Cfdocument is a new weapon in the Coldfusion arsenal. It's not without it's detractors, but personally I think it is splendid for what it can do. When it comes to performance, however, there are a number of things to keep in mind. If you think about what Cfdocument is being tasked to do under the hood and I'm sure you could come up with a few as well. Since it is my blog, we might as well work from my list...Read More
Infinite loops are great fun. Technically an infinite loop is one with no hope of ever stopping. In the old days(1995) I worked for an outfit with a database product for salvage yards. The whole thing was written in MUMPS and everything was done through a terminal. The first program I ever wrote myself was a "spinner" program. It ran on the terminal and produced the following characters 1/2 second apart - "/,|,-,\,|" the result was a little spinning widget on the terminal. I added some text that said "rebuilding dataset, please wait". Whenever we were working on something and needed a way to keep folks from hassling us with new issues we would put it up on the screen. It looked like it was really doing something. With an http request it's a different story however...Read More
I love using the application.cfc file instead of application.cfm. The cfc approach encapsulates several events inside of automatically fired functions that formerly required "hand coding". For example, I used to check to see if application vars existed and set them if they did not. This required thinking about locking and testing one or more variables for existence (isDefined() or structKeyExists()). Using Application.cfc means this job is handled by the onApplicationStart( ) function. One function that belongs to Application.cfc deserves a bit more attention - the onRequest( ) function. Here's an example from a webtop application that forces login.Read More
This is a nice tip from Dan Switzer on a fix for a tricky cf chart labeling problem. Sometimes when using an overlapping horizontal bar chart, the labels fail to appear or go missing. In this example from Robi Sen, the first and third labels are there but the middle label is missing.Read More
If you use flash remoting on multiple sites on the same server you have probably had to configure the JrunScripts virtual directory. On the standard edition this virtual directory points to the folder <%cfusionmx7%>/runtime/lib/wsconfig/1. When you are running multiple instances you end up with several folders in the wsconfig folder - 1 for each instance (FYI - the root of a multi-instance CF installation is JRUN4, not ColdfusionMX7 as you might think). You might suspect that each site needing flash remoting should point this virtual to "it's own" instance. This is not the case. As Russ (a.k.a. "Snake") pointed out in a recent cfguru post, you must point this virtual to folder number 1. So...
If you are using CMFX and trying to "tune" the JVM - or maybe even just adding a class path, I have some advice for you. Don't use the CF Administrator to do it! Instead, get used to editing the jvm.config file located in cfusionmx7/runtime/bin. Not only will you benefit from gaining a better knowledge of the inner workings of your JVM, but you will also miss out on a ticklish bug that will have you scratching your head in frustration. Here's the scoop.Read More
There's a very interesting post and discussion on Brian Kotek's blog today dealing with the use of the function "isDefined( )" vs "structKeyExists( )". If you've been programming since the days of CF 4.x and "parameterexists()" you'll know that using isDefined() can be a delicate experience at times. It becomes especially tricky in CFMX where the way variables are initiated has changed. In the old days you could have a variable in the variables scope that included a period in the name, and unless you specifically called "structNew()" it would stand as primitive variable in the variables scope. Take this Example:Read More
You may have read one of my previous posts regarding the nuances of working with Application Variables. In the first post I took great pains to point out that the application name is the anchor for all the variables in the application and that naming 2 separate applications the same results in them sharing the same scope. Now, thanks to Jim Davis of Depressed Press I have another "gotcha" to add to the conversation.Read More