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 lxml.html | |
import requests | |
import csv | |
import os | |
base_url = 'http://fantasyfootballcalculator.com/' | |
folder = "./Drafts" | |
num = 1 | |
verbose = True |
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 lxml.html | |
from lxml import etree | |
import requests | |
import csv | |
import os | |
import datetime | |
base_url = 'https://gg.com/racing/' | |
def get_dates_interval(start,finish,format): |
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
# event (M3mSB, W3mSB, M10mPF, W10mPF) | |
# round (prelim, semi, final) | |
# diver (diver names) | |
# dcountry (hopefully the 3-character country code like USA) | |
# difficulty (this is a number like 3.2) | |
# score (scores range from 0 to 10) | |
# judge (the judge names, not numbers) | |
# jcountry (same comment applies as above) | |
dir <- setwd("/Volumes/HDD/Documents/Work/Current/625/Diving") |
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
set.seed(10) | |
lm.power <- c() | |
spd.power <- c() | |
for (n in range) { | |
spd.pvalue <- c() | |
lm.pvalue <- c() | |
for (j in 1:1E2) { | |
mat <- c() | |
samplesize <- 1E2 | |
for (i in 1:samplesize) { |
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
# randomize 1:nSongs across each iteration (?) | |
# be aware of the songs in the basedir, so that we don't resing songs | |
beMarkov <- TRUE # flag: don't do previous songs | |
Sys.setlocale("LC_ALL", "chs") | |
basedir <- "D:/Karaoke/To Sing/" #"C:/Users/Susan/Dropbox" | |
outdir <- "D:/Karaoke/To Sing/" | |
addLeadZero <- function(x, n=2) { | |
x <- as.character(x) |
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
#!/bin/sh | |
FILE=$(date +%Y%m%d-%H%M%S) | |
cd ~/Dropbox/Public/Screenshots | |
screencapture -i $FILE.png | |
echo "https://dl.dropboxusercontent.com/u/*/Screenshots/$FILE.png" | pbcopy |
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 | |
sys.setrecursionlimit(100000) | |
# dynamic programming | |
def fun(A, motes): | |
# print A, motes | |
if A == 1: | |
return len(motes) | |
if len(motes) == 0: | |
return 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
# The primes 3, 7, 109, and 673, are quite remarkable. By taking any two primes and concatenating them in any order the result will always be prime. For example, taking 7 and 109, both 7109 and 1097 are prime. The sum of these four primes, 792, represents the lowest sum for a set of four primes with this property. | |
# Find the lowest sum for a set of five primes for which any two primes concatenate to produce another prime. | |
def primes(n): | |
ret = list() | |
multiples = set() | |
for i in xrange(2, n+1): | |
if i not in multiples: | |
ret.append(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
N <- 100000000 | |
isprime <- rep(1,N) | |
for (i in 2:(floor(sqrt(N)))) { | |
if (isprime[i]==1) { | |
for (k in i:(floor(N/i))) { | |
isprime[i*k] <- 0 | |
} | |
} | |
print(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
import itertools | |
# using reverse polish notation | |
def calculate(expr): | |
stack = list() | |
for e in expr: | |
if type(e) == int: | |
stack.append(e) | |
else: |
OlderNewer