<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-3332201</id><updated>2011-04-21T19:55:09.256-07:00</updated><title type='text'>ColdFusion Snippets</title><subtitle type='html'>Coldfusion Code, solutions, and snippets for those who can't do it on their own</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://cfcode.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://cfcode.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>mmmbeer</name><uri>http://www.blogger.com/profile/08832575945852262638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>93</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-3332201.post-105656092869038906</id><published>2003-06-25T10:08:00.000-07:00</published><updated>2003-06-25T10:08:48.750-07:00</updated><title type='text'></title><summary type='text'>A Must have Mozilla ExtensionPNH toolbar</summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/105656092869038906'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/105656092869038906'/><link rel='alternate' type='text/html' href='http://cfcode.blogspot.com/2003_06_01_archive.html#105656092869038906' title=''/><author><name>mmmbeer</name><uri>http://www.blogger.com/profile/08832575945852262638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-3332201.post-95504623</id><published>2003-06-10T06:37:00.000-07:00</published><updated>2003-06-10T06:37:38.230-07:00</updated><title type='text'></title><summary type='text'>Nice DHTML librariesJavaScript: DHTML API,Drag &amp; Drop for Images and LayersJavascript drawing library</summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/95504623'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/95504623'/><link rel='alternate' type='text/html' href='http://cfcode.blogspot.com/2003_06_01_archive.html#95504623' title=''/><author><name>mmmbeer</name><uri>http://www.blogger.com/profile/08832575945852262638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-3332201.post-92779655</id><published>2003-04-17T07:42:00.000-07:00</published><updated>2003-04-17T07:42:20.106-07:00</updated><title type='text'></title><summary type='text'>Forcing a file downloadEveryone should know how to use cfcontent to get ColdFusion to dish up a file.However, making the browser download it is often precarious.  Many browsers have settings that tell them exactly how to handle a particular file.  This is due to their mime-types.Well, it was suggested earlier today, that to make the browser download a file, set the mime-type: "application/</summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/92779655'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/92779655'/><link rel='alternate' type='text/html' href='http://cfcode.blogspot.com/2003_04_01_archive.html#92779655' title=''/><author><name>mmmbeer</name><uri>http://www.blogger.com/profile/08832575945852262638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-3332201.post-92489472</id><published>2003-04-12T09:41:00.000-07:00</published><updated>2003-04-12T12:05:05.000-07:00</updated><title type='text'></title><summary type='text'>Some 'nifty' stuff This site has some cool stuff: http://www.webweaver.org/dan/css/  I personally like the label on a checkmark makes the label clickable as well.</summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/92489472'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/92489472'/><link rel='alternate' type='text/html' href='http://cfcode.blogspot.com/2003_04_01_archive.html#92489472' title=''/><author><name>mmmbeer</name><uri>http://www.blogger.com/profile/08832575945852262638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-3332201.post-92321432</id><published>2003-04-09T16:13:00.000-07:00</published><updated>2003-04-09T16:13:26.390-07:00</updated><title type='text'></title><summary type='text'>First (n-1) words in a stringThis nifty little snippet will grab the first (n-1) words from a string and output them:&lt;cfset mystring = "Answeree(A) and Questioner(Q) agree that the work will lie solely with Q.A is not an agent of Q.A does not guarantee syntax &amp; answers shall be delivered in psuedocode with intent for Q to RTFM and derive answers empiracally.##coldfusion reserves the right to </summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/92321432'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/92321432'/><link rel='alternate' type='text/html' href='http://cfcode.blogspot.com/2003_04_01_archive.html#92321432' title=''/><author><name>mmmbeer</name><uri>http://www.blogger.com/profile/08832575945852262638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-3332201.post-89796604</id><published>2003-02-26T13:49:00.000-08:00</published><updated>2003-02-26T13:51:42.000-08:00</updated><title type='text'></title><summary type='text'>Search Engine Safe URLs in MXURL formats that do not use the ? query string identifier result in page not found errors when using ColdFusion MX with either Microsoft IIS or Apache web servers. The problem is not evident when using the integrated ColdFusion MX web server, typically on port 8500.Solution for Microsoft IIS web serverThis is a known bug that was logged with Macromedia as a J-Run</summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/89796604'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/89796604'/><link rel='alternate' type='text/html' href='http://cfcode.blogspot.com/2003_02_01_archive.html#89796604' title=''/><author><name>mmmbeer</name><uri>http://www.blogger.com/profile/08832575945852262638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-3332201.post-88949522</id><published>2003-02-11T18:57:00.000-08:00</published><updated>2003-02-11T18:57:14.580-08:00</updated><title type='text'></title><summary type='text'>Mozilla's Google toolbarI might finally be able to use mozilla for real now.mozdev.org - googlebar: indexThe Googlebar project was initially created to address the widespread desire in the mozilla community for the Google toolbar to support Netscape 7/Mozilla, since many users of mozilla enjoy having all of Google's specialty searches in one convenient location. In the past, the Google toolbar </summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/88949522'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/88949522'/><link rel='alternate' type='text/html' href='http://cfcode.blogspot.com/2003_02_01_archive.html#88949522' title=''/><author><name>mmmbeer</name><uri>http://www.blogger.com/profile/08832575945852262638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-3332201.post-88945077</id><published>2003-02-11T17:32:00.000-08:00</published><updated>2003-02-11T17:32:48.700-08:00</updated><title type='text'></title><summary type='text'>Neat Web toolsPorter's Workshop Yeah, it's a pretty bland-looking page, but it scores really high on the Doesn't-feel-like-sucking-a-pot-roast-through-a-garden-hose Bandwidth Scale. Please excuse any mess you run into; this is my development area, where I get to play. And I don't always put away my toys. Also, I make no guarantees as to what browsers support any of this.</summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/88945077'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/88945077'/><link rel='alternate' type='text/html' href='http://cfcode.blogspot.com/2003_02_01_archive.html#88945077' title=''/><author><name>mmmbeer</name><uri>http://www.blogger.com/profile/08832575945852262638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-3332201.post-88848720</id><published>2003-02-10T05:34:00.000-08:00</published><updated>2003-02-10T05:34:50.370-08:00</updated><title type='text'></title><summary type='text'>Pure CSSWelcome to the edge, css/edge</summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/88848720'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/88848720'/><link rel='alternate' type='text/html' href='http://cfcode.blogspot.com/2003_02_01_archive.html#88848720' title=''/><author><name>mmmbeer</name><uri>http://www.blogger.com/profile/08832575945852262638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-3332201.post-88848075</id><published>2003-02-10T05:16:00.000-08:00</published><updated>2003-02-10T05:16:04.270-08:00</updated><title type='text'></title><summary type='text'>Noodle Incident CSS DesignsThis is a Problem &amp; Workaround Set for a series of CSS Boxes going from a simple single box, through 3 columns with a full width top box, all with variations.Box lessons</summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/88848075'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/88848075'/><link rel='alternate' type='text/html' href='http://cfcode.blogspot.com/2003_02_01_archive.html#88848075' title=''/><author><name>mmmbeer</name><uri>http://www.blogger.com/profile/08832575945852262638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-3332201.post-88488122</id><published>2003-02-03T12:10:00.000-08:00</published><updated>2003-02-03T12:10:27.920-08:00</updated><title type='text'></title><summary type='text'>XSL:FO - Formatting ObjectsIn MX, you can actually make use of formatting objects thanks to nice integration of Java.Look at Apache's FOP for more information.</summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/88488122'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/88488122'/><link rel='alternate' type='text/html' href='http://cfcode.blogspot.com/2003_02_01_archive.html#88488122' title=''/><author><name>mmmbeer</name><uri>http://www.blogger.com/profile/08832575945852262638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-3332201.post-88478588</id><published>2003-02-03T08:44:00.000-08:00</published><updated>2003-02-03T08:46:10.000-08:00</updated><title type='text'></title><summary type='text'>Javascript to limit text area sizeSince there is no built in mechanism to limit text area sizes, this page tells you how to use javascript to do just that, limit text area.Note: right-click paste gets around this script.  You'll probably need to append an "onchange" event as well.</summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/88478588'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/88478588'/><link rel='alternate' type='text/html' href='http://cfcode.blogspot.com/2003_02_01_archive.html#88478588' title=''/><author><name>mmmbeer</name><uri>http://www.blogger.com/profile/08832575945852262638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-3332201.post-88432143</id><published>2003-02-02T11:48:00.000-08:00</published><updated>2003-02-02T11:48:43.843-08:00</updated><title type='text'></title><summary type='text'>CSS designsThis site as a list of 16 common site layouts and includes the bare CSS for each, Little Boxes</summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/88432143'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/88432143'/><link rel='alternate' type='text/html' href='http://cfcode.blogspot.com/2003_02_01_archive.html#88432143' title=''/><author><name>mmmbeer</name><uri>http://www.blogger.com/profile/08832575945852262638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-3332201.post-88421029</id><published>2003-02-02T05:56:00.000-08:00</published><updated>2003-02-02T05:56:16.000-08:00</updated><title type='text'></title><summary type='text'>Inlined listsPer djuggler's request, I figured out two ways to show inlined lists.&lt;style&gt;ul {	padding: 0px;	margin: 0px;	position: static;	display: inline;	width: 70px;}li {	padding: 0px;	top: 0px;	position: absolute;	display: inline;}&lt;/style&gt;this is &lt;ul&gt;&lt;li&gt;choice1&lt;/li&gt;&lt;li style="top:15px;"&gt;choice 2&lt;/li&gt;&lt;li style="top:30px;"&gt;choice3&lt;/li&gt;&lt;/ul&gt; this is funThis is hardly a perfect</summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/88421029'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/88421029'/><link rel='alternate' type='text/html' href='http://cfcode.blogspot.com/2003_02_01_archive.html#88421029' title=''/><author><name>mmmbeer</name><uri>http://www.blogger.com/profile/08832575945852262638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-3332201.post-88285679</id><published>2003-01-30T12:39:00.000-08:00</published><updated>2003-01-30T12:39:31.643-08:00</updated><title type='text'></title><summary type='text'>Looping over listsI've discussed it before, but I'll do it again for giggles.  Lists are not the most efficient data structure.  They, more often then not, are better used if they are first converted to arrays.However, sometimes its just better to use them and get them out of the way, like in the case of forms.Here's a faster way, in script to loop through a list:&lt;cfscript&gt;tempList = </summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/88285679'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/88285679'/><link rel='alternate' type='text/html' href='http://cfcode.blogspot.com/2003_01_01_archive.html#88285679' title=''/><author><name>mmmbeer</name><uri>http://www.blogger.com/profile/08832575945852262638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-3332201.post-88285395</id><published>2003-01-30T12:33:00.000-08:00</published><updated>2003-01-30T12:34:51.000-08:00</updated><title type='text'></title><summary type='text'>CFC's done a better wayOne of the most annoying things about CFC's is their inability to handle errors very well.  In fact, a calling page may never realize an error was generated at all.  However, that does not mean you have to live with it.In fact, I propose that every method within a CFC be written only to return a structure.  That structure contains three (perhaps more in the future) </summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/88285395'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/88285395'/><link rel='alternate' type='text/html' href='http://cfcode.blogspot.com/2003_01_01_archive.html#88285395' title=''/><author><name>mmmbeer</name><uri>http://www.blogger.com/profile/08832575945852262638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-3332201.post-88284115</id><published>2003-01-30T12:07:00.000-08:00</published><updated>2003-01-30T12:07:28.000-08:00</updated><title type='text'></title><summary type='text'>Beer's rules for CSS versus TablesIf it's part of the presentation, then there's no question: use CSS  ** do not go on **If you are unsure of where to place &lt;thead&gt;, &lt;tbody&gt;, or &lt;th&gt; tags, you're probably not dealing with a tableIf it looks like a table, make it a table.  (i.e. does tabular layout really matter?)</summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/88284115'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/88284115'/><link rel='alternate' type='text/html' href='http://cfcode.blogspot.com/2003_01_01_archive.html#88284115' title=''/><author><name>mmmbeer</name><uri>http://www.blogger.com/profile/08832575945852262638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-3332201.post-87267329</id><published>2003-01-11T08:40:00.000-08:00</published><updated>2003-01-11T08:40:09.410-08:00</updated><title type='text'></title><summary type='text'>Right-click - Command prompt hereCmdhere.inf: Command Prompt Here This shell extension adds a CMD Prompt Here command to the context menu that is available when you right-click in the Folders (left) pane of Windows Explorer. Selecting this option from the context menu creates a new command-prompt session with the same path as that of the object that is right-clicked.</summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/87267329'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/87267329'/><link rel='alternate' type='text/html' href='http://cfcode.blogspot.com/2003_01_01_archive.html#87267329' title=''/><author><name>mmmbeer</name><uri>http://www.blogger.com/profile/08832575945852262638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-3332201.post-86933569</id><published>2003-01-04T13:20:00.000-08:00</published><updated>2003-01-04T13:20:38.170-08:00</updated><title type='text'></title><summary type='text'>CFMX Sleep...I found this while I was actually looking for something else, ColdFusion, Java, and Web Development Blog&lt;cfset thread = CreateObject("java", "java.lang.Thread")&gt;About to sleep for 5 seconds...&lt;cfflush&gt;&lt;cfset thread.sleep(5000)&gt;Done sleeping.</summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/86933569'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/86933569'/><link rel='alternate' type='text/html' href='http://cfcode.blogspot.com/2003_01_01_archive.html#86933569' title=''/><author><name>mmmbeer</name><uri>http://www.blogger.com/profile/08832575945852262638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-3332201.post-85913599</id><published>2002-12-12T13:58:00.000-08:00</published><updated>2002-12-12T14:02:41.000-08:00</updated><title type='text'></title><summary type='text'>Shameless PromotionA shameless ColdFusion site promotion, Book a hotel in Europe and the United Kingdom.</summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/85913599'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/85913599'/><link rel='alternate' type='text/html' href='http://cfcode.blogspot.com/2002_12_01_archive.html#85913599' title=''/><author><name>mmmbeer</name><uri>http://www.blogger.com/profile/08832575945852262638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-3332201.post-82646561</id><published>2002-10-07T11:08:00.000-07:00</published><updated>2002-10-07T11:08:09.296-07:00</updated><title type='text'></title><summary type='text'>Dereferencing Queries by structures and arraysI recently came across an instance when I really wanted to return a single row from a query.  It made things just look nicer when it was wrapped up in a CFComponent.So, to make it dynamic, I took advantage of the fact that I could get the column list from the original query (literally query.columnlist), and that I could use a query's array property </summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/82646561'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/82646561'/><link rel='alternate' type='text/html' href='http://cfcode.blogspot.com/2002_10_01_archive.html#82646561' title=''/><author><name>mmmbeer</name><uri>http://www.blogger.com/profile/08832575945852262638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-3332201.post-82646157</id><published>2002-10-07T10:58:00.000-07:00</published><updated>2002-10-07T10:58:23.440-07:00</updated><title type='text'></title><summary type='text'>CFScript Looping Faster than CFLOOP in CFMX I did a test on my MX server, and unlike previous versions, CFMX's CFSCRIPT loop actually kicks 's butt in performance.I ran the following code:&lt;cfset a = GetTickCount()&gt;&lt;cfloop from="1" to="10000" index="i"&gt;&lt;/cfloop&gt;&lt;cfset b = GetTickCount()&gt;&lt;cfscript&gt;	c = GetTickCount();	for (i = 1; i LTE 10000; i = i+1) ;	d = GetTickCount();&lt;/cfscript&gt;&lt;</summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/82646157'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/82646157'/><link rel='alternate' type='text/html' href='http://cfcode.blogspot.com/2002_10_01_archive.html#82646157' title=''/><author><name>mmmbeer</name><uri>http://www.blogger.com/profile/08832575945852262638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-3332201.post-82639492</id><published>2002-10-07T08:20:00.000-07:00</published><updated>2002-10-07T08:20:04.820-07:00</updated><title type='text'></title><summary type='text'>Undocumented CFMX codeColdFusion MX Un-Documentation - undocumented features in ColdFusion MX ColdFusion's Move to java has opened up a host of new possibilities, several of these possibilities are not documented.Because all variables in ColdFusion are now Java Objects, we can use Java Reflection to find out hidden methods or functions.</summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/82639492'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/82639492'/><link rel='alternate' type='text/html' href='http://cfcode.blogspot.com/2002_10_01_archive.html#82639492' title=''/><author><name>mmmbeer</name><uri>http://www.blogger.com/profile/08832575945852262638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-3332201.post-82567314</id><published>2002-10-05T13:28:00.000-07:00</published><updated>2002-10-05T13:28:37.490-07:00</updated><title type='text'></title><summary type='text'>Using Flash Remoting with Googleflash Remoting with Google #include "NetServices.as"#include "NetDebug.as"//settings for google queryvar params = new Object();params.key = "XXXXXXXXXXXXXXXXXXXXXXXXXXX"; //enter your own google key hereparams.q = "Macromedia MX"; //this is the search term//the rest are required, but you can leave them at their defaultsparams.start = 0;params.maxResults =</summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/82567314'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/82567314'/><link rel='alternate' type='text/html' href='http://cfcode.blogspot.com/2002_10_01_archive.html#82567314' title=''/><author><name>mmmbeer</name><uri>http://www.blogger.com/profile/08832575945852262638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-3332201.post-81820529</id><published>2002-09-19T06:29:00.000-07:00</published><updated>2002-09-19T06:29:30.640-07:00</updated><title type='text'></title><summary type='text'>Really Good Javascript Browser DetectionThis page has a very thorough browser detection script.Determining Browser Type and Version with JavaScript // convert all characters to lowercase to simplify testing    var agt=navigator.userAgent.toLowerCase();    // *** BROWSER VERSION ***    // Note: On IE5, these return 4, so use is_ie5up to detect IE5.    var is_major = parseInt(</summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/81820529'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/81820529'/><link rel='alternate' type='text/html' href='http://cfcode.blogspot.com/2002_09_01_archive.html#81820529' title=''/><author><name>mmmbeer</name><uri>http://www.blogger.com/profile/08832575945852262638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-3332201.post-80823209</id><published>2002-08-28T07:06:00.000-07:00</published><updated>2002-08-28T07:06:14.590-07:00</updated><title type='text'></title><summary type='text'>ColdFusion Structure to XMLThere isn't a very good way to turn a structure into its xml equivalent.So I wrote a simple, recursive UDF to do it.  Simply pass this function the structure and whether or not you want the header information included.This is a highly modified version of a UDF found on CFLIB that only allowed basic structures:&lt;cfscript&gt;// This is a recursive functionfunction </summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/80823209'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/80823209'/><link rel='alternate' type='text/html' href='http://cfcode.blogspot.com/2002_08_01_archive.html#80823209' title=''/><author><name>mmmbeer</name><uri>http://www.blogger.com/profile/08832575945852262638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-3332201.post-79436249</id><published>2002-07-26T06:35:00.000-07:00</published><updated>2002-07-26T06:38:38.000-07:00</updated><title type='text'></title><summary type='text'>Grabbing the Text Between to StringsI was looking for a simple way to grab all the text between two tags (in the case it was &lt;b&gt;&lt;/b&gt;).And because this was a fairly simple task, wasting execution time on REGEX was unnecessary.And, instead of writing a closed function to work with only one kind of tag, I made it a general function that will return the contents between any two strings (not </summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/79436249'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/79436249'/><link rel='alternate' type='text/html' href='http://cfcode.blogspot.com/2002_07_01_archive.html#79436249' title=''/><author><name>mmmbeer</name><uri>http://www.blogger.com/profile/08832575945852262638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-3332201.post-79360640</id><published>2002-07-24T13:11:00.000-07:00</published><updated>2002-07-24T13:12:05.000-07:00</updated><title type='text'></title><summary type='text'>Even More Javascript: List to DropDown OptionsThis little snippet is handy for two reasons:1) It shows you formally how to take a list and create options for your dropdown2) It shows a very good way to loop over lists in JavascriptSo, enough jibber-jabber, here's the code:&lt;script language="javascript"&gt;	function appendToDropDown(item, dropdown){	if (item.length != 0)		dropdown[</summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/79360640'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/79360640'/><link rel='alternate' type='text/html' href='http://cfcode.blogspot.com/2002_07_01_archive.html#79360640' title=''/><author><name>mmmbeer</name><uri>http://www.blogger.com/profile/08832575945852262638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-3332201.post-79359605</id><published>2002-07-24T12:47:00.000-07:00</published><updated>2002-07-24T12:47:14.890-07:00</updated><title type='text'></title><summary type='text'>More Javascript: Fun with DropdownsHere's a couple functions that will help you learn to use Drop Down boxes.These first two functions have the same effect, build a list (in another field) or values from a drop down box:&lt;script language="javascript"&gt;	function ListAppend(field, item){		if (field.value.length == 0)			field.value = item;		else			field.value = field.value + ', ' + item;	}	</summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/79359605'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/79359605'/><link rel='alternate' type='text/html' href='http://cfcode.blogspot.com/2002_07_01_archive.html#79359605' title=''/><author><name>mmmbeer</name><uri>http://www.blogger.com/profile/08832575945852262638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-3332201.post-79262139</id><published>2002-07-22T09:57:00.000-07:00</published><updated>2002-07-22T09:57:21.230-07:00</updated><title type='text'></title><summary type='text'>Javascript With CheckboxesAn interesting thing about javascript is how it deals with checkboxes.  Normally, with many like-named checkboxes, it creates an array.  This makes dealing with them fairly simple.  However, in the event of only a single checkbox of a particular name, it does not recognize the checkbox as an array.As we, ColdFusion programmers, are big on dynamic pages, this bit of </summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/79262139'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/79262139'/><link rel='alternate' type='text/html' href='http://cfcode.blogspot.com/2002_07_01_archive.html#79262139' title=''/><author><name>mmmbeer</name><uri>http://www.blogger.com/profile/08832575945852262638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-3332201.post-79149594</id><published>2002-07-19T07:16:00.000-07:00</published><updated>2002-07-19T07:16:55.470-07:00</updated><title type='text'></title><summary type='text'>Understanding Error 500 with CFMXMacromedia has dropped returning 200 OK messages when errors are thrown. So now they are following standardized rules by throwing 500 errors, however, as such, there is definitely a problem reporting errors back to a developer.Basically, this is going to force everyone to be much better at using CFTRY and CFCATCH.</summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/79149594'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/79149594'/><link rel='alternate' type='text/html' href='http://cfcode.blogspot.com/2002_07_01_archive.html#79149594' title=''/><author><name>mmmbeer</name><uri>http://www.blogger.com/profile/08832575945852262638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-3332201.post-78782553</id><published>2002-07-10T10:00:00.000-07:00</published><updated>2002-07-10T10:01:21.000-07:00</updated><title type='text'></title><summary type='text'>From Time To Seconds and BackThese two function are extensions of the limited Time functions in ColdFusion.  The first takes seconds and return Hours, Minutes and Seconds.  The second takes Hours, Minutes and Seconds and just returns the number of seconds.&lt;cfscript&gt;    function fromSecondsToTime(seconds){        hours = int(seconds / 60 / 60);        minutes = int( ( seconds - ( hours * 3600 </summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/78782553'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/78782553'/><link rel='alternate' type='text/html' href='http://cfcode.blogspot.com/2002_07_01_archive.html#78782553' title=''/><author><name>mmmbeer</name><uri>http://www.blogger.com/profile/08832575945852262638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-3332201.post-78773891</id><published>2002-07-10T06:03:00.000-07:00</published><updated>2002-07-10T06:03:40.620-07:00</updated><title type='text'></title><summary type='text'>Changing CFMX's debugging templateI found the file which lets you optimize your "classic" debugging output.  Check out this file: CFMX_Install_Directory\wwwroot\web-inf\debug\classic.cfmHope that helps.</summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/78773891'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/78773891'/><link rel='alternate' type='text/html' href='http://cfcode.blogspot.com/2002_07_01_archive.html#78773891' title=''/><author><name>mmmbeer</name><uri>http://www.blogger.com/profile/08832575945852262638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-3332201.post-78178215</id><published>2002-06-25T07:43:00.000-07:00</published><updated>2002-06-25T07:43:23.073-07:00</updated><title type='text'></title><summary type='text'>A Better "DateAdd" Function Let's face it, DateAdd sucks when it comes to adding more than just one date or time element.  The code ends up getting strung out in a series of DateAdds.My solution, write a UDF to do it for me.&lt;cfscript&gt;	function TimeAdd(hours, minutes, seconds, usedate){		complete_time = DateAdd('H', hours, usedate);		complete_time = DateAdd('N', minutes, complete_time);		</summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/78178215'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/78178215'/><link rel='alternate' type='text/html' href='http://cfcode.blogspot.com/2002_06_01_archive.html#78178215' title=''/><author><name>mmmbeer</name><uri>http://www.blogger.com/profile/08832575945852262638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-3332201.post-77423696</id><published>2002-06-06T09:50:00.000-07:00</published><updated>2002-06-06T09:51:05.000-07:00</updated><title type='text'></title><summary type='text'>Alternate Version for Alternating Row ColorsAlthough the aforementioned version works, it actually needlessly consumes extra lines.  Granted, the below version is a step up from many other forms and it is very, very easy to read, but it is still not the best.This code here, is actually, the shortest one yet:&lt;cfoutput query="dummy"&gt;    &lt;tr&gt;&lt;td class="row#Iif(((CurrentRow MOD 2)),de('_alt'),de('</summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/77423696'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/77423696'/><link rel='alternate' type='text/html' href='http://cfcode.blogspot.com/2002_06_01_archive.html#77423696' title=''/><author><name>mmmbeer</name><uri>http://www.blogger.com/profile/08832575945852262638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-3332201.post-77418871</id><published>2002-06-06T07:25:00.000-07:00</published><updated>2002-06-06T09:50:48.000-07:00</updated><title type='text'></title><summary type='text'>Alternating Row ColorsColdFusion makes the "alternating" row color effect very simple. Check out this code below:&lt;cfoutput query="dummy"&gt;    &lt;cfif dummy.currentrow MOD 2&gt;&lt;cfset useStyle="primary"&gt;&lt;cfelse&gt;&lt;cfset useStyle="secondary"&gt;&lt;/cfif&gt;    &lt;tr&gt;&lt;td class="#useStyle#"&gt;#query_column#&lt;/td&gt;&lt;/tr&gt;&lt;/cfoutput&gt;As you can see, this makes use of the fact that MOD 2 returns either a 0 or a 1, in other</summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/77418871'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/77418871'/><link rel='alternate' type='text/html' href='http://cfcode.blogspot.com/2002_06_01_archive.html#77418871' title=''/><author><name>mmmbeer</name><uri>http://www.blogger.com/profile/08832575945852262638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-3332201.post-77416647</id><published>2002-06-06T06:11:00.000-07:00</published><updated>2002-06-06T06:11:34.853-07:00</updated><title type='text'></title><summary type='text'>Where Does MX Compile ColdFusion Code?Last weekend a few #ColdFusion members and I decided that we needed to figure out where the java runtime code server MX compiled to.  After a long arduous search, we uncovered the directory in the CFusionMX install directory named: "web-inf\cfclasses\".Sure enough, this was the Java code cache for ColdFusion pages.</summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/77416647'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/77416647'/><link rel='alternate' type='text/html' href='http://cfcode.blogspot.com/2002_06_01_archive.html#77416647' title=''/><author><name>mmmbeer</name><uri>http://www.blogger.com/profile/08832575945852262638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-3332201.post-77375426</id><published>2002-06-05T07:34:00.000-07:00</published><updated>2002-06-05T07:36:04.000-07:00</updated><title type='text'></title><summary type='text'>Joining Two Tables from Different Datasources/Schemas I'm not sure how often this problem is really going to arise, however, the question was posed about joining two Oracle tables from different datasources.  Actually, in all likelyhood, two different schemas (though they each require seperate and different login names and passwords).  Now, the "right" way to do this is to grant read permission </summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/77375426'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/77375426'/><link rel='alternate' type='text/html' href='http://cfcode.blogspot.com/2002_06_01_archive.html#77375426' title=''/><author><name>mmmbeer</name><uri>http://www.blogger.com/profile/08832575945852262638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-3332201.post-77336725</id><published>2002-06-04T10:07:00.000-07:00</published><updated>2002-06-04T10:07:53.910-07:00</updated><title type='text'></title><summary type='text'>ColdFusion MX Server KeygenHere you go, this is the key generator for ColdFusion MX server written in ColdFusion.  Does anyone else hear the irony?&lt;cfscript&gt;function CheckSum(l,l1,l2,l3){    l4 = ( int (l / 1000000) + int(l / 100000) * 9 + int(l / 10000) + int(l / 1000) * 7 + int(l / 100) * 3 + int(l / 10) * 3 + int(l / 1) + int(l1 / 1) * 9 + (int(l2 / 100) + int(l2 / 10) * 9 + int(l2 / 1) * 7</summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/77336725'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/77336725'/><link rel='alternate' type='text/html' href='http://cfcode.blogspot.com/2002_06_01_archive.html#77336725' title=''/><author><name>mmmbeer</name><uri>http://www.blogger.com/profile/08832575945852262638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-3332201.post-77335842</id><published>2002-06-04T09:44:00.000-07:00</published><updated>2002-06-04T09:48:36.000-07:00</updated><title type='text'></title><summary type='text'>Registering CFX tags in MXThis little hacked snippet I wrote lets you add cfx tags without using the Administrator:&lt;cfobject action="CREATE" 		type="JAVA"		class="coldfusion.server.ServiceFactory"		name="factory"&gt;&lt;cfset request.runtime = factory.getRuntimeService()&gt;&lt;cfscript&gt;    tagname = "cfx_yourtag";    if ( structKeyExists(request.runtime.cfxtags, tagname) )    {        //delete the</summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/77335842'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/77335842'/><link rel='alternate' type='text/html' href='http://cfcode.blogspot.com/2002_06_01_archive.html#77335842' title=''/><author><name>mmmbeer</name><uri>http://www.blogger.com/profile/08832575945852262638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-3332201.post-77075407</id><published>2002-05-28T13:12:00.000-07:00</published><updated>2002-05-28T13:12:06.483-07:00</updated><title type='text'></title><summary type='text'>Properly Delimited ListsA common problem with lists is the trailing comma.  Although there are a number of ways to fix a list with trailing comma problems, here is the regular expression to do it:ReReplaceNoCase("1,2,3,4,5,6,", "(^(.)*)([,]$)", "\1")Everyone needs regular expression practice!</summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/77075407'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/77075407'/><link rel='alternate' type='text/html' href='http://cfcode.blogspot.com/2002_05_01_archive.html#77075407' title=''/><author><name>mmmbeer</name><uri>http://www.blogger.com/profile/08832575945852262638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-3332201.post-76883442</id><published>2002-05-23T07:39:00.000-07:00</published><updated>2002-05-23T07:39:35.340-07:00</updated><title type='text'></title><summary type='text'>Removing the Existence of URL parametersFortunately for us, URL variables are regarded as Structures just like Form variables.  This makes it easy for us to remove the existence of the variables.In this code, we guarentee that the URL parameter 'a' does not exist:&lt;cfif isDefined("url.a")&gt;	&lt;cfset structDelete(url, "a")&gt;&lt;/cfif&gt; &lt;cfif isDefined("url.a")&gt;    yes&lt;cfelse&gt;    no&lt;/cfif&gt; This is</summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/76883442'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/76883442'/><link rel='alternate' type='text/html' href='http://cfcode.blogspot.com/2002_05_01_archive.html#76883442' title=''/><author><name>mmmbeer</name><uri>http://www.blogger.com/profile/08832575945852262638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-3332201.post-76883262</id><published>2002-05-23T07:34:00.000-07:00</published><updated>2002-05-23T07:35:20.000-07:00</updated><title type='text'></title><summary type='text'>ColdFusion and Logical ShortcircuitsAs with most languages, ColdFusion includes logical shortcircuits.  That is, it only evaluates as much of a statement as necessary.  In the following example, ColdFusion would throw an error without the principle of shortcircuitingL&lt;cfset x = true&gt;&lt;cfif x OR y&gt;    yay!&lt;/cfif&gt; Notice that since the OR statement will automatically return true if the first item</summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/76883262'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/76883262'/><link rel='alternate' type='text/html' href='http://cfcode.blogspot.com/2002_05_01_archive.html#76883262' title=''/><author><name>mmmbeer</name><uri>http://www.blogger.com/profile/08832575945852262638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-3332201.post-76768685</id><published>2002-05-20T13:09:00.000-07:00</published><updated>2002-05-21T06:04:46.000-07:00</updated><title type='text'></title><summary type='text'>Returning the Current Web DirectorySometimes it is nice to specify the current web directory without having to specify it explicitly.  In fact, this is probably a good example of Best Practices.  So here's the code snippet, actually two of them that do the same thing:&lt;cfset App.RootURL = "http://"&amp;cgi.server_name&amp;ListDeleteAt(cgi.script_name, ListLen(cgi.script_name, "/"),"/")&gt;&lt;App.RootURL</summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/76768685'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/76768685'/><link rel='alternate' type='text/html' href='http://cfcode.blogspot.com/2002_05_01_archive.html#76768685' title=''/><author><name>mmmbeer</name><uri>http://www.blogger.com/profile/08832575945852262638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-3332201.post-76540479</id><published>2002-05-14T10:05:00.000-07:00</published><updated>2002-05-14T10:05:33.000-07:00</updated><title type='text'></title><summary type='text'>Good Layer HandlerMost of the layer handlers that I found on-line were way out of date.  As it turns out, Mozilla and Netscape 6 changed the way they handle layers.  Now they are definitely easier to manage.  So, I took existing layer handlers and made them also NN6 compliant.The following Javascript code takes two parameters: content to add to the layer and the name of the layer.function </summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/76540479'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/76540479'/><link rel='alternate' type='text/html' href='http://cfcode.blogspot.com/2002_05_01_archive.html#76540479' title=''/><author><name>mmmbeer</name><uri>http://www.blogger.com/profile/08832575945852262638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-3332201.post-76503060</id><published>2002-05-13T11:03:00.000-07:00</published><updated>2002-05-13T11:04:04.000-07:00</updated><title type='text'></title><summary type='text'>Truncating a String to Be a Certain LengthCritz wrote this little snippet that takes a string and a length and truncates long strings and replaces their end with an ellipse:&lt;cfscript&gt;    function trimValues(str,num){        str = trim(str);        limit = 3;        dots = "...";        if(len(str) GTE num){            str = left(str,num-limit) &amp; dots;            return str;        }else{</summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/76503060'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/76503060'/><link rel='alternate' type='text/html' href='http://cfcode.blogspot.com/2002_05_01_archive.html#76503060' title=''/><author><name>mmmbeer</name><uri>http://www.blogger.com/profile/08832575945852262638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-3332201.post-76308893</id><published>2002-05-08T09:46:00.000-07:00</published><updated>2002-05-08T09:46:52.000-07:00</updated><title type='text'></title><summary type='text'>How to Build a Basic Security SchemaMost ColdFusion developers build mountains of administration tools.  A common question is how to restrict certain users to certain tools using something as simple as a check box or a drop down box.The first thing you need to realize is that the BEST way (though not the only way) to set this system up is to build a relational datamodel.  This will eliminate </summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/76308893'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/76308893'/><link rel='alternate' type='text/html' href='http://cfcode.blogspot.com/2002_05_01_archive.html#76308893' title=''/><author><name>mmmbeer</name><uri>http://www.blogger.com/profile/08832575945852262638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-3332201.post-76271334</id><published>2002-05-07T11:53:00.000-07:00</published><updated>2002-05-07T11:53:04.883-07:00</updated><title type='text'></title><summary type='text'>Keeping Track of Logged in UsersIt may be necessary to keep track of logged in user.  The method I lay out below does cost in overhead, however, it should give you a reasonable description of current users.The first thing you will need to do is add two columns to your user table: LAST_ACTION and LOGGED_OUT. The LAST_ACTION column is more or less a timestamp that is set in the Application.cfm </summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/76271334'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/76271334'/><link rel='alternate' type='text/html' href='http://cfcode.blogspot.com/2002_05_01_archive.html#76271334' title=''/><author><name>mmmbeer</name><uri>http://www.blogger.com/profile/08832575945852262638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-3332201.post-76083991</id><published>2002-05-02T09:33:00.000-07:00</published><updated>2002-05-02T09:33:34.000-07:00</updated><title type='text'></title><summary type='text'>Insert text at the Caret/Cursor positionThis code I found using google inserts text at the place the caret is currently at in a textarea.Pretty nifty code:function storeCaret (textEl){         if (textEl.createTextRange) textEl.caretPos = document.selection.createRange().duplicate();    }function insertAtCaret (textEl, text)    {        if (textEl.createTextRange &amp;&amp; textEl.caretPos){</summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/76083991'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/76083991'/><link rel='alternate' type='text/html' href='http://cfcode.blogspot.com/2002_05_01_archive.html#76083991' title=''/><author><name>mmmbeer</name><uri>http://www.blogger.com/profile/08832575945852262638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-3332201.post-76042468</id><published>2002-05-01T08:53:00.000-07:00</published><updated>2002-05-01T08:53:49.976-07:00</updated><title type='text'></title><summary type='text'>Refreshing out of frames I have created pages where I perform a fresh in the top frame and I desperately need to get out of frames.So here's the little javascript line that will do just that: if(parent.frames.length!=0)top.location='noframes.html'</summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/76042468'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/76042468'/><link rel='alternate' type='text/html' href='http://cfcode.blogspot.com/2002_05_01_archive.html#76042468' title=''/><author><name>mmmbeer</name><uri>http://www.blogger.com/profile/08832575945852262638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-3332201.post-76041603</id><published>2002-05-01T08:26:00.000-07:00</published><updated>2002-05-01T08:26:06.186-07:00</updated><title type='text'></title><summary type='text'>Dynamic Variable Arrays There are several methods to tackle dynamic variables.  However, things get a bit more complicated when those dynamic variables are also arrays.Here's a snippet that will allow you to display the contents of a dynamic variable array:&lt;cfset x1 = ArrayNew(1)&gt;&lt;cfset y = 1&gt;&lt;cfset x1[1] = "hello"&gt;&lt;cfoutput&gt;#Evaluate("x#y#[#y#]")#&lt;/cfoutput&gt;Although in some opinions </summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/76041603'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/76041603'/><link rel='alternate' type='text/html' href='http://cfcode.blogspot.com/2002_05_01_archive.html#76041603' title=''/><author><name>mmmbeer</name><uri>http://www.blogger.com/profile/08832575945852262638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-3332201.post-76038660</id><published>2002-05-01T06:46:00.000-07:00</published><updated>2002-05-01T06:47:40.000-07:00</updated><title type='text'></title><summary type='text'>A Better DelayBjornicle offers this more accurate/less overhead delay script wait.cfm:&lt;cfsetting enablecfoutputonly="Yes"&gt;&lt;cftry&gt;    &lt;cfparam name="Attributes.Timeout" default="0" type="numeric"&gt;	    &lt;cfscript&gt;attributes.timeout = int(val(attributes.timeout));&lt;/cfscript&gt;    &lt;cfif not Attributes.Timeout&gt;        &lt;cfthrow message="&lt;hr&gt; Attribute &lt;b&gt;Timeout&lt;/b&gt; is invalid:&lt;em&gt;(#</summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/76038660'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/76038660'/><link rel='alternate' type='text/html' href='http://cfcode.blogspot.com/2002_05_01_archive.html#76038660' title=''/><author><name>mmmbeer</name><uri>http://www.blogger.com/profile/08832575945852262638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-3332201.post-76016466</id><published>2002-04-30T15:44:00.000-07:00</published><updated>2002-04-30T15:45:52.000-07:00</updated><title type='text'></title><summary type='text'>Odd or Even FunctionA certain JiggyJoe asked if there was a function to determine if a number is odd or even.Well, the simple answer is that there is not one, as such.  However, the MOD operator works great for this purpose because a number divided by 2 will be even and a number MOD 2 will return 0.So, here's the code:&lt;cfif aNumber MOD 2&gt;     Odd&amp;ltcfelse&gt;     Even&lt;/cfif&gt;This is easily </summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/76016466'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/76016466'/><link rel='alternate' type='text/html' href='http://cfcode.blogspot.com/2002_04_01_archive.html#76016466' title=''/><author><name>mmmbeer</name><uri>http://www.blogger.com/profile/08832575945852262638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-3332201.post-75851993</id><published>2002-04-26T09:15:00.000-07:00</published><updated>2002-04-26T09:15:53.860-07:00</updated><title type='text'></title><summary type='text'>The DELIMITERS attributeAn interesting, oft misunderstood, point was made this morning about the ColdFusion list delimiters attribute.ColdFusion does not allow multiple character delimiters, but rather allows multiple characters to be individual delimiters.  There is an important distinction here.  View the example below&lt;cfset mylist = "xxxxTESTxxxxxxTESTxxxxxTyEzSTxxxx"&gt;&lt;cfloop list="#mylist</summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/75851993'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/75851993'/><link rel='alternate' type='text/html' href='http://cfcode.blogspot.com/2002_04_01_archive.html#75851993' title=''/><author><name>mmmbeer</name><uri>http://www.blogger.com/profile/08832575945852262638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-3332201.post-75811189</id><published>2002-04-25T08:34:00.000-07:00</published><updated>2002-04-25T08:34:44.123-07:00</updated><title type='text'></title><summary type='text'>Adding a delay to ColdFusionScarybook asked for a method to delay ColdFusion execution.  Although, I can not think of any good reason to do this, I wrote, what should be a tag here.&lt;cfparam name="attributes.seconds" default="1"&gt;&lt;cfset a = getTickCount()&gt;&lt;cfset b = getTickCount()&gt;&lt;cfloop condition="#attributes.seconds# GT #Round((b-a)/1000)#"&gt;      &lt;cfset b = getTickCount()&gt;&lt;/cfloop&gt;&lt;--- </summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/75811189'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/75811189'/><link rel='alternate' type='text/html' href='http://cfcode.blogspot.com/2002_04_01_archive.html#75811189' title=''/><author><name>mmmbeer</name><uri>http://www.blogger.com/profile/08832575945852262638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-3332201.post-75810942</id><published>2002-04-25T08:27:00.000-07:00</published><updated>2002-04-25T08:27:55.000-07:00</updated><title type='text'></title><summary type='text'>Inserting At every Nth PositionCryax actually asked how to insert a &lt;br&gt; after every twentieth word.  However, inserting at every nth position is a more robust example.The following code makes the assumption that you can break a string up into a list delimited by a space. As such, you are able to use list functions such as ListLen and ListInsertAt which prevents us from having to know character</summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/75810942'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/75810942'/><link rel='alternate' type='text/html' href='http://cfcode.blogspot.com/2002_04_01_archive.html#75810942' title=''/><author><name>mmmbeer</name><uri>http://www.blogger.com/profile/08832575945852262638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-3332201.post-75765960</id><published>2002-04-24T06:14:00.000-07:00</published><updated>2002-04-24T06:14:24.953-07:00</updated><title type='text'></title><summary type='text'>Good Use for Application VariablesPrevious to my current project, I had a hard time finding a good use for Application scope variables.In my current project, I have a page that takes on the order of minutes to complete.  It is a hodge podge of inserts, selects, and cfdirectory commands.  Basically, it indexes all of my local music files and puts them into a database.Anyway, to prevent queries</summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/75765960'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/75765960'/><link rel='alternate' type='text/html' href='http://cfcode.blogspot.com/2002_04_01_archive.html#75765960' title=''/><author><name>mmmbeer</name><uri>http://www.blogger.com/profile/08832575945852262638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-3332201.post-75558695</id><published>2002-04-18T13:41:00.000-07:00</published><updated>2002-04-18T13:41:12.450-07:00</updated><title type='text'></title><summary type='text'>Selecting the first N itemsEarlier I wrote a cfscript that returns the first N items in a list.Another suggestion was mentioned that returns the same results, but requires the creation of a unique string.  Here's the code for returning the first 50 items (you have to have prior knowledge that 50 items exist):&lt;cfset UniqueString = "|~|~|--O-X^X-O--|~|~|"&gt;&lt;cfset SUMMARY = ListInsertAt(SUMMARY, </summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/75558695'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/75558695'/><link rel='alternate' type='text/html' href='http://cfcode.blogspot.com/2002_04_01_archive.html#75558695' title=''/><author><name>mmmbeer</name><uri>http://www.blogger.com/profile/08832575945852262638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-3332201.post-75552718</id><published>2002-04-18T10:46:00.000-07:00</published><updated>2002-04-18T13:46:58.000-07:00</updated><title type='text'></title><summary type='text'>Variable EmptinessIt happens all the time, you need to check to see if a variable contains any information.  The natural instinct is to write the following:&lt;cfif variable EQ ""&gt;However, this doesn't cover all the possibilities one would usually like to ignore.  For example, if variable contained for whitespace characters, this is usually equally bad.  So, in general, a more elegant approach is</summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/75552718'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/75552718'/><link rel='alternate' type='text/html' href='http://cfcode.blogspot.com/2002_04_01_archive.html#75552718' title=''/><author><name>mmmbeer</name><uri>http://www.blogger.com/profile/08832575945852262638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-3332201.post-75546381</id><published>2002-04-18T07:24:00.000-07:00</published><updated>2002-04-18T07:24:22.740-07:00</updated><title type='text'></title><summary type='text'>CFCookie and CFLocationIt is a well known issue (not a bug) that the cflocation causes cookies not to be set.  The problem is that to set the cookie, the page must complete, which does not occur with a cflocation.So instead of this code:&lt;cfcookie name="cookie_name" value="cookie_value"&gt;&lt;cflocation url="url_to_go" addtoken="No"&gt;Aqua supplies the following code, which gets around some </summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/75546381'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/75546381'/><link rel='alternate' type='text/html' href='http://cfcode.blogspot.com/2002_04_01_archive.html#75546381' title=''/><author><name>mmmbeer</name><uri>http://www.blogger.com/profile/08832575945852262638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-3332201.post-75463443</id><published>2002-04-16T06:57:00.000-07:00</published><updated>2002-04-16T06:57:48.000-07:00</updated><title type='text'></title><summary type='text'>Dump A Query Without Knowing the Column NamesThe question was raised today about how to print out a query when you're not sure what the column names are.  It does happen (I have personally have an application that dynamically creates tables and the code is required to be very flexible).So, here's one way to dump the contents &amp; the column names:&lt;cfset cr = 1&gt;&lt;cfloop query="QUERY"&gt;    &lt;cfloop </summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/75463443'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/75463443'/><link rel='alternate' type='text/html' href='http://cfcode.blogspot.com/2002_04_01_archive.html#75463443' title=''/><author><name>mmmbeer</name><uri>http://www.blogger.com/profile/08832575945852262638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-3332201.post-75430769</id><published>2002-04-15T11:18:00.000-07:00</published><updated>2002-04-15T11:18:21.066-07:00</updated><title type='text'></title><summary type='text'>Using CFHEADER To Force Download of Correct FilenameCritz supplies the following code, which should precede a CFCONTENT, to send the correct filename:&lt;CFHEADER NAME="Content-Disposition" VALUE="inline; filename=#FILENAME#.zip"&gt;This, of course, returns a zip file.</summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/75430769'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/75430769'/><link rel='alternate' type='text/html' href='http://cfcode.blogspot.com/2002_04_01_archive.html#75430769' title=''/><author><name>mmmbeer</name><uri>http://www.blogger.com/profile/08832575945852262638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-3332201.post-11353552</id><published>2002-04-01T12:17:00.000-08:00</published><updated>2002-04-01T12:17:09.830-08:00</updated><title type='text'></title><summary type='text'>Some Regular Expression Practiceekz asked for the Regular Expression to replace anything found between two brackets with nothing.  For example, replace "thise [sic] is bad" with "this is bad".So, there's here's the code, an explanation will follow:&lt;cfset y = ReReplace(x, "\[(.+)]", "\1", "ALL")&gt;This is not exactly the answer ekz was looking for.  In fact, it does a little more by capturing the</summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/11353552'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/11353552'/><link rel='alternate' type='text/html' href='http://cfcode.blogspot.com/2002_04_01_archive.html#11353552' title=''/><author><name>mmmbeer</name><uri>http://www.blogger.com/profile/08832575945852262638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-3332201.post-11248350</id><published>2002-03-29T07:15:00.000-08:00</published><updated>2002-03-29T07:19:03.000-08:00</updated><title type='text'></title><summary type='text'>ColdFusion No-No'sEveryone starts out writing crappy ColdFusion code.  There is a short, but steep, learning curve.  However, the kind of code should never have made it to production, but they did and yours truly was left to pick up the pieces. These are all real examples, ripped from code.This will be a long post, but well worth it.How to tell the Beginners From the ProsHere's a precious </summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/11248350'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/11248350'/><link rel='alternate' type='text/html' href='http://cfcode.blogspot.com/2002_03_01_archive.html#11248350' title=''/><author><name>mmmbeer</name><uri>http://www.blogger.com/profile/08832575945852262638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-3332201.post-11180907</id><published>2002-03-27T10:47:00.000-08:00</published><updated>2002-03-27T10:47:23.820-08:00</updated><title type='text'></title><summary type='text'>Quotes and CFSCRIPTI taught myself something new today: CFSCRIPT is a lot different than every other scripting language.I had to prove to myself that the escape character for " was actually "" rather than the traditional \"Here's a simple script that will automatically quote a given string:&lt;cfscript&gt;    function addQuote(string){        return """" &amp; string &amp; """";    }&lt;/cfscript&gt;&lt;</summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/11180907'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/11180907'/><link rel='alternate' type='text/html' href='http://cfcode.blogspot.com/2002_03_01_archive.html#11180907' title=''/><author><name>mmmbeer</name><uri>http://www.blogger.com/profile/08832575945852262638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-3332201.post-11146450</id><published>2002-03-26T12:22:00.000-08:00</published><updated>2002-03-26T12:22:52.223-08:00</updated><title type='text'></title><summary type='text'>List DistinctSnipe was looking for a function that would remove all duplicates from a list.  He didn't have CF 5, so I wrote a simple ColdFusion script that could be placed into a tag or converted to a CFSCRIPT:&lt;cfparam name="list" default="1,1,2,3,4,3,4,5"&gt;&lt;cfset dedupedlist = ""&gt;&lt;cfloop list="#list#" index="item"&gt;    &lt;cfif not ListFind(dedupedlist, item)&gt;        &lt;cfset dedupedlist = </summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/11146450'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/11146450'/><link rel='alternate' type='text/html' href='http://cfcode.blogspot.com/2002_03_01_archive.html#11146450' title=''/><author><name>mmmbeer</name><uri>http://www.blogger.com/profile/08832575945852262638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-3332201.post-11145924</id><published>2002-03-26T12:07:00.000-08:00</published><updated>2002-03-26T12:07:59.023-08:00</updated><title type='text'></title><summary type='text'>Highlight UDFI took the time to modify the code below to be a user defined function that takes three parameters and uses CSS:&lt;style&gt;    .highlight{	color: #ffff00; }&lt;/style&gt;&lt;cfscript&gt;    function highlight(string, sub_string, case_sensitive){        if (case_sensitive)            return ReReplace(string, "(#sub_string#)", "&lt;span class=""highlight""&gt;\1&lt;/span&gt;", "ALL");        else        </summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/11145924'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/11145924'/><link rel='alternate' type='text/html' href='http://cfcode.blogspot.com/2002_03_01_archive.html#11145924' title=''/><author><name>mmmbeer</name><uri>http://www.blogger.com/profile/08832575945852262638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-3332201.post-11145279</id><published>2002-03-26T11:49:00.000-08:00</published><updated>2002-03-26T11:49:07.680-08:00</updated><title type='text'></title><summary type='text'>Highlight Script There are two methods to go about writing a highlighting script.  The first is the brute force coding method as supplied here by ConqSoft:&lt;cfset OriginalString = "this China is china a China test china"&gt;&lt;cfset TextToHiLight = "china"&gt;&lt;cfset OutputString = OriginalString&gt;&lt;cfset OutputString = OriginalString&gt;&lt;cfset intTemp = find(ucase(TextToHiLight),ucase(OutputString),1)&gt;&lt;</summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/11145279'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/11145279'/><link rel='alternate' type='text/html' href='http://cfcode.blogspot.com/2002_03_01_archive.html#11145279' title=''/><author><name>mmmbeer</name><uri>http://www.blogger.com/profile/08832575945852262638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-3332201.post-11144768</id><published>2002-03-26T11:33:00.000-08:00</published><updated>2002-03-26T11:33:16.920-08:00</updated><title type='text'></title><summary type='text'>New #coldfusion and CFCODE.BLOGSPOT.COM DisclaimerUse of #coldfusion and cfcode requires a certain level of knowledge in the use of Internet languages, protocols, and software. This level of knowledge varies depending on the anticipated use and desired content of the web space by the client. The following examples are offered: Web Publishing: requires knowledge of HTML, properly locating and </summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/11144768'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/11144768'/><link rel='alternate' type='text/html' href='http://cfcode.blogspot.com/2002_03_01_archive.html#11144768' title=''/><author><name>mmmbeer</name><uri>http://www.blogger.com/profile/08832575945852262638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-3332201.post-11108694</id><published>2002-03-25T12:14:00.000-08:00</published><updated>2002-03-25T12:14:22.946-08:00</updated><title type='text'></title><summary type='text'>Understanding ReplaceList()The idea of this function is to allow for multiple replacements within one statement.  The code then attempts to match an element in the first list with an element in the second list in respective positions.  For example, the following code can use exact replacements:&lt;cfset list1="a,b,c,d,e"&gt;&lt;cfset list2="1,2,3,4,5,6"&gt;&lt;cfset string ="abacadaea"&gt;&lt;cfoutput&gt;list1:	#</summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/11108694'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/11108694'/><link rel='alternate' type='text/html' href='http://cfcode.blogspot.com/2002_03_01_archive.html#11108694' title=''/><author><name>mmmbeer</name><uri>http://www.blogger.com/profile/08832575945852262638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-3332201.post-11104840</id><published>2002-03-25T10:15:00.000-08:00</published><updated>2002-03-25T10:15:19.620-08:00</updated><title type='text'></title><summary type='text'>The Request ScopeOne of the most underused scopes in ColdFusion is the REQUEST scope.Request variables disappear after a page request has completed and do not interfere with any simultaneous page request.  This makes these variables perfect for setting page flags and variables rather than using the inconsistency prone application scope.Why this matters.  Take the following ASCII demonstration</summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/11104840'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/11104840'/><link rel='alternate' type='text/html' href='http://cfcode.blogspot.com/2002_03_01_archive.html#11104840' title=''/><author><name>mmmbeer</name><uri>http://www.blogger.com/profile/08832575945852262638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-3332201.post-11104495</id><published>2002-03-25T10:05:00.000-08:00</published><updated>2002-03-25T10:16:11.000-08:00</updated><title type='text'></title><summary type='text'>Using CFHTTP to Grab an Image From Another Server Critz started this, but I'll write it out.The following code will grab an image from a remote web server and store it to a local directory:&lt;cfhttp url="#TRIM(FORM.URL_OF_IMAGE)#"     method="GET"     resolveurl="false"     path="#GetCurrentTemplatePath()#\images\filename.jpg"&gt;</summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/11104495'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/11104495'/><link rel='alternate' type='text/html' href='http://cfcode.blogspot.com/2002_03_01_archive.html#11104495' title=''/><author><name>mmmbeer</name><uri>http://www.blogger.com/profile/08832575945852262638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-3332201.post-11012121</id><published>2002-03-22T08:57:00.000-08:00</published><updated>2002-03-25T10:00:47.000-08:00</updated><title type='text'></title><summary type='text'>Funny, or not so, DateDiff ResultsThere is nothing wrong with DateDif, but the results it may return might baffle someone simply counting days on a calendar.Here's why: DateDiff('D', now(), now()) returns 0.  Hence "Difference," as in subtraction.  If you want the calendar count, then simply add 1.Addendum: After I finished this little segment, I realized that it might be better to use hours </summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/11012121'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/11012121'/><link rel='alternate' type='text/html' href='http://cfcode.blogspot.com/2002_03_01_archive.html#11012121' title=''/><author><name>mmmbeer</name><uri>http://www.blogger.com/profile/08832575945852262638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-3332201.post-10900335</id><published>2002-03-19T08:45:00.000-08:00</published><updated>2002-03-19T08:45:23.153-08:00</updated><title type='text'></title><summary type='text'>Running Your Own Performance ChecksIn previous posts we had a bit of game going to develop the fastest Random Character generator.  To test the speed, we used a little known function called getTickCount().This returns the current execution time.  So to get an overall execution time, simply wrap your code with two variables that are equal to getTickCount before and after execution and subtract </summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/10900335'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/10900335'/><link rel='alternate' type='text/html' href='http://cfcode.blogspot.com/2002_03_01_archive.html#10900335' title=''/><author><name>mmmbeer</name><uri>http://www.blogger.com/profile/08832575945852262638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-3332201.post-10898002</id><published>2002-03-19T07:29:00.000-08:00</published><updated>2002-03-19T07:30:27.000-08:00</updated><title type='text'></title><summary type='text'>Returning ONLY Files from a DirectoryCFDIRECTORY is nice if you need to list the entire contents of a directory or a single file type (using the filter parameter), but it is slightly more difficult to perform more complicated requests.The following code snippet will print out ONLY files (with extensions) and ignores directories:&lt;cfdirectory action="LIST" directory="#GetDirectoryFromPath(</summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/10898002'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/10898002'/><link rel='alternate' type='text/html' href='http://cfcode.blogspot.com/2002_03_01_archive.html#10898002' title=''/><author><name>mmmbeer</name><uri>http://www.blogger.com/profile/08832575945852262638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-3332201.post-10862355</id><published>2002-03-18T09:06:00.000-08:00</published><updated>2002-03-18T09:10:12.000-08:00</updated><title type='text'></title><summary type='text'>Return the First N items in a listThis is a quick solutions to a problem heff_neil posed.  Basically, it returns the first N items from a list given the list, the delimiter, and the number of items:&lt;cfscript&gt;function getFirstNItems(list, delimiter, count){    if (count LTE 0) return "";    if (count GT ListLen(list, delimiter))        return list;    else{        tempPos = 1;        for </summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/10862355'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/10862355'/><link rel='alternate' type='text/html' href='http://cfcode.blogspot.com/2002_03_01_archive.html#10862355' title=''/><author><name>mmmbeer</name><uri>http://www.blogger.com/profile/08832575945852262638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-3332201.post-10777241</id><published>2002-03-15T14:16:00.000-08:00</published><updated>2002-03-15T14:16:01.556-08:00</updated><title type='text'></title><summary type='text'>More Speed Posts The question was posed, how to concat three variables with strings between them.So I used this opportunity to test the two methods.  Here's the situation: turn var1, var2, var3 (where these are variables)  into --- var1.var2.var3There are two standard solutions:&lt;cfset new_var= "#var1#.#var2#.#var3#"&gt;and&lt;cfset new_var=  var1 &amp; "." &amp; var2 &amp; "." &amp; var3&gt;Both solutions, in a </summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/10777241'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/10777241'/><link rel='alternate' type='text/html' href='http://cfcode.blogspot.com/2002_03_01_archive.html#10777241' title=''/><author><name>mmmbeer</name><uri>http://www.blogger.com/profile/08832575945852262638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-3332201.post-10769050</id><published>2002-03-15T09:53:00.000-08:00</published><updated>2002-03-15T11:27:22.000-08:00</updated><title type='text'></title><summary type='text'>Even Faster Random Character GeneratorBjornicle had to go and beat my code for speed, but his code is alittle bit longer and required typing in all of the characters.&lt;cfscript&gt;    letters = arraynew(1);    letters[1] = "1"; letters[2] = "2"; letters[3] = "3"; letters[4] = "4"; letters[5] = "5"; letters[6] = "6";     letters[7] = "7"; letters[8] = "8"; letters[9] = "9";letters[10] = "0";</summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/10769050'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/10769050'/><link rel='alternate' type='text/html' href='http://cfcode.blogspot.com/2002_03_01_archive.html#10769050' title=''/><author><name>mmmbeer</name><uri>http://www.blogger.com/profile/08832575945852262638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-3332201.post-10764887</id><published>2002-03-15T07:33:00.000-08:00</published><updated>2002-03-15T09:21:45.000-08:00</updated><title type='text'></title><summary type='text'>Random Character Generator UpdateWith a new insight, I have created a Random Character generator that is about 20% faster and allows for equally probable number, upper, or lowercase character.&lt;cfscript&gt;    function randomChar(){        var temp =  RandRange(500,10000);        switch(temp MOD 3){            case(0): return Chr((temp MOD 10) + 48); break;            case(1): return Chr((temp</summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/10764887'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/10764887'/><link rel='alternate' type='text/html' href='http://cfcode.blogspot.com/2002_03_01_archive.html#10764887' title=''/><author><name>mmmbeer</name><uri>http://www.blogger.com/profile/08832575945852262638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-3332201.post-10761416</id><published>2002-03-15T05:23:00.000-08:00</published><updated>2002-03-15T05:24:16.000-08:00</updated><title type='text'></title><summary type='text'>Creating a Random CharacterGenerating random numbers is easy with ColdFusion.  You can simply use RandRange(a, b) to get a number in a range.It is equally simple to create a random character.  The trick is to use the ASCII character table.The following code example will return a random UPPERCASE letter:&lt;cfset randomChar = chr(randrange(65,90))&gt;This code will do the same for lowercase:&lt;</summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/10761416'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/10761416'/><link rel='alternate' type='text/html' href='http://cfcode.blogspot.com/2002_03_01_archive.html#10761416' title=''/><author><name>mmmbeer</name><uri>http://www.blogger.com/profile/08832575945852262638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-3332201.post-10694225</id><published>2002-03-13T07:30:00.000-08:00</published><updated>2003-07-18T06:54:05.330-07:00</updated><title type='text'></title><summary type='text'>Random Records in SQL onlyEach of the major database systems have their own peculiarities.  This is true for the retrieving a "random record" problem.Instead of going through and explaining them myself, I have linked them.Oracle: Getting a Random Sample of RecordsMSSql: How to select a random record in mssql ?select top 1 * from banners order by newid() Access: How to select a random </summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/10694225'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/10694225'/><link rel='alternate' type='text/html' href='http://cfcode.blogspot.com/2002_03_01_archive.html#10694225' title=''/><author><name>mmmbeer</name><uri>http://www.blogger.com/profile/08832575945852262638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-3332201.post-10105607</id><published>2002-02-25T08:38:00.000-08:00</published><updated>2002-02-25T08:38:41.460-08:00</updated><title type='text'></title><summary type='text'>Concatting Database Fields in SQL rather than ColdFusionIt is sometimes beneficial to concatenate several columns together to make them more useful and efficient.The example posed on #coldfusion was in reference to an address.  The idea was that the only reason for the address, on this page, was for displaying "city, state zipcode." So rather than getting all three fields, like this:   SELECT </summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/10105607'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/10105607'/><link rel='alternate' type='text/html' href='http://cfcode.blogspot.com/2002_02_01_archive.html#10105607' title=''/><author><name>mmmbeer</name><uri>http://www.blogger.com/profile/08832575945852262638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-3332201.post-10014073</id><published>2002-02-22T12:34:00.000-08:00</published><updated>2002-02-22T12:34:53.533-08:00</updated><title type='text'></title><summary type='text'>Manipulating Dynamic VariablesA frequently asked question is how to manipulate dynamic variables.  First, there are several ways to do it:To print the content of a dynamic variables var1, var2, ..., var50 you could do the following:&lt;cfoutput&gt;     &lt;cfloop from="1" to="50" index="i"&gt;          #Evaluate("var#i#")#     &lt;/cfloop&gt;&lt;/cfoutput&gt;Another method, if you were trying to set the same </summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/10014073'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/10014073'/><link rel='alternate' type='text/html' href='http://cfcode.blogspot.com/2002_02_01_archive.html#10014073' title=''/><author><name>mmmbeer</name><uri>http://www.blogger.com/profile/08832575945852262638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-3332201.post-9851070</id><published>2002-02-18T09:20:00.000-08:00</published><updated>2002-02-19T13:16:11.000-08:00</updated><title type='text'></title><summary type='text'>Looping Over Queries in CFSCRIPTCFSCRIPT has a different looping structure and therefore it may be necessary to change how you perform your outputs.Consider this:&lt;cfscript&gt;	for(i=1; i LTE qryName.RecordCount; i=i+1) {		qryName.columnName[i];		}&lt;/cfscript&gt;</summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/9851070'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/9851070'/><link rel='alternate' type='text/html' href='http://cfcode.blogspot.com/2002_02_01_archive.html#9851070' title=''/><author><name>mmmbeer</name><uri>http://www.blogger.com/profile/08832575945852262638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-3332201.post-9690022</id><published>2002-02-13T11:25:00.000-08:00</published><updated>2002-02-13T11:35:40.000-08:00</updated><title type='text'></title><summary type='text'>Accessing particular rows returned from a queryYou can easily access a particular record by utilizing the fact that queries can be handled like queries.For example, to get the 3rd element:&lt;cfoutput&gt;#query.columnname[3]#&lt;/cfoutput&gt;Will print the value contained in the column "columnname" in the third row of the query results.Question answered by workBEER for d9</summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/9690022'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/9690022'/><link rel='alternate' type='text/html' href='http://cfcode.blogspot.com/2002_02_01_archive.html#9690022' title=''/><author><name>mmmbeer</name><uri>http://www.blogger.com/profile/08832575945852262638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-3332201.post-9688239</id><published>2002-02-13T10:31:00.000-08:00</published><updated>2002-02-13T11:08:26.000-08:00</updated><title type='text'></title><summary type='text'>Creating DSNless Database connectionsTwo tutorials teach you how to get access to a database without the traditional DSN.The first is for those that are still using ColdFusion 4.x:Com Object instead of a DSN&lt;cfobject type="COM" name="MyConn" class="ADODB.Connection" action="CREATE"&gt;&lt;CFSCRIPT&gt;DSNtemp = "DRIVER={Microsoft Access Driver (*.mdb)};"; DSNtemp = DSNtemp &amp; "DBQ= d:\data\mydb.mdb"</summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/9688239'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/9688239'/><link rel='alternate' type='text/html' href='http://cfcode.blogspot.com/2002_02_01_archive.html#9688239' title=''/><author><name>mmmbeer</name><uri>http://www.blogger.com/profile/08832575945852262638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-3332201.post-9687705</id><published>2002-02-13T10:14:00.000-08:00</published><updated>2002-02-13T10:54:01.000-08:00</updated><title type='text'></title><summary type='text'>Using SQL IN operatorIf you want to figure out if an id is one of a list of items in SQL, you might initially want to do the following:WHERE item.ID = 1 AND item.ID = 2 AND item.ID = 3 ...However, a drastically simpler method is demostrated by ConqSoft:SELECT * FROM thistable WHERE itemid IN (#comma_seperated_list#)Answered by ConqSoft for foo'</summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/9687705'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/9687705'/><link rel='alternate' type='text/html' href='http://cfcode.blogspot.com/2002_02_01_archive.html#9687705' title=''/><author><name>mmmbeer</name><uri>http://www.blogger.com/profile/08832575945852262638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-3332201.post-9681263</id><published>2002-02-13T06:41:00.000-08:00</published><updated>2002-02-13T10:54:11.000-08:00</updated><title type='text'></title><summary type='text'>Alias your Aggregate SQL functionsWhen you do a:SELECT count(*)FROM    tablenameTo return expected results you may wish to ALIAS the aggregate's column name:SELECT count(*) AS tablecountFROM    tablenameThis will return a query with a column named "tablecount".  A related topic of interest would be GROUP BY.Question answered by djuggler for a question posed by bananachunks</summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/9681263'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/9681263'/><link rel='alternate' type='text/html' href='http://cfcode.blogspot.com/2002_02_01_archive.html#9681263' title=''/><author><name>mmmbeer</name><uri>http://www.blogger.com/profile/08832575945852262638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-3332201.post-9681000</id><published>2002-02-13T06:32:00.000-08:00</published><updated>2002-02-13T10:54:19.000-08:00</updated><title type='text'></title><summary type='text'>CFEXITHow do you quit processing a template or custom tag without ending execution?Normally, &lt;cfabort&gt; is used to end processing, however, this will end all processing.For the above question, &lt;cfexit&gt; will do the trick.  This tag leaves a template or custom tag and returns to the main page to continue processing.Answered more quickly by Snipe, but eventually by Critz and workBEER for a </summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/9681000'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/9681000'/><link rel='alternate' type='text/html' href='http://cfcode.blogspot.com/2002_02_01_archive.html#9681000' title=''/><author><name>mmmbeer</name><uri>http://www.blogger.com/profile/08832575945852262638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-3332201.post-9679703</id><published>2002-02-13T05:41:00.000-08:00</published><updated>2002-02-13T10:54:30.000-08:00</updated><title type='text'></title><summary type='text'>A Better &lt;CFIF&gt; statementThere are several places where shortcuts in coding are available.  Often times these shortcuts amount to faster execution as well.  In the case of the following line of code, both these are true:&lt;cfif comparenocase(variable,"a_substring") IS NOT 0&gt;     Not the same&lt;cfelse&gt;     The same&lt;cfif&gt;ColdFusion resolves false and true to be 0 and anyother number, </summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/9679703'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/9679703'/><link rel='alternate' type='text/html' href='http://cfcode.blogspot.com/2002_02_01_archive.html#9679703' title=''/><author><name>mmmbeer</name><uri>http://www.blogger.com/profile/08832575945852262638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-3332201.post-9679483</id><published>2002-02-13T05:30:00.000-08:00</published><updated>2002-02-13T05:30:30.436-08:00</updated><title type='text'></title><summary type='text'>Using Anchors and URL parametersThe proper way to combine both is to pass the URL parameters and then attach the anchor.  For example:http://127.0.0.1/testtemplate.cfm?page=4#a_testAnswered by mmmBEER &amp; bananachunks for a question posed by null</summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/9679483'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/9679483'/><link rel='alternate' type='text/html' href='http://cfcode.blogspot.com/2002_02_01_archive.html#9679483' title=''/><author><name>mmmbeer</name><uri>http://www.blogger.com/profile/08832575945852262638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-3332201.post-9653447</id><published>2002-02-12T12:32:00.000-08:00</published><updated>2002-02-13T07:47:13.000-08:00</updated><title type='text'></title><summary type='text'>Obtaining NT username from someone logged inal-x: is there any way to pull the NT username somebody is logged in as using coldfusion?example: i'm logged in as "alex" through windows networking logonConqsoft:#CGI.AUTH_USER# is in the form DOMAIN\USERIDTo return the USERID use the following:&lt;cfset request.lanuserid = listlast(cgi.auth_user, "\")&gt;</summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/9653447'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/9653447'/><link rel='alternate' type='text/html' href='http://cfcode.blogspot.com/2002_02_01_archive.html#9653447' title=''/><author><name>mmmbeer</name><uri>http://www.blogger.com/profile/08832575945852262638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-3332201.post-9652776</id><published>2002-02-12T12:13:00.000-08:00</published><updated>2002-02-12T12:18:15.000-08:00</updated><title type='text'></title><summary type='text'>Overly complicated solution for adding all the values from checkboxes into a QUERY&lt;CFQUERY name="PatientsNoOrders" datasource="#application.datasrc#"&gt;SELECT DISTINCT &lt;CFLOOP index="x" from="1" to="#Evaluate(ListLen(url.criteria)-1)#"&gt;                                            #SetVariable("temp", "p." &amp; ListGetAt(criteria, x) &amp; ",")#                            &lt;/CFLOOP&gt;</summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/9652776'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3332201/posts/default/9652776'/><link rel='alternate' type='text/html' href='http://cfcode.blogspot.com/2002_02_01_archive.html#9652776' title=''/><author><name>mmmbeer</name><uri>http://www.blogger.com/profile/08832575945852262638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry></feed>
