Categories
Geek

Dial “M” for MAXINT

[I originally posted this to The Farm, but thought that it might be of general enough interest to post here.]

This one got pointed out to me by Alain Chesnais, Tucows’ new Director of Product Management. Google the following phone number:

(214) 748-3647

There are nearly 19,000 results for this phone number at the time of this writing. That’s a little odd.

Also of note is the fact that although 214 is the area code for central Dallas and parts of northeast Texas, the first page of Google results also reports that the number for four cafes with free wi-fi in San Francsico, Santa Cruz and Fremont, all cities hundreds of miles to the west, in California. It’s also reported as the phone number for the Jackson County, Florida Chamber of Commerce. And an inn in Labrador.

What’s happening here?

I looked at the number on Friday morning, not thinking much about it until lunch, when it occured to me that I if I ignore the phone number formatting, it becomes:

2147483647

…which should look very, very familiar to most programmers. That’s the largest value for a signed integer that can be represented in 32 bits, or MAXINT for many programming languages…and databases.

These Google results for the MAXINT phone number are most likely coming from database-generated pages (and maybe a few static pages in which someone dutifully copied the number from a database-generated source) in which the phone number was stored as a signed 32-bit integer value.

This will work for phone numbers with the following area codes…

  • 201: Jersey City/Hackensack NJ
  • 202: Washington, DC
  • \

  • 203: Connecticut
  • 204: Manitoba
  • 205: Alabama
  • 206: Seattle, WA
  • 207: Maine
  • 208: Idaho
  • 209: Fresno, CA
  • 210: San Antonio, TX
  • 212: New York City
  • 213: Los Angeles

and some subset of numbers in the 214 (Central Dallas) area code.

The moral of the story: don’t store phone numbers — or for that matter, any number that has no actual value as a quantitative amount, such as social security numbers, serial numbers and so on — as integers!

Categories
It Happened to Me

We’re in Today’s Toronto Star

More later, but in the meantime, here’s the link to the story (free registration required)!

Categories
Uncategorized

Blogacatmas Participants [Updated]

My thanks to these Blogacatmas participants, who posted cat pictures on their blogs in honour of this very special day:

Update: Rannie’s posted a great photo up on Photojunkie.

Categories
Uncategorized

Blogacatmas, Part Three

Yes, even more cat pictures…

Single girl + living alone with cat = big trouble. I know this from experience.

“I know kung fu!”

The trick is to gain the baby’s confidence, after which kitty can suck out its breath at will.

“Put down and catnip and back away slowly…”

Atkins-compliant!

“Everybody get on this side of the table if you want to be in the picture!”

Categories
In the News

Switcheroo

Categories
Uncategorized

Blogacatmas, Part Two

More pictures with cats…

There’s some kind of Wizard-of-Oz thing going on here…

“It’s not what it looks like, honey…I can explain…”

Looks comfy. But should a sudden storm hit…

“If those things in Raisin Bran aren’t really raisins, THEN WHAT THE HELL ARE THEY?!”

Categories
Uncategorized

The First of Many "Blogacatmas" Pictures

On this blog, the first Friday of October is traditionally declared as

“Blogacatmas”, the feast day in which bloggers are encouraged to engage

in that most stereotypical of blog activities: posting pictures of

cats. Here’s the first one, courtesy of my friend Eldon Brown…