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.
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:
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.
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.
"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.
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.
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: