Skip to content

Instantly share code, notes, and snippets.

View chrisspen's full-sized avatar

Chris Spencer chrisspen

View GitHub Profile
@chrisspen
chrisspen / montyhall.py
Created April 6, 2022 16:38
Simulation of the Monty Hall problem.
"""
CKS 2022-04-06 Simulation of the Monty Hall problem.
"""
import random
CAR = 'c'
GOAT = 'g'
doors = [CAR, GOAT, GOAT]
@chrisspen
chrisspen / digicheck.py
Created January 6, 2020 18:23 — forked from petri/digicheck.py
Single-file Python digital signature maker and checker
"""digicheck - create and verify signatures for files
Usage:
digicheck keys
digicheck public <keyfilename>
digicheck sign <filename> <keyfilename>
digicheck check <filename> <keyfilename> <signaturefilename>
digicheck (-h | --help)
digicheck --version
#!/bin/bash
set -e
[ -d /tmp/test ] && rm -Rf /tmp/test || true
mkdir -p /tmp/test
cd /tmp/test
git init
touch test.txt
echo "123" >> test.txt
echo "000" >> test.txt
echo "456" >> test.txt
@chrisspen
chrisspen / dnn.py
Created August 11, 2014 14:31 — forked from syhw/dnn.py
"""
A deep neural network with or w/o dropout in one file.
"""
import numpy, theano, sys, math
from theano import tensor as T
from theano import shared
from theano.tensor.shared_randomstreams import RandomStreams
from collections import OrderedDict