What’s the most expensive query you can think of? How about this one - USPS money orders are sold throughout the United States at numerous post office locations. Each money order has a unique ID number, and while there’s no data on how many money orders are sold annually, you’d assume that finding out about the status of the money order is running a SELECT query on some large table that has that money_order_id as unique index.

How long would that query take?

Well, for one, a trip to the post office (20 minutes sound reasonable, but your mileage may vary). You have to physically request Form 6401, as there’s no option to pre-fill it online. So make it another 10 minutes at postal window.

Then it takes $5, as specified in the USPS money order rules. After that the filled 6401 travels to some place in Iowa, which would get back to you two weeks later in an official letter from some kind of USPS database query execution department.

Total cost: 2 weeks + 20 minutes + 10 minutes + $5.00

Posted in Optimization at February 27th, 2008. 1 Comment.

Pretty cool idea - instead of exploring officially approved photos on the travel agent’s Web site, see what the hotel looks like in a short video. TVTrip is founded by Expedia alumni, and has videos of the hotels from around the world. They claim 3,825 videos so far, and include a variety of destinations including some motel in Palo Alto as well as Radisson SAS in Paris, France.

Posted in Entertainment, Startups at February 24th, 2008. No Comments.

Guys at PHParchitect are running a PHP contest for smallest, fastest, most efficient command-line PHP script. A seemingly simple link parser task is probably very tricky, but the task itself is somewhat poorly specced out, as several things are not clear:

  1. Their example lists the href enclosed in <link rel=”stylesheet” type=”text/css” href=”/css/c7y.css” id=”Main C7Y CSS”></link>. So is that a valid link? Anything in href qualifies as a link?
  2. Does a JavaScript window.open qualifies as a link?
  3. What about <a href=”http://www.yahoo.com” onclick=”window.location=http://www.google.com”>link</a> or any similar shenanigans? What qualifies as a link there?
Posted in PHP at February 23rd, 2008. No Comments.

Lars Strojny says that a new magic constant __DIR__ is coming to PHP 5.3. __DIR__ will refer to the current directory of the script. It’s useful for those include and include_once directives where it’s preferable to use absolute paths to avoid navigating down the include path.

Posted in PHP at February 22nd, 2008. 1 Comment.

htaccesseditor.com is an online editor for .htaccess files specifically. It’s a fairly easy way to set up custom pages for each of the HTTP errors, set up redirects for specific destinations, default pages for Web servers, and a few other things. What it doesn’t have is preventing image hotlinking via mod_rewrite, or setting up .htaccess for a virtual host.

Posted in Webmaster tools at February 21st, 2008. 1 Comment.

Emotiv brain headsetSlashdot had a story on brain control headsets coming out soon from Emotiv. The company seems to have done a fair bit of research in linking various neural activity to explicit emotions. They’re targeting gaming market, and hoping to introduce game that analyze your emotions as well as kinetic signals that the brain is sending towards the other body organs. What’s also cool is they’re launching an SDK:

Additionally, Emotiv has announced the commercial availability of its full SDK. The SDK has been upgraded significantly since it was first announced in March 2007 at last years GDC. The commercially available version of the kit now includes:

  • 2 beta-version neuroheadsets
  • Software toolkit that exposes the APIs
  • Full access to detection libraries
  • Suite of development tools for effective creation and integration of applications with content

The Emotiv EPOC is the worlds first consumer neuroheadset. It detects and processes human conscious thoughts and expressions and non-conscious emotions. By integrating the Emotiv EPOC into their games or other applications, developers can dramatically enhance interactivity, gameplay and player enjoyment by, for example, enabling characters to respond to a players smile, laugh or frown; by adjusting the game dynamically in response to player emotions such as frustration or excitement; and enabling players to manipulate objects in a game or even make them disappear using the power of their thoughts.

Headset itself will cost $299 once released into commercial production, the SDK details are available here.

Posted in Gadgets, Programming, Science, Startups, Technology at February 20th, 2008. No Comments.

The bionic arm project, sponsored by DARPA and executed by Deka Research and Development Corp. run by Dean Kamen (inventor of Segway, among other things), is nearing completion and might undergo clinical trials if DARPA sees the project fit, IEEE Spectrum says: “The arm has motor control fine enough for test subjects to pluck chocolate-covered coffee beans one by one, pick up a power drill, unlock a door, and shake a hand. Six preconfigured grip settings make this possible, with names like chuck grip, key grip, and power grip. The different grips are shortcuts for the main operations humans perform daily.”

Posted in Gadgets, Health, Immortality, Science, Technology at February 2nd, 2008. No Comments.