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.IO; | |
using System.Text; | |
using System.Text.Json; | |
// need System.Text.Json 9.0 or later | |
namespace jsonserializertest | |
{ | |
class Program |
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; | |
namespace a | |
{ | |
public class Class1 | |
{ | |
public static void X() | |
{ | |
dynamic x = GetDynamic(); | |
// CS0173 with .NET SDK 8.0.300pre3 and netstandard2.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.Diagnostics; | |
using System.Text; | |
using Azure.Core.Pipeline; | |
using Garnet; | |
using Garnet.client; | |
using Garnet.server; | |
using Microsoft.Extensions.DependencyInjection; | |
using Microsoft.Extensions.Logging; | |
using Microsoft.Extensions.Logging.Console; |
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 Stride.Engine; | |
using Stride.Input; | |
using R3; | |
namespace RetrieveInputKeyEventWithR3; | |
public class RetriveKeyEventScript: StartupScript | |
{ | |
public override Start() |
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 NATS.Client.Core; | |
using R3; | |
using System.Diagnostics; | |
await using var con = new NatsConnection(); | |
await using var subscription = await con.SubscribeCoreAsync<string>("hoge"); | |
using var cts = new CancellationTokenSource(); | |
{ | |
using var _ = Observable.CreateFrom<NatsMsg<string>, INatsSub<string>>(subscription, Generator) |
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 R3; | |
var a = new A(); | |
using var x1 = Observable.FromEvent<A.PiyoHandler, int>(h => new A.PiyoHandler(h), h => a.PiyoEvent += h, h => a.PiyoEvent -= h) | |
.Subscribe(x => Console.WriteLine($"piyo: {x}")); | |
using var x2 = Observable.FromEventHandler<int>(h => a.MogeEvent += h, h => a.MogeEvent -= h) | |
.Subscribe(x => Console.WriteLine($"moge: {x}")); | |
using var x3 = Observable.FromEvent<A.HogeHandler, (object?, int)>(h => new A.HogeHandler((sender, arg) => h((sender, arg))), h => a.HogeEvent += h, h => a.HogeEvent -= h) | |
.Subscribe(x => Console.WriteLine($"hoge: {x}")); | |
// See https://aka.ms/new-console-template for more information |
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
FROM mono:6.12 | |
COPY zstdtest /zstdtest | |
CMD ["mono","/zstdtest/zstdtest.exe"] |
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.Threading.Tasks; | |
using System.Threading; | |
using System.Linq; | |
using System; | |
await ThreadIdTest(100, 100); | |
async Task ThreadIdTest(int minThreads, int minCompletionNum) | |
{ | |
ThreadPool.GetMinThreads(out var currentMinThreads, out var currentCompletionNum); |
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.Text; | |
// space(U+0020),tab(U+0009),fullwidth space(U+3000),linefeed(U+000a) | |
var str = "a b\tc d\n"; | |
foreach(var x in str.Split(' ')) | |
{ | |
Console.WriteLine($"a: '{x}'"); | |
} | |
foreach(var x in str.Split(null)) | |
{ |
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; | |
public class RedBlackNode<T> where T : IComparable<T> | |
{ | |
public T Data { get; set; } | |
public RedBlackNode<T> Left { get; set; } | |
public RedBlackNode<T> Right { get; set; } | |
public bool IsRed { get; set; } | |
} |
NewerOlder