start new:
tmux
start new with session name:
tmux new -s myname
Roll your own iPython Notebook server with Amazon Web Services (EC2) using their Free Tier.
import os | |
import numpy | |
from pandas import DataFrame | |
from sklearn.feature_extraction.text import CountVectorizer | |
from sklearn.naive_bayes import MultinomialNB | |
from sklearn.pipeline import Pipeline | |
from sklearn.cross_validation import KFold | |
from sklearn.metrics import confusion_matrix, f1_score | |
NEWLINE = '\n' |
<!-- solution 1, 117b, inspired by http://www.p01.org/releases/140bytes_music_softSynth/ --> | |
<button onclick="new Audio('data:audio/wav;base64,UklGRl9vT19XQVZFZm10IBAAAAABAAEAQB8AAEAfAAABAAgAZGF0YU'+Array(1e3).join(123)).play()">Beep</button> | |
<!-- Solution 2, 107b, inspired by http://xem.github.io/chip8/c8.html --> | |
<button onclick="o=(A=new AudioContext()).createOscillator();o.connect(A.destination);o.start(0);setTimeout('o.stop(0)',500)">Boop</button> |
/* | |
from : http://en.wikipedia.org/wiki/Mersenne_twister | |
*/ | |
let MT | |
let index | |
class PRNG { | |
static setSeed(seed) { | |
// Create a length 624 array to store the state of the generator | |
MT = new Uint32Array(624) | |
index = 0 |
""" | |
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy) | |
BSD License | |
""" | |
import numpy as np | |
# data I/O | |
data = open('input.txt', 'r').read() # should be simple plain text file | |
chars = list(set(data)) | |
data_size, vocab_size = len(data), len(chars) |
""" | |
A bare bones examples of optimizing a black-box function (f) using | |
Natural Evolution Strategies (NES), where the parameter distribution is a | |
gaussian of fixed standard deviation. | |
""" | |
import numpy as np | |
np.random.seed(0) | |
# the function we want to optimize |
// gif by dave aka @beesandbombs :) | |
int[][] result; | |
float t, c; | |
float ease(float p) { | |
return 3*p*p - 2*p*p*p; | |
} | |
float ease(float p, float g) { |