(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
require 'nn' | |
require 'cutorch' | |
require 'cunn' | |
--[[ | |
-- A simple benchmark comparing fully-connected net times on CPU and GPU. | |
-- | |
-- Note that we don't count time it takes to transfer data to the GPU. | |
--]] |
# null.py | |
import numpy as np | |
from scipy.linalg import qr | |
def qr_null(A, tol=None): | |
Q, R, P = qr(A.T, mode='full', pivoting=True) | |
tol = np.max(A) * np.finfo(R.dtype).eps if tol is None else tol | |
rnk = min(A.shape) - np.abs(np.diag(R))[::-1].searchsorted(tol) | |
return Q[:, rnk:].conj() |
""" | |
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) |
#!/bin/sh | |
sudo apt-get remove --purge vim vim-runtime vim-gnome vim-tiny vim-common vim-gui-common | |
sudo apt-get install liblua5.1-dev luajit libluajit-5.1 python-dev ruby-dev libperl-dev mercurial libncurses5-dev libgnome2-dev libgnomeui-dev libgtk2.0-dev libatk1.0-dev libbonoboui2-dev libcairo2-dev libx11-dev libxpm-dev libxt-dev | |
sudo mkdir /usr/include/lua5.1/include | |
sudo ln -s /usr/include/luajit-2.0 /usr/include/lua5.1/include | |
cd ~ | |
hg clone https://code.google.com/p/vim/ |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
Allows you to easily validate, clean, check type of card based on number, and verify the security code. It's small, has the fastest luhn implementation, works for all major cards without complex expressions, framework agnostic, and doesn't cost your company a small fortune to use like other libraries.
Easily hook it up to any framework, any code, easy to port.
Type
#!/bin/bash | |
mkdir -p ~/.ssh | |
# generate new personal ed25519 ssh keys | |
ssh-keygen -o -a 100 -t ed25519 -f ~/.ssh/id_ed25519 -C "rob thijssen <[email protected]>" | |
ssh-keygen -o -a 100 -t ed25519 -f ~/.ssh/id_robtn -C "rob thijssen <[email protected]>" | |
# generate new host cert authority (host_ca) ed25519 ssh key | |
# used for signing host keys and creating host certs |
import numpy as np | |
import bottleneck as bn | |
def top_n_indexes(arr, n): | |
idx = bn.argpartsort(arr, arr.size-n, axis=None)[-n:] | |
width = arr.shape[1] | |
return [divmod(i, width) for i in idx] | |
np.random.seed(47) |