Difference between revisions of "User:Geekthras"

From Geohashing
imported>Geekthras
(shit reformatting as soon as I can figure this out :()
imported>Geekthras
Line 1: Line 1:
 
Woo woo! I is here!
 
Woo woo! I is here!
Yeah, no car = fail. I'll get there whenever possible, but that's not very often - if it's within maybe 10-15 miles of my house I'll bike. I made a script which tells me approximate distance in miles and opens up a google maps map googles. Erm.  
+
In the Boston Graticuzzle!
 +
Yeah, no car = fail. I'll get there whenever possible, but that's not very often - if it's within maybe 10-15 miles of my house I'll bike, or sometimes take the T. I made a script which tells me approximate distance in miles and opens up a google maps map googles. Erm.  
  
  
import datetime
+
Status on Geohashes:
import md5
+
Reached: '''0'''
def hexdec(s) :
+
Missed: '''3'''
    fract = 1/16.0
+
Saturdays: '''0'''
    z = "0123456789abcdef"
+
Missed because...
    return sum(z.index(s[i])/(16.0**(i+1))for i in xrange(len(s)))
 
def run(dow, date="", d = ""):
 
    now = datetime.datetime.now()
 
  
    if d != "" :
+
Attempted, but inaccessible (water, etc.): '''0'''
        now = d
+
Out of range: '''0'''
    year = str(now.year)
+
School: '''3'''
    month = str(now.month)
+
Other commitments: '''0'''
    day = str(now.day)
 
    if len(day) == 1 :
 
        day = "0" +day
 
    if len(month) == 1 :
 
        month = "0" + month
 
    if date != "" :
 
        year = date.split("-")[0]
 
        month = date.split("-")[1]
 
        day = date.split("-")[2]
 
    string = "-".join([year, month, day,str(dow).replace(',',' ')])
 
    m = md5.md5(string).hexdigest()
 
    offset =(hexdec(m[:16]), hexdec(m[16:]))
 
    wkday = now.weekday()
 
    if wkday == 4 :
 
        r = run(dow, d=now+datetime.timedelta(1))
 
        print dist(r, (42.CENSORTED,-71.CENSORTED)), r
 
       
 
    webbrowser.open_new_tab(geturl((42.CENSORTED,-71.CENSORTED),(42+offset[0], 0-(71+offset[1]))))
 
   
 
    return (42+offset[0], 0-(71+offset[1]))
 
def geturl(s,e) :
 
    return "http://maps.google.com/maps?f=d&hl=en&geocode=" + str(s[0]) + ","+ str(s[1]) + "&saddr=" + str(s[0]) + " ,+-" + str(abs(s[1])) + "&daddr=" + str(e[0]) + ",+-" + str(abs(e[1])) + "&mra=mr&mrcr=0&dirflg=h&sll=" + str((s[0]+e[0])/2) + "," + str((s[1]+e[1])/2) + "&ie=UTF8&z=10"
 
  
   
+
2008-05-21 -- Missed due to school
import socket
+
2008-05-22 -- Missed due to school
 
+
2008-05-23 -- Missed due to school
import urllib
+
2008-05-24 -- Likely miss due to birthday party
s = urllib.urlopen("http://money.cnn.com/data/markets/dow/")
 
q = s.read()
 
s.close()
 
import re
 
import math
 
import webbrowser
 
a  = run(re.findall(".*?Open.*?([0-9\.,]+).*", q)[0].replace(',',''))
 
b = (42.CENSORTED,-71.CENSORTED)
 
def dist(z, me) :
 
    dy = 26000*(z[0] - me[0])/360
 
    r = 26000*math.cos(math.radians(me[0]))
 
    dx = r*(z[1]-me[1])/360
 
    return ((dx**2)+(dy**2))**0.5
 
print dist(a, b), a
 
print geturl(b, a)
 

Revision as of 04:27, 24 May 2008

Woo woo! I is here! In the Boston Graticuzzle! Yeah, no car = fail. I'll get there whenever possible, but that's not very often - if it's within maybe 10-15 miles of my house I'll bike, or sometimes take the T. I made a script which tells me approximate distance in miles and opens up a google maps map googles. Erm.


Status on Geohashes: Reached: 0 Missed: 3 Saturdays: 0 Missed because...

Attempted, but inaccessible (water, etc.): 0 Out of range: 0 School: 3 Other commitments: 0

2008-05-21 -- Missed due to school 2008-05-22 -- Missed due to school 2008-05-23 -- Missed due to school 2008-05-24 -- Likely miss due to birthday party