Skip to content

Instantly share code, notes, and snippets.

View ofctlo's full-sized avatar

Brian Mason ofctlo

View GitHub Profile
@ofctlo
ofctlo / board.rb
Last active January 18, 2018 01:24
basic Othello with text-based GUI
require_relative './util.rb'
require_relative './errors.rb'
module Othello
# Represents a single state of the game board. The Board is responsible for
# the game logic: what moves are valid, and what the state of the board is
# after a move is made.
class Board
include Util
@ofctlo
ofctlo / list-names.R
Last active January 16, 2016 20:54
add names to list
pathogen<-data.frame(
org =c("ecoli", "campylobacter", "salmonella", "rotavirus", "cryptosporidium", "ascaris"),
alpha =c(NA, 0.145, 0.3126, 0.2531, NA, NA),
a =c(0.000105, 0, 0, 0, 0, 0),
n50 =c(NA, 896, 23600, 6.17, NA, NA),
pdi =c(1, 0.3, 0.3, 0.5, 0.7, 0.39),
k =c(0.0000511, NA, NA, NA, 0.00419, 1),
ratio =c(1, 10^5, 10^5, 10^5, 10^6, 10^6),
equation=c("expon", "bpois", "bpois", "bpois", "expon", "expon")
)
pathogens <- read.csv('pretend/this/is/from/a/csv.csv')
sites <- read.csv('whatever/this/is/called.csv')
applySites <- function(siteRow) {
applyPathogens <- function(pathogenRow) {
# you have access to siteRow and pathogenRow, do some work.
}
return(apply(pathogens, 1, applyPathogens))
}

Keybase proof

I hereby claim:

  • I am ofctlo on github.
  • I am ofctlo (https://keybase.io/ofctlo) on keybase.
  • I have a public key whose fingerprint is C8FE 6D91 E824 AA0C 7B4C 957D B17B 6489 4884 A97B

To claim this, I am signing this object: