the singularity of being and nothingness
ColdFusion

ColdFusion 10: ArrayEach and StructEach, Hooray!
Feb 20th
Earlier today, I was looking through the “New Functions in ColdFusion 10” doc, and noticed a few gems: ArrayEach() and StructEach(). These are huge, because until now, there has been something of a disconnect between dealing with arrays and structures in CF, and their counterparts in other languages, like JavaScript. All JS libraries (like ExtJS) have “each” methods attached to basic objects which allows you to treat collections of the same kind of thing in a bulk way. Fortunately, CF10 introduces two very handy new methods to apply an “each”-like process to both arrays and structures.
ArrayEach()NOTE: The ArrayEach() and StructEach() functions act on the original array/struct. Therefore, if you make changes to the array/struct within these functions (as in the ArrayEach() example below), the original array/struct will be affected (thanks Andy!).
So, for example, let’s say you have an array of friends’ names, and you want to make the list all uppercase. Pre-CF10, you might approach this by looping over the array, and executing a function at each iteration. Fine, easy enough, and it works. However, with ArrayEach(), you can ditch the clunkiness of the for-loop, and keep everything self-contained to the array. And, you can execute either an “inline” function, or More >

Grouping in CFLoop…Finally!
Feb 18th
With the public release of ColdFusion 10 Beta yesterday, I thought I’d play around a bit with some of the new capabilities. One of the features added in this release is the ability to group in query loops using <cfloop>.
As expected, this is pretty straightforward, and has the same capabilities as the <cfoutput> corollary. Here’s a quick example:
<cfquery name="qproducts" datasource="somedatasource"> select * from products order by category,subcategory,product </cfquery> <cfoutput> <cfloop query="qproducts" group="category"> <h1>#category#</h1> <cfloop group="subcategory" groupcasesensitive="true" > <h2>#subcategory#</h2> <cfloop> #product#<br /> </cfloop> </cfloop> </cfloop> </cfoutput>
Pretty simple, but something which I know a lot of people have wanted for quite a while. Well, now you have it!
Share this:
ColdFusion Queries to ExtJS Data Models
Jan 8th
I love data Models in ExtJS. They are extremely simple to use, but are amazingly powerful for driving robust JavaScript applications. In fact, I’ve gotten to the point where I use them in just about everything I do, and they are fast becoming an indispensible part of my JavaScript development approach.
A big part of the appeal of ExtJS data Models is their flexibility. While some data “plugins” in other JS frameworks certainly allow you mimic some of the behaviors of a data model, ExtJS’ data Model wins hands down because of its extreme flexibility. With a ExtJS Model, you can quickly and easily create powerful definitions of data objects (fields, data types, associations, validations, etc.) in your application. These models can then in turn be used to craft a data Store, which can themselves be plugged into many of ExtJS’ data components (DataView, Grid, Chart). What you end up with is a super-powerful, deeply-data-driven application in a ridiculously small number of lines of code.
Of course, the perfect complement to the simplicity and grace of ExtJS’s data Model is to “feed” it using ColdFusion. Below, I’ll outline how to retrieve data from CF, as well an extremely easy way (there are More >

Resolutions and Stuff
Jan 2nd
I’m not big on resolutions. When I’ve made them in the past, I typically last about 3 whole days before they’re broken and forgotten. Besides, there’s something a bit odd about resolutions anyway. After all, why would we wait until a New Year to do something (lose weight, exercise more, etc.), when it makes a lot more sense to do these things *before* the year begins so that we have the benefit of whatever change for the whole year?
Ah, but that’s the neurosis of the Western mind; what can be done about it? Nothing 🙂
But even though I’m reticent about making resolutions, I have been thinking about the year that lies ahead, particularly from a professional standpoint. Over the last year, I’ve been very productive in my professional development. Particularly in relation to ColdFusion, JavaScript and SQL, I have tremendously expanded my competency, and I feel quite comfortable with where I am as a developer.
However, as we all know, complacency can be a silent killer. While it may not immediately harm a person in relation to their employment prospects, it can be detrimental in the long-term, if nothing else than by souring them to the prospects of learning new skills, More >

ColdFusion Gotcha: Switch Statement in CFScript
Aug 30th
The other day, I was reworking a bit of tag-based code to use my preference of <cfscript> syntax. While doing this, I ran across something like this:
<cfswitch expression="#img.extension#"> <cfcase value=".gif,.jpg"> Not transparent </cfcase> <cfcase value=".png"> Transparent </cfcase> </cfswitch>
No rocket-science here, just a simple switch statement which just so happens to have a “case” which evaluates a list of values. Honestly, I’m not sure I had ever done a list of values in a <case>, but it just works.
Thinking nothing of it, I quickly converted it to <cfscript> syntax:
<cfscript> switch(img.extension) { case ".gif,.jpg": writeoutput("Not transparent"); break; case ".png": writeoutput("Transparent"); break; } </cfscript>
At first, I thought it was working. But as I tested a bit more, I noticed that it wasn’t. No error, per se, but the “case” was not evaluating as it did in the tag-based equivalent.
Turns out you have to do something a bit different with <cfscript>. Here’s an alternative that will replicate the tag-based functionality:
<cfscript> switch(img.extension) { case ".gif": case ".jpg": writeoutput("Not transparent"); break; case ".png": writeoutput("Transparent"); break; } </cfscript>
According to the docs,
Multiple case constant: statements can precede the statement or statements to execute if any of the cases are true. This lets you specify several matches for one code block.
Ah, so More >

How I Got Started in ColdFusion
Aug 1st
This is my contribution to the thread started over at Ray Camden’s site. If you’re a CF developer, be sure to share your thoughts too!
Like all good stories, this one begins with bourbon and cheap cigars.
Years ago, I was in a poker society with my best friends in the world. We were liturgically serious about our poker, going so far as to create the framework for member rules, organizational bylaws, and the like.
At some point, it became apparent that our group needed a website–just some place online where we could store information for our organization. Though I had no idea how to do it, I volunteered to create the website. A ridiculous number of hours–and a hacked together Photoshop-to-HTML export–later, our website was born.
It was hacky, impossible to maintain, and *not* secure (despite my lame attempt to create a login). Yet through the process, I discovered that I LOVED making websites.
Fast-forward a year and a half, and I landed my first job as a web designer. I was laughably under-qualified, but I got my shot and I threw all my energy into it. I had a lot of success, and felt good about my decision. Even after moving from a “hobby” to More >

Renaming Files in CFScript
May 13th
I’ve recently taken to writing all of my components in pure cfscript. To me, they look cleaner and are easier to navigate. Plus, I just really like cfscript 🙂
One of the challenges, of course, is that after using tags for so long, it can be sometimes challenging to find equivalent functionality in cfscript. Some tags expose functionality that may not be readily apparent in cfscript functions provided.
Take cffile’s “rename” action. If you look through the list of “FileXXXX()” methods, you’ll see a lot that correspond 1-to-1 with the tag actions. However, interestingly enough, there’s no FileRename() function.
Now you might think that this means that files can’t be renamed with using cffile. Wrong! You can simply use FileMove() to accomplish the rename. And actually, if you think about it, this makes sense. After all, when you move a file, you literally move it–so if the file is moved to a different or same location with a new file name, that’s the file that’s getting moved…no copy to worry about cleaning up after the face.
Ok, enough of that. So here’s a pretty ordinary file rename with cffile:
<cffile action=”rename” source=”c:\files\memo\readonlymemo.doc” destination=”c:\files\memo\normalmemo.doc”>
But we can accomplish precisely the same thing with FileMove():
filemove(c:\files\memo\readonlymemo.doc, c:\files\memo\normalmemo.doc);
Pretty nice!
Share this:

ColdFusion Wrapper for Aviary Effects API
May 11th
Sometime last week, Aviary (the super-sweet collection of online image editing tools) launched their new developer site, along with a new Effects API. When I see “API,” I think “ColdFusion wrapper,” so that’s exactly what I did 🙂
Share this:
IE9 Support for Gloss
Apr 24th
Today I released a major revision to Gloss…it now supports IE9!
One of the reasons I hadn’t provided support for IE9 was because of a bug in ExtJS’s TreePanel, which would not correctly attach events to tree nodes. However, I found a nice workaround (read hack) that resolved the issue, so now I’m pleased to release this app for IE9 users.
One of the things I am pleasantly surprised about is how darn well Gloss operates in IE9. The animations are smooth, the page loading is super-quick, and it’s just all-around a very slick experience.
So if you’ve wanted to use Gloss, but were impeded because of the lack of IE support, now’s your chance to turn over a new leaf 🙂
Share this:TECHNICAL NOTE: Because of the necessity of localStorage for Gloss, running Gloss in IE9 will only work correctly if you are running in IE9 Standards Mode.