links for 2009-09-09

  • Sarah Palin still believes in death panels, the bogeyman, ghosts, and werewolves. She's just the gift that keeps on giving.
  • A single Perl regular expression to validate e-mail addresses against RFC822. This is why I don't use Perl. I mean, I'm impressed, but this is nearly meaningless to me. I'd hate to try to modify this.
  • A PHP function that really and truly validates e-mail addresses against all relevant RFCs. I'm still using a validator that I cobbled together in 1999, one that doesn't even accept plus signs in the address, despite that I complain mightily when a website won't let me enter an e-mail address with a plus sign.
  • "The Grand Tour was the traditional travel of Europe undertaken by mainly upper-class European young men of means. The custom flourished from about 1660 until the advent of large-scale rail transit in the 1840s, and was associated with a standard itinerary. The tradition continued after rail and steamship travel made the journey less of a burden, and American and other overseas youth joined in. It served as an education rite of passage."

Published by Waldo Jaquith

Waldo Jaquith (JAKE-with) is an open government technologist who lives near Char­lottes­­ville, VA, USA. more »

15 replies on “links for 2009-09-09”

  1. I love Perl. :)

    Possibly the finest-looking tweetable piece of code I ever wrote was some Perl to convert base 10 numbers to base 7–as represented by solfège syllables.

    I call it “julie-andrews.pl”:

    ($\,@_)=(“\n”,’Do’,’Re’,’Mi’,’Fa’,’So’,’La’,’Ti’,shift);do{$_=$_[$_[$#_]%$#_].$_;$_[$#_]=($_[$#_]-$_[$#_]%$#_)/$#_}while($_[$#_]);print

    P.S. There’s a special warm place for those who refuse + signs in addresses!

  2. Why does anyone still pay attention to Palin? Didn’t she become irrelevant when she quit her job?

    I guess on the bright side. If this media love affair pushes her over the top for the Republican nomination in 2012, then it’s a win.

  3. Using regex for email address “validation” is wrong-headed. That’s the job of the mail gateway. Your job as a programmer is to make sure there is one @-sign and no tricky evil characters (whitespace, mainly) before or after it.

    There’s no difference between these two invalid addresses as far as your website is concerned: anything@example.net (user does not exist) and foo@3 (bad domain).

  4. “Why does anyone still pay attention to Palin? Didn’t she become irrelevant when she quit her job?”

    One would think… but then again, it’s a convenient tactic when your own side looks foolish day in and day out. These frequent Palin updates are essentially saying, “Yeah, but.. but… but… LOOK AT HER!”

  5. Using regex for email address “validation” is wrong-headed. That’s the job of the mail gateway. Your job as a programmer is to make sure there is one @-sign and no tricky evil characters (whitespace, mainly) before or after it.

    But…wouldn’t that be done by validating the address using regex?

    Sounds like the question here is not whether to perform validation, but rather how much validation to perform. If someone’s already provided you with a validation regexp (as part of, say, a Perl module) that performs reasonably, why bother to write one of your own to perform a less-thorough job?

  6. One would think… but then again, it’s a convenient tactic when your own side looks foolish day in and day out. These frequent Palin updates are essentially saying, “Yeah, but.. but… but… LOOK AT HER!”

    Sarah Palin is clearly one of the most important voices of the Republican Party. When she says something crazy, it’s totally relevant.

    Also, I think that the Republican Party looks much, much more foolish right now. Just yesterday Mr. Family Values there in California was caught for his mildly pornographic bragging about cheating on his wife and that jackass in congress heckled the president. I see zero need for distraction from Democrats.

  7. Also, I think that the Republican Party looks much, much more foolish right now.

    That’s because you’re a Democrat. :-)

  8. I’m with Waldo on that point. I was a lifelong moderate Republican until the party went completely unhinged of order a decade ago.

    I’m voting Democratic these days in the hopes that some time in the woodshed will bring the Republican party back to its senses. It needs to purge its fringe influences, and to do that it needs to be out of power for awhile. (It’s unhealthy for any one party to maintain power indefinitely anyway….)

    The Democrats also have to go through this cycle, from time to time, and they’ll probably be going through it again soon.

  9. What destinations would be included in a modern-day Grand Tour, I wonder? The Renaissance’s Euro-centric outlook on life was broad enough to think that an individual’s education needed practical, personal familiarity with both cultural history and the modern-day peoples of important foreign lands, but it was narrow enough to think that Western culture and politics was all that mattered. What would be added to a Grand Tour today? What would be removed?

  10. As has been pointed out, Publius, Palin is an actual honest-to-god power in the GOP. Unlike, say, Jeremiah Wright or Saul Alinsky, who only matter to the left in the fever dreams of the right. Sure, both sides have nuts, but your nuts are running things. Ours are fringe voices famous only because of the obsessions of the right.

    ~

    Good question, Sam. I’m just back from a month in Australia in which I met quite a few young folks (college, or immediately after) on their own (generally year long) Grand Tours. Australia and Thailand are definitely stops on it.

  11. @Jeff: I think there’s a misunderstanding here because of the several issues involved in email address validation. The first is security in relying applications (thick client or thin), the second is address validity. Security will require a regex, of course.

    Validity, on the other hand, can only be taken as far as ensuring that the data is in the form “username@host”. Some regexes will try to ensure that “host” is a valid FQDN, which is silly: What’s the difference between a non-existent TLD and a non-existent subdomain? At that point, you’re edging into verification, which regex could never do.

    Here’s my question: When is it the case that 1) you need to know that an email address follows the RFCs, 2) you won’t be checking if it actually exists first, and 3) you are not an SMTP (etc.) server?

Comments are closed.