Skip to content

Instantly share code, notes, and snippets.

@maxhodak
maxhodak / rebroadcase-txs.py
Created April 12, 2013 12:17
mtgox cron job
import json, base64
# wget https://data.mtgox.com/api/0/bitcoin_tx.php -> txs.json
fd = open("txs.json")
parsed = json.loads(fd.read())
parsed = parsed["result"]
out = open("out.txt", "w")
for row in parsed:
out.write("bitcoind sendrawtransaction \"%s\"\n" % base64.b64decode(row["tx"]).encode("hex"))
[maxhodak@Maxs-MacBook-Pro:Sources/europa-pso (svn:trunk:6686/)]$ ant (05-10 21:24)
Buildfile: /Users/maxhodak/Sources/europa-pso/build.xml
findPlatform:
[echo] os.name='Mac OS X' os.arch='x86_64'
[echo] Running build for : family=unix os=mac 64bit=true
init:
init-unix:
@maxhodak
maxhodak / common-authors
Created May 11, 2013 16:24
common authors
368296 Wang
287899 Lee
286787 LI
282538 Chen
273751 Zhang
254735 KIM
231384 Liu
172062 Smith
153624 Yang
137075 WU
NULL NULL NULL REVIEWER
NULL NULL NULL NATIONAL DEAF-MUTE COLLEGE
NULL NULL NULL Ophthalmic Surgeon
NULL NULL NULL Dioradin Company
NULL NULL NULL CO-WORKERS
NULL NULL NULL McLaren, Goode & Co
NULL NULL NULL REVIEWER
NULL NULL NULL WRITER OF THE NOTICE
NULL NULL NULL REPORTER
NULL NULL NULL San Jose Hospital
foo = { "bar" => "baz" }
def quuxify(bar)
bar["bar"] = "quux"
end
foo #=> {"bar"=>"baz"}
quuxify(foo)

Keybase proof

I hereby claim:

  • I am maxhodak on github.
  • I am maxh (https://keybase.io/maxh) on keybase.
  • I have a public key ASCMmkegRl8XUjBnL54RYBce-xU22aagDVN4krfFWHXM6go

To claim this, I am signing this object:

from __future__ import division
import random
# question: consider a society that allows only a single child,
# unless your first child is a girl, in which case you can have
# one more child. does this policy introduce a male gender bias?
N = 1000
boys = 0