Archive for June, 2009

geolocation in Firefox 3.5

I came crossed geolocation feature that was introduced in Firefox 3.5. That is very neat functionality that marketings will love for targeted ads. And also for web developer/engineers, it’s something that we can customize the web content based on the users’ location.

It used to require somewhat complex process to get (not technology side tho) the information.

Anyways, in this link you get to see how to access the core API for.

And then here’s the properties of position object:

  • QueryInterface
  • coords : xpconnect wrapped
  • timestamp
  • getInterfaces
  • getHelperForLanguage
  • contractID
  • classDescription : wifi geo location position object
  • classID
  • implementationLanguage
  • flags : 8
  • SINGLETON : 1
  • THREADSAFE : 2
  • MAIN_THREAD_ONLY : 4
  • DOM_OBJECT : 8
  • PLUGIN_OBJECT : 16
  • EAGER_CLASSINFO : 32
  • CONTENT_NODE : 64
  • RESERVED

And interestingly position.coords has some unique properties:

  • QueryInterface
  • latitude
  • longitude
  • altitude
  • accuracy
  • altitudeAccuracy
  • heading
  • speed

As you can see it has speed property. So in theory, with the available properties you can make GPS system on the web.

pretty xml & json

I was working on a feed project at work and dealing with lots of XML and JSON data. If data were well indented and formatted, my tasks would have been a lot smooth. However, the reality was not like how I imagined as usual.

At first I googled about it. I kinda found one but the application required actual file, which could be okay. However, I could see myself copying and pasting xml into a file and upload, which is not quite ideal.

So I decided to make one for myself and my tasks. Let me know if it works well for you or you find a bug.

Here they are:
http://www.shinstudio.com/tools/pretty-xml
http://www.shinstudio.com/tools/pretty-json

haven’t written anything for more than 1 month!

Honestly I’ve been too bush with my full time work. You know when you have a full time job, you become really busy for anything else unless you slack. :P

At work, I’m doing some platform migration work for the news section of Yahoo TV these days. That’s all I can say. This work does not enhance the page features at all. It’s “migration” work. That’s all. It gives me some challenges though, which keeps me interested at least.