Just

Thursday, November 22nd, 2007. Filed under Design

Look around and enjoy the fresh new stripedy goodness of tylermcmanus.com. Thank you, StripeMania.

Oh, and favicon.cc is a great place to make your own favicons, too.

–>

Add

Wednesday, November 21st, 2007. Filed under ColdFusion

As it happens, I had the need today to add a totals row to an existing query object that summed the various column data above it. Like this:

Month Oranges
January 5
February 12
March 3
April 8
May 14
June 11
July 6
August 11
September 10
October 12
November 7
December 4
Total Oranges Sold 103

In this particular case, I preferred to do the totalling in the cfc where i’m building the query, rather than after the fact in the cfm page. I didn’t figure it would be difficult, but as it turns out, there was a bit of a hitch in the way one can reference query object columns from the ArraySum function (specifically, dot notation doesn’t work). But, then I found Ben Nadel’s post on this issue wherein he used array notation, and I’m now good to go. Thanks, Ben. Hope this little tidbit helps someone else.

<cfquery name="orangesales" datasource="#request.ds#">
    SELECT monthname, oranges
    FROM orangesales
</cfquery>

<cfset QueryAddRow(orangesales) />
<cfset QuerySetCell(orangesales,"monthname","Total Oranges Sold") />
<cfset QuerySetCell(orangesales,"oranges",ArraySum(orangesales["oranges"])) />

–>

Humorous

Friday, November 16th, 2007. Filed under Humor

When asked an either/or question, my first response tends to be “yes” or “no”.

Cashier: Would you like a spoon or a fork with that side dish?
Me: Yes, thank you.
Cashier: Which one?
Me: Oh, um…spoon I guess.

–>