Skip to content

Instantly share code, notes, and snippets.

View itn3000's full-sized avatar
🤔
🤔🤔🤔🤔🤔🤔

Yusuke Ito itn3000

🤔
🤔🤔🤔🤔🤔🤔
View GitHub Profile
@itn3000
itn3000 / splitstrtest.cs
Last active May 29, 2023 08:38
split string test
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))
{
@itn3000
itn3000 / redblack_chatgptgenerated.cs
Created March 17, 2023 05:07
redblack tree code
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; }
}
@itn3000
itn3000 / Cargo.toml
Created October 26, 2022 02:55
rust tokio with cancellation token loop test
[package]
name = "tokiotest"
version = "0.1.0"
authors = ["itn3000"]
edition = "2018"
[dependencies]
tokio = { version = "1.21",features = [
"rt",
"rt-multi-thread",
@itn3000
itn3000 / ConcurrentDicitionaryKeyTypeBench.cs
Created June 2, 2022 02:44
ConcurrentDictionary.TryGetValue comparison by key types.
// This benchmark use one record and TryGetValue returns true.
// Results will be affected by record num and whether match any record or not.
using System.Collections.Concurrent;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Running;
BenchmarkRunner.Run<ConcurrentDictionaryBench>();
record C1(string a, int b, string c);
@itn3000
itn3000 / cmake-memo-ja.md
Last active April 19, 2022 00:09
cmake memo in Japanese
  • 静的リンクしたい場合は-DCMAKE_DEFAULT_CMP0091=NEW "-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded$<$<CONFIG:Debug>:Debug>"とする
    • cmake-3.15以降
  • ビルド出力先の指定は-B、ソース指定は-S
  • VSの場合、ターゲットアーキテクチャを-Aオプションで指定する(x64,Win32)
  • VSの場合、リリースビルドしたいときは--config Release
@itn3000
itn3000 / how-to-create-server-client-cert.md
Last active February 28, 2025 04:24
how to create root,server,client certificate by openssl
@itn3000
itn3000 / FasterLogWithFastCommitMode.cs
Last active April 14, 2022 02:20
Exception in iterating FasterLog with FastCommitMode=true
using FASTER.core;
// ensure log directory is empty.
if (Directory.Exists("abc"))
{
Directory.Delete("abc", true);
}
using var fl = new FasterLog(new FasterLogSettings("abc")
{
@itn3000
itn3000 / ReturnClientCertificateThumbprint-description.md
Last active April 17, 2022 18:52
investigation of discarding client certificate problem on IIS

Steps to reproduce

Environment

  • Windows Server 2022 for server
  • ubuntu-20.04 with curl for HTTP client

setup

  1. creating self signed CA certificate using openssl and import to server root CA
@itn3000
itn3000 / github-actions-release.yml
Last active April 6, 2022 07:00
github actions release event type sandbox
# This is a basic workflow to help you get started with Actions
name: CI
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the master branch
release:
types:
- published
@itn3000
itn3000 / NuGetVersionParseTest.cs
Last active April 1, 2022 15:02
nuget semver2 parse test
// dotnet add package NuGet.Versioning --version 6.1.0
using System;
using System.Reflection;
using NuGet.Versioning;
namespace nugetclienttest
{
class Program
{
static void OutputVersion(NuGetVersion v)