<?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>Red Sweater Blog &#187; Apple</title>
	<atom:link href="http://www.red-sweater.com/blog/category/articles/apple/feed" rel="self" type="application/rss+xml" />
	<link>http://www.red-sweater.com/blog</link>
	<description>Mac &#38; Technology Writings by Daniel Jalkut</description>
	<lastBuildDate>Tue, 17 Jan 2012 22:03:11 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.1</generator>
		<item>
		<title>Freedom From Choice</title>
		<link>http://www.red-sweater.com/blog/2200/freedom-from-choice</link>
		<comments>http://www.red-sweater.com/blog/2200/freedom-from-choice#comments</comments>
		<pubDate>Fri, 07 Oct 2011 16:55:50 +0000</pubDate>
		<dc:creator>Daniel Jalkut</dc:creator>
				<category><![CDATA[Apple]]></category>

		<guid isPermaLink="false">http://www.red-sweater.com/blog/?p=2200</guid>
		<description><![CDATA[Since Steve Jobs passed away on Wednesday, the web has been overflowing with heartfelt tributes to the impact his work had on the technology world, and the world at large. But a few people don&#8217;t respect or value the contributions that Jobs made. Richard Stallman, the famously anti-Apple, GPL protagonist, comes off borderline celebratory in [...]]]></description>
			<content:encoded><![CDATA[<p>Since Steve Jobs passed away on Wednesday, the web has been overflowing with heartfelt tributes to the impact his work had on the technology world, and the world at large.</p>
<p>But a few people don&#8217;t respect or value the contributions that Jobs made. Richard Stallman, the famously anti-Apple, <a href="http://www.gnu.org/copyleft/gpl.html">GPL</a> protagonist, comes off <a href="http://stallman.org/archives/2011-jul-oct.html#06_October_2011_(Steve_Jobs)">borderline celebratory</a> in his reaction:</p>
<blockquote>
<p>Steve Jobs, the pioneer of the computer as a jail made cool, designed to sever fools from their freedom, has died. As Chicago Mayor Harold Washington said of the corrupt former Mayor Daley, &#8220;I&#8217;m not glad he&#8217;s dead, but I&#8217;m glad he&#8217;s gone.&#8221;</p>
</blockquote>
<p>It&#8217;s dumbfounding to me that anybody who lives to <em>any degree</em> in the public&#8217;s eye could be this emotionally callous about the death of another person. He paints Jobs as a robber of freedoms, first and foremost, while neglecting to acknowledge the many <em>liberties</em> he brought, for example to those of us who can&#8217;t, or don&#8217;t want to build our own computing infrastructures.</p>
<p>I find it laughably easy to <a href="http://www.red-sweater.com/blog/825/getting-pretty-lonely">poke holes</a> in the philosophy of &#8220;freedom&#8221; that Stallman and his acolytes passionately pursue. In this particular case, his metaphor of the computer as a jail brings to mind the beauty of constraints. Freedom <em>from</em> choice can be as liberating and empowering as freedom of choice.</p>
<p>Imagine a Steinway piano: each string is perfectly tuned so as to cast a unique, beautiful tone into the air with the gentle press of a key. I respect and value this instrument as a liberator of artistic expression. Many people find a lifetime&#8217;s pursuit of study in this device, extracting no end of joy from the limitless possibilities it offers.</p>
<p>But to Richard Stallman the piano must appear no less than &#8220;musical jail.&#8221; After all, the sound spectrum is made up of an infinite number of tuneable pitches, and this … instrument … this villainous oppressor of choice, limits its users to a paltry 88 tones.</p>
<p> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.red-sweater.com/blog/2200/freedom-from-choice/feed</wfw:commentRss>
		<slash:comments>22</slash:comments>
		</item>
		<item>
		<title>Steve Jobs &#8211; 1955-2011</title>
		<link>http://www.red-sweater.com/blog/2192/steve-jobs-1955-2011</link>
		<comments>http://www.red-sweater.com/blog/2192/steve-jobs-1955-2011#comments</comments>
		<pubDate>Thu, 06 Oct 2011 02:10:09 +0000</pubDate>
		<dc:creator>Daniel Jalkut</dc:creator>
				<category><![CDATA[Apple]]></category>

		<guid isPermaLink="false">http://www.red-sweater.com/blog/2192/%ef%a3%bf</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p style="margin-top: 1em; font-size: 4em;"><a href="https://twitter.com/#!/search/"></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.red-sweater.com/blog/2192/steve-jobs-1955-2011/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sandbox Corners</title>
		<link>http://www.red-sweater.com/blog/2170/sandbox-corners</link>
		<comments>http://www.red-sweater.com/blog/2170/sandbox-corners#comments</comments>
		<pubDate>Fri, 09 Sep 2011 18:48:00 +0000</pubDate>
		<dc:creator>Daniel Jalkut</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.red-sweater.com/blog/?p=2170</guid>
		<description><![CDATA[Apple&#8217;s sandboxing technologies make it possible to control at a very fine-grain system level exactly which system resources an application should be allowed to access. It offers control over reading and writing  files, opening  network resources, and much more. I&#8217;m really excited about sandboxing and also really terrified. Apple has given us, thus far, a [...]]]></description>
			<content:encoded><![CDATA[<p>Apple&#8217;s sandboxing technologies make it possible to control at a very fine-grain system level exactly which system resources an application should be allowed to access. It offers control over reading and writing  files, opening  network resources, and much more.</p>
<p>I&#8217;m really excited about sandboxing and also really terrified. Apple has given us, thus far, a limiting set of entitlements that don&#8217;t quite cover everything that reasonable apps want to do, or even everything that Apple itself has approved as acceptable behavior in the Mac App Store. Yet Apple has made it clear that it wants to see all apps adopt sandboxing, and the writing is on the wall that in particular, participants in the Mac App Store should be prepared for the day when non-sandboxed apps may not be approved for sale in the store.</p>
<p>For us developers looking into sandboxing our own apps, it can be tough to wrap one&#8217;s head around exactly what privileges need to be requested. One way to go about it is to sandbox your application with the strictest of controls (basically disallow everything disallowable), and see what breaks. Then you could add back whatever entitlements are necessary to get things working again.</p>
<p>On the other hand, it would be handier to have the system simply tell us what kinds of behaviors our app is engaging in, and what the corresponding entitlements would be to allow it to work even while sandboxed. Thanks to a tracing mechanism in the sandbox, this is in fact possible. Furthermore, you can use a command-line tool to apply arbitrary sandbox profiles to an application without having to modify the application itself.</p>
<p>I defined a handy shortcut in zsh for running an arbitrary app with the &#8220;trace&#8221; mechanism enabled, to show exactly what the app is accessing, simplify the output, and open it in my default text editor:</p>
<pre style="font-size: 1.0em;">function sbx()
{
        echo '(version 1)\n(trace "/tmp/traceout.sb")' &gt; /tmp/tracein.sb
        sandbox-exec -f /tmp/tracein.sb $1
        sandbox-simplify /tmp/traceout.sb &gt; /tmp/tracesimple.sb
        open -t /tmp/tracesimple.sb
}</pre>
<p>After you&#8217;ve defined this in your .zshrc (other shells, you are on your own!), you can do something like:</p>
<pre style="font-size: 1.0em;"><span>sbx /Applications/FastScripts</span>.app/Contents/MacOS/FastScripts</pre>
<p>Then you use whatever features in your app you are concerned about, and quit the app. A text file will open with exquisite details about all the privileged actions your app was permitted to do, which would otherwise be forbidden by the sandbox.  Great, just copy that list of permissions into your sandbox entitlements plist, and we&#8217;re done. Right? Not quite.</p>
<p>The rules generated by the trace are very precise and may not be sufficient to cover your app&#8217;s behavior in practice. For example, if I open FastScripts, my scripting utility, and run a single AppleScript that controls the terminal, the resulting permissions trace reveals a sandbox rule that would allow that behavior to happen:</p>
<pre style="font-size: 1.0em;">(allow appleevent-send
       (appleevent-destination "com.apple.terminal"))
</pre>
<p>That&#8217;s well and good for a utility that only ever needs to send events to the Terminal, but of course FastScripts is a general purpose scripting application that needs to send events &#8220;wherever the heck the user wants to send them.&#8221; Currently, Apple doesn&#8217;t offer a sandbox entitlement for this broad behavior, so it is not possible to sandbox FastScripts.</p>
<p>I think that Apple would have a lot more developer enthusiasm for this feature if it wasn&#8217;t so clear to many of us that our apps will be forced to lose features in order to adopt sandboxing. And while users may be happy about the prospects of improved security with the sandbox, I think there will be less excitement about the diminished functionality of apps whose features don&#8217;t fit nicely into the sandbox confines.</p>
<p>Developers and power-users can use the sandbox command-line tools now to get a good sense for what will or will not work down the road if sandboxing, with the current set of entitlements, is enforced by Apple for a large number of 3rd party applications. There is some documentation for these tools in e.g. &#8220;man sandbox-exec&#8221;, but the documentation is pretty minimal. If you want to read more, check out this <a href="http://reverse.put.as/wp-content/uploads/2011/09/Apple-Sandbox-Guide-v0.1.pdf">useful document</a>, which aims to give a better understanding of the sandbox, entitlement profiles, and how to use the command-line tools.</p>
<p> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.red-sweater.com/blog/2170/sandbox-corners/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Fall Speaking Lineup</title>
		<link>http://www.red-sweater.com/blog/2162/fall-speaking-lineup</link>
		<comments>http://www.red-sweater.com/blog/2162/fall-speaking-lineup#comments</comments>
		<pubDate>Tue, 30 Aug 2011 14:53:07 +0000</pubDate>
		<dc:creator>Daniel Jalkut</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://www.red-sweater.com/blog/?p=2162</guid>
		<description><![CDATA[After the stress of moving (tomorrow!) is passed, I&#8217;ll be tackling a slate of new challenges this fall, including the usual work at Red Sweater, developing future versions of MarsEdit and my other apps. But I&#8217;ll also be punctuating the season with a few speaking opportunities at three great conferences. Çingleton. October 14-15. Montreal, Québec. [...]]]></description>
			<content:encoded><![CDATA[<p>After the stress of moving (tomorrow!) is passed, I&#8217;ll be tackling a slate of new challenges this fall, including the usual work at Red Sweater, developing future versions of <a href="http://www.red-sweater.com/marsedit/">MarsEdit</a> and my other apps. But I&#8217;ll also be punctuating the season with a few speaking opportunities at three great conferences.</p>
<ul>
<li><a href="http://çingleton.com/">Çingleton</a>. October 14-15. Montreal, Québec. My friends <a href="http://kickingbear.com/">Guy English</a>, <a href="http://indev.ca/">Scott Morrison</a>, and <a href="http://edovia.com/">Luc Vandal</a> teamed up to put on a very small, very focused &#8220;symposium.&#8221; I love the small scale and single-tracked nature, but it comes with one huge drawback: low capacity. Just as the similarly formatted C4 conferences sold out quickly every year, I expect Çingleton will do the same.</li>
<li><a href="http://www.mactech.com/conference/about">MacTech</a>. November 2-4, Los Angeles, California. This year&#8217;s show features a keynote from <a href="http://www.guykawasaki.com/">Guy Kawasaki</a>, which will be exciting for me, since I&#8217;ve corresponded with Guy over the years: he&#8217;s provided a ton of valuable feedback about MarsEdit. Also exciting is the addition to the organization team of Scotty from <a href="http://ideveloper.tv/blog/">iDeveloperTV</a>, who will be running the developer side of the conference.</li>
<li><a href="http://ios2011.voicesthatmatter.com/">Voices That Matter</a>. November 12-13. Boston, Massachusetts. The floating conference moves back to Boston, the site of its first show, at which I also had the pleasure of speaking. They have just <a href="http://ios2011.voicesthatmatter.com/calendar">posted the schedule</a>, revealing that <a href="http://bignerdranch.com/instructors/hillegass.shtml">Aaron Hillegass</a> will be delivering the opening keynote. Definitely wake up for this!</li>
</ul>
<p>The Voices That Matter folks are offering a coupon code with a twist: $150 off for the purchaser, with a $50 bonus for me as the speaker. I am not paid for the speaking itself, so if you are looking for a discount, consider using &#8220;<strong>BSTSPK5</strong>&#8220;. When combined with the early-bird pricing, it brings the cost of the conference down to $395.</p>
<p>With such a busy speaking lineup, I have once again had to pass on some other conferences where I would have enjoyed the less demanding experience of<em> </em>simply attending. In particular, I am bummed to be missing:</p>
<ul>
<li><a href="http://360idev.com/">360iDev</a>. September 11-14. Denver, Colorado. Another show I haven&#8217;t had the pleasure of attending yet, but that is celebrated by many of my peers. The <a href="http://360idev.com/schedule">schedule</a> a more conventional, multi-track affair, which is great for those who prefer to pick a favorite topic from a variety of choices. The keynote address will be delivered by my friend <a href="http://360idev.com/schedule">Matt Drance</a>, whose work you may also know from his past life as an Apple evangelist.</li>
<li><a href="http://www.secondconf.com/">SecondConf</a>. September 23-25. Chicago, Illinois. Seen by many as the organic successor to C4, I have been hoping to attend for the past two years. This year&#8217;s <a href="http://www.secondconf.com/speakers/">roster of speakers</a> is outstanding, featuring some well-known developers and … <a href="http://ihnatko.com/">Andy Ihnatko</a>! But it&#8217;s also notable for featuring some folks who don&#8217;t do as much public speaking, including <a href="http://rohdesign.com/">Mike Rohde</a>, the designer of Red Sweater&#8217;s logo!</li>
</ul>
<p>Suffice to say, there is a lot going on this fall. If you are looking  for something to do, take a click-through to some of these great shows and see if any of them sounds like the right place for you.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.red-sweater.com/blog/2162/fall-speaking-lineup/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Steve Jobs</title>
		<link>http://www.red-sweater.com/blog/2143/steve-jobs</link>
		<comments>http://www.red-sweater.com/blog/2143/steve-jobs#comments</comments>
		<pubDate>Thu, 25 Aug 2011 05:07:08 +0000</pubDate>
		<dc:creator>Daniel Jalkut</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Nostalgia]]></category>

		<guid isPermaLink="false">http://www.red-sweater.com/blog/?p=2143</guid>
		<description><![CDATA[I was hired at Apple on May 13, 1996. I was twenty years old, and had been using a Mac for approximately two years, during which time I had been contracting for Apple on and off as a QA engineer, while I finished my B.A. at UC Santa Cruz. Gil Amelio was the CEO. I [...]]]></description>
			<content:encoded><![CDATA[<p>I was hired at Apple on May 13, 1996. I was twenty years old, and had been using a Mac for approximately two years, during which time I had been contracting for Apple on and off as a QA engineer, while I finished my B.A. at UC Santa Cruz. Gil Amelio was the CEO.</p>
<p>I had grown up using mostly non-Apple products. My dad bought me a Timex Sinclair when I was six. I moved on to a Commodore 64, an Amiga 1000, and finally a Unix-based Sun 3/50 before I caught Mac fever in 1994. Two years later, I was working full-time at Apple as a software engineer at Apple.</p>
<p>When I signed on, Jobs was long gone, but his legacy was strong. Ten years after his departure from the company, bumpers in the parking lot remained plastered with the aspirational &#8220;The Journey is the Reward&#8221; proverbs that he had famously reiterated. Jobs made his mark, and the pursuit of excellence was alive and well inside Apple.</p>
<p>In late 1996, Apple announced that it would acquire Steve Jobs&#8217;s NeXT computing. Steve Jobs, in one role or another, was returning to Apple. I was overwhelmed, but excited. Although I had never worked for Steve Jobs, I felt that I had been working on his vision.</p>
<p>When I left Apple in 2002, it seemed that Jobs had won. He proved himself to critics by rescuing Apple from the throes of bankruptcy and restoring it to a company of huge successes. The iMac, iPod, and Mac OS X were all new testaments to his enduring legacy at Apple.</p>
<p>But he was just getting started. Still to come were not only the obvious iPhone and iPad, but dozens of less obvious successes ranging from the ever-improving Mac OS X, to the incredible Airport Express, to the fact that every damn thing Apple makes just works so damned well together.</p>
<p>Pixar Animation Studios is another of Jobs&#8217;s great successes. My three-year old, Henry, has lately been obsessed with everything Pixar. This includes &#8220;Cars,&#8221; which I have seen more times than I care to admit. It&#8217;s actually a pretty great film, and I&#8217;m fond of the romantic interlude where the protagonist Lightning McQueen is led on a carefree drive through the desert by his love interest, Sally. Their ride is set to an upbeat <a href="http://www.youtube.com/watch?v=_w1M5m8CCRI">Randy Newman tune</a>, which helps to pack an emotional punch in the scene.</p>
<p>Today I was driving in my own car, and heard an old Bob Dylan song that I realized the Randy Newman score reminds me of.  Steve Jobs is known to be a huge Bob Dylan fan, so it&#8217;s especially poignant that on the day of his retirement as CEO of Apple, I may have found myself listening to one of his favorite songs. <a href="http://www.youtube.com/watch?v=eRj3MCPazuM">Buckets of Rain</a> also includes a concise proverb of its own, which serves as an appropriate comment on Jobs&#8217;s career:</p>
<blockquote>
<p>&#8220;Life is sad, and life is a bust, all you can do is do what you must. You do what you must do, and you do it well.&#8221; &#8212; Bob Dylan, &#8220;Buckets of Rain&#8221;</p>
</blockquote>
<p>Well said, Bob. Well done, Steve. For the rest of us: let us do what we must do, and do it well.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.red-sweater.com/blog/2143/steve-jobs/feed</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Even Geekier Window Resizing</title>
		<link>http://www.red-sweater.com/blog/1990/even-geekier-window-resizing</link>
		<comments>http://www.red-sweater.com/blog/1990/even-geekier-window-resizing#comments</comments>
		<pubDate>Sat, 23 Jul 2011 21:03:54 +0000</pubDate>
		<dc:creator>Daniel Jalkut</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Lion]]></category>

		<guid isPermaLink="false">http://www.red-sweater.com/blog/?p=1990</guid>
		<description><![CDATA[One of the UI concessions OS X Lion makes to a time-honored Microsoft Windows feature, is the addition window-resizing hotspots on all edges of a given window. Traditionally, Mac users have been limited to resizing windows only through the use of the &#8220;Zoom&#8221; button in the title bar, or by clicking and dragging the resize [...]]]></description>
			<content:encoded><![CDATA[<p>One of the UI concessions OS X Lion makes to a time-honored Microsoft Windows feature, is the addition window-resizing hotspots on all edges of a given window. Traditionally, Mac users have been limited to resizing windows only through the use of the &#8220;Zoom&#8221; button in the title bar, or by clicking and dragging the resize control at the bottom-right corner of a window.</p>
<p>Now you can grab any edge of a window and grow or shrink it to suit your wants. What I didn&#8217;t notice until today, however, are a few interesting variations on window resizing that are facilitated by pressing a modifier key while resizing.</p>
<p>Hold the <strong>option key</strong> while resizing to cause changes in the  window&#8217;s width or height to be made in equal measure on each side of the window. For example, clicking and dragging the right edge of a window with option depressed will cause the left side to grow or shrink in mirrored fashion. For lack of a better term, I&#8217;ll call this <strong>balanced resizing</strong>.</p>
<p>Hold the <strong>shift key</strong> while resizing to impose <strong>constrained resizing.</strong> Whatever direction you grow or shrink the window, adjustments will be made so that the ratio of height to width remains the same.</p>
<p>These are some pretty geeky resizing modes. I don&#8217;t foresee using them particularly often, but it&#8217;s interesting to know they are there.</p>
<p>(I did some preliminary Googling before sharing this, and didn&#8217;t see any documentation come up. I&#8217;ve since noticed that Matt Gemmell already <a href="https://twitter.com/#!/mattgemmell/status/93713451167383552">shared this tip</a> in a Twitter update.)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.red-sweater.com/blog/1990/even-geekier-window-resizing/feed</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Picking Off iCal&#8217;s Paper Bits</title>
		<link>http://www.red-sweater.com/blog/1970/picking-off-icals-paper-bits</link>
		<comments>http://www.red-sweater.com/blog/1970/picking-off-icals-paper-bits#comments</comments>
		<pubDate>Sat, 23 Jul 2011 20:07:38 +0000</pubDate>
		<dc:creator>Daniel Jalkut</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Hacking]]></category>
		<category><![CDATA[Lion]]></category>
		<category><![CDATA[Rant]]></category>

		<guid isPermaLink="false">http://www.red-sweater.com/blog/?p=1970</guid>
		<description><![CDATA[OS X Lion brings dramatically redesigned versions of the classic iCal and Address Book applications. Many people, or at least some important decision makers inside Apple, are very happy with these changes. Other folks, such as myself, believe they look and behave like crap. When I first saw the Lion version of iCal, my eyes [...]]]></description>
			<content:encoded><![CDATA[<p>OS X Lion brings dramatically redesigned versions of the classic iCal and Address Book applications. Many people, or at least some important decision makers inside Apple, are very happy with these changes. Other folks, such as myself, believe they look and behave like crap.</p>
<p>When I first saw the Lion version of iCal, my eyes were drawn to the obnoxious bits of paper that cling to the top of the window, artificially and pointlessly leaving the debris that you might find on a real-life calendar with removable paper sheets:</p>
<p><img title="iCal-Messy.png" src="http://www.red-sweater.com/blog/wp-content/downloads/2011/07/iCal-Messy.png" border="0" alt="ICal Messy" width="450" height="192" /></p>
<p>As <a href="https://twitter.com/catshive">Cathy Shive</a> pointed out in her <a href="http://nsconference.com/">NSConference</a> talk on user interface metaphors, the presence of junk like this in an application is at best useless, at worst distracting and detrimental to the usability of the application. I remember her saying in her talk, before Lion&#8217;s iCal had even been presented in a private developer beta, that little things like paper scraps in an application are particularly annoying because she always wants to try to pick them off just as she would with a physical object.</p>
<p>Lion has given me the opportunity to empathize deeply with that concern. I hate those cruddy paper bits, and I can&#8217;t pick them off! Or can&#8217;t I?</p>
<p>To clean up your copy of iCal on Lion:</p>
<ol>
<li>Select the iCal application in the Finder and press cmd-D to duplicate (make a backup, for safe keeping).</li>
<li>Control click the application icon and select &#8220;Show Package Contents.&#8221;</li>
<li>Navigate to Contents/Resources/</li>
<li>Select &#8220;CanvasTopTile.png&#8221; and open it up in <a href="http://flyingmeat.com/acorn/">Acorn</a> or another, less attractive image editor. Or download <a href="http://www.red-sweater.com/blog/wp-content/downloads/2011/07/CanvasTopTile.png">my edited version</a> and replace the original file.</li>
<li>Select the paper bits and &#8220;clean them up&#8221; by deleting them.</li>
<li>Reopen iCal, and bask in the glow of your clean white calendar:</li>
</ol>
<p><img title="iCal-Clean.png" src="http://www.red-sweater.com/blog/wp-content/downloads/2011/07/iCal-Clean.png" border="0" alt="ICal Clean" width="450" height="197" /></p>
<p>Granted, this <em>only fixes the paper bits</em>. You&#8217;re still stuck with that horrendous tan leather toolbar. But at least that doesn&#8217;t beg to be picked at. It&#8217;s worth noting that the tan leather can also be tweaked by editing a variety of other image resources in the bundle. It&#8217;s trickier because many of the graphical components of the toolbar are designed to blend with the leather background, so you&#8217;ll end up having to change quite a few of the images.</p>
<p>I&#8217;m reminded of <em>another great observation</em> Cathy made in her talk: when you make very stylistic choices like this for a user interface, you dramatically increase the variety of reasons that the customer can be repulsed by the design. What if I don&#8217;t like leather? What if I don&#8217;t like <em>tan leather</em>? What if I prefer a <em>running stitch</em> to an <em>outline stitch</em>? You can argue that matte grays and subdued color gradients may invite the same controversy, but there&#8217;s a reason they are so common in user interfaces: because they&#8217;re far less likely to distract from the form and function of the application itself.</p>
<p><strong>Addendum: </strong><strong>Updating the iCal code signature</strong>. Thanks to <a href="https://twitter.com/rentzsch/status/94862617918717952">rentzsch</a> and <a href="https://twitter.com/daagaak/status/94867316520648704">daagaak</a> on Twitter for pointing out that editing the resource will break the &#8220;code signature&#8221; on the application, put there by Apple to assure users that the application 1. Was developed by Apple, and 2. Has not been modified by anybody but Apple. You can re-sign the application after tweaking it, to put it back into a  &#8221;signed&#8221; state, albeit not by Apple. Hopefully this will prevent it from prompting you all the time about approving connections to services like MobileMe. From the Terminal:</p>
<pre> codesign -f -s - /Applications/iCal.app</pre>
<p>This reveals how little things like tweaking an application&#8217;s resources have wider-reaching consequences than they used to. I&#8217;m pretty sure you won&#8217;t miss any functionality in iCal by using a self-signed copy of the app vs. an Apple-signed version. But I could be wrong!</p>
<ol> </ol>
]]></content:encoded>
			<wfw:commentRss>http://www.red-sweater.com/blog/1970/picking-off-icals-paper-bits/feed</wfw:commentRss>
		<slash:comments>22</slash:comments>
		</item>
		<item>
		<title>Bit Hacking</title>
		<link>http://www.red-sweater.com/blog/1947/bit-hacking</link>
		<comments>http://www.red-sweater.com/blog/1947/bit-hacking#comments</comments>
		<pubDate>Thu, 21 Jul 2011 14:28:37 +0000</pubDate>
		<dc:creator>Daniel Jalkut</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Hacking]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.red-sweater.com/blog/?p=1947</guid>
		<description><![CDATA[Lion is the first operating system to require, and to fully take advantage of, 64-bit addressing modes in the Intel chips that power Apple&#8217;s Macintosh computers. One of the side-effects of this is that every object identifier in Mac OS X&#8217;s Cocoa programming framework (typically an address in memory), is now twice as long as [...]]]></description>
			<content:encoded><![CDATA[<p>Lion is the first operating system to require, and to fully take advantage of, 64-bit addressing modes in the Intel chips that power Apple&#8217;s Macintosh computers. One of the side-effects of this is that every object identifier in Mac OS X&#8217;s Cocoa programming framework (typically an address in memory), is now twice as long as it was in a 32-bit environment.</p>
<p>Apple has apparently taken advantage of the 64-bit runtime in Lion by optimizing the Objective C runtime itself to use some of these extra bits for, shall we say, clever purposes. <a href="http://objectivistc.tumblr.com/">Bavarious describes an optimization</a> through which Apple is able to replace previously full-fledged opaque objects such as NSNumber with an object-placeholder that exists entirely as the 64-bit &#8220;object address&#8221; itself. This means that, for a wide range of &#8220;simple&#8221; objects, no additional memory allocation is required, and no retain/release memory management is required for the &#8220;object.&#8221;</p>
<p>The trick relies on a implementation detail of the system, that allocated blocks of memory will always be aligned at 16-byte offsets into the address space. This leaves a bunch of numbers that can be represented in 64-bits, that cannot reasonably be assigned to any other object. To understand this practically, imagine that your neighborhood&#8217;s postal addresses are all assigned at offsets of 10: 30, 40, 50, etc. A clever postal service could institute an addressing system that uses an &#8220;invalid&#8221; address such as &#8220;31,&#8221; to perhaps mean &#8220;deliver to 30 with expedited afternoon delivery.&#8221;</p>
<p>Cleverness like this with encoding extra information in memory addresses is a time-honored tradition. I recall the days of 24-bit addressing on classic Mac OS, where Apple, and many 3rd party developers, observed that the high 8 bits of a typical memory address could be tweaked and used to store additional information, because the system would never reference those bits when resolving a particular address.</p>
<p>In those days, using those extra bits turned out to be a pretty significant headache when 32-bit addressing ultimately came along, and lots of code had this &#8220;crufty&#8221; treatment of addresses to clean up. Perhaps it is a memory of situations like this that caused Jon &#8220;Wolf&#8221; Rentzsch to <a href="http://www.delicious.com/url/a01d14b2e7785507e55d15edf3a131d6">comment in his bookmarking</a> of the above-referenced blog post:</p>
<blockquote>
<p>&#8220;Every tagged pointer has its lowest bit set, hence tagged pointers are odd integers&#8221; <strong>Strikes me as a really bad idea. </strong>[Emphasis Mine]</p>
</blockquote>
<p>But the difference now, in this scenario, is the &#8220;cute hacking&#8221; is all being done by a central power, with and in terms of opaque objects that only Apple has the authority to change. I think this is a really clever hack that will undoubtedly lead to some serious performance gains in Lion and beyond. It&#8217;s hard to imagine specific outcomes that will make Apple regret adopting this strategy. In the worst case scenario, an addressing system of future Macs will not leave any &#8220;spare&#8221; bits to be exploited, so the runtime will simply revert to its previous behavior.</p>
<p> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.red-sweater.com/blog/1947/bit-hacking/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Lion&#8217;s Whole-Disk Encryption</title>
		<link>http://www.red-sweater.com/blog/1935/lions-whole-disk-encryption</link>
		<comments>http://www.red-sweater.com/blog/1935/lions-whole-disk-encryption#comments</comments>
		<pubDate>Wed, 20 Jul 2011 15:36:37 +0000</pubDate>
		<dc:creator>Daniel Jalkut</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Lion]]></category>
		<category><![CDATA[Macintosh]]></category>

		<guid isPermaLink="false">http://www.red-sweater.com/blog/?p=1935</guid>
		<description><![CDATA[One of my favorite new features in Lion is a completely revamped &#8220;FileVault&#8221;, Apple&#8217;s brand-name for encryption techonologies that protect the data on your disk from eavesdroppers, should the disk be lost or stolen. In Mac OS X 10.6 and earlier, FileVault was a feature that only affected your home directory. In OS X Lion, [...]]]></description>
			<content:encoded><![CDATA[<p>One of my favorite new features in Lion is a completely revamped &#8220;FileVault&#8221;, Apple&#8217;s brand-name for encryption techonologies that protect the data on your disk from eavesdroppers, should the disk be lost or stolen.</p>
<p><img title="Security &amp; Privacy.png" src="http://www.red-sweater.com/blog/wp-content/downloads/2011/07/Security-Privacy.png" border="0" alt="Security  Privacy" width="450" height="85" /></p>
<p>In Mac OS X 10.6 and earlier, FileVault was a feature that only affected your home directory. In OS X Lion, it applies encryption at a very low-level, encrypting an entire volume of your disk at a time, and keeping it encrypted as you use it.</p>
<p>I was able to enable FileVault for my boot volume with relative ease, using the <strong>Security &amp; Privacy </strong>preference pane in System Preferences. However, the UI for this is pretty limited, and notably, it only allows you to protect the computer&#8217;s startup disk.</p>
<p>The way I have my Mac configured, most of my sensitive data is not on the startup volume, but is instead on a second partition called &#8220;Data&#8221; where I keep my home directory, media files, etc.  Apple&#8217;s Disk Utility allows you to erase and reformat a volume as encrypted from scratch, but what if you want to migrate a volume in-place, the way the system does the boot volume? You&#8217;re not completely out of luck.</p>
<p>OS X Lion ships with a low-level technology called &#8220;core storage,&#8221; which is used to facilitate a wide variety of disk-maintenance functionality, including whole-disk encryption. To get a quick look at what core storage supports, type &#8220;diskutil cs&#8221; at the Terminal command line. For a more in-depth look, type &#8220;man diskutil&#8221; and search for the core storage command documentation.</p>
<p><strong>Important:</strong> This is the part of the blog article where I warn you to be very careful before proceeding. The diskutil command is capable of doing incredibly destructive things to your disk and to your data, so you should feel confident <em style="font-weight: bold;">before doing anything </em>that you have a <strong>100% reliable backup of your data</strong>.</p>
<p>To convert an arbitrary volume to Lion&#8217;s whole-disk encryption, you use diskutil&#8217;s core storage &#8220;convert&#8221; command, and provide a passphrase. For example, if you have a volume called &#8220;Data&#8221; attached to your Mac, you would run something like this from the command line:</p>
<pre style="font-size: 1em;">% diskutil cs convert /Volumes/Data -passphrase [yourPasswordHere]</pre>
<p>What this does is kicks off a conversion process similar to what the System Preferences panel does when allowing you to convert your main startup volume to core storage with encryption. At any time during the conversion, you can use the diskutil command again to see status of your volumes, whether they are encrypted, not encrypted, or in-progress while converting.</p>
<pre style="font-size: 1em;">% diskutil cs list</pre>
<p>You&#8217;ll see a bunch of information, but search carefully for the named volume (e.g. &#8220;Data&#8221;) that you just started the conversion process on. You&#8217;ll find a line starting with something like:</p>
<pre style="font-size: 1em;">Size (Converted):</pre>
<p>This shows you what the progress in the conversion is. From time to time, check this manually, to see how far along things have progressed.</p>
<h3>Caveats</h3>
<p>In addition to the major admonition above to backup your data carefully, you should also know that after you have converted a volume, it seems to be in a sort of provisionally encrypted state where it&#8217;s still being treated by the running OS as a &#8220;native volume&#8221; although it&#8217;s been converted and is ready to be treated as a &#8220;core storage&#8221; volume. I have to confess I don&#8217;t really understand it 100%, but it seemed like a really good idea to me to restart <em>as soon as possible</em> after the conversion is complete.</p>
<p><strong>But before you restart,</strong> bear in mind that there appears to be a bug in the login process that will prevent a user whose home directory is on an encrypted (&#8220;locked&#8221;) <em>secondary volume</em> from being able to log in. It seems that whatever logic Apple applies to unlock volumes at login time is not applied early enough to allow the actual login to occur. This means that if you converted your secondary volume like I did, and it contains your home directory, you won&#8217;t be able to login.</p>
<p>For this reason, make sure that you have a valid account to log in to whose home directory is located on the main startup volume. In my experience, the process of logging in to this main-volume account will prompt the system to ask for the secondary volume&#8217;s password in order to unlock it. Once the secondary volume is unlocked, you can log out and log back in to your regular account, with the home directory on the secondary volume.</p>
<p>This bug is pretty annoying. Hopefully this is something that Apple will get fixed soon, and it may be for bugs like this that they haven&#8217;t enabled full-disk encryption as a full-fledged user-facing feature of the operating system. In the mean time, if encrypting your data is important to you, I hope these instructions and caveats will serve you well.</p>
<p><strong>Update: </strong>Not surprisingly, this topic is covered in some detail in <a href="http://arstechnica.com/apple/reviews/2011/07/mac-os-x-10-7.ars/13">John Siracusa&#8217;s Lion review</a>.</p>
<p> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.red-sweater.com/blog/1935/lions-whole-disk-encryption/feed</wfw:commentRss>
		<slash:comments>35</slash:comments>
		</item>
		<item>
		<title>Get Lion</title>
		<link>http://www.red-sweater.com/blog/1924/get-lion</link>
		<comments>http://www.red-sweater.com/blog/1924/get-lion#comments</comments>
		<pubDate>Wed, 20 Jul 2011 14:10:38 +0000</pubDate>
		<dc:creator>Daniel Jalkut</dc:creator>
				<category><![CDATA[App Store]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[Hacking]]></category>

		<guid isPermaLink="false">http://www.red-sweater.com/blog/?p=1924</guid>
		<description><![CDATA[Today Apple released OS X Lion, aka Mac OS X 10.7, the latest in the decade-long run of incredible updates to Mac OS X. I encourage everybody to upgrade to Lion. I&#8217;ve been running it for months in pre-release form, and even while the bugs were being ironed out, I found the experience of using it [...]]]></description>
			<content:encoded><![CDATA[<p>Today <a href="http://www.apple.com/macosx/">Apple released OS X Lion</a>, aka Mac OS X 10.7, the latest in the decade-long run of incredible updates to Mac OS X.</p>
<p>I encourage everybody to <a href="http://itunes.apple.com/us/app/os-x-lion/id444303913?mt=12">upgrade to Lion</a>. I&#8217;ve been running it for months in pre-release form, and even while the bugs were being ironed out, I found the experience of using it to be (mostly) superior to running 10.6.</p>
<p>If you want a more detailed analysis of Lion&#8217;s features, sit down with a tall glass of your favorite beverage, and read John Siracusa&#8217;s <a href="http://arstechnica.com/apple/reviews/2011/07/mac-os-x-10-7.ars">famously detailed review</a>. If you&#8217;re looking for a quicker overview, check out Jason Snell&#8217;s <a href="http://www.macworld.com/article/161026/2011/07/osx_lion_review.html">Macworld review</a>, or my developer buddy Matt Gemmell&#8217;s <a href="http://www.guardian.co.uk/technology/2011/jul/20/mac-osx-lion-review">guest appearance at the Guardian UK</a>.</p>
<h3>Supported Systems</h3>
<p>We have known for some time that Mac OS X Lion would drop support for a number of Macs. In particular, all Macs that do not support Intel&#8217;s 64-bit memory addressing are not qualified to install the OS. But I was curious to know a bit more about how Apple makes this determination when, say, a user is browsing the Lion &#8220;product&#8221; in the Mac App Store.</p>
<p>As I described <a href="http://www.red-sweater.com/blog/1566/the-future-of-mac-app-store-installs">in an an earlier post</a>, you can learn a lot about a product in the App Store by inspecting the HTML that makes up the product page, and by manually loading the references resources. In the case of Lion, the &#8220;Buy Now&#8221; button contains a number of parameters intended to inform the Mac App Store client about whether a sale should be allowed, and what some of the conditions of sale are. In the case of Lion, here is the raw HTML:</p>
<pre style="font-size: 1em; white-space: pre-wrap;">&lt;button is-rental="0" dk-id="30" is-pre-order="0" preflight="http://a5.mzstatic.com/us/r1000/
065/Purple/cd/82/29/mzm.tvvarwmu.pfpkg" item-name="OS X Lion" bundle-id="com.apple.InstallAssistant.Lion" version-string="10.7" buyparams="productType=C&amp;amp;price=0&amp;amp;salableAdamId=444303913&amp;amp; pricingParameters=STDRDL" large-icon="http://a4.mzstatic.com/us/r1000/083/Purple/00/00/00/ lion.170x170-75.png" is-install-button="0" is-update="0" check-is-osx-server="http://r.mzstatic.com/static/isOSXServer.pfpkg" is-free-download="0" adam-id="444303913" metrics-leaf="1" metrics-loc="Buy" class="button-area" aria-label="Install, OS X Lion, Free"&gt;    &lt;span class="price"&gt;Install&lt;/span&gt;    &lt;span class="left-cap"&gt;&lt;/span&gt;    &lt;div class="inner"&gt;&lt;span&gt;Install&lt;/span&gt;&lt;/div&gt;    &lt;span class="right-cap"&gt;&lt;/span&gt;  &lt;/button&gt;</pre>
<p>If you load the &#8220;preflight&#8221; URL content from the command line, and unarchive it with the &#8220;xar&#8221; tool, you get a few files including a file called &#8220;Distribution&#8221;:</p>
<pre style="font-size: 1em; white-space: pre-wrap;">% mkdir TestFolder; cd TestFolder
% curl -O http://a5.mzstatic.com/us/r1000/065/Purple/cd/82/29/mzm.tvvarwmu.pfpkg
% xar -x -f mzm.tvvarwmu.pfpkg
% more Distribution
</pre>
<p>Inside you will see a number of constant constraints such as <strong>hostArchitectures=&#8221;x86_64,i386&#8243;</strong>, but also more nuanced tests that, for example, test the current computer&#8217;s motherboard model ID with a fixed list of allowed values. Presumably this will prevent the App Store from allowing (without some hacking) downloading Lion and installing it, for example, on a Dell PC that happens to meet the ostensive hardware requirement.</p>
<p>Perhaps the most heartwarming bit of code in this relatively complex document is a small function call from the start of the test for whether the install should be allowed on this computer:</p>
<pre style="font-size: 1em; white-space: pre-wrap;">function isSupportedPlatform(){

        if( isVirtualMachine() ){
                return true;
        }
</pre>
<p>It has already been announced that Lion 10.7 will finally support virtualization, e.g. with the use of products such as VMWare or Parallels. This install-time test seems to drive home how true that is.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.red-sweater.com/blog/1924/get-lion/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

