Skip to content

Instantly share code, notes, and snippets.

View grahamwren's full-sized avatar

Graham Wren grahamwren

View GitHub Profile
#!/usr/bin/env ruby
require 'csv'
require 'set'
require 'bigdecimal'
require 'pg'
require 'optparse'
require 'logger'
require 'json'
#!/usr/bin/env bash
bucket=$1
mkdir -p /tmp/buckets
W_DIR=/tmp/buckets/$bucket
# pull down the bucket into the working dir
aws s3 sync s3://$bucket $W_DIR
#pragma once
#include <algorithm>
#include <list>
#include <memory>
#include <unordered_map>
using namespace std;
template <typename K, typename V, int cache_size = 32> class LRUCache {
LENGTH=100000000
bench: test_boxing.exe
echo "System: $$(uname -a)" > results.log
for i in {0..10}; do (echo "run $$i"; ./test_boxing.exe) >> results.log; done
test_boxing.exe: test_boxing.cpp
g++ -O0 --std=c++11 -DLENGTH=$(LENGTH) test_boxing.cpp -o test_boxing.exe
@grahamwren
grahamwren / Makefile
Last active April 14, 2020 18:00
Cpp Const Pointer Demo
run: test_const_pointers.o
./test_const_pointers.o
test_const_pointers.o: test_const_pointers.cpp
g++ test_const_pointers.cpp -o test_const_pointers.o -std=c++11
clean:
rm *.o
@grahamwren
grahamwren / Cargo.toml
Last active March 29, 2019 16:17
Quickselect in Rust
[package]
name = "quickselect"
version = "1.0.0"
authors = ["Graham Wren <[email protected]>"]
publish = false
[lib]
name="quickselect"
path="./quickselect.rs"