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
public static class ReactiveSignalR | |
{ | |
public static IObservable<T> CreateObservable<T>(string uri, string methodName, TimeSpan retryInterval) | |
{ | |
return Observable.Create<T>(observer => | |
{ | |
var connection = new HubConnectionBuilder() | |
.WithUrl(uri) | |
.WithAutomaticReconnect(new FixedIntervalRetryPolicy(retryInterval)) | |
.Build(); |
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 Microsoft.ML; | |
using Microsoft.ML.Data; | |
using Microsoft.ML.Trainers; | |
using SkiaSharp; | |
public record ColorCount( | |
byte R, | |
byte G, | |
byte B, |
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 Microsoft.ML.OnnxRuntime; | |
using Microsoft.ML.OnnxRuntime.Tensors; | |
using SkiaSharp; | |
public record DetectResult( | |
float Left, | |
float Top, | |
float Right, | |
float Bottom, |
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
public static class IncrementalGeneratorInitializationContextExtensions | |
{ | |
public static IncrementalValuesProvider<T> ForAttributeWithMetadataNameWithOptions<T>( | |
this IncrementalGeneratorInitializationContext context, | |
string fullyQualifiedMetadataName, | |
Func<SyntaxNode, CancellationToken, bool> predicate, | |
Func<GeneratorAttributeSyntaxContext, AnalyzerConfigOptions, CancellationToken, T> transform) | |
{ | |
var syntaxContext = context.SyntaxProvider.ForAttributeWithMetadataName( | |
fullyQualifiedMetadataName, |
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 Microsoft.Extensions.DependencyInjection; | |
public sealed class KeyedServiceProxy<T> | |
where T : notnull | |
{ | |
private readonly IServiceProvider serviceProvider; | |
public KeyedServiceProxy(IServiceProvider serviceProvider) | |
{ | |
this.serviceProvider = serviceProvider; |
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
Directory.SetCurrentDirectory(AppContext.BaseDirectory); | |
var host = Host.CreateDefaultBuilder(args) | |
.UseWindowsService() | |
.UseSystemd() | |
.ConfigureLogging(config => | |
{ | |
config.ClearProviders(); | |
}) | |
.ConfigureServices((context, services) => |
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 CallBenchmark; | |
using BenchmarkDotNet.Attributes; | |
using BenchmarkDotNet.Columns; | |
using BenchmarkDotNet.Configs; | |
using BenchmarkDotNet.Diagnosers; | |
using BenchmarkDotNet.Exporters; | |
using BenchmarkDotNet.Jobs; | |
using BenchmarkDotNet.Running; |
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 builder = WebApplication.CreateBuilder(args); | |
builder.WebHost.UseKestrel(options => | |
{ | |
options.ListenLocalhost(9999, config => | |
{ | |
config.UseConnectionHandler<MyConnectionHandler>(); | |
}); | |
}); | |
var app = builder.Build(); |
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
<Project Sdk="Microsoft.NET.Sdk"> | |
<PropertyGroup> | |
<OutputType>Exe</OutputType> | |
<TargetFramework>net7.0</TargetFramework> | |
<ImplicitUsings>enable</ImplicitUsings> | |
<Nullable>enable</Nullable> | |
</PropertyGroup> | |
<ItemGroup> |
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
public static class HexEncoder | |
{ | |
private static ReadOnlySpan<byte> HexTable => new[] | |
{ | |
(byte)'0', (byte)'1', (byte)'2', (byte)'3', | |
(byte)'4', (byte)'5', (byte)'6', (byte)'7', | |
(byte)'8', (byte)'9', (byte)'A', (byte)'B', | |
(byte)'C', (byte)'D', (byte)'E', (byte)'F' | |
}; |
NewerOlder