<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>awkward.org &#187; Development</title>
	<atom:link href="http://awkward.org/category/development/feed/" rel="self" type="application/rss+xml" />
	<link>http://awkward.org</link>
	<description>T &#38; M - Thoughts &#38; Musings</description>
	<lastBuildDate>Sun, 14 Nov 2010 20:40:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Don&#8217;t ignore baseclass methods in OSObject</title>
		<link>http://awkward.org/feeder/?FeederAction=clicked&#038;feed=Articles+%28RSS2%29&#038;seed=http%3A%2F%2Fawkward.org%2F2009%2F03%2F01%2Fdont-ignore-baseclass-methods-in-osobject%2F&#038;seed_title=Don%26%238217%3Bt+ignore+baseclass+methods+in+OSObject</link>
		<comments>http://awkward.org/feeder/?FeederAction=clicked&#038;feed=Articles+%28RSS2%29&#038;seed=http%3A%2F%2Fawkward.org%2F2009%2F03%2F01%2Fdont-ignore-baseclass-methods-in-osobject%2F&#038;seed_title=Don%26%238217%3Bt+ignore+baseclass+methods+in+OSObject#comments</comments>
		<pubDate>Mon, 02 Mar 2009 01:38:31 +0000</pubDate>
		<dc:creator>awk</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Darwin Kernel]]></category>
		<category><![CDATA[IOKit]]></category>
		<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[OSObject]]></category>

		<guid isPermaLink="false">http://awkward.org/?p=217</guid>
		<description><![CDATA[Having spent an hour so (and more than a few reboots) &#8211; here&#8217;s a reminder to myself (and other hapless souls).  Just because OSObject is pretty abstract and can&#8217;t be constructed on it&#8217;s own that doesn&#8217;t mean you can ignore its methods. In my case I was stymied by an apparent &#8216;hanging&#8217; reference even though [...]]]></description>
			<content:encoded><![CDATA[<p>Having spent an hour so (and more than a few reboots) &#8211; here&#8217;s a reminder to myself (and other hapless souls). </p>
<p>Just because OSObject is pretty abstract and can&#8217;t be constructed on it&#8217;s own that doesn&#8217;t mean you can ignore its methods. In my case I was stymied by an apparent &#8216;hanging&#8217; reference even though I could see that my very simple OSObject subclass was allocated only once and free() was called as the reference count went to zero.</p>
<p>My mistake was not to call the baseclass OSObject::free() from my own method &#8211; so of course although I thought (knew) I was done with the object the rest of the IOKit/kernel wasn&#8217;t so convinced.</p>
<p>So&#8230; don&#8217;t forget that OSObject still does very important things &#8211; even if it does seem a bit of a placeholder !</p>
]]></content:encoded>
			<wfw:commentRss>http://awkward.org/feeder/?FeederAction=clicked&#038;feed=Articles+%28RSS2%29&#038;seed=http%3A%2F%2Fawkward.org%2F2009%2F03%2F01%2Fdont-ignore-baseclass-methods-in-osobject%2F&#038;seed_title=Don%26%238217%3Bt+ignore+baseclass+methods+in+OSObject/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mac OS X Desktop Virtualization</title>
		<link>http://awkward.org/feeder/?FeederAction=clicked&#038;feed=Articles+%28RSS2%29&#038;seed=http%3A%2F%2Fawkward.org%2F2008%2F03%2F21%2Fmac-os-x-desktop-virtualization%2F&#038;seed_title=Mac+OS+X+Desktop+Virtualization</link>
		<comments>http://awkward.org/feeder/?FeederAction=clicked&#038;feed=Articles+%28RSS2%29&#038;seed=http%3A%2F%2Fawkward.org%2F2008%2F03%2F21%2Fmac-os-x-desktop-virtualization%2F&#038;seed_title=Mac+OS+X+Desktop+Virtualization#comments</comments>
		<pubDate>Fri, 21 Mar 2008 19:36:54 +0000</pubDate>
		<dc:creator>awk</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[VMware]]></category>

		<guid isPermaLink="false">http://awkward.org/2008/03/21/mac-os-x-desktop-virtualization/</guid>
		<description><![CDATA[Craig Hockenberry (Iconfactory &#38; Twitterific) is looking to encourage more developers to request Apple to support the use of Mac OS X Client (Desktop) virtualization and not just the Server version of Mac OS X : http://furbo.org/2008/03/21/vote-for-virtualization/ Of course I have a vested interest in this and am not without bias on the issue &#8211; [...]]]></description>
			<content:encoded><![CDATA[<p>Craig Hockenberry (<a href="http://iconfactory.com" target="_blank">Iconfactory</a> &amp; <a href="http://iconfactory.com/software/twitterrific" target="_blank">Twitterific</a>) is looking to encourage more developers to request Apple to support the use of Mac OS X Client (Desktop) virtualization and not just the Server version of Mac OS X :</p>
<p><a href="http://furbo.org/2008/03/21/vote-for-virtualization/" target="_blank">http://furbo.org/2008/03/21/vote-for-virtualization/</a></p>
<p>Of course I have a vested interest in this and am not without bias on the issue &#8211; but all the same he raises valid points&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://awkward.org/feeder/?FeederAction=clicked&#038;feed=Articles+%28RSS2%29&#038;seed=http%3A%2F%2Fawkward.org%2F2008%2F03%2F21%2Fmac-os-x-desktop-virtualization%2F&#038;seed_title=Mac+OS+X+Desktop+Virtualization/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iPhone SDK Restrictions</title>
		<link>http://awkward.org/feeder/?FeederAction=clicked&#038;feed=Articles+%28RSS2%29&#038;seed=http%3A%2F%2Fawkward.org%2F2008%2F03%2F13%2Fiphone-sdk-restrictions%2F&#038;seed_title=iPhone+SDK+Restrictions</link>
		<comments>http://awkward.org/feeder/?FeederAction=clicked&#038;feed=Articles+%28RSS2%29&#038;seed=http%3A%2F%2Fawkward.org%2F2008%2F03%2F13%2Fiphone-sdk-restrictions%2F&#038;seed_title=iPhone+SDK+Restrictions#comments</comments>
		<pubDate>Thu, 13 Mar 2008 16:53:47 +0000</pubDate>
		<dc:creator>awk</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://awkward.org/2008/03/13/iphone-sdk-restrictions/</guid>
		<description><![CDATA[There&#8217;s been some &#8216;grumbling&#8217; (here and here) about some of the restrictions that are placed on application developers and their products if they use the iPhone SDK. Many of the commenters seem concerned that the SDK is much more restrictive than &#8216;regular desktop&#8217; development, with restrictions on running in the background, a lack of access [...]]]></description>
			<content:encoded><![CDATA[<p>There&#8217;s been some &#8216;grumbling&#8217; (<a href="http://www.rogueamoeba.com/utm/2008/03/11/iphone-sdk-bug-filing/" target="_blank">here</a> and <a href="http://macdaddyworld.com/2008/03/06/iphone-sdk-first-thoughts/" target="_blank">here</a>) about some of the restrictions that are placed on application developers and their products if they use the iPhone SDK.</p>
<p>Many of the commenters seem concerned that the SDK is much more restrictive than &#8216;regular desktop&#8217; development, with restrictions on running in the background, a lack of access to certain parts of the platform, and pieces of functionality present in desktop Mac OS X but missing from Cocoa Touch.</p>
<p>Why are things so different ? Technical challenges ? No. The reason &#8211; in two words is: Legal Liability.</p>
<p>I think Apple is very concerned that there is a danger someone would try to use their iPhone in an emergency (to dial 911) and have it fail because of a failure (or out of control) third-party application. If that happens and lawyers get involved I don&#8217;t think they&#8217;re going to  go after small  one-person software developers with buggy code. Rather they&#8217;ll go for the deep pockets at Apple.</p>
<p>Yes Mac OS X uses protected memory, and is a pre-emptive operating system. But it&#8217;s still vulnerable to people using too many resources and there are places in the OS where the failure of one application at the wrong time can lead other applications to fail (for example Disk Notification on the desktop  Mac OS X can cause Finder to stall if you fail to respond to the notification request in a timely manner).</p>
<p>Personally I&#8217;m grateful for a little care, attention and large walls in this space &#8211; my phone is probably more important than my desktop, especially in an emergency, making sure it&#8217;s always there when I need it is very important.</p>
]]></content:encoded>
			<wfw:commentRss>http://awkward.org/feeder/?FeederAction=clicked&#038;feed=Articles+%28RSS2%29&#038;seed=http%3A%2F%2Fawkward.org%2F2008%2F03%2F13%2Fiphone-sdk-restrictions%2F&#038;seed_title=iPhone+SDK+Restrictions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iPhone SDK, App signing and Beta Testing</title>
		<link>http://awkward.org/feeder/?FeederAction=clicked&#038;feed=Articles+%28RSS2%29&#038;seed=http%3A%2F%2Fawkward.org%2F2008%2F03%2F07%2Fiphone-sdk-app-signing-and-beta-testing%2F&#038;seed_title=iPhone+SDK%2C+App+signing+and+Beta+Testing</link>
		<comments>http://awkward.org/feeder/?FeederAction=clicked&#038;feed=Articles+%28RSS2%29&#038;seed=http%3A%2F%2Fawkward.org%2F2008%2F03%2F07%2Fiphone-sdk-app-signing-and-beta-testing%2F&#038;seed_title=iPhone+SDK%2C+App+signing+and+Beta+Testing#comments</comments>
		<pubDate>Sat, 08 Mar 2008 02:11:17 +0000</pubDate>
		<dc:creator>awk</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://awkward.org/2008/03/07/iphone-sdk-app-signing-and-beta-testing/</guid>
		<description><![CDATA[Part of the iPhone SDK is a requirement to spend $99/year if you wish to distribute your application through the iTunes Store. The $99 also gives you the ability to load your application into your own phone for testing without needing to use the store. Apparently it does this by giving you a certificate which [...]]]></description>
			<content:encoded><![CDATA[<p>Part of the iPhone SDK is a requirement to spend $99/year if you wish to distribute your application through the iTunes Store.</p>
<p>The $99 also gives you the ability to load your application into your own phone for testing without needing to use the store. Apparently it does this by giving you a certificate which you can use to sign your application, the same certificate needs to be installed into the phone for the application to run.</p>
<p>This is part of Apples mechanism to ensure that only approved (blessed) applications will be distributed through the store &#8211; apps on the store will be signed with a different certificate that Apple will control and that certificate will be installed on all iPhones running V2.0 of the iPhone OS.</p>
<p>What about beta testing your application on a larger pool of users than just your phone &#8211; testing is always a good thing &#8211; but right now it&#8217;s unclear how you can distribute your application to a pool of testers and let them install it. Using the store won&#8217;t be a good thing because that exposes the app to everyone. Require every tester to have paid $99 for the tools to self-sign (as it&#8217;s called) and install the app on their phone ? That seems expensive. Distribute your certificate with each app and have testers install it alongside the app ? Better &#8211; but still the question of exactly how is the app installed.</p>
<p>How to test the fruits of your labours seems quite unanswered right now !</p>
]]></content:encoded>
			<wfw:commentRss>http://awkward.org/feeder/?FeederAction=clicked&#038;feed=Articles+%28RSS2%29&#038;seed=http%3A%2F%2Fawkward.org%2F2008%2F03%2F07%2Fiphone-sdk-app-signing-and-beta-testing%2F&#038;seed_title=iPhone+SDK%2C+App+signing+and+Beta+Testing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iPhone to Android &#8211; I&#8217;ll see your 10 million and raise you another 90 million</title>
		<link>http://awkward.org/feeder/?FeederAction=clicked&#038;feed=Articles+%28RSS2%29&#038;seed=http%3A%2F%2Fawkward.org%2F2008%2F03%2F06%2Fiphone-to-android-ill-see-your-10-million-and-raise-you-another-90-million%2F&#038;seed_title=iPhone+to+Android+%26%238211%3B+I%26%238217%3Bll+see+your+10+million+and+raise+you+another+90+million</link>
		<comments>http://awkward.org/feeder/?FeederAction=clicked&#038;feed=Articles+%28RSS2%29&#038;seed=http%3A%2F%2Fawkward.org%2F2008%2F03%2F06%2Fiphone-to-android-ill-see-your-10-million-and-raise-you-another-90-million%2F&#038;seed_title=iPhone+to+Android+%26%238211%3B+I%26%238217%3Bll+see+your+10+million+and+raise+you+another+90+million#comments</comments>
		<pubDate>Thu, 06 Mar 2008 20:49:36 +0000</pubDate>
		<dc:creator>awk</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://awkward.org/2008/03/06/iphone-to-android-ill-see-your-10-million-and-raise-you-another-90-million/</guid>
		<description><![CDATA[One of the things that Google announced with Android (though they&#8217;ve revised the rules once already) was a competition with between $25,000 and $275,000 in prize money for the best mobile applications on Android. Today&#8217;s &#8216;One More Thing&#8230;&#8217; announcement from Steve Jobs during the iPhone SDK event was for John Doerr from the VC Partners [...]]]></description>
			<content:encoded><![CDATA[<p>One of the things that Google announced with Android (though they&#8217;ve revised the rules once already) was a competition with between $25,000 and $275,000 in prize money for the best mobile applications on Android.</p>
<p>Today&#8217;s &#8216;One More Thing&#8230;&#8217; announcement from Steve Jobs during the iPhone SDK event was for <a href="http://en.wikipedia.org/wiki/John_Doerr" target="_blank">John Doerr</a> from the VC Partners <a href="http://www.kpcb.com" target="_blank">Kleiner Perkins Caulfield &amp; Byers</a> announcing that they&#8217;ve created a $100 million fund to invest in the development of applications for the iPhone. You can find the <a href="http://www.kpcb.com/initiatives/ifund/faq.html" target="_blank">FAQ here</a> &#8211; Kleiner has one of the better track records of picking good tech firms to fund. Gaining their funding would be a huge leg up for any developer !</p>
<p>Frankly I prefer Apple&#8217;s approach &#8211; it seems a little more professional and a little less like a competition for students !</p>
]]></content:encoded>
			<wfw:commentRss>http://awkward.org/feeder/?FeederAction=clicked&#038;feed=Articles+%28RSS2%29&#038;seed=http%3A%2F%2Fawkward.org%2F2008%2F03%2F06%2Fiphone-to-android-ill-see-your-10-million-and-raise-you-another-90-million%2F&#038;seed_title=iPhone+to+Android+%26%238211%3B+I%26%238217%3Bll+see+your+10+million+and+raise+you+another+90+million/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>It&#8217;s all in the predicate</title>
		<link>http://awkward.org/feeder/?FeederAction=clicked&#038;feed=Articles+%28RSS2%29&#038;seed=http%3A%2F%2Fawkward.org%2F2008%2F02%2F26%2Fits-all-in-the-predicate%2F&#038;seed_title=It%26%238217%3Bs+all+in+the+predicate</link>
		<comments>http://awkward.org/feeder/?FeederAction=clicked&#038;feed=Articles+%28RSS2%29&#038;seed=http%3A%2F%2Fawkward.org%2F2008%2F02%2F26%2Fits-all-in-the-predicate%2F&#038;seed_title=It%26%238217%3Bs+all+in+the+predicate#comments</comments>
		<pubDate>Wed, 27 Feb 2008 02:35:01 +0000</pubDate>
		<dc:creator>awk</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[iOnTV]]></category>

		<guid isPermaLink="false">http://awkward.org/2008/02/26/its-all-in-the-predicate/</guid>
		<description><![CDATA[Although I might have ordered a new zippy MacBook &#8211; my old PowerBook is still proving its use: highlighting pieces of code that are just too slow. In the iOnTV UI application the schedule grid (list of what&#8217;s on) is a critical part of the main window. I noticed that as the database of program [...]]]></description>
			<content:encoded><![CDATA[<p>Although I might have ordered a new zippy MacBook &#8211; my old PowerBook is still proving its use: highlighting pieces of code that are just too slow.</p>
<p>In the iOnTV UI application the schedule grid (list of what&#8217;s on) is a critical part of the main window. I noticed that as the database of program information got larger scrolling performance in the schedule grid (going backwards/forwards in time) was terribly slow on my PowerBook.</p>
<p>A little time with Shark showed that I was spending 80% my time in the &#8216;fetch schedules on a station between two times&#8217; method. This method used a simple predicate to fetch only those schedule details fulfilling the arguments :</p>
<blockquote><p>NSPredicate *predicate = [NSPredicate predicateWithFormat:@"((station == %@) AND (time &gt;= %@) AND (time &lt;= %@)) OR ((station == %@) AND (time &lt; %@) AND (endTime &gt; %@))", self, startDate, endDate, self, startDate, startDate];</p></blockquote>
<p>A little thinking about it and I realized that the logic was overly complex and could be simplified :</p>
<blockquote><p>NSPredicate *predicate = [NSPredicate predicateWithFormat:@"(station == %@) AND (((time &gt;= %@) AND (time &lt;= %@)) OR ((endTime &gt;= %@) AND (endTime &lt;= %@)))", self, startDate, endDate, startDate, endDate];</p></blockquote>
<p>I don&#8217;t need to compare against the station more than once &#8211; start with everything on this station, and then consider only those things that start between the two times or end between the two times.</p>
<p>Result ? The fetch is now less than 10% of the CPU usage when changing the start time in the schedule grid ! Much better ! I still have a couple more optimizations to make &#8211; but watch those predicates !</p>
]]></content:encoded>
			<wfw:commentRss>http://awkward.org/feeder/?FeederAction=clicked&#038;feed=Articles+%28RSS2%29&#038;seed=http%3A%2F%2Fawkward.org%2F2008%2F02%2F26%2Fits-all-in-the-predicate%2F&#038;seed_title=It%26%238217%3Bs+all+in+the+predicate/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Thinking Differently</title>
		<link>http://awkward.org/feeder/?FeederAction=clicked&#038;feed=Articles+%28RSS2%29&#038;seed=http%3A%2F%2Fawkward.org%2F2007%2F12%2F05%2Fthinking-differently%2F&#038;seed_title=Thinking+Differently</link>
		<comments>http://awkward.org/feeder/?FeederAction=clicked&#038;feed=Articles+%28RSS2%29&#038;seed=http%3A%2F%2Fawkward.org%2F2007%2F12%2F05%2Fthinking-differently%2F&#038;seed_title=Thinking+Differently#comments</comments>
		<pubDate>Wed, 05 Dec 2007 17:26:08 +0000</pubDate>
		<dc:creator>awk</dc:creator>
				<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://awkward.org/2007/12/05/thinking-differently/</guid>
		<description><![CDATA[I shipped an early version of the iOnTV app a few weeks ago now and have had a few bug reports etc. from the early adopters brave enough to try it out. One thing that&#8217;s become clear is that the current setup process is Not quite robust enough Not &#8216;guided enough&#8217; Looking over the logs [...]]]></description>
			<content:encoded><![CDATA[<p>I shipped an early version of the <a href="http://iontv-app.com" target="_blank">iOnTV </a>app a few weeks ago now and have had a few bug reports etc. from the early adopters brave enough to try it out.</p>
<p>One thing that&#8217;s become clear is that the current setup process is</p>
<ol>
<li>Not quite robust enough</li>
<li>Not &#8216;guided enough&#8217;</li>
</ol>
<p>Looking over the logs of users with problems I&#8217;ve been quite surprised at how &#8216;random&#8217; people can behave in attempting to get things to work.</p>
<p>I tried to set out a step by step approach that should give a complete list of all the stations available to iOnTV, however when it fails people step outside of the step by step approach (which is easy to do) and get lost.</p>
<p>What it comes down to I think is a fundamental difference between how programmers think and how non-programmers (users) think :</p>
<p>One of the mental skills that a good programmer develops that becomes a way of life is that we have a linear thought process with branches and that we&#8217;re particularly good at back tracking to the last junction and taking a different branch whilst remembering all the other junctions and branches we&#8217;ve ever seen (or made) in the past. In other words we&#8217;ve programmed ourselves to be just as linear as the machine we&#8217;re programming.</p>
<p>&#8216;Users&#8217; on the other hand are not so programmed &#8211; in fact they&#8217;re far more random in their actions and generally don&#8217;t maintain such a linear approach to things. They &#8216;jump&#8217; from one spot to another without remembering (or paying heed) to where they were.</p>
<p>How can a developer cope with this ?</p>
<ol>
<li>Work with QA people who are just as random &#8211; this is probably one of the fundamentals of QA and why programmers should not do QA and why a QA person should not write code (white box testing etc. is an engineering process not a QA thing). One of the best QA people I ever worked with (Baron Arnold at Be) was also capable of some of the most &#8216;random&#8217; actions. Infuriating as an engineer to deal with (not personally &#8211; BA is one of the nicest folk out there), but definately &#8216;real world&#8217;</li>
<li>Don&#8217;t give choices without considering the consequences. For iOnTV this means I need to write a &#8216;wizard&#8217; (as much as they can be loathsome) that will guide people through the step-by-step setup process to scan all the devices and find all the stations that iOnTV can receive.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://awkward.org/feeder/?FeederAction=clicked&#038;feed=Articles+%28RSS2%29&#038;seed=http%3A%2F%2Fawkward.org%2F2007%2F12%2F05%2Fthinking-differently%2F&#038;seed_title=Thinking+Differently/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Presentation at Boston CocoaHeads</title>
		<link>http://awkward.org/feeder/?FeederAction=clicked&#038;feed=Articles+%28RSS2%29&#038;seed=http%3A%2F%2Fawkward.org%2F2007%2F11%2F08%2Fpresentation-at-boston-cocoaheads%2F&#038;seed_title=Presentation+at+Boston+CocoaHeads</link>
		<comments>http://awkward.org/feeder/?FeederAction=clicked&#038;feed=Articles+%28RSS2%29&#038;seed=http%3A%2F%2Fawkward.org%2F2007%2F11%2F08%2Fpresentation-at-boston-cocoaheads%2F&#038;seed_title=Presentation+at+Boston+CocoaHeads#comments</comments>
		<pubDate>Fri, 09 Nov 2007 02:37:08 +0000</pubDate>
		<dc:creator>awk</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Leopard]]></category>

		<guid isPermaLink="false">http://awkward.org/2007/11/08/presentation-at-boston-cocoaheads/</guid>
		<description><![CDATA[I gave a presentation this evening at the monthly CocoaHeads meeting here in Boston. The topic was &#8216;Leopard Features in iOnTV&#8217;. You can download the slides of the presentation here.]]></description>
			<content:encoded><![CDATA[<p>I gave a presentation this evening at the monthly CocoaHeads meeting here in Boston. The topic was &#8216;Leopard Features in iOnTV&#8217;. You can download the slides of the presentation <a href="http://www.awkward.org/downloads/Cocoaheads_Presentation.pdf">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://awkward.org/feeder/?FeederAction=clicked&#038;feed=Articles+%28RSS2%29&#038;seed=http%3A%2F%2Fawkward.org%2F2007%2F11%2F08%2Fpresentation-at-boston-cocoaheads%2F&#038;seed_title=Presentation+at+Boston+CocoaHeads/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Why I don&#8217;t &#8216;do&#8217; Enterprise Software</title>
		<link>http://awkward.org/feeder/?FeederAction=clicked&#038;feed=Articles+%28RSS2%29&#038;seed=http%3A%2F%2Fawkward.org%2F2007%2F10%2F29%2Fwhy-i-dont-do-enterprise-software%2F&#038;seed_title=Why+I+don%26%238217%3Bt+%26%238216%3Bdo%26%238217%3B+Enterprise+Software</link>
		<comments>http://awkward.org/feeder/?FeederAction=clicked&#038;feed=Articles+%28RSS2%29&#038;seed=http%3A%2F%2Fawkward.org%2F2007%2F10%2F29%2Fwhy-i-dont-do-enterprise-software%2F&#038;seed_title=Why+I+don%26%238217%3Bt+%26%238216%3Bdo%26%238217%3B+Enterprise+Software#comments</comments>
		<pubDate>Mon, 29 Oct 2007 18:56:21 +0000</pubDate>
		<dc:creator>awk</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Personal]]></category>

		<guid isPermaLink="false">http://awkward.org/2007/10/29/why-i-dont-do-enterprise-software/</guid>
		<description><![CDATA[Jason Fried has a nice article on &#8216;Why Enterprise Software Sucks&#8216; with which I agree entirely.For the last 10 years I&#8217;ve worked entirely on projects that individuals use &#8211; indeed the lack of the individual focus was why I left two previous employers. If I decide to move on from my current position I suspect [...]]]></description>
			<content:encoded><![CDATA[<p>Jason Fried has a nice article on &#8216;<a href="http://www.37signals.com/svn/posts/669-why-enterprise-software-sucks" target="_blank">Why Enterprise Software Sucks</a>&#8216; with which I agree entirely.For the last 10 years I&#8217;ve worked entirely on projects that individuals use &#8211; indeed the lack of the individual focus was why I left two previous employers. If I decide to move on from my current position I suspect that a shift away from focusing on the individual will be part of the reason why.One of the great things about the <a href="http://iontv-app.com" target="_blank">iOnTV</a> project is that it&#8217;s entirely individually focused and I think this is also a driving force behind many of the &#8216;indie&#8217; developers out there today for the Mac. I really don&#8217;t think <a href="http://gusmueller.com/blog/" target="_blank">Gus Mueller</a> had the large art department in mind when he wrote <a href="http://www.flyingmeat.com/acorn/" target="_blank">Acorn</a>, and <a href="http://www.wilshipley.com/blog/" target="_blank">Wil Shipley</a> clearly doesn&#8217;t design <a href="http://www.delicious-monster.com/" target="_blank">Delicious Library</a> for &#8216;libraries&#8217;. Both of these folks (and so <a href="http://www.red-sweater.com/products/index.html" target="_blank">many,</a> <a href="http://photon-app.com" target="_blank">many</a> <a href="http://www.wonderwarp.com/shovebox/" target="_blank">more</a>) are focused entirely on the individual. </p>
]]></content:encoded>
			<wfw:commentRss>http://awkward.org/feeder/?FeederAction=clicked&#038;feed=Articles+%28RSS2%29&#038;seed=http%3A%2F%2Fawkward.org%2F2007%2F10%2F29%2Fwhy-i-dont-do-enterprise-software%2F&#038;seed_title=Why+I+don%26%238217%3Bt+%26%238216%3Bdo%26%238217%3B+Enterprise+Software/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ScriptingBridge</title>
		<link>http://awkward.org/feeder/?FeederAction=clicked&#038;feed=Articles+%28RSS2%29&#038;seed=http%3A%2F%2Fawkward.org%2F2007%2F10%2F26%2Fscriptingbridge%2F&#038;seed_title=ScriptingBridge</link>
		<comments>http://awkward.org/feeder/?FeederAction=clicked&#038;feed=Articles+%28RSS2%29&#038;seed=http%3A%2F%2Fawkward.org%2F2007%2F10%2F26%2Fscriptingbridge%2F&#038;seed_title=ScriptingBridge#comments</comments>
		<pubDate>Sat, 27 Oct 2007 03:50:09 +0000</pubDate>
		<dc:creator>awk</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Leopard]]></category>

		<guid isPermaLink="false">http://awkward.org/2007/10/26/scriptingbridge/</guid>
		<description><![CDATA[One of the new &#8216;developer&#8217; features (i.e. a new API) in Leopard is ScriptingBridge. It&#8217;s a significant improvement to the mechanics of driving one application from another using AppleScript/AppleEvents.It&#8217;s always been possible to use NSAppleScript in Cocoa to send AppleScript to another application basically using a simple string : NSString *appleScriptSource = [NSString stringWithFormat:@"tell iTunes [...]]]></description>
			<content:encoded><![CDATA[<p>One of the new &#8216;developer&#8217; features (i.e. a new API) in Leopard is ScriptingBridge. It&#8217;s a significant improvement to the mechanics of driving one application from another using AppleScript/AppleEvents.It&#8217;s always been possible to use NSAppleScript in Cocoa to send AppleScript to another application basically using a simple string :</p>
<p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal"><span class="Apple-tab-span" style="white-space: pre">	</span>NSString *appleScriptSource = [<span style="color: #5c2699">NSString</span> <span style="color: #2e0d6e">stringWithFormat</span>:<span style="color: #c41a16">@"tell iTunes to add (POSIX file \"%@\")"</span>, moviePath];</p>
<p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal"><span class="Apple-tab-span" style="white-space: pre">	</span>NSAppleScript *aScript  = [[<span style="color: #5c2699">NSAppleScript</span> <span style="color: #2e0d6e">alloc</span>] <span style="color: #2e0d6e">initWithSource</span>:appleScriptSource];</p>
<p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal"><span class="Apple-tab-span" style="white-space: pre">	</span>NSAppleEventDescriptor *aDescriptor = [aScript <span style="color: #2e0d6e">executeAndReturnError</span>:&amp;anError];</p>
<p>Not too bad, and you do get the returned data and in theory you can use that in subsequent scripts to affect the added track (adding metadata, setting it&#8217;s kind etc). However it&#8217;s slow and still really rather clumsy, and if you want to do any real argument munging you may be forced to revert to NSAppleEvent directly which is really painful and exceedingly longwinded.ScriptingBridge in Leopard makes this much, much more straightforward and friendly. Using the command line sdef and sdp tools you can create an Objective-C 2.0 header file which contains all the scriptable classes and elements of an application. Then you can include the header file and ScriptingBridge framework and the above code becomes:</p>
<p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; color: #2e0d6e"><span style="color: #000000"><span class="Apple-tab-span" style="white-space: pre">	</span></span><span style="color: #3f6e74">iTunesApplication</span><span style="color: #000000"> *iTunes = [</span><span style="color: #5c2699">SBApplication</span><span style="color: #000000"> </span>applicationWithBundleIdentifier<span style="color: #000000">:</span><span style="color: #c41a16">@"com.apple.iTunes"</span><span style="color: #000000">];</span></p>
<p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal"><span class="Apple-tab-span" style="white-space: pre">	</span>[iTunes <span style="color: #2e0d6e">setDelegate</span>:<span style="color: #aa0d91">self</span>];</p>
<p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; min-height: 14px"><span class="Apple-tab-span" style="white-space: pre">	</span><span style="color: #5c2699">NSArray</span> *filesArray = [<span style="color: #5c2699">NSArray</span> <span style="color: #2e0d6e">arrayWithObject</span>:[<span style="color: #5c2699">NSURL</span> <span style="color: #2e0d6e">fileURLWithPath</span>:moviePath]];</p>
<p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal"><span class="Apple-tab-span" style="white-space: pre">	</span><span style="color: #3f6e74">iTunesTrack</span> *theTrack = [iTunes <span style="color: #26474b">add</span>:filesArray <span style="color: #26474b">to</span>:<span style="color: #aa0d91">nil</span>];</p>
<p> At first glance it looks like this is about the same code, but it executes much faster (no script parsing/compilation to AppleEvents). The returned object is a real Objective-C object so in the next line you can do :</p>
<p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal"><span class="Apple-tab-span" style="white-space: pre">	</span>theTrack.videoKind = <span style="color: #26474b">iTunesEVdKTVShow</span>;</p>
<p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal"><span class="Apple-tab-span" style="white-space: pre">	</span>theTrack.show = <span style="color: #5c2699">movieTitle</span>;</p>
<p> Note &#8211; you can use Objective-C 2.0 style properties. Much neater than lines and lines of coded AppleScript. There is one catch &#8211; the header file is built from parsing the scripting definitions in the application (the sdef). These can still tend to be rather opaque &#8211; and in particular rather &#8216;type free&#8217;. AppleScript generally is a very weak typing language, and if you&#8217;re used to strong typing (C like) languages it can be a bit of a mind bending experience. In the iTunes case I struggled for a couple of days with the add: to: message &#8211; the generated header says :</p>
<p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; color: #007400"><span style="color: #000000">- (</span><span style="color: #3f6e74">iTunesTrack</span><span style="color: #000000"> *) add:(</span><span style="color: #5c2699">NSArray</span><span style="color: #000000"> *)x to:(</span><span style="color: #5c2699">SBObject</span><span style="color: #000000"> *)to;  </span>// add one or more files to a playlist</p>
<p> There&#8217;s no indication of type for the contents of the array. Experience with ScriptEditor (and the initial NSAppleScript solution) suggested I should be able to just use an NSString in the array with the POSIX style path. However that failed with a &#8216;not found&#8217; error when the message was sent. I initially thought it was a problem with the to argument needing to be a valid playlist and I spent quite some time convincing myself that I had a valid playlist argument (basically iterating things in the iTunesApplication object to get down to a playlist). Finally I went back to ScriptEditor and launched it from Terminal with the AEDebug=1 and AEDebugSends=1 environment variable set. This shows on stdout a debug of the AppleEvents that ScriptEditor sends. Looking at the log I could see that ScriptEditor was converting my POSIX path into an &#8216;furl&#8217;  (File URL) ! The lightbulb came on and I adjusted my code to do likewise with an NSURL and everything &#8216;just worked&#8217; as I&#8217;d hoped it would. It is odd however &#8211; the definition in the scripting def file actually refers to an &#8216;alias&#8217; an old world MacOS 7 concept that&#8217;s pretty much fallen out of use. I expected the path string to be converted correctly, after all I&#8217;d already proven that other AppleEvents in other applications (Sketch2 in Leopard is a good test case) that take alias get converted, however it appears as though there&#8217;s something more specific in the iTunes case that needs the file URL.</p>
]]></content:encoded>
			<wfw:commentRss>http://awkward.org/feeder/?FeederAction=clicked&#038;feed=Articles+%28RSS2%29&#038;seed=http%3A%2F%2Fawkward.org%2F2007%2F10%2F26%2Fscriptingbridge%2F&#038;seed_title=ScriptingBridge/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

