Officer Roseland offers a unique take on 'Stimulus Package'
I don't blog about music too often here, but I figured this was a special case. I first heard of Officer Roseland when Brian Jones pinged me. He was using BlogCFC for their band blog so I asked for a sample of his music. He gladly obliged, and I was pretty impressed. Very much an indie band, reminding me a bit of the 80s, but more Pixies than synth pop. As a sample:
Today the band released their 4th album, Stimulus Package. Unlike other bands who release their music for free and sell physical CDs or other extras, Officer Roseland is doing something unique. When you ask to download their album, you can choose to either GIVE or TAKE. If you GIVE, the band will donate to a charity. If you TAKE, they will send you a dollar. Seriously. They will pay you to download their music.
I know zip about the music business so I have no idea how well this will work, but I can definitely recommend folks give their new album a try. (It sounds much more polished then the embedded video above.)
jQuery Thickbox and ColdFusion Dynamic Image Resizing
Ok, is it just me, or has JavaScript spoiled me? It seems like almost daily I come across a web page with a long list of image thumbnails. I click on one and the entire page reloads. I click back and get a whole other large page load. I click on another image, and, well, you get the idea. I hate this. I've blogged before about the jQuery Thickbox plugin. It is a great solution to this problem, especially when you team it up with ColdFusion. Here is a great example.
ColdFusion LiveDocs Updated
On Friday I mentioned that the ColdFusion support site had been updated. Today LiveDocs was updated as well. Randy Nielsen goes into detail here:
ColdFusion 8 documentation is now running under Community Help
jQuery Form Validation with Selects
<A reader on my first post on jQuery Form Validation< asked an interesting question - how do you validate select form fields? Specifically, given that a drop down may have a 'Other' option, how do mark a text field required if the drop down is set to Other?
Use Google Analytics and Ajax? Remember to update your code
Just a quick tip to remind you that if you use Google Analytics with a heavily Ajax driven site, you may want to update your code to track your Ajax requests. Google details this here:
How do I track AJAX applications?
I updated ColdFusionBloggers to add this code and did a bit of cleanup. Previously I had 4 different functions that loaded content into the main div for the site. There was loadContent(), which was called when you first hit the page, previous and next, called with pagination, and the search button. All of these used jQuery's .load() function to load a URL and then ran a callback function named cbfunc. (Yes, real imaginative.)
cbfunc took care of turning off the loading animation. I thought it would be a great place to handle logging the request with Google. Unfortunately, I didn't have access to the URL requested from within the call back function. I could have rewritten the 4 main functions to do something like so:
$("#content").load(u, function() {
$("#loadingmsg").hide();
pageTracker._trackPageview(u);
});
That would have worked - but it felt like a lot of repetition. I added a new method to handle everything called loadDiv():
function loadDiv(theurl) {
$("#content").load(theurl,function() {
<cfif not structKeyExists(variables, "isiphone") or not variables.isiphone>
$("#loadingmsg").hide();
</cfif>
<cfif not application.dev>
pageTracker._trackPageview(theurl);
</cfif>
});
}
The iPhone check in there simply disables hiding the loading indicator for the iPhone version. The application.dev check simply blocks Google Analytics from running when I test locally.
Anyway, I'll let folks know what kind of impact this has on my stats. To be honest, I don't ever go beyond page 1 myself, except when I'm searching. Still though I'm curious.
Ask a Jedi: Career advice for a ColdFusion Developer?
Asoka asks:
I need your advice, Ray. I'm at sort of a crossroads in my career right now and am looking to either move up or move on to greener pastures. I'm in a web developer position in the federal government and I've been building web apps with ColdFusion for several years. What I want to know is, what would be a better option for a developer like me who's looking to move up: (1) Learn a ColdFusion framework, gateways, and a bunch of other advanced CF stuff that I don't already know, or (2) learn PHP or another entirely different programming language. I'm sort of leaning towards the second option because I *think* it would give me greater flexibility and marketability and I want to avoid being a "one-trick-pony", especially in today's competitive IT job market. As always, thanks for your expert guidance and assistance!
So before I offer any type of career advice, I'll remind folks that I probably don't have the best history for someone who should be offering suggestions. I think I've had around 5 jobs or so over the past 10 years, which averages about a job every 2 years. My wife and kids have been understanding of this (thank goodness!) but I'm probably not the example you want to use if you specifically want to 'move up' in an organization. That being said, I'll try my best to offer some thoughts on your main question - should you advance your ColdFusion knowledge or focus on learning other languages?
ColdFusion added to Adobe Community Help
I twittered on this earlier (for folks who want to follow me, I'm cfjedimaster on Twitter) - Adobe has added ColdFusion to their Community Help system. Head over to the form and try a search for RSS. Notice how my blog comes up? You can now search at Adobe and get a mix of 'official' and community resources. More information may be found at the Adobe Community Help blog:
Behold, ColdFusion fans: the ColdFusion search engine is here!
Ask a Jedi: Using ColdFusion Ajax to set Client Variables
<James Brown (yes, him) asks:
Is there a way to assign a value to a client variable using JavaScript? I know JavaScript runs on the client side and ColdFusion on the server, but with AJAX allowing remote calls to ColdFusion I wonder if it might be possible. Thank you for your help.
Yep, and it's so easy, it's rather trivial. As long as you can make a HTTP request with Ajax, then you can run any code you would imagine.
An Introduction to jQuery and Form Validation (3)
For my final (well, for now) post on jQuery and forms validation, I thought I'd actually create a real form with actual back end processing. I'm going to demonstrate with a form that makes use of both client-side and server-side validation, and also demonstrate one of the cooler features of the jQuery Validation library - remote validation.
Determining the location of ColdFusion's log files
This was asked on cf-talk yesterday but figured it would be a good tip to share here. Is there a way - via code - to determine the location of ColdFusion log files? Yes, via the Admin API:
<cfscript>
adminObj = createObject("component","cfide.adminapi.administrator");
adminObj.login("admin");
debugger = createObject("component", "cfide.adminapi.debugging");
logfolder = debugger.getLogProperty("logdirectory");
</cfscript>
<cfoutput>#logfolder#</cfoutput>
The first two lines create an instance of the Administrator API CFC and logs in with my password. (And no, 'admin' isn't really my password. It's password.)
The next two lines use the debugging CFC to run getLogProperty("logdirectory"), which as you can guess, gets the log directory value.
More Entries