I hereby claim:
- I am motivic on github.
- I am motivic (https://keybase.io/motivic) on keybase.
- I have a public key whose fingerprint is B77E 6212 9274 6C04 47C9 A42D EA79 3DCC A0C4 8858
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| #!/usr/bin/env bash | |
| # Inspired by https://forum.ethereum.org/discussion/13723/cron-the-miner | |
| ethminer=/opt/ethminer | |
| wallet=08adb68e47e6552f23a5d34feb0d7b47852522b6 | |
| log="$HOME/log/ethminer_$(date "+%Y%m%d_%H%M%S").log" | |
| case $1 in | |
| start) | |
| $ethminer --farm-recheck 200 --cuda --stratum us1.ethermine.org:4444 -SF us1.ethermine.org:14444 --userpass $wallet > $log 2>&1 & |
| #!/bin/bash | |
| # Source: https://gist.github.com/ryin/3106801 | |
| # Script for installing tmux on systems where you don't have root access. | |
| # tmux will be installed in $HOME/local/bin. | |
| # It's assumed that wget and a C/C++ compiler are installed. | |
| # Updated to install TMUX_VERSION 2.3 from https://tmux.github.io/ | |
| # exit on error | |
| set -e | |
| import numpy as np | |
| # Read in the data | |
| data = [] | |
| with open('in.dta', 'r') as input: | |
| row = [float(x) for x in input.readline().strip().split(' ') if x != ''] | |
| while row: | |
| data.append(row) | |
| row = [float(x) for x in input.readline().strip().split(' ') if x != ''] | |
| training_x = np.array([p[:2] for p in data]) |
| import numpy as np | |
| # Find f(x), where f is the line through p1 and p2 | |
| def f(p1, p2, x): | |
| return (p2[1]-p1[1])/(p2[0]-p1[0])*(x-p1[0])+p1[1] | |
| epochs = [] | |
| Eouts = [] | |
| N = 100 |
| import numpy as np | |
| import matplotlib.pyplot as plt | |
| x = np.arange(-2, 2, 0.1) | |
| # Hyperbolic Tangent | |
| y_tanh = np.tanh(x) | |
| # Sigmoid/Softmax | |
| sigmoid = lambda t: 1/(1+np.exp(-t)) | |
| sigmoid_vec = np.vectorize(sigmoid, otypes=[np.float]) |
| #!/usr/bin/env bash | |
| base_dir=".git/objects" | |
| blue=$(tput setaf 4) | |
| normal=$(tput sgr0) | |
| for d in $(ls -R $base_dir); do | |
| if [[ -d "$base_dir/$d" ]]; then | |
| for f in $(ls -R $base_dir/$d); do | |
| file="$base_dir/$d/$f" |
| import numpy as np | |
| # Find f(x), where f is the line through p1 and p2 | |
| def f(p1, p2, x): | |
| return (p2[1]-p1[1])/(p2[0]-p1[0])*(x-p1[0])+p1[1] | |
| # Get random points p1 and p2 | |
| p1, p2 = np.random.rand(2, 2) | |
| line = lambda x: f(p1, p2, x) |
| # http://code.activestate.com/recipes/65207-constants-in-python/?in=user-97991 | |
| # Put in const.py...: | |
| class _const: | |
| class ConstError(TypeError): pass | |
| def __setattr__(self,name,value): | |
| if self.__dict__.has_key(name): | |
| raise self.ConstError, "Can't rebind const(%s)"%name | |
| self.__dict__[name]=value | |
| import sys | |
| sys.modules[__name__]=_const() |
| # https://google.github.io/styleguide/pyguide.html | |
| i = 4 | |
| def foo(x): | |
| def bar(): | |
| print i, | |
| # ... | |
| # A bunch of code here | |
| # ... | |
| for i in x: # Ah, i *is* local to Foo, so this is what Bar sees | |
| print i, |