« April 2007 | Main | June 2007 »

May 2007 Archives

May 31, 2007

Calling CF from a command line?

While looking over Ashwin Matthew's ColdFusion blog posts, I caught this gem on calling CF from a command line interface (CLI). I have always wanted to use this exact feature but always presumed that it wasn't possible. But now that I know better, I can stop using PHP for CLI work and start using a far better language for the task.

Updating cached queries after content changes

One of the finer arts of being a ColdFusion developer is learning how to efficiently cache your queries. CF gives you such an easy and powerful way to cache your queries that it's easy just to start caching particular queries for a specific amount of time and leave it at that. But what if you cache your query for an hour or a day and an editor updates the content in the meantime? The content as it's displayed on the website won't change until the cache expires, which may not please the editor. So you might decrease the duration of your cache's lifetime, perhaps to just an hour. But then you could be refreshing the cache a lot more often than you need to since the editor doesn't make changes more than once a day. So is there a way to get fine-tune control over your query so that it's cached for as long as you need but gets refreshed right after someone updates the content?

Yes there is! Read on and I'll share my technique.

Continue reading "Updating cached queries after content changes" »

May 30, 2007

Microformats CFC mentioned in Open Source Update and ColdFusion Weekly Podcast

Brian Rinaldi was kind enough to mention my microformats code in his latest ColdFusion Open-Source Update as well as in his contribution to the ColdFusion Weekly Podcast. Thanks, Brian! I'm gratified that you think the code is worthy of the community's attention.

Digg this-- public beta of ColdFusion 8

Ray Camden and Brian Rinaldi have each mentioned in their blogs that the public release candidate of ColdFusion 8 (also known as "Scorpio") has been posted to Adobe Labs. Release the hounds!

And to help spread the word, make sure to digg the story!

May 17, 2007

Thank you, Adobe

The Boston CFUG was treated to a preview of CF8 (aka Scorpio) tonight by Jason Delmore. The set of new features in Scorpio is really amazing: it has new database introspection tags, MS Exchange integration, and automatic creation of Breeze/Connect presentations; the especially exciting and obvious improvements are native image manipulation, improved file I/O, and caching for queries which use the <cfqueryparam> tag (finally!).

Kudos to Brian Rinaldi and Jason Delmore for putting together such a fun presentation. I really look forward to working with CF8.

Oh, and I also really ought to thank Brian and Adobe for the generous prizes they raffled off. I was the lucky recipient of two of them. Thanks again!

May 16, 2007

ColdFusion CFC for microformats

Since hearing about microformats at the An Event Apart Boston conference, I've wanted to build some tools for myself and to share with other ColdFusion developers to help make use of this new standard. The tools I've created will handle creating and formatting of hCards, hCalendars, and hReviews, and they'll also handle parsing these formats from other people's web sites just like the Technorati contact tool does.

Very quickly: microformats are an XHTML specification which supports the encoding of contact data (hCards), dates and events (hCalendars), reviews (hReviews), and other formats in regular XHTML code, thus enabling machines to successfully parse data out of the same URIs that people can read themselves. This saves developer time and makes the content more semantic and search-engine friendly. Read John Allsop's blog Microformatique for a more in-depth yet approachable explanation.

You can download the CFCs here. Please use them, modify them, and give me feedback! I hope that lots of people find them helpful.

Just added: I've created a listing for this project on RIAForge at microformats.riaforge.org

May 14, 2007

Faster file parsing in Scorpio

Finally! File parsing will get faster in Coldfusion, as Ben Forta informs us via his blog.
For starters, if you have ever had to work with large text files in ColdFusion (maybe parsing a large CSV file) you'll know that doing so is very inefficient. ...This is slow for two reasons. Not only does ColdFusion read the entire file into memory in a variable all at once, but also looping through the file requires treating it as a list which involves lots of parsing which can also be resource intensive. ...[The new code will] open the file, reads one line at a time, and closes it when done.
Sweet! This will make many of my pages sooo much faster.

May 3, 2007

Google Browser Sync

I just found out about Google Browser Sync for Firefox. With it you can synchronize your browser settings across computers (including "bookmarks, history, persistent cookies, and saved passwords"), and even restore tabs and windows from your previous session. You can control which settings are synced.

But while it all sounds convenient, syncing my history, tabs, and windows is about all I would allow it to do. I mean, there's a reason that saved passwords and cookies were written with local filesystem security-- they're not meant to be shared across different computers through a network. Sure, the Browser Sync extension encrypts your data, but I just don't want my history, cookies, and passwords stored on anyone else's systems. After all, encryption once thought to be "unbreakable" has been broken plenty of times before.

So I may use Google Browser Sync, but if I do I'm going to use it in a very limited fashion. The convenience of having my passwords and cookies synced is not worth the security risk of having them stored elsewhere on the 'Net.

May 2, 2007

Best Practices for Online Credit Card Security

After several years of coding applications that needed to process credit cards in real time as well as perform autorenewals at specified intervals, I've come up with a few best practices that I use as a habit.

Continue reading "Best Practices for Online Credit Card Security" »

May 1, 2007

Problems with browser-cached charts in ColdFusion

After adding some charts to the result pages of our tools with CF7's new <cfchart> tag, my boss reported an annoying behavior that he observed: if he clicked the browser's back button to go back to a previous result page, the chart wouldn't appear. Instead, he'd get an placeholder graphic with an error message about the chart having expired from ColdFusion's cache. What to do?

Continue reading "Problems with browser-cached charts in ColdFusion" »