Tag Archives: Programming

Extension experiment

Just recently I’ve been using Google Chrome more and more as my primary web browser, but there’s one thing that really frustrates me about it.

I tend to have a lot of tabs open, with around a dozen or so “would like to read” tabs and a widely varying number of tabs related to my current task. Even when I use several browser windows I soon find myself with 15 or more tabs in the current window.

As the number of tabs increases in a Chrome window you’re left with only the favicon by which to distinguish their contents, that’s if they have a favicon at all.

I decided that doing something about this would be a good opportunity to do a little light hacking and so set about writing a Chrome extension. It has been a couple of years since I wrote any JavaScript, and I still find the code I produce with it to be terribly ugly, but it only took an evening to whip something usable up.

There are a couple of things I’d like to fix:

  • Visually differentiate the active tab.
  • Visually differentiate pinned tabs.
  • Chrome gives focus to browser action popups and this falls through to the first anchor – I don’t like how this looks so need to do something about that. That being said I don’t actually think I want or need that element to be an anchor at all…

All that being said, I wrote this last night on the sofa and it’s already proving its worth. If I fix it up any more and figure out how to write less ugly JavaScript I may publish the code somewhere.

make frustrated

November saw the release of Fedora 14 which includes the new and improved GNU make 3.82, this includes some fixes for long standing bugs in the parser – and therefore breaks dozens of projects’ Makefiles.

Common signs of the new, strict, make are the following output at make time:

Makefile:246: *** mixed implicit and normal rules. Stop.

This means you have both explicit and pattern targets in your make rule, this caused issues if explicit targets where used in the rule *after* pattern targets make could misparse the entire rule – of course, make had been doing this for long enough that everyone knew to avoid doing that…

Makefile:923: *** missing separator (did you mean TAB instead of 8 spaces?).  Stop.

Make has always required tabs, rather than spaces, for indentation. But in previous versions of Make it was permissible to use 8 spaces instead of a tab. This is no longer allowed in make 3.82!

Whilst the Makefiles of most projects have been updated we where bitten by this pretty hard where our stable release of Poky Laverne 4.0, released October 26th, can’t be built on Fedora 14. Ouch!

So this week, I donned my distribution engineer hat and set about resolving these issues, I had to hack the Makefiles of some dozen or so projects (and even did some guerilla pushes to Gnome git).

The need to do this has left me extremely frustrated, these bugs have existed in the parser for long enough that they had been widely relied upon in many projects – to ‘fix’ the parser and therefore break the Makefiles of so many projects feels like a pretty severe move to me. Could this not have been a warning in make 3.82 and turned into an error later?

This is the second case of upstream introducing regressions that have hit us in Poky recently, the first being an regression in Python 2.7’s xmlrpclib which changed the way some private methods worked (parse_response() would no longer accept a file-like object) breaking our XML-RPC server…

Unfortunately this bug was not fixed for Python 2.7.1, but has since been fixed upstream.

Whilst I’ve ranted here I do really appreciate both of these open source projects and my knowledge with both Makefiles and Python programming has increased whilst debugging and working around these issues for Poky. There’s still a part of me that wishes I hadn’t had to do it, though!

Find nearest tube station

When I first released Blunderground I put together a ToDo in the README of cool features I could implement if I get some time, one of which read: “Zoom to nearest station (get location from OSM)”.

Well, Neil recently got a Pre and decided that a good way to learn the WebOS API’s etc would be to contribute to Blunderground, and contribute he did – with an awesome patch to implement a “Jump to Nearest” button!

This adds a huge data file to Blunderground (> 1000 lines) that includes all the required data to find which tube station is nearest to the devices current GPS location and then zoom the map to that station.

I then decided to steal some glory from Neil by converting the main map to be a HTML canvas (rather than an img tag) and adding some slight bling for his feature:

The overlay will dissapear after 10 seconds, which could probably be handled in a nicer way…