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.

Categories
Uncategorized

TSOT’s Ruby/Rails Project Nights – Starting January 8th

Bruce Lee, wearing a TSOT t-shirt and holding Ruby on Rails nunchuks.

The Quick Version

TSOT Ruby/Rails Night
Tuesday, January 8th, 2008 (and the second Tuesday of every month)
@ TSOT’s office — 151 Bloor Street West (on the south side, just east of Avenue Road)
11th floor
Door open and food at 5:30 p.m.
Presentations start at 6-ish
FREE ADMISSION (but limited space)
To register, please email joey.devilla@tsotinc.com

About TSOT

TSOT is a Toronto-based start-up that develops — look out, here come the buzzwords — social networking applications using Ruby on Rails. Our first applications are FraternityLive and SororityLive, social software built specifically for people in fraternities and sororities. Both apps are currently being tested with a userbase of thousands of university students and alumni, and we expect to release them in early 2008.

About Ruby/Rails Project Nights

We believe that it’s good for Toronto to have a healthy developer ecosystem — it’s good not only for us as a Toronto-based development shop, but also as a group of developers who are passionate about the work we do. We’d like to see Toronto as “Silicon Valley++” — with the vibrant high-tech scene, but with all the amenities that make Toronto a better place to live than the Valley (such as not being a dreary 50-mile stretch of suburbia and having decent places to go at night).

Hence our contribution to the local developer scene: TSOT Ruby/Rails Project Nights, which will take place on the second Tuesday of every month. They’ll feature in-depth presentations by developers working on interesting projects — primarily Ruby and Ruby on Rails — along with drinks and munchies and a chance to socialize with your fellow developers. They’ll be hosted by Yours Truly, TSOT developer and DemoCamp regular Joey “Accordion Guy” deVilla.

The First Night: Tuesday, January 8th

This first Ruby/Rails Night will feature presentations by a couple of Ruby/Rails local heroes on their current Ruby/Rails projects:

The doors will open at 5:30, the first presentation will start at about 6, and we hope to wrap up the evening by 8:30 or 9. We’ll provide food and drinks, and if there’s enough of a demand, we can always go out to a nearby pub afterwards. There’s no cost to attend (but be advised that seating is limited).

If you’ve been thinking about making a Ruby or Rails presentation (perhaps you want to rehearse for RailsConf 2008!), we’d like to have you present it at one of our project nights!

Add TSOT Ruby/Rails Nights to your list of New Year’s resolutions!

How Do I Register?

Registration is free, but space is limited. To register for the upcoming Jan 8th gathering, please email joey.devilla@tsotinc.com

For More Information

For more information about TSOT Project Nights, please contact:

The event is also listed on Upcoming.org.

Categories
Uncategorized

It’s Complicated

Here’s the most recent XKCD comic:

“Couple” comic from XKCD (December 10, 2007)
Click the comic to see it at full size on its original page.

It reminded me of an idea I had for a simple Facebook app. It would go through your entire list of friends, and send a “please explain” message to anyone who had their relationship listed as “it’s complicated”.