Wednesday, April 23, 2008

Another thing happening on Thursday

Yesterday I posted about a few things that were going on on Thursday. I'd actually forgotten another thing going on that day that is significant for us and also leads on to something of a rant.

On Thursday our fridge/freezer gets repaired.

Now, this is nothing unusual really, but the thing is, this is a unit that we bought less than two years ago that cost us about $2500 (including fitting parts and delivery etc). Apparently pretty much all new units come with a very basic 1 year warranty these days, and this is no exception.

So much for having confidence in your products...

The unit in question is a Maytag Ice2O one that has a French door door fridge at the top with in-door water and ice, and a pull-out freezer at the bottom. It works very well: when it's not broken.

What happened was a couple of weeks ago the freezer started to warm up. The temperature alarm allowed us to save the food by moving it to another freezer. A while after that the fridge went the same way.

We called an engineer out, but he couldn't find anything wrong because we'd turned it off in the meantime (the noises it was making were worrying us) and when he turned it back on again it started cooling properly.

Then on Friday the same thing happened. This time we left it on, and called out the engineer again (on Monday). Unfortunately, we weren't as fortunate as my colleague Chris who merely had to replace a bulb in his freezer. For us, it was that the compressor had shorted out, and needed replacing.

I'm very grateful to the engineer who then went on to call Maytag himself to try and see what they could do. They first told him that it was a one year warranty and that was it. The engineer then continued to fight our cause, pointing out that this would be something like a $650 repair on a $2500 unit that is less than two years old, and Maytag finally said they would give the part for free, though they would not help out at all with the labour.

Firstly, I'm grateful to Maytag for giving the part for free: it is something they are no legally bound to do. I'm even more grateful to the engineer who did a great job at representing us to the company.

However, I would say that refridgerators are appliances that people purchase expecting to be able to keep them for like ten years. These aren't things we just throw away after a year.

I am new to this country (and Maytag isn't a brand I'd heard of before in the UK), but since I've moved here I've heard about the "Maytag Repairman" commercials which document the sad existence of the poor Maytag Repairman who is bored out of his mind because Maytag products never break down. What's happened to that? Why do your products (which are supposed to be long-life) carry only one-year warranties? Do you really have that little faith in your products these days?

Or maybe the situation is that you're quite fond of the income stream you get from selling extended warranties?

Hmm, this is getting personal, and I could go on ranting. but I think I've made my point.

I'm off to get a cold drink out of the cool box filled with ice in my garage...

Tuesday, April 22, 2008

All Go on thursday

A couple of things are launching on Thursday that are of relevance to me.

First of all there's the release of Ubuntu Hardy Heron: I've just come into the Ubuntu world having decided to install it on my new machine's replacement hard drive (couldn't be bothered to install Gentoo again, and fancied a change anyway).

I installed a beta version of Hardy Heron anyway when I installed, so the launch on Thursday won't actually have that much of an effect on me. Still a big event anyway for those who use Ubuntu or Linux in general (or are thinking of doing so).

The other thing that happens on Thursday is the opening of the new QuikTrip just up the road from where we live (it will be on Justin Rd, FM407 in Lewisville, TX). At least, it will be Thursday if the "open in X days" signs outside are being properly kept up to date. :)

It will be nice to have a QT so close for a number of reasons: we don't currently have a competitive place to buy fuel from, especially when heading north. QT is also an excellent place to get drinks from (fountain drinks, slushies etc), which will be very welcome in the appraoching summer. Also (and to tie this loosely into the previously blogged theme of weight loss), it's going to be close enough to walk to. which will provide us with a way to get some exercise. Walk up there, buy a drink and walk back.

I wonder if anything else of interest to me is happening on Thursday that I'm not aware of?

Friday, April 18, 2008

=== null is faster than is_null

I hate using more than one method to do the same thing in my code: it makes it read inconsistently in my opinion. I try to keep it uniform so there are no surprises.

Lately I've been struggling to decide which of the following is the 'best' way to check if a given variable is null or not in PHP:


$v === null
So I figured I'd try a rough and ready script to benchmark the two. The following will do:

$c = 1000000; // Iterations
$v = null; // Value to use in comparison
$d = null; // Dummy variable for assignment
$i = 0; // Counter
$s = microtime(true);

for ($i = 0; $i < $c; ++$i)
$d = is_null($v);

$s2 = microtime(true);

echo $s2 - $s . "\n";

for ($i = 0; $i < $c; ++$i)
$d = $v === null;

echo microtime(true) - $s2 . "\n";
A million iterations of each should be sufficient. Everything is initialised before the loops so neither has an unfair advantage. I also tried running the script with $v set to numerous other types and values with no effect on the result, and finally tried swapping the loops around to ensure that running order was not a factor.

The result? Well, on my machine === null turns out to be roughly four times faster than is_null.

I find this quite surprising: === is a generic operator while is_null is a very specific function. The only cause I can think of is that the function call adds overhead.

So, there you go. If you need to check if a variable is null or not, === NULL is the faster way to go.

Wednesday, April 16, 2008

Thanks for the tip, Vista Installer

Recently my hard drive died, and while it's been in the RMA process I've been running Linux only off an old IDE drive of mine.

I've got my replacement now and started putting things back on to it last night. The first task was partitioning it (which I did using Linux tools so I could get everything just the way I wanted it). This includes a 250GB partition for Vista, which I use for games and games alone. Nothing but games...

So when it came to installing Vista it asked me to pick where I wanted to install it, to which I selected the aforementioned 250GB partition.

Upon clicking install, I got this error message:

Windows is unable to find a system volume that meets its criteria for installation
Frikkin fantastic! Not only is the vista installer too brain dead to install to the partition I created for it (and explicitly pointed out to it), it won't tell me why. How's about telling me which criteria it's not meeting? That would be an excellent start.

In the end I did two things that fixed it (not sure if one or both was required, couldn't be bothered to do it scientifically).

The first thing was to delete the 100MB partition I'd created for the linux /boot mount. This was the only partition before the Vista one on the drive. If this was the problem I'd like to ram a rusty nail into the left eye of the developer that decided that was something that could prevent an installation. The partition is invisible to Windows anyway.

The second thing was to mark the Vista partition as 'bootable'. If this was the problem I'd like to ram a rusty nail into the right eye of the developer that decided that was something that could prevent an installation. The Vista installer can't mark a partition as bootable itself? Is it really that shit?

There is plenty on the net about other people having this same problem. More than one person had to unplug their card reader in order to get around this. Seriously, why the hell should the presence of a card reader prevent Vista from finding a partition to install on especially since the installer allows you to explicitly select the partition yourself.

The mind boggles.

Game developers: please get your finger out and start writing games that are cross-platform so I can finally wipe this chaff off my hard drive and out of my life for good...