<?xml version="1.0" encoding="utf-8"?>
			
			<rss version="2.0" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:cc="http://web.resource.org/cc/" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd">

			<channel>
			<title>Making It Up As I Go Along - ColdFusion</title>
			<link>http://www.miuaiga.com/index.cfm</link>
			<description></description>
			<language>en-us</language>
			<pubDate>Sun, 05 Sep 2010 13:06:09 -0600</pubDate>
			<lastBuildDate>Sat, 04 Sep 2010 12:30:00 -0600</lastBuildDate>
			<generator>BlogCFC</generator>
			<docs>http://blogs.law.harvard.edu/tech/rss</docs>
			<managingEditor>michael@miuaiga.com</managingEditor>
			<webMaster>michael@miuaiga.com</webMaster>
			<itunes:subtitle></itunes:subtitle>
			<itunes:summary></itunes:summary>
			<itunes:category text="Technology" />
			<itunes:category text="Technology">
				<itunes:category text="Podcasting" />
			</itunes:category>
			<itunes:category text="Technology">
				<itunes:category text="Tech News" />
			</itunes:category>
			<itunes:keywords></itunes:keywords>
			<itunes:author></itunes:author>
			<itunes:owner>
				<itunes:email>michael@miuaiga.com</itunes:email>
				<itunes:name></itunes:name>
			</itunes:owner>
			<itunes:image href="" />
			<image>
				<url></url>
				<title>Making It Up As I Go Along</title>
				<link>http://www.miuaiga.com/index.cfm</link>
			</image>
			<itunes:explicit>no</itunes:explicit>
			
			<item>
				<title>How to set up local vs. production settings for Mura CMS</title>
				<link>http://www.miuaiga.com/index.cfm/2010/9/4/How-to-set-up-local-vs-production-settings-for-Mura-CMS</link>
				<description>
				
				&lt;p&gt;In an effort to become acquainted with &lt;a href=&quot;http://www.getmura.com&quot; target=&quot;_blank&quot;&gt;Mura CMS&lt;/a&gt;, I have been spending some time looking at the overall way the application is structured - what is included into what, where settings are stored or specified, and what the options are for modifying the default way things are done, in order to retain some of the in-house workflow concepts I have developed over the years.&lt;br /&gt;&lt;br /&gt;One of the main aspects of my production workflow involves the easy use of both a local and live server, running from the same database. Generally, when starting a new ColdFusion project, I like to:&lt;/p&gt;
&lt;p&gt;- Set up a local directory for the project, where i can work in the browser via a local host url&lt;br /&gt;(something like http://172.16.17.5:8500/SiteName/wwwroot/&amp;nbsp; or http://localhost:8500/sitename/wwwroot )&lt;/p&gt;
&lt;p&gt;- Set up a database on my live production server at &lt;a title=&quot;ColdFusion Hosting&quot; href=&quot;http://www.GoWestHosting.com&quot; target=&quot;_blank&quot;&gt;www.GoWestHosting.com&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;- Create a DSN on the live server, pointing to the database&lt;/p&gt;
&lt;p&gt;- Create a DSN on my local CF server, pointing to the same remote database&lt;br /&gt;&lt;br /&gt;Now I can work locally and view my changes instantly without the need for FTP.&lt;br /&gt;&lt;br /&gt;Or, as needed, I can push changes to the live site with a few clicks, and view the changes there as well (such as posting work for clients, or working with routines that require server-specific settings, launched from the site&apos;s &quot;real&quot; location)&lt;br /&gt;&lt;br /&gt;My application.cfc contains both sets of DSN info, and uses a switch, based on the current cgi. server variables , to determine which DSN to run from, along with other server specific settings (such as google map key). So, wherever the site is viewed, my application &apos;knows&apos; which content paths and other settings to use for each page request or query.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;(So... what about MuraCMS?) &lt;/em&gt;&lt;br /&gt;&lt;br /&gt;One of the first things I noticed when installing Mura locally was the way that it cached the local directory structure. So if my Mura site was installed in a subdirectory of the local site, e.g. http://localhost:8500/sitename/wwwroot/test/ , Mura would store the setting &quot;/sitename/wwwroot/test&quot; automatically, and prepend this path to all required assets. Wonderful. Superb. But...&lt;/p&gt;
&lt;p&gt;Then I pushed the Mura files to the live server, uploading the works via FTP. And found I had a problem. That path was still being prepended to all assets... but didn&apos;t exist.&lt;br /&gt;On the live server i was simply working from http://sitename.com/test/ , so everything was instantly broken - images, javascript, css. &lt;br /&gt;&lt;br /&gt;Unlike my own usual practices, where all primary templates or pages live in the site root,&amp;nbsp; Mura is designed to use &apos;root relative&apos; paths, rather than location relative, which makes sense if content will be served from different directory levels. &lt;br /&gt;&lt;br /&gt;So instead of simply looking in ../css/ for a css file, it wants to use the path /sitename/wwwroot/test/css&lt;/p&gt;
&lt;p&gt;&lt;em&gt;(So... how did I fix this? Get to the point already... )&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Half of any solution is identifying the problem. In this case, I needed to find out &quot;how to use two different sets of configuration variables&quot; , and set out to find the answer.&lt;/p&gt;
&lt;p&gt;On setup, mura creates and populates a file called &apos;settings.ini.cfm&apos;, which is a simple text file with variables and values stored one per line. And inside, I could see the paths were being stored as text strings. Cool. Now I know where it lives... but how to change it on the fly, and keep two different versions?&lt;/p&gt;
&lt;p&gt;I asked my question to the very friendly, patient guys on &lt;a href=&quot;http://www.getmura.com/index.cfm/blog/the-mura-show/&quot; target=&quot;_blank&quot;&gt;the Mura Show&lt;/a&gt; , but must not have asked correctly, or clearly enough. I came away thinking the solution was to set up a domain &apos;alias&apos; and somehow map a direct IP to my subfolder locally , which doesn&apos;t work since you can&apos;t put paths in the Windows hosts file... and i got into a right frustrating mess.&lt;/p&gt;
&lt;p&gt;Deciding to take another crack at it with fresh morning-coffee eyes, I got smart and did a bit of googling. And I found this, the settings.ini reference from the Mura site: &lt;a href=&quot;http://docs.getmura.com/index.cfm/installation-set-up/settingsinicfm-reference/&quot; target=&quot;_blank&quot;&gt;http://docs.getmura.com/index.cfm/installation-set-up/settingsinicfm-reference/ &lt;/a&gt;&lt;/p&gt;
&lt;p&gt;and... AHA! a classic RTFM moment.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;(finally... the fix !)&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;wouldn&apos;t you know it, the very first line of the settings.ini.cfm file is for the &quot;mode&quot;, (which i completely overlooked before, and the Mura team must not have thought of in reference to my seemingly vague questions. )&lt;/p&gt;
&lt;p&gt;The default mode is &apos;production&apos; and beyond the first few lines, all settings in the file are under a heading of [production]. The light started coming on right about now... they really did think of everything! &lt;br /&gt;&lt;br /&gt;So, all I had to do was create another grouping, and change that master &apos;mode&apos; setting. I simply duplicated all the lines below [production], added a new heading of [localdev] , and changed the settings to match those of my local server. (I also changed &apos;production&apos; paths to match the settings of my live production server with the simpler root directory structure) &lt;br /&gt;&lt;br /&gt;Just a few more steps - upload the changed file to the live server, and click &apos;reload application&apos; in the Mura admin.&amp;nbsp; Then, change my local copy of the settings.ini.cfm file to &apos;mode=localdev&apos; , and click &apos;reload application&apos; in my local admin as well. &lt;br /&gt;&lt;br /&gt;This caused the local settings to be loaded for the local site, and the production settings to be loaded for the production site ... and i am back in business, working in both locations with ease! &lt;br /&gt;&lt;br /&gt;Bearing in mind that any uploaded images will need to be manually copied with FTP, and some other things might need a little hand-holding, I am very pleased to be back in business with the freedom to work the way I am used to, with live, functioning copies of the complete site on both my local server and the live location.&lt;/p&gt;
&lt;p&gt;The only caveat at this stage - I&apos;ll have to be careful not to upload the settings.ini.cfm file, since I still don&apos;t have an &apos;automatic&apos; switch for which group of settings to use. But as long as my production version of the file says &quot;mode=production&quot; and my local file says &quot;mode=localdev&quot; , I should be good to go.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt; 
				</description>
				
				<category>ColdFusion</category>				
				
				<category>Mura CMS</category>				
				
				<pubDate>Sat, 04 Sep 2010 12:30:00 -0600</pubDate>
				<guid>http://www.miuaiga.com/index.cfm/2010/9/4/How-to-set-up-local-vs-production-settings-for-Mura-CMS</guid>
				
			</item>
			
			<item>
				<title>HTML Formatter ColdFusion-friendly code cleanup tool</title>
				<link>http://www.miuaiga.com/index.cfm/2010/2/8/HTML-Formatter-ColdFusionfriendly-code-cleanup-tool</link>
				<description>
				
				&lt;p&gt;No matter how clean your code, there&apos;s something to be said for a fast, clean pre-launch cleanup with a reliable code formatter . My favorite by far is the HTML Formatter from LogicHammer.com:&amp;nbsp; &lt;a href=&quot;http://www.logichammer.com/html-formatter/&quot; target=&quot;_blank&quot;&gt;http://www.logichammer.com/html-formatter/&lt;br /&gt;&lt;br /&gt;&lt;/a&gt;Complete with a full set of ColdFusion-friendly options, this simple tool makes cleaning your code a snap. I use it as I&apos;m working, to clean up the work-so-far at any point, and before final launch to make sure the production code will be as easy as possible to maintain and revisit later on. It is a standalone executable, which means there&apos;s no installation, and you can put in anywhere you like on your hard drive.&lt;/p&gt;
&lt;p&gt;I simply create a taskbar shortcut on my Windows PC and drag the files I want to clean directly from the &apos;project&apos; view in Eclipse onto the icon - couldn&apos;t be faster, simpler or easier. I prefer to have my original files altered, with the originals automatically put in a specified backup location - you can also assign the option to leave the original alone and create a cleaned-up copy.&lt;/p&gt;
&lt;p&gt;Among other fav features, HTML Formatter ships with a simple text-based config file which makes it incredibly easy to specify tags to ignore or to indent, and file extensions to be formatted or skipped ( you can run the formatting on specific files, or an entire directory).&lt;/p&gt;
&lt;p&gt;For only $14.99 you get all the features and 2 years of updates (there is also an 8.99 version with a basic feature set). The program&apos;s developer has answered every question I ask directly and has been very helpful with customizations, even building in some features I requested a while back (for the record - I&apos;m not affiliated with logichammer in any way, just very pleased with this slick little tool).&lt;/p&gt; 
				</description>
				
				<category>ColdFusion</category>				
				
				<category>Tools &amp;amp; Tips</category>				
				
				<category>WebDev</category>				
				
				<pubDate>Mon, 08 Feb 2010 23:44:00 -0600</pubDate>
				<guid>http://www.miuaiga.com/index.cfm/2010/2/8/HTML-Formatter-ColdFusionfriendly-code-cleanup-tool</guid>
				
			</item>
			
			<item>
				<title>How to find lowercase (no caps) values in mySQL (and Capitalize them with ColdFusion)</title>
				<link>http://www.miuaiga.com/index.cfm/2010/2/4/How-to-find-lowercase-no-caps-values-in-mySQL-and-Capitalize-them-with-ColdFusion</link>
				<description>
				
				I have a request from a client to help clean up some customer-entered data in a mySQL database, specifically, we need to capitalize all of the values in a column called &apos;user_city&apos;

For the actual capitalization, I am using the very handy CapFirstTitle() function from CFlib : &lt;a href=&quot;http://www.cflib.org/index.cfm?event=page.udfbyid&amp;udfid=116&quot;&gt;http://www.cflib.org/index.cfm?event=page.udfbyid&amp;udfid=116&lt;/a&gt;

But first, I need to find all of the entries that are not already capitalized. This dataset has tens of thousands of records , including some with a blank value in the &apos;city&apos; field - no need to loop all of that just to fix our caps! 

So, here&apos;s the SQL query code to find all of the records with no capital letters at all, by comparing to a lower() all lowercase version of the same value:

&lt;code&gt;
SELECT  user_city, ID 
FROM site_users
WHERE user_city = lower(user_city)
AND NOT user_city = &apos;&apos;
ORDER  by user_city
&lt;/code&gt;

And here is the full CFoutput / CFquery code for the loop and update with Coldfusion, and the CapFirstTitle() function in the head of the page: 

&lt;code&gt;
&lt;cfoutput query=&quot;myQueryAbove&quot;&gt;
	&lt;cfquery datasource=&quot;#application.dsn#&quot;&gt;
	UPDATE site_users
	SET user_city = &apos;#capFirstTitle(myQueryAbove.user_city)#&apos;
	WHERE ID = #myQueryAbove.ID#
	&lt;/cfquery&gt;
&lt;/cfoutput&gt;

&lt;/code&gt;

for other columns you could use OR in the first query and an additional statement in the second, or just change the queries, run the page again, or even, make the column name a variable and just change it once in the head of the page... easy. 
				</description>
				
				<category>mySQL</category>				
				
				<category>ColdFusion</category>				
				
				<pubDate>Thu, 04 Feb 2010 18:30:00 -0600</pubDate>
				<guid>http://www.miuaiga.com/index.cfm/2010/2/4/How-to-find-lowercase-no-caps-values-in-mySQL-and-Capitalize-them-with-ColdFusion</guid>
				
			</item>
			
			<item>
				<title>Show any Twitter Feed on your site with ColdFusion and CFFEED</title>
				<link>http://www.miuaiga.com/index.cfm/2009/10/22/Show-any-Twitter-Feed-on-your-site-with-ColdFusion-and-CFFEED</link>
				<description>
				
				This is so simple, I&apos;ll let the comments do the &apos;splainin:

&lt;code&gt;

&lt;!--- 
start CF Twitter Feed 
---&gt;

&lt;!--- SET THE URL: add your username instead of mine ---&gt;

&lt;cfset feedurl=&quot;http://search.twitter.com/search.atom?q=from%3Agowestweb&quot; /&gt;

&lt;!--- CFFEED does all the work ---&gt;

&lt;cffeed
    source=&quot;#feedurl#&quot;
    properties=&quot;feedmeta&quot;
    query=&quot;feeditems&quot;
    overwrite=&quot;true&quot; /&gt;

&lt;!--- CFOUTPUT shows the feed like a query ---&gt;

&lt;ul class=&quot;tweet&quot;&gt;
&lt;!--- change maxrows to suit your layout ---&gt;
&lt;cfoutput query=&quot;feeditems&quot; maxrows=&quot;3&quot;&gt;
&lt;li&gt;#content#&lt;/li&gt;
&lt;/cfoutput&gt;
&lt;/ul&gt;

&lt;!---  
end CF Twitter Feed 
---&gt;

&lt;!---
NOTE: in addition to #content#, you can show date and other columns related to each feed item. 
Use &lt;cfdump var=&quot;#feeditems#&quot;&gt; to see all the available columns in the query 
---&gt;


&lt;/code&gt; 
				</description>
				
				<category>ColdFusion</category>				
				
				<category>Demos</category>				
				
				<category>WebDev</category>				
				
				<pubDate>Thu, 22 Oct 2009 00:25:00 -0600</pubDate>
				<guid>http://www.miuaiga.com/index.cfm/2009/10/22/Show-any-Twitter-Feed-on-your-site-with-ColdFusion-and-CFFEED</guid>
				
			</item>
			
			<item>
				<title>ColdFusion Form Spam Prevention: CF Meetup Notes and Follow-Up</title>
				<link>http://www.miuaiga.com/index.cfm/2009/10/15/ColdFusion-Form-Spam-Prevention-CF-Meetup-Notes-and-FollowUp</link>
				<description>
				
				Thanks to all who attended my first CF Meetup presentation. 

Info: &lt;a href=&quot;http://www.meetup.com/coldfusionmeetup/calendar/11596049/?a=nr1p_grp&amp;rv=nr1p&quot;&gt;http://www.meetup.com/coldfusionmeetup/calendar/11596049/?a=nr1p_grp&amp;rv=nr1p&lt;/a&gt;

Recording: &lt;a href=&quot;http://www.meetup.com/coldfusionmeetup/pages/Recordings_of_the_ColdFusion_Meetup-2009/&quot;&gt;http://www.meetup.com/coldfusionmeetup/pages/Recordings_of_the_ColdFusion_Meetup-2009/&lt;/a&gt;

Demo Page (as seen in the presentation): &lt;a href=&quot;http://www.gowestwebdesign.com/demos/contact-form/index.cfm&quot;&gt;http://www.gowestwebdesign.com/demos/contact-form/index.cfm&lt;/a&gt;

As far as I can tell we had a good turnout, and though talking to a silent connection takes some getting used to, the live-chat comments and interaction during the talk really made it fun (and helped me fill the full time slot with this simple subject!). 

I really enjoy meeting other developers and designers, and I hope anybody who attended, had questions or just wants to get more involved in the community will drop me an email, check out our web developer newsgroups (see the link top right of this blog), and of course... be my Facebook and/or Twitter friend.

Thanks also to Charlie Arehart for all of his efforts keeping the CF Meetups going, and growing strong. He was the perfect balance of aggressive and encouraging in getting me to present this topic, and I am very glad he persisted. He&apos;s definitely the right guy for the positing of CF Host and quickly removed any concerns or worries I might have had just before we went live.

Now that it is done, I would like to do another! On that note, if there is anything you think I know about, that you&apos;d like to see me share, please do drop me a line.

Several people asked to have a copy of the code used in the presentation. The sample below is directly from the file shown in the demo.

&lt;code&gt;

&lt;!--- START PROCESSING ---&gt;
&lt;cfif isDefined(&apos;form.senderFrom&apos;)&gt;

&lt;!--- VALIDATE FIELDS ---&gt;

&lt;!--- check email ---&gt;
&lt;cfif NOT len(trim(form.senderFrom)) gt 6 or NOT isValid(&apos;email&apos;,form.senderFrom)&gt;
&lt;cfset request.formError = &apos;A valid email address must be provided&apos;&gt;

&lt;!--- message ---&gt;
&lt;cfelseif NOT len(trim(form.senderMessage))&gt;
&lt;cfset request.formError = &apos;Be sure to include a message&apos;&gt;

&lt;!--- honeypot ---&gt;
&lt;cfelseif len(trim(form.email_address))&gt;
&lt;cfset request.formError = &apos;Spam!! &lt;br /&gt;(Run away! Run away!)&apos;&gt;
&lt;/cfif&gt;

&lt;!--- /end VALIDATE FIELDS ---&gt;

&lt;!--- CHECK FOR UNWANTED CONTENT---&gt;
&lt;!--- loop all form variables ---&gt;
&lt;cfloop index=&quot;f&quot; list=&quot;#form.fieldnames#&quot;&gt;
&lt;!--- set variable for field value ---&gt;
&lt;cfset value=&quot;#evaluate(&apos;form.#f#&apos;)#&quot;&gt;

&lt;!--- BANNED WORDS ---&gt;
&lt;cfset bannedWordsList = &quot;herring,albatross,dragon,grail,lumberjack&quot;&gt;

&lt;!--- loop the banned words list and see if we have a match ---&gt;
&lt;!--- Check for banned words ---&gt;
&lt;cfloop list=&quot;#bannedWordsList#&quot; delimiters=&quot;,&quot; index=&quot;w&quot;&gt;
&lt;cfif FindNoCase(w,value)&gt;

&lt;cfset request.formerror=&quot;&lt;br /&gt;Beg your pardon? &lt;br /&gt;Your WHAT hurts?&quot;&gt;
&lt;cfbreak&gt;
&lt;/cfif&gt;
&lt;/cfloop&gt;
&lt;!--- / end BANNED WORDS ---&gt;

&lt;!--- HTML BLOCK ---&gt;
&lt;cfset leftChar = &apos;&lt;&apos; &gt;
&lt;cfset rightChar = &apos;&gt;&apos; &gt;
&lt;!--- look for both characters contained in our content ---&gt;
&lt;cfif findNoCase(leftChar, value) AND findNoCase(rightChar, value)&gt;
&lt;cfset request.formerror = &quot;Text only please - no HTML&quot;&gt;
&lt;cfbreak&gt;
&lt;/cfif&gt;
&lt;!--- / end HTML BLOCK ---&gt;

&lt;/cfloop&gt;
&lt;!--- / end CHECK FOR UNWANTED CONTENT ---&gt;

&lt;fieldset&gt;
	&lt;legend&gt;
		&lt;cfif isDefined(&apos;request.formerror&apos;) and len(trim(request.formerror))&gt;
		Error!
			&lt;cfelse&gt;
		Thank You
		&lt;/cfif&gt;
	&lt;/legend&gt;

&lt;!--- SHOW RESPONSE ---&gt;
&lt;cfif isDefined(&apos;request.formerror&apos;) and len(trim(request.formerror))&gt;
&lt;p&gt;&lt;strong&gt;ERROR: &lt;cfoutput&gt;#request.formerror#&lt;/cfoutput&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Go &lt;a href=&quot;javascript:history.back()&quot;&gt;back&lt;/a&gt; and try again&lt;/p&gt;

&lt;cfelse&gt;
&lt;p&gt;Thank you. &lt;br /&gt;&lt;br /&gt;Your message has been sent and we will reply soon!&lt;/p&gt;
&lt;/cfif&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;/fieldset&gt;

&lt;!--- IF FORM NOT SUBMITTED (show the form) ---&gt;
&lt;cfelse&gt;

&lt;fieldset&gt;&lt;legend&gt;Sample Contact Form&lt;/legend&gt;

&lt;cfform name=&quot;contactForm&quot; action=&quot;#cgi.SCRIPT_NAME#&quot; method=&quot;post&quot;&gt;
&lt;div&gt;
&lt;label for=&quot;senderName&quot;&gt;Name:&amp;nbsp;&amp;nbsp;&lt;/label&gt;&lt;cfinput type=&quot;text&quot; name=&quot;senderName&quot; size=&quot;48&quot; value=&quot;&quot; required=&quot;true&quot; message=&quot;Your Name is required&quot;&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;label for=&quot;senderFrom&quot;&gt;Email:&amp;nbsp;&amp;nbsp;&lt;/label&gt;&lt;cfinput type=&quot;text&quot; name=&quot;senderFrom&quot; size=&quot;48&quot; value=&quot;&quot; required=&quot;true&quot; validate=&quot;email&quot; message=&quot;Email Address is required&quot;&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;label for=&quot;senderPhone&quot;&gt;Phone:&amp;nbsp;&amp;nbsp;&lt;/label&gt;&lt;input type=&quot;text&quot; name=&quot;senderPhone&quot; size=&quot;20&quot; value=&quot;&quot;&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;label for=&quot;senderPhone&quot;&gt;Your Message:&lt;/label&gt;&lt;textarea name=&quot;senderMessage&quot; cols=&quot;30&quot; rows=&quot;12&quot; style=&quot;width:310px;&quot;&gt;&lt;/textarea&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align:center&quot;&gt;
&lt;input type=&quot;submit&quot; value=&quot;Submit&quot;&gt;
&lt;/div&gt;

&lt;div id=&quot;email_wrapper&quot;&gt;
&lt;input type=&quot;text&quot; name=&quot;email_address&quot; value=&quot;&quot; size=&quot;20&quot;&gt;
&lt;/div&gt;

&lt;/cfform&gt;

&lt;/fieldset&gt;

&lt;/cfif&gt;
&lt;!--- / end IF FORM SUBMITTED ---&gt;

&lt;/code&gt;

Thanks again to Charlie and everyone else - this has been a very positive and rewarding experience, and I hope to return with more good CF-Stuff to share. 
				</description>
				
				<category>ColdFusion</category>				
				
				<category>Demos</category>				
				
				<pubDate>Thu, 15 Oct 2009 13:43:00 -0600</pubDate>
				<guid>http://www.miuaiga.com/index.cfm/2009/10/15/ColdFusion-Form-Spam-Prevention-CF-Meetup-Notes-and-FollowUp</guid>
				
			</item>
			
			<item>
				<title>Come to my (first) CF Meetup: Captcha-Free Spam Prevention for ColdFusion Forms</title>
				<link>http://www.miuaiga.com/index.cfm/2009/10/12/Come-to-my-first-CF-Meetup-CaptchaFree-Spam-Prevention-for-ColdFusion-Forms</link>
				<description>
				
				Tired of Spam? (Who isn&apos;t?)

No matter how good our filters are, or how careful we may be about making our email addresses publicly accessible, some of the nasty stuff still gets through. 

But there is a way to fight back, defending your websites&apos; contact forms and other form-to-email inputs, without making your website visitors jump through extra hoops, solve puzzles or read fuzzy scrambled letters (captcha) just to drop you a note.

To learn more, tune into my ColdFusion Meetup presentation this Thursday, October 15, 2009. (If you haven&apos;t yet attended the CF Meetup, this is a good time to start!)

Details here:
&lt;a href=&quot;http://www.meetup.com/coldfusionmeetup/boards/view/viewthread?thread=784112&quot;&gt;http://www.meetup.com/coldfusionmeetup/boards/view/viewthread?thread=7841126&lt;/a&gt;

The live meetup will be here: &lt;a href=&quot;http://experts.acrobat.com/cfmeetup/&quot;&gt;http://experts.acrobat.com/cfmeetup/&lt;/a&gt;

Recording will be posted here: &lt;a href=&quot;http://recordings.coldfusionmeetup.com/&quot;&gt;http://recordings.coldfusionmeetup.com/&lt;/a&gt;


See you at Noon Eastern (10am here in Utah) on Thursday, October 15 ! 
				</description>
				
				<category>ColdFusion</category>				
				
				<category>Demos</category>				
				
				<category>WebDev</category>				
				
				<pubDate>Mon, 12 Oct 2009 12:14:00 -0600</pubDate>
				<guid>http://www.miuaiga.com/index.cfm/2009/10/12/Come-to-my-first-CF-Meetup-CaptchaFree-Spam-Prevention-for-ColdFusion-Forms</guid>
				
			</item>
			
			<item>
				<title>How to use the CFEclipse Scribble Pad as a fast and easy ColdFusion sandbox</title>
				<link>http://www.miuaiga.com/index.cfm/2009/9/5/How-to-use-the-CFEclipse-Scribble-Pad-as-a-fast-and-easy-ColdFusion-sandbox</link>
				<description>
				
				&lt;p&gt;Like most developers I know, I&apos;m always checking functions, testing little changes and trying to find just the right syntax for certain bits and blocks of code. Every project usually ends up with a &apos;test.cfm&apos; file, which gets written and overwritten with all sorts of little snippets, queries, and other scribbly things, then deleted. To use the test file, I open it like any file in my editor, make changes, then load that page&apos;s local url in the browser, refresh, repeat... not bad, it works... but I just discovered something much better!&lt;/p&gt;
&lt;p&gt;Thanks to Mark Esher&apos;s MX Unit blog post about the &lt;a href=&quot;http://blog.mxunit.org/2009/04/timesavers-cfeclipse-scribble-pad.html&quot;&gt;CFEclipse Scribble Pad&lt;/a&gt; , I&apos;ve now got a one-click (or one key, F8) instant sandbox to scribble whatever I like, across all projects in my Eclipse workspace. Launching the CFEclipse scribble now (F8) causes 2 things to happen automatically: my &apos;scribble.cfm&apos; file (stored in a _temp project in my workspace) opens for editing, and the Eclipse browser view (which I seldom use otherwise but is perfect for viewing little bits, cfdumps and snippets) pops up, showing me the rendered output. Very nice.&lt;/p&gt;
&lt;p&gt;It isn&apos;t just saving the clicks, but saving the thought process. While coding, the distraction of stopping, making a temp file, going to that file in the browser.. every step takes my mind further off of the super-intensive outrageously-important totally-impressive thing I was doing when I decided I needed to scribble in the first place. &lt;br /&gt;&lt;br /&gt;Setting it up was easy - just follow the directions : &lt;a href=&quot;http://blog.mxunit.org/2009/04/timesavers-cfeclipse-scribble-pad.html&quot;&gt;http://blog.mxunit.org/2009/04/timesavers-cfeclipse-scribble-pad.html&lt;/a&gt; . This is another perfect example of the powerful, practical tools and timesavers that hide behind a previously-unnoticed menu option or toolbar icon - and though one of the simplest, I have no doubt this will be among my most-used commands when working in Eclipse!&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt; 
				</description>
				
				<category>ColdFusion</category>				
				
				<category>Eclipse</category>				
				
				<category>WebDev</category>				
				
				<pubDate>Sat, 05 Sep 2009 11:34:00 -0600</pubDate>
				<guid>http://www.miuaiga.com/index.cfm/2009/9/5/How-to-use-the-CFEclipse-Scribble-Pad-as-a-fast-and-easy-ColdFusion-sandbox</guid>
				
			</item>
			
			<item>
				<title>Add Leading Zeros to a Numeric Value with ColdFusion</title>
				<link>http://www.miuaiga.com/index.cfm/2009/8/31/Add-Leading-Zeros-to-a-Numeric-Value-with-ColdFusion</link>
				<description>
				
				ColdFusion&apos;s numberformat() allows for the use of &apos;_&apos; (underscore) or &apos;9&apos; as a placeholder in a numeric mask. But these do not add a leading zero to non-decimal values. ( If the number contains fewer digits than the mask, you get the truncated number without any zeros on the left side).

In some cases, however, you want those zeros. The super-simple CF solution? Use a &apos;0&apos; as the mask character!

&lt;code&gt;
&lt;cfset theNumber = &quot;1287&quot;&gt;
&lt;cfoutput&gt;#NumberFormat(TheNumber, &quot;000009&quot;)#&lt;/cfoutput&gt;
&lt;/code&gt;

This returns 001287

&lt;code&gt;
&lt;cfset theNumber = &quot;1287&quot;&gt;
&lt;cfoutput&gt;#NumberFormat(TheNumber, &quot;999999&quot;)#&lt;/cfoutput&gt;
&lt;/code&gt;

This returns 1287 
				</description>
				
				<category>ColdFusion</category>				
				
				<pubDate>Mon, 31 Aug 2009 11:50:00 -0600</pubDate>
				<guid>http://www.miuaiga.com/index.cfm/2009/8/31/Add-Leading-Zeros-to-a-Numeric-Value-with-ColdFusion</guid>
				
			</item>
			
			<item>
				<title>Get the recordcount of a ColdFusion update, insert or delete query using CFquery result attribute</title>
				<link>http://www.miuaiga.com/index.cfm/2009/8/27/Get-the-recordcount-of-a-ColdFusion-update-insert-or-delete-query-using-CFquery-result-attribute</link>
				<description>
				
				When you run a cfquery using SELECT, the number of records returned is easy to find using #queryname.recordcount# - but what about the other types of SQL queries, our good friends Update, Insert and Delete ? Those query types don&apos;t return a total of rows in the same way.

But there&apos;s an easy solution ... once again, we can use &apos;recordcount&apos;, but in this case it is a node of the &apos;result&apos; variable as defined in our cfquery tag.

&lt;code&gt;

&lt;cfquery datasource=&quot;#request.dsn#&quot; name=&quot;saveChanges&quot; result=&quot;updateResult&quot;&gt;
UPDATE table_name
SET 
column1 = &apos;#value1#&apos;, 
column2 = &apos;#value2#&apos;
WHERE column3 = 1
&lt;/cfquery&gt;

&lt;cfset recordsChanged = updateResult.recordCount&gt;
&lt;/code&gt;

That query is just a sample, you could have any &apos;where&apos; statement, values, etc... but notice the &quot;result&quot; attribute of the cfquery tag, which will accept any variable name you want to use. Then, immediately following the query code, we simply get the &apos;recordcount&apos; node of the result structure, and we have the number of updated records from the query. 

( Note: this example is for mySQL - ymmv with other db types) 
				</description>
				
				<category>mySQL</category>				
				
				<category>ColdFusion</category>				
				
				<pubDate>Thu, 27 Aug 2009 19:06:00 -0600</pubDate>
				<guid>http://www.miuaiga.com/index.cfm/2009/8/27/Get-the-recordcount-of-a-ColdFusion-update-insert-or-delete-query-using-CFquery-result-attribute</guid>
				
			</item>
			
			<item>
				<title>Get the ID of a newly created record from a ColdFusion insert query using CFquery result attribute</title>
				<link>http://www.miuaiga.com/index.cfm/2009/8/27/Get-the-ID-of-a-newly-created-record-from-a-ColdFusion-insert-query-using-CFquery-result-attribute</link>
				<description>
				
				When inserting a new row to a mySQL database table using &amp;lt;cfquery&amp;gt;, it is often necessary to find the ID of the new record so you can refer to it in subsequent queries or other code further down the page.

There are a few ways to do this, but I like this one best:

&lt;code&gt;

&lt;cfquery name=&quot;insertRecord&quot; datasource=&quot;#request.dsn#&quot;  result=&quot;insertResult&quot;&gt;
INSERT INTO my_table
(
column_1,
column_2,
etc
)
VALUES
(
&apos;#value1#&apos;,
&apos;#value2#&apos;,
&apos;etc&apos;
)
&lt;/cfquery&gt;

&lt;cfset newID = insertResult.generated_Key&gt;
&lt;/code&gt;

Notice the &quot;result&quot; attribute of the cfquery tag, which will accept any variable name you want to use. 
Then, immediately following the query code, we simple get the &apos;generated_Key&apos; node of the result value, and voila - we have the ID of the new record, ready for whatever is needed next.

(Note: This example is for mySQL - not sure how this plays out in MS SQL or other DB engines... your mileage may vary.) 
				</description>
				
				<category>mySQL</category>				
				
				<category>ColdFusion</category>				
				
				<pubDate>Thu, 27 Aug 2009 15:48:00 -0600</pubDate>
				<guid>http://www.miuaiga.com/index.cfm/2009/8/27/Get-the-ID-of-a-newly-created-record-from-a-ColdFusion-insert-query-using-CFquery-result-attribute</guid>
				
			</item>
			
			<item>
				<title>Verify remote images exist - prevent missing images with CFHTTP</title>
				<link>http://www.miuaiga.com/index.cfm/2009/8/21/Verify-remote-images-exist--prevent-missing-images-with-CFHTTP</link>
				<description>
				
				I am creating a photo gallery where the images actually reside on a third-party service. To prevent &apos;blank&apos; or missing images from showing up in my html gallery markup, I needed a way to verify the remote image actually exists before including it into the dynamic &lt;cfoutput&gt; markup.

This seems to work quite nicely:

&lt;code&gt;

&lt;cfoutput query=&quot;myImageQuery&quot;&gt;

&lt;cfset imgURL = &quot;http://remotesite.com/images/#imageFilename#&quot;&gt;
&lt;!--- check for the image via cfhttp: 
Note:&apos;head&apos; method gets only headers, which is all we need (thanks @ScottP) ---&gt;
&lt;cfhttp url=&quot;#imgURL#&quot; method=&quot;head&quot;&gt;	
&lt;!--- isolate the &apos;mimeType&apos; value from the cfhttp results ---&gt;
&lt;cfset myStatus = cfhttp.mimeType&gt;
&lt;!--- if the mimeType is jpg (jpeg), include the image in our output ---&gt;
&lt;cfif myStatus eq &quot;image/jpeg&quot;&gt;
&lt;img src=&quot;#imgURL#&quot; alt=&quot;#imageTitle#&quot;&gt;
&lt;/cfif&gt;

&lt;/cfoutput&gt;

&lt;/code&gt; 
				</description>
				
				<category>ColdFusion</category>				
				
				<category>WebDev</category>				
				
				<pubDate>Fri, 21 Aug 2009 18:15:00 -0600</pubDate>
				<guid>http://www.miuaiga.com/index.cfm/2009/8/21/Verify-remote-images-exist--prevent-missing-images-with-CFHTTP</guid>
				
			</item>
			
			<item>
				<title>Add alternate pricing option to Cartweaver</title>
				<link>http://www.miuaiga.com/index.cfm/2009/8/21/Add-alternate-pricing-option-to-Cartweaver</link>
				<description>
				
				A Cartweaver user asked how he can add alternate pricing to his Cartweaver ecommerce site. He was understandably concerned about the need to edit the database, and how much code editing might be involved. But if you take a systematic approach, it is pretty straightforward.

The first part of setting up any alternate pricing system is to get that info into your database and admin, so you can work with it. In this case, since the basic goal is to duplicate the existing &apos;price&apos; system, that is exactly what we are going to do.  [More]
				</description>
				
				<category>ColdFusion</category>				
				
				<category>Cartweaver</category>				
				
				<category>WebDev</category>				
				
				<pubDate>Fri, 21 Aug 2009 10:48:00 -0600</pubDate>
				<guid>http://www.miuaiga.com/index.cfm/2009/8/21/Add-alternate-pricing-option-to-Cartweaver</guid>
				
			</item>
			
			<item>
				<title>Marking current menu link with jQuery for CartWeaver categories</title>
				<link>http://www.miuaiga.com/index.cfm/2009/8/19/Marking-current-menu-link-with-jQuery-for-CartWeaver-categories</link>
				<description>
				
				Working on a heavily-modified &lt;a href=&quot;http://www.cartweaver.com&quot;&gt;Cartweaver Coldfusion E-Commerce&lt;/a&gt; shopping cart site, I have created a database-driven navigation menu containing links to each category. When a user clicks a link, the products in that category are displayed, and the menu link for that category is highlighted via a special &apos;currentLink&apos; css class.

Now of course I could use CF to add &apos; class=&quot;currentLink&quot; &apos; to the current category&apos;s menu option, but I am not doing this particular menu that way. Besides, it is just as easy with jQuery! 

&lt;code&gt;

&lt;cfif cgi.script_name contains &apos;results.cfm&apos; AND isDefined(&apos;url.category&apos;) and url.category gt 0&gt;
&lt;cfsavecontent variable=&quot;highlight&quot;&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
$(document).ready(function(){
$(&apos;.sideNav li a&apos;).removeClass(&apos;currentLink&apos;);
$(&apos;.sideNav li a[href=results.cfm?category=&lt;cfoutput&gt;#url.category#&lt;/cfoutput&gt;]&apos;).addClass(&apos;currentLink&apos;);
//end jQuery
});
&lt;/script&gt;
&lt;/cfsavecontent&gt;
&lt;cfhtmlhead text=&quot;#highlight#&quot;&gt;
&lt;/cfif&gt;

&lt;/code&gt;


Simple enough - if we are on the &apos;results&apos; page, and a category is defined in the url, remove the &apos;currentLink&apos; class from all existing menu items, find the one where the &apos;href&apos; attribute matches the current pagename and category, and add the class back to that link. Done.

The use of cfsavecontent and cfhtmlhead means I can put this right below the code that calls in my custom nav tag, for easy fine-tuning right where i need it (rather than in an external scripts file). 

Quick , easy, and done in a flash with jQuery! 
				</description>
				
				<category>ColdFusion</category>				
				
				<category>jQuery</category>				
				
				<category>Cartweaver</category>				
				
				<category>WebDev</category>				
				
				<pubDate>Wed, 19 Aug 2009 17:15:00 -0600</pubDate>
				<guid>http://www.miuaiga.com/index.cfm/2009/8/19/Marking-current-menu-link-with-jQuery-for-CartWeaver-categories</guid>
				
			</item>
			
			<item>
				<title>Redirect secure &apos;https&apos; requests using getPageContext() and isSecure()</title>
				<link>http://www.miuaiga.com/index.cfm/2009/8/17/Redirect-secure-https-requests-using-getPageContext-and-isSecure</link>
				<description>
				
				&lt;p&gt;Working on a site using a shared ssl, where only 2 specific pages of the site are required to operate under the https:// SSL prefix, I needed a quick way to check whether a page request for either of those pages was using the &apos;https&apos; prefix - if not, redirect, adding the &apos;s&apos;. Likewise, all other pages, we want to make sure they are not using the &apos;s&apos; and redirect without it.&lt;/p&gt;
&lt;p&gt;I found this blog post, which got me started: &lt;a class=&quot;moz-txt-link-freetext&quot; href=&quot;http://www.chapter31.com/2007/07/21/detecting-and-redirecting-http-to-https/&quot;&gt;http://www.chapter31.com/2007/07/21/detecting-and-redirecting-http-to-https/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Using the fun and interesting CF goodies &lt;br /&gt;getPageContext() and isSecure() &lt;br /&gt; &lt;br /&gt;&amp;lt;!--- REDIRECTION TO SSL / non-SSL ---&amp;gt; &lt;br /&gt;&amp;lt;cfset secureRequest = getPageContext().getRequest() /&amp;gt; &lt;br /&gt;&amp;lt;!--- for these pages, redirect to secure (https) page&amp;nbsp; ---&amp;gt; &lt;br /&gt;&amp;lt;cfif cgi.SCRIPT_NAME contains &apos;payment.cfm&apos; OR cgi.SCRIPT_NAME contains  &apos;payment_response.cfm&apos;&amp;gt; &lt;br /&gt;&amp;lt;cfif NOT secureRequest.isSecure()&amp;gt; &lt;br /&gt;&amp;lt;cflocation  url=&lt;a class=&quot;moz-txt-link-rfc2396E&quot; href=&quot;https://www.miuaiga.com/#secureRequest.getServerName%28%29##secureRequest.getRequestURI%28%29#?#secureRequest.getQueryString%28%29#&quot;&gt;&quot;https://#secureRequest.getServerName()##secureRequest.getRequestURI()#?#secureRequest.getQueryString()#&quot;&lt;/a&gt; addtoken=&quot;false&quot; /&amp;gt; &lt;br /&gt;&amp;lt;/cfif&amp;gt; &lt;br /&gt;&amp;lt;cfelse&amp;gt; &lt;br /&gt;&amp;lt;!--- for all other pages, redirect to non-secure (http) page ---&amp;gt; &lt;br /&gt;&amp;lt;cfif secureRequest.isSecure()&amp;gt; &lt;br /&gt;&amp;lt;cflocation  url=&lt;a class=&quot;moz-txt-link-rfc2396E&quot; href=&quot;../#secureRequest.getServerName%28%29##secureRequest.getRequestURI%28%29#?#secureRequest.getQueryString%28%29#&quot;&gt;&quot;http://#secureRequest.getServerName()##secureRequest.getRequestURI()#?#secureRequest.getQueryString()#&quot;&lt;/a&gt; addtoken=&quot;false&quot; /&amp;gt; &lt;br /&gt;&amp;lt;/cfif&amp;gt; &lt;br /&gt;&amp;lt;/cfif&amp;gt;&lt;/p&gt;
&lt;p&gt;Quick and simple.&lt;/p&gt; 
				</description>
				
				<category>ColdFusion</category>				
				
				<category>WebDev</category>				
				
				<pubDate>Mon, 17 Aug 2009 13:00:00 -0600</pubDate>
				<guid>http://www.miuaiga.com/index.cfm/2009/8/17/Redirect-secure-https-requests-using-getPageContext-and-isSecure</guid>
				
			</item>
			
			<item>
				<title>301 &quot;Permanent&quot; URL Redirection with Coldfusion 8 and cflocation</title>
				<link>http://www.miuaiga.com/index.cfm/2009/8/10/301-Permanent-URL-Redirection-with-Coldfusion-8-and-cflocation</link>
				<description>
				
				&lt;p&gt;When moving domains, or forwarding the traffic from one site to another, the usual and preferred method is a &quot;301&quot; or &quot;permanent status&quot; redirection, which, simply put, means &quot;the page is gone and it is not coming back. Please look here from now on --&amp;gt; &quot;&lt;/p&gt;
&lt;p&gt;As Pete Frietag quickly explains in this blog post : &lt;a href=&quot;http://www.petefreitag.com/item/648.cfm&quot;&gt;http://www.petefreitag.com/item/648.cfm&lt;/a&gt; , 301 redirection with ColdFusion is as simple as could be as of CF8.&lt;/p&gt;
&lt;p&gt;&amp;lt;cflocation url=&quot;http://www.newsite.com&quot; statuscode=&quot;301&quot; addtoken=&quot;false&quot;&amp;gt;&lt;/p&gt;
&lt;p&gt;That&apos;s it.... just plop that in your old page, set the url, there&apos;s yer 301 .&lt;/p&gt;
&lt;p&gt;Of course, this only works in cases where the old domain is still hosted on a live server, i.e. moving a directory within an existing site. For full-blown root domain redirection, see your friendly neighborhood domain registrar or server control panel.&lt;/p&gt; 
				</description>
				
				<category>ColdFusion</category>				
				
				<category>WebDev</category>				
				
				<pubDate>Mon, 10 Aug 2009 11:30:00 -0600</pubDate>
				<guid>http://www.miuaiga.com/index.cfm/2009/8/10/301-Permanent-URL-Redirection-with-Coldfusion-8-and-cflocation</guid>
				
			</item>
			</channel></rss>