Skip to content

Instantly share code, notes, and snippets.

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

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:

foo = { "bar" => "baz" }
def quuxify(bar)
bar["bar"] = "quux"
end
foo #=> {"bar"=>"baz"}
quuxify(foo)
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
@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
[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 / 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"))
This file has been truncated, but you can view the full file.
sendrawtransaction "010000000145a05ea6c56e969b3ccba0722a1a234008be6f6d7034313d8ce014f4e0f11c12000000008b48304502200c0a0c22a89fae473d853583a6c7c4a666f7cd536cc6008458ec7f0f5fbf7e70022100de964f12554d574520660b0c3aa4d569231dfd341341f601797c3454a4fce333014104ea46d3f7e1553f2ce3fc3dabe8e8b57770fd7bd2181c283bb2ffaee7756cf85624529b4a0f7f0ae4d285d3703025e9c5ec0c9a3fba73afbc5080bc82f8d26435ffffffff02753f1051000000001976a914e9e92a5b3d188009bbbc070c61df608f8adc2bb288acb0ad0100000000001976a914d152c289756a6e0cc32e4ee8aba54abe13ceb91888ac00000000"
sendrawtransaction "0100000001b2ed3bf8131908b718278af4c22e4e6fc5dc3758547bb5d98057828b37c82bd8000000008a4730440220543aab6a552442c7da5c6c52a008a1525149af05deca63d7c0a5d4b0c2c2f76b0220227e5c6964b7f697828ef5f8d53c53fac017bd910dca1b7fbd7b415028a291f8014104290fe0305a05ad6c21de7ae7b4ebe0ed03a6725cb99ce1d794eee6bc65e6aeb4803e408c90e79cefbd6edacf6f617a4f9c3c78b3311933ea0def578990052a9dffffffff028919512b000000001976a9142cdec05e67da042ebc3a0ef8fba965f6ac53856e88acc0d40100000000001976a91404e6
Solution(Set(
Device(Set(
Pipeline(Queue(
Warp(/* ... */),
Warp(/* ... */),
Warp(/* ... */))))),
Device(Set(
Pipeline(Queue(
Warp(/* ... */),
Warp(/* ... */)
@maxhodak
maxhodak / gist:5025643
Last active December 14, 2015 04:08
nested class creation
class A(q: mutable.Set[B])
class B(a: String)(implicit a: A)
val a = A(mutable.Set(
B("a"),
B("b"),
B("c")))
// access the outer A object:
// a.q.head.a