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.Services.AddHttpClient(); | |
builder.Services.AddSingleton<ICertificateProvider, CertificateProvider>(); | |
builder.Services.AddSingleton<IPostConfigureOptions<HttpClientFactoryOptions>, ConfigureHttpClientFactory>(); | |
var app = builder.Build(); | |
var factory = app.Services.GetRequiredService<IHttpClientFactory>(); | |
app.MapGet("/{clientId}", async (string clientId) => |
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
1. Create c:\1.restore.json | |
2. msbuild c:\1.csproj -target:GenerateRestoreGraphFile -property:RestoreGraphOutputPath="c:\1.restore.json" -property:RestoreRecursive=false -property:RestoreDotnetCliToolReferences=false | |
3. dotnet nuget package add --package Litedb c:\\1.csproj --dg-file c:\1.restore.json |
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; | |
// define BowlingGame Class in a new file | |
// define Frame Class in a new file | |
class MainClass | |
{ | |
static void Main() |
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
static class RSAParametersHelper | |
{ | |
public static RSAParameters FromPem(string pem) | |
{ | |
using var rsa = new RsaPem(); | |
rsa.ImportFromPem(pem); | |
return rsa.ExportParameters(); | |
} | |
class RsaPem : RSA |
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 class Container | |
{ | |
private SortedDictionary<int, int> _storage = new(); | |
private int _count = 0; | |
public Container() | |
{ | |
// write your code here | |
} |
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; | |
using Microsoft.Extensions.DependencyInjection.Extensions; | |
using Microsoft.Extensions.Options; | |
public class Programm | |
{ | |
static int _idCounter = 0; | |
interface IService |
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; | |
using Microsoft.Extensions.Options; | |
var services = new ServiceCollection(); | |
services.AddSingleton<RootService>(); | |
services.AddSingleton<IService, RootService>(); | |
PluginImplementation.Configure(services); | |
using var rootSp = services.BuildServiceProvider(); | |
var pluginRegistration = rootSp.GetRequiredService<IOptionsMonitor<PluginRegistration>>() |
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"; |
NewerOlder