<?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>Wed, 10 Feb 2010 04:58:35 +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>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>2</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>
		<item>
		<title>Coding Kata</title>
		<link>http://www.chriscowdery.com/posts/119</link>
		<comments>http://www.chriscowdery.com/posts/119#comments</comments>
		<pubDate>Mon, 25 Jan 2010 06:24:16 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Kata]]></category>

		<guid isPermaLink="false">http://www.chriscowdery.com/?p=119</guid>
		<description><![CDATA[Ever write code that looks like this?

If you&#8217;re saying no, then you&#8217;re either a legend or you might have some delusions of grandeur &#8211; but in any case a little practice never hurt anybody. I&#8217;ve decided to keep my skills fresh, I&#8217;m going to try and create (and tackle) a new problem every day, and [...]]]></description>
			<content:encoded><![CDATA[<p>Ever write code that looks like this?</p>
<p><img src="http://www.chriscowdery.com/wp-content/uploads/2010/01/dari.jpg" alt="thatll_work" title="thatll_work" width="500" height="347" class="alignnone size-full wp-image-120" /></p>
<p>If you&#8217;re saying no, then you&#8217;re either a legend or you might have some delusions of grandeur &#8211; but in any case a little practice <em>never</em> hurt anybody. I&#8217;ve decided to keep my skills fresh, I&#8217;m going to try and create (and tackle) a new problem every day, and I&#8217;d like to share them with the rest of the world so that you might benefit as well. </p>
<p>This concept is by no means new, and I encourage you to check out <a href="http://codekata.pragprog.com">Dave Thomas&#8217; Coding Kata</a>, which is the earliest example of Coding Kata I can find. I really like the concept, but unfortunately the site is no longer maintained, so I&#8217;d like to pick up the torch and carry on from where Dave left off.</p>
<p>Some of them you may have come across some of before, but I&#8217;ll try to keep them as fresh as possible. I&#8217;ll also post the answer in the comments the next day for those who are interested. Karma points to whoever gets it first before that though <img src='http://www.chriscowdery.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.chriscowdery.com/posts/119/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Thin Air Multitouch</title>
		<link>http://www.chriscowdery.com/posts/16</link>
		<comments>http://www.chriscowdery.com/posts/16#comments</comments>
		<pubDate>Tue, 03 Nov 2009 05:21:54 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Portfolio]]></category>
		<category><![CDATA[Projects]]></category>

		<guid isPermaLink="false">http://www.chriscowdery.com/?p=16</guid>
		<description><![CDATA[Although I have a deep interest in all ways that we interact with technology, one my favorite niche areas of HCI is Multitouch research. Ever since I saw Jeff Han give his TED Talk on Multitouch technology, I was hooked.
This summer I wanted to make my own Multitouch interface as a side project, but I [...]]]></description>
			<content:encoded><![CDATA[<p>Although I have a deep interest in all ways that we interact with technology, one my favorite niche areas of HCI is <a href="http://en.wikipedia.org/wiki/Multi-touch">Multitouch</a> research. Ever since I saw <a href="http://www.ted.com/talks/jeff_han_demos_his_breakthrough_touchscreen.html">Jeff Han</a> give his TED Talk on Multitouch technology, I was hooked.</p>
<p>This summer I wanted to make my own Multitouch interface as a side project, but I wanted to add a new twist to it &#8211; I wanted to make it work in thin air, without any physical contact. I saw some very interesting projects on <a href="http://www.alab.t.u-tokyo.ac.jp/~siggraph/09/TouchableHolography/SIGGRAPH09-TH.html">touchable holography </a>, and I&#8217;d also just finished watching <a href="http://www.imdb.com/title/tt1136608/">District 9</a> (my favorite part was admittedly some of the cool UIs that the aliens had), and I couldn&#8217;t stop but think&#8230; <em>how cool would it be to have something like that??</em></p>
<p>I started sketching a bunch of prototypes in my spare time, and I finally came up with one inspired by some of the fantastic work of <a href="http://procrastineering.blogspot.com/">Johnny Chung Lee</a>. The prototype used a matrix of infrared LEDs, positioned on the top of a display, which would reflect infrared light back to a user (standing an arbitrary location away from the display). The user  would be wearing gloves with reflective tape on each finger, which would in turn reflect the infrared light back at two infrared cameras (read: wiimotes), positioned at either side of the display.</p>
<p>When the user first starts the system, they must calibrate it before they use it. A quick sample is done of the area to see if there are any areas emitting infrared light and if so, to remove them from the sampling area so they aren&#8217;t treated as input from you. The system plays a tone and the user then creates a brightness threshold by presenting all ten fingers at a point which functions as a virtual wall &#8211; it&#8217;s very similar to a <a href="http://image.guardian.co.uk/sys-images/Arts/Arts_/Pictures/2007/09/24/mime460.jpg">mime&#8217;s wall</a> performance.</p>
<p>Anything that is registered as brighter than the average of all ten points counts as a push, and for these reasons we can also detect virtual pressure based on how bright the light is being reflected when compared to the initial threshold. But we&#8217;re not done yet! We still need to know <em>where</em> the screen is, so after creating the virtual wall the system prompts the user to point at four crosshairs, positioned at the four respective corners of the screen.</p>
<p>CV algorithms are then used to detect if there is a &#8216;press&#8217; and if so, how many and where. Using pre-existing <a href="http://www.whitenoiseaudio.com/touchlib/">libraries for processing mutlitouch input</a>, we are able to process the information read from the cameras and use this information to recognize various gestures, such as pinching and a finger coming in and out of the threshold.</p>
<p>The current version now has &#8216;darth vader gloves&#8217; which have IR LEDs wired right into the glove. This not only helps cut down on power consumption, but it also gives more relevant readings in the cameras as lots of noise would be generated by the IR light rays hitting various parts of the reflective tape. The current prototype doesn&#8217;t support any more than 4 points acting in a multitouch gesture either at this point, but I plan to expand on this soon, school permitting <img src='http://www.chriscowdery.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Youtube videos, photos, howtos, specs and the like will hopefully find their way up here soon, coursework permitting <img src='http://www.chriscowdery.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.chriscowdery.com/posts/16/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Man in the middle design</title>
		<link>http://www.chriscowdery.com/posts/10</link>
		<comments>http://www.chriscowdery.com/posts/10#comments</comments>
		<pubDate>Tue, 03 Nov 2009 05:18:55 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Process]]></category>
		<category><![CDATA[Software Design]]></category>

		<guid isPermaLink="false">http://www.chriscowdery.com/?p=10</guid>
		<description><![CDATA[I used to always be a relentless top-down developer. I deduced that it simply was the best way to go &#8211; once you create the interface the client wants, you have a better understanding of the requirements and can get feedback right away which would help cut down potential changes in architecture mid-project. Bottom-up projects [...]]]></description>
			<content:encoded><![CDATA[<p>I used to always be a relentless top-down developer. I deduced that it simply was the best way to go &#8211; once you create the interface the client wants, you have a better understanding of the requirements and can get feedback <em>right away</em> which would help cut down potential changes in architecture mid-project. Bottom-up projects often suffered costly redesigns as the client would change their minds after seeing the product and in some cases I&#8217;d have to re-invent the wheel again.. and again. After being scarred too many times, I switched over to a top-down philosophy for my app development, and have been doing it for several years now.</p>
<p>The procedure was more or less the same for every project. I would create my user interface in Photoshop and slice it up (or if I&#8217;m feeling exceptionally keen, straight to the code), and then piece by piece I would snap little bits of interface together to form an overall gestalt. After many refinements and tweakings, I&#8217;d prepare a demo and portfolio for my client and showcase the new interface. If all went well, I&#8217;d begin design of my Controller and Model components from then on, giddy with satisfaction that the client liked the demo.</p>
<p>But that&#8217;s when the honeymoon period starts to end. Quickly.</p>
<p>The app now has all these lofty requirements and proposed features, and there&#8217;s a substantial chasm between the various elements. Solutions pop into your head on how to connect them, some more eloquent than others, but invariably the initial solution isn&#8217;t as clean-cut as you&#8217;d like it to be. Several pads of paper and pots of coffee later, a nice design emerges for your Controller and you swiftly bind all the GUI elements to their proposed functions. Life is good. But then there&#8217;s the Model&#8230;</p>
<p><img class="alignnone size-full wp-image-11" title="Travis-cavingunderpressure" src="http://www.chriscowdery.com/wp-content/uploads/2009/11/Travis-cavingunderpressure.jpg" alt="Travis-cavingunderpressure" width="500" height="375" /></p>
<p>After slewing through the Model, and getting that last unit test to pass, you finally have first release candidate to show to the client. You&#8217;re pleased with yourself, glad that you pulled it off and you&#8217;re happy with the results, and the client is too. The client then pulls you aside afterwards and was wondering what happened in the past few weeks. Despite the fact that you told them it was going to take a while to &#8216;do the plumbing&#8217; to connect everything, they expected something working earlier than this, after all &#8211; they saw an interface with everything they wanted to see on it! How hard could it possibly be?</p>
<p>Time after time I find that this approach suffers from the <a href="http://www.joelonsoftware.com/articles/fog0000000356.html">Iceberg Effect</a>, in addition to the dangerous waters you have to navigate through to avoid a Frankenstein app and other anti-patterns. I assumed it was the best way to go about doing things (for me) despite it&#8217;s shortcomings, and I continued on my merry little way&#8230; until this weekend.</p>
<p><strong>What if</strong> you didn&#8217;t start with the View, or even the Model &#8211; and just went <em>straight</em> to the Controller. This way you could start on an app which knew from the ground up the best ways to interact with the Model and also the best ways to interact with the View.</p>
<p>The most <em>essential</em> moment in the development of an application I believe is when you realize how the users intent can be fulfilled, and since this is predominately Controller logic anyway, you&#8217;ve basically got the app in the bag. Here are a few pros to this approach:</p>
<ul>
<li>You can construct a modular Controller around the <em>users actions</em> and not the <em>nitpicky needs of the app infrastructure</em></li>
<li>You still have an understanding of what functionality the user will be able to use in the View</li>
<li>You don&#8217;t need to make any compromises with the design of your model</li>
<li>You won&#8217;t be a victim to the Iceberg Effect</li>
<li>Can construct unit tests right away for Test Driven Development</li>
<li>Less likely to paint yourself into a corner since you know the app&#8217;s logic and constraints up-front</li>
<li>You and the client have reasonably high visibility on the project</li>
</ul>
<p>No methodology would be complete without it&#8217;s drawbacks though. Here&#8217;s a few which I think can come into play:</p>
<ul>
<li>Longer delay in getting the interface ready means that there could be a small back-and-forth between Controller and View handshaking if the client makes repeated changes</li>
<li>More time needed up-front to flush out the design</li>
</ul>
<p>So what do you think? Is this a steaming pile of balderdash, or do you think it&#8217;s a happy compromise in this day and age of app development? I will be trying it on my next project, and I&#8217;ll keep you posted with the results.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.chriscowdery.com/posts/10/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
