<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Can't see nothing but the source code &#187; Programming</title>
	<atom:link href="http://codeforfun.wordpress.com/category/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://codeforfun.wordpress.com</link>
	<description>Java development with an iPhone touch pad for the Atari 2600 from an urban hip-hop perspective</description>
	<lastBuildDate>Wed, 09 Dec 2009 01:51:25 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='codeforfun.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/8d21f8fd8dcc021adcd46592bfbddcda?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>Can't see nothing but the source code &#187; Programming</title>
		<link>http://codeforfun.wordpress.com</link>
	</image>
			<item>
		<title>My Top 80&#8217;s Moments</title>
		<link>http://codeforfun.wordpress.com/2009/12/08/my-top-80s-moments/</link>
		<comments>http://codeforfun.wordpress.com/2009/12/08/my-top-80s-moments/#comments</comments>
		<pubDate>Wed, 09 Dec 2009 01:51:25 +0000</pubDate>
		<dc:creator>Cliff</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://codeforfun.wordpress.com/?p=1090</guid>
		<description><![CDATA[I bring you tidings and cheer this year. All the way from Stonegate Drive where I spent many an hour in front of the T.V. I list my top five 80&#8217;s moments. 
Transformers The Movie (One shall stand, one shall fall)


The Last Dragon (Busta Rhymes and Marlon Wayans need to do a remake!)





Bruce Lee Nunchucks [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codeforfun.wordpress.com&blog=228419&post=1090&subd=codeforfun&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I bring you tidings and cheer this year. All the way from Stonegate Drive where I spent many an hour in front of the T.V. I list my top five 80&#8217;s moments. </p>
<p><strong>Transformers The Movie</strong> <em>(One shall stand, one shall fall)</em></p>
<p><object width="500" height="400"><param name="movie" value="http://www.youtube.com/v/Cf_qfX9cKsQ&#038;fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/Cf_qfX9cKsQ&#038;fs=1" type="application/x-shockwave-flash" width="500" height="400" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p><object width="500" height="400"><param name="movie" value="http://www.youtube.com/v/pQuofYoyCfw&#038;fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/pQuofYoyCfw&#038;fs=1" type="application/x-shockwave-flash" width="500" height="400" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p><strong>The Last Dragon</strong> <em>(<a href="http://www.bustarhymes.com/">Busta Rhymes</a> and <a href="http://www.myspace.com/marlonwayans">Marlon Wayans</a> need to do a remake!)</em></p>
<p><object width="500" height="400"><param name="movie" value="http://www.youtube.com/v/mxF2ouw8NJ0&#038;fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/mxF2ouw8NJ0&#038;fs=1" type="application/x-shockwave-flash" width="500" height="400" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p><object width="384" height="313"><param name="movie" value="http://www.youtube.com/v/Nm6-KDSEq2E&#038;fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/Nm6-KDSEq2E&#038;fs=1" type="application/x-shockwave-flash" width="384" height="313" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p><object width="500" height="400"><param name="movie" value="http://www.youtube.com/v/s8JDGwoMqIE&#038;fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/s8JDGwoMqIE&#038;fs=1" type="application/x-shockwave-flash" width="500" height="400" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p><object width="500" height="400"><param name="movie" value="http://www.youtube.com/v/WBqwAr34DF8&#038;fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/WBqwAr34DF8&#038;fs=1" type="application/x-shockwave-flash" width="500" height="400" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p><span style="text-align:center; display: block;"><a href="http://codeforfun.wordpress.com/2009/12/08/my-top-80s-moments/"><img src="http://img.youtube.com/vi/mxF2ouw8NJ0/2.jpg" alt="" /></a></span></p>
<p><strong>Bruce Lee Nunchucks</strong> <em>(Nuff said)</em></p>
<p><object width="384" height="313"><param name="movie" value="http://www.youtube.com/v/bRyDcB7qQFo&#038;fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/bRyDcB7qQFo&#038;fs=1" type="application/x-shockwave-flash" width="384" height="313" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p><strong>Bruce Lee and Kareem</strong> <em>(Now why would they use the Asian lengthening effect for a clip with Kareem?)</em></p>
<p><object width="384" height="313"><param name="movie" value="http://www.youtube.com/v/RBRJ2qCx5VM&#038;fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/RBRJ2qCx5VM&#038;fs=1" type="application/x-shockwave-flash" width="384" height="313" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p><strong>Breaking Electric Boogaloo</strong> <em>(Sweeping the living room hadn&#8217;t been the same since!)</em></p>
<p><object width="500" height="400"><param name="movie" value="http://www.youtube.com/v/BVrWDPi12zE&#038;fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/BVrWDPi12zE&#038;fs=1" type="application/x-shockwave-flash" width="500" height="400" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p>And number six (I can&#8217;t leave it out) <strong>Storm Shadow vs. Snake Eyes</strong></p>
<p><object width="500" height="400"><param name="movie" value="http://www.youtube.com/v/a-_a-sjtNUM&#038;fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/a-_a-sjtNUM&#038;fs=1" type="application/x-shockwave-flash" width="500" height="400" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p>Honestly I&#8217;m not sure if it was more cool to have the glow or the touch but either way I found myself in front of the mirror practicing mentally induced spontaneous combustion. (Don&#8217;t act like it was just me! A whole lot of you thought you could light up an empty dark room but instead found a way to accidentally crap your pants when showing your homies.)</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/codeforfun.wordpress.com/1090/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/codeforfun.wordpress.com/1090/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/codeforfun.wordpress.com/1090/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/codeforfun.wordpress.com/1090/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/codeforfun.wordpress.com/1090/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/codeforfun.wordpress.com/1090/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/codeforfun.wordpress.com/1090/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/codeforfun.wordpress.com/1090/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/codeforfun.wordpress.com/1090/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/codeforfun.wordpress.com/1090/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codeforfun.wordpress.com&blog=228419&post=1090&subd=codeforfun&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://codeforfun.wordpress.com/2009/12/08/my-top-80s-moments/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/11e7597f889f569d804b6f8c79e60e6a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Cliff</media:title>
		</media:content>

		<media:content url="http://img.youtube.com/vi/mxF2ouw8NJ0/2.jpg" medium="image" />
	</item>
		<item>
		<title>You must fail before you can succeed!</title>
		<link>http://codeforfun.wordpress.com/2009/12/01/you-must-fail-before-you-can-succeed/</link>
		<comments>http://codeforfun.wordpress.com/2009/12/01/you-must-fail-before-you-can-succeed/#comments</comments>
		<pubDate>Wed, 02 Dec 2009 01:28:44 +0000</pubDate>
		<dc:creator>Cliff</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[iPhone TDD]]></category>
		<category><![CDATA[Objective C unit tests]]></category>

		<guid isPermaLink="false">http://codeforfun.wordpress.com/?p=1087</guid>
		<description><![CDATA[If you try to fail and you succeed, which have you actually done? Are you a success? Or a failure? Is it good to be a failure? Is it better to be successful at failure? Let&#8217;s add detail to the question. By the way, I&#8217;m Cliff. You&#8217;re here because you tried to fail and you [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codeforfun.wordpress.com&blog=228419&post=1087&subd=codeforfun&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>If you try to fail and you succeed, which have you actually done? Are you a success? Or a failure? Is it good to be a failure? Is it better to be successful at failure? Let&#8217;s add detail to the question. By the way, I&#8217;m Cliff. You&#8217;re here because you tried to fail and you succeeded. Today&#8217;s topic is something I&#8217;ve visited before. It&#8217;s a new thing I&#8217;m trying with unit tests. Actually it&#8217;s an old thing to many but I&#8217;m trying it for the first time in both C++ and ObjC so it feels sorta new-ish.</p>
<p><strong>How do you unit test?</strong><br />
Let&#8217;s start with how you unit test. What are your steps? What are the recommended steps? In order to be successful at TDD you must appreciate the entirety of the practice. It goes, &#8220;Red, Green, Refactor&#8221;. Red comes before Green, just like with traffic lights. What I&#8217;m saying is that you have to begin with a failing test. The first test is important. The first failure should describe what work you have to do. In my case, I&#8217;m swimming in un-ventured waters (C++/ObjC++ testing) so there&#8217;s some learning that needs to be re-enforced. Here&#8217;s how I&#8217;ve been starting my tests recently:</p>
<pre class="brush: plain;">
//
//  MyCoolNewObjectTest.m
//  Created by cliftoncraig07 on 12/1/09.
//  Copyright 2009 __MyCompanyName__. All rights reserved.
//
#import &lt;SenTestingKit/SenTestingKit.h&gt;
#include &quot;MyCoolNewObject.h&quot;

@interface MyCoolNewObjectTest : SenTestCase
{
  MyCoolNewObject *coolObject;
}
@end

@implementation MyCoolNewObjectTest

-(void) setUp
{}

@end
</pre>
<p>The test shell is completely empty except for references to the &#8220;thing&#8221; I&#8217;m about to create. I get my first failure which is a compile error stating that this thing does not exist. &#8220;No such file error&#8230;&#8221; around the include. Here I have an opportunity to review my design as minimalist as it is. I ask, &#8220;Does the error make sense? Is it expected? Do I like the name of this cool new thing I&#8217;m creating? Is it specific to the task I&#8217;m assigned to?&#8221; Always review each error with these question. After creating the files for the new &#8220;thing&#8221; I then follow up with:</p>
<pre class="brush: plain;">
//
//  MyCoolNewObjectTest.m
//  Created by cliftoncraig07 on 12/1/09.
//  Copyright 2009 __MyCompanyName__. All rights reserved.
//
#import &lt;SenTestingKit/SenTestingKit.h&gt;
#include &quot;MyCoolNewObject.h&quot;

@interface MyCoolNewObjectTest : SenTestCase
{
  MyCoolNewObject *coolObject;
}
@end

@implementation MyCoolNewObjectTest

-(void) setUp
{ STFail(@&quot;You must fail before you can succeed!&quot;); }

@end
</pre>
<p>Also important, while I train myself on the new testing framework, because I need to catch myself misnaming the &#8220;setup&#8221; method which should have a capital &#8220;U&#8221;. It also lets me know that my test is actually running as part of the suite. Far too often, in Xcode, I&#8217;ll have the wrong target active and begin writing the wrong code because I was getting false positives from tests that were never run. Here&#8217;s where it gets interesting. The STFail in the above example does not fail! Now we face our original question, if you try to fail, as we have above, and you succeed like our test suite will do here, which have you actually done? The first time I hit the unexpected success I got nervous and read all around the SenTesting framework and OCUnit. Eventually I settled on the conclusion that because there were no tests to run the setUp was being optimized away as unnecessary. What the above example is pointing out is that such a test case can never fail since there are no tests. That leads us to our final step&#8230;</p>
<pre class="brush: plain;">
//
//  MyCoolNewObjectTest.m
//  Created by cliftoncraig07 on 12/1/09.
//  Copyright 2009 __MyCompanyName__. All rights reserved.
//
#import &lt;SenTestingKit/SenTestingKit.h&gt;
#include &quot;MyCoolNewObject.h&quot;

@interface MyCoolNewObjectTest : SenTestCase
{
  MyCoolNewObject *coolObject;
}
@end

@implementation MyCoolNewObjectTest

-(void) setUp
{ STFail(@&quot;You must fail before you can succeed!&quot;); }

-(void) testSomething
{}

@end
</pre>
<p>&#8230;and here we get our familiar red bar! Our test case is complete and we now understand a little more about OCUnit. That&#8217;s it for today. Go on. Nothing else to see here. I know what you&#8217;re thinking. &#8220;We haven&#8217;t written or learned anything new!&#8221; Sure we have! We&#8217;ve written and validated our first test case in ObjC++. (I&#8217;m using OCUnit w/ C++ extensions to exercise or test drive C++ code.) The little amount we went over here is persistent through all the testing you will do from then on. It starts from the basic mechanics. Make sure every line of code is proceeded by some test (or compiler) failure. If you&#8217;ve done more than 2-3 things and haven&#8217;t run a build to generate a failure then you&#8217;re completely off track.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/codeforfun.wordpress.com/1087/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/codeforfun.wordpress.com/1087/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/codeforfun.wordpress.com/1087/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/codeforfun.wordpress.com/1087/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/codeforfun.wordpress.com/1087/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/codeforfun.wordpress.com/1087/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/codeforfun.wordpress.com/1087/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/codeforfun.wordpress.com/1087/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/codeforfun.wordpress.com/1087/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/codeforfun.wordpress.com/1087/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codeforfun.wordpress.com&blog=228419&post=1087&subd=codeforfun&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://codeforfun.wordpress.com/2009/12/01/you-must-fail-before-you-can-succeed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/11e7597f889f569d804b6f8c79e60e6a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Cliff</media:title>
		</media:content>
	</item>
		<item>
		<title>Too many social networks</title>
		<link>http://codeforfun.wordpress.com/2009/11/30/too-many-social-networks/</link>
		<comments>http://codeforfun.wordpress.com/2009/11/30/too-many-social-networks/#comments</comments>
		<pubDate>Tue, 01 Dec 2009 01:11:44 +0000</pubDate>
		<dc:creator>Cliff</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://codeforfun.wordpress.com/?p=1085</guid>
		<description><![CDATA[I rode the Wave then Twitter sucked me in! I don&#8217;t do Facebook anymore because too many people would know too much of my dirty laundry. (Not that I have anything to hide I&#8217;m just careful on what I share with whom.) It started over a year ago when those Facebook apps got to be [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codeforfun.wordpress.com&blog=228419&post=1085&subd=codeforfun&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I rode the Wave then Twitter sucked me in! I don&#8217;t do Facebook anymore because too many people would know too much of my dirty laundry. (Not that I have anything to hide I&#8217;m just careful on what I share with whom.) It started over a year ago when those Facebook apps got to be fun. Before I knew it I was answering &#8220;would you rather&#8230;&#8221; questions and rating friends in a way that could be taken out of context. Nobody would believe that I was &#8220;just trying out this little app&#8221; if they were to come across some of the stoopidity I was putting in the checkboxes. Its dangerous. Not only do these social network apps link people in ways never thought of before, they have a way of weening information out of you that you wouldn&#8217;t typically share in a regular situation. </p>
<p>I&#8217;m a mostly open guy but I have a certain edge to my personality that, when not kept under control, can lead to random outbursts in awkward situations. Because 90% of my connections were work related and because Facebook has no qualms with broadcasting every minute move you make to your entire Friend list by default I found it&#8217;d be easier if I just left it alone, lest somebody thought I was experiencing a breakdown of some sort. I&#8217;m putting this out there as a warning to some of you who may be on Facebook and not realizing that the stuff you do there IS broadcasted and permanent. You won&#8217;t realize until someone in your office taps you and asks about your &#8220;wall&#8221; or inquires why you were up at 12am updating the movie preferences with Steel Magnolia topping your list.</p>
<p>More important is the distraction these things impose on your normal activity. Something as personal as spending the holiday with your family can now be interrupted by a series of dumb tweets on a nonsense topic. I don&#8217;t usually reveal too much of my personal life here because it&#8217;s supposed to be all about the sourcecode but that last statement is too true and speaks to my level of discipline. While I don&#8217;t believe I did anything too damaging with Twitter (following the Wayans Bros. trends) this weekend I do understand the potential for chaos.</p>
<p>Google Wave is another big nothing. On its own, its an IM/Email/Live-Twitter-Board that doesn&#8217;t give you anything you don&#8217;t already have. It just aggregates existing tools in an interesting new way and because it wears a &#8220;Google&#8221; badge you&#8217;ll use it regardless of its current usability issues. I burned an entire day trying to work around usability flaws my and lack of Wave connections and find some practical advantage of the new platform. I feel it does have potential  and there is something big that could happen over the next few months but it is just taking too much of my time to follow along with everything else. </p>
<p>I always used to wonder about people who would pay for Cable, Pay-Per-View, NetFlix, Blockbuster, cell service, a land line, Satellite radio, and multiple-magazine subscriptions. Now I fear I&#8217;m becoming one if I don&#8217;t tone things down.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/codeforfun.wordpress.com/1085/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/codeforfun.wordpress.com/1085/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/codeforfun.wordpress.com/1085/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/codeforfun.wordpress.com/1085/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/codeforfun.wordpress.com/1085/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/codeforfun.wordpress.com/1085/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/codeforfun.wordpress.com/1085/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/codeforfun.wordpress.com/1085/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/codeforfun.wordpress.com/1085/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/codeforfun.wordpress.com/1085/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codeforfun.wordpress.com&blog=228419&post=1085&subd=codeforfun&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://codeforfun.wordpress.com/2009/11/30/too-many-social-networks/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/11e7597f889f569d804b6f8c79e60e6a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Cliff</media:title>
		</media:content>
	</item>
		<item>
		<title>Objective-C Gotchas</title>
		<link>http://codeforfun.wordpress.com/2009/11/30/objective-c-gotchas/</link>
		<comments>http://codeforfun.wordpress.com/2009/11/30/objective-c-gotchas/#comments</comments>
		<pubDate>Mon, 30 Nov 2009 17:05:29 +0000</pubDate>
		<dc:creator>Cliff</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[iPhone SDK]]></category>
		<category><![CDATA[iphone unit testing]]></category>
		<category><![CDATA[Objective C]]></category>
		<category><![CDATA[XCode]]></category>

		<guid isPermaLink="false">http://codeforfun.wordpress.com/?p=1080</guid>
		<description><![CDATA[You&#8217;re working in Objective-C land trying to get a product out the door and into the Apple iTunes Store, right? (Don&#8217;t argue with me I&#8217;m just setting the stage.) You&#8217;re feeling the second cup of coffee seep into your bloodstream which creates a certain euphoric sensation as the last 3 times you mashed Cmd+B turned [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codeforfun.wordpress.com&blog=228419&post=1080&subd=codeforfun&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>You&#8217;re working in Objective-C land trying to get a product out the door and into the Apple iTunes Store, right? (Don&#8217;t argue with me I&#8217;m just setting the stage.) You&#8217;re feeling the second cup of coffee seep into your bloodstream which creates a certain euphoric sensation as the last 3 times you mashed Cmd+B turned up no errors. Yes, that&#8217;s what&#8217;s happening in your copy of XCode right now. You then Cmd+Tilde to toggle the other XCode window active (Cmd+Tilde is a nifty Apple shortcut for switching active windows in the current app) and Cmd+B once again when a red flag on the play pops up in some code that had been just fine moments ago? What happened? Hi, <a href="http://codeforfun.wordpress.com/about/">I&#8217;m Cliff</a>. You&#8217;re here because XCode got&#8217;cha and you&#8217;re not quite sure how/why/where. I&#8217;m here because I wanna list as many of these got&#8217;chas before I forget them.</p>
<p><strong>Property accessor notation in Earlier SDKs</strong><br />
Here&#8217;s one weird gotcha that I just hit again for the first time. If you have a variable typed as a protocol and that protocol has a setter, which takes another protocol type defined then you may get an error when using dot notation in SDKs earlier than 3.0. That is a definition like this:</p>
<pre class="brush: plain;">
@protocol MyCoolAbstractType &lt;NSObject&gt;
-(void) setNetworkDataProvider:(id&lt;MyNetworkDataProvider&gt;)aNetworkDataProvider;
@end
</pre>
<p>&#8230;should be coded like this:</p>
<pre class="brush: plain;">
@protocol MyCoolAbstractType &lt;NSObject&gt;
@property (nonatomic, retain) id&lt;MyNetworkDataProvider&gt; networkDataProvider;
@end
</pre>
<p>&#8230;before you can do this:</p>
<pre class="brush: plain;">
id&lt;MyCoolAbstractType&gt; myObj = //create object from factory
myObj.networkDataProvider = [[MyConcreteNetworkDataProvider alloc] init];
</pre>
<p>Evidently the &#8220;Discover setter is a property&#8221; feature is something new Santa delivered with 3.0 and never told me about. Here I thought I had that toy from 2 years ago!</p>
<p><strong>Unit Tests Can&#8217;t Be Signed</strong><br />
I added a unit test dependency to my &#8220;Application&#8221; target the other week in order to streamline my dev cycles. The idea was to ensure any changes I made to satisfy the integrated application bundle did not impact behaviors outlined in my test cases. (I use mini applications to perform my integration testing.) The problem here is that, even though this works well for simulator builds, an on-device build will fail as XCode attempts to sign your unit test target output. I haven&#8217;t discovered a work-around for this one yet so I&#8217;m gonna just punt and remove the test dependency from any targets meant to run on device.</p>
<p><em>I&#8217;ll trow up more as I find them&#8230;</em></p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/codeforfun.wordpress.com/1080/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/codeforfun.wordpress.com/1080/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/codeforfun.wordpress.com/1080/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/codeforfun.wordpress.com/1080/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/codeforfun.wordpress.com/1080/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/codeforfun.wordpress.com/1080/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/codeforfun.wordpress.com/1080/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/codeforfun.wordpress.com/1080/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/codeforfun.wordpress.com/1080/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/codeforfun.wordpress.com/1080/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codeforfun.wordpress.com&blog=228419&post=1080&subd=codeforfun&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://codeforfun.wordpress.com/2009/11/30/objective-c-gotchas/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/11e7597f889f569d804b6f8c79e60e6a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Cliff</media:title>
		</media:content>
	</item>
		<item>
		<title>This makes me happy</title>
		<link>http://codeforfun.wordpress.com/2009/11/18/this-makes-me-happy/</link>
		<comments>http://codeforfun.wordpress.com/2009/11/18/this-makes-me-happy/#comments</comments>
		<pubDate>Wed, 18 Nov 2009 21:26:33 +0000</pubDate>
		<dc:creator>Cliff</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://codeforfun.wordpress.com/?p=1076</guid>
		<description><![CDATA[groovy -e &#8216;def printout = { it.consumeProcessOutput(System.out, System.err); it.waitFor() }; new File(/./).eachDirMatch ({ new File(it, /pom.xml/).exists() }) { printout(&#8220;mvn -f $it/pom.xml clean&#8221;.execute()) }&#8217;
Which can be simplified from Groovy 1.5 to Groovy 1.6.5 speak:
groovy -e &#8216;new File(/./).eachDirMatch ({ new File(it, /pom.xml/).exists() }) {&#8220;mvn -f $it/pom.xml clean&#8221;.execute(). waitForProcessOutput(System.out,System.err)}&#8217;
which only fits in a tweet if you don&#8217;t care [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codeforfun.wordpress.com&blog=228419&post=1076&subd=codeforfun&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>groovy -e &#8216;def printout = { it.consumeProcessOutput(System.out, System.err); it.waitFor() }; new File(/./).eachDirMatch ({ new File(it, /pom.xml/).exists() }) { printout(&#8220;mvn -f $it/pom.xml clean&#8221;.execute()) }&#8217;</p>
<p>Which can be simplified from Groovy 1.5 to Groovy 1.6.5 speak:<br />
groovy -e &#8216;new File(/./).eachDirMatch ({ new File(it, /pom.xml/).exists() }) {&#8220;mvn -f $it/pom.xml clean&#8221;.execute(). waitForProcessOutput(System.out,System.err)}&#8217;</p>
<p>which only fits in a tweet if you don&#8217;t care for errors when a directory isn&#8217;t a maven project:<br />
groovy -e &#8216;new File(/./).eachDir {&#8220;mvn -f $it/pom.xml clean&#8221;.execute(). waitForProcessOutput(System.out,System.err)}&#8217;</p>
<p>For those of you looking puzzled, it&#8217;s a Groovy way to clean a bunch of Maven project subfolders you plan to add into Subversion. It&#8217;ll work for ant too just by changing &#8220;mvn&#8221; to &#8220;ant&#8221; and changing &#8220;pom.xml&#8221; to &#8220;build.xml&#8221; in case you have a bunch of Ant projects that need to be added into svn.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/codeforfun.wordpress.com/1076/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/codeforfun.wordpress.com/1076/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/codeforfun.wordpress.com/1076/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/codeforfun.wordpress.com/1076/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/codeforfun.wordpress.com/1076/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/codeforfun.wordpress.com/1076/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/codeforfun.wordpress.com/1076/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/codeforfun.wordpress.com/1076/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/codeforfun.wordpress.com/1076/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/codeforfun.wordpress.com/1076/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codeforfun.wordpress.com&blog=228419&post=1076&subd=codeforfun&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://codeforfun.wordpress.com/2009/11/18/this-makes-me-happy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/11e7597f889f569d804b6f8c79e60e6a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Cliff</media:title>
		</media:content>
	</item>
		<item>
		<title>Don&#8217;t forget to flush!</title>
		<link>http://codeforfun.wordpress.com/2009/11/16/dont-forget-to-flush/</link>
		<comments>http://codeforfun.wordpress.com/2009/11/16/dont-forget-to-flush/#comments</comments>
		<pubDate>Tue, 17 Nov 2009 04:30:57 +0000</pubDate>
		<dc:creator>Cliff</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[I/O streams]]></category>
		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://codeforfun.wordpress.com/?p=1074</guid>
		<description><![CDATA[It&#8217;s been a rough day. I spent the majority of it chasing down random misbehavior on a staging server. My development machine is 32 bit. (Technically my development machine is 64 bit but I&#8217;m running a 32bit Kernel in my OS.) The staging server is 64bit. I write Java. Java sez, &#8220;you write once and [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codeforfun.wordpress.com&blog=228419&post=1074&subd=codeforfun&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>It&#8217;s been a rough day. I spent the majority of it chasing down random misbehavior on a staging server. My development machine is 32 bit. (Technically my development machine is 64 bit but I&#8217;m running a 32bit Kernel in my OS.) The staging server is 64bit. I write Java. Java sez, &#8220;you write once and run anywhere!&#8221; In reality, when I move compiled source code from my development machine to my staging machine things act radically different.</p>
<p>The big picture is that I&#8217;m trying to make the staging machine talk to me. I mean literally talk, using english words and all. It&#8217;s the extra 32 bits in this staging machine that have been getting in the way. They force me to scour the web and find native libraries that contain the same amount of extra chromosomes&#8230; err&#8230; bits. Then on top of that, Tomcat likes to do different things when you throw war files in it.</p>
<p>Today&#8217;s lesson begins from Tomcat. Pretend you&#8217;ve written a servlet. (Ok, you don&#8217;t have to pretend. Go on and write a servlet if it makes you feel better, I&#8217;ll wait here patiently.) In your servlet make like you have a lot of binary stuff that you want to share with connecting web people. These people might be sitting under a MacbookPro, or scrolling a Blackberry wheel, or flicking an iPhone or something. Whatever the case, they came to your servlet to get these wonderful binary thingies. These binary thingies are larger than your typical web page, spanning a few kilobytes. So now you have to use one of those stream classes. If you&#8217;re really smart, like I think I am, then you&#8217;ll do something clever [stupid] and try pipelining, or reading from an input stream and writing to an output stream. You&#8217;ll do this because you&#8217;re afraid of materializing too much binary goodness in your precious RAM sticks. You&#8217;ll say &#8220;1024 bytes is plenty enough! Let&#8217;s take these one thousand twenty four bytes and put them on the output stream for the people can get those!&#8221; Then if you&#8217;re really really smart, you&#8217;ll do this in a loop until you reach the bottom of your input stream.</p>
<p>Are you all done with your computer program? I think I&#8217;m done with mine! Goody! Lets mash the run button and see what happens? Is yourz doing like mine isn&#8217;t doing? Minez is supposed to be shuttling all of the binary stuff across teh internets, but its not because its borked. I only get part of what I thought I was gonna git. Now go scratch your head like the guys in the head and shoulders commercials and pour another cup of coffee. when you get back we&#8217;ll figure out wha happend&#8230;</p>
<p>Are you back yet? Cool! Lets look into your really really smart looping program. Do you see it? Right there in the middle of your loop. You keep writin&#8217; stuff but only part of it is showing on the other end. Any idea why? My Mommy told me a long time ago, &#8220;never forget to flush! It&#8217;s just bad manners&#8230;&#8221; She was also famous for saying stuff like, &#8220;poop or get off the pot!&#8221; In the loop thing we never flush our output stream! Maybe that&#8217;s why we only see a part of the stuff on the other end. So then there&#8217;s a happy ending to the story after all isn&#8217;t there?</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/codeforfun.wordpress.com/1074/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/codeforfun.wordpress.com/1074/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/codeforfun.wordpress.com/1074/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/codeforfun.wordpress.com/1074/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/codeforfun.wordpress.com/1074/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/codeforfun.wordpress.com/1074/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/codeforfun.wordpress.com/1074/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/codeforfun.wordpress.com/1074/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/codeforfun.wordpress.com/1074/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/codeforfun.wordpress.com/1074/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codeforfun.wordpress.com&blog=228419&post=1074&subd=codeforfun&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://codeforfun.wordpress.com/2009/11/16/dont-forget-to-flush/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/11e7597f889f569d804b6f8c79e60e6a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Cliff</media:title>
		</media:content>
	</item>
		<item>
		<title>Linux Can&#8217;t load library:libmawt.so</title>
		<link>http://codeforfun.wordpress.com/2009/11/13/linux-cant-load-librarylibmawt-so/</link>
		<comments>http://codeforfun.wordpress.com/2009/11/13/linux-cant-load-librarylibmawt-so/#comments</comments>
		<pubDate>Fri, 13 Nov 2009 14:38:07 +0000</pubDate>
		<dc:creator>Cliff</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[AWT]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Linux Hacks]]></category>
		<category><![CDATA[Window Toolkits]]></category>

		<guid isPermaLink="false">http://codeforfun.wordpress.com/?p=1072</guid>
		<description><![CDATA[Your a Java developer and you&#8217;ve installed Linux. Maybe this is your first time converting from Windows. Maybe you&#8217;re a Linux veteran trying Java for the first time. Maybe you&#8217;re new to both Java and Linux and you&#8217;re running some crappy program some other Java guy wrote. Whatever your background is, you now find yourself [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codeforfun.wordpress.com&blog=228419&post=1072&subd=codeforfun&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Your a Java developer and you&#8217;ve installed Linux. Maybe this is your first time converting from Windows. Maybe you&#8217;re a Linux veteran trying Java for the first time. Maybe you&#8217;re new to both Java and Linux and you&#8217;re running some crappy program some other Java guy wrote. Whatever your background is, you now find yourself staring at an unstatisfied link error. You don&#8217;t know what angered the link and you have no idea how to satisfy it. Hi, I&#8217;m <a href="http://codeforfun.wordpress.com/about">Cliff</a> and you&#8217;re here because you suck at satisfying links. But we already knew that, didn&#8217;t we? Does the error below look familiar?</p>
<p>java.lang.UnsatisfiedLinkError: Can&#8217;t load library: /usr/lib/jvm/java-6-openjdk/jre/lib/amd64/motif21/libmawt.so<br />
 at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1666)<br />
 at java.lang.Runtime.load0(Runtime.java:787)<br />
 at java.lang.System.load(System.java:1022)<br />
 at java.lang.ClassLoader$NativeLibrary.load(Native Method)<br />
 at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1767)<br />
 at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1684)<br />
 at java.lang.Runtime.loadLibrary0(Runtime.java:840)<br />
 at java.lang.System.loadLibrary(System.java:1047)<br />
 at sun.security.action.LoadLibraryAction.run(LoadLibraryAction.java:67)<br />
 at sun.security.action.LoadLibraryAction.run(LoadLibraryAction.java:47)<br />
 at java.security.AccessController.doPrivileged(Native Method)<br />
 at java.awt.Toolkit.loadLibraries(Toolkit.java:1610)<br />
 at java.awt.Toolkit.(Toolkit.java:1632)</p>
<p>The long answer begins, &#8220;four score and seventeen (&#8230;seven? &#8230;several?) years ago&#8230;&#8221; and continues with babbling about openjdk and motif libs with a bunch of other nonsense you probably don&#8217;t particularly care about. The short story (which is also why you&#8217;re here listening to the most long-winded developer this side of the east coast that loves to insert rambling between parenthesis as if that makes any of his blog posts easier on the eyes&#8230;) is that you probably need to unset or set an environment variable. &#8220;export AWT_TOOLKIT=MToolkit&#8221; will cause the error while &#8220;export AWT_TOOLKIT=XToolkit&#8221; should make it go away. The environment variable controls which one of Linux&#8217;s windowing toolkits are used to draw the program on your screen. The MToolkit causes the Java program to look for the &#8220;libmawt.so&#8221; file which is a Motif Abstract Windowing Toolkit Shared Object, hence the &#8220;m-a-w-t.s-o&#8221; in the file name. Shared objects are the Linux way of sharing code. Other operating systems use other files. Windows uses &#8220;.dll&#8221; files, while Mac OSX uses &#8220;dylib&#8221; files. The Abstract Windowing Toolkit is the Java way of drawing programs on your screen which is abstract so that it can change the way the program looks and feels. Motif is one of the many looks of a java program, while others include &#8220;Native&#8221;, &#8220;Metal&#8221;, &#8220;Aqua&#8221; and others. Not all of these looks are available in each distribution of Java so chances are that you copied a program from a system (or developed a program for a system) that included the Motif look and feel and now you&#8217;re trying to run it on your fresh Linux install. </p>
<p>The good news is the problem is easy to fix once you know the how and why. The bad news is you&#8217;ll probably do something clever like putting &#8220;AWT_TOOLKIT=XToolkit&#8221; in your &#8220;~/.bash_profile&#8221; and forget this hack is in place which will likely cause other issues several months down the line when you want to toy with Compiz-Fusion but your IntelliJ editor is acting funny, locking up or going completely dark or something. That&#8217;s your good-news/bad-news for the day. Happy coding and clever hacking to you all.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/codeforfun.wordpress.com/1072/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/codeforfun.wordpress.com/1072/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/codeforfun.wordpress.com/1072/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/codeforfun.wordpress.com/1072/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/codeforfun.wordpress.com/1072/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/codeforfun.wordpress.com/1072/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/codeforfun.wordpress.com/1072/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/codeforfun.wordpress.com/1072/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/codeforfun.wordpress.com/1072/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/codeforfun.wordpress.com/1072/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codeforfun.wordpress.com&blog=228419&post=1072&subd=codeforfun&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://codeforfun.wordpress.com/2009/11/13/linux-cant-load-librarylibmawt-so/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/11e7597f889f569d804b6f8c79e60e6a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Cliff</media:title>
		</media:content>
	</item>
		<item>
		<title>Wave to me</title>
		<link>http://codeforfun.wordpress.com/2009/11/03/wave-to-me/</link>
		<comments>http://codeforfun.wordpress.com/2009/11/03/wave-to-me/#comments</comments>
		<pubDate>Tue, 03 Nov 2009 19:05:42 +0000</pubDate>
		<dc:creator>Cliff</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://codeforfun.wordpress.com/?p=1063</guid>
		<description><![CDATA[I received a Google Wave invite this morning from a friend and I was all excited and ready to jump in. You know that feeling you get when you put on your favorite hat and your best shoes, grab a six pack and run into the party but nobody&#8217;s there? Yeah, thats the feeling. It&#8217;s [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codeforfun.wordpress.com&blog=228419&post=1063&subd=codeforfun&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I received a Google Wave invite this morning from a friend and I was all excited and ready to jump in. You know that feeling you get when you put on your favorite hat and your best shoes, grab a six pack and run into the party but nobody&#8217;s there? Yeah, thats the feeling. It&#8217;s like the Music is playing but there&#8217;s no DJ on the turn tables. You got a full tank of gas, you mash the pedal but the transmission is slipping. It&#8217;s when you pour the most gigantimous bowl of Lucky Charms, grab the shovel from next to the microwave oven, dig it into the bowl then open the refrigerator door to find an empty milk carton. I&#8217;m not out of hope, if I gotta wave to complete strangers then that&#8217;s what I&#8217;ll do for now. It&#8217;d be much better if Google found a way to make it work with existing communications like AIM, email, MyBook and FaceSpace. Then people would have some use for it other than a place holder in an otherwise empty conversation, &#8220;&#8230;say y&#8217;know I got one uh dose G Wiz Googly Wave thing-a-ma-jigs&#8230; it&#8217;s awesome&#8230;&#8221;</p>
<p>If you&#8217;re in the same boat as I am, look for clifton.craig somewhere in the wave system. By the way, how do you search and find new contacts with this crazy thing? Until then, I&#8217;m waving but nobody&#8217;s waving back&#8230; holler&#8230;</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/codeforfun.wordpress.com/1063/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/codeforfun.wordpress.com/1063/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/codeforfun.wordpress.com/1063/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/codeforfun.wordpress.com/1063/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/codeforfun.wordpress.com/1063/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/codeforfun.wordpress.com/1063/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/codeforfun.wordpress.com/1063/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/codeforfun.wordpress.com/1063/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/codeforfun.wordpress.com/1063/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/codeforfun.wordpress.com/1063/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codeforfun.wordpress.com&blog=228419&post=1063&subd=codeforfun&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://codeforfun.wordpress.com/2009/11/03/wave-to-me/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/11e7597f889f569d804b6f8c79e60e6a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Cliff</media:title>
		</media:content>
	</item>
		<item>
		<title>Hard to test things</title>
		<link>http://codeforfun.wordpress.com/2009/10/28/hard-to-test-things/</link>
		<comments>http://codeforfun.wordpress.com/2009/10/28/hard-to-test-things/#comments</comments>
		<pubDate>Wed, 28 Oct 2009 23:21:03 +0000</pubDate>
		<dc:creator>Cliff</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[iPhone SDK]]></category>
		<category><![CDATA[iPhone TDD]]></category>
		<category><![CDATA[Objective C]]></category>

		<guid isPermaLink="false">http://codeforfun.wordpress.com/?p=1059</guid>
		<description><![CDATA[So I&#8217;d been thinking. Because I&#8217;m back into iPhone development and getting warmed up not only to ObjC issues and errors but also C++ oddities, I&#8217;m wondering how do you write tests for some of the more difficult things to capture? For instance, I&#8217;ve figured out how to capture some of the manual reference counting [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codeforfun.wordpress.com&blog=228419&post=1059&subd=codeforfun&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>So I&#8217;d been thinking. Because I&#8217;m back into iPhone development and getting warmed up not only to ObjC issues and errors but also C++ oddities, I&#8217;m wondering how do you write tests for some of the more difficult things to capture? For instance, I&#8217;ve figured out how to capture some of the manual reference counting that&#8217;s required by CocoaTouch. (I assert that objects passed into other objects are properly retained and properly released when the object itself is released.) Still I can&#8217;t capture the more involved memory management problems. How do you assert an autorelease? What about dynamic memory allocation with pointers? I ended up with a single method that dynamically allocates for a pointer via malloc. I then changed it to use new with array notation. </p>
<p>void MySpecialObject::writeRequestToStream(CFStringRef aRequest, CFWriteStreamRef requestStream)<br />
{<br />
  if(CFWriteStreamGetStatus(requestStream) == kCFStreamStatusNotOpen) CFWriteStreamOpen(requestStream);<br />
  UInt8* convertedString =(UInt8*)convertToCString(aRequest);<br />
  CFWriteStreamWrite(requestStream, convertedString, CFStringGetLength(aRequest));<br />
  free(convertedString);<br />
}</p>
<p>It&#8217;s used in one spot so far and I&#8217;ve manually added the free without a prior failing test. I felt dirty. Assuming there were no call to free, how would you write a failing test for the code above? Is this just one of those things where you have to be extra careful? Maybe I should investigate the use of Velocity style code macros/templates that expand after keying special abbreviation similar to what we have in IntelliJ. I can imagine something like &#8220;cstr&#8221; expanding to:</p>
<p>char *myCStr = new char[size];<br />
// use myCStr here<br />
free(myCStr);</p>
<p>With the ability to tab through highlighting the variable name, declared size and commented insert code section. Any bright ideas?</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/codeforfun.wordpress.com/1059/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/codeforfun.wordpress.com/1059/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/codeforfun.wordpress.com/1059/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/codeforfun.wordpress.com/1059/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/codeforfun.wordpress.com/1059/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/codeforfun.wordpress.com/1059/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/codeforfun.wordpress.com/1059/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/codeforfun.wordpress.com/1059/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/codeforfun.wordpress.com/1059/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/codeforfun.wordpress.com/1059/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codeforfun.wordpress.com&blog=228419&post=1059&subd=codeforfun&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://codeforfun.wordpress.com/2009/10/28/hard-to-test-things/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/11e7597f889f569d804b6f8c79e60e6a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Cliff</media:title>
		</media:content>
	</item>
		<item>
		<title>Downgrade your iPhone DFU mode</title>
		<link>http://codeforfun.wordpress.com/2009/10/26/downgrade-your-iphone-dfu-mode/</link>
		<comments>http://codeforfun.wordpress.com/2009/10/26/downgrade-your-iphone-dfu-mode/#comments</comments>
		<pubDate>Mon, 26 Oct 2009 13:15:24 +0000</pubDate>
		<dc:creator>Cliff</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[DFU Mode]]></category>
		<category><![CDATA[firmware hacks]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[iPhone SDK]]></category>

		<guid isPermaLink="false">http://codeforfun.wordpress.com/?p=1057</guid>
		<description><![CDATA[My iPhone crapped out on me this weekend. I went to use it and the screen wouldn&#8217;t show at all. I loaded iTunes which was able to recognize it and offer to restore it to factory. Word of advice, iTunes is very sneaky! I didn&#8217;t realize that the factory restore it offered came with a [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codeforfun.wordpress.com&blog=228419&post=1057&subd=codeforfun&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>My iPhone crapped out on me this weekend. I went to use it and the screen wouldn&#8217;t show at all. I loaded iTunes which was able to recognize it and offer to restore it to factory. Word of advice, iTunes is very sneaky! I didn&#8217;t realize that the factory restore it offered came with a complimentary upgrade to OS 3.1.2! It became apparent after I went to use the device and swiped right revealing the new spotlight search. Crap! I needed to keep it on 2.2 because I need to verify 2.2 compatibility. No worries, I&#8217;l just down grade when I get to the office. I then realized that I couldn&#8217;t build and run on device using XCode. I was getting &#8220;No Provisioned device connected&#8221; errors. I got concerned thinking I had to go through the whole re-provisioning my device hassle. Then I realized the &#8220;use for development&#8221; button in XCode. One thing lead to another then I finally realized all of the ugly truths about iPhone development. </p>
<p>1. OS 3.1.2 only accepts builds from XCode with iPhone SDK 3.1.2.<br />
2. The iPhone SDK 3.1.2 only installs on OSX 10.6 (Snow Leopard)<br />
3. Apple no longer offers any iPhone OS earlier than 3.1.2 on its website.<br />
4. If you are lucky enough to find a lingering copy of iPhone OS 3.0 or earlier, you cannot roll back from 3.1.2 (&#8230;easily) due to baseband errors.<br />
5. DFU mode is not easy to do or understand.<br />
6. You will likely spend the good part of a couple of days trying to recover from an unintentional upgrade as your first 5-7 rollbacks will leave you with misc errors.</p>
<p>The simple answer is that you cannot downgrade the OS without using DFU mode. DFU stands for Device Firmware Upgrade and is a secret mode that Apple doesn&#8217;t want you to know about. You have to use something similar to the old Nintendo Contra cheat (you remember up, up, down, down, left, right, left, right, b, a&#8230;) to enable it. I&#8217;ve tried it a couple of times so far and realized that you probably should have a completely installed OS before trying it. My second attempt (after a fresh iTunes restore) left me with an error and I&#8217;m hoping the third time is a charm. Here goes nothing&#8230;</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/codeforfun.wordpress.com/1057/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/codeforfun.wordpress.com/1057/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/codeforfun.wordpress.com/1057/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/codeforfun.wordpress.com/1057/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/codeforfun.wordpress.com/1057/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/codeforfun.wordpress.com/1057/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/codeforfun.wordpress.com/1057/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/codeforfun.wordpress.com/1057/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/codeforfun.wordpress.com/1057/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/codeforfun.wordpress.com/1057/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codeforfun.wordpress.com&blog=228419&post=1057&subd=codeforfun&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://codeforfun.wordpress.com/2009/10/26/downgrade-your-iphone-dfu-mode/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/11e7597f889f569d804b6f8c79e60e6a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Cliff</media:title>
		</media:content>
	</item>
	</channel>
</rss>