Archive for November, 2006

Nov 24 2006

Back From The Brink

Published by under PHP,Site Work

Its nice to use a hosting service that keeps its customers informed.  Yesterday, just as I was about to leave work I noticed that my blog was offline. I hunted high and low last night but could I find the problem? Could I hell!

I’ve finally found the solution.  It seems that my hosting company silently upgraded both the PHP4 and PHP5 (although I only found a notice about the PHP5 upgrade.  Else where on teh intawebs I found the the latest version of PHP5 has got short PHP tag disabled, therefor <? ... ?> is not allowed, instead you have to use the long format <? ... ?>.

Now, don’t get me wrong, I don’t have a problem with using the long format, infact I prefer it. However, my hosting company (in its infinite wisdom) has decided to not show errors in the browser, instead I have to go to my hosting control panel, and the errors that are logged by PHP is simply:

PHP Parse error: syntax error, unexpected $end in [filename] on line 6

Why, oh why, can’t the error be something like “PHP Parse error: short tags disabled”.  That would have caused a lot less frustration on my part and for everyone that reads my blog.  Now I have to go through the rest of my site and try to find where else short tag have been used for PHP…. argghhhh!!!!

No responses yet

Nov 23 2006

More MySpace Bulletin Reposting

Published by under General

I’ve been thinking again about reposting MySpace bulletins and, in particular, the self counting bulletin (which I’ll use as the basis for this article).  When I came across the self counting bulletin I had to click on a link within the bulletin in order to repost it, I then had to click on the confirmation link in MySpace to say that yes I did want to post the bulletin.

The link in the bulletin sent my browser to another site that posted a fake bulletin form back to MySpace for me to confirm posting.  What I have been thinking is, would it be possible for the off site page to load the MySpace confirmation page into a frame and use javascript to click the confirmation link?  I haven’t had a chance to look into this yet so I have no idea if this is possible or not, but it sure would be neat if you could.

7 responses so far

Nov 17 2006

A Trip Down Memory Lane

Published by under General

Following on from my Google Earth plot of my never to have been last day in Norway, I have embarked on a project to plot my actual journey home through Norway.  So far its take about 5 hours spread over three evenings and I’ve got as far as Stryn – the town I stayed in the night before my crash.

Just as I was sitting down last night a thought occured to me… why didn’t I use the route finding capabilities of Google Earth rather than manually plotting the line from corner to corner to corner.  My reasoning for carrying on at that point in time was because I come so far I may as well continue.  However, as I plotted more of the route I realised why I should plot it rather than use the route finder, as I was plotting I was taken back to my time in Norway.  I remembered going round particularly sharp corners, and places I had to stop on narrow roads because the coaches sure as hell weren’t going to stop, and high passes which were stunningly beautiful but all I could think at the time was “i-i-i-itssss f-f-f-fuuuck-k-king fr-fr-fr-freeeezing!!!!!”.

Whilst I have wanted to go back to Norway and finish the job properly simply because I was hacked off by the crash, I now want to go back and do it because I remember now how stunningly beautiful the place is.

Thank you Google Earth!

2 responses so far

Nov 14 2006

Service Path To Executable

Published by under General

Today I’ve been editing and testing a Windows Service application.  I’ve got my system setup so that whilst running in debug mode the application runs as a command line application, so that the debugger automatically connects to it rather than me having to manually connect the debugger to the service every time I want to test my code.

When I switch to Rlease mode the application gets compiled as a service and is automatically started using a post-build action.  This is where I ran into a problem.  Its been a while since I last ran the service on my machine and the release exe location has changed since then and the service starter complained about to path to exe being incorrect.  I could have re-installed the service but I thought it would be easier (and better) to change the location of the currently installed exe.

This is a lot easier than it sounds and can be accomplished with the good ole regedit.  Just click on Start Menu -> Run and enter “Regedit” (sans quotes).  Then you need to navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\[Name of Service].  To change the location of the exe just change the ImagePath key.

Please note that directly editing the registry with Regedit can completely balls up your machine and prevent it from starting.  If in doubt seek professional help, so you can blame someone else if it all goes tits-up.

19 responses so far

Nov 09 2006


Published by under Links

Those of you that have to listen to my music on a regular basis will know that I’m a stickler for a good mashup and today I think I found my musical heaven.

Its a site called Mashup.Podcast which does exactly what it says on the tin. Its a podcast made by a bloke that, like me, likes mashups. I’ve only listened to half a podcast so far but what I’ve heard I like… although there does seem to be a little too much talking for my liking. Having said that I may actually learn something about mashups, like who’s doing them and where to find more of them!!!

Check out the site @

No responses yet

Nov 09 2006

Disecting A Self Counting MySpace Bulletin

Published by under PHP

I came across a MySpace bulletin that announced itself as “The only bulletin that counts how many times its been posted!”. If read someone elses bulletin all you need to do is click the link at the bottom and it loads up your own bulletin posting form for you to repost the bulletin with the latest posting count.

Being the inquisitive sort of person I am [trying to be]. I decided to take a look at how the bulletin works. Whilst it appears to work by magic, the code behind it is very simple. The link that you click in the bulletin to repost it is actually a link to This page contains a form on it that is the same as the MySpace bulletin posting form (only on a different server). The user never sees this form, however, as when the page is loaded javascript on the page automatically submits the form to MySpace.

But how does the count get updated? That’s very simple and comes down to three lines of code:

$count= read_file("count.txt");

What happens is when you click the repost bulletin link, the bullcount.php page opens up the count.txt file, reads the number, adds one and saves the number again. It then creates the bulletin post form (including the new count) and submits it for you. Quite simple really.

This is all very nice, however, unless you know what you are doing you’ll never know quite how far the bulletin has got to, even if you have a lot of friends on MySpace you’ll only get the latest count so long as your friends re-post the bulletin. So I propose an upgrade to this simple setup. Whilst it is not possible to dynamically change the number in the bulletin, we can change the number in the body of the bulletin. This can be done using a dynamically generated gif (a graphical representation of the number), which is very trivial in PHP and there are numerous scripts out there which do just this. The result would be that the bulletin title could indicate at which point the users joined the chain, and the image in the bulletin body would indicate how far it has got.

The current implementation relies on a simple text file but this can lead to all sorts of concurrency problems, especially if you have 100,000 users opening it for outputting to the gif, therefore this upgrade may require a change to using a DB that can handle locking but I’ll leave that for someone else to sort out.

If you’re planning on creating your own version the code required for the bulletin posting form is:

<form name="bulletinForm" action="" method="POST" target="_self">
<input type="hidden" name="groupID" value="0">
<input type="hidden" name="hashcode" value="MHsGCisGAQQBgjdYA8igbTBrBgorBgEEAYI3WAMBoF0wWwIDAgABAgJmAwICAMAECMDZad0h0zS3BBBjEFtHHZcIPZ22xHDNx80PBDB/bOdbTVXoblD/iQi1aMqvh//wZuk7RhaHgFKCy/h6bH0MSkrfs7r9H1gdk0fA69k=">
<input type="hidden" name="hash" value="6308J150O169O160O160O153O168O157O162">
<div style="visibility:hidden;display:none;">
<input type="hidden" name="subject" value="
echo("Let's see how big this can get. Repost number: $count");
" size="1" maxlength="50">
<textarea name="body" type="hidden" style="width: 0px; height: 0px;"><Center>
<font face="comic sans ms">
This is the only bulliten that counts how many times its been posted!<br>
So far this bulletin has been posted<br><big>
<?php echo("$count"); ?></big><br>
<a href="">
Click here to repost this bulletin</a><br>
<input type="submit" value="Click here if you're not automatically redirected.">

This code was “borrowed” from here… I assume they don’t mind me re-posting it as they did put the source code online :)

3 responses so far

Nov 05 2006

The Anti-Climax of MySpace

Published by under General

I’m on day two of life after MySpace and I must admit its a bit of an anti-climax. I’ve been looking around the profiles of some people I (kinda) know and I just don’t seem to be able to follow the logic of communication on this site.

I’ve also start to embark on a social engineering project of my own. However, I’m not at liberty to disclose too much information about it at this stage. I am a little concerned though that if I take it too far there’ll be no going back.

Right, I’m off now to go and get Second Life installed on my home machine. If anyone in Guernsey see’s a glow coming from the direction of my flat don’t worry… it’ll be my graphics card & processor burning under the strain of try to run SL.

Oh, I forgot to put a link to my MySpace profile, it’s

No responses yet

Nov 04 2006

Joining The Borg

Published by under General

OMFG! I can’t believe I’ve actually joined the so-called social network. As you can probably guess I’ve had to do away with the crap site design that is the default MySpace style. This new theme is courtesey of Mike Industries.

I always thought of Microsoft as being the closest thing in reality to the Borg (from Star Trek) but now that I’ve signed up to MySpace I think this is closer to the Borg. Everyone thinks they’re different, or social outcasts but by joining MySpace you are in fact joining the biggest herd of sheep the world has ever seen since the rise of Christianity.

No responses yet

Nov 02 2006

Route For Last Day In Norway

Published by under Technology

This post come courtesy of two events that have occured at just the right moment. Firstly, the latest version of Google Earth 4 (4.0.2416 beta) now makes it possible to create paths and polygons in the free version, which was previously only available in the Plus version. Secondly I have just submitted my claim form for the accident I had in Norway in 2005 (don’t ask why its taken so long).

To cut a long story short I have made available the route that I would have taken from Skei (in Sogn og Fjordane) to Bergan on my last day in Norway. Unfortunately I crashed my bike in Skei but now I can use the “Tools -> Play Tour (Ctrl + Alt + P)” to see what I was missing. It looks its best if you have the terrain layer enabled so that you fly through between and over the mountains.


3 responses so far

Nov 01 2006

New Version of Monaco Font

Published by under Programming

I’ve recently been sent newer version of the Monaco font and so I decided to put it on-line. The version number of the previous font I hosted was 2.0 but this new version is 5.1d1e1. I’m not sure how the new version differs but I’m told its from a new Mac Book Pro.

I’ve also noticed on several forums that people have said that the version I’m hosting isn’t quite the same as the version on the Macs. This, I believe is because the Mac version of the font contains more information about how the font should behave than is contained in the standard True Type Font. That said, this is as close as you;re going to get to the original Apple Monaco font.

Update: Several people have commented that the above version of Monaco does not render correctly on Linux. Thankfully, someone has sent me a copy which does render on Linux, however, it does not render correctly under Windows. You can now download the Linux version. Windows user should continue to use the version about.

Please note that this font is provided as is. I have not tested the font myself, I am merely providing it to you as it was sent to me.


If you like Monaco, you might also want to check out Envy Code R (preview release 6) from DamienG.

70 responses so far