Dept. of Egregious Programming Jokes

In web development, you’re always working to minimize the amount of intelligence in the web page itself while maximizing user-friendliness. It’s a hard thing to balance, of course, and nowhere is this problem more obvious than in validation of inputs, like dates. Usually, dates are put in using two or three “select” controls, though sometimes the year is a text box. Of course, unless you imbue these controls with a bit of intelligence, you can get dates that make no sense (September 31, for example, but with leap years it’s more complex than that).

For a couple days, I’ve been working with a client on how we might deal with yet-another-date-entry, this time for a birthday. While I’ve coded the fancy Javascript and DHTML stuff required to make one of these work in the past, I’ve come to believe that depending on Javascript is bad juju, and so we were trying to think of ways around it (there aren’t really any; you just have to do your validation on the server). In thinking of options, though, my partner and I jokingly suggested that we could just put in a list of all the birthdays, and have the user pick. This would mean:

  • We’d have no chance of getting invalid input; and
  • We’d have NO client-side scripting involved.

This combination of factors respresents, at first blush, a sort of web programming Holy Grail, but only until you inspect how it’s been accomplished. This particular approach is untenable on its face for lots of reasons, but that doesn’t make it any less funny to deploy just long enough to get a laugh out of the project manager and client, so I set out do just that.

Creating such a select-box involves having a defined list of options; the only difference here is that the list of options would be very, very long. Here some interesting things to note about this particular list of options:

  • It contains every date between January 1, 1900, and August 25, 2004.
  • This means the file — and the resulting select-box on the page — contains some 38,233 entries. Next time you complain about how many entries there are on FedEx.com’s country picker, remember this little experiment.
  • The list took too long to generate on the fly (i.e., every time the page loaded), so I wrote another script to dump the whole long option list to a file that I then included in the HTML template.
  • The file containing the list is 2.1 megabytes all by itself, so the page takes a couple minutes to download even on broadband; best not to try it at all on dial-up.

I put the thing together and called the project manager, mentioning that I’d found a way to solve the date entry problem that (as the list above notes) ensures we’ll only get valid data, but wholly eschews scripting. He was shocked and very pleased, so I told him where he could inspect it and asked him to call me if he had any questions.

Two minutes later, the phone rang. The project manager (whom we’ll call Andy, as that’s his name {unless you’re flying a jet with him [HDANCN?]}) was amused enough that he’s having a hard time talking, and insisted that I leave it live long enough to spring the joke on the actual clients. Heh.

Sometimes, being a geek is fun.

The media aren’t liberal. They’re just idiots.

And they’re not doing their job. They’re behaving as if giving equal time to both sides of an issue — say, the Swiftie thing — is being “objective,” when in reality we have actual facts on one side and an enormous pile of lies on the other. Any real journalist — are there any on TV anymore? — would actually examine what’s being said, and try to separate the wheat from the rhetorical chaff (read: bullshit).

At least SOME people are noticing this. From the Times’ Alessandra Stanley, quoted at TPM; she referrs to the softball treatment Wolf Blitzer gave Bob “Hatchetman” Dole, who said demonstrably untrue things about Kerry’s war record on his show:

That kind of air-kiss coverage is typical of cable news, where the premium is on speed and spirited banter rather than painstaking accuracy. But it has grown into a lazy habit: anchors do not referee – they act as if their reportage is fair and accurate as long as they have two opposing spokesmen on any issue.

More satirically, The Daily Show made the same point Monday night:

STEWART: Here’s what puzzles me most, Rob. John Kerry’s record in Vietnam is pretty much right there in the official records of the US military, and haven’t been disputed for 35 years? CORDDRY: That’s right, Jon, and that’s certainly the spin you’ll be hearing coming from the Kerry campaign over the next few days. STEWART: Th-that’s not a spin thing, that’s a fact. That’s established. CORDDRY: Exactly, Jon, and that established, incontravertible fact is one side of the story. STEWART: But that should be — isn’t that the end of the story? I mean, you’ve seen the records, haven’t you? What’s your opinion? CORDDRY: I’m sorry, my *opinion*? No, I don’t have ‘o-pin-i-ons’. I’m a reporter, Jon, and my job is to spend half the time repeating what one side says, and half the time repeating the other. Little thing called ‘objectivity’ — might wanna look it up some day. STEWART: Doesn’t objectivity mean objectively weighing the evidence, and calling out what’s credible and what isn’t? CORDDRY: Whoa-ho! Well, well, well — sounds like someone wants the media to act as a filter! [high-pitched, effeminate] ‘Ooh, this allegation is spurious! Upon investigation this claim lacks any basis in reality! Mmm, mmm, mmm.’ Listen buddy: not my job to stand between the people talking to me and the people listening to me. STEWART: So, basically, you’re saying that this back-and-forth is never going to end. CORDDRY: No, Jon — in fact a new group has emerged, this one composed of former Bush colleages, challenging the president’s activities during the Vietnam era. That group: Drunken Stateside Sons of Privilege for Plausible Deniability. They’ve apparently got some things to say about a certain Halloween party in ’71 that involved trashcan punch and a sodomized pi–ata. Jon — they just want to set the record straight. That’s all they’re out for. STEWART: Well, thank you Rob, good luck out there. We’ll be right back. Via Atrios

No wonder mainstream media hates these guys. They’re the only ones still doing any sort of real commentary.

Fafnir and Giblets contemplate the end times

Fafblog:

“But Giblets!” says me. “We are faced with an eschatological dilemma! If the world ends don’t we end too?” “Never!” says Giblets. “The world may be temporal but Fafnir an Giblets are forever!” “Yes!” says me. “We defy all ends! An middles an beginnings for good measure!” “We defy linearity!” says Giblets. “We are of the internet and embrace its heady disjointed bosom!” “We are hypertextual dispensationalists!” says me. “The endtimes cannot touch us!” “But what will we do after the world ends?” says Giblets. “Dunno,” says me. “We got that ol Yahtzee set.” “An Risk the game of world domination,” says Giblets. “An Fafblog,” says me. “An Fafblog,” says Giblets. “Even after the end of the age.”

New, America ’04, now with Loyalty Oaths!

By now it’s old news, but we’ve been meaning to put this up for days. Salon’s coverage of the “must sign loyalty pledge to see George” story is pretty spot-on. I mean, What. The. Fuck? Are they just allergic to, you know, the democratic process? Are they afraid he’ll self-destruct if he gets asked hard questions? And can’t they get a fer-crying-out-loud copyeditor? Sheesh.

The headline alone should freak you out

U.S. Uses Secret Evidence In Secrecy Fight With ACLU.” Excerpt:

The Justice Department is using secret evidence in its ongoing legal battles over secrecy with the American Civil Liberties Union, submitting material to two federal judges that cannot be seen by the public or even the plaintiffs, according to documents released yesterday. In one of the cases, the government also censored more than a dozen seemingly innocuous passages from court filings on national security grounds, only to be overruled by the judge, according to ACLU documents. Among the phrases originally redacted by the government was a quotation from a 1972 Supreme Court ruling: “The danger to political dissent is acute where the Government attempts to act under so vague a concept as the power to protect ‘domestic security.’ Given the difficulty of defining the domestic security interest, the danger of abuse in acting to protect that interest becomes apparent.”

Read that last graf again, just for emphasis. Secrecy is not democratic. This is why sunshine laws exist. Our government — or at least this Justice Department — appears to hate the idea that it is ultimately accountable to you and me.

Atrios Nails It

As much as the White House has tried to spin it otherwise, there’s a large difference between pro-Kerry/anti-Bush ads financed by organizations like MoveOn and the anti-Kerry ads produced by the Swifties. Atrios has more, but the gist is this:

  • SBVfT is an organization that exists only to slam Kerry with demonstrably untrue allegations from people who did not in fact serve with him in Vietnam, whereas
  • MoveOn has existed for a while now, and has yet to run any ad that’s simply and objectively false.

On a related note, this Boston Glob editorial wonders how it might have played out had Clinton attacked Bob Dole’s record in 1996.

In which we confound those who stereotype us

Much has been made lately of the soon-to-expire Asault Weapons Ban. Antigun people love this law, and want it extended/renewed; for the most part, people who’ve actually read the law laugh out loud at how ridiculous it it. The big, ugly secret is that “assault weapon” is a meaningless term that has nothing to do with the actual functions of a given rifle; the weapons banned by the AWB are weapons that fail cosmetic, not functional, tests. (Remember that fully-automatic weapons are already illegal, and that semiauto guns must not be easily convertable to full-auto, so the AWB has nothing to do with rate of fire.)

It’s just plain a bad law. People who oppose gun regulation already hate it, but people who support gun control laws ought to hate it, too. For illustration, see if you can tell the illegal ones from the legal ones.

In which we track down bizarre bugs

One thing that separates real web people from halfasses (and no-asses) is the sheer quality of the code, and its adherence to <a href=””http://w3c.org”>standards. For a variety of reasons, “well, it works” isn’t a very good barometer of whether or not a particular page’s code is correct; some browsers helpfully adjust errors in HTML to produce what they think you meant, for example, which is great for that particular browser, but not so good for the developer, as it gives him or her a false sense of accuracy. Most modern browsers are more meticulous, so this happens less often now, but it’s still an issue.

The only way to make sure you’re doing right, then, is to (a) test in as many browsers you can find and (b) use a validator to ensure syntactic and semantic accuracy in your code. Many, many problems go away if your code validates; in fact, today’s lesson is how important it is to validate even if you think you’re already valid.

Be advised that while we all, I’m sure, are very, very careful about validating our HTML, it is equally important to validate our CSS as well. I spent an hour or so today trying to figure out why my formerly functional, carefully validated layout worked fine in Mozilla, Firefox, and IE, but failed utterly in Safari — frankly, a situation I’ve never seen before.

Only after remembering to validate my CSS did I discover the problem:

This rule had a typo in it:

      div#left h2 {
        color: black;
        padding-bottom: 0;
        margin-bottom: 5px;
        text-align: left;>
        }

The trailing > in the final attribute crept in without my knowledge, doubtless on an inadvertent keystroke. IE and Gecko browsers appear to have been ignoring it as garbage; at the very least, it caused no trouble for me there. In Safari, however, the entire layout was hopelessly broken with all three columns rendering on top of each other, etc — a pretty awful sight, and very discouraging.

Up to now, I’ve not had this particular experience — ie, everyone but Safari working fine. When I code to a compliant browser, I usually find that only minor changes are required to get an optimum presentation in all modern browsers, so this little problem took me completely by surprise.

Once again: validate, validate, validate. Then validate again. The time you save may be your own.

More on the Gluten-Free Host

Fafblog scores again:

“Giblets is not concerned with the heartless exclusionary legalism of the Catholic hierarchy!” says Giblets. “Giblets is concerned because it clearly states that only unleavened wheat can turn into parts of Jesus! We have been workin with leavened flour!” “But we have to Giblets,” I says pointin at the nicely molded Jesus dough. “Otherwise our Jesus Bread-Golem will not rise when we bake him.”

We’re SO SURE this was a “clerical error”

It’s no secret what we Heathen think of the bizarre, Kafka-esque “no-fly list” created in the wake of 9/11; it’s a system and notion positively brimming with opportunities for abuse, and one that seems utterly allergic to transparency.

Now the troubles have extended to Senators, so perhaps something will be done.

Clerical error puts Kennedy on “no fly” list CAPITOL HILL The Senate Judiciary Committee has heard this morning from one of its own about some of the problems with airline “no fly” watch lists. Massachusetts Democrat Ted Kennedy says he had a close encounter with the lists when trying to take the U-S Airways shuttle out of Washington to Boston. The ticket agent wouldnt let him on the plane. His name was on the list — in error. After a flurry of phone calls, Kennedy was able to fly home, but then the same thing happened coming back to Washington. Kennedy says it took three calls to Homeland Security Secretary Tom Ridge to get his name stricken from the list. The process took several weeks, in all. And Kennedy asks — what about the little guy? AP

Note: we don’t want to hear it if your comment includes any reference to Florida date-rape trials or auto accidents. Let it go, or post about it with the Freepers. <?p>

Dept. of “Gaaaaaaa!”

Some rock-throwing LA kids inadvertantly angered 120,000 bees from a colony large enough that it had compromised the structural integrity of the building housing it.

If you’ll excuse us, we have to go have an enormous attack of the heebie jeebies now. And also pay the Terminex bill.

Hurricane Postscript

So we’re fine, and the wedding is on, and will take place at the original location. On the other hand, Charlotte Country — south of Sarasota — is a disaster area, and lacks basic things like operational hospitals; additionally, hundreds of thousands of folks evacuated the lower areas of Sarasota and Tampa only to find themselves directly in the path of the storm, albeit a reduced, inland version.

But as for us and ours, we’re fine.

Hurricane Update

It’s now raining. Poorly dressed local weathermen breathlessly suggest the possibility that Charley may make the jump to storm manhood and claim Category 5 before landfall. Fortunately, it appears to have turned inland a bit to the south, thereby saving, among other things, Tampa Bay.

In other news, we’ve watched bad USA television, half of the Terminator, and something that involved Bob Newhart doing charades on stage with a monkey. Beer and rum supplies are holding up well, and we’ve discovered the couch can actually fold out into a bed.

So, all in all, things are looking up.

What you should know about copyright expiration

The British equivalent of the RIAA is having a fit, largely because copyright law is working as intended — meaning Elvis’ “That’s All Right” is about to pass into the public domain (in January, 2005) after a reasonable period of exclusive copyright (fifty years). They’d like very much for this not to happen, just as Disney has managed to keep Mickey locked up with well-timed copyright extensions for years. Read this for more about why this is bad.

What we knew, and when we knew it

Robert X. Cringley has some interesting things to say about a study the Department of Justice had done regarding sentencing guidelines, and what effect they have on crime. The study found that longer sentences actually increase crime, though, so the DOJ buried it, and never mind the consequences, because it’s more important, I suppose, to lock people up than to work for a healthier society.

I hate people.

Fun in the Sun Report

So, right now, it’s clear that 49 of the 50 states in our fair country are completely legitimate places to be, to drink, to watch people get married, etc.

We, of course, are in Florida. In Sarasota, actually. Theoretically, there’s a big wedding tomorrow, but Charley may have other plans. We’re waiting for the storm in a borrowed condo; we’ve got food, ice, towels, wireless Internet access, plus important shit like rum and beer. And, as I said, the plan is for there to be a wedding tomorrow, but the original location is now closed in will likely remain so given its location on the bay.

Them Republicans just cain’t seem to keep their yaps shut

Or something. As you must be aware by now, over the weekend it looks like they burned another covert operative by being either careless or incompetant (it doesn’t look like there’s a revenge angle on this one). Bill Clinton made a great point (on Letterman last week) about the difficulties of gathering human intelligence in the Arab world when you’ve spend the previous 50 years trying to perfect the art of blending in behind the Iron Curtain, but surely we can do better than this.

On the other hand, perhaps this could be the problem.

Sure, they’ve got torture, no free press, and the death penalty, but that’s liberation for you

Fafblog on recent Iraqi events, including the bizarre tail of an Oregon National Guard unit who found some Iraqi prisoners being “freedom tickled” by their newly-sovereign captors, intervened, and were told by their commander to “return the prisoners to their abusers and immediately withdraw.”

This, children, is how we spread freedom and democracy.