Skip to content

Instantly share code, notes, and snippets.

View elofgren's full-sized avatar

Eric Lofgren elofgren

  • Washington State University
  • Pullman, WA
View GitHub Profile
@elofgren
elofgren / gist:f76dca0cc1da60f75108d6ed987c24f5
Created January 11, 2019 22:10
Number of Hits for 40 Intercessors
n_samples <- 10000
distribution <- data.frame("roll"=seq(from=1,to=n_samples,by=1),"hits"=99)
for (i in 1:n_samples){
rolls <- sample(1:6, 40, replace=T)
hits <- sum(rolls>2)
explode <-sum(base > 4)
total <- hits + explode
distribution[i,2] <- total
@elofgren
elofgren / SSH_Colorchange
Created December 3, 2013 18:20
Change Terminal Color when SSHing into a Server (OS X) - Add to .bashrc
function tabc() {
NAME=$1; if [ -z "$NAME" ]; then NAME="Pro"; fi
osascript -e "tell application \"Terminal\" to set current settings of front window to settings set \"$NAME\""
}
alias ssh_bigiron="tabc Ocean; ssh user@bigiron.institution.edu; tabc"
@elofgren
elofgren / gist:1390355
Created November 24, 2011 00:40
SIR with Random Parameters
#Python implementation of continuous SIR model
#Transmission parameter values are random
#Import Necessary Modules
import numpy as np
import scipy.integrate as spi
#Solving the differential equation. Solves over t for initial conditions PopIn
def eq_system(startState,t):