This file contains hidden or 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
| %%%% NIPS Macros (LaTex) | |
| %%%% Style File | |
| %%%% Dec 12, 1990 Rev Aug 14, 1991; Sept, 1995; April, 1997; April, 1999 | |
| % This file can be used with Latex2e whether running in main mode, or | |
| % 2.09 compatibility mode. | |
| % | |
| % If using main mode, you need to include the commands | |
| % \documentclass{article} | |
| % \usepackage{nips10submit_e,times} |
This file contains hidden or 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 regex | |
| import numpy as np | |
| import pandas as pd | |
| import matplotlib.pyplot as plt | |
| import seaborn as sns | |
| CURRENCY_REGEX = regex.compile(r'[\$€,]') |
This file contains hidden or 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 | |
| set -eux | |
| function help { | |
| echo "Please source this script instread of running it" | |
| } | |
| # https://www.emacswiki.org/emacs/EmacsdInitScript | |
| function init_emacs { |
This file contains hidden or 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 | |
| set -eux -o pipefail | |
| function install_docker { | |
| # https://docs.docker.com/engine/installation/linux/docker-ce/ubuntu/#uninstall-old-versions | |
| # Remove exising docker versions | |
| sudo apt-get remove -y docker docker-engine docker.io | |
| sudo apt-get install -y \ |
This file contains hidden or 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.pkgs <- function (...) { | |
| df.pkgs.loaded <- data.frame(installed.packages()) | |
| pkgs.loaded <- levels(df.pkgs.loaded$Package) | |
| pkgs.required <- list(...) | |
| pkgs.todo <- setdiff(pkgs.required, pkgs.loaded) | |
| for (pkg in pkgs.todo) { | |
| install.packages(pkg, repos = c("https://cloud.r-project.org")) | |
| } | |
| for (pkg in pkgs.required) { |
This file contains hidden or 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
| install.packages(c("sp", "rgeos", "rgdal", "dplyr", "maptools", "leaflet", "scales")) | |
| library(sp) | |
| library(rgeos) | |
| library(rgdal) | |
| library(maptools) | |
| library(dplyr) | |
| library(leaflet) | |
| library(scales) |
This file contains hidden or 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
| """ Compute receptive field size | |
| http://vision.stanford.edu/teaching/cs231b_spring1415/slides/alexnet_tugce_kyunghee.pdf | |
| """ | |
| def receptive_field_size(layers): | |
| """ Find the receptive field size of a single 'neuron' | |
| after a series of 'conv' and 'pool' operations | |
| """ | |
| if not layers: return 0 |
This file contains hidden or 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 | |
| lxc profile device set default eth0 parent enp2s0 | |
| lxc profile device set default eth0 nictype macvlan | |
| # https://insights.ubuntu.com/2016/04/07/lxd-networking-lxdbr0-explained/ | |
| cat <<EOF | sudo tee /etc/network/interfaces.d/containerbr.cfg | |
| auto containerbr | |
| iface containerbr inet dhcp | |
| bridge_ports eth0 |
This file contains hidden or 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 | |
| echo "Install xhyve driver" | |
| brew install docker-machine-driver-xhyve | |
| function quit_with { >&2 echo "ERROR: $@, quit"; exit 1; } | |
| function sudo_inst { | |
| local _prefix=$(brew --prefix docker-machine-driver-xhyve) | |
| echo "Run the following commands since xhyve requires sudo access" |
This file contains hidden or 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 time import sleep | |
| from random import randint | |
| import json | |
| import requests | |
| import pandas as pd | |
| def fb_graph_api_crawl(params, **kws): | |
| print('initial call') | |
| res = requests.get('https://graph.facebook.com/v2.8/search', params).json() | |
| _js_list = [res['data']] |
NewerOlder