This will be, hopefully, the first of a few more technical blog posts. It's grand detailing the minutia of my life but occasionally I need to think through a problem or two, and the results can be interesting.
I'm currently writing an Android app in my spare time. I'll skip the details of what the app does for now, but I'm working with location information (GPS coordinates) and I'm passing around results from the phone to a database.
While converting from numbers to strings (part of the HTTP POST code) it dawned on me that, as previous experience has shown, trying to keep precision in numerical values while they are represented as strings often has issues. I'm writing out a double to a string in Java - that's all good. I can pull that back into the GAE python code as a double - in python, floats are double precision by default. Next question - what precision does the GeoPt GAE datatype honour? the docs simply say "floating point" - is that single precision or double precision? Assuming it's talking about the python type rather than the java type, hopefully it means double precision.
This might sound nit-picky, but given the range of values for longitude (-180.0 through 0 to +180.0) the precision of the number can make the difference between microns and metres in world space.
For single point values, If you're working around the zero line (at the Greenwich royal observatory) then the most precise value is around 2^-127 - a very small number indeed. in decimal, this is equivalent to 10^-38, so given the required precision in decimal degrees , this is so small there's no named SI prefix for it.
If you're on the other side of the world, however, then you're plus or minus 180 degrees, give or take some precision. this gives us a fixed exponent (2^7) and values for the lowest significant bit of the mantissa in the range of 0.000015, give or take - so if you add a single insignificant bit, you're moving your geo point by around 1.5 metres. That's not insignificant.
Doubles add another whole stack of zeros here -it's safe to say you've got at least 10 zeros before your changed value shows up, which is sub-millimetre accuracy - safely inside the tolerance of any real world geo fix, and probably good enough for any spacial positioning work that's trying to correctly locate physical space. So that's good to know!
Monday, May 2, 2011
Friday, April 22, 2011
Fantastic day
Today, while being something of a downer for Jesus with the cross and the nails and all that stuff, was an absolutely glorious day for me, the missus and the bairn. We spent a lovely afternoon up on Devil's Dyke with Jay, Sal and Jack, eating steak, drinking G&Ts and watching the world go by. Gabe ate enough for three babies, certainly considerably more than Jack did. He also met his first real live horse.
It's a long break for me now (and who knows?!) so I'm going to get stuck into the side projects I've had on the cards for months now. Advice abounds.
It's a long break for me now (and who knows?!) so I'm going to get stuck into the side projects I've had on the cards for months now. Advice abounds.
Friday, April 8, 2011
What a couple of weeks
it's been a mental couple of weeks. Big changes for me personally at work, along with some sun. Bought a Kindle - that's pretty cool. Gabe properly running around now, he's pretty much walking at all times now indoors.
Wednesday, March 23, 2011
Oh Canada
An old friend offered us accomodations in Montreal, and we'd have been crazy to pass the opportunity up, so we came over for a visit. As per usual, I wasn't sure what to expect, other than what we saw on google street view. I had the impression that people would be fairly evenly split between french and english speaking natives in the city, which mostly held out for spoken conversations. The metro system, advertising, signposts on streets, etc were all (or virtually all) in french - which after a day or two wasn't really too hard to work out for the most part. I can pick together halves of most sentences, but not quite everything. It's reinforced my belief that if I ask people to speak slowly, I can mostly understand. I can't converse in the language to save my life, which is unfortunate.
I wish I'd had a decent roaming data plan instead of this (admittedly fantastic while in the UK) O2 PAYG data plan - We had access to complimentary internet but that's no use whatsoever when you're out and about - and that was where we needed it most - for looking up locations on the map, checking train times, translation services, that sort of thing.
One of the big lures of a smart phone is that it's a utility device (at least the way I use mine, anyway). It's effectively an extension of your brain, a streetmap, a location service and more. None of that is available to you if you can't get data into the thing, which is a real shame - with the amount of local storage I've got on the box, I should be able to cache huge amounts of relevant data (like all of the google map data for a location and the surrounding area, or translation dictionaries, that sort of thing). For cloud services like live audio transcription, sure, you'll need a net connection. Next time I'll be more prepared. I certainly didn't expect to be paying close to a pound per text.
As for Montreal itself - well, I think we're still digesting whether we really like it or not. We certaily saw some beautiful things, and some areas of the city were a delight to walk around. Other areas were pretty grim, which I'd expect from any city really but it certainly wasn't what I expected from the ends of the metro lines - in most cities that takes you far enough out to be in the suburbs - not Montreal.
The important part was seeing some snow - and even better, watching it fall while sitting in a jacuzzi ;)
Definitely an eye opener of a visit.
And like usual, the travel aspect (the portions outside of our direct control, at least) have gone to hell, and we're apparently waiting for a pilot to arrive from Toronto. We're looking at another couple of hours sitting in the bloody airport, listening to other people's music, screaming children, and plagued coughing and sneezing. have I ever told you that I hate people in general, and all humans in particular?
Apart from the nice ones, that is. And maybe the pretty ones. They get a free pass.
I wish I'd had a decent roaming data plan instead of this (admittedly fantastic while in the UK) O2 PAYG data plan - We had access to complimentary internet but that's no use whatsoever when you're out and about - and that was where we needed it most - for looking up locations on the map, checking train times, translation services, that sort of thing.
One of the big lures of a smart phone is that it's a utility device (at least the way I use mine, anyway). It's effectively an extension of your brain, a streetmap, a location service and more. None of that is available to you if you can't get data into the thing, which is a real shame - with the amount of local storage I've got on the box, I should be able to cache huge amounts of relevant data (like all of the google map data for a location and the surrounding area, or translation dictionaries, that sort of thing). For cloud services like live audio transcription, sure, you'll need a net connection. Next time I'll be more prepared. I certainly didn't expect to be paying close to a pound per text.
As for Montreal itself - well, I think we're still digesting whether we really like it or not. We certaily saw some beautiful things, and some areas of the city were a delight to walk around. Other areas were pretty grim, which I'd expect from any city really but it certainly wasn't what I expected from the ends of the metro lines - in most cities that takes you far enough out to be in the suburbs - not Montreal.
The important part was seeing some snow - and even better, watching it fall while sitting in a jacuzzi ;)
Definitely an eye opener of a visit.
And like usual, the travel aspect (the portions outside of our direct control, at least) have gone to hell, and we're apparently waiting for a pilot to arrive from Toronto. We're looking at another couple of hours sitting in the bloody airport, listening to other people's music, screaming children, and plagued coughing and sneezing. have I ever told you that I hate people in general, and all humans in particular?
Apart from the nice ones, that is. And maybe the pretty ones. They get a free pass.
Thursday, February 24, 2011
Watching from afar
Nic and I just watched Discovery STS 133 launch on a really short window (2 seconds left). What a fantastic piece of technology, what a fantastic view of the launch and what an amazing process involved to get the bird into space.
I'm totally gutted that we didn't get to see it launch from the causeway - I'll be mounting the tickets and putting them up on the wall somewhere, as that's our only link to how close we came to watching it live.
Good luck to you, Discovery crew.
I'm totally gutted that we didn't get to see it launch from the causeway - I'll be mounting the tickets and putting them up on the wall somewhere, as that's our only link to how close we came to watching it live.
Good luck to you, Discovery crew.
Saturday, February 19, 2011
Legends
LoL has sucked me in, somewhat. Halfway to 30 now, enjoying playing a game competitively again. SC2 just freaks me out too much to play properly competitively - at least with LoL there's other folks to rely on to carry the game.
Gabe is so close to walking properly - he keeps taking a couple of steps then dropping to the floor. What a lazy boy.
Gabe is so close to walking properly - he keeps taking a couple of steps then dropping to the floor. What a lazy boy.
Friday, January 28, 2011
It doesn't matter which side you are on ...
If you go around shooting guns or blowing stuff up and you kill innocent people in the process - you're a bad guy.
Subscribe to:
Posts (Atom)