Hang Firefox 3 on Mac with Firebug

July 4, 2008

This 2-line web page will hang Firefox 3 with Firebug on a Mac:

<body onload="debugger">
<img src="">

(With Firebug scripting enabled)

This completely hangs the Firefox user-interface, so you can’t access your other tabs. The only thing to do is a Force-Quit. I reported the bug but unfortunately I just don’t have the time and energy to learn how to fix it myself. Hoping somebody out there might have some useful insights.

MapIt – a Freebase Google Maps builder (updated)

May 31, 2007

My latest version of MapIt has a better GUI. Less black-magic going on now.

Try it (probably Firefox only for now)

mapit builder

Building a query:
origin of rivers + image



Resulting mashup
showing Freebase rivers on Google Earth

Example maps:

Let me know if you manage to build any interesting maps. Feedback and bug reports very welcome.

Mapit – a Freebase Google Maps builder

May 14, 2007

 Sorry, this program no longer works. I’d love to fix it but I really don’t have time right now.

Mapit is my first attempt at a usable map-builder for Freebase. The goal is to enable ordinary users to build their own Freebase / Google Maps mashups. (Freebase account required – ask me if you need an invite. Tested on Firefox) Mapit screenshot I spent most of the weekend underground so I didn’t have much time to work on the GUI. It would be great to make something like Yahoo Pipes. But even this work-in-progress version of Mapit is pretty powerful. My previous map of Freebase Users can now be generated in 6 mouse clicks. Examples:

I know that there is loads of scope for improvement and bug fixes. Comments very welcome.

 Sorry, this program no longer works. I’d love to fix it but I really don’t have time right now. 

Playing with Freebase – List of television spin-offs

April 24, 2007

I started playing with Freebase a few days ago. It’s like a cross between the Wikipedia and a database. It also has an API and a Javascript template language MJT.

Yesterday Alec Flett suggested using the API to make a list of television spin-off shows using the API and MJT.

Here’s the hand-written page on the Wikipedia: List of television spin-offs

Here’s my auto-generated list. (Freebase account required). It’s the first time I’ve written anything using MJT. Feedback very welcome.

Screenshot of auto-generated TV Spinoff list

Here’s a screen-shot to prove that it works 😉

How the code works:

  1. Execute a query for all TV Programs with Spin-offs
  2. Create a hash-table of programs that are spin-offs
  3. Display all the root TV programs
  4. Display all the spin-off TV programs
  5. For-each spin-off, move its DOM element to be a child of its parent TV program

The program also highlights the 30-odd TV Programs with claim to be spin-offs of themselves. Looks like the data could do with some cleaning up.

Bugs to fix:

  • Internet Explorer support (currently only works in Firefox)
  • Alphabetically sort sub-branches of tree as well
  • Stop using Wikipedia CSS file
  • Find a more elegant way to invoke Javascript after a database query finishes

Updates: Nov 07 – fixed broken link

Javascript RegExp Unicode Character Class Tester

February 14, 2007

Javascript developers can test regular expressions against all unicode characters with my Javascript RegExp Unicode Character Class Tester

Very useful if you need to know exactly which characters  match a RegExp like /\s/

Interesting results from Firefox 2

  • \d matches 159 digit characters from many alphabets (not just Basic Latin)
  • \s matches 22 different types of whitespace: [\t\n\v\f\r \u00a0\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u2028\u2029\u3000]

Useful docs:

Hope you find this useful and feel free to leave comments.