coldfusion

Moving Pic of the Day Foiled Again

A while back I made an attempt to move Pic of the Day (NSFW) off of ColdFusion 8 and onto Railo 3.  I can't afford a license of CF9, so my only upgrade path is through a free alternative.  Unless someone has an extra four grand they want to give me….
Last time I was foiled [...]

Goodbye JRun, Hello Tomcat

Last night I finally kicked JRun to the curb and replaced it with Tomcat on my personal server.  I knew JRun was a pig and that I'd get some improvements by switching, I'd just never gotten around to doing it.  I don't know why I waited.  Here are two graphs from my server, see if [...]

Interesting ColdFusion CFQuery "Feature"

And just to be clear, when I say "feature" I actually mean "completely broken behaviour," though for a change of pace it's not with the compiler.  Probably.  Hopefully.
Consider this innocent-seeming code:
<cfquery datasource="dsn_A" name="">
insert into test (s) values (
'dsn_A – record 1'
)
</cfquery>
Every CF app has this (or equivalent) [...]

Even Better CF DB Error Messages

A few weeks ago I posted about fixing CF's DB error messages so that they include query params you passed as well as the raw SQL of the query.  I also supplied a patch for detail.cfm so your SQL renders in a PRE tag for better readability, but didn't make it general enough to handle [...]

Fixing CF DB Error Messages

Fixing CF DB Error Messages

When you're working on someone else's code and you get an error message (because I know you'd never write code that errors), CF usually does a pretty good job of giving you the info you need to debug the issue.  But for some reason they don't show you query parameters, even though they're included in [...]

Custom Scopes for CFGroovy2

The middle of last week I committed an update to CFGroovy2 to allow an arbitrary number of scopes to be passed in as attributes, just like you have always been able to do with the 'variables' attribute.  If you update, the change is the addition of lines 47-51:
<cfloop list="#lCase(structKeyList(attributes))#" index="scope">
<cfif listFind("language,lang,script,variables", scope) EQ [...]

More Floating Point Madness

Ever the one to fight floating point errors, I thought I'd share my latest troubles.  The context is rendering axis labels for a chart, specifically from 67 to 68, in steps of 0.2.  As you can easily deduce, the desired list has six labels: 67.0, 67.2, 67.4, 67.6, 67.8, and 68.0.  However, ColdFusion might disagree [...]

Beware ColdFusion Floating Point Integers

Adobe ColdFusion uses java.lang.Double to represent numbers in most cases, and it's a floating point representation.  That means it stores a finite amount of precision about the number in question, and discards any bits beyond that.  The stored precision is relative to the magnitude of the number.  So if you ask it to store a [...]

ColdFusion Struct Literals Are Not Thread Safe (CFML Ones Are)

If you read my blog regularly or follow me on Twitter, you know how much I hate Adobe's quasi-implementation of struct (and array) literals.  I'm really hoping "third time's a charm" and CF9's implementation is sane.  The gripe is that this code:
<cfset s = {
name = "barney",
age = 29
} />
is executed [...]

Riddle Me This, CFLOOP

Take this simple loop:
<cfloop from="1″ to="10″ index="i">
#i#<br />
<cfif i EQ 3>
<cfset i += 3 />
</cfif>
</cfloop>
What is the output?  My answer is the numbers 1-3 followed by 7-10.  But I was dismayed to learn this evening that it doesn't seem to be the case on my [...]