By Tom Fotherby on February 19, 2010

We have just finished and published greekislandpropertyfinders.co.uk which is a modified clone of http://www.heidijoycegardens.com.
Technical details of site:
Posted in Client Work | Tagged GIPF |
By Tom Fotherby on February 18, 2010

On the Bitvolution WordPress theme, the sidebar is quite small (only 220px) and the default WordPress tag cloud widget was producing tags that were clipped in a ugly manner. By default, the WordPress tag cloud widget has a maximum font size of 22px so I was looking for a way to reduce it.
Note: If you are not a theme editor, you might find it easier to just install a suitable tag cloud plugin, e.g. Configurable Tag Cloud (CTC).
The WordPress tag cloud widget already allows you to specify various options including the largest font size, e.g. <?php wp_tag_cloud('largest=18'); ?>
so we only need to create a new widget that overrides the default widget and then unregister the default widget so there aren’t two widgets with the same name in the “Available Widgets” dashboard page. We can register our own widget using register_sidebar_widget and we can unregister the default tag cloud widget using unregister_widget('WP_Widget_Tag_Cloud');
.
This is the code you need – put it in the functions.php file in your WordPress theme folder:
add_action("widgets_init", array('Tag_cloud_withLimitedFontSize', 'register'));
/** Widget - Override the default WordPress tag cloud BUT cap the largest font size to 18 (instead of 22)\
because at 22 some tags don't fit in the sidebar. */
class Tag_cloud_withLimitedFontSize
{
function widget($args){
echo $args['before_widget'];
echo $args['before_title'] . 'Tags' . $args['after_title'];
echo wp_tag_cloud('largest=18');
echo $args['after_widget'];
}
function register()
{
register_sidebar_widget('Tag Cloud', array('Tag_cloud_withLimitedFontSize', 'widget'));
unregister_widget('WP_Widget_Tag_Cloud');
}
}
If there’s a better way to do this, please let me know.
Posted in Technical | Tagged PHP, WebDevelopment, Wordpress |
By Tom Fotherby on February 11, 2010

A website that I was working on suddenly started crashing Firefox 3.6 on my PC (Ubuntu 9.10, 64bit). I’m talking a full out hang with 100% CPU usage and a frozen mouse and keyboard and the only way to recover is to remote login from a 2nd PC and kill the Firefox process.
I found the cause of the crash and it was a single line of recently added CSS code at the top of the websites stylesheet: body { opacity: 0.9999; }
So, if you run a website, be careful of non-100% opacity when it affects many elements. I have hosted a page that reproduces the issue and found a bug that tracks the issue: #279890. This CSS is also a problem on Windows – it causes text to blur horribly in IE 7 in some situations.
What is that CSS for anyway? Firefox 2.0 on Macs used to have a problem where text could dim or get bold or flicker when a animated effect that changed the opacity of an element was used. It was caused because the use of a opacity filter triggered the Gecko rendering engine to switch from the operating system’s method of anti-aliasing to its own internal method. Whenever opacity dropped below 100% the mode switched and resulted in a defect such as a flicker or blink. The fix was simple – all that was needed was to add body { -moz-opacity: 0.9999; }
to the stylesheet because it would force Firefox to use a consistent text rendering method.
Hack == Bug
Posted in Technical | Tagged Bug, Firefox, WebDevelopment |
By Tom Fotherby on February 1, 2010
I didn’t play much single player but we found this game really fun in multiplayer mode, especially 4 player – you have to work together otherwise it’s chaos.
I liked the “bubble mode”, it’s like a get out of jail free but without making it feel like cheating.
Posted in Game Reviews | Tagged Wii |
By Tom Fotherby on January 26, 2010
If you can spot what I find annoying about the following screenshot of an advert I keep seeing whilst browsing around, then you are fabulously geeky (like me):

Google is trying to teach me to suck eggs. They obviously know what Operating system I’m using so I thought they would be clever enough to detect what browser I’m using and serve me something more targeted? What scares me more is that I suspect they are actually paying someone for me to see that advert.
Posted in Journal | Tagged Annoying, Google, Linux |
By Tom Fotherby on January 24, 2010
I was recently on the look out for a nice minimalist WordPress theme. This is the list I came up with:

Posted in Web Design | Tagged List, Wordpress |
By Tom Fotherby on January 20, 2010
I’ve just finished a new webpage called PeoplePerHour Economy that was written about in the mainstream tech press (see bottom half of article):

Technical details:
- The charts and graphs are implemented using the Google Charts API – a simple and extremely efficient method of producing charts.
- The charts (and chart data) are cached over a 24 hour period to take some load off the webserver. The caching is done by some simple PHP code – memcached seemed overkill.
- The UK map is implemented using a 3rd-party image map with polygon co-ordinates specifying each county. The hover-over highlighting is done using a JQuery plugin called mapHighlight.
- The “Job-o-meter” is implemented using a JQuery plugin called jOdometer customised to format the number with commas and animate the digits with some easing. I have made the customisations available via a github fork.
Posted in Client Work | Tagged Design, PeoplePerHour |
By Tom Fotherby on January 10, 2010

A friend of mine is planning to write 52 songs in a year.
It sounds extremely challenging but I love the first three. He’s releasing them under a copyleft license.
Go for it Rob!
Posted in Journal |
By Tom Fotherby on January 9, 2010
Yes – I went outside bare foot in the snow. I saw the cat catch a Robin in the garden and rushed to the rescue. The nice thing about working from home is that you don’t need to wear any shoes.
Posted in Journal | Tagged Random |
By Tom Fotherby on January 6, 2010

For £30, in my opinion this is MUCH better than a iPod because it can play ogg vorbis files. I use it to listen to podcasts at the gym and it’s ideal – it remembers where you got to so you can easily listen to hour long files and the fast-forward is perfect. The clip on the back is the best feature – really handy for cliping to the exercise bike or the ergo handle.
It has 2GB internal memory and a card slot to increase the space if you need it. I have found a big flaw though – if you put too many large files in the memory it freezes when you unplug it from the computer with a message on the screen: “Refreshing your media.” – I have waited for hours for the message to go away but the only way to fix it is hold the power button down for several seconds until it turns off, then plug it back into the computer and remove some of the big files and see if it’s ok again when unplugged.
Posted in Toys | Tagged Exercise, Gadget, Music |
By Tom Fotherby on January 5, 2010

I need to remind myself that there’s no point whining about a shortfalling in a piece of software unless I can be sure the author is aware of it. To that effect, I filed a bug with the Chrome team: #31833. I also submitted a tiny patch for the Jodometer JQuery plugin.
Posted in Tech Journal | Tagged Bugs, Open-source, Software |
By Tom Fotherby on January 2, 2010
I spend half my life with my hand glued to a mouse – so the best one on the market will offer a good return on investment. This one can track on glass (we have a glass coffee table), which demonstrates how accurate and precise it is. The sensitivity is flawless.
Wireless mice are good for cat owners because cats love pouncing on moving wires.
The one pain about this mouse is the battery life – it isn’t good. It seems to last about a month, tops. You have to remember to turn it off every time you stop using it which I find a headache – It would be good if it could turn off automatically when it has been stationary for a few minutes.
Posted in Toys | Tagged Hardware |
By Tom Fotherby on January 1, 2010

I recommend the new Ubuntu 9.10 release (Karmic Koala), it works well on a Sony VGN-AR51E.
Karmic Goods:
- It includes a new piece of software called “Ubuntu One”:
- The Desktop icons have been improved and now use a vector format (i.e. svg instead of png). I was able to use my own icons, created in inkscape, very easily.
- Updated software. Firefox was updated from version 3.0.11 to 3.5 which is faster, supports the video and audio tags and has a private browsing mode. Geany was updated from version 0.17 to 0.18 which handles long filenames better in the Documents pane. Meld has been updated from version 1.2 to 1.3.0 which has better search functionality and no longer seems to lose it’s scroll synchronisation when the window loses focus. The kernel was updated from 2.6.28 to 2.6.31.
- The headphone and microphone sockets now work. So does the DVD eject button on the laptop chassis. Only the 2 user programmable buttons and AV-mode keys still do nothing.
Karmic Bads:
- Startup and shutdown seems slower! This is odd seeing as it uses newer startup software called Upstart that is supposed to be faster! I even installed Grub 2 via https://wiki.ubuntu.com/Grub2 but it didn’t help.
- At shutdown I sometimes get an error: “CIFS VFS: server not responding” which hangs the system sometimes for a while. This is because I have mounted Samba shares in /etc/fstab and when using Wireless, Ubuntu tries to unmount Samba shares after shutting down network services. The bug tracking number is #211631.
- The webcam (MotionEye – Ricoh USB r5u870) didn’t work after the upgrade: /dev/video0 no longer existed!
Fixing the webcam:
The Sony VGN-AR51E laptop comes with a integrated Ricoh webcam. The webcam model number is 05ca:1839 as seen via:
> lsusb
Bus 001 Device 002: ID 05ca:1839 Ricoh Co., Ltd Visual Communication Camera VGP-VCC6 [R5U870]
Current kernel info:
> uname -a
Linux psyduck 2.6.31-16-generic #53-Ubuntu SMP Tue Dec 8 04:02:15 UTC 2009 x86_64 GNU/Linux
Useful commands and logs that give info about the problem:
> dmesg | less (or less /var/log/kern.log)
[ 19.367070] uvcvideo: Found UVC 1.00 device (05ca:1839)
[ 19.367573] uvcvideo: UVC non compliance - GET_DEF(PROBE) not supported. Enabling workaround.
[ 19.367786] uvcvideo: Failed to query (129) UVC probe control : -32 (exp. 26).
[ 19.367789] uvcvideo: Failed to initialize the device (-5).
[ 19.367824] usbcore: registered new interface driver uvcvideo
[ 19.367828] USB Video Class driver (v0.1.0)
The problem seems to be that the webcam drivers were not packaged for Ubuntu 9.10. In the previous version (Ubuntu 9.04) the webcam used the r5u870 V4L2 driver but it was deprecated and replaced in Karmic by a kernel module called R5U87x. R5U87x should be better because it is a set of userland tools that loads the firmware for all UVC compliant devices and makes them work with a more standard uvcvideo driver. Unfortunately, the R5U87x tools were not packaged in time for Karmic because the firmware images contained in the package didn’t have a suitable license to allow redistribution. i.e. the original working r5u870 driver was not packaged but nor was the newer R5U87x driver! This is all documented in Bug 120434.
Current (Dec/09) fix:
Add necessary encryption keys needed for software download:
gpg --keyserver keyserver.ubuntu.com --recv 9711AB5F
gpg --export --armor 9711AB5F | sudo apt-key add -
sudo apt-get update
sudo apt-get install r5u87x
Now run the script that will download the necessary webcam firmware:
sudo /usr/share/r5u87x/r5u87x-download-firmware.sh
Test with a application such as Cheese (or gstreamer-properties or xawtv or skype).
In Skype, audio works but video still doesn’t until you add yourself to the “video” group (the file permissions of /dev/video* is group read and writtable for the “video” group):
sudo usermod -a -G video tom
Other tweaks:
The Ubuntu splash screen is nice but I prefer to see what the computer is doing. To turn off the splash screen do:
Posted in Tech Journal | Tagged Ubuntu |
By Tom Fotherby on December 28, 2009
Wii, Duck hunt (Light gun), 6/10

When you buy this game you know what you’re going to get. And you get it. And yes, they went overkill on everything, especially the gore and the clichés and the bad language. The story is entertaining if you like Shaun of the Dead.
I like the gun shop – it makes the game have a bit of variety when you can choose a different gun for the level.
My main bone to pick is that it is extremely difficult to calibrate the light gun. I was trying to calibrate the official AMS Hand Cannon through the in-game calibration settings. Why is it so hard? It was way off on the first million attempts. However after 30 mins of trying, I managed to get it spot-on. It was just a random success. So I suggest you patiently re-try and re-try until it just works (for reference, the TV was a Samsung UE40B7020W).
Posted in Game Reviews |
By Tom Fotherby on December 21, 2009
Today, I found out about a WordPress plugin called Elastic (http://elastictheme.org/, download link) which is a WYSIWYG theme editor for WordPress.
It looks like a very promising technology to make it easier to develop WordPress themes. I’m interested in re-useable modules so, if I develop something interesting for one client, I can re-use the same something for a different client with 1-click (therefore being able to quote them a reduced price). Plugins and widgets achieve this to some extent but Elastic aims to make the same possible at a more fundamental level.
Posted in Journal | Tagged WebDevelopment, Wordpress |