<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Eric Fickes</title>
	<atom:link href="http://ericfickes.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://ericfickes.com</link>
	<description>Design minded Internet Programmer</description>
	<lastBuildDate>Fri, 28 Oct 2011 04:14:43 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>iBoth</title>
		<link>http://ericfickes.com/2011/10/iboth/</link>
		<comments>http://ericfickes.com/2011/10/iboth/#comments</comments>
		<pubDate>Thu, 06 Oct 2011 04:40:11 +0000</pubDate>
		<dc:creator>Eric Fickes</dc:creator>
				<category><![CDATA[apple]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[microsoft]]></category>
		<category><![CDATA[osx]]></category>

		<guid isPermaLink="false">http://ericfickes.com/?p=2194</guid>
		<description><![CDATA[I&#8217;m a PC, but I&#8217;m also a MAC. Thank you Steve.]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m a <a title="Microsoft.com" href="http://www.microsoft.com" target="_blank">PC</a>, but I&#8217;m also a <a title="MacBook Pro" href="http://www.apple.com/macbookpro/" target="_blank">MAC</a>.</p>
<p>Thank you Steve.<br />
</p>
<div id="attachment_2195" class="wp-caption alignnone" style="width: 716px"><a href="http://ericfickes.com/wp-content/uploads/2011/10/stevejobs.png" style="float:left;" rel="lightbox[2194]"><img class="size-full wp-image-2195 " title="stevejobs" src="http://ericfickes.com/wp-content/uploads/2011/10/stevejobs.png" alt="Steve Jobs 1955 - 2011" width="706" height="644" style="float:left;" /></a><p class="wp-caption-text">Steve Jobs 1955 - 2011</p></div>
]]></content:encoded>
			<wfw:commentRss>http://ericfickes.com/2011/10/iboth/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Blogging is on hold</title>
		<link>http://ericfickes.com/2011/09/blogging-is-on-hold/</link>
		<comments>http://ericfickes.com/2011/09/blogging-is-on-hold/#comments</comments>
		<pubDate>Tue, 20 Sep 2011 20:32:21 +0000</pubDate>
		<dc:creator>Eric Fickes</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://ericfickes.com/?p=2184</guid>
		<description><![CDATA[I&#8217;m currently on a break from blogging. The last six months have been quite busy and a lot of things have changed. This website isn&#8217;t going anywhere, but a change is coming. I haven&#8217;t decided what I&#8217;m going to do &#8230; <a href="http://ericfickes.com/2011/09/blogging-is-on-hold/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m currently on a break from blogging. The last six months have been quite busy and a lot of things have changed. This website isn&#8217;t going anywhere, but a change is coming. I haven&#8217;t decided what I&#8217;m going to do with the site, but I&#8217;m shooting for a redo sometime between now and 2012.</p>
<p>Got any suggestions? Thinking about dropping WordPress for <a href="http://octopress.org/" target="_blank">Octopress</a>, or maybe even building my own website again and maybe aggregating all my other online accounts to make a sort of Eric Central if you will.</p>
<p>In the meantime, feel free to click around and see what I&#8217;ve already got on the site. You can still find me contributing to the internets on <a href="http://twitter.com/ericfickes" target="_blank">Twitter</a>, and where ever else the nets takes me.</p>
<p><a href="http://ericfickes.com/wp-content/uploads/2011/09/memes-the-internet-is.jpeg" rel="lightbox[2184]"><img class="aligncenter size-full wp-image-2190" title="internets full of lolcats" src="http://ericfickes.com/wp-content/uploads/2011/09/memes-the-internet-is.jpeg" alt="" width="500" height="356" /></a></p>
<p>I&#8217;m still here, just busy programming internets.</p>
]]></content:encoded>
			<wfw:commentRss>http://ericfickes.com/2011/09/blogging-is-on-hold/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Happy Father&#8217;s day</title>
		<link>http://ericfickes.com/2011/06/happy-fathers-day/</link>
		<comments>http://ericfickes.com/2011/06/happy-fathers-day/#comments</comments>
		<pubDate>Sun, 19 Jun 2011 17:36:17 +0000</pubDate>
		<dc:creator>Eric Fickes</dc:creator>
				<category><![CDATA[comedy]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[video]]></category>

		<guid isPermaLink="false">http://ericfickes.com/?p=2175</guid>
		<description><![CDATA[This one never gets old. It&#8217;s the dad life!]]></description>
			<content:encoded><![CDATA[<p>This one never gets old.  It&#8217;s the dad life!</p>
<p><iframe width="640" height="390" src="http://www.youtube.com/embed/DOKuSQIJlog?rel=0" frameborder="0" allowfullscreen></iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://ericfickes.com/2011/06/happy-fathers-day/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>It&#8217;s time for Ignite Denver 9, get your tickets now</title>
		<link>http://ericfickes.com/2011/06/its-time-for-ignite-denver-9-get-your-tickets-now/</link>
		<comments>http://ericfickes.com/2011/06/its-time-for-ignite-denver-9-get-your-tickets-now/#comments</comments>
		<pubDate>Sun, 19 Jun 2011 06:10:35 +0000</pubDate>
		<dc:creator>Eric Fickes</dc:creator>
				<category><![CDATA[comedy]]></category>
		<category><![CDATA[cool]]></category>
		<category><![CDATA[denver]]></category>
		<category><![CDATA[video]]></category>

		<guid isPermaLink="false">http://ericfickes.com/?p=2167</guid>
		<description><![CDATA[UPDATE : here I am talking crazy at Ignite Denver 9 This Tuesday, June 21st is Ignite Denver 9, and I was selected to speak!.  My talks is a ten point list of things to help you stop being dumb &#8230; <a href="http://ericfickes.com/2011/06/its-time-for-ignite-denver-9-get-your-tickets-now/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>UPDATE : here I am talking crazy at Ignite Denver 9</p>
<p><iframe width="640" height="510" src="http://www.youtube.com/embed/zY3e_wzHg-A?rel=0" frameborder="0" allowfullscreen></iframe></p>
<p>This Tuesday, June 21st is <a href="http://ignitedenver.org/">Ignite Denver 9, and I was selected to speak!</a>.  My talks is a ten point list of things to help you stop being dumb at computers.  This Ignite Denver is going to be a lot of fun.  It was our first time having a practice run prior to the big event.  I&#8217;m excited to see how this practice effects the talks.  I&#8217;ll tell you my final slide deck is much better than the one I took to practice.</p>
<p>Here is an image and video I found while putting my talk together.  Hope to see you<a title="I'm speaking at Ignite Denver 9, you better show up!" href="http://ignitedenver.org/" target="_blank"> Tuedsay at Ignite Denver</a>.</p>
<p><a href="http://ericfickes.com/wp-content/uploads/2011/06/man-at-old-computer.jpg" rel="lightbox[2167]"><img class="aligncenter size-full wp-image-2168" title="man-at-old-computer" src="http://ericfickes.com/wp-content/uploads/2011/06/man-at-old-computer.jpg" alt="Far out solid and right on Bob" width="800" height="640" /></a></p>
<hr />
<iframe width="640" height="390" src="http://www.youtube.com/embed/U7RDFk64TpM?rel=0" frameborder="0" allowfullscreen></iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://ericfickes.com/2011/06/its-time-for-ignite-denver-9-get-your-tickets-now/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>I spoke about HTML5, and left out some notes</title>
		<link>http://ericfickes.com/2011/04/i-spoke-about-html5-and-left-out-some-notes/</link>
		<comments>http://ericfickes.com/2011/04/i-spoke-about-html5-and-left-out-some-notes/#comments</comments>
		<pubDate>Fri, 15 Apr 2011 05:29:00 +0000</pubDate>
		<dc:creator>Eric Fickes</dc:creator>
				<category><![CDATA[adobe]]></category>
		<category><![CDATA[conference]]></category>
		<category><![CDATA[FLASH]]></category>
		<category><![CDATA[flash platform]]></category>
		<category><![CDATA[FLEX]]></category>
		<category><![CDATA[HTML5]]></category>

		<guid isPermaLink="false">http://ericfickes.com/?p=2151</guid>
		<description><![CDATA[Tonight I spoke about the state of HTML5 and my thoughts about it&#8217;s future.  The overall message of the talk was to think of HTML5 as a tool rather than a Flash killer.  In time, HTML5 is expected to advance &#8230; <a href="http://ericfickes.com/2011/04/i-spoke-about-html5-and-left-out-some-notes/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a title="Flex Camp 2011 Denver" href="http://dfug.groupsite.com/calendar/event/2011/4/14/251740" target="_blank"><img class="alignleft size-full wp-image-2152" title="RIA 5280 Flex Camp 2011" src="http://ericfickes.com/wp-content/uploads/2011/04/Screen-shot-2011-04-14-at-10.44.21-PM.png" alt="" width="167" height="129" /></a>Tonight I spoke about the state of HTML5 and my thoughts about it&#8217;s future.  The overall message of the talk was to think of HTML5 as a tool rather than a Flash killer.  In time, HTML5 is expected to advance to a point where we can deliver &#8220;flash like&#8221; audio, video, and application experiences on any device with an HTML5 compliant browser.  Similar to XML when it gave us a common format to exchange data between different computer systems in 2000, HTML5 may be that tool to connect us across all devices.</p>
<p>In the now there is a great deal of energy by the major browser makers to implement HTML5.  However, it really feels like only the fun stuff is here right now ( audio, video, canvas ).  Chrome and Opera have plenty more impressive features, but it&#8217;s going to be be a while until HTML5 is that magical ubiquitous platform.  With all the major browsers getting monthly ( and sometimes semi-monthly ) updates, HTML5 is more than just all the rage.  It&#8217;s actually getting built!</p>
<div style="width:425px" id="__ss_7635295"> <strong style="display:block;margin:12px 0 4px"><a href="http://www.slideshare.net/ericfickes/targeting-screens-with-html5-flash-native" title="Targeting Screens with HTML5, Flash &amp; Native">Targeting Screens with HTML5, Flash &amp; Native</a></strong> <iframe src="http://www.slideshare.net/slideshow/embed_code/7635295" width="425" height="355" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe>
<div style="padding:5px 0 12px"> View more <a href="http://www.slideshare.net/">presentations</a> from <a href="http://www.slideshare.net/ericfickes">Eric Fickes</a> </div>
</p></div>
<p>And here are some of the notes that didn&#8217;t make it into the presentation, and information on the demos that did.</p>
<p><strong>TOOLING</strong></p>
<ul>
<li><strong>Dreamweaver HTML5 Pack</strong>. <a title="Get the HTML5 pack for Dreamweaver on Adobe Labs" href="http://labs.adobe.com/technologies/html5pack/" target="_blank">http://labs.adobe.com/technologies/html5pack/</a></li>
<li><strong>TextMate</strong>.  There are HTML5 bundles available. <a title="TextMate for OS X" href="http://macromates.com/" target="_blank">http://macromates.com/</a></li>
<li><strong>WebStorm</strong>.  Web IDE = JavaScript / HTML Editor + JS Debugger + VCS Support.  <a title="From the makers of IntelliJIDEA, and .NET's Refactor" href="http://www.jetbrains.com/webstorm/" target="_blank">http://www.jetbrains.com/webstorm/</a></li>
<li><strong>Aptana</strong>.  <a href="http://www.aptana.com/" target="_blank">http://www.aptana.com/</a></li>
</ul>
<p><strong>MOBILE FRAMEWORKS</strong></p>
<ul>
<li><span style="color: #000000;"><strong>JO </strong>( mobile app fw, js html5 )  <a title="Javacript and HTML5 mobile framework" href="http://joapp.com/" target="_blank">http://joapp.com/</a><strong><br />
</strong></span></li>
<li><strong>Sencha JS</strong> ( Javascript and HTML5 ) <a title="Javascript and HTML5 framework" href="http://www.sencha.com/" target="_blank">http://www.sencha.com/</a></li>
<li><strong>PhoneGap</strong> ( mobile and js, open source all 6 platforms ) <a title="Open source mobile javascript framework" href="http://www.phonegap.com/" target="_blank">http://www.phonegap.com/</a></li>
<li><strong>Wink</strong> ( Lightweight mobile javascript framework ) <a title="Lightweight mobile javascript framework" href="http://www.winktoolkit.org/" target="_blank">http://www.winktoolkit.org/</a></li>
<li><strong>NimbleKit</strong> ( native iOS using HTML and JS ) <a title="Use HTML and Javascript to create native iOS apps" href="http://www.nimblekit.com/" target="_blank">http://www.nimblekit.com/</a></li>
<li><strong>Appcelerator  &gt; Titanium Platform</strong> ( html, css, js, ruby, python ) <a title="HTML, CSS, Javascript, Ruby, Python" href="http://www.appcelerator.com/products/titanium-cross-platform-application-development/" target="_blank">http://www.appcelerator.com/products/titanium-cross-platform-application-development/</a></li>
<li><strong>Appcelerator  &gt; Titanium Mobile</strong> ( html, css, js ) <a title="HTML, CSS, and Javascript" href="http://www.appcelerator.com/products/titanium-mobile-application-development/" target="_blank">http://www.appcelerator.com/products/titanium-mobile-application-development/</a></li>
<li><strong>jQTouch</strong> ( jQuery for iPhone and iPod Touch ) <a title="jQuery for iPhone and iPod Touch" href="http://jqtouch.com/" target="_blank">http://jqtouch.com/</a></li>
<li><strong>jQueryMobile</strong> ( Touch-Optimized Web Framework for Smartphones &amp; Tablets )  <a title="Touch framework for Smartphones &amp; Tablets" href="http://jquerymobile.com/" target="_blank">http://jquerymobile.com/</a></li>
<li><strong>The M-Project</strong> ( HTML5, JS for mobile ) <a title="HTML5 and Javascript for mobile" href="http://the-m-project.net/" target="_blank">http://the-m-project.net/</a></li>
<li><strong>Rhodes</strong> (Ruby framework to build native apps for iPhone, Windows Mobile, RIM, Symbian and Android).  <a title="Ruby framework to make native apps for iPhone, Windows Mobile, RIM, Symbian and Android" href="http://rhomobile.com/products/rhodes/" target="_blank">http://rhomobile.com/products/rhodes/</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://ericfickes.com/2011/04/i-spoke-about-html5-and-left-out-some-notes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>McDonalds&#8217; Chicken Nuggets are NOT boneless</title>
		<link>http://ericfickes.com/2011/03/mcdonalds-chicken-nuggets-are-not-boneless/</link>
		<comments>http://ericfickes.com/2011/03/mcdonalds-chicken-nuggets-are-not-boneless/#comments</comments>
		<pubDate>Sat, 12 Mar 2011 04:15:52 +0000</pubDate>
		<dc:creator>Eric Fickes</dc:creator>
				<category><![CDATA[denver]]></category>
		<category><![CDATA[ramblings]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[bone]]></category>
		<category><![CDATA[boneless]]></category>
		<category><![CDATA[chicken]]></category>
		<category><![CDATA[chicken mcnugget]]></category>
		<category><![CDATA[chicken nugget]]></category>
		<category><![CDATA[chickenMcNuggetsHaveBones]]></category>
		<category><![CDATA[health]]></category>
		<category><![CDATA[mcdonalds]]></category>
		<category><![CDATA[mcnugget]]></category>
		<category><![CDATA[safety]]></category>

		<guid isPermaLink="false">http://ericfickes.com/?p=2110</guid>
		<description><![CDATA[UPDATE 3.24.11- The owner of the McDonalds called and sounded very sincere on the phone, while having no idea how his restaraunt was being run. We were offered more free food, but politely declined. McDonalds&#8217; insurance has now served Tyson &#8230; <a href="http://ericfickes.com/2011/03/mcdonalds-chicken-nuggets-are-not-boneless/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>UPDATE 3.24.11- The owner of the McDonalds called and sounded very sincere on the phone, while having no idea how his restaraunt was being run.  We were offered more free food, but politely declined.  McDonalds&#8217; insurance has now served Tyson Foods Inc with a bone notice.</p>
<div id="attachment_2138" class="wp-caption aligncenter" style="width: 610px"><a href="http://ericfickes.com/wp-content/uploads/2011/03/tysons-bone-notice1.jpg" rel="lightbox[2110]"><img class="size-full wp-image-2138" title="Tyson Foods Inc bone notice" src="http://ericfickes.com/wp-content/uploads/2011/03/tysons-bone-notice1.jpg" alt="Tyson Foods Inc bone notice" width="600" height="803" /></a><p class="wp-caption-text">Tyson Foods make McDonalds Chicken McNuggets, and some have bones</p></div>
<p>&#8220;The chicken mcnuggets already come packaged and prepared to our insured location and they are not altered in any way; therefore Tyson Foods Inc. may be liable for said incident.&#8221;</p>
<p>Wow, my image of McDonalds is going right down the tubes.  They don&#8217;t actually make their food, they just heat it up and put it in a bag?  I&#8217;m loving it!</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>I&#8217;m not a litigious guy, but I feel like something needs to be said about McDonalds and the bones in their Chicken McNuggets.  Tonight is Friday, so the wife and I took the kids to McDonalds so they could play with their friends on the playground.  Tonight was <em>mostly</em> like every other Friday, except that Fletch received two surprises in his happy meal.</p>
<ol>
<li>A Superman action figure ( nicely packed in it&#8217;s own plastic bag )</li>
<li>A chicken bone ( hidden inside of a nugget )</li>
</ol>
<p>The chicken bone came as quite a shocker.  Fletch was eating slow as usual and got really weird, then started spitting out his nugget onto the bench.  At first I thought he had a cough and was trying not to choke.  After I cleaned all the mush off the bench I found this CHICKEN BONE!!!</p>
<p><a href="http://ericfickes.com/wp-content/uploads/2011/03/nugget-bone1.jpg" rel="lightbox[2110]"><img class="aligncenter size-full wp-image-2111" title="chicken bone on top of chicken mc nugget" src="http://ericfickes.com/wp-content/uploads/2011/03/nugget-bone1.jpg" alt="This bone is on a nugget only for size reference" width="765" height="1024" /></a></p>
<p><a href="http://ericfickes.com/wp-content/uploads/2011/03/nugget-bone2.jpg" rel="lightbox[2110]"><img class="aligncenter size-full wp-image-2112" title="nugget-bone2" src="http://ericfickes.com/wp-content/uploads/2011/03/nugget-bone2.jpg" alt="Holding the chicken bone from Fletch's Chicken McNugget" width="765" height="1024" /></a></p>
<p>The manager of this location showed zero sympathy that my three year old just bit into a chicken bone and said we have to fill out an incident report.  Notice the form is folded in half.  The manager gave my wife Jenn the form folded in half and said to fill out our name and phone number.  He will fill out the remainder of the form.  He also said this isn&#8217;t the first time this has happened, and that McDonalds will just recall the batch of chicken that our bone filled McNugget came from.</p>
<p><a href="http://ericfickes.com/wp-content/uploads/2011/03/nugget-bone3.jpg" rel="lightbox[2110]"><img class="aligncenter size-full wp-image-2115" title="nugget-bone3" src="http://ericfickes.com/wp-content/uploads/2011/03/nugget-bone3.jpg" alt="Jenn filling out the McDonalds incident report for finding a chicken bone in a Chicken McNugget" width="765" height="1024" /></a></p>
<p>Something else I&#8217;d like to point out is McDonalds says on their website their chicken McNuggets are boneless.</p>
<p><a href="http://ericfickes.com/wp-content/uploads/2011/03/mcdonalds-lie.png" rel="lightbox[2110]"><img class="aligncenter size-full wp-image-2116" title="mcdonalds-lie" src="http://ericfickes.com/wp-content/uploads/2011/03/mcdonalds-lie.png" alt="McDonalds lies about their Chicken McNuggets being boneless. My son bit into a chicken bone in a Chicken McNugget 2 hours ago, they are not boneless" width="978" height="639" /></a></p>
<p><span style="font-size: small;"><span style="line-height: 24px;">While <em>most</em> chicken McNuggets are <em>probably</em> boneless, I consider this a straight up lie.  How can big corporations like McDonalds get away with bold face lies and nobody does anything about it?  In the past I didn&#8217;t care because I knew their food was shit, so I didn&#8217;t eat there ( even though I <em>did</em> grow up on McDonalds ).  Now that I&#8217;m a parent, my wife and I are no match for the marketing power of McDonalds, their toys, and their Playplaces.</span></span></p>
<p><span style="font-size: small;"><span style="line-height: 24px;">So, that&#8217;s all I know to do right now, make some noise.  McDonalds will continue selling their mostly boneless chicken McNuggets and silencing anybody who finds the golden nuggets with bones.</span></span></p>
<p><span style="font-size: small;"><span style="line-height: 24px;"><a href="http://ericfickes.com/wp-content/uploads/2011/03/nugget-quarter1.jpg" rel="lightbox[2110]"><img class="aligncenter size-large wp-image-2125" title="nugget-quarter" src="http://ericfickes.com/wp-content/uploads/2011/03/nugget-quarter1-764x1024.jpg" alt="" width="640" height="857" /></a><a href="http://ericfickes.com/wp-content/uploads/2011/03/nugget-ruler.jpg" rel="lightbox[2110]"><img class="aligncenter size-large wp-image-2126" title="nugget-ruler" src="http://ericfickes.com/wp-content/uploads/2011/03/nugget-ruler-764x1024.jpg" alt="" width="640" height="857" /></a><br />
</span></span></p>
<p><span style="font-size: small;"><span style="line-height: 24px;">If you think I&#8217;m crazy, you can ask <a title="McDonalds chicken mcnuggets are NOT boneless" href="http://www.google.com/search?sourceid=chrome&amp;ie=UTF-8&amp;q=bone+in+chicken+mcnugget" target="_blank">Google about bones in Chicken McNuggets</a>.  If you&#8217;re into Facebook, there is a group you can join called <a title="Join the Facebook group " href="http://www.facebook.com/group.php?gid=44270496418" target="_blank">Mc Donalds chicken nuggets DO contain bones!!</a></span></span></p>
]]></content:encoded>
			<wfw:commentRss>http://ericfickes.com/2011/03/mcdonalds-chicken-nuggets-are-not-boneless/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Use INFORMATION_SCHEMA to find data about your database</title>
		<link>http://ericfickes.com/2011/02/find-out-data-about-your-database-with-system-views/</link>
		<comments>http://ericfickes.com/2011/02/find-out-data-about-your-database-with-system-views/#comments</comments>
		<pubDate>Mon, 21 Feb 2011 21:29:23 +0000</pubDate>
		<dc:creator>Eric Fickes</dc:creator>
				<category><![CDATA[database]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[internets]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[automation]]></category>
		<category><![CDATA[data discovery]]></category>
		<category><![CDATA[db2]]></category>
		<category><![CDATA[information_schema]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[oracle]]></category>
		<category><![CDATA[rdmbs]]></category>
		<category><![CDATA[schemata]]></category>
		<category><![CDATA[sql server]]></category>
		<category><![CDATA[sql-92]]></category>
		<category><![CDATA[SQLSERVER]]></category>
		<category><![CDATA[system tables]]></category>
		<category><![CDATA[system views]]></category>
		<category><![CDATA[tsql]]></category>

		<guid isPermaLink="false">http://ericfickes.com/?p=2062</guid>
		<description><![CDATA[Have you ever been in this situation?  You&#8217;re the new developer for a database powered application and you have to figure out what tables contain a specific column?  Or maybe you&#8217;ve got a legacy database that needs it&#8217;s stored procedures &#8230; <a href="http://ericfickes.com/2011/02/find-out-data-about-your-database-with-system-views/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Have you ever been in this situation?  You&#8217;re the new developer for a database powered application and you have to figure out what tables contain a specific column?  Or maybe you&#8217;ve got a legacy database that needs it&#8217;s stored procedures and user defined functions cleaned up?  Or perhaps you&#8217;ve been assigned a unique database inventory task that requires you to report on the structure of your database, rather than the contents of your database.  Besides cracking open your favorite SQL editor and clicking through your database by hand, you might find the data you need from your database&#8217;s INFORMATION_SCHEMA System View.</p>
<p>All of the RDMS systems I&#8217;ve worked with have built in System Views ( or tables ) that contain data about the structure and contents of your database.  These views are there to help you with non data tasks.  For the sake of this post we&#8217;re only going mention the INFORMATION_SCHEMA, which is the system view I use most in SQL Server, and MySQL.  For your reference, here are links to INFORMATION_SCHEMA docs for four popular RDMS systems.</p>
<ol>
<li>SQL Server &#8211; <a title="SQL Server INFORMATION_SCHEMA" href="http://msdn.microsoft.com/en-us/library/ms186778.aspx" target="_blank">http://msdn.microsoft.com/en-us/library/ms186778.aspx</a></li>
<li>MySQL &#8211; <a title="MySQL INFORMATION_SCHEMA" href="http://dev.mysql.com/doc/refman/5.5/en/information-schema.html" target="_blank">http://dev.mysql.com/doc/refman/5.5/en/information-schema.html</a></li>
<li>Oracle &#8211; <a title="Oracle INFORMATION_SCHEMA" href="http://download.oracle.com/docs/cd/E17952_01/refman-5.0-en/information-schema.html" target="_blank">http://download.oracle.com/docs/cd/E17952_01/refman-5.0-en/information-schema.html</a></li>
<li>DB2 &#8211; <a title="DB2 INFORMATION_SCHEMA" href="http://www.tar.hu/sqlbible/sqlbible0100.html" target="_blank">http://www.tar.hu/sqlbible/sqlbible0100.html</a></li>
</ol>
<p>If you work with SQL Server, you&#8217;ll be happy to know you can see all of the System Views in Management Studio by default.</p>
<div id="attachment_2065" class="wp-caption aligncenter" style="width: 419px"><a href="http://ericfickes.com/wp-content/uploads/2011/02/AdventureWorks-SystemViews.png" rel="lightbox[2062]"><img class="size-full wp-image-2065" title="AdventureWorks-SystemViews" src="http://ericfickes.com/wp-content/uploads/2011/02/AdventureWorks-SystemViews.png" alt="SQL Server Management Studio shows all System Views" width="409" height="461" /></a><p class="wp-caption-text">System Views in the AdventureWorks database</p></div>
<p>If you work with MySQL, you can see the INFORMATION_SCHEMA database in MySQL Workbench, but you&#8217;ll have to enable it in Preferences first.</p>
<div id="attachment_2066" class="wp-caption aligncenter" style="width: 610px"><a href="http://ericfickes.com/wp-content/uploads/2011/02/mysql-ShowMetadataSchemata.png" rel="lightbox[2062]"><img class="size-medium wp-image-2066   " title="mysql-ShowMetadataSchemata" src="http://ericfickes.com/wp-content/uploads/2011/02/mysql-ShowMetadataSchemata-300x146.png" alt="" width="600" height="293" /></a><p class="wp-caption-text">Edit &gt; Preferences &gt; SQL Editor &gt; Check &#39;Show Metadata Schemata&#39;</p></div>
<p>Now for the MySQL users, turning on the Metadata Schemata is <em>not</em> required in order to query those system tables.  Assuming your user has appropriate permissions, you can always fire up Workbench and fire a query like this.</p>
<pre class="brush: sql; title: ; notranslate">
SELECT *
FROM INFORMATION_SCHEMA.Columns
WHERE Column_Name LIKE '%user%'
</pre>
<div id="attachment_2069" class="wp-caption aligncenter" style="width: 432px"><a href="http://ericfickes.com/wp-content/uploads/2011/02/mysql-has-info-schemas.png" rel="lightbox[2062]"><img class="size-full wp-image-2069" title="mysql-has-info-schemas" src="http://ericfickes.com/wp-content/uploads/2011/02/mysql-has-info-schemas.png" alt="" width="422" height="469" /></a><p class="wp-caption-text">MySQL has INFORMATION_SCHEMA tables too!</p></div>
<p>Now that you know about INFORMATION_SCHEMA, you should be happy to know this is part of the SQL-92 standard.  Which means whatever sql scripts you write in MySQL, will most likely work with SQL Server as well.  So go ahead and start querying your database, you&#8217;ll probably find uses for the INFORMATION_SCHEMA in your daily life really quickly.</p>
<p>I&#8217;m going to assume you&#8217;ve got the general idea here, so here are a few sql scripts that I&#8217;ve used over the years.  The first three are informational queries, and the last three are stored procedures that generate .NET or Coldfusion code based off of a table name.</p>
<p><strong>Find all tables with the column EmployeeID</strong></p>
<pre class="brush: sql; title: ; notranslate">
SELECT	*
FROM	INFORMATION_SCHEMA.COLUMNS
WHERE	COLUMN_NAME LIKE 'EmployeeID'
</pre>
<div id="attachment_2072" class="wp-caption aligncenter" style="width: 478px"><a href="http://ericfickes.com/wp-content/uploads/2011/02/1-which-tables-contain-columnName.png" rel="lightbox[2062]"><img class="size-full wp-image-2072" title="1-which-tables-contain-columnName" src="http://ericfickes.com/wp-content/uploads/2011/02/1-which-tables-contain-columnName.png" alt="" width="468" height="236" /></a><p class="wp-caption-text">Which tables have an EmployeeID column?</p></div>
<p><strong>How many tables have the word employee in the name</strong></p>
<pre class="brush: sql; title: ; notranslate">
SELECT	*
FROM	INFORMATION_SCHEMA.TABLES
WHERE	LOWER(TABLE_NAME) LIKE '%employee%'
</pre>
<div id="attachment_2073" class="wp-caption aligncenter" style="width: 483px"><a href="http://ericfickes.com/wp-content/uploads/2011/02/2-which-tables-are-named.png" rel="lightbox[2062]"><img class="size-full wp-image-2073" title="2-which-tables-are-named" src="http://ericfickes.com/wp-content/uploads/2011/02/2-which-tables-are-named.png" alt="" width="473" height="183" /></a><p class="wp-caption-text">How many %employee% tables are in the DB?</p></div>
<p><strong>How many SPROCs and UDFs does our database contain?</strong></p>
<pre class="brush: sql; title: ; notranslate">
SELECT	s.SPROCs, f.UDFs
FROM
(
	SELECT	COUNT(ROUTINE_NAME) AS 'SPROCs', NULL AS 'UDFs'
	FROM	INFORMATION_SCHEMA.ROUTINES
	WHERE	ROUTINE_TYPE = 'PROCEDURE'
) AS s,
(
	SELECT	NULL AS 'SPROCs', COUNT(ROUTINE_NAME) AS 'UDFs'
	FROM	INFORMATION_SCHEMA.ROUTINES
	WHERE	ROUTINE_TYPE = 'FUNCTION'
) AS f
</pre>
<div id="attachment_2076" class="wp-caption aligncenter" style="width: 159px"><a href="http://ericfickes.com/wp-content/uploads/2011/02/3-how-many-sprocs-udfs.png" rel="lightbox[2062]"><img class="size-full wp-image-2076" title="3-how-many-sprocs-udfs" src="http://ericfickes.com/wp-content/uploads/2011/02/3-how-many-sprocs-udfs.png" alt="" width="149" height="65" /></a><p class="wp-caption-text">How many stored procedures and user defined functions are in the DB?</p></div>
<p>The stored procedures listed below all accept an incoming table name, then reads data from INFORMATION_SCHEMA to generate code for the specified database table.  Instead of listing the raw SQL, I&#8217;m just showing a sample result and allowing you to download the raw SQL sprocs.</p>
<p><strong>Generate C# ADO.NET to VO Stored Procedure</strong></p>
<div id="attachment_2077" class="wp-caption aligncenter" style="width: 583px"><a href="http://ericfickes.com/wp-content/uploads/2011/02/4-create-sproc-generateGetTableCode.png" rel="lightbox[2062]"><img class="size-full wp-image-2077" title="4-create-sproc-generateGetTableCode" src="http://ericfickes.com/wp-content/uploads/2011/02/4-create-sproc-generateGetTableCode.png" alt="" width="573" height="458" /></a><p class="wp-caption-text">Build custom C# ADO.NET to custom VO fillerup code</p></div>
<p><a title="Download 'Generate C# ADO.NET to VO' Stored Procedure" href="http://ericfickes.com/code/INFO_SCHEMA/DotNet-generateGetTableCode.sql" target="_blank">download stored procedure</a></p>
<p><a title="Download 'Generate C# ADO.NET to VO' Stored Procedure" href="http://ericfickes.com/code/INFO_SCHEMA/DotNet-generateGetTableCode.sql" target="_blank"></a><br />
<strong>Generate .NET VO class Stored Procedure</strong></p>
<p><a href="http://ericfickes.com/wp-content/uploads/2011/02/5-create-sproc-generateTableVoClass.png" rel="lightbox[2062]"><img class="aligncenter size-full wp-image-2078" title="5-create-sproc-generateTableVoClass" src="http://ericfickes.com/wp-content/uploads/2011/02/5-create-sproc-generateTableVoClass.png" alt="Generate C# VO class for DB table name" width="315" height="454" /></a></p>
<p><a title="Download 'Generate .NET VO class' stored procedure" href="http://ericfickes.com/code/INFO_SCHEMA/DotNet-generateTableVoClass.sql" target="_blank">download stored procedure</a></p>
<p><strong>Generate Coldfusion CFFunction with CFQUERY Stored Procedure</strong></p>
<div id="attachment_2079" class="wp-caption aligncenter" style="width: 502px"><a href="http://ericfickes.com/wp-content/uploads/2011/02/6-create-sproc-MakeSelectFromDbTable.png" rel="lightbox[2062]"><img class="size-full wp-image-2079" title="6-create-sproc-MakeSelectFromDbTable" src="http://ericfickes.com/wp-content/uploads/2011/02/6-create-sproc-MakeSelectFromDbTable.png" alt="" width="492" height="276" /></a><p class="wp-caption-text">Generate Coldfusion CFFunction with CFQUERY for specified table name</p></div>
<p><a title="Download 'Generate Coldfusion CFFunction with CFQUERY' stored procedure" href="http://ericfickes.com/code/INFO_SCHEMA/Coldfusion-MakeSelectFromDbTable.sql" target="_blank">download stored procedure</a></p>
<p>I use these System Views almost daily, and there are a lot of scenarios where my job would take a lot longer to do if I didn&#8217;t know about this information.  The INFORMATION_SCHEMA also feeds my passion to build code that makes code, just love it.  Hopefully this nickel tour was enough information to help somebody out.</p>
]]></content:encoded>
			<wfw:commentRss>http://ericfickes.com/2011/02/find-out-data-about-your-database-with-system-views/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
<enclosure url="http://ericfickes.com/code/INFO_SCHEMA/DotNet-generateGetTableCode.sql" length="17232" type="audio/mpeg" />
		</item>
		<item>
		<title>An aggregate may not appear in the set list of an UPDATE statement</title>
		<link>http://ericfickes.com/2011/02/an-aggregate-may-not-appear-in-the-set-list-of-an-update-statement/</link>
		<comments>http://ericfickes.com/2011/02/an-aggregate-may-not-appear-in-the-set-list-of-an-update-statement/#comments</comments>
		<pubDate>Mon, 21 Feb 2011 06:43:00 +0000</pubDate>
		<dc:creator>Eric Fickes</dc:creator>
				<category><![CDATA[database]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[internets]]></category>
		<category><![CDATA[microsoft]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[tips and tricks]]></category>
		<category><![CDATA[tsql]]></category>

		<guid isPermaLink="false">http://ericfickes.com/?p=1998</guid>
		<description><![CDATA[Ever seen the error &#8220;An aggregate may not appear in the set list of an UPDATE statement&#8221; when working with SQL Server?  I ran into this one recently after trying to put a COUNT in an UPDATE statement.  I was rewriting &#8230; <a href="http://ericfickes.com/2011/02/an-aggregate-may-not-appear-in-the-set-list-of-an-update-statement/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Ever seen the error &#8220;An aggregate may not appear in the set list of an UPDATE statement&#8221; when working with SQL Server?  I ran into this one recently after trying to put a COUNT in an UPDATE statement.  I was rewriting some legacy code to use a stored procedure, and it turned out to be the perfect case for a <a title="Read about Temporary Tables on MSDN" href="http://msdn.microsoft.com/en-us/library/ms177399.aspx" target="_blank">Temporary Table</a>.</p>
<p>Instead of boring you with a work scenario, let&#8217;s take a simpler one that uses the <a title="Download Microsoft's AdventureWorks database from this site so you can play along at home" href="http://msftdbprodsamples.codeplex.com/releases/view/37109" target="_blank">AdventureWorks</a> database.  This example will create a list of sales people, total order count for each person, and store this list a single table variable to be used as the final data table.</p>
<p>Should be three simple steps right?</p>
<h2>1. Create @Table variable</h2>
<pre class="brush: sql; title: ; notranslate">
DECLARE @SalesPeople TABLE
(
  EmployeeID int NOT NULL,
  SalesPersonID int NOT NULL,
  FullName varchar(200) NOT NULL,
  Title varchar(200) NOT NULL,
  sales_count int NULL default 0
)
</pre>
<h2>2. INSERT sales people into @Table</h2>
<pre class="brush: sql; title: ; notranslate">
-- HACKISH : Match SalesPersonID to EmployeeID, and fill @SalesPeople
INSERT INTO @SalesPeople
( EmployeeID, SalesPersonID, FullName, Title )
SELECT	e.EmployeeID, sp.SalesPersonID,
		c.FirstName + ' ' + c.LastName as FullName,
		e.Title
FROM	Sales.SalesPerson sp,
		HumanResources.Employee e,
		Person.Contact c
WHERE	sp.SalesPersonID = e.EmployeeID
AND		e.ContactID = c.ContactID
</pre>
<h2>3. UPDATE @Table with COUNT</h2>
<pre class="brush: sql; title: ; notranslate">
UPDATE	@SalesPeople
SET
	sales_count = COUNT( soh.SalesOrderID )
FROM	@SalesPeople sp, Sales.SalesOrderHeader soh
WHERE EXISTS (
	SELECT DISTINCT SalesPersonID FROM @SalesPeople WHERE SalesPersonID = soh.SalesPersonID
)
AND	sp.SalesPersonID = soh.SalesPersonID
</pre>
<div id="attachment_2004" class="wp-caption alignnone" style="width: 775px"><a style="font-weight: normal;" href="http://ericfickes.com/wp-content/uploads/2011/02/aggregate-error.png" rel="lightbox[1998]"><img title="aggregate-error" src="http://ericfickes.com/wp-content/uploads/2011/02/aggregate-error.png" alt="" width="765" height="187" /></a><p class="wp-caption-text">Not COUNT allowed in an UPDATE SET statement</p></div>
<p>The third step is where the original error comes in, so let&#8217;s update this to four steps and see how a Table Variable gets through this.</p>
<h2>1 &amp; 2 &#8211; Repeat from above</h2>
<h2>3. Create Table Variable of order counts</h2>
<pre class="brush: sql; title: ; notranslate">
SELECT	soh.SalesPersonID, COUNT( soh.SalesOrderID ) AS sales_count
INTO	#SalesOrderCounts
FROM	Sales.SalesOrderHeader soh
WHERE EXISTS (
	SELECT DISTINCT SalesPersonID FROM @SalesPeople WHERE SalesPersonID = soh.SalesPersonID
)
GROUP BY soh.SalesPersonID
</pre>
<h2>4. Update @Table with order counts</h2>
<pre class="brush: sql; title: ; notranslate">
UPDATE	@SalesPeople
SET		sales_count = tmp.sales_count
FROM	@SalesPeople sp, #SalesOrderCounts tmp
WHERE	sp.SalesPersonID = tmp.SalesPersonID
</pre>
<p>And here&#8217;s the full script from start to finish with the table variable in use.</p>
<pre class="brush: sql; title: ; notranslate">
-- Master table of sales people
DECLARE @SalesPeople TABLE
(
  EmployeeID int NOT NULL,
  SalesPersonID int NOT NULL,
  FullName varchar(200) NOT NULL,
  Title varchar(200) NOT NULL,
  sales_count int NULL default 0
)

-- Match SalesPersonID to EmployeeID, and fill @SalesPeople
INSERT INTO @SalesPeople
( EmployeeID, SalesPersonID, FullName, Title )
SELECT	e.EmployeeID, sp.SalesPersonID,
		c.FirstName + ' ' + c.LastName as FullName,
		e.Title
FROM	Sales.SalesPerson sp, HumanResources.Employee e, Person.Contact c
WHERE	sp.SalesPersonID = e.EmployeeID
AND		e.ContactID = c.ContactID

-- put sales counts into the other kind of #tableVariable
SELECT	soh.SalesPersonID, COUNT( soh.SalesOrderID ) AS sales_count
INTO	#SalesOrderCounts
FROM	Sales.SalesOrderHeader soh
WHERE EXISTS (
	SELECT DISTINCT SalesPersonID FROM @SalesPeople WHERE SalesPersonID = soh.SalesPersonID
)
GROUP BY soh.SalesPersonID

-- Update our master @table with data from #tableVariable
UPDATE	@SalesPeople
SET		sales_count = tmp.sales_count
FROM	@SalesPeople sp, #SalesOrderCounts tmp
WHERE	sp.SalesPersonID = tmp.SalesPersonID

-- dump the results
SELECT	FullName, Title, sales_count
FROM	@SalesPeople

-- cleanup
drop table #SalesOrderCounts
</pre>
]]></content:encoded>
			<wfw:commentRss>http://ericfickes.com/2011/02/an-aggregate-may-not-appear-in-the-set-list-of-an-update-statement/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Eleven Coldfusion-ish tips from the field</title>
		<link>http://ericfickes.com/2011/02/eleven-coldfusion-ish-tips-from-the-field/</link>
		<comments>http://ericfickes.com/2011/02/eleven-coldfusion-ish-tips-from-the-field/#comments</comments>
		<pubDate>Sun, 20 Feb 2011 08:34:49 +0000</pubDate>
		<dc:creator>Eric Fickes</dc:creator>
				<category><![CDATA[adobe]]></category>
		<category><![CDATA[coldfusion]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[tips and tricks]]></category>
		<category><![CDATA[asc]]></category>
		<category><![CDATA[cfml]]></category>
		<category><![CDATA[cfscript]]></category>
		<category><![CDATA[chr]]></category>
		<category><![CDATA[list]]></category>
		<category><![CDATA[listcontains]]></category>
		<category><![CDATA[listfind]]></category>
		<category><![CDATA[listhasvalue]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[parameterized query]]></category>
		<category><![CDATA[special character]]></category>
		<category><![CDATA[sproc]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[stored procedure]]></category>

		<guid isPermaLink="false">http://ericfickes.com/?p=1965</guid>
		<description><![CDATA[I&#8217;ve had this running list of Coldfusion tips on my wall for the last few years and it&#8217;s time to get these online.  All of the items in this list came from Coldfusion projects over the last few years, but &#8230; <a href="http://ericfickes.com/2011/02/eleven-coldfusion-ish-tips-from-the-field/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve had this running list of Coldfusion tips on my wall for the last few years and it&#8217;s time to get these online.  All of the items in this list came from Coldfusion projects over the last few years, but a good portion of these could easily be considered tips for server programmers.  I definitely run into the same items when programming Asp.NET.</p>
<p>There is no rhyme or reason here, just some things I felt need to be repeated.</p>
<h2>1. <a href="http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=functions_m-r_14.html" target="_blank">PreserveSingleQuotes</a>()</h2>
<p>This one came in really handy on a project requiring large text files to be imported into a MySQL database.  I used Coldfusion to upload and read the files into large INSERT chunks using <a href="http://dev.mysql.com/doc/refman/5.5/en/insert.html" target="_blank">MySQL&#8217;s multi &#8211; row INSERT syntax</a>. Code built the VALUES portion of the SQL, then I just fed the data into a function for insertion.</p>
<pre class="brush: sql; title: ; notranslate">
INSERT INTO tbl_name (a,b,c) VALUES(1,2,3),(4,5,6),(7,8,9);
</pre>
<pre class="brush: coldfusion; title: ; notranslate">
	&lt;cfquery name=&quot;insert_data&quot; result=&quot;insert_result&quot; DATASOURCE=&quot;#request.dsn#&quot; USERNAME=&quot;#request.dbuser#&quot; PASSWORD=&quot;#request.dbpswd#&quot;&gt;
	INSERT INTO table
	( column1, column2, column3, column4, column5, column6, column7 )
	VALUES
	#PreserveSingleQuotes( insert_values )#
	&lt;/cfquery&gt;
</pre>
<h2>2. What if GENERATED_KEY doesn&#8217;t work?</h2>
<p>If you&#8217;re using MySQL and the GENERATED_KEY property of your cfquery objects isn&#8217;t populating, you can use <a href="http://dev.mysql.com/doc/refman/5.5/en/information-functions.html#function_last-insert-id" target="_blank">LAST_INSERT_ID</a> instead.</p>
<pre class="brush: sql; title: ; notranslate">SELECT LAST_INSERT_ID();</pre>
<h2>3. Use ArrayAppend when building strings</h2>
<p>Classic performance tuning tip for just about any programming language.  Here I&#8217;ll give a Coldfusion example and keep it dead simple.  If you ever have to concatenate strings in code, user ArrayAppend instead.  Here are two loops that do the same thing.  If you run this code, you should notice loop1 takes forever, and loop2 is smoking fast.</p>
<p><strong>slow&#8230;..</strong></p>
<pre class="brush: coldfusion; title: ; notranslate">
&lt;cfscript&gt;
xx				= 100000;
insertString	= &quot;&quot;;

// do the loop
while( xx &gt; 0 ) {
	insertString &amp;= xx &amp; &quot; &quot;;
	xx--;
}

WriteOutput( insertString);
&lt;/cfscript&gt;
</pre>
<p><strong>FAST!</strong></p>
<pre class="brush: coldfusion; title: ; notranslate">
&lt;cfscript&gt;
xx				= 1000000;
insertArray		= ArrayNew(1);
// do the loop
while( xx &gt; 0 ) {
	ArrayAppend( insertArray, xx &amp; &quot; &quot; );
	xx--;
}

WriteOutput( ArrayToList( insertArray, &quot; &quot; ) );
ArrayClear( insertArray );
&lt;/cfscript&gt;
</pre>
<h2>4. If CSV, then CHR</h2>
<p>This one is simple, if you find yourself creating CSV or any other text file, use special characters when dealing with single and double quotes, etc.</p>
<ul>
<li>chr(9) = Tab</li>
<li>chr(34) = &#8221; double quote</li>
<li>chr(39) = &#8216; single quote</li>
</ul>
<p>And if you&#8217;re not sure of the correct code for the character you&#8217;re looking to use, just wrap that character in <a href="http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=functions_a-b_25.html" target="_blank">ASC()</a> and <a href="http://help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec22c24-7ecf.html" target="_blank">WriteOutput</a> to the page.</p>
<h2>5. Use CFMail with GMail</h2>
<p>This is a no brainer, but with how difficult sending email can be with <em><a title="I love .NET, but it's a pain in the butt sometimes" href="http://www.google.com/search?sourceid=chrome&amp;ie=UTF-8&amp;q=send+email+with+ASP.NET" target="_blank">other languages</a></em>, I&#8217;m mentioning it here.</p>
<p><strong>Application.cfc</strong></p>
<pre class="brush: coldfusion; title: ; notranslate">
&lt;cfscript&gt;
	APPLICATION.mail.server		= &quot;smtp.gmail.com&quot;;
	APPLICATION.mail.port		= &quot;465&quot;;
	APPLICATION.mail.ssl		= true;
	APPLICATION.mail.user		= &quot;gmailAccount&quot;;
	APPLICATION.mail.pswd		= &quot;gmailPasssword&quot;;
&lt;/cfscript&gt;
</pre>
<p><strong>Emailer.cfm</strong></p>
<pre class="brush: coldfusion; title: ; notranslate">
&lt;cfmail to=&quot;work@ericfickes.com&quot;
		bcc=&quot;&quot;
		from=&quot;web@master.com&quot;
		subject=&quot;sending mail is easy with Coldfusion&quot;
		server=&quot;#application.mail.server#&quot;
		useSSL=&quot;#application.mail.ssl#&quot;
		port=&quot;#application.mail.port#&quot;
		username=&quot;#application.mail.user#&quot;
		password=&quot;#application.mail.pswd#&quot;&gt;
#emailBody#
&lt;/cfmail&gt;
</pre>
<h2>6. CFSCRIPT doesn&#8217;t know NULL?</h2>
<p>Another tip from the land of importing and exporting data.  While working with query objects in CFScript, for some reason I could never accurately detect for NULL values.  I tried all sorts of detection schemes and ended up just writing a hacky fail safe.  Please, if you have a better suggestion for *easy* NULL detection in CFSCript, add it in the comments below.</p>
<p><strong>utils.cfc</strong></p>
<pre class="brush: coldfusion; title: ; notranslate">
&lt;!---  Simple value getter with try / catch to get around NULL values
This function originated in a script where we always needed a &quot; &quot; even if
the value from the database was null.
---&gt;
&lt;cffunction name=&quot;qryGetString&quot; access=&quot;public&quot; returntype=&quot;string&quot;&gt;

&lt;cfargument name=&quot;data&quot; type=&quot;string&quot;&gt;

&lt;cftry&gt;
	&lt;cfscript&gt;
	return #data# &amp; &quot; &quot;;
	&lt;/cfscript&gt;

	&lt;cfcatch type=&quot;Any&quot;&gt;
		&lt;cfreturn &quot; &quot;/&gt;
	&lt;/cfcatch&gt;
&lt;/cftry&gt;

&lt;/cffunction&gt;
</pre>
<p><strong>Exporter.cfm</strong></p>
<pre class="brush: coldfusion; title: ; notranslate">
// largeish loop
tab = chr(9);
for( xx = 1; xx &lt;= queryObj.RecordCount; xx++ )
{
	// start the row
	this_row = 	utils_cfc.qryGetString( queryObj.FirstName[xx] ) &amp; tab &amp;
			utils_cfc.qryGetString( queryObj.MiddleName[xx] ) &amp; tab &amp;
			utils_cfc.qryGetString( queryObj.LastName[xx] ) &amp; tab &amp;
			utils_cfc.qryGetString( queryObj.Suffix[xx] ) &amp; tab &amp;
			utils_cfc.qryGetString( queryObj.MedicalTitle[xx] ) &amp; tab &amp;
			utils_cfc.qryGetString( queryObj.email[xx] ) &amp; tab &amp;
			utils_cfc.qryGetString( queryObj.practice_phone[xx] ) &amp; tab &amp;
			utils_cfc.qryGetString( queryObj.practice_fax[xx] ) &amp; tab &amp;
			utils_cfc.qryGetString( queryObj.practice_name[xx] ) &amp; tab &amp;
			utils_cfc.qryGetString( queryObj.practice_address1[xx] ) &amp; tab &amp;
			utils_cfc.qryGetString( queryObj.practice_address2[xx] ) &amp; tab &amp;
			utils_cfc.qryGetString( queryObj.practice_city[xx] ) &amp; tab &amp;
			utils_cfc.qryGetString( queryObj.practice_state[xx] ) &amp; tab &amp;
			utils_cfc.qryGetString( queryObj.practice_zipcode[xx] ) &amp; tab &amp;
			utils_cfc.qryGetString( queryObj.hospital_affiliation[xx] ) &amp; tab;

	// do stuff with the data
}
</pre>
<h2>7. How I find list items</h2>
<h2><span style="font-size: 16px; color: #444444; line-height: 24px;">Ever notice the different behavior in the Coldfusion ListFind commands?  I ended up writing my own ListHasValue function in order to find exact pattern matching in a list.  I had a list of role ids in a list, and just couldn&#8217;t get the built in functions to tell me when my id was in the list without also matching on other ids.  This one makes sense when you run some code.</span></h2>
<p>The top of this sample as my custom ListHasValue() command, and the lower half does three simple loops counting from 1 to 100, and using ListFind, ListContains, and ListHasValue for number checking against the same list.</p>
<pre class="brush: coldfusion; title: ; notranslate">
&lt;!---
	Use this to do an exact pattern check for a value in a list.
	This is useful inside of a loop checking numbers against a number list.

	EX :

	list = &quot;91, 92&quot;

	if you loop from 1 - 100, ListFind and related CF functions will match
	on 1, 2, and 9.  Not just 91 and 92

	Use this when you're looping and you ONLY want to match on 91, or 92

---&gt;
&lt;cffunction name=&quot;ListHasValue&quot; access=&quot;public&quot; returntype=&quot;boolean&quot;&gt;

	&lt;cfargument name=&quot;list&quot; required=&quot;yes&quot; type=&quot;string&quot;&gt;
	&lt;cfargument name=&quot;value&quot; required=&quot;yes&quot; type=&quot;any&quot;&gt;

	&lt;cfscript&gt;
		// clean up to be safe
		list = trim( toString( list ) );

		// check to see if we have a *possible* match
		position = ListContains( list, value ) ;

		if( position &gt; 0 )
		{
			// NOTE : KEEP THE TRIM AND TOSTRING
			found_value = trim( toString( ListGetAt( list, position ) ) );

			if( Compare( value, found_value ) == 0 )
			{
				return true;
			}
		}

		// no match for you!
		return false;
	&lt;/cfscript&gt;

&lt;/cffunction&gt;

&lt;cfscript&gt;
list	= &quot;1, 11, 21, 31, 41, 51, 61, 71, 81, 91, 99&quot;;
xx		= 1;

WriteOutput( &quot;List = &quot; &amp; list &amp; &quot;&lt;hr&gt;&quot;);

while( xx &lt; 100 ) {
	if( ListContains( list, xx ) &gt; 0 )
	{
		WriteOutput( &quot;ListContains found &quot; &amp; xx &amp; &quot;&lt;br&gt;&quot; );
	}
    xx++;
}

WriteOutput(&quot;&lt;hr /&gt;&quot;);

xx = 1;
while( xx &lt; 100 ) {
	// ListFind
	if( ListFind( list, xx ) &gt; 0 )
	{
		WriteOutput( &quot;ListFind found &quot; &amp; xx &amp; &quot;&lt;br&gt;&quot; );
	}
    xx++;
}

WriteOutput(&quot;&lt;hr /&gt;&quot;);

xx = 1;
while( xx &lt; 100 ) {
    // Eric's ListHasValue
	if( ListHasValue( list, xx ) )
	{
		WriteOutput( &quot;ListHasValue found &quot; &amp; xx &amp; &quot;&lt;br&gt;&quot; );
	}
	xx++;
}
&lt;/cfscript&gt;
</pre>
<p>If you run this code on your Coldfusion server, you should notice the following results.  ListContains matches single digits from the loop that do not really exist in the list.  ListFind only finds the number 1?  And finally, my function does exactly what I needed it to do.  Tell me when a specific number exists in a list.</p>
<div id="attachment_1980" class="wp-caption alignnone" style="width: 240px"><a href="http://ericfickes.com/wp-content/uploads/2011/02/cf-list-find1.png" rel="lightbox[1965]"><img class="size-full wp-image-1980" title="cf-list-find" src="http://ericfickes.com/wp-content/uploads/2011/02/cf-list-find1.png" alt="CF ListFind function comparison" width="230" height="559" /></a><p class="wp-caption-text">Coldfusion ListFind functions don&#39;t always behave how I want them to</p></div>
<p><span style="font-size: 16px; color: #444444; line-height: 24px;"><br />
</span></p>
<h2>8. Make PDFs faster</h2>
<p>This could easily be it&#8217;s own topic, but I&#8217;ll say one thing about making PDFs faster with CFDocument.  Only put final content between &lt;cfdocument&gt; and &lt;/cfdocument&gt;.  That is, if you have any processing code, cfqueries, cfloops, inside of your cfdocument tag, your cfml page is running slower than it needs to be.  Here&#8217;s a simple example of one of my cfml pages that has only final content in the cfdocument tags.</p>
<p>The key to this example is moving all of my content creation code into an external file, then including at the top of my page. I always do a check for my main PDF_BODY variable, and then spit out my PDF document.</p>
<pre class="brush: coldfusion; title: ; notranslate">
&lt;cfinclude template=&quot;code/export_pdf_codefile.cfm&quot;&gt;

&lt;cfif PDF_BODY NEQ &quot;&quot;&gt;

    &lt;cfdocument	name=&quot;provider_profile&quot;
                format=&quot;PDF&quot;
                pagetype=&quot;A4&quot;
                mimetype=&quot;application/pdf&quot;
                orientation=&quot;portrait&quot;
                margintop=&quot;0&quot;
                marginbottom=&quot;0.2&quot;
                marginleft=&quot;0.2&quot;
                marginright=&quot;0.2&quot;
                &gt;
        &lt;cfoutput&gt;#PDF_BODY#&lt;/cfoutput&gt;
    &lt;/cfdocument&gt;

    &lt;!--- send directly to client ---&gt;
    &lt;cfheader name=&quot;Content-Disposition&quot; value=&quot;attachment; filename=#filename#&quot;&gt;
    &lt;cfcontent type=&quot;application/pdf&quot; variable=&quot;#provider_profile#&quot;&gt;

&lt;cfelse&gt;
	No PDF content found
&lt;/cfif&gt;
</pre>
<h2>9. Use parameterized queries</h2>
<p>This is a tip for all server side programmers whether you use Coldfusion, ASP, JSP, PBJ.  Use parameterized queries when doing any database interaction.  It&#8217;s too easy not to use, and you get protection from SQL Injection, as well as enforcing proper data types when speaking to your database.  This is something all server programmers should do regardless of your language, the sample below is for Coldfusion.</p>
<p><strong>BAD</strong></p>
<pre class="brush: coldfusion; title: ; notranslate">
&lt;cfquery name=&quot;tblInsert&quot; datasource=&quot;myDb&quot;&gt;
INSERT INTO	myTable
( col1, col2, col3, col4 )
VALUES
( '#Form.field1#', '#Form.field2#', '#Form.field3#' )
&lt;/cfquery&gt;
</pre>
<p><strong>GOOD</strong></p>
<pre class="brush: coldfusion; title: ; notranslate">
&lt;cfset val1 = Form.field1&gt;
&lt;cfset val2 = Form.field1&gt;
&lt;cfset val3 = Form.field1&gt;

&lt;cfquery name=&quot;tblInsert&quot; datasource=&quot;myDb&quot;&gt;
INSERT INTO	myTable
( col1, col2, col3, col4 )
VALUES
(
    &lt;cfqueryparam cfsqltype=&quot;cf_sql_varchar&quot; value=&quot;#val1#&quot; /&gt;,
    &lt;cfqueryparam cfsqltype=&quot;cf_sql_varchar&quot; value=&quot;#val2#&quot; /&gt;,
    &lt;cfqueryparam cfsqltype=&quot;cf_sql_varchar&quot; value=&quot;#val3#&quot; /&gt;
)
&lt;/cfquery&gt;
</pre>
<h2>10. Where&#8217;d the time go?</h2>
<p>For the good programmers already using parameterized queries, ever insert a timestamp into your database and find out the date is correct, but the time is always 12:00:00?  Take a closer look at the cfsqltype in your cfqueryparam, I had this exact problem and here&#8217;s what happened.</p>
<p>Using <strong>cf_sql_date does</strong> not include the full date and timestamp, just the date.</p>
<pre class="brush: coldfusion; title: ; notranslate">
&lt;cfqueryparam cfsqltype=&quot;cf_sql_date&quot; value=&quot;#paymentDate#&quot; /&gt;
</pre>
<p>&nbsp;</p>
<p>Using <strong>cf_sql_timestamp</strong> includes the full date and timestamp I was looking for.</p>
<pre class="brush: coldfusion; title: ; notranslate">
&lt;cfqueryparam cfsqltype=&quot;cf_sql_timestamp&quot; value=&quot;#paymentDate#&quot; /&gt;
</pre>
<h2>11. Stored Procedures are a little different</h2>
<p>This last one isn&#8217;t much of a tip, but more of a reminder to myself.  I do so much database work that stored procedures are just queries to me, but not so to Coldfusion and the CFQuery tag.  If you want to get data from a stored procedure, you need to use the <a href="http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=Tags_r-s_22.html" target="_blank">CFStoredproc</a> tag.  Here&#8217;s a sample of passing one argument into a stored procedure, and how to get the resulting data.</p>
<pre class="brush: coldfusion; title: ; notranslate">
&lt;cfstoredproc	datasource=&quot;myDb&quot; procedure=&quot;GetDataFaster&quot;&gt;

	&lt;cfprocparam type=&quot;in&quot; cfsqltype=&quot;cf_sql_integer&quot; value=&quot;#inputVar#&quot; /&gt;

	&lt;!--- specify sproc result here, cfstoredproc res != returned recordset ---&gt;
	&lt;cfprocresult name = sprocResult&gt;

&lt;/cfstoredproc&gt;

&lt;cfreturn #sprocResult.ColumnFromQuery#&gt;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://ericfickes.com/2011/02/eleven-coldfusion-ish-tips-from-the-field/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Injecting javascript into asp.net via code</title>
		<link>http://ericfickes.com/2011/02/injecting-javascript-into-asp-net-via-code/</link>
		<comments>http://ericfickes.com/2011/02/injecting-javascript-into-asp-net-via-code/#comments</comments>
		<pubDate>Sat, 19 Feb 2011 04:13:50 +0000</pubDate>
		<dc:creator>Eric Fickes</dc:creator>
				<category><![CDATA[.net]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[microsoft]]></category>
		<category><![CDATA[tips and tricks]]></category>
		<category><![CDATA[asp.net]]></category>
		<category><![CDATA[aspx]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[js]]></category>
		<category><![CDATA[Literal]]></category>
		<category><![CDATA[msdn]]></category>
		<category><![CDATA[postback]]></category>

		<guid isPermaLink="false">http://ericfickes.com/?p=1903</guid>
		<description><![CDATA[Microsoft has a great MSDN article on using javascript along asp.net, but they didn&#8217;t mention a technique I like to use, put it in a Literal control.  While there are many ways to add javascript to a page, I find &#8230; <a href="http://ericfickes.com/2011/02/injecting-javascript-into-asp-net-via-code/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Microsoft has a great MSDN article on <a title="Several other techniques for using javascript with asp.net" href="http://msdn.microsoft.com/en-us/library/aa479011.aspx" target="_blank">using javascript along asp.net</a>, but they didn&#8217;t mention a technique I like to use, put it in a <a title="ASP.NET Literal Class" href="http://msdn.microsoft.com/en-us/library/f0aw4d5w.aspx" target="_blank">Literal</a> control.  While there are many ways to add javascript to a page, I find putting the javascript in a literal much less stressful.  Using a Literal control placeholder is also a good way to add messaging to a page after postback, but we&#8217;re just going to look at adding javascript.</p>
<p>Let&#8217;s take a simple example.  Say you&#8217;ve got a comment form that you want to auto close, or reload after the form was posted.  Below is a simple single file style asp.net page with a simple javascript function that reloads this page.</p>
<pre class="brush: csharp; title: ; notranslate">
&lt;%@ Page Language=&quot;C#&quot; %&gt;

&lt;script runat=&quot;server&quot;&gt;
/// &lt;summary&gt;
/// &lt;/summary&gt;
/// &lt;param name=&quot;sender&quot;&gt;&lt;/param&gt;
/// &lt;param name=&quot;e&quot;&gt;&lt;/param&gt;
protected void Page_Load(object sender, EventArgs e)
{
    if (!IsPostBack)
    {

    }
}

///////////////////////////////////////////////////////////////////////////////
/// Do stuff with the form data, then refresh page using javascript
protected void submitComments(object sender, EventArgs e)
{

    try
    {
	//
	// do stuff here
	//

	// set javascript timer to reload page afer 3 seconds
	js_target.Text = &quot;setTimeout('reload()', 3000);&quot;;

    }
    catch (Exception exc)
    {
        Response.Write( &quot;ERROR : &quot; + exc.Message );
    }
}
&lt;/script&gt;

&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;

&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; &gt;
&lt;head&gt;
	&lt;title&gt;Comments&lt;/title&gt;
	&lt;script type=&quot;text/javascript&quot;&gt;
	// page reload helper
	function reload() {
		document.location.replace( document.location );
	}
	&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;

&lt;form id=&quot;form1&quot; runat=&quot;server&quot; method=&quot;post&quot;&gt;

&lt;script type=&quot;text/javascript&quot;&gt;&lt;asp:Literal runat=&quot;server&quot; id=&quot;js_target&quot; /&gt;&lt;/script&gt;

	Comments
	&lt;asp:TextBox runat=&quot;server&quot; ID=&quot;comment_box&quot; Width=&quot;200&quot; /&gt;
	&lt;br&gt;&lt;br&gt;

	Your name
	&lt;asp:TextBox runat=&quot;server&quot; ID=&quot;fullname&quot; Width=&quot;200&quot; /&gt;
	&lt;br&gt;&lt;br&gt;
	&lt;asp:Button runat=&quot;server&quot; ID=&quot;submit_btn&quot; onclick=&quot;submitComment&quot; Text=&quot;submit&quot; /&gt;

&lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<p>If you look just under the form tag you&#8217;ll see the key to this technique, an asp literal wrapped by an open and close script tag.</p>
<pre class="brush: jscript; title: ; notranslate">
&lt;script type=&quot;text/javascript&quot;&gt;&lt;asp:Literal runat=&quot;server&quot; id=&quot;js_target&quot; /&gt;&lt;/script&gt;
</pre>
<p>When you load your page and view the source you&#8217;ll just see an empty script tag, so it shouldn&#8217;t interfere with the execution or rendering of your page.</p>
<p>The last part of this technique is simple, in your server code just set your Literal control&#8217;s .Text value to your javascript code.  In this case when I post my comment form, after handling the input data I display a thank you message, then set some javascript to reload the page.</p>
<pre class="brush: csharp; title: ; notranslate">
ltl_js.Text = &quot;setTimeout('reload()', 3000);&quot;;
</pre>
<p>That&#8217;s all there is to it.  Drop a literal in an empty script block and BAM!, you have an easy way to add javascript to your asp.net page.</p>
]]></content:encoded>
			<wfw:commentRss>http://ericfickes.com/2011/02/injecting-javascript-into-asp-net-via-code/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

