Vanity Foul
Dedicated to the wanderings of an egotistical mind.
All | Technology | News | Entertainment | Roller | Humor? | Personal | Atom | Cats | Politics


20091113
Friday November 13, 2009

Sending To 'International' Email Addresses I've spent the better part of this week resolving an issue, whereby a user with an email address at Gmail was unable to subscribe to my employer's offering due to his address containing an accented character: é.

The first hurdle was saving the address to our database. The validation routine had a rather simple regular expression that did not account for what I call "high ascii", from the Extended Ascii Codes, specifically up to char 165. A brief research turned up Les Hazlewood's most thorough validator, but even it did not account for high ascii.

It only stood to reason that it *must* be possible to email addresses containing umlauts, acutes, and accents, but the relevant specs (namely RFC 822) don't mention them. Finally, in the section on 7-bit vs 8-bit within SendMail's own resources page were references to two other specs. In section 5 of RFC 1891 were instructions on how to escape high ascii characters to meet the requirement that SMTP headers must be in "low ascii" (chars 33 - 126).

With that knowledge I was able to modify Mr. Hazlewood's regex, replacing "a-zA-Z" in his patterns with "\\p{L}", so long as each email address was then escaped before being added to the recipient list in a SMTPMessage. I based my escaping code on that provided by eadelarosa, making changes to preserve most of the lower ascii characters for readability:

public static String asciiToHex(String ascii){
    StringBuilder hex = new StringBuilder();
        
    for (int i=0; i < ascii.length(); i++) {
      	char c = ascii.charAt(i);
       	if ((c > 32 && c < 127) && (c != '+' && c != '=')) {
     	    hex.append(c);
       	} else {
	    hex.append("+" + Integer.toHexString(ascii.charAt(i)));
       	}
    }
               
    return hex.toString();
}	

I was disappointed to learn that Java's SMTP classes didn't do this work for me, though not terribly surprised.
( Nov 13 2009, 07:14:23 AM ) Technology Permalink
Trackback: http://www.brainopolis.com/roller/trackback/lance/Weblog/sending_to_international_email_addresses



20090803
Monday August 03, 2009

Building in Surveillance

It's bad civic hygiene to build technologies that could someday be used to facilitate a police state. No matter what the eavesdroppers and censors say, these systems put us all at greater risk. Communications systems that have no inherent eavesdropping capabilities are more secure than systems with those capabilities built in.[Bruce Schneier on Security]

I'm not dead yet.
( Aug 03 2009, 11:50:57 AM ) Technology Permalink [Link]
Trackback: http://www.brainopolis.com/roller/trackback/lance/Weblog/building_in_surveillance



20090718
Saturday July 18, 2009

Echoing Rafe

Why I don't own a Kindle
By Rafe
The Kindle seems neat and all, but I'm not going to pay for books that I don't actually own.

( Jul 18 2009, 10:05:30 AM ) Technology Permalink
Trackback: http://www.brainopolis.com/roller/trackback/lance/Weblog/echoing_rafe



20090319
Thursday March 19, 2009

Parrot 1.0 It's been a long time coming, Parrot 1.0 is finally released. How far behind is Perl 6?
( Mar 19 2009, 06:27:10 AM ) Technology Permalink [Link]
Trackback: http://www.brainopolis.com/roller/trackback/lance/Weblog/parrot_1_0



20090223
Monday February 23, 2009

Epoch Time Event

Kottke notices that tomorrow, Feb 13th, at 5:31:30 PM Central Time, the unix clock (which some call "epoch time") will hit 1234567890 (that is the number of milliseconds since 'the beginning', Jan 1 1970 iirc). Some coworkers and I are celebrating at Shamrocks, stop on by and join us.
( Feb 23 2009, 10:34:52 AM ) Technology Permalink [Link]
Trackback: http://www.brainopolis.com/roller/trackback/lance/Weblog/epoch_time_event1



20090114
Wednesday January 14, 2009

Jingoism

Last night Sean and 'friend' from Solution Design Group presented the Javascript Dependency Manager they've created, jingo at the Groovy Users of MN meeting. The presentation was very well done, including an excellent review of the existing systems.

Basically, the other solutions where created ad-hoc to support the javascript framework they originate from: Dojo and YUI, primarily (Ext also?). But Jingo was purpose-built with the singular intent to create transitive javascript dependency. The Jingo guys should how easy it is to wrap Jingo around another library (unfortunately it does require modifying existing .js files) by demonstrating an RSS reader created with Ext, but using Jingo for dependancy management.

The major criticism of the Ext/Jingo demo was the number of files that Jingo downloads in this case (as opposed to the ext-all.js monster). To address this Sean has already begun planning a G/JSP tag library (or other mechanisms) for a given page to dynamically condense all the dependencies into a single .js file (with caching, obviously). Also, I think the point was missed of using the appropriately sized solution to a problem: for a more modest dependency tree Jingo is a good fit, but if your going to need a monster library like Ext, perhaps ext-all.js is better

I'm not a professional javascript developer, but Jingo really got me excited. Cool technology, a well thought-out design, easily extends existing libraries. +1

Update: Sean has released the slides from his presentation. ( Jan 14 2009, 08:47:24 AM ) Technology Permalink [Link]
Trackback: http://www.brainopolis.com/roller/trackback/lance/Weblog/jingoism



20081022
Wednesday October 22, 2008

Profanity Filters

I've written a profanity filter once in my past. I think the biggest problem outlined in that link is substituting "appropriate" words for inappropriate letter combinations. But it also seems that no matter how careful you are, someone will still find a way to swear on your site (see the comments). ( Oct 22 2008, 02:22:26 PM ) Technology Permalink [Link]
Trackback: http://www.brainopolis.com/roller/trackback/lance/Weblog/profanity_filters



20080618
Wednesday June 18, 2008

Senate blocks debate of clean energy tax credits Risking the wrath of Reuters:

The U.S. Senate on Tuesday blocked debate of a bill to offer about $17.7 billion in tax incentives for consumers to build renewable energy sources like windmills and solar arrays, and buy plug-in cars that run on electricity rather than gasoline. source

That just sucks, and I wonder what their justification is. It does involve a lot of money, including $7 billion over 10 years to extend renewable energy credits. But couldn't we offset that by reducing the subsidies we pay the oil companies? I mean, it's rather obvious they no longer need the taxpayer's help and they produce record profits quarter-after-quarter.
( Jun 18 2008, 10:49:52 AM ) Technology Permalink [Link]
Trackback: http://www.brainopolis.com/roller/trackback/lance/Weblog/senate_blocks_debate_of_clean




archives
links