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
doors = c(1:3) | |
tossout = function (x,y,z) { | |
if(x == y) { | |
return(sample(z[which(z!=x)],1)) | |
} else { return(z[which(z!=x & z!=y)]) } | |
} | |
results = function(x,y) { | |
if(x!=y) { 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
# script detailing process for weighted scores in Runner's World dataset | |
# reading in the csv containing the table | |
dat = read.csv("data/runners-world-data.csv") | |
# remove the ranking column since rows are id'd 1:x | |
dat = dat[,2:7] | |
# weights provided by Runner's World | |
weights = c(.4,.2,.2,.1,.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
library(ggplot2) | |
library(ggthemes) | |
# assigning notes and values centered around middle C | |
viola.notes = c(LETTERS[3:7],LETTERS[1:7],LETTERS[1:5]) | |
viola.values = c(seq(-7,9,by=1)) | |
violin.notes = c(LETTERS[7],LETTERS[1:7],LETTERS[1:7],LETTERS[1:2]) | |
violin.values = c(seq(-3,13,by=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
def encrypt_mono(file, key="key"): | |
'''This function encrypts text in a text file using a key and monoalphabetic substituion cypher''' | |
import string | |
def strip_punctuation(s): | |
return ''.join(c for c in s if c not in string.punctuation) | |
# remove repeating characters from key and add remaining letters of alphabet | |
alphabet = 'abcdefghijklmnopqrstuvwxyz' |