<?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>Josh Highland &#187; Tech</title>
	<atom:link href="http://joshhighland.com/blog/category/tech/feed/" rel="self" type="application/rss+xml" />
	<link>http://joshhighland.com/blog</link>
	<description>the living internet</description>
	<lastBuildDate>Fri, 20 Jan 2012 18:48:38 +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>Too cool for iTunes Match</title>
		<link>http://joshhighland.com/blog/2012/01/20/too-cool-for-itunes-match/</link>
		<comments>http://joshhighland.com/blog/2012/01/20/too-cool-for-itunes-match/#comments</comments>
		<pubDate>Fri, 20 Jan 2012 18:48:38 +0000</pubDate>
		<dc:creator>Josh Highland</dc:creator>
				<category><![CDATA[mac]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[iTunes]]></category>
		<category><![CDATA[match]]></category>

		<guid isPermaLink="false">http://joshhighland.com/blog/?p=14760</guid>
		<description><![CDATA[I would gladly pay more than $20 a year to have full access to my 150+ gig library of music. Until then, I guess I&#8217;m not allowed to play]]></description>
			<content:encoded><![CDATA[<p></p><p><img class="size-full wp-image-14761 alignnone" title="Too cool for iTunes Match" src="http://joshhighland.com.s3.amazonaws.com/blog/wp-content/uploads/2012/01/Screen-Shot-2012-01-09-at-1.35.27-PM.png" alt="Screen Shot 2012 01 09 at 1.35.27 PM Too cool for iTunes Match" width="581" height="257" /></p>
<p>I would gladly pay more than $20 a year to have full access to my 150+ gig library of music. Until then, I guess I&#8217;m not allowed to play <img src='http://joshhighland.com.s3.amazonaws.com/blog/wp-includes/images/smilies/icon_sad.gif' alt="icon sad Too cool for iTunes Match" class='wp-smiley' title="Too cool for iTunes Match" /> </p>
]]></content:encoded>
			<wfw:commentRss>http://joshhighland.com/blog/2012/01/20/too-cool-for-itunes-match/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Non-abstract method Foo::bar() must contain body</title>
		<link>http://joshhighland.com/blog/2011/12/01/non-abstract-method-foobar-must-contain-body/</link>
		<comments>http://joshhighland.com/blog/2011/12/01/non-abstract-method-foobar-must-contain-body/#comments</comments>
		<pubDate>Fri, 02 Dec 2011 04:00:48 +0000</pubDate>
		<dc:creator>Josh Highland</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[error code]]></category>

		<guid isPermaLink="false">http://joshhighland.com/blog/?p=14731</guid>
		<description><![CDATA[I was working on one of my PHP based projects, and I was getting the following error: Non-abstract method Foo::bar() must contain body in Foo.php on line 10 The problem was that I had accidentally put a semicolon at the end of the first line of the function: WRONG WAY: class Foo &#123; function bar&#40;&#41;; [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>I was working on one of my PHP based projects, and I was getting the following error:</p>
<blockquote><p>Non-abstract method Foo::bar() must contain body in Foo.php on line 10</p></blockquote>
<p>The problem was that I had accidentally put a semicolon at the end of the first line of the function:</p>
<p>WRONG WAY:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">class</span> Foo 
<span style="color: #009900;">&#123;</span> 
    <span style="color: #000000; font-weight: bold;">function</span> bar<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// extra semicolon! </span>
    <span style="color: #009900;">&#123;</span> 
        <span style="color: #666666; font-style: italic;">// stuff </span>
    <span style="color: #009900;">&#125;</span> 
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>RIGHT WAY:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">class</span> Foo 
<span style="color: #009900;">&#123;</span> 
    <span style="color: #000000; font-weight: bold;">function</span> bar<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>    <span style="color: #666666; font-style: italic;">// no semicolon, yay </span>
    <span style="color: #009900;">&#123;</span> 
        <span style="color: #666666; font-style: italic;">// stuff </span>
    <span style="color: #009900;">&#125;</span> 
<span style="color: #009900;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://joshhighland.com/blog/2011/12/01/non-abstract-method-foobar-must-contain-body/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Why I&#8217;m pre-ordering the iPhone 4S</title>
		<link>http://joshhighland.com/blog/2011/10/06/why-im-pre-ordering-the-iphone-4s/</link>
		<comments>http://joshhighland.com/blog/2011/10/06/why-im-pre-ordering-the-iphone-4s/#comments</comments>
		<pubDate>Fri, 07 Oct 2011 01:20:37 +0000</pubDate>
		<dc:creator>Josh Highland</dc:creator>
				<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Josh's Rambling]]></category>
		<category><![CDATA[Tech]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[ios 5]]></category>
		<category><![CDATA[iphone 4s]]></category>
		<category><![CDATA[steve jobs]]></category>

		<guid isPermaLink="false">http://joshhighland.com/blog/?p=14699</guid>
		<description><![CDATA[Am I ordering the new iPhone 4S? As my tattoo says, &#8220;oh hellz yeah!&#8221; I&#8217;m excited about the iPhone 4S and I&#8217;m going to pre-order it. I&#8217;ve heard a lot of people complain about the 4s, about how &#8220;It&#8217;s nothing new&#8221;, and &#8220;It&#8217;s basically the same as the iPhone 4&#8243;. Here are the things that [...]]]></description>
			<content:encoded><![CDATA[<p></p><p><img class="size-full wp-image-14700 alignright" title="Why Im pre ordering the iPhone 4S" src="http://joshhighland.com.s3.amazonaws.com/blog/wp-content/uploads/2011/10/iphone4s.jpg" alt="iphone4s Why Im pre ordering the iPhone 4S" width="291" height="414" />Am I ordering the new iPhone 4S? As <a href="http://joshhighland.com/blog/2008/07/31/homeward-bound-oh-hellz-yeah/">my tattoo says</a>, &#8220;oh hellz yeah!&#8221;</p>
<p>I&#8217;m excited about the iPhone 4S and I&#8217;m going to pre-order it. I&#8217;ve heard a lot of people complain about the 4s, about how &#8220;It&#8217;s nothing new&#8221;, and &#8220;It&#8217;s basically the same as the iPhone 4&#8243;.</p>
<p>Here are the things that make the iPhone 4S different from the iPhone 4</p>
<ul>
<li>2x the data speed</li>
<li>2x the CPU (A5 processor)</li>
<li>7x the graphics speed</li>
<li>8mp camera</li>
<li>5 element lens</li>
<li>Larger camera CMOS</li>
<li>1080p HD video with image stabilization</li>
<li>Longer batter life</li>
<li>Bluetooth 4.0</li>
<li>Supports GSM &amp; CDMA (Use it on ANY carrier)</li>
<li>Siri voice control</li>
<li>Improved antennas</li>
</ul>
<p>So yeah I guess besides those things, the iPhone 4s is just like the iPhone 4&#8230;</p>
<p>I love my iPhone, ive loved them all. I&#8217;ve owned every generation produced. With each release, the iPhone gets better, and becomes a larger part of my life. I use my phone a lot. It&#8217;s a mobile computer thats always with me. As an app developer, I can basically do anything I want with it.</p>
<p>When I ask people who are disapointed in the 4s, what they were hoping to see, the most common responce I get it, &#8220;I wanted it to be shaped different.&#8221; Shaped different! What? OK, I agree it would be cool to have a different sized iPhone, or a slightly different shape, but if I had to choose between better speed and an updated look, I&#8217;m going to pick the improved speed 10 times out of 10&#8230; I actally USE my phone.</p>
<p>I think more people would have been excited about the iPhone 4s if it looked noticabley different from an iPhone 4. I really think that most people care more about the status of the iPhone and the look of it rather then the utility and freedom it provides. If the iPhone 4S had a different style back, like metal instead of glass, I feel that more people would be impressed with it. There is nothing stylish about owning an iPhone 4S. The 4S update is about the &#8220;S&#8221;, speed.</p>
<p>Personally, I like to think that the 4S means &#8220;For Steve Jobs&#8221;. The world has lost a great visionary. Without him we wouldnt be arguing about iPhones. RIP.</p>
]]></content:encoded>
			<wfw:commentRss>http://joshhighland.com/blog/2011/10/06/why-im-pre-ordering-the-iphone-4s/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>I Don&#8217;t Always Test My Code&#8230;</title>
		<link>http://joshhighland.com/blog/2011/09/12/i-dont-always-test-my-code/</link>
		<comments>http://joshhighland.com/blog/2011/09/12/i-dont-always-test-my-code/#comments</comments>
		<pubDate>Mon, 12 Sep 2011 15:13:00 +0000</pubDate>
		<dc:creator>Josh Highland</dc:creator>
				<category><![CDATA[funny]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[test]]></category>

		<guid isPermaLink="false">http://joshhighland.com/blog/?p=14691</guid>
		<description><![CDATA[If you have ever worked in a mulch-tiered web environment, you know how funny and true this is. &#160; &#160;]]></description>
			<content:encoded><![CDATA[<p></p><p>If you have ever worked in a mulch-tiered web environment, you know how funny and true this is.</p>
<p><img class="alignleft size-full wp-image-14692" title="I Dont Always Test My Code..." src="http://joshhighland.com.s3.amazonaws.com/blog/wp-content/uploads/2011/09/i-dont-always-test-my-code-but-when-i-do-i-do-it-in-production.jpg" alt="i dont always test my code but when i do i do it in production I Dont Always Test My Code..." width="550" height="690" /></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://joshhighland.com/blog/2011/09/12/i-dont-always-test-my-code/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hey OS X Lion, did you eat my Library folder?</title>
		<link>http://joshhighland.com/blog/2011/08/09/hey-os-x-lion-did-you-eat-my-library-folder/</link>
		<comments>http://joshhighland.com/blog/2011/08/09/hey-os-x-lion-did-you-eat-my-library-folder/#comments</comments>
		<pubDate>Wed, 10 Aug 2011 03:23:15 +0000</pubDate>
		<dc:creator>Josh Highland</dc:creator>
				<category><![CDATA[mac]]></category>
		<category><![CDATA[tutorials]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[Lion]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[terminal]]></category>

		<guid isPermaLink="false">http://joshhighland.com/blog/?p=14676</guid>
		<description><![CDATA[Mac OS X Lion (10.7), introduced a bunch of new features to the Mac platform. At the same time it&#8217;s taken away some things that experienced Mac users are used to. The idea was to remove things that the average user doesn&#8217;t need. If your like me, you might have yelled &#8220;Hey! Where is the [...]]]></description>
			<content:encoded><![CDATA[<p></p><p><img class="alignleft size-full wp-image-14677" title="Hey OS X Lion, did you eat my Library folder?" src="http://joshhighland.com.s3.amazonaws.com/blog/wp-content/uploads/2011/08/mac-lion.png" alt="mac lion Hey OS X Lion, did you eat my Library folder?" width="306" height="236" /></p>
<p>Mac OS X Lion (10.7), introduced a bunch of new features to the Mac platform. At the same time it&#8217;s taken away some things that experienced Mac users are used to. The idea was to remove things that the average user doesn&#8217;t need.</p>
<p>If your like me, you might have yelled &#8220;Hey! Where is the Library folder in OS X Lion?&#8221;, when trying to access data from the iPhone simulator.</p>
<p>After doing some research, I found that the folder was not gone, it had simply been hidden. Running the following command from the terminal, I was able to make my Library folder visible once again.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">chflags nohidden ~<span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span></pre></div></div>

<p>You may also need to restart finder by using this command</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">killall</span> Finder <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> open <span style="color: #000000; font-weight: bold;">/</span>System<span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>CoreServices<span style="color: #000000; font-weight: bold;">/</span>Finder.app</pre></div></div>

<p>If for some strange reason you want to go back to being a n00b and hide the Library folder again, you can use the following command</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">chflags hidden ~<span style="color: #000000; font-weight: bold;">/</span>Library</pre></div></div>

<p><img class="alignleft size-full wp-image-14678" title="Hey OS X Lion, did you eat my Library folder?" src="http://joshhighland.com.s3.amazonaws.com/blog/wp-content/uploads/2011/08/OSx-Lion-Library-Directory.jpg" alt="OSx Lion Library Directory Hey OS X Lion, did you eat my Library folder?" width="580" height="184" /></p>
]]></content:encoded>
			<wfw:commentRss>http://joshhighland.com/blog/2011/08/09/hey-os-x-lion-did-you-eat-my-library-folder/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Mac: Rename all files names in a directory to lower case</title>
		<link>http://joshhighland.com/blog/2011/07/14/rename-all-files-names-in-a-directory-to-lower-case/</link>
		<comments>http://joshhighland.com/blog/2011/07/14/rename-all-files-names-in-a-directory-to-lower-case/#comments</comments>
		<pubDate>Fri, 15 Jul 2011 02:58:22 +0000</pubDate>
		<dc:creator>Josh Highland</dc:creator>
				<category><![CDATA[mac]]></category>
		<category><![CDATA[tutorials]]></category>
		<category><![CDATA[command line]]></category>
		<category><![CDATA[lowercase]]></category>
		<category><![CDATA[terminal]]></category>
		<category><![CDATA[tolower]]></category>

		<guid isPermaLink="false">http://joshhighland.com/blog/?p=14671</guid>
		<description><![CDATA[Just like my last post, I was working with a directory of about 1000 files. There was all sorts of problems with the way they were named. Anyone whos used a *nix type system will know that &#8220;.jpg&#8221;, &#8220;.Jpg&#8221;, &#8220;.JPG&#8221; are all very separate things. To solve the issue I was having I needed to [...]]]></description>
			<content:encoded><![CDATA[<p></p><p><img class="alignleft size-full wp-image-14665" title="Mac: Rename all files names in a directory to lower case" src="http://joshhighland.com.s3.amazonaws.com/blog/wp-content/uploads/2011/07/Terminal-Logo-100x100.png" alt="Terminal Logo 100x100 Mac: Rename all files names in a directory to lower case" width="100" height="100" />Just like my last post, I was working with a directory of about 1000 files. There was all sorts of problems with the way they were named. Anyone whos used a *nix type system will know that &#8220;.jpg&#8221;, &#8220;.Jpg&#8221;, &#8220;.JPG&#8221; are all very separate things. To solve the issue I was having I needed to rename all of the files in the directory to lowercase.</p>
<p>I fired up my friend the Mac terminal and ran the following command:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">for</span> i <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000; font-weight: bold;">*</span>; <span style="color: #000000; font-weight: bold;">do</span> <span style="color: #c20cb9; font-weight: bold;">mv</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$i</span>&quot;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$(echo $i|tr A-Z a-z)</span>&quot;</span>; <span style="color: #000000; font-weight: bold;">done</span></pre></div></div>

<p>The code loops through each of the files in the current directory and renames it to the lowercase equivalent. fast, simple, elegant. Major time saver.</p>
]]></content:encoded>
			<wfw:commentRss>http://joshhighland.com/blog/2011/07/14/rename-all-files-names-in-a-directory-to-lower-case/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Mac: Converting a directory of images into JPG files</title>
		<link>http://joshhighland.com/blog/2011/07/13/mac-converting-a-direcotry-of-images-into-jpg-files/</link>
		<comments>http://joshhighland.com/blog/2011/07/13/mac-converting-a-direcotry-of-images-into-jpg-files/#comments</comments>
		<pubDate>Wed, 13 Jul 2011 07:20:49 +0000</pubDate>
		<dc:creator>Josh Highland</dc:creator>
				<category><![CDATA[mac]]></category>
		<category><![CDATA[tutorials]]></category>
		<category><![CDATA[command line]]></category>
		<category><![CDATA[file conversion]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[terminal]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://joshhighland.com/blog/?p=14664</guid>
		<description><![CDATA[Recently I was presented with a problem where I had a directory of about 1000 graphic files of mixed formats (png, gif, bmp, jpg), and I needed to convert them all to jpg files. I tried various solutions but I ended using the following command in my Mac&#8217;s terminal. mkdir jpegs; sips -s format jpeg [...]]]></description>
			<content:encoded><![CDATA[<p></p><p><img class="alignleft size-full wp-image-14665" title="Mac: Converting a directory of images into JPG files" src="http://joshhighland.com.s3.amazonaws.com/blog/wp-content/uploads/2011/07/Terminal-Logo-100x100.png" alt="Terminal Logo 100x100 Mac: Converting a directory of images into JPG files" width="100" height="100" /></p>
<p>Recently I was presented with a problem where I had a directory of about 1000 graphic files of mixed formats (png, gif, bmp, jpg), and I needed to convert them all to jpg files.</p>
<p>I tried various solutions but I ended using the following command in my Mac&#8217;s terminal.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">mkdir</span> jpegs; sips <span style="color: #660033;">-s</span> format jpeg <span style="color: #000000; font-weight: bold;">*</span>.<span style="color: #000000; font-weight: bold;">*</span> <span style="color: #660033;">--out</span> jpgs</pre></div></div>

<p>This command creates directory called &#8220;jpgs&#8221;, and converts all of the files in the current directory into .jpg format, and moves them into the newly created &#8220;jpgs&#8221; direcotry.</p>
<p>It truly saved the day.</p>
]]></content:encoded>
			<wfw:commentRss>http://joshhighland.com/blog/2011/07/13/mac-converting-a-direcotry-of-images-into-jpg-files/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dude I&#8217;m speaking at WordCamp OC!</title>
		<link>http://joshhighland.com/blog/2011/04/13/dude-im-speaking-at-wordcamp-oc/</link>
		<comments>http://joshhighland.com/blog/2011/04/13/dude-im-speaking-at-wordcamp-oc/#comments</comments>
		<pubDate>Thu, 14 Apr 2011 05:44:55 +0000</pubDate>
		<dc:creator>Josh Highland</dc:creator>
				<category><![CDATA[wordpress]]></category>
		<category><![CDATA[presentation]]></category>
		<category><![CDATA[WCOC]]></category>
		<category><![CDATA[WordCampOC]]></category>

		<guid isPermaLink="false">http://joshhighland.com/blog/?p=14650</guid>
		<description><![CDATA[That&#8217;s right, I&#8217;m speaking at the 2011 Orange County WordCamp, May 14th. What is a WordCamp? WordCamp is a conference that focuses on everything WordPress. WordCamps are informal, community-organized events that are put together by WordPress users. Everyone from casual users to core developers participate, share ideas, and get to know each other. I&#8217;m going [...]]]></description>
			<content:encoded><![CDATA[<p></p><p><img class="alignleft size-full wp-image-14651" title="Dude Im speaking at WordCamp OC!" src="http://joshhighland.com.s3.amazonaws.com/blog/wp-content/uploads/2011/04/wcoc-250-2_0002_Speaking.png" alt="wcoc 250 2 0002 Speaking Dude Im speaking at WordCamp OC!" width="250" height="250" />That&#8217;s right, I&#8217;m speaking at the <a href="http://2011.oc.wordcamp.org/">2011 Orange County WordCamp</a>, May 14th.</p>
<p>What is a WordCamp? WordCamp is a conference that focuses on everything WordPress. WordCamps are informal, community-organized events that are put together by WordPress users. Everyone from casual users to core developers participate, share ideas, and get to know each other.</p>
<p>I&#8217;m going to be presenting the topic, <em>&#8220;Optimizing WordPress: Speed Matters&#8221;</em></p>
<p>By itself, WordPress is fast  and snappy application but over time your site may become sluggish and  laggy. A slow site is not good for your readers, or your search engine  rankings. In a one hour presentation, I&#8217;m going to show some practical ways to optimize your WordPress sites content and  configuration. The presentation will cover best practices, helpful  plugins and real life optimization examples.</p>
<p>I&#8217;m excited to check out the other topics that are being presented. The OC WordCamp has three distinct tracks of sessions, beginners, advanced, and business minded users.</p>
<p>If you&#8217;re free on May 14th 2011 and love WordPress, you should come and hang out with some fellow WordPress users. <a href="http://2011.oc.wordcamp.org">http://2011.oc.wordcamp.org</a></p>
]]></content:encoded>
			<wfw:commentRss>http://joshhighland.com/blog/2011/04/13/dude-im-speaking-at-wordcamp-oc/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Letting the database to the heavy lifting: Capitalization via SQL</title>
		<link>http://joshhighland.com/blog/2011/02/12/letting-the-database-to-the-heavy-lifting-capitalization-via-sql/</link>
		<comments>http://joshhighland.com/blog/2011/02/12/letting-the-database-to-the-heavy-lifting-capitalization-via-sql/#comments</comments>
		<pubDate>Sun, 13 Feb 2011 07:33:04 +0000</pubDate>
		<dc:creator>Josh Highland</dc:creator>
				<category><![CDATA[coldfusion]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[Capitalization]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[ucfirst]]></category>

		<guid isPermaLink="false">http://joshhighland.com/blog/?p=14626</guid>
		<description><![CDATA[Years ago I had the pleasure of meeting Ben Forta and listen to his thoughts on web development. One thing that stuck with me was his statement that: &#8220;Dynamic programming languages like PHP and Coldfusion are great, but developers need to leverage the database more. Allow the database to do it&#8217;s job, the heavy lifting&#8221; [...]]]></description>
			<content:encoded><![CDATA[<p></p><p><img class="alignleft size-full wp-image-14627" title="Letting the database to the heavy lifting: Capitalization via SQL " src="http://joshhighland.com.s3.amazonaws.com/blog/wp-content/uploads/2011/02/databaseStrength.jpg" alt="databaseStrength Letting the database to the heavy lifting: Capitalization via SQL " width="332" height="318" />Years ago I had the pleasure of meeting <a href="http://en.wikipedia.org/wiki/Ben_Forta">Ben Forta</a> and listen to his  thoughts on web development. One thing that stuck with me was his  statement that:</p>
<blockquote><p><em>&#8220;Dynamic programming languages like PHP and Coldfusion  are great, but developers need to leverage the database more. Allow the  database to do it&#8217;s job, the heavy lifting&#8221;</em></p></blockquote>
<p>With that being said, I was recently working with a database that  contained users first names. The data was not snantized at entry, and  contained a mix of lower cased (ex. josh) and upper cased (ex. Josh)  first characters in the firstname column. I needed to always present the  users first name in a capitalized format.</p>
<p>The first solution that most developers would reach for is  dynamically parsing the users first name, then upper-casing the first character. This works, but in my opinion isn&#8217;t the most elegant solution.</p>
<p>With a simple SQL statement, like the one below, we can return the users first name already in a capitalized state.</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">SELECT</span> <span style="color: #66cc66;">&#40;</span><span style="color: #993333; font-weight: bold;">UPPER</span><span style="color: #66cc66;">&#40;</span><span style="color: #993333; font-weight: bold;">LEFT</span><span style="color: #66cc66;">&#40;</span>firstname<span style="color: #66cc66;">,</span><span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">+</span><span style="color: #993333; font-weight: bold;">SUBSTRING</span><span style="color: #66cc66;">&#40;</span>firstname<span style="color: #66cc66;">,</span><span style="color: #cc66cc;">2</span><span style="color: #66cc66;">,</span>LEN<span style="color: #66cc66;">&#40;</span>firstname<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">AS</span> firstname 
<span style="color: #993333; font-weight: bold;">FROM</span> users</pre></div></div>

<div>It&#8217;s quick to implement, its easy to work with, and it&#8217;s also very fast on the performance scale.</div>
<div></div>
<div>Yes, I understand that there are cool convenience functions in like <a href="http://php.net/manual/en/function.ucfirst.php">ucfirst()</a> in PHP, but I&#8217;m a lazy programmer and I don&#8217;t want to have to remember  to use <a href="http://php.net/manual/en/function.ucfirst.php">ucfirst()</a> every time I&#8217;m dealing with the users name. I&#8217;d rather get  the information in the correct format the first time, then remembering  to groom it every time before I use it. Set it and forget it.</div>
<div></div>
]]></content:encoded>
			<wfw:commentRss>http://joshhighland.com/blog/2011/02/12/letting-the-database-to-the-heavy-lifting-capitalization-via-sql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Detecting Character Encoding In Coldfusion</title>
		<link>http://joshhighland.com/blog/2011/02/03/detecting-character-encoding-in-coldfusion/</link>
		<comments>http://joshhighland.com/blog/2011/02/03/detecting-character-encoding-in-coldfusion/#comments</comments>
		<pubDate>Thu, 03 Feb 2011 08:34:46 +0000</pubDate>
		<dc:creator>Josh Highland</dc:creator>
				<category><![CDATA[coldfusion]]></category>
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://joshhighland.com/blog/?p=14615</guid>
		<description><![CDATA[Most of the time I only work with UTF-8 or UTF-16 character encodings. With that said, recently I was working on an old coldfusion project. Do to database restrictions, required all inputs from the user into the application to be Latin-1 (ISO-8859-1) character encoded. Coldfusion does not have a good way of checking the character [...]]]></description>
			<content:encoded><![CDATA[<p></p><p><img class="alignleft size-full wp-image-14616" title="Detecting Character Encoding In Coldfusion " src="http://joshhighland.com.s3.amazonaws.com/blog/wp-content/uploads/2011/02/cf-and-java.jpg" alt="cf and java Detecting Character Encoding In Coldfusion " width="300" height="162" />Most of the time I only work with <a href="http://en.wikipedia.org/wiki/Utf-8">UTF-8</a> or <a href="http://en.wikipedia.org/wiki/UTF-16/UCS-2">UTF-16</a> character encodings.  With that said, recently I was working on an old coldfusion project. Do  to database restrictions, required all inputs from the user into the  application to be <a href="http://en.wikipedia.org/wiki/Latin-1">Latin-1 (ISO-8859-1)</a> character encoded.</p>
<p>Coldfusion does not have a good way of checking the character encoding of a string, so I had to pull out some of my Java skillz.</p>
<p>Dropping into Java from ColdFusion is a lot easier then it sounds. Check it out</p>

<div class="wp_syntax"><div class="code"><pre class="cfm" style="font-family:monospace;"><span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfscript</span><span style="color: #0000FF;">&gt;</span></span>   
   //use this to test character encoding. We only want Latin-1
    encoder = createObject(&quot;java&quot;, &quot;java.nio.charset.Charset&quot;).forName(&quot;ISO-8859-1&quot;).newEncoder();
&nbsp;
    if(encoder.canEncode(testVar))
    {
        //its Latin-1
    }
    else
    {
        /NOT Latin-1
    }
<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #990000; font-weight: bold;">cfscript</span><span style="color: #0000FF;">&gt;</span></span></pre></div></div>

<p>The Java layer of Coldfusion is very powerful and under utilized by many developers.</p>
<p>If you want to see some true ColdFusion magic, check out the ColdBox Framework, <a href="http://coldboxframework.com/" target="_blank">http://ColdBoxFramework.com</a></p>
]]></content:encoded>
			<wfw:commentRss>http://joshhighland.com/blog/2011/02/03/detecting-character-encoding-in-coldfusion/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic (Feed is rejected)
Page Caching using disk: enhanced
Database Caching 13/68 queries in 0.014 seconds using disk: basic
Object Caching 1144/1261 objects using disk: basic
Content Delivery Network via Amazon Web Services: S3: joshhighland.com.s3.amazonaws.com

Served from: joshhighland.com @ 2012-02-06 22:46:50 -->
