Archive for April, 2007

Changing the load order of a webpage

I had an exciting weekend of writing a wonderful ‘webcast’ system. Although it worked fine over the LAN, I found I had a problem when I uploaded it to the internet. The problem as a little weird. The system work by loading a bunch of images then used a version of 1pixelout‘s mp3 flash player to play the audio. The problem I had was that half the images were loading, then the flash started loading. A user would then have to wait until the mp3 had finished playing before the final images were loaded.

I searched high and low on the net to see if there was a magical way to control the loading order. In the end I found this really elegant solution to load the flash as the last item.

In your style sheet, give the style you want to appear last: display: none;Then in the body tag change the display to block using onload:document.getElementById('audio').style.display = 'block';"

I’ve tested this in Firefox and IE on both Linux and Windows and it seem to work perfectly.

Lovely test data

I’ve spent most of my weekend thinking up names. Am I having a baby? NO! Do I need a killa handle for my next l33t project? No. Am I thinking of running away and setting up a new life for my self living in a tree? Yes, but that not why.

The reason I’ve been thinking up new names is I’ve been testing my latest, greatest app and needed to fill it with test data. I hate thinking of test names. Normally I end up with bob, bob1, bob2 or my favourite piece of test data “rich is gay”. That’s fine if you just want a few test name, but what if you want say 1000 or 2000 or 10,000. That were Benjamin Keen‘s Data Generator comes in. It’s a little script that create random data perfect for shoehorning in to any app you want. It will even output CSV, MySQL, XML, Excel or HTML and best of all it’s GNU

I’ve put a copy at http://www.deaconsworld.org.uk/datagenerator/ to try and save him some bandwidth.

Extreme ASCII Art

LibcacaWhilst procrastinating over yet another dead line, I thought I’d have a play with libcaca, the completely useless yet completely brilliant Colour AsCii Art library. libcaca is a graphics library that output text rather than images. The genius part of it is that you can use it as a video output in mplayer and display all your wonderful HD videos as text!

I always love stuff like this. You can see how much work as gone even though it’s a complete waste of time. It’s a similar idea to NetQoS‘ Network management display which again is great but completely useless. Check that out here http://www.techcrunch.com/2007/04/10/watch-your-network-play-space-invaders/

Return top