Skip to content

Instantly share code, notes, and snippets.

View kespindler's full-sized avatar

Kurt Spindler kespindler

View GitHub Profile
[package]
name = "qrgen"
version = "0.1.0"
authors = ["kurt spindler <kespindler@gmail.com>"]
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
tide = "0.5.1"
"""
ipython3 -i run.py
"""
import numpy as np
N_candidates = 5
def general_votes(candidate_R, candidate_D):
"""If candidate_R and candidate_D were the winners of the
@kespindler
kespindler / setup.sh
Created February 9, 2014 01:00
Benchmark EC2 GPU instances with Pylearn2 deep learning on MNIST dataset
sudo apt-get -y update
sudo apt-get -y upgrade
sudo apt-get -y dist-upgrade
sudo apt-get -y install git make python-dev python-setuptools libblas-dev gfortran g++ python-pip python-numpy python-scipy liblapack-dev
sudo pip install ipython nose
sudo apt-get install screen
sudo pip install --upgrade git+git://github.com/Theano/Theano.git
wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1204/x86_64/cuda-repo-ubuntu1204_5.5-0_amd64.deb
sudo dpkg -i cuda-repo-ubuntu1204_5.5-0_amd64.deb
sudo apt-get update
@kespindler
kespindler / monkeypatch.py
Created January 11, 2014 17:06
Monkey-patching logging
import logging
def getMessage(self):
"""
Return the message for this LogRecord.
Return the message for this LogRecord after merging any user-supplied
arguments with the message.
"""
if not logging._unicode: #if no unicode support...
msg = str(self.msg)
@kespindler
kespindler / gist:4255446
Created December 11, 2012 02:35
gitconfig
[diff]
tool = vimdiff
[difftool "mvim"]
cmd = mvim -d $LOCAL $REMOTE
keepbackup = false
[alias]
dt = difftool
st = status
cm = commit
br = branch
@kespindler
kespindler / gist:4254467
Created December 10, 2012 23:52
swap keyboard linux
! Swap caps lock and escape
remove Lock = Caps_Lock
keysym Escape = Caps_Lock
keysym Caps_Lock = Escape
add Lock = Caps_Lock
! $ xmodmap ~/.speedswapper
@kespindler
kespindler / gist:3005323
Created June 27, 2012 16:45
log memory of iphone simulator
while true; do top -l1 | grep iPhone\ Simulator | awk '{print $12}' | tee mem.log; sleep 3; done;
@kespindler
kespindler / gist:2520181
Created April 28, 2012 16:51
Roughly 400 very common English words
the dog, the cat, the fish, the bird, the animal, the snake, the cow, the pig, the mouse, the horse, the elephant, the tail, the wing
the train, the plane, the car, the bicycle, the bus, the boat, the tire, the gasoline, the train ticket
the city, the house, the street, the airport, the train station, the bridge, the hotel, the farm, the crowd, the court
the hat, the dress, the skirt, the shirt, the T-shirt, the pants, the shoes, the pocket
red, green, blue, yellow, green, brown, pink, orange, black, white, gray, light, dark
@kespindler
kespindler / gist:2513266
Created April 27, 2012 21:13
data:text/html,<b>ZOMG I AM BOLD!?!!?</b>
data:text/html,<b>ZOMG I AM BOLD!?!!?</b>
@kespindler
kespindler / gist:2511605
Created April 27, 2012 18:33
demonstrate difference between heap and stack alloc.
#include <ctime>
#include <iostream>
namespace {
class empty { }; // even empty classes take up 1 byte of space, minimum
}
int main()
{
std::clock_t start = std::clock();