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 getpass | |
def compute_freqs(sequence): | |
freqs = { | |
'd|d' : 0, | |
'f|d' : 0, | |
'd|f' : 0, | |
'f|f' : 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
n <- 500 | |
a <- rnorm(n, 0, 3) | |
b <- rnorm(n, 1, 4) | |
Z <- rep(0, n) | |
V <- rep(0, n) | |
P <- rep(0, n) | |
for (i in seq(5, n)) { | |
df <- i %% 24 | |
A <- a[1:i] |
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
teams = c('Yahoo_Settings', 'French_Revolution', 'Full_QBker', 'Angel_Edward Team', | |
'TheGhostofAL', 'Hawkn_Balls', 'Jessica_Eric', "Mikes_Team", | |
'Game_of_Throws', 'WhoDat_Nation', 'Jim_Michael', "Alexandras_Team") | |
df = data.frame(teams=teams, avg=avg_scores, sd=sd_scores) | |
m = matrix(0, 151, 12) | |
x = seq(0,150) | |
for (i in 1:12) { | |
m[,i] = dnorm(x, avgs[i], sds[i]) |
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
teams = c('Yahoo_Settings', 'French_Revolution', 'Full_QBker', 'Angel_Edward Team', | |
'TheGhostofAL', 'Hawkn_Balls', 'Jessica_Eric', "Mikes_Team", | |
'Game_of_Throws', 'WhoDat_Nation', 'Jim_Michael', "Alexandras_Team") | |
df = data.frame(teams=teams, avg=avg_scores, sd=sd_scores) | |
m = matrix(0, 151, 12) | |
x = seq(0,150) | |
for (i in 1:12) { | |
m[,i] = dnorm(x, avgs[i], sds[i]) |
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
cc_sim = function(seed, tran, debug=FALSE) { | |
# Does a simulation from a list of transition coefficients | |
# and initial state. | |
# | |
# Args: | |
# seed: the initial state | |
# tran: a list of transition coefficients | |
n = length(tran) | |
lst = rep(1,n) |
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
# Download all pdfs from a remote directory | |
grep -o '\"[a-zA-Z]*\.pdf\"' index.html | | |
sed s/\"//g | | |
sed -e "s/^/http:\/\/web.ipac.caltech.edu\/staff\/fmasci\/home\/statistics\_refs\//" | | |
xargs wget |
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
legoSim <- function() { | |
i = 1 | |
legos <- c() | |
while(TRUE) { | |
x <- sample(1:16, 1) | |
if (x %in% legos == FALSE) { | |
legos <- c(legos, x) | |
if (length(legos) == 16) { break } | |
} | |
else { i <- i + 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
MIT LicenseCopyright (C) <2014> <Joshua Andersen> | |
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | |
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | |
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTW |
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 selenium import webdriver | |
profile = webdriver.FirefoxProfile() | |
profile.add_extension('JSErrorCollector.xpi') | |
ff=webdriver.Firefox(profile) | |
ff.get('http://www.somepage.com') | |
ff.execute_script('return window.JSErrorCollector_errors.pump()') |
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 demonstration of Merge Sort in Java. | |
*/ | |
public class Merge { | |
public Merge() {} | |
/** | |
* Gets a sorted array in O(n log n). | |
* |
NewerOlder