Skip to content

Instantly share code, notes, and snippets.

warp! Help, I'm trapped in a time

Martin Ankerl martinus

warp! Help, I'm trapped in a time
Block or report user

Report or block martinus

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
martinus / benchmark2.cpp
Created Jul 27, 2019
simple benchmark of robin_hood map, updated
View benchmark2.cpp
#include <iostream>
#include <string>
#include <chrono>
#include <unordered_map>
#include "tsl/robin_map.h"
#include "robin_hood.h"
using my_clock = std::chrono::high_resolution_clock;
martinus / benchmark.cpp
Created Jul 25, 2019
simple benchmark of tsl, robin_hood, and std::unordered_map
View benchmark.cpp
#include <iostream>
#include <string>
#include <chrono>
#include <unordered_map>
#include "tsl/robin_map.h"
#include "robin_hood.h"
using namespace std;
using my_clock = std::chrono::high_resolution_clock;
martinus / random_bool_benchmark.cpp
Last active Mar 3, 2019
fast random bool in C++
View random_bool_benchmark.cpp
#include <algorithm>
#include <chrono>
#include <iostream>
#include <random>
#define LIKELY(x) __builtin_expect((x), 1)
#define UNLIKELY(x) __builtin_expect((x), 0)
#define NO_INLINE __attribute__((noinline))
// extremely fast random number generator that also produces very high quality random.
martinus / .bashrc
Created May 4, 2018
awesome bash prompt
View .bashrc
function prompt_timer_start {
echo -ne "\033]0;${@}\007"
function prompt_svn_stats() {
command -v svn >/dev/null
if [ $? != 0 ]; then
martinus / DifferentialEvolution.cpp
Created Sep 22, 2014
Differential Evolution - Sample Code
View DifferentialEvolution.cpp
/* Example adapted from
* This implements the DE/rand/1/bin optimization algorithm.
/* Initialize individuals */
for (i=0; i<NP; i++) {
/* randomly initialize all individuals */
for (j=0; j<D; j++) {
View gist:250192d3350c4b11756a
Verifying that +martinus is my Bitcoin username. You can send me #bitcoin here:
martinus / xy.gnuplot
Created May 2, 2014
Bitcoin Balance over Time of Last Transaction - Gnuplot to produce a graph like this:
View xy.gnuplot
#set term pngcairo size 1920,1080 enhanced font 'Verdana,10'
set term pngcairo size 3840,2160 enhanced font 'Verdana,10'
set title 'Bitcoin Balance over Time of Last Transaction'
set xlabel 'Last Transaction [Time]'
set ylabel 'Amount [BTC]'
set output 'xy.png'
set logscale y
set xdata time
set timefmt "%s"
set format x "%Y-%m-%d"
View marsagliamwc99.hpp
#pragma once
/// MarsagliaMWC99 is a simple random number generator based on
/// George Marsaglia's MWC (multiply with carry) generator.
/// Although it is very simple, it passes Marsaglia's DIEHARD
/// series of random number generator tests. It is exceptionally fast.
/// @see
/// @see
/// @see
View trie.rb
class TrieNode
def initialize
@sub_tries = {}
@end_of_word = false
def insert(input)
to_insert = input
You can’t perform that action at this time.