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
//solution2("...xxx..x....xxx.", 7); | |
//solution("aaAbcCABBc"); | |
static int solution2(string S, int B) | |
{ | |
if (B < 2 || S.Length == 0) | |
return 0; | |
var potholes = new List<int>(); | |
var count = 1; |
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.Buffers; | |
using System.IO.Pipelines; | |
using System.Runtime.CompilerServices; | |
using U8; | |
using U8.InteropServices; | |
namespace _1brc | |
{ | |
internal class U8File | |
{ |
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; | |
using System.Buffers.Binary; | |
using System.Buffers.Text; | |
using System.Diagnostics; | |
using System.Diagnostics.CodeAnalysis; | |
using System.Text; | |
using System.Threading.Channels; | |
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 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 |