« December 2007 | Main | February 2008 »

January 2008 Archives

January 31, 2008

"How do you pronounce URL?" Techrepublic, who cares?!?

The subject line of today's email newsletter from Techrepublic asks "How do you pronounce URL?" The body goes on to say '[a user] asks: "Is it common practice to pronounce URL as 'Earl,' or is it more common for people to spell it out as U-R-L when they talk about a URL?" Find out what TechRepublic members say about pronouncing URL, SQL, and more...'

They really must have been scraping the bottom of their idea barrel when they sent this one out. What a waste of space in my inbox! C'mon, TechRepublic, I really don't care how your editors pronounce "URL", I don't care what your readers think on the question, and I'm willing to bet that most other readers don't really care either. You can do better than that.

January 30, 2008

Yet another lesson on database indexing... (and solving "null null" and that-query-doesn't-exist errors)

Boy, am I in a much better mood today than in the last two days.

I had come into the office over the weekend to re-install ColdFusion MX 7 on our production server, thinking that switching to single-server mode from multiple-server mode might solve some of the strange, unpredictable errors that we were seeing on our live site. The re-install, which we had practiced on our dev server first, went without a hitch and the site seemed to perform quite well. But as Saturday progressed to Sunday, the site saw even more errors than before. The same happened as the week began on Monday, with our site becoming increasingly slow and unstable.

The errors that we saw varied, and happened in all different parts of the site, but had one major theme in common: they all had to do with queries. For instance, we saw errors saying that "qQuiz" wasn't defined when we tried to loop over a query of that name-- but the cfquery tag for qQuiz, which executed before the loop, didn't throw an error. We also saw errors stating that queries were timing out, and even the infamous "null null" errors, which you see if you're using cferror templates to provide nicely-formatted errors for your users. Our pages, especially the queries themselves, were taking an amazingly long time to execute-- anywhere from 2 to 15 seconds per query. Try as a might, I couldn't get a handle on what the problem was...

Continue reading "Yet another lesson on database indexing... (and solving "null null" and that-query-doesn't-exist errors)" »

January 29, 2008

Introducing ClickHeat for ColdFusion, a clicks heatmapping application

I'm finally ready to share ClickHeat for ColdFusion with the rest of the community. It's a port of Labsmedia's original ClickHeat project, which is written in PHP. ClickHeat shows you where users are clicking on your pages: which links, which graphics, which nav items.

ClickHeat has two main parts: a JavaScript which tracks click coordinates and sends them via AJAX to a .cfm page which saves the information to a log file; and an application which reads the log file and converts it to a click map or heat map. A heat map creates a fuzzy, color-coded map telling you where the greatest amount of click activity occurs on your page (cooler blues indicate less activity, while brighter yellows and reds indicate more activity).

You can check out ClickHeat in my projects section. Please let me know what you think or if you run into any problems using the code.

January 26, 2008

Hae a Happy Burns Night (Jan 25th)

I'm sending out a happy Burns Night to everyone. Burns Night, which was actually last night, is a celebration of the life of Robert Burns, a Scottish Poet. My wife and I went to the house of a Scottish friend for dinner, where we were treated to the traditional welcome speech and the Address to the Haggis. Yes, we ate haggis-- and it was nowhere near what you hear it to be. Although it was made up of oats and ground-up sheep, it was, quite frankly, delicious. Perhaps the whisky helped.

If you ever get the chance, attend a Burns Night. It's good food, good fun, and good poetry. Imagine The Simpsons' Willie the groundskeeper reciting poetry, and you'll have some idea of what Robert Burns' literature sounds like (with apologies to my Scottish host, Grant).

January 22, 2008

Now this is how to send a preview email...

In a few of the apps I've written there's been the need to show users a preview of a newsletter email or stock alert email. Before AJAX was widely known and available, you used to have to provide some action that would submit a form and refresh the page in the browser, perhaps interrupting the flow of the user's experience in the process. But today I noticed that the email service provider iContact has a great way of handling one-off preview emails without making you leave the page you're on.

Continue reading "Now this is how to send a preview email..." »

Your civil rights: Help change the FISA bill for the better

I believe in the protection of American civil liberties, and so I encourage everyone to sign the petition to Senator Reid to help change the FISA bill currently under consideration by Congress for the better.

I wanted to spread this message since I believe it's important. I believe that to enforce the laws of our country, the government should be able to gather evidence about crimes. But it should have to get a warrent to do so. From the petition on the ACLU's site:

President Bush wants Congress to pass a bill that lets the government spy on the phone calls and emails of Americans without a warrant.

He also wants a bill that makes sure the truth about illegal spying on the emails and phone calls of Americans is never exposed. He does this by stopping lawsuits against phone companies that illegally handed over the phone calls and emails of Americans to the government.

But very soon, the Senate will vote on a bill to regulate spying on the emails and phone calls of Americans. What we don't know is whether Senate Majority Leader Harry Reid will ask the Senate to take up a bill that was written closely with the Bush administration, or a more reasonable bill.

Tell Senator Reid you don’t want lawbreakers to be let off the hook. And you don’t want the government to seize your phone calls and emails without a warrant.

I mean, really... who on earth would want to encourage communications companies to feel as if they could break the law now with the promise that they'd be protected by immunity later? If you agree, or even if you are unsure, make your voice heard and sign the petition.

Which is the best feed reader?

I'm starting to keep up with the blogs of more and more people these days, so I figure that it's time I get some help keeping track of all of them. I've put ColdFusionBloggers.org on my bookmarks toolbar, and while it's a great aggregator (props to Ray!) I keep wondering whether I've missed anything that's fallen off the short list it creates. I think maybe I ought to use a reader that will help me track a large number of blogs and mark whether or not I've read any given posting. What does everybody else prefer to use? Google Reader? FeedDemon? How exactly do you use them to keep up with the massive number of good posts out there?

January 17, 2008

Internationalization: Integrating language files into your ColdFusion application

While thinking about which features to include in one of my applications, I decided it would be valuable to customers (and a good mental exercise for me) to provide the cabability for the app to support different languages, and to support the ability for the user to add new languages of their own.

I will admit that while I did look around a bit for articles on how to achieve this, I didn't look very hard, because the solution seemed readily apparent...

Continue reading "Internationalization: Integrating language files into your ColdFusion application" »

January 16, 2008

A nice-to-have developer extension: MRI bookmarklet from Westciv

MRI will highlight all elements which match the selector you enter in the MRI dialogRob Wilkerson reminded me in yesterday's post regarding XRAY to mention the MRI bookmarklet from Westciv as well. From WestCiv's site: "MRI is a free cross browser tool that lets you test selectors with any web page. Selectors, particularly complex ones can be difficult to get exactly right - MRI lets you experiment with them on any web page (local or online, static or dynamic).

Essentially, MRI lets you search and identify specific selectors on your web page. Selectors are the names or tags that you specify in your CSS so that you can "select" which elements to style. So MRI will help you find all anchor tags within a list item (li > a), or all elements with a certain class or ID.

I put this as a "nice to have" since I don't think it's as useful as XRAY is. It's more often that I'm wondering "why on earth is this particular element styled/not styled this way?", which XRAY will tell me, than I wonder "which elements have this certain selector?"

January 15, 2008

Another must-have developer extension: XRAY bookmarklet from Westciv

I've got to add to my list of must-have developer tools:

  • XRAY in action, showing the CSS inheritance of the posting titles on my blogXRAY: XRAY is a JavaScript bookmarklet which allows you to "see the box model for any element on any web page". That doesn't sound very sexy, but it is-- when activated, this bookmarklet brings up a modal dialog box that will show you the nested parents for whatever element you click on, and you can even traverse up. Whichever element you click on or is in focus will be outlined. It's fantastic for determining an element's exact height, width, nesting, and CSS inheritance.

ColdFusion market share: Why isn't CF offered on Yahoo! Domains?

Jake Munson's recent blog entry about ColdFusion's market share made me do some thinking. We all benefit when CF gains market share, since there will be 1) more work for CF developers, and 2) a more robust community, with more open source projects and more code to be shared among us. So how can CF be put in front of developers who aren't otherwise exposed to it? Is there any way its use could be effectively free, like PHP is?

So it occurred to me that there would be a way to get it in front of a large number of developers. There are a few hosting companies who really reach a large audience, such as Yahoo! Domains. Whatever such companies offer as hosting tools is what the population at large will try. Now I ask you-- if someone were to sign up with Yahoo! for their web site, and be given the choice of using PHP or ColdFusion to code their site, which would they choose? ColdFusion, of course!

So why on earth hasn't Adobe struck some kind of deal to get CF offered on Yahoo! Domains? Instead of making someone choose CF as their hosting plan, why not get it to be offered for free to whoever signs up? Adobe would still make money from a licensing fee, and ColdFusion would get huge exposure.

January 11, 2008

What would happen if Apple bought Adobe?

Robert X. Cringely wonders in today's column about a possible purchase of Adobe by Apple. I wonder how this would affect ColdFusion? Any thoughts out there?

Two must-have web developer extensions for Firefox

In case other developers aren't aware of two of the handiest extensions for Firefox:

  • MeasureIt: This puts a small widget in the left side of your status bar; when you click on the widget, your cursor turns into a crosshair which you can then click-and-drag to get a to-the-pixel measurement of any area of the page. Perfect for the times that you're wondering just how much room you have for a graphic or table.

  • ColorZilla: This puts a small widget in the left side of your status bar; when you click on the widget, your cursor turns into an eyedropper which you can then use to color sample any area of the page-- and you can then copy the color value to your clipboard in RGB or hex. Great when you're wondering what nice color some other site is using, or when you need to pick one color as the matte for a transparent GIF that's going over a gradient.

UI technique: changing submit button appearance via background images

In my recent post titled "Preventing multiple page requests after double-clicks", I suggest a way to use JavaScript to prevent multiple requests resulting from double-clicks on submit buttons or links. In the comments of my posting, Sam Farmer mentions the technique of putting "...the submit button in a span or div and after submission change the span or div contents to say 'Processing' or something like that." His is a great idea, and one that I've used myself in other sites. I responded that I'd blog about my technique for changing the appearance of a submit button to show that it's been clicked, so here goes!

Continue reading "UI technique: changing submit button appearance via background images" »

January 10, 2008

Preventing multiple page requests after double-clicks

A friend asked me for advice today on a problem he had been experiencing with his ColdFusion application. On around one out of every 500 requests, there would be an error saying that a certain session variable was undefined. He wondered if the problem was that he was deleting the session variable at the bottom of the page, but I assured him that it couldn't be the source of the error earlier in the page. But the answer I suggested was... double-clicks.

I think that double-clicks on a link or submit button could cause the same page to be requested and run twice at almost exactly the same time. The first request would run but never reach the browser; the second would run and then be sent back to the browser. If the timing was right, the first request would destroy the session variables right in the middle of the page processing of the second, throwing an error in the process. So what can be done about it?

Continue reading "Preventing multiple page requests after double-clicks" »

January 8, 2008

Input should be validated by your application, not by your users!

Using the Symantec Store checkout process today to renew NAV for some of the office computers, I found myself baffled by one of their input requirements. Under the phone number field on the credit card entry screen, appears the phrase "Please enter numbers only." I only noticed this after typing in the phone number with a dash after the first three digits and seeing my entry get truncated because the field was at its character limit:

symantec-store-phone-field.gif

Why on earth can't Symantec, a company who purports to be able to defeat malware attacks and eradicate viruses from your computer, manage to parse a simple dash out of a phone number? This is a prime example of putting work where it doesn't belong-- on the shoulders of the customer. Any web site, whether they are trying to sell products or services or are just trying to get registration and participation, should make it as easy as possible for people to use the site. Parsing dashes from phone numbers and spaces from credit card numbers is so easy, there's absolutely no excuse to make the customer do it for you.

Configuring Foundeo Spell Checker to work with ColdFusion's FCKEditor

During a recent project, a client wanted to get a spellchecker working with FCKEditor. They had selected Foundeo Spell Checker to work with, which is a nicely-portable implementation since it uses a .jar library as the spelling dictionary-- no need to install a specific library that could only run on Windows or OSX or Linux.

The following instructions are good for the downloaded version of FCKEditor, not for the version that's built in to Coldfusion 8. Because the JavaScript object reference for the editor is different for CF8, I'll have to give instructions for that editor in another post.

Continue reading "Configuring Foundeo Spell Checker to work with ColdFusion's FCKEditor" »

January 7, 2008

How to get dynamic content on static HTML pages

When I first started my blog, I was using an old version of Coldfusion that couldn't support any of the modern blog projects. So, I installed MovableType instead, which publishes my blog as static HTML pages. Static code makes it kinda hard to put in all of those nice, dynamic touches that web developers are used to including in their pages, especially of the subject of the blog is often ColdFusion.

But I got it in my head that I wanted to put interesting and ever-changing quotes at the bottom of my blog entries, as I've seen on a few other major sites (you may have noticed the pithy quote at the bottom of this page). More experienced developers will be able to guess right away how I got it to work, but if you're curious about how I did it exactly, please read on.

Continue reading "How to get dynamic content on static HTML pages" »