
After the earlier report about October, I was really ...optimistic
IT conservations: Jelly Bean on its way: From The Verge : The Taiwan-based manufacturer also revealed that a Jelly Bean update for the HTC One X and One S will arrive in Oct...
My thoughts on IT, the internet, mobile, open source etc.
IT conservations: Jelly Bean on its way: From The Verge : The Taiwan-based manufacturer also revealed that a Jelly Bean update for the HTC One X and One S will arrive in Oct...
u = yahooURL+"?appid="+yahooAppidyFrom Y! we get some fine XML back and use XPath to access the geo coordinates
u += "&postal="+po.zip
u += "&city="+po.city
u += "&street="+quote_plus(unicodedata.normalize('NFKD', po.addr).encode('ascii','ignore'))
u += "&country=Austria"
doc = ElementTree(file=urlopen(u))So now we have the geo coordinates of all the underground stations and all the post offices.
lat = doc.findall('.//Result/latitude')[0].text
lon = doc.findall('.//Result/longitude')[0].text
select haversine(p.lat,p.lon, u.lat,u.lon) as distance, p.plz,p.street,p.lat,p.lon,u.station,u.lat,u.lon
from ubahn.post p, ubahn.stationen u
where haversine(p.lat,p.lon, u.lat,u.lon) <1
order by 1 asc
fetch first 20 rows only
CREATE FUNCTION HAVERSINE( lat1 decimal(10,8), lon1 decimal(10,8), lat2 decimal(10,8), lon2 decimal(10,8))
RETURNS DECIMAL(15,8)
F1: BEGIN ATOMIC
declare dlat, dlon, a, d double;
set dlat = radians(lat2-lat1);
set dlon = radians(lon2-lon1);
set a = sin(dlat/2) * sin(dlat/2) + cos(radians(lat1)) * cos(radians(lat2)) * sin(dlon/2) * sin(dlon/2);
set d = 2*6367*asin(sqrt(a));
return d;
END