Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
# Installation: | |
# - Put this in your .bash_profile | |
# - Replace my directory with your exobrain directory on line 10 | |
# | |
# What you get: | |
# A Jupyter notebook open on a well-defined port that is always | |
# on for exobrain-ing your ideas... | |
exec 6<>/dev/tcp/localhost/10000 || ( | |
source activate py27 && |
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
function method_a(options) | |
parameterstring = "" | |
keyssorted = sort!(collect(keys(options))) | |
for key in keyssorted | |
parameterstring *= "$key=$(options["$key"])&" | |
end | |
chop(parameterstring) | |
end | |
function method_b(options) |
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 os | |
import numpy as np | |
import pandas as pd | |
import rpy2 | |
from rpy2 import robjects | |
from rpy2.robjects.packages import importr | |
AMELIA = importr("Amelia") |
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 scala.math.ulp | |
/** | |
* ThirdWay calls `ulp` occasionally. This script tries to assess costs. | |
*/ | |
def timeIt[R](f: => R): Long = { | |
val start = System.currentTimeMillis | |
f | |
System.currentTimeMillis - start |
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
/* | |
Consider two activities, A and B, both scheduled at the same time. When | |
activated, they schedule themselves for reactivation in a time delta of 0.1 | |
and 0.2. If this is less than the ulp at a given time, both activities end | |
up being scheduled at the same time. | |
*/ | |
import scala.math.ulp | |
val MaxTime = 9.007199254740991E15 |
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
// Load a DataFrame of users. Each line in the file is a JSON | |
// document, representing one row. | |
val sqlContext = new org.apache.spark.sql.SQLContext(sc) | |
val people = sqlContext.read.json("users.json.bz2") |
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
$ nslookup donaldjdrumpf.com | |
54.192.37.{240, 220, 36, 204, 108, 84, 38, 123} | |
$ nslookup optrump2016.com | |
104.18.47.68 | |
104.18.46.68 | |
$ nslookup donaldtrump.com | |
104.16.72.120 | |
104.16.75.120 |
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
# Makefile | |
FETCH = data/raw/FETCHED | |
PROCESS = data/clean/CLEANED | |
all: $(FETCH) $(PROCESS) | |
$(FETCH): scripts/fetch.py | |
@mkdir -p data/raw | |
python scripts/fetch.py | |
@touch $(FETCH) |
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
Make |