<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" version="2.0">

<channel>
	<title>andymroczblogkowski</title>
	
	<link>http://mrox.net/blog</link>
	<description>It's like the right way, but with 3 additional layers of abstraction.</description>
	<lastBuildDate>Tue, 16 Feb 2010 19:15:52 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/andymroczblogkowski" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="andymroczblogkowski" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>On Background Apps</title>
		<link>http://mrox.net/blog/2010/02/16/on-background-apps/</link>
		<comments>http://mrox.net/blog/2010/02/16/on-background-apps/#comments</comments>
		<pubDate>Tue, 16 Feb 2010 14:26:09 +0000</pubDate>
		<dc:creator>amrox</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[ipad]]></category>
		<category><![CDATA[iphone]]></category>

		<guid isPermaLink="false">http://mrox.net/blog/?p=250</guid>
		<description><![CDATA[The lack of background applications or multitasking has come into the collective chattersphere again with the announcement of the iPad. It&#8217;s the new &#8220;non-user-replacable battery&#8221;. The ability to run more than one application at a time sounds like a good thing. Two (or twelve) are better than one right? However, multitasking is a means to [...]]]></description>
			<content:encoded><![CDATA[<p>The lack of background applications or multitasking has come into the collective chattersphere again with the announcement of the iPad. It&#8217;s the new &#8220;non-user-replacable battery&#8221;. The ability to run more than one application at a time sounds like a good thing. Two (or twelve) are better than one right? However, multitasking is a means to an end, not a goal in itself. I&#8217;m interested as to <em>why</em> everyone is clamoring for the ability to run applications in the background. What exactly do we they to be able to do?</p>

<h3>The Why of Background Applications</h3>

<p>In an effort to understand the nature of background applications and multitasking from an regular user&#8217;s point of view, I tried to come up with some basic use cases.</p>

<ul>
<li><p><strong>Switching between applications efficiently.</strong> Good iPhone (and hopefully iPad) apps solve this by preserving their state when quit and restoring it at launch. If done right it usually achieves the same effect as true multitasking.</p></li>
<li><p><strong>Viewing several application at once.</strong> This is an obvious use-case for desktop OS&#8217;s with large 15&#8243;+ screens, but a non-issue for iPhone applications. It doesn&#8217;t make sense to display more than a single application at a time with such a small screen size. We&#8217;ll need to wait and see how this plays out for iPad, but my guess is that the screen size is <em>just small enough</em>.</p></li>
<li><p><strong>Things that take a long time.</strong> There are countless tasks that your computer could do &#8220;in the background&#8221; &#8212; compiling, running a scientific simulation, rendering a large video &#8212; but these aren&#8217;t usually what you want to be running on your resource-constrained mobile device. Downloading sizable files is the one kind of background task that is common in even mobile devices. iPhone&#8217;s built-in iTunes and App Stores already support this use case by downloading media and applications in the background.</p>

<p>&#42; iPhone OS has no public API that allows for downloading data in the background while your application is no longer running. </p></li>
<li><p><strong>Notifications.</strong> Sometimes we want to be notified when a new email or instant message arrives. Although it&#8217;s not perfect, this use case is mostly addressed by the Apple Push Notification service. Again, when done right, the actual user experience is very close to what a real background application could deliver. </p></li>
<li><p><strong>Audio</strong>. Audio is in a slightly different category than everything else. It can be consumed effectively without any on-screen interface and extremely minimal user interaction. On iPhone, the built-in iPod application can play file-based audio content in the background. However, there are many sources of audio that don&#8217;t come from files stored on your device, a prime example being streaming internet radio.</p>

<p>&#42; iPhone OS has no public API that allows for playing streaming audio in the background while your application is no longer running.</p></li>
</ul>

<p><strong>Update:</strong> Adam Engst posted some <a href="http://db.tidbits.com/article/10989">similar thoughts</a> on the same subject of background apps after I began writing this post (I&#8217;m a slow writer). He brought up one use case that wasn&#8217;t in my original list:</p>

<ul>
<li><strong>Inter-application communication.</strong> The majority of every-day inter-application communication is via Copy/Paste or Drag/Drop (which is essentially Copy/Paste anyway). As of version 3.0, iPhone OS supports Copy/Paste, and the Drag/Drop metaphor doesn&#8217;t make as much sense for iPhone applications, so it&#8217;s reasonable that it&#8217;s ommitted.</li>
</ul>

<p>Of the <del>five</del> six general use cases listed above four are either not applicable or addressed in some way. That leaves downloading files and playing streaming audio content unaccounted for. Both downloading files and playing streaming audio have some similarities &#8212; they both are retrieving bits from the Internet. Initially, file downloads seem like the simpler case, but may bring some extra complexity to the user. </p>

<p>Arbitrary file downloads suffer from two problems: managing multiple downloads and the &#8220;where did I put that file&#8221; problem. Multiple background downloads suggests that some UI to manage these downloads will be required &#8212; which is exactly the kind of complexity that iPhone OS strives to avoid. Also, if downloads can happen in the background where do they go? Into a shared &#8220;Downloads&#8221; area, or directly into the application? Neither of these problems are insurmountable, but I bring them up to show that file downloads will require some additional thought and design to get right.</p>

<p>Streaming audio avoids the management problem with one simple restriction: only one audio stream can be active at a time. In general, you only want to play audio from a single source anyway, so this is very reasonable limitation. There are obviously battery life concerns, but let&#8217;s put those aside for a moment and consider what supporting background audio could look like from the API level.</p>

<h3>An iPhone OS API for Streaming Audio</h3>

<p>Apple added <a href="http://developer.apple.com/iphone/library/documentation/AVFoundation/Reference/AVAudioPlayerClassReference/Reference/Reference.html">AVAudioPlayer</a> in iPhone OS 2.2. At first glance, it looks like it solves most of our problem. It has an initializer that takes a URL, an observable property <code>currentTime</code> and delegate methods to provide notifications regarding interruptions and playback completion. It&#8217;s a good starting point, but we&#8217;ll need to make some changes:</p>

<ol>
<li><p><strong>Support for <code>http</code> URLs.</strong> Currently <code>AVAudioPlayer</code> can only play local file URLs that are in a format supported by Core Audio. If we extend it to include <code>http</code> URLs (in a format supported by Core Audio), we have a simple streaming player for basic audio types. We could even go one step further and include support for <a href="http://developer.apple.com/iphone/library/documentation/NetworkingInternet/Conceptual/StreamingMediaGuide/Introduction/Introduction.html">HTTP Live Streaming</a>.</p></li>
<li><p><strong>Set the Background Audio Player.</strong> Cocoa often provides shared service objects via singletons. In some cases it also allows you to set the shared instance (<a href="http://developer.apple.com/mac/library/documentation/cocoa/reference/Foundation/Classes/NSURLCache_Class/Reference/Reference.html"><code>NSURLCache</code>&#8217;s <code>setSharedURLCache:</code></a> for example).  This pattern makes sense for our use case because we only want one background audio player active at a time. We&#8217;ll add class methods to <code>AVAudioPlayer</code> to get and set the background player.</p>

<p>The one restriction is that the background audio player instance should only be accessible to the process that originally set it to maintain cross-application confidentiality. This can be enforced by having <code>AVAudioPlayer</code> store the bundle identifer of the application that started the background audio. Still, other applications may want to know if some background audio is already playing so we&#8217;ll create a second flag called <code>hasBackgroundAudioPlayer</code> that can be queried by any process.</p>

<p><code>// Returns YES if a background player is active, NO otherwise.</code><br />
<code>+ (BOOL) hasBackgroundAudioPlayer;</code></p>

<p><code>// Returns nil if called by non-owning process</code><br />
<code>+ (AVAudioPlayer *) backgroundAudioPlayer;</code></p>

<p><code>// Overrides any existing background audio players</code><br />
<code>+ (void) setBackgroundAudioPlayer:(AVAudioPLayer *)audioPlayer;</code></p></li>
<li><p><strong>Queue several URLs.</strong> An <code>AVAudioPlayer</code> instance was designed to play only a single file. To play multiple files in succession, an <code>AVAudioPlayer</code> must be created for each one. While restricting to a single file simplifies the usage of <code>AVAudioPlayer</code> it would be more useful for our case if we could queue several URLs. This way <code>AVAudioPlayer</code> can work through an entire playlist in the background.</p>

<p>We can solve this by adding a URL queue property to <code>AVAudioPlayer</code>. The contents of this queue may be directly manipulated, so we&#8217;ll just use an <code>NSMutableArray</code>. As <code>AVAudioPlayer</code> finishes playing a URL and then URL queue isn&#8217;t empty, it will remove the first URL from the queue and begin playing it.</p>

<p>Lastly, we should tweak the <code>audioPlayerDidFinishPlaying:successfully:</code> delegate method to also pass the URL that finished.</p>

<p><code>@property (readonly) NSMutableArray *URLQueue;</code></p>

<p><code>- (void)audioPlayer:(AVAudioPlayer *)player didFinishPlayingURL:(NSURL *)url successfully:(BOOL)flag</code></p></li>
</ol>

<p>Now we have an enhanced <code>AVAudioPlayer</code> that can play a list of streaming audio sources in the background. Obviously there are a number of ways to provide background audio playback. This is just one approach given to show that providing such a service can be done without full-blown multitasking and moderate API additions.</p>

<p>I think that some mechanism to play back streaming audio in the background would be a great addition to iPhone OS as long as battery life is acceptable. iPad makes this feature even more compelling. With an iPhone, you can start your favorite streaming player, put the iPhone back in your pocket, and go about your business. It&#8217;s a sidekick device. However, when you&#8217;re on your iPad, you want to <em>use</em> it. You want to be browsing the web, writing, or playing a game &#8212; not staring at the progress bar of the current track.</p>
]]></content:encoded>
			<wfw:commentRss>http://mrox.net/blog/2010/02/16/on-background-apps/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating a Default Development Profile to Run Any iPhone App</title>
		<link>http://mrox.net/blog/2010/02/10/creating-a-default-development-profile-to-run-any-iphone-app/</link>
		<comments>http://mrox.net/blog/2010/02/10/creating-a-default-development-profile-to-run-any-iphone-app/#comments</comments>
		<pubDate>Wed, 10 Feb 2010 15:33:38 +0000</pubDate>
		<dc:creator>amrox</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[xcode]]></category>

		<guid isPermaLink="false">http://mrox.net/blog/?p=229</guid>
		<description><![CDATA[I&#8217;m collaborating on an iPhone project and the topic of sharing device UDIDs for development came up. I was surprised to learn that other developers didn&#8217;t have a default development profile that allows you to build and run any application, without installing new provisioning profiles or changing bundle IDs.

Here&#8217;s how I set mine up:



Create a [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m collaborating on an iPhone project and the topic of sharing device UDIDs for development came up. I was surprised to learn that other developers didn&#8217;t have a default development profile that allows you to build and run any application, without installing new provisioning profiles or changing bundle IDs.</p>

<p>Here&#8217;s how I set mine up:</p>

<hr />

<h3>Create a wildcard App ID in the iPhone Program Portal:</h3>

<div style="text-align:center;">
<a href="http://mrox.net/blog/wp-content/uploads/2010/02/create_wildcard_appid2.png" rel="lightbox"><img src="http://mrox.net/blog/wp-content/uploads/2010/02/create_wildcard_appid2-300x222.png" alt="" title="create_wildcard_appid" width="300" height="222" class="aligncenter size-medium wp-image-238" /></a></div>

<hr />

<h3>Create a Development Provisioning Profile with the &#8220;wildcard&#8221; App ID:</h3>

<div style="text-align:center;"><a href="http://mrox.net/blog/wp-content/uploads/2010/02/create_default_development_profile1.png" rel="lightbox"><img src="http://mrox.net/blog/wp-content/uploads/2010/02/create_default_development_profile1-300x147.png" alt="" title="create_default_development_profile" width="300" height="147" class="aligncenter size-medium wp-image-243" /></a>
</div>

<hr />

<h3>Choose the &#8220;iPhone Developer&#8221; Automatic Profile Selector</h3>

<div style="text-align:center;">


<a href="http://mrox.net/blog/wp-content/uploads/2010/02/xcode_choose_automatic_development1.png" rel="lightbox"><img src="http://mrox.net/blog/wp-content/uploads/2010/02/xcode_choose_automatic_development1-299x100.png" alt="" title="xcode_choose_automatic_development" width="299" height="100" class="aligncenter size-medium wp-image-246" /></a>
</div>

<hr />

<h3>And that&#8217;s it</h3>

<p>Now you should be able to build and run any project on your iPhone device in development mode. You won&#8217;t be able to use this configuration for distribution, but that&#8217;s why you can configure separate development and distribution profiles.</p>
]]></content:encoded>
			<wfw:commentRss>http://mrox.net/blog/2010/02/10/creating-a-default-development-profile-to-run-any-iphone-app/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My Best of 2009</title>
		<link>http://mrox.net/blog/2010/01/06/my-best-of-2009/</link>
		<comments>http://mrox.net/blog/2010/01/06/my-best-of-2009/#comments</comments>
		<pubDate>Thu, 07 Jan 2010 03:14:30 +0000</pubDate>
		<dc:creator>amrox</dc:creator>
				<category><![CDATA[Blog]]></category>

		<guid isPermaLink="false">http://mrox.net/blog/?p=219</guid>
		<description><![CDATA[I decided to share a few of my favorite things of 2009. Yes I know 2009 was so last week, but I think this post still lands within the relevancy window.

My list doesn&#8217;t necessarily includes things that were newly created last year, but rather things that were new-to-me, or made a significant impact on me [...]]]></description>
			<content:encoded><![CDATA[<p>I decided to share a few of my favorite things of 2009. Yes I know 2009 was <em>so last week</em>, but I think this post still lands within the relevancy window.</p>

<p>My list doesn&#8217;t necessarily includes things that were newly created last year, but rather things that were new-to-me, or made a significant impact on me within the year. And we&#8217;ll start it off with…</p>

<h2>Trip: Prague/Munich/Ghent</h2>

<p>I went to Prague, Munich (Oktoberfest), and Ghent (for the third time) in September with two friends. It was, of course, awesome. Amazingly though, I still haven&#8217;t posted pictures from the trip. New Year&#8217;s resolution: suck less.</p>

<h3>Runner-Up: (Tie) <a href="http://mrox.net/blog/2009/06/26/an-event-apart-09/">AEA</a>/<a href="http://beeradvocate.com/acbf/">ACBF</a> (Boston), <a href="http://mrox.net/blog/2009/06/18/wwdc-09-post-mortem/">WWDC</a> (San Francisco)</h3>

<p>It may seem like I&#8217;m cheating by listing <em>every</em> place I went in 2009, but I couldn&#8217;t really decide which trip was better. Both included technical conferences, good friends, and great memories.</p>

<h2>Local Event: <a href="http://www.phillybeerweek.org/">Philly Beer Week 2009</a></h2>

<p>Philly Beer Week came at just the right time for me, and it was a lot of fun. Some standout sub-events were the <a href="http://www.voodoobrewery.com/">Voodoo</a> tasting at <a href="http://www.yelp.com/biz/doobies-philadelphia">Doobie&#8217;s</a> and the Zythos Belgian Beer Fest to cap off the week.</p>

<h3>Runner-Up: <a href="http://www.barcampphilly.org/">BarCamp Philly 2009</a></h3>

<p>Philly&#8217;s second BarCamp was twice as good as the first. If this trend continues…</p>

<h2>Blog: <a href="http://daringfireball.net">Daring Fireball</a></h2>

<p>I&#8217;ve been a DF reader for years, but this year I decided to support Mr. Gruber and buy a membership. It&#8217;s my favorite blog.</p>

<h3>Runner-Up: <a href="http://www.uiandus.com/">UI&amp;us</a></h3>

<p>UI design is one of the most challenging, but also interesting aspects of software development for me, and this blog put forth a lot of great ideas. Plus Keith Lang is a really nice guy.</p>

<h2>Programming Site: <a href="http://stackoverflow.com/">Stack Overflow</a></h2>

<p>I was a little skeptical at first, but Stack Overflow has definitely changed the Q&amp;A landscape for the better. It&#8217;s hard to go back to forums and mailing lists.</p>

<h3>Runner-Up: <a href="http://github.com/">GitHub</a></h3>

<p>I&#8217;ve only skimmed the surface, but so far I&#8217;m impressed with GitHub. It really delivers on the promise of &#8220;Social Coding&#8221;.</p>

<h2>Local (Philly) Site: (Tie) <a href="http://technicallyphilly.com/">Technically Philly</a>, <a href="http://unbreaded.com/">Unbreaded</a></h2>

<p>Both blogs are well-written and on-topic. I couldn&#8217;t pick a clear favorite, so they&#8217;ll share the honor.</p>

<h3>Runner-Up: <a href="http://www.uwishunu.com/">uwishunu</a></h3>

<p>It&#8217;s not a new site, but it&#8217;s become my favorite place to find fun and interesting things to do in my fair city.</p>

<h2>Album: <a href="http://jaydiohead.com/">Jaydiohead</a></h2>

<p>Yes, a mashup album. Why? Because it rocks, and made a 30-year-old white guy who never cared for Jay-Z before into a fan.</p>

<h3>Runner-Up: <a href="http://www.amazon.com/gp/product/B001CZOUCG?ie=UTF8&#038;tag=andymroczblog-20&#038;linkCode=as2&#038;camp=1789&#038;creative=390957&#038;creativeASIN=B001CZOUCG">Infinity + 1 by A-Track</a><img src="http://www.assoc-amazon.com/e/ir?t=andymroczblog-20&#038;l=as2&#038;o=1&#038;a=B001CZOUCG" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /></h3>

<p>I picked this up from an Amazon MP3 deal on a whim, not knowing what to expect. Since then slowly but surely embedded itself in my brain. Super fun mix.</p>

<h2>Movie: <a href="http://www.amazon.com/gp/product/B001KVZ6FW?ie=UTF8&#038;tag=andymroczblog-20&#038;linkCode=as2&#038;camp=1789&#038;creative=390957&#038;creativeASIN=B001KVZ6FW">Up</a><img src="http://www.assoc-amazon.com/e/ir?t=andymroczblog-20&#038;l=as2&#038;o=1&#038;a=B001KVZ6FW" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /></h2>

<p>Great film. <a href="http://www.youtube.com/watch?v=HxoWHeoYU3g">Squirrel!</a></p>

<h3>Runner-Up: <a href="http://www.amazon.com/gp/product/B002WY65VU?ie=UTF8&#038;tag=andymroczblog-20&#038;linkCode=as2&#038;camp=1789&#038;creative=390957&#038;creativeASIN=B002WY65VU">Zombieland</a><img src="http://www.assoc-amazon.com/e/ir?t=andymroczblog-20&#038;l=as2&#038;o=1&#038;a=B002WY65VU" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /></h3>

<p>Zombieland produced the most real-life LOLs for of any movie I saw in the theatre all year. Worth it for the Bill Murray cameo alone.</p>

<h2>TV Show: <a href="http://www.amazon.com/gp/redirect.html?ie=UTF8&#038;location=http%3A%2F%2Fwww.amazon.com%2Fgp%2Fentity%2FPushing-Daisies%2FB001CHNIWC%3Fie%3DUTF8%26ref_%3Dep%255Fsprkl%255Ftv%255FB001CHNIWC&#038;tag=andymroczblog-20&#038;linkCode=ur2&#038;camp=1789&#038;creative=390957">Pushing Daisies</a><img src="https://www.assoc-amazon.com/e/ir?t=andymroczblog-20&#038;l=ur2&#038;o=1" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /></h2>

<p>I know Pushing Daisies was actually cancelled before 2009 began, but it&#8217;s new to me. I loved the characters and the feel of the show. My only gripe was the rushed ending of the second season, but that is obviously attributed to it&#8217;s cancellation.</p>

<h3>Runner-Up: <a href="http://www.amazon.com/gp/product/B000Q6GUW0?ie=UTF8&#038;tag=andymroczblog-20&#038;linkCode=as2&#038;camp=1789&#038;creative=390957&#038;creativeASIN=B000Q6GUW0">Dexter</a><img src="http://www.assoc-amazon.com/e/ir?t=andymroczblog-20&#038;l=as2&#038;o=1&#038;a=B000Q6GUW0" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /></h3>

<p>Another new-to-me show. I&#8217;m not quite sure what I was expecting, but I was surprised by how much I liked this show. I&#8217;ve only finished the first two seasons, but the third is already in my Netflix queue.</p>

<h2>Podcast: <a href="http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewPodcast?id=318584787">The MDN Show</a></h2>

<p>The new, unified show from <a href="http://www.mac-developer-network.com/">The Mac Developer Network</a> became an instant favorite of mine. I liked all the previous shows, but it&#8217;s nice having the content all in one place.</p>

<h3>Runner-Up: <a href="http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewPodcast?id=279215411">Stack Overflow</a></h3>

<p>I can&#8217;t exactly put my finger on <em>why</em> I like the Stack Overflow podcast so much, but I keep coming back to it. I think there is a good dynamic between <a href="http://www.joelonsoftware.com/">Joel</a> and <a href="http://www.codinghorror.com/blog/">Jeff</a>. It&#8217;s also fun to listen to them discuss anything Apple-related. It&#8217;s like two polar bears trading tips on life in the rain forest.</p>

<h2>Book (Fiction): <a href="http://www.amazon.com/gp/product/0307476308?ie=UTF8&#038;tag=andymroczblog-20&#038;linkCode=as2&#038;camp=1789&#038;creative=390957&#038;creativeASIN=0307476308">The Road</a><img src="http://www.assoc-amazon.com/e/ir?t=andymroczblog-20&#038;l=as2&#038;o=1&#038;a=0307476308" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /></h2>

<p>Best novel I&#8217;ve read in awhile. And I read it before I knew it was being made into a movie, which makes my appreciation more <em>authentic</em>.</p>

<h3>Runner-Up: <a href="http://www.amazon.com/gp/product/0316013323?ie=UTF8&#038;tag=andymroczblog-20&#038;linkCode=as2&#038;camp=1789&#038;creative=390957&#038;creativeASIN=0316013323">Consider the Lobster and Other Essays</a><img src="http://www.assoc-amazon.com/e/ir?t=andymroczblog-20&#038;l=as2&#038;o=1&#038;a=0316013323" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /></h3>

<p>I actually consumed this particular work as an audiobook. I highly recommend it, especially since it&#8217;s read by the author, <a href="http://en.wikipedia.org/wiki/David_Foster_Wallace">David Foster Wallace</a> (may he rest in peace).</p>

<h2>Book (Technical): <a href="http://www.amazon.com/gp/product/1430218150?ie=UTF8&#038;tag=andymroczblog-20&#038;linkCode=as2&#038;camp=1789&#038;creative=390957&#038;creativeASIN=1430218150">Learn Objective–C on the Mac</a><img src="http://www.assoc-amazon.com/e/ir?t=andymroczblog-20&#038;l=as2&#038;o=1&#038;a=1430218150" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /></h2>

<p>Although I still think <a href="http://www.amazon.com/gp/product/0321503619?ie=UTF8&#038;tag=andymroczblog-20&#038;linkCode=as2&#038;camp=1789&#038;creative=390957&#038;creativeASIN=0321503619">Cocoa Programming for Mac OS X</a><img src="http://www.assoc-amazon.com/e/ir?t=andymroczblog-20&#038;l=as2&#038;o=1&#038;a=0321503619" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /> is the best text for learning Cocoa, it lacks more foundational information about C and programming basics. We used this book for PhillyCocoa&#8217;s <a href="http://phillycocoa.org/classes/cocoa-foundations/">Cocoa Programming Foundations Workshop</a> and were very happy with it.</p>

<h3>Runner-Up: <a href="http://www.amazon.com/gp/product/0596517742?ie=UTF8&#038;tag=andymroczblog-20&#038;linkCode=as2&#038;camp=1789&#038;creative=390957&#038;creativeASIN=0596517742">JavaScript: The Good Parts</a><img src="http://www.assoc-amazon.com/e/ir?t=andymroczblog-20&#038;l=as2&#038;o=1&#038;a=0596517742" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /></h3>

<p>Technical books that approach a topic from a particular angle, instead of being just another tutorial or reference really stand out for me. I don&#8217;t even write much JavaScript, but I really enjoyed this book. Plus it&#8217;s a short read.</p>

<h2>Mac Application: (Tie) <a href="http://www.flyingmeat.com/acorn/">Acorn</a>, <a href="http://likethought.com/opacity/">Opacity</a></h2>

<p>I&#8217;m not a big fan of Photoshop. It&#8217;s expensive, cumbersome, and does much more than I need. I wanted some lighter, cheaper, and more geared towards developers. Enter Acorn, a well-designed, scriptable image editor. It&#8217;s usually the first place I go if I need to work with any graphics. However, this year I discovered a super-interesting application called Opacity. It&#8217;s obviously designed with the developer in mind, with bindable variables and it&#8217;s own &#8220;build&#8221; system. I do almost all my image work in these two apps, hence the tie.</p>

<h3>Runner-Up: <a href="http://www.decimus.net/dterm.php">DTerm</a></h3>

<p>I was aware of DTerm for awhile, but I didn&#8217;t &#8220;get it&#8221; until recently. It&#8217;s great for interacting with git from within Xcode, and supersedes the &#8220;<a href="http://mrox.net/blog/2009/06/05/another-open-terminal-here-toolbar-app/">Open Terminal Here</a>&#8221; applications I&#8217;ve written about previously.</p>

<h2>iPhone Application: <a href="http://itunes.apple.com/us/app/tweetie-2/id333903271?mt=8">Tweetie 2</a></h2>

<p>Great application all-around. I love the &#8220;<a href="http://twitter.com/amrox/status/7420761307">pull down to refresh</a>&#8221; feature.</p>

<h3>Runner-Up: <a href="http://itunes.apple.com/us/app/byline/id284946773?mt=8">Byline</a></h3>

<p>Byline is the best Google Reader client I&#8217;ve tried. I love swipe to mark/unmark as read.</p>

<h2>iPhone Game: <a href="http://itunes.apple.com/us/app/parachute-panic/id317435143?mt=8">Parachute Panic</a></h2>

<p>Parachute Panic is a fun, casual game, but it&#8217;s the hand-drawn graphical style and music that pushed it to the top. ♫ The game is overrrr ♫ But not foreverrrr ♫ Try it again! ♫</p>

<h3>Runner-Up: <a href="http://itunes.apple.com/us/app/flight-control/id306220440?mt=8">Flight Control</a></h3>

<p>Again, a fun, casual game whith great graphical style and music.</p>

<h2>Video Game: <a href="http://www.amazon.com/gp/product/B001ET07O0?ie=UTF8&#038;tag=andymroczblog-20&#038;linkCode=as2&#038;camp=1789&#038;creative=390957&#038;creativeASIN=B001ET07O0">House of the Dead: Overkill</a><img src="http://www.assoc-amazon.com/e/ir?t=andymroczblog-20&#038;l=as2&#038;o=1&#038;a=B001ET07O0" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /></h2>

<p>Yes, its bloody, campy, and kinda stupid, which is exactly why it won. Very fun in that &#8220;turn your brain off and shoot at things&#8221; kind of way.</p>

<h3>Runner-Up: <a href="http://www.telltalegames.com/monkeyisland">Tales of Monkey Island</a></h3>

<p>Guybrush Threepwood, Mighty Pirate returns. Man, I miss adventure games.</p>

<h2>Brunch: <a href="http://www.cafeestelle.com/">Café Estelle</a></h2>

<p>Excellent food, friendly staff, and human-sized portions.</p>

<h3>Runner-Up: <a href="http://www.figsrestaurant.com/">Figs</a></h3>

<p>This little BYO has great egg dishes and the thickest pancakes I&#8217;ve ever seen.</p>

<h2>Lunch Truck: <a href="http://twitter.com/HonestToms">Honest Tom&#8217;s Tacos</a></h2>

<p>I love the simplicity of the menu. For lunch, there are two kinds of tacos, coffee, and no step three. The sweet potato tacos are my favorite.</p>

<h3>Runner-Up: <a href="http://www.yelp.com/biz/la-dominique-philadelphia">La Dominique</a></h3>

<p>This unassuming cart serves up delicious, painstakingly-crafted crêpes on Drexel&#8217;s campus.</p>

<h2>Restaurant: <a href="http://www.amadarestaurant.com/">Amada</a></h2>

<p>I&#8217;ve actually been to Amada once previously, but it stood out in my mind as the best restaurant experience I had this year. The &#8220;Matador&#8221; cocktail was awesome.</p>

<h3>Runner-Up: <a href="http://www.thebelgiancafe.com/">The Belgian Café</a></h3>

<p>It gets mixed reviews from fellow Fairmount residents, but I really like The Belgian Café. Tasty veggie burgers and impressive beer list. Done.</p>

<h2>Bar: <a href="http://www.nationalmechanics.com/">National Mechanics</a></h2>

<p>National Mechanics has become the go-to bar of the geek crowd in Philly. I&#8217;ve had several &#8220;good times&#8221; there this year, so this was an easy choice.</p>

<h3>Runner-Up: <a href="http://pubonpassyunkeast.com/">The P.O.P.E.</a></h3>

<p>I don&#8217;t make it out to this South Philly hangout very often, but I have blast every time I do.</p>

<h2>Beer: <a href="http://www.ratebeer.com/beer/liefmans-cuvee-brut-was-kriekbier/4638/86873/">Liefmans Cuvée Brut</a></h2>

<p>This may seem like an odd choice, but I stand by it for a few reasons. First, I was given a tour of the Leifmans brewery in Belgium brewery courtesy of some awesome friends. Second, although sour fruit beers aren&#8217;t usually my first choice, this is actually a pretty damn good beer.</p>

<h3>Runner-Up: (Tie) <a href="http://www.dogfish.com/">Dogfish Head</a> <a href="http://www.ratebeer.com/beer/dogfish-head-sahtea/93237/">Sah&#8217;tea</a>, <a href="http://www.ratebeer.com/beer/dogfish-head-palo-santo-marron/66797/">Palo Santo Marron</a></h3>

<p>And a Dogfish Head double-whammie in the runner-up position. I discovered both these beers in 2009 but under very different circumstances. Palo Santo I first tried during a tour of the Dogfish Head brewery, and Sah&#8217;tea at the aforementioned Belgian Café after the first fateful night we spent with the <a href="http://www.flickr.com/photos/amrox/3953103309/">little monster</a>. Friends and I bought and split cases of each.</p>

<h2>Predictions for 2010</h2>

<ul>
<li>Probably contain around 365 days.</li>
<li>Still no jetpacks.</li>
<li>Ragnarök.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://mrox.net/blog/2010/01/06/my-best-of-2009/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Wildcard App ID and Push Notifications</title>
		<link>http://mrox.net/blog/2009/07/30/wildcard-app-id-and-push-notifications/</link>
		<comments>http://mrox.net/blog/2009/07/30/wildcard-app-id-and-push-notifications/#comments</comments>
		<pubDate>Fri, 31 Jul 2009 00:23:12 +0000</pubDate>
		<dc:creator>amrox</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[iphone]]></category>

		<guid isPermaLink="false">http://mrox.net/blog/?p=214</guid>
		<description><![CDATA[Back in the Dark Ages of iPhone Development, when the NDA loomed over us all, getting information was hard.  The deployment and code-signing piece was especially tricky to get working correctly.  One was often thrilled to get it working at all.

One step of the process is choosing an application ID, which uses the [...]]]></description>
			<content:encoded><![CDATA[<p>Back in the Dark Ages of iPhone Development, when the NDA loomed over us all, getting information was hard.  The deployment and code-signing piece was especially tricky to get working correctly.  One was often thrilled to get it working at all.</p>

<p>One step of the process is choosing an application ID, which uses the common reverse domain name format.  The documentation also stated that if you want to share information across multiple applications, a wildcard app ID (com.yourcompany.*) can be used.  No drawbacks were given, and sharing is good, right?  So I can only imagine that some people may have used a wildcard app ID for their application.  And I can also only imagine that these people had no problems with their wildcard app ID, until iPhone OS 3.0 came out that is.</p>

<p>You see, Apple&#8217;s Push Notification service <a href="http://developer.apple.com/IPhone/library/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/ProvisioningDevelopment/ProvisioningDevelopment.html">using a wildcard application ID</a>.</p>

<p>Those same people may have been under the impression that it was the app ID that uniquely identified the application, and therefore changing it would yield a <em>new</em> application, and not update the existing one.  This means that all ranking in the App Store would be lost, and users would not be notified of the update.</p>

<p>The good news is, this is not the case.  An application&#8217;s app ID <em>can</em> be changed by generating a new app ID, re-generating a distribution the App Store distribution certificate, and submitting to the App Store.</p>

<p>So if you shipped your app with a wildcard ID, and now want to integrate push notifications, you are not screwed.  Just generate a new, non-wildcard app ID.</p>
]]></content:encoded>
			<wfw:commentRss>http://mrox.net/blog/2009/07/30/wildcard-app-id-and-push-notifications/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>An Event Apart 09</title>
		<link>http://mrox.net/blog/2009/06/26/an-event-apart-09/</link>
		<comments>http://mrox.net/blog/2009/06/26/an-event-apart-09/#comments</comments>
		<pubDate>Fri, 26 Jun 2009 19:40:24 +0000</pubDate>
		<dc:creator>amrox</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[aea]]></category>
		<category><![CDATA[aea09]]></category>
		<category><![CDATA[conference]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://mrox.net/blog/?p=197</guid>
		<description><![CDATA[I attended the recent An Event Apart conference in Boston.  An Event Apart is aimed at designers who build websites, and has a standards-oriented slant.

I am not a designer, but I have to play one from time to time.  I don&#8217;t plan to make designing websites my primary focus, but some basic skills [...]]]></description>
			<content:encoded><![CDATA[<p>I attended the recent <a href="http://aneventapart.com/2009/boston/">An Event Apart</a> conference in Boston.  An Event Apart is aimed at designers who build websites, and has a standards-oriented slant.</p>

<p>I am not a designer, but I have to play one from time to time.  I don&#8217;t plan to make designing websites my primary focus, but some basic skills is necessary these days.  Also I think the web <em>might not</em> be a passing fad, so investing in some expertise in that realm would probably pay off in the long run  AEA seemed like a good way to jump-start that area of my professional skill set.</p>

<p>The talks were very high quality across the board, and the topics ranged from design psychology to CSS nuts and bolts.  I found <a href="http://aneventapart.com/speakers/jasonsantamaria/">Jason Santa Maria</a> and <a href="http://aneventapart.com/speakers/dancederholm/">Dan Cederholm</a> to have the most useful technical content.  <a href="http://aneventapart.com/speakers/whitneyhess/">Whitney Hess</a>&#8217;s DIY UX talk and <a href="http://aneventapart.com/speakers/kristinahalvorson/">Kristina Halvorson</a>&#8217;s Content Strategy talk both had great information from a less technical, but still development-related standpoint.  From a general-interest perspective, <a href="http://aneventapart.com/speakers/jaredspool/">Jared Spool</a> on Amazon and <a href="http://aneventapart.com/speakers/simplescott/">SimpleScott</a> on the Obama campaign website were extremely interesting.</p>

<p>Beyond the talks, the conference itself was a great experience.  The presenters were very down to earth, and I met a lot of cool people.  The designers didn&#8217;t even seem to mind that I wasn&#8217;t &#8220;one of them&#8221;.</p>

<p>A few personal key takeaways:</p>

<ul>
<li><em>&#8220;Websites don&#8217;t need to look the same in every browser.&#8221;</em> This was the mantra of the conference.  We were made to chant it over and over until it permeated our souls (just kidding (sorta)).</li>
<li>Grid-based layouts are your friend.</li>
<li>Fluid layouts are cool.</li>
<li>Sketch.  <em>&#8220;Sketchbooks are not about being a good artist, they&#8217;re  about being a good thinker.&#8221;</em> &#8211; Jason Santa Maria.</li>
<li><em>&#8220;The behavior you&#8217;re seeing is the behavior you&#8217;ve designed for.&#8221;</em> &#8211; Joshua Porter</li>
<li>Charge for the value you bring to a client, not the hours you work.</li>
</ul>

<p>I didn&#8217;t take many pictures but instead outsourced them via the  <a href="http://www.flickr.com/groups/aeaboston09/">AEA Boston 09 Flickr pool</a>.</p>

<p>Finally, I wanted to put some of my newfound skills and excitement to use.  Without further adieu, I give you: <a href="http://doesthissitejustshowonebigword.com">doesthissitejustshowonebigword.com</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://mrox.net/blog/2009/06/26/an-event-apart-09/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>And the winner is… wait… what?</title>
		<link>http://mrox.net/blog/2009/06/19/and-the-winner-is%e2%80%a6-wait%e2%80%a6-what/</link>
		<comments>http://mrox.net/blog/2009/06/19/and-the-winner-is%e2%80%a6-wait%e2%80%a6-what/#comments</comments>
		<pubDate>Fri, 19 Jun 2009 17:21:17 +0000</pubDate>
		<dc:creator>amrox</dc:creator>
				<category><![CDATA[Blog]]></category>

		<guid isPermaLink="false">http://mrox.net/blog/?p=158</guid>
		<description><![CDATA[The iPhone app we built for Wolfgang&#8217;s Vault, Concert Vault (iTunes link), was awarded Best iPhone/iPod touch application by Macworld UK.

This is quite the pleasant surprise.  I had no idea it was even being considered.  It&#8217;s an honor to be chosen out of all of the nominees, which are all great apps.  [...]]]></description>
			<content:encoded><![CDATA[<p>The iPhone app we built for <a href="http://concerts.wolfgangsvault.com/">Wolfgang&#8217;s Vault</a>, <a href="http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=294355484&amp;mt=8">Concert Vault</a> (iTunes link), was awarded <a href="http://www.macworld.co.uk/mac/news/index.cfm?newsid=26313">Best iPhone/iPod touch application</a> by Macworld UK.</p>

<p>This is <em>quite</em> the pleasant surprise.  I had no idea it was even being considered.  It&#8217;s an honor to be chosen out of all of the nominees, which are all great apps.  I use several of them myself. </p>

<p>Working with Wolfgang&#8217;s Vault has been a great experience and we&#8217;re excited to continue building apps to deliver their extraordinary content on the iPhone platform.</p>
]]></content:encoded>
			<wfw:commentRss>http://mrox.net/blog/2009/06/19/and-the-winner-is%e2%80%a6-wait%e2%80%a6-what/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>WWDC 09 Post Mortem</title>
		<link>http://mrox.net/blog/2009/06/18/wwdc-09-post-mortem/</link>
		<comments>http://mrox.net/blog/2009/06/18/wwdc-09-post-mortem/#comments</comments>
		<pubDate>Thu, 18 Jun 2009 20:41:58 +0000</pubDate>
		<dc:creator>amrox</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[wwdc]]></category>

		<guid isPermaLink="false">http://mrox.net/blog/?p=152</guid>
		<description><![CDATA[WWDC 09 was my second WWDC, after first attending in 2008.  I would have liked to do a more well-constructed breakdown of this year&#8217;s conference, but time has been scarce, and I didn&#8217;t want the information to get (more) stale.  Instead, I give you a brain-dump of some of my experiences:


Keynote


Cheaper, better laptops? [...]]]></description>
			<content:encoded><![CDATA[<p>WWDC 09 was my second WWDC, after first attending in 2008.  I would have liked to do a more well-constructed breakdown of this year&#8217;s conference, but time has been scarce, and I didn&#8217;t want the information to get (more) stale.  Instead, I give you a brain-dump of some of my experiences:</p>

<ul>
<li><p>Keynote</p>

<ul>
<li>Cheaper, better laptops? Yes please.</li>
<li>Snow Leopard for $29 is great.</li>
<li>Boos at AT&amp;T were funny (and warranted).</li>
<li>&#8220;Find My Phone&#8221; was the surprise hit.</li>
<li>Too much time in demos (a third of which didn&#8217;t work!).</li>
<li>Scott Forstall seemed like a stronger presenter than Phil Schiller.</li>
<li>My prediction the new iPhone&#8217;s video chat feature would be demoed by calling Steve Jobs was wrong.</li>
</ul></li>
<li><p>Events and Parties</p>

<ul>
<li><a href="http://sfmacindie.com/">sfMacIndie</a> was worthwhile &#8211; bumped into some old friends and made some new ones.</li>
<li>First <em>Stump the Experts</em>. Fun, but I don&#8217;t know if I&#8217;d do it again.</li>
<li>Those WebKit guys and girls can throw a <a href="http://webkit.org/blog/63/webkit-open-source-party-at-wwdc/">good party</a>.</li>
<li>The <a href="http://bignerdranch.com/">Big Nerd Ranch</a> was, of course, a lot of fun.</li>
<li>Beer Bash: <a href="http://www.cakemusic.com/">Cake</a> was good, but the food, not so much.

<ul>
<li>&#8220;Don&#8217;t bring hot dogs to a sausage party.&#8221; &#8211; <a href="http://twitter.com/themartorana">@themartorana</a></li>
</ul></li>
</ul></li>
<li><p>Travel &amp; Lodging </p>

<ul>
<li>First Virgin American experience was positive, though the best part is their attitude, not the in-flight entertainment or wifi.</li>
<li><a href="http://intercontinentalsanfrancisco.com/">The InterContinental</a> was really convenient and pleasant.  Internet will cost you though.</li>
</ul></li>
<li><p>Food &amp; Drink</p>

<ul>
<li>The food court in the <a href="http://maps.google.com/maps?f=q&amp;source=s_q&amp;hl=en&amp;geocode=&amp;q=Westfield+San+Francisco+Centre%E2%80%8E+865+Market+St,+San+Francisco&amp;sll=37.649034,-95.712891&amp;sspn=37.151544,56.601563&amp;ie=UTF8&amp;ll=37.785283,-122.406921&amp;spn=0.009124,0.013819&amp;z=16&amp;iwloc=A">Westfield Centre</a> is good conference lunch alternative (but a little pricey).</li>
<li><a href="http://www.yelp.com/biz/blue-bottle-coffee-co-san-francisco-7">Blue Bottle</a> coffee is great.</li>
<li><a href="http://www.yelp.com/biz/nicks-crispy-tacos-san-francisco">Nick&#8217;s Crispy Tacos</a> is a tasty, fun place to go for some Mexican if you can&#8217;t get to the Mission.</li>
<li><a href="http://www.yelp.com/biz/the-chieftain-irish-pub-and-restaurant-san-francisco">The Chieftan</a> is a great place to have a brew and bump into other Mac developers.</li>
<li>The <a href="http://www.yelp.com/biz/thirsty-bear-brewing-company-san-francisco">Thirsty Bear</a> continues to serve great beer.</li>
<li><a href="http://www.yelp.com/biz/the-butler-and-the-chef-bistro-san-francisco">The Butler &amp; The Chef</a> makes a good waffle.</li>
<li><a href="http://www.yelp.com/biz/lucky-13-san-francisco">Lucky 13</a> felt like a Philly dive bar, despite it&#8217;s Castro location.</li>
</ul></li>
</ul>

<p>Whew. I think that&#8217;s all the non-NDA-encumbered information I have for now.  Again, WWDC proved to be a good experience.  If you develop Mac or iPhone software, and can afford it, it is definitely worth your time.  </p>

<p>Finally, it was awesome to travel with so many local friends this time (even the smelly ones) and of course, make some new ones.  That&#8217;s what WWDC is <em>really</em> all about, anyway.</p>

<p>Oh, and the few photos I took can be found <a href="http://www.flickr.com/photos/amrox/sets/72157619890481734/">here</a>.</p>

<p>Now let&#8217;s just hope the videos come out more promptly this year. <img src='http://mrox.net/blog/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://mrox.net/blog/2009/06/18/wwdc-09-post-mortem/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Another “Open Terminal Here” Toolbar App</title>
		<link>http://mrox.net/blog/2009/06/05/another-open-terminal-here-toolbar-app/</link>
		<comments>http://mrox.net/blog/2009/06/05/another-open-terminal-here-toolbar-app/#comments</comments>
		<pubDate>Fri, 05 Jun 2009 19:08:45 +0000</pubDate>
		<dc:creator>amrox</dc:creator>
				<category><![CDATA[Blog]]></category>

		<guid isPermaLink="false">http://mrox.net/blog/?p=148</guid>
		<description><![CDATA[In Learning the Terminal on the Mac &#8211; Part 4, I mentioned a mini-application called OpenTerminalHere that opens a new Terminal in the same directory as the current Finder window.  Well recently Dan Benjamin linked to another, nearly identical application called cdto.

Both toolbar applications work as advertised, but cdto takes the extra step of [...]]]></description>
			<content:encoded><![CDATA[<p>In <a href="http://mrox.net/blog/2008/08/09/learning-the-terminal-on-the-mac-part-4-bringing-finder-and-terminal-together/">Learning the Terminal on the Mac &#8211; Part 4</a>, I mentioned a mini-application called <a href="href=&quot;http://jo.irisson.free.fr/?p=59">OpenTerminalHere</a> that opens a new Terminal in the same directory as the current Finder window.  Well recently <a href="http://hivelogic.com/articles/view/mac-os-x-toolbar-button-to-open-a-terminal-window">Dan Benjamin</a> linked to another, nearly identical application called <a href="http://code.google.com/p/cdto/">cdto</a>.</p>

<p>Both toolbar applications work as advertised, but cdto takes the extra step of clearing the scrollback buffer after changing directories, yielding a slightly cleaner workspace.  cdto is also hosted on Google Code, so it&#8217;s easy to grab the source on hack on it.</p>

<p>Enjoy.</p>
]]></content:encoded>
			<wfw:commentRss>http://mrox.net/blog/2009/06/05/another-open-terminal-here-toolbar-app/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Terminal Quickie: Kill ‘Em All</title>
		<link>http://mrox.net/blog/2009/06/04/terminal-quickie-kill-em-all/</link>
		<comments>http://mrox.net/blog/2009/06/04/terminal-quickie-kill-em-all/#comments</comments>
		<pubDate>Thu, 04 Jun 2009 23:56:19 +0000</pubDate>
		<dc:creator>amrox</dc:creator>
				<category><![CDATA[Articles]]></category>

		<guid isPermaLink="false">http://mrox.net/blog/?p=138</guid>
		<description><![CDATA[More often than I&#8217;d like, my Mac gets into a very unhappy state. Running applications won&#8217;t respond, but they won&#8217;t force quit either. New applications won&#8217;t launch, and the unresponsive applications block a proper system restart.

Usually I want to cut my losses, and get my machine back into a good state as soon as possible. [...]]]></description>
			<content:encoded><![CDATA[<p>More often than I&#8217;d like, my Mac gets into a very unhappy state. Running applications won&#8217;t respond, but they won&#8217;t force quit either. New applications won&#8217;t launch, and the unresponsive applications block a proper system restart.</p>

<p>Usually I want to cut my losses, and get my machine back into a good state as soon as possible.  As a last resort, I could do a hard restart with the old hold-the-power-button-down-for-5-seconds trick, but then I have to wait for the machine to reboot and risk damaging my filesystem.</p>

<p>There is an alternative method that will kill all of your processes, responsive or not, and get you back working much more quickly &#8211; as long as you still have shell access:</p>

<p><code>
$ kill -9 -1
</code></p>

<p><strong>Warning:</strong> this really will kill all your running processes immediately, without saving any data.  Use wisely.</p>

<h2>Discussion</h2>

<p>So what&#8217;s going on here?  Basically, the <code>kill</code> (<a href="http://developer.apple.com/documentation/Darwin/Reference/ManPages/man1/kill.1.html">man page</a>) is used to terminate processes.  Usually it is used to kill a single process, like so:</p>

<p><code>
$ kill 1234
</code></p>

<p>where <code>1234</code> is the process id. The process id can be obtained a number of ways, but the most common is with the <code>ps</code> (<a href="http://developer.apple.com/documentation/Darwin/Reference/ManPages/man1/ps.1.html">man page</a>) command.</p>

<p>The <code>kill</code> command also lets you specify a <a href="http://en.wikipedia.org/wiki/POSIX_signal">signal</a> to send to the process. By default, it sends the TERM signal, which ask the program to terminate.  However, the TERM signal isn&#8217;t always enough.  Sn unresponsive program often won&#8217;t be able to react to the signal, and programs can even choose to ignore the signal completely.</p>

<p>Luckily, the <a href="http://en.wikipedia.org/wiki/SIGKILL"><code>KILL</code> signal</a> does not suffer from the problem.  When this signal is sent, the operating system will stop the process dead in its tracks, whether it wants to stop or not. The <code>KILL</code> signal is very powerful, but don&#8217;t only use it as a last resort because it does not allow processes to save data, close resources, and otherwise exit cleanly.</p>

<p>You can send the <code>KILL</code> signal to a process like this:</p>

<p><code>
$ kill -KILL 1234
</code></p>

<p>Or use the numeric value for the signal, which is <code>9</code>:</p>

<p><code>
$ kill -9 1234
</code></p>

<p>There is one final piece to the puzzle.  Notice that in the original command we pass a <code>-1</code> as the process id.  This is a special argument that tells <code>kill</code> to send the signal to <em>all</em> processes belonging to you (or every process on the system, if you&#8217;re the super user).</p>

<p>Basically, <code>kill -9 -1</code> is a quick way or killing every process belonging to you.  Running this on a OS X system is a quick a dirty way to clear your environment and start fresh.  Remember, this will kill all processes immediately &#8211; without saving data &#8211; and log you out, so use with care.</p>
]]></content:encoded>
			<wfw:commentRss>http://mrox.net/blog/2009/06/04/terminal-quickie-kill-em-all/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Adding Debug-only Preferences in iPhone Applications</title>
		<link>http://mrox.net/blog/2008/11/16/adding-debug-only-preferences-in-iphone-applications/</link>
		<comments>http://mrox.net/blog/2008/11/16/adding-debug-only-preferences-in-iphone-applications/#comments</comments>
		<pubDate>Sun, 16 Nov 2008 16:21:26 +0000</pubDate>
		<dc:creator>amrox</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[iphone xcode]]></category>

		<guid isPermaLink="false">http://mrox.net/blog/?p=108</guid>
		<description><![CDATA[Recently I bumped into an iPhone application configuration/deployment problem, and thought someone else might benefit from my findings.

Motivation and Goals

Here&#8217;s the basic scenario:  I wanted to expose certain options in my iPhone application that were only available in Debug builds.  One choice would be to add the ability to change the options in [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I bumped into an iPhone application configuration/deployment problem, and thought someone else might benefit from my findings.</p>

<h3>Motivation and Goals</h3>

<p>Here&#8217;s the basic scenario:  I wanted to expose certain options in my iPhone application that were only available in Debug builds.  One choice would be to add the ability to change the options in the application itself, and use the usual conditional compilation (<code>#ifdef DEBUG</code>…) techniques to hide or expose them based on build configuration.</p>

<p>However, this would require adding a whole bunch of custom UI in my application, which didn&#8217;t really seem appealing.  The application was already using the standard iPhone application Setting system, which is driven by simple plists.  I thought to myself, boy it would be nice if my Debug-only options could be automagically added to Settings bundle at build time.</p>

<p>For example, the standard settings pane would look like this:</p>

<div style="text-align:center;"><img src="http://amrox.webfactional.com/blog/wp-content/uploads/2008/11/nodebug.png" alt="NoDebug.png" border="0" width="360" height="654" />
</div>

<p>And debug-only options would be added automatically, to produce this:</p>

<div style="text-align:center;">
<img src="http://amrox.webfactional.com/blog/wp-content/uploads/2008/11/hasdebug.png" alt="HasDebug.png" border="0" width="360" height="654" />
<img src="http://amrox.webfactional.com/blog/wp-content/uploads/2008/11/debugpane2.png" alt="DebugPane2.png" border="0" width="360" height="654" />
</div>

<p>I&#8217;m a believer in the <a href="http://en.wikipedia.org/wiki/Don't_repeat_yourself">DRY</a> principle, so I wanted to avoid duplicating and information at all possible.  Also I wanted to &#8220;set it and forget it&#8221; and not require any manual build steps.</p>

<p>After some experimentation, trial, and error, I arrived at the following solution:</p>

<ol>
<li><strong>Store Debug settings in a separate child pane.</strong> The Settings system allows for child panes of the root pane.  To keep the main settings and debug settings separate, we keep them on different panes.
</li>
<li><strong>Add an reference to the child pane from the root pane at build time.</strong>  To keep the main root settings clean, we&#8217;ll inject the reference to the debug clild pane at build time.
</ol>

<h3>Create the Property List</h3>

<p>First, add a Settings Bundle to your project if you haven&#8217;t already.  Choose <code>File -> New File… -> Settings -> Settings Bundle</code>.</p>

<p>Next we need to add a second plist for our Debug settings.  Xcode doesn&#8217;t allow you to create a new plist inside the Settings bundle (or any bundle for that matter), so we&#8217;ll have to create our Debug.plist by some other means.  If you&#8217;re familiar with the shell, the easiest way is to navigate to <code>Settings.bundle</code> inside your project and simply duplicate the main Root settings to create Debug settings.</p>

<blockquote>
<code>
cp Settings.bundle/Root.plist Settings.bundle/Debug.plist
</code>
</blockquote>

<p>If you prefer to use Finder, navigate to Settings.bundle and then right- or control-click and choose <emph>Show Package Contents</emph>.  Then option-drag to duplicate <code>Root.plist</code> and rename it to <code>Debug.plist</code>.</p>

<p>Once the file has been created, collapse and expand the Settings bundle in your projects Groups &amp; Files section to refresh it&#8217;s contents.  It should look like this:</p>

<div style="text-align:center;"><img src="http://amrox.webfactional.com/blog/wp-content/uploads/2008/11/adddebugsettingsexample-debugplist.png" alt="AddDebugSettingsExample - Debug.plist .png" border="0" width="250" height="272" /></div>

<p>Note, you can name the child settings plist something other than &#8220;Debug&#8221; if you want.  We&#8217;ll see how to do that in the next section.</p>

<h3>The Injection Script</h3>

<p>The purpose of the injection script is to add a child pane option to an existing settings plist file.  It uses the built in <a href="http://developer.apple.com/documentation/Darwin/Reference/ManPages/man8/PlistBuddy.8.html">PlistBuddy</a> utility to do all the real work.</p>

<p>The <code>addDebugSettingsChild.sh</code> takes two arguments.  The first is of course that path to the target plist file.  The second is the name of the new child pane, or &#8216;Debug&#8217; if unspecified.</p>

<p>Here&#8217;s the script:</p>

<pre><code>#!/bin/sh

# addDebugSettingsChild.sh
#
# Simple script to inject a Debug menu in an iPhone Settings plist.
#
# created 10.15.2008 by Andy Mroczkowski, mrox.net

THIS="`basename $0`"
PLISTBUDDY="/usr/libexec/PlistBuddy -x"

set -e

if [ -z "$1" ]; then
    echo "Usage:"
    echo "   $THIS plist_file [child_pane_name]"
    echo "   - If unspecified, child_pane_name is 'Debug'"
    exit 1
fi

if [ ! -e "$1" ]; then
    echo "[$THIS] file not found: '$1'"
    exit 2
fi

if [ ! -z "$2" ]; then
    CHILD_PANE_NAME="$2"
else
    CHILD_PANE_NAME="Debug"
fi

TARGET="$1"
echo "[$THIS] adding '$CHILD_PANE_NAME' child to: $TARGET"

$PLISTBUDDY -c "Add PreferenceSpecifiers:0 dict" "$TARGET"
$PLISTBUDDY -c "Add PreferenceSpecifiers:0:Type string 'PSGroupSpecifier'" "$TARGET"

$PLISTBUDDY -c "Add PreferenceSpecifiers:1 dict" "$TARGET"
$PLISTBUDDY -c "Add PreferenceSpecifiers:1:Type string 'PSChildPaneSpecifier'" "$TARGET"
$PLISTBUDDY -c "Add PreferenceSpecifiers:1:Title string '$CHILD_PANE_NAME Settings'" "$TARGET"
$PLISTBUDDY -c "Add PreferenceSpecifiers:1:File string '$CHILD_PANE_NAME'" "$TARGET"
</code></pre>

<p><a href="http://mrox.net/files/addDebugSettingsChild.sh">Download</a></p>

<h3>Creating the Build Step</h3>

<p>We&#8217;ve created a Debug settings child pane in our settings bundle, and a script to add an option to access our child pane from the root pane.  Now we just have to tie the pieces together in Xcode&#8217;s build settings.</p>

<p>Copy <code>addDebugSettingsChild.sh</code> to your project&#8217;s folder.  You don&#8217;t need to add it to the project itself.  Next add a new &#8220;Run Script Build Phase&#8221; to the target for your application.  Order it so be comes after the &#8220;Copy Bundle Resources&#8221; phase, and name it something more descriptive if you&#8217;d like.  I called mine &#8220;Run Debug Settings Script&#8221;.</p>

<p><p></p>

<div style="text-align:center;"><img src="http://amrox.webfactional.com/blog/wp-content/uploads/2008/11/debugplist-adddebugsettingsexample-2.png" alt="Debug.plist - AddDebugSettingsExample-2.png" border="0" width="240" height="104" /></div>

<p><p></p>

<p>Next we have to make the our new Run Script phase actually do something.  Basically, we need to call the <code>addDebugSettingsChild.sh</code> if we&#8217;re building with the &#8220;Debug&#8221; configuration, and also set up the input and out files so Xcode knows when to run the script and when not to.  Let&#8217;s set up the input and output files first.</p>

<p>Add the path to your Root settings plist as an input file.  If you used the default names and locations, this should be:</p>

<pre>
<code>
$(SRCROOT)/Settings.bundle/Root.plist
</pre>

<p></code></p>

<p>The file we will be altering will be in the built products area, not the project source root, so the output file should be:</p>

<pre>
<code>
$(BUILT_PRODUCTS_DIR)/$(UNLOCALIZED_RESOURCES_FOLDER_PATH)/Settings.bundle/Root.plist
</pre>

<p></code></p>

<p>Finally create the body of the script.  I only want to add my extra settings if I'm building the "Debug" configuration, so my script looks like this:</p>

<p><code>
<pre>
if [ "$CONFIGURATION" == "Debug" ]; then
    sh addDebugSettingsChild.sh "$SCRIPT<em>OUTPUT</em>FILE_0"
fi
</pre>
</code></p>

<p>You may notice that the script's input is specified as the output file.  This is not a mistake.  The <code>addDebugSettingsChild.sh</code> script modifies the specified plist in place, and we want to alter the one in our built-products area, not the source tree.</p>

<p>Again it's important to specify the input and output files.  If you don't, Xcode may run the script on every build, which will result in repeated Debug child pane choices in our main settings plist.</p>

<p>Once you're done, it should look like this:</p>

<div style="text-align:center;"><img src="http://amrox.webfactional.com/blog/wp-content/uploads/2008/11/run-script-phase-for-adddebugsettingsexample-info.png" alt="Run Script Phase for “AddDebugSettingsExample” Info.png" border="0" width="630" height="654" /></div>

<h3>Conclusion</h3>

<p>And that's it.  You can now add edit the Root and Debug plists and they will be updated appropriately and everything will be  happy.  Well, mostly happy (see Caveats).  I hope you found if useful.  If not, I'm sorry.  Here's some pictures of <a href="http://www.flickr.com/photos/87258185@N00/sets/72157603724213121/">Robocop on a Unicorn</a> to cheer you up.</p>

<h4>Sample Project</h4>

<p>You can download a sample project with all the above steps already completed <a href="http://mrox.net/files/AddDebugSettingsExample.zip">here</a>.</p>

<h4>Caveats and Future Work</h4>

<ul>
<li>
<b>Be careful when switching configurations and using Build and Run.</b>  The products in the build folder for each configuration should always be correct, but Xcode won't necessarily re-install the right Setting bundle if it doesn't detect a change.  The workaround is to just build clean and re-build when switching from Debug to Release or vice versa.  Any suggestions on how to improve this are welcome.
</li>
<li>
<b>Child pane options are always injected at the top.</b>  I'd prefer if I could add the "Debug Settings" option at the end of the main preferences, but I could not find a simple way to append an element to the end of an array with PlistBuddy.  I considered using PlistBuddy to loop through the array to determine the size, and then use that to append it to the end, but I didn't want to add all that complexity to the script for a minor issue just yet.
</li>
<li>
<b>Debug.plist still exists, but is inaccessible, in Release builds.</b> This method does not prevent the installation of the <code>Debug.plist</code>, but there will be no way to get to it, since it's not referenced as a child from the root plist.  If this bothers you, you'll probably have to set up another script to remove <code>Debug.plist</code>.
</li>
<li>
<b>What if I'm not using a Settings bundle in my Release builds?</b> This technique assumes that you're already using a Settings bundle to your application, and you want to add extra stuff to it based on build configuration.  If you'd like to <em>only</em> have Settings bundle for Debug builds, this isn't going to work for you, though hopefully some of the information can help you get started on a similar solution.
</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://mrox.net/blog/2008/11/16/adding-debug-only-preferences-in-iphone-applications/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss><!-- Dynamic page generated in 2.023 seconds. --><!-- Cached page generated by WP-Super-Cache on 2010-03-09 08:56:00 -->
