This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var swapChainDescription = new SwapChainDescription | |
| { | |
| BufferCount = 2, | |
| Flags = SwapChainFlags.None, | |
| IsWindowed = true, | |
| ModeDescription = new ModeDescription(form.ClientSize.Width, form.ClientSize.Height, refreshRate: new Rational(60, 1), Format.B8G8R8A8_UNorm), | |
| OutputHandle = form.Handle, | |
| SampleDescription = new SampleDescription(count: 1, quality: 0), | |
| SwapEffect = SwapEffect.Discard, | |
| Usage = Usage.RenderTargetOutput |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class PseudoLinear(nn.Module): | |
| def __init__(self, features, device=None): | |
| super().__init__() | |
| self.weight = nn.Parameter(torch.randn(features, device=device)) | |
| self.bias = nn.Parameter(torch.randn(features, device=device)) | |
| def forward(self, x): | |
| return x * self.weight + self.bias + x | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!-- | |
| xmlns:dataSources="clr-namespace:LostTech.Stack.Widgets.DataSources;assembly=LostTech.Stack.Widgets" | |
| --> | |
| <dataSources:CommandLineDataSource x:Key="RemoteCall" | |
| dataSources:DataSource.RefreshInterval="0:0:10"> | |
| <dataSources:CommandLineValueSource Program="ssh"> | |
| <dataSources:CommandLineValueSource.Arguments> | |
| <x:String>-T</x:String> | |
| <x:String>remote.pc.name.local</x:String> | |
| <x:String>nvidia-smi</x:String> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!-- | |
| xmlns:stack="https://schemas.losttech.software/stack/2022/xaml/all" | |
| --> | |
| <zones:Zone> | |
| <stack:AutoCapture.CaptureFilters> | |
| <stack:CaptureFilter> | |
| <filters:ProcessName Value="HxOutlook"/> <!-- Windows Mail App --> | |
| <filters:ProcessName Value="WindowsTerminal"/> <!-- The new Windows Terminal app --> | |
| <filters:Title Value="Google Voice - Voice"/> | |
| <filters:Title Value="Messenger" Match="Exact"/> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!-- | |
| xmlns:binding="clr-namespace:LostTech.Stack.Widgets.DataBinding;assembly=LostTech.Stack.Widgets" | |
| xmlns:dataSources="clr-namespace:LostTech.Stack.Widgets.DataSources;assembly=LostTech.Stack.Widgets" | |
| --> | |
| <StackPanel Orientation="Horizontal"> | |
| <StackPanel.Resources> | |
| <dataSources:WebDataSource x:Key="Weather" | |
| Url="https://api.openweathermap.org/data/2.5/weather?lat=YOUR_LAT&lon=YOUR_LON&units=metric&appid=PUT_YOUR_OWN_HERE" | |
| dataSources:DataSource.RefreshInterval="0:15:0" /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Runtime.InteropServices; | |
| using static PInvoke.Kernel32; | |
| // usage: new Job().AddProcess(new SafeObjectHandle(win32childProcessHandle, ownsHandle: false); | |
| // might need to keep Job instance alive | |
| public class Job : IDisposable | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import torch | |
| from torch import device as Device | |
| from torch.utils.data import IterableDataset | |
| from typing import Optional | |
| MS_IN_SECOND = 1000 | |
| MS_IN_MINUTE = 60 * MS_IN_SECOND | |
| MS_IN_HOUR = 60 * MS_IN_MINUTE | |
| MS_IN_DAY = 24 * MS_IN_HOUR | |
| MS_IN_YEAR = 365 * MS_IN_DAY |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <Grid | |
| xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
| xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | |
| xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | |
| xmlns:sys="clr-namespace:System;assembly=mscorlib" | |
| xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |
| xmlns:zones="clr-namespace:LostTech.Stack.Zones;assembly=Stack" | |
| zones:Layout.Version="2" | |
| mc:Ignorable="d" | |
| Width="1024" Height="576" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| Func<int, int, int> addImpl = (a, b) => a + b; | |
| var add = Infix.Create(addImpl); | |
| Console.WriteLine(41 |add| 1); | |
| public class Infix<T1, T2, TResult> { | |
| public Func<T1, T2, TResult> Op; | |
| public static Infix<T2, TResult> operator | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <Grid | |
| xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
| xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |
| xmlns:filters="clr-namespace:LostTech.Stack.Extensibility.Filters;assembly=LostTech.Stack.Extensibility" | |
| xmlns:stack="https://schemas.losttech.software/stack/2022/xaml/all" | |
| stack:Layout.Version="2" | |
| > | |
| <Grid.RowDefinitions> | |
| <RowDefinition Height="Auto"/> | |
| <RowDefinition Height="*"/> |