Thursday, 30 August 2007

Film Review: The Game

I hadn't watched The Game in a long time (over two years) but recently we had guests staying who had never seen it before and so I sat and watched it again. Now you may think that it can't be that good a film if I haven't watched it in so long, but you would be mistaken. The problem is that it is such a good film, but one that is never as good as the first time when you didn't know the plot. Therefore, leaving a long gap between viewings is worthwhile as you will forget little bits of the plot.

Without giving too much away this is a film about a control freak (probably the best performance by Michael Douglas I've ever seen) who finds his life falling apart around him. There are many twists and turns to this enjoyable film and so you really need to concentrate (i.e. no doing the crossword while watching).

My Rating: 4 Stars I nearly gave it the full five starts but the fact that it is one of those films that can never be as good as the first time you watched it lets it down slightly.

Wednesday, 29 August 2007

An Update To: Win XP + Network Drives == Slow Boot

Just a quick update to a previous post on network drives slowing down the boot sequence of Windows XP. Turns out that I was too quick when I stated that Windows Vista doesn't seem to suffer from the same problem.

In the last few days I changed which shares were being mapped to drives and I suddenly started finding that logging in to Windows Vista was taking ages. It would just sit there with a black screen and mouse pointer apparently doing nothing. So I've just added the registry key from the previous post, rebooted and everything seems back to normal.

So to recap, don't rely on Microsoft to fix things and if you are getting a slow log in under Windows Vista and have mapped drives then it's worth trying this fix.

Origami CD/DVD Packet

Some of you may have previously had a CD or DVD from me in an origami paper packet. I think they are nicer than using a plastic jewel case (better on the environment anyway) and can easily be given customised labels and artwork etc.

Anyway, I thought I'd provide the Microsoft Publisher template I created to produce the packets and the origami instructions to make it easier for anyone who wants to fold their own!

Tuesday, 28 August 2007

Edible Lego

As a kid I was always taught that Lego wasn't something that should be eaten and as far as I recall I never succumbed to the urge to eat those lovely red and yellow pieces of plastic! I'm certain though that ever since Lego first went on sale in 1963 kids have been accidentally eating the blocks and suffering the consequences.

So what in the world were Kellogg's thinking when they decided to market fruit flavoured edible Lego?

Sunday, 26 August 2007

Cardboard Models


As a kid I built many cardboard models and usually they fell apart not long after due to my relatively sloppy sticking and folding! As a slightly more patient adult I may have better luck!

However, I still don't think that I'm good enough or have enough patience to build a cardboard version of the Starship Enterprise, Millennium Falcon, or any of the other sci-fi models available at the SF Movie Paper Craft Gallery.

On the other hand, as a fan of the original Sonic the Hedgehog games, I am tempted to build this model. I still find it hard to believe that it is over 15 years since the first Sonic game was released, and it is still as playable now as it was then!

Saturday, 25 August 2007

Jacket Potato with Chicken, Leek and Bacon


Ingredients (Serves 1)
1 chicken breasts
1 leek
2 rashers smoked bacon
1 heaped dessert spoon of flour
¼ pint of chicken stock
1 teaspoon of whole grain mustard
1 dessert spoon of crème fraîche

Cooking Instructions
First dice the bacon, chop the chicken breast into bite sized chunks, and thinly slice the leek. Heat a small amount of olive oil in a heavy bottomed saucepan and gently fry the bacon and chicken. When the chicken is almost cooked add the leeks and continue to cook until the leeks are soft and tender.

Sprinkle the flour into the pan and stir through. Pour in the stock, stirring constantly as the source thickens. Stir in the mustard and crème fraîche. Continue cooking, stirring constantly, for a few minutes while the crème fraîche melts into the sauce.

Spoon over a jacket potato and serve.

Friday, 24 August 2007

Great Crested Grebes

So for today I thought I'd go with a photo story. Back in May we visited the RSPB reserve at Old Moor. As soon as we entered one of the hides we knew something odd was going on from the strange shrieking noises we could hear. Turns out two pairs of Great Crested Grebes were having one violent looking fight.


The photos are the edited highlights of the the fight; squaring up to one another, violent fighting, and finally after one couple had been chased off, the other couple were left to enjoy each others company.

Thursday, 23 August 2007

if (window.opera && opera.wiiremote)

While my current readership maybe small (4 at last count) it is diverse. As such I'm sorry that some posts maybe of absolutely no interest to some. For example, today's post is probably relevant to only 1 of my readers!



Object detection is considered the best way of implementing cross browser JavaScript -- that is check to see which methods are available and then use the correct combination to achieve whatever it is you are trying to do.

Detecting the Opera web browser is easy as it's the only browser to implement the window.opera object. The Nintendo Wii console has an Opera web browser but until yesterday I had no idea how to recognise it as different to the PC version of Opera without looking at the user agent string, which can be easily spoofed.

It turns out, however, that Opera on the Wii has extra objects that allow access to details of the Wiimotes -- opera.wiiremote. So we can use this to detect when we are running JavaScript on the Wii by checking for window.opera && opera.wiiremote.

Of course we can do much more than just detect that we are running on the Wii. As far as I can tell the only thing that can't be detected are the values from the accelerometers. There are a number of demo pages as well as a simple game called Wii Roll that you can try.

Of course you can't develop web pages on the Wii so testing web pages will mean trekking backwards and forwards between your PC and the Wii. Of course someone else has already thought of this and developed a wiiremote emulator script so that you can develop and test on your PC.

Wednesday, 22 August 2007

Silver Y Moth on Lavender


We get lots of wildlife in the garden, and for today's post I thought I'd go with a moth photo. Just outside the kitchen window there is a large lavender plant which at around dusk is covered in Silver Y moths. Taking photos of them is actually quite difficult as they don't stay still for very long, the plant tends to sway around, and dusk doesn't give the best light.


I've tried to take photos recently and ended up with every one of them blurry or out of focus so I'm having to use one that I took in July last year instead.

For those interested in Latin names then the Silver Y moth is called Autographa gamma. I guess this is because it looks like someone has autographed each wing of the moth with the lowercase version of the Greek letter gamma, γ.

Tuesday, 21 August 2007

"Run When Finished" -- A Vista UAC Security Hole?

Back in February a security researcher called Joanna Rutkowska blogged about her experiences with Windows Vista and a potential problem with Vista's User Account Control (UAC). The main point she raised was that when running a setup program the UAC presents you with just two options 1) run the installer with full administrator privileges or 2) don't run the installer. So if you are unsure about an installer then Vista puts you in the position of having to trust the installer completely or not at all. What you really want is the option to trust it a little and run it using the current user account. Malware/Spyware authors can use this against you by crafting a malicious installer, which will have unfettered access to the machine on which it is run. An issue not discussed though was the common "Run program when finished" option.

On the last screen of many installers there is a check box, selected by default, which asks you if you want to run the software when the installer finishes. Because the installer is running with administrator privileges the application is launched with the same set of enhanced privileges without triggering a UAC prompt! Now I can see two issues with this. Firstly a malware author doesn't have to try and craft a malicious installer program. They can just use something like InstallSheild to generate an installer for their malware and then hope that the user chooses to leave the "Run when finished" option selected and the malware will run with complete access to the machine. Secondly, even if the software is completely safe the user is now able to do things that usually they wouldn't be allowed to do and so could accidentally cause damage to files or settings on their computer. It is this second issue that alerted me to the problem in the first place.

Over the weekend I was testing some web development I was doing in the Opera web browser when it asked me if I wanted to update to the newest version. I thought this was an ideal time to go make some coffee (hey I mentioned coffee for the first time on this blog!) so I allowed it to download and run the installer for the new version. When it finished I allowed the installer to restart Opera and thought nothing else about it. Now when I was using XP I had got into a nasty habit of saving temp files into the root of the C: drive. Vista doesn't let you do this, but for some reason I must have tried anyway and it succeeded, although at time I didn't think this was weird. It was only about an hour later, having done some more development and re-oppened Opera, that I tried to save a second file in the same place as the first, so I could do a diff between the two files, that I noticed something was wrong -- Opera wouldn't let me save the file in the root of the C: drive, offering to save in the Documents folder instead. It took me quite a while to figure out how come I had been able to save the earlier file. When the penny eventually dropped and I realised that it must have been because the 1st instance of Opera I had opened after the update had been running with administrator privileges, I uninstalled and then re-installed Opera to check I wasn't being crazy. I wasn't and I can easily reproduce the behaviour. I have since tried installers for a number of other bits of software and in all of them where I'm offered the option to "run when finished" the program is run with administrator privileges and I can save into the root of the C: drive.

So what exactly does this mean for the average everyday user of Windows Vista -- to be safe don't rely on the UAC to protect you either from malware or yourself. From now on I'm going to be unchecking the "Run when finished" box to ensure that programs are not run with administrator privallages unncesseraily.

In the long run I think companies who develop software which is used to generate installers (for example the InstallShield product from Macrovision) should seriously consider either removing the "Run when finished" option from the installers or ensuring that the application is launched under the logged in users account and not under the account being used to run the installer. While I don't know enough about the Windows Vista API to know how to do this, it must be possible given that I can use the runas command line tool to run programs under any user account to which I can log in.

What Has Been Happening?


I really have no idea what has been happening in the toilets at work, but these signs went up on the cubicle doors quite a while back.

I wonder if they've made any difference?

Monday, 20 August 2007

Graph Paper

Graph paper is one of many stationary items that I don't keep a ready supply of. As such I never actually have any when I need it. That is no longer a problem though as I now just download and print graph paper from the cleverly named Free Online Graph Paper site.

It can produce (at last count) 40 different types of graph and grid paper, each of which can be customised in many different ways. So you can have graph paper or normal lined paper or music notation sheets, or calligrahy guideline paper, or...................

What you eventually download after choosing and configuring your paper is a PDF which of course you can then print as many times as you want whenever you need to.

Sunday, 19 August 2007

How Big Is That Starship?

Ever wondered just how big your favourite starship is? Well visit Jeff Russell's Starship Dimensions page and you will be wondering no longer (thanks to Rob for the tip off).

Saturday, 18 August 2007

CSS Selectors

When I first started to setup this blog I made a number of changes to the standard template I choose to use. One of the things I wanted to be able to do was add representative icons to links to show their file types. You may already have seen this in my post on the BBC iPlayer, but in case you missed it here is another link to the solution I provided in that posting. Now assuming that you are reading this in Internet Explorer 7, Firefox, Opera or Safari there should have been a little zip icon following that link. If your using some other browser here is what the link should look like in a screenshot of the link in the iPlayer post:
This is achieved using CSS attribute selectors. Basically I have a CSS rule that checks the destination of every link and if it ends in .zip then it adds the little icon. There are six easy to use CSS attribute selectors that allow you to match attributes in different ways: starts with, ends with, contains, is exactly equal to, has the attribute, match one item in a space separated list.

So that I don't have to pollute my main template file with lots of rules just to show an example of each I've put together a separate demo page. If you want more details than there are in the demo then take a look at the CSS3 Selectors specification, which defines these attribute selectors as well as a whole load of others.

If you intend to use any of these CSS rules it is worth remembering that to get them to work at all in Internet Explorer not only do you have to be using version 7 but you must ensure that your HTML page specifies the HTML 4.01 strict doctype, because in quirks mode IE totally ignores all these CSS rules.

Friday, 17 August 2007

Chinese Chili Chicken


Ingredients (Serves 2)
2 chicken breasts
1 tablespoon cornflour
4 tablespoons olive oil
1 egg white
1 large green chili
1 large red chili
A 1 inch long piece of root ginger
1 green pepper
1 red pepper
1 tablespoon dark soy sauce
1 tablespoon white wine vinegar

Cooking Instructions
Mix 1 tablespoon of the oil with the cornflour and egg white in a large bowl. Chop the chicken into inch sized cubes, add to the bowl and stir to coat all the chicken pieces.

Remove the stalk and seeds from the chilies and chop finely. Peel the ginger and chop into very small cubes. Chop the two peppers into pieces about 2cm square.

Heat the remaining oil in a wok and once hot add the chillies and ginger and cook for a couple of minutes. Now add the coated chicken pieces and stir to ensure that the chicken doesn't get all stuck together.

Continue to cook until the chicken is fully cooked through and then throw in the peppers. Cook for a further few minutes to soften the peppers then add the soy sauce and white wine vinegar (note that these are likely to spit as they are added to the wok). Cook a little longer until most of the fluid has evaperated, then serve on a bed of rice.

Cleaning up Your Windows Machine

As an update to yesterdays posting I got some feedback that the script I supplied couldn't be used. I'm not sure what the problem was but the safest option is just to enter the key manually. A slow performing Windows machine can of course be caused by other issues than the one I highlighted yesterday which got me thinking about a tool I run quite regularly -- CCleaner.

CCleaner will scour your hard disk for temporary files that can be deleted as well as allowing you to remove private data such as browsing histories etc. It also has an option that scans the registry for what it calls Issues and then attempts to fix them.

I tend to run it about once a month and it tends to remove about 200Mb of files and about 50 registry issues. Note that the it's worth running the Issues scanner multiple times until it tells you that it can't find anything else to fix. This is because sometimes the fixes it applies on the first pass highlight further problems.

Thursday, 16 August 2007

Win XP + Network Drives == Slow Boot

Given that I've been busy today I thought I'd just give a quick Windows XP performance tip that I had to hunt down a while back.

I found that my machine was suddenly taking an inordinate amount of time to log in. There was nothing obviously wrong so I started to look around the web for suggestions. After a lot of hunting around I came across a Microsoft tool called Bootvis. Bootvis allows you to visualize the time taken by different bits of Windows as it boots. Unfortunately Microsoft no longer distributes Bootvis but you can still get a copy from Softpedia.

To cut a long story short I eventually traced the problem to some network shares that I had recently mapped to drive letters and which were being restored each time Windows booted. This was what I wanted, but there was a problem. Some of the network shares were not always available and Windows was waiting for each connection to timeout before moving on to do anything else.

The solution is a registry change. Adding a single key to the registry means that all network shares are mapped to drive letters as before but Windows does not actually try to connect them until the first time you use them. This cut the time taken to get to a useable desktop on my machine by about two minutes!

So without further ado the magic instructions are: Open the registry editor (run the command regedit from the start menus "Run..." option), and then add a new DWORD key RestoreConnection in the HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\NetworkProvider folder leaving the value set to the default of 0.

Note that as far as I can tell Windows Vista does things differently and this registry change is no longer needed.

Wednesday, 15 August 2007

Control the BBC iPlayer

When the BBC recently opened up their iPlayer to more beta testers I signed up and got an invite quite quickly. I've been playing with it for a week or so now and it has been great to catch up with old episodes of Doctor Who which are currently showing on BBC 3!

The programmes are downloaded using the Kontiki Delivery Management System. This is a peer-to-peer system and this is causing some users to complain quite vocally on the iPlayer messages boards. The problem is that rather than downloading TV programmes directly from the BBC each user is actually downloading shows from other users of the system. The delivery manager starts with Windows and cannot easily be turned off. This means that once you have downloaded a single TV show the software will continue to use your broadband connection to send the show to other iPlayer users. If not monitored this could cause users with a capped monthly download limit to quickly exceed their monthly allowance.

Knowing how the system works I'm quite happy to allow it to use a small amount of my bandwidth to provide the shows I've downloaded to other users. I did, however, want to install the iPlayer on my laptop so that I can catch up on TV when I'm away and this presents me with a problem. My laptop is often connected to networks where I don't pay the broadband bill or where peer-to-peer software is not allowed. So I needed a simple way of controlling the player.

Note that I'm not saying that everyone should stop uploading the TV shows they have downloaded. If they did the service would stop working properly and I would be unhappy. Rather I'm offering a solution for those people, like me, who have a genuine need to be able to limit the software's ability to upload data.

The iPlayer message boards are littered with people suggesting ways to stop the iPlayer using your bandwidth but they all involve manually stopping the software, something I could easily forget to do. So being an inquisitive software engineer I've had a think and a little bit of tinkering later and I have a totally transparent solution to the problem. I think that this solution is OK within the Terms and Conditions you agree to when installing the iPlayer as Term 15 states that "When you use the BBC iPlayer library you shall not have the option to 'switch off' the peer-to-peer functionality". As the only time I use the iPlayer is when it is open and running then there should be no problems with stopping the peer-to-peer functionality service when I have choosen to exit the iPlayer interface. However, I will not be held responsible for your use of this solutuion.

For those of you who simply want to regain control of your computer you can download the solution and instructions without reading any further. If however you are interested to see how the solution works then read on.

Firstly it's important to know that the iPlayer consists of two parts: the interface and a background service that actually controls the downloading and uploading of TV shows. We can easily make sure the user interface does not start with Windows from the iPlayer preferences. The second half of the problem is ensuring that the background service only runs when you have the iPlayer interface open.

The background service which handles the downloading and uploading of the TV shows is called KService. There are two parts to ensuring that it only runs when we want it to: making sure it does not run when Windows starts and stopping it when we exit the iPlayer. We can manage all of this from a command line, so we are going to write an old style batch file to implement this.

I'll show you the whole batch file first, then I'll explain what it does:

sc config KService start= demand
start /wait KHost.exe %*
net stop KService


OK so lets take the file a line at a time:


  1. this line configures the KService so that it only starts when it is needed. In theory we only need to do this once but we will do it every time we start the iPlayer just to ensure that it has not been reset to automatic.

  2. this line starts the KHost application, which is the iPlayer interface, and then waits for it to be closed by the user. This will continue to wait until the user chooses to exit the application by right clicking on the icon in the system tray and choosing "Exit". The %* at the end of the line means pass on any command line parameters the batch file had been given to the KHost application.

  3. by the time we get to the last line we know that the user has finished using the iPlayer so we stop the KService which stops the software from uploading or downloading any more data.



So save this as KHost.bat in the iPlayer installation directory alongside the real KHost.exe (by default this will be "C:\Program Files\Kontiki"). Now from a command prompt we can run the batch file and pass in the same arguments as the shortcut on the start menu uses and iPlayer runs correctly. Now this may seem like we have fixed the problem, but there is one thing left.

If you are browsing the list of TV shows that can be downloaded without the local application already running then it will be started as needed. From what I can tell it runs the KHost application with some different arguments to correctly embed it and then communicates with the running KHost process. To get our batch file to mimic this behaviour we have to be a little more clever and turn the batch file into a proper Windows application to replace KHost.

Firstly we need to move the existing KHost.exe file somewhere new as we will still need it. I choose to create an subdirectory called orig and put it in there. Now we also need to change the batch file so that it can find KHost in the new location. So we now have a new version of the batch file:

sc config KService start= demand
start /wait orig\KHost.exe %*
net stop KService


Now we just need to compile this batch file into an executable. For this we use an existing compiler. Simply load the batch file we have built into the compiler tweak the options as you see fit (I checked both boxes but didn't bother with an icon) and then hit build and out will pop a executable version of the batch file named KHost.exe. Thats it, everything is now finished. Assuming you have followed the instructions properly the iPlayer should work exactly as it did before, but now the downloading and uploading will only take place when you choose to have the iPlayer loaded and will stop as soon as you choose to exit the interface.

So I can now safetly install the iPlayer on my laptop and not worry about what it's doing in the background when connected to networks on which I'm not allowed or don't want to run peer-to-peer software.

I'd like to stress that if you can you do not use this solution because if everyone stopped sharing the TV shows they had downloaded then the iPlayer would become useless -- something I do not want to see happen.

New Garden Visitor

We get lots of birds in the garden, but recently we have had a new visitor -- a young Great Spotted Woodpecker. We've seen it quite a few times now, although this photo was taken back in July when it first appeared.

Apparently you can tell that it's a young bird by the red on it's head. According to the book I looked in juveniles have a red crown, whereas on adult males the red is on the nape of the neck and the females have no red on their head at all.

Tuesday, 14 August 2007

Color Hunter

As anyone who knows me is probably aware when it comes to choosing color schemes, don't ask me! I really can't tell when two colors just really do not go together. This has of course resulted in some really bad websites in the past.

So I was trying to alter the template for this blog and was looking for some new colors. Now I'm still not happy with the layout and style but I did come across a really useful website -- Color Hunter.

Color Hunter produces color palettes from images. For example, give it a picture of a sunset and you will get five colors that are predominate in the picture which you can then use as a palette somewhere else knowing that in at least one other place they have been seen together. You can also search using a HTML color code to find palettes that include a given color.

If that was all the site did then it's use would of course be limited. It's one truly clever feature is to let you search by photo tags. So I wanted a color palette that had something to do with coffee, so I search for coffee and I'm now using the colors you see on this site from palette #49310.

I'm still not convinced by the color scheme I chose, but at least now I know where I'll be looking next time I need a color palette!

Monday, 13 August 2007

1st Post

Well I guess every blog starts with a 1st post, so here is mine.

I'm not yet happy with the layout/style so I'm sure that will evolve over time. I'm also not exactly sure exactly what I'm going to blog about but it will probably cover; computing, music, food, films, books and anything else I happen to find interesting.

Hopefully you'll find this blog interesting enough to keep on reading it past this very enlightening, interesting, and spellbinding 1st post!