So, I understand that Apple purports to have good reasons for not supporting MMS at the moment and that Apple plans to support MMS this summer for 3G and 3G S phones and AT&T seems to be proud of themselves for offering MMS for free on the iphone despite the fact that MMS is free with basic messaging with almost every other provider, but whatever. That's all well and good.
But, here's what pisses me off . . . aside the fact that MMS has been around a really long time and that the iPhone is one of the few phones that doesn't support it, I'm still really annoyed by the way AT&T . . . oh excuse me . . . at&t decided to hack together some form of MMS support.
If you don't have an iPhone, let me tell you how this goes. You get a text message. The text message links you to a simple at&t multimedia messaging page with text boxes for message id and password. Then, you enter your message id and password which are provided in the text message.
Now, if you don't have a computer handy and you want to view this message on your iPhone, you had better grab a pen, 'cause this message id looks something like this: esth9389uohh or 1ch309903hsuh or 47&75uck5r3411y3ffingb4d! How I'm expected to remember this, I don't know.
Then, the password is a little easier to remember. It's just two four letter words separated by a two digit number. So, why do I find this so frustrating? Well, simply because there is no reason under the sun to do this. There is absolutely no difference between my entering these codes manually and at&t tacking them onto the query string. In fact, if they did that, they could use longer keys and could make it harder to brute force.
Then, when I got an MMS message, I could just click the link and, lo and behold, there would be my message. I wouldn't have to try to write down the dumb message id and try to figure out if that l is a 1.
I've got a password for you at&t . . . epic69fail.
another programmer trying to enhance his craft through information sharing and socialization
Tuesday, June 16, 2009
Friday, June 12, 2009
Soundex Extension Method for C#
I've been pretty swamped at work lately so I've not been blogging much. Worse than that, I haven't really been able to do much creative programming and virtually nothing academic.
A few days ago, I was working on some basic name searching and recognized an opportunity to squeeze in some play time. It occurred to me that the users of our application will be looking people up by name and will often not know how to spell the name correctly.
I wanted to allow users to search for people by name without regard for different spellings. For example, if you're looking for Geoff McArther or Jeff MacArther, both names will be returned by the same search term.
To do this, I used a technology invented back in the 1920s for the US Census called soundex. The following is a set of extension methods that implement the soundex phonetic algorithm:
A few days ago, I was working on some basic name searching and recognized an opportunity to squeeze in some play time. It occurred to me that the users of our application will be looking people up by name and will often not know how to spell the name correctly.
I wanted to allow users to search for people by name without regard for different spellings. For example, if you're looking for Geoff McArther or Jeff MacArther, both names will be returned by the same search term.
To do this, I used a technology invented back in the 1920s for the US Census called soundex. The following is a set of extension methods that implement the soundex phonetic algorithm:
public static string Soundex(this string s)Now, it may not yet be perfect as I had a pretty hard time finding the exact specs for the American soundex, but it should be pretty close. If you notice something wrong, please leave me a comment and I'll correct it.
{
// by default, a soundex is the first letter
// followed by three numbers
return Soundex(s, 4);
}
public static string Soundex(this string s, int length)
{
return FullSoundex(s)
.PadRight(length, '0') // soundex is no shorter than
.Substring(0, length); // and no longer than length
}
public static string FullSoundex(this string s)
{
// the encoding information
const string chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
const string codes = "0123012D02245501262301D202";
// some helpful regexes
Regex hwBeginString = new Regex("^D+");
Regex simplify = new Regex(@"(\d)\1*D?\1+");
Regex cleanup = new Regex("[D0]");
// i need a capitalized string
s = s.ToUpper();
// i'm building the coded string using a string builder
// because i think this is probably the fastest and least
// intensive way
StringBuilder coded = new StringBuilder();
// do the encoding
for (int i = 0; i < s.Length; i++)
{
int index = chars.IndexOf(s[i]);
if (index >= 0)
coded.Append(codes[index]);
}
// okay, so here's how this goes . . .
// the first thing I do is assign the coded string
// so that i can regex replace on it
string result = coded.ToString();
// then i remove repeating characters
//result = repeating.Replace(result, "$1");
result = simplify.Replace(result, "$1").Substring(1);
// now i need to remove any characters coded as D from
// the front of the string because they're not really
// valid as the first code because they don't have an
// actual soundex code value
result = hwBeginString.Replace(result, string.Empty);
// i used the char D to indicate that an h or w existed
// so that if to similar sounds were separated by an h or
// a w that I could remove one of them. if the h or w does
// not separate two similar sounds, then i need to remove
// it now
result = cleanup.Replace(result, string.Empty);
// return the first character followed by the coded
// string
return string.Format("{0}{1}", s[0], result);
}
Communication Clarity Fail
When I'm not writing awesome software (grin), you can usually find me flying airplanes, dreaming about airplanes, thinking about airplanes, or blogging about airplanes.
Yesterday, I was getting ready to make my first solo in a Super Decathlon, and I spent an agonizing nerve-racked hour waiting for my instructor to get off of a conference call. I thought I'd try to work off some nervous energy reading.
Lately, I've been reading The Pragmatic Programmer. It's a really great book and will probably be the subject of several forthcoming posts reviewing the book, but that's not the topic here.
This post is about the coincidence of me sitting there at the airport reading about programming and finding this British Airways memorandum that was published in Pilot Magazine in 2006:
Yesterday, I was getting ready to make my first solo in a Super Decathlon, and I spent an agonizing nerve-racked hour waiting for my instructor to get off of a conference call. I thought I'd try to work off some nervous energy reading.
Lately, I've been reading The Pragmatic Programmer. It's a really great book and will probably be the subject of several forthcoming posts reviewing the book, but that's not the topic here.
This post is about the coincidence of me sitting there at the airport reading about programming and finding this British Airways memorandum that was published in Pilot Magazine in 2006:
From British Airways Flight Operations Department notice:Oh, thanks for clearin' that one up fellas!
There appears to be some confusion over the new pilot role titles.
This notice will hopefully clear up any misunderstandings.
The titles P1, P2, and Co-Pilot will now cease to have any meaning,
within the British Airways operational manuals. They are to be
replaced by
-Handling Pilot,
-Non-Handling Pilot,
-Handling Landing Pilot,
-Non-Handling Landing Pilot,
-Handling Non-Landing Pilot,
-Non-Handling Non-Landing Pilot.
The Landing Pilot is initially the Handling Pilot and will handle the
take-off and landing except in role reversal when he is the
Non-Handling Pilot for taxi until the Handling Non-Landing hands
the handling to the Landing Pilot at 80 knots.
The Non-Landing (Non-Handling, since the Landing Pilot is handling)
Pilot reads the checklist to the Handling Pilot until after Before
Descent Checklist completion, when the Handling Landing Pilot
hands the handling to the Non-Handling Non-Landing Pilot who
then becomes the Handling Non-Landing Pilot.
The Landing Pilot is the Non-Handling Pilot until the 'decision
altitude' call, when the Handling Non-Landing Pilot hands the
handling to the Non-Handling Landing Pilot, unless the latter call
'go-around', in which case the Handling Non-Landing Pilot
continues handling and the Non-Handling Landing Pilot continues
non-handling until the next call of 'land' or 'go-around' as appropriate.
In view of recent confusions over these rules, it was deemed
necessary to restate them clearly
Subscribe to:
Posts (Atom)