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.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 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
| // <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; |
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:x="http://schemas.microsoft.com/winfx/2006/xaml" | |
| xmlns:zones="clr-namespace:LostTech.Stack.Zones;assembly=Stack" | |
| xmlns:system="clr-namespace:System;assembly=mscorlib" | |
| mc:Ignorable="d" | |
| zones:Layout.Version="2" | |
| 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
| <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:x="http://schemas.microsoft.com/winfx/2006/xaml" | |
| xmlns:zones="clr-namespace:LostTech.Stack.Zones;assembly=Stack" | |
| mc:Ignorable="d" | |
| Width="1024" Height="576" | |
| d:DesignWidth="1024" | |
| d:DesignHeight="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
| <zones:Zone.Style> | |
| <Style> | |
| <Style.Triggers> | |
| <DataTrigger Binding="{Binding IsChecked, ElementName=StackLeftSide}" Value="True"> | |
| <Setter Property="zones:Zone.Layout"> | |
| <Setter.Value> | |
| <ItemsPanelTemplate> | |
| <UniformGrid Columns="1" /> | |
| </ItemsPanelTemplate> | |
| </Setter.Value> |
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
| <zones:Zone.Style> | |
| <Style> | |
| <Style.Triggers> | |
| <DataTrigger Binding="{Binding IsChecked, ElementName=StackLeftSide}" Value="True"> | |
| <Setter Property="zones:Zone.Layout"> | |
| <Setter.Value> | |
| <ItemsPanelTemplate> | |
| <UniformGrid Columns="1" /> | |
| </ItemsPanelTemplate> | |
| </Setter.Value> |
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 MyList(list): | |
| ... def __getitem__(self, idx): | |
| ... print('hello') | |
| ... return super().__getitem__(idx) | |
| ... | |
| >>> l = MyList() | |
| >>> l.append(42) | |
| >>> l[0] | |
| hello | |
| 42 |
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 List: | |
| def add(self, item): ... | |
| class ListMixin: | |
| def append(self, item): return self.add(item) | |
| def mix_in(target_type, mixin): | |
| ??? | |
| mix_in(List, ListMixin) |
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
| namespace Inline_vs_Static_Readonly | |
| { | |
| using System; | |
| using BenchmarkDotNet.Attributes; | |
| using BenchmarkDotNet.Jobs; | |
| using BenchmarkDotNet.Running; | |
| [SimpleJob(RuntimeMoniker.Net48)] | |
| [SimpleJob(RuntimeMoniker.Mono)] | |
| [SimpleJob(RuntimeMoniker.NetCoreApp31)] | |
| public class InlineOrStaticReadonly |
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 Python.Runtime; | |
| class MyNonGenericTree | |
| { | |
| } | |
| PyTypeConversion<MyNonGenericTree>.Converter = tree => ...; | |
| class MyTree<T> | |
| { |