<?xml version="1.0" encoding="UTF-8"?>


<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/" xmlns="http://purl.org/rss/1.0/">

<channel rdf:about="http://earthlingsoft.net/ssp/blog/">
<title>Quarter Life Crisis/Mac OS X</title>
<link>http://earthlingsoft.net/ssp/blog/archives/mac_os_x</link>
<image>
<title>Quarter Life Crisis</title>
<url>http://earthlingsoft.net/ssp/blog/includes/qlc.gif</url>
<link>http://earthlingsoft.net/ssp/blog/</link>
</image>
<description>Mac OS X-related posts from Quarter Life Crisis</description>
<dc:language>en</dc:language>
<dc:creator>Sven-S. Porst (ssp-web@earthlingsoft.net)</dc:creator>
<dc:date>2009-07-23T01:19:06+01:00</dc:date>
<admin:generatorAgent rdf:resource="http://www.movabletype.org/?v=5.01" />

<items>
<rdf:Seq>
<rdf:li rdf:resource="http://earthlingsoft.net/ssp/blog/2009/07/utis" />

<rdf:li rdf:resource="http://earthlingsoft.net/ssp/blog/2009/02/safari_4b1" />

<rdf:li rdf:resource="http://earthlingsoft.net/ssp/blog/2008/09/copying_the_install_dvd" />

<rdf:li rdf:resource="http://earthlingsoft.net/ssp/blog/2008/08/progress_1" />

<rdf:li rdf:resource="http://earthlingsoft.net/ssp/blog/2008/08/x5_developing" />

<rdf:li rdf:resource="http://earthlingsoft.net/ssp/blog/2008/06/mac_os_x_display_fail" />

<rdf:li rdf:resource="http://earthlingsoft.net/ssp/blog/2008/05/meh" />

<rdf:li rdf:resource="http://earthlingsoft.net/ssp/blog/2008/05/whats_in_a_public_identifier" />

<rdf:li rdf:resource="http://earthlingsoft.net/ssp/blog/2008/04/webkit_quirk_2" />

<rdf:li rdf:resource="http://earthlingsoft.net/ssp/blog/2008/04/labyrinths_vs_pyobjc_vs_encodings" />
</rdf:Seq>
</items>

</channel>


<item rdf:about="http://earthlingsoft.net/ssp/blog/2009/07/utis">
<title>UTIs</title>
<link>http://earthlingsoft.net/ssp/blog/2009/07/utis</link>
<description><![CDATA[<p>
<a href="http://mikeabdullah.net/">Mike</a> recently &#8216;twittered&#8217; about visualising the dependences among <acronym title="Uniform Type Identifier">UTI</acronym>s and eventually came up with the pretty hand-made graph based on Apple&#8217;s documentation presented in <a href="http://www.mikeabdullah.net/utis_diagram/">this blog post</a>. 
</p><p>
I have been amazed by UTIs since first seeing them as they look like a reasonable way to unify the legacy (Mac File and Creator type), internet (MIME-Type) and stupid (file name extension) ways of identifying file types. UTIs maintain backwards compatibility while opening the way for future development [I <em>totally</em> want to see integration with Unix&#8217; <code>file</code> command. But I fear we&#8217;ll have to wait for the day when technology has advanced enough to provide all the power of a PDP-11 in a pocket size package before we can expect to see that.] and a wider use [e.g. non-file data-types, like the clipboard]. Thus I consider them and their proliferation across the Mac <acronym>API</acronym>s a good thing. 
</p><p>
The basic idea for UTIs is quite simple: software can specify them in &#8216;reverse domain name notation&#8217; (e.g.: public.text, public.xml, com.apple.quicktime-movie), it can specify which other methods of file type identification a UTI is equivalent to and it can assign other UTIs which the new UTI <em>conforms</em> to. Those conformances give a system of inherited types and you&#8217;ll find that public.xml → public.text → public.data. Graphing those relations is the task this text is about. 
</p><p>
The first step towards achieving that is collecting the data making up that graph. Apple&#8217;s documentation only lists a few examples and the biggest bunch of &#8216;standard&#8217; UTIs is listed in the &#8216;CoreTypes&#8217; bundle in MacOS X&#8217;s system folder.
</p><p>
In principle Launch Services should know about all UTIs on the machine [considering the output of <code title="/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister">lsregister -dump</code>] but as we are in hacking mode here and I&#8217;m not familiar with Launch Services, I went for the dumb option: collect all Info.plist files on the system in which the UTIs are stored. Spotlight fails me for that, <code>locate</code> gives quick and incomplete results (lacking non public readable folders) and this bit of command line junk runs slowly but yields what seems to be a complete list that I stored in a file:
</p>

<pre>
sudo find -s / | grep Info.plist | sed 's/\(.*\)/"\1"/g' | xargs -L 5 grep --files-with-matches TypeDeclarations
</pre>

<p>
Said file is then used by a <a href="http://pyobjc.sourceforge.net/">PyObjC</a> script which reads the property lists, collects the UTIs and the relations between them and creates a <a href="http://graphviz.org/">GraphViz</a> file. A colleague recently introduced me to GraphViz which converts simple text input algorithmically into graphs. Those aren&#8217;t perfectly pretty and can be a bit hard to control, but with more than a dozen items, it seems to be a reasonable way of avoiding the tedium of manual graph layout.
</p><p>
I am then running the created GraphViz file through the <code>twopi</code> tool using
</p>

<pre>
twopi -Nfontname=Helvetica -Tpdf /tmp/UTIGraph.gv &gt; /tmp/UTIs.pdf
</pre>

<p>
which creates a reasonable layout.
</p><p>
Of course I had to start tweaking things a little, soon after seeing the graph the first time. As <em>loads</em> of UTIs conform to public.data or public.bundle or some sort of zip archive, that was making the graph quite messy. Hence I decided to clean things up a bit by suppressing those conformances and expressing them by the node&#8217;s shape or colour. I also removed all the single nodes and placed them separatedly. (An attempt to group things better seems to fail with the <code>twopi</code> tool).
</p><p>
As I was using PyObjC anyway, I figured I could just use <code>NSWorkspace</code> to grab the relevant icons. This resulted in a very heavy PDF file which creates all sort of scrolling FAIL in X.5&#8217;s Preview along with a less than impressive speed. (In fact, one version of the file even stumped Illustrator when opening it in there.) So slightly more control was needed, to scale down all icons to a 128&times;128 size and to avoid using the generic document icon for all files without custom icons. 
</p><p class="aside">
While I&#8217;m at this: can anybody tell me a good way to compare NSImages? The only way I could find was using <code>iEqualToData:</code> on a <code>TIFFRepresentation</code>. But I  couldn&#8217;t find a way to create a working hash of the image data. [In addition to that, the image nerds among you may enjoy comparing the PNG compression ratios achieved by Cocoa in different versions of OS X. Personally, I can only recommend using <a href="http://www.lemkesoft.com/">GraphicConverter</a> for the task: with its best and slowest setting it routinely saves ¼ to ⅓ for the images I save in PNG format.]
</p><p>
A few more steps of manual intervention to single out all UTIs which do not conform to any &#8216;interesting&#8217; UTIs - thus uncluttering the graph - gave this:
</p><p class="centred">
<img src="http://earthlingsoft.net/ssp/blog/graphics/UTIGraph.jpeg" style="width:95%;max-width:428px;max-height:631px;" alt="UTIGraph">
</p><p>
The PyObjC script isn&#8217;t exactly pretty and to work it requires (a) the folder /tmp/UTI-Icons, (b) the installed GraphViz Software and (c) a file named Info-Plists.text in the same folder as the script, each line of which is a path to an Info.plist file. As a consequence I wouldn&#8217;t recommend anybody to even look at it. But if you <em>must</em>, you&#8217;ll find it <a href="http://earthlingsoft.net/ssp/misc/utitracker.py">here</a>. Furthermore, the <a href="http://files.getdropbox.com/u/382997/UTIs.pdf">full size PDF is available from my public DropBox folder</a> and you can see a large, roughly annotated, bitmap <a href="http://www.flickr.com/photos/cv47al/3746742711/">at Flickr</a>. Unfortunately I couldn&#8217;t find an easy way to turn the large image into a Google map. [And I&#8217;m somewhat annoyed that software and computers aren&#8217;t better at dealing with such files.]
</p>
]]></description>
<dc:subject>Mac OS X</dc:subject>
<dc:creator>ssp</dc:creator>
<dc:date>2009-07-23T01:19:06+01:00</dc:date>
</item>

<item rdf:about="http://earthlingsoft.net/ssp/blog/2009/02/safari_4b1">
<title>Safari 4b1</title>
<link>http://earthlingsoft.net/ssp/blog/2009/02/safari_4b1</link>
<description><![CDATA[<p>
<img src="http://earthlingsoft.net/ssp/blog/graphics2/Safari.png" style="width:128px;height:128px;" alt="Safari Icon">
Half the world&#8217;s web surfing enthusiasts have been sort-of surprised by Apple&#8217;s Safari 4 beta release this Tuesday. And at least half of these people have commented on the new features and changes seen in the beta version. Not being the one to miss out in a UI palaver, let me add my €0,02 as well. 
</p>

<h4 id="underthehood">Beneath the hood</h4>

<p>
It seems that Safari 4 will bring quite a few improvements under the hood. Faster JavaScript, fancy new CSS effects, local storage and improved scores on random standards tests. I suppose that those are good things. Things that are worth implementing and refining early so - for a change - browsers are ready once the web designers get their act together.
</p><p>
Those changes are as unnoticeable as they are amazing. None of the sites I am using seems to behave differently today in Safari 4b than it behaved last week in Safari 3. Which probably is a good thing or simply proves that I just don&#8217;t surf enough. 
</p><p>
And who&#8217;s going to  bitch about such technicalities anyway?
</p>

<h4 id="zoom">Zooming</h4>

<p>
Web browsers could zoom into pages from day one. Pressing ⌘-+ simply <strong>increased the base font size</strong>, thus making text larger and potentially more legible. This has always been problematic to a certain extent as web designs which use images have a tendency to break down after a step or two of this: The graphics are included as fixed size bitmaps and (due to both bad / lazy designers and the limitations of HTML / CSS) they don&#8217;t scale along with the text. Hence, the font sizes may end up being blown out of proportion to the size of the decorative banner ads or so&#8230;
</p><p>
<img src="http://earthlingsoft.net/ssp/blog/graphics/Safari4b1ResizeMenu.png" style="max-width:50%;width:214px;height:103px;" alt="Zoom menu items in Safari 4b1's View menu">
At some stage the strategy of re-interpreting web page zooming as a <strong>zoom into the page</strong> - increasing the size of everything on the page proportionally - was introduced (many years ago by Opera, I think). This strategy neatly avoids the problem of layouts breaking and Safari 4b both implements it and uses it by default. The setting for it are easily accessible in the View Menu.
</p><p>
Personally I prefer &#8216;old-school&#8217; HTML resizing. Both because I&#8217;m an old fart and because I prefer narrow browser windows and despise web &#8216;designers&#8217; who think they should have a say about the size and shape of my browser window. Having the new resizing option feels like it gives more power to them as increasing a page&#8217;s text size will likely blow said page out of the window size I want to use.
</p>

<h4 id="visualbookmarks-coverflow">Visual Bookmarks: Cover Flow</h4>

<p>
Safari 4b1 offers two ways of visualising bookmarks. The first is having a <strong>Cover Flow</strong> view mode when browsing bookmarks.  I think this is a &#8216;nice&#8217; idea because it&#8217;s sometimes easier to recognise pages visually than remembering their name. On the other hand: When did you last browse your bookmarks?
</p><p>
I realised I <em>never</em> browse my bookmarks. The links I need frequently are in my bookmarks bar and I know where they are because I use them frequently. The other links are in my bookmarks for (a) sentimental value, (b) because I forgot to delete them or (c)  autocompletion.
</p><p>
<strong>Autocompletion</strong> is important. Even more so if you have a device with a crappy keyboard like an iPod touch or an iPhone. Once you have a link in your bookmarks, it&#8217;s much more accessible on these devices. Hence bookmarks need to be there, but they hardly ever need to be seen.
</p><p class="centred">
<a href="http://earthlingsoft.net/ssp/blog/graphics/Safari4b1CoverFlow.jpeg" title="Click to enlarge."><img src="http://earthlingsoft.net/ssp/blog/graphics/Safari4b1CoverFlow.jpeg" style="width:95%;max-width:807px;max-height:658px;" alt="Bookmark Cover Flow in Safari 4b1"></a>
</p><p class="aside">
In fact I used these graphical bookmarks as an opportunity to quickly go through all of them. The screenshots usually let you see easily when a bookmark has stopped working and points to an error page. There were plenty of such broken bookmarks  in my collection - particularly on music and computer related sites. Presumably because they are run by the most technically illiterate people. Even more embarrassingly, most of the music sites still exist, just the links broke because the moron who &#8216;designed&#8217; the Flash-atrocity site in 2004 thought entering the domain name should immediately redirect you to the &#8216;/index.php&#8217; path while the douchebag who re-&#8216;designed&#8217; the even worse Flash+Web-2-atrocity site  in 2007 considered a redirect to &#8216;/index.asp&#8217; more appropriate. Both being morons of course meant that nobody thought about creating redirects beforehand and nobody checks the 404 logs either. Tada, job well done and &#8216;designer&#8217; paid with the money from my CDs! And as Safari - optimistically - doesn&#8217;t show you the URL you are about to bookmar thus not giving you the opportunity to scrutinise and fix it easily, you end up having that worthless crap in your bookmarks.
</p>

<h4 id="visualbookmarks-topsites">Visual Bookmarks: Top Sites</h4>

<p>
The other 3D novelty in Safari 4b1 is the <strong>Top Sites</strong> view. It displays a gratuitously 3D view of thumbnails of the pages Safari considers your favourite ones:
</p><p class="centred">
<a href="http://earthlingsoft.net/ssp/blog/graphics/Safari4b1%20TopSites.jpeg" title="Click to enlarge."><img src="http://earthlingsoft.net/ssp/blog/graphics/Safari4b1%20TopSites-klein.jpeg" style="width:95%;max-width:600px;max-height:383px;" alt="Safari 4b1's Top Sites feature"></a>
</p><p>
It seems that Apple still love the feature at this stage as they added a non-removable button for accessing it (which for some incomprehensible reason works differently from the Bookmarks button right next to it) to Safari&#8217;s Bookmarks Bar and make Safari open any new tab or window displaying it despite you having told Safari that you always want it to open new tabs and windows with a &#8216;blank&#8217; page years ago. Let&#8217;s say I was not impressed. And even less so was my boss when I wanted to &#8216;quickly look something up on the web&#8217; and the screen seen above appeared&#8230;
</p><p>
Ah well, I am not sure I&#8217;ll like this feature. It needs to download loads of stuff in the background through a helper process, it seems impossible to add specific pages to it at the moment and it furthermore includes the horrifying trend of being so poorly designed that it needs an &#8216;Edit&#8217; button (this may be excusable on a simplistic device like the iPod touch or iPhone on which editing will be the exception and interaction is coarse but I find this just embarrassing in everyday editing applications like Safari or the Address Book, this being the 21st century and all). So, no, I&#8217;m not convinced. But if I could remove the button for it from my Bookmarks Bar, it would just be some useless code in my Safari binary rather than a constant annoyance.
</p>

<h4 id="comment-archiving">Comment: Archiving</h4>

<p>
Let me take a moment to comment on the features above. Obviously the developments for Safari 4 established quite a bit of infrastructure for saving and updating thumbnail graphics of the pages you view. To me that seems to be solving the wrong problem and at best an intermediate performance-enhancing step one may need to do when doing The Right Thing™.
</p><p>
At the moment Safari saves three kinds of web page related items: your bookmarks, a log of the pages you recently visited and thumbnail images. Both the bookmarks and the log of the pages you visited are indexed by Spotlight and thus somewhat accessible. Unfortunately neither of these is Quick Look enabled, meaning that you will know something in the page you visited yesterday contains the text you are interested in, but you cannot immediately access it &#8216;see&#8217; the page in question.
</p><p>
It seems that the &#8216;right&#8217; thing would be storing proper webarchives of the visited pages. That may be a bit more effort than the current approach but it would have the advantage that even web history items would not only be findable via Spotlight - they&#8217;d also be viewable right away, even without an internet connection.
</p><p>
I&#8217;ve been in that situation a number of times and I can tell you the following: it&#8217;s nice that you can search the content of your web browsing history using Spotlight. But finding something in there while you don&#8217;t have an internet connection is incredibly frustrating - much more so than not finding it at all. Of course only unworthy sub-humans will come into situations without internet access in Apple&#8217;s mindset, but I take the liberty of thinking it&#8217;s something worth keeping in mind - even more so as it enables you to see the page the way it looked yesterday when you thought it was interesting, an aspect that can play a role when having in mind the large number of blog-style sites with frequently changing content we have today.
</p>

<h4 id="addressfield">Address Field</h4>

<p>
Safari 4b1 comes with a redesigned address field. It appears they&#8217;re generously stealing from the improvements Firefox users have been enjoying for a while there. And it&#8217;s a welcome change. Safari&#8217;s URL <strong>autocompletion</strong> becomes much more competent by this, offering a somewhat reasonably ordered selection of completions from your bookmarks and history items. I welcome these improvements.
</p><p class="centred">
<a href="http://earthlingsoft.net/ssp/blog/graphics/Safari4b1Autocompletion.png" title="Click to enlarge."><img src="http://earthlingsoft.net/ssp/blog/graphics/Safari4b1Autocompletion.png" style="width:95%;max-width:465px;max-height:266px;" alt="Safari 4b1 URL autocompletion menu"></a>
</p><p>
This isn&#8217;t quite perfect yet. One thing they still haven&#8217;t fixed is Safari&#8217;s unwillingness to invoke autocompletion after hitting the <strong>backspace</strong> key: Say you want to go to Google and accidentally type &#8216;gog&#8217;, then you realise you missed an &#8216;o&#8217; and hit the backspace key. In all likelyhood &#8216;go&#8217; would autocomplete to &#8216;google.com&#8217; already, so Safari should <em>try</em> that. But it doesn&#8217;t. Seems like a trivial oversight to me and I couldn&#8217;t yet figure out why Safari doesn&#8217;t do it.
</p><p>
Another, even more significant omission is that the address field only completes addresses. I totally expect it to <strong>complete bookmark names</strong> as well. 
</p><p>
But that isn&#8217;t all there is to Safari&#8217;s new address field. It comes with the <strong>Add Bookmark +</strong>-button affixed to its left side. Yes, that does look neat and may be another hat-tip to Firefox and its even more elegant / lazy solution to bookmarking, but it annoys the hell out of people like myself who don&#8217;t want a button for creating bookmarks in their toolbar. In fact, I prefer thinking about said &#8216;toolbar&#8217; as the &#8216;navigation&#8217; bar, and creating bookmarks has nothing to do with navigation, so it doesn&#8217;t appear there. I am perfectly capable of using a menu, hitting ⌘-D or using drag and drop (for which spring loaded elements in the Bookmarks Bar would have been nice) when I want to create a new bookmark. 
</p><p>
Going on, on the right hand side of the location field, we now see the <strong>Cancel / Reload</strong> button in there. It doesn&#8217;t really look like a button. but it looks like what you see on the iPod. That&#8217;s rubbish. 15 years of web browsing taught my muscle memory where a reload button is supposed to be. And that location is left of the address field and not inside it on the right. In fact I still find the location of the reload button the single most irritating &#8216;feature&#8217; of IE7 whenever having descend into those fields.
</p><p>
Whenever you visit a site whose connection isn&#8217;t only encrypted but also deemed particularly secure by Safari, the right hand side of the address field will also host the <strong>name of the SSL-certificate holder</strong>. Potentially shortened, with a funky fadeout and - strangely far away from the lock icon which remains in the page title. This is no dealbreaker but I find it a bit irritating. Wouldn&#8217;t the lock icon be better accommodated next to the address and the certificate owner&#8217;s name?
</p><p class="centred">
<a href="http://earthlingsoft.net/ssp/blog/graphics/Safari4b1CertificateName.png" title="Click to enlarge."><img src="http://earthlingsoft.net/ssp/blog/graphics/Safari4b1CertificateName.png" style="width:95%;max-width:388px;max-height:29px;" alt="Safari 4b1's address bar"></a>
</p><p>
Another point is <strong>progress indication</strong>. Safari used to indicate its progress of loading a page by colouring in the address field with a blue bar. That scheme of progress indication was pretty much a sham because with a browser&#8217;s progress indicator you need &#8216;instant gratification&#8217; to assure users the click they just made has been registered but you have no clue whatsoever how long the page will take to load at that moment. Hence, at that point, you  have to display <em>some</em> amount of progress which is completely independent of what&#8217;s going on for real. 
</p><p>
From that point of view, the indeterminate &#8216;spinning wheel&#8217; progress indicator used by Safari 4b1 is technically more correct. But it&#8217;s simply too hard to see. That large and blue bit of progress indicator appearing on the screen was very obvious, a small and grey progress indicator appearing at the far end of the address field is pretty much invisible. You - or at least <em>I</em> - don&#8217;t just see it but have to consciously look for it,  which is by far too much effort for me. 
</p><p>
Arguments have been made that people are more hesitant to actually use a page before loading has &#8216;completed&#8217; and that the less visible progress indicator encourages them to use the page before that. That&#8217;s an interesting point, but I can&#8217;t remember the last time Apple cared for pensioners or people with slow internet connections&#8230;
</p>

<h4 id="finding">Finding</h4>

<p>
Safari 4b1&#8217;s <strong>Find field</strong> has been pimped as well. Using Google&#8217;s instant search completion recommendations you can now be even lazier and share your partial thoughts with Google as well. It&#8217;s a nice convenience. The menu popping up while you type in the Find field also contains a &#8216;Find&#8217; command which will search for the typed text in the current page. 
</p><p>
As this command is at the very far end of the menu, 20 items in or so, I find it highly inaccessible, particularly when navigating with the keyboard, which I am likely to do as I have just been typing in a search term. This needs extra fine tuning, say in the form of making the up-arrow go to the last menu item when you&#8217;re in the find field or  highlighting the matches for the search term on the current page (which implies other problems, though).
</p><p>
Strangely, the popup menu that goes with the (empty) Find field lacks both a Clear Recent Searches command <em>and</em> that plain Find command which is attached to the bottom of the popup menu while you are typing. Those aspects could be more friendly, useful and consistent.
</p>

<h4 id="tabs">Tabs</h4>

<p>
Let&#8217;s move on to the big elephant in the web browser. Safari 4b1 comes with twisted tabs. Instead of being just above the page, the tabs live in the browser window&#8217;s title bar now. That&#8217;s just odd but my current stance is to give it a few days to see how much of the &#8216;odd&#8217; impression comes from the look  being new and differing from the standard Mac GUI (which of course itself is a bad thing in my book).
</p><p>
One thing this change has going for it is that it tries to be <strong>more logical</strong>. Lukas Mathis <a href="http://ignorethecode.net/blog/2009/02/24/hierarchies/">discusses the hierarchy of the browser UI</a> in detail, making that point clear (and explaining why Coda keeps feeling odd even after long usage). So, in the Safari 4b1 image of the world, each tab is a browser and comes with its own address bar and Google field inside it (at the moment these fields&#8217; behaviours are slightly different when you change tabs while typing in there, the Google field lovingly carries whatever you typed to the new tab, while the address field doesn&#8217;t do that) which makes more sense conceptually. 
</p><p>
On the other hand you now have a <strong>Bookmarks Bar</strong>  conceptually &#8216;within&#8217; each tab and it can contain folders which offer to open all their items in tabs. That ends up being a bit mind boggling or even destructive as you <em>might</em> expect that command to just replace the current tab  by many new tabs and <em>may</em> be shocked that it destroyed the content you had in other tabs. Perhaps this will be  improved as further builds emerge, but I see a conceptual problem here: you want a Bookmarks Bar, you want it close to the browser display, yet it doesn&#8217;t really belong inside each tab but it belongs to the whole application. Tricky one. To me the only logical conclusion seems to be to <em>not</em> use the Bookmarks Bar at all and hope that URL autocompletion will fit the bill. That would solve the problem with the Top Sites icon, save vertical space <em>and</em> get the browsing done nonetheless: Win-win-win.
</p><p>
After discussing things somewhat neutrally so far, let&#8217;s get to the bile. <strong>Those in-titlebar tabs just irritate the hell out of me.</strong> I assume that Apple will come up with better close and move icons for them, and the web has been full of (correct) remarks on how irritating and unclear the tabbed title bar&#8217;s behaviour is: what will come to the front when I click? the window? the tab? Where can I click to move the window? Where can I click to move a tab? Can I recognise a window as a window among other windows of the OS? To me neither of these questions has a clear or satisfactory answer. 
</p><p>
I guess getting used to them <em>might</em> improve that situation a little and Apple improving the design a bit by using better icons and colours (e.g. currently I simply don&#8217;t see at all that there are tabs when only two are open as there is so much blank space in the title bar that I don&#8217;t perceive the window as tabbed) may fix things a bit more. But I&#8217;d be cautious here: There&#8217;s a reason why all windows should look and work the same. These Safari windows don&#8217;t and that makes them difficult to use.
</p><p>
However, the argument that can be made here is <strong>vertical space</strong>. On today&#8217;s wide computer screens we have horizontal space without end but we can only read 80 characters in a row in that direction. Which makes the vertical space much more precious when it comes to reading as any scrolling action is an extra effort. And from <em>that</em> point of view I can appreciate the effort, even though I am not convinced the space savings are great enough to justify all those strange visuals in the Safari tabs. 
</p>

<h4 id="vertical">Vertical</h4>

<p>
As the preciousness of vertical space is one of my favourite topics, let&#8217;s make a rest here and take this a bit further. Apple saved some space by unifying the window&#8217;s title bar with the Tab Bar and I already eliminated the Bookmarks Bar for good a few paragraphs ago. So what&#8217;s left? The address field, a.k.a. the Toolbar in Apple&#8217;s terminology. That bar takes up further vertical space and is not used most of the time as only the back button is needed regularly.
</p><p>
Indeed, Safari <em>can</em> hide the address field and you can temporarily unhide it using ⌘-L. You can enter an URL then and after hitting return, the bar will be hidden again. That&#8217;s quite efficient, leaves you with a clear screen and in case you do a fair bit of your browser navigation by keyboard, this looks like a feasibly option which maximises the browsing space at first.
</p><p>
Unfortunately Safari&#8217;s implementation of the auto-hiding is somewhat buggy and after a while of browsing and URL editing the address field will cease being hidden and become permanently visible again. Hence such a browsing strategy <a href="http://earthlingsoft.net/ssp/blog/2003/01/safari#toolbar">never really works out in Safari as it existed so far</a> (and Apple&#8217;s stupid non-A-Z keyboard equivalents for those commands make trying to hide / unhide the &#8216;bars&#8217; by keyboard equivalents an exercise in frustration).
</p><p>
In my opinion it&#8217;d be cool if Safari could just show the most relevant buttons on the side of the window - as horizontal space is cheap, that&#8217;d be revolutionarily cool and useful. - Uh, wait, I may just be a closet-fan of IE5/Mac:
</p><p class="centred">
<a href="http://earthlingsoft.net/ssp/blog/graphics/IE5SideToolbar.png" title="Click to enlarge."><img src="http://earthlingsoft.net/ssp/blog/graphics/IE5SideToolbar.png" style="width:95%;max-width:669px;max-height:480px;" alt="Toolbar on the side in Internet Explorer 5 for Mac"></a>
</p>

<h4 id="fin">Fin</h4>

<p>
OK, that&#8217;s it. Safari 4b1 is a bigger step UI-wise than I would have expected. Yet, many of its changes seem gimmicky and not fully thought through. Be it for offline-viewing of my surfing history or for the fact that they tried to nick the best browser features left and right without visibly demonstrating that they&#8217;re also convinced by the underlying ideas (say, Google Chrome&#8217;s multi-process architecture is completely missing). 
</p><p>
Even though Apple is becoming quite Microsoftish in the way that they ship WebKit with their OS and you practically can&#8217;t remove it from the machine without breaking loads of things, Safari remains just a browser. It&#8217;s a µ between it or Mozilla&#8217;s or Google&#8217;s or Opera&#8217;s browsers and switching is not a big deal if one starts disliking one&#8217;s current browser. Let&#8217;s see where this takes us.
</p>

<p class="update">
Safari 4 has been released since. Why not read the <a href="http://earthlingsoft.net/ssp/blog/2009/06/safari_reloaded">post on it and on working around its shortcomings</a> as well?
</p>
]]></description>
<dc:subject>Software</dc:subject>
<dc:creator>ssp</dc:creator>
<dc:date>2009-02-25T23:41:16+01:00</dc:date>
</item>

<item rdf:about="http://earthlingsoft.net/ssp/blog/2008/09/copying_the_install_dvd">
<title>Copying the Mac OS X Install DVD</title>
<link>http://earthlingsoft.net/ssp/blog/2008/09/copying_the_install_dvd</link>
<description><![CDATA[<p>
<img src="http://earthlingsoft.net/ssp/blog/graphics2/TerminalX5.png" style="width:128px;height:128px;" alt="Terminal Icon">
I rather dislike having to start my computer from a DVD. It is noisy and takes ages. As the braindead Mac OS X installer (unlike its &#8216;Classic&#8217; predecessors) <em>needs</em> the system to be booted from a special partition to do its magic, this means that having to install a system is both a pain and a waste of time.
</p><p>
The pain can be reduced by having a copy of the system CD on a spare hard drive partition. The machine can easily copy the DVD over and in case you need it - i.e. after the proverbial shit hit the equally proverbial fan - you&#8217;ll have an install medium that&#8217;s quite quick. Unfortunately Apple&#8217;s system DVDs or Disk Utility don&#8217;t come with instructions how to make such a copy. 
</p><p>
Pierre Igot recently <a href="http://www.betalogue.com/2008/08/26/tiger-sans-dvd/">discussed this issue</a> for the slightly different topic of installing system software on a machine without a DVD reader. And along the same lines - though tested for Mac OS X.5 on my current MacBook only - I can recommend the following steps:
</p><ol>
<li>Make sure you have a hard drive large enough to contain the install DVD (10GB should be plenty, 8 will do)</li>
<li>Use the command
<pre>asr restore --source /Volumes/Mac\ OS\ X\ Install\ DVD --target /Volumes/Empty Hard Drive/ --erase --disableOwners</pre>
In which volume names are adjusted for your setup of course.
</li>
</ol>
<p>
There&#8217;s no step 3. The magic <code>asr</code> command will copy the image over to the hard drive partition, deleting the previous contents of the partition in the progress and &#8216;blessing&#8217; the partition to be recognised as bootable in the process. It&#8217;s really quite an easy thing to do.
</p>
]]></description>
<dc:subject>Mac OS X</dc:subject>
<dc:creator>ssp</dc:creator>
<dc:date>2008-09-05T01:46:46+01:00</dc:date>
</item>

<item rdf:about="http://earthlingsoft.net/ssp/blog/2008/08/progress_1">
<title>Progress</title>
<link>http://earthlingsoft.net/ssp/blog/2008/08/progress_1</link>
<description><![CDATA[<p>
Mac OS X loves displaying progress windows. Presumably because it loves progress. Progress in copying or moving files, progress in deleting items in the Trash, progress in deleting items from a backup, progress in mounting a disk image, progress in connecting to a server, progress in burning a CD, progress in compressing or decompressing files. 
</p><p>
Unfortunately all of these kinds of progress are displayed in a window of their own. Which means that you can easily end up with different progress windows covering each other and having to &#8216;manage&#8217; your progress windows to actually benefit from the information they display. To me it would seem much cleaner to have a single window which displays all the progress panels for file or Finder based tasks. That would seem less disorganised.
</p><p class="centred">
<a href="http://earthlingsoft.net/ssp/blog/graphics/Progress%20indicators.png" title="Click to enlarge."><img src="http://earthlingsoft.net/ssp/blog/graphics/Progress%20indicators.png" style="width:95%;max-width:497px;max-height:431px;" alt="A bunch of progress windows for Finder actions"></a>
</p>
]]></description>
<dc:subject>Mac OS X</dc:subject>
<dc:creator>ssp</dc:creator>
<dc:date>2008-08-28T00:23:12+01:00</dc:date>
</item>

<item rdf:about="http://earthlingsoft.net/ssp/blog/2008/08/x5_developing">
<title>X.5 Developing</title>
<link>http://earthlingsoft.net/ssp/blog/2008/08/x5_developing</link>
<description><![CDATA[<p>
While it may be hard to argue in favour of Mac OS X.5 when speaking to normal people, developers will surely love it. Not only is the new OS version full of updated frameworks and other behind-the-scenes magic that makes programming easier, the <a href="http://developer.apple.com/">Developer Tools</a> have also been improved significantly. I am not a hard-core developer, so I surely missed many great  aspects in this list of my experiences so far. 
</p><p>
You are invited to add your pet loves and hates at the end.
</p>

<h4 id="xcode">XCode</h4>

<p>
<img src="http://earthlingsoft.net/ssp/blog/graphics2/XCode%20Icon.png" style="width:128px;height:128px;" alt="XCode Icon">
XCode has become faster and more powerful in its third incarnation. The slowness of Cocoa&#8217;s text engine is pretty much forgotten  and XCode can now open and syntax-colour large source files <em>quickly</em> enough that an onlooking Linux person doesn&#8217;t have enough time to recite the benefits of emacs along with a full list of key bindings. That is an extremely welcome improvement.
</p><p>
Just like <em>code folding</em> is. Having it invalidates excuses for not having lengthy comments, say, and it can simplify understanding structures and problems on a global level. Unfortunately XCode 3 seems to have shipped so immaturely that code folding is wildly incomplete and buggy. A rather obvious problem is that  red or black markers in the editor&#8217;s scroll bar, which indicate compilation problems, appear in the wrong position when lines have been folded above the error. Another is that the foldings aren&#8217;t reliably persistent which they certainly should be if they are to be useful.
</p><p>
A  neat new feature of XCode&#8217;s editor is its ability to <em>&#8216;refactor&#8217;</em>. In a way I am a bit disappointed by this because I used to think that &#8216;refactoring&#8217; is a big computer sciency thing where you re-think your application and re-design its data structures for a new version to make things better, more efficient and fantastically future-proof. In XCode&#8217;s terminology (and quite possibly in reality - my respect for all programmers who spent a hard night &#8216;refactoring&#8217; just dropped!) refactoring means that you <em>re-name some variables</em>. Probably all for the sake of consistency, beauty and future-proofing as well - but  somewhat less spectacular  than what I had in mind. 
</p><p>
That said, it <em>is</em> a wonderful feature. You click a variable in your code, it will become underlined and an arrow button appears to its right (most of the times, anyway). That button will contain a menu which activates &#8216;refactoring&#8217; and after selecting it, any change you make to the variable&#8217;s name will be copied to all other occurrences of that variable name as well. In effect this means that you are much more likely to end up with good variable names simply  because replacing the bad ones you initially put there is easy. 
</p><p>
Just be warned that XCode&#8217;s interpretation of the <q>Edit all in scope</q> command is a bit - ahem - idiosyncratic: When I define a variable inside an <code>if</code> branch, I (and my debugger) consider the scope of that variable to be that branch only, XCode&#8217;s refactoring, however, will happily rename all other variables with the same name inside your method but outside that branch as well. I rate this somewhere between &#8216;not helpful&#8217; and &#8216;dangerous&#8217;.
</p><p class="centred">
<img src="http://earthlingsoft.net/ssp/blog/graphics/XCodeEditorRefactor.png" style="width:95%;max-width:270px;max-height:135px;" alt="Refactoring in XCode 3's editor">
</p><p>
The new XCode version also cleaned up a few other things to make your work more streamlined. <em>Compilation errors</em> will now show up amidst your code, the Run and Debug modes work more similarly  and the debug mode has  generally been improved. Most notably you just need to <em>hover over variables</em> in your code  while debugging to see their value and inspect them. Thousands of clicks and sighs will be saved this way. 
</p><p class="centred">
<a href="http://earthlingsoft.net/ssp/blog/graphics/XCodeDebugVariables.png" title="Click to enlarge."><img src="http://earthlingsoft.net/ssp/blog/graphics/XCodeDebugVariables.png" style="width:95%;max-width:570px;max-height:242px;" alt="XCode displaying variable information when hoving over them in code while debugging"></a>
</p><p>
XCode&#8217;s breakpoints gained a GUI for things like playing a sound or logging some string or backtrace as well as the ability to have <q>Global</q>, that is cross-project, breakpoints. That&#8217;s great for those of us who program occasionally and forget whatever little they know about the gritty gdb commands in between. That said, the GUI implemented here is far from perfect once again: 
</p><p>
After just a few uses I noticed that: (a) you cannot use the scroll wheel in the breakpoint list when there are expanded items with text fields in them, (b) switching between the different actions like <q>Log</q>, <q>[Play] Sound</q> &amp;c deletes the settings you made in your previous choice; that&#8217;s very inconvenient and bad for experimentation, (c) no Undo  (but at least Copy and Paste work, so it&#8217;s still better than an iPhone&#8230;), (d) no Duplicate command, (e) after expanding a  breakpoint by clicking the triangle at the left of the breakpoint you always have to click the ⊕ button at its far right side; that&#8217;s annoying; relocating the buttons or simply letting a double click in the area have the same effect would be handy.
</p><p class="centred">
<a href="http://earthlingsoft.net/ssp/blog/graphics/XCode3%20Breakpoints.png" title="Click to enlarge."><img src="http://earthlingsoft.net/ssp/blog/graphics/XCode3%20Breakpoints.png" style="width:95%;max-width:519px;max-height:126px;" alt="Breakpoints window of XCode 3"></a>
</p><p>
XCode&#8217;s help now seemingly gained the ability to automatically subscribe to <em>documentation updates</em>, download and install  them (in what seems to be universally considered the most resource hogging background process Apple gave us so far) and thus save you the hassle of that login, download and install process. 
</p><p>
Another addition -  which may well end up being a star of XCode -  is the <em>Research Assistant</em>, an inspector window that displays information and documentation about the method, variable type or function your cursor is currently on. It&#8217;s a wonderful idea which could be tremendously useful if it were well implemented. But it&#8217;s still quite far from that.
</p><p>
Even in my shallow experience the Research Assistant is one of the main factors making XCode 3 terribly sluggish -  waiting a full second before seeing what you typed appear on screen sluggish, that is. This needs major improvement. Allegedly there are cutting edge technologies like multi-tasking or multi-threading which let applications look up one thing without stalling your typing while doing that. Let&#8217;s hope Apple catch up with those technologies at some stage. The Research Assistant also isn&#8217;t terribly good at displaying information for many things it should know about. Specifically it doesn&#8217;t display information when you click into a child part of a struct or Objective-C 2 property statement or when you click into one of the methods of your own classes. - Nice idea, but not really there yet.
</p><p>
XCode&#8217;s <em>autocompletion</em>  improved as well. But it remains ridiculously bad. I don&#8217;t think I ever used an autocompletion feature which so consistently managed to suggest the most useless autocompletion when several possible completions are available. Making this perfect should be hard but a bit of work might lead to considerable improvements already: XCode has a lot of information at hand, it knows about Apple&#8217;s data types and the functions/methods belonging to them, it knows about your classes and it knows the code you use close to where you are typing. Humans and even dull logic will probably manage to complete <code>[bezierPath moveToPoint: NSMak</code>  in a useful way - a task which  is already too hard for XCode&#8217;s autocompletion. And this is just a random example I had on screen at the moment. There are many many others you will come across.
</p><p class="centred">
<img src="http://earthlingsoft.net/ssp/blog/graphics/XCode%20Autocompletion%201.png" style="width:95%;max-width:191px;max-height:61px;" alt="Screenshot of XCode 3's ill-advising autocompletion.">
</p><p>
I am lazy, so I really want to use autocompletion, but with XCode&#8217;s - as it is today - I frequently think that it would have been quicker to type things myself than to wait for the autocompletion suggestion to appear or to fight XCode to provide me the correct autocompletion. This is even harder and frustrating because even after using it for a while I am unable to predict what hitting the tab key will do. You cannot develop &#8216;muscle memory&#8217; for the autocompletion for (at least) two reasons: The first is that you cannot simply type a few letters and hit tab. You have to wait for a moment before hitting tab until XCode has caught up with you. That costs time and &#8216;flow&#8217;. And then, XCode seems to try to be &#8216;clever&#8217; about the default completion it suggests. Which could be a good thing. But somehow I found that in most cases it&#8217;s just not clever enough and hands me  the wrong completion.
</p>

<h4 id="objc">Objective C 2</h4>

<p>
Objective-C -  the best programming language since Basic or Pascal - got a <a href="http://developer.apple.com/documentation/Cocoa/Conceptual/ObjectiveC/index.html?http://developer.apple.com/documentation/Cocoa/Conceptual/ObjectiveC/Introduction/chapter_1_section_1.html">version bump</a> as well. And it surely resolves the single thing  Objective-C lacked in comparison with RealBasic: <em>Garbage collection</em>. While, personally, I think that Objective-C&#8217;s retain-release concept  really isn&#8217;t so bad once you got the idea, leaving out all those explicit retain, release or autorelease calls will certainly make programming more fun and less of a hassle. 
</p><p>
I&#8217;m sure there will also be situations where having proper garbage collection will solve real memory management problems. Just as there will be situations where it will <a href="http://developer.apple.com/releasenotes/GraphicsImaging/RN-CoreImage/index.html">hurt performance</a>. In fact, I am fairly sure that I already observed such a situation in a <a href="http://earthlingsoft.net/Symmetries">fun little project</a> where I ended up using 60MB of extra RAM while displaying an animation. Probably just being able to release the images in question as soon as you don&#8217;t need them anymore rather than waiting for the garbage collector to  feel like doing the job could avoid this generous waste of precious RAM.
</p><p>
<em>Properties</em> look great as well because - as big as my love for brackets may be - it&#8217;s quicker to type than accessor or Key-Value-Coding methods. I&#8217;m lazy in that way. XCode&#8217;s autocompletion still mostly sucks when you are using properties and I am not sure whether I fully grasped the concept and its consequences yet. (What&#8217;s the cost of using a property? Does it really make sense to access a class&#8217; instance variable via <code>self.myInteger</code>? I keep thinking that it may be the &#8216;cleaner&#8217; version of doing things but that in many cases it&#8217;s probably just an absurd waste of CPU cycles - i.e. global warming. So what&#8217;s the responsible thing to do?) My lazy self is also a bit disappointed that setting up a property requires three lines of code in three different locations. I was thinking more about a single magic statement in a single place. As XCode&#8217;s &#8216;refactoring&#8217; also fails to make renaming properties easy by offering to change both the source and header file and listing all other places where the property is used by files (code and nibs) in the project, this isn&#8217;t entirely convenient.
</p><p>
Objective-C 2&#8217;s new <em>looping</em> techniques are very welcome as well. I  doubt that anybody will miss having to type <code>NSEnumerator</code> all over the place. I certainly won&#8217;t. 
</p>

<h4 id="interfacebuilder">Interface Builder</h4>

<p>
<img src="http://earthlingsoft.net/ssp/blog/graphics2/IB3Icon.png" style="width:128px;height:128px;" alt="Interface Builder 3 Icon">
One of the more problematic parts of X.5&#8217;s developer tools is the completely reworked Interface Builder. While re-engineering and re-writing the ancient Interface Builder application to better match today&#8217;s Cocoa environment with things like Bindings and the iPhone runtime environment around is most likely a good idea, the application itself seems terribly under-engineered and prematurely released to me. 
</p><p>
Somehow the new Interface Builder seems to require a lot more screen real estate than its predecessors with its huge, overly animated and split viewed Library palette being the most obvious problem. Just try creating a medium sized window on a MacBook screen. It will end up being frustrating because you&#8217;ll either have the Library palette covering your window or you&#8217;ll have to fight the battle between the Library and Inspector palettes about who is on top. That&#8217;s not very convincing.
</p><p>
Interface Builder&#8217;s - just like XCode&#8217;s - New File window is a matter of bad design as well. Rather than carefully using the space in that huge window to make all relevant items that can be created clearly visible, you&#8217;ll easily find yourself in a situation where you see scrolling views and many subitems which makes things look much more complicated than they really are.
</p><p>
Other things that regularly drive my nuts in the new Interface Builder are that it seems even worse at dealing with localisations than its predecessors (easy switching between different language versions of the same UI element would seem like an obvious thing to do), that it makes it ridiculously non-obvious how to instantiate one of your own classes in a nib file and that its bindings editor still sucks full time (no good preservation of what you enter, no help autocompleting key paths and no friggin&#8217; way to make the Inspector window wide enough to even <em>see</em> your full key path, FAIL, FAIL, FAIL) which makes other points like the new icons for nib and xib files that simply don&#8217;t stand out in your XCode file list and thus needlessly hard to find seem minor in comparison.
</p><p>
Uh, and Interface Builder&#8217;s pseudo HUD, small, overly auto-scrolling action method selection window is probably something for which you want a copy of the HIG engraved in some hard material just so you can slap the people who implemented this with it.
</p><p class="centred">
<img src="http://earthlingsoft.net/ssp/blog/graphics/IB3ConnectionPopupHUD.png" style="width:95%;max-width:278px;max-height:276px;" alt="Connection HUD Popup window">
</p>

<h4 id="documentation">Documentation</h4>

<p>
Apple have a proud history of shipping all that nice Cocoa stuff and giving us sub-standard documentation and examples along with it. My impression is that this situation has improved <em>a little</em> but hasn&#8217;t changed fundamentally yet.
</p><p>
The problem with this is that it can waste a lot of time or create sufficient frustration to simply discourage people - particularly those of us who&#8217;re only in this for the fun - from trying things. In many places of Cocoa the behaviour of the framework is  un(der)-defined by the documentation. Be it because Apple are too stingy to have more exhausting documentation written as they don&#8217;t care about their developers or because they don&#8217;t know themselves. Giving Apple the benefit of the doubt one could hope that the people working there and making the frameworks actually know those details and can explain them. Then <em>please</em> make them share that knowledge, it will save time over and over again around the world!
</p><p>
Then there are small things in XCode&#8217;s documentation browser which could be smoother. Say, when I&#8217;m entering <code>NSMenuItem</code>  into the search field I keep getting the legacy <code>NSMenuItem</code> protocol as the first result. I am even warned about this being a deprecated way of doing things and (after scrolling) I&#8217;ll get a link to the new class, but wouldn&#8217;t things be, um, useful if the Help gave me the thing I&#8217;m looking for right away?
</p><p>
Another aspect of documentation - which is quite &#8216;in character&#8217; for Apple, though - is that it&#8217;s not very candid about what doesn&#8217;t work. This kind of information can be tremendously helpful as it keeps people from wasting time trying things that are hopeless. What about a comprehensive guide to all Cocoa controls indicating which of them can <em>realistically</em> be used with Bindings, say?
</p><p>
The final point are examples. Many people, including myself, find examples a very valuable form of documentation as they don&#8217;t just theorise about the frameworks but <em>show</em> you how things are done. With a bit of luck you can even nick some code from them. In some areas (Quartz Composer, Audio?) the examples seem to be quite comprehensive and give you a good starting point for not just using those technologies in a simple way but really digging into them. In other areas, however (CoreData and Bindings come to mind), the examples are far from covering the whole problem space. I think that having more of them could make learning the underlying technologies much easier (particularly for &#8216;magic&#8217; technologies like CoreData which you are not going to understand fully).
</p>

<h4 id="codesigning">Code Signing</h4>

<p>
MacOS X.5 is full of technology for <a href="http://developer.apple.com/documentation/Security/Conceptual/CodeSigningGuide/Introduction/chapter_1_section_1.html#//apple_ref/doc/uid/TP40005929-CH1-DontLinkElementID_13">code signing</a>. It has good and bad sides. Let me discuss <a href="http://brockerhoff.net/bb/viewtopic.php?p=2438#2438">what it does</a> first.
</p><p>
The essential idea for code signing is to authenticate an application. A developer can create a certificate and sign his application. While - just as with encryption certificates - it takes quite a bit of extra effort to make sure such a signature really authenticates the developer, this at least gives you a way to determine whether two different versions of an application originated from the same developer (modulo the developer&#8217;s incompetence at handling his certificate, that is).
</p><p>
Mac OS X.5 already uses this in a number of ways. The best one of them is the keychain. If an application has been signed by the developer and you allow that application to access your keychain, the keychain will now remember not just the application and its version but the developer&#8217;s certificate. If you download an update for the application, the keychain will recognise that it has been signed by the same developer and the application will be granted access to the keys without further ado. This means there is one less annoying dialogue asking the user for permission to access the keychain. Which makes it more likely that users will take  those requests seriously when they <em>do</em> appear. It&#8217;s a good thing.
</p><p>
Other areas where Mac OS X.5 uses code signing is for its firewall and its nanny mode. In the latter, code signing is used more destructively: Rather than letting people execute any code, only certain &#8216;trusted&#8217; applications which are pinned down by the signatures of their developers (or the signatures OS X.5 adds if there is none) are allowed to accept network connections or to be used by the kids.
</p><p>
Obviously things easily become a bit creepy once we venture in this direction. For example because of the automated code signing by the OS, applications can be modified without you really knowing about it. And obviously once you have these technologies in place for the good intentions they are also easily available for bad ones.
</p><p>
I suppose the iPhone is a prominent example for this. Essentially it&#8217;s Apple&#8217;s decision whose code can run on the iPhone. That <span title="smirk">toy</span> is not a computer at all but a highly controlled environment. Apple dictates its rules and it will be interesting to see when the first applications are found to be against Apple&#8217;s arbitrary terms and conditions and will be banned from iPhones. Would instant messaging be fine? Would route planning be OK for third party software on the iPhone or did Apple make an &#8216;exclusive&#8217; contract with some software company for that already? Is porn in or out? And if it&#8217;s out, who gets to decide what porn is? Is VoIP OK? Or an application displaying The Guardian? Or one displaying Fox News for that matter? Do we really want someone else deciding which software may run and which doesn&#8217;t?
</p><p>
Well, the iPhone and Mac OS X.5 have the technology to censor away. Currently it&#8217;s a mere possibility but what will happen in X.6, .7, .8? We don&#8217;t know. The code signing doesn&#8217;t seem to be fully documented yet (another aspect which makes this a bit creepy) so the full power isn&#8217;t entirely clear at the moment. But it appears that using the <code>codesign</code> utility you can sign pretty much everything from a Unix command line tool to a OS X bundle. And the detailed settings appear to give finely levelled control about which parts of a bundle are covered by the signature. When will applications start trying to refuse running when their signature isn&#8217;t matched? When will frameworks which Apple ship but don&#8217;t want other applications to use simply fail to initialise when the application using them hasn&#8217;t been signed by Apple? 
</p><p>
We&#8217;ll have to see how this plays out. If I am not mistaken they have done a similar thing on Windows for ages with drivers. Whenever a hardware company doesn&#8217;t cough up the money for Microsoft&#8217;s certification and a driver is installed some dialogue box comes up asking people whether they really want to continue installing an unsigned driver. I haven&#8217;t watched many Windows users but none of those I saw seemed to even register that warning, they just dismissed it because that&#8217;s the natural thing to do. Which to me means that <em>if</em> signing technology is to have any practical effect it has to be drastic. Things need to not work when they are not signed. And that&#8217;s a bit of a scary prospect as it makes a completely walled in computing experience - one that one wouldn&#8217;t consider a computing experience at all in some classical sense - seem quite realistic.
</p><p class="aside">
Interesting question: Does XCode support convenient code  signing yet? There is a field for entering the key to use for singing in the build target inspectors. But entering something there never did much for me. When compiling the project with the <code>xcodebuild</code> command, however, it looked like a signature was created.
</p>
]]></description>
<dc:subject>Mac OS X 10.5 Leopard</dc:subject>
<dc:creator>ssp</dc:creator>
<dc:date>2008-08-22T08:25:22+01:00</dc:date>
</item>

<item rdf:about="http://earthlingsoft.net/ssp/blog/2008/06/mac_os_x_display_fail">
<title>Mac OS X Display FAIL</title>
<link>http://earthlingsoft.net/ssp/blog/2008/06/mac_os_x_display_fail</link>
<description><![CDATA[<p>
My impression is that slowly but surely Apple manage to ruin every good thing about their soft- and hardware. Traditionally I had a very high opinion of their networking support. Not that I could (or had a need to) judge its technical merits. But it just worked. AppleTalk was perfect back in the days (but has been degraded to the printing niche by Apple by now where it is still superior to all the other methods of printing I have seen, if only because PAP driven printers seem to be the only ones which can automatically, tell the computer whether they have a duplexer and that they are having a paper jam). But even TCP/IP networking was relatively good on the Mac. Since System 7.5 it could do without restarting and it pretty much &#8216;just worked&#8217; for me all the time. Except when you had to use Apple&#8217;s particularly shitty implementation of SMB/CIFS networking, but we could be generous and not consider that proper networking at all, I suppose.
</p><p>
But as technology &#8216;develops&#8217; I have a machine now whose Airport connection routinely fails and, since the X.5.3 update whose Ethernet connection fails as well when there&#8217;s a high load on the machine. Fan-friggin-tastic. My inner conspiracy theorist assumes it&#8217;s a scheme by Apple to move the whole internet onto iPhones. Haha.
</p><p>
Another point where the Mac ruled pretty much forever was support for multiple screens. No matter what you hooked up, the computer would generally make reasonable sense of it and options to adjust the multi-screen desktop to your liking were never far off. And I have never seen a Mac cause significant problems when trying to hook up an external screen. — Until last week that is. The crappy CRT in the office started flickering. Which meant I got a different crappy CRT as a replacement which looks just the same from the outside. And it worked just fine with the MacBook the first time I used it. When attaching it the second time with Apple&#8217;s ridiculously overpriced &#8216;MacBook to VGA adaptor&#8217; the screen just gave me an <q>OVERRIDE SYNC ERROR</q> message. All capital letter FAIL, that is.
 </p><p class="centred">
<a href="http://earthlingsoft.net/ssp/blog/graphics/OVERRIDESYNCERROR.jpeg" title="Click to enlarge."><img src="http://earthlingsoft.net/ssp/blog/graphics/OVERRIDESYNCERROR.jpeg" style="width:95%;max-width:450px;max-height:253px;" alt="Screen displaying OVERRIDE SYNC ERROR"></a>
</p><p>
I first hoped, I had just destroyed the crappy screen. But the fact that the crappy X-Terminal in my office could use the screen just fine, hinted that the carefully &#8216;crafted&#8217; combination of a MacBook and Mac OS X was to blame. Some combinatin of deleting all preference files remotely looking like they are WindowServer or Monitor related, restarting the machine and replugging the screen at the right moment, solved the problem. Temporarily. Attaching it the next time gave an OVERRIDE SYNC ERROR once more. Now that sucks. It&#8217;s exactly the reason why I&#8217;m not using Linux or Windows. I want this to &#8216;just work&#8217;. 
</p><p>
(If you want to trigger extra bugs in OS X, start playing with the &#8216;Rotate Screen&#8217; options OS X offers for the secondary screen. I ended up with my secondary screen being all blue and completely unusable after having used that while trying to explore this problem. More Suck.
</p>
]]></description>
<dc:subject>Mac OS X</dc:subject>
<dc:creator>ssp</dc:creator>
<dc:date>2008-06-03T00:24:23+01:00</dc:date>
</item>

<item rdf:about="http://earthlingsoft.net/ssp/blog/2008/05/meh">
<title>Meh</title>
<link>http://earthlingsoft.net/ssp/blog/2008/05/meh</link>
<description><![CDATA[<p>
I had a nice post mostly written with a bit of <a href="http://www.twitter.com/">Twitter</a> bashing in it. Not because of the service&#8217;s amazing unreliability but because you can&#8217;t do a step on the internet these days without people screaming that OMG! their life is ruined because Twitter was offline for an hour. Get a phone if you need to communicate with people. Somehow I had managed to bring Mr Scoble into this thanks to <a href="http://www.25hoursaday.com/weblog/2008/05/23/SomeThoughtsOnTwittersAvailabilityProblems.aspx">this text</a>. And, just like Twitter, I don&#8217;t think that Mr Scoble is to blame for anything. The people taking him seriously are. In fact, I had forgotten he existed before reading that text. So my theory ended up being that perhaps Mr Scoble could cure Twitter by simply not sending any messages. Sounded like a win-win situation to me. And perhaps he could even end up as a hero after this. Perhaps we&#8217;re not quite ready to give out Nobel prizes for saving web-2 sites yet, but we&#8217;ll never learn if he doesn&#8217;t try.
</p><p>
Then I managed to write down the good old Beatles → Oasis → Travis → Starsailor → Keane line of <a href="http://earthlingsoft.net/ssp/blog/2004/08/haldern_pop#starsailor">musical descent</a> and dodgily compared it to the descent Speak → Phone → Instant Message → SMS → Twitter of communication, where each new member of the series requires more elaborate technology to communicate less. In fact, with Twitter we must have arrived somewhere in the inane quarters (I&#8217;m just queuing for a coffee, btw, and they&#8217;re playing an interesting CD, must remember) and – just as with Keane – the scary question is of course what will come next? [I suspect the answer should be Hot or Not, but that has been around for years and cleverly reduced user interaction to a yes/no decision, can we beat that?]
</p><p>
But before I could elaborate on that, I found myself in kernel panic land and my text gone. At first I hoped chances to recover the text aren&#8217;t too bad. After all that study that RAM isn&#8217;t completely erased when a machine restarts or is shut down made the rounds recently. The question was just whether the crucial bit of RAM would be overwritten by the time I could access it. It was, which is why you have to make to with this text.
</p><p>
Thus, I restarted the system taking the 1:8 (256MB:2GB) chance of OS X overwriting my text just to boot. I&#8217;m fairly sure that my machine&#8217;s memory had been shaken through well at the time of the panic (PIDs in the 40000 range, 10days of uptime, 5GB of swap files, WTF ‽), so stuff could have been anywhere. But the next problem was to actually access that darn RAM. Let&#8217;s just say that OS X doesn&#8217;t come with a convenient way to do that and – naturally – nobody quickly replied to the question I asked on the topic on Twitter, because that might have been useful. 
</p><p>
And the web wasn&#8217;t too useful either as <em>most</em> search queries with what looked like relevant terms on this issue to me returned regurgitated versions of the story of those geeks managing to read the RAM and encryption keys of a machine they quickly turned off. As web sites, and particularly computer web sites, go not a single one of them did any original research on this or even contained any clue that the writers tried to reproduce this on their own machines. Naturally none of them contained a clue on how to read out the machine&#8217;s memory – all that while reading web pages in Safari ate up my precious RAM.
</p><p>
At some stage I had &#8216;lucky&#8217; search terms which led me to the site of the inimitable Amit Singh – a site that from my point of view suffers from the problem many others should envy it for: it has so much  good content that it&#8217;s difficult to find the bits that are relevant for you – who mentions the problem in a <a href="http://www.osxinternals.com/book/bonus/chapter8/kma/">sidenote</a>. To quote:
</p>

<blockquote>
<p>
As a trivial alternative to the kernel extension described in this document, you can try using the <code>kmem=1</code> boot-time argument. If your kernel supports this argument (the Apple kernels at the time of this writing do), setting it will reenable the kernel memory device.
</p>
</blockquote>

<p>
Now I wonder how many of the people writing mouthfuls about hacking computers by reading out their RAM would know this <q>trivial</q> bit of information? Anyway, the upshot is that Apple decided that their users &#8216;don&#8217;t need&#8217; to be able to easily access their very own machine&#8217;s very own RAM if they want to and simply turned off the <code>/dev/mem</code> file people know an love from other systems. But running a command like <code>sudo nvram boot-args="kmem=1"</code> will enable the <code>/dev/mem</code> file again after the next restart [and delete other settings you may have had for boot arguments].  
</p><p>
The rest was an exercise in copying a file and looking at it. Searching for some rare words from my text (Starsailor!) in both ASCII and UTF-16 encodings didn&#8217;t find it, which as far as I can tell suggests that the text had been overwritten already. This is a good point to laud the <a href="http://ridiculousfish.com/hexfiend/">HexFiend</a> tool. While it could do with a better search feature (e.g. Unicode Text Entry, NSStrings love UTF-16 if I&#8217;m not mistaken), it has amazing performance. Even on my slow laptop drive it gets through 2GB in around a minute, reading almost 30MB/s. I have never seen other applications achieve this. Even better, all this is done without discernible CPU usage or performance degradation.
</p><p>
So in the end I lost, but I came out of it with another story to tell.
</p><p>
Homework: Inspect your swap files with HexFiend to see whether they really are encrypted when you&#8217;re using that option of the OS. Also find out whether your system will display the contents of the swap files to you or whether you have to forcefully shut it down to look at them.
</p>
]]></description>
<dc:subject>Mac OS X</dc:subject>
<dc:creator>ssp</dc:creator>
<dc:date>2008-05-24T00:28:25+01:00</dc:date>
</item>

<item rdf:about="http://earthlingsoft.net/ssp/blog/2008/05/whats_in_a_public_identifier">
<title>What&apos;s in a Public Identifier</title>
<link>http://earthlingsoft.net/ssp/blog/2008/05/whats_in_a_public_identifier</link>
<description><![CDATA[<p>
It looks like Apple didn&#8217;t just change their registered name or whatever last year, they also made an effort to copy that change over to as many places as possible. For example to the header of XML format property list files. Old ones will read like this:
</p>

<blockquote>
<code>&lt;!DOCTYPE plist PUBLIC &quot;-//Apple Computer//DTD PLIST 1.0//EN&quot; &quot;http://www.apple.com/DTDs/PropertyList-1.0.dtd&quot;&gt;
</code></blockquote>

<p>
while current ones read like this:
</p>

<blockquote>
<code>&lt;!DOCTYPE plist PUBLIC &quot;-//Apple//DTD PLIST 1.0//EN&quot; &quot;http://www.apple.com/DTDs/PropertyList-1.0.dtd&quot;&gt;
</code></blockquote>

<p>
It doesn&#8217;t look like this difference is of any practical relevance as both the old and new style properly lists work just fine on my Mac. But seeing the difference made me wonder whether it&#8217;s like this &#8216;by design&#8217; or because Apple parse the files sloppily. If what&#8217;s up there in XML files really serves as an identifier, it shouldn&#8217;t change or Apple would have to &#8216;register&#8217; the same format under two names. Which&#8217;d seem a bit sloppy.
</p><p>
Would a strict parser bark on this? Unfortunately I couldn&#8217;t find a clear answer to that question with a bit of googling. As far as I understand the space between the first &#8216;//&#8217; and the second &#8216;//&#8217; is used for the name of the format&#8217;s owner. Is that the current owner or rather the owner at the time the format was specified? 
</p><p>
On the upside: 9 bytes saved per file! OMG! LOL!
</p>
]]></description>
<dc:subject>Mac OS X</dc:subject>
<dc:creator>ssp</dc:creator>
<dc:date>2008-05-11T18:59:35+01:00</dc:date>
</item>

<item rdf:about="http://earthlingsoft.net/ssp/blog/2008/04/webkit_quirk_2">
<title>WebKit Quirk 2</title>
<link>http://earthlingsoft.net/ssp/blog/2008/04/webkit_quirk_2</link>
<description><![CDATA[<p>
Another distinct WebKit Quirk after <a href="http://earthlingsoft.net/ssp/blog/2008/04/webkit_quirk_1b">the other day's duplicate</a> of the <a href="http://earthlingsoft.net/ssp/blog/2008/04/webkit_quirk_1">first one</a>. This one has to do with the 'rounded corners' WebKit can draw on boxes. That's a pretty neat feature but it's neither fully standardised nor perfectly implemented yet. 
</p><p>
Just look at this little example:
</p><p class="centred">
<p style="height: 160px; margin: 10px auto; background: black; margin:20px; border:2px white solid; -webkit-border-radius: 20px; -moz-border-radius:20px;"></p>
</p><p>
The problem we see here is that WebKit anti-aliases its rounded borders. A nice idea, if it were taking the background into account. However, WebKit prefers to anti-alias the background against colour of the inside of the element in question rather than what's actually visible behind it. To make this clear, perhaps this example with a background image is helpful:
</p><p class="centred">
<p style="height: 160px; margin: 10px auto; background: black url(http://earthlingsoft.net/ssp/blog/graphics/PetiteFermeDessert.jpeg); margin:20px; border:2px white solid; -webkit-border-radius: 20px; -moz-border-radius:20px;"></p>
</p><p>
If you look closely, you'll notice that the portion of the background image that would be shown at the corner is displayed there. Resizing the browser window's width while watching the right corners may make this more obvious. I'd say this shouldn't happen.
</p><p>
Amusingly they don't have this problem in Firefox because they decided they'd be happy without anti-aliasing and thus avoided this opportunity for sloppy implementation.
</p><p>
Another thing that's rather unsatisfying about rounded corners is the way they are handled by <code>img</code> elements: A rounded corner is drawn but it is drawn beneath the image. So instead of cropping the image in a nice and round way, it gives something ugly. This is so obvious that I'd guess it's deliberate. But I wonder what the rationale behind it could be.
</p><p class="centred">
	<img src="http://earthlingsoft.net/ssp/blog/includes/qlc.gif" style="height:64px; width:64px; padding:0px; -webkit-border-radius: 12px; border: 3px solid #ff9900;-moz-border-radius: 12px">
</p><p>
Mozilla (as of Firefox 2) actually outdoes WebKit in this respect as it doesn't only not crop <code>img</code> elements but also lets an element's background image 'underlap' beyond the rounded corners – and occasionally even outside the border!
</p><p>
Look at these issues on a <a href="http://www.earthlingsoft.net/ssp/blog/other/WebKitRoundedCornerExample.html">separate page</a>.
</p>

]]></description>
<dc:subject>Mac OS X</dc:subject>
<dc:creator>ssp</dc:creator>
<dc:date>2008-04-21T00:09:40+01:00</dc:date>
</item>

<item rdf:about="http://earthlingsoft.net/ssp/blog/2008/04/labyrinths_vs_pyobjc_vs_encodings">
<title>Labyrinths vs. PyObjC vs. Encodings</title>
<link>http://earthlingsoft.net/ssp/blog/2008/04/labyrinths_vs_pyobjc_vs_encodings</link>
<description><![CDATA[<p> 
Rather than bitching about stupid journalists quoting stupid Austrian academics (well at least one of the parties must have been stupid, it&#8217;s hard to tell which) on the topic of Labyrinths which in turn led to my social sciences flatmate to get a completely wrong impression of what a labyrinth or maze is because he&#8217;ll simply believe anything written on paper (aka social science thinking) rather than a perfectly logical argument I present to him (aka thinking), let me bitch about something else&#8230;
</p><p>
Like the fact that some complete frigtard managed to produce a TeX file which contained Roman text along with cyrillic characters. Well, that shouldn&#8217;t be a big problem. However, it <em>is</em> a problem   if - and that&#8217;s how we reconstructed things - the document was created in the following way:
</p><ul>
<li>The document was first written as a TeX document in Russian in the 1990s.  It was written on a Mac and saved using the Mac Cyrillic encoding.</li>
<li>Cyrillic lookalike characters were used for Roman ones in a number of places. For example Н (Cyrillic capital letter EN) instead of H (Latin capital letter H). </li>
<li>Then someone (else) created an English translation of the document and didn&#8217;t re-type all of the formulas but simply copy and pasted them from the Russian version.</li>
</ul><p>
This is hard to notice when looking at the text file in the right encoding and it&#8217;s rather tricky to find out what exactly happened there as well. (Just try to find out the exact encoding of a file in a Linux GUI if you don&#8217;t really know what you&#8217;re doing&#8230; and who&#8217;d guess Mac-friggin-Cyrillic for it?) But it certainly leaves us with a document containing Cyrillic characters where they shouldn&#8217;t be. 
</p><p>
The next problems were to find all the Cyrillic characters in the document and to replace them.  That should be fairly trivial but with the tools I have at hand I found it quite complicated. [read: if you know a one line regular expression to achieve the same thing, please leave a comment!] A straightforward change of file encoding didn&#8217;t do the trick as this replacement of characters is no such thing. So after a bit of back and forth I ended up doing the following: Open the file in a text editor as Mac Cyrillic. This made sure the wrong characters are correctly interpreted; Copy the file&#8217;s text to the clipboard. Hack together the following <a href="http://pyobjc.sourceforge.net/">PyObjC</a> script to replace characters in the clipboard and write them to a file - printing out the conversions done and the potentially remaining problems to the console:
</p>

<pre>#!/usr/bin/env python
#coding=utf-8
from AppKit import *

pb = NSPasteboard.generalPasteboard()
input = pb.stringForType_(NSStringPboardType).mutableCopy()

originalstring = u'ЗЃгНМЕКаСТ•А†бä'
newstring =  u'3oyHMEKaCTeAacä'
l = len(originalstring)

for i in range(0, l-1):
    a = originalstring[i]
    b = newstring[i]
    count = input.replaceOccurrencesOfString_withString_options_range_(a, b, NSLiteralSearch, NSMakeRange(0, input.length()))
    print a + "->" + b
    print count

a = input.rangeOfCharacterFromSet_( NSCharacterSet.characterSetWithRange_(NSMakeRange(0,127)).invertedSet())

print input[a.location-100:a.location+10]
print input.writeToFile_atomically_encoding_error_("/Users/ssp/Desktop/test.tex", 0, NSASCIIStringEncoding, None)
</pre>

<p><p>
This still feels like it is a bit too complicated for the simple problem at hand. But it did the job. I think I&#8217;m starting to like PyObjC. To begin with, python as a language seems quite nice and intuitive. I haven&#8217;t read a manual but just from seeing a few examples I could deduce enough to get a working script. I wouldn&#8217;t say that this is necessarily a technically good thing for a language, but for a scripting language used for off-the-cuff hackish stuff like this it&#8217;s brilliant. [This certainly beats the atrocity known as perl or the hideousness of shell scripts.]
</p><p>
Then there&#8217;s Objective-C and the Cocoa frameworks. As I am familiar with them, having direct access is rather good and gives me the ability to do many things right away without needing to re-learn everything. Again, perfect for hacks like this. And it&#8217;s better than the &#8216;real thing&#8217; because I don&#8217;t have the overhead of creating an XCode project, compiling and so on when doing this. A nice thing about Cocoa is its fault tolerance. You can just get away with passing zero pointers in many situations, leaving you with a working script even though things didn&#8217;t go perfectly. [That certainly beats AppleScript; As AppleScript is probably the worst language ever for string manipulation I wanted to avoid it here.]
</p><p>
Extra kudos go to the PyObjC implementors for making a bit of an effort in their error messages. Compared to other languages, these were actually helpful. There&#8217;s nothing as bad as starting a hack like this and running into a cryptic error message which halts progress. At that point you start losing loads of time. For some things - as the inclusion of non-ASCII characters  in the script, an issue which I was really scared about considering the general Unicode incompetence in scripting languages - PyObjC simply spat out a message pointing right to <a href="http://www.python.org/dev/peps/pep-0263/">a web page discussing the issue</a> and telling me I want to write <code>#coding=utf-8</code> at the top of my script. Another Google search made clear that I want to add a <code>u</code> in front of my string constants and things worked from there. That&#8217;s excellent.
</p><p>
Of course this script is still imperfect. It&#8217;s off-the-cuff by someone who doesn&#8217;t know what he&#8217;s doing. And I failed to do everything I wanted to achieve. A few questions that stuck follow. Any insight on the issues they present will be appreciated.
</p><ul>
<li>Is there a really simple way to get a collection of all &#8216;strange&#8217; characters in a document? Just a list of all non-ASCII characters without duplicates in a line of Cocoa or a magic regular expression? That would have made it easier to gauge the size of the problem before starting.
</li><li>
I managed to find the &#8216;wrong&#8217; characters one-by-one but I would only get their offset from the beginning of the string easily. When looking at things in a text editor at the same time you usually just have a command to jump to a certain line but not to a certain character in the file. What&#8217;s the easiest way to solve this?
</li><li>
It seems that the last character in my strings is ignored. (That&#8217;s why I added trivial replacement at the very end.)
</li><li>
python strings and NSStrings don&#8217;t seem to be exactly identical in PyObjC. For some Objective-C&#8217;s <code>-length</code> method works, for others I had to use Python&#8217;s <code>len()</code> function.
</li><li>
I couldn&#8217;t write to the clipboard. When doing so in <a href="http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/Classes/NSPasteboard_Class/index.html">NSPasteboard</a> you need to pass an &#8216;owner&#8217; to the method you are calling. Usually that is <code>self</code>. I tried entering <code>self</code> but PyObjC just gave an error. I tried passing other things like 0 or a string instead and that led to a rather unfortunate situation where OS X.5&#8217;s whole clipboard infrastructure was broken. <code>pboard</code> needed to be killed and any running application which tried to use the clipboard froze and needed to be killed when doing so. Hence I just wrote the results to a file&#8230;
</li>
</ul> </p>
]]></description>
<dc:subject>Mac OS X</dc:subject>
<dc:creator>ssp</dc:creator>
<dc:date>2008-04-16T09:42:37+01:00</dc:date>
</item>


</rdf:RDF>