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
// calculated Coordinated Mars Time (MTC) | |
var d = new Date(); | |
var millis = d.getTime(); | |
var jd_ut = 2440587.5 + (millis / 8.64E7); | |
var jd_tt = jd_ut + (35 + 32.184) / 86400; | |
var j2000 = jd_tt - 2451545.0; | |
var msd = (((j2000 - 4.5) / 1.027491252) + 44796.0 - 0.00096); | |
var mtc = (24 * msd) % 24; |
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
{"name": "P0", "children": [{"name": "AB", "children": [{"name": "ABa", "children": [{"name": "ABal", "children": [{"name": "ABalp", "children": [{"name": "ABalpa", "children": [{"name": "ABalpap", "children": [{"name": "ABalpapa", "children": [{"name": "ABalpapap", "children": [{"name": "ABalpapapa", "children": [{"name": "RMDDL"}, {"name": "ABalpapapap", "children": [{"name": "SMBDL"}, {"name": "ABalpapapapa"}]}]}, {"name": "ABalpapapp", "children": [{"name": "SMBVL"}, {"name": "ABalpapappa"}]}]}, {"name": "ABalpapaa", "children": [{"name": "ABalpapaap", "children": [{"name": "arc_ant_V"}, {"name": "ABalpapaapp"}]}, {"name": "ABalpapaaa", "children": [{"name": "hyp2_V"}, {"name": "RIPL"}]}]}]}, {"name": "ABalpapp", "children": [{"name": "ABalpappa", "children": [{"name": "ABalpappaa", "children": [{"name": "ABalpappaap", "children": [{"name": "I2L"}, {"name": "ABalpappaapp"}]}, {"name": "ABalpappaaa"}]}, {"name": "ABalpappap", "children": [{"name": "mc3V"}, {"name": "e2V"}]}]}, {"name": "ABalpappp", "childr |
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
- | |
title: "Voter Participation" | |
screen_name: "pmarca" | |
first_id: 488428182282858498 | |
first_timestamp: "2014-07-13T16:02:07-05:00" | |
tweets: | |
- "2014-07-13T16:02:07-05:00 Common thing one hears in US is \"Political system broken; Founding Fathers never intended politics to be dominated by moneyed interests.\"" | |
- "2014-07-13T16:03:08-05:00 But in 1776, voting \"restricted to property owners—most of whom are white male Protestants over the age of 21\". http://t.co/x2AVaTBaEa" | |
- "2014-07-13T16:03:51-05:00 In 1789, George Washington was elected President. \"Only 6% of the population can vote.\" http://t.co/PpX4aLQcM8" | |
- "2014-07-13T16:04:38-05:00 Not until 1856 was voting expanded even to all white men (eliminating property ownership requirement) -- http://t.co/PpX4aLQcM8" |
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
#!/usr/bin/env python | |
from collections import defaultdict | |
bigrams = defaultdict(set) # mapping first letter to possible second letter | |
trigrams = set() | |
with open("/usr/share/dict/words") as words: | |
for word in words: | |
word = word.replace("\n", "#") |
moved to
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
# Bash snippet to open new shells in most recently visited dir. | |
# Useful if you want to open a new terminal tab at the present | |
# tab's location. | |
# | |
# Put this in your .bashrc or whatever. | |
pathed_cd () { | |
if [ "$1" == "" ]; then | |
cd | |
else |
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
# brainf*** Interpreter in Python | |
# Copyright (c) 2002 & 2006, James Tauber | |
# | |
# see http://en.wikipedia.org/wiki/Brainfuck | |
import sys | |
class brainf: | |
def __init__(self, program): |
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
# Python implementation of the Gibbons-Lester-Bird algorithm[1] for enumerating | |
# the positive rationals. | |
# | |
# James Tauber 2004-07-01 | |
# http://jtauber.com/ | |
# | |
# [1] http://web.comlab.ox.ac.uk/oucl/work/jeremy.gibbons/publications/rationals.pdf | |
def rationals(): | |
""" |
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
# Implementation of Simon Plouffe's formula for Pi in Hex | |
# | |
# James Tauber 2007-03-14 | |
# http://jtauber.com/blog/2007/03/14/generating_the_hex_digits_of_pi/ | |
def pi(): | |
N = 0 | |
n, d = 0, 1 | |
while True: | |
xn = (120*N**2 + 151*N + 47) |
OlderNewer