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
Aardvark | |
Elephant | |
Albatross | |
Alligator | |
Alpaca | |
Anaconda | |
Ant | |
Anteater | |
Antelope | |
Armadillo |
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 __future__ import division | |
from numpy import * | |
class AdaBoost: | |
def __init__(self, training_set): | |
self.training_set = training_set | |
self.N = len(self.training_set) | |
self.weights = ones(self.N)/self.N | |
self.RULES = [] |
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 threading, os, sys | |
from multiprocessing import cpu_count | |
NUM_CPUS = cpu_count() | |
def batch_process(command_list, batch_size=NUM_CPUS): | |
iteratorlock = threading.Lock() | |
exceptions = [] | |
cmd = command_list.__iter__() | |
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 datetime import datetime, date, timedelta | |
def EurodollarExpirations(): | |
start = datetime.now().date() | |
n = 20 | |
ex = [date(2008,12,15)] | |
for i in range(120): | |
x = ex[-1] | |
x += timedelta(days=91) | |
if x.day <= 12: x += timedelta(days=7) |
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 __future__ import division | |
from numpy import * | |
class Tableau: | |
def __init__(self, obj): | |
self.obj = [1] + obj | |
self.rows = [] | |
self.cons = [] |
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, sys | |
from boto.s3.connection import S3Connection | |
from boto.s3.bucket import Bucket | |
AWS_ACCESS_KEY = os.getenv('AWS_ACCESS_KEY') | |
AWS_SECRET_KEY = os.getenv('AWS_SECRET_KEY') | |
conn = S3Connection(AWS_ACCESS_KEY, AWS_SECRET_KEY) | |
bucket_name = sys.argv[1] |
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 rsa | |
(pubkey, privkey) = rsa.newkeys(512, poolsize=8) | |
print pubkey | |
print privkey | |
msg = "this is a secret message!" |
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 sys, string, urllib | |
GROUPS = dict([('ags','ftp://ftp.cmegroup.com/pub/settle/stlags'), | |
('rates','ftp://ftp.cmegroup.com/pub/settle/stlint'), | |
('fx','ftp://ftp.cmegroup.com/pub/settle/stlcur'), | |
('nymex','ftp://ftp.cmegroup.com/pub/settle/stlnymex'), | |
('comex','ftp://ftp.cmegroup.com/settle/stlcomex'), | |
('clearport','ftp://ftp.cmegroup.com/settle/stlcpc')]) | |
# month codes |
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
cdef extern from "math.h": | |
double sin(double) | |
cdef double f(double x) except *: | |
return sin(x**2) | |
def integrate(double a, double b, int N): | |
cdef int i | |
cdef double s, dx | |
s = 0 |
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
package main | |
import ( | |
"fmt" | |
"github.com/vmihailenco/redis" | |
"net/http" | |
"strings" | |
) | |
func handler(w http.ResponseWriter, r *http.Request, c *redis.Client) { |
OlderNewer