I hereby claim:
- I am seanplusplus on github.
- I am seanplusplus (https://keybase.io/seanplusplus) on keybase.
- I have a public key whose fingerprint is 2016 70BA 7220 A4DC 5140 ED60 EDC2 AD43 B29A 0F4E
To claim this, I am signing this object:
a,200 | |
a,202 | |
a,205 | |
b,302 | |
b,60 | |
b,3100 | |
c,50 | |
c,200 |
#!/usr/bin/env python | |
import collections | |
def main(): | |
di = {} | |
f = file('in.txt', 'r') | |
for line in f: | |
k = line.rstrip().split(',')[0] | |
v = line.rstrip().split(',')[1] |
// https://github.com/SeanPlusPlus/WebDevTemplates/blob/master/hello-world/hello-js/CHALLENGES.md #3 | |
'use strict'; | |
(function(){ | |
var msg = 'hello world'; | |
var arr = msg.replace(' ', '').split(''); | |
var obj = {}; | |
arr.forEach(function(chr) { |
var msgString = 'hello world'; | |
var msgArray = msgString.replace(' ', '').split(''); | |
var characterCount = {}; | |
msgArray.forEach(function(char) { | |
if (char in characterCount) { | |
characterCount[char] += 1; | |
} | |
else { | |
characterCount[char] = 1; | |
} |
I hereby claim:
To claim this, I am signing this object:
How do I get changes from Sean's sweet repo?
git remote add upstream [email protected]:SeanPlusPlus/WebDevTemplates.git
git fetch upstream
git checkout master
git merge upstream/master
Beware of conflicts
// http://play.elevatorsaga.com/#challenge=1 | |
{ | |
init: function(elevators, floors) { | |
var elevator = elevators[0]; // Let's use the first elevator | |
elevator.on("idle", function() { | |
// The elevator is idle, so let's go to all the floors (or did we forget one?) | |
elevator.goToFloor(0); | |
elevator.goToFloor(1); | |
elevator.goToFloor(2); |
#!/usr/bin/env python | |
############################################################################### | |
def get_pseudo_random_ints(li, total_randoms_needed): | |
############################################################################### | |
pseudo_random_ints = [] | |
for idx, char in enumerate(''.join(li)): | |
if idx < total_randoms_needed: | |
pseudo_random_ints.append(ord(char)) | |
return pseudo_random_ints |
#!/usr/bin/env python | |
from random import shuffle | |
def main(): | |
li = ['foo', 'bar', 'baz', 'meh', 'blerg'] | |
shuffle(li) | |
print li | |
if __name__ == '__main__': | |
main() |
avgTemp <- function() { | |
data <- read.csv('hw1_data.csv') | |
d <- data[data$Ozone>31 & data$Temp>90,]$Solar.R | |
mean(d[!is.na(d)]) | |
} | |
above <- function(x, n = 10) { | |
use <- x > n | |
x[use] | |
} |