<?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"
	>

<channel>
	<title>/dev/random &#187; Programming</title>
	<atom:link href="http://mcdevzone.com/category/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://mcdevzone.com</link>
	<description>Reality has a liberal bias</description>
	<pubDate>Sun, 07 Sep 2008 21:58:33 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.1</generator>
	<language>en</language>
			<item>
		<title>Error alert of the week</title>
		<link>http://mcdevzone.com/2008/08/27/error-alert-of-the-week/</link>
		<comments>http://mcdevzone.com/2008/08/27/error-alert-of-the-week/#comments</comments>
		<pubDate>Wed, 27 Aug 2008 20:42:21 +0000</pubDate>
		<dc:creator>mike</dc:creator>
		
		<category><![CDATA[Macintosh]]></category>

		<category><![CDATA[Programming]]></category>

		<category><![CDATA[iPhone]]></category>

		<category><![CDATA[fail]]></category>

		<category><![CDATA[xcode]]></category>

		<guid isPermaLink="false">http://mcdevzone.com/?p=3843</guid>
		<description><![CDATA[Xcode gives this very informative error message when an iPhone enabled for development is being updated in iTunes.
Uploaded with plasq&#8217;s Skitch!
]]></description>
			<content:encoded><![CDATA[<p>Xcode gives this very informative error message when an iPhone enabled for development is being updated in iTunes.</p>
<div class="thumbnail" align=center><a href="http://skitch.com/mike3k/wppx/very-informative-xcode-error" onclick="javascript:pageTracker._trackPageview ('/outbound/skitch.com');"><img src="http://img.skitch.com/20080827-x1bnsdqh291i8yx8ha2ft9ijm3.preview.jpg" alt="Very informative XCode error" /></a><br /><span style="font-family: Lucida Grande, Trebuchet, sans-serif, Helvetica, Arial; font-size: 10px; color: #808080">Uploaded with <a href="http://plasq.com/" onclick="javascript:pageTracker._trackPageview ('/outbound/plasq.com');">plasq</a>&#8217;s <a href="http://skitch.com" onclick="javascript:pageTracker._trackPageview ('/outbound/skitch.com');">Skitch</a>!</span></div>
]]></content:encoded>
			<wfw:commentRss>http://mcdevzone.com/2008/08/27/error-alert-of-the-week/feed/</wfw:commentRss>
		</item>
		<item>
		<title>I love when things suddenly fall into place</title>
		<link>http://mcdevzone.com/2008/08/26/i-love-when-things-suddenly-fall-into-place/</link>
		<comments>http://mcdevzone.com/2008/08/26/i-love-when-things-suddenly-fall-into-place/#comments</comments>
		<pubDate>Wed, 27 Aug 2008 02:03:59 +0000</pubDate>
		<dc:creator>mike</dc:creator>
		
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://mcdevzone.com/?p=3837</guid>
		<description><![CDATA[For the past few months I&#8217;ve been working on a server administration application (I can&#8217;t go into specifics). It was ported Windows code that included some MFC emulation using old-fashioned Mac APIs such as WaitNextEvent. As expected, it never worked reliably and I was starting to feel defeated by it.
I figured out that the actual [...]]]></description>
			<content:encoded><![CDATA[<p>For the past few months I&#8217;ve been working on a server administration application (I can&#8217;t go into specifics). It was ported Windows code that included some MFC emulation using old-fashioned Mac APIs such as WaitNextEvent. As expected, it never worked reliably and I was starting to feel defeated by it.</p>
<p>I figured out that the actual server code consisted of self-contained C++ objects that had very little to do with the application code. I ended up throwing away most of the old application code and grafting the server code into a modern Cocoa application using some ObjectiveC++ bridge classes. Once I got it to build, it took less than a day to get it working, and in the process fixed lots of long-standing bugs.</p>
]]></content:encoded>
			<wfw:commentRss>http://mcdevzone.com/2008/08/26/i-love-when-things-suddenly-fall-into-place/feed/</wfw:commentRss>
		</item>
		<item>
		<title>TouchCode Rocks</title>
		<link>http://mcdevzone.com/2008/08/13/touchcode-rocks/</link>
		<comments>http://mcdevzone.com/2008/08/13/touchcode-rocks/#comments</comments>
		<pubDate>Thu, 14 Aug 2008 02:25:53 +0000</pubDate>
		<dc:creator>mike</dc:creator>
		
		<category><![CDATA[Programming]]></category>

		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://mcdevzone.com/?p=3766</guid>
		<description><![CDATA[TouchCode is a set of iPhone open source projects that fill in some features that are missing from Cocoa Touch. The most useful part is TouchXML, which is a drop-in replacement for Cocoa&#8217;s NSXML* classes.
I was able to get the unmodified ObjectiveFlickr code working by simply doing a global search &#038; replace of NSXMLDocument with [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://toxicsoftware.com/touchcode-usage/" onclick="javascript:pageTracker._trackPageview ('/outbound/toxicsoftware.com');">TouchCode</a> is a set of iPhone open source projects that fill in some features that are missing from Cocoa Touch. The most useful part is TouchXML, which is a drop-in replacement for Cocoa&#8217;s NSXML* classes.</p>
<p>I was able to get the unmodified ObjectiveFlickr code working by simply doing a global search &#038; replace of NSXMLDocument with CXMLDocument, NSXMLNode with CXMLNode, and NSXMLElement with CXMLElement. The result is less ugly than using NSXMLParser.</p>
<p>For the Official LOLCats application I need to handle RSS feeds, which I found to be exceptionally ugly with NSXMLParser. With TouchXML it&#8217;s easy. I can get an array of items with something like this:</p>
<blockquote><p><code><br />
    NSError *err = nil;<br />
    CXMLDocument *doc = [[CXMLDocument alloc]<br />
                            initWithContentsOfURL: [NSURL URLWithString: @"http://feeds.feedburner.com/myfeed"]<br />
                         options:0 error: &#038;err];<br />
<br />
    NSArray *nodes = [doc nodesForXPath: @"//item" error: nil];<br />
</code></p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://mcdevzone.com/2008/08/13/touchcode-rocks/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Flickr Frameworks on the iPhone</title>
		<link>http://mcdevzone.com/2008/08/12/flickr-frameworks-on-the-iphone/</link>
		<comments>http://mcdevzone.com/2008/08/12/flickr-frameworks-on-the-iphone/#comments</comments>
		<pubDate>Wed, 13 Aug 2008 02:00:27 +0000</pubDate>
		<dc:creator>mike</dc:creator>
		
		<category><![CDATA[Programming]]></category>

		<category><![CDATA[iPhone]]></category>

		<category><![CDATA[flickr]]></category>

		<category><![CDATA[zooomr]]></category>

		<guid isPermaLink="false">http://mcdevzone.com/?p=3762</guid>
		<description><![CDATA[I spent the weekend modifying ObjectiveFlickr to work on the iPhone, which was mostly a matter of changing the response handling code that depends on NSXMLDocument. I was pretty much able to plug in my MCFlickrParser class, which I use in LOLCats, to create a NSDictionary structured very much like the XML document.
Yesterday I was [...]]]></description>
			<content:encoded><![CDATA[<p>I spent the weekend modifying <a href="http://lukhnos.org/objectiveflickr/blog/" onclick="javascript:pageTracker._trackPageview ('/outbound/lukhnos.org');">ObjectiveFlickr</a> to work on the iPhone, which was mostly a matter of changing the response handling code that depends on NSXMLDocument. I was pretty much able to plug in my MCFlickrParser class, which I use in LOLCats, to create a NSDictionary structured very much like the XML document.</p>
<p>Yesterday I was informed about <a href="http://speirs.org/svn/FlickrKit/" onclick="javascript:pageTracker._trackPageview ('/outbound/speirs.org');">FlickrKit</a>, which already works on the iPhone. FlickrKit seems more advanced, but it&#8217;s also a lot larger than ObjectiveFlickr. I created simple Flickr browsers using both frameworks. The FlickrKit version is 704k, while the ObjectiveFlickr version is only 148k. I&#8217;ve only tried it on the simulator and the performance seems about the same for both.</p>
<p>I will probably stick with OF for this project, since I would like to support Zooomr as well as Flickr and OF already seems to support Zooomr.</p>
]]></content:encoded>
			<wfw:commentRss>http://mcdevzone.com/2008/08/12/flickr-frameworks-on-the-iphone/feed/</wfw:commentRss>
		</item>
		<item>
		<title>LOLCats 1.1 is available</title>
		<link>http://mcdevzone.com/2008/08/10/app-store-frustration/</link>
		<comments>http://mcdevzone.com/2008/08/10/app-store-frustration/#comments</comments>
		<pubDate>Mon, 11 Aug 2008 02:16:14 +0000</pubDate>
		<dc:creator>mike</dc:creator>
		
		<category><![CDATA[Programming]]></category>

		<category><![CDATA[iPhone]]></category>

		<category><![CDATA[Apple]]></category>

		<category><![CDATA[flickr]]></category>

		<category><![CDATA[lolcats]]></category>

		<category><![CDATA[zooomr]]></category>

		<guid isPermaLink="false">http://mcdevzone.com/?p=3749</guid>
		<description><![CDATA[UPDATE: Minutes after I posted this, I got a notice from Apple that the update has been approved and is now ready for sale.
Apple still hasn&#8217;t approved my update to LOLCats. Still no response from Apple for the second update, which I feel is pretty urgent, since it reduces the possibility of inappropriate images appearing, [...]]]></description>
			<content:encoded><![CDATA[<p><strong>UPDATE</strong>: Minutes after I posted this, I got a notice from Apple that the update has been approved and is now ready for sale.</p>
<p><del datetime="2008-08-11T02:24:27+00:00">Apple <b>still</b> hasn&#8217;t approved my update to LOLCats. Still no response from Apple for the second update, which I feel is pretty urgent, since it reduces the possibility of inappropriate images appearing, which I&#8217;ve received several complaints about.<br />
</del><br />
I&#8217;m now getting close to another update, which adds Zooomr support.</p>
<p>Meanwhile, I&#8217;m working on a second Flickr-related application. I had expected to share a lot of code with LOLCats, but it turns out I&#8217;ve only reused one class, my Flickr parser. </p>
<p>For this app, I need to support Flickr authorization, so it seemed easier to rewrite Flickr&#8217;s ObjectiveFlickr code, which already supports authorization. However, ObjectiveFlickr depends on XMLDocument, which isn&#8217;t available on the iPhone. I&#8217;m replacing the response handling code with my Flickr parser class. When it&#8217;s finished, I&#8217;ll release the Flickr-related code (not the entire app) as open source.</p>
<p>On a fun note, I purposely added the LOLCATS tag to this photo of Midnight to make it to appear in the application. As a result, the number of hits on that photo are about 100x the average for my similar photos.</p>
<p><a href="http://www.flickr.com/photos/44124367601@N01/2750386650" title="View 'Midnight watching' on Flickr.com" onclick="javascript:pageTracker._trackPageview ('/outbound/www.flickr.com');">
<div style="text-align:center;"><img src="http://farm4.static.flickr.com/3004/2750386650_7616ac13e3.jpg" alt="Midnight watching" border="0" width="375" height="500" /></div>
<p></a></p>
]]></content:encoded>
			<wfw:commentRss>http://mcdevzone.com/2008/08/10/app-store-frustration/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Zooomr supports Flickr API</title>
		<link>http://mcdevzone.com/2008/08/08/zooomr-supports-flickr-api/</link>
		<comments>http://mcdevzone.com/2008/08/08/zooomr-supports-flickr-api/#comments</comments>
		<pubDate>Sat, 09 Aug 2008 02:02:28 +0000</pubDate>
		<dc:creator>mike</dc:creator>
		
		<category><![CDATA[Photography]]></category>

		<category><![CDATA[Programming]]></category>

		<category><![CDATA[Web]]></category>

		<category><![CDATA[flickr]]></category>

		<guid isPermaLink="false">http://mcdevzone.com/?p=3742</guid>
		<description><![CDATA[Until I started poking around in Flickr&#8217;s Objective C code, I didn&#8217;t realize that Zooomr supported a variant of Flickr&#8217;s API. I found that it&#8217;s fairly easy to port code which uses Flickr to Zooomr. In less than an hour, I had LOLCats working with Zooomr. I plan to include Zooomr support in the other [...]]]></description>
			<content:encoded><![CDATA[<p>Until I started poking around in Flickr&#8217;s Objective C code, I didn&#8217;t realize that <a href="http://www.zooomr.com/" onclick="javascript:pageTracker._trackPageview ('/outbound/www.zooomr.com');">Zooomr</a> supported a variant of Flickr&#8217;s API. I found that it&#8217;s fairly easy to port code which uses Flickr to Zooomr. In less than an hour, I had LOLCats working with Zooomr. I plan to include Zooomr support in the other iPhone Flickr app I&#8217;m working on.</p>
]]></content:encoded>
			<wfw:commentRss>http://mcdevzone.com/2008/08/08/zooomr-supports-flickr-api/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Setting up Subversion at MediaTemple</title>
		<link>http://mcdevzone.com/2008/08/05/setting-up-subversion-at-mediatemple/</link>
		<comments>http://mcdevzone.com/2008/08/05/setting-up-subversion-at-mediatemple/#comments</comments>
		<pubDate>Wed, 06 Aug 2008 03:32:23 +0000</pubDate>
		<dc:creator>mike</dc:creator>
		
		<category><![CDATA[Programming]]></category>

		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://mcdevzone.com/?p=3734</guid>
		<description><![CDATA[I recently moved my Subversion repositories from my home server to Dreamhost, for the extra safety of an offsite backup of my source code. When I switched this domain to MediaTemple it unsurprisingly broke my Subversion repository.
While DreamHost provides an easy one click Subversion setup, it requires a little more work on MediaTemple. After a [...]]]></description>
			<content:encoded><![CDATA[<p>I recently moved my Subversion repositories from my home server to Dreamhost, for the extra safety of an offsite backup of my source code. When I switched this domain to MediaTemple it unsurprisingly broke my Subversion repository.</p>
<p>While DreamHost provides an easy one click Subversion setup, it requires a little more work on MediaTemple. After a few headaches, I managed to get it set up. I hope I can save some people a bit of trouble with these tips. This only applies to a GridServer. It will probably be different for other MediaTemple account types.</p>
<p>Unlike DreamHost, the GridServer doesn&#8217;t support HTTP access for Subversion; you can only use SSH. Note that your SSH login includes the domain name. The login will usually be serveradmin%yourdomain.com@yourdomain.com.</p>
<p>You&#8217;ll need to log in to your serveradmin account via ssh to create the repository. For best results, it should be in in the /data directory. After logging in, create the repository with the following commands:</p>
<blockquote><p><tt>cd data<br />svnadmin create &#8211;fs-type fsfs SVN</tt></p></blockquote>
<p>This will create a repository named SVN. You can use a different name if you prefer.</p>
<p>You can then set up the repository in XCode. Create a new repository configuration and enter a URL like <tt>svn+ssh://serveradmin%<b>yourdomain</b>.com@<b>yourdomain</b>.com/home/<b>XXXXX</b>/data/SVN</tt>. To find the actual path, when you&#8217;re logged in via ssh, enter the command <tt>pwd</tt>, which will give you something like /home/11111/users/.home. You can ignore the /users/.home part.</p>
<p>Be very careful to enter the login and password correctly. If you attempt too many incorrect logins, you will be locked out. To regain access, go to the Mediatemple control panel and click the button to unlock, and wait about 10 minutes.</p>
<div align=center class="thumbnail"><a href="http://skitch.com/mike3k/1iyn/svn-setup" onclick="javascript:pageTracker._trackPageview ('/outbound/skitch.com');"><img src="http://img.skitch.com/20080806-exhx3m9fur8sghrr64m7qxmq77.preview.jpg" alt="SVN Setup" /></a><br /><span style="font-family: Lucida Grande, Trebuchet, sans-serif, Helvetica, Arial; font-size: 10px; color: #808080">Uploaded with <a href="http://plasq.com/" onclick="javascript:pageTracker._trackPageview ('/outbound/plasq.com');">plasq</a>&#8217;s <a href="http://skitch.com" onclick="javascript:pageTracker._trackPageview ('/outbound/skitch.com');">Skitch</a>!</span></div>
]]></content:encoded>
			<wfw:commentRss>http://mcdevzone.com/2008/08/05/setting-up-subversion-at-mediatemple/feed/</wfw:commentRss>
		</item>
		<item>
		<title>This brings back some memories</title>
		<link>http://mcdevzone.com/2008/07/31/this-brings-back-some-memories/</link>
		<comments>http://mcdevzone.com/2008/07/31/this-brings-back-some-memories/#comments</comments>
		<pubDate>Fri, 01 Aug 2008 00:19:02 +0000</pubDate>
		<dc:creator>mike</dc:creator>
		
		<category><![CDATA[Programming]]></category>

		<category><![CDATA[6502]]></category>

		<guid isPermaLink="false">http://mcdevzone.com/?p=3712</guid>
		<description><![CDATA[I found this very interesting article about the MOS 6502 processor&#8217;s illegal opcodes. My first computer was an Ohio Scientific Challenger 1P, on which I did a lot of 6502 assembly language programming.
]]></description>
			<content:encoded><![CDATA[<p>I found <a href="http://www.pagetable.com/?p=39" onclick="javascript:pageTracker._trackPageview ('/outbound/www.pagetable.com');">this very interesting article</a> about the <a href="http://en.wikipedia.org/wiki/6502" onclick="javascript:pageTracker._trackPageview ('/outbound/en.wikipedia.org');">MOS 6502</a> processor&#8217;s illegal opcodes. My first computer was an <a href="http://en.wikipedia.org/wiki/Ohio_Scientific" onclick="javascript:pageTracker._trackPageview ('/outbound/en.wikipedia.org');">Ohio Scientific</a> Challenger 1P, on which I did a lot of 6502 assembly language programming.</p>
]]></content:encoded>
			<wfw:commentRss>http://mcdevzone.com/2008/07/31/this-brings-back-some-memories/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Another Photowalk</title>
		<link>http://mcdevzone.com/2008/07/30/another-photowalk/</link>
		<comments>http://mcdevzone.com/2008/07/30/another-photowalk/#comments</comments>
		<pubDate>Wed, 30 Jul 2008 16:03:13 +0000</pubDate>
		<dc:creator>mike</dc:creator>
		
		<category><![CDATA[Local]]></category>

		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://mcdevzone.com/?p=3707</guid>
		<description><![CDATA[Paulo is planning another photowalk on August 23 in connection with Scott Kelby&#8217;s Worldwide Photo Walk. This one will be in Lauderdale-by-the-sea, a quaint beach town only a few miles from me, at the end of Commercial Blvd. I&#8217;ve been there many times.
]]></description>
			<content:encoded><![CDATA[<p><a href="http://paulopics.com/blog/2008/07/30/5-feet-tall-shark-died-in-south-florida-hot-water/" onclick="javascript:pageTracker._trackPageview ('/outbound/paulopics.com');">Paulo</a> is planning another photowalk on August 23 in connection with <a href="http://www.photoshopuser.com/photowalk/" onclick="javascript:pageTracker._trackPageview ('/outbound/www.photoshopuser.com');">Scott Kelby</a>&#8217;s Worldwide Photo Walk. This one will be in Lauderdale-by-the-sea, a quaint beach town only a few miles from me, at the end of Commercial Blvd. I&#8217;ve been there many times.</p>
]]></content:encoded>
			<wfw:commentRss>http://mcdevzone.com/2008/07/30/another-photowalk/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Cocoa debugging tip</title>
		<link>http://mcdevzone.com/2008/07/25/cocoa-debugging-tip/</link>
		<comments>http://mcdevzone.com/2008/07/25/cocoa-debugging-tip/#comments</comments>
		<pubDate>Fri, 25 Jul 2008 15:08:32 +0000</pubDate>
		<dc:creator>mike</dc:creator>
		
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://mcdevzone.com/?p=3691</guid>
		<description><![CDATA[When you&#8217;re debugging a memory allocation issue, it&#8217;s very useful to be able to see the retain count of an object. One way to do it is by calling the object&#8217;s retainCount method, which you can do in the debugger console by entering something like call (int)[self retainCount].
That&#8217;s a lot of typing if you do [...]]]></description>
			<content:encoded><![CDATA[<p>When you&#8217;re debugging a memory allocation issue, it&#8217;s very useful to be able to see the retain count of an object. One way to do it is by calling the object&#8217;s retainCount method, which you can do in the debugger console by entering something like <tt>call (int)[self retainCount]</tt>.</p>
<p>That&#8217;s a lot of typing if you do it very often. Fortunately GDB lets you create macros that can make it a lot easier. To define a macro called <tt>rc</tt>, which will print the retain count, you can define a macro as follows:</p>
<blockquote><p><code>define rc<br />
call (int)[$arg0 retainCount]<br />
end<br />
</code></p></blockquote>
<p>You can now type <tt>rc self</tt> to see the current object&#8217;s retain count. Unfortunately you&#8217;ll have to enter that definition every time you start the debugger. </p>
<p>However, GDB lets you create a startup file with commands that will be executed every time it starts up. Simply create a file called <tt>.gdbinit</tt> in your home directory and enter that definition in it. You will now have the command <tt>rc</tt> available every time you use the debugger.</p>
]]></content:encoded>
			<wfw:commentRss>http://mcdevzone.com/2008/07/25/cocoa-debugging-tip/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
