Skip to content

Instantly share code, notes, and snippets.

@realazthat
realazthat / cube.hpp
Last active August 29, 2015 14:07
A cube/corner/face library for reasoning about cubes.
/*
Copyright (c) 2012 Azriel Fasten azriel.fasten@gmail.com
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
/*
Copyright (c) 2012 Azriel Fasten azriel.fasten@gmail.com
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
@realazthat
realazthat / list.1.dot
Created January 26, 2015 18:20
dot graphs for "Maintaining an efficient ordering where you can insert elements “in between” any two other elements in the ordering?" at http://cs.stackexchange.com/a/14710/2755
#step 1
digraph list{
{rank=same;
D1[style=invis,shape=point];
D1[style=invis];
}
{rank=same;
D[dir=back];
@realazthat
realazthat / common.py
Last active August 29, 2015 14:20
spider for files of a certain extension
import yaml
import argparse
from attrdict import AttrDict
#from check_config import check_config
def check_config(config,partial=False):
pass
@realazthat
realazthat / klee example
Created June 26, 2011 15:04
klee example
int main()
{
int a;
klee_make_symbolic(&a, sizeof(a));
if(a==5)
return 1;
return 0;
}
@realazthat
realazthat / gist:2415094
Created April 18, 2012 17:08
cpu timer
struct cputimer
{
cputimer(const std::string& name)
: name(name)
{
}
~cputimer()
{
{
"units":
[
"Botan-1.10.3/src/algo_base/symkey.cpp",
"Botan-1.10.3/src/algo_factory/algo_factory.cpp",
"Botan-1.10.3/src/algo_factory/prov_weight.cpp",
"Botan-1.10.3/src/alloc/alloc_mmap/mmap_mem.cpp",
"Botan-1.10.3/src/alloc/mem_pool/mem_pool.cpp",
"Botan-1.10.3/src/alloc/system_alloc/defalloc.cpp",
"Botan-1.10.3/src/asn1/alg_id.cpp",

Inline-style: alt text

Um, why isn't this rendering.

@realazthat
realazthat / adventofcode.day3.part1.py
Last active December 4, 2015 17:54
adventofcode.day3
import collections
class Santa:
def __init__(self):
self.coord = [0,0];
self.visits = collections.defaultdict(int)
@realazthat
realazthat / adventofcode.day1.part1.py
Last active December 7, 2015 20:10
adventofcode.day1
class Elevator:
def __init__(self):
self.floor = 0
def advance(self, symbol):
assert symbol in ['(', ')']
if symbol == '(':