Skip to content

Instantly share code, notes, and snippets.

View AndreyAkinshin's full-sized avatar

Andrey Akinshin AndreyAkinshin

View GitHub Profile
@AndreyAkinshin
AndreyAkinshin / DEV Labs 2015 - Учимся замерять время правильно.md
Last active June 28, 2022 19:09
DEV Labs 2015 - Учимся замерять время правильно

Введение

  • Главный вопрос: что и зачем вы измеряете?
  • Используйте библиотеки для бенчмаркинга: JMH, BenchmarkDotNet

Как правильно запускать бенчмарк

  • Release build
  • Без дебаггера
  • Выключите другие приложения
@AndreyAkinshin
AndreyAkinshin / PrivateBaseClassConstructorInheritance.cs
Last active July 29, 2016 08:31
Create derived class for base class with private constructor
using System;
using System.Runtime.InteropServices;
class Program
{
public class Base
{
private Base()
{
}
@AndreyAkinshin
AndreyAkinshin / JitVersionInfo.cs
Last active September 7, 2015 15:30
Determination JIT version in runtime
public enum JitVersion
{
Mono, MsX86, MsX64, RyuJit
}
public class JitVersionInfo
{
public JitVersion GetJitVersion()
{
if (IsMono())
@AndreyAkinshin
AndreyAkinshin / fips-download-template.py
Last active August 29, 2015 14:11
Template for fips bulletin downloading
# Main link: http://www1.fips.ru/wps/wcm/connect/content_ru/ru/ofic_pub/ofic_bul/ofic_bul_prevm
# pdf->txt converter: pdfminer, https://pypi.python.org/pypi/pdfminer/
import urllib, os
def get_link(year, month, number):
link = "http://www1.fips.ru/Archive/EVM/" + \
str(year) + "/" + str(year) + "." + str(month).zfill(2) + ".20" + \
"/DOC/RUNW/000/00" + str(year)[0:1] + "/" + str(year)[1:4].zfill(3) + "/" + \
str(number)[0:3].zfill(3) + "/" + str(number)[3:6].zfill(3) + "/document.pdf"