This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import random | |
from hashlib import sha256 | |
digits58 = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz' | |
# No big I, big O, digit 0, or little l. 26 * 2 + 10 - 4 = 58. | |
base_count = len(digits58) | |
def encode_base58(bitcoin_bytes): | |
num = int.from_bytes(bitcoin_bytes, 'big') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\documentclass{article} | |
\title{This Mug Exaggerates My Grandfathering Skills To An Embarrassing Degree} | |
\author{Herman Fraser} | |
\date{1/31/01 3:00pm} | |
\begin{document} | |
\maketitle | |
COMMENTARY | |
My word. I still can't believe I was even nominated. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from random import uniform | |
def myvariate(): | |
return uniform(-2,2) | |
for i in range(1000000): | |
a = myvariate() | |
b = myvariate() | |
c = myvariate() | |
d = myvariate() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def arrange_dots(number): | |
"""Make string with specified number of dots, in rows of 10. | |
Useful to show a toddler which is the bigger number. | |
""" | |
tens = number // 10 | |
ones = number % 10 | |
row_of_ten = '.' * 10 + '\n' | |
rectangle = '\n' + row_of_ten * tens | |
return(rectangle + '.' * ones) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
print("""What is the "inverse survival function" of the standard normal? | |
The cdf is based on erf(x), the survival function is based on erfc(x), | |
and the inverse survival is based on 1/erfc(x). The error function | |
erf(x) is not an elementary function, but it can be approximated as | |
1 - 1 / (p(x))^4 , where p(x) is a 4th degree polynomial in x, with | |
coefficients a = 0.278393, b = 0.230389, c = 0.000972, d = 0.078108. | |
[https://en.wikipedia.org/wiki/Error_function] This means that | |
1/erfc(x) can be approximated as (p(x))^4 . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<title>Links about examples per feature</title> | |
</head> | |
<body> | |
<h1>"How many training examples do you need?"</h1> |
OlderNewer