This file contains 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 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 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 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 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 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 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 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="*"/> |
This file contains 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.Diagnostics; | |
using System.Runtime.InteropServices; | |
using System.Runtime.Serialization; | |
using System.Runtime.Serialization.Formatters.Binary; | |
unsafe { | |
IntPtr resource1 = Marshal.AllocHGlobal(sizeof(FakeUnmanagedRefcountedObject)); | |
*(FakeUnmanagedRefcountedObject*)resource1 = default; // zero memory | |
var i1 = new UnmanagedRefcountWrapper(resource1); | |
i1.Value = 10; |
This file contains 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
// <PackageReference Include="ILGPU" Version="1.0.0-beta3" /> | |
// <PackageReference Include="TypeNum" Version="0.2.0-CI-20210909-064812" /> | |
using System.Runtime.InteropServices; | |
using ILGPU; | |
using ILGPU.Runtime; | |
using ILGPU.Runtime.CPU; | |
using TypeNum; |