Hydrogen Car Almost Makes Nancy Pelosi President

Sunday, April 8th, 2007

According to the Detroit News:

Credit Ford Motor Co. CEO Alan Mulally with saving the leader of the free world from self-immolation.

Mulally told journalists at the New York auto show that he intervened to prevent President Bush from plugging an electrical cord into the hydrogen tank of Ford’s hydrogen-electric plug-in hybrid at the White House last week. Ford wanted to give the Commander-in-Chief an actual demonstration of the innovative vehicle, so the automaker arranged for an electrical outlet to be installed on the South Lawn and ran a charging cord to the hybrid. However, as Mulally followed Bush out to the car, he noticed someone had left the cord lying at the rear of the vehicle, near the fuel tank.

“I just thought, ‘Oh my goodness!’ So, I started walking faster, and the President walked faster and he got to the cord before I did. I violated all the protocols. I touched the President. I grabbed his arm and I moved him up to the front,” Mulally said. “I wanted the president to make sure he plugged into the electricity, not into the hydrogen This is all off the record, right?”

OK. So our illustrious leaders are a few homeworks short of a gentleman’s C, and I’m not too surprised that a major CEO would think they can’t be trusted to figure out which end of the car to plug an extension cord into. However here’s my question:

Just what the hell is Ford doing building a car that can blow up and kill people if some random idiot (or the President of the United States) sticks the plug into the wrong hole?
(more…)

Fundamentally Safe Database APIs

Friday, April 6th, 2007

Is anyone aware of work on fundamentally safe database APIs for server side programs that completely avoid the possibility of SQL injection? What I envision is a somewhat limited API that does not execute raw SQL statements or provide any facility to do so. Instead you’d set up something like this:

Statement s = database.getSelectStatement();
s.setTable("customers");
s.addField("email");
s.addField("telephone");
s.addCondition(
  new EqualsCondition("id", "p17")
);
ResultSet r = s.execute();

The library would turn this into the usual SQL statement

SELECT email, telephone FROM customers WHERE id = "p17"

The library could verify the individual parts of the query before submitting it to the database. If you passed a string like "id = \"p17\" OR true; DELETE * FROM customers; SELECT * FROM customers WHERE " to EqualsCondition() it would throw an exception.
(more…)

WordPress Upgraded

Wednesday, April 4th, 2007

I’ve upgraded the WordPress engine on this site to the latest version, 2.1.3. Initial results look positive, but holler (preferably via e-mail) if you notice anything going wrong.
(more…)

Supplying img sizes automatically

Wednesday, April 4th, 2007

What if any tools are available for reading HTML, finding missing width and height attributes on img elements, and filling in the relevant values? So far all I’ve found is this Perl Script from Randal Schwartz circa 1999 and this Perl script based on ImageMagik from Marc Merlins. I haven’t been able to resolve the dependencies for Schwartz’s script yet. Merlins’ runs, but is not XHTML savvy. That may be easy to fix though.

BBEdit almost does this, but it replaces existing height and width attributes too, including ones you’ve deliberately set to a different size. I only want to fill in missing height and width attributes, not change existing ones.

I’d love to find a simple open source GUI tool that could pull this off for an entire site.

Death Threats, Anonymity, and Blogs

Sunday, April 1st, 2007

I’ve been avoiding comment on the whole Sierra/Locke/etc. dust-up lately. Most of the commentary seems pretty on-the-mark, but a few usually sensible people are starting to overreact and call for self-censorship. Once the mainstream media gets hold of this next week, expect the customary cast of Congressional idiots to elevate that to calls for government mandated censorship. However the problem has been blown way out of proportion. There’s one thing that I think needs to be said that hasn’t been said yet to put this whole sordid mess in its proper perspective:

Death threats are no big deal.
(more…)

Styling abbr with CSS

Wednesday, March 28th, 2007

Proper use of the abbr and acronym elements is good for accessibility and good for conversational style writing. No longer do you have to write phrases that grate on the ear such as, “Many problems are much easier to solve with a native Extensible Markup Language (XML) database and XQuery than with a relational database and Structured Query Language (SQL).” Instead, you just assume 99% of your audience knows what you’re talking about, and instead you write:

Many problems are much easier to solve with a native <abbr title="Extensible Markup Language">XML</abbr> database and XQuery than with a relational database and <abbr title="Structured Query Language">SQL</abbr>.

However, there are two problems with this:
(more…)