As configured in my dotfiles.
start new:
tmux
start new with session name:
As configured in my dotfiles.
start new:
tmux
start new with session name:
#!/usr/bin/expect -f | |
set ssh_host "172.19.10.80" | |
set ssh_user "user" | |
set ssh_password "password" | |
set dest_host "172.19.10.91" | |
set dest_port 8080 | |
set local_port 80 | |
set timeout -1 | |
spawn ssh -N $ssh_user@$ssh_host -L 127.0.0.1:$local_port:$dest_host:$dest_port |
#!/bin/sh -e | |
hostname=$1 | |
device=$2 | |
file=$HOME/.dynv6.addr6 | |
[ -e $file ] && old=`cat $file` | |
if [ -z "$hostname" -o -z "$token" ]; then | |
echo "Usage: token=<your-authentication-token> [netmask=64] $0 your-name.dynv6.net [device]" | |
exit 1 | |
fi |
APIs x creativity x Twitter => awesomeness!
""" | |
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) |
""" | |
Shows how to do a cross join (i.e. cartesian product) between two pandas DataFrames using an example on | |
calculating the distances between origin and destination cities. | |
Tested with pandas 0.17.1 and 0.18 on Python 3.4 and Python 3.5 | |
Best run this with Spyder (see https://github.com/spyder-ide/spyder) | |
Author: Markus Konrad <post@mkonrad.net> | |
April 2016 |
def smart_procrustes_align_gensim(base_embed, other_embed, words=None): | |
"""Procrustes align two gensim word2vec models (to allow for comparison between same word across models). | |
Code ported from HistWords <https://github.com/williamleif/histwords> by William Hamilton <wleif@stanford.edu>. | |
(With help from William. Thank you!) | |
First, intersect the vocabularies (see `intersection_align_gensim` documentation). | |
Then do the alignment on the other_embed model. | |
Replace the other_embed model's syn0 and syn0norm numpy matrices with the aligned version. | |
Return other_embed. |
componentDidMount () { | |
// Get cookies as a request header string | |
CookieManager.get("http://127.0.0.1:8000/login/", (err, res) => { | |
// Outputs 'user_session=abcdefg; path=/;' | |
fetch("http://127.0.0.1:8000/login/", { | |
method: "POST", | |
headers: { | |
'Accept': 'application/json', | |
'Content-Type': 'application/json', |
sudo add-apt-repository ppa:openjdk-r/ppa | |
sudo apt-get update | |
sudo apt-get install openjdk-7-jre | |
# install openjdk | |
sudo apt-get install openjdk-7-jdk | |
# download android sdk | |
wget http://dl.google.com/android/android-sdk_r24.2-linux.tgz |
import argparse | |
import os | |
import shutil | |
import time | |
import torch | |
import torch.nn as nn | |
import torch.nn.parallel | |
import torch.backends.cudnn as cudnn | |
import torch.optim |