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
import tempfile | |
import pickle | |
import os | |
from functools import wraps | |
def _encode_fcall(f, *args, **kwargs): | |
""" | |
Encode a function invocation to a dictionary (function call descriptor). | |
Structure of the function call descriptor: |
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
/* | |
Under context of Chrome browser, and if the URL starts with "https://arxiv.org/": | |
"Windows + Alt + P" - Go to PDF is in abstract page, and go to abstract page if in PDF | |
(will not overwrite clipboard) | |
*/ | |
#IfWinActive ahk_exe chrome.exe | |
#!p:: | |
Send ^l | |
Sleep, 100 | |
oldClipboard := Clipboard |
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 boltons.iterutils import remap # pip install boltons | |
from pprint import pprint | |
def inspect_structure(obj): | |
""" | |
>>> inspect_structure([1, 2]) | |
[<type 'int'>, <type 'int'>] | |
>>> import numpy as np | |
>>> inspect_structure([1, {3:'hola'}, np.eye(2)]) |
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
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc | |
. ~/.bashrc | |
mkdir ~/local | |
mkdir ~/node-latest-install | |
cd ~/node-latest-install | |
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1 | |
./configure --prefix=~/local | |
make install # ok, fine, this step probably takes more than 30 seconds... | |
curl https://www.npmjs.org/install.sh | sh |
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
# this set of dependencies is acquired from: | |
# https://github.com/jupyter/jupyter_console/issues/158#issue-330642313 | |
jupyter==1.0.0 | |
jupyter-client==5.2.3 | |
jupyter-console==5.2.0 | |
jupyter-core==4.4.0 | |
ipython==6.4.0 | |
prompt-toolkit==1.0.15 |
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
#!/bin/bash | |
if [ "${BASH_SOURCE[0]}" = "\${0}" ]; then | |
echo This script intends to be sourced rather than be called >> /dev/stderr | |
exit 1 | |
fi | |
__findrt_upward() { | |
local acc="" | |
local targetrt="" | |
local venv="rt" # virtualenv name to search for |
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
if [ "${BASH_SOURCE[0]}" != "$0" ]; then | |
echo "This script intends to be called rather than be sourced" | |
return 1 | |
fi |
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
/^ *$/d | |
/^#[^!]/d | |
1,/^#!\(\/bin\/\|\/usr\/bin\/env \)\(ba\)\?sh$/p | |
/^#!\(\/bin\/\|\/usr\/bin\/env \)\(ba\)\?sh$/q |
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
""" | |
Defines Moving MNIST dataset and function to generate moving mnist. | |
Adapted from: https://gist.github.com/tencia/afb129122a64bde3bd0c | |
""" | |
import os | |
import math | |
import collections | |
import itertools | |
import bisect |
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 argparse | |
import logging | |
import sys | |
def make_parser(): | |
parser = argparse.ArgumentParser( | |
description='Select column(s) of CSV file by name assuming the first ' | |
'row of the CSV lists the column names. Currently the ' |
OlderNewer