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/python | |
""" | |
Input: | |
[visitor, element, t] | |
Output: | |
[element, count(visitor)].sort(lambda a,b: b[1]-a[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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>Bootstrap, from Twitter</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta name="description" content=""> | |
<meta name="author" content=""> |
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/sbin/dtrace -Zs | |
python$target:::function-entry | |
{ | |
trace(copyinstr(arg1)); | |
} |
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 boto | |
import boto.s3 | |
import os.path | |
import sys | |
# Fill these in - you get them when you sign up for S3 | |
AWS_ACCESS_KEY_ID = '' | |
AWS_ACCESS_KEY_SECRET = '' | |
# Fill in info on data to upload |
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
# see | |
# * https://www.quantopian.com/research/notebooks/201610-Female-CEO/1106-Alpha-confirmation.ipynb | |
# * https://www.quantopian.com/posts/running-pipeline-backtest-in-reserach | |
last_pipeline_index = None | |
pipeline_data = None | |
def get_new_data(t, pipeline_name): | |
start_date = 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
# https://www.quantopian.com/posts/help-with-custom-factor | |
class SidInList(CustomFilter): | |
inputs = [] | |
window_length = 1 | |
params = ('sid_list',) | |
def compute(self, today, assets, out, sid_list): | |
assert len(sid_list) > 0 | |
out[:] = np.in1d(assets, sid_list) | |
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
class Classifier(): | |
def __init__(self, | |
df, depth=3, | |
source_cols=input_columns, target='delta_90', | |
use_classification=False): | |
""" | |
Given the model, let's train | |
:return: Classified model | |
""" |
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
""" | |
A simple tool for researching Pairs based on: | |
https://www.quantopian.com/clone_notebook?id=57ed7c41144f8837290000da | |
""" | |
from datetime import date, timedelta | |
import matplotlib.pyplot as plt | |
from statsmodels.tsa.stattools import coint | |
from zipline import TradingAlgorithm |
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 zipline.api import ( | |
schedule_function, date_rules, time_rules, sid, symbol, | |
set_slippage, slippage, set_commission, commission, | |
get_datetime, order_target_percent, | |
# record, # Replaced below | |
attach_pipeline, | |
order_target, get_open_orders, history | |
) | |
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
// START DEBUG LOG | |
// https://github.com/Aloisius/hadoop-s3a/blob/master/src/main/java/org/apache/hadoop/fs/s3a/S3AFileSystem.java#L150 | |
// Try to get our credentials or just connect anonymously | |
String accessKey = conf.get(NEW_ACCESS_KEY, conf.get(OLD_ACCESS_KEY, null)); | |
String secretKey = conf.get(NEW_SECRET_KEY, conf.get(OLD_SECRET_KEY, null)); | |
String userInfo = name.getUserInfo(); |
OlderNewer