Easy Envelopes Widget

I discovered the Easy Envelopes widget over at Apple Gazette This widget makes it really easy to print an envelope without having to open Word or some similar app, and without having to worry about formatting. It’s literally faster than scribbling it out by hand, which is half of the point for me; the other half is satisfying my OCD by having nice, clean print. ;-)

It autopopulates the return address by looking up your “Me” record in the OS X address book. You may then fill in the destination address by searching for a contact or by manually typing in an address. Very well thought out.

The widget did a great job at getting over typical problem areas, like printer and paper size. Overall, this widget is definitely Ambrosia calibre. And it’s free!

Using LIKE in Query of Queries SQL

The Query-of-Queries (QoQ) feature of ColdFusion is especially useful for manipulating data that ColdFusion holds in a Query object but isn't actually a result set from a SQL query. For instance, LDAP results, directory lists, and FTP directory lists are all returned as Query objects by <cfldap>, <cfdirectory>, and <cfftp>.

That said, don't forget that QoQ supports the LIKE conditional for pulling the records you want. But you can search for more than 'StartOfPhrase%' when using LIKE.

I have an app that calls an LDAP query and then uses QoQ to find all User IDs (cn's) that start with "W" or "G". Why didn't I just make this filter in the LDAP call? With effort, I could have, but I was already filtering on different requirements in LDAP, and it was easier at this point to fine-tune the results with a QoQ. Previously, my code looked something like this:

SELECT * FROM LdapResults WHERE cn LIKE 'W%' OR cn LIKE 'G%'

Whereas that worked, it is needlessly verbose; this became more clear when I also had to check for IDs starting with "A", and I realized how uncomely that approach was. It also doesn't enforce the fact that the legit IDs will always be 6 characters in length.

So start using LIKE's other accepted symbols! Brackets [] let you specify a range of acceptable characters, and underscore _ lets you define how many characters to look for, versus the wildcard % which just accepts any length of characters.

SELECT * FROM LdapResults WHERE cn LIKE '[WAG]_____'

That query is more accurate and actually shorter (note: syntax highlighting makes the underscores difficult to see).

Finally, what if the first character should always be a "W", "A", or "G", but the remaining 5 characters should always be digits? The QoQ LIKE doesn't support repetition quantifiers like the curly braces {} do in RegEx. So you will have to manually repeat [0-9] for each character:

SELECT * FROM LdapResults
WHERE cn LIKE '[WAG][0-9][0-9][0-9][0-9][0-9]'

That does start getting more verbose again, but the SQL is now very precise regarding its filter requirements. A little tweaking like this, and QoQ can be extremely handy.

Mad at Your Money: Unlocking the iPhone

As the froth and fervor surrounding the iPhone continues, it is no surprise that we see some people making some poor decisions. For instance, we have the lady who spends $800 for the front spot in line because she thought she was going to buy out the whole store, clearly ignorant of the one-per-customer rule at AT&T stores. That's just incredibly embarrassing and foolish, which is different than what I'm going to talk about next.

Alex King is someone I respect and occasionally read, and he recently canceled his iPhone plan in line with TUAW's instructions so that he could use his iPhone as the world's coolest widescreen iPod and internet device--apparently the syncing and WiFi capability continue to function just fine with the phone components disabled.

My first reaction was how awesome that was. And more power to Alex for having the gumption to try it and for buying himself the coolest iPod ever. :-) In the end, though, you're paying $599 + $49 for first month of service = $650 minimum for an 8GB video iPod. The cool factor may be here now, even if the high price tag doesn't deter you, but it may feel a bit more foolish when the heat and excitement of the iPhone cools and Apple brilliantly times the release of a 60GB widescreen multitouch iPod 3 months out from now, for a comparable $400-$600 price range because it lacks the complexity, price and hassle of the phone components. The price, the timeframe, the mere existence of said iPod are all pure fabrications to indulge my point (although "sources" do claim these things). It could happen. And it would make business sense.
Yes, there may be some phoneless iPhone owners grumbling in October.

  Theme Brought to you by Directory Journal and Elegant Directory.