Rob Brooks-Bilson
Tech, Photography, Stuff
Tech, Photography, Stuff
August 8, 2003
I'll be on vacation all next week, so chances are I won't be blogging much. I've got a lot to say about the MX 6.1 release when I get back, so stay tuned.
On a related note, my new O'Reilly book, Programming ColdFusion MX should be on store shelves next Wednesday (8/13). I'll try to blog an entry from the road, but if not, I'll have a lot to say about it when I return.
August 8, 2003
One often requested enhancement to ColdFusion has been the addition of milliseconds to ColdFusion's various date/time functions. In MX 6.1, Macromedia has finally added support via a new mask element, "l" (that's a lowercae L). This new mask can be used with the following functions:
timeFormat()
lsTimeFormat()
dateAdd()
datePart()
August 7, 2003
I saw a question on the CF-Talk list asking about the new wrap() function in CF MX 6.1. It's not as intuitive a function as you would think. The first time I saw it, I assumed you passed it a string and a character break, and it would return a string formatted with <BR> tags at the appropriate interval. This is not what it does. Here's an explanation from my new book, Programming ColdFusion MX:
Usage: wrap(string, limit [,strip])
Specifies the maximum number of characters to allow per line in string. If a line is longer than the specified number of characters, an attempt is made to break the line by inserting a line break at the nearest whitespace character (space, tab, etc) before the character limit. If string contains no whitespace characters before the maximum number of characters per line, a line break is inserted at the maximum line length. Wrap() uses operating system specific line breaks. On Windows, it's a carriage return and newline character. On Unix/Linux, it's a newline. Optionally, you can specify a third Boolean argument to indicate whether to remove all existing carriage line breaks before wrapping the string. The default for this argument is false.
<cfset myString="This is a string that is so long, I probably would like to break it up. What do you think about that? Is it a good idea?">
<cfoutput>
<pre>#wrap(myString, 80, False)#</pre>
</cfoutput>
If you need a function that actually inserts <BR> tags for you, consider wrap() from the CFLib.org web site. Note that you'll have to rename the UDF to avoid conflicting with the new wrap() function in 6.1.
August 7, 2003
CNet's News.com has a short piece on the upcoming Flash 7 player. Of particular interest is this quote:
"The new version of the Flash Player, available for download from Macromedia, concentrates on performance improvements that allow the software to process some types of Flash content as much as 10 times faster, said Lucian Beebe, Macromedia's product manager for Flash."
I've been using the beta for a week or so now, and I've noticed that it does seem to run Flash Remoting apps a bit quicker, although I don't have any real comparison numbers.
August 6, 2003
In a blog post earlier today, Ben Forta mentions that getTickCount() returns a different value than in previous versions of ColdFusion.
With the MX 6.1 release, getTickCount() now returns the number of milliseconds from Unix Epoch (January 1, 1970, 00:00 GMT). Note that it doesn't account for your GMT offset.
August 5, 2003
I haven't done many off-topic posts on my blog (yet), but I figured with the number of people I know that live in California, I could tap into your collective knowledge for some suggestions.
My 5th anniversary is coming up on Aug 15th, and to celebrate, my wife Persephone and I are flying out to LA, renting a convertible and making our way up the coast to Napa/Sonoma for a day or so, and finishing up with three nights in San Francisco. What I'm looking for are some ideas on what to do in between. We're planning on making stops at the Getty Museum and the Hearst Castle, but are interested in suggestions on what sea-side towns might be worth stopping at on our way up the coast, as well as recommendations on where to stay.
August 5, 2003
Here's another interesting new feature in ColdFusion MX 6.1...
There may be cases where it would be useful to have one or more methods available to all of the components on your server. Ideas that come to mind are debugging methods, server-wide settings, etc. As of ColdFusion MX 6.1, you can modify a special component called component.cfc that all components on the server automatically extend. Out of the box, the component.cfc file can be found in the \WEB-INFcftags directory and is completely empty. Any methods or properties you place in the file are automatically available to every CFC on your server.
August 5, 2003
For those of you working with CFCs in ColdFusion MX 6.0, you'll be happy to know that the bug affecting variables scope has been fixed in MX 6.1. Now, both the variables scope, and the unnamed scope (unscoped variables) behave the same way. Here's a breakdown of how the variables/unnamed scope, the local scope (var keyword) and the this scope differ:
Variables/Unnamed Scope
Variables in the variables scope are available only within the CFC. They are available to the constructor code, and to all component methods and any pages they include. They may be prefixed with the variables prefix or left unscoped (often called the unnamed scope). Variables in the variables scope that are set within the calling page are not automatically available within the component’s variables scope. Additionally, variables in the variables scope exist as long as the component object exists. This allows them to persist between method calls.
Local Scope
This differs from variables you set in the "local" scope of a method by using the var keyword. These variables are available only to the method in which they are defined and any pages included by that method. Additionally, local variables do not last beyond the life of the method call. The local variable scope differs from other variable scopes in that there is no scope prefix used for the variable. Note that if you do not define the variable with the var keyword, the variable exists in the variables scope, not the local scope.
This Scope
The this scope is functionally equivalent to the this scope in JavaScript and ActionScript. Variables in the this scope are available to all methods within a CFC, any pages they include, and the page that calls the CFC. Within a CFC you refer to variables in the this scope using the this prefix: this.varName. Outside the CFC, you use the component name to reference variables in the this scope: myComponent.varName. Note that this applies only when the CFC is instantiated as an object via the cfobject tag or createObject( ) function, not when a component method is invoked using the cfinvoke tag, without the CFC being instantiated separately.
I hope this helps put things in perspective!
August 4, 2003
The long awaited ColdFusion MX 6.1 (formerly Red Sky) is now available for download. I though t it wasn't going to be out for a while longer, but it looks like it's been added to the Macromedia web site (although no mention on the homepage yet).
CF MX 6.1 is so much more than just a maintenance update for ColdFusion. In addition to the over 400 bug fixes in this release, you should (in most cases) notice a huge boost in the speed and stability of the application server thanks to major improvements and tuning undertaken by Macromedia's engineering staff.
Here are the highlights of the new release:
Here's the best part about this release. If you have an existing ColdFusion MX license, the upgrade is completely free! I've been running it in a test environment for quite some time now, and I can say without any hesitation that this is the best, most stable release of ColdFusion ever!
In the self-promotions department, my new book, Programming ColdFusion MX (2nd Ed.) is set to ship on August 13th. O'Reilly specifically decided to hold publication to allow me to update it for MX 6.1. As far as I know, it's the only book on the market that covers all of the changes (and there are a ton) introduced in ColdFusion MX 6.1. I'll be posting more about the book in a few days.
July 25, 2003
If you are a Macromedia DevNet Subscriber, DRK4 is now available for download. If you aren't a subscriber, you can purchase it seperately. I've had a chance to check it out, and there are some really nice Flash and Dreamweaver MX components as well as several CF MX components, tags, and sample apps, including a complete polling application with a Flash front end and a CF back end. Very nice indeed.