This file contains hidden or 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
require File.expand_path(File.dirname(__FILE__) + '/neo') | |
require 'pry' | |
# Greed is a dice game where you roll up to five dice to accumulate | |
# points. The following "score" function will be used to calculate the | |
# score of a single roll of the dice. | |
# | |
# A greed roll is scored as follows: | |
# | |
# * A set of three ones is 1000 points |
This file contains hidden or 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
http://math.ucr.edu/home/baez/photon/tensor.htm: | |
<blockquote>Both direct sum and tensor product are standard ways of <b>putting together little Hilbert spaces to form big ones.</b> They are used for different purposes. Suppose we have two physical systems.... Roughly speaking, if ... a physical system's ... states are either of A OR of B, its Hilbert space will be [a] direct sum.... If we have a system whose states are states of A AND states of B, its Hilbert space will be [a] tensor product.... | |
<pre> | |
<b>MEASURE SPACE</b> disjoint union Cartesian product | |
<b>HILBERT SPACE</b> direct sum tensor product | |
</pre> | |
</blockquote> |
This file contains hidden or 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
`> sort( round(sapply( split( HX, HX$course_id ), function(x) sum(x$viewed) / sum(x$registered) *100 )), decreasing=T)` | |
Programming | |
77 | |
Mechanical Engineering | |
71 | |
Structural Engineering | |
68 | |
E&M | |
67 | |
Computer Science |
This file contains hidden or 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
s#MITx/2.01x/2013_Spring#Structural Engineering#g | |
s#MITx/3.091x/2013_Spring#Solid State Chemistry#g | |
s#MITx/8.MReV/2013_Summer#Mechanical Engineering#g | |
s#MITx/8.02x/2013_Spring#E\&M#g | |
s#MITx/14.73x/2013_Spring#Poverty#g | |
s#MITx/6.002x/2013_Spring#Circuits \& Electronics#g | |
s#MITx/3.091x/2012_Fall#Solid State Chemistry#g | |
s#MITx/8.MReV/2013_Summer#Mechanical Engineering#g | |
s#MITx/6.00x/2013_Spring#Programming#g | |
s#MITx/6.00x/2012_Fall#Programming#g |
This file contains hidden or 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 from = "[email protected]" | |
set realname = "Humility Consulting" | |
set imap_user = "[email protected]" | |
set imap_pass = "my password in plaintest" | |
set folder = "imaps://imap.gmail.com:993" | |
set spoolfile = "+INBOX" | |
set postponed = "+[Gmail]/Drafts" |
This file contains hidden or 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
#print a specific line | |
li() { sed -n "$1"p ; } | |
lines() { sed -n "$1,$2"p ; } | |
#whitespace | |
ws() { echo -e "\t⋮\t⋮\t⋮" ; } #could also do this once for each column à la (head -1 | tr -dC , | sed "s/,/\t⋮/g") |
This file contains hidden or 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
" fun! MySys() | |
" return "$1" | |
" endfun | |
" set runtimepath=~/.vim_runtime,~/.vim_runtime/after,\$VIMRUNTIME | |
" source ~/.vim_runtime/vimrc | |
" helptags ~/.vim_runtime/doc | |
imap jk <Esc> |
This file contains hidden or 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
# You're meant to read through this | |
# configuraton file rather than simply | |
# copying it to your home directory. | |
# | |
# There are some places where you're | |
# meant to uncomment something if you | |
# want to use it in your TMUX. | |
# | |
# I hope it's readable. | |
# |
This file contains hidden or 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
require(microbenchmark) | |
# ζ is U+3b6 in Ubuntu | |
ready.set.go.10000000 <- microbenchmark( "ζ <- complex(0); for (j in 1:1e6) ζ <- c(ζ,complex(argument=j/1e6*2*pi,modulus=1) )", "ζ <- complex(1e6); for (j in 1:1e6) ζ[j] <- complex(argument=j/1e6*2*pi, modulus=1)", "ζ <- complex( argument=1:1e6*2*pi, modulus=1 )" ) | |
a<-Sys.time(); ready.set.go.10000000 <- microbenchmark( "ζ <- complex(0); for (j in 1:1e7) ζ <- c(ζ,complex(argument=j/1e7*2*pi,modulus=1) )", "ζ <- complex(1e7); for (j in 1:1e7) ζ[j] <- complex(argument=j/1e7*2*pi, modulus=1)", "ζ <- complex( argument=1:1e7*2*pi, modulus=1 ))" ,times=5e4L); b<-Sys.time() | |
b-a |
This file contains hidden or 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/bash | |
# peek | |
# look at N random lines of datafile.csv | |
# usage: rand datafile.csv N | |
# rand $1 $2 | |
head -1 $1 #names row of $1 |