Sometimes Truth is Stranger than Fiction

From a recent article in the Economist:

Readers with long memories may recall GeneDupe's previous attempt to break into the pet market, the Real Goldfish (see article). This animal was genetically engineered to deposit gold in its skin cells, for that truly million-dollar look. Unfortunately Dr Fril, a biologist, neglected to think about the physics involved. The fish, weighed down by one of the heaviest metals in existence, sank like a stone, as did the project.



My site is the second Google result for "things that would make you shit in your pants" (quotes required, alas).


Homegrown Query Languages

I've been working on a system where one of the requirements is the ability to perform simple searches based on filling out the parts of a form that are known. Basically what most Web sites would classify as "Advanced Search."

At first this struck me as a problem that had likely been solved once or twice in a really compelling way, like how Markdown and Textile have solved the problem of text-to-HTML translation.

On the other hand nearly every Web site's full-text search has a slightly different query system, so perhaps this isn't a completely solved problem. Also, full-text search isn't exactly what I had in mind: I needed a more structured system. And sending in straight or filtered SQL is just too much of a security risk (in a perfect world, this wouldn't be a problem, but we're talking PHP on Oracle here).

Eventually I settled on the following solution:

  • Fields left blank don't affect the query
  • Fields whose value isn't one of the "special values" below must be a full, exact, and case-sensitive match (SQL = clause)
  • Fields whose value begins with a tilde (~) create a case-insensitive like clause (% matches one or more characters, and _ matches exactly one character)
  • Fields that begin with a greater-than or less-than symbol constrain the value accordingly
  • Fields that are a single quote are constrained to be null
  • Any of these constraints (except a blank field) can be negated by prepending an exclamation mark (!)

It seems to do the trick, though it's far from perfect. Two obvious shortcomings are that it doesn't support "between" clauses, or indeed multiple constraints on any one column, and that there is currently no way to escape fields that actually start with a !, ', >, < or ~ (though this could easily be fixed with some sort of escape character). It's also perhaps a bit much to expect a non-technical person to grasp.

So first off, does anyone know of some other widely-deployed system that solves this problem? Secondly, are there any shortcomings of the above system (for the purpose of structured search of a table) that I haven't noticed?

Peak Oil

I've spent some time reading a blog called Peak Oil Debunked which talks about pretty much what you'd expect. Here's a representative snippet:

So here's a conservation tip for people out in the exurbs: sleep at your office or workplace during the week, and commute on the weekends. That will reduce your commuting fuel usage by 80%, even with single person commuting.

Of course the pessimists will moan and howl over this one. It pisses them off that I am unmasking the "peak oil problem" for what it really is: a trivial lifestyle issue. Sleeping at the office just isn't "realistic". It's more realistic to think that the overweight American populace will wage bloody riots in the street -- because sleeping at the office a few nights a week is so ridiculously unthinkable. The American way of life is not negotiable, doncha know.

In any case, it's an interesting counterpoint to the doom and gloom peak oil sites out there. Despite my relatively liberal and conservation-oriented views in this area, I think I'm a bit more on the Marshall Brain/Cecil Adams school on the whole peak oil thing than I am in the doomsayers' camp.

Things will definitely change once refined petroleum stops being cheaper than bottled water, but I just don't buy the idea that it's going to be an unmitigated disaster. I think it's going to be a well-mitigated potential disaster, not unlike Y2K.

Sony-Ericsson W800i + IOGear Stereo Headset = No Dice

After throwing my hands up in frustration, infomercial-style, at the flimsy tangly wired earbuds that came with my W800, I decided that wireless was definitely the way to go. I bought a pair of IOGear Bluetooth Headphones (model GBMH201) from Buy.com which arrived this morning.

I charged them for two hours, managed to get the to pair with my phone, but then discovered that they promptly disconnect from the phone after about 10 seconds. Worse, even when they're paired the phone won't play music through them. I guess that means that the W800i doesn't support the A2DP (advanced audio distribution profile). I updated the phone to the latest firmware using SE's update utility, but still no dice. So I'm shipping the headphones back to Buy.com later this week.


Bellingham Public Library Lookup Bookmarklet

As much for my own reference as for that of my (cough) readers, here's a bookmarklet that takes ISBN-containing URLs and will look them up in the Bellingham Whatcom Public Library catalog:

Bellingham Public Library Lookup

Update: This Blogger piece of shit thing is [not] eating my backslashes. Oh, well, you get what you pay for. Probably time to move to a real blogging system. Here's what the link should look like:...

Update 2: Safari is fucking up the link, not blogger. Time to file a bug report with Apple, I guess.

Update 3: Found a workaround: URL-encode the backslashes.


I Feel We've Arrived

Bellingham now has a sub-craigslist.