<?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>dans.blog</title>
			<link>http://blog.pengoworks.com/index.cfm</link>
			<description>This blog contains the miscellaneous ramblings, thoughts and interests of Dan G. Switzer, II.</description>
			<language>en-us</language>
			<pubDate>Mon, 23 Nov 2009 11:26:05 -0500</pubDate>
			<lastBuildDate>Fri, 06 Nov 2009 17:08:16 -0500</lastBuildDate>
			<generator>BlogCFC</generator>
			<docs>http://blogs.law.harvard.edu/tech/rss</docs>
			<managingEditor>dswitzer@pengoworks.com</managingEditor>
			<webMaster>dswitzer@pengoworks.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>dswitzer@pengoworks.com</itunes:email>
				<itunes:name></itunes:name>
			</itunes:owner>
			<itunes:image href="" />
			<image>
				<url></url>
				<title>dans.blog</title>
				<link>http://blog.pengoworks.com/index.cfm</link>
			</image>
			<itunes:explicit>no</itunes:explicit>
			
			
			
			
			
			<item>
				<title>ColdFusion 8 Search Server service (Verity) reporting Error 1067 on startup</title>
				<link>http://blog.pengoworks.com/index.cfm/2009/11/6/ColdFusion-8-Search-Server-service-Verity-reporting-Error-1067-on-startup</link>
				<description>
				
				&lt;p&gt;Yesterday I rebooted my personal dev server and much to my chagrin, when the server started back up the ColdFusion 8 Search Server service (aka Verity) would not start. Any attempt to start the service would result in the following error:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;Error 1067: The process terminated unexpectedly.&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;I looked around ColdFusion&apos;s log files, but couldn&apos;t find anything useful so I decided to try and start up Verity from the command line. Running from command line resulted in:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;K2Admin - Verity, Inc. Version 5.5.0 (Build 20050601)     &lt;br /&gt;Resolved Entity [admin.dtd] to DTD file [C:\ColdFusion8\verity\k2\common\admin.dtd]      &lt;br /&gt;D:\ColdFusion8\verity\Data\host\admin\admin8.xml parsed in 16 ms      &lt;br /&gt;Status: Starting K2Admin Version 5.5.0 (Build 20050601 Sep&amp;#160; 4 2006 14:41:49)      &lt;br /&gt;Status: Service Alias: ColdFusionK2 (Host:localhost Port:9951)      &lt;br /&gt;Status: Master Administration Server: localhost:9951      &lt;br /&gt;Status: Creating Backup Service - 2 threads      &lt;br /&gt;Status: Creating Broker Service - 1 threads      &lt;br /&gt;*** FATAL Application Error ***      &lt;br /&gt;Exiting ...&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;I hunted around trying to find the root cause for the fatal application error, but I couldn&apos;t find anything on Google or any of the forums I checked. Since I wasn&apos;t getting anywhere, I decided to try uninstalling and reinstalling the Verity services.&lt;/p&gt;  &lt;p&gt;Inside the .\ColdFusion8\verity folder, there&apos;s two files called verity-uninstall.bat and verity-install.bat which you can use to uninstall and install the Verity service. &lt;/p&gt;  &lt;p&gt;I ran the verity-uninstall.bat batch to uninstall the service and once the service was correctly uninstalled, I went ahead and ran the verity-install.bat file to re-install the service.&lt;/p&gt;  &lt;p&gt;Fortunately this fixed the issue for me. I had to re-create all my collection, but that wasn&apos;t a big deal (time consuming, but painless.)&lt;/p&gt;  &lt;p&gt;So, if your Verity service isn&apos;t starting up and nothing else you&apos;ve tried is working, you might just trying uninstalling and reinstalling the service.&lt;/p&gt;
				
				</description>
						
				
				<category>HTML/ColdFusion</category>				
				
				<pubDate>Fri, 06 Nov 2009 17:08:16 -0500</pubDate>
				<guid>http://blog.pengoworks.com/index.cfm/2009/11/6/ColdFusion-8-Search-Server-service-Verity-reporting-Error-1067-on-startup</guid>
				
				
			</item>
			
		 	
			
			
			<item>
				<title>Flash suddenly stops working in Firefox v3</title>
				<link>http://blog.pengoworks.com/index.cfm/2009/10/21/Flash-suddenly-stops-working-in-Firefox-v3</link>
				<description>
				
				&lt;p&gt;Sometime in the last week or so, Flash stopped working me on many sites. It seemed to stop working around the time of the last Microsoft Vista updates, but I can&apos;t be sure. The strange thing is, it worked on some sites (like Adobe) but wasn&apos;t working on a lot of the sites I was visiting. I tried reinstalling Flash, but that didn&apos;t fix it. Since it wasn&apos;t a high priority for me, I haven&apos;t had time to look into it until today.&lt;/p&gt;  &lt;p&gt;Today I was doing some QA on our site and noticed one of the Flash components was no longer working. Since Flash seemed to break for me around the time of the last Windows Update, I thought I should probably look into things to see if this is a wide spread issue. &lt;/p&gt;  &lt;p&gt;I quickly fired up a couple of different versions of Firefox (and on different PCs) and they were all working fine. This seemed to indicate the problem might be local to my installation.&lt;/p&gt;  &lt;p&gt;Next, I decided to actually examine the source code in Firebug&amp;#8212;which is when I noticed something odd. The &lt;samp&gt;&amp;lt;object /&amp;gt;&lt;/samp&gt; tag was grayed out like it was hidden or being ignored. So, I fired up the same page in another Firefox install and the &lt;samp&gt;&amp;lt;object /&amp;gt;&lt;/samp&gt; tag was being shown as expected.&lt;/p&gt;  &lt;blockquote class=&quot;note&quot;&gt;&lt;strong&gt;NOTE:&lt;/strong&gt;     &lt;div&gt;At this point I also checked some of the sites I remembered where Flash was working and sure enough they were using the &lt;samp&gt;&amp;lt;embed &amp;gt;&lt;/samp&gt; tag instead of the &lt;samp&gt;&amp;lt;object /&amp;gt;&lt;/samp&gt; tag.&lt;/div&gt; &lt;/blockquote&gt;  &lt;p&gt;Since I thought this was extremely odd, I decided to fire up a brand new Profile to see if things would work in an empty Profile. Dropping to a command prompt, I used &lt;samp&gt;firefox P&lt;/samp&gt; to create a brand new profile called &amp;quot;test&amp;quot;. Next I used &lt;samp&gt;firefox -P test -no-remote&lt;/samp&gt; to open up the new profile (the &lt;samp&gt;no-remote&lt;/samp&gt; argument allows you to open a separate instance of Firefox using a different profile.)&lt;/p&gt;  &lt;p&gt;When using the new Profile, Flash was worked as I expected. This told me something was wrong with my normal Profile, but what?&lt;/p&gt;  &lt;p&gt;In order to track things down, I first tried disabling add-ons that looked like primary suspects (Firebug, Web Developer, AdBlock Plus, etc.) Nothing changed. I next tried uninstalling these add-ons. Flash still not working. I finally just uninstalled all the add-ons. And what do you know? Flash started working again.&lt;/p&gt;  &lt;p&gt;In order to try to determine which add-on was causing my Flash problems, I tried installing each add-on individually. Unfortunately (at least from a troubleshooting standpoint) after re-installing all the add-ons Flash is still working correctly.&lt;/p&gt;  &lt;p&gt;So I obviously had a problem with my profile that was caused by one of the add-ons I had installed. Unfortunately, I do not know which add-on was the culprit. I do know that after removing all my add-ons and reinstalling them Flash is now working properly again.&lt;/p&gt;  &lt;blockquote class=&quot;update&quot;&gt;&lt;strong&gt;UPDATE:&lt;/strong&gt;     &lt;div&gt;     &lt;p&gt;Here are a list of the add-ons I had installed, all of which have been reinstalled:&lt;/p&gt;      &lt;p&gt;Adblock Plus 1.1.1       &lt;br /&gt;Clear Cache Button 0.9b        &lt;br /&gt;ColorZilla 2.0.2        &lt;br /&gt;Download Statusbar 0.9.6.5        &lt;br /&gt;Firebug 1.4.3        &lt;br /&gt;Firesizer 0.92        &lt;br /&gt;Free Download Manager 1.3.4        &lt;br /&gt;Html Validator 0.8.5.8        &lt;br /&gt;IE View 1.4.4        &lt;br /&gt;Microsoft .NET Framework Assistant 1.1        &lt;br /&gt;Organize Status Bar 0.6.3        &lt;br /&gt;Page Speed 1.3        &lt;br /&gt;Print Context Menu 1.2        &lt;br /&gt;QuickFrame 0.5.1        &lt;br /&gt;QuickProxy 2009.07.19        &lt;br /&gt;Web Developer 1.1.8        &lt;br /&gt;XMarks 3.3.2&amp;#160; (&lt;strong&gt;NOTE:&lt;/strong&gt; I didn&apos;t actually uninstall this add-on, it was the one exception of an add-on that I did not uninstall.)&lt;/p&gt;   &lt;/div&gt;&lt;/blockquote&gt;
				
				</description>
						
				
				<category>Flex/Flash</category>				
				
				<pubDate>Wed, 21 Oct 2009 11:32:33 -0500</pubDate>
				<guid>http://blog.pengoworks.com/index.cfm/2009/10/21/Flash-suddenly-stops-working-in-Firefox-v3</guid>
				
				
			</item>
			
		 	
			
			
			<item>
				<title>Stupid HTML Tricks: Add a non-selectable option to a select element</title>
				<link>http://blog.pengoworks.com/index.cfm/2009/10/16/Stupid-HTML-Tricks-Add-a-nonselectable-option-to-a-select-element</link>
				<description>
				
				&lt;p&gt;Occasionally I&apos;ve run into a situation where I&apos;ve wanted to add some whitespace between two options in a &lt;samp&gt;&amp;lt;select /&amp;gt;&lt;/samp&gt; element. The most common solution I&apos;ve seen people use is to include an empty &lt;samp&gt;&amp;lt;option&amp;gt;&amp;lt;/option&amp;gt;&lt;/samp&gt; tag pair. While this works, it adds a blank entry that the user can actually select&amp;#8212;which means you have to add some code to handle the selection of what is designed to just be used for whitespace.&lt;/p&gt;  &lt;p&gt;A better solution is to use an empty &lt;samp&gt;&amp;lt;optgroup /&amp;gt;&lt;/samp&gt; that is disabled:&lt;/p&gt;  &lt;div class=&quot;wlWriterEditableSmartContent&quot; id=&quot;scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E6:09462905-94f0-4fb2-84f1-72f1cb1e3427&quot; style=&quot;padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px&quot;&gt;&lt;pre style=&quot;background-color:#FFFFFF;white-space:-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; white-space: pre-wrap; word-wrap: break-word;overflow: auto;&quot;&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;select&lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;
  &lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;option&lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;Value 1&lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;option&lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;
  &lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;&amp;lt;!--&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;-// add a non-selectable space between options, the margin-top is for FF spacing //-&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;--&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;
  &lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;optgroup &lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;disabled&lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;=&quot;disabled&quot;&lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt; style&lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;=&quot;margin-top: 1em;&quot;&lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;optgroup&lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;
  &lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;option&lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;Value 2&lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;option&lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;
&lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;select&lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!-- Code inserted with Steve Dunn&apos;s Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --&gt;&lt;/div&gt;

&lt;p&gt;This will add a non-selectable blank line between &amp;quot;Value 1&amp;quot; and &amp;quot;Value 2&amp;quot;. Here&apos;s an example:&lt;/p&gt;

&lt;p&gt;&lt;select style=&quot;font-size: 1.4em;&quot;&gt; &lt;option&gt;Value 1&lt;/option&gt; &lt;optgroup style=&quot;margin-top: 1em;&quot; disabled=&quot;disabled&quot;&gt;&lt;/optgroup&gt; &lt;option&gt;Value 2&lt;/option&gt;&lt;/select&gt;&lt;/p&gt;

&lt;p&gt;I use this technique often before normal &amp;lt;optgroup /&amp;gt; tags as it helps make the menu look a little cleaner by adding some separation between the options and works with all modern browsers. Best of all, you don&apos;t have to worry about handling those empty &lt;samp&gt;&amp;lt;option /&amp;gt;&lt;/samp&gt; tags!&lt;/p&gt;
				
				</description>
						
				
				<category>HTML/ColdFusion</category>				
				
				<pubDate>Fri, 16 Oct 2009 11:53:00 -0500</pubDate>
				<guid>http://blog.pengoworks.com/index.cfm/2009/10/16/Stupid-HTML-Tricks-Add-a-nonselectable-option-to-a-select-element</guid>
				
				
			</item>
			
		 	
			
			
			<item>
				<title>Custom jQuery selector for finding usable elements</title>
				<link>http://blog.pengoworks.com/index.cfm/2009/10/15/Custom-jQuery-selector-for-finding-usable-elements</link>
				<description>
				
				&lt;p&gt;While working on some code today, I faced a problem I&apos;ve run into a few times in the past where I needed to find the first usable input element within a specific context. What I mean by &amp;quot;usable&amp;quot; is an element which is visible to the user and not disabled. &lt;/p&gt;  &lt;p&gt;Finding the first usable input element can be handy when you&apos;re using tabbed form, as when the user changes tabs, you can place the focus in the first visible input element. In my use case, I was implement a &amp;quot;reset&amp;quot; on a form where the fields being displayed could vary. I wanted to automatically place the focus in the first visible field after the user triggered a &amp;quot;reset&amp;quot; of the form.&lt;/p&gt;  &lt;p&gt;If you&apos;re using jQuery v1.3 (or higher) this custom selector is very simple, just add the following to your page:&lt;/p&gt;  &lt;div class=&quot;wlWriterEditableSmartContent&quot; id=&quot;scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E6:d69db129-3d1d-42bd-9f67-5826b5cedcc6&quot; style=&quot;padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px&quot;&gt;&lt;pre style=&quot;background-color:#FFFFFF;white-space:-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; white-space: pre-wrap; word-wrap: break-word;overflow: auto;&quot;&gt;&lt;span style=&quot;color: #008000;&quot;&gt;//&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt; finds elements that are usable (i.e. visible on the screen and are not disabled)&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;
&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;$.expr[&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;].usable &lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;function&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; (node, index, prop, nodes){
  &lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; $n &lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; $(node);
  &lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;//&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt; return if the element is viewable or not            &lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;
&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; ($n.attr(&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;disabled&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;!==&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; $n.is(&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;:visible&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;);
};&lt;/span&gt;&lt;/pre&gt;&lt;!-- Code inserted with Steve Dunn&apos;s Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --&gt;&lt;/div&gt;

&lt;p&gt;If you&apos;re using jQuery v1.2 (or lower) the code is slightly more complex because the &amp;quot;:visible&amp;quot; selector doesn&apos;t check with the parent elements to make sure they are all visible. So, in order to make our code work with jQuery v1.2 we&apos;ll need to first create a custom selector for which will find elements that are truly visible:&lt;/p&gt;

&lt;div class=&quot;wlWriterEditableSmartContent&quot; id=&quot;scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E6:5e6e6a9a-7a42-4684-a2a0-e2d1438758f2&quot; style=&quot;padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px&quot;&gt;&lt;pre style=&quot;background-color:#FFFFFF;white-space:-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; white-space: pre-wrap; word-wrap: break-word;overflow: auto;&quot;&gt;&lt;span style=&quot;color: #008000;&quot;&gt;//&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt; finds elements that are viewable&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;
&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;$.expr[&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;].viewable &lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;function&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; (node, index, prop, nodes){
  &lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; r &lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;;

  &lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;function&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; viewable(n){
    &lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; $n &lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; $(n);
    &lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; (($n.css(&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;display&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;!==&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;none&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; ($n.css(&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;visibility&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;!==&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;hidden&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;));
  }
  
  &lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;//&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt; if not usable, stop processing&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;
&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;( &lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;!&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;viewable(node) ) &lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;;

  $(node).parents().each(&lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;function&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; (){
    r &lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; viewable(&lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;this&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;);
    &lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;//&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt; if not viewable, stop processing chain&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;
&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; r;
  });

  &lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;//&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt; return if the element is usable or not            &lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;
&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; r;
};&lt;/span&gt;&lt;/pre&gt;&lt;!-- Code inserted with Steve Dunn&apos;s Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --&gt;&lt;/div&gt;

&lt;p&gt;The new &amp;quot;:viewable&amp;quot; selector should pretty much behave the same way that the &amp;quot;:visible&amp;quot; selector does in jQuery v1.3.&lt;/p&gt;

&lt;p&gt;The only difference in this version of the &amp;quot;:usable&amp;quot; selector is that we&apos;re going to use our custom &amp;quot;:viewable&amp;quot; selector instead of the &amp;quot;:visible&amp;quot; selector:&lt;/p&gt;

&lt;div class=&quot;wlWriterEditableSmartContent&quot; id=&quot;scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E6:96da859e-d8a6-444a-a1c3-391d164a43d4&quot; style=&quot;padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px&quot;&gt;&lt;pre style=&quot;background-color:#FFFFFF;white-space:-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; white-space: pre-wrap; word-wrap: break-word;overflow: auto;&quot;&gt;&lt;span style=&quot;color: #008000;&quot;&gt;//&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt; finds elements that are usable (i.e. visible on the screen and are not disabled)&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;
&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;$.expr[&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;].usable &lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;function&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; (node, index, prop, nodes){
  &lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; $n &lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; $(node);
  &lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;//&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt; return if the element is viewable or not            &lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;
&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; ($n.attr(&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;disabled&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;!==&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; $n.is(&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;:viewable&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;);
};&lt;/span&gt;&lt;/pre&gt;&lt;!-- Code inserted with Steve Dunn&apos;s Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --&gt;&lt;/div&gt;

&lt;p&gt;The &amp;quot;:usable&amp;quot; selector can be used in several ways:&lt;/p&gt;

&lt;div class=&quot;wlWriterEditableSmartContent&quot; id=&quot;scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E6:c284420c-b1f3-42c1-a7ad-c5d3d7669fce&quot; style=&quot;padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px&quot;&gt;&lt;pre style=&quot;background-color:#FFFFFF;white-space:-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; white-space: pre-wrap; word-wrap: break-word;overflow: auto;&quot;&gt;&lt;span style=&quot;color: #008000;&quot;&gt;//&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt; find all usable form elements&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;
&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;$(&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;:input:usable&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;)

&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;//&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt; find the first usable form element&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;
&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;$(&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;:input:usable:first&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;)&lt;/span&gt;&lt;/pre&gt;&lt;!-- Code inserted with Steve Dunn&apos;s Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --&gt;&lt;/div&gt;

&lt;p&gt;While the most common usage of the selector will probably be :input:usable:first, I can see where occasionally you might want to get all the input elements visible to the user.&lt;/p&gt;

&lt;p&gt;Hope this helps someone!&lt;/p&gt;
				
				</description>
						
				
				<category>jQuery</category>				
				
				<pubDate>Thu, 15 Oct 2009 14:31:23 -0500</pubDate>
				<guid>http://blog.pengoworks.com/index.cfm/2009/10/15/Custom-jQuery-selector-for-finding-usable-elements</guid>
				
				
			</item>
			
		 	
			
			
			<item>
				<title>Vote now to have ColdFusion provide better XSS protection</title>
				<link>http://blog.pengoworks.com/index.cfm/2009/10/14/Vote-now-to-have-ColdFusion-provide-better-XSS-protection</link>
				<description>
				
				&lt;p&gt;Today I submitted the &lt;a href=&quot;http://cfbugs.adobe.com/cfbugreport/flexbugui/cfbugtracker/main.html#bugId=80336&quot; target=&quot;_blank&quot;&gt;ColdFusion Enhancement Request #80336&lt;/a&gt; to add better tools for preventing XSS attacks. More and more it&apos;s becoming common for developers to need to implement some type of WYSIWYG editor, but with that comes the increased risk of XSS attacks.&lt;/p&gt;  &lt;p&gt;We&apos;ve all heard about attacks on MySpace and other major sites and this is because it&apos;s actually a pretty difficult problem to solve correctly (since there are so many attack vectors.)&lt;/p&gt;  &lt;p&gt;My suggestion would be for Adobe to integrate the OWASP AntiSamy project into ColdFusion. This is an excellent tool for cleaning up input to prevent XSS attacks and is highly configurable via XML.&lt;/p&gt;  &lt;p&gt;If you&apos;re interested in solving this problem now, see my &lt;a href=&quot;http://blog.pengoworks.com/index.cfm/2008/1/3/Using-AntiSamy-to-protect-your-CFM-pages-from-XSS-hacks&quot; target=&quot;_blank&quot;&gt;Using AntiSamy to protect your CFM pages from XSS hacks&lt;/a&gt; blog entry for details on implementing AntiSamy right now.&lt;/p&gt;
				
				</description>
						
				
				<category>HTML/ColdFusion</category>				
				
				<pubDate>Wed, 14 Oct 2009 14:46:00 -0500</pubDate>
				<guid>http://blog.pengoworks.com/index.cfm/2009/10/14/Vote-now-to-have-ColdFusion-provide-better-XSS-protection</guid>
				
				
			</item>
			
		 	
			
			
			<item>
				<title>Rounding to the nearest fraction (i.e. specific decimal place)</title>
				<link>http://blog.pengoworks.com/index.cfm/2009/9/25/Rounding-to-the-nearest-fraction-ie-specific-decimal-place</link>
				<description>
				
				&lt;p&gt;I&apos;m working on some &amp;quot;star rating&amp;quot; code and I really wanted to round numbers of to the nearest fraction. While the math is really basic, my math skills are rusty and this took me longer to solve than I care to admit. So I thought I&apos;d just blog the solution for anyone else that might find it useful:&lt;/p&gt;  &lt;p&gt;&lt;samp&gt;&lt;font color=&quot;#008080&quot;&gt;round&lt;/font&gt;( &lt;font color=&quot;#ff8080&quot;&gt;value&lt;/font&gt;/&lt;font color=&quot;#804040&quot;&gt;fraction&lt;/font&gt; ) * &lt;font color=&quot;#804040&quot;&gt;fraction&lt;/font&gt; &lt;/samp&gt;&lt;/p&gt;  &lt;p&gt;Like I said, it&apos;s very basic math but is very handy when you want to round to something other than to the closest integer.&lt;/p&gt;
				
				</description>
						
				
				<category>HTML/ColdFusion</category>				
				
				<category>JavaScript</category>				
				
				<category>Java</category>				
				
				<category>SQL</category>				
				
				<category>Flex/Flash</category>				
				
				<pubDate>Fri, 25 Sep 2009 08:55:59 -0500</pubDate>
				<guid>http://blog.pengoworks.com/index.cfm/2009/9/25/Rounding-to-the-nearest-fraction-ie-specific-decimal-place</guid>
				
				
			</item>
			
		 	
			
			
			<item>
				<title>From the worst day ever, to the best&amp;hellip;</title>
				<link>http://blog.pengoworks.com/index.cfm/2009/9/21/From-the-worst-day-ever-to-the-best</link>
				<description>
				
				&lt;p&gt;Today started off horribly. But before I get into today, I have to backtrack a bit.&lt;/p&gt;  &lt;p&gt;While I haven&apos;t blogged about this yet (because it&apos;s still very early,) my wife is pregnant. Getting pregnant has been a long process for us and something our family and close friends have known about. Because so many people have known what we&apos;ve been going through, we announced it to close friends and family a little sooner than we&apos;d probably have liked. &lt;/p&gt;  &lt;p&gt;Last Monday at 5am, Jenn woke me up and she had passed a clot. From the look of things, I was really afraid things were bleak. Jenn continued to spot all last week, so I was really worried that something went wrong w/the pregnancy. The doctor&apos;s didn&apos;t seem overly concerned and we just needed to wait out our appointment which was scheduled for today at 10a.&lt;/p&gt;  &lt;p&gt;Needless to say, last week really sucked. We were trying to stay optimistic, but I was preparing for the worst.&lt;/p&gt;  &lt;more/&gt;  &lt;p&gt;This morning at 4:45am (a week almost to the minute) Jenn work me up again. This time the bleeding was really bad (I even had to clean up the path on the floor to the bathroom.) The clot she passed was about the size of a racket ball. As much as I thought last week was bad, this was much worse. The morning was really tough on us. The morning was a long one waiting for our scheduled ultrasound (which I was really assuming the worse had happened.)&lt;/p&gt;  &lt;p&gt;When we saw the doctor we explained what had happened. He didn&apos;t seem overly shocked (because we had kept him a breast of the spotting) but I was surprised he didn&apos;t seem as concerned as we were.&lt;/p&gt;  &lt;p&gt;So when the ultrasound started, I was really trying to figure out how to comfort Jenn, just fearing the worse.&lt;/p&gt;  &lt;p&gt;Much to my surprise, I saw a similar black blob as we did on our ultrasound on 9/10, but I was still hesitant to get my hopes too high. However, within seconds a little peanut shape emerged from the blackness and once again we saw the little fluttering of a heart.&lt;/p&gt;  &lt;p&gt;After basically preparing myself of the worst for the past week and then just feeling like my thoughts were confirmed this morning, I can&apos;t even begin to explain the emotions I was feeling--to say it was a relief doesn&apos;t even begin to explain it.&lt;/p&gt;  &lt;p&gt;We even got to hear the heart for the very first time. The heartbeat was very healthy and was over the healthy 150 beats per minute they like to hear. &lt;/p&gt;  &lt;p&gt;While we&apos;re still not sure what&apos;s causing Jenn&apos;s spotting, the doctor didn&apos;t find any lesions--only another smaller clot and he doesn&apos;t feel like it&apos;s threatening the baby.&lt;/p&gt;  &lt;p&gt;So everything looks to be going great. The bleeding is still a concern, but thankfully the baby appears healthy.   &lt;br /&gt;It&apos;s funny how quickly your life can change with just the lubb-dub sound of a heartbeat. I&apos;ve always heard how life change on a heartbeat, now I truly understand.&lt;/p&gt;  &lt;p&gt;&lt;img title=&quot;ultrasound_20090921&quot; style=&quot;border-right: 0px; border-top: 0px; display: block; float: none; margin-left: auto; border-left: 0px; margin-right: auto; border-bottom: 0px&quot; height=&quot;820&quot; alt=&quot;ultrasound_20090921&quot; src=&quot;http://blog.pengoworks.com/enclosures/ultrasound_20090921_d19d86b4-cba5-4688-b79b-e9f31ece2b8b.png&quot; width=&quot;361&quot; border=&quot;0&quot; /&gt;&lt;/p&gt;
				
				</description>
						
				
				<category>Personal</category>				
				
				<pubDate>Mon, 21 Sep 2009 12:14:42 -0500</pubDate>
				<guid>http://blog.pengoworks.com/index.cfm/2009/9/21/From-the-worst-day-ever-to-the-best</guid>
				
				
			</item>
			
		 	
			
			
			<item>
				<title>Create iPhone-style buttons with the iButton jQuery Plug-in</title>
				<link>http://blog.pengoworks.com/index.cfm/2009/9/3/Create-iPhonestyle-buttons-with-the-iButton-jQuery-Plugin</link>
				<description>
				
				&lt;p&gt;At work we just released another jQuery plug-in called the &lt;a href=&quot;http://www.givainc.com/labs/ibutton_jquery_plugin.htm&quot; target=&quot;_blank&quot;&gt;iButton jQuery Plug-in&lt;/a&gt; (which brings the total of open source jQuery plug-ins we&apos;ve released to four.) This plug-in allows you to generate iPhone-style buttons from checkbox and radio elements. While there are several libraries out there that generated iPhone-style buttons, we couldn&apos;t find one that did everything we needed, so I wrote one!&lt;/p&gt;  &lt;p&gt;The users of our application are very keyboard centric, so it was very important that we supported keyboard entry. Keyboard support often seems to be overlooked in most UI plug-ins&amp;#8212;developers get so focused on the mouse interaction, they forget completely about keyboard entry. So we always make keyboard support a key feature in the jQuery plug-ins we write.&lt;/p&gt;  &lt;p&gt;Anyway, here&apos;s a list of the key features:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Works with checkboxes or radio elements &lt;/li&gt;    &lt;li&gt;Full keyboard support &amp;#8212; use the [TAB] key to move from field to field and use the spacebar to toggle the status of the iButton (or use the arrow keys for radio buttons) &lt;/li&gt;    &lt;li&gt;Custom event handlers &lt;/li&gt;    &lt;li&gt;Detach iButton behavior from the element &lt;/li&gt;    &lt;li&gt;Metadata support &amp;#8212; when used with the &lt;a href=&quot;http://plugins.jquery.com/project/metadata&quot;&gt;jQuery Metadata Plug-in&lt;/a&gt;, you can define the properties for your button completely within the class attribute of your input elements &lt;/li&gt;    &lt;li&gt;Enable/disable drag support &amp;#8212; while the dragging behavior is intuitive on touch-based devices, it&apos;s not always be the best or expected UI behavior and may cause some mouse users problems (NOTE: In order to help differentiate between an intended mouse click or an actual drag event, we&apos;re developed the clickOffset option. If the time (in milliseconds) is under this value (120ms by default) it&apos;s assumed the user was attempting to click the button and not drag the handle.) &lt;/li&gt;    &lt;li&gt;Enable/disable animation &lt;/li&gt;    &lt;li&gt;Single sprite image &amp;#8212; easily change the look of your button by just replacing the image sprite &lt;/li&gt;    &lt;li&gt;Customizable labels &amp;#8212; use any labels you want for your buttons &lt;/li&gt;    &lt;li&gt;Support for disabled buttons &lt;/li&gt;    &lt;li&gt;Easing support for animations &lt;/li&gt;    &lt;li&gt;iPhone support &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;You can see a demo of the plug-in on the &lt;a href=&quot;http://www.givainc.com/labs/ibutton_example.htm&quot; target=&quot;_blank&quot;&gt;Giva Labs - iButton Example Page&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;We&apos;re pretty happy with the end result and are planning on using it in a few locations in our application. If you like plug-in, don&apos;t forget to &lt;a href=&quot;http://digg.com/programming/Create_iPhone_style_buttons_with_the_iButton_jQuery_Plug_in&quot; target=&quot;_blank&quot;&gt;Digg it&lt;/a&gt;!&lt;/p&gt;
				
				</description>
						
				
				<category>jQuery</category>				
				
				<pubDate>Thu, 03 Sep 2009 17:09:01 -0500</pubDate>
				<guid>http://blog.pengoworks.com/index.cfm/2009/9/3/Create-iPhonestyle-buttons-with-the-iButton-jQuery-Plugin</guid>
				
				
			</item>
			
		 	
			
			
			<item>
				<title>Disabling &amp;quot;The Publisher Could Not Be Verified&amp;quot; when running program under Vista</title>
				<link>http://blog.pengoworks.com/index.cfm/2009/8/18/Disabling-The-Publisher-Could-Not-Be-Verified-when-running-program-under-Vista</link>
				<description>
				
				&lt;p&gt;Ever since upgrading to Windows Vista, I&apos;ve had a probably with a program that I run infrequently where I&apos;d get a message of &amp;quot;The Publisher Could Not Be Verified&amp;quot; and have to click on a box to verify I want to run the program. Since I don&apos;t use the application very frequently, the annoyance was minor.&lt;/p&gt;  &lt;p&gt;Today I found myself needing to frequently re-load the application, so this message became really annoying. Windows Vista has an &amp;quot;Unblock&amp;quot; function in the file properties (right-click on the file from Windows Explorer and select &amp;quot;Properties&amp;quot;&amp;#8212;it&apos;s on the general tab,) but this was not working for me. &lt;/p&gt;  &lt;p&gt;I could click the &amp;quot;Unblock&amp;quot; button and apply the change, but the change wouldn&apos;t ever take. Since this program is my Program Files (x86) folder, I suspected this was the culprit. While I tried a few things to try to make the change as an admin (such as changing the file attributes&amp;#8212;which forces you to grant admin privileges) the thing that end up working for me was to copy the files to another folder (like the desktop) go through the &amp;quot;Unblock&amp;quot; procedure again and then copy the files back to it&apos;s sub-folder in the Program Files (x86) folder. This seemed to do the trick.&lt;/p&gt;  &lt;p&gt;So, while I&apos;m sure there&apos;s a better way to get this to work, if you&apos;re getting the message &amp;quot;The Publisher Could Not Be Verified&amp;quot; every time you try to run a program and just using the &amp;quot;Unblock&amp;quot; function doesn&apos;t work, try moving the file to a folder that doesn&apos;t need administration privileges to modify the file.&lt;/p&gt;
				
				</description>
						
				
				<category>Technology</category>				
				
				<pubDate>Tue, 18 Aug 2009 16:18:33 -0500</pubDate>
				<guid>http://blog.pengoworks.com/index.cfm/2009/8/18/Disabling-The-Publisher-Could-Not-Be-Verified-when-running-program-under-Vista</guid>
				
				
			</item>
			
		 	
			
			
			<item>
				<title>SVN reporting &amp;quot;Working copy text base is corrupt&amp;quot;</title>
				<link>http://blog.pengoworks.com/index.cfm/2009/7/22/SVN-reporting-Working-copy-text-base-is-corrupt</link>
				<description>
				
				&lt;p&gt;This morning started off to a rough start. I came in to realize the commit of a merge I made at the end of the day yesterday had failed. Whenever I would attempt to commit the merge changes, it would go through the entire process and then finally fail with a error message of:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;org.tigris.subversion.javahl.ClientException: Working copy text base is corrupt&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;After trying a &amp;quot;Cleanup&amp;quot; and several other steps to rectify the problem, I finally did hit Google to try and find a solution. I came across &lt;a href=&quot;http://glob.bushi.net.nz/glob/2007/02/14/subversion-checksum-mismatch-easy-workaround/&quot; target=&quot;_blank&quot;&gt;chris&apos; subversion checksum mismatch - easy workaround&lt;/a&gt; which offered several various solutions to the problem.&lt;/p&gt;  &lt;p&gt;I tried several of the solutions, but wasn&apos;t haven&apos;t much success until I came across &lt;a href=&quot;http://talk-on-tech.blogspot.com/&quot; target=&quot;_blank&quot;&gt;Michael Sparer&apos;s&lt;/a&gt; comment:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;Thanks for the explanation, which shed some light on how svn manages its working copy. My problem seemed to stem from a bogus file under .svn/text-base, which didn&apos;t match the file actually on the server.      &lt;br /&gt;- server file (.../x.java): OK       &lt;br /&gt;- orig copy from server (.svn/text-base/x.java.svn-base): BOGUS (not same as server)       &lt;br /&gt;- checksum (in .svn/entries): matches server, but not server copy&lt;/p&gt;    &lt;p&gt;If I can make the bogus copy match what&apos;s on the server, then it will also match the checksum, and everyone will be happy.      &lt;br /&gt;What I did (i&apos;ll call the working dir with the corrupt file &amp;quot;orig-dir&amp;quot;:       &lt;br /&gt;1. Fresh checkout of svn dir matching orig-dir into /tmp/blah       &lt;br /&gt;2. Copy /tmp/blah/.svn/text-base/x.java.svn-base into orig-dir/.svn/text-base       &lt;br /&gt;3. Check in successfully&lt;/p&gt;    &lt;p&gt;I wish svn would let you refresh a given file from the server...maybe there&apos;s a command and I just haven&apos;t found it or my svn is too old.&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;In the end, this ended up being my problem as well. The copy of me .svn/text-base/filename.ext.svn-base was out of sync with the actually copy on the server.&lt;/p&gt;  &lt;p&gt;To resolve this, I checked out a clean copy from the server to a tmp folder, then I just replaced the copy in my working folder. After doing this, I was able to check in the file without incident.&lt;/p&gt;  &lt;blockquote class=&quot;note&quot;&gt;&lt;strong&gt;NOTE:&lt;/strong&gt;     &lt;div&gt;I also noticed I had a copy of the template in the .svn/tmp/text-base/ folder. I made a copy of this file and then removed the file this directory before committing. I&apos;m not sure if this step is necessary, but I wanted my local working copy to mirror as closely as possible a fresh working copy.&lt;/div&gt; &lt;/blockquote&gt; I could have just wiped my local copy altogether, but I wanted to know the root problem incase it every happens again. Since I have a pretty large repository it takes a while to checkout from SVN, so at least know I have an option to try if I ever run into the issue again that won&apos;t require me checking out the entire working directory structure.  
				
				</description>
						
				
				<category>HTML/ColdFusion</category>				
				
				<category>Java</category>				
				
				<pubDate>Wed, 22 Jul 2009 11:24:55 -0500</pubDate>
				<guid>http://blog.pengoworks.com/index.cfm/2009/7/22/SVN-reporting-Working-copy-text-base-is-corrupt</guid>
				
				
			</item>
			
		 	
			
			
			<item>
				<title>Using MSSQL to output time in days, hours and minutes</title>
				<link>http://blog.pengoworks.com/index.cfm/2009/7/17/Using-MSSQL-to-output-time-in-days-hours-and-minutes</link>
				<description>
				
				&lt;p&gt;I was working on some code today where I wanted to output a time span in the format &lt;em&gt;1d 4h 36m&lt;/em&gt; (i.e. &amp;quot;1 day, 4 hours and 36 minutes.&amp;quot;) I wanted a pure SQL solution so that I didn&apos;t have to worry about formatting later. Here&apos;s some example SQL that will format a time span by days, hours and minutes.&lt;/p&gt;  &lt;div class=&quot;wlWriterEditableSmartContent&quot; id=&quot;scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E6:2d2c4d4f-6f6d-4e43-a4d0-4dc969eb34be&quot; style=&quot;padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px&quot;&gt;&lt;pre style=&quot;background-color:#FFFFFF;white-space:-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; white-space: pre-wrap; word-wrap: break-word;overflow: auto;&quot;&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;declare&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;@startTime&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;datetime&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;
&lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;set&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;@startTime&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #808080;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;&apos;&lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;2009-07-11 14:19:40.000&lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;&apos;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;

&lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;declare&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;@endTime&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;datetime&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;
&lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;set&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;@endTime&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #808080;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; getUtcDate()

&lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;select&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; 
    &lt;/span&gt;&lt;span style=&quot;color: #FF00FF;&quot;&gt;convert&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;varchar&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #800000; font-weight: bold;&quot;&gt;40&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;), &lt;/span&gt;&lt;span style=&quot;color: #FF00FF;&quot;&gt;dateDiff&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;(mi, &lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;@startTime&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;@endTime&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #808080;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #800000; font-weight: bold;&quot;&gt;24&lt;/span&gt;&lt;span style=&quot;color: #808080;&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: #800000; font-weight: bold;&quot;&gt;60&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;)) &lt;/span&gt;&lt;span style=&quot;color: #808080;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;&apos;&lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;d &lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;&apos;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; 
  &lt;/span&gt;&lt;span style=&quot;color: #808080;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #FF00FF;&quot;&gt;convert&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;varchar&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #800000; font-weight: bold;&quot;&gt;40&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;), &lt;/span&gt;&lt;span style=&quot;color: #FF00FF;&quot;&gt;dateDiff&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;(mi, &lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;@startTime&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;@endTime&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #808080;&quot;&gt;%&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #800000; font-weight: bold;&quot;&gt;24&lt;/span&gt;&lt;span style=&quot;color: #808080;&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: #800000; font-weight: bold;&quot;&gt;60&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #808080;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #800000; font-weight: bold;&quot;&gt;60&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;color: #808080;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;&apos;&lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;h &lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;&apos;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;
  &lt;/span&gt;&lt;span style=&quot;color: #808080;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #FF00FF;&quot;&gt;convert&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;varchar&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #800000; font-weight: bold;&quot;&gt;40&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;), &lt;/span&gt;&lt;span style=&quot;color: #FF00FF;&quot;&gt;dateDiff&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;(mi, &lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;@startTime&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;@endTime&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #808080;&quot;&gt;%&lt;/span&gt;&lt;span style=&quot;color: #800000; font-weight: bold;&quot;&gt;60&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;color: #808080;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;&apos;&lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;m&lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;&apos;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;as&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; Format1
  , &lt;/span&gt;&lt;span style=&quot;color: #FF00FF;&quot;&gt;case&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;
      &lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;when&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; (((&lt;/span&gt;&lt;span style=&quot;color: #FF00FF;&quot;&gt;dateDiff&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;(mi, &lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;@startTime&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;@endTime&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #808080;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #800000; font-weight: bold;&quot;&gt;24&lt;/span&gt;&lt;span style=&quot;color: #808080;&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: #800000; font-weight: bold;&quot;&gt;60&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;))) &lt;/span&gt;&lt;span style=&quot;color: #808080;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #800000; font-weight: bold;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;then&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;
          &lt;/span&gt;&lt;span style=&quot;color: #FF00FF;&quot;&gt;convert&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;varchar&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #800000; font-weight: bold;&quot;&gt;40&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;), &lt;/span&gt;&lt;span style=&quot;color: #FF00FF;&quot;&gt;dateDiff&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;(mi, &lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;@startTime&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;@endTime&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #808080;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #800000; font-weight: bold;&quot;&gt;24&lt;/span&gt;&lt;span style=&quot;color: #808080;&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: #800000; font-weight: bold;&quot;&gt;60&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;)) &lt;/span&gt;&lt;span style=&quot;color: #808080;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;&apos;&lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;d &lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;&apos;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; 
        &lt;/span&gt;&lt;span style=&quot;color: #808080;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #FF00FF;&quot;&gt;convert&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;varchar&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #800000; font-weight: bold;&quot;&gt;40&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;), &lt;/span&gt;&lt;span style=&quot;color: #FF00FF;&quot;&gt;dateDiff&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;(mi, &lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;@startTime&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;@endTime&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #808080;&quot;&gt;%&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #800000; font-weight: bold;&quot;&gt;24&lt;/span&gt;&lt;span style=&quot;color: #808080;&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: #800000; font-weight: bold;&quot;&gt;60&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #808080;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #800000; font-weight: bold;&quot;&gt;60&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;color: #808080;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;&apos;&lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;h &lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;&apos;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;
        &lt;/span&gt;&lt;span style=&quot;color: #808080;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #FF00FF;&quot;&gt;convert&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;varchar&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #800000; font-weight: bold;&quot;&gt;40&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;), &lt;/span&gt;&lt;span style=&quot;color: #FF00FF;&quot;&gt;dateDiff&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;(mi, &lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;@startTime&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;@endTime&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #808080;&quot;&gt;%&lt;/span&gt;&lt;span style=&quot;color: #800000; font-weight: bold;&quot;&gt;60&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;color: #808080;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;&apos;&lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;m&lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;&apos;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;
      &lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;when&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; (((&lt;/span&gt;&lt;span style=&quot;color: #FF00FF;&quot;&gt;dateDiff&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;(mi, &lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;@startTime&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;@endTime&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #808080;&quot;&gt;%&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #800000; font-weight: bold;&quot;&gt;24&lt;/span&gt;&lt;span style=&quot;color: #808080;&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: #800000; font-weight: bold;&quot;&gt;60&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #808080;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #800000; font-weight: bold;&quot;&gt;60&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;)) &lt;/span&gt;&lt;span style=&quot;color: #808080;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #800000; font-weight: bold;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;then&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;
          &lt;/span&gt;&lt;span style=&quot;color: #FF00FF;&quot;&gt;convert&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;varchar&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #800000; font-weight: bold;&quot;&gt;40&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;), &lt;/span&gt;&lt;span style=&quot;color: #FF00FF;&quot;&gt;dateDiff&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;(mi, &lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;@startTime&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;@endTime&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #808080;&quot;&gt;%&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #800000; font-weight: bold;&quot;&gt;24&lt;/span&gt;&lt;span style=&quot;color: #808080;&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: #800000; font-weight: bold;&quot;&gt;60&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #808080;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #800000; font-weight: bold;&quot;&gt;60&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;color: #808080;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;&apos;&lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;h &lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;&apos;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;
        &lt;/span&gt;&lt;span style=&quot;color: #808080;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #FF00FF;&quot;&gt;convert&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;varchar&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #800000; font-weight: bold;&quot;&gt;40&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;), &lt;/span&gt;&lt;span style=&quot;color: #FF00FF;&quot;&gt;dateDiff&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;(mi, &lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;@startTime&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;@endTime&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #808080;&quot;&gt;%&lt;/span&gt;&lt;span style=&quot;color: #800000; font-weight: bold;&quot;&gt;60&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;color: #808080;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;&apos;&lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;m&lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;&apos;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;
      &lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;else&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;
          &lt;/span&gt;&lt;span style=&quot;color: #FF00FF;&quot;&gt;convert&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;varchar&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #800000; font-weight: bold;&quot;&gt;40&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;), &lt;/span&gt;&lt;span style=&quot;color: #FF00FF;&quot;&gt;dateDiff&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;(mi, &lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;@startTime&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;@endTime&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #808080;&quot;&gt;%&lt;/span&gt;&lt;span style=&quot;color: #800000; font-weight: bold;&quot;&gt;60&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;color: #808080;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;&apos;&lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;m&lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;&apos;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;
    &lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;end&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;as&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; Format2
  , &lt;/span&gt;&lt;span style=&quot;color: #FF00FF;&quot;&gt;convert&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;varchar&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #800000; font-weight: bold;&quot;&gt;40&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;), &lt;/span&gt;&lt;span style=&quot;color: #FF00FF;&quot;&gt;dateDiff&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;(mi, &lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;@startTime&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;@endTime&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #808080;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #800000; font-weight: bold;&quot;&gt;24&lt;/span&gt;&lt;span style=&quot;color: #808080;&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: #800000; font-weight: bold;&quot;&gt;60&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;)) &lt;/span&gt;&lt;span style=&quot;color: #808080;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;&apos;&lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;&apos;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; 
  &lt;/span&gt;&lt;span style=&quot;color: #808080;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #808080;&quot;&gt;right&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;&apos;&lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;00&lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;&apos;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #808080;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #FF00FF;&quot;&gt;convert&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;varchar&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #800000; font-weight: bold;&quot;&gt;40&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;), &lt;/span&gt;&lt;span style=&quot;color: #FF00FF;&quot;&gt;dateDiff&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;(mi, &lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;@startTime&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;@endTime&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #808080;&quot;&gt;%&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #800000; font-weight: bold;&quot;&gt;24&lt;/span&gt;&lt;span style=&quot;color: #808080;&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: #800000; font-weight: bold;&quot;&gt;60&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #808080;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #800000; font-weight: bold;&quot;&gt;60&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;), &lt;/span&gt;&lt;span style=&quot;color: #800000; font-weight: bold;&quot;&gt;2&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;color: #808080;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;&apos;&lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;&apos;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;
  &lt;/span&gt;&lt;span style=&quot;color: #808080;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #808080;&quot;&gt;right&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;&apos;&lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;00&lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;&apos;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #808080;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #FF00FF;&quot;&gt;convert&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;varchar&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #800000; font-weight: bold;&quot;&gt;40&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;), &lt;/span&gt;&lt;span style=&quot;color: #FF00FF;&quot;&gt;dateDiff&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;(mi, &lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;@startTime&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;@endTime&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #808080;&quot;&gt;%&lt;/span&gt;&lt;span style=&quot;color: #800000; font-weight: bold;&quot;&gt;60&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;), &lt;/span&gt;&lt;span style=&quot;color: #800000; font-weight: bold;&quot;&gt;2&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;as&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; Format3&lt;/span&gt;&lt;/pre&gt;&lt;!-- Code inserted with Steve Dunn&apos;s Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --&gt;&lt;/div&gt;

&lt;blockquote class=&quot;note&quot;&gt;
	&lt;strong&gt;NOTE:&lt;/strong&gt;
	&lt;div&gt;Make sure to keep the dateDiff() time in minutes. If you switch to hours (or days) you&apos;ll have rounding issues you&apos;ll have to work around. By sticking to using minutes for the equations, you avoid the rounding issues.&lt;/div&gt;
&lt;/blockquote&gt;

&lt;p&gt;When you run this query in Microsoft SQL Server, you&apos;ll see that it outputs 3 columns&amp;#8212;Format1, Format2 and Format3.&lt;/p&gt;

&lt;p&gt;Format1 always outputs the time span in format 0d 0h 0m, even when the days or hours are 0. In my case, I really wanted to ignore days if no days have passed and hours if we&apos;re still under 60 minutes. This lead me to create Format2.&lt;/p&gt;

&lt;p&gt;Format2 still uses the 0d 0h 0m format, but it will drop off days if less than 24 hours old and drop hours if less than 60 minutes has passed. This leaves you strings like &amp;quot;6d 4h 52m&amp;quot;, &amp;quot;4h 10m&amp;quot; or &amp;quot;3m&amp;quot;. In my case, this was the best formatting for my uses.&lt;/p&gt;

&lt;p&gt;Format3 is an alternative format that places the time span in the format d:hh:mm. While I&apos;m not using that formatting currently, some people may find it useful. This also shows off how you can force the hours and minutes to output as a digit value (i.e. 0:02:01 = 0 days, 2 hours and 1 minute.)&lt;/p&gt;

&lt;p&gt;Hopefully this will prove useful to some of you.&lt;/p&gt;
				
				</description>
						
				
				<category>SQL</category>				
				
				<pubDate>Fri, 17 Jul 2009 11:59:21 -0500</pubDate>
				<guid>http://blog.pengoworks.com/index.cfm/2009/7/17/Using-MSSQL-to-output-time-in-days-hours-and-minutes</guid>
				
				
			</item>
			
		 	
			
			
			<item>
				<title>CF9 can protect SQL statements stored as string from SQL injection</title>
				<link>http://blog.pengoworks.com/index.cfm/2009/7/15/CF9-can-protect-SQL-statements-stored-as-string-from-SQL-injection</link>
				<description>
				
				&lt;p&gt;One of the many new features in ColdFusion 9 is the ability to use every tag within a &amp;lt;cfscript /&amp;gt; block. Developers seem to either love or hate &amp;lt;cfscript /&amp;gt; and I&apos;ve always falling into the love (well, maybe not love but I&apos;m extremely fond of it.) I just find &amp;lt;cfscript /&amp;gt; a better method for writing business logic. So for me, the addition of being able to access any CF tag via &amp;lt;cfscript /&amp;gt; will be really nice. However, I wanted to point out one specific use case where the addition of being able to script any tag really comes in handy.&lt;/p&gt;  &lt;p&gt;One of issue I&apos;ve run into in the past with ColdFusion is that there&apos;s no good way to protect a SQL statement from SQL injections if your SQL is coming from a string variable. In most cases you&apos;re going to build dynamic SQL statements within a &amp;lt;cfquery /&amp;gt; block, occasionally I&apos;ve found situations were this isn&apos;t ideal. &lt;/p&gt;  &lt;p&gt;In these cases I&apos;ve wanted to use a UDF to generate a block of SQL for me, because I can easily re-use the function to re-use common blocks of SQL.&lt;/p&gt;  &lt;p&gt;The problem with building the statement via a UDF is that when your SQL is generated as a string, there&apos;s you can&apos;t use &amp;lt;cfqueryparam /&amp;gt; to secure your data (unless you were to save the string to disk, include it in the query and then clean up the temp file.)&lt;/p&gt;  &lt;p&gt;This is where CF9&apos;s new functionality of being able to script any tag will become handy. ColdFusion 9 introduces a way to bind a token to a SQL parameter. This would allow you to build a SQL statement completely from a string and then bind tokens in the string to parameters.&lt;/p&gt;  &lt;p&gt;The following example code comes from &lt;a href=&quot;http://www.aliaspooryorik.com/blog/index.cfm/e/posts.details/post/cfquery-in-cfml-with-parameters-218&quot; target=&quot;_blank&quot;&gt;John Whish&apos;s cfquery in cfml with parameters&lt;/a&gt; post:&lt;/p&gt;  &lt;div class=&quot;wlWriterEditableSmartContent&quot; id=&quot;scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E6:ffeff394-d8d4-4e2c-8945-1b7383471992&quot; style=&quot;padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px&quot;&gt;&lt;pre style=&quot;background-color:#FFFFFF;overflow: auto;&quot;&gt;&lt;span style=&quot;color: #008000;&quot;&gt;//&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt; create a query&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;
&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;q &lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; Query();

&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;//&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt; don&apos;t need to set datasource if using this.datasource in Application.cfc &lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;
&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;q.setDatasource( &lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;cfartgallery&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; );

&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;//&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt; build the SQL statement &lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;
&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;q.setSQL( &lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;select * from Art where artistid = :artistid and issold = :issold&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; );

&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;//&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt; this is the equivalent of cfqueryparam &lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;
&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;q.addParam( name&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;artistid&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;, value&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;2&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;, cfsqltype&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;CF_SQL_INTEGER&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; );
q.addParam( name&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;issold&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;, value&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;, cfsqltype&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;CF_SQL_BIT&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; );

&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;//&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt; run the query and get a query object&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;
&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;result &lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt; q.execute();

&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;//&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt; dump query object&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;
&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;writeDump( result );&lt;/span&gt;&lt;/pre&gt;&lt;!-- Code inserted with Steve Dunn&apos;s Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --&gt;&lt;/div&gt;

&lt;p&gt;As you can see from the code, the setSQL() method takes a string of SQL to execute. You&apos;ll also notice two unique tokens in the SQL &amp;quot;:artistid&amp;quot; and &amp;quot;:issold&amp;quot;. When you invoke the q.addParam() method, you&apos;re replacing the tokens with a binding SQL variable&amp;#8212;which protects you from SQL injections.&lt;/p&gt;

&lt;p&gt;So, the addition to the new Query() object ends up solving a problem that I&apos;ve run into in the past to which there&apos;s never been a really good solution for in the past. &lt;/p&gt;

&lt;p&gt;I&apos;ve been meaning to post this since the CF9 beta became public, but work kept getting in the way. :)&lt;/p&gt;
				
				</description>
						
				
				<category>HTML/ColdFusion</category>				
				
				<pubDate>Wed, 15 Jul 2009 15:21:45 -0500</pubDate>
				<guid>http://blog.pengoworks.com/index.cfm/2009/7/15/CF9-can-protect-SQL-statements-stored-as-string-from-SQL-injection</guid>
				
				
			</item>
			
		 	
			
			
			<item>
				<title>My lab 16 months after double bilateral TTA&amp;hellip;</title>
				<link>http://blog.pengoworks.com/index.cfm/2009/6/22/My-lab-16-months-after-double-bilateral-TTA</link>
				<description>
				
				&lt;p&gt;In February 2008, our black lab (then just 4 years old) was in pretty bad shape. Both of her rear knees had gotten so bad she &lt;a href=&quot;http://blog.pengoworks.com/index.cfm/2008/2/12/My-poor-NikNiks&quot; target=&quot;_blank&quot;&gt;basically could no longer walk&lt;/a&gt;. We decided to proceed with a &lt;a href=&quot;http://www.ncbi.nlm.nih.gov/pubmed/17143394&quot;&gt;bilateral TTA (tibial tuberosity advancement)&lt;/a&gt; in both her hind legs. It was a tough decision for us, because it&apos;s not a cheap procedure and we weren&apos;t sure how we&apos;d manage to keep her constrained for the 11-12 week recoup time. &lt;/p&gt;  &lt;p&gt;I&apos;ve blogged several times about how successful the operation was. She&apos;s really done excellent and there are no real hints of her knees ever bothering her. She&apos;ll occasionally get up slowly, but I can&apos;t say that&apos;s because of the surgery. What I do know is the dog still loves to run and jump. The knee surgery has not slowed her pursuit of climbing trees one bit, so I know she&apos;s doing well.&lt;/p&gt;  &lt;p&gt;The other night my wife was playing around w/our new iPhone 3GS that we&apos;re trying out and I thought it was a good idea to post a video of her running and playing fetch in our yard. Well the video is not terribly exciting, I thought it might be useful for someone debating on whether or not it&apos;s worth the investment of the bilateral TTA procedure. I know in our case w/out the surgery we would have had to put her down&amp;#8212;because she was just in too much pain and it was only going to get worse. So, seeing her run around today still thrills me to no end.&lt;/p&gt;  &lt;p&gt;I try to play ball w/my labs for at least 30 minutes every day (weather pending.) I&apos;ve run Nikki (our black lab) pretty hard this year and she&apos;s held up great. She&apos;ll run for as long as I&apos;m willing to throw the ball and I&apos;ve seen no side effects from the surgery at all. So here&apos;s she is doing her favorite activity in the world&amp;#8212;playing fetch:&lt;/p&gt;  &lt;object width=&quot;425&quot; height=&quot;344&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.youtube.com/v/togjs-1HBI8&amp;amp;hl=en&amp;amp;fs=1&amp;amp;&quot;&gt;&lt;/param&gt;&lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot;&gt;&lt;/param&gt;&lt;param name=&quot;allowscriptaccess&quot; value=&quot;always&quot;&gt;&lt;/param&gt;&lt;embed src=&quot;http://www.youtube.com/v/togjs-1HBI8&amp;amp;hl=en&amp;amp;fs=1&amp;amp;&quot; type=&quot;application/x-shockwave-flash&quot; allowscriptaccess=&quot;always&quot; allowfullscreen=&quot;true&quot; width=&quot;425&quot; height=&quot;344&quot;&gt;&lt;/embed&gt;&lt;/object&gt;
				
				</description>
						
				
				<category>Personal</category>				
				
				<pubDate>Mon, 22 Jun 2009 18:45:19 -0500</pubDate>
				<guid>http://blog.pengoworks.com/index.cfm/2009/6/22/My-lab-16-months-after-double-bilateral-TTA</guid>
				
				
			</item>
			
		 	
			
			
			<item>
				<title>Stay w/Verizon Wireless or keep my iPhone 3GS?</title>
				<link>http://blog.pengoworks.com/index.cfm/2009/6/22/Stay-wVerizon-Wireless-or-keep-my-iPhone-3GS</link>
				<description>
				
				&lt;p&gt;Ok, so on Friday I decided to pick up an iPhone 3GS to try it out. My Verizon XV6700 really has issues and just is a horrible phone (I can&apos;t see the display when outside and also have always had problems hearing the person on the other land if there&apos;s any amount of background noise.)&lt;/p&gt;  &lt;p&gt;I&apos;ve been eligible for my &amp;quot;new every two&amp;quot; for almost a year, but Verizon still hasn&apos;t put out a phone I&apos;m completely happy with. Every time I think they might have a winner (like the Storm) it fails.&lt;/p&gt;  &lt;p&gt;So on Friday I was supposed to play golf, but due to some severe storms in the morning my party cancelled the outing (although I did end up playing a round later by myself.) Since I had the day off and nothing to really do, I thought I&apos;d see if the local AT&amp;amp;T had any of the iPhone 3GS&apos; in stock. Sure enough they had several still in stock, so w/my 30 day guarantee, I thought I&apos;d sign up and see how it goes.&lt;/p&gt;  &lt;p&gt;The biggest thing that&apos;s held me back from the iPhone is the lack of physical keyboard and AT&amp;amp;T&apos;s network (which I keep hearing bad things about.)&lt;/p&gt;  &lt;p&gt;So, over the weekend I did a lot of playing around w/the iPhone. Well there&apos;s a lot of stuff I really like, I&apos;m still a bit wary about AT&amp;amp;T&apos;s network and I really dislike the software keyboard&amp;#8212;especially since the iPhone seems to require a lot of password typing (I&apos;m sure the whole App Store password re-entry is for security purposes, but when you have a very secure password it&apos;s very cumbersome to keep re-typing the password in. Instead of constantly re-typing the password I&apos;d rather be able to disable iPhone access to the App Store via the Preferences in iTunes.)&lt;/p&gt;  &lt;p&gt;Anyway, is AT&amp;amp;T&apos;s network really that bad? So far the coverage has seemed ok, although when playing golf Saturday while my bars showed full, the conversation with my wife seemed to be breaking up a lot.&lt;/p&gt;  &lt;p&gt;Should I go ahead and move the wife and me to iPhones and move off VZW?&lt;/p&gt;
				
				</description>
						
				
				<category>Personal</category>				
				
				<pubDate>Mon, 22 Jun 2009 14:45:27 -0500</pubDate>
				<guid>http://blog.pengoworks.com/index.cfm/2009/6/22/Stay-wVerizon-Wireless-or-keep-my-iPhone-3GS</guid>
				
				
			</item>
			
		 	
			
			
			<item>
				<title>structFilter() UDF - Filtering a structure based upon a regular expression</title>
				<link>http://blog.pengoworks.com/index.cfm/2009/6/17/structFilter-UDF--Filtering-a-structure-based-upon-a-regular-expression</link>
				<description>
				
				&lt;p&gt;Today I thought I&apos;d share a little ColdFusion helper function I&apos;ve been using for years: structFilter(). The structFilter() parses a structure and returns only the keys that match a given regular expression. &lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;div class=&quot;wlWriterEditableSmartContent&quot; id=&quot;scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E6:81054b5a-20e3-4dae-b096-2419f67b92d2&quot; style=&quot;padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px&quot;&gt;&lt;pre style=&quot;background-color:#FFFFFF;overflow: auto;&quot;&gt;&lt;span style=&quot;color: #008000;&quot;&gt;&amp;lt;!--&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;-
 Searches a structure for keys matching a regex and returns a structure containing the
 matched keys.

 @param input        The structure to filter. (struct; required)
 @param regex        The regular expression to filter keys against. (string; required)
 @param useNoCase    Do a case insensitive search? (boolean; default = true)
 @param useDeepCopy  Do a deep copy on the keys? (boolean; default = false)

 @return Returns a structure containing the matching keys.
 @author Dan G. Switzer, II (dan.switzer@givainc.com)
 @version 1, June 17, 2009
-&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;--&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;
&lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;cffunction &lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;=&quot;structFilter&quot;&lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt; returntype&lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;=&quot;struct&quot;&lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt; output&lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;=&quot;false&quot;&lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt; access&lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;=&quot;public&quot;&lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt; 
    hint&lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;=&quot;Filters keys in a structure to those matching the regular expression.&quot;&lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;
  &lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;&amp;lt;!--&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;-// define valid arguments //-&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;--&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;
  &lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;cfargument &lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;=&quot;input&quot;&lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt; type&lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;=&quot;struct&quot;&lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt; required&lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;=&quot;true&quot;&lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;
  &lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;cfargument &lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;=&quot;regex&quot;&lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt; type&lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;=&quot;string&quot;&lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt; required&lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;=&quot;true&quot;&lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;
  &lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;cfargument &lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;=&quot;useNoCase&quot;&lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt; type&lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;=&quot;boolean&quot;&lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt; required&lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;=&quot;false&quot;&lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt; default&lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;=&quot;true&quot;&lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;
  &lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;cfargument &lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;=&quot;useDeepCopy&quot;&lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt; type&lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;=&quot;boolean&quot;&lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt; required&lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;=&quot;false&quot;&lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt; default&lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;=&quot;false&quot;&lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;
  
  &lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;&amp;lt;!--&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;-// define local variables //-&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;--&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;
  &lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;cfset &lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;var result &lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;= structNew() &lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;

  &lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;&amp;lt;!--&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;-// if using NoCase and the (?i) directive doesn&apos;t exist, append to regex //-&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;--&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;  
  &lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;cfif &lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;arguments.useNoCase and not reFind(&quot;^\(\?[mx]*i[mx]*\)&quot;, arguments.regex)&lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;
    &lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;cfset &lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;arguments.regex &lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;= &quot;(?i)&quot;&lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt; &amp;amp; arguments.regex &lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;
  &lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;cfif&lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;

  &lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;cfloop &lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;item&lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;=&quot;key&quot;&lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt; collection&lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;=&quot;#arguments.input#&quot;&lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;
    &lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;cfif &lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;reFind(arguments.regex, key)&lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;
      &lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;cfif &lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;arguments.useDeepCopy&lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;
        &lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;cfset &lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;result[key] &lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;= duplicate(arguments.input[key]) &lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;
      &lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;cfelse&lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;
        &lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;cfset &lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;result[key] &lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;= arguments.input[key] &lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;
      &lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;cfif&lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;
    &lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;cfif&lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;
  &lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;cfloop&lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;

  &lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;&amp;lt;!--&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;-// return the new structure //-&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;--&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;  
  &lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;cfreturn &lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;result &lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;
&lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;cffunction&lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!-- Code inserted with Steve Dunn&apos;s Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --&gt;&lt;/div&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;I&apos;ve found this helper UDF to be extremely handy in when you have a bunch of serialized form fields that follow a given nomenclature. For example, if you have a bunch of form fields like:&lt;/p&gt;

&lt;div class=&quot;wlWriterEditableSmartContent&quot; id=&quot;scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E6:fce01ecb-93e5-4bc8-8574-010a513f47ac&quot; style=&quot;padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px&quot;&gt;&lt;pre style=&quot;background-color:#FFFFFF;overflow: auto;&quot;&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;input &lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;type&lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;=&quot;text&quot;&lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt; name&lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;=&quot;name&quot;&lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt; value&lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;=&quot;&quot;&lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;
&lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;input &lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;type&lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;=&quot;text&quot;&lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt; name&lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;=&quot;description&quot;&lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt; value&lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;=&quot;&quot;&lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;

&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;&amp;lt;!--&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;-// dynamic list of variables //-&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;--&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;
&lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;cfloop &lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;index&lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;=&quot;i&quot;&lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt; from&lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;=&quot;1&quot;&lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt; to&lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;=&quot;10&quot;&lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;
  &lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;cfoutput&lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;
    &lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;input &lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;type&lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;=&quot;text&quot;&lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt; name&lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;=&quot;id_#i#&quot;&lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt; value&lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;=&quot;&quot;&lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;
  &lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;cfoutput&lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;
&lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;cfloop&lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;
&lt;/span&gt;&lt;/pre&gt;&lt;!-- Code inserted with Steve Dunn&apos;s Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --&gt;&lt;/div&gt;

&lt;p&gt;Using the structFilter() UDF you can vary easily process all the fields starting with &amp;quot;id_&amp;quot; by doing:&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;div class=&quot;wlWriterEditableSmartContent&quot; id=&quot;scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E6:85cdcb38-babf-4b81-9c6b-0c694cf621b6&quot; style=&quot;padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px&quot;&gt;&lt;pre style=&quot;background-color:#FFFFFF;overflow: auto;&quot;&gt;&lt;span style=&quot;color: #008000;&quot;&gt;&amp;lt;!--&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;-// 
  get all the fields:
  * starting with &quot;id_&quot;
  * and ending with one or more numbers
//-&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;--&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;  
&lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;cfset &lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;stIds &lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;= structFilter(form, &lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;&quot;^id_\d+$&quot;) &lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!-- Code inserted with Steve Dunn&apos;s Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --&gt;&lt;/div&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;This will give you a structure containing all the &amp;quot;id_&amp;quot; fields that you can then process in a collection-based loop. This method is much more effective then passing in some kind of hidden &amp;quot;counter&amp;quot; variable where you loop from 1 to the counter variable (which is a technique I&apos;ve used in the past) as it doesn&apos;t rely on the numbers being serialized.&lt;/p&gt;

&lt;p&gt;There are obviously many other uses for this function, but I use it a lot for processing complex forms that have dynamically generated fields that have a fixed nomenclature.&lt;/p&gt;
				
				</description>
						
				
				<category>HTML/ColdFusion</category>				
				
				<pubDate>Wed, 17 Jun 2009 10:49:12 -0500</pubDate>
				<guid>http://blog.pengoworks.com/index.cfm/2009/6/17/structFilter-UDF--Filtering-a-structure-based-upon-a-regular-expression</guid>
				
				
			</item>
			
		 	
			</channel></rss>