This blog has moved!

Due to the limitations of using a free WordPress.com blog, and the fact that I already have a webserver with available space, I’ve decided to move this blog to a new home: http://tuttletree.com/nerdblog/

I will miss being listed in the RSS feeds for the Coldfusion tag, etcetera, but in this case the juice is worth the squeeze.

Leave a Comment

Bummer! No CFUnited for me!

I need to learn not to get so excited about tentative plans until they are more firm. As it turns out, my involvement with my current project is so “crucial” (in my boss’ terms), and the schedule is so tight, that we can’t afford the time off to send me to CFUnited, even though the location is right, the cost would be justified, and the content would be beneficial. I suppose there’s always next year – and with any luck it’ll be somewhere more exotic.

In the meantime, I’m looking for a conference to attend this fall instead; and I’ll have to try to get my fill of Scorpio information from the May 15th presentation.

I’ve been working on the follow-up to my application.cfm tweaks post that I promised, but I am somewhat deterred until I find an adequate solution for posting code. Perhaps I’ll just use codeShare and then update it later when I find a more permanent solution.

Leave a Comment

On posting code

As this is a free wordpress.com blog, I unfortunately don’t have the ability to edit the CSS of my theme. I tried every single theme offered, even the pink ones, and none of them have adequate support for the <code> tag, in my opinion. I don’t think I’m asking too much: a fixed width font, and horizontal scrolling instead of wrapping.

So I set to work on applying every free theme available and checking out how the code in my first post appeared. Needless to say, I was not happy. Most themes do use a fixed-width font, but none of them offer horizontal scrolling instead of wrapping. The closest I found was a theme called Freshy 1.0. I didn’t dwell on it long (why bother? It doesn’t have horizontal scrolling!) but its author did find a way to number the lines, which is an added bonus. Except that wrapped lines were given a new line number every time they wrap, which is inaccurate.

I’ve noticed that Dave Shuck, who I mentioned in my last post, likes to use codeShare, which has a really nice polish to it – but only archives your submissions for up to 8 weeks, as best I can tell. I hate running into dead links, let alone finding code examples that are no longer available. I can see myself writing a permanently archiving clone of codeShare if I can’t get a theme solution in place.

I’ve offered to modify a few of the free themes to include better support for the tag, so we’ll see where that goes. In the meantime, if anyone is aware of other creative solutions like codeShare that don’t purge your submissions I’m quite interested.

Comments (1)

The anticipation is nigh unbearable!

Dave Shuck has a great writeup on the Scorpio (ColdFusion 8) presentation by Ben Forta to the Dallas Fort Worth CFUG – link via Steve of the Philly CFUG – detailing the new tags and attributes presented. Dave reports that Ben plans to show more and more features as his presentation tour goes on, which only makes me more excited to see what else will be unveiled at the Philly presentation on 5/15. Obviously I’m planning on attending, and I will be sure to take notes based on Dave’s writeup, as well as report back on anything new unveiled to us.

Leave a Comment

Optimizing your application.cfm

Because application.cfm is called on every request, it is extremely important that it be succinct, efficient, and optimized. Besides containing hundreds of lines of code, the worst and most common faux-pas I’ve seen among my clients is setting all of your application variables on every request.

Global availability within your application and the fact that they are stored in memory long term are the two greatest advantages to using application variables, and if you are resetting their values on every request you’ve eliminated half of those. You should instead check for the existence of your application variables and, if not found, reset them.

In short, this is bad code:

<cfapplication name="myApp">
  <cflock scope="application" type="exclusive" timeout="30">
    <cfset application.myvar="25">
  </cflock>

And this is good code:

<cfapplication name="myApp">
  <cfif not isDefined(”application.varsAreSet”)>
    <cflock scope=”application” type=”exclusive” timeout=”30″>
      <cfset application.myVar=25>
      <cfset application.varsAreSet=”true”>
    </cflock>
  </cfif>

I am planning on posting additional application.cfm optimization techniques next week – focusing on how best to make a single application.cfm that works in all of your environments, and as always, welcome questions.

Comments (2)