The i-Technology Media!
Register | Log in
   
 
.NET  ·  AJAX  ·  CLOUD  ·  ECLIPSE  ·  FLEX  ·  OPEN WEB  ·  iPHONE  ·  JAVA  ·  LINUX  ·  OPEN SOURCE  ·  ORACLE  ·  PBDJ  ·  SEARCH  ·  SILVERLIGHT  ·  SOA  ·  VIRTUALIZATION  ·  WEB 2.0  ·  WIRELESS  ·  XML
Comments
Drool, Britannia? Is the UK Failing the Cloud?
By Roger Strukhoff
Richard Davies wrote: The UK has a good crop of technology pioneers in cloud computing - for example ElasticHosts, FlexiScale, Flexiant, OnApp - and also some strong government initiatives such as G-Cloud. We will have to see whether this kind of technical leadership converts into swift mass-market adoption or not.
Jan. 8, 2012 11:38 AM EST
read more & respond »
Cloud Expo on Google News
Did you read today's front page stories & breaking news?

Cloud Expo & Virtualization 2011 West
Keynotes
Oracle
Opening Keynote | An Enterprise Cloud for Business-Critical Applications
Abiquo
Day 2 Keynote | The Enterprise Cloud Tightrope - Balancing for Success
Akamai
Day 3 Keynote | The DNA of an Enterprise Cloud
DIAMOND SPONSOR:
Oracle
Many Clouds, Many Choices'Cloud
PLATINUM PLUS SPONSORS:
Abiquo
Enterprise Cloud Best Practices - Town Hall - Join the discussion…
PLATINUM SPONSORS:
Intel
Progressing Toward the Federated, Automated and Client-Aware Cloud
New Relic
How to build an app with Twitter-like throughput
Rackspace
Computing in the Cloud Era
GOLD SPONSORS:
Gale Technologies
Practical Cloud Migration
IBM
Re-think IT. Re-inventing Business.
Intel/McAfee
Identity Driven Security in the Cloud
PerspecSys
Hackers Hackers Everywhere, Is My Public Cloud That Safe?
Red Hat
Unlock the Value of the Cloud
SHI
Mission Critical Applications and the Cloud - Myth or Reality?
SoftLayer
Not Your Grandpa's Cloud
Terremark
Integrating Enterprise Clouds
VMware
Upgrade to a vCloud
POWER PANELS:
Cloud Expo Silicon Valley: CTO Power Panel
Cloud Expo Silicon Valley: CEO Power Panel
Cloud Expo Silicon Valley: Cloud SuperStars Panel
Cloud Expo Silicon Valley: CloudNOW Panel
Click For 2010 West
Event Webcasts
Cloud Expo & Virtualization 2011 East
DIAMOND SPONSOR:
Dell
Dell & VMware Deliver the Enterprise Hybrid Cloud
PLATINUM PLUS SPONSORS:
Abiquo
Are Financial Services Organizations Risking Security by Avoiding Cloud Computing?
Oracle
From Consolidation to Enterprise Private PaaS
PLATINUM SPONSORS:
Intel
Driving the Transformation to Next Generation Cloud Data Centers
Rackspace
The Inevitability of an Open Cloud
GOLD SPONSORS:
CA Technologies
Follow YOUR path to Cloud Computing
Interxion
Who Keeps the Cloud in the Air?
Microsoft
Patterns for Cloud Computing
PerspecSys
War in the Clouds: Are you ready?
ServiceMesh
The Big Win: Stop Playing Small-Ball with Your Cloud Strategy
Terremark
Evaluating Enterprise Clouds
Xiotech
Cloud Storage: Myths and Realities
POWER PANELS:
Cloud Expo New York: CTO Power Panel
Cloud Expo New York: CEO Power Panel
Cloud Expo New York: CMO Power Panel
Cloud Expo New York: Wrap-Up Power Panel
Click For 2010 West
Event Webcasts
Live Google News by SYS-CON!
Top Three Links You Must Click On


CF Tips & Techniques
June 1998 Tip and Tricks
Using Color to Enhance Readability of Data Output

By: Ray Camden
Sep. 17, 2003 12:00 AM

Output of query results into a tabular format provides developers with a wide variety of formatting options. Use of color is but one of the options available to developers to enhance readability of data for the end-user. For example, consider the following output screen for a demographics-related query:

 

While the output is reasonably clear in the sample above, the sample output below shows how alternating the cell colors of each row enhances readability:

 

Fortunately for the Cold Fusion developer, dressing up your output like the above is simple and is accomplished with a few <CFSET> and <CFIF> tags! At the top of your output CFM, initialize a variable called #cellcolor# with the following line:

<cfset cellcolor="##d2d2d2">

Now add the following within the <CFOUTPUT> portion of your output CFM:

<cfoutput query="yourquery">
    <cfif #cellcolor# is "##ffffff">
       <cfset cellcolor = "##d2d2d2">
    <cfelse>
        <cfset cellcolor = "##ffffff">
   </cfif>

Follow with your output information, but specify the background color (BGCOLOR) of each cell as your #cellcolor# variable.

<tr>
    <td align="center" border="0" bgcolor="#cellcolor#">
    <input type=radio name=SelectedKey value='#fldKey#'>
    </td>
    <td align="left" border="0" bgcolor="#cellcolor#">
        <font face="arial"size="-1">
    <b>#fldLName#, #fldFName# #fldMI#</b>
    <br>
    <font size="-2">(#fldFMP#/#Left(fldSSN, 3)#-
        #Mid(fldSSN, 4,2)#-#Right(fldSSN,4)#)
    </td>
...
</tr>

You should now have alternating colors for your output table! Note that you may want to consider setting the #cellcolor# variable from within your APPLICATION.CFM as opposed to setting it within your output CFM.

Mark Westbrook
All Systems Go, Inc.
westbrook@aol.com

"Fruits-of-Experience" Tips 1

1. Refresh code that'll stop caching on most browsers and proxie systems.
<CFHEADER NAME="Expires" VALUE="Sun, 06 Nov 1994 08:49:37 GMT">
<CFHEADER NAME="Pragma" VALUE="no-cache">
<CFHEADER NAME="cache-control" VALUE="no-cache, no-store, must-revalidate">

2. The above code as well as any CFHEADER code will cause a CFLOCATION to die.

3. Keep an eye on the variable order of evaluation. There are times where specifying the scope will help out the page speed (though not much).

4. Using the CFMODULE syntax rather than the common CF_ is slightly faster.

5. CFMODULE has more overhead than a CFINCLUDE due to parameter passing. Evaluate where and why you need to use each.

6. Modules have access to all Url, Form, CGI and server variables without having to have them passed. You only have to pass local variables and queries.

7. CFINCLUDE executes as if it's in the directory of the calling template. CFINCLUDE inside a cfinclude assumes the calling CFINCLUDE's directory rather than the 'true' template.

8. CFMODULES can be located in the same directory as the calling template when using the CF_ method.

9. When using the CFMODULE method of calling modules, they may reside anywhere.

10. If your only expecting 1 row returned from a query, add in the maxrows attribute. In most cases it will not help any, but in some queries it'll speed it up some.

11. Read the forums religiously. new things are posted there regularly

12. Join the CF-Talk list. The amount of CF information going around it is immense and the speed is greater than the forums (email vs. webpage).

13. Check the tag gallery regularly and know what's there. Why create new things if they already exist for use (unless you just like to build).

14. Be aware that different web servers may return different CGI variables.

15. Keep apraised of web technologies as you never know what'll look good with your site.

16. Give information and code when you can. CF is a community and we tend to share quite a lot.

Michael Dinowitz House of Fusion. ICQ# 2995061

"Fruits-of-Experience" Tips 2
Always try to use variable names that reflect what they stand for. If a variable stores the number of widgets in the storeroom, make it obvious. Use NUMBER_WIDGETS or even NUM_WIDGETS_STOREROOM. You may be tempted to use variable names that make sense at the time or are quicker to type, but these same variables will make no sense to you when your application reaches two to three thousand lines.

Use comments. No, I mean really use comments. You may have spent five hours working on five lines of code, but two months from now will you remember what those five lines are really doing? Probably not. Comments can not only help others, but also help jog your memory when you need it most. (Like when the client is breathing down your neck asking for revisions to code you haven’t touched in months.)

Don’t back up your code when your done, back it up during the whole process of creation. Also, use multiple backups. Most code, especially Cold Fusion, is small in file size. Everyday I create a complete backup of my work in a new folder, using a simple numbering scheme so that I know what folder has the most recent version. Not only do I do this everyday, but also before any big modifications or additions.

When inserting information into a database that includes user input, be aware that by default, Access does not allow fields to be zero-length (empty). If you want the user to be able to leave certain fields empty, be sure to modify the data type for your field.

Cold Fusion can be used for more than just web sites. You can also use it for quick application development for personal use. I had a database full of quotes that I needed to convert into files. I could have exported the data, but I needed each quote to be in a single file, and I needed to wrap each quote with some simple HTML. It took me only a few minutes to create a quick CF application to handle this job for me.

Raymond Camden
morpheus@deathclock.com


E-mail us your tips.
Published Sep. 17, 2003— Reads 6,343
Copyright © 2003 SYS-CON Media, Inc. — All Rights Reserved.
Syndicated stories and blog feeds, all rights reserved by the author.
About Ray Camden
A longtime ColdFusion user, Raymond is a co-author of the "Mastering ColdFusion" series published by Sybex Inc, as well as the lead author for the ColdFusion MX Developer's Handbook. He also presents at numerous conferences and contributes to online webzines. He and Rob Brooks-Bilson created and run the Common Function Library Project (www.cflib.org), an open source repository of ColdFusion UDFs. Raymond has helped form three ColdFusion User Groups and is the manager of the Acadiana MMUG.

Add Your Feedback

In order to post a comment you need to be registered and logged in.

Register | Sign-in

Reader Feedback: Page 1 of 1

Subscribe to the World's Most Powerful Newsletters
Subscribe to Our Rss Feeds & Get Your SYS-CON News Live!
Click to Add our RSS Feeds to the Service of Your Choice:
Google Reader or Homepage Add to My Yahoo! Subscribe with Bloglines Subscribe in NewsGator Online
myFeedster Add to My AOL Subscribe in Rojo Add 'Hugg' to Newsburst from CNET News.com Kinja Digest View Additional SYS-CON Feeds
Publish Your Article! Please send it to editorial(at)sys-con.com!

Advertise on this site! Contact advertising(at)sys-con.com! 201 802-3021

SYS-CON Featured Whitepapers

ADS BY GOOGLE

Breaking Java News
DRH Internet Announces Director of Deliverability and ISP Relations
Zacks Sell List Highlights: Expedia, NII Holdings, Elan and Gentex
Futura Mobility, LLC Announces Launch and Expanded Leadership Team to Take Advantage of Rapidly Expanding Mobility Space
Zacks Investment Ideas Feature Highlights: Madison Square Garden
The Zacks Analyst Blog Highlights: The Boeing, Delta Air Lines, United Continental Holdings, JetBlue Airways and Southwest Airlines
The Zacks Analyst Blog Highlights: Valeant Pharmaceuticals International, Pfizer, ISTA Pharmaceuticals, Johnson & Johnson and Sanofi
The Zacks Analyst Blog Highlights: Bank of America, Citigroup, UBS AG, Royal Bank of Scotland and Barclays PLC
Are Target Prices Important?
Zacks Releases Four Powerful ''Buy'' Stocks: Zynga, Philip Morris International, Post Properties and Textainer Group Holdings
Zacks' Voice of the People Highlights Opportunities With Home Depot, Starbucks, Altria and Cincinnati Financial

ADVERTISE   |   MAGAZINE SUBSCRIPTIONS   |   FREE BREAKING-NEWSLETTERS!   |   SYS-CON.TV   |   BLOG-N-PLAY!   |   WEBCAST   |   EDUCATION   |   RESEARCH

.NET Developer's Journal - .NETDJ   |   ColdFusion Developer's Journal - CFDJ   |   Eclipse Developer's Journal - EDJ   |   Enterprise Open Source Magazine - EOS
Open Web Developer's Journal - OPENWEB   |   iPhone Developer's Journal - iPHONE   |   Virtualization - Virtualization   |   Java Developer's Journal - JDJ   |   Linux.SYS-CON.com
PowerBuilder Developer's Journal - PBDJ   |   SEO / SEM Journal - SJ   |   SOAWorld Magazine - SOAWM   |   IT Solutions Guide - ITSG   |   Symbian Developer's Journal - SDJ
WebLogic Developer's Journal - WLDJ   |   WebSphere Journal - WJ   |   Wireless Business & Technology - WBT   |   XML-Journal - XMLJ   |   Internet Video - iTV
Flex Developer's Journal - Flex   |   AJAXWorld Magazine - AWM   |   Silverlight Developer's Journal - SLDJ   |   PHP.SYS-CON.com   |   Web 2.0 Journal - WEB2
Apache   |   CMS   |   CRM   |   HP   |   Oracle Journal   |   Perl   |   Python   |   Red Hat   |   Ruby on Rails   |   SAP   |   SaaS

SYS-CON MEDIA:   ABOUT US   |   CONTACT US   |   COMPANY NEWS   |   CAREERS   |   SITE MAP
SYS-CON EVENTS:   |  AJAXWorld Conference & Expo  |  iPhone Developer Summit  |  Cloud Computing Conference & Expo  |  SOA World Conference & Expo  |  Virtualization Conference & Expo
INTERNATIONAL SITES:   India  |  U.K.  |  Canada  |  Germany  |  France  |  Australia  |  Italy  |  Spain  |  Netherlands  |  Brazil  |  Belgium
 Terms of Use & Our Privacy Statement     About Newsfeeds / Video Feeds
Copyright ©1994-2008 SYS-CON Publications, Inc. All Rights Reserved. All marks are trademarks of SYS-CON Media.
Reproduction in whole or in part in any form or medium without express written permission of SYS-CON Publications, Inc. is prohibited.
 
close this window