<?xml version='1.0' encoding='UTF-8'?><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/" xmlns:blogger="http://schemas.google.com/blogger/2008" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" version="2.0"><channel><atom:id>tag:blogger.com,1999:blog-5424132702988443424</atom:id><lastBuildDate>Fri, 30 Aug 2024 04:15:06 +0000</lastBuildDate><category>coldfusion</category><category>coldmvc</category><category>coldspring</category><category>hibernate</category><category>javascript</category><category>jquery</category><category>not-so-awesome</category><category>awesome</category><category>frameworks</category><category>model-glue</category><category>oop</category><category>prototype</category><category>grails</category><category>groovy</category><category>orm</category><category>books</category><category>css</category><category>event handlers</category><category>fail</category><category>memcached</category><category>rails</category><category>spring</category><category>wishlist</category><category>37signals</category><category>amazon</category><category>aop</category><category>apache</category><category>bug</category><category>cells</category><category>cf9</category><category>code</category><category>coldbox</category><category>documentation</category><category>ehcache</category><category>facebook</category><category>formatting</category><category>git</category><category>github</category><category>ie</category><category>languages</category><category>lesscss</category><category>links</category><category>markdown</category><category>naming conventions</category><category>php</category><category>quickstart</category><category>random</category><category>ruby</category><category>syntax</category><category>twitter</category><category>usability</category><category>zend framework</category><title>Bears. Beets. Battlestar Galactica.</title><description></description><link>http://bears-eat-beets.blogspot.com/</link><managingEditor>noreply@blogger.com (Tony Nelson)</managingEditor><generator>Blogger</generator><openSearch:totalResults>86</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5424132702988443424.post-6256378709643960684</guid><pubDate>Sat, 12 May 2012 14:25:00 +0000</pubDate><atom:updated>2012-05-12T11:51:57.343-05:00</atom:updated><title>ColdFusion From an Outsider&#39;s Perspective</title><description>After changing my primary development language to PHP over a year ago, I&#39;ve been able to get a new perspective on ColdFusion. One thing I&#39;ve noticed is that people in the community spend less time focusing on new language enhancements and instead spend more time trying to make the language easier to work with. While this is a good thing, there are two pain-points that seem to come up over and over again that simply aren&#39;t issues in most other languages:&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Case sensitivity&lt;/li&gt;
&lt;li&gt;Struct key order &lt;/li&gt;
&lt;/ul&gt;
Would it really be so bad if ColdFusion was case sensitive? It would make converting ColdFusion objects to JSON or XML a lot more straightforward. &lt;i&gt;&quot;But Tony, I want to be able to define a function named &lt;/i&gt;&lt;i&gt;getName but then be able to call it using&lt;/i&gt;&lt;i&gt; gEtNaMe()&quot;&lt;/i&gt;. There should be no place for inconsistency in code. I honestly don&#39;t see any benefits to it not being case sensitive. Besides, with the addition of Hibernate, parts of the language are starting to become case sensitive already.&lt;br /&gt;
&lt;br /&gt;
Would it really be so bad if structs maintained their correct key order?&lt;i&gt; &lt;/i&gt;I see people building relatively complex solutions trying to solve this problem, often times having to dip into Java to accomplish the task. Wouldn&#39;t it be better if the native data type just worked the way you wanted it to? &lt;i&gt;&quot;But Tony, that&#39;s not how a HashMap works.&quot; &lt;/i&gt;Says who? Object keys stay ordered in JavaScript and associative array keys stay ordered in PHP. ColdFusion should work the same way.&lt;br /&gt;
&lt;br /&gt;
In my opinion, making these changes adds a lot more value to the language than some of the other recent enhancements, such as WebSockets or REST.</description><link>http://bears-eat-beets.blogspot.com/2012/05/coldfusion-from-outsiders-prospective.html</link><author>noreply@blogger.com (Tony Nelson)</author><thr:total>9</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5424132702988443424.post-843850712814947921</guid><pubDate>Wed, 21 Sep 2011 13:37:00 +0000</pubDate><atom:updated>2011-10-05T22:16:16.714-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">javascript</category><category domain="http://www.blogger.com/atom/ns#">jquery</category><title>Encode HTML Characters in JavaScript using jQuery</title><description>Here&#39;s a quick post on how to encode and decode HTML characters in JavaScript using jQuery. I didn&#39;t come up with the solution, but I thought it was pretty clever.

&lt;pre name=&quot;code&quot; class=&quot;js&quot;&gt;
function htmlEncode(value){
    return $(&#39;&amp;lt;div/&amp;gt;&#39;).text(value).html();
}

function htmlDecode(value){
    return $(&#39;&amp;lt;div/&amp;gt;&#39;).html(value).text();
}
&lt;/pre&gt;

Courtesy of &lt;a href=&quot;http://stackoverflow.com/questions/1219860/javascript-jquery-html-encoding&quot; target=&quot;_blank&quot;&gt;http://stackoverflow.com/questions/1219860/javascript-jquery-html-encoding&lt;/a&gt;</description><link>http://bears-eat-beets.blogspot.com/2011/09/encode-html-characters-in-javascript.html</link><author>noreply@blogger.com (Tony Nelson)</author><thr:total>2</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5424132702988443424.post-9086295887768335094</guid><pubDate>Wed, 10 Aug 2011 22:47:00 +0000</pubDate><atom:updated>2011-08-10T18:03:51.259-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">jquery</category><category domain="http://www.blogger.com/atom/ns#">naming conventions</category><title>jQuery Naming Conventions: Don&#39;t Prefix Variables With $</title><description>When working with jQuery, I hate it when developers prefix their variables with dollar signs. For example, &lt;code&gt;var $buttons = $(&#39;.button&#39;);&lt;/code&gt;. In my opinion the dollar sign really hurts the readability of the code.&lt;br /&gt;&lt;br /&gt;Some developers claim that adding the dollar sign is a good naming convention because it shows that the value represents a jQuery object. If that&#39;s the case, then everybody should start using &lt;a href=&quot;http://en.wikipedia.org/wiki/Hungarian_notation&quot; target=&quot;_blank&quot;&gt;Hungarian notation&lt;/a&gt; all of the time. Gross.&lt;br /&gt;&lt;br /&gt;The one exception I might make is for &lt;code&gt;var $this = $(this);&lt;/code&gt;, although even then I would rather prefer something like &lt;code&gt;var me = $(this);&lt;/code&gt;.&lt;br /&gt;&lt;br /&gt;Long story short, don&#39;t prefix your variables with a dollar sign. Besides, it&#39;s not like you&#39;re working with PHP or anything.</description><link>http://bears-eat-beets.blogspot.com/2011/08/jquery-naming-conventions-dont-prefix.html</link><author>noreply@blogger.com (Tony Nelson)</author><thr:total>3</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5424132702988443424.post-3494863125433148675</guid><pubDate>Tue, 07 Jun 2011 02:52:00 +0000</pubDate><atom:updated>2011-06-06T21:53:55.363-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">coldmvc</category><title>ColdMVC Updates 1.3.7</title><description>Here&#39;s a quick post describing some small but relatively cool updates to ColdMVC in version 1.3.7: &lt;a href=&quot;http://bit.ly/ColdMVC-Updates-1_3_7&quot; title=&quot;ColdMVC Updates 1.3.7&quot;&gt;http://bit.ly/ColdMVC-Updates-1_3_7&lt;/a&gt;</description><link>http://bears-eat-beets.blogspot.com/2011/06/coldmvc-updates-137.html</link><author>noreply@blogger.com (Tony Nelson)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5424132702988443424.post-4739281647228727738</guid><pubDate>Tue, 31 May 2011 04:27:00 +0000</pubDate><atom:updated>2011-05-30T23:29:31.207-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">coldmvc</category><category domain="http://www.blogger.com/atom/ns#">documentation</category><title>ColdMVC Documentation Updates</title><description>I recently added some more documentation for ColdMVC:&lt;br /&gt;&lt;br /&gt;* An overview of models in ColdMVC: &lt;a href=&quot;http://www.coldmvc.com/guide/models&quot; title=&quot;Models&quot; target=&quot;_blank&quot;&gt;http://www.coldmvc.com/guide/models&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;* Query operators in ColdMVC: &lt;a href=&quot;http://www.coldmvc.com/guide/operators&quot; title=&quot;Operators&quot; target=&quot;_blank&quot;&gt;http://www.coldmvc.com/guide/operators&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;* Building complex queries in ColdMVC: &lt;a href=&quot;http://www.coldmvc.com/guide/queries&quot; title=&quot;Queries&quot; target=&quot;_blank&quot;&gt;http://www.coldmvc.com/guide/queries&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;* Getters and setters in ColdMVC: &lt;a href=&quot;http://www.coldmvc.com/guide/getters-and-setters&quot; title=&quot;Getters and Setters&quot; target=&quot;_blank&quot;&gt;http://www.coldmvc.com/guide/getters-and-setters&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;* Specify required params for an action: &lt;a href=&quot;http://www.coldmvc.com/annotations/params&quot; title=&quot;@params&quot; target=&quot;_blank&quot;&gt;http://www.coldmvc.com/annotations/params&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;* Specify allowed request methods for an action: &lt;a href=&quot;http://www.coldmvc.com/annotations/methods&quot; title=&quot;@methods&quot; target=&quot;_blank&quot;&gt;http://www.coldmvc.com/annotations/methods&lt;/a&gt;</description><link>http://bears-eat-beets.blogspot.com/2011/05/coldmvc-documentation-updates.html</link><author>noreply@blogger.com (Tony Nelson)</author><thr:total>3</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5424132702988443424.post-4630841488119967255</guid><pubDate>Fri, 29 Apr 2011 02:21:00 +0000</pubDate><atom:updated>2011-04-28T21:47:49.731-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">coldfusion</category><category domain="http://www.blogger.com/atom/ns#">coldmvc</category><category domain="http://www.blogger.com/atom/ns#">zend framework</category><title>Advanced INI Parsing in ColdFusion</title><description>At work, I&#39;ve been using the &lt;a href=&quot;http://framework.zend.com/&quot; title=&quot;Zend Framework&quot; target=&quot;_blank&quot;&gt;Zend Framework&lt;/a&gt; for PHP a lot. One of the best features in my opinion is how you&#39;re able to manage your configuration settings between different environments within a project.&lt;br /&gt;&lt;br /&gt;I&#39;ve always been a fan of using INI files for storing configuration settings, but the &lt;a href=&quot;http://framework.zend.com/manual/en/zend.config.adapters.ini.html&quot;&gt;Zend_Config_Ini&lt;/a&gt; class that Zend Framework comes with takes INI files to a whole new level by adding section inheritance and nested properties.&lt;br /&gt;&lt;br /&gt;After a couple hours, I was able to take the same powerful functionality that Zend Framework provides and port it to ColdFusion, mainly for the purpose of adding it to my &lt;a href=&quot;http://www.coldmvc.com&quot; title=&quot;ColdMVC&quot; target=&quot;_blank&quot;&gt;ColdMVC&lt;/a&gt; framework.&lt;br /&gt;&lt;br /&gt;Why do I think this is cool? Let&#39;s look at a sample INI file that you might see on a project:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;; Settings for the production environment&lt;br /&gt;[production]&lt;br /&gt;autoReload = false&lt;br /&gt;development = false&lt;br /&gt;reminderService.sendReminders = true&lt;br /&gt;facebook.api.username = prod@mycompany.com&lt;br /&gt;facebook.api.password = 90ujlc890$f&lt;br /&gt;&lt;br /&gt;; Settings for the staging environment&lt;br /&gt;[staging : production]&lt;br /&gt;reminderService.sendReminders = false&lt;br /&gt;facebook.api.username = staging@mycompany.com&lt;br /&gt;facebook.api.password = 879kjasdf!&lt;br /&gt;&lt;br /&gt;; Basic settings for the development environment.&lt;br /&gt;; Each developer should create their own environment that extends this one.&lt;br /&gt;[development : staging]&lt;br /&gt;development = true&lt;br /&gt;autoReload = true&lt;br /&gt;&lt;br /&gt;; Settings for Tony&#39;s development environment&lt;br /&gt;[development-tony : development]&lt;br /&gt;emailService.options.forceTo = [ &quot;tony@mycompany.com&quot;, &quot;tony@gmail.com&quot; ]&lt;br /&gt;facebook.api.username = tony@mycompany.com&lt;br /&gt;facebook.api.password = w1nn1ng&lt;br /&gt;&lt;br /&gt;; Settings for Ryan&#39;s development environment&lt;br /&gt;[development-ryan : development]&lt;br /&gt;emailService.options.forceTo = ryan@mycompany.com&lt;br /&gt;facebook.api.username = ryan@mycompany.com&lt;br /&gt;facebook.api.password = govikes&lt;br /&gt;&lt;br /&gt;; Settings for Joe&#39;s development environment&lt;br /&gt;[development-joe : development]&lt;br /&gt;emailService.options.forceTo = joe@mycompany.com&lt;br /&gt;facebook.api.username = joe@mycompany.com&lt;br /&gt;facebook.api.password = welcome&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Pretty straightforward settings file. Each environment has its own section, but now it comes with a twist.&lt;br /&gt;&lt;br /&gt;See the colons in the section names? That&#39;s inheritance in action. If you look at the &lt;code&gt;development-tony&lt;/code&gt; environment, you&#39;ll see that it extends the &lt;code&gt;development&lt;/code&gt; environment, which extends the &lt;code&gt;staging&lt;/code&gt; environment, which extends the &lt;code&gt;production&lt;/code&gt; environment.&lt;br /&gt;&lt;br /&gt;Also, notice the periods in the property names. Those are nested properties, which will be automatically converted to ColdFusion structs at runtime.&lt;br /&gt;&lt;br /&gt;So how does this work? Pretty simple:&lt;br /&gt;&lt;br /&gt;&lt;pre class=&quot;js&quot; name=&quot;code&quot;&gt;&lt;br /&gt;var ini = new Ini(&quot;/path/to/config.ini&quot;);&lt;br /&gt;var config = ini.getSection(&quot;development-tnelson&quot;);&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;If I were to now dump the &lt;code&gt;config&lt;/code&gt; variable that was returned, I&#39;d see the following output:&lt;br /&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiZql2rq1AmcfvajDZc7L7JbIFgadUFS3kGPwtG6kxI4P1oPpIGWGIXI1IbHLNnXbXJqsKfnonkrF0nCE2-9ru2M_w5dj7WJv3pMFpU-qNaZ6nZAhzCol58_ISA9x8ko3ERHwg7TgC7tkY/s1600/Capture.JPG&quot;&gt;&lt;img style=&quot;cursor:pointer; cursor:hand;width: 337px; height: 400px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiZql2rq1AmcfvajDZc7L7JbIFgadUFS3kGPwtG6kxI4P1oPpIGWGIXI1IbHLNnXbXJqsKfnonkrF0nCE2-9ru2M_w5dj7WJv3pMFpU-qNaZ6nZAhzCol58_ISA9x8ko3ERHwg7TgC7tkY/s400/Capture.JPG&quot; border=&quot;0&quot; alt=&quot;&quot;id=&quot;BLOGGER_PHOTO_ID_5600830385294601074&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Pretty sweet if you ask me.&lt;br /&gt;&lt;br /&gt;You can find all of the code on GitHub at &lt;a href=&quot;https://github.com/tonynelson19/ini/&quot;&gt;https://github.com/tonynelson19/ini/&lt;/a&gt;, which also includes &lt;a href=&quot;https://github.com/tonynelson19/ini/blob/master/test/IniTest.cfc&quot;&gt;26 green unit tests&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Also, I&#39;ve included the new INI parser in the latest version of &lt;a href=&quot;http://www.coldmvc.com&quot; title=&quot;ColdMVC&quot; target=&quot;_blank&quot;&gt;ColdMVC&lt;/a&gt;, which you should definitely check out if you haven&#39;t yet.</description><link>http://bears-eat-beets.blogspot.com/2011/04/advanced-ini-parsing-in-coldfusion.html</link><author>noreply@blogger.com (Tony Nelson)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiZql2rq1AmcfvajDZc7L7JbIFgadUFS3kGPwtG6kxI4P1oPpIGWGIXI1IbHLNnXbXJqsKfnonkrF0nCE2-9ru2M_w5dj7WJv3pMFpU-qNaZ6nZAhzCol58_ISA9x8ko3ERHwg7TgC7tkY/s72-c/Capture.JPG" height="72" width="72"/><thr:total>4</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5424132702988443424.post-3810956139588920938</guid><pubDate>Wed, 20 Apr 2011 03:35:00 +0000</pubDate><atom:updated>2011-04-19T22:38:02.410-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">coldmvc</category><category domain="http://www.blogger.com/atom/ns#">quickstart</category><title>ColdMVC Quick Start Tutorial</title><description>I recently wrote a Quick Start tutorial for ColdMVC, my convention-based MVC framework for ColdFusion 9. Check it out and let me know what you think.&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://www.coldmvc.com/quickstart&quot; title=&quot;ColdMVC Quick Start&quot;&gt;http://www.coldmvc.com/quickstart&lt;/a&gt;</description><link>http://bears-eat-beets.blogspot.com/2011/04/coldmvc-quick-start-tutorial.html</link><author>noreply@blogger.com (Tony Nelson)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5424132702988443424.post-407747189079481478</guid><pubDate>Mon, 28 Feb 2011 04:00:00 +0000</pubDate><atom:updated>2011-02-27T22:17:44.476-06:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">formatting</category><category domain="http://www.blogger.com/atom/ns#">javascript</category><title>Code Formatting and New Lines</title><description>Last week I had a healthy debate with some co-workers about code formatting, which to a lot of developers can be a pretty religious subject. While you could argue that coding style should be a personal preference, I believe it&#39;s more important to use consistent coding practices when working in a team environment.&lt;br /&gt;&lt;br /&gt;One formatting style we discussed was the use of new lines in code blocks. Here are three common formatting styles for the same code:&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Style 1&lt;/b&gt;&lt;br /&gt;&lt;pre name=&quot;code&quot; class=&quot;js&quot;&gt;&lt;br /&gt;if (true) {&lt;br /&gt;    console.log(&#39;yay!&#39;);&lt;br /&gt;} else {&lt;br /&gt;    console.log(&#39;boo!&#39;);&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Style 2&lt;/b&gt;&lt;br /&gt;&lt;pre name=&quot;code&quot; class=&quot;js&quot;&gt;&lt;br /&gt;if (true) {&lt;br /&gt;    console.log(&#39;yay!&#39;);&lt;br /&gt;}&lt;br /&gt;else {&lt;br /&gt;    console.log(&#39;boo!&#39;);&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Style 3&lt;/b&gt;&lt;br /&gt;&lt;pre name=&quot;code&quot; class=&quot;js&quot;&gt;&lt;br /&gt;if (true)&lt;br /&gt;{&lt;br /&gt;    console.log(&#39;yay!&#39;);&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;{&lt;br /&gt;    console.log(&#39;boo!&#39;);&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;When I first starting coding, I preferred Style 3, since it provides more visual separation. Currently I prefer Style 2, although it&#39;s not even a formatting option at &lt;a href=&quot;http://jsbeautifier.org/&quot; title=&quot;Online javascript beautifier&quot; target=&quot;_blank&quot;&gt;http://jsbeautifier.org/&lt;/a&gt;, which makes me question my choice a little. &lt;a href=&quot;http://javascript.crockford.com/code.html&quot; title=&quot;Code Conventions for the JavaScript Programming Language&quot; target=&quot;_blank&quot;&gt;Douglas Crockford seems to prefer Style 1&lt;/a&gt;, so maybe I should consider making the switch.&lt;br /&gt;&lt;br /&gt;Which do you prefer?</description><link>http://bears-eat-beets.blogspot.com/2011/02/code-formatting-and-new-lines.html</link><author>noreply@blogger.com (Tony Nelson)</author><thr:total>20</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5424132702988443424.post-4060674296843662572</guid><pubDate>Tue, 08 Feb 2011 03:30:00 +0000</pubDate><atom:updated>2011-02-07T21:43:51.511-06:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">code</category><category domain="http://www.blogger.com/atom/ns#">coldfusion</category><category domain="http://www.blogger.com/atom/ns#">syntax</category><title>Don&#39;t Mix Tags and Script in the Same Component</title><description>Every now and then, I&#39;ll see some code in an open source ColdFusion project that mixes tag syntax and script syntax in the same component. Personally, I find it really annoying when people jump in and out of cfscript blocks. If the component isn&#39;t written entirely in script, then don&#39;t use any script - stick with tags.&lt;br /&gt;&lt;br /&gt;Some people think that since writing in script is cleaner, it&#39;s cleaner to write part of the function in script than write it using tags. However, if you&#39;re declaring your component and functions in tags, switching to script inside the function actually decreases your code readability in my opinion. Take the following hypothetical example, which is sadly all-too-common in certain open source projects:&lt;br /&gt;&lt;br /&gt;&lt;pre name=&quot;code&quot; class=&quot;coldfusion&quot;&gt;&lt;br /&gt;&amp;lt;cffunction name=&quot;setFoo&quot; access=&quot;public&quot; output=&quot;false&quot; returntype=&quot;void&quot;&amp;gt;&lt;br /&gt; &amp;lt;cfargument name=&quot;foo&quot; required=&quot;true&quot; type=&quot;string&quot; /&amp;gt;&lt;br /&gt;&lt;br /&gt; &amp;lt;cfscript&amp;gt;&lt;br /&gt;  variables.foo = arguments.foo;&lt;br /&gt; &amp;lt;/cfscript&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/cffunction&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;cffunction name=&quot;getFoo&quot; access=&quot;public&quot; output=&quot;false&quot; returntype=&quot;string&quot;&amp;gt;&lt;br /&gt;&lt;br /&gt; &amp;lt;cfscript&amp;gt;&lt;br /&gt;  return variables.foo;&lt;br /&gt; &amp;lt;/cfscript&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/cffunction&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;I find this style of coding ridiculous.</description><link>http://bears-eat-beets.blogspot.com/2011/02/dont-mix-tags-and-script-in-same.html</link><author>noreply@blogger.com (Tony Nelson)</author><thr:total>20</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5424132702988443424.post-4953501721134007358</guid><pubDate>Wed, 12 Jan 2011 03:10:00 +0000</pubDate><atom:updated>2011-01-11T21:12:30.639-06:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">amazon</category><category domain="http://www.blogger.com/atom/ns#">fail</category><title>Amazon Order Arrival Date</title><description>&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEinTVhe_RY3Ct49oOsR_0lQuwzEmrVCPD1iiTTHEz_acqh5TP3feYPbLJM0e0IwAYfWJWBxh0dPQ2dUuD0WmzxN133N_2pu5QCJ1DEmOAjboKoV528prHq3xbFF-HI3STGlhGv57IWpkHo/s1600/amazon.jpg&quot;&gt;&lt;img style=&quot;cursor:pointer; cursor:hand;width: 400px; height: 129px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEinTVhe_RY3Ct49oOsR_0lQuwzEmrVCPD1iiTTHEz_acqh5TP3feYPbLJM0e0IwAYfWJWBxh0dPQ2dUuD0WmzxN133N_2pu5QCJ1DEmOAjboKoV528prHq3xbFF-HI3STGlhGv57IWpkHo/s400/amazon.jpg&quot; border=&quot;0&quot; alt=&quot;&quot;id=&quot;BLOGGER_PHOTO_ID_5561131885345945858&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I expected better from you, Amazon...&lt;br /&gt;&lt;br /&gt;Fail.</description><link>http://bears-eat-beets.blogspot.com/2011/01/amazon-order-arrival-date.html</link><author>noreply@blogger.com (Tony Nelson)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEinTVhe_RY3Ct49oOsR_0lQuwzEmrVCPD1iiTTHEz_acqh5TP3feYPbLJM0e0IwAYfWJWBxh0dPQ2dUuD0WmzxN133N_2pu5QCJ1DEmOAjboKoV528prHq3xbFF-HI3STGlhGv57IWpkHo/s72-c/amazon.jpg" height="72" width="72"/><thr:total>2</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5424132702988443424.post-4030703910923154279</guid><pubDate>Sat, 08 Jan 2011 21:05:00 +0000</pubDate><atom:updated>2011-01-08T15:27:18.881-06:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">coldfusion</category><category domain="http://www.blogger.com/atom/ns#">markdown</category><title>Using Markdown in ColdFusion</title><description>&lt;a href=&quot;http://daringfireball.net/projects/markdown/&quot; title=&quot;Markdown&quot; target=&quot;_blank&quot;&gt;Markdown&lt;/a&gt; is &quot;a text-to-HTML conversion tool for web writers. Markdown allows you to write using an easy-to-read, easy-to-write plain text format, then convert it to structurally valid XHTML (or HTML).&quot;&lt;br /&gt;&lt;br /&gt;Here&#39;s a quick post describing how you can use Markdown in ColdFusion.&lt;br /&gt;&lt;br /&gt;First, download &lt;a href=&quot;http://markdownj.org/&quot; title=&quot;MarkdownJ: Text2HTML for Java&quot; target=&quot;_blank&quot;&gt;MarkdownJ&lt;/a&gt;, a Java port of the Markdown conversion utility originally written in Perl. Here&#39;s a direct link to the download site: &lt;a href=&quot;http://code.google.com/p/markdownj/&quot; title=&quot;markdownj - Project Hosting on Google Code&quot; target=&quot;_blank&quot;&gt;http://code.google.com/p/markdownj/&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Next, either put the markdownj.jar file in the ColdFusion classpath or download &lt;a href=&quot;http://javaloader.riaforge.org/&quot; title=&quot;JavaLoader&quot; target=&quot;_blank&quot;&gt;JavaLoader&lt;/a&gt;. I prefer using JavaLoader, so that&#39;s what my example will show.&lt;br /&gt;&lt;br /&gt;Finally, some code:&lt;br /&gt;&lt;br /&gt;&lt;pre name=&quot;code&quot; class=&quot;coldfusion&quot;&gt;&lt;br /&gt;&amp;lt;cfset paths = [ expandPath(&amp;quot;markdownj-1.0.2b4-0.3.0.jar&amp;quot;) ] /&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;cfset javaLoader = new javaloader.JavaLoader(paths, true) /&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;cfset markdownProcessor = javaLoader.create(&amp;quot;com.petebevin.markdown.MarkdownProcessor&amp;quot;).init() /&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;cfset html = markdownProcessor.markdown(&amp;quot;This is a *simple* example&amp;quot;) /&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;cfoutput&amp;gt;&lt;br /&gt;#html#&lt;br /&gt;&amp;lt;/cfoutput&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;The above code will produce the following HTML output:&lt;br /&gt;&lt;br /&gt;&lt;pre name=&quot;code&quot; class=&quot;html&quot;&gt;&lt;br /&gt;&amp;lt;p&amp;gt;This is a &amp;lt;em&amp;gt;simple&amp;lt;/em&amp;gt; example&amp;lt;/p&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;OK. So if that&#39;s the simple example, what about a more complex example?&lt;br /&gt;&lt;br /&gt;&lt;pre name=&quot;code&quot; class=&quot;html&quot;&gt;&lt;br /&gt;# This is an h1&lt;br /&gt;&lt;br /&gt;## This is an h2&lt;br /&gt;&lt;br /&gt;This is a normal paragraph. Lorem ipsum dolor sit amet,&lt;br /&gt;consectetur adipisicing elit, sed do eiusmod tempor&lt;br /&gt;incididunt ut labore et dolore magna aliqua.&lt;br /&gt;&lt;br /&gt;*  This is a unordered list. Hanging indents allow&lt;br /&gt; you to wrap a list item onto multiple lines&lt;br /&gt;* List item 2&lt;br /&gt;* List item 3&lt;br /&gt;&lt;br /&gt;---&lt;br /&gt;These are horizontal rules&lt;br /&gt;***&lt;br /&gt;&lt;br /&gt;This is how to *italicize* something. This is _another way_ to italicize something.&lt;br /&gt;&lt;br /&gt;This is how to **bold** something. This is __another way__ to bold something.&lt;br /&gt;&lt;br /&gt;1. This is an ordered list&lt;br /&gt;2. List item 2&lt;br /&gt;3. List item 3&lt;br /&gt;&lt;br /&gt;This is [an example](http://example.com/ &amp;quot;Title&amp;quot;) inline link.&lt;br /&gt;&lt;br /&gt;[This link](http://example.net/) has no title attribute.&lt;br /&gt;&lt;br /&gt;&amp;gt; This is a block quote. Lorem ipsum dolor sit amet,&lt;br /&gt;&amp;gt; consectetur adipisicing elit, sed do eiusmod tempor&lt;br /&gt;&amp;gt; incididunt ut labore et dolore magna aliqua.&lt;br /&gt;&lt;br /&gt; This is a code block.&lt;br /&gt; To produce a code block in Markdown, simply&lt;br /&gt; indent every line of the block by at least&lt;br /&gt; 4 spaces or 1 tab&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;And that&#39;s the basics of Markdown. Here&#39;s a full set of syntax rules: &lt;a href=&quot;http://daringfireball.net/projects/markdown/syntax&quot; title=&quot;Markdown Syntax Documentation&quot; target=&quot;_blank&quot;&gt;http://daringfireball.net/projects/markdown/syntax&lt;/a&gt;. Pretty sweet if you ask me.</description><link>http://bears-eat-beets.blogspot.com/2011/01/using-markdown-in-coldfusion.html</link><author>noreply@blogger.com (Tony Nelson)</author><thr:total>8</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5424132702988443424.post-273871126765038238</guid><pubDate>Wed, 22 Dec 2010 04:44:00 +0000</pubDate><atom:updated>2010-12-21T22:47:46.451-06:00</atom:updated><title>My Mini Library</title><description>&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgiwCxaXpi0Ewi8SxxBEJ9lo1Cx3p2evHpnztYhLGrV5339QPk3gMO6Y5xq9uk4z8Ce4n68EebG9Xnez3PNihRliGQMFAnig2wubqtH3qeyuZ1ttsaIURr14NdTMpU3e_ZNgJCaNt-FmtU/s1600/IMG_3069.JPG&quot;&gt;&lt;img style=&quot;cursor:pointer; cursor:hand;width: 350px; height: 500px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgiwCxaXpi0Ewi8SxxBEJ9lo1Cx3p2evHpnztYhLGrV5339QPk3gMO6Y5xq9uk4z8Ce4n68EebG9Xnez3PNihRliGQMFAnig2wubqtH3qeyuZ1ttsaIURr14NdTMpU3e_ZNgJCaNt-FmtU/s400/IMG_3069.JPG&quot; border=&quot;0&quot; alt=&quot;&quot;id=&quot;BLOGGER_PHOTO_ID_5553363157785614082&quot; /&gt;&lt;/a&gt;</description><link>http://bears-eat-beets.blogspot.com/2010/12/my-mini-library.html</link><author>noreply@blogger.com (Tony Nelson)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgiwCxaXpi0Ewi8SxxBEJ9lo1Cx3p2evHpnztYhLGrV5339QPk3gMO6Y5xq9uk4z8Ce4n68EebG9Xnez3PNihRliGQMFAnig2wubqtH3qeyuZ1ttsaIURr14NdTMpU3e_ZNgJCaNt-FmtU/s72-c/IMG_3069.JPG" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5424132702988443424.post-9029226792777111142</guid><pubDate>Wed, 17 Nov 2010 03:01:00 +0000</pubDate><atom:updated>2010-11-16T21:19:39.846-06:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">css</category><category domain="http://www.blogger.com/atom/ns#">facebook</category><category domain="http://www.blogger.com/atom/ns#">grails</category><category domain="http://www.blogger.com/atom/ns#">links</category><title>Link Dump (11-16-2010)</title><description>&lt;a href=&quot;http://highscalability.com/blog/2010/11/16/facebooks-new-real-time-messaging-system-hbase-to-store-135.html&quot; title=&quot;Facebook&#39;s New Real-time Messaging System: HBase to Store 135+ Billion Messages a Month&quot; target=&quot;_blank&quot;&gt;Facebook&#39;s New Real-time Messaging System: HBase to Store 135+ Billion Messages a Month&lt;/a&gt;&lt;br /&gt;&quot;Keeping with their small teams doing amazing things approach, 20 new infrastructures services are being released by 15 engineers in one year.&quot; Also, very interesting that Facebook chose HBase over their own Cassandra. &lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://googlecode.blogspot.com/2010/11/instant-previews-under-hood.html&quot; title=&quot;Instant Previews: Under the hood &quot; target=&quot;_blank&quot;&gt;Instant Previews: Under the hood &lt;/a&gt;&lt;br /&gt;Google uses base64 encoded data URIs to display the instant preview images rather than static images to reduce the number of web requests. &quot;...even though base64 encoding adds about 33% to the size of the image, our tests showed that gzip-compressed data URIs are comparable in size to the original JPEGs.&quot;&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://sixrevisions.com/css/10-random-css-tricks-you-might-want-to-know-about/&quot; title=&quot;10 Random CSS Tricks You Might Want to Know About&quot; target=&quot;_blank&quot;&gt;10 Random CSS Tricks You Might Want to Know About&lt;/a&gt;&lt;br /&gt;Target IE6 and IE7 without conditional comments: add a * before the property for IE7 and below, add a _ before the property for IE6 and below.&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://blog.springsource.com/2010/11/15/yet-another-flavour-of-gorm-mongodb/&quot; title=&quot;Yet Another Flavour of GORM: MongoDB&quot; target=&quot;_blank&quot;&gt;Yet Another Flavour of GORM: MongoDB&lt;/a&gt;&lt;br /&gt;Very cool to see Grails support MongoDB, although it would be cooler if Hibernate had native support for more NoSQL databases.&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://techcrunch.com/2010/11/06/why-products-suck-and-how-to-make-them-suck-less/&quot; title=&quot;Why Products Suck (And How To Make Them Suck Less)&quot; target=&quot;_blank&quot;&gt;Why Products Suck (And How To Make Them Suck Less)&lt;/a&gt;&lt;br /&gt;&quot;People only complain about things that matter to them; better to have complaints than disinterest. And not all complaints are equal: complaints that you don’t support feature X are far better than complaints about how feature Y sucks.&quot;</description><link>http://bears-eat-beets.blogspot.com/2010/11/link-dump-11-16-2010.html</link><author>noreply@blogger.com (Tony Nelson)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5424132702988443424.post-4823960540865736129</guid><pubDate>Tue, 16 Nov 2010 02:38:00 +0000</pubDate><atom:updated>2010-11-15T21:09:52.840-06:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">cells</category><category domain="http://www.blogger.com/atom/ns#">coldmvc</category><category domain="http://www.blogger.com/atom/ns#">rails</category><title>ColdMVC Plugins and Cells in Rails</title><description>I haven&#39;t posted in awhile because I haven&#39;t felt like I&#39;ve had anything good to write about, but I&#39;ve been reading &lt;a href=&quot;http://www.pragprog.com/titles/ahptl/pragmatic-thinking-and-learning&quot; title=&quot;Pragmatic Thinking and Learning: Refactor Your Wetware&quot; target=&quot;_blank&quot;&gt;Pragmatic Thinking and Learning: Refactor Your Wetware&lt;/a&gt; and one trick to getting over a writer&#39;s block is to just write for the sake of writing. So that&#39;s what I&#39;m going to attempt to do in the coming weeks.&lt;br /&gt;&lt;br /&gt;Lately I&#39;ve been continuing to work on &lt;a href=&quot;https://github.com/tonynelson19/ColdMVC&quot; title=&quot;ColdMVC&quot; target=&quot;_blank&quot;&gt;ColdMVC&lt;/a&gt;, my convention-based framework for ColdFusion inspired by Ruby on Rails and Grails. I&#39;ve mainly been working on updating the plugin architecture for ColdMVC, with a focus on keeping things modular. I&#39;ve also split out all of the plugins to their own repositories on GitHub to try to make things easier to manage. Right now they all follow a &quot;ColdMVC-{Plugin}&quot; naming convention and can be found &lt;a href=&quot;https://github.com/tonynelson19/&quot; title=&quot;tonynelson19&#39;s Profile&quot; target=&quot;_blank&quot;&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;I&#39;m also trying to get an official ColdMVC website up with some documentation and links to all the various plugins, but haven&#39;t quite got around to it yet.&lt;br /&gt;&lt;br /&gt;On a final note, I&#39;ve found a couple really good blog posts talking about cells in Ruby on Rails.&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;&lt;a href=&quot;http://nicksda.apotomo.de/2010/11/rails-misapprehensions-cells-dont-break-mvc/&quot; title=&quot;Rails Misapprehensions: Cells don’t break MVC&quot; target=&quot;_blank&quot;&gt;Rails Misapprehensions: Cells don’t break MVC&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href=&quot;http://nicksda.apotomo.de/2010/11/rails-misapprehensions-what-the-fuck-is-mvp/&quot; title=&quot;Rails Misapprehensions: What the f*ck is MVP?&quot; target=&quot;_blank&quot;&gt;Rails Misapprehensions: What the f*ck is MVP?&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href=&quot;http://nicksda.apotomo.de/2010/11/lets-write-a-reusable-sidebar-component-in-rails-3/&quot; title=&quot;Let’s write a Reusable Sidebar Component in Rails 3!&quot; target=&quot;_blank&quot;&gt;Let’s write a Reusable Sidebar Component in Rails 3!&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;I quickly threw together a &lt;a href=&quot;https://github.com/tonynelson19/ColdMVC-Cells&quot;&gt;cells plugin for ColdMVC&lt;/a&gt;. I&#39;m not sure how I feel about it yet, but at the very least it&#39;s an interesting concept.</description><link>http://bears-eat-beets.blogspot.com/2010/11/coldmvc-plugins-and-cells-in-rails.html</link><author>noreply@blogger.com (Tony Nelson)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5424132702988443424.post-5205187536681743555</guid><pubDate>Mon, 23 Aug 2010 23:32:00 +0000</pubDate><atom:updated>2010-08-23T23:04:11.600-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">coldmvc</category><category domain="http://www.blogger.com/atom/ns#">lesscss</category><title>Creating a LESS CSS Plugin for ColdMVC</title><description>One of the coolest things I&#39;ve seen in awhile is &lt;a href=&quot;http://lesscss.org/&quot; target=&quot;_blank&quot;&gt;LESS CSS&lt;/a&gt;, which &quot;extends CSS with variables, mixins, operations, and nested rules&quot;. Barney Boisvert has blogged about &lt;a href=&quot;http://www.barneyb.com/barneyblog/2009/09/08/lesscss-for-cfml-developers/&quot; target=&quot;_blank&quot;&gt;using LESS with ColdFusion already&lt;/a&gt;, but I wanted to show an even simpler integration using my &lt;a href=&quot;http://github.com/tonynelson19/ColdMVC/&quot; target=&quot;_blank&quot;&gt;ColdMVC framework&lt;/a&gt; with a &lt;a href=&quot;http://blog.atozofweb.com/2010/08/using-less-css-with-coldfusion/&quot; target=&quot;_blank&quot;&gt;little help from around the web&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Assuming you already have ColdMVC up and running, your next steps will be to download &lt;a href=&quot;http://javaloader.riaforge.org/&quot; target=&quot;_blank&quot;&gt;JavaLoader&lt;/a&gt; and the &lt;a href=&quot;http://www.asual.com/lesscss/&quot; target=&quot;_blank&quot;&gt;LESS jar file&lt;/a&gt;. Next, we&#39;ll create a new ColdFusion project called ColdCSS, which contains the LESS jar file and a single component, ColdCSS.cfc.&lt;br /&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4d4p6jBYGnHRUfB06SNGrGN2nN3JteYwpLfwBqiqdTe7hE_GCo5tZzDEXGN_p3bypxfKaZ1v2oQMKfYjplL1SqGOgtjc45cPder8NNcApv8NWo7PXyNwX6jbV8R17zkliexSe-ysSPE4/s1600/Capture.JPG&quot;&gt;&lt;img style=&quot;cursor:pointer; cursor:hand;width: 273px; height: 131px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4d4p6jBYGnHRUfB06SNGrGN2nN3JteYwpLfwBqiqdTe7hE_GCo5tZzDEXGN_p3bypxfKaZ1v2oQMKfYjplL1SqGOgtjc45cPder8NNcApv8NWo7PXyNwX6jbV8R17zkliexSe-ysSPE4/s400/Capture.JPG&quot; border=&quot;0&quot; alt=&quot;&quot;id=&quot;BLOGGER_PHOTO_ID_5508760180959462818&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Next, open your application&#39;s &lt;code&gt;/config/plugins.cfm&lt;/code&gt; template and register the ColdCSS plugin. The path to your plugin might be different, but here&#39;s what it looks like if the ColdCSS project is in the same directory as your application.&lt;br /&gt;&lt;br /&gt;&lt;pre name=&quot;code&quot; class=&quot;coldfusion&quot;&gt;&lt;br /&gt;&amp;lt;cfset add(&amp;quot;coldcss&amp;quot;, &amp;quot;../../coldcss/&amp;quot;) /&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Here&#39;s the content of the new component, ColdCSS.cfc:&lt;br /&gt;&lt;br /&gt;&lt;pre name=&quot;code&quot; class=&quot;coldfusion&quot;&gt;&lt;br /&gt;/**&lt;br /&gt; * @accessors true&lt;br /&gt; * @singleton&lt;br /&gt; */&lt;br /&gt;component {&lt;br /&gt;&lt;br /&gt; property pluginManager;&lt;br /&gt;&lt;br /&gt; /**&lt;br /&gt;  * @events applicationStart&lt;br /&gt;  */&lt;br /&gt; public void function generateFiles() {&lt;br /&gt;&lt;br /&gt;  var jars = [ getDirectoryFromPath(getCurrentTemplatePath()) &amp;amp; &amp;quot;lesscss-engine-1.0.22.jar&amp;quot; ];&lt;br /&gt;  var javaLoader = new javaloader.JavaLoader(jars, true);&lt;br /&gt;  var lessEngine = javaLoader.create(&amp;quot;com.asual.lesscss.LessEngine&amp;quot;).init();&lt;br /&gt;  var directories = pluginManager.getPluginPaths();&lt;br /&gt;  var i = &amp;quot;&amp;quot;;&lt;br /&gt;&lt;br /&gt;  arrayAppend(directories, expandPath(&amp;quot;/public/css/&amp;quot;));&lt;br /&gt;&lt;br /&gt;  for (var directory in directories) {&lt;br /&gt;&lt;br /&gt;   var files = directoryList(directory, true, &amp;quot;query&amp;quot;, &amp;quot;*.less&amp;quot;);&lt;br /&gt;&lt;br /&gt;   for (i = 1; i &amp;lt;= files.recordCount; i++) {&lt;br /&gt;&lt;br /&gt;    var source = files.directory[i] &amp;amp; &amp;quot;/&amp;quot; &amp;amp; files.name[i];&lt;br /&gt;    var destination = files.directory[i] &amp;amp; &amp;quot;/&amp;quot; &amp;amp; replaceNoCase(files.name[i], &amp;quot;.less&amp;quot;, &amp;quot;.css&amp;quot;);&lt;br /&gt;    var content = fileRead(source);&lt;br /&gt;&lt;br /&gt;    fileWrite(destination, lessEngine.compile(content));&lt;br /&gt;&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Without going over the component line by line, here&#39;s how it works. When your application starts, ColdMVC will execute &lt;code&gt;ColdCSS.generateFiles()&lt;/code&gt;, which will scan your application and all other registered plugins and find any files ending with a &lt;code&gt;.less&lt;/code&gt; file extension, compile them to CSS using the LESS engine, and write them back to disk in the same folder as the original &lt;code&gt;.less&lt;/code&gt; file, all in less than 50 lines of code.</description><link>http://bears-eat-beets.blogspot.com/2010/08/creating-less-css-plugin-for-coldmvc.html</link><author>noreply@blogger.com (Tony Nelson)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4d4p6jBYGnHRUfB06SNGrGN2nN3JteYwpLfwBqiqdTe7hE_GCo5tZzDEXGN_p3bypxfKaZ1v2oQMKfYjplL1SqGOgtjc45cPder8NNcApv8NWo7PXyNwX6jbV8R17zkliexSe-ysSPE4/s72-c/Capture.JPG" height="72" width="72"/><thr:total>6</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5424132702988443424.post-302555215562763602</guid><pubDate>Mon, 16 Aug 2010 13:28:00 +0000</pubDate><atom:updated>2010-08-16T08:28:00.474-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">coldfusion</category><title>Thoughts on Property Getters/Setters in ColdFusion</title><description>In ColdFusion 9, you can have ColdFusion automatically generate getters and setters for your properties by adding &lt;code&gt;@accessors true&lt;/code&gt; to the component metadata. For example, the following two code snippets are practically identical.&lt;br /&gt;&lt;br /&gt;&lt;pre class=&quot;coldfusion&quot;&gt;&lt;br /&gt;component {&lt;br /&gt; public string function getFirstName() {&lt;br /&gt;  return variables.firstName;&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; public void function setFirstName(required string firstName) {&lt;br /&gt;  variables.firstName = arguments.firstName;&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class=&quot;coldfusion&quot;&gt;&lt;br /&gt;/**&lt;br /&gt; * @accessors true&lt;br /&gt; */&lt;br /&gt;component {&lt;br /&gt; property firstName;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Nice. That&#39;s a lot less code. Now what happens if you have a business rule where you always need the first name to be capitalized. I know it&#39;s not the best real world example, but it&#39;s straightforward. Simple enough, just override the generated getter by defining your own &lt;code&gt;getFirstName&lt;/code&gt; method.&lt;br /&gt;&lt;br /&gt;&lt;pre class=&quot;coldfusion&quot;&gt;&lt;br /&gt;/**&lt;br /&gt; * @accessors true&lt;br /&gt; */&lt;br /&gt;component {&lt;br /&gt; property firstName;&lt;br /&gt; &lt;br /&gt; public string function getFirstName() {&lt;br /&gt;  return ucase(variables.firstName);&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Done. While that works and is the correct way of overriding the getter, it doesn&#39;t quite feel cohesive enough to me since the getter isn&#39;t visually tied directly to the property. I think it would be better if we were able to define the getters and setters as part of the property, similar to how other languages do it.&lt;br /&gt;&lt;br /&gt;&lt;pre class=&quot;coldfusion&quot;&gt;&lt;br /&gt;/**&lt;br /&gt; * @accessors true&lt;br /&gt; */&lt;br /&gt;component {&lt;br /&gt;&lt;br /&gt; property firstName {&lt;br /&gt;  get: function() {&lt;br /&gt;   return ucase(variables.firstName);&lt;br /&gt;  }&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Obviously this is just hypothetical syntax, but I think it reads a lot better.</description><link>http://bears-eat-beets.blogspot.com/2010/08/thoughts-on-property-getterssetters-in.html</link><author>noreply@blogger.com (Tony Nelson)</author><thr:total>7</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5424132702988443424.post-6177135932479472041</guid><pubDate>Thu, 17 Jun 2010 01:51:00 +0000</pubDate><atom:updated>2010-06-16T21:03:36.945-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">bug</category><category domain="http://www.blogger.com/atom/ns#">coldfusion</category><category domain="http://www.blogger.com/atom/ns#">coldmvc</category><title>ColdFusion 9 Bug #82955</title><description>Awhile ago I submitted a bug for ColdFusion 9. Here&#39;s the description from the bug tracker: Error when calling a function with an implicit struct argument containing a complex value inside a loop. It&#39;s a little hard to explain exactly what&#39;s going on in words, but here&#39;s some sample code that can reproduce the error.&lt;br /&gt;&lt;pre name=&quot;code&quot; class=&quot;coldfusion&quot;&gt;&lt;br /&gt;&amp;lt;!--- To test, remove the comments from around each scenario ---&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;!--- create a simple array of users ---&amp;gt;&lt;br /&gt;&amp;lt;cfset users = [] /&amp;gt;&lt;br /&gt;&amp;lt;cfset users[1] = { name = &amp;quot;Tony&amp;quot; } /&amp;gt;&lt;br /&gt;&amp;lt;cfset users[2] = { name = &amp;quot;Joe&amp;quot; } /&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;cfoutput&amp;gt;&lt;br /&gt;&amp;lt;!---&lt;br /&gt;Scenario 1: Pass in the user. This should work. &amp;lt;br /&amp;gt;&lt;br /&gt;&amp;lt;cfloop array=&amp;quot;#users#&amp;quot; index=&amp;quot;user&amp;quot;&amp;gt;&lt;br /&gt; #sayHelloSimple(user)# &amp;lt;br /&amp;gt;&lt;br /&gt;&amp;lt;/cfloop&amp;gt;&lt;br /&gt;---&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;!---&lt;br /&gt;Scenario 2: Pass in a struct containing the user. This should work. &amp;lt;br /&amp;gt;&lt;br /&gt;&amp;lt;cfloop array=&amp;quot;#users#&amp;quot; index=&amp;quot;user&amp;quot;&amp;gt;&lt;br /&gt; &amp;lt;cfset parameters = { user = user } /&amp;gt;&lt;br /&gt; #sayHelloComplex(parameters)# &amp;lt;br /&amp;gt;&lt;br /&gt;&amp;lt;/cfloop&amp;gt;&lt;br /&gt;---&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;!---&lt;br /&gt;Scenario 3: Pass in an implicit struct containing the user. This should work, but doesn&#39;t. &amp;lt;br /&amp;gt;&lt;br /&gt;&amp;lt;cfloop array=&amp;quot;#users#&amp;quot; index=&amp;quot;user&amp;quot;&amp;gt;&lt;br /&gt; #sayHelloComplex({ user = user })# &amp;lt;br /&amp;gt;&lt;br /&gt;&amp;lt;/cfloop&amp;gt;&lt;br /&gt;---&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;!---&lt;br /&gt;Scenario 4: Same as Scenario 4, but wrapped inside a try/catch. This should print &amp;quot;fail&amp;quot;. &amp;lt;br /&amp;gt;&lt;br /&gt;&amp;lt;cfloop array=&amp;quot;#users#&amp;quot; index=&amp;quot;user&amp;quot;&amp;gt;&lt;br /&gt; &amp;lt;cftry&amp;gt;&lt;br /&gt;  #sayHelloComplex({ user = user })# &amp;lt;br /&amp;gt;&lt;br /&gt;  &amp;lt;cfcatch type=&amp;quot;any&amp;quot;&amp;gt;&lt;br /&gt;   fail &amp;lt;br /&amp;gt;&lt;br /&gt;  &amp;lt;/cfcatch&amp;gt;&lt;br /&gt; &amp;lt;/cftry&amp;gt;&lt;br /&gt;&amp;lt;/cfloop&amp;gt;&lt;br /&gt;---&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;!---&lt;br /&gt;Scenario 5: Pass in a single implicit struct containing the user without looping. This should work. &amp;lt;br /&amp;gt;&lt;br /&gt;#sayHelloComplex({ user = users[1] })# &amp;lt;br /&amp;gt;&lt;br /&gt;---&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;!---&lt;br /&gt;Scenario 6: Pass in an implicit struct containing the user inside an include. This should work. &amp;lt;br /&amp;gt;&lt;br /&gt;&amp;lt;cfloop array=&amp;quot;#users#&amp;quot; index=&amp;quot;user&amp;quot;&amp;gt;&lt;br /&gt; &amp;lt;cfinclude template=&amp;quot;user.cfm&amp;quot; /&amp;gt;&lt;br /&gt;&amp;lt;/cfloop&amp;gt;&lt;br /&gt;---&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;!---&lt;br /&gt;content of user.cfm&lt;br /&gt;&amp;lt;cfoutput&amp;gt;&lt;br /&gt;#sayHelloComplex({ user = user })# &amp;lt;br /&amp;gt;&lt;br /&gt;&amp;lt;/cfoutput&amp;gt;&lt;br /&gt;---&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/cfoutput&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;cffunction name=&amp;quot;sayHelloSimple&amp;quot; returntype=&amp;quot;string&amp;quot;&amp;gt;&lt;br /&gt; &amp;lt;cfargument name=&amp;quot;user&amp;quot; type=&amp;quot;any&amp;quot; /&amp;gt;&lt;br /&gt;&lt;br /&gt; &amp;lt;cfreturn &amp;quot;Hello, #arguments.user.name#&amp;quot; /&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/cffunction&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;cffunction name=&amp;quot;sayHelloComplex&amp;quot; returntype=&amp;quot;string&amp;quot;&amp;gt;&lt;br /&gt; &amp;lt;cfargument name=&amp;quot;collection&amp;quot; type=&amp;quot;any&amp;quot; /&amp;gt;&lt;br /&gt;&lt;br /&gt; &amp;lt;cfreturn &amp;quot;Hello, #arguments.collection.user.name#&amp;quot; /&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/cffunction&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;I should note that the complex value doesn&#39;t need to be a struct, but it can be an object as well. If you&#39;ve got a free second, do me a favor and vote it up! &lt;a href=&quot;http://cfbugs.adobe.com/cfbugreport/flexbugui/cfbugtracker/main.html#bugId=82955&quot; target=&quot;_blank&quot;&gt;http://cfbugs.adobe.com/cfbugreport/flexbugui/cfbugtracker/main.html#bugId=82955&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Also, ColdMVC is now on RIAForge, so check that out too if you haven&#39;t yet: &lt;a href=&quot;http://coldmvc.riaforge.org/&quot; target=&quot;_blank&quot;&gt;http://coldmvc.riaforge.org/&lt;/a&gt;.</description><link>http://bears-eat-beets.blogspot.com/2010/06/coldfusion-9-bug-82955.html</link><author>noreply@blogger.com (Tony Nelson)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5424132702988443424.post-2366862899326827186</guid><pubDate>Sat, 24 Apr 2010 14:03:00 +0000</pubDate><atom:updated>2010-04-27T11:35:40.882-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">coldmvc</category><category domain="http://www.blogger.com/atom/ns#">grails</category><category domain="http://www.blogger.com/atom/ns#">orm</category><title>GORM vs ColdMVC ORM</title><description>One of the more interesting session&#39;s at &lt;a href=&quot;http://www.cfobjective.com/&quot; target=&quot;_blank&quot;&gt;cf.Objective()&lt;/a&gt; was &lt;a href=&quot;http://blog.mattwoodward.com/&quot; target=&quot;_blank&quot;&gt;Matt Woodward&#39;s&lt;/a&gt; presentation &lt;a href=&quot;http://www.cfobjective.com/cfo/assets/File/pdfs/MattWoodwardCFMLonGrails.pdf&quot; target=&quot;_blank&quot;&gt;CFML on Grails&lt;/a&gt;. In the presentation, Matt showed how he was able to create a CFML plugin for Grails in order to integrate ColdFusion and Grails. &lt;br /&gt;&lt;br /&gt;While the code worked, it seemed a little sketchy at times trying to get the two languages to play nice together cohesively. Even so, Matt achieved his goal of integrating the languages, so he gets props for that.&lt;br /&gt;&lt;br /&gt;In his presentation, Matt said one of the biggest advantages of using Grails is being able to leverage &lt;a href=&quot;http://www.grails.org/GORM&quot; target=&quot;_blank&quot;&gt;Grails Object Relational Mapping (GORM)&lt;/a&gt;, which is essentially a user-friendly abstraction layer on top of Hibernate.&lt;br /&gt;&lt;br /&gt;While Matt took the approach of integrating ColdFusion into Grails in order to use GORM, I took the opposite approach by trying to recreate GORM in ColdFusion inside my &lt;a href=&quot;http://github.com/tonynelson19/ColdMVC/&quot; target=&quot;_blank&quot;&gt;ColdMVC&lt;/a&gt; framework. Not everything from GORM has been ported over yet, but here&#39;s a set of examples for comparison&#39;s sake. The top line in each pair is Grails, while the second line is ColdMVC.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;def count = Book.count()&lt;br /&gt;var count = _Book.count();&lt;br /&gt;&lt;br /&gt;def count = Book.countByTitle(&quot;The Shining&quot;)&lt;br /&gt;var count = _Book.countByTitle(&quot;The Shining&quot;);&lt;br /&gt;&lt;br /&gt;def count = Book.countByTitleAndAuthor(&quot;The Sum of All Fears&quot;, &quot;Tom Clancy&quot;)&lt;br /&gt;var count = _Book.countByTitleAndAuthor(&quot;The Sum of All Fears&quot;, &quot;Tom Clancy&quot;);&lt;br /&gt;&lt;br /&gt;def book = Book.find(&quot;from Book as b where b.author=:author&quot;,[author:&#39;Dan Brown&#39;])&lt;br /&gt;var book = _Book.find(&quot;from Book as b where b.author=:author&quot;,{author=&#39;Dan Brown&#39;});&lt;br /&gt;&lt;br /&gt;def book = Book.findAll(&quot;from Book as b where b.author=? order by b.releaseDate&quot;,[&#39;Dan Brown&#39;],[max:10, offset:5])&lt;br /&gt;var book = _Book.findAll(&quot;from Book as b where b.author=? order by b.releaseDate&quot;,[&#39;Dan Brown&#39;],{max=10, offset=5});&lt;br /&gt;&lt;br /&gt;def book = Book.findByTitle(&quot;The Shining&quot;)&lt;br /&gt;var book = _Book.findByTitle(&quot;The Shining&quot;);&lt;br /&gt;&lt;br /&gt;def books = Book.findAllByTitleLike(&quot;%Hobbit%&quot;)&lt;br /&gt;var books = _Book.findAllByTitleLike(&quot;Hobbit&quot;);&lt;br /&gt;&lt;br /&gt;def books = Book.findAllByTitle(&quot;The Shining&quot;, [max:10, sort:&quot;title&quot;, order:&quot;desc&quot;, offset:100])&lt;br /&gt;var books = _Book.findAllByTitle(&quot;The Shining&quot;, {max=10, sort=&quot;title&quot;, order=&quot;desc&quot;, offset=100});&lt;br /&gt;&lt;br /&gt;def book = Book.findWhere(title:&quot;The Shining&quot;, author:&quot;Stephen King&quot;)&lt;br /&gt;var book = _Book.findWhere({title=&quot;The Shining&quot;, author=&quot;Stephen King&quot;});&lt;br /&gt;&lt;br /&gt;def books = Book.findAllWhere(author:&quot;Stephen King&quot;)&lt;br /&gt;var books = _Book.findAllWhere({author=&quot;Stephen King&quot;});&lt;br /&gt;&lt;br /&gt;def book = Book.get(1)&lt;br /&gt;var book = _Book.get(1);&lt;br /&gt;&lt;br /&gt;def books = Book.getAll(2,1,3)&lt;br /&gt;var books = _Book.getAll(2,1,3);&lt;br /&gt;&lt;br /&gt;def books = Book.getAll([1,2,3])&lt;br /&gt;var books = _Book.getAll([1,2,3]);&lt;br /&gt;&lt;br /&gt;def books = Book.list()&lt;br /&gt;var books = _Book.list();&lt;br /&gt;&lt;br /&gt;def books = Book.list(max:10, offset:100, sort:&quot;title&quot;, order:&quot;desc&quot;)&lt;br /&gt;var books = _Book.list({max=10, offset=100, sort=&quot;title&quot;, order=&quot;desc&quot;});&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;As you can see, aside from a couple small syntax differences, they&#39;re almost identical.</description><link>http://bears-eat-beets.blogspot.com/2010/04/gorm-vs-coldmvc-orm.html</link><author>noreply@blogger.com (Tony Nelson)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5424132702988443424.post-53349948378862914</guid><pubDate>Wed, 21 Apr 2010 13:36:00 +0000</pubDate><atom:updated>2010-04-24T10:39:39.920-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">coldmvc</category><title>ColdMVC: Event Listeners</title><description>ColdMVC provides your application with several interception points throughout the lifecyle of a request. This is possible thanks to centralized event dispatching from ColdMVC’s &lt;code&gt;&lt;a href=&quot;http://github.com/tonynelson19/ColdMVC/blob/master/utils/EventDispatcher.cfc&quot; target=&quot;_blank&quot;&gt;EventDispatcher&lt;/a&gt;&lt;/code&gt; component. In a typical ColdMVC request, the following events will be dispatched:&lt;br /&gt;&lt;br /&gt;• requestStart&lt;br /&gt;• actionStart&lt;br /&gt;• preAction&lt;br /&gt;• pre:{controller}Controller&lt;br /&gt;• pre:{controller}Controller.{action}&lt;br /&gt;• action&lt;br /&gt;• post:{controller}Controller:{action}&lt;br /&gt;• post:{controller}Controller&lt;br /&gt;• postAction&lt;br /&gt;• actionEnd&lt;br /&gt;• requestEnd&lt;br /&gt;&lt;br /&gt;Any controller within the application can listen for these events by applying metadata to the desired listener method. The &lt;code&gt;events&lt;/code&gt; metadata is a comma-separated list of regular expressions, providing quite a bit of flexibility in intercepting. As an example, if you wanted a &lt;code&gt;SecurityController&lt;/code&gt; to verify a user is logged in at the beginning of each request, you could have the following code:&lt;br /&gt;&lt;code&gt;&lt;pre&gt;&lt;br /&gt;component {&lt;br /&gt;&lt;br /&gt; /**&lt;br /&gt;  * @events requestStart&lt;br /&gt;  */&lt;br /&gt; function verifyLoggedIn() {&lt;br /&gt;  if (!session.isLoggedIn) {&lt;br /&gt;   redirect({controller=&quot;security&quot;, action=&quot;logout&quot;});&lt;br /&gt;  }&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;/code&gt;&lt;br /&gt;Furthermore, ColdMVC will implicitly invoke certain methods on your request’s controller if they are defined. Before the request’s action is invoked, ColdMVC will invoke the controller’s &lt;code&gt;pre&lt;/code&gt; and &lt;code&gt;pre{Action}&lt;/code&gt; methods if they exist. Next, ColdMVC will invoke the action for the request, followed by the &lt;code&gt;post{Action}&lt;/code&gt; and &lt;code&gt;post&lt;/code&gt; methods if they exist. For example, if the current requst is &lt;code&gt;/product/list&lt;/code&gt;, ColdMVC will invoke &lt;code&gt;ProductController.pre()&lt;/code&gt;, &lt;code&gt;ProductController.preList()&lt;/code&gt;, &lt;code&gt;ProductController.list()&lt;/code&gt;, &lt;code&gt;ProductController.postList()&lt;/code&gt;, and finally &lt;code&gt;ProductController.post()&lt;/code&gt;.</description><link>http://bears-eat-beets.blogspot.com/2010/04/coldmvc-event-listeners.html</link><author>noreply@blogger.com (Tony Nelson)</author><thr:total>1</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5424132702988443424.post-6737298734241107460</guid><pubDate>Tue, 20 Apr 2010 16:49:00 +0000</pubDate><atom:updated>2010-04-20T11:49:00.605-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">coldmvc</category><title>ColdMVC: Plugins</title><description>Plugins are custom functions that are available to your views and layouts that help keep your presentation layer clean. Plugins are defined using a simple .cfm file that maps a plugin name to a method on either a helper or a bean defined within ColdSpring.&lt;br /&gt;&lt;br /&gt;When you first create an application using ColdMVC, you&#39;ll already have access to a standard set of plugins, defined inside &lt;code&gt;&lt;a href=&quot;http://github.com/tonynelson19/ColdMVC/blob/master/config/plugins.cfm&quot; target=&quot;_blank&quot;&gt;/coldmvc/config/plugins.cfm&lt;/a&gt;&lt;/code&gt;. The most prominent plugin is the &lt;code&gt;linkTo()&lt;/code&gt; method that builds URLs for your views.&lt;br /&gt;&lt;br /&gt;When ColdMVC loads, it will load any plugins that are found inside your application&#39;s &lt;code&gt;/app/config/plugins.cfm&lt;/code&gt;, then any plugins inside &lt;code&gt;/coldmvc/config/plugins.cfm&lt;/code&gt;. If you would like to override one of ColdMVC&#39;s plugins, simply define your own plugin with the same name as the ColdMVC plugin.&lt;br /&gt;&lt;br /&gt;While your views and layouts still have access to all of your application&#39;s &lt;a href=&quot;http://bears-eat-beets.blogspot.com/2010/04/coldmvc-helpers.html&quot; target=&quot;_blank&quot;&gt;helpers&lt;/a&gt;, it is recommended to use plugins rather than the helpers. Even though they will generate the exact same HTML, &lt;code&gt;#linkTo({controller=&quot;post&quot;, action=&quot;list&quot;})#&lt;/code&gt; reads a lot better than &lt;code&gt;#$.link.to({controller=&quot;post&quot;, action=&quot;list&quot;})#&lt;/code&gt;.</description><link>http://bears-eat-beets.blogspot.com/2010/04/coldmvc-plugins.html</link><author>noreply@blogger.com (Tony Nelson)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5424132702988443424.post-8187332895458515040</guid><pubDate>Tue, 20 Apr 2010 13:42:00 +0000</pubDate><atom:updated>2010-04-20T21:13:42.146-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">coldmvc</category><title>ColdMVC: Custom Tags</title><description>Writing views and layouts can be tedious work, especially if you want to ensure you’re using consistent HTML markup around your form fields. To make views a little less painful, it’s best to use custom tags to generate the HTML for you. That way, you don’t have to worry small things like radio button markup and instead can focus on more important things, like your application’s business logic.&lt;br /&gt;&lt;br /&gt;A new installation of ColdMVC will already have a standard library of custom tags available to use inside your views, such as &lt;code&gt;&amp;lt;c:input /&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;c:select /&amp;gt;&lt;/code&gt;, and &lt;code&gt;&amp;lt;c:textarea /&amp;gt;&lt;/code&gt;. These files are all located within &lt;code&gt;&lt;a href=&quot;http://github.com/tonynelson19/ColdMVC/tree/master/tags/&quot; target=&quot;_blank&quot;&gt;/coldmvc/tags&lt;/a&gt;&lt;/code&gt;.&lt;br /&gt;&lt;br /&gt;You can create your own custom tags in a ColdMVC application simply by placing a .cfm file inside your application’s &lt;code&gt;/app/tag&lt;/code&gt;s folder. For example, if you created a file located at &lt;code&gt;/app/tags/tony.cfm&lt;/code&gt;, you would then have access to that custom tag inside your views and layouts by using &lt;code&gt;&amp;lt;c:tony /&amp;gt;&lt;/code&gt;.&lt;br /&gt;&lt;br /&gt;When ColdMVC first loads, it will load any custom tags located within your application’s &lt;code&gt;/app/tags&lt;/code&gt; folder, then any custom tags inside &lt;code&gt;/coldmvc/tags&lt;/code&gt; folder that haven’t been loaded yet. These custom tags will then be available to all of your views and layouts.&lt;br /&gt;&lt;br /&gt;Most of the default custom tags inside ColdMVC simply delegate their functionality to a ColdMVC helper component, so extending the default custom tags can be done by extending the helpers. If you would like to completely override a custom tag that ships with ColdMVC, simply create a custom tag with the same file name inside your application’s &lt;code&gt;/app/tags&lt;/code&gt; folder, and ColdMVC will load your custom tag rather than ColdMVC’s custom tag.&lt;br /&gt;&lt;br /&gt;By default, ColdMVC will import the custom tags using a “c” prefix. If you would like to change the prefix to something else, such as “foo”, you can do so inside your &lt;code&gt;/config/config.ini&lt;/code&gt; file by setting &lt;code&gt;tagPrefix=foo&lt;/code&gt;. However, it is recommended as a best practice to use the default tag prefix of “c” to provide framework consistency across projects.&lt;br /&gt;&lt;br /&gt;In a typical ColdFusion application, you need to import your custom tags into each ColdFusion template using the &lt;code&gt;&amp;lt;cfimport /&amp;gt;&lt;/code&gt; tag. However, you do not have to do this inside a ColdMVC application. For each view and layout in your application, ColdMVC will automatically generate a corresponding .cfm file inside your application’s &lt;code&gt;/.generated&lt;/code&gt; folder that contains the content of your template along with the &lt;code&gt;&amp;lt;cfimport /&amp;gt;&lt;/code&gt; tag.&lt;br /&gt;&lt;br /&gt;Most of the templates are generated the first time they are requested, with the exception of files beginning with an underscore, which are considered “private” templates by convention and therefore are generated when the application first loads.</description><link>http://bears-eat-beets.blogspot.com/2010/04/coldmvc-custom-tags.html</link><author>noreply@blogger.com (Tony Nelson)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5424132702988443424.post-4047751760005484131</guid><pubDate>Mon, 19 Apr 2010 18:10:00 +0000</pubDate><atom:updated>2010-04-19T13:13:36.165-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">coldmvc</category><title>ColdMVC: Helpers</title><description>ColdMVC allows you to create helper components that are globally available to your entire application. These helper components are good for containing useful functions similar to those found on &lt;a href=&quot;http://cflib.org/&quot; target=&quot;_blank&quot;&gt;cflib.org&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;When ColdMVC first loads, it will load any helpers located within your application’s &lt;code&gt;/app/helpers&lt;/code&gt; folder, then any helpers inside ColdMVC’s &lt;code&gt;/helpers&lt;/code&gt; folder that haven’t been loaded yet. These helpers will then be globally available throughout your application inside the &lt;code&gt;$&lt;/code&gt; variable.&lt;br /&gt;&lt;br /&gt;ColdMVC ships with a handful of helpers that can be found inside &lt;code&gt;&lt;a href=&quot;http://github.com/tonynelson19/ColdMVC/tree/master/helpers/&quot; target=&quot;_blank&quot;&gt;/coldmvc/helpers&lt;/a&gt;&lt;/code&gt;. If you would like to override the functionality of one ColdMVC’s helpers, simply create a .cfc with the same name inside your application’s &lt;code&gt;/app/helpers&lt;/code&gt; directory, extend the corresponding ColdMVC helper, and make your changes.&lt;br /&gt;&lt;br /&gt;You can create your own helpers by creating a .cfc and placing it inside your application’s &lt;code&gt;/app/helpers&lt;/code&gt; folder. The newly created helper is then available throughout your application inside the &lt;code&gt;$&lt;/code&gt; variable. For example, if you created a file located at &lt;code&gt;/app/helpers/tony.cfc&lt;/code&gt;, you would then have access to that helper throughout your application by using &lt;code&gt;$.tony&lt;/code&gt;.</description><link>http://bears-eat-beets.blogspot.com/2010/04/coldmvc-helpers.html</link><author>noreply@blogger.com (Tony Nelson)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5424132702988443424.post-3286935123239218209</guid><pubDate>Fri, 16 Apr 2010 13:12:00 +0000</pubDate><atom:updated>2010-04-16T08:36:56.139-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">coldmvc</category><title>ColdMVC: Routing</title><description>At the most basic level, all a web application does is accept a user’s request, process some data, then send a response back to the user. Figuring out what and how the application should process is what routing is all about.&lt;br /&gt;&lt;br /&gt;A typical URL inside a ColdMVC application will look like following:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;http://myapp.com/index.cfm/product/show/1&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Using pattern matching defined in a config file, ColdMVC is able to determine the appropriate controller and action that should be executed for the request, as well as any other parameters that should be populated into the request. For example, the previous URL would result in the &lt;code&gt;show&lt;/code&gt; method being executed on the ProductController, while also setting &lt;code&gt;params.id&lt;/code&gt; to “1”. This is because the incoming request, “/product/show/1” matches the default pattern “/:controller/:action/:id”, defined inside &lt;a href=&quot;http://github.com/tonynelson19/ColdMVC/blob/master/config/routes.cfm&quot; target=&quot;_blank&quot;&gt;/coldmvc/config/routes.cfm&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;You’re able to create your own custom routes inside your application’s /config/routes.cfm file. Custom routes are especially handy when creating user-friendly URLs. For example, you could create a pattern that routes anything matching “/user/:name” to &lt;code&gt;UserController.show()&lt;/code&gt;. Here’s what that route would look like inside the routes.cfm config file:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&amp;lt;cfset add(&quot;/user/:name&quot;, {defaults = {controller=&quot;user&quot;, action=&quot;show&quot;}}) /&amp;gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;ColdMVC offers several other features for handling incoming routes, such as parameter requirements, default parameters, and computed parameters, that I&#39;ll cover in more detail in future posts. However, knowing just the basics should cover most routing scenarios.&lt;br /&gt;&lt;br /&gt;Recognizing routes makes up only half of routing. Since it’s possible for ColdMVC to consume URLs that match a pattern, its equally important that ColdMVC is able to generate those same URLs as well.&lt;br /&gt;&lt;br /&gt;The easiest way to generate a URL inside a view or a layout is by using the &lt;code&gt;#linkTo()#&lt;/code&gt; plugin. This method can accept three arguments: a struct of parameters, a querystring, and a name. For most links in the application, you’ll only need to specify the parameters, which typically consists of keys for the &lt;code&gt;controller&lt;/code&gt;, &lt;code&gt;action&lt;/code&gt;, and &lt;code&gt;id&lt;/code&gt;.&lt;br /&gt;&lt;br /&gt;For example, if you want to link to a product’s record, your code might look like this: &lt;br /&gt;&lt;br /&gt;&lt;code&gt;&amp;lt;a href=”#linkTo({controller=”product”, action=”show”, id=product})#”&amp;gt;#product.name()#&amp;lt;/a&amp;gt;&lt;/code&gt;. &lt;br /&gt;&lt;br /&gt;If you don’t specify a controller or an action in the parameters and a matching route can’t be found, the router will look again, only this time it will add the current request’s controller and action to the parameters.&lt;br /&gt;&lt;br /&gt;There are several more advanced features of URL generation that I haven’t discussed yet, such as named routes and model-based routes, so I’ll go over them in more detail in future posts as well. In the meantime, if you’re curious to see how these features work, take a look at the routes defined for the sample blog application, located at &lt;a href=&quot;http://github.com/tonynelson19/ColdMVC/blob/master/samples/blog/config/routes.cfm&quot; target=&quot;_blank&quot;&gt;/coldmvc/samples/blog/config/routes.cfm&lt;/a&gt;.</description><link>http://bears-eat-beets.blogspot.com/2010/04/coldmvc-routing.html</link><author>noreply@blogger.com (Tony Nelson)</author><thr:total>3</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5424132702988443424.post-1763955442873531363</guid><pubDate>Thu, 15 Apr 2010 23:08:00 +0000</pubDate><atom:updated>2010-04-15T18:11:48.298-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">coldmvc</category><title>ColdMVC: Params Scope and Flash Scope</title><description>In addition to the standard ColdFusion scopes, ColdMVC “adds” two additional scopes to your application: &lt;code&gt;params&lt;/code&gt; and &lt;code&gt;flash&lt;/code&gt;. This is possible by leveraging ColdFusion’s &lt;code&gt;getPageContext().getFusionContext().hiddenScope&lt;/code&gt; variable.&lt;br /&gt;&lt;br /&gt;The &lt;code&gt;params&lt;/code&gt; scope will contain all &lt;code&gt;FORM&lt;/code&gt; and &lt;code&gt;URL&lt;/code&gt; variables, as well as any parameters created by the current request’s route. All variables within the &lt;code&gt;params&lt;/code&gt; scope are automatically copied into the &lt;code&gt;variables&lt;/code&gt; scope of views and layouts for quicker reference.&lt;br /&gt;&lt;br /&gt;The &lt;code&gt;flash&lt;/code&gt; scope is a slightly temporary scope. Any data put into the &lt;code&gt;flash&lt;/code&gt; scope lasts for the life of the current request, and is then copied into the &lt;code&gt;params&lt;/code&gt; scope of the next request. This is useful for displaying one-time status messages to the end user when records are successfully added, edited, or deleted.</description><link>http://bears-eat-beets.blogspot.com/2010/04/coldmvc-params-scope-and-flash-scope.html</link><author>noreply@blogger.com (Tony Nelson)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5424132702988443424.post-5280007224319739877</guid><pubDate>Thu, 15 Apr 2010 13:36:00 +0000</pubDate><atom:updated>2010-04-15T08:36:00.092-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">coldmvc</category><title>ColdMVC: Layouts</title><description>Layouts allow your application to have a consistent look and feel as well as help keep your views clean and focused. Layouts are simply .cfm files located inside your application’s /app/layouts/ folder.&lt;br /&gt;&lt;br /&gt;By default, ColdMVC will look for a layout with the same name as your controller. For example, if you were make a request to http://myapp.com/index.cfm/product/list, ColdMVC would look for a layout located at /app/layouts/product.cfm. If it cannot find a product.cfm, it look look for the default layout, located at /app/layouts/index.cfm. This is useful if your application has several controllers but only 1 main layout.&lt;br /&gt;&lt;br /&gt;If you want to pass data to your layout, create a LayoutController.cfc inside your application’s /app/controllers/ folder and have it extend coldmvc.LayoutController. Then create a function inside the LayoutController with the same name as the request’s controller. In the previous example, you would create function named &lt;code&gt;product&lt;/code&gt;. Inside the function, any data put into the params scope will be automatically copied into the variables scope of the layout. If a &lt;code&gt;product&lt;/code&gt; function isn’t defined inside the LayoutController, ColdMVC will look for an &lt;code&gt;index&lt;/code&gt; method and call that instead.&lt;br /&gt;&lt;br /&gt;By default, each controller’s corresponding layout is the same name as the controller. You can change this by adding @layout metadata to your controller’s metadata. If you would like to change the layout for an individual action within a controller, you can do this by adding @layout metadata to the function.&lt;br /&gt;&lt;br /&gt;If your request uses a layout, your layout is in charge of rendering the view’s content. This can be done simply by calling &lt;code&gt;#render()#&lt;/code&gt; inside your layout where you want your view’s content to be displayed.</description><link>http://bears-eat-beets.blogspot.com/2010/04/coldmvc-layouts.html</link><author>noreply@blogger.com (Tony Nelson)</author><thr:total>0</thr:total></item></channel></rss>