Categories
Uncategorized

On Extended Warranties

Illustration of a cellphone walking through a number of hazards
Illustration by James Kaczman for the New York Times.
Click the image to see the illustration with its original article.

In response to an article from last year titled Extended Warranties are for Suckers, a reader going by the name “any non moose” pointed out in the comments that:

Corporates often prefer to warranty their purchases, since having a fleet of consistent items is much cheaper than having a hodge-podge of all different ones. Being able to swap one item for an identical one within your own organisation without having to retrain the user(s) is very very useful.

But I agree that for a SOHO or hobbyist, warranties are as you say, for suckers.

Yes, moose, when I was writing about extended warranties, I was referring to purchases made for home, hobby or SOHO purposes.

Since we’re in the final week of shopping before the holiday that’s increasingly referred to as “Holiday”, here are some links for those of you who are purchasing electronics as gifts and wondering if the warrantly plan is worth it (generally not):

Categories
Uncategorized

“Bioshock” Meets a Shopping Cart

I love this Photoshop job in which Rapture (the setting of the game BioShock) propaganda replaces the standard “Do not leave child unattended” message on grocery shopping carts:

Grocery shopping cart plastic thingy marked “Is a man not entitled to the sweat of his brow?”

The line is derived from the philosophy of game character Andrew Ryan (whose name and backstory are rearrangements of Ayn Rand). You hear it in an in-game recording in Ryan’s own voice:

I am Andrew Ryan, and I’m here to ask you a question: Is a man not entitled to the sweat of his brow?

No, says the man in Washington. It belongs to the poor.

No, says the man in the Vatican. It belongs to God.

No, says the man in Moscow. It belongs to everyone.

I rejected those answers. Instead, I chose something different. I chose the impossible.

I chose…Rapture.

A city where the artist would not fear the censor. Where the scientist would not be bound by petty morality. Where the great would not be constrained by the small. And with the sweat of your brow, Rapture can become your city as well.

If you’re looking for a gift for someone with an XBox 360 or a PC with enough horsepower to play modern first-person shooter games, you might want to consider BioShock as a gift. It’s an excellent game that blends gaming action with a very rich backstory — quite possibly the richest since Myst. Better still, it’s can be finished in an amount of time that still lets you have a life: at the “easy” level, I finished it in a about a week, playing a couple of hours a day, and I’m a relatively casual gamer.

Links

Categories
Uncategorized

1000 Copies of “Rock Band” Taken in Truck Heist

Screen shot from “Rock Band”

I remember watching an interview with William Gibson in which he talked about the 1992 L.A. Riots and the Digital Divide. He remarked that while many stores were looted, it was notable that a store that had laptop computers in their window display went untouched; he looters simply saw no value in them, whether for themselves or as things they could “fence”.

Looking at tech devices that people are stealing is a pretty good indicator of their mainstream appeal. Had the riots taken place today, the laptops would probably be among the first things taken by the looters. Here in Toronto, GPS navigation systems have replaced car stereos as the must-steal items.

As for console games, Rock Band has now been established as the most in-demand game, if you’re using theft as your yardstick of tech popularity. A truck carrying more than 1,000 copies of the XBox 360 the game — which includes a guitar, drum and mic controller — was hijacked in Long beach, California last weekend.

According to the L.A. Times article on the theft, “Thieves are increasingly targeting the nearly $260 billion of goods that move through the Los Angeles and Long Beach ports each year, especially targeting high-priced electronics shipped from Chinese factories.”

Meanwhile, we Canadians still have to wait — Rock Band’s Canadian release date has been delayed until the 17th.

Categories
Uncategorized

Pythagorean Pick-Up [Updated]

Don’t you wish stuff like this actually happened?

Comic showing guy picking up a girl using the Pythagorean Theorem
Click the comic to see it on its original page.
Comic courtesy of Miss Fipi Lele.

You get bonus bragging rights if you spotted the missing precondition.

Categories
Uncategorized

Area Man Gives Glowing Review for His Windows Vista to XP Upgrade Experience

Windows Vista reliability monitor window showing a system’s downward reliability trend
Click the screenshot to see the article Review: Windows XP

From the blog Coding Sanity (whose subtitle is “.NET, pragmatism and geek cachet”) comes the review titled Review: Windows XP

I have finally decided to take the plunge. Last night I upgraded my Vista desktop machine to Windows XP, and this afternoon I will be doing the same to my laptop.

You can read the whole review about the experience of upgrading from Windows Vista to Windows XP here. The review concludes with this:

To be honest there is only one conclusion to be made; Microsoft have really outdone themselves in delivering a brand new operating system that really excels in all the areas where Vista was sub-optimal. From my testing, discussions with friends and colleagues, and a review of the material out there on the web there seems to be no doubt whatsoever that that upgrade to XP is well worth the money. Microsoft can really pat themselves on the back for a job well done, delivering an operating system which is much faster and far more reliable than its predecessor. Anyone who thinks there are problems in the Microsoft Windows team need only point to this fantastic release and scoff loudly.

And Now, a Word on Vista’s Behalf…

Here’s Chris Pirillo delivering a very stirring defense of Windows Vista. Enjoy!

Categories
Uncategorized

In PHP, There’s Equality, and Then There’s EQUALITY

Ka=Ping Yee’s Equality Test

Here’s a quickie PHP script based on the one that appears in Ka-Ping Yee’s LiveJournal entry titled Why PHP Should Never Be Taught:

<?php
$a = 0;
$b = "eggs";
$c = "spam";
$e = "eggs";

echo "<h1>The \"==\" Exercise</h1>";
echo "<ul>";
echo "<li>\$a is $a</li>";
echo "<li>\$b is $b</li>";
echo "<li>\$c is $c</li>";
echo "<li>\$d is undefined</li>";
echo "<li>\$e is $e</li>";
echo "</ul>";

echo ($a == $b) ? "\$a == \$b<br />" : "\$a != \$b<br />";
echo ($b == $c) ? "\$b == \$c<br />" : "\$b != \$c<br />";
echo ($a == $c) ? "\$a == \$c<br />" : "\$a != \$c<br />";
echo ($a == $d) ? "\$a == \$d<br />" : "\$a != \$d<br />";
echo ($b == $d) ? "\$b == \$d<br />" : "\$b != \$d<br />";
echo ($c == $d) ? "\$c == \$d<br />" : "\$c != \$d<br />";
echo ($b == $e) ? "\$b == \$e<br />" : "\$b != \$e<br />";
?>

If you’re not familiar with PHP’s quirks, you’ll find the output surprising:

The “==” Exercise

  • $a is 0
  • $b is eggs
  • $c is spam
  • $d is undefined
  • $e is eggs

$a == $b
$b != $c
$a == $c
$a == $d
$b != $d
$c != $d
$b == $e

What Happened?

In PHP, as with many other programming languages, the == operator is the equality operator, which returns true if the operands on either side are equal in value. It works as expected when used on operands of the same type, as evidenced by the program above, which states that $b is equal in value to $e, both of which are set to the string eggs.

We get into strange territory when the == operator is used to compare operands of different types. The program above evaluates the boolean $a == $b as true even though $a is set to the integer value 0 and $b is set to the value eggs. How can eggs be equivalent to 0? They’re so tasty and versatile! Damned anti-ovites!

In PHP, the == operator is what I like to call the “Slack Equality Operator”. When used to compare a string and a number, it attempts to convert the string to a numeric type and then performs the comparison. The following example code, taken from the PHP documentation, shows how PHP’s string-to-number coercion works:

<?php
$foo = 1 + "10.5";                // $foo is float (11.5)
$foo = 1 + "-1.3e3";              // $foo is float (-1299)
$foo = 1 + "bob-1.3e3";           // $foo is integer (1)
$foo = 1 + "bob3";                // $foo is integer (1)
$foo = 1 + "10 Small Pigs";       // $foo is integer (11)
$foo = 4 + "10.2 Little Piggies"; // $foo is float (14.2)
$foo = "10.0 pigs " + 1;          // $foo is float (11)
$foo = "10.0 pigs " + 1.0;        // $foo is float (11)
?>

Hence the eggs/zero equivalence: the string eggs is coerced to 0.

Enter the === Operator

I like to call the === the “Strict Equality Operator”. It returns true if and only if:

  • Both operands are the same type
  • Both operands have the same value

Here’s the code I showed at the start of the article, but with all instances of == replaced with ===:

<?php
$a = 0;
$b = "eggs";
$c = "spam";
$e = "eggs";

echo "<h1>The \"===\" Exercise</h1>";
echo "<ul>";
echo "<li>\$a is $a</li>";
echo "<li>\$b is $b</li>";
echo "<li>\$c is $c</li>";
echo "<li>\$d is undefined</li>";
echo "<li>\$e is $e</li>";
echo "</ul>";

echo ($a === $b) ? "\$a === \$b<br />" : "\$a != \$b<br />";
echo ($b === $c) ? "\$b === \$c<br />" : "\$b != \$c<br />";
echo ($a === $c) ? "\$a === \$c<br />" : "\$a != \$c<br />";
echo ($a === $d) ? "\$a === \$d<br />" : "\$a != \$d<br />";
echo ($b === $d) ? "\$b === \$d<br />" : "\$b != \$d<br />";
echo ($c === $d) ? "\$c === \$d<br />" : "\$c != \$d<br />";
echo ($b === $e) ? "\$b === \$e<br />" : "\$b != \$e<br />";
?>

Here’s the output, which behaves as expected:

The “===” Exercise

  • $a is 0
  • $b is eggs
  • $c is spam
  • $d is undefined
  • $e is eggs

$a != $b
$b != $c
$a != $c
$a != $d
$b != $d
$c != $d
$b === $e

Once More, in Ruby

Just for kicks, I thought I’d translate the original code into Ruby just to see what would happen. Here’s the code:

a = 0
b = "eggs"
c = "spam"
e = "eggs"

puts "a is 0"
puts "b is 'eggs'"
puts "c is 'spam'"
puts "e is 'eggs'"

puts a == b ? "a == b" : "a != b"
puts b == c ? "b == c" : "b != c"
puts a == c ? "a == c" : "a != c"
puts a == d ? "a == d" : "a != d"
puts b == d ? "b == d" : "b != d"
puts c == d ? "c == d" : "c != d"
puts b == e ? "b == e" : "b != e"

…and here’s the output:

a is 0
b is 'eggs'
c is 'spam'
e is 'eggs'
a != b
b != c
a != c
double-equals.rb:14: undefined local variable or method `d' for main:Object (NameError)

Links

Categories
Uncategorized

Developer Hardware Nerdvana at TSOT

Gear-wise, life is pretty sweet at TSOT. The standard-issue computer is a 15″ MacBook Pro (the 2.2 Ghz model), which is a great Ruby on Rails development machine. The standard issue keyboard is the ultra-skinny Apple Wired Keyboard and Apple Mighty Mouse, but I don’t like the feel of either. I prefer the feel of the Logitech Cordless Wave Keyboard/Mouse combo, so that’s what got assigned to me.

The final piece of the developer gear complement arrived today: our Dell 24″ Ultrasharp widescreen LCD monitors. Now I’m in Hardware Nerdvana:

TSOT standard-issue developer gear: 15″ MacBook Pro, 24″ Dell widescreen LCD monitor and Logitech Wave cordless keyboard and mouse.