Cab Action

I’m in London to see Kate Bush’s show again.  I had a suitcase with me this time, so I took a cab from Paddington to my hotel in Whitehall.

DSC00795

We encountered some very blocked-up traffic, and my cabbie said “Hm!”  Then he switched on the radio and it said that black cabs were blocking traffic throughout the center of London to protest Uber and its ilk.

DSC00794

My cabbie said “Shit!  It’s our lot that’s causing this.  I heard about traffic being blocked, but I though it was the bicyclists!”

DSC00793

He then made a heroic (and not very legal, in bits (if we got nabbed, he’d gonna blame me and tell the coppers I threatened him)) effort to drive me as close to the hotel as he could get, and I strolled the rest of the way.

DSC00792

Excitement!

Now din-din.

From The Annals Of Trivial Programming Errors

It was pointed out to me that the alphabetical list of groups on my web site was very short.  It seemed to only list a tenth of the groups I probably had albums from.

Here’s the snippet that constructs an array by reading the directory that contains all the group names:

while ($group = readdir($dir))
  $groups[] = $group;

See the error?  Yeah, I had bought an album from the group 0, and that made that loop terminate when it reached that group name.  (readdir reads in unsorted directory order, so it didn’t terminate immediately, which is why I hadn’t noticed.)

0: The Bobby Tables of bands.

The fix is something like

 while (($group = readdir($dir)) !== false)
   $groups[] = $group;

PHP type coercion is usually convenient, but…