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
" Generated by Color Theme Generator at Sweyla | |
" http://sweyla.com/themes/seed/690000/ | |
set background=dark | |
hi clear | |
if exists("syntax_on") | |
syntax reset | |
endif |
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
Greg's Program | |
gcc gregs-program.cc -o main && ./main |
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 feather | |
import pandas as pd | |
from ggplot import * | |
standings = feather.read_dataframe('./standings.feather') | |
attendance = feather.read_dataframe('./attendance.feather') | |
payrolls = attendance[['year', 'est_payroll']].groupby('year').mean() / 1000 | |
print payrolls[(payrolls.index==1970) | (payrolls.index==2010)] |
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
dtypes <- list( | |
"foo"=as.character, | |
"bar"=as.integer, | |
"letters"=function(x) { | |
factor(x, levels=c("a", "b", "c")) | |
} | |
) | |
ensureAllVariablesExist <- function(df) { | |
has.types <- names(dtypes) %in% names(df) |
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 | |
import pandas as pd | |
import numpy as np | |
# get churn.csv from here: https://raw.githubusercontent.com/EricChiang/churn/master/data/churn.csv | |
churn_df = pd.read_csv('churn.csv') | |
col_names = churn_df.columns.tolist() | |
print "Column names:" | |
print col_names |
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
var arDrone = require('ar-drone'); | |
var colors = require('colors'); | |
console.log("EMERGENCY LANDING!!!".red.bold.underline.bgBlack) | |
var client = arDrone.createClient(); | |
client.stop(); | |
client.land(); |
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 Table courtesy statetable.com | |
CREATE TABLE state (id integer, name varchar(255), abbreviation varchar(255), country varchar(255), type varchar(255), sort integer, status varchar(255), occupied varchar(255), notes varchar(255), fips_state varchar(255), assoc_press varchar(255), standard_federal_region varchar(255), census_region varchar(255), census_region_name varchar(255), census_division varchar(255), census_division_name varchar(255), circuit_court varchar(255)); | |
INSERT INTO state (id,name,abbreviation,country,type,sort,status,occupied,notes,fips_state,assoc_press,standard_federal_region,census_region,census_region_name,census_division,census_division_name,circuit_court) VALUES ('1','Alabama','AL','USA','state','10','current','occupied','','1','Ala.','IV','3','South','6','East South Central','11'); | |
INSERT INTO state (id,name,abbreviation,country,type,sort,status,occupied,notes,fips_state,assoc_press,standard_federal_region,census_region,census_region_name,census_division,census_division_name,circ |
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
!include LogicLib.nsh | |
!include nsDialogs.nsh | |
; -------------------------------- | |
; Variables | |
; -------------------------------- | |
!define dest "{{dest}}" | |
!define src "{{src}}" | |
!define name "{{name}}" |
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 numpy as np | |
# import my tree model from the model.py file | |
from model import tree | |
from yhat import Yhat, YhatModel, preprocess | |
class TreeModel(YhatModel): |
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
library(RODBC) | |
library(RODBCext) | |
# this will connect using "ScienceOps" credentials if the system user is "root" | |
# and will conenct using Windows credentials otherwise | |
connectToMSDb <- function() { | |
write("reconnecting to database...", stderr()) | |
odbcConnect(Sys.getenv("DB_URL")) # using the Database URL stored as a environment variable (see http://sandbox.yhathq.com/models/{modelname}/settings - Environment Variables) | |
# odbcConnect("Server=FOO;Database=BAR;Trusted_Connection=True;") # using a hard-coded DB URL | |
} |