Skip to content

Instantly share code, notes, and snippets.

View jmtagarro's full-sized avatar

José María Tagarro Martí jmtagarro

View GitHub Profile
@kylelk
kylelk / sha256.py
Created December 27, 2013 21:15
Python implantation of sha256
def sha256(data):
bytes = ""
h0 = 0x6a09e667
h1 = 0xbb67ae85
h2 = 0x3c6ef372
h3 = 0xa54ff53a
h4 = 0x510e527f
h5 = 0x9b05688c
h6 = 0x1f83d9ab
@stucchio
stucchio / beta_bandit.py
Last active April 3, 2022 21:17
Beta-distribution Bandit
from numpy import *
from scipy.stats import beta
class BetaBandit(object):
def __init__(self, num_options=2, prior=(1.0,1.0)):
self.trials = zeros(shape=(num_options,), dtype=int)
self.successes = zeros(shape=(num_options,), dtype=int)
self.num_options = num_options
self.prior = prior
@nikcub
nikcub / README.md
Created October 4, 2012 13:06
Facebook PHP Source Code from August 2007