MapMyGlobe

Archive for February, 2008

Geolocalization, Geolocalisation, Geolocation?

Wednesday, February 27th, 2008

For a while I’ve been wondering which one (if any) of these terms is proper english. The first two ones appeal to French speakers like I am (the French word being “Géolocalisation”), but it turns out they’re as far from Shakespeare’s language as it could get. On the other hand, the third one, Geolocation, is designated by Google, and therefore by the Wisdom of the Crowds, as the proper one :)

Here at MapMyGlobe, we use a tiny bit of IP geolocation (or more accurately, we’ll use it in the next release) to position a pin for the user when he creates his own profile page.

IP Geolocation is also a very important piece of my other project, MapMySearch, a mashup that enables you to locate on a map, the servers hosting the top results of your search in Google.

Gmail Homepage’s Quota estimate

Tuesday, February 26th, 2008

I was curious about how the quota counter on Gmail’s homepage (you know, the one before you log in, that’s updated every second) worked, so I had a quick look at the source, and it proved pretty interesting. First, it’s one of the few scripts I’ve seen from Google that’s not obfuscated. Then, it turns out they use linear interpolation between some past storage values and estimated future storage. The joke is that they have a storage estimate of Number.MAX_VALUE in Year 3456 :)

gmail-logo.gif

A brilliant summary of how storage estimates evolved over time can be found on Zvi Devir’s page. He also points out the Sci-Fi inside joke comment in the interpolation array definition from the geeks over at Google: // Estimates of nanite storage generation over time. :) And finally, a function called updateQuota() is called every second to change the quota value on the webpage via DOM scripting.

Another interesting thing in this script is how they get a value of Round-trip Time (RTT) between your browser and their server and store it in a cookie for future use. They do that by loading an image of size 0, and by looking at the time span between when they start to send it and after they receive it. Well, strictly speaking, depending on your connection’s bandwidth this estimate can be higher because you have to send all the bytes in the request and get all the bytes in the response (when strictly speaking RTT is for one Bit) but I guess the estimate is good enough that way. In my case Gmail’s RTT varies greatly, from values as low as 172ms to as high as 3s. For reference, the code they use is:

var ONE_PX = "https://mail.google.com/mail/images/c.gif?t=" +
  (new Date()).getTime();

function LogRoundtripTime() {
  var img = new Image();
  var start = (new Date()).getTime();
  img.onload = GetRoundtripTimeFunction(start);
  img.src = ONE_PX;
}

function GetRoundtripTimeFunction(start) {
  return function() {
  var end = (new Date()).getTime();
  SetGmailCookie("GMAIL_RTT", (end - start));
  }
}

MapMyGlobe under construction

Sunday, February 24th, 2008

MapMyGlobe’s code is undergoing a lot of work these days. I will tell you more about it in the coming days, as I roll out the new functionalities and improvements. But what I can tell you now, is that I am feeling that I know very precisely what I need to change to make the app more efficient, more robust, and above all, simpler.

sunshine.jpg

Stay tuned!