This file contains 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
module Program | |
open System.Collections.Generic | |
open BenchmarkDotNet.Attributes | |
open BenchmarkDotNet.Running | |
[<SimpleJob(launchCount = 3, warmupCount = 3, targetCount = 5)>] | |
[<GcServer(true)>] | |
[<MemoryDiagnoser>] | |
[<MarkdownExporterAttribute.GitHub>] |
This file contains 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
internal static class Program | |
{ | |
[DllImport("Kernel32.dll")] | |
private static extern bool QueryPerformanceFrequency(out long lpFrequency); | |
[DllImport("Kernel32.dll")] | |
private static extern bool QueryPerformanceCounter(out long lpPerformanceCount); | |
private static void Main(string[] args) | |
{ | |
long frequency, start, stop; |
This file contains 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 UntypedOrderBy | |
{ | |
private static readonly ConcurrentDictionary<(Type, string), Delegate> Lambdas = new ConcurrentDictionary<(Type, string), Delegate>(); | |
public static IEnumerable<TType> OrderyByProperty<TType>(this IEnumerable<TType> collection, string name) | |
{ | |
var lambda = Lambdas.GetOrAdd((typeof(TType), name), key => | |
{ | |
ParameterExpression entity = Expression.Parameter(typeof(TType)); | |
MethodCallExpression getterCall = |
This file contains 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 temp = new StringBuilder().Append("inter").Append("ned"); | |
string internedString1 = temp.ToString(); | |
string internedString2 = temp.ToString(); | |
Console.WriteLine($"Interned? {nameof(internedString1)}: {String.IsInterned(internedString1) != null}"); | |
Console.WriteLine($"Interned?: {nameof(internedString2)} {String.IsInterned(internedString2) != null}"); | |
String.Intern(internedString1); | |
Console.WriteLine($"Interned? {nameof(internedString1)}: {String.IsInterned(internedString1) != null}"); |
This file contains 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
# | |
# Dockerfile for shadowsocks-libev | |
# | |
FROM alpine | |
MAINTAINER longkai <[email protected]> | |
ENV SERVER_ADDR 0.0.0.0 | |
ENV SERVER_PORT 8388 | |
ENV PASSWORD= |
This file contains 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
/*подключить можно через Stylish для хрома с указанием доменов habrahabr.ru и geektimes.ru */ | |
body { | |
font-family: sans-serif; /* Заменяет "system stack fonts" на обычный sans-serif. По крайней мере на вин10 это стало более читаемым */ | |
} | |
.comment > .comment__message, .post__text-html{ | |
line-height: 150%; /* 1.6 -> 1.5 */ | |
} |
This file contains 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
Total time: 00:03:10 (190.47 sec) | |
// * Summary * | |
BenchmarkDotNet=v0.10.9, OS=Windows 10 Redstone 2 (10.0.15063) | |
Processor=Intel Core i5-4670 CPU 3.40GHz (Haswell), ProcessorCount=4 | |
Frequency=3320320 Hz, Resolution=301.1758 ns, Timer=TSC | |
[Host] : .NET Framework 4.7 (CLR 4.0.30319.42000), 32bit LegacyJIT-v4.7.2101.1 | |
DefaultJob : .NET Framework 4.7 (CLR 4.0.30319.42000), 32bit LegacyJIT-v4.7.2101.1 |