Spirit of Christmas – Canary Wharf

This photo- taken of a Christmas tree* in the Canary wharf says everything you need to know about the UK in the 21st century. Bah Humbug!

*Every Christmas tree and hanging decorations in Canary Wharf has one of these. Nice eh, the bastardisation of a bauble with a CCTV message!

Mispellings in TV Adverts

With a product name like Cillit Bang, (Silly Name!) I suppose it was to be expected but I saw an Ad today on Sky One (about 14:10 pm GMT+1) with a big bad spelling mistake. I wasn’t even paying much attention but as it flashed past something must have registered so I rewound and paused it.. et voila.

The top photo was the full screen advert (as seen on a Sky+ Box) and the bottom is an expanded version of the bottom right part of the screen. “Stainless Steal!”. Er chaps, you mean “Stainless Steel”?

Argos screw up a purchase reservation!

Yesterday my wife reserved three items on their website, to be collected within 48 hours from one of their stores in East London. She received an email confirming that the three items were reserved and would be held until the end of tomorrow.

Today we traipsed down to pick them up. 3.00 o’clock at Argos on a holiday Sunday- almost an entire outer circle of hell to itself. It took 5 minutes sat in the car park just to get a parking spot.

Anyway they screwed up. So much for three items reserved. They only had two. The other was ‘Out of Stock’ according to their staff. So here we have a no doubt expensive stock/booking system which gets it wrong.

Presumably at some point the branches stock figures were matched against reservations and the system should have realised that a reserved item would be out of stock? So why no notification, apology or anything?

I tried their phone line support. Getting through to a human was an achievement, however she might as well have not been there. Full marks to her for passing me to another number where the staff had long finished for the day. But a waste of my time (on an 0870 number- gee thanks Argos).

So I have used their online email system to send an email that should glow white hot with ire (polite, no bad language but firm). Watch this space… I wonder if anyone in Argos land ever checks the web for good/bad customer feedback?

I made top ten for C++ Programming on Google!

Writing for About.com (see previous post) isn’t done just for love; they do pay and that depends upon how many people visit the site. Which means I have to write stuff that people want to read and also apply a bit of SEO magic to make sure it’s found for what people are actually searching for.

Well my C++ column (including C and C#) is now at #9 on the first page of google for c++ programming. Getting to #1 position will be a lot lot harder. In fact staying in the top ten won’t be that easy!

Now I just have to work out how to get something that people on Digg and Reddit want to read…

Rock, Scissors and Paper Contest

http://cplus.about.com Rock, Scissors and Paper Contest
My other hat is writing the About C, C++ and C# website for About.com– the New York Times owned website. I’m one of their 600 guides who write for them.

One of the interesting things I’ve been doing there is running the Rock, Scissors and Paper (RSP) contest– it’s free and open to anyone and new players can join anytime between now and Christmas. It’s not the easiest to let developers use all three languages to write bots to play RSP but I managed it.

Each week, every bot in the contest plays every other bot in a 100 hand match. All wins are totalled up and that determines the ranking.

What I did was develop a C# Winforms application that uses a dll for each bot. I’ve done the hard bit and provided a full skeleton dll for C, C++ and C# that anyone can download and flesh out; just fill in the function bodies, the move logic goes in the GetMove() function. I wrote a C# wrapper for the C and C++ bots which wraps the dll calls in a class- it looks like this:

   public class bot
      public const int botnum = 1;
      const string dll = “c:\ongoing\dlls\skeleton1.dll”;

      CallingConvention = CallingConvention.Cdecl)]
      public static extern string GetBotName(); // returns name of your Bot

      CallingConvention = CallingConvention.Cdecl,CharSet=CharSet.Ansi)]
      public static extern char
         GetMove([MarshalAs(UnmanagedType.LPStr)]String S,
         [MarshalAs(UnmanagedType.LPStr)]String S2); // return move

.. others trimmed for shortness

Note the marshalling attributes – the dlls use cdecl, it’s ansi chars (8 bit as C# uses Unicode) and the strings are passed as lpstr. A string in C is just an array of 8 bit chars.

This function GetMove passes in the previous hands (in this match against one bot) so you can see what your bot played and what the opponent played. After each week I publish the results and a file containing all bots moves- eg this was the match between bot 1 and 5. 1 won 29 times, 5 won 33. Below this are the strings which I’ve trimmed to fit this.

1 v 5 29 33

You can see the full file this came from: Week 6 results It’s just a text file, generated by the application.

So if you fancy entering- remember it’s free just follow this link:
Rock, Scissors and Paper Contest

Hard Disk Woes

Over the years I must have bought maybe 15 hard disks of increasing capacity. Most have been very reliable (I did drop one in 1999 which slowly deteriorated over a 6 month period with increasing numbers of bad sectors). But two I have bought recently have acquired bad sectors in a short period of time.

One is an external 160 GB 2.5″ disk. I bought this from Freecom whose disk enclosures are excellent- internally it was a Samsung disk. The first problem was my own stupidity. I left the cable plugged in to the enclosure USB socket (it was a micro USB) while it was moved and it snapped the socket off the interface motherboard. It was very tiny- 5 pins so couldn’t be soldered back on.

I found an Irish firm Nexxons selling cheap 2.5″ enclosures on Ebay and transplanted the disk from the elegant Freecom case (invalidating the Freecom warranty of course) into one of those. Freecom would have replaced the entire thing but I would have lost some recently unbacked up data. Their technical support are excellent but they told me they send the damaged stuff off to Germny so you have no chance of recovering data.

Three months later. I plug the disk in one day and Windows decides to ignore the disk! I always format them NTFS. Anyway, the NTFS structure had got corrupted and doing a chkdsk /f tidied things up. A useful tip– you know when you try to do check a disk for errors from Windows properties tools with the Automatically fix file system errors box ticked and it won’t do it cos the disk is busy (and offers to do it on your next boot). Drop to dos, (start, run enter cmd and press enter). Then type in chkdsk e: /f (if e: is your drive). This will close processes down if it can and do it immediately.

So I did that and d’oh 4K bad sectors. But it worked so i backed stuff up, bought a 500Gb brick (Lacie) from Dabs and copied stuff onto that. A week later, same problem with the 160GB. Now it was 8K bad sectors. In fact it was worse because I used a spare PC and left it trying to access my disk which took it 30 mins. I checked out Samsung- 36 month warranty on hard disks, and mine was oh 6 months old. All UK Samsung disk returns are done by http://www.rexo.co.uk/ who have a pretty good returns website. One week after sending the faulty disk off, a brand new one came back. Kudos to Rexo for excellent service (and likewise to Freecom).

But the saga isn’t over yet. Somehow I’d managed to buy the biometric 500GB drive not just an ordinary disk. It has a pretty good fingerprint reader, though it is very fussy about positioning fingers. It usually takes three or four attempts before it works but it is reliable enough to trust. I don’t need this level of security though.

So the other day I was copying some files onto the replacement 160GB from the 500GB when… bad block! Chkdsk didn’t find any bad sectors but the file was still uncopyable and the folder it was in could not be deleted. I got everything else off and did a full 4 hour format. 4K bad sectors. This on a disk that I’d bought just ten days earlier and had definitely not dropped…Dabs have a very good returns system so it’s now waiting to be collected. I suspect Dabs might have trouble testing the drive as they don’t have my fingers!

4Kb out of 500 GB is minuscule but hard disks are generally so reliable that it indicates some kind of fault which will only get worse. Once you get a dodgy sector, seriously think about replacing the disk or you risk losing it and everything on it.

20 MPH Zone Madness – Congestion Charge Tactics?

Waltham Forest Council have been bribed by Transport For London to induce vehicular atherosclerosis in the transport system in East London and they are now targetting my area. My suspicions are that by sealing off side streets, adding 20 MPH zones and putting speedbumps everywhere they force traffic onto the main roads and congest them. All this is done in the name of stopping speeding and making the place safer. It’s a regular speedtrack.

On my road we get the odd loony who does 60 or 70 at 2.00 am in the morning – this where the road is barely wide enough for two cars to pass without exchanging fluids. One bloke lost control and clipped 4 cars before crunching to a halt. That was about 4 years ago. The main speeding that happens round here is on the main road at 5.00 am in the morning. I see cars doing 50-60 MPH. It won’t stop that happening.

Then of course TFL will claim (this is my belief- no proof) that because traffic is slow on the main road the area (East London) needs a Congestion Charge – you can see this was decided a few years ago.

So what good do speedbumps do? None except force cars to slow down. They are however very bad for the environment with increased noise and air pollution and vibration shock. See for yourself. Barnet reduced accidents in the year after it removed their speedbumps.

The fact is that speedbumps appear to cost lives- up to 500 in London. I quote this from Paul Smith, a retired engineer who campaigns to improve road safety on his website SafeSpeed. It’s a Word Doc.

“In London in 1981, 274 pedestrians died in road accidents. By 2002 the annual toll had dropped to 107. This covers the main period of hump introduction in the London area. Even if we assume that the entire benefit of 167 lives was due to road humps (and clearly there are other factors) the 500 lives lost annually in ambulances claimed by the London Ambulance Service is three times greater. “

So speedbumps do not save lives- they cost them by slowing down emergency services by approximately 10 seconds per bump. Those seconds make all the difference.

So from now on, as far as I am concerned TFL are to be called “Congest for London”.

After several months with Pivotlog as my blogging software, I defected to WordPress. My hands were a bit tied because the people who provide the shared server were complaining that it was running excessively high CPU figures- around 52%. So three hours with WordPress then I found the import from Pivotlog addin and it was a very smooth transition.

Pivotlog was possibly always going to be a potential time bomb because it used flat files whereas WordPress uses MySQL.

Programming contests

I write for About.com on C, C++ and C# programming and have been running a Programming Challenge.

You find lots of these challenges and contests on the web so I collected a list of ten that seem to be live and put them in a article Ten Programming Contests. One thing I’ve noticed is just how many Chinese and Eastern European developers are entering these. Maybe it’s a cultural thing or maybe this is where the future lies. If I do a Google Trends search for C++/C#, these are then top ten countries in order using google.

India, Pakistan, South Africa, Israel, Singapore, Viet Nam, Ukraine, Russia, Czech Republic, Denmark.

Of course maybe the richer countries like the USA, Canada, UK, France, Germany can afford the manuals and have less need to search… but interesting.