<?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>Chris Cowdery</title>
	<atom:link href="http://www.chriscowdery.com/feed" rel="self" type="application/rss+xml" />
	<link>http://www.chriscowdery.com</link>
	<description>Coding, Design and all things Tech</description>
	<lastBuildDate>Sun, 27 Jun 2010 22:54:40 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Fun with Computer Vision</title>
		<link>http://www.chriscowdery.com/posts/179</link>
		<comments>http://www.chriscowdery.com/posts/179#comments</comments>
		<pubDate>Sun, 27 Jun 2010 22:35:06 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Computer Vision]]></category>

		<guid isPermaLink="false">http://www.chriscowdery.com/?p=179</guid>
		<description><![CDATA[One of my early projects in Computer Vision was a simple Optical Character Recognition (OCR) program. Although this is by no means anything new, it&#8217;s still fun to learn how it works, and I&#8217;m going to share with you a little demo of OCR that you can create yourself!
Your mission, should you choose to accept it: Detect [...]]]></description>
			<content:encoded><![CDATA[<p>One of my early projects in Computer Vision was a simple <a href="http://en.wikipedia.org/wiki/Optical_character_recognition" target="_blank">Optical Character Recognition</a> (OCR) program. Although this is by no means anything new, it&#8217;s still fun to learn how it works, and I&#8217;m going to share with you a little demo of OCR that you can create yourself!</p>
<p>Your mission, should you choose to accept it: <strong>Detect all the letter i&#8217;s on a document!</strong></p>
<p>Couple of things to note:</p>
<ul>
<li>Not all of the letter i&#8217;s will look the same (there will be some blotches of ink that make the letters look a little different)</li>
<li>You won&#8217;t have knowledge of what every single letter i looks like (or ever will look like) in the universe</li>
<li>You won&#8217;t have to recognize handwriting (that&#8217;s another party in and of itself)</li>
</ul>
<p>So let&#8217;s get started! We&#8217;ll be using the following document for our character detection:</p>
<p><a rel="attachment wp-att-180" href="http://www.chriscowdery.com/posts/179/textimage"><img class="aligncenter size-medium wp-image-180" title="TextImage" src="http://www.chriscowdery.com/wp-content/uploads/2010/06/TextImage-590x514.png" alt="" width="590" height="514" /></a></p>
<p>First, we can break the problem down into a bunch of subtasks, namely:</p>
<div id="_mcePaste">
<ol>
<li>Manipulating the data to make a solution easier for the program to visualize.</li>
<li>Cropping the image to the area of interest (getting rid of the image and handwriting above).</li>
<li>Finding and extracting ‘templates’, regions of the image which contain the ‘i’s we’re looking for.</li>
<li>Determining the locations of each row of text.</li>
<li>Correlating the template of the i character with each possible character.</li>
<li>Determining thresholds for each of the templates (the &#8216;bouncer&#8217; which determines if a character is really an i or not).</li>
<li>Displaying the results with the rectangles around each i.</li>
</ol>
</div>
<p>So let&#8217;s get started! I&#8217;ll be using <a href="http://www.mathworks.com/products/matlab/" target="_blank">MATLAB</a> and the <a href="http://www.mathworks.com/products/image/" target="_blank">Image Processing Toolbox</a> for my implementation in this post, but I&#8217;ll also attach a script which accomplishes the same results using Python.</p>
<h2>Manipulating the Data</h2>
<p>First things first, we need to read in our image. We&#8217;ll do that as follows:</p>
<blockquote><p>im = imread(&#8216;TextImage.tif&#8217;);<br />
im = im2double(im);</p></blockquote>
<p>This reads in the TextImage.tif image as a grayscale image,  and assigns each pixel to an intensity between 0 and 1 inclusive. However, we&#8217;re not quite done yet. By convention, data of interest is represented as white (all 1&#8217;s), and data which isn&#8217;t of interest being black (all 0&#8217;s) &#8211; so we&#8217;ll want to invert our image to show that the black text we just read in is of interest (e.g. white) we&#8217;ll do that as follows:</p>
<blockquote><p>im = imadjust(im, [0 1],[1 0]);</p></blockquote>
<div>This effectively says &#8220;Hey, what&#8217;s black is white, and what&#8217;s white is black!&#8221;. Pretty concise and nifty.</div>
<div>But wait! We&#8217;re not quite done yet. We need to do some <strong>thresholding</strong> of the data which we have so far. This process defines a &#8216;cut off&#8217; in that anything that is above (or equal to) the value we specify is scaled automatically to its maximum value, and anything below it is scaled automatically to its minimum value. In this case, our pixels will either go to 1 or 0 (as this is the range of our data). We&#8217;re doing this step to eliminate the paper grain, noise, and other image artifacts that aren&#8217;t of interest.</div>
<div>Thresholding values are usually determined after some experimentation and some number fiddling, but I found a good threshold for this document was <strong>0.05</strong>. We can apply it like so:</div>
<blockquote>
<div>THRESHOLD = 0.05;</div>
<div>im = im &gt; THRESHOLD;</div>
</blockquote>
<h2>Cropping the Image</h2>
<p>Although this is not an essential step, and the algorithm which we&#8217;ll be implementing soon will function fine without it, we&#8217;re going to restrict the area which we&#8217;ll be looking at. This helps for visualization in the end, and can be accomplished pretty quickly.</p>
<blockquote><p>im = im(400:end,:);</p></blockquote>
<p>This line of code cuts off everything above 400px, and leaves the rest of our image intact (end MATLAB knows means &#8220;go to the end of the image&#8221;, it&#8217;s not a variable we set earlier).</p>
<h2>Finding Templates</h2>
<p>The next goal we&#8217;ll have is to extract i&#8217;s from the image above that are of interest to us (computer vision junkies call these &#8216;templates&#8217;). I usually open up Adobe Photoshop and manually select areas which are of interest, and copy and paste the pixel coordinates. It&#8217;s important to note that we&#8217;re &#8216;cheating&#8217; on some level as we have a priori knowledge of what our document already looks like &#8211; a luxury which many commercial OCR software systems don&#8217;t often have <img src='http://www.chriscowdery.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>Alas, I&#8217;ve taken some of the dirty work out for you, and found some i&#8217;s which are indicative of i&#8217;s across the entire document. Here&#8217;s my findings:</p>
<blockquote><p>templateOne = im(510:542, 532:551);<br />
templateOne = im2double(templateOne);</p>
<p>templateTwo = im(68:100, 390:409);<br />
templateTwo = im2double(templateTwo);</p>
<p>templateThree = im(266:298, 899:918);<br />
templateThree = im2double(templateThree);</p>
<p>templateFour = im(67:99, 144:163);<br />
templateFour = im2double(templateFour);</p>
<p>templateFive = im(168:200, 875:894);<br />
templateFive = im2double(templateFive);</p></blockquote>
<p>So we now have five templates (patches of the letter i in the image), each template is 19 pixels wide and 32 pixels tall. Now we&#8217;re going to combine all of them into an array for easy access later.</p>
<blockquote><p>templates(:,:,1) = templateOne;<br />
templates(:,:,2) = templateTwo;<br />
templates(:,:,3) = templateThree;<br />
templates(:,:,4) = templateFour;<br />
templates(:,:,5) = templateFive;</p></blockquote>
<p>This creates a three dimensional array. In the first two dimensions, we store the grayscale intensity (again from 0 to 1 inclusive) of the templates we found. Each index in the third dimension represents another template (The colon (:) operator in MATLAB is shorthand for &#8220;include everything&#8221;). So imagine a cardboard box stacked with a bunch of sheets of paper of the letter i on them, roughly speaking.</p>
<h2>Finding the rows of text</h2>
<p>Here&#8217;s some fun debauchery. We need to detect where each row of text  begins so that we know where we can match our templates to, and this can be accomplished fairly quickly.</p>
<p>First, what we need to do is rotate the image 90 degrees (put it on its side), and add up the pixel values in each <em>column. </em>Note that now that the image is rotated 90 degrees, what used to be <em>rows are now columns</em>. We&#8217;re rotating the image 90 degrees as it plays nicer with MATLAB&#8217;s sum function (only adds up columns). We&#8217;ll then be storing this in an array called spaces.</p>
<blockquote><p>spaces = sum(im&#8217;);</p></blockquote>
<p>Next, we need to determine (another) threshold, the intensity of what each row of text should be when summed up. If the sum of each row doesn&#8217;t match a threshold, there probably isn&#8217;t text there, so it&#8217;s not the beginning of a row. We can threshold the row sums by doing the following:</p>
<blockquote><p>ROW_SPACE_THRESHOLD = 10;<br />
spaces = spaces &gt; (ROW_SPACE_THRESHOLD);</p></blockquote>
<p>Now let&#8217;s detect <em>where</em> changes occur by taking the derivative of spaces. This highlights where values changed from 0 to 1 and vice versa. Begins stores where each row begins (derivative is 1), and ends stores where each row ends (derivative is -1).</p>
<blockquote><p>spaceDerivative = diff(spaces);<br />
begins = find(spaceDerivative == 1);<br />
ends = find(spaceDerivative == -1);</p></blockquote>
<h2>Correlating the template</h2>
<p>Before we sink our teeth into the meat of the OCR, we first need to define thresholds for each character template we found. Roughly speaking, this is the amount of &#8217;slack&#8217; we&#8217;ll give to each character we find. If it&#8217;s within this &#8217;slack&#8217; region, the program will think the character we found is an i, otherwise it won&#8217;t be. This is useful as we&#8217;ll never know what every single i looks like (and even if we did, that algorithm would be extremely inefficient), so this defines a level of tolerance in how much a character we are analyzing can deviate from our templates of the letter i to actually be considered the letter i. We&#8217;ll be definining these using integer constants determined by experimentation.</p>
<blockquote><p>MAX_FILTERED_I_VALUES = [ 145, 147, 147, 170, 150 ];</p></blockquote>
<p>Each index of the MAX_FILTERED_I_VALUES corresponds to the tolerance for each template (e.g. the first number corresponds to the first template, and so on). The meaning and purpose of these templates will be explored in greater detail very soon.</p>
<p>Now! This is where the fun starts. First we&#8217;re going to want to iterate through each row we found. We can do that like so:</p>
<blockquote><p>for i = 1 : (min([length(begins) length(ends)])),</p></blockquote>
<p>Next we&#8217;re going to want to extract each row, and then shortly thereafter each character from each row.  We can get the current row this way:</p>
<blockquote><p>currentRow = im(begins(i):ends(i),:);</p></blockquote>
<p>This says, &#8220;hey for this particular row number (index), we only care about pixels from whatever you found from the beginning to the end&#8221;. Now we need to find the spaces in between the characters:</p>
<blockquote><p>row_spaces = sum(currentRow);<br />
row_spaces = row_spaces &gt; 0.8;<br />
row_diff = diff(row_spaces);</p>
<p>charBegin = find(row_diff == 1);<br />
charEnd = find(row_diff == -1);</p></blockquote>
<p>This is a similar approach to what we did before, in that we&#8217;re taking this row of text we found, checking to see if it matches a threshold (which I found by experimentation for you) in each column to see if there&#8217;s actually text there, and then taking the derivative of that threshold to see where each character begins and ends.</p>
<p>Now let&#8217;s loop through each character we found:</p>
<blockquote><p>for j = 1 : min([length(charEnd) length(charBegin)]),</p></blockquote>
<p>Let&#8217;s get things set up for processing:</p>
<blockquote><p>currentChar = currentRow(:,charBegin(j):charEnd(j));<br />
currentChar = im2double(currentChar);</p>
<p>possibleMach = 0;</p></blockquote>
<p>In the above code, we&#8217;re segmenting the character from the image and converting its intensity to a double (why we&#8217;re doing this will be explained soon). We&#8217;re also creating a flag called possibleMatch to determine if we&#8217;ve actually found something that is likely to be an i.</p>
<p>Now for each character we found, iterate through the templates we extracted earlier to see if there&#8217;s a match. Enjoy your <a href="http://en.wikipedia.org/wiki/Big_O_notation" target="_blank">O(n^3) efficiency</a> <img src='http://www.chriscowdery.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> . We can iterate through each template this way (again, this is MATLAB shorthand for: every item in templates, take whatever&#8217;s in the third dimension &#8211; which is where we stored the index of our templates).</p>
<blockquote><p>for k = 1 : length(templates(1,1,:)),</p></blockquote>
<p>And we can correlate our above character with the template this way:</p>
<blockquote><p>filtered = abs(imfilter(currentChar,templates(:,:,k),&#8217;corr&#8217;));<br />
possibleMach = max(filtered(:)) &gt; MAX_FILTERED_I_VALUES(k);</p></blockquote>
<p>This is where the magic happens! Let&#8217;s break apart what we&#8217;re doing here:</p>
<p>In the first lone of code, we do something called a correlation (specified by the &#8216;corr&#8217; string to MATLAB). The correlation operation multiplies each pixel in the neighborhood by the corresponding pixel in the template. The output values (in a Cartesian x,y plane) are a sum of the results. The output value will be the highest at points where the template closely matches. If the value is determined to be a possible match by matching a constant threshold (MAX_FILTERED_I_VALUES), then we have a match.</p>
<p>In other words, the  correlation number returned from the imfilter function is (roughly speaking) a score of how closely the character we just found matches a possible template, and if the correlation value we found is greater than the threshold which we set earlier in MAX_FILTERED_I_VALUES, we&#8217;ve got a match!</p>
<h2>Displaying the Results</h2>
<p>The party is over, and now it&#8217;s time to clean up.  So if we&#8217;ve found a possible match, draw a red rectangle around it:</p>
<blockquote><p>if (possibleMach)</p>
<p>% Draw a red box around each character matching</p>
<p>finalRGB(begins(i):ends(i),charBegin(j),1) = 1.0;<br />
finalRGB(begins(i):ends(i),charBegin(j),2) = 0.0;<br />
finalRGB(begins(i):ends(i),charBegin(j),3) = 0.0;</p>
<p>finalRGB(begins(i):ends(i),charEnd(j),1) = 1.0;<br />
finalRGB(begins(i):ends(i),charEnd(j),2) = 0.0;<br />
finalRGB(begins(i):ends(i),charEnd(j),3) = 0.0;</p>
<p>finalRGB(begins(i),charBegin(j):charEnd(j),1) = 1.0;<br />
finalRGB(begins(i),charBegin(j):charEnd(j),2) = 0.0;<br />
finalRGB(begins(i),charBegin(j):charEnd(j),3) = 0.0;</p>
<p>finalRGB(ends(i),charBegin(j):charEnd(j),1) = 1.0;<br />
finalRGB(ends(i),charBegin(j):charEnd(j),2) = 0.0;<br />
finalRGB(ends(i),charBegin(j):charEnd(j),3) = 0.0;</p>
<p>break;<br />
end</p></blockquote>
<p>We draw a red rectangle by setting the red intensity (By MATLAB, 1st index in the third dimension of the image) to be 1 (all the way) and setting green and blue to be zero.</p>
<p><strong>We&#8217;re done! </strong>Our final product now looks like this:</p>
<p><a rel="attachment wp-att-181" href="http://www.chriscowdery.com/posts/179/screen-shot-2010-04-14-at-7-54-49-pm"><img class="aligncenter size-medium wp-image-181" title="Screen shot 2010-04-14 at 7.54.49 PM" src="http://www.chriscowdery.com/wp-content/uploads/2010/06/Screen-shot-2010-04-14-at-7.54.49-PM-590x316.png" alt="" width="590" height="316" /></a></p>
<p><strong>If you&#8217;d like to download the example source code, it can be found here:<br />
<a href="http://chriscowdery.com/download/blog/ocr-fun.zip">http://chriscowdery.com/download/blog/ocr-fun.zip</a></strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.chriscowdery.com/posts/179/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Seekqr</title>
		<link>http://www.chriscowdery.com/posts/173</link>
		<comments>http://www.chriscowdery.com/posts/173#comments</comments>
		<pubDate>Sun, 27 Jun 2010 08:22:26 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.chriscowdery.com/?p=173</guid>
		<description><![CDATA[Seekqr is a year-long project I started with Sean Madden, Sherman Lee and Brian Murphy for an entry into the Student Contest in Software Engineering (SCORE) 2011 competition (specifically the &#8220;QR Marks the Spot&#8221; project division). The project was initially started to showcase usability principles in cross-platform mobile application for the Engineering Methods of Software [...]]]></description>
			<content:encoded><![CDATA[<p>Seekqr is a year-long project I started with Sean Madden, Sherman Lee and Brian Murphy for an entry into the <a href="http://score-contest.org/2011/">Student Contest in Software Engineering (SCORE)</a> 2011 competition (specifically the <a href="http://score-contest.org/2011/Projects.php#cavrakorlic">&#8220;QR Marks the Spot&#8221; project division</a>). The project was initially started to showcase usability principles in cross-platform mobile application for the Engineering Methods of Software Usability (SE444) course, but has been extended to the competition.</p>
<p>Two months ago we had our first milestone release, and so far we&#8217;re really pleased with how the project has come together so far. We&#8217;ve got a lot up our sleeves, so stay tuned!</p>
<p><strong>
<p>If you&#8217;re interested, here&#8217;s an excerpt from our initial blog post:</p>
<p></strong></p>
<p><strong>Hey and welcome to the dev blog of </strong><a href="http://xkcd.com/327/" target="_blank"><span style="color: #000000;"><strong>&#8216;</strong></span></a><strong>; DROP TABLE Students; &#8211;!</strong></p>
<p>Here you&#8217;ll be able to find posts relevant to our discoveries, hardships, findings and more as we carry forward with the development of our QR Code Game Framework for the <a href="http://score-contest.org/2011/" target="_blank"><span style="color: #000000;">2011 SCORE Contest</span></a>; spewe&#8217;ll be working on the <a href="http://score-contest.org/2011/Projects.php#cavrakorlic" target="_blank"><span style="color: #000000;">QR Marks the Spot</span></a> challenge.</p>
<p>This past few week we&#8217;ve been mostly keeping our heads down with configuration management, requirements and design for the project. The scope and design of the project has undergone some exciting transformations this week, and it&#8217;s really nice to see everything gaining momentum. To begin with, I&#8217;d like to share some of my findings from this week:</p>
<h2>Workflow<a href="http://www.seekqr.com/wordpress/wp-content/uploads/2010/03/screen-shot-2010-03-19-at-2-25-49-am.png"><img class="size-medium wp-image-8 alignright" title="Screen shot 2010-03-19 at 2.25.49 AM" src="http://www.seekqr.com/wordpress/wp-content/uploads/2010/03/screen-shot-2010-03-19-at-2-25-49-am.png?w=300" alt="" width="200" height="196" /></a></h2>
<p>A lot of exciting things have happened this week for our workflow, both internally and externally.</p>
<ul>
<li><strong>We&#8217;re the proud new parents of an <a href="http://www.activecollab.com/" target="_blank">ActiveCollab</a> instance</strong>, which is proving to be excellent for keeping the team on track. Not only does it tie in directly with our repository, it also gives us great metrics like burndown, schedule of deliverables, ticket tracking, and plenty of communication options. <em>We highly recommend ActiveCollab for small to mid-sized software development teams for these reasons.</em> Check it out!</li>
<li><strong>We&#8217;re trying <em>really</em> hard to be hip. </strong>We&#8217;ve got a <a href="www.twitter.com/seusability" target="_blank">Twitter</a> account which we&#8217;ll be posting some of the spur-of-the-moment updates on the project, so be sure to follow us if you&#8217;re interested in some of the finer grained details.</li>
<li><strong>A classy new WordPress blog!</strong> Not only do we have a classy new theme, we&#8217;re also going to try and put some stellar content here (could happen!) as the project progresses. Glad you found us!</li>
<li><strong>We&#8217;re hopping on the <a href="http://git-scm.com/" target="_blank">Git</a> bandwagon.</strong> We have a lot of <a href="http://subversion.tigris.org/" target="_blank">Subversion</a> and <a href="http://mercurial.selenic.com/" target="_blank">Mercurial</a> vetrans on the team, but we&#8217;d like to take this opportunity to learn something new &#8211; so we&#8217;re diving <em>head first</em> into Git, and so far so good!</li>
</ul>
<h2>Platform<a href="http://www.seekqr.com/wordpress/wp-content/uploads/2010/03/screen-shot-2010-03-19-at-2-55-17-am.png"><img class="size-medium wp-image-12 alignright" title="Screen shot 2010-03-19 at 2.55.17 AM" src="http://www.seekqr.com/wordpress/wp-content/uploads/2010/03/screen-shot-2010-03-19-at-2-55-17-am.png?w=300" alt="" width="200" height="126" /></a></h2>
<p>One of the requirements for our project was that it <em>must be able to run on a mobile device</em>; however some (polite) holy wars arose when trying to pick a specific platform to implement the project in. After some research and talking with friends, we&#8217;re currently pursuing <strong><a href="http://www.appcelerator.com/" target="_blank">Titanium</a></strong>.</p>
<p>Titanium has a very interesting approach to the multi-platform dilemma &#8211; it enables developers to create a rich web application using Javascript w<em>hich later compiles into a native app</em> for your device of choice. What sets Titanium apart however is that its API provides an abstract way of interfacing with platform-specific APIs; a simple call to Titanium&#8217;s API for the device&#8217;s camera (for example) will invoke different code for the Apple iPhone than it will for Google Android devices.</p>
<p>Is this a <strong>silver bullet</strong> for application development? <em>Perhaps.</em> It&#8217;s exceedingly difficult to replicate the entire breadth of functionality that a native API has to offer &#8211; but Titanium exceeded our initial expectations. With this framework, we&#8217;ll be able to rapidly prototype UI designs building off of existing Javascript libraries like <a href="http://mootools.net/" target="_blank">MooTools</a> and <a href="http://jquery.com/" target="_blank">JQuery</a>. This also let&#8217;s us do heavy data crunching on the client <em>and</em> the server when the time comes. Very cool.</p>
<p>That more or less sums up the activity this week for the team. Please don&#8217;t hesitate to leave any of your thoughts in comments. Stay tuned!</p>
<p><strong>Next week </strong>we&#8217;ll be getting our hands dirty with:</p>
<ul>
<li>Diving more into Titanium</li>
<li>Developing a <a href="http://en.wikipedia.org/wiki/Work_breakdown_structure" target="_blank">WBS</a></li>
<li>Creating wireframes for UI</li>
<li>Brainstorming for some swanky names for our project</li>
</ul>
<p>&nbsp;</p>
<p><strong>
<p>If you&#8217;re interested in the development of Seekqr, swing by the team blog at <a href="http://blog.seekqr.com/">http://blog.seekqr.com/</a>.</p>
<p></strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.chriscowdery.com/posts/173/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>It&#8217;s About Time</title>
		<link>http://www.chriscowdery.com/posts/169</link>
		<comments>http://www.chriscowdery.com/posts/169#comments</comments>
		<pubDate>Sun, 27 Jun 2010 07:49:50 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Blog]]></category>

		<guid isPermaLink="false">http://www.chriscowdery.com/?p=169</guid>
		<description><![CDATA[Hey! I&#8217;m not dead! In fact I&#8217;m very much alive, and I&#8217;m having a fantastic time down here in California at Apple.

I&#8217;ve been really busy getting into the swing of things, so I apologize for the dearth of updates. But! Without further ado&#8230; posts!
]]></description>
			<content:encoded><![CDATA[<p>Hey! I&#8217;m not dead! In fact I&#8217;m very much alive, and I&#8217;m having a fantastic time down here in California at Apple.</p>
<p><a rel="attachment wp-att-170" href="http://www.chriscowdery.com/posts/169/photo"><img class="aligncenter size-medium wp-image-170" title="Golden Gate Bridge" src="http://www.chriscowdery.com/wp-content/uploads/2010/06/photo-590x442.jpg" alt="" width="590" height="442" /></a></p>
<p>I&#8217;ve been really busy getting into the swing of things, so I apologize for the dearth of updates. But! Without further ado&#8230; posts!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.chriscowdery.com/posts/169/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Coding Kata – February 2nd 2010 – Bite Sized Katas</title>
		<link>http://www.chriscowdery.com/posts/153</link>
		<comments>http://www.chriscowdery.com/posts/153#comments</comments>
		<pubDate>Tue, 02 Feb 2010 06:00:13 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.chriscowdery.com/?p=153</guid>
		<description><![CDATA[In a slightly different vein, here are some smaller brainteasers for you to try!

Create an algorithm which divides any two numbers of different bases together. Does your algorithm work with negative numbers? How about negative bases?
How would you find a cycle in a linked list? Can you do it iteratively?
Multiply a number by 7 without [...]]]></description>
			<content:encoded><![CDATA[<p>In a slightly different vein, here are some smaller brainteasers for you to try!</p>
<ul>
<li><strong>Create an algorithm which divides any two numbers of different bases together.</strong> <br />Does your algorithm work with negative numbers? <br />How about negative bases?</li>
<li><strong>How would you find a cycle in a linked list?</strong> <br />Can you do it iteratively?</li>
<li><strong>Multiply a number by 7 without using the multiplication operator.</strong> <br />Can it be done without addition?</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.chriscowdery.com/posts/153/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Coding Kata &#8211; February 1st 2010 &#8211; Flippin&#8217; Lists</title>
		<link>http://www.chriscowdery.com/posts/151</link>
		<comments>http://www.chriscowdery.com/posts/151#comments</comments>
		<pubDate>Mon, 01 Feb 2010 06:00:40 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Kata]]></category>

		<guid isPermaLink="false">http://www.chriscowdery.com/?p=151</guid>
		<description><![CDATA[Goal: Flip tuples in a doubly linked list.
Example: Given A  B  C  D, have an algorithm produce B  A  D  C.
Constraints: All manipulations must be made to the original linked list, and minimize use of external data structures as much as possible.
Hmmm of the day: The ideal solution is [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Goal:</strong> Flip tuples in a doubly linked list.<br />
Example: Given A <-> B <-> C <-> D, have an algorithm produce B <-> A <-> D <-> C.</p>
<p><strong>Constraints:</strong> All manipulations must be made to the original linked list, and minimize use of external data structures as much as possible.</p>
<p><strong>Hmmm of the day:</strong> The ideal solution is fairly brief and elegant, so don&#8217;t try to over-think it unless you need to!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.chriscowdery.com/posts/151/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Coding Kata – January 29 2010 – Playing Vegas</title>
		<link>http://www.chriscowdery.com/posts/149</link>
		<comments>http://www.chriscowdery.com/posts/149#comments</comments>
		<pubDate>Fri, 29 Jan 2010 17:18:36 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Kata]]></category>

		<guid isPermaLink="false">http://www.chriscowdery.com/?p=149</guid>
		<description><![CDATA[Goal: Design and implement an algorithm to detect certain hands in a game of Poker. You are given your parameters as 5 ints [0-13] representing each value of the card. The hands to check are:

Four of a kind (ex: 5,4,5,5,5)
Full house (ex: 5,4,4,5,5)
Three of a kind (ex: 5,4,5,5,1)
Two pair (ex: 8,4,4,5,5)
Pair (ex: 7,1,2,5,5)
High card (ex: [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Goal:</strong> Design and implement an algorithm to detect certain hands in a game of Poker. You are given your parameters as 5 ints [0-13] representing each value of the card. The hands to check are:</p>
<ul>
<li>Four of a kind (ex: 5,4,5,5,5)</li>
<li>Full house (ex: 5,4,4,5,5)</li>
<li>Three of a kind (ex: 5,4,5,5,1)</li>
<li>Two pair (ex: 8,4,4,5,5)</li>
<li>Pair (ex: 7,1,2,5,5)</li>
<li>High card (ex: 1,2,3,4,5)</li>
</ul>
<p><strong>Constraints:</strong></p>
<ul>
<li>Return the String value or enum code (to your specification) representing each case</li>
</ul>
<p><strong>Hmmm of the day:</strong> Are there any poker hands which could fall into more than one category?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.chriscowdery.com/posts/149/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Coding Kata – January 28 2010 &#8211; Crazy List Copying</title>
		<link>http://www.chriscowdery.com/posts/135</link>
		<comments>http://www.chriscowdery.com/posts/135#comments</comments>
		<pubDate>Thu, 28 Jan 2010 05:53:16 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Kata]]></category>

		<guid isPermaLink="false">http://www.chriscowdery.com/?p=135</guid>
		<description><![CDATA[Goal: Create a duplicate copy of a linked list given the following facts about the linked list:

Each node in the list has a pointer to the next element in the list, or null if no element is present
Each node in the list has a data pointer which points to any arbitrary node in the list

Constraints:

You [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Goal:</strong> Create a duplicate copy of a linked list given the following facts about the linked list:</p>
<ul>
<li>Each node in the list has a pointer to the next element in the list, or null if no element is present</li>
<li>Each node in the list has a data pointer which points to <em>any</em> arbitrary node in the list</li>
</ul>
<p><strong>Constraints:</strong></p>
<ul>
<li>You are allowed to modify the list, so long as it is returned to its original state</li>
</ul>
<p><strong>Example: </strong><br />
<a href="http://www.chriscowdery.com/?attachment_id=139" rel="attachment wp-att-139"><img src="http://www.chriscowdery.com/wp-content/uploads/2010/01/crazylist1.png" alt="" title="crazylist" width="379" height="446" class="alignnone size-full wp-image-139" /></a></p>
<p><strong>Hmmm of the day:</strong> Can this be solved using pointer arithmetic, and if so, is it the most efficient solution?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.chriscowdery.com/posts/135/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Coding Kata &#8211; January 27 2010 &#8211; The Ski Lift</title>
		<link>http://www.chriscowdery.com/posts/133</link>
		<comments>http://www.chriscowdery.com/posts/133#comments</comments>
		<pubDate>Wed, 27 Jan 2010 06:23:13 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Kata]]></category>

		<guid isPermaLink="false">http://www.chriscowdery.com/?p=133</guid>
		<description><![CDATA[Goal: Create an algorithm to determine how close you are to the summit of a mountain (percentage) whilst on a chairlift. You know the following information:

What chair you are on
The chair coming in the opposite direction visible to your left at the current time

At what point do you have an accurate estimate of your progress? [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Goal:</strong> Create an algorithm to determine how close you are to the summit of a mountain (percentage) whilst on a <a href="http://en.wikipedia.org/wiki/Chairlift">chairlift</a>. You know the following information:</p>
<ul>
<li>What chair you are on</li>
<li>The chair coming in the opposite direction visible to your left at the current time</li>
</ul>
<p>At what point do you have an accurate estimate of your progress? When you are at that point, what is your percentage progress to the top?</p>
<p><strong>Constraints:</strong> You are not given the number of chairs on the chairlift.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.chriscowdery.com/posts/133/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Coding Kata – January 26 2010</title>
		<link>http://www.chriscowdery.com/posts/131</link>
		<comments>http://www.chriscowdery.com/posts/131#comments</comments>
		<pubDate>Tue, 26 Jan 2010 05:16:59 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Kata]]></category>

		<guid isPermaLink="false">http://www.chriscowdery.com/?p=131</guid>
		<description><![CDATA[Goal: Create code to rotate an N by N array 90 degrees clockwise.
Constraints: All manipulations must be made to the original array, but a single staging variable can be used.
Hmmm of the day: Can this be done for N by M arrays as well? If so, how? If not, why not?
]]></description>
			<content:encoded><![CDATA[<p><strong>Goal:</strong> Create code to rotate an N by N array 90 degrees clockwise.</p>
<p><strong>Constraints:</strong> All manipulations must be made to the original array, but a single staging variable can be used.</p>
<p><strong>Hmmm of the day:</strong> Can this be done for N by M arrays as well? If so, how? If not, why not?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.chriscowdery.com/posts/131/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Coding Kata &#8211; January 25 2010</title>
		<link>http://www.chriscowdery.com/posts/125</link>
		<comments>http://www.chriscowdery.com/posts/125#comments</comments>
		<pubDate>Mon, 25 Jan 2010 06:31:16 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Kata]]></category>

		<guid isPermaLink="false">http://www.chriscowdery.com/?p=125</guid>
		<description><![CDATA[Goal: Design a data structure and controller to model a Connect Four game.
Your controller must have two functions, putPiece and checkForWin (using any parameters you choose).
Constraints: Your checkForWin method should be relatively efficient (i.e. it can&#8217;t have O(n2) efficiency). Think you can do it in O(n)? How about O(1)?
Hmmm of the day: The most efficient [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Goal:</strong> Design a data structure and controller to model a <a href="http://en.wikipedia.org/wiki/Connect_Four">Connect Four</a> game.<br />
Your controller must have two functions, putPiece and checkForWin (using any parameters you choose).</p>
<p><strong>Constraints:</strong> Your checkForWin method should be relatively efficient (i.e. it can&#8217;t have O(n<sup>2</sup>) efficiency). Think you can do it in O(n)? How about O(1)?</p>
<p><strong>Hmmm of the day: </strong>The most efficient way to put a piece may seem a little &#8216;backwards&#8217; at first.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.chriscowdery.com/posts/125/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
