Archive for October, 2006

DHTML Digital Clock

Thursday, October 19th, 2006

I saw a spam article on Digg the other day about adding a clock to your webpage – the clocks in question were coded in Flash, and although looked nice, seemed to be rather heavyweight for what they do. This gave me the idea to construct my own digital clock using pure DHTML, as a nice complement to the analogue clock of a few months ago.

This clock consists of a pretty small javascript file, a minimal stylesheet and three images (a horizontal bar, a vertical bar and an animated gif for the flashing dots separating the hours, minutes and seconds). These images can be modified to include anti-aliasing, change of colours, or change of size (although a change of size will require adjustments to the stylesheet).

  • Tested in:
    • IE6
    • IE7
    • Firefox 2
    • Netscape 8
  • Valid XHTML

Source code is available below – feel free to use on your website.

Digital Clock Source Code

Prehistoric Computers

Tuesday, October 10th, 2006

Was sent this letter by Dell yesterday. For some reason I don’t normally even bother opening junk mail like this, but for once I’m glad I did. The very first sentence of the letter made my afternoon!

Dell Letter

Dell XPS M1710

Monday, October 2nd, 2006

My new work laptop is a Dell XPS M1710, which comes with lovely glowing red LEDs all over the place. I was a little bit slow off the mark, but I just assumed that the LEDs were red, and stayed on. But no – it appears that this is not the case. In fact, the LEDs can be controlled by software to change their colour and brightness as desired.

Amongst the Dell Quickset applications delivered with this machine is a program called “Gaming.exe”, which allows the LED states to be configured via a simple user interface. Using a rather nice little program called API Monitor, various people (such as Johannes Brodwall) have managed to reverse engineer the calls to the LED device driver. Johannes’ extremely well written application, whilst very functional, didn’t work perfectly for me (it switched off the touchpad LED completely), and was a little overkill for what I wanted. I therefore decided to have a crack at producing my own version to control the LEDs, by converting Johannes’ C source code into Delphi. Using API Monitor, I was able to work out why the touchpad LED didn’t work on my laptop using Johannes software (I assume the device driver supplied by Dell has been updated slightly).

Feel free to download the complete XPS Source Code or Executable.

Notes

1) To compile the source code, you’ll need the excellent CoolTrayIcon component, available here.

2) To run the application successfully, you’ll need the Dell Quickset utiltity installed.

The worst car in the world?

Sunday, October 1st, 2006

I’m not an expert on cars. I’ve not even driven that many different cars. I’d never get a job as a presenter on Top Gear. However, I’m sure anyone that’s ever driven a Chevrolet HHR will agree that this has to be the worst car ever. It’s just awful, plastic rubbish, it handles like a wheelbarrow, the automatic gearbox is just laughable, the visiblity when driving is like trying to look through a letterbox, and goddamn it’s ugly. What were they thinking when they designed this monstrosity?

Chevrolet HHR

I challenge anyone to find a worse car. And no, the Fiat 126 is not worse than this.

Baseball

Sunday, October 1st, 2006

Whilst over in the States I was lucky enough to be given a ticket to watch the LA Angels play the Texas Rangers. I’m not usually a baseball fan, but this game was great fun, and the seats were excellent right at the front of the stadium. I managed to catch this short video of a home run.

Ubuntu Experiences #4

Sunday, October 1st, 2006

OK – this one had been bugging me for weeks: I just couldn’t get the flash plugin for Firefox working. I scoured the newsgroups, and found many different answers, none of which worked. Under Windows, the whole process is trivially easy, and even under my old Fedora Core 5 install, it was a no-brainer. However in this case, I really struggled. I scoured websites, newsgroups, blog postings, and tried each of the suggested remedies, but nothing worked. Finally, I found a post by “jtpratt”, and I was heartened to find that I was not the only person who was having this issue. JTPratt’s post documents the process s/he went through clearly, and the fix, and I spotted in there where I was going wrong:

During the flash installers process, it asks you to specify the installation path to your browser, and in my case, suggested /usr/lib/mozilla. I checked that this directory did indeed exist, and accepted this default, only to find that the install still had not worked. However JTPratt’s post suggested using “which firefox” at the terminal to find the location of your installation, which reported “/usr/bin/firefox”, a shortcut to “/usr/lib/firefox”. So rerunning the flashinstaller using the correct path has finally fixed the flash issue. I no longer have those annoying missing jigsaw images when I view a flash-laden page. W00t!

Update: Since finally getting the flash plugin to work, I’ve installed FlashBlock for Firefox. After all that effort, the only thing (aside from YouTube and StickCricket) which seems to be written in Flash is a multitude of annoying ads.

Ubuntu Experiences #3

Sunday, October 1st, 2006

OK – MySql. Here’s where it all started to go a little bit wrong. As usual, the installation of MySql was dead easy. The one line command which does it all is:

sudo apt-get install mysql-server

Easy enough, but then MySql needs a little configuration. MySql comes with no root password set, and to avoid any potential security threats, I tried to set one. According to the Ubuntu Dapper Guide, the process is simple:

mysqladmin -u root password mynewpassword

mysqladmin -h root@local-machine-name -u root -p password mynewpassword

sudo /etc/init.d/mysql restart

This all seemed to work fine, but when I tried to log in to MySql, my password was rejected. I am still not sure why I couldn’t log in, but I get the feeling that some of the special characters in the password I chose weren’t recognized. To work my way around this, I needed to stop the mysqld process, and restart it using the –skip-grant-tables option as described here. I’m sure it’s documented somewhere that passwords must not contain the special characters I used, but it certainly wasn’t obvious.