Previous Issue Current Issue Main page Next Issue
Fusion Authority Fusion Authority
The House of Fusion Technical Magazine
Issue: 5

January 10, 2000
January 16, 2000
This is an opt-in magazine. To join, leave or change subscription mode, please visit the signup page. All content of this magazine is copyright Fusion Authority, Inc. It may not be reproduced without permission.

News
Fusion Authority Announced on Allaire Site
Allaire Selects MERANT to Deliver Data Access and Integration for Linux ColdFusion Web Applications
Allaire Adds New Vice President Of Business Development To Executive Management Team
Allaire Corporation Takes Half of Riverside Center for New Headquarters
AbleCommerce Announces New TopSites.com Site
Nominations Still Open for CFDJ's Readers' Choice Awards
HTMLCenter Reviews TopStyle CSS Editor
 
Tech and Tags
What's New in the Tag Gallery
Problem with StructClear (Session) and Potential Fix
Allaire Spectra: Slow Performance When Retrieving Text Columns from Sybase
Unix Beta Available
Ejipt 2.0 Beta 4 Available for Download
 
Views
John Cesta on Ecommerce and Client Discrimination
 
Techniques
Comparisons with CFIF
ColdFusion and Linux: The Ultimate Remote Web Server Combination
 

News

Fusion Authority Announced on Allaire Site

The Allaire Developer's Exchange announced Fusion Authority as a new ColdFusion resource, and made special mention of these weekly alerts.

Developer's Exchange: Fusion Authority Listing

[Top]

Allaire Selects MERANT to Deliver Data Access and Integration for Linux ColdFusion Web Applications

MOUNTAIN VIEW, Calif., and NEWBURY, England, Jan. 10
Allaire Corporation and MERANT announced a strategic agreement to leverage the MERANT Egility(TM) solution to provide market-leading data access and integration for critical e-business and Web applications. Under the terms of the agreement, Allaire will integrate MERANT's DataDirect® technology with the new Linux versions of ColdFusion, giving Allaire customers secure high-availability data access and integration across Linux-based Web applications.

MERANT will provide scalable transaction-based connectivity between ColdFusion applications residing on Linux and industry-leading databases, including MySQL, Oracle, Microsoft SQL Server, Informix and Sybase.

Datek News Story (PRNewswire)
Ecommerce Times

[Top]

Allaire Adds New Vice President Of Business Development To Executive Management Team

CAMBRIDGE, Mass., Jan. 11, 2000 /PRNewswire/ -- Allaire Corporation has announced the addition of George Favaloro to its senior management team as Vice President of Business Development. With nearly twenty years of experience behind him, Favaloro will now manage Allaire's emerging business strategy formulation group, the mergers and acquisitions team, and strategic partnerships account team.

Prior to joining Allaire, Favaloro served as Director of Marketing for Compaq Corporation, where he founded and launched the company's Internet Solutions Division. Most recently, he was responsible for worldwide marketing of Compaq's enterprise solutions for e-commerce, ISPs/ASPs, Internet security, and Web and application servers working with key partners such as Microsoft, Oracle, and Checkpoint.

Allaire Adds New Vice President Of Business Development To Executive Management Team
Datek News Story

[Top]

Allaire Corporation Takes Half of Riverside Center for New Headquarters

BOSTON, Jan. 10, 2000 /PRNewswire/ -- Allaire Corporation has signed a lease for their new 270,446-square-foot headquarters at Riverside Center, a new office building development in Newton, Mass., with plans to relocate from Cambridge in summer 2000. The building is now 74% pre-leased, four months before its completion. According to David Gerth, Allaire's Chief Financial Officer, Riverside Center "meets the needs of our rapidly expanding company and in addition provides a setting that is complementary to the dynamic and creative atmosphere of Allaire." The Allaire transaction is this year's largest office lease transaction on Massachusetts' Route 128, often referred to as "America's Technology Highway."

Allaire Corporation Takes Half of Riverside Center for New Headquarters (Smartmoney)

[Top]

AbleCommerce Announces New TopSites.com Site

Business Wire - January 12, 2000
AbleCommerce, makers of the Award-Winning E-Commerce Software by the same name, have launched TopSites.com (http://www.topsites.com), a dynamic search engine or "Mall" of the wide range of shopping sites that have been built and are administered with AbleCommerce. The listing in TopSites.com is a free service to AbleCommerce storeowners. Among those listed: Bushnell, CITGO, Cummins Engine, Dixie Chicks, and many more.

[Top]

Nominations Still Open for CFDJ's Readers' Choice Awards

Readers of CFDJ (ColdFusion Developer's Journal) are invited to visit http://www.sys-con.com/coldfusion/index2.cfm and nominate your choice for this year's ColdFusion "Bests." Nominations will be accepted until January 31, 1999.

[Top]

HTMLCenter Reviews TopStyle CSS Editor

HTMLCenter gave TopStyle high reviews for its customizable interface, ease-of-use, and browser-specific coding options. One con listed: the preview window did not pre-configure for Netscape 4, apparently because of a technical limitation of Netscape rather than a defect in TopStyle. (A free version of TopStyle ships with Allaire HomeSite (TM) and ColdFusion Studio (TM).)

http://www.htmlcenter.com/reviews/reviews.cfm/80

[Top]


Tech and Tags

What's New in the Tag Gallery

CF_ExciteNews
Put current Reuter's news headlines on your site.
CF_AutoAddMDB
Scans a folder and all its sub-folders, etc., looking for MS Access database files (*.mdb), and automatically adds a datasource for them using them.
CF_AutoAddCFX
Scans a folder and all its sub-folders, etc., looking for *.DLL Files, and automatically adds them to the CFX custom tags list.
Skipjack CreditCard Auth
This is a collection of instuctions, templates, and examples for ColdFusion developers attempting to integrate Skipjack's credit card authorization services into their sites.
Category Management Tag
This custom tag allows easy category management (adding, modifying, or deleting categories).
CF_FIXFONT
ColdFusion custom tag used to adjust font size based on platform.
CF_SQLScript
Executes .sql file to sql database. Useful for initialization pages.
Community software
This Community software provides people with an easy and interactive method for information posting and sharing on the Internet.

[Top]

Problem with StructClear (Session) and Potential Fix

Due to changes to Session variables in ColdFusion 4.5, you can not use StructClear(Session) anymore to delete someone's session. This is covered in a new Knowledge Base article on the Allaire site.

A potential fix for this is to use the following code

<CFLOOP COLLECTION=#Session# ITEM="key">
<CFIF Not ListFindNoCase('CFID,CFTOKEN,SESSIONID,URLTOKEN', Key)>
<CFSET StructDelete(Session, Key)>
</CFIF>
</CFLOOP>

[Top]

Allaire Spectra: Slow Performance When Retrieving Text Columns from Sybase

The Sybase database that ships with Spectra can experience slow query times for pages that involve 'text' datatype columns.

For more information, see http://www.allaire.com/developer/gallery/index.cfm?Objectid=14084

[Top]

Unix Beta Available

ColdFusion Server beta for UNIX now available for public beta.

http://beta.allaire.com/cfarizona

[Top]

Ejipt 2.0 Beta 4 Available for Download

Ejipt is an all-Java EJB server available for download off the beta site. Details are posted in the Read Me section of the Ejipt Beta Web site.

http://beta.allaire.com/ejipt20

[Top]


Views

John Cesta on Ecommerce and Client Discrimination

"Putting up the Web site is one thing but advertising it is everything! Clients don't seem to understand this. 'You mean besides paying to create and host a Web site we have to pay to advertise it?!' Well, I guess not if you don't want any traffic.

"The Web's a new frontier. Clients are afraid to spend more and more money on their site unless they see an immediate return. Unfortunately, they won't see an immediate return unless they spend more and more money on it!"

[Top]


Techniques

Comparisons with CFIF

by Michael Dinowitz

There are a number of ways to compare two text strings inside a ColdFusion CFIF statement. The problem is, some are faster than others. Now you may think that comparing strings would be the same no matter what method is used. Unfortunately, this is not true. I could dream up a number of reasons for this but it really wouldn't matter. What does matter is results. For this reason, I'll be going over each of the comparison methods, giving you their average speeds and how to use them. If this information is used properly, then you should see a jump of 50% in your CFIF statements and hopefully some more speed in all your code.

Before we start, I'm going to assume you know the ins and outs of a CFIF statement. That being the case, what we're looking at here is either the Statement part of a CFIF or a single Clause of the statement.

<CFIF Statement>
<CFIF Clause [joiner] Clause>

If you have any questions on the structure and proper use of a CFIF, you can check it out in the ColdFusion documentation, in any of the excellent ColdFusion books that have been written or you can wait till I release my paper on The Complete CFIF, which will be a slightly altered version of the Comparison chapter in the forthcoming book, Core ColdFusion.

Comparison MethodFastest (ms)Average (ms)
Variable IS "Value".29.30
NOT Compare(Variable, 'Value').10.11
NOT CompareNoCase(Variable, 'Value').11.11
Find(Variable, 'Value').10.11
FindNoCase(Variable, 'Value').10.11
REFind('Value', Variable).14.14
REFindNoCase('Variable', Value).16.17
*All tests done on CF 4.5 - results may vary

Basics

The simplest type of comparison is also the default. This uses no functions for comparison, relying instead on the basic power of the CFIF tag.

<CFIF Variable IS "Value">

While this statement works and works well, it's actually the slowest way to compare text values. I believe that this statement does a few evaluations before trying to do any sort of comparison. The first evaluation is to see if either value is a Boolean and the second is to see if either is a Numeric. If they are one of these data types, then the actual comparison goes rather fast. (This is because of the way ColdFusion processes Boolean and numbers vs. text values.) If not, then a standard text comparison is performed. I've come to this conclusion after a few tests:
<CFIF Variable IS "True"> <!--- This is the text value TRUE --->
<CFIF Variable IS True> <!--- This is the Boolean value TRUE --->

<CFIF Variable IS "100"> <!--- This is the text value 100 --->
<CFIF Variable IS 100> <!--- This is the numeric value 100 --->

Both of these groups operated at exactly the same speeds, even though one was treating a value as text and the other was treating it as a Boolean or a number. This says that some other operation is going on than plain text comparison.

Functions

Logically, using a function to do a comparison inside a CFIF should add to overhead rather than reduce it. When a function is run, ALL of the variables within it are evaluated and then the function is executed. Even after that, the CFIF tag has to look at the result as TRUE or FALSE like any comparison. This looks like more operations and it is, but it's still faster. A function simply takes a variable and uses it with no checking of what the data type is. This can lead to more mixed data type errors, but also leads to a faster execution. In addition, if done right, the result of a function should be a Boolean, which is the fastest comparison operation within a CFIF.

Not Compare / Not CompareNoCase

This is the best and fastest type of comparison function around. It takes two values and says if they are exactly alike. There is both a case-sensitive and non-case-sensitive version of this function. The function will return a -1 or a +1 if one of the variables is less or more than the other. Only if they are exactly alike will it return a 0. In Boolean terms, a 0 is FALSE. To make it TRUE and useful within a CFIF, we have to use a NOT logical modifier before the function. This says, NOT FALSE, which is the same as true. Because of this, it is not as intuitive for people to look at the code and understand it, which is, for me, its only drawback.

<CFIF Not Compare(Variable, 'value')>
<CFIF Not CompareNoCase(Variable, 'value')>

Find / FindNoCase

These functions are a lot more intuitive, but also more problematic. The functions will take two values and compare them. If the first value is in the second value, the function will return the numeric position of the match. The problem is, this can be ANYWHERE in the second value. This means that a simple comparison that looks like it should logically work can fail.
<CFIF FindNoCase('admin', 'useradmin')>
<CFIF FindNoCase('admin', 'administrator')>

The first example will return a 'TRUE' result to a CFIF that uses it, but the actual result is 5. The second will also return a 'TRUE' result and the value will be 1, but it's not an exact match for what we were expecting. With some fine control this can be used, but is too prone to problems for my taste.

<CFIF Find(Variable, 'value')>
<CFIF FindNoCase(Variable, 'value')>

REFind / REFindNoCase

I've included these functions, as they will also allow exact comparisons between two values and a whole lot more. Personally, I'd never use them for simple comparisons, as they have a bit more overhead to go with the extra power.
<CFIF REFind('value', Variable)>
<CFIF REFindNoCase('value, Variable)>

My advice after all this is to go through all your code, look for any places that have a standard CFIF, and change it to one of the above functions. You'll save in speed and in the end, that's all that matters. To make your job a little easier, this Regular Expression will work in Studio to find every location that should be changed:
<CFIF[^>]+ IS [^>]+>

It might also be a smart idea to comment all the changes. It might save your life if you ever have to change it all back. :)

[Top]

ColdFusion and Linux: The Ultimate Remote Web Server Combination

by Michael Sheldon

By now, anyone in the CF community who's paying the least bit of attention knows that ColdFusion for Linux is just around the corner. In some ways, it's really nothing special; it's the same ColdFusion we have come to know and love, just on a different platform. In fact, there are a couple of features missing, like Verity and Advanced Security, due to lack of support for Linux in those components.

So, why should you care about CF for Linux?

Obviously, all of the penguin crowd will flock to the Linux version, with shouts of "stability!", "performance!", "it's not Microsoft!", etc.... Personally, I don't get too worked up over that. My NT boxes have all been very stable and reliable, real-life performance benchmarks have not yet been done to what I would call a reasonable standard, and while I don't always like what Microsoft does, I don't have any irrational phobias about using their products.

So why do I practically drool over the prospect of CF on Linux? Three words: Remotely Administered Servers. NT is fine, so long as you have direct keyboard access to it, but when you have to deal with an NT server located in another room, another city, or another country, things start to look a bit different. (Yes, I know about PC Anywhere, VNC, and other remote control software, but I've never been completely satisfied with them, since it is yet another piece of software to cause trouble.) Linux brings us to the point where I don't even need a keyboard, mouse or monitor attached to the computer, it will run just fine without them. And since Linux is a primarily command-line system, a telnet session (or SSH for the security-minded) is "just like being there." I can do anything I want to my Linux servers from any location, so long as it does not involve actual manipulation of hardware. This includes installing software, re-booting, and stopping and starting daemon processes (services). It's even possible to mount a CD remotely if you're willing to do a little work.

Another feature I feel is highly underrated by the Windows crowd is the ability to "strip the system down" to only the essential components. Windows NT by it's very nature has a lot of overhead before you even install ColdFusion. Linux, on the other hand can be run stripped down to the bone. For a good server install, I always do an absolute minimal install, then custom install only the components I need (Apache, ColdFusion, SSH, ...). This gives me a box that performs better, and has fewer security holes.

Lastly, because everything on Linux is based on the command-line, automating processes is very easy. Write the script, schedule it with cron, sit back and let it run. My box automatically emails my log files to me, deletes the old ones, scans the logs for problems, etc.... I can schedule processes to be stopped or started, content to be synchronized, configuration file modifications, or any other possible maintenance task.

Now, don't buy into all the fervor about how "easy" it is to use Linux. You're not going to learn it well enough in a day to install a production server. You didn't learn NT in a day, and this will certainly be no different. Find an old box, get a copy of RedHat 6.1, and start experimenting. Soon enough, you'll be confident enough to start using Linux as a development server, then for production. Also, chances are that you've got a Linux User Group in your area. Find out where they meet, and drop in. The User Groups are a fantastic means of getting non-urgent support.

Don't fear the penguin!

[Top]


This is an opt-in magazine. To join, leave or change subscription mode, please visit the signup page. All content of this magazine is copyright Fusion Authority, Inc. It may not be reproduced without permission.