- ages are in years
- contribution, and savings are in dollars
- avg_annual_return is a ratio, so 1.07 is a 7% annual return
let's say I'm 25 years old, I am going to contribute $2000/yr in bonds (~5% return), and I've already invested $5700 in bonds
// nodewar.com library function… | |
// o.lib.targeting.simpleTarget(ship, pos) | |
// | |
// mostly deobfuscated/deminified | |
// | |
function simpleTarget(ship, pos) { | |
var i, r, h, | |
torque = 0, | |
thrust = 0, | |
dir = o.lib.targeting.dir(ship, pos); |
#!/bin/bash | |
export FOO=100 | |
python - <<END | |
import os | |
print "foo:", os.environ['FOO'] | |
END |
from collections import Counter | |
K = 3 | |
dataset = [ | |
# weight, color, # seeds, type | |
[303, 3, 1, "banana"], | |
[370, 1, 2, "apple"], | |
[298, 3, 1, "banana"], | |
[277, 3, 1, "banana"], | |
[377, 4, 2, "apple"], |
function getJSON(url, cb) { | |
var xhr = new XMLHttpRequest(); | |
xhr.open("GET", url, true); | |
xhr.onreadystatechange = function() { | |
if (xhr.status != 200 || xhr.readyState != 4) return; | |
cb(JSON.parse(xhr.responseText)); | |
} | |
xhr.send(); | |
}; |
# add new database to addons before running this | |
# fill in the blank | |
# eg. DBNAME=HEROKU_POSTGRESQL_ROSE <- new Database | |
DBNAME=HEROKU_POSTGRESQL_ROSE | |
heroku maintenance:on | |
heroku scale web=0 | |
heroku pgbackups:capture --expire |
function replace(txt) { | |
txt = txt.replace(/witnesses/gi, "dudes I know"); | |
txt = txt.replace(/allegedly/gi, "kinda probably"); | |
txt = txt.replace(/new study/gi, "tumblr post"); | |
txt = txt.replace(/rebuild/gi, "avenge"); | |
txt = txt.replace(/space/gi, "spaaace"); | |
txt = txt.replace(/google glass/gi, "virtual boy"); | |
txt = txt.replace(/smartphone/gi, "pokédex"); | |
txt = txt.replace(/electric/gi, "atomic"); | |
txt = txt.replace(/senator/gi, "elf-lord"); |
import struct | |
import math | |
from ctypes import create_string_buffer | |
class error(Exception): | |
pass | |
# this module redefines the names of some builtins that are used | |
max_ = max |
import warnings | |
import random | |
if random.random() > 0.999: | |
warnings.warn("Hi marco, nice day today, eh?") |
alert('adsf') |