I hereby claim:
- I am marcper on github.
- I am marcper (https://keybase.io/marcper) on keybase.
- I have a public key ASATXI5AwqNDiD5GQhh1DkyrSZjNlMp4I4OUnRacviwdKgo
To claim this, I am signing this object:
# Power analysis for coin tossing | |
# H1: coin is rigged (p1 > 0.5). Probability of heads in the alternative hypothesis. | |
# H0: coin is fair (p0 = 0.5). Probability of heads in the null hypothesis. | |
import math | |
import itertools | |
def binom_coeff(n, k): | |
return math.factorial(n) / (math.factorial(k) * math.factorial(n - k)) |
def parse_vec file | |
v = {} | |
file.split("\n").each do |s| | |
arr = s.split(":") | |
v[arr[0]] = arr[1].gsub("[", "").gsub("]", "").split(",").map(&:to_i) | |
end | |
v | |
end | |
def parse_inv file |
I hereby claim:
To claim this, I am signing this object:
function orderTasks(num) { | |
var out = {}, | |
fib, i = 0, | |
sum = idx = ct = 0, | |
tasks = Array.apply(null, {length: num}).map(Number.call, Number).reverse(); // http://stackoverflow.com/a/20066663 | |
while (sum < num) { | |
idx++; | |
sum += getFib(idx); | |
} |
// Validates last two digits of a CPF or CNPJ | |
// Validation rules taken from http://ghiorzi.org/DVnew.htm | |
function validateCnpjCpf(value, type) { | |
var cpf = (type === "cpf"), | |
docLength = cpf ? 11 : 14, | |
chkLast; | |
if (value == null || value == "") { | |
return true; | |
} |
<!DOCTYPE html> | |
<html lang="eng"> | |
<head> | |
<meta charset="utf-8"> | |
<title>Conway's Game of Life</title> | |
<link rel="stylesheet" href="style.css"> | |
</head> | |
<body> |