Skip to content

Instantly share code, notes, and snippets.

View Elsensee's full-sized avatar

Oliver S. Elsensee

  • Hamburg, Germany
View GitHub Profile
@quietlynn
quietlynn / PiCalculator.cs
Created March 13, 2012 13:07
A simple PI calculator in C#.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Numerics;
namespace PiCalculator
{
public class PiCalculator
{
@jboner
jboner / latency.txt
Last active November 19, 2024 14:58
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
using System;
using System.Collections.Generic;
using System.Linq;
using System.Numerics;
using System.Text;
using System.Threading.Tasks;
namespace PrintPI
{
class Program
@Elsensee
Elsensee / LocalizationManager.cs
Created March 5, 2014 16:36
A localization manager for .NET written in C# without use of satellite assemblys but only txt-files.
/*
* Copyright (c) 2014 Oliver Schramm
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
@Treeki
Treeki / TurnipPrices.cpp
Last active November 1, 2024 14:15
AC:NH turnip price calculator
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
// munged from https://github.com/simontime/Resead
namespace sead
{
class Random
{