<?xml version="1.0" encoding="UTF-8" standalone="no"?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:blogger="http://schemas.google.com/blogger/2008" xmlns:gd="http://schemas.google.com/g/2005" xmlns:georss="http://www.georss.org/georss" xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/" xmlns:thr="http://purl.org/syndication/thread/1.0"><id>tag:blogger.com,1999:blog-6650413229535480271</id><updated>2024-10-06T20:25:43.244-07:00</updated><category term="coldfusion"/><category term="server management"/><category term="cfcs"/><category term="functions"/><category term="sql"/><category term="application"/><category term="bugs"/><category term="cfscript"/><category term="couchdb"/><category term="db4o"/><category term="email"/><category term="oodb"/><category term="open-source"/><category term="undocumented"/><title type="text">Coldfusion by Russ &lt;CFRuss&gt;</title><subtitle type="html"/><link href="http://cfruss.blogspot.com/feeds/posts/default" rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"/><link href="http://www.blogger.com/feeds/6650413229535480271/posts/default?redirect=false" rel="self" type="application/atom+xml"/><link href="http://cfruss.blogspot.com/" rel="alternate" type="text/html"/><link href="http://pubsubhubbub.appspot.com/" rel="hub"/><author><name>Russ</name><uri>http://www.blogger.com/profile/10235704663975985613</uri><email>noreply@blogger.com</email><gd:image height="16" rel="http://schemas.google.com/g/2005#thumbnail" src="https://img1.blogblog.com/img/b16-rounded.gif" width="16"/></author><generator uri="http://www.blogger.com" version="7.00">Blogger</generator><openSearch:totalResults>22</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-6650413229535480271.post-3153302860423316353</id><published>2013-01-12T02:05:00.000-08:00</published><updated>2013-01-12T02:05:12.659-08:00</updated><title type="text">Yeah, I'm lazy</title><content type="html">I'm starting to realize that I have a different perspective on programming than a lot of other developers.&lt;br /&gt;
&lt;br /&gt;
tl;dr I'm lazy and open minded. &lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;I prefer GUI interfaces to command-line utilities.&amp;nbsp;&lt;/li&gt;
&lt;li&gt;I like IDEs.&amp;nbsp;&lt;/li&gt;
&lt;li&gt;I think every OS has certain useful qualities, so I don't blindly use only one.&lt;/li&gt;
&lt;li&gt;I use layers of abstraction to make my life easier. &lt;/li&gt;
&lt;li&gt;I really like learning new things, but I don't want to put in the time to learn the detailed intricacies of some language or framework. When I need to know something in particular, I'll research it then. &lt;/li&gt;
&lt;li&gt;I am willing to sacrifice some performance for code that is easier to understand.&lt;/li&gt;
&lt;li&gt;I don't think that language X is the best language ever.&lt;/li&gt;
&lt;li&gt;I don't think that language Y is totally useless, either.&amp;nbsp;&lt;/li&gt;
&lt;li&gt;I try to keep an open mind about new ideas in programming. I don't think that there is only one right way to do something and that there will never be a better way.&lt;/li&gt;
&lt;li&gt;I genuinely appreciate every contribution to my open source works, and never berate others for offering their contributions. &lt;/li&gt;
&lt;li&gt;I don't denigrate other developers who have different opinions than I do. Just because we disagree doesn't mean that I am better than they are.&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
I've always known these things about myself, but I just realized tonight how different my views are from some other developers out there. &lt;br /&gt;
&lt;br /&gt;
Now, being open minded doesn't mean that I don't have my own strong opinions, it just means that I'm happy to listen to another's point of view-- as long as they're not being pretentious.&lt;div class="blogger-post-footer"&gt;Content provided by: &lt;a href="http://cfruss.blogspot.com/"&gt;cfruss.blogspot.com&lt;/a&gt;&lt;/div&gt;</content><link href="http://cfruss.blogspot.com/feeds/3153302860423316353/comments/default" rel="replies" title="Post Comments" type="application/atom+xml"/><link href="http://www.blogger.com/comment/fullpage/post/6650413229535480271/3153302860423316353" rel="replies" title="3 Comments" type="text/html"/><link href="http://www.blogger.com/feeds/6650413229535480271/posts/default/3153302860423316353" rel="edit" type="application/atom+xml"/><link href="http://www.blogger.com/feeds/6650413229535480271/posts/default/3153302860423316353" rel="self" type="application/atom+xml"/><link href="http://cfruss.blogspot.com/2013/01/yeah-im-lazy.html" rel="alternate" title="Yeah, I'm lazy" type="text/html"/><author><name>Russ</name><uri>http://www.blogger.com/profile/10235704663975985613</uri><email>noreply@blogger.com</email><gd:image height="16" rel="http://schemas.google.com/g/2005#thumbnail" src="https://img1.blogblog.com/img/b16-rounded.gif" width="16"/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6650413229535480271.post-2539579991502541549</id><published>2013-01-03T02:27:00.000-08:00</published><updated>2013-01-03T02:27:16.533-08:00</updated><title type="text">Convert a Coldfusion collection to an XML object</title><content type="html">I've just pushed an addition to &lt;a href="http://russplaysguitar.github.com/UnderscoreCF/"&gt;Underscore.cfc&lt;/a&gt; that allows you to easily convert a Coldfusion collection (array, struct, object, or query) to an XML object: &lt;span style="font-family: Courier New, Courier, monospace;"&gt;_.toXml(collection, [*elementNames])&lt;/span&gt; &lt;br /&gt;
&lt;br /&gt;
As far as I can tell, conversion to XML isn't something that most people do very often in CFML, but usually it involves a lot of custom code in order to get it into the right format. If you just need some basic XML, though, it's irritating that there isn't a simple way to generate simple XML. Well, now there is! Here is a basic example:&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;_.toXml([1, 2]);&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;=&amp;gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&amp;lt;array&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&amp;nbsp; &amp;lt;element&amp;gt;1&amp;lt;/element&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&amp;nbsp; &amp;lt;element&amp;gt;2&amp;lt;/element&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&amp;lt;/array&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
That's pretty easy, huh? How about a struct:&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;_.toXml({nice: 'one'});&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;=&amp;gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&amp;lt;struct&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&amp;nbsp; &amp;lt;nice&amp;gt;one&amp;lt;/nice&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&amp;lt;/struct&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
To provide custom element names, just pass in the names after the collection in the parameters, like so:&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;_.toXml([['Nested Array Item'], 'First Level Item'], 'Levels', 'levelOne', 'levelTwo');&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;=&amp;gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&lt;span style="font-family: Courier New, Courier, monospace;"&gt;Levels&lt;/span&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&amp;nbsp; &amp;lt;levelOne&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;lt;levelTwo&amp;gt;&lt;/span&gt;&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&lt;span style="font-family: Courier New, Courier, monospace;"&gt;Nested Array&lt;/span&gt; Item&amp;lt;/levelTwo&amp;gt; &lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&amp;nbsp; &amp;lt;/&lt;/span&gt;&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&lt;span style="font-family: Courier New, Courier, monospace;"&gt;levelOne&lt;/span&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&lt;span style="font-family: Courier New, Courier, monospace;"&gt;levelOne&lt;/span&gt;&amp;gt;&lt;/span&gt;&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&lt;span style="font-family: Courier New, Courier, monospace;"&gt;First Level Item&lt;/span&gt;&amp;lt;/&lt;/span&gt;&lt;span style="font-family: Courier New, Courier, monospace;"&gt;levelOne&lt;/span&gt;&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="font-family: Courier New, Courier, monospace;"&gt;Levels&lt;/span&gt;&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
You can see in the example above that the element names were applied to all unnamed elements for each level.&amp;nbsp; &lt;br /&gt;
&lt;br /&gt;
And that's not all!&amp;nbsp; _.&lt;span style="font-family: Courier New, Courier, monospace;"&gt;toXml() &lt;/span&gt;will also convert a query or an object to XML. Speaking of objects, one nifty feature is that any values of the collection that are functions will be invoked and their result added to the XML. Example:&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;_.toXml({myFunc: function () { return 'result'; } });&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;=&amp;gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&amp;lt;struct&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&lt;span style="font-family: Courier New, Courier, monospace;"&gt;myFunc&lt;/span&gt;&amp;gt;&lt;/span&gt;&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&lt;span style="font-family: Courier New, Courier, monospace;"&gt;result&lt;/span&gt;&amp;lt;/&lt;/span&gt;&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&lt;span style="font-family: Courier New, Courier, monospace;"&gt;myFunc&lt;/span&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&amp;lt;/struct&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
I'm pretty happy with how this new function turned out. It will be available in version 2.4 of Underscore.cfc, but you can try it out now by grabbing the latest &lt;a href="https://github.com/russplaysguitar/underscorecf"&gt;development source on GitHub&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;Content provided by: &lt;a href="http://cfruss.blogspot.com/"&gt;cfruss.blogspot.com&lt;/a&gt;&lt;/div&gt;</content><link href="http://cfruss.blogspot.com/feeds/2539579991502541549/comments/default" rel="replies" title="Post Comments" type="application/atom+xml"/><link href="http://www.blogger.com/comment/fullpage/post/6650413229535480271/2539579991502541549" rel="replies" title="0 Comments" type="text/html"/><link href="http://www.blogger.com/feeds/6650413229535480271/posts/default/2539579991502541549" rel="edit" type="application/atom+xml"/><link href="http://www.blogger.com/feeds/6650413229535480271/posts/default/2539579991502541549" rel="self" type="application/atom+xml"/><link href="http://cfruss.blogspot.com/2013/01/convert-coldfusion-collection-to-xml.html" rel="alternate" title="Convert a Coldfusion collection to an XML object" type="text/html"/><author><name>Russ</name><uri>http://www.blogger.com/profile/10235704663975985613</uri><email>noreply@blogger.com</email><gd:image height="16" rel="http://schemas.google.com/g/2005#thumbnail" src="https://img1.blogblog.com/img/b16-rounded.gif" width="16"/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6650413229535480271.post-6363450537692666633</id><published>2012-12-22T02:45:00.000-08:00</published><updated>2012-12-22T02:45:56.953-08:00</updated><title type="text">_.toQuery(arrayOfStructs)</title><content type="html">I'm pleased to announce the latest addition to Underscore.cfc: &lt;span style="font-family: Courier New, Courier, monospace;"&gt;toQuery(arrayOfStructs, [columnNames], [columnTypes])&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
This new method does exactly what you'd expect it to: it converts an array of structs to a query in Coldfusion.&lt;br /&gt;
&lt;br /&gt;
But wait, doesn't the native&amp;nbsp;&lt;span style="font-family: Courier New, Courier, monospace;"&gt;QueryNew()&lt;/span&gt;&amp;nbsp;function already do that? Indeed! Here is an example:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;QueryNew(&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp;"firstCol, secondCol",&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp;"varchar, varchar",&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp;[{firstCol: "first value", secondCol: "second value"}]&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;);&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
While this is totally useful, what if you want to use&amp;nbsp;&lt;span style="font-family: Courier New, Courier, monospace;"&gt;QueryNew()&lt;/span&gt;&lt;span style="font-family: Times, Times New Roman, serif;"&gt;to create a query from an array of structs without knowing the column names and types beforehand?&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
With _.&lt;span style="font-family: Courier New, Courier, monospace;"&gt;toQuery()&lt;/span&gt;, you can now perform the conversion in a simpler way, without determining the column names or types:&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;_.toQuery([&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp;{firstCol: "first value", secondCol: "second value"}&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Courier New, Courier, monospace;"&gt;]);&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Nice and easy.&amp;nbsp;If some structs have more keys than others, it supports that, too.&lt;br /&gt;
&lt;br /&gt;
It delegates to &lt;span style="font-family: Courier New, Courier, monospace;"&gt;QueryNew()&lt;/span&gt; under the hood, but it does iterate the array once to build the list of column names.&amp;nbsp;Optionally, you can supply a list of column names which it will use instead of dynamically determining them. If you pass in a list of column types, it will forward that to &lt;span style="font-family: Courier New, Courier, monospace;"&gt;QueryNew()&lt;/span&gt;, too.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
This will be released as part of Underscore.cfc version 2.4 within the next couple of months, but you can download the bleeding-edge version from github and use it now if you'd like: &lt;a href="https://github.com/russplaysguitar/underscorecf" target="_blank"&gt;UnderscoreCF&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="blogger-post-footer"&gt;Content provided by: &lt;a href="http://cfruss.blogspot.com/"&gt;cfruss.blogspot.com&lt;/a&gt;&lt;/div&gt;</content><link href="http://cfruss.blogspot.com/feeds/6363450537692666633/comments/default" rel="replies" title="Post Comments" type="application/atom+xml"/><link href="http://www.blogger.com/comment/fullpage/post/6650413229535480271/6363450537692666633" rel="replies" title="0 Comments" type="text/html"/><link href="http://www.blogger.com/feeds/6650413229535480271/posts/default/6363450537692666633" rel="edit" type="application/atom+xml"/><link href="http://www.blogger.com/feeds/6650413229535480271/posts/default/6363450537692666633" rel="self" type="application/atom+xml"/><link href="http://cfruss.blogspot.com/2012/12/toqueryarrayofstructs.html" rel="alternate" title="_.toQuery(arrayOfStructs)" type="text/html"/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image height="16" rel="http://schemas.google.com/g/2005#thumbnail" src="https://img1.blogblog.com/img/b16-rounded.gif" width="16"/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6650413229535480271.post-8244180030511432501</id><published>2012-08-12T03:11:00.002-07:00</published><updated>2012-08-12T03:15:44.831-07:00</updated><title type="text">Sorting an array of structs with _.sortBy()</title><content type="html">For some reason, sorting an array of non-simple values in Coldfusion is not very easy. Oftentimes, you end up with ugly, one-off solutions that are barely readable, much less maintainable. For this very reason, I'm happy to give you: &lt;a href="http://russplaysguitar.github.com/UnderscoreCF/#sortBy"&gt;_.sortBy()&lt;/a&gt;, part of the &lt;a href="http://russplaysguitar.github.com/UnderscoreCF/"&gt;Underscore.cfc functional programming library&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
_.sortBy() makes sorting complex collections in Coldfusion dead-simple by utilizing CF's new anonymous functions. The method takes two parameters: the collection and the iterator function. The value returned from the iterator is used to sort on, so it must be a string, number, Boolean, or date/time value.&lt;br /&gt;
&lt;br /&gt;
Enough talk! Here are some examples:&lt;br /&gt;
&lt;pre&gt;_ = new Underscore();

// sort by name:
complexArray = [{ Name: 'Xander', IQ: 100 }, { Name: 'Sarah', IQ: 3000 }];
sortedArray = _.sortBy(complexArray, function (obj) { 
 return obj.name;
});
// result: [{ Name: 'Sarah', IQ: 3000 }, { Name: 'Xander', IQ: 100 }]

// sort by array length
multiDimensionalArray = [[1, 2], [1], [1, 2, 3]];
sortedArray = _.sortBy(multiDimensionalArray, function (subArray) {
 return arrayLen(subArray);
});
// result: [[1], [1, 2], [1, 2, 3]]
&lt;/pre&gt;
&lt;br /&gt;
_.sortBy() doesn't modify the original collection-- it returns a new one. It utilizes&amp;nbsp;&lt;a href="http://russplaysguitar.github.com/UnderscoreCF/#map"&gt;_.map()&lt;/a&gt; and CF's native arraySort() under the covers, so it should be just as fast as native array sorting (which I expect has a &lt;a href="http://en.wikipedia.org/wiki/Time_complexity#Table_of_common_time_complexities"&gt;linear time complexity&lt;/a&gt;). The minimum requirements are Coldfusion 10 or Railo 4.&lt;br /&gt;
&lt;br /&gt;
As a bonus, _.sortBy() also works on every other type of Coldfusion collection: structures, queries, xml, and even comma-delimited lists. It will always return a new array though, so for structures you'll get back a value-array, while queries or xmlObjects will result in an array of structs.&lt;br /&gt;
&lt;br /&gt;
I hope that this new sorting method saves you some headaches and helps you make your code more elegant.&lt;br /&gt;
&lt;br /&gt;
I encourage you to browse the numerous other features of &lt;a href="http://russplaysguitar.github.com/UnderscoreCF/"&gt;Underscore.cfc&lt;/a&gt; and to contribute if you feel so inclined. Bug reports and enhancement requests are welcome. This project is &lt;a href="https://github.com/russplaysguitar/underscorecf"&gt;hosted on GitHub&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;Content provided by: &lt;a href="http://cfruss.blogspot.com/"&gt;cfruss.blogspot.com&lt;/a&gt;&lt;/div&gt;</content><link href="http://cfruss.blogspot.com/feeds/8244180030511432501/comments/default" rel="replies" title="Post Comments" type="application/atom+xml"/><link href="http://www.blogger.com/comment/fullpage/post/6650413229535480271/8244180030511432501" rel="replies" title="0 Comments" type="text/html"/><link href="http://www.blogger.com/feeds/6650413229535480271/posts/default/8244180030511432501" rel="edit" type="application/atom+xml"/><link href="http://www.blogger.com/feeds/6650413229535480271/posts/default/8244180030511432501" rel="self" type="application/atom+xml"/><link href="http://cfruss.blogspot.com/2012/08/sorting-array-of-structs-with-sortby.html" rel="alternate" title="Sorting an array of structs with _.sortBy()" type="text/html"/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image height="16" rel="http://schemas.google.com/g/2005#thumbnail" src="https://img1.blogblog.com/img/b16-rounded.gif" width="16"/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6650413229535480271.post-3800426463297891470</id><published>2012-07-19T21:27:00.001-07:00</published><updated>2012-07-19T21:27:54.188-07:00</updated><title type="text">In progress: Backbone.cfc (a Backbone.js port for Coldfusion)</title><content type="html">Do we need another Coldfusion framework?&lt;br /&gt;
&lt;br /&gt;
I'm not sure, but I'm writing one anyways: Backbone.cfc&lt;br /&gt;
&lt;br /&gt;
I know, we already have a lot to choose from: CFWheels, FW/1, Farcry, Mach-II, Coldbox, ModelGlue, and many more... but I'm bored this summer and I figure it can't hurt to have one more, so&amp;nbsp;&lt;span style="background-color: white;"&gt;I'm working on a port of Backbone.js for Coldfusion.&lt;/span&gt;&lt;br /&gt;
&lt;blockquote class="tr_bq"&gt;
&lt;span style="background-color: white;"&gt;&lt;i&gt;Backbone.js gives structure to web applications by providing &lt;b&gt;models &lt;/b&gt;with key-value binding and custom events, &lt;b&gt;collections &lt;/b&gt;with a rich API of enumerable functions, &lt;b&gt;views &lt;/b&gt;with declarative event handling, and connects it all to your existing API over a RESTful JSON interface.
&lt;br /&gt;
-- Backbonejs.org
&lt;/i&gt;&lt;/span&gt;&lt;span style="background-color: white;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/blockquote&gt;
Backbone.cfc does the exact same things as described above. It utilizes the &lt;a href="http://russplaysguitar.github.com/UnderscoreCF"&gt;Underscore framework&lt;/a&gt;, providing built-in methods like each(), map(), and filter() for model collections.&lt;br /&gt;
&lt;br /&gt;
&lt;span style="background-color: white;"&gt;Like the Javascript version, Backbone.cfc is a framework without a Controller. Derick Bailey has a great explanation of how Backbone.js fits into existing framework patterns in his blog entry:&amp;nbsp;&lt;/span&gt;&lt;a href="http://lostechies.com/derickbailey/2011/12/23/backbone-js-is-not-an-mvc-framework/" style="background-color: white;"&gt;Backbone.js Is Not An MVC Framework&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
If you're familiar with Backbone.js, then you're probably thinking, "What about Backbone Views?", and rightly so. One of the best things about Backbone.js is that it automatically updates your Views live in the browser anytime your Models change. Obviously, this is impossible with a server-side languages like Coldfusion. So although Backbone.cfc &amp;nbsp;supports Views, changes must still be sent to the client via HTTP.&lt;br /&gt;
&lt;br /&gt;
One of my primary motivations for writing this framework is to become more familiar with Backbone.js. I use it a lot for other projects, so writing a port seemed like a great way to learn more about it.&lt;br /&gt;
&lt;br /&gt;
I think that Backbone.cfc will be a framework that is easy for anyone with Backbone.js experience to jump into. People with existing REST services that want a framework to leverage them in Coldfusion may also find the project particularly useful.&lt;br /&gt;
&lt;br /&gt;
So now the bad news... I haven't written any documentation for this yet and it is still very much in progress. If you'd like to see what I've got so far (and maybe contribute?), head on over to the &lt;a href="https://github.com/russplaysguitar/BackboneCF"&gt;BackboneCF repository on GitHub&lt;/a&gt;. I hope to have it mostly done by the end of summer, though.&lt;div class="blogger-post-footer"&gt;Content provided by: &lt;a href="http://cfruss.blogspot.com/"&gt;cfruss.blogspot.com&lt;/a&gt;&lt;/div&gt;</content><link href="http://cfruss.blogspot.com/feeds/3800426463297891470/comments/default" rel="replies" title="Post Comments" type="application/atom+xml"/><link href="http://www.blogger.com/comment/fullpage/post/6650413229535480271/3800426463297891470" rel="replies" title="0 Comments" type="text/html"/><link href="http://www.blogger.com/feeds/6650413229535480271/posts/default/3800426463297891470" rel="edit" type="application/atom+xml"/><link href="http://www.blogger.com/feeds/6650413229535480271/posts/default/3800426463297891470" rel="self" type="application/atom+xml"/><link href="http://cfruss.blogspot.com/2012/07/in-progress-backbonecfc-backbonejs-port.html" rel="alternate" title="In progress: Backbone.cfc (a Backbone.js port for Coldfusion)" type="text/html"/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image height="16" rel="http://schemas.google.com/g/2005#thumbnail" src="https://img1.blogblog.com/img/b16-rounded.gif" width="16"/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6650413229535480271.post-7994829099264786396</id><published>2012-07-04T03:17:00.003-07:00</published><updated>2012-07-04T03:51:56.495-07:00</updated><title type="text">Underscore.cfc v2.0 -- now with Railo support!</title><content type="html">I hadn't planned on releasing a 2nd version of &lt;a href="http://russplaysguitar.github.com/UnderscoreCF/"&gt;Underscore.cfc&lt;/a&gt; so fast, but I had to make some breaking changes in order to get it compatible with Railo 4 (beta).&lt;span style="background-color: white;"&gt;The big change is in the way that context is handled. Previously, you could reference the "this" context if you had passed in a context variable. You can still do this, but you must explicitly specify a name for the context in the iterator's parameters. For instance:&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre style="background-color: #f4f4f4; border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 5px; font-family: Monaco, Consolas, 'Lucida Console', monospace; font-size: 12px; line-height: 18px; margin-bottom: 30px; padding: 2px 0px 2px 15px;"&gt;_.map([1, 2, 3], function(num, index, array, this) { return(num + this.contextVar); }, {contextVar: 3}); 
=&amp;gt; [4, 5, 6]
&lt;/pre&gt;
This is a bit of a break from the original Underscore.js library, but it was necessary-- and I think is a better solution for Coldfusion anyways.&lt;br /&gt;
&lt;br /&gt;
Other changes include: removal of erroneous debugging info and updates to the unit tests, since Railo and Adobe CF don't always agree on types and struct element order.&lt;br /&gt;
&lt;br /&gt;
I'm happy that Railo has caught up to Adobe on closures, since that was obviously a pre-requisite for this library to function. Way to go Railo!&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;More about Underscore.cfc...&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
One of the features in Underscore.cfc that I'm particularly pleased with is &lt;a href="http://russplaysguitar.github.com/UnderscoreCF/#memoize"&gt;memoize()&lt;/a&gt;. If you're not familiar with it, memoize (not to be confused with memorize) allows you to significantly improve the performance of some recursive functions. Good candidates for memoize are functions in which the next result is based upon one or more calls to the same function.&lt;br /&gt;
&lt;br /&gt;
&lt;pre style="background-color: #f4f4f4; border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 5px; font-family: Monaco, Consolas, 'Lucida Console', monospace; font-size: 12px; line-height: 18px; margin-bottom: 30px; padding: 2px 0px 2px 15px;"&gt;fibonacci = _.memoize(function(n) {  return n &amp;lt; 2 ? n : fibonacci(n - 1) + fibonacci(n - 2); });&lt;/pre&gt;
&lt;br /&gt;
The example included in the docs (a Fibonacci sequence algorithm) doesn't really do memoize any justice until you try running it and compare it to the original, non-memoized version. There really is no comparison between the two: The original gets progressively slower as you increment the input number, but the memoized version doesn't skip a beat. This is because it does not need to recompute every value in the list-- it saves them in a "memo" array and uses that whenever it is available. In a sense, it is temporarily caching your function results for the duration of the recursive function's execution. (note: if you're going to test this out, start at 20 and work your way up slowly or else your computer might take a long time to process).&lt;br /&gt;
&lt;br /&gt;
Memoize is just one of the 60+ closure-style functions in the &lt;a href="http://russplaysguitar.github.com/UnderscoreCF/"&gt;Underscore.cfc library&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;Content provided by: &lt;a href="http://cfruss.blogspot.com/"&gt;cfruss.blogspot.com&lt;/a&gt;&lt;/div&gt;</content><link href="http://cfruss.blogspot.com/feeds/7994829099264786396/comments/default" rel="replies" title="Post Comments" type="application/atom+xml"/><link href="http://www.blogger.com/comment/fullpage/post/6650413229535480271/7994829099264786396" rel="replies" title="0 Comments" type="text/html"/><link href="http://www.blogger.com/feeds/6650413229535480271/posts/default/7994829099264786396" rel="edit" type="application/atom+xml"/><link href="http://www.blogger.com/feeds/6650413229535480271/posts/default/7994829099264786396" rel="self" type="application/atom+xml"/><link href="http://cfruss.blogspot.com/2012/07/underscorecfc-v20-now-with-railo.html" rel="alternate" title="Underscore.cfc v2.0 -- now with Railo support!" type="text/html"/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image height="16" rel="http://schemas.google.com/g/2005#thumbnail" src="https://img1.blogblog.com/img/b16-rounded.gif" width="16"/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6650413229535480271.post-8907020378548090087</id><published>2012-07-01T00:01:00.000-07:00</published><updated>2012-07-01T00:02:40.834-07:00</updated><title type="text">Underscore.cfc v1.0 released</title><content type="html">&lt;div&gt;
Functional programming in Coldfusion? Yes, please!&lt;/div&gt;
&lt;div&gt;
&lt;span style="background-color: white;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
I'm pleased to announce the release of version 1.0 of Underscore.cfc:&amp;nbsp;&lt;a href="http://russplaysguitar.github.com/UnderscoreCF/"&gt;http://russplaysguitar.github.com/UnderscoreCF/&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="background-color: white;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="background-color: white;"&gt;Underscore.cfc is a code library that makes use of Coldfusion 10's new closures and anonymous functions. It is similar to&amp;nbsp;&lt;a href="https://github.com/markmandel/Sesame"&gt;Sesame&lt;/a&gt;&amp;nbsp;but includes a ton of other functions that &lt;a href="http://underscorejs.org/"&gt;Underscore.js &lt;/a&gt;has. In total, it contains 66 functions, grouped into five categories: Collection functions, array functions, object functions, function functions, and utility functions.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="background-color: white;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
One key feature that it has is the ability to provide a context object for the iteration functions.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;span style="background-color: white;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="background-color: white;"&gt;A few of the most useful functions are:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;Map&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;pre style="background-color: #f4f4f4; border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 5px; font-family: Monaco, Consolas, 'Lucida Console', monospace; font-size: 12px; line-height: 18px; margin-bottom: 30px; padding: 2px 0px 2px 15px;"&gt;_.map([1, 2, 3], function(num){ return num * 3; }); 
=&amp;gt; [3, 6, 9] 
_.map({one : 1, two : 2, three : 3}, function(num, key){ return num * 3; });
=&amp;gt; [3, 6, 9]&lt;/pre&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style="background-color: white;"&gt;&lt;b&gt;Reduce&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;pre style="background-color: #f4f4f4; border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 5px; font-family: Monaco, Consolas, 'Lucida Console', monospace; font-size: 12px; line-height: 18px; margin-bottom: 30px; padding: 2px 0px 2px 15px;"&gt;sum = _.reduce([1, 2, 3], function(memo, num){ return memo + num; }, 0);
=&amp;gt; 6&lt;/pre&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style="background-color: white;"&gt;&lt;b&gt;Filter&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;pre style="background-color: #f4f4f4; border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 5px; font-family: Monaco, Consolas, 'Lucida Console', monospace; font-size: 12px; line-height: 18px; margin-bottom: 30px; padding: 2px 0px 2px 15px;"&gt;evens = _.filter([1, 2, 3, 4, 5, 6], function(num){ return num % 2 == 0; });
=&amp;gt; [2, 4, 6]&lt;/pre&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style="background-color: white;"&gt;The collection functions allow you to pass in arrays, structs, queries, or objects, which is pretty cool.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="background-color: white;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="background-color: white;"&gt;So why did I bother writing this? After using Underscore.js a lot, I noticed that although there were ports of it in various other languages, no one had written a port of it for Coldfusion. Although I haven't used CF much in the past year or so, I felt like it would be fun to write. I was right: I learned a lot about functional programming, javascript, and Coldfusion 10's new features.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="background-color: white;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="background-color: white;"&gt;I hope that this library makes Coldfusion a little more enjoyable for people to write!&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;Content provided by: &lt;a href="http://cfruss.blogspot.com/"&gt;cfruss.blogspot.com&lt;/a&gt;&lt;/div&gt;</content><link href="http://cfruss.blogspot.com/feeds/8907020378548090087/comments/default" rel="replies" title="Post Comments" type="application/atom+xml"/><link href="http://www.blogger.com/comment/fullpage/post/6650413229535480271/8907020378548090087" rel="replies" title="1 Comments" type="text/html"/><link href="http://www.blogger.com/feeds/6650413229535480271/posts/default/8907020378548090087" rel="edit" type="application/atom+xml"/><link href="http://www.blogger.com/feeds/6650413229535480271/posts/default/8907020378548090087" rel="self" type="application/atom+xml"/><link href="http://cfruss.blogspot.com/2012/07/underscorecfc-v10-released.html" rel="alternate" title="Underscore.cfc v1.0 released" type="text/html"/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image height="16" rel="http://schemas.google.com/g/2005#thumbnail" src="https://img1.blogblog.com/img/b16-rounded.gif" width="16"/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6650413229535480271.post-3862663908068338479</id><published>2009-11-29T20:15:00.000-08:00</published><updated>2010-01-18T19:07:32.640-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="application"/><category scheme="http://www.blogger.com/atom/ns#" term="cfcs"/><category scheme="http://www.blogger.com/atom/ns#" term="cfscript"/><category scheme="http://www.blogger.com/atom/ns#" term="coldfusion"/><title type="text">Application.cfc Reference in CFScript for Coldfusion 9</title><content type="html">One of Coldfusion 9's features is the ability to define components entirely within CFScript. I was looking around for an example of Application.cfc in CFScript, and I couldn't find it. So I've compiled it for you here. It includes all available methods and application variables. (If you find something I've missed, let me know!)&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
- The ordering of variables and methods matches Adobe's documentation.&lt;br /&gt;
- Descriptions are from Adobe.&lt;br /&gt;
- Variables are set to CF defaults.&lt;br /&gt;
- onRequest, onError, and onMisingTemplate are commented out because they can mess with your application if you don't implement them properly.&lt;br /&gt;
- You do not need to enclose this within cfscript tags.&lt;br /&gt;
&lt;br /&gt;
Application.cfc:&lt;br /&gt;
&lt;pre style="border: 1px solid black; padding: 4px; overflow: scroll; display: block; height:500px; font-size:12px;"&gt;&lt;span style="color: rgb(68, 68, 68); width:2100px; display:block;"&gt;&lt;i&gt;/**
@title "Application.cfc reference in CFScript for Coldfusion 9"
@description "This component includes all Application.cfc methods and variables, set to their default values (if applicable). Please note that default values are not always desirable, and some methods or variables should be modified or removed depending on the situation."
@author "Russ S. (http://cfruss.blogspot.com)"

@dateCreated "November 29, 2009"
@licence "This work is licensed under the Creative Commons Attribution 3.0 United States License. To view a copy of this license, visit http://creativecommons.org/licenses/by/3.0/us/ or send a letter to Creative Commons, 171 Second Street, Suite 300, San Francisco, California, 94105, USA."

@hint "You implement methods in Application.cfc to handle ColdFusion application events and set variables in the CFC to configure application characteristics."
*/&lt;/i&gt;&lt;/span&gt;

&lt;span style="color: rgb(32, 64, 160);"&gt;component&lt;/span&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;output&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;"false"&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;{&lt;/strong&gt;&lt;/span&gt;

&lt;span style="color: rgb(68, 68, 68);"&gt;/* **************************** APPLICATION VARIABLES **************************** */&lt;/span&gt;

&lt;span style="color: rgb(68, 68, 68);"&gt;// The application name. If you do not set this variable, or set it to the empty string, your CFC applies to the unnamed application scope, which is the ColdFusion J2EE servlet context.&lt;/span&gt;
&lt;span style="color: rgb(32, 64, 160);"&gt;THIS&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;name&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;=&lt;/span&gt; &lt;span style="color: rgb(0, 128, 0);"&gt;""&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;

&lt;span style="color: rgb(68, 68, 68);"&gt;// Life span, as a real number of days, of the application, including all Application scope variables.&lt;/span&gt;
&lt;span style="color: rgb(32, 64, 160);"&gt;THIS&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;applicationTimeout&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;=&lt;/span&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;createTimeSpan&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;0&lt;/span&gt;, &lt;span style="color: rgb(255, 0, 0);"&gt;1&lt;/span&gt;, &lt;span style="color: rgb(255, 0, 0);"&gt;0&lt;/span&gt;, &lt;span style="color: rgb(255, 0, 0);"&gt;0&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;

&lt;span style="color: rgb(68, 68, 68);"&gt;// Whether the application supports Client scope variables.&lt;/span&gt;
&lt;span style="color: rgb(32, 64, 160);"&gt;THIS&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;clientManagement&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;=&lt;/span&gt; &lt;strong&gt;false&lt;/strong&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;

&lt;span style="color: rgb(68, 68, 68);"&gt;// Where Client variables are stored; can be cookie, registry, or the name of a data source.&lt;/span&gt;
&lt;span style="color: rgb(32, 64, 160);"&gt;THIS&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;clientStorage&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;=&lt;/span&gt; &lt;span style="color: rgb(0, 128, 0);"&gt;"registry"&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt; &lt;span style="color: rgb(68, 68, 68);"&gt;//cookie||registry||datasource&lt;/span&gt;

&lt;span style="color: rgb(68, 68, 68);"&gt;// Contains ColdFusion custom tag paths. &lt;/span&gt;
&lt;span style="color: rgb(32, 64, 160);"&gt;THIS&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;customTagPaths&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;=&lt;/span&gt; &lt;span style="color: rgb(0, 128, 0);"&gt;""&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;

&lt;span style="color: rgb(68, 68, 68);"&gt;// The Google Maps API key required to embed Google Maps in your web pages.&lt;/span&gt;
&lt;span style="color: rgb(32, 64, 160);"&gt;THIS&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;googleMapKey&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;=&lt;/span&gt; &lt;span style="color: rgb(0, 128, 0);"&gt;""&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;

&lt;span style="color: rgb(68, 68, 68);"&gt;// Name of the data source from which the query retrieves data. &lt;/span&gt;
&lt;span style="color: rgb(32, 64, 160);"&gt;THIS&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;datasource&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;=&lt;/span&gt; &lt;span style="color: rgb(0, 128, 0);"&gt;""&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;

&lt;span style="color: rgb(68, 68, 68);"&gt;// Whether to store login information in the Cookie scope or the Session scope.&lt;/span&gt;
&lt;span style="color: rgb(32, 64, 160);"&gt;THIS&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;loginStorage&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;=&lt;/span&gt; &lt;span style="color: rgb(0, 128, 0);"&gt;"cookie"&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt; &lt;span style="color: rgb(68, 68, 68);"&gt;//cookie||session&lt;/span&gt;

&lt;span style="color: rgb(68, 68, 68);"&gt;// A structure that contains ColdFusion mappings. Each element in the structure consists of a key and a value. The logical path is the key and the absolute path is the value. &lt;/span&gt;
&lt;span style="color: rgb(32, 64, 160);"&gt;THIS&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;mappings&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;=&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;{&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;}&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;

&lt;span style="color: rgb(68, 68, 68);"&gt;// Whether to enable validation on cfform fields when the form is submitted.&lt;/span&gt;
&lt;span style="color: rgb(32, 64, 160);"&gt;THIS&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;serverSideFormValidation&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;=&lt;/span&gt; &lt;strong&gt;true&lt;/strong&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;

&lt;span style="color: rgb(68, 68, 68);"&gt;// Whether the application supports Session scope variables.&lt;/span&gt;
&lt;span style="color: rgb(32, 64, 160);"&gt;THIS&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;sessionManagement&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;=&lt;/span&gt; &lt;strong&gt;true&lt;/strong&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;

&lt;span style="color: rgb(68, 68, 68);"&gt;// Life span, as a real number of days, of the user session, including all Session variables.&lt;/span&gt;
&lt;span style="color: rgb(32, 64, 160);"&gt;THIS&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;sessionTimeout&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;=&lt;/span&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;createTimeSpan&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;0&lt;/span&gt;, &lt;span style="color: rgb(255, 0, 0);"&gt;0&lt;/span&gt;, &lt;span style="color: rgb(255, 0, 0);"&gt;30&lt;/span&gt;, &lt;span style="color: rgb(255, 0, 0);"&gt;0&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;

&lt;span style="color: rgb(68, 68, 68);"&gt;// Whether to send CFID and CFTOKEN cookies to the client browser.&lt;/span&gt;
&lt;span style="color: rgb(32, 64, 160);"&gt;THIS&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;setClientCookies&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;=&lt;/span&gt; &lt;strong&gt;true&lt;/strong&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;

&lt;span style="color: rgb(68, 68, 68);"&gt;// Whether to set CFID and CFTOKEN cookies for a domain (not just a host).&lt;/span&gt;
&lt;span style="color: rgb(32, 64, 160);"&gt;THIS&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;setDomainCookies&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;=&lt;/span&gt; &lt;strong&gt;false&lt;/strong&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;

&lt;span style="color: rgb(68, 68, 68);"&gt;// Whether to protect variables from cross-site scripting attacks.&lt;/span&gt;
&lt;span style="color: rgb(32, 64, 160);"&gt;THIS&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;scriptProtect&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;=&lt;/span&gt; &lt;strong&gt;false&lt;/strong&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;

&lt;span style="color: rgb(68, 68, 68);"&gt;// A Boolean value that specifies whether to add a security prefix in front of the value that a ColdFusion function returns in JSON-format in response to a remote call. &lt;/span&gt;
&lt;span style="color: rgb(32, 64, 160);"&gt;THIS&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;secureJSON&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;=&lt;/span&gt; &lt;strong&gt;false&lt;/strong&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;

&lt;span style="color: rgb(68, 68, 68);"&gt;// The security prefix to put in front of the value that a ColdFusion function returns in JSON-format in response to a remote call if the secureJSON setting is true. &lt;/span&gt;
&lt;span style="color: rgb(32, 64, 160);"&gt;THIS&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;secureJSONPrefix&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;=&lt;/span&gt; &lt;span style="color: rgb(0, 128, 0);"&gt;""&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;

&lt;span style="color: rgb(68, 68, 68);"&gt;// A comma-delimited list of names of files. Tells ColdFusion not to call the onMissingTemplate method if the files are not found.&lt;/span&gt;
&lt;span style="color: rgb(32, 64, 160);"&gt;THIS&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;welcomeFileList&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;=&lt;/span&gt; &lt;span style="color: rgb(0, 128, 0);"&gt;""&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;

&lt;span style="color: rgb(68, 68, 68);"&gt;// A struct that contains the following values: server, username, and password.If no value is specified, takes the value in the administrator.&lt;/span&gt;
&lt;span style="color: rgb(32, 64, 160);"&gt;THIS&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;smtpServersettings&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;=&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;{&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;}&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;

&lt;span style="color: rgb(68, 68, 68);"&gt;// Request timeout. Overrides the default administrator settings.&lt;/span&gt;
&lt;span style="color: rgb(32, 64, 160);"&gt;THIS&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;timeout&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;=&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;30&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt; &lt;span style="color: rgb(68, 68, 68);"&gt;// seconds&lt;/span&gt;

&lt;span style="color: rgb(68, 68, 68);"&gt;// A list of ip addresses that need debugging.&lt;/span&gt;
&lt;span style="color: rgb(32, 64, 160);"&gt;THIS&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;debugipaddress&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;=&lt;/span&gt; &lt;span style="color: rgb(0, 128, 0);"&gt;""&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;

&lt;span style="color: rgb(68, 68, 68);"&gt;// Overrides the default administrator settings. It does not report compile-time exceptions.&lt;/span&gt;
&lt;span style="color: rgb(32, 64, 160);"&gt;THIS&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;enablerobustexception&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;=&lt;/span&gt; &lt;strong&gt;false&lt;/strong&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;

&lt;span style="color: rgb(68, 68, 68);"&gt;/* ORM variables */&lt;/span&gt;

&lt;span style="color: rgb(68, 68, 68);"&gt;// Specifies whether ORM should be used for the ColdFusion application.Set the value to true to use ORM. The default is false.&lt;/span&gt;
&lt;span style="color: rgb(32, 64, 160);"&gt;THIS&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;ormenabled&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;=&lt;/span&gt; &lt;strong&gt;false&lt;/strong&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;

&lt;span style="color: rgb(68, 68, 68);"&gt;// The struct that defines all the ORM settings. Documentation: http://help.adobe.com/en_US/ColdFusion/9.0/Developing/WSED380324-6CBE-47cb-9E5E-26B66ACA9E81.html&lt;/span&gt;
&lt;span style="color: rgb(32, 64, 160);"&gt;THIS&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;ormsettings&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;=&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;{&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;}&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;

&lt;span style="color: rgb(68, 68, 68);"&gt;// note: THIS.datasource applies to cfquery as well as ORM. It is defined on line 31.&lt;/span&gt;


&lt;span style="color: rgb(68, 68, 68);"&gt;/* **************************** APPLICATION METHODS **************************** */&lt;/span&gt;


&lt;span style="color: rgb(68, 68, 68);"&gt;&lt;i&gt;/**
@hint "Runs when an application times out or the server is shutting down."
@ApplicationScope "The application scope."
*/&lt;/i&gt;&lt;/span&gt;
&lt;strong&gt;public&lt;/strong&gt; &lt;strong&gt;void&lt;/strong&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;function&lt;/span&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;onApplicationEnd&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(32, 64, 160);"&gt;struct&lt;/span&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;ApplicationScope&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(32, 64, 160);"&gt;structNew&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;{&lt;/strong&gt;&lt;/span&gt;

&lt;strong&gt;return&lt;/strong&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;
&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;}&lt;/strong&gt;&lt;/span&gt;


&lt;span style="color: rgb(68, 68, 68);"&gt;&lt;i&gt;/**
@hint "Runs when ColdFusion receives the first request for a page in the application."
*/&lt;/i&gt;&lt;/span&gt;
&lt;strong&gt;public&lt;/strong&gt; &lt;strong&gt;boolean&lt;/strong&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;function&lt;/span&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;onApplicationStart&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;{&lt;/strong&gt;&lt;/span&gt;

&lt;strong&gt;return&lt;/strong&gt; &lt;strong&gt;true&lt;/strong&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;
&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;}&lt;/strong&gt;&lt;/span&gt;


&lt;span style="color: rgb(68, 68, 68);"&gt;&lt;i&gt;/**
@hint "Intercepts any HTTP or AMF calls to an application based on CFC request."
@cfcname "Fully qualified dotted path to the CFC."

@method "The name of the method invoked."
@args "The arguments (struct) with which the method is invoked."
*/&lt;/i&gt;&lt;/span&gt;
&lt;strong&gt;public&lt;/strong&gt; &lt;strong&gt;void&lt;/strong&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;function&lt;/span&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;onCFCRequest&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(32, 64, 160);"&gt;required&lt;/span&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;string&lt;/span&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;cfcname&lt;/span&gt;, &lt;span style="color: rgb(32, 64, 160);"&gt;required&lt;/span&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;string&lt;/span&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;method&lt;/span&gt;, &lt;span style="color: rgb(32, 64, 160);"&gt;required&lt;/span&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;string&lt;/span&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;args&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;{&lt;/strong&gt;&lt;/span&gt;

&lt;strong&gt;return&lt;/strong&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;
&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;}&lt;/strong&gt;&lt;/span&gt;


&lt;span style="color: rgb(68, 68, 68);"&gt;&lt;i&gt;/**
@hint "Runs when an uncaught exception occurs in the application."
@Exception "The ColdFusion Exception object. For information on the structure of this object, see the description of the cfcatch variable in the cfcatch description."
@EventName "The name of the event handler that generated the exception. If the error occurs during request processing and you do not implement an onRequest method, EventName is the empty string."

note: This method is commented out because it should only be used in special cases
*/&lt;/i&gt;&lt;/span&gt;
&lt;span style="color: rgb(68, 68, 68);"&gt;/*
public void function onError(required any Exception, required string EventName) {
return;
}
*/&lt;/span&gt;


&lt;span style="color: rgb(68, 68, 68);"&gt;&lt;i&gt;/**
@hint "Runs when a request specifies a non-existent CFML page."
@TargetPage "The path from the web root to the requested CFML page."
note: This method is commented out because it should only be used in special cases
*/&lt;/i&gt;&lt;/span&gt;
&lt;span style="color: rgb(68, 68, 68);"&gt;/*
public boolean function onMissingTemplate(required string TargetPage) {
return true;
}
*/&lt;/span&gt;


&lt;span style="color: rgb(68, 68, 68);"&gt;&lt;i&gt;/**
@hint "Runs when a request starts, after the onRequestStart event handler. If you implement this method, it must explicitly call the requested page to process it."
@TargetPage "Path from the web root to the requested page."
note: This method is commented out because it should only be used in special cases
*/&lt;/i&gt;&lt;/span&gt;
&lt;span style="color: rgb(68, 68, 68);"&gt;/*
public void function onRequest(required string TargetPage) {
return;
}
*/&lt;/span&gt;


&lt;span style="color: rgb(68, 68, 68);"&gt;&lt;i&gt;/**
@hint "Runs at the end of a request, after all other CFML code."

*/&lt;/i&gt;&lt;/span&gt;
&lt;strong&gt;public&lt;/strong&gt; &lt;strong&gt;void&lt;/strong&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;function&lt;/span&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;onRequestEnd&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;{&lt;/strong&gt;&lt;/span&gt;
&lt;strong&gt;return&lt;/strong&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;

&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;}&lt;/strong&gt;&lt;/span&gt;


&lt;span style="color: rgb(68, 68, 68);"&gt;&lt;i&gt;/**
@hint "Runs when a request starts."
@TargetPage "Path from the web root to the requested page."
*/&lt;/i&gt;&lt;/span&gt;
&lt;strong&gt;public&lt;/strong&gt; &lt;strong&gt;boolean&lt;/strong&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;function&lt;/span&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;onRequestStart&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(32, 64, 160);"&gt;required&lt;/span&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;string&lt;/span&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;TargetPage&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;{&lt;/strong&gt;&lt;/span&gt;

&lt;strong&gt;return&lt;/strong&gt; &lt;strong&gt;true&lt;/strong&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;
&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;}&lt;/strong&gt;&lt;/span&gt;


&lt;span style="color: rgb(68, 68, 68);"&gt;&lt;i&gt;/**
@hint "Runs when a session ends."
@SessionScope "The Session scope"

@ApplicationScope "The Application scope"
*/&lt;/i&gt;&lt;/span&gt;
&lt;strong&gt;public&lt;/strong&gt; &lt;strong&gt;void&lt;/strong&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;function&lt;/span&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;onSessionEnd&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(32, 64, 160);"&gt;required&lt;/span&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;struct&lt;/span&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;SessionScope&lt;/span&gt;, &lt;span style="color: rgb(32, 64, 160);"&gt;struct&lt;/span&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;ApplicationScope&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(32, 64, 160);"&gt;structNew&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;{&lt;/strong&gt;&lt;/span&gt;

&lt;strong&gt;return&lt;/strong&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;
&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;}&lt;/strong&gt;&lt;/span&gt;


&lt;span style="color: rgb(68, 68, 68);"&gt;&lt;i&gt;/**
@hint "Runs when a session starts."
*/&lt;/i&gt;&lt;/span&gt;
&lt;strong&gt;public&lt;/strong&gt; &lt;strong&gt;void&lt;/strong&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;function&lt;/span&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;onSessionStart&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;{&lt;/strong&gt;&lt;/span&gt;

&lt;strong&gt;return&lt;/strong&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;
&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;}&lt;/strong&gt;&lt;/span&gt;

&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;}&lt;/strong&gt;&lt;/span&gt;
&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;Content provided by: &lt;a href="http://cfruss.blogspot.com/"&gt;cfruss.blogspot.com&lt;/a&gt;&lt;/div&gt;</content><link href="http://cfruss.blogspot.com/feeds/3862663908068338479/comments/default" rel="replies" title="Post Comments" type="application/atom+xml"/><link href="http://www.blogger.com/comment/fullpage/post/6650413229535480271/3862663908068338479" rel="replies" title="4 Comments" type="text/html"/><link href="http://www.blogger.com/feeds/6650413229535480271/posts/default/3862663908068338479" rel="edit" type="application/atom+xml"/><link href="http://www.blogger.com/feeds/6650413229535480271/posts/default/3862663908068338479" rel="self" type="application/atom+xml"/><link href="http://cfruss.blogspot.com/2009/11/applicationcfc-reference-in-cfscript.html" rel="alternate" title="Application.cfc Reference in CFScript for Coldfusion 9" type="text/html"/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image height="16" rel="http://schemas.google.com/g/2005#thumbnail" src="https://img1.blogblog.com/img/b16-rounded.gif" width="16"/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6650413229535480271.post-5731114536793973147</id><published>2009-09-09T21:18:00.000-07:00</published><updated>2009-09-09T21:35:23.186-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="coldfusion"/><category scheme="http://www.blogger.com/atom/ns#" term="functions"/><category scheme="http://www.blogger.com/atom/ns#" term="open-source"/><title type="text">ListToQuery: My first CFLib submission</title><content type="html">My first submission to CFLib.org has been approved and posted! Check it out: &lt;a href="http://bit.ly/aQuEQ"&gt;CFLib.org - listToQuery&lt;/a&gt;. &lt;br /&gt;&lt;br /&gt;It is super-simple and does exactly what it says. I wrote it because I was working on a project which required a list be converted to a query, and I couldn't find any existing UDFs to do so.&lt;br /&gt;&lt;br /&gt;If you find yourself in a similar situation, I highly recommend submitting your solution to &lt;a href="http://www.CFLib.org"&gt;CFLib.org&lt;/a&gt;. It helps everyone! Plus, it gives you priceless bragging rights.&lt;br /&gt;&lt;br /&gt;On a side note: I was working on &lt;a href="http://cfruss.blogspot.com/2009/07/about-couchdb-for-coldfusion.html"&gt;CouchDB for Coldfusion&lt;/a&gt; and ended up spending 3 hours writing a UDF that I planned to submit to CFLib. When I was done, I found &lt;a href="http://www.cflib.org/udf/easySocket"&gt;EasySocket&lt;/a&gt;, which was submitted a week ago and is almost exactly what I wrote! If only I had searched CFLib for "socket" before writing my own UDF. How disappointing...&lt;div class="blogger-post-footer"&gt;Content provided by: &lt;a href="http://cfruss.blogspot.com/"&gt;cfruss.blogspot.com&lt;/a&gt;&lt;/div&gt;</content><link href="http://cfruss.blogspot.com/feeds/5731114536793973147/comments/default" rel="replies" title="Post Comments" type="application/atom+xml"/><link href="http://www.blogger.com/comment/fullpage/post/6650413229535480271/5731114536793973147" rel="replies" title="0 Comments" type="text/html"/><link href="http://www.blogger.com/feeds/6650413229535480271/posts/default/5731114536793973147" rel="edit" type="application/atom+xml"/><link href="http://www.blogger.com/feeds/6650413229535480271/posts/default/5731114536793973147" rel="self" type="application/atom+xml"/><link href="http://cfruss.blogspot.com/2009/09/listtoquery-my-first-cflib-submission.html" rel="alternate" title="ListToQuery: My first CFLib submission" type="text/html"/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image height="16" rel="http://schemas.google.com/g/2005#thumbnail" src="https://img1.blogblog.com/img/b16-rounded.gif" width="16"/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6650413229535480271.post-4441426800297857760</id><published>2009-08-31T17:26:00.000-07:00</published><updated>2009-09-01T01:14:08.384-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="coldfusion"/><category scheme="http://www.blogger.com/atom/ns#" term="couchdb"/><category scheme="http://www.blogger.com/atom/ns#" term="oodb"/><title type="text">An object-database for Coldfusion</title><content type="html">I've been working on an OODB (object-database) for Coldfusion! It uses CouchDB as the data-storage engine and it is Railo compatible. As far as I know, there is no OODB for Coldfusion yet, so this is fairly cutting-edge. &lt;br /&gt;&lt;br /&gt;So far I've got the basic CRUD working, and it is WAY cool. Instead of data-mapping by hand or even using CF 9's fancy new ORM (object-relational mapping), you just make your object and go like so: &lt;br /&gt;&lt;br /&gt;OODB.save(myObject, 'myObjID'); &lt;br /&gt;&lt;br /&gt;How simple is that?! When you want to populate an object with saved data, you go like so:&lt;br /&gt;&lt;br /&gt;OODB.load(myObject, 'myObjID'); &lt;br /&gt;&lt;br /&gt;This has the potential to save vast amounts of development time by allowing developers to focus almost entirely on object behavior instead of data-mapping. I think OODB will be really useful for projects that have relatively small data storage needs (blogs, wikis, etc). SQL will probably remain the best choice for large datasets though. &lt;br /&gt;&lt;br /&gt;The next big thing I need to do for this project is to make an OODB method to get lists of object IDs based on the data within them. Until then, this code is more cool than it is useful. &lt;br /&gt;&lt;br /&gt;If you'd like to check it out, &lt;a href="http://couchdb.riaforge.org/index.cfm?event=page.svnzip"&gt;download CouchDB for Coldfusion&lt;/a&gt;. You'll find the OODB files in the OODB directory. Don't forget to install &lt;a href="http://couchdb.apache.org"&gt;CouchDB&lt;/a&gt; first! You'll also need to modify document.cfc to get it working. &lt;br /&gt;&lt;br /&gt;WARNING: I don't recommend this for real-world use yet: this is beta code running on beta software. &lt;br /&gt;&lt;br /&gt;&lt;a href="http://twitter.com/russplaysguitar"&gt;Follow me on Twitter&lt;/a&gt; if you'd like to stay up to date on the latest developments. &lt;br /&gt;&lt;br /&gt;Special thanks to &lt;a href="http://mingo.nl/"&gt;Mingo Hagen&lt;/a&gt; and &lt;a href="http://corfield.org"&gt;Sean Corfield&lt;/a&gt; for their continued input and support.&lt;div class="blogger-post-footer"&gt;Content provided by: &lt;a href="http://cfruss.blogspot.com/"&gt;cfruss.blogspot.com&lt;/a&gt;&lt;/div&gt;</content><link href="http://cfruss.blogspot.com/feeds/4441426800297857760/comments/default" rel="replies" title="Post Comments" type="application/atom+xml"/><link href="http://www.blogger.com/comment/fullpage/post/6650413229535480271/4441426800297857760" rel="replies" title="2 Comments" type="text/html"/><link href="http://www.blogger.com/feeds/6650413229535480271/posts/default/4441426800297857760" rel="edit" type="application/atom+xml"/><link href="http://www.blogger.com/feeds/6650413229535480271/posts/default/4441426800297857760" rel="self" type="application/atom+xml"/><link href="http://cfruss.blogspot.com/2009/08/object-database-for-coldfusion.html" rel="alternate" title="An object-database for Coldfusion" type="text/html"/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image height="16" rel="http://schemas.google.com/g/2005#thumbnail" src="https://img1.blogblog.com/img/b16-rounded.gif" width="16"/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6650413229535480271.post-3475248060271122971</id><published>2009-07-11T22:24:00.000-07:00</published><updated>2009-07-11T22:49:46.288-07:00</updated><title type="text">CouchDB for Coldfusion</title><content type="html">Download the project here: &lt;a href="http://couchdb.riaforge.org/"&gt;CouchDB for Coldfusion on RIAForge&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;A recent Twitter by &lt;a href="http://twitter.com/mjhagen"&gt;Mingo Hagen&lt;/a&gt; inspired me to start my first open-source project on RIAForge: &lt;a href="http://couchdb.riaforge.org/"&gt;CouchDB for Coldfusion&lt;/a&gt;. This project is basically a CFC wrapper for CouchDB operations.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://couchdb.apache.org"&gt;CouchDB&lt;/a&gt; is a fairly new concept. It is a document-oriented database that uses a RESTful HTTP/JSON API for interactions. You should read more about it yourself, but here are just a few reasons why it is cool:&lt;br /&gt;* Schema-free storage&lt;br /&gt;* Data is stored as JSON&lt;br /&gt;* All document revisions are saved&lt;br /&gt;* You can interact with the DB directly through the browser via the built-in API&lt;br /&gt;* Built-in web-based admin&lt;br /&gt;&lt;br /&gt;&lt;a href="http://couchdb.riaforge.org/"&gt;CouchDB for Coldfusion&lt;/a&gt; is still in the early stages, but already I find it is an easy way to interact with &lt;a href="http://couchdb.apache.org"&gt;CouchDB&lt;/a&gt;. I'll be using this project as a way to learn more about CouchDB. If you'd like to contribute please let me know and I'll give you SVN access.&lt;div class="blogger-post-footer"&gt;Content provided by: &lt;a href="http://cfruss.blogspot.com/"&gt;cfruss.blogspot.com&lt;/a&gt;&lt;/div&gt;</content><link href="http://cfruss.blogspot.com/feeds/3475248060271122971/comments/default" rel="replies" title="Post Comments" type="application/atom+xml"/><link href="http://www.blogger.com/comment/fullpage/post/6650413229535480271/3475248060271122971" rel="replies" title="12 Comments" type="text/html"/><link href="http://www.blogger.com/feeds/6650413229535480271/posts/default/3475248060271122971" rel="edit" type="application/atom+xml"/><link href="http://www.blogger.com/feeds/6650413229535480271/posts/default/3475248060271122971" rel="self" type="application/atom+xml"/><link href="http://cfruss.blogspot.com/2009/07/about-couchdb-for-coldfusion.html" rel="alternate" title="CouchDB for Coldfusion" type="text/html"/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image height="16" rel="http://schemas.google.com/g/2005#thumbnail" src="https://img1.blogblog.com/img/b16-rounded.gif" width="16"/></author><thr:total>12</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6650413229535480271.post-8089259607639238614</id><published>2009-06-08T23:00:00.001-07:00</published><updated>2009-06-08T23:39:02.159-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="cfcs"/><category scheme="http://www.blogger.com/atom/ns#" term="coldfusion"/><category scheme="http://www.blogger.com/atom/ns#" term="db4o"/><title type="text">db4o in Coldfusion, anyone?</title><content type="html">&lt;a href="http://www.db4o.com/"&gt;DB4O&lt;/a&gt; is an object database. It allows you to store objects (at whatever state they happen to be in) and retrieve them for use later.&lt;br /&gt;This can be really useful if:&lt;br /&gt;1. You want a simple, quick way to store data&lt;br /&gt;2. You want to create an application that can run without an SQL database&lt;br /&gt;3. You hate SQL (or SQL hates you)&lt;br /&gt;&lt;br /&gt;I did some research and found a guy named Todd Sharp who &lt;a href="http://cfsilence.com/blog/client/index.cfm/2008/5/28/More-CFJava--Compiling-Classes-And-Persisting-Objects"&gt;installed db4o for Coldfusion&lt;/a&gt;. He hasn't released his code, so that got me thinking: "Hey, I know some Java and I know how to install Java classes in Coldfusion. Why don't I do it myself?"&lt;br /&gt;&lt;br /&gt;So I tried it, and it worked! But... I've run into a couple serious issues that I can't seem to figure out.&lt;br /&gt;&lt;br /&gt;Firstly, after about four or five "save" operations, the database becomes corrupt. No matter how simple the objects are, this always happens. If I can't figure this out, my experiment is basically a failure.&lt;br /&gt;&lt;br /&gt;Second, I cannot store CFCs. If I try, my CPU goes full throttle until I kill Coldfusion. I'm guessing this is due to the underlying complexity of CFCs, but it sure puts a damper on things. I've been using CF 8's JSON functions to "simplify" my Coldfusion objects like so: DeserializeJSON(SerializeJSON(myCFCinstance))&lt;br /&gt;&lt;br /&gt;Does anyone else have any experience with db4o? I'll provide my source code and installation instructions to anyone who wants to try it.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://blog.taragana.com/index.php/archive/how-to-learn-db40-java-and-net-object-database-in-5-minutes/"&gt;Here is a great tutorial for db4o&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;My system specs:&lt;br /&gt;Java version: Open JDK 1.6.0_0&lt;br /&gt;CF Version: 8,0,1,195765   &lt;br /&gt;OS: Ubuntu 9.04 (2.6.28-11-generic)&lt;br /&gt;Hardware: Dell Vostro 1000&lt;div class="blogger-post-footer"&gt;Content provided by: &lt;a href="http://cfruss.blogspot.com/"&gt;cfruss.blogspot.com&lt;/a&gt;&lt;/div&gt;</content><link href="http://cfruss.blogspot.com/feeds/8089259607639238614/comments/default" rel="replies" title="Post Comments" type="application/atom+xml"/><link href="http://www.blogger.com/comment/fullpage/post/6650413229535480271/8089259607639238614" rel="replies" title="4 Comments" type="text/html"/><link href="http://www.blogger.com/feeds/6650413229535480271/posts/default/8089259607639238614" rel="edit" type="application/atom+xml"/><link href="http://www.blogger.com/feeds/6650413229535480271/posts/default/8089259607639238614" rel="self" type="application/atom+xml"/><link href="http://cfruss.blogspot.com/2009/06/db4o-in-coldfusion-anyone.html" rel="alternate" title="db4o in Coldfusion, anyone?" type="text/html"/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image height="16" rel="http://schemas.google.com/g/2005#thumbnail" src="https://img1.blogblog.com/img/b16-rounded.gif" width="16"/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6650413229535480271.post-9026782992673528587</id><published>2008-03-18T23:08:00.000-07:00</published><updated>2008-03-18T23:24:39.849-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="bugs"/><category scheme="http://www.blogger.com/atom/ns#" term="coldfusion"/><category scheme="http://www.blogger.com/atom/ns#" term="functions"/><title type="text">Round()... and why I sometimes hate my life.</title><content type="html">I came across a frustrating Coldfusion MX 6.1 bug today. When attempting to use the Round() function, my numbers were not rounding correctly. Instead of rounding up at .5, they were being rounded down. Uhh... wtf, cf?&lt;br /&gt;&lt;br /&gt;I spent about an hour or so debugging the issue, and sadly, I still cannot say for certain what the problem was. My best guess is that one of the variables in my expression may not have been of type numeric (although it held a numeric value), which could've somehow caused Coldfusion to get confused when performing the Round() function.&lt;br /&gt;&lt;br /&gt;After this thought entered my mind, I immediately encapsulated the expression in a Val() function and "presto!", Round() started working again and I began to reconcile my feelings towards the computer. I had wasted so much time on something so moronic that I didn't feel the need to really fish around for the exact reason WHY Round() stopped working right, I was just happy that it was over with.&lt;br /&gt;&lt;br /&gt;Just thinking about it gives me a headache again!&lt;div class="blogger-post-footer"&gt;Content provided by: &lt;a href="http://cfruss.blogspot.com/"&gt;cfruss.blogspot.com&lt;/a&gt;&lt;/div&gt;</content><link href="http://cfruss.blogspot.com/feeds/9026782992673528587/comments/default" rel="replies" title="Post Comments" type="application/atom+xml"/><link href="http://www.blogger.com/comment/fullpage/post/6650413229535480271/9026782992673528587" rel="replies" title="0 Comments" type="text/html"/><link href="http://www.blogger.com/feeds/6650413229535480271/posts/default/9026782992673528587" rel="edit" type="application/atom+xml"/><link href="http://www.blogger.com/feeds/6650413229535480271/posts/default/9026782992673528587" rel="self" type="application/atom+xml"/><link href="http://cfruss.blogspot.com/2008/03/round-and-why-i-sometimes-hate-my-life.html" rel="alternate" title="Round()... and why I sometimes hate my life." type="text/html"/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image height="16" rel="http://schemas.google.com/g/2005#thumbnail" src="https://img1.blogblog.com/img/b16-rounded.gif" width="16"/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6650413229535480271.post-5747334701520321803</id><published>2008-01-24T00:14:00.000-08:00</published><updated>2008-01-24T00:40:40.296-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="cfcs"/><category scheme="http://www.blogger.com/atom/ns#" term="email"/><category scheme="http://www.blogger.com/atom/ns#" term="server management"/><title type="text">MX 6.1 Issue: CFPOP vs. open-source IMAP alternatives... and why you may end up with CFX_POP3</title><content type="html">Today I spent a large portion of my time fighting a losing battle against bugs. Bugs in Java, bugs in Coldfusion MX 6.1, bugs in the open-source scripts I tried to use... ahhh! Finally I broke down and begged the boss to just buy CFX_POP3 for $20. Let me explain my dilemma:&lt;br /&gt;&lt;br /&gt;My goal: A script that will automatically remove email addresses from our mailing list if we receive a "recipient does not exist" response. This means not only getting a list of messages in the inbox, but also parsing the message body to find the email address that will be removed.&lt;br /&gt;&lt;br /&gt;First try: &amp;lt;CFPOP&gt; . This is Coldfusion's built in POP email tag. In theory, you can handle all the normal email functions with it. In practice, if you try to access a message that is in UTF-7 (rather than UTF-8, the current standard), you'll get an error message. This isn't Coldfusion's fault- rather, UTF-7 is no longer supported in Java. There are a couple of .jar's out there that should enable Java to handle UTF-7, but none of them worked for me. &lt;br /&gt;&lt;br /&gt;Second attempt: IMAP via open-source CFCs. I tried &lt;a href="http://sourceforge.net/projects/cfimap-cfc/"&gt;cfimap&lt;/a&gt; AND &lt;a href="http://www.opensourcecf.com/1/2006/12/ImapCFC-Update.cfm"&gt;imap.cfc&lt;/a&gt;, both of which were not compatible with MX 6.1, and no amount of debugging got me anywhere.&lt;br /&gt;&lt;br /&gt;My solution: &lt;a href="http://store.newmediadevelopment.net/cfx_tag.cfm?ProductID=16"&gt;CF_POP3&lt;/a&gt; For $20, I should've just gone for it in the first place. It has some extra features that CFPOP lacks, but what counts is that it supports UTF-7. &lt;br /&gt;&lt;br /&gt;Thank goodness I'm done with debugging other people's open-source code. For now.&lt;div class="blogger-post-footer"&gt;Content provided by: &lt;a href="http://cfruss.blogspot.com/"&gt;cfruss.blogspot.com&lt;/a&gt;&lt;/div&gt;</content><link href="http://cfruss.blogspot.com/feeds/5747334701520321803/comments/default" rel="replies" title="Post Comments" type="application/atom+xml"/><link href="http://www.blogger.com/comment/fullpage/post/6650413229535480271/5747334701520321803" rel="replies" title="0 Comments" type="text/html"/><link href="http://www.blogger.com/feeds/6650413229535480271/posts/default/5747334701520321803" rel="edit" type="application/atom+xml"/><link href="http://www.blogger.com/feeds/6650413229535480271/posts/default/5747334701520321803" rel="self" type="application/atom+xml"/><link href="http://cfruss.blogspot.com/2008/01/mx-61-issue-cfpop-vs-open-source-imap.html" rel="alternate" title="MX 6.1 Issue: CFPOP vs. open-source IMAP alternatives... and why you may end up with CFX_POP3" type="text/html"/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image height="16" rel="http://schemas.google.com/g/2005#thumbnail" src="https://img1.blogblog.com/img/b16-rounded.gif" width="16"/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6650413229535480271.post-8764581267590618725</id><published>2008-01-14T20:12:00.000-08:00</published><updated>2008-01-14T20:50:06.593-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="server management"/><category scheme="http://www.blogger.com/atom/ns#" term="sql"/><title type="text">Tip: Speed up your SQL database with indexing</title><content type="html">When your database starts to grow, you'll find that your queries take longer and longer to complete. This is because they have to search more and more rows. This slowdown can affect your entire website or application as the slow queries inevitably occupy more simultaneous threads. You can even experience temporary outages if slow queries occupy all your threads, forcing every query request to wait!&lt;br /&gt;&lt;br /&gt;There are numerous ways to fix this:&lt;br /&gt;1. Code conservatively so that your query the database as little as possible.&lt;br /&gt;2. Include primary keys in your WHERE and JOIN-ON clauses.&lt;br /&gt;3. Run a Query Analyzer tool on slow queries to find out what parts of your query are slowest, and then...&lt;br /&gt;4. Create indexes on columns that are frequently used in WHERE or JOIN clauses.&lt;br /&gt;&lt;br /&gt;Main points when indexing:&lt;br /&gt;1. Don't index columns where a large percentage of rows haveh the same values. This defeats the whole purpose. &lt;br /&gt;2. Don't index large varchar columns. Again, this will not increase performance.&lt;br /&gt;3. Don't index every column. Just index the ones used to identify unique rows in a large number of WHERE and JOIN clauses.&lt;br /&gt;4. Go read some more in-depth documentation on indexing. This is just a general overview. Here is a decent article regarding Clustered VS. Non-Clustered Indexes: &lt;a href="http://www.daemon.com.au/index.cfm?objectid=ABF13B5F-EA69-0EC7-F7FAD8ABCA1E04FD"&gt;daemon: Database Indexing Strategies for FarCry&lt;/a&gt;. (FYI Farcry is a CMS, but the DB principals are the same)&lt;br /&gt;&lt;br /&gt;For example:&lt;br /&gt;In the case of one website I'm working on, my predecessor chose to ignore Primary Keys and generate his own uniquely identifying numbers. These numbers are used in many queries, but none of the columns were indexed. After applying an index to these columns, the entire website saw a significant performance boost. In fact, this has helped reduce the number of SQL Deadlocks by minimizing row-lock time.&lt;div class="blogger-post-footer"&gt;Content provided by: &lt;a href="http://cfruss.blogspot.com/"&gt;cfruss.blogspot.com&lt;/a&gt;&lt;/div&gt;</content><link href="http://cfruss.blogspot.com/feeds/8764581267590618725/comments/default" rel="replies" title="Post Comments" type="application/atom+xml"/><link href="http://www.blogger.com/comment/fullpage/post/6650413229535480271/8764581267590618725" rel="replies" title="0 Comments" type="text/html"/><link href="http://www.blogger.com/feeds/6650413229535480271/posts/default/8764581267590618725" rel="edit" type="application/atom+xml"/><link href="http://www.blogger.com/feeds/6650413229535480271/posts/default/8764581267590618725" rel="self" type="application/atom+xml"/><link href="http://cfruss.blogspot.com/2008/01/tip-speed-up-your-sql-database-with.html" rel="alternate" title="Tip: Speed up your SQL database with indexing" type="text/html"/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image height="16" rel="http://schemas.google.com/g/2005#thumbnail" src="https://img1.blogblog.com/img/b16-rounded.gif" width="16"/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6650413229535480271.post-8557167731969586301</id><published>2008-01-10T20:20:00.000-08:00</published><updated>2008-01-10T20:40:26.760-08:00</updated><title type="text">Query of Queries - "unsupported type conversion error" in MX 6.1</title><content type="html">I just ran into this frustrating bug yesterday. When working with Query of Queries you (&amp;lt;cfquery dtype="query"&gt;) you may get the error, "unsupported type conversion error." After doing some research I found out that the reason this occurs is because Coldfusion attempts to automatically determine the data types for columns in QofQ. If it gets it wrong and you try to use the QofQ in such a way that conflicts with the data-type Coldfusion assigned, you will get this error.&lt;br /&gt;&lt;br /&gt;To remedy this you must be sure that when you create the QofQ, the data in your columns LOOKS like the data types you think they should be. For example, if you want Coldfusion to assign the varchar datatype to a column, you should initially populate the column with at least one cell that contains a non-numeric character. If a column contains only integers, Coldfusion will assign an "int" data type to it. I don't know the details of how Coldfusion determines a "date" data type for QofQ, but I'm sure you'll figure it out.&lt;br /&gt;&lt;br /&gt;I just find it helpful to know that this "bug" exists so that when I get an "unsupported type conversion error" I'll know what is causing it.&lt;div class="blogger-post-footer"&gt;Content provided by: &lt;a href="http://cfruss.blogspot.com/"&gt;cfruss.blogspot.com&lt;/a&gt;&lt;/div&gt;</content><link href="http://cfruss.blogspot.com/feeds/8557167731969586301/comments/default" rel="replies" title="Post Comments" type="application/atom+xml"/><link href="http://www.blogger.com/comment/fullpage/post/6650413229535480271/8557167731969586301" rel="replies" title="0 Comments" type="text/html"/><link href="http://www.blogger.com/feeds/6650413229535480271/posts/default/8557167731969586301" rel="edit" type="application/atom+xml"/><link href="http://www.blogger.com/feeds/6650413229535480271/posts/default/8557167731969586301" rel="self" type="application/atom+xml"/><link href="http://cfruss.blogspot.com/2008/01/query-of-queries-unsupported-type.html" rel="alternate" title="Query of Queries - &quot;unsupported type conversion error&quot; in MX 6.1" type="text/html"/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image height="16" rel="http://schemas.google.com/g/2005#thumbnail" src="https://img1.blogblog.com/img/b16-rounded.gif" width="16"/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6650413229535480271.post-1478529915663678510</id><published>2008-01-03T19:40:00.000-08:00</published><updated>2008-01-03T21:28:07.286-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="cfcs"/><category scheme="http://www.blogger.com/atom/ns#" term="coldfusion"/><category scheme="http://www.blogger.com/atom/ns#" term="undocumented"/><title type="text">Passing multiple same-named arguments to a CFC via GET or POST</title><content type="html">&lt;h1 style="color: white; font-size: 1px; display: none; visibility: hidden; margin:0px;padding:0px;"&gt;functions,  cfcs, components, cffunction, cfcompnent, cfargument, lists, tricks, secrets, unknown, tips, interesting, uncommon, undocumented&lt;/h1&gt;I discovered a useful undocumented behavior of Coldfusion components today! It turns out that if you define the value of a named argument more than once in a remote method call (via GET or POST), those values will be passed as a comma-delimited list. This behavior is different than how Coldfusion would treat argument multiples in every other function call--normally, Coldfusion either overwrites arguments with their last defined value or throws an error.&lt;br /&gt;&lt;br /&gt;Here is an example:&lt;br /&gt;&lt;br /&gt;&lt;b&gt;example.cfc&lt;/b&gt;&lt;br /&gt;&lt;div style="padding-left: 16px; padding-right:16px;background-color: rgb(238, 238, 238); font-family: courier new;"&gt;&lt;br /&gt;&lt;span style='color:#900'&gt;&amp;#60;&amp;#99;&amp;#102;&amp;#99;&amp;#111;&amp;#109;&amp;#112;&amp;#111;&amp;#110;&amp;#101;&amp;#110;&amp;#116;&amp;#62;&lt;/span&gt;&lt;br /&gt;&amp;#9;&lt;span style='color:#900'&gt;&amp;#60;&amp;#99;&amp;#102;&amp;#102;&amp;#117;&amp;#110;&amp;#99;&amp;#116;&amp;#105;&amp;#111;&amp;#110;&amp;#32;&amp;#110;&amp;#97;&amp;#109;&amp;#101;&amp;#61;&amp;#34;&amp;#116;&amp;#101;&amp;#115;&amp;#116;&amp;#34;&amp;#32;&amp;#97;&amp;#99;&amp;#99;&amp;#101;&amp;#115;&amp;#115;&amp;#61;&amp;#34;&amp;#114;&amp;#101;&amp;#109;&amp;#111;&amp;#116;&amp;#101;&amp;#34;&amp;#32;&amp;#114;&amp;#101;&amp;#116;&amp;#117;&amp;#114;&amp;#110;&amp;#116;&amp;#121;&amp;#112;&amp;#101;&amp;#61;&amp;#34;&amp;#97;&amp;#110;&amp;#121;&amp;#34;&amp;#62;&lt;/span&gt;&lt;br /&gt;&amp;#9;&amp;#9;&lt;span style='color:#900'&gt;&amp;#60;&amp;#99;&amp;#102;&amp;#100;&amp;#117;&amp;#109;&amp;#112;&amp;#32;&amp;#118;&amp;#97;&amp;#114;&amp;#61;&amp;#34;&amp;#35;&amp;#97;&amp;#114;&amp;#103;&amp;#117;&amp;#109;&amp;#101;&amp;#110;&amp;#116;&amp;#115;&amp;#35;&amp;#34;&amp;#62;&lt;/span&gt;&lt;br /&gt;&amp;#9;&lt;span style='color:#900'&gt;&amp;#60;&amp;#47;&amp;#99;&amp;#102;&amp;#102;&amp;#117;&amp;#110;&amp;#99;&amp;#116;&amp;#105;&amp;#111;&amp;#110;&amp;#62;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;Then simply type something like this as a url to call the above component: http://www.yourdomain.com/&lt;br&gt;&lt;b&gt;example.cfc?method=test&amp;a=1&amp;a=2&amp;a=oh&amp;a=3&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;This is what you'll see:&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjz0pTmsyV0OU0QGkXNJZ_ILtnd0dQMdEgjW1HXM9ygC22Yas4Dgt1pe_MlRXe6ILYCmZK5PDS88OlyGBy9u4sbLdkc8OspfNEn6xrbrXXaVE8nXsdK9olaBmzmQBzQ0rgz1olFTqW8peg/s1600-h/samename.jpg"&gt;&lt;img style="cursor:pointer; cursor:hand;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjz0pTmsyV0OU0QGkXNJZ_ILtnd0dQMdEgjW1HXM9ygC22Yas4Dgt1pe_MlRXe6ILYCmZK5PDS88OlyGBy9u4sbLdkc8OspfNEn6xrbrXXaVE8nXsdK9olaBmzmQBzQ0rgz1olFTqW8peg/s200/samename.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5151486938840927842" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;kinda cool, huh? &lt;br /&gt;&lt;br /&gt;I've tested this behavior in Coldfusion MX 6.1 and MX 7. If anyone out there would like to test it on MX 8 and let me know how it works, that would be great!&lt;div class="blogger-post-footer"&gt;Content provided by: &lt;a href="http://cfruss.blogspot.com/"&gt;cfruss.blogspot.com&lt;/a&gt;&lt;/div&gt;</content><link href="http://cfruss.blogspot.com/feeds/1478529915663678510/comments/default" rel="replies" title="Post Comments" type="application/atom+xml"/><link href="http://www.blogger.com/comment/fullpage/post/6650413229535480271/1478529915663678510" rel="replies" title="0 Comments" type="text/html"/><link href="http://www.blogger.com/feeds/6650413229535480271/posts/default/1478529915663678510" rel="edit" type="application/atom+xml"/><link href="http://www.blogger.com/feeds/6650413229535480271/posts/default/1478529915663678510" rel="self" type="application/atom+xml"/><link href="http://cfruss.blogspot.com/2008/01/passing-multiple-same-named-arguments.html" rel="alternate" title="Passing multiple same-named arguments to a CFC via GET or POST" type="text/html"/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image height="16" rel="http://schemas.google.com/g/2005#thumbnail" src="https://img1.blogblog.com/img/b16-rounded.gif" width="16"/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjz0pTmsyV0OU0QGkXNJZ_ILtnd0dQMdEgjW1HXM9ygC22Yas4Dgt1pe_MlRXe6ILYCmZK5PDS88OlyGBy9u4sbLdkc8OspfNEn6xrbrXXaVE8nXsdK9olaBmzmQBzQ0rgz1olFTqW8peg/s72-c/samename.jpg" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6650413229535480271.post-4182415581370151474</id><published>2007-10-28T02:10:00.001-07:00</published><updated>2007-12-20T01:06:38.605-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="server management"/><title type="text">Shared Hosting Security Issues</title><content type="html">I'm so frustrated with the web host provider for my newest independent project. I accidentally discovered a serious security issue and have been trying to get them to fix it, but they haven't even been getting back to me. It shouldn't be MY responsibility to try to get them to fix THEIR problem! &lt;br /&gt;&lt;br /&gt;Long story short, the moral is: don't trust shared hosting security! And NEVER store sensitive customer information (ssn's, credit card info, etc) on a shared database server.&lt;br /&gt;&lt;br /&gt;And watch where you buy stuff online. Personally, I think paypal is the ONLY way to do it.&lt;br /&gt;&lt;br /&gt;Sigh.&lt;div class="blogger-post-footer"&gt;Content provided by: &lt;a href="http://cfruss.blogspot.com/"&gt;cfruss.blogspot.com&lt;/a&gt;&lt;/div&gt;</content><link href="http://cfruss.blogspot.com/feeds/4182415581370151474/comments/default" rel="replies" title="Post Comments" type="application/atom+xml"/><link href="http://www.blogger.com/comment/fullpage/post/6650413229535480271/4182415581370151474" rel="replies" title="0 Comments" type="text/html"/><link href="http://www.blogger.com/feeds/6650413229535480271/posts/default/4182415581370151474" rel="edit" type="application/atom+xml"/><link href="http://www.blogger.com/feeds/6650413229535480271/posts/default/4182415581370151474" rel="self" type="application/atom+xml"/><link href="http://cfruss.blogspot.com/2007/10/shared-hosting-security-issues.html" rel="alternate" title="Shared Hosting Security Issues" type="text/html"/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image height="16" rel="http://schemas.google.com/g/2005#thumbnail" src="https://img1.blogblog.com/img/b16-rounded.gif" width="16"/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6650413229535480271.post-727006038904747859</id><published>2007-10-14T01:14:00.000-07:00</published><updated>2007-12-20T01:06:51.930-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="coldfusion"/><category scheme="http://www.blogger.com/atom/ns#" term="server management"/><title type="text">Make your own remote server monitor!</title><content type="html">Site going down in the middle of the night? Here is how to set up your own remote server monitor that will email your host support team (and even send you a text message!):&lt;br /&gt;&lt;br /&gt;1. Install Coldfusion developer (it's free!) on one your development machines. It cannot go on the same server that is being monitored because if it goes down, so will the monitor (duh.) This step is easier said than done, but if you already have Coldfusion installed on a local machine then you don't have to worry about it.&lt;br /&gt;&lt;br /&gt;2. Set up a mail server that coldfusion can access with the cfmail tag. The mail server cannot be located on the server that you are monitoring!&lt;br /&gt;&lt;br /&gt;3. Copy &amp; modify this simple code:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;&lt;br /&gt;&amp;lt;!--- ServerMonitor.cfm ---&gt; &lt;br /&gt;Testing the server...&lt;br /&gt;&amp;lt;cftry&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;lt;cfhttp url="http://www.yoursite.com" throwOnError="yes" redirect="no"&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;Success!&lt;br /&gt;  &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;lt;cfcatch&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Monitor failure!&lt;br /&gt;    &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;!--- send email to host support team ---&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;cfmail to="support@yourhost.com" from="youremail@yourOTHERhost.com" subject="Server Monitor Failure"&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Our server, (INSERT YOUR SERVER NAME HERE), may be having troubles. Could you please check on it? Thank you!&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/cfmail&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;!--- send text message to you ---&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;cfmail to="SEE STEP 4" from="youremail@yourOTHERhost.com" subject="Server Monitor Failure"&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Our server, (INSERT YOUR SERVER NAME HERE), may be having troubles. Could you please check on it? Thank you!&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/cfmail&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;lt;/cfcatch&gt;&lt;br /&gt;&amp;lt;/cftry&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;4. Did you know you can send text messages with simple emails? You do now! Here is a list of providers and associated text-message email addresses:&lt;br /&gt;&lt;br /&gt;AT&amp;T Wireless&lt;br /&gt;NUMBER@mmode.com&lt;br /&gt;&lt;br /&gt;Cingular&lt;br /&gt;NUMBER@mms.mycingular.com&lt;br /&gt;&lt;br /&gt;Sprint&lt;br /&gt;NUMBER@pm.sprint.com&lt;br /&gt;&lt;br /&gt;T-Mobile&lt;br /&gt;NUMBER@tmomail.net&lt;br /&gt;&lt;br /&gt;Verizon&lt;br /&gt;NUMBER@vzwpix.com&lt;br /&gt;&lt;br /&gt;5. Schedule ServerMonitor.cfm (the above code) to run automatically every half hour (or something like that) in Coldfusion Administrator (or with Windows Task Sceduler). I say every half hour because if the server goes down you don't want to be recieving a million text messages or have your host support team get pissed at you. (p.s. it might be best to disable the text messaging option if you don't get unlimited text messages)&lt;br /&gt;&lt;br /&gt;Now just remember to leave the machine on all night. That's it! No more worrying about checking your busy e-commerce site in the middle of the night, no more calling host support at 2am asking them to reboot the server :)&lt;div class="blogger-post-footer"&gt;Content provided by: &lt;a href="http://cfruss.blogspot.com/"&gt;cfruss.blogspot.com&lt;/a&gt;&lt;/div&gt;</content><link href="http://cfruss.blogspot.com/feeds/727006038904747859/comments/default" rel="replies" title="Post Comments" type="application/atom+xml"/><link href="http://www.blogger.com/comment/fullpage/post/6650413229535480271/727006038904747859" rel="replies" title="1 Comments" type="text/html"/><link href="http://www.blogger.com/feeds/6650413229535480271/posts/default/727006038904747859" rel="edit" type="application/atom+xml"/><link href="http://www.blogger.com/feeds/6650413229535480271/posts/default/727006038904747859" rel="self" type="application/atom+xml"/><link href="http://cfruss.blogspot.com/2007/10/make-your-own-remote-server-monitor.html" rel="alternate" title="Make your own remote server monitor!" type="text/html"/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image height="16" rel="http://schemas.google.com/g/2005#thumbnail" src="https://img1.blogblog.com/img/b16-rounded.gif" width="16"/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6650413229535480271.post-6862593727663996295</id><published>2007-10-07T20:24:00.001-07:00</published><updated>2008-01-03T21:26:36.201-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="functions"/><title type="text">ExpandPath()</title><content type="html">I recently happened upon a cool CF function that returns the absolute path of a directory on your server after being passed a relative path: &lt;a href="http://livedocs.adobe.com/coldfusion/7/htmldocs/wwhelp/wwhimpl/common/html/wwhelp.htm?context=ColdFusion_Documentation&amp;file=part_cfm.htm"&gt;ExpandPath()&lt;/a&gt;&lt;br /&gt;This function is especially helpful when something requires an absolute path-- which is usually the case for file management tags (cffile, cfdirectory, cfftp), system functions (fileExists(), directoryExists(), getFileFromPath(), GetProfileString()) and some others (cfexecute, cfdocument.)&lt;br /&gt;For those of us working on shared servers, this tag is especially useful because: 1. Sometimes you don't know the absolute path and 2. Even if you did, there is no guarantee that it won't change someday. Speaking of things changing someday, this tag is extremely helpful when writing portable or compartmentalized code--which we should be doing anyways to save us from future headaches ("...damnit, I changed my webroot location and now I have to fix all my absolute references! Oh the horror...")&lt;div class="blogger-post-footer"&gt;Content provided by: &lt;a href="http://cfruss.blogspot.com/"&gt;cfruss.blogspot.com&lt;/a&gt;&lt;/div&gt;</content><link href="http://cfruss.blogspot.com/feeds/6862593727663996295/comments/default" rel="replies" title="Post Comments" type="application/atom+xml"/><link href="http://www.blogger.com/comment/fullpage/post/6650413229535480271/6862593727663996295" rel="replies" title="1 Comments" type="text/html"/><link href="http://www.blogger.com/feeds/6650413229535480271/posts/default/6862593727663996295" rel="edit" type="application/atom+xml"/><link href="http://www.blogger.com/feeds/6650413229535480271/posts/default/6862593727663996295" rel="self" type="application/atom+xml"/><link href="http://cfruss.blogspot.com/2007/10/expandpath.html" rel="alternate" title="ExpandPath()" type="text/html"/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image height="16" rel="http://schemas.google.com/g/2005#thumbnail" src="https://img1.blogblog.com/img/b16-rounded.gif" width="16"/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6650413229535480271.post-4279764931005605899</id><published>2007-09-21T00:01:00.000-07:00</published><updated>2007-12-20T01:06:16.636-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="coldfusion"/><category scheme="http://www.blogger.com/atom/ns#" term="server management"/><title type="text">How to clear your Coldfusion server cache (not a pretty job, but someone's gotta do it...)</title><content type="html">&lt;p class="whs17"&gt;I found the following information somewhere on the web (that means it &lt;span style="font-style: italic;"&gt;must &lt;/span&gt;be true!)&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="whs17"&gt;&lt;span style="font-weight: bold;"&gt;&lt;b&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="whs17"&gt;&lt;span style="font-weight: bold;"&gt;&lt;b&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;blockquote&gt;&lt;p class="whs17"&gt;&lt;span style="font-weight: bold;"&gt;&lt;b&gt;How to Clear   your CFMX Server Cache -&lt;/b&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;The CFMX server reads ColdFusion files and recompiles this information   to Java Class files. Sometimes, after making changes to the JAR files   within the ColdFusion library (/lib), or your CFM scripts, you may need   to perform the following steps to 'clear your cache' as we like to call   it. &lt;/p&gt; &lt;p&gt;The folder that contains the Java *.class files is in the location shown   below. Your path may vary depending on your installation location.&lt;/p&gt; &lt;p&gt;e.g. C:\CFusionMX\wwwroot\WEB-INF\cfclasses&lt;/p&gt; &lt;ol class="whs18" type="1"&gt;&lt;li class="kadov-p"&gt;&lt;p&gt;Make a backup of all the (*.class) files in a   separate folder. &lt;/p&gt;&lt;/li&gt;&lt;li class="kadov-p"&gt;&lt;p&gt;&lt;span style="font-weight: bold;"&gt;&lt;b&gt;Stop&lt;/b&gt;&lt;/span&gt; the   ColdFusion Application Server &lt;/p&gt;&lt;/li&gt;&lt;li class="kadov-p"&gt;&lt;p&gt;Delete all (*.class) files in the "cfclasses"   folder specified in above. &lt;/p&gt;&lt;/li&gt;&lt;li class="kadov-p"&gt;&lt;p&gt;&lt;span style="font-weight: bold;"&gt;&lt;b&gt;Start&lt;/b&gt;&lt;/span&gt;   the ColdFusion Application Server&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/blockquote&gt;&lt;ol class="whs18" type="1"&gt;&lt;/ol&gt; &lt;p&gt;&lt;/p&gt;But really though, it works. I did it today when I installed that hotfix from my last post. You can trust me.... lol. Now you're never going to do it.&lt;br /&gt;Anyways, from what I've read Coldfusion caches all your Coldfusion pages in this folder. If you make a lot of changes to your site, then you probably have a bunch of unused cache files. This can contribute to a slower site because the server has to search through those files whenever a page is accessed. One forum-fellow said he had 40,000 files in there, oh snap! I didn't have quite that many, but still, I'm glad I found out how to "clear my cache" (as they like to call it.)&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;/blockquote&gt;&lt;p&gt;   &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;Content provided by: &lt;a href="http://cfruss.blogspot.com/"&gt;cfruss.blogspot.com&lt;/a&gt;&lt;/div&gt;</content><link href="http://cfruss.blogspot.com/feeds/4279764931005605899/comments/default" rel="replies" title="Post Comments" type="application/atom+xml"/><link href="http://www.blogger.com/comment/fullpage/post/6650413229535480271/4279764931005605899" rel="replies" title="0 Comments" type="text/html"/><link href="http://www.blogger.com/feeds/6650413229535480271/posts/default/4279764931005605899" rel="edit" type="application/atom+xml"/><link href="http://www.blogger.com/feeds/6650413229535480271/posts/default/4279764931005605899" rel="self" type="application/atom+xml"/><link href="http://cfruss.blogspot.com/2007/09/how-to-clear-your-coldfusion-server.html" rel="alternate" title="How to clear your Coldfusion server cache (not a pretty job, but someone's gotta do it...)" type="text/html"/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image height="16" rel="http://schemas.google.com/g/2005#thumbnail" src="https://img1.blogblog.com/img/b16-rounded.gif" width="16"/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6650413229535480271.post-1476085599967505619</id><published>2007-09-19T18:25:00.000-07:00</published><updated>2009-06-09T14:24:58.316-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="coldfusion"/><category scheme="http://www.blogger.com/atom/ns#" term="sql"/><title type="text">cfQueryParam -- featuring zombies and oral surgeons</title><content type="html">Check out this &lt;a href="http://www.forta.com/blog/index.cfm/2005/12/21/SQL-Injection-Attacks-Easy-To-Prevent-But-Apparently-Still-Ignored"&gt;article&lt;/a&gt; by Ben Forta about SQL Injection Attacks. Yikes! It's scary to think that someone could simply put a few extra lines into a url and totally ruin a database. Thank goodness for cfQueryParam (not to be confused with cfParam!)&lt;br /&gt;So today I spent some time searching through query after query making sure that any of them with user input was filtered with cfQueryParam. Kind of mind-numbing, but alas, very necessary. The only snags that I hit had to do with using LIKE statements or functions in queries with cfQueryParam. Here is what I learned.&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;Example of how to use LIKE with cfQueryParam (for my oral surgeon):&lt;/span&gt;&lt;br /&gt;&lt;blockquote&gt;SELECT&lt;span style="font-weight: bold;"&gt; &lt;/span&gt;tooth&lt;br /&gt;FROM mouth&lt;br /&gt;WHERE tooth LIKE &amp;lt;cfqueryparam value="%#form.wisdomTooth#%" cfsqltype="CF_SQL_VARCHAR"&gt;&lt;/blockquote&gt;The trick here is that instead of putting the wildcard indicators (%) on the outside of the cfqueryparam tag, you have to include them in the value attribute. In fact, Coldfusion throws an error if you try to put anything outside the cfqueryparam tag.&lt;br /&gt;&lt;br /&gt;The following is a great illustration of what will NOT work (for zombies&lt;span style="font-weight: bold;"&gt; &lt;/span&gt;with discerning taste):&lt;br /&gt;&lt;blockquote&gt;SELECT brains&lt;br /&gt;FROM people&lt;br /&gt;WHERE tasteRating = tasteTest(&amp;lt;cfqueryparam value="#url.victimSkin#" cfsqltype="CF_SQL_INTEGER"&gt;)&lt;/blockquote&gt;You would need to put the tasteTest function INSIDE the cfqueryparam value attribute, like so: &amp;lt;cfqueryparam value="#tasteTest(url.taste)#" cfsqltype="CF_SQL_INTEGER"&gt;&lt;br /&gt;&lt;br /&gt;This brings me to another cute piece of information that I found today. There is bug in Coldfusion MX 6.1 regarding the use of functions inside cfqueryparam tags. If you are too good for MX 6.1 and only use "new" versions of Coldfusion, then this won't apply to you, Mr. Fancypants. For the rest of us: &lt;a href="http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_19108&amp;amp;sliceId=2"&gt;Coldfusion MX 6.1 Hot Fix for cfQuery / cfQueryParam&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;p.s. Although the cfsqltype is NOT a required attribute, someone somewhere said that it improves performance, which makes sense to me--so what the hell, why not use it? Apparently it is hard to come by  a chart of cfsqltypes and their associated SQL data types (it was not included in the Coldfusion MX 6.1 LiveDocs.)&lt;br /&gt;So here is the link to the Adobe LiveDocs page that DOES include a chart: &lt;a href="http://livedocs.adobe.com/coldfusion/7/htmldocs/wwhelp/wwhimpl/common/html/wwhelp.htm?context=ColdFusion_Documentation&amp;amp;file=00000317.htm"&gt;Coldfusion MX 7 cfQueryParam (with data type chart!)&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;Content provided by: &lt;a href="http://cfruss.blogspot.com/"&gt;cfruss.blogspot.com&lt;/a&gt;&lt;/div&gt;</content><link href="http://cfruss.blogspot.com/feeds/1476085599967505619/comments/default" rel="replies" title="Post Comments" type="application/atom+xml"/><link href="http://www.blogger.com/comment/fullpage/post/6650413229535480271/1476085599967505619" rel="replies" title="5 Comments" type="text/html"/><link href="http://www.blogger.com/feeds/6650413229535480271/posts/default/1476085599967505619" rel="edit" type="application/atom+xml"/><link href="http://www.blogger.com/feeds/6650413229535480271/posts/default/1476085599967505619" rel="self" type="application/atom+xml"/><link href="http://cfruss.blogspot.com/2007/09/like-it-ps-theres-bug-in-61.html" rel="alternate" title="cfQueryParam -- featuring zombies and oral surgeons" type="text/html"/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image height="16" rel="http://schemas.google.com/g/2005#thumbnail" src="https://img1.blogblog.com/img/b16-rounded.gif" width="16"/></author><thr:total>5</thr:total></entry></feed>