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 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 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 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 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
# Requested gist of code to produce: | |
# https://www.scribd.com/doc/271871142/Julia-Type-Hierarchy | |
# | |
# I just redirected the output to a dot file, then executed: | |
# dot -Tpdf julia.dot -o julia.pdf | |
function print_type_tree(t, parent=Any, seen=Set{DataType}()) | |
# Avoid redundant edges. | |
t ∈ seen && return | |
push!(seen, t) | |
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
state | search_vol | unempl_rate | pop_est | avg_cc_debt | avg_score | unemployed | med_inc | |
---|---|---|---|---|---|---|---|---|
Mississippi | 100 | 8.3 | 2991207.0 | 4594 | 610 | 24827018.1 | 39295 | |
Georgia | 64 | 7.7 | 9992167.0 | 5343 | 629 | 76939685.9 | 47527 | |
Alabama | 64 | 6.2 | 4833722.0 | 4817 | 620 | 29969076.400000002 | 43472 | |
West Virginia | 64 | 6.1 | 1854304.0 | 4315 | 625 | 11311254.399999999 | 43124 | |
Louisiana | 62 | 6.3 | 4625470.0 | 4773 | 621 | 29140461.0 | 40296 | |
South Carolina | 61 | 7.1 | 4774839.0 | 5389 | 618 | 33901356.9 | 42661 | |
Arkansas | 60 | 7.5 | 2959373.0 | 4535 | 619 | 22195297.5 | 40591 | |
Florida | 60 | 6.4 | 19552860.0 | 4861 | 639 | 125138304.0 | 46059 | |
Kentucky | 59 | 8.2 | 4395295.0 | 4436 | 629 | 36041419.0 | 40887 |
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
$ 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 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 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 |
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 itertools | |
import numpy as np | |
import matplotlib.pyplot as plt | |
%matplotlib inline | |
def step_spiral(x_0=0, y_0=0): | |
point = (0, x_0, y_0) | |
yield point | |
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 ftplib import FTP, error_perm, error_temp | |
# List passwords | |
passlist = ["azedaedaze" , "connerre" , "iazevbfhiazev"] | |
length = len(passlist) | |
# IP FTP | |
ftp = FTP('ftpperso.free.fr') | |
# User FTP | |
user = "esconnerre" |