3 ms·
I usually try to do something fun for the pi searcher for Pi day. (http://www.angio.net/pi http://www.angio.net/pi ). But this year, I felt lazy, so I abused
by dgacmu 12y ago
I usually try to do something fun for the pi searcher for Pi day. (http://www.angio.net/pi http://www.angio.net/pi ). But this year, I felt lazy, so I abused the RESTful interface I created last year to find the first occurrence of "piday" in Pi, using a very simple alphanumeric mapping (00 == a, 01 == 1, 25 == z, 26 == a, etc.).
The answer is to search for: 1560810050
and check the alpha display below the results. :)
But the method is the part I shouldn't encourage others to use... but, hey, it's Pi day, what's a few more AWS instances up and running? I was too lazy to do this the right way, so I pounded on my own web interface with a quick little python script. Please don't judge me for poor python written quickly the morning of pi day. ;-)
import urllib2
import json
import time
for p in xrange(15, 100, 26):
for i in xrange(8, 100, 26):
for d in xrange(3, 100, 26):
for a in xrange(0, 100, 26):
for y in xrange(24, 100, 26):
time.sleep(0.2)
pistr = '{:=02}{:=02}{:=02}{:=02}{:=02}'.format(p, i, d, a, y)
r = urllib2.urlopen("http://www.angio.net/newpi/piquery?q=" + pistr).read()
dat = json.loads(r)
idat = dat['results'][0]
if idat['status'] != 'notfound':
print dat
sys.exit(0)
- dgacmu 12y ago(Ahem - I should point out for others that I open sourced the pi searcher code a year or so ago, so if you really want to pound on it, you can do it locally, in go -- https://github.com/dave-andersen/pisearch https://github.com/dave-andersen/pisearch )
- Will_Do 12y agoWhere is `{:=02}` documented? I've never seen this before and it's pretty awesome.