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
// See https://aka.ms/new-console-template for more information | |
using System.Buffers.Binary; | |
using System.Buffers.Text; | |
using System.Diagnostics; | |
using System.Diagnostics.CodeAnalysis; | |
using System.Text; | |
var filePath = @"C:\projects\local\1brc-main\measurements.txt"; | |
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
// See https://aka.ms/new-console-template for more information | |
using Microsoft.Extensions.Configuration; | |
using Microsoft.Extensions.DependencyInjection; | |
using Microsoft.Extensions.Hosting; | |
var builder = Host.CreateApplicationBuilder(args); | |
builder.Services.AddSingleton<Service>(); |
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
// See https://aka.ms/new-console-template for more information | |
using System.Buffers.Binary; | |
var data = new byte[] { | |
100, | |
100,100,10,10, | |
11,11,11,11, | |
12,00, | |
4, | |
4, |
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
// See https://aka.ms/new-console-template for more information | |
using System.Diagnostics; | |
using System.Runtime.InteropServices; | |
while (true) | |
{ | |
var process = Process.GetCurrentProcess(); | |
ulong cohost = 0; | |
int status; | |
status = NtQueryInformationProcess(process.Handle, 0x31, ref cohost, Marshal.SizeOf(typeof(ulong)), out _); // cohost |
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; | |
while (true) | |
{ | |
var pbi = new ParentProcessUtilities(); | |
var process = Process.GetCurrentProcess(); | |
int status; | |
while (true) | |
{ |
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.Collections.Generic; | |
using System.Linq; | |
using System.Net.Mail; | |
using System.Reflection; | |
using System.Runtime.CompilerServices; | |
using System.Text.RegularExpressions; | |
var data = new Bar(1, new Foo(2)); | |
var d = new Derive_SumEverything<Bar>(); |
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.Security.Cryptography; | |
using System; | |
using System.Text.Json; | |
using System.Text.Json.Serialization.Metadata; | |
var a = new A { ModeA = "A", ModeB = "B" }; | |
JsonSerializerOptions optionsA = new() | |
{ | |
TypeInfoResolver = new DefaultJsonTypeInfoResolver |
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
// See https://aka.ms/new-console-template for more information | |
using BenchmarkDotNet.Attributes; | |
using BenchmarkDotNet.Running; | |
using System.Runtime.CompilerServices; | |
using System.Runtime.InteropServices; | |
BenchmarkRunner.Run<Benchmarks>(); | |
public class Benchmarks | |
{ |
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.AspNetCore.TestHost; | |
var builder = WebApplication.CreateBuilder(args); | |
builder.WebHost.UseTestServer(); | |
var app = builder.Build(); | |
var group = app.MapGroup("/"); | |
group.AddEndpointFilter(async (efiContext, next) => | |
{ | |
var result = await next(efiContext); |
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 ServiceCollectionExtensions | |
{ | |
internal static readonly string ModulesKey = "Modules"; | |
public static IServiceCollection AddModules(this IServiceCollection serviceCollection, HostBuilderContext builderContext) | |
{ | |
var modulesSection = builderContext.Configuration.GetSection(ModulesKey); | |
foreach (var moduleName in modulesSection.GetChildren()) | |
{ | |
var type = Type.GetType(moduleName.Value, true, false); |