<?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/Patches</title>
<link>http://earthlingsoft.net/ssp/blog/category/patches</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>Patches-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-06-14T00:34:16+01:00</dc:date>
<admin:generatorAgent rdf:resource="http://www.movabletype.org/?v=5.2.3" />

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

<rdf:li rdf:resource="http://earthlingsoft.net/ssp/blog/2005/10/ipod_contacts_improvement" />

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

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

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

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

</channel>


<item rdf:about="http://earthlingsoft.net/ssp/blog/2009/06/safari_reloaded">
<title>Safari Reloaded</title>
<link>http://earthlingsoft.net/ssp/blog/2009/06/safari_reloaded</link>
<description><![CDATA[<p>
<img src="http://earthlingsoft.net/ssp/blog/graphics2/Safari.png" style="width:128px;height:128px;" alt="Safari Icon">
Safari 4 was released last week. It&#8217;s unspectacular from the point of view of a web user and brings a lot of improved techno-wanker stuff beneath the hood. That&#8217;s probably a good thing as someone has to take the first step and Safari and other non-IE browsers seem to have enough velocity these days to help driving the development of web browsers and even dragging the Microsoft&#8217;s Internet Explorer along.
</p>

<h4 id="bling">Bling</h4>

<p>
The more critical points about Safari 4 are the changes to its user interface though. Some of them, like &#8216;<a href="http://earthlingsoft.net/ssp/blog/2009/02/safari_4b1#visualboomarks-topsites">Top Sites</a>&#8217; are vacuous pieces of crap (enquire within to make me argue that it&#8217;s visual overload, much less effective than typing the first letter of the address and may waste your time by reminding you of the existence of websites you shouldn&#8217;t visit so often), <em>but</em> unlike many other types of crap Apple introduced in the past years, these can be easily and turned off and ignored without any problem.
</p>

<h4 id="coverflow">Cover Flow and lost opportunities</h4>

<p>
The same uselessness statement could me made about Cover Flow bookmarks, I suppose, but to be honest <em>I</em> hardly ever use my bookmarks at all, so to me it seems mainly a waste of effort (and judging from what I heard others say, a rather unreliable one at that as Safari doesn&#8217;t seem to be good at actually fetching those images. Personally I also consider that feature a missed opportunity. Not only did Apple decide to litter our hard drives with hundreds of megabytes of web page screenshots (opening the folder of which <em>may</em> be a good way to visualise the privacy implications of web bugs - particularly Google), they also missed out on the opportunity to create a good solution for this that offers search and offline access as well.
</p><p>
To me the current implementation of Safari seems ridiculous. For each page you visit it stores a reference in your browsing history, it saves a file with the page&#8217;s text for Spotlight searches and it saves a screenshot of the page for its Cover Flow bookmarks.  Yet, there seems to be no way to actually look at the screenshots Safari stores for you. They are not displayed by Quick Look when invoked on browsing history items and they are neither used to give you an impression of one of those history items when you are offline. To me, saving a web archive with the actual page in it (plus a screenshot, possibly, for performance) would seem much more logical. <em>And</em> it would make those situations when you discover a page you visited in a Spotlight search while you don&#8217;t have internet access much less frustrating.
</p>

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

<p>
Another <em>big</em> debate among browser users was Apple&#8217;s re-location of the tab bar into the window&#8217;s title bar which existed in some beta versions of Safari 4. While I could appreciate the space savings of that, <a href="http://earthlingsoft.net/ssp/blog/2009/02/safari_4b1#tabs">I thought</a> it was more irritating than useful in the end. Simply because it made the window&#8217;s title bar look extremely busy and made things hard to click. In addition, that idea also ruined other subtle display methods in Safari: The unique lock icon location for encrypted sites and the full window width page title. Without the latter it&#8217;s quite hard to see the page&#8217;s name at a glance.
</p><p>
Surprisingly  Apple listened to the loads of the feedback they must have received on this issue and the released version of the browser come with traditional style tabs. Those aren&#8217;t perfect either, but apparently they&#8217;re the best you can do when working with the &#8216;tab&#8217; metaphor. In particular, they still suffer from horizontal overflow problems, as tabs to everywhere. And Apple&#8217;s insistence on only giving you an overflow chevron with no way to actually move between the tabs doesn&#8217;t make that any better. In fact, they added some fancy background colouring to the menu coming out of the overflow chevron, presumably to give you a better idea about the context you&#8217;re looking at. But I am not really sure it helps me figure out anything.
</p><p>
The following two screenshots are an example of that. I opened six tabs in a narrow Safari window which could only fit four of them in. In the beginning, with the fourth tab selected, it looked like this:
</p><p class="centred">
<a href="http://earthlingsoft.net/ssp/blog/graphics/SafariOverflowMenu1.png" title="Click to enlarge."><img src="http://earthlingsoft.net/ssp/blog/graphics/SafariOverflowMenu1.png" style="width:95%;max-width:493px;max-height:174px;" alt="First example of Safari overflow menu with four light coloured items and two dark coloured items"></a>
</p><p>
This makes sense to me, assuming that the light colour indicates the visible tabs and the dark colour indicates the hidden tabs. Then I paniced and switched to the last tab:
</p><p class="centred">
<a href="http://earthlingsoft.net/ssp/blog/graphics/SafariOverflowMenu2.png" title="Click to enlarge."><img src="http://earthlingsoft.net/ssp/blog/graphics/SafariOverflowMenu2.png" style="width:95%;max-width:493px;max-height:174px;" alt="Second example of Safari overflow menu with three light coloured items and tree dark coloured items"></a>
</p><p>
Now, with the same window width and tab arrangement, seeing three of both the light and the dark items suggests that my initial idea about the meaning of the colours was wrong. I guess I&#8217;ll just have to avoid looking at this. Tabs aren&#8217;t good for you anyway.
</p>

<h4 id="progress">Progress</h4>

<p>
Another contentious issue was that of the progress indicator. Safari used to have a progress indicator which coloured in the address field according to the page&#8217;s progress at being loaded. While a progress indicator that gives quantitative information may be extremely problematic on a conceptual level for loading web pages - you have to display some progress immediately after the request is sent to let the user know something is happening but you have no clue at that stage how long it will take to complete everything - I think that Safari used to fake it reasonably well. 
</p><p>
Nobody wants to read precise information from the progress indicator. Usually people just want to see that (a) their request is being processed and that (b) some progress is happening. That is, you want a bit of the progress bar to appear as soon as a click is made and then you wa old nt the progress bar to move at a reasonable speed as long as data are coming in. That way a stalled progress indicator may give you a hint that something isn&#8217;t working properly and that a reload may be in order. Particularly in low-bandwidth situations, which web sites and browsers don&#8217;t seem to be particularly good with, <a href="http://www.betalogue.com/2009/06/12/safari4/" title="Betalogue &raquo; Blog Archive &raquo; Safari 4 and the blue progress bar: Ignoring the needs of users in low-bandwidth conditions">this is a useful feature</a>.
</p><p>
Apple decided to remove the progress indicator in the betas, replacing it by a tiny spinning progress indicator at the very right hand side of the address bar in beta versions. This was very irritating as the visual impact of that tiny graphic was so low that you always had to consciously <em>look</em> at that tiny bit of screen space to see whether or not the progress indicator appeared. Definitely a change for worse, big enough to penetrate Apple&#8217;s bug reporters (perhaps people at Apple are even using Safari themselves&#8230;). 
</p><p>
Their &#8216;solution&#8217; to the problem was to not just display the progress indicator but provide an easily visible dark background around it which you&#8217;ll immediately notice without having to make an effort to look for it. That certainly solves the biggest problem with the new progress indicator seen in the betas. The other problem, however, of seeing whether there is actual progress in the file transfers or whether they have stalled, remains. 
</p><p>
I&#8217;d certainly like to read the reasoning that went into putting engineering resources into making the progress indicator worse than it was before. Seems illogical to me, particularly as Apple missed out on what looks like the only potential <em>advantage</em> of an indeterminate progress indicator to me: The ability to let it spin when further resources are loaded <em>after</em> the page finished loading, like many of those fancy <a href="http://earthlingsoft.net/ssp/blog/2006/04/the_second_web" title="The second Web (Quarter Life Crisis)">web 2</a> pages like to do. 
</p>

<h4 id="back">Reload button</h4>

<p>
Another problem with Safari 4 is that Apple moved the Reload button to the right hand side of the address bar. Web browsers were born with the reload button at the left hand side of the window. More importantly, they were born with the Reload button close to the Back and Forward buttons, which not only makes sense but also keeps distances short when navigating with the mouse. Internet Explorer 7 broke that tradition and its wrongly placed Reload buttons remains the second most annoying thing about it (the first item in the list, naturally, being the rendering mistakes which make me need the reload button and non-trivially test in that browser in the first place).
</p><p>
Safari is keen to follow in Internet Explorer 7&#8217;s steps in this respect and moves its combined Reload and Stop button far away from the other navigation buttons. That irriates the hell out of me - and apparently a few other people as well. As there seems to be no point in holding one&#8217;s breath (and Apple&#8217;s software regime on the Mac hasn&#8217;t reached iPhone level fascism yet), a little bit of clicking yielded this:
</p><p class="centred">
<a href="http://earthlingsoft.net/ssp/blog/graphics/Safari4ProperReload.png" title="Click to enlarge."><img src="http://earthlingsoft.net/ssp/blog/graphics/Safari4ProperReload.png" style="width:95%;max-width:202px;max-height:78px;" alt="Reload button at the left in Safari 4"></a>
</p><p>
It&#8217;s not as good as the Safari 3 original as it doesn&#8217;t reflect the state change from Stop to Reload but it may be a reasonable approximation until somebody discovers a better fix. You can <a href="http://earthlingsoft.net/ssp/tidbits/#safari4reloadfix">grab a copy of the files here</a> and use them at your own risk.
</p>
]]></description>
<dc:subject>Software</dc:subject>
<dc:creator>ssp</dc:creator>
<dc:date>2009-06-14T00:34:16+01:00</dc:date>
</item>

<item rdf:about="http://earthlingsoft.net/ssp/blog/2005/10/ipod_contacts_improvement">
<title>iPod Contacts Improvement</title>
<link>http://earthlingsoft.net/ssp/blog/2005/10/ipod_contacts_improvement</link>
<description><![CDATA[<p>
<img src="http://earthlingsoft.net/ssp/blog/graphics2/Franz%20Ferdinand%20You%20Could%20Have%20It%20So%20Much%20Better2.jpeg" style="width:50%;max-width:500px;max-height:500px;" alt="Franz Ferdinand's You Could Have it so much better  cover art">
Only yesterday I did my little bit of complaining about <a href="http://earthlingsoft.net/ssp/blog/2005/09/bug_report_friday_ipod" title="Bug report Friday: iPod (Quarter Life Crisis)">shortcomings of the iPod</a>. And today &ndash; well, yesterday as well technically as I prefer posting here shortly after midnight, Franz Ferdinand&#8217;s new album was released. First impressions suggest that it&#8217;s highly enjoyable. But more importantly, its title is <em>You Could Have It So Much Better</em>. 
</p><p>
Going by this positive motto, I looked at yesterday&#8217;s problems again and decided  that I can have it so much better and I&#8217;ll just improve the situation for me and my iPod. While all the music management on the iPod is done by iTunes which determines everything you see there all the way to the <a href="http://earthlingsoft.net/ssp/blog/2005/09/itunes_5_artist_sorting_patch" title="iTunes 5 Artist sorting patch (Quarter Life Crisis)">sorting order</a>, the situation is quite different for contacts on the iPod. 
</p><p>
All iTunes (and formerly iSync) does there is to generate a &#8216;VCF&#8217; file from the data it finds in your address book and copy it to the iPod&#8217;s Contacts folder (at least that&#8217;s what happens on my iPod&#8230; I don&#8217;t know whether the current photo-savvy models do some more trickery to include the photos from your address book). And in fact, possibly to make cross-platform compatibility easier, you any drop any &#8216;VCF&#8217; file &ndash; which is nothing but a bunch of concatenated VCARD records &ndash; into the iPod&#8217;s contacts folder and the iPod will attempt to display the contact information therein.
</p><p>
Thus all I needed to do to solve some of the problems I described yesterday was to generate my own &#8216;VCF&#8217; file with all the extra data I want and without the problem that certain addresses aren&#8217;t displayed. To do that I decided to write a  little AppleScript, that goes through my address book and
</p><ul>
<li>
Marks all addresses as &#8216;Home&#8217; or &#8216;Work&#8217; in the exported file, so the iPod doesn&#8217;t ignore them because they&#8217;re marked &#8216;Other&#8217;
</li><li>
Uses the pronunciation form of names whenever available. This isn&#8217;t a good solution. A good one should only do this if the real name can&#8217;t be displayed on the iPod (because it&#8217;s in Thai or Tamil, say) and then it should also check on the glyphs needed to display the pronunciation form (I suppose someone speaking Thai may want to note the pronunciation of a German name in their own writing). So, yup, this solution isn&#8217;t very good. It does work for my needs, though, and it&#8217;s Apple&#8217;s job to do this properly. 
</li><li>
Adds people&#8217;s birth dates to the comment section for a contact.
</li><li>
Adds people&#8217;s first AIM address to the comment section for a contact. Obviously people using other services would prefer to use other or additional services here.
</li><li>
Includes only the first two e-mail addresses for a contact. &ndash; Why that? I usually keep all old e-mail addresses for people, so Mail can still display the correct photo even with messages I received years ago. I am also still hoping that one day Mail will offer smart folders for each person in your address book &ndash; and you&#8217;d need all their past addresses for that. Usually I&#8217;ll make sure I have the newest addresses at the top of the list, so having the first two will give me the relevant ones without unnecessarily cluttering the iPod&#8217;s screen.
</li>
</ul>
<p>
It works pretty well for me. As we&#8217;re dealing with AppleScript here it means writing this small file will take quite some time. And it means we&#8217;re enjoying AppleScript&#8217;s typical quirks &ndash; somehow I needed to make a call to <a href="http://earthlingsoft.net/UnicodeChecker">UnicodeChecker</a> to ensure the file is properly encoded as UTF-16, thus using for good what I consider a <a href="http://earthlingsoft.net/ssp/blog/2005/06/applescript_and_text_encodings" title="AppleScript and Text Encodings (Quarter Life Crisis)">quirk in AppleScript&#8217;s handling of encodings</a>. But in total it does work and I can now enjoy a Contacts list with names, all addresses and birth dates on my iPod.
</p><p>
Grab yourself a copy of the <a href="http://earthlingsoft.net/ssp/blog/other/iPod%20Addresses.scpt">script</a>. And make sure to look at its readme and to adjust the file location at the very top of the script to whatever is appropriate for your iPod before running the script. 
</p><p>
<ins>Update: The first version of the script was still flawed in that it didn&#8217;t transfer all addresses in a way that the iPod would display them. In the current revision, addresses are now inserted into the contact&#8217;s comments and everything seems to be present.
</ins>
<blockquote>
<p>
Well, I&#8217;m just a voice in your earpiece<br>
Telling you no, it&#8217;s not all right.<br>
You know, you could have it so much better.<br>
You could have it so much better.<br>
If you tried&#8230;
</p>

<p class="by">Franz Ferdinand &ndash; You Could Have It So Much Better</p>

<p></blockquote></p>
]]></description>
<dc:subject>Patches</dc:subject>
<dc:creator>ssp</dc:creator>
<dc:date>2005-10-01T01:31:22+01:00</dc:date>
</item>

<item rdf:about="http://earthlingsoft.net/ssp/blog/2005/09/itunes_5_artist_sorting_patch">
<title>iTunes 5 Artist sorting patch</title>
<link>http://earthlingsoft.net/ssp/blog/2005/09/itunes_5_artist_sorting_patch</link>
<description><![CDATA[<p> 
After my <a href="http://earthlingsoft.net/ssp/blog/2005/09/itunes_5" title="iTunes 5 (Quarter Life Crisis)">recent post on iTunes 5</a> there have been requests for a more detailed description of how to improve iTunes&#8217; <a href="http://earthlingsoft.net/ssp/blog/2005/09/itunes_5#localisation" title="iTunes 5 (Quarter Life Crisis)">localised band sorting</a> which also spoils the sorting on the iPod. In its English localisation, iTunes is set up to sort bands with names like &#8216;The Strokes&#8217; as if they were called &#8216;Strokes, The&#8217; &ndash; thus giving them a more natural position in the artist list in both iTunes and the iPod. 
</p><p class="aside">
You will not need this patch for iTunes <a href="http://earthlingsoft.net/ssp/blog/2007/07/itunes_73">7.3</a> and higher as Apple finally restored the proper artist sorting there. It was necessary for iTunes <a href="http://earthlingsoft.net/ssp/blog/2005/09/itunes_5">5</a>, <a href="http://earthlingsoft.net/ssp/blog/2005/10/itunes_6">6</a>, and <a href="http://earthlingsoft.net/ssp/blog/2006/09/itunes_7">7.0</a> and for iTunes <a href="http://earthlingsoft.net/ssp/blog/2007/03/itunes_71">7.1</a> and <a href="http://earthlingsoft.net/ssp/blog/2007/05/itunes_72">7.2</a> it was crucial to apply it before first launching the application. —— The patch also seems that it works in a similar way on iTunes for Windows. All you need to do is find a folder iTunes.Resources in the folder of your iTunes application there to locate the same file I describe the change for below. 
</p><p>
For other languages than English,  iTunes 5&#8217;s localisation  replaces the &#8216;The&#8217;  by the appropriate article from the respective language. This sorts local bands just fine. But as everyone is listening to English bands as well, it will leave English bands sorted badly and makes them hard to find &ndash; a situation that has been better in the later versions of iTunes 4. Here I&#8217;m trying to give a description on how to fix the problem yourself. While it&#8217;s not particularly nice, it isn&#8217;t a terribly hard thing to do. To be able to do this you&#8217;ll need a text editor and use an account that lets you write  to the iTunes application. You may want to make a backup copy of the complete iTunes application in case things go wrong.
</p><p>
<img src="http://earthlingsoft.net/ssp/blog/graphics/iTunes%20Open%20Package.png" style="width:218px;height:112px;" alt="Opening the iTunes package">
The first steps are to quit iTunes and open iTunes&#8217; package in the Finder. To do that control-click the application and select the third item in the menu that appears. It should read something along the lines of &#8216;Show Package Contents&#8217; in your langauge. This will open a new window showing a folder &#8216;Contents&#8217;. Open that folder and also the folder &#8216;Resources&#8217; contained in it.
</p><p>
<img src="http://earthlingsoft.net/ssp/blog/graphics/iTunes%205%20Package%20Resources.png" style="width:236px;height:332px;" alt="iTunes 5's package and some of its contents">
Within the Resources folder there are many different files and folders. Folder whose name end in &#8216;lproj&#8217; are relevant for the localisation. iTunes will load data from the folder that corresponds to your preferred language. For many languages the proper name is used but for others, like Swedish, an abbreviation like &#8216;sv&#8217; is used. Go and find the folder that is appropriate for your language and open it. Within the folder is the file &#8216;Localizable.strings&#8217;. This is the file containing the relevant strings and we are going to change it. So if you haven&#8217;t made a backup copy of iTunes a few paragraphs ago be sure to at least make one of this file before you change it.
</p><p>
Now open that file in a text editor. TextEdit in its standard setup will work for this but any other editor that can handle Unicode files will do as well.   If the file doesn&#8217;t look right, and accented or other &#8216;special&#8217; characters like the &copy; sign in line 17 look garbled something went wrong and you should try to explicitly open the file as a UTF-16 encoded one.
</p><p>
Once the file is open, find the relevant strings. They are around line 345 and labelled by &#8216;146.xxx&#8217;, where xxx is a number. Note that the x-es start with 001 and increase in numbering. The German version of those strings looks like this:
</p><p>
<code>/* ===== Reordered Artist Strings ===== */<br>
"146.001" = "Die ";<br>
"146.002" = "%1, Die";<br>
"146.003" = "die ";<br>
"146.004" = "%1, die";<br>
"146.005" = "DIE ";<br>
"146.006" = "%1, DIE";</code>
</p><p>
It Tells iTunes that when it finds a band whose name starts with &#8216;Die &#8217; to sort it as if the &#8216;Die&#8217; were appended at the end, in the form &#8220;%1, Die&#8221;, where %1 is supposed to denote the remainder of the band&#8217;s name. Note two things here. First, capitalisation is important, i.e. there have to be separate entries for instances of the same word with potentially different capitalisation. And second, in the lines with odd numbers there is a space at the end of the string.  You shouldn&#8217;t forget that as it ensures that, e.g. &#8216;Thelonious Monk&#8217; won&#8217;t be sorted as if his name were &#8216;lonious Monk, The&#8217;. 
</p><p>
All that remains to do now is to add the additional re-sorting instructions you may want. Just add two new lines containing the strings to match and replace and  make sure their numbers increase appropriately. Make sure that you&#8217;re not missing any of the quotation marks or semicolons! The most obvious addition would be something like this:
</p><p>
<code>"146.007" = "The ";<br>
"146.008" = "%1, The";<br>
"146.009" = "THE ";<br>
"146.010" = "%1, THE";<br>
"146.011" = "the ";<br>
"146.012" = "%1, the";</code>
</p><p>
That&#8217;ll sort the English names. And once you&#8217;re at it you may think about adding  strings for other languages as well. Perhaps add &#8216;Les&#8217; as well for French, or add &#8216;Der&#8217; and &#8216;Das&#8217; as well for German. I am not sure whether the latter ones are appropriate, though, but as you&#8217;re changing stuff yourself now, you can adjust things to match your taste&#8230;
</p><p class="aside">
As for &#8216;matching your taste&#8217; you could also abuse this to re-sort things more boldly. I.e. if you&#8217;re a big fan of Mando Diao and think it&#8217;d be nice to have them listed at the top of your iTunes and iPod artist lists rather than having to find them in the middle of hundreds of bands you could try adding something like<br>
<code>"146.013" = "Mando Diao";<br>
"146.014" = "00001";</code><br>
which should make sure the band is listed very far at the top. I&#8217;m not really recommending to do this as it makes the list less logical, but it could be useful to some.
</p><p>
After saving the file with the changes made, you should be able to start iTunes again and it should sort band names in the way you intended.
</p><p>
Finally let me note that you&#8217;re doing all this at your own risk and any future updates to iTunes, in case they don&#8217;t fix the problem anyway, may reset your changes so you&#8217;ll have to apply them again. If you want changes for several languages, you&#8217;ll have to update the &#8216;Localizable.strings&#8217; file for each of them. Please don&#8217;t complain about those inconveniences, at least not to me&#8230; but if you&#8217;ve made it up to here you&#8217;re probably looking for that kind of trouble.
</p>

<hr>

<p>
If you really enjoyed doing this, you may also be interested in looking at my <a href="http://earthlingsoft.net/ssp/blog/2004/04/patching">old iTunes patch</a> which makes the little arrows next to song, band and album names which take you to the relevant section of iTMS or your music library more subtle.
</p>
]]></description>
<dc:subject>Patches</dc:subject>
<dc:creator>ssp</dc:creator>
<dc:date>2005-09-15T00:51:10+01:00</dc:date>
</item>

<item rdf:about="http://earthlingsoft.net/ssp/blog/2005/09/celsius">
<title>Celsius</title>
<link>http://earthlingsoft.net/ssp/blog/2005/09/celsius</link>
<description><![CDATA[<p>
Back when I looked a the new features of Mac OS X.4, I took a good <a href="http://earthlingsoft.net/ssp/blog/2005/05/x4_dashboard" title="X.4 Dashboard (Quarter Life Crisis)">look at the Dashboard</a> and was disappointed by its lack of proper localisation. This was particularly evident in the <a href="http://earthlingsoft.net/ssp/blog/2005/05/x4_dashboard#weather" title="X.4 Dashboard (Quarter Life Crisis)">Weather widget</a> which not only has the annoying habit of preferring small U.S. towns which nicked the names of their European ancestors when you enter them &ndash; and giving very little feedback about it. It also gives you Fahrenheit temperatures for every new widget you open.
</p><p>
<img src="http://earthlingsoft.net/ssp/blog/graphics/Dashboard%20Weather%20Icon.png" style="width:79px;height:80px;" alt="Weather widget icon">
That&#8217;s not only annoying for the user but also quite stupid. The system knows where I am, which language I prefer and whether I&#8217;m using metric units. From these informations quite a good guess regarding the preferred temperature scale could be made: E.g. Having German as the preferred system language, <em>not</em> being located in the U.S. (<a href="http://en.wikipedia.org/wiki/Fahrenheit#Usage" title="Fahrenheit - Wikipedia, the free encyclopedia">or Jamaica</a>) and preferring metric units should allow a pretty safe prediction in favour of degrees Celsius.
</p><p>
All this is quite annoying and really puts me off the weather widget which I otherwise like for its shiny prettiness and its forecasts. So I decided to have a look at it. After all the Dashboard is mostly driven by JavaScript which means you can read the code and change it. And my hope was that even with my JavaScript experience being rather low-key (I&#8217;d say a single digit number of lines so far), I should be able to figure out what goes wrong, why it goes wrong and how to fix it.
</p><p>
Looking at the relevant scripts made me realise that closed source software has a definite  advantage. While you can&#8217;t fix things yourself and can&#8217;t learn from what other people did, it also keeps you from thinking that the people who wrote the software should be embarrassed. It seems that the Weather widget gets it wrong in a number of places. Ranging from a lack of resources or interest in localisation to really, erm, <em>odd</em> ways of programming and weaknesses in spelling.
</p><p>
My first impression while looking at the code was that the widget isn&#8217;t as bad as it seems as it in fact has hooks for localised strings all over the place in its JavaScript code. It even contains a string <code>UseCelcius</code> which can be set to zero or one and determines the widget&#8217;s default temperature scale. It also showcases a strange form of humour or ignorance about the spelling of Mr Celsius&#8217; name &ndash; which is found throughout the JavaScript code. I&#8217;d like to make the sad sidenote at this place that the Google fight Celsius vs. Celcius ended with the ridiculous score of 8.4million:1.3 million. Eeek.
</p><p>
Thus  a quick solution for the problem was to just localise the widget myself. With about twenty strings this wasn&#8217;t too hard to do and has the advantage of giving me German day names as well for the forecast:
</p><p class="centred">
<a href="http://earthlingsoft.net/ssp/blog/graphics/Dashboard%20Wetter.png" title="Click to enlarge."><img src="http://earthlingsoft.net/ssp/blog/graphics/Dashboard%20Wetter.png" style="width:95%;max-width:284px;max-height:203px;" alt="German Weather Widget" lang="de"></a>
</p><p>
<img src="http://earthlingsoft.net/ssp/blog/graphics/Dashboard%20Wetter%20Icon.png" style="width:95px;height:116px;" alt="Dashboard Wetter Icon">
And while I was at it, I also updated the widget&#8217;s icon to display a temperature that&#8217;s reasonable in Celsius and localised the name as well. Unfortunately you can&#8217;t have localised icons so the original icon had to be overwritten for this. 
</p><p>
But then, just for the heck of it, I thought I should try whether I could now use Fahrenheit temperatures with my new version of the widget. And the result was that I couldn&#8217;t in the German localisation. Hence another look at the JavaScript code was needed and it exhibited two things. <em>First</em>, that the choice of Fahrenheit or Celsius is stored on a per-widget basis. Doing this probably avoids the (IMO small) problem of having to update all widgets which are already running to reflect the change. But it is also the reason why we had to re-set the temperature scale to Celsius for each new widget we opened before.  Personally I think a global preference would be better here.
And <em>second</em>, the preference for the temperature scale to be used is saved like this:
<pre>widget.setPreferenceForKey(isCelcius ? true : null, createkey("celcius"));
</pre>
I.e. if the scale is Celsius we save &#8216;Yes&#8217; and if it isn&#8217;t we save nothing at all. In particular this is the reason why I couldn&#8217;t save the Fahrenheit scale in  my German localisation. Luckily a problem that could be fixed with a few keystrokes.
</p><p>
<img src="http://earthlingsoft.net/ssp/blog/graphics/German%20Weather%20Widget%20folder.png" style="width:202px;height:165px;" alt="Contents of downloaded folder">
I put together the files I changed for download:
</p>

<dl>
<dt id="x3"><a href="http://earthlingsoft.net/ssp/blog/other/German%20Weather%20Widget.zip">Mac OS X.3-X.5</a>:
</dt><dd>
You need to add the German localisation, replace the icon and patch the JavaScript.
</dd>
<dt id="x6"><a href="http://earthlingsoft.net/ssp/blog/other/German%20Weather%20Widget%2010.6.zip">Mac OS X.6</a>:
</dt><dd>
You only need to add the German files and replace the icon.
</dd>
</dl> 

<p>
Enjoy at your own risk.
</p>
]]></description>
<dc:subject>Mac OS X</dc:subject>
<dc:creator>ssp</dc:creator>
<dc:date>2005-09-12T01:15:15+01:00</dc:date>
</item>

<item rdf:about="http://earthlingsoft.net/ssp/blog/2005/06/demetallifise">
<title>De-Metallifise!</title>
<link>http://earthlingsoft.net/ssp/blog/2005/06/demetallifise</link>
<description><![CDATA[<p>
I am not a friend of metal windows. Back in X.3 I downloaded a neat patch which simply killed every system-provided metal window and turned it into a simple grey one which still included the light effects of metal windows. Not a perfect solution but reasonably good one for my taste &ndash;&nbsp;particularly as metal applications tend to use slightly different visuals which don&#8217;t fit in too well with the lighter non-metal windows.
</p><p>
After installing X.4, I started to feel how much I got used to that patch and somehow I couldn&#8217;t find it again, which was a pain. With the new &#8216;unified&#8217; window type in X.4 the whole window situation has become even more tricky and people are trying all sorts of things such as changing window types on application launch to replace the metal theme by either the unified or the normal window type &ndash; depending on whether they have a toolbar or not. Pierre Chatel&#8217;s new <a href="http://www.chatelp.org/?s=haxies">Unifier</a> hack works along those lines and can give pleasant results in some applications. 
</p><p>
Seeing that and its shortcomings increased my taste for getting rid of the metal windows once more, so I had a look around in the System folder. The relevant UI graphics seem to come from the HIToolbox framework which is part of the Carbon framework. Interestingly they are stored in resource files rather than those supposedly more modern techniques of having a separate image file for each graphic. (I say supposedly there because resource files seem far superior to me.  The &#8216;modern&#8217; technique just looks like a convenience for developers at the cost of making things slow to copy and &ndash;&nbsp;I assume &ndash; also slower to load). 
</p><p>
<img src="http://earthlingsoft.net/ssp/blog/graphics/ResEditClown.png" style="width:167px;height:247px;" alt="Res Edit Startup Graphics">
Unfortunately Apple have dropped any support for editing resource files with OS X. Which means playing with them is as royal a pain as you can have. Despite there being attempts at having native resource editors on OSX (<a href="http://macupdate.com/info.php/id/15422">ResFork</a>, <a href="http://macupdate.com/info.php/id/13831">ResTool</a>), neither of them is any better than our ancient friend ResEdit &ndash; which is the only application I use in Classic these days. 
</p><p>
Due to ResEdit&#8217;s age, it can&#8217;t deal with the data fork resource files which became en vogue with OS X. So you&#8217;ll have to convert the files OS X uses before editing them and re-convert them afterwards. (This can be done quite easily in the Terminal doing something like
<code>touch newFile</code> to create a new file and 
<code>cp DFResFile newFile/rsrc</code> to copy a data fork resource file into its resource fork. It&#8217;s complicated enough to annoy you when you have to do it the fifth time in a row. And too easy to be worth making an Automator action for.
</p><p>
Once ResEdit is running, you&#8217;ll want to take a look at the <code>PXN#</code> resources where all the graphics are stored. ResEdit can&#8217;t edit those (and neither can the newer editors as far as I can tell) and the format looks like a bit of a pain. I <a href="http://www.geocities.com/themeclassroom/editors.html">learned</a> that there&#8217;s a very simple Classic application with the nice name <a href="http://www.geocities.com/themeclassroom/pixie.sit">Pixie</a> that&#8217;ll convert the resources to strangely arranged images and back.
</p><p class="centred">
<a href="http://earthlingsoft.net/ssp/blog/graphics/ResEditExtrasrsrc.png" title="Click to enlarge."><img src="http://earthlingsoft.net/ssp/blog/graphics/ResEditExtrasrsrc.png" style="width:95%;max-width:440px;max-height:219px;" alt="ResEdit Screenshot"></a>
</p><p>
For my purposes using an all black image (that should probably have a width divisible by 4) with Pixie was good enough so this wasn&#8217;t as painful as it sounds. This doesn&#8217;t make the window look black as there still seem to be some masks and gradients at work. Replacing the most offending resource (ID 4460) with my newly created one, gave me what pretty much looks like the same effect that the old patch I had downloaded gave. Plainly grey windows with a light gradient.
</p><p>
I assume this could do with slightly nicer graphics and a better understanding of what&#8217;s going on. But as what comes out was good enough for me, I decided that I won&#8217;t spend more time on fixing the bug that are metal windows &ndash; although I&#8217;d be interested in seeing other improvements.
</p><p>
If you want those changes as well, I&#8217;ll offer them as a handy download akin to the <a href="http://earthlingsoft.net/ssp/blog/2004/04/patching">patch</a> for iTunes last year. It should go without saying that you&#8217;re totally on your own with the instructions that follow and that playing around with them can seriously ruin your system. Perhaps even following my instructions precisely will, I don&#8217;t claim that I know what I&#8217;m doing. So be careful. You&#8217;ll need a Terminal window and an administrator account for this to work&#8230;
</p>

<p><ins><strong>Warning: this will only work on PowerPC based Macs. For Intel based Macs a different file needs to be patched with a different file. To do that replace <em>every</em> occurrence of &#8216;Extras&#8217; in the commands below with &#8216;Extras2&#8217;. <a href="http://earthlingsoft.net/ssp/blog/2006/06/mac_book_3_software#patching" title="Mac Book 3, Software (Quarter Life Crisis)">Read more about the Intel situation.</a></strong></ins>
</p>

<dl>
<dt>Go to the relevant folder</dt>
<dd>cd /System/Library/Frameworks/Carbon.framework/Frameworks/HIToolbox.framework/Resources/</dd>
<dt>Make a backup copy of the Extras.rsrc file, just to be paranoid</dt>
<dd>cp Extras.rsrc ~/Desktop/Extras.rsrc</dd>
<dt>Move the Extras.rsrc file</dt>
<dd>sudo mv Extras.rsrc ExtrasBackup.rsrc</dd>
<dt>Download the patch resource file</dt>
<dd>sudo curl -o Extras.rsrc <a href="http://earthlingsoft.net/ssp/blog/other/ExtrasPatch.rsrc">http://earthlingsoft.net/ssp/blog/other/ExtrasPatch.rsrc</a></dd>
<dt>Patch a little</dt>
<dd>sudo /Developer/Tools/ResMerger -append -srcIs DF -dstIs DF ExtrasBackup.rsrc -o Extras.rsrc
</dd>
</dl>

<p>
And that&#8217;s essentially it. You may want to clean up after yourself and get that backup file out of the system folder. Applications you launch afterwards should have metal-less metal windows.
</p><p class="centred">
<a href="http://earthlingsoft.net/ssp/blog/graphics/NonMetallicCalculator.png" title="Click to enlarge."><img src="http://earthlingsoft.net/ssp/blog/graphics/NonMetallicCalculator.png" style="width:95%;max-width:360px;max-height:304px;" alt="Non-Metal Calculator, Happy Snowman"></a>
</p>
]]></description>
<dc:subject>Mac OS X</dc:subject>
<dc:creator>ssp</dc:creator>
<dc:date>2005-06-04T02:42:35+01:00</dc:date>
</item>

<item rdf:about="http://earthlingsoft.net/ssp/blog/2004/04/patching">
<title>Patching</title>
<link>http://earthlingsoft.net/ssp/blog/2004/04/patching</link>
<description><![CDATA[<p>
<a href="http://earthlingsoft.net/ssp/blog/2004/04/itunes_arrows" title="iTunes arrows (Quarter Life Crisis)">Yesterday</a> I wondered what would be the best way to patch one of iTunes' resource files in order to improve iTunes. And while I am not aware of a proper application to generate those patches, it can be done &#8211;&#160;in a slightly non-obvious but not hard-to-understand fashion.
</p><p>
Beware &#8211; to follow those steps you will need to have Apple's developer tools installed and you'll be exposed to using the Terminal application. Read: This won't be a good experience.
</p><p>
First quit iTunes and then start the Terminal where you change into iTunes' intestines
<pre>cd /Applications/iTunes.app/Contents/Resources/</pre>
Then move the original resource file out of the way and download the file I prepared containing the lighter shade arrows and the non-metal background.
<pre>mv iTunes.rsrc iTunesBackup.rsrc
curl <a href="http://earthlingsoft.net/ssp/blog/other/iTunesPatch.rsrc" title="You don't need to click this. It's just in case you want to download the file without going to the Terminal and doing the patching.">http://earthlingsoft.net/ssp/blog/other/iTunesPatch.rsrc</a> > iTunes.rsrc</pre>
Now do the patching:
<pre>/Developer/Tools/ResMerger -append -srcIs DF -dstIs DF iTunesBackup.rsrc -o iTunes.rsrc</pre>
You'll see two warning messages while this is running. Seeing them suggests that things worked as they should.
</p><p>
And that's it already. Now keep your fingers crossed and hope that iTunes launches regularly when you try to start it. Keep in mind that it's your own problem if you wreck your copy of iTunes this way. 
</p>]]></description>
<dc:subject>iTunes</dc:subject>
<dc:creator>ssp</dc:creator>
<dc:date>2004-04-30T16:23:03+01:00</dc:date>
</item>


</rdf:RDF>