<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Darren Cook&#039;s Blog</title>
	<atom:link href="http://darrentcook.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://darrentcook.wordpress.com</link>
	<description>A pensieve for ColdFusion &#039;n stuff</description>
	<lastBuildDate>Mon, 26 Dec 2011 09:16:49 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='darrentcook.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://0.gravatar.com/blavatar/e01e312a774d5d09daba28a05b55aaa0?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>Darren Cook&#039;s Blog</title>
		<link>http://darrentcook.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://darrentcook.wordpress.com/osd.xml" title="Darren Cook&#039;s Blog" />
	<atom:link rel='hub' href='http://darrentcook.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Exposing Virtual Machine Services via Apache</title>
		<link>http://darrentcook.wordpress.com/2011/03/09/exposing-virtual-machine-services-via-apache/</link>
		<comments>http://darrentcook.wordpress.com/2011/03/09/exposing-virtual-machine-services-via-apache/#comments</comments>
		<pubDate>Wed, 09 Mar 2011 19:04:44 +0000</pubDate>
		<dc:creator>darrentcook</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://darrentcook.wordpress.com/?p=64</guid>
		<description><![CDATA[I have a Virtual Machine (TurnKeyLinux.com&#8217;s Redmine Appliance) running under Virtual Box. But I wanted the site to be exposed through the host OS so it could run under the same IP (and thus URI) associated to the host. The &#8230; <a href="http://darrentcook.wordpress.com/2011/03/09/exposing-virtual-machine-services-via-apache/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=darrentcook.wordpress.com&amp;blog=13453423&amp;post=64&amp;subd=darrentcook&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I have a Virtual Machine (TurnKeyLinux.com&#8217;s Redmine Appliance) running under Virtual Box. But I wanted the site to be exposed through the host OS so it could run under the same IP (and thus URI) associated to the host.</p>
<p>The solution is rather simple:</p>
<ol>
<li>Review the network settings of the virtual machine: the host machine needs to be able to communicate with the virtual machine.
<ul>
<li>I&#8217;m using VirtualBox, so I chose to attach to the Host-only Adapter (vm instance &gt; Settings &gt; Network &gt; Adapter [X] &gt; Attached to: Host-only Adapter). This instructs VirtualBox to create a virtual network with it&#8217;s own DHCP server, members of which are your virtual machine and the host itself.</li>
<li>To control virtual networks including DHCP settings, in VirtualBox go to Preferences &gt; Network, select or create a Host-only Network, and click the screwdriver icon to edit it. Edit your IP addresses and DHCP server setttings. If you need more control over DHCP, you can probably use the VBoxManage command line utility; dig into the VirtualBox documentation for details.</li>
<li>Start up your Virtual Machine. From the Host command line you should be able to ping the virtual machine&#8217;s IP address.</li>
</ul>
</li>
<li>Edit your Apache httpd.conf file. Add a new virtual host which will act as a proxy server to your VM machine:
<ul>
&lt;VirtualHost *:80&gt;<br />
ServerName vmmachine.mysite.org<br />
ProxyPreserveHost On<br />
ProxyPass / http://192.168.0.43/<br />
ProxyPassReverse / http://192.168.0.43/<br />
&lt;/VirtualHost&gt;
</ul>
<p>(The IP address used in the ProxyPass settings is the IP address of your virtual machine.)
</li>
</ol>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/darrentcook.wordpress.com/64/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/darrentcook.wordpress.com/64/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/darrentcook.wordpress.com/64/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/darrentcook.wordpress.com/64/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/darrentcook.wordpress.com/64/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/darrentcook.wordpress.com/64/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/darrentcook.wordpress.com/64/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/darrentcook.wordpress.com/64/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/darrentcook.wordpress.com/64/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/darrentcook.wordpress.com/64/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/darrentcook.wordpress.com/64/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/darrentcook.wordpress.com/64/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/darrentcook.wordpress.com/64/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/darrentcook.wordpress.com/64/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=darrentcook.wordpress.com&amp;blog=13453423&amp;post=64&amp;subd=darrentcook&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://darrentcook.wordpress.com/2011/03/09/exposing-virtual-machine-services-via-apache/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ec0982f4f9ba80859d4e8e4ec23d3ab3?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">darrentcook</media:title>
		</media:content>
	</item>
		<item>
		<title>Troubleshooting CF 9 Installation on OS X</title>
		<link>http://darrentcook.wordpress.com/2010/09/13/troubleshooting-cf-9-installation-on-os-x/</link>
		<comments>http://darrentcook.wordpress.com/2010/09/13/troubleshooting-cf-9-installation-on-os-x/#comments</comments>
		<pubDate>Mon, 13 Sep 2010 19:17:55 +0000</pubDate>
		<dc:creator>darrentcook</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://darrentcook.wordpress.com/?p=59</guid>
		<description><![CDATA[There can be many issues when installing CF 9 under OS X. There are various tips scattered around the web, so I&#8217;ve compiled many of them and a few of my own into this list. BTW these were written while &#8230; <a href="http://darrentcook.wordpress.com/2010/09/13/troubleshooting-cf-9-installation-on-os-x/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=darrentcook.wordpress.com&amp;blog=13453423&amp;post=59&amp;subd=darrentcook&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>There can be many issues when installing CF 9 under OS X.  There are various tips scattered around the web, so I&#8217;ve compiled many of them and a few of my own into this list.</p>
<p>BTW these were written while installing CF 9 on Snow Leopard using the MultiServer configuration option.</p>
<p>Start CF manually to see what errors are occurring:</p>
<ul>
<li> Open Terminal.</li>
<li> $ cd /Applications/JRun4/bin</li>
<li> $ ./jrun -config jvm.config -start cfusion</li>
</ul>
<p>&#8220;Error 500: Internal Server Error<br />
The server encountered an internal error or misconfiguration and was unable to complete your request.&#8221;<br />
&#8220;The server encountered an internal error and was unable to complete your request. JRun closed connection.&#8221;</p>
<ol>
<li> If the server is just starting up, it will give this message. Wait 10 seconds and try again.</li>
<li> Log into JRun4 Administrator . On the side bar, expand [servername]  and click Services. Make sure that the ProxyService (and WebService, if you are trying to use that port) are both running (click the green Play arrow).</li>
<li>Make sure the JRun service is running: open Activity Viewer and check for jrun instances. If the JRun service appears and disappears, CF is crashing: check the logs or run CF manually from the terminal (see above tip) to find out why.</li>
</ol>
<p>&#8220;Forbidden  You don&#8217;t have permission to access /index.cfm on this server.&#8221; (or some other file)</p>
<ul>
<li> Make sure you have an index.cfm (index.htm) page in the web root, or that you specify it in the URL.</li>
<li> Make sure permissions are correct on the JRun4 server directories (admin or staff has read/write, everyone has read only seems to work)
<ul style="list-style-type:none;">
<li>$ sudo chmod -R 775 /workspace/[directory]</li>
<li> $ sudo chown -R root:admin /workspace/[directory]</li>
</ul>
</li>
<li> Make sure your DocumentRoot and &lt;Directory&gt; settings in Apache httpd.conf are correct (see steps below).</li>
</ul>
<p>I&#8217;m using the built-in OS X Apache server (which I specified when installing CF).  I make sure Apache is running by going into System Preferences &gt; Sharing &gt; Web Sharing and check the box, and I check to see it&#8217;s running using Activity Viewer (look for httpd).  Next, check the apache config file to make sure it&#8217;s set up correctly for ColdFusion (maybe make a backup copy before you edit it.). I use pico to edit it:<br />
$ sudo pico /private/etc/apache2/httpd.conf<br />
Check the file for the following:</p>
<ul>
<li> The DirectoryIndex setting specifies index.cfm</li>
<li>Check the DocumentRoot and Directory settings. They should point to your CF webroot but they probably point to the OS X default ( &#8220;/Library/WebServer/Documents&#8221;). For the Multiserver Config install, it should be changed to the default website &#8220;/Applications/JRun4/servers/cfusion/cfusion-ear/cfusion-war&#8221;. After you do this, you will probably want to move the CFIDE directory from /Library/WebServer/Documents to the cfusion-war folder as well (as the CF installer uses the original Apache DocumentRoot path by default).</li>
<li> Find the &#8220;AddHandler jrun-handler&#8221; setting under the JRun Settings section. Make sure that .cfm .cfml .cfc are all listed.</li>
<li> Save the config changes, and restart Apache making sure it runs. Best is to stop/start the service from terminal this time, so if there is an error you can see it:<br />
$ sudo apachectl -k stop<br />
$ sudo apachectl -k start</li>
<li> At least once when I uninstalled/reinstalled CF, the installer caused a bug in httpd.conf which I had to correct; starting Apache from the command line helped me find it.</li>
</ul>
<p>Check permissions on your webroot directory &amp; files. I had issues when experimenting with my webroot being under my user Home directory. I also had issues when unzipping an EAR file; OS X granted my user account read/write but &#8220;no access&#8221; to &#8220;everyone&#8221; on the unzipped version, which I had to change.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/darrentcook.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/darrentcook.wordpress.com/59/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/darrentcook.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/darrentcook.wordpress.com/59/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/darrentcook.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/darrentcook.wordpress.com/59/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/darrentcook.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/darrentcook.wordpress.com/59/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/darrentcook.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/darrentcook.wordpress.com/59/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/darrentcook.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/darrentcook.wordpress.com/59/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/darrentcook.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/darrentcook.wordpress.com/59/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=darrentcook.wordpress.com&amp;blog=13453423&amp;post=59&amp;subd=darrentcook&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://darrentcook.wordpress.com/2010/09/13/troubleshooting-cf-9-installation-on-os-x/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ec0982f4f9ba80859d4e8e4ec23d3ab3?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">darrentcook</media:title>
		</media:content>
	</item>
		<item>
		<title>Toggle Hidden Files in OS X Finder (Snow Leopard)</title>
		<link>http://darrentcook.wordpress.com/2010/08/31/toggle-hidden-files-in-os-x-finder-snow-leopard/</link>
		<comments>http://darrentcook.wordpress.com/2010/08/31/toggle-hidden-files-in-os-x-finder-snow-leopard/#comments</comments>
		<pubDate>Tue, 31 Aug 2010 18:39:04 +0000</pubDate>
		<dc:creator>darrentcook</dc:creator>
				<category><![CDATA[Applescript]]></category>
		<category><![CDATA[OSX]]></category>

		<guid isPermaLink="false">http://darrentcook.wordpress.com/?p=48</guid>
		<description><![CDATA[I needed a reliable and fast way to toggle viewing hidden files in OS X Finder. There are many options out there if you google this, but the most intriguing idea to me was leveraging the new Services feature of &#8230; <a href="http://darrentcook.wordpress.com/2010/08/31/toggle-hidden-files-in-os-x-finder-snow-leopard/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=darrentcook.wordpress.com&amp;blog=13453423&amp;post=48&amp;subd=darrentcook&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I needed a reliable and fast way to toggle viewing hidden files in OS X Finder. There are many options out there if you google this, but the most intriguing idea to me was leveraging the new Services feature of OS X 10.6 Snow Leopard.</p>
<p>I started based on <a href="http://www.macworld.com/article/153107/2010/08/togglehiddenfiles.html">this article</a>, incorporated the various Applescript tips found in it&#8217;s comments into the base script, and did some more tinkering of my own. Here is my current solution top to bottom with a new Applescript:</p>
<ol>
<li>Launch /Applications/Automator.app and choose Service as your template for a new script.</li>
<li>Set the <em>Service receives selected</em> dropdown to &#8220;files or folders&#8221; <em>in</em> &#8220;Finder.app&#8221;. This makes it visible in the services menu when you right-click a file or folder in the Finder.</li>
<li>Drag the <em>Library &gt; Utilities: Run AppleScript</em> action from the Utilities library to the work area on the right.</li>
<li>Paste the following script into the <em>Run AppleScript</em> pane:
<pre style="overflow:scroll;">on run

	if the button returned of ¬
		(display dialog "Toggling hidden files restarts the Finder, which will cancel any file operations in progress. " &amp; ¬
			"Please make sure you have no files copying before you continue." buttons {"Cancel", "OK"} default button 2) ¬
			is "Cancel" then return

	-- Get the frontmost app so we can try to reactivate it after relaunching finder
	tell application "System Events"
		-- name of application process sometimes returns eg: firefox-bin.
		-- application file of application process returns eg: /Applications/Firefox.app
		-- The filename from the latter is most useable below, so use an Applescript trick to get it:
		set frontmostApplication to application file of the first application process whose frontmost is true
		set AppleScript's text item delimiters to ":"
		set frontmostApplication to the last word of (the name of frontmostApplication as string)
	end tell
	-- get the frontmost window of the frontmost app: you have to reactivate both the app and it's window
	try
		tell application frontmostApplication
			set window_name to name of front window
		end tell
	end try

	-- Get the frontmost window of Finder so it can be reactivated after relaunching Finder
	try
		set finder_window to name of front window of application "Finder"
	end try

	-- TERM Finder (saves prefs), toggle the hidden files setting, then relaunch Finder
	do shell script "killall -TERM Finder;" &amp; ¬
		"toggle=`defaults read com.apple.finder AppleShowAllFiles`;" &amp; ¬
		"if [ -z $toggle ];then toggle=0;fi;" &amp; ¬
		"toggle=$((($toggle-1)*-1));" &amp; ¬
		"defaults write com.apple.finder AppleShowAllFiles $toggle;" &amp; ¬
		"osascript -e 'tell application \"Finder\" to activate'"

	-- activating the frontmost window of Finder is good user experience,
	-- and serves as a fallback active window if frontmostApplication activation fails
	try
		tell window finder_window of application "Finder" to activate
	end try
	-- try to re-activate the original frontmostApp and it's window
	try
		activate frontmostApplication
		activate window window_name of application frontmostApplication
	end try

	return
end run</pre>
</li>
<li>Save the service, naming it &#8220;Toggle Hidden Files&#8221; (as a Service, Automator defaults to the correct system directory automatically).</li>
</ol>
<p>Now, right click a file or folder in a Finder window and choose Services  &gt; Toggle Hidden Files. The service also shows up under the Finder  &gt; Services menu. Tada! Finder will relaunch with hidden file viewing  toggled on or off.</p>
<p>Have fun with your new service.</p>
<p>PS: an Applescripting note:<br />
Syntax is critical sometimes. Take the following two examples:<br />
Example 1:</p>
<pre>		tell application frontmostApplication
			set window_name to name of front window
		end tell</pre>
<p>Example 2:</p>
<pre>		set window_name to name of front window of application frontmostApplication</pre>
<p>The former works, the latter does not. Why? They have different context: in the former, the frontmostApp is setting window_name. In the latter, Applescript is trying to do the setting, by introspecting the name from the frontmostApp. Apparently they are not one and the same thing&#8230;.it goes to show how imprecise English really is. It reminds me of my daughter&#8217;s 6th grade math book, which in an attempt to make math more accessible winds up introducing the exact same type of idiosyncrasies as this. It&#8217;s very confusing. Math and programming are and should be precise, and spoken/written language is not (at least, not naturally or without a lot of care)&#8230;this is why we have specific &#8220;languages&#8221; of symbols to represent math and programming concepts. I suspect there are mathematicians (and Lisp programmers) who argue similar points about many scripting languages&#8230;.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/darrentcook.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/darrentcook.wordpress.com/48/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/darrentcook.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/darrentcook.wordpress.com/48/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/darrentcook.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/darrentcook.wordpress.com/48/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/darrentcook.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/darrentcook.wordpress.com/48/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/darrentcook.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/darrentcook.wordpress.com/48/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/darrentcook.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/darrentcook.wordpress.com/48/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/darrentcook.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/darrentcook.wordpress.com/48/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=darrentcook.wordpress.com&amp;blog=13453423&amp;post=48&amp;subd=darrentcook&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://darrentcook.wordpress.com/2010/08/31/toggle-hidden-files-in-os-x-finder-snow-leopard/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ec0982f4f9ba80859d4e8e4ec23d3ab3?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">darrentcook</media:title>
		</media:content>
	</item>
		<item>
		<title>Optimizing ColdFusion Code</title>
		<link>http://darrentcook.wordpress.com/2010/07/15/optimizing_coldfusion_code/</link>
		<comments>http://darrentcook.wordpress.com/2010/07/15/optimizing_coldfusion_code/#comments</comments>
		<pubDate>Thu, 15 Jul 2010 07:46:09 +0000</pubDate>
		<dc:creator>darrentcook</dc:creator>
				<category><![CDATA[ColdFusion]]></category>

		<guid isPermaLink="false">http://darrentcook.wordpress.com/?p=30</guid>
		<description><![CDATA[Optimizing ColdFusion Code Following are some tips, pointers and examples on best practices for writing optimized ColdFusion code. Some of the optimization results can be fairly astounding. Scopes slow down functions. Any scoped reference inside a function slows it down &#8230; <a href="http://darrentcook.wordpress.com/2010/07/15/optimizing_coldfusion_code/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=darrentcook.wordpress.com&amp;blog=13453423&amp;post=30&amp;subd=darrentcook&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h3>Optimizing ColdFusion Code</h3>
<p>Following are some tips, pointers and examples on best practices for writing optimized ColdFusion code. Some of the optimization results can be fairly astounding.</p>
<li>Scopes slow down functions. Any scoped reference inside a function slows it down by, in my estimation, a factor of 100. Even arguments.myVar is slower than just myVar.</li>
<li>VAR everything in a function, declaring dummy values to start, ie: <code>var nNumber = 0; var aArray = 0; var qQuery = 0; var stStruct = 0;</code> I know plenty of folks like to do <code>var LOCAL = StructNew(); LOCAL.myvar = "foo";</code>. But guess what, it can be quite slow in comparison. So if you need speed, stick to VAR. Additionally, using VAR makes your code more thread-safe by keeping local function variables out of the VARIABLES scope.</li>
<li>Use Compare() instead of EQ, NEQ, etc. Example:
<pre><code>function isNumber( sStr )
{
    return LSisNumeric( sStr ) AND sStr EQ Val( sStr );
}</code></pre>
<p>This was called 6468 times (33 cols, 196 rows, once for each cell). The job took 766ms. Simply changing it to:</p>
<pre><code>function isNumber( sStr )
{
    return LSisNumeric( sStr ) AND Not Compare( sStr, Val( sStr ) );
}</code></pre>
<p>&#8230;dropped the time to 501ms.</li>
<li>Use IncrementValue(i) instead of i = i + 1. Take, for example, the following loops:
<pre><code>&lt;cfscript&gt;
     for (i=1; i lt 250000; i=i+1) {
          x = i;
     }
&lt;/cfscript&gt;</code></pre>
<pre><code>&lt;cfscript&gt;
     var tick = 0;
     var i = 0;
     var x = 0;
     var top = 250000;
     for (i=1; Compare(i, top); i=IncrementValue(i) ) {
          x = i;
     }
&lt;/cfscript&gt;</code></pre>
<p>The second loop applies the 3 best practices of using VAR, Compare() and IncrementValue(). Guess what the runtimes are? ~980ms for the first loop, but only 63ms for the second loop!</li>
<li>Don&#8217;t write nice functions for short tasks, especially if they&#8217;re scoped. For example:
<pre><code>&lt;cfscript&gt;
    //Determines whether a datetime string contains only date data
    function isDateOnly( sStr )
    {
        try {
            ts    = ParseDateTime( sStr );
            dte    = ParseDateTime( DateFormat( sStr, "MM/DD/YYYY" ) );
            return Not DateCompare( ts, dte );
        } catch( Any e ) {
            return false;
        }
    }

    //Determines whether a datetime string contains only time data
    function isTimeOnly( sStr )
    {
        try {
            ts    = ParseDateTime( sStr );
            tme    = ParseDateTime( TimeFormat( sStr, "HH:mm:ss.l" ) );
            return Not DateCompare( ts, tme );
        } catch( Any e ) {
            return false;
        }
    }

    // Replacement for isNumeric(), since Assert( isNumeric( "100E4" ) )
    // With this, you can Assert( Not isNumber("100E4") ) and Assert( Not isNumber("10200,10300") )
    function isNumber( sStr )
    {
        return LSisNumeric( sStr ) AND Not Compare( sStr, Val( sStr ) );
    }

    Application.isDateOnly = isDateOnly;
    Application.isTimeOnly = isTimeOnly;
    Application.isNumber = isNumber;
&lt;/cfscript&gt;</code></pre>
<p>Later used by</p>
<pre><code>&lt;cfscript&gt;
    function generateClassForExcel( sCellData )
    {
        if(         Application.isNumber( sCellData )    )    return "class=""gen"" x:num";    // hack: adds the x:num attribute to the td
        else if(    Application.isDateOnly( sCellData )    )    return "class=""dt""";
        else if(    Application.isTimeOnly( sCellData )    )    return "class=""tm""";
        else if(     isDate( sCellData )                )    return "class=""dttm""";
        return "class=""txt""";
    }

    function writeTable( qQuery )
    {
        writeOutput("&lt;table&gt;" &amp; chr(13) );
        for( r = 1; r LTE qQuery.RecordCount; r++ )
        {
            writeOutput( "&lt;tr&gt;" &amp; chr(13) );
            for( c = 1; c LTE ListLen(qQuery.ColumnList); c++ )
                writeOutput("&lt;td #generateClassForExcel(qQuery[c][r])#&gt;#qQuery[c][r]#&lt;/td&gt;#chr(13)#");
            writeOutput( "&lt;/tr&gt;" &amp; chr(13) );
        }
        writeOutput("&lt;/table&gt;" &amp; chr(13) );
    }
&lt;/cfscript&gt;</code></pre>
<p>Using the above code for a 33 col x 196 row query took +200 seconds. So I performed some optimizations.<br />
Here are the steps I took to optimize the code, and how the stats changed as I went:</p>
<table border="1px solid silver" cellspacing="0" cellpadding="2">
<tbody>
<tr>
<th>Seconds per row</th>
<th>Total runtime (secs)</th>
<th>Step</th>
</tr>
<tr>
<td>1.0 &#8211; 1.3</td>
<td>~215</td>
<td>Original version as above, with Application scoped functions</td>
</tr>
<tr>
<td>.26 &#8211; .47</td>
<td>~75</td>
<td>After adding rowLimit &amp; colLimit variables and using Compare(), instead of evaluating query.RecordCount/ColumnList in the for() statement</td>
</tr>
<tr>
<td>.18</td>
<td>~35</td>
<td>After changing to cfscript from cftags (code not visible above: originally writeTable() was not a function but cfquery/cfloop/cfoutput statements, code which I lost before capturing these notes)</td>
</tr>
<tr>
<td>.04</td>
<td>.7</td>
<td>After removing  Application.isDateOnly() and Application.isTimeOnly() calls, to see what the effect would be.</td>
</tr>
<tr>
<td>0</td>
<td>&lt;.2</td>
<td>After removing all  Application.is*() function calls, to see what the baseline could be. The Total runtime is &lt;.2 because I lost the actual measurement&#8230;remind me to capture notes as I work next time, not afterwards. But who knew it would be this interesting??</td>
</tr>
<tr>
<td>0</td>
<td>.187</td>
<td>With final generateCellWithClass() function  (all Application.is*() functionality brought inline and the decision tree is revamped, see below)</td>
</tr>
</tbody>
</table>
<p>Here is what the final optimized code looked like:</p>
<pre><code>function generateCellWithClass( sCellData )
{
    var ts        = "";
    var dte        = "";
    var tme        = "";

    if( Not Compare( sCellData, Val( sCellData ) ) )
        return "&lt;td class=""gen"" x:num&gt;" &amp; sCellData &amp; "&lt;/td&gt;";

    else if( isDate( sCellData ) )
    {

        ts        = ParseDateTime( sCellData );
        dte        = ParseDateTime( DateFormat( sCellData, "MM/DD/YYYY" ) );
        if(    Not DateCompare( ts, dte ) )
            return "&lt;td class=""dt""&gt;" &amp; sCellData &amp; "&lt;/td&gt;";

        tme        = ParseDateTime( TimeFormat( sCellData, "HH:mm:ss.l" ) );
        if(    Not DateCompare( ts, tme ) )
            return "&lt;td class=""tm""&gt;" &amp; sCellData &amp; "&lt;/td&gt;";

        return "&lt;td class=""dttm""&gt;" &amp; sCellData &amp; "&lt;/td&gt;";

    }

    return "&lt;td&gt;" &amp; sCellData &amp; "&lt;/td&gt;";

}

function writeTable( qQuery )
{
    var rowLimit = qQuery.RecordCount + 1;
    var colLimit = ArrayLen( qQuery.getColumnList() ) + 1;

    writeOutput("&lt;table&gt;" &amp; chr(13) );
    for( r = 1; Compare( r, rowLimit ); r++ )
    {
        writeOutput( "&lt;tr&gt;" &amp; chr(13) );
        for( c = 1; Compare( c, columnLimit ); c++ )
            writeOutput(generateCellWithClass(qQuery[c][r] &amp; chr(13) );
        writeOutput( "&lt;/tr&gt;" &amp; chr(13) );
    }
    writeOutput("&lt;/table&gt;" &amp; chr(13));
}</code></pre>
<p>Notice that there are no scopes, everything is calculated locally, and the code more efficiently walks the decision tree. It&#8217;s also a lot shorter.</p>
<p>Using the optimized version took <strong>only 187ms</strong> for the exact same 33&#215;196 query!! From 215 seconds to 187ms&#8230;that&#8217;s a factor of what, 1150 times faster?</li>
<li>Functions which must start out scoped, can be copied to a local reference to remove the need for a scope. In the previous example, if generateCellWithClass() <em>had</em> to reside in the Application scope, the final code would still run slow. You can, however, copy a reference to it such that it becomes unscoped:
<pre><code>&lt;cfobject&gt;
    &lt;cfscript&gt;
        variables.generateCellWithClass = Application.generateCellWithClass; // copy the global function as a local instance
        function writeTable( qQuery )
        {
            ...
            generateCellWithClass(...);
            ...
        }
    &lt;/cfscript&gt;
&lt;/cfobject&gt;</code></pre>
<p>Now writeTable() can call generateCellWithClass() without a scope name, gaining most of the optimization back.</li>
<li>An example of a heavily optimized application function. Before:
<pre><code>&lt;cffunction
    name="TableToQuery"
    returnType="query"
    output="false"
    hint="Convert a a flat delimited table (as a string) to a cfquery object."
    &gt;
    &lt;!--- ARGUMENTS ---&gt;
    &lt;cfargument name="sTableData" type="string"&gt;
    &lt;cfargument name="sColDelim" type="string" default="#chr(9)#"&gt;
    &lt;!--- OPTIONAL ARGUMENTS ---&gt;

    &lt;!--- BODY ---&gt;
    &lt;cfscript&gt;

        sCRLF = chr(13) &amp; chr(10);

        // Replace alternate row delimiters with our default
        sTableData = Replace( sTableData, "#chr(13)##chr(10)#", "¶", "ALL" );
        sTableData = Replace( sTableData, "#chr(13)#", "¶", "ALL" );
        sTableData = Replace( sTableData, "#chr(10)#", "¶", "ALL" );

        // Replace empty items with a space, so our list functions don't drop them
        sTableData = Replace( sTableData, "#sColDelim##sColDelim#", " #sColDelim# #sColDelim# ", "all" );
        sTableData = Replace( sTableData, "#sColDelim#¶", "#sColDelim# ¶", "all" );
        sTableData = Replace( sTableData, "¶#sColDelim#", "¶ #sColDelim#", "all" );

        // get the columns for the table
        lCols = ListGetAt( sTableData, 1, "¶" );
        qData = QueryNew( Replace( lCols, sColDelim, ",", "all" ) );

        // load the data into the query
        for ( i = 2; i lte ListLen( sTableData, "¶" ); i = i + 1 )

        {
            nCurrRow = i - 1;
            QueryAddRow( qData );

            lRowData = ListGetAt( sTableData, i, "¶" );
            for ( j = 1; j lte ListLen( lRowData, sColDelim ); j = j + 1 )
            {
                sColData = Trim( ListGetAt( lRowData, j, sColDelim ) );
                if( sColData neq "" )
                {
                    // when exporting tab-separated format from Excel, values with double-quotes get escaped
                    // so we have to unescape them
                    sColData = Replace( sColData, '""', '"', "all" ); // remove double-quotes
                    if( Left( sColData, 1 ) eq '"' and Len( sColData ) gte 2 )
                        sColData = Mid( sColData, 2, Len( sColData ) );
                    if( Right( sColData, 1 ) eq '"' and Len( sColData ) gte 2 )
                        sColData = Mid( sColData, 1, Len( sColData ) - 1 );
                }
                QuerySetCell( qData, ListGetAt( lCols, j, sColDelim ), sColData, nCurrRow );
            }
        }

    &lt;/cfscript&gt;
    &lt;!--- RETURN ---&gt;
    &lt;cfreturn qData&gt;
&lt;/cffunction&gt;</code></pre>
<p>After:</p>
<pre><code>&lt;cffunction
    name="TSVtoQuery"
    returnType="query"
    output="false"
    &gt;
    &lt;!--- ARGUMENTS ---&gt;
    &lt;cfargument name="sTableData" type="string"&gt;
    &lt;cfargument name="sColDelim" type="string" default="#chr(9)#"&gt;
    &lt;!--- OPTIONAL ARGUMENTS ---&gt;
    &lt;cfargument name="bForceAllVarchars" type="boolean" default="false"&gt; &lt;!--- fixes errors when CF guesses the wrong data type for a col based on initial rows of data ---&gt;

    &lt;!--- BODY ---&gt;
    &lt;cfscript&gt;

        var sCRLF            = chr(13) &amp; chr(10);
        var aDataRecords    = 0;                    // sTableData parsed as an array
        var aColData        = 0;                    // aDataRecords[r] parsed as column values
        var qData            = 0;                    // the query we are building

        var aColNames        = 0;                    // Colnames for qData from sTableData
        var rows            = 0;                    // number of rows in sTableData
        var cols            = 0;                    // number of items in aDataRecords[r]
        var r                = 0;                    // row counter
        var c                = 0;                    // col counter
        var i                = 0;                    // general reusable counter

        // Replace alternate row delimiters with our default
        sTableData = Replace( sTableData, "#chr(13)##chr(10)#", "¶", "ALL" );
        sTableData = Replace( sTableData, "#chr(13)#", "¶", "ALL" );
        sTableData = Replace( sTableData, "#chr(10)#", "¶", "ALL" );

        // Replace empty items with a space, so our list functions don't drop them
        // Prep data
        sTableData = Replace( sTableData, "¶#sColDelim#", "¶ #sColDelim#", "all" );
        sTableData = Replace( sTableData, "#sColDelim#¶", "#sColDelim# ¶", "all" );
        sTableData = Replace( sTableData, "#sColDelim##sColDelim#", "#sColDelim# #sColDelim#", "all" );
        if( Left( sTableData, 1) EQ sColDelim )                // Handle the first column is unnamed
            sTableData = " " &amp; sTableData;
        sTableData = Replace( sTableData, '""', '"', "all" ); // Excel escapes double-quotes when exporting: remove these

        // Store our data in an accessible format
        aDataRecords = ListToArray( sTableData, "¶" );        

        // fix up the columns
        aDataRecords[1] = ListChangeDelims( aDataRecords[1], ",", sColDelim );
        i = 1;
        while ( ListFind( aDataRecords[1], " " ) )     // Replace blank col names with a value
        {
            aDataRecords[1] = ListSetAt( aDataRecords[1], ListFind( aDataRecords[1], " " ), "unnamed_col" &amp; i );
            i = IncrementValue( i );
        }
        aDataRecords[1] = ReplaceList( aDataRecords[1], " ,:,',__", "_,_,_,_" ); // column names cannot use these chars
        aColNames= ListToArray( aDataRecords[1], "," );

        // create the query
        if( bForceAllVarchars )
        {
            variables.dual = QueryNew( "" );
            qData = Application.QoQ( "select '' as " &amp; ListChangeDelims( aDataRecords[1], ", '' as " ) &amp; " from dual" );
        }
        else
        {
            qData = QueryNew( aDataRecords[1] );
        }
        QueryAddRow( qData, ArrayLen( aDataRecords ) - 1 );

        // load the data into the query
        rows = ArrayLen( aDataRecords ) + 1; // Convert LEQ to Compare() for performance
        for ( r = 2; Compare(r, rows); r = r + 1 )
        {
            aColData = ListToArray( aDataRecords[r], sColDelim );
            cols = Min( ArrayLen( aColData ), ArrayLen( aColNames ) ) + 1;
            for ( c = 1; Compare(c, cols); c = c + 1 )
                QuerySetCell( qData, aColNames[c], REReplace( aColData[c], "^[\s""]*([\s\S]*?)[\s""]*$", "\1", "ALL" ), r - 1 );
        }

    &lt;/cfscript&gt;
    &lt;!--- RETURN ---&gt;
    &lt;cfreturn qData&gt;
&lt;/cffunction&gt;</code></pre>
<ul>Things to note:</p>
<li>Everything is VAR&#8217;d</li>
<li>Many operations done inside the main loops are moved to the outside</li>
<li>Loop conditions are pre-evaluated as much as possible, and stored in a local var. Loop conditions use Compare() instead of LEQ, etc.</li>
<li>Arrays are used instead of Lists. Arrays are indexed: you only have to parse the string once during ListToArray() instead of every time with ListGetAt()</li>
<li>IF statements for the string manipulations are eliminated by combining everything into a regular expression. If I wanted further optimization, I&#8217;d use a Perl-compatible java regexp library, such as <a href="http://www.javaregex.com/">www.javaregex.com</a></li>
</ul>
<p>You&#8217;re wondering the difference, right?  I tried an upload with both functions, of 23k rows. The first one never finished, I killed it after 15 minutes. Or maybe it was 30 during lunch. Whatever.  The second one runs in 20 seconds!!!</li>
<p><strong>Caveats, disclaimers, yada yada:</strong></p>
<li>Note that this page does not dive into the fairly well documented and discussed slow-object-creation issues of CF. The rule of thumb there is, object creation is expensive, reuse objects as much as practical. Enough said&#8230;by me and for now, anyway.</li>
<li>These examples and any benchmarks were all made and tested in CF MX 6.1. I haven&#8217;t had a chance to benchmark these under CF 7 or greater yet&#8230;particularly because my benchmark tests were ad-hoc and have since mostly been lost. From a couple tests I have made under CF 8 and based on some intuition, I would say most of these points are still generally valid.</li>
<li>About the benchmarks: They are not strictly measured or controlled. In general, I tried to kill unnecessary apps and services on my Windows development server to get more consistent results, but otherwise I just ran a webpage a few times to get a ballpark number as stated by CF debug output or timestamp outputs. I have not tried to verify many of these in the 2 years since, but I know I saw the numbers  with my very own eyes at the time I ran them and they were big enough differences to prove the point.</li>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/darrentcook.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/darrentcook.wordpress.com/30/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/darrentcook.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/darrentcook.wordpress.com/30/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/darrentcook.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/darrentcook.wordpress.com/30/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/darrentcook.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/darrentcook.wordpress.com/30/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/darrentcook.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/darrentcook.wordpress.com/30/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/darrentcook.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/darrentcook.wordpress.com/30/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/darrentcook.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/darrentcook.wordpress.com/30/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=darrentcook.wordpress.com&amp;blog=13453423&amp;post=30&amp;subd=darrentcook&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://darrentcook.wordpress.com/2010/07/15/optimizing_coldfusion_code/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ec0982f4f9ba80859d4e8e4ec23d3ab3?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">darrentcook</media:title>
		</media:content>
	</item>
		<item>
		<title>ColdFusion Builder: CF Variable Mappings, code assist, and linked folders</title>
		<link>http://darrentcook.wordpress.com/2010/05/05/coldfusion-builder-code-assist-with-linked-folders/</link>
		<comments>http://darrentcook.wordpress.com/2010/05/05/coldfusion-builder-code-assist-with-linked-folders/#comments</comments>
		<pubDate>Wed, 05 May 2010 05:07:58 +0000</pubDate>
		<dc:creator>darrentcook</dc:creator>
				<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[ColdFusion Builder]]></category>
		<category><![CDATA[codeassist]]></category>
		<category><![CDATA[coldfusion]]></category>
		<category><![CDATA[coldfusionbuilder]]></category>

		<guid isPermaLink="false">http://darrentcook.wordpress.com/?p=7</guid>
		<description><![CDATA[How to extend ColdFusion Variable Mappings to directories outside of your project, using linked folders. <a href="http://darrentcook.wordpress.com/2010/05/05/coldfusion-builder-code-assist-with-linked-folders/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=darrentcook.wordpress.com&amp;blog=13453423&amp;post=7&amp;subd=darrentcook&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I was poking around ColdFusion Builder today, trying to get objects from my common library to display the code assist (aka code hints) popup. As described in various blogs (I read <a href="http://www.coldfusionjedi.com/index.cfm/2010/3/9/ColdFusion-Builder--Code-Assist-for-Scoped-Variables" target="_blank">this one</a> and <a href="http://blog.multipliedbyinfinity.com/post.cfm/coldfusion-variable-mappings-in-cf-builder" target="_blank">this one</a>) as well as in the CFB help files, you simply go into your project&#8217;s Properties &gt; ColdFusion Variable Mappings section, add the variable name alias and the &#8220;fully qualified&#8221; cf dot-notated path to the object.<br />
<a style="text-decoration:none;" href="http://darrentcook.files.wordpress.com/2010/05/7project_properties_mapping.jpg"><img class="size-full wp-image-10 alignnone" title="project properties mapping" src="http://darrentcook.files.wordpress.com/2010/05/7project_properties_mapping.jpg?w=640&#038;h=640" alt="" width="640" height="640" /></a></p>
<p>Well darn it all, it doesn&#8217;t always work, does it?  It turns out that &#8220;fully qualified&#8221; really means relative-to-your-project, not the webroot. So because my common folder resides in the filesystem outside of my TestProject folder, CFB can&#8217;t find it and won&#8217;t display code hints.</p>
<p>After posting a comment to this effect one one of the above blogs, I remembered folder linking from Flex, and lo and behold, it works lovely for ColdFusion variable mappings! So here&#8217;s how to do it.</p>
<h2>Step 1: create a new folder in your project</h2>
<p><a href="http://darrentcook.files.wordpress.com/2010/05/1new_folder.jpg"><img class="size-full wp-image-11 alignnone" title="1new_folder" src="http://darrentcook.files.wordpress.com/2010/05/1new_folder.jpg?w=640&#038;h=588" alt="" width="640" height="588" /></a></p>
<h2>Step 2: Click the advanced button, and check &#8220;Link to folder in the file system&#8221;</h2>
<p><a href="http://darrentcook.files.wordpress.com/2010/05/2new_folder_advanced.jpg"><img class="size-full wp-image-12 alignnone" title="2new_folder_advanced" src="http://darrentcook.files.wordpress.com/2010/05/2new_folder_advanced.jpg?w=640" alt=""   /></a></p>
<h2>Step 3: See that variables button? Click it</h2>
<p>Variables? It turns out Eclipse supports <em>path</em> variables, which can be used as shortcuts in path names. A prime opportunity to map the web root to a variable since it&#8217;ll be used a lot: here you see I am mapping my J2EE webroot folder to &#8220;www&#8221;:</p>
<p><a href="http://darrentcook.files.wordpress.com/2010/05/3new_path_variable.jpg"><img class="alignnone size-full wp-image-13" title="3new_path_variable" src="http://darrentcook.files.wordpress.com/2010/05/3new_path_variable.jpg?w=640&#038;h=647" alt="" width="640" height="647" /></a></p>
<p>Click OK a couple times to get back to the new folder window from step 2.</p>
<h2>Step 4: create your linked folder</h2>
<p>Now you want to enter the path to your external code directory (using the path variable you just created), and optionally modify the folder name:</p>
<p><a href="http://darrentcook.files.wordpress.com/2010/05/4new_folder_advanced_final.jpg"><img class="alignnone size-full wp-image-14" title="4new_folder_advanced_final" src="http://darrentcook.files.wordpress.com/2010/05/4new_folder_advanced_final.jpg?w=640" alt=""   /></a></p>
<p>Click finish and voila! You have a linked directory inside your project:</p>
<p><a href="http://darrentcook.files.wordpress.com/2010/05/5new_linked_folder_final.jpg"><img class="alignnone size-full wp-image-15" title="5new_linked_folder_final" src="http://darrentcook.files.wordpress.com/2010/05/5new_linked_folder_final.jpg?w=640&#038;h=586" alt="" width="640" height="586" /></a></p>
<p>The linked directory is now available for CFB to use when resolving ColdFusion Variable Mappings settings. Remember that first screenshot where I created the udf variable mapping? Let&#8217;s test it out now:</p>
<p><a href="http://darrentcook.files.wordpress.com/2010/05/8code_assist_works.jpg"><img class="alignnone size-full wp-image-17" title="8code_assist_works" src="http://darrentcook.files.wordpress.com/2010/05/8code_assist_works.jpg?w=640&#038;h=587" alt="" width="640" height="587" /></a></p>
<p>Excellent!! Just what the doctor ordered. Happy coding!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/darrentcook.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/darrentcook.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/darrentcook.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/darrentcook.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/darrentcook.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/darrentcook.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/darrentcook.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/darrentcook.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/darrentcook.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/darrentcook.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/darrentcook.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/darrentcook.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/darrentcook.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/darrentcook.wordpress.com/7/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=darrentcook.wordpress.com&amp;blog=13453423&amp;post=7&amp;subd=darrentcook&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://darrentcook.wordpress.com/2010/05/05/coldfusion-builder-code-assist-with-linked-folders/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ec0982f4f9ba80859d4e8e4ec23d3ab3?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">darrentcook</media:title>
		</media:content>

		<media:content url="http://darrentcook.files.wordpress.com/2010/05/7project_properties_mapping.jpg" medium="image">
			<media:title type="html">project properties mapping</media:title>
		</media:content>

		<media:content url="http://darrentcook.files.wordpress.com/2010/05/1new_folder.jpg" medium="image">
			<media:title type="html">1new_folder</media:title>
		</media:content>

		<media:content url="http://darrentcook.files.wordpress.com/2010/05/2new_folder_advanced.jpg" medium="image">
			<media:title type="html">2new_folder_advanced</media:title>
		</media:content>

		<media:content url="http://darrentcook.files.wordpress.com/2010/05/3new_path_variable.jpg" medium="image">
			<media:title type="html">3new_path_variable</media:title>
		</media:content>

		<media:content url="http://darrentcook.files.wordpress.com/2010/05/4new_folder_advanced_final.jpg" medium="image">
			<media:title type="html">4new_folder_advanced_final</media:title>
		</media:content>

		<media:content url="http://darrentcook.files.wordpress.com/2010/05/5new_linked_folder_final.jpg" medium="image">
			<media:title type="html">5new_linked_folder_final</media:title>
		</media:content>

		<media:content url="http://darrentcook.files.wordpress.com/2010/05/8code_assist_works.jpg" medium="image">
			<media:title type="html">8code_assist_works</media:title>
		</media:content>
	</item>
	</channel>
</rss>
