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
$ bc -l | |
bc 1.06.95 | |
Copyright 1991-1994, 1997, 1998, 2000, 2004, 2006 Free Software Foundation, Inc. | |
This is free software with ABSOLUTELY NO WARRANTY. | |
For details type `warranty'. | |
2^2 | |
4 | |
2^2^2 |
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
# This computes the USD index which is the "broad measure of the US Dollar against a BASKET of currencies" rather than against a particular pair | |
getFX(c("USD/EUR", "USD/JPY", "USD/GBP", "USD/CAD", "USD/SEK", "USD/CHF")) | |
# The formula comes from ICE markets https://www.theice.com/publicdocs/futures_us/ICE_Dollar_Index_FAQ.pdf | |
e <- .576 | |
y <- .136 | |
s <- .119 | |
l <- .091 |
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
require(ggplot2); data(msleep); attach(msleep) | |
animal.brains <- na.omit( data.frame( name, round( brainwt / bodywt * 100, 1) )) | |
names(list) <- c("animal", "how.brainy") | |
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
#!/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 |
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
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 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 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 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 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 = "humility.consulting@gmail.com" | |
set realname = "Humility Consulting" | |
set imap_user = "humility.consulting@gmail.com" | |
set imap_pass = "my password in plaintest" | |
set folder = "imaps://imap.gmail.com:993" | |
set spoolfile = "+INBOX" | |
set postponed = "+[Gmail]/Drafts" |
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
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 |