<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
    <title>Legends of the Sun Pig: Everything (blog, reviews, et al.)</title>
    <link rel="alternate" type="text/html" href="http://www.sunpig.com/martin/" />
    <link rel="self" type="application/atom+xml" href="http://www.sunpig.com/martin/feeds/everything-atom.xml" />
    <id>tag:www.sunpig.com,2008-02-11:/martin//everything</id>
    <updated>2010-02-06T21:21:16Z</updated>
    <subtitle>Combined feed for Legends of the Sun Pig: blog, reviews, and other stuff.</subtitle>
    <generator uri="http://www.sixapart.com/movabletype/">Movable Type Pro 4.32-en</generator>

<entry>
	<title>Second-hand 80s</title>
	<link rel="alternate" type="text/html" href="http://www.sunpig.com/martin/archives/2010/02/06/second-hand-80s.html" />	
	
	<id>tag:www.sunpig.com,2010:/martin//2.2239</id>
    
	<published>2010-02-06T19:58:17Z</published>
	<updated>2010-02-06T21:21:16Z</updated>
    
	<summary>Alex and Fiona were both singing Harold Faltermeyer&apos;s Axel F in in their shower and bath this evening. The funny thing about this is that they had probably never heard the original. They picked it up from watching Monsters vs. Aliens on DVD, in which there is a scene where...</summary>
	
	
    <author>
        <name>Martin</name>
        <uri>http://www.sunpig.com/martin/</uri>
    </author>
    
    <category term="80s" label="80s" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="alex" label="alex" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="axelf" label="axel f" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="family" label="family" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="fiona" label="fiona" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="music" label="music" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://www.sunpig.com/martin/">
	
        <![CDATA[<p>Alex and Fiona were both singing <a href="http://www.youtube.com/watch?v=Cu9jFLM6lec">Harold Faltermeyer's Axel F</a> in in their shower and bath this evening. The funny thing about this is that they had probably never heard the original.  <em>They</em> picked it up from watching <i><a href="http://www.imdb.com/title/tt0892782/">Monsters vs. Aliens</a></i> on DVD, in which there is a scene where the President of the USA (Stephen Colbert) tries to make contact with the aliens by playing the <a href="http://www.youtube.com/watch?v=MjlLJzESN8w">five note message</a> from <i><a href="http://www.imdb.com/title/tt0075860/">Close Encounters of the Third Kind</a></i>. He doesn't quite manage it, so he breaks into a spontaneous rendition of <i>Axel F</i> instead.</p>

<p>Although I listen to a <a href="http://www.last.fm/user/sunpig">lot</a> of music when I'm alone, we don't listen to much in the family spaces around the house.  The kids both have stereos on their rooms, but they don't listen to the radio on their own.  Yet they are constantly exposed to musical and cultural references in the films and TV they watch, and the games they play.  I always find it fun to see how they react when I connect something they've just heard or seen to the "original" from twenty years ago (which itself generally has roots in a still earlier era).</p>

<p>In this case, their interest turned into dance.  While they were still getting clean and ready for bed, I burned a selection of 80s hits onto CDs for them.  The playlist opens with Axel F, of course, but there's some Michael Jackson on there, a bit of ABC, a bit of Human League, a bit of Boomtown Rats.  They eagerly stuck the discs into their players, and just minutes later Alex was breakdancing to Axel F, and Fiona had put together a short ballet to the sounds of "Girls Just Wanna Have Fun."  I was completely enchanted.</p>

<p>Music is so important to me that I'm always delighted whenever they take any kind of interest in it.  I need to work on getting more of it into their lives.</p>]]>
        
	
	
	
    </content>
</entry>

<entry>
	<title>Spinnerette - Ghetto Love</title>
	<link rel="alternate" type="text/html" href="http://www.sunpig.com/martin/somethingnice/2010/#002238" />	
	
	<id>tag:www.sunpig.com,2010:/martin//18.2238</id>
    
	<published>2010-01-27T23:16:08Z</published>
	<updated>2010-01-27T23:19:45Z</updated>
    
	
	
	<summary>Spinnerette - Ghetto Love (via @stewartr)</summary>
    <author>
        <name>Martin</name>
        <uri>http://www.sunpig.com/martin/</uri>
    </author>
    
    
    <content type="html" xml:lang="en" xml:base="http://www.sunpig.com/martin/">
	
	
	
        <![CDATA[<p>Spinnerette - <i>Ghetto Love</i> (via <a href="http://twitter.com/Stewartr/status/8250079462">@stewartr</a>)</p>]]>
	
    </content>
</entry>

<entry>
	<title>Grandma</title>
	<link rel="alternate" type="text/html" href="http://www.sunpig.com/martin/archives/2010/01/25/grandma.html" />	
	
	<id>tag:www.sunpig.com,2010:/martin//2.2237</id>
    
	<published>2010-01-25T20:17:06Z</published>
	<updated>2010-01-25T20:20:03Z</updated>
    
	<summary>After a long, full, and happy life, my grandmother Florence McLean died peacefully this morning. We miss her a lot....</summary>
	
	
    <author>
        <name>Martin</name>
        <uri>http://www.sunpig.com/martin/</uri>
    </author>
    
    
    <content type="html" xml:lang="en" xml:base="http://www.sunpig.com/martin/">
	
        <![CDATA[<p>After a long, full, and happy life, my grandmother Florence McLean died peacefully this morning.</p>

<img src="http://sunpig.com/martin/images/2010/01/grandma_mclean_with_alex_20010429.jpg" title="Grandma McLean with Alex, 29 April 2001" alt="Grandma McLean with Alex, 29 April 2001" /> 

<p>We miss her a lot.</p>]]>
        
	
	
	
    </content>
</entry>

<entry>
	<title>Leaving Facebook</title>
	<link rel="alternate" type="text/html" href="http://www.sunpig.com/martin/archives/2010/01/23/leaving-facebook.html" />	
	
	<id>tag:www.sunpig.com,2010:/martin//2.2236</id>
    
	<published>2010-01-23T13:32:29Z</published>
	<updated>2010-01-23T18:46:07Z</updated>
    
	<summary>I don&apos;t make a secret of the fact that I don&apos;t like Facebook. Where others find it playful, I find it intrusive and annoyingly attention-seeking. I don&apos;t like its attitudes towards content ownership and privacy. I particularly don&apos;t like its sense of self-importance, and the greedy way it tries to...</summary>
	
	
    <author>
        <name>Martin</name>
        <uri>http://www.sunpig.com/martin/</uri>
    </author>
    
    
    <content type="html" xml:lang="en" xml:base="http://www.sunpig.com/martin/">
	
        <![CDATA[<p>I don't make a secret of the fact that I don't like Facebook.  Where others find it playful, I find it intrusive and annoyingly attention-seeking.  I don't like its attitudes towards <a href="http://consumerist.com/2009/02/facebooks-new-terms-of-service-we-can-do-anything-we-want-with-your-content-forever.html" title="Facebook's New Terms Of Service: "We Can Do Anything We Want With Your Content. Forever." - The Consumerist">content ownership</a> and <a href="http://www.eff.org/deeplinks/2009/12/facebooks-new-privacy-changes-good-bad-and-ugly" title="Facebook&#039;s New Privacy Changes: The Good, The Bad, and The Ugly | Electronic Frontier Foundation">privacy</a>. I particularly don't like its sense of self-importance, and the greedy way it tries to assume control of my social graph.  It's not that I don't want to connect with my friends over social networks, but I want it to be on <em>my</em> terms, not <em>theirs</em>.</p>

<p>Additionally, whenever you're dealing with a company that handles anything of value to you (with banks it's money, with Facebook and Google it's personal data), you have to weigh up the trust you have to place in them against the benefit you expect to receive.  Google passes that test for me (<em>for now</em>), but I don't trust Facebook not to try and screw me over.</p>

<p>What happens when you try to <em>leave</em> Facebook is emblematic of this.  Here's the page you get when you try to disable your account:</p>

<img src="http://sunpig.com/martin/images/2010/01/leavingfacebook.jpg" alt="Facebook's disable account page" />

<p>Asking me to confirm that I want to deactivate my account is appropriate.  Using my social connections in a clear attempt to trigger an emotional response that will keep me on the service is <strong>absolutely not</strong>.</p>

<p>"Your 32 friends will no longer be able to keep in touch with you" is nonsense.  I assume that since they know how to use a web browser, they're reasonably familiar with a computer, and probably have an email account they can use to reach me.</p>

<p>Below that, they display a random selection of my Facebook contacts with above each one the text "XXX will miss you".  Not only are these statements factually incorrect &mdash; they won't miss me because I never used Facebook to communicate with them in the first place &mdash; but Facebook is almost literally putting words in the mouths of these people.  Facebook has not asked them if they will miss me; it is using them as sock puppets to push its own message, which is "don't go."  By using the emotional "miss you" phrase, Facebook is using its knowledge of my social connections to <em>make me feel bad about leaving</em>.</p>

<p>They are <em>abusing my social graph</em> for their own ends.  It's manipulative, unethical, and downright slimy.</p>

<p>Furthermore, if they are using <em>my contacts</em> to try to make <em>me</em> stay, it follows that if my friends have tried to leave Facebook, then Facebook may have used <em>me</em>, or at least my photo, to try to make <em>them</em> stay &mdash; something that I myself would absolutely not do.</p>

<p>Goodbye, Facebook.  Martin will not miss you.</p>]]>
        
	
	
	
    </content>
</entry>

<entry>
	<title>On refusing to be terrorized</title>
	<link rel="alternate" type="text/html" href="http://www.sunpig.com/martin/archives/2010/01/16/on-refusing-to-be-terrorized.html" />	
	
	<id>tag:www.sunpig.com,2010:/martin//2.2235</id>
    
	<published>2010-01-16T19:32:22Z</published>
	<updated>2010-01-16T19:33:54Z</updated>
    
	<summary>When it comes to security, I&apos;m firmly in Bruce Schneier&apos;s &quot;refuse to be terrorized&quot; camp. I&apos;m sick of the &quot;we must do something&quot; panic reaction that follows even minimal terrorist threats, and the security theatre it leads to. It&apos;s not about the inconvenience it causes me and other passengers; it&apos;s...</summary>
	
	
    <author>
        <name>Martin</name>
        <uri>http://www.sunpig.com/martin/</uri>
    </author>
    
    
    <content type="html" xml:lang="en" xml:base="http://www.sunpig.com/martin/">
	
        <![CDATA[<p>When it comes to security, I'm firmly in Bruce Schneier's "<a href="http://www.schneier.com/essay-124.html" title="Refuse to be Terrorized">refuse to be terrorized</a>" camp.  I'm sick of the "we must do something" panic reaction that follows even minimal terrorist threats, and the <a href="http://en.wikipedia.org/wiki/Security_theater" title="Security theater - Wikipedia, the free encyclopedia">security theatre</a> it leads to. It's not about the inconvenience it causes me and other passengers; it's not even about the ridiculous costs that have to be borne by companies and taxpayers in order to implement measures that will do nothing to prevent a determined terrorist carrying out a attack &mdash; all they have to do, after all, is change their target.</p>

<p><a href="http://www.schneier.com/blog/archives/2010/01/airport_securit_12.html" title="Schneier on Security: Post-Underwear-Bomber Airport Security">Bruce Schneier</a>:</p>
<blockquote cite="http://www.schneier.com/blog/archives/2010/01/airport_securit_12.html"><p>It's magical thinking: If we defend against what the terrorists did last time, we'll somehow defend against what they do next time. Of course this doesn't work. We take away guns and bombs, so the terrorists use box cutters. We take away box cutters and corkscrews, and the terrorists hide explosives in their shoes. We screen shoes, they use liquids. We limit liquids, they sew PETN into their underwear. We implement full-body scanners, and they're going to do something else. This is a stupid game; we should stop playing it.</p></blockquote>

<p><a href="http://www.papersplease.org/wp/2010/01/08/lessons-from-the-case-of-the-man-who-set-his-underpants-on-fire/" title="Papers, Please!  &raquo; Blog Archive   &raquo; Lessons from the case of the man who set his underpants on fire">Edward Hasbrouck</a>:</p>
<blockquote cite="http://www.papersplease.org/wp/2010/01/08/lessons-from-the-case-of-the-man-who-set-his-underpants-on-fire/"><p>What’s most striking about the government’s response to this unsuccessful bombing attempt is the complete lack of any rational relationship between the actions that have been taken and are being proposed, any analysis of which of these and similar tactics did or did not contribute to the success or failure of the Christmas Day attack on Northwest Airlines flight 253, and any likelihood that they would make future attempts at terrorism less likely to succeed.</p></blockquote>

<p>No, what bothers me is the fact that distorting public policy, removing individual liberties, and instituting a culture of irrationality and fear is <a href="http://www.schneier.com/blog/archives/2006/08/what_the_terror.html" title="Schneier on Security: What the Terrorists Want">exactly what the terrorists wanted in the first place</a>.</p>

<blockquote cite="http://www.schneier.com/blog/archives/2006/08/what_the_terror.html"><p>Our job is to think critically and rationally, and to ignore the cacophony of other interests trying to use terrorism to advance political careers or increase a television show's viewership.</p></blockquote>

<p>So what can I personally do to refuse to be terrorized?  Unfortunately, airlines and airports have a monopoly on air travel, and national governments have a monopoly on border control, so I can't refuse to play the security game whenever I go abroad.  I would if I could, because personally I feel more <a href="http://boingboing.net/2009/12/11/dr-peter-watts-canad.html" title="Dr Peter Watts, Canadian science fiction writer, beaten and arrested at US border Boing Boing">at risk from the security measures</a> than I do from terrorist action.  The risk of being subject of an <em>attempted</em> terrorist attack (much less a sucessful one) is, after all, <a href="http://www.fivethirtyeight.com/2009/12/odds-of-airborne-terror.html" title="FiveThirtyEight: Politics Done Right: The Odds of Airborne Terror">less than being struck by lightning</a>.</p>

<p>For one thing, I can help point out when people take the right approach.  For example, <a href="http://www.theregister.co.uk/2010/01/08/mutallab_comment/" title="Trouser-bomb clown attacks - how much should we laugh? • The Register">The Register</a>:</p>

<blockquote cite="http://www.theregister.co.uk/2010/01/08/mutallab_comment/"><p>First: It is completely impossible to prevent terrorists from attacking airliners.<p>

<p>Second: This does not matter. There is no need for greater efforts on security.</p>

<p>Third: A terrorist set fire to his own trousers, suffering eyewateringly painful burns to what Australian cricket commentators sometimes refer to as the "groinal area", and nobody seems to be laughing. What's wrong with us?</p></blockquote>

<p>I can also call bullshit on articles like <a href="http://www.travolution.co.uk/articles/2010/01/15/3157/skyscanner-poll-backs-body-scanners.html" title="Skyscanner poll backs body scanners - Travolution.co.uk">this one on Travolution</a> in which a tiny, poorly worded sidebar poll on a <em>travel industry</em> blog gets blown up to represent that a majority of all <em>travellers</em> are in favour of body scanners that <a href="http://www.independent.co.uk/news/uk/home-news/are-planned-airport-scanners-just-a-scam-1856175.html" title="Are planned airport scanners just a scam? - Home News, UK - The Independent">would not have flagged the completely pants bomber in the first place</a>.</p>

<p>But ranting about this stuff on my blog reminds me of the depressing inevitability of the war in Iraq in late 2002 and early 2003.  No matter how much we, the people, protested &mdash; and the lead-up to the war we saw the <a href="http://en.wikipedia.org/wiki/February_15,_2003_anti-war_protest" title="February 15, 2003 anti-war protest - Wikipedia, the free encyclopedia">biggest anti-war protests in history</a> &mdash; our governments still went blithely ahead.  I may have high hopes for the decade ahead, but an end to the ridiculous security theatre that plagues us is beyond even my wildest dreams.</p>]]>
        
	
	
	
    </content>
</entry>

<entry>
	<title>How to detect a page request from Safari 4&apos;s Top Sites feature</title>
	<link rel="alternate" type="text/html" href="http://www.sunpig.com/martin/archives/2010/01/08/how-to-detect-a-page-request-from-safari-4s-top-sites-feature.html" />	
	
	<id>tag:www.sunpig.com,2010:/martin//2.2234</id>
    
	<published>2010-01-08T22:30:23Z</published>
	<updated>2010-01-08T21:50:51Z</updated>
    
	<summary>While reading Jeremy Keith&apos;s blog entry &quot;Safari Askew&quot; I remembered that I had looked at this just before Christmas, and found an answer. The problem is to do with Safari 4&apos;s &quot;Top Sites&quot; feature, which shows you a pretty grid of thumbnails for the sites you visit most regularly (or...</summary>
	
	
    <author>
        <name>Martin</name>
        <uri>http://www.sunpig.com/martin/</uri>
    </author>
    
        <category term="Techie" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="The Web" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en" xml:base="http://www.sunpig.com/martin/">
	
        <![CDATA[<p>While reading Jeremy Keith's blog entry "<a href="http://adactio.com/journal/1636/" title="Adactio: Journal&mdash;Safari askew">Safari Askew</a>" I remembered that I had looked at this just before Christmas, and found an answer.</p>

<p>The problem is to do with Safari 4's "Top Sites" feature, which shows you a pretty grid of thumbnails for the sites you visit most regularly (or that you have pinned in place).  The interesting thing is that these thumbnails are live (ish) previews of what those pages <em>currently</em> look like.  If you don't happen to have a Top Sites page open in a tab, and if Safari considers that the current thumbnail is sufficiently out of date, it will automatically go and retrieve the latest version.</p>

<img src="http://sunpig.com/martin/images/2010/01/topsites.jpg" alt="Safari 4's Top Sites feature" />

<p>This can cause headaches for site owners, because in order to show the <em>actual</em> state of the page, Safari relies on <em>full page requests</em>: it downloads all the HTML, CSS, images, and JavaScript for the page, and then displays everything exactly as if the user were viewing the page in a standard tab.  Adverts are rendered, page tracking scripts are executed, and to the server it looks just like a regular page hit.  This can lead to the site <a href="http://meta.stackoverflow.com/questions/13727/did-safaris-top-sites-feature-earn-my-enthusiast-badge" title="Did Safari's top sites feature earn my enthusiast badge? - Meta Stack Overflow">recording unnecessary actions</a>, and your <a href="http://www.digitalangels.co.uk/blog/2009/04/safari-4-how-its-top-sites-view-can-mess-up-your-stats/" title="Safari 4 &#8211; how its Top Sites view can mess up your stats | Digital Angels">site analytics being all messed up</a>.</p>

<p>At <a href="http://www.skyscanner.net/">Skyscanner</a>, for example, we noticed this because Google Analytics was showing an unusually high number of Safari users (8.5%) with an abnormally high bounce rate (the proportion of sessions where users view a single page, then walk away with no further interaction):  Safari 4 users were twice as likely to bounce as other browsers.  Useless sessions generated by Top Sites were the problem.</p>

<p>As Jeremy noted, the user agent that Safari 4 reports for a Top Sites request is exactly the same as for a normal page request.  Fortunately, there is a way to distinguish the two types of request: in the current version of Safari 4 (4.0.4) the Top Sites request for the <em>base</em> page (but not its JS/CSS/image resources) carries an additional HTTP header, namely "<code>X-Purpose: preview</code>".</p>

<p>An easy way to verify this is to use an HTTP debugging proxy like <a href="http://www.fiddler2.com/" title="Fiddler Web Debugger - A free web debugging tool">Fiddler</a> or <a href="http://www.charlesproxy.com/" title="Charles Web Debugging Proxy &bull; HTTP Monitor / HTTP Proxy / HTTPS &amp; SSL Proxy / Reverse Proxy">Charles</a> to watch what happens when Top Sites makes a request &mdash; see the screen grabs below:</p>

<img src="http://sunpig.com/martin/images/2010/01/safari4requests.png" alt="Normal and Top Sites HTTP requests from Safari 4" />

<p>If your pages are dynamically generated, you can adjust your server-side code to examine the HTTP headers of the incoming request, and take appropriate action if this is a "preview" request.  Here's some sample PHP code:</p>

<pre><code>
&lt;?php
if ($_SERVER["HTTP_X_PURPOSE"] == "preview") {
	echo "preview";
} else {
	echo "normal";
}
?&gt;
</code></pre>

<p>(<code>"X-Purpose"</code> is not a standard HTTP header, and you won't find "HTTP_X_PURPOSE" in the PHP documentation.  It's the <a href="http://hoohoo.ncsa.illinois.edu/cgi/env.html" title="CGI Environment Variables">CGI specification</a> that specifies how HTTP headers should be handled: they should be made into an environment variable with an "HTTP_" prefix followed by the header name, with dashes replaced by underscores.  Hence, the value of the <code>"X-Purpose"</code> header is placed in the <code>"HTTP_X_PURPOSE"</code> environment variable, and retrieved as <code>$_SERVER["HTTP_X_PURPOSE"]</code>.)</p>

<p>If all you're looking to do it fix your site stats in Google Analytics, then you should just make sure that you don't write out the GA tracking code for preview requests.  If you are concerned about excessive load on your servers, unwanted user actions, or spurious advert impressions, you can take more aggressive action, perhaps by rendering a lightweight version of the page.  An extreme possibility I considered was generating a <em>completely</em> different version of the page, specifically designed to look good in the thumbnail format of the Top Sites preview page:</p>

<img src="http://sunpig.com/martin/images/2010/01/topsitessubverted.jpg" alt="Safari 4 Top Sites with custom preview thumbnail: PROBABLY A BAD IDEA" />

<p>However, doing this runs counter to the notion that these thumbnails represent <em>previews</em>, and I don't know how your users would react.  More importantly, Google might consider this <a href="http://www.google.com/support/webmasters/bin/answer.py?hl=en&amp;answer=66355">cloaking</a>, and come round your house in the middle of the night with a baseball bat.  Just because it's possible, doesn't mean it's a good idea...</p>]]>
        
	
	
	
    </content>
</entry>

<entry>
	<title>2009 in review: books</title>
	<link rel="alternate" type="text/html" href="http://www.sunpig.com/martin/archives/2010/01/02/2009-in-review-books.html" />	
	
	<id>tag:www.sunpig.com,2010:/martin//2.2226</id>
    
	<published>2010-01-02T15:00:00Z</published>
	<updated>2010-01-02T14:05:43Z</updated>
    
	<summary>2009 was the year of the re-read for me, and in particular the series re-read. I love diving into a series and living in the same world as the characters for weeks on end. At the start of the year I couldn&apos;t find any new series I wanted to start...</summary>
	
	
    <author>
        <name>Martin</name>
        <uri>http://www.sunpig.com/martin/</uri>
    </author>
    
        <category term="Books" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en" xml:base="http://www.sunpig.com/martin/">
	
        <![CDATA[<p>2009 was the year of the re-read for me, and in particular the <em>series</em> re-read.  I love diving into a series and living in the same world as the characters for weeks on end.  At the start of the year I couldn't find any new series I wanted to start on, so I went back to some old favourites:</p>

<ul>
<li>Roger Zelazny's <i>Amber</i> series</li>
<li>Neil Gaiman's <i>Sandman</i> books</li>
<li>Lois MacMaster Bujold's <i>Vorkosigan</i> series</li>
<li>Julian May's <i><a href="http://en.wikipedia.org/wiki/Saga_of_Pliocene_Exile" title="Saga of Pliocene Exile - Wikipedia, the free encyclopedia">Pliocene</a></i> and <i><a href="http://en.wikipedia.org/wiki/Galactic_Milieu_Series" title="Galactic Milieu Series - Wikipedia, the free encyclopedia">Galactic Milieu</a></i> series</li>
</ul>

<p>I have read the first three series several times before already, and they are always fresh, and always fun. For a change, I read the Vorkosigan books in chronological order (although I started with <i><a href="http://www.amazon.co.uk/gp/product/0671720872?ie=UTF8&amp;tag=legenofthesun-21&amp;linkCode=as2&amp;camp=1634&amp;creative=19450&amp;creativeASIN=0671720872" title="Shards of Honor: Amazon.co.uk: Lois McMaster Bujold: Books">Shards of Honor</a></i>, rather than <i><a href="http://www.amazon.co.uk/gp/product/0671653989?ie=UTF8&amp;tag=legenofthesun-21&amp;linkCode=as2&amp;camp=1634&amp;creative=19450&amp;creativeASIN=0671653989" title="Falling Free: Amazon.co.uk: Lois McMaster Bujold: Books">Falling Free</a></i>), and in rapid succession.  The early Miles books (<i><a href="http://www.amazon.co.uk/gp/product/0743468406?ie=UTF8&amp;tag=legenofthesun-21&amp;linkCode=as2&amp;camp=1634&amp;creative=19450&amp;creativeASIN=0743468406" title="The Warrior's Apprentice (Vorkosigan): Amazon.co.uk: Lois McMaster Bujold: Books">The Warrior's Apprentice</a></i> and <i><a href="ttp://www.amazon.co.uk/gp/product/0671720147?ie=UTF8&amp;tag=legenofthesun-21&amp;linkCode=as2&amp;camp=1634&amp;creative=19450&amp;creativeASIN=0671720147">The Vor Game</a></i> are still my favourites, and it turns out that <i><a href="ttp://www.amazon.co.uk/gp/product/0743436121?ie=UTF8&amp;tag=legenofthesun-21&amp;linkCode=as2&amp;camp=1634&amp;creative=19450&amp;creativeASIN=0743436121">Diplomatic Immunity</a></i> isn't as bad as I remembered it.</i></p>

<p>The Julian May books were less of a pleasure.  If it weren't for the "I've got this far so might as well keep going" sunk-costs argument, I would (should) have stopped about fifty pages into <i>The Golden Torc</i>.  I remember waiting eagerly for the publication of <i><a href="http://www.amazon.co.uk/gp/product/0330322990?ie=UTF8&amp;tag=legenofthesun-21&amp;linkCode=as2&amp;camp=1634&amp;creative=19450&amp;creativeASIN=0330322990" title="Diamond Mask (Galactic Milieu Trilogy): Amazon.co.uk: Julian May: Books">Diamond Mask</a></i> and <i><a href="ttp://www.amazon.co.uk/gp/product/0330323059?ie=UTF8&amp;tag=legenofthesun-21&amp;linkCode=as2&amp;camp=1634&amp;creative=19450&amp;creativeASIN=0330323059">Magnificat</a></i> in the mid-90s, but now I just find the characters overly self-absorbed and melodramatic; I don't think I'll be re-reading them again.</p>

<a href="http://www.amazon.co.uk/gp/product/0061139076?ie=UTF8&amp;tag=legenofthesun-21&amp;linkCode=as2&amp;camp=1634&amp;creative=19450&amp;creativeASIN=0061139076" title="Beguilement (Sharing Knife): 1: Amazon.co.uk: Lois McMaster Bujold: Books"><img src="http://sunpig.com/martin/images/2009/12/beguilement.jpg" alt="Lois McMaster Bujold - The Sharing Knife, volume one: Beguilement" class="left" /></a>
<a href="http://www.amazon.co.uk/gp/product/0061139068?ie=UTF8&amp;tag=legenofthesun-21&amp;linkCode=as2&amp;camp=1634&amp;creative=19450&amp;creativeASIN=0061139068" title="Legacy (Sharing Knife): Amazon.co.uk: Lois McMaster Bujold: Books"><img src="http://sunpig.com/martin/images/2009/12/legacy.jpg" alt="Lois McMaster Bujold - The Sharing Knife, volume two: Legacy" class="left" /></a>
<p>Staying with Lois McMaster Bujold, 2009 saw the publication of the fourth and final book in her <i>Sharing Knife</i> series.  I bought the first book, <i><a href="http://www.amazon.co.uk/gp/product/0061139076?ie=UTF8&amp;tag=legenofthesun-21&amp;linkCode=as2&amp;camp=1634&amp;creative=19450&amp;creativeASIN=0061139076" title="Beguilement (Sharing Knife): 1: Amazon.co.uk: Lois McMaster Bujold: Books">Beguilement</a></i> when it was released in 2006, but didn't read it at the time.  I knew it was only the first part of a single big story, and having been burned by Peter F. Hamilton's <i><a href="http://sunpig.com/martin/quickreviews/001566.html" title="Peter F. Hamilton - Pandora's Star [Legends of the Sun Pig - Martin Sutherland's Blog]">Pandora's Star</a></i> the previous year, I didn't want to start on the tale, only to have to wait three years to get to its end.  But when the fourth part, <i><a href="http://www.amazon.co.uk/gp/product/0061375373?ie=UTF8&amp;tag=legenofthesun-21&amp;linkCode=as2&amp;camp=1634&amp;creative=19450&amp;creativeASIN=0061375373" title="The Sharing Knife, Volume Four: Horizon: Amazon.co.uk: Lois McMaster Bujold: Books">Horizon</a></i> was published in February, I grabbed it and started from the beginning.</p>

<a href="http://www.amazon.co.uk/gp/product/0061375357?ie=UTF8&amp;tag=legenofthesun-21&amp;linkCode=as2&amp;camp=1634&amp;creative=19450&amp;creativeASIN=0061375357" title="Passage: Sharing Knife 3: Amazon.co.uk: Lois McMaster Bujold: Books"><img src="http://sunpig.com/martin/images/2009/12/passage.jpg" alt="Lois McMaster Bujold - The Sharing Knife, volume three: Passage" class="right" /></a>
<p><i>The Sharing Knife</i> is a fantasy romance -- not a combination that normally leaps off the shelves at me.  But I trust Bujold to write characters I care about and a story that interests me regardless of my genre prejudices, and that is exactly what she has done here.  The world she has created has more of an American frontier feel to it rather than a pseudo-medieval European vibe: prairies and riverside trading towns rather than dark forests and castles.  Lakewalkers patrol the land on the lookout for malices, creatures that rise from the earth and feed on the life energy of everything nearby, and are capable of devastating entire towns.  The malices are an ancient menace, but thanks to Lakewalker efforts over the centuries, a rare one now. So rare that many farmers don't even believe in them any more, which causes tension when Lakewalkers come to town and require their aid.  Because of the apparent safety, and the particular magical means by which Lakewalkers fight the malices, farmers have grown likely to fear and mistrust them, and call them witches, rather than heed their warnings.</p>

<a href="http://www.amazon.co.uk/gp/product/0061375373?ie=UTF8&amp;tag=legenofthesun-21&amp;linkCode=as2&amp;camp=1634&amp;creative=19450&amp;creativeASIN=0061375373" title="The Sharing Knife, Volume Four: Horizon: Amazon.co.uk: Lois McMaster Bujold: Books"><img src="http://sunpig.com/martin/images/2009/12/horizon.jpg" alt="Lois McMaster Bujold - The Sharing Knife, volume four: Horizon" class="left" /></a>
<p>The main characters are Fawn, a young farmer woman who has run away from home, and Dag, a grizzled Lakewalker veteran.  They fall in love despite the large cultural gap that separates them.  The books follow them as, outcast from their families and communities, they try find a place for themselves in the world, and to somehow reconcile these two parallel but highly interdependent societies.</p>

<p>Oh, and fight evil!  The book covers may <em>look</em> all sweet and pastoral, but the plot is driven forward by the ongoing and very real threat of the malices.  While I wouldn't characterize the books as adventure stories, there is no lack of action.  Bujold strikes a masterful balance between the clash-of-cultures love story and edge-of-your-seat thrills, and I can highly recommend the whole series.</p>

<p>(Just make sure you read the first two books, <i>Beguilement</i> and <i>Legacy</i> together, because it is really one book split in two -- even the covers are two halves of a single piece.  Three and four make up "part two", but they are a looser pairing.)</p>

<a href="http://www.amazon.co.uk/gp/product/0441006159?ie=UTF8&amp;tag=legenofthesun-21&amp;linkCode=as2&amp;camp=1634&amp;creative=19450&amp;creativeASIN=0441006159" title="Book of Jhereg (Vlad Taltos): Amazon.co.uk: Steven Brust: Books"><img src="http://sunpig.com/martin/images/2009/12/jhereg.jpg" alt="Steven Brust - Jhereg" class="right"/></a>
<p>Throughout November and December I also caught up on <a href="http://en.wikipedia.org/wiki/Steven_Brust" title="Steven Brust - Wikipedia, the free encyclopedia">Steven Brust's</a> Vlad Taltos series (including an advance copy of <i><a href="http://www.amazon.co.uk/gp/product/0765312085?ie=UTF8&amp;tag=legenofthesun-21&amp;linkCode=as2&amp;camp=1634&amp;creative=19450&amp;creativeASIN=0765312085" title="Iorich (Vlad Taltos Series): Amazon.co.uk: Steven Brust: Books">Iorich</a></i> thanks to Patrick at <a href="http://us.macmillan.com/TorForge.aspx" title="Macmillan :: Tor | Forge">Tor</a>).  I know that I had read <i><a href="http://www.amazon.co.uk/gp/product/0441006159?ie=UTF8&amp;tag=legenofthesun-21&amp;linkCode=as2&amp;camp=1634&amp;creative=19450&amp;creativeASIN=0441006159" title="Book of Jhereg (Vlad Taltos): Amazon.co.uk: Steven Brust: Books">Jhereg</a></i> before, and I'm pretty sure that parts of <i><a href="http://www.amazon.co.uk/gp/product/0441944566?ie=UTF8&amp;tag=legenofthesun-21&amp;linkCode=as2&amp;camp=1634&amp;creative=19450&amp;creativeASIN=0441944566" title="Yendi Jhereg #02: Amazon.co.uk: Brust Steven: Books">Yendi</a></i> were familiar; what I can't figure out is why the hell I would have read the first two books, but not gone on to devour the rest of the series, because it's <em>awesome</em>.  They are (for the most part) hard-boiled fantasy detective novels, not dissimilar in tone to some of my favourite contemporary detective series (Spenser, Elvis Cole, Myron Bolitar, et al.)  The "detective" may be a witchcraft-using assassin, and his sidekick a miniature dragon (jhereg) on his shoulder, but the mean streets of the city are still mean, and when tough talk fails, knocking a few heads together often shakes loose the information required.</p>

<p>That only really describes the surface appearance of this series, though; the underlying world is rich and complex, full of Gods, Great Weapons, ancient sorcery, discrimination, social unrest, and peasant revolutions.  Another thing that appeals to me about the books is that they are <em>short</em>, in the 200&ndash;300 page range.  Steven Brust says what he wants to say, and then moves on.  I like that.  (Unfortunately his writing style in the other Dragaeran books has the opposite effect on me.  I haven't been able to get past the first few pages of <i><a href="http://www.amazon.co.uk/gp/product/0765319659?ie=UTF8&amp;tag=legenofthesun-21&amp;linkCode=as2&amp;camp=1634&amp;creative=19450&amp;creativeASIN=0765319659" title="The Phoenix Guards: Amazon.co.uk: Steven Brust: Books">The Phoenix Guards</a></i>.)</p>

<a href="http://www.amazon.co.uk/gp/product/0061438294?ie=UTF8&amp;tag=legenofthesun-21&amp;linkCode=as2&amp;camp=1634&amp;creative=19450&amp;creativeASIN=0061438294" title="What Every Body Is Saying: An Ex-FBI Agent's Guide to Speed-reading People: Amazon.co.uk: Joe Navarro: Books"><img src="http://sunpig.com/martin/images/2009/12/whateverybodyissaying.jpg" alt="Joe Navarro - What Every Body Is Saying" class="left"/></a>
<p>Finally, some non-fiction.  I have been interested in non-verbal communication since I picked up a copy of Allan Pease's <i>Body Language</i> in the mid-eighties.  In fact, this is one of the reasons I dislike working remotely.  Phone calls strip out all the visual cues I use to pick up on the mood of the office, and to gauge unvoiced concerns in a meeting.</p>

<p>Joe Navarro is a former FBI agent with a background in interrogation and deception detection, and <i><a href="http://www.amazon.co.uk/gp/product/0061438294?ie=UTF8&amp;tag=legenofthesun-21&amp;linkCode=as2&amp;camp=1634&amp;creative=19450&amp;creativeASIN=0061438294" title="What Every Body Is Saying: An Ex-FBI Agent's Guide to Speed-reading People: Amazon.co.uk: Joe Navarro: Books">What Every Body Is Saying</a></i> pays a lot of attention to reading the signals people emit during conversation.  Navarro emphasizes that this is not about being able to tell whether someone is lying or telling the truth (although that does make for <a href="http://www.amazon.co.uk/gp/product/B002AKIR58?ie=UTF8&amp;tag=legenofthesun-21&amp;linkCode=as2&amp;camp=1634&amp;creative=19450&amp;creativeASIN=B002AKIR58" title="Lie To Me - Season 1 [DVD] [2009]: Amazon.co.uk: Tim Roth: DVD">good TV</a>), but rather about learning whether someone is confident or holding back, relaxed or stressed.  When you understand that, you can try to guide the conversation to figure out <em>why</em> they are feeling that way.</p>

<p>Interestingly, this has significant use in usability testing.  One of the tenets of usability testing is that you pay attention to what people <em>do</em>, rather than what they <em>say</em>.  People are often reluctant to criticize, preferring instead to tell white lies about things they dislike.  By studying their posture, gestures, and expressions during a test, and in post-test conversations, you can gain a much better understanding of their emotional state, and where problems lie.</p>

<p>This is definitely one of my top picks of the year.  It's very clearly written, and sprinkled with good illustrations, and not only does it make an excellent introduction to the subject of non-verbal testing, but it also rewards repeated reading and bite-sized dippings-into.  Very excellent.</p>]]>
        
	
	
	
    </content>
</entry>

<entry>
	<title>One of the most important things I read in 2009</title>
	<link rel="alternate" type="text/html" href="http://www.sunpig.com/martin/archives/2010/01/01/one-of-the-most-important-things-i-read-in-2009.html" />	
	
	<id>tag:www.sunpig.com,2010:/martin//2.2227</id>
    
	<published>2010-01-01T12:56:59Z</published>
	<updated>2010-01-01T13:03:31Z</updated>
    
	<summary>Dean Allen commenting over on Zeldman&apos;s site during the discussion of why he shut down Favrd: No fit of pique for me, actually. More like a gradual aha, with a slight wince and sigh at the end. I’ve spent the past year or so reading and writing and doing my...</summary>
	
	
    <author>
        <name>Martin</name>
        <uri>http://www.sunpig.com/martin/</uri>
    </author>
    
    
    <content type="html" xml:lang="en" xml:base="http://www.sunpig.com/martin/">
	
        <![CDATA[<p><a href="http://www.zeldman.com/2009/12/06/the-stars-look-down/#comment-50635">Dean Allen commenting over on Zeldman's site during the discussion of why he shut down Favrd</a>:</p>

<blockquote cite="http://www.zeldman.com/2009/12/06/the-stars-look-down/#comment-50635">
<p>No fit of pique for me, actually. More like a gradual aha, with a slight wince and sigh at the end. I’ve spent the past year or so reading and writing and doing my level best to chip away at 40 years of belief in the logical fallacy that one’s identity meaning – self-worth, self-image, whatever you want to call it – can accurately be measured in the thoughts of others. Much as you and I may enjoy being encouraged through recognition and praise and dislike being saddened by rejection or indifference (god knows we’re taught to right from the outset by caregivers: good boy, pretty picture, heckuva job Brownie), deriving personal value from these transactions in the absence of a well-formed internal frame of reference through which you can decide on your own what does and doesn’t work, and subsequently accept the opinions of others as feedback, is just plain faulty thinking, of the sort that makes otherwise capable, centred people all loopy and weird.</p>
</blockquote>

<p>I never used Favrd; I haven't spent a lot of time thinking about the rights and wrongs  of shutting it down so abruptly.  What I <em>have</em> spent a lot of time thinking about is my own sense of self and self-worth.  I intend to spend more time on this in 2010.</p>]]>
        
	
	
	
    </content>
</entry>

<entry>
	<title>To blog or to tweet?</title>
	<link rel="alternate" type="text/html" href="http://www.sunpig.com/martin/archives/2009/12/30/to-blog-or-to-tweet.html" />	
	
	<id>tag:www.sunpig.com,2009:/martin//2.2225</id>
    
	<published>2009-12-30T23:48:53Z</published>
	<updated>2009-12-30T23:55:24Z</updated>
    
	<summary>Yesterday Anil Dash wrote a great piece about being on Twitter&apos;s &quot;Suggested User List.&quot; I tweeted it this morning, as did many other people. This afternoon Anil tweeted: Thanks to all who retweeted my piece about Twitter&apos;s suggested list. (I miss the days when people responded with their own blog...</summary>
	
	
    <author>
        <name>Martin</name>
        <uri>http://www.sunpig.com/martin/</uri>
    </author>
    
    
    <content type="html" xml:lang="en" xml:base="http://www.sunpig.com/martin/">
	
        <![CDATA[<p>Yesterday Anil Dash wrote a great piece about <a href="http://dashes.com/anil/2009/12/life-on-the-list.html" title="Life on the List - Anil Dash">being on Twitter's "Suggested User List."</a>  <a href="http://twitter.com/sunpig/status/7192644516">I tweeted it</a> this morning, as did many other people.  This afternoon Anil tweeted:</p>

<blockquote cite="http://twitter.com/anildash/status/7198393478">
	<p><a href="http://twitter.com/anildash/status/7198393478">Thanks to all who retweeted my piece about Twitter's suggested list. (I miss the days when people responded with their own blog posts, tho.)</a></p>
</blockquote>

<p>Yeah, I miss those days too.  Twitter (which I will use as shorthand for any short messaging service) makes it very easy to post a quick thought, a status update, or a link to something interesting.  Much of blogging <em>used</em> to be like that, but the blog postings used to be longer, with more context.  I rarely posted one-line blog entries or simple links, because I felt that a blog entry should have some kind of story &mdash; a thread, a narrative &mdash; to guide the reader to a particular conclusion or insight.  This classical "essay" model of blogging has problems, though:</p>

<ul>
	<li>If you are locked into the classical mode, a sense of obligation to write a more elaborate piece can prevent you from writing <em>anything</em>.</li>
	<li>Not all thoughts, insights, and amusing moments you want to share with your friends (and the rest of the world) warrant more than a brief sentence or two.  Explaining an aphorism can ruin the joke.</li>
	<li>And sometimes all you want to do is point to a link, or stick up a photo.  In first-generation blogging tools the overhead of creating an "entry" could be more effort than the mini-message was worth.</li>
</ul>

<p>Over the last year, I have heard many people say that they blog much less now that Twitter is around.  By providing an outlet for people to express themselves <em>quickly and efficiently</em> (albeit in 140-character chunks), it bleeds off a certain amount of creative pressure that would otherwise have led to more and longer blog postings.</p>

<p>I don't want to make this a lament on the "death of blogging", because blogging emphatically <em>isn't</em> dead; otherwise, where would we all find the cool links to tweet about?  In fact, good blog articles <em>benefit</em> from Twitter, because it provides a fast and social notification medium in parallel to the existing mechanisms of RSS feeds and reblogging.</p>

<p>Furthermore, "The Tweet" is as much a new form of writing as blogging was, with <a href="http://www.randsinrepose.com/archives/2009/03/02/the_art_of_the_tweet.html" title="Rands In Repose: The Art of the Tweet">its own grammar and conventions</a>.  In his article "<a href="http://philip.greenspun.com/writing/changed-by-web-and-weblog" title="How the Web and the Weblog have changed Writing">How the Web and the Weblog have changed Writing</a>", Philip Greenspun talks about how blogs have given a natural home to ideas that don't need to be padded out to a whole book or a full-length magazine article; Twitter is just the next logical step.</p>

<p>The web has given us an unprecedented range of tools with which to express ourselves.  It is up to us to learn to use these tools, and to understand when it is appropriate to use each one.</p>
]]>
        
	
	
	
    </content>
</entry>

<entry>
	<title>JavaScript: Rule 1</title>
	<link rel="alternate" type="text/html" href="http://www.sunpig.com/martin/archives/2009/12/29/javascript-rule-1.html" />	
	
	<id>tag:www.sunpig.com,2009:/martin//2.2224</id>
    
	<published>2009-12-29T23:02:58Z</published>
	<updated>2010-01-04T09:34:04Z</updated>
    
	<summary>JavaScript development (for the web) is big right now, and in 2010 it&apos;s only going to get bigger. There is a lot of information available on good practices for web application development with JavaScript, but if performance and maintainability matter to you, few things* are more important than Rule 1:...</summary>
	
	
    <author>
        <name>Martin</name>
        <uri>http://www.sunpig.com/martin/</uri>
    </author>
    
    
    <content type="html" xml:lang="en" xml:base="http://www.sunpig.com/martin/">
	
        <![CDATA[<p>JavaScript development (for the web) is big right now, and in 2010 it's only going to get bigger.  There is a lot of information available on good practices for web application development with JavaScript, but if performance and maintainability matter to you, few things<sup><small><a href="#jsrule1footnote">*</a></small></sup> are more important than <strong>Rule 1</strong>:</p>

<p><strong><em>Source code is for humans, live code is for machines.</em></strong></p>

<p>I first heard Christian Heilmann state this rule at <a href="http://sunpig.com/martin/archives/2007/11/26/atmedia-ajax.html">@Media Ajax 2007</a> as "<a href="http://www.slideshare.net/cheilmann/planning-javascript-and-ajax-for-larger-teams-174408">production code is for humans, live code is for machines</a>" but I prefer the term "source code" to "production code".  The rule was important and prescient then; now I consider it the absolute foundation of any significant web application.</p>

<img src="http://sunpig.com/martin/images/2009/12/jsrule1.png" alt="Development code is transformed into live code before being sent to the browser." />

<p>Rule 1 comes into play as soon as you have a project that involves any of the following:</p>
<ul>
<li>More than a couple of hundred lines of JavaScript source code.</li>
<li>More than a couple of JavaScript source code files.</li>
<li>More than one developer.</li>
</ul>

<p>In olden days (say, 2006), the JavaScript code for many web applications consisted of a single file.  Comments were few and far between, and variable names were kept short because we wanted the code to be as small as possible.  But this strategy does not scale.  As projects get more complex, a single file filled with non-descriprive functions and one-letter variable names quickly becomes unreadable.  In modern web application development there are two weapons we can use to tackle this problem: concatenation and minification.</p>

<p><i>Concatenation</i> is the process of taking multiple JavaScript files, and combining them into a single file.  <i>Minification</i> is the process of transforming a JavaScript source file to make it smaller.  Early JavaScript minifiers just removed comments and unnecessary whitespace, but modern minifiers (<a href="http://developer.yahoo.com/yui/compressor/">YUI compressor</a>, <a href="http://www.dojotoolkit.org/docs/shrinksafe">Dojo Shrinksafe</a>, <a href="http://code.google.com/closure/compiler/">Google Closure Compiler</a>) can also perform more aggresive optimizations, such as shortening variable names and removing unneeded code.</p>

<p>Basically, the JavaScript source code that developers write is no longer the JavaScript code that end users receive, and can see when they view the components for the page.  The first benefit of this is performance: concatenating files reduces the number of HTTP requests web app requires, and minification reduces the download size (and can also reduce parsing time on the client).  The second benefit comes in the form of better source code clarity, which is good for development and maintenance:</p>

<ul>
<li>You can use multiple files to hold your source code, and organize them (naming convention, file hierarchy) however you want.</li> 
<li>You can use lots of whitespace and comments throughout your source code.</li>
<li>You can use descriptive (long) variable and function names, because the minifier will try to reduce them to one-letter variables (identifier replacement).</li>
</ul>

<p>A further consequence of this is that when you are writing JavaScript code, you now have to keep <em>three</em> audiences in mind:</p>

<ul>
<li>The browser's JavaScript interpreter.  Your code <a href="http://www.faqs.org/rfcs/rfc2119.html">MUST</a> run in the target browser(s).</li>
<li>Humans.  Your code <a href="http://www.faqs.org/rfcs/rfc2119.html">SHOULD</a> be clear and comprehensible to your colleagues.</li>
<li>The minifier ("compiler").  Your code <a href="http://www.faqs.org/rfcs/rfc2119.html">SHOULD</a> be structured to help your minifier apply its optimizations.</li>
</ul>

<p>Personally, I am most familiar with the <a href="http://developer.yahoo.com/yui/compressor/">YUI compressor</a>.  If you choose to use it, then Nicholas Zakas' slide deck on <a href="http://www.slideshare.net/nzakas/extreme-javascript-compression-with-yui-compressor">structuring your code for optimal optimization</a> is required reading.  In addition to helping the YUI compressor make your code even smaller, many of these tips make for tidier, more comprehensible code; and because they encourage the use of local instead of global variables, they can even make your code <a href="http://dev.opera.com/articles/view/efficient-javascript/?page=2#avoidglobal">run</a> <a href="http://www.slideshare.net/nzakas/java-script-variable-performance-presentation">faster</a> <a href="http://www.sitepen.com/blog/2009/08/10/web-page-global-variable-performance/">too</a>.  Here are some of the main points:</p>

<ul>
<li>Any literal value used two or more times should be stored in a local variable.</li>
<li>Any global variable used two or more times should be stored in a local variable.</li>
<li>Any property used two or more times should be stored in a local variable.</li>
<li>Try to use only one <code>var</code> keyword and one <code>return</code> statement per function.</li>
<li>Don't use <code>eval</code>, <code>with</code>, or JScript conditional comments.</li>
</ul>

<p><em>Where</em> exactly you apply the concatenation and minification is up to you, and will depend on how your deployment pipeline is set up.  You can do it as part of your build process, or you can do it at runtime &mdash; provided you have some form of caching enabled so that you don't repeat the process for every request.</p>

<p id="jsrule1footnote"><sup><small>*</small></sup>Finally, I should note that the process of concatenation and minification is not the single most effective strategy in reducing the download <em>size</em> of your JavaScript components; that honour goes to <a href="http://www.phpied.com/reducing-tpayload/">gzipping</a>, so I suppose that enabling gzip compression on your web application should, in the programming tradition of zero-based lists, be considered as "Rule 0".  But when it comes to <em>maintaining</em> a complex application, and delivering a compact download package, this is the way to go.</p>]]>
        
	
	
	
    </content>
</entry>

<entry>
	<title>Movable Type drops support for Safari?</title>
	<link rel="alternate" type="text/html" href="http://www.sunpig.com/martin/archives/2009/12/21/movable-type-drops-support-for-safari.html" />	
	
	<id>tag:www.sunpig.com,2009:/martin//2.2223</id>
    
	<published>2009-12-21T21:29:28Z</published>
	<updated>2009-12-21T22:23:18Z</updated>
    
	<summary>I&apos;ve been an enthusiastic user and advocate of Movable Type since version 1 in 2001. I can&apos;t remember any statement from Six Apart that has shocked me more than this one, made by Jun Kaneka on the MT support forum on 9th December: Just to be clear, MT5 should work...</summary>
	
	
    <author>
        <name>Martin</name>
        <uri>http://www.sunpig.com/martin/</uri>
    </author>
    
        <category term="Blogging" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="Movable Type" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en" xml:base="http://www.sunpig.com/martin/">
	
        <![CDATA[<p>I've been an enthusiastic user and advocate of <a href="http://movabletype.com/">Movable Type</a> since <a href="http://www.sunpig.com/martin/archives/2001/10/11/messing-with-movable-type.html">version 1 in 2001</a>. I can't remember any statement from <a href="http://www.sixapart.com/">Six Apart</a> that has shocked me more than this one, made by <a href="http://forums.movabletype.org/2009/11/mt5-template-editing-editor-has-mind-of-its-own.html#comment-34424">Jun Kaneka on the MT support forum on 9th December</a>:</p>

<blockquote>
<p>Just to be clear, MT5 should work fine with Safari. Actually, the UI designer mainly uses Safari to develop MT5.</p>

<p>On the other hand, supported platform is defined by
the platform which QA team conducts their test. It is now</p>

<p>* Mozilla Firefox 3.5 or higher</p>
<p>* Internet Explorer 6.0 or higher</p>
</blockquote>

<p>He slightly elaborates on this <a href="http://www.sixapart.com/pipermail/mtos-dev/2009-December/003661.html">on the MTOS-dev mailing list, also on 9th December</a>:</p>

<blockquote>
<p>That's the difference between "Supported" and "Should work fine".
I'm sorry that the System Requirements page on MT.org
is not precise on that part. We will fix it.</p>
</blockquote>

<p>The System Requirements page for MT was last updated on 10th December.  The "Web Browser" section currently reads:</p>

<blockquote>
<p>As Movable Type is a modern web application which uses Javascript and AJAX extensively, it requires a modern web browser. We strongly recommend the latest version of the following browsers. Browsers are free and easy to upgrade!</p> 
 
<p>The Movable Type is tested and supported on the following browsers:</p> 
 
<ul> 
<li>Mozilla Firefox 3.5 or higher</li> 
<li>Internet Explorer 6.0 or higher (We <strong>STRONGLY</strong> recommend the latest version).</li> 
</ul> 
 
<p>Movable Type should work fine with other modern browsers, but is not tested with these browsers:</p> 
 
<ul> 
<li>Safari 3 or higher</li> 
<li>Opera</li> 
<li>Chrome</li> 
<li>etc.</li> 
</ul>
</blockquote>

<p>As a web developer, I completely understand the difference between "supported" and "should work".  Yahoo's <a href="http://developer.yahoo.com/yui/articles/gbs/">Graded Browser Support</a> policy, with its definitions of A, C, and X-grade browsers codifies this concept neatly.  With limited development and testing resources it is impossible to fully support <em>every</em> browser.</p>

<p>But for a company like Six Apart to restrict their list to <em>IE6+</em> and <em>Firefox 3.5+</em> is  mind-boggling.  First of all, there is a huge contradiction between the two platforms they <em>do</em> support: IE6 is eight years old, used by a small and rapidly declining percentage of users, and is widely known as the least capable browser platform still in common use today; Firefox 3.5 is one of the most advanced browsers currently available, but it was released a mere six months ago.  Secondly: no Safari.  Safari is the browser of choice for the <em>vast</em> majority of Mac users, and enjoys significant use on Windows, too.</p>

<p>The only thing I can think of when I look at that list is: enterprise.  Movable Type has now completely abandoned its former user base of hobbyists, bloggers, and geeks, and wants to concentrate on selling into the corporate market.  The vocal minority of people who will be pissed off by the absence of official Safari support &mdash the trendsetters, the evangelists, the plugin developers, the tutorial writers &mdash; are not the people 6A is interested in reaching any more.  To be honest, most of them left for Wordpress, Drupal, or ExpressionEngine a long time ago.  For several years now, Movable Type has been lacking in product momentum, community, and cool factor, but <em>damn it</em>, it's a great product with a fantastic feature set, and it's an awesomely stable platform on which to build a site.</p>

<p>But if MT is abandoning <em>me</em> (I'm writing this in Chrome &mdash; not Safari, but part of the Webkit family), I don't think I can continue to recommend <em>it</em> any more, and this makes me very sad.</p>]]>
        
	
	
	
    </content>
</entry>

<entry>
	<title>Fronteers conference 2009</title>
	<link rel="alternate" type="text/html" href="http://www.sunpig.com/martin/archives/2009/11/22/fronteers-conference-2009.html" />	
	
	<id>tag:www.sunpig.com,2009:/martin//2.2221</id>
    
	<published>2009-11-22T23:37:00Z</published>
	<updated>2009-11-23T10:47:17Z</updated>
    
	<summary> Fronteers is the Dutch organization for Front-end web developers. Since 2007 it has run regular meetings for members and non-members, and it also runs an annual conference that attracts speakers and delegates from all over the world. For some reason I didn&apos;t blog about the 2008 conference, but here&apos;s...</summary>
	
	
    <author>
        <name>Martin</name>
        <uri>http://www.sunpig.com/martin/</uri>
    </author>
    
    
    <content type="html" xml:lang="en" xml:base="http://www.sunpig.com/martin/">
	
        <![CDATA[		<p>
			<a href="http://fronteers.nl/"><img src="http://sunpig.com/martin/images/2009/11/fronteers-logo.png" class="left" alt="Fronteers logo"></a> <a href="http://fronteers.nl/">Fronteers</a> is the Dutch organization for Front-end web developers. Since 2007 it has run regular meetings for members and non-members, and it also runs an annual conference that attracts speakers and delegates from all over the world. For some reason I didn't blog about the 2008 conference, but here's my report of the 2009 conference that took place at <a href="http://www.felix.meritis.nl/en/">Felix Meritis</a> in Amsterdam last week. It was a single-track conference with remarkably few beards present — I'd estimate that fewer than 10% of the men were sporting facial hair (even including soul patches), an extremely low figure for the tech industry.
		</p>
		<p>
			<a href="http://www.1pictureaday.com/"><img src="http://farm3.static.flickr.com/2227/buddyicons/32623829@N00.jpg?1239469749#32623829@N00" class="left" alt="Marien van Os: 1pictureaday.com" title="Marien van Os: 1pictureaday.com"></a>The speaker photos in this blog post were made by <a href="http://www.1pictureaday.com/">Marien Van Os</a> (<a href="http://www.flickr.com/photos/marvos/">marvos on flickr</a>), used under a Creative Commons license. (And also by permission -- because it's polite to ask.) Please go and have a look at his photos on <a href="http://1pictureaday.com/">1pictureaday.com</a>, because they're <em>amazing</em>.
		</p>
		<h4>
			Thursday 5 November
		</h4>
		<h5>
			What's New With The Mobile Web - <a href="http://molly.com/">Molly Holzschlag</a>
		</h5>
		<p>
			<a href="http://www.flickr.com/photos/marvos/4077975981/in/set-72157622616776549"><img src="http://farm4.static.flickr.com/3492/4077975981_d988a170bc_m.jpg" class="left" alt="Molly Holzschlag at Fronteers 2009, by Marien van Os" title="Molly Holzschlag at Fronteers 2009, by Marien van Os"></a> Molly opened the conference with an overview of where "The Mobile Web" stands today, and what we can (and should) be doing to work with it. Her view is that the most practical strategy at the moment is to create a single site for both the mobile and desktop web ("<i>desktop web</i>" being the term that many of the speakers used to distinguish the "traditional" mode of accessing the web with a PC and a browser), but optimize the experience for the device. This means using things like server-side UA detection, CSS media types, capability detection, and <a href="http://www.w3.org/TR/css3-mediaqueries/">CSS3 media queries</a> to determine what the user is browsing with, and adjust the display accordingly. This certainly fits with existing best practices for accessibility, which emphasize progressive enhancement over graceful degradation; progressive enhancement for mobile devices can be treated as another branch of the same tree.
		</p>
		<h5>
			The Mobile Web, Or The Masochist's Guide To Gleeful Self-flagellation - <a href="http://quirksmode.org/">Peter-Paul Koch</a>
		</h5>
		<p>
			<a href="http://www.flickr.com/photos/marvos/4077977037/in/set-72157622616776549"><img src="http://farm3.static.flickr.com/2591/4077977037_1b8b1d0a69_m.jpg" class="left" alt="Peter-Paul Koch at Fronteers 2009, by Marien van Os" title="Peter-Paul Koch at Fronteers 2009, by Marien van Os"></a> Peter-Paul has recently been doing <a href="http://www.quirksmode.org/blog/archives/2009/09/testing_mobile_2.html">research into mobile browsers</a>, and has published a ton of useful and interesting information on his site <a href="http://www.quirksmode.org/">Quirksmode.org</a>. Here he talked about the mobile browser landscape, highlighting the fact that — at present — you have almost no hope of building a site that will render the same on all devices.
		</p>
		<p>
			He then went on to discuss <a href="http://www.w3.org/TR/widgets/">W3C Widgets</a>, which is a specification to allow you to package up a single page of HTML, along with CSS and JavaScript, and deploy it as a single package to a widget-capable device. The device typically uses a separate runtime to display the widget outside of a browser context, which makes it seem much more like an <em>application</em> than a <em>web page</em>. The technology to run these widgets exists already on S60 phones, and in Opera Mobile, but it is unlikely that the iPhone will (ever) implement it, which is a significant downside for developers who would like to target a uniform platform.
		</p>
		<ul>
			<li>
				<a href="http://www.slideshare.net/pp.koch/the-mobile-web-fronteers-2009">Slides: The Mobile Web (or the masochist's guide to gleeful self-flagellation)</a>
			</li>
		</ul>
		<h5>
			Of Hamsters, Feature Creatures And Missed Opportunities - <a href="http://wait-till-i.com/">Chris Heilmann</a>
		</h5>
		<p>
			<a href="http://www.flickr.com/photos/marvos/4078733134/in/set-72157622616776549"><img src="http://farm3.static.flickr.com/2698/4078733134_fe02315d60_m.jpg" class="left" alt="Christian Heilmann at Fronteers 2009, by Marien van Os" title="Christian Heilmann at Fronteers 2009, by Marien van Os"></a> Chris is always an entertaining speaker. He is passionate about the web, software development, and the technologies we have available to us today. Although the topics he covered in the first half of this presentation were fun and inspiring (don't hang on to knowledge beyond its use-by date; share your skills; use a JavaScript library), it was the second half where he talked about <a href="http://developer.yahoo.com/yql/">YQL</a> that really set the audience alight.
		</p>
		<p>
			In case you haven't come across it before, YQL is a service from Yahoo! that allows you to run SQL-like statements <em>on the web</em>. Not as in, "here's a web-based interface to a back-end SQL database", but as in, "<code><a href="http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20flickr.photos.search%20where%20text%3D%22Cat%22%20limit%2010&amp;format=json&amp;callback=cbfunc">select * from flickr.photos.search where text="Cat" limit 10</a></code>" to get a list of cat pictures from Flickr as XML, or as JSON with a callback (JSONP) so that you can get the results directly from client code, with no server-side proxy needed.
		</p>
		<p>
			(Pause for awesome.)
		</p>
		<p>
			YQL has been publicly available <a href="http://developer.yahoo.net/blog/archives/2008/12/opening_the_web.html">for about a year now</a>, and has been getting steadily more powerful and useful. Not only can you query Yahoo's own services, but <a href="http://developer.yahoo.net/blog/archives/2009/05/yql_open_tables.html">community tables</a> allows anyone to create a table definition for any arbitrary web service. You can use XPath queries to select data from the HTML of an arbitrary web page. It is cool, useful, and above all <em>stable</em>. It is built on top of <a href="http://pipes.yahoo.com/pipes/">Yahoo Pipes</a>, and apparently powers many of Yahoo's own new services now. According to Chris, "if YQL goes down, Yahoo goes down."
		</p>
		<p>
			If you haven't tried it yet, just fire up the <a href="http://developer.yahoo.com/yql/console/">developer console</a> and experiment with some of the sample queries. You don't even need a developer key to get started, and run YQL queries from your own applications.
		</p>
		<ul>
			<li>
				<a href="http://www.wait-till-i.com/2009/11/05/of-hamsters-feature-creatures-and-missed-opportunities-my-talk-at-fronteers-2009/">Slides, talk outline, live audio recording</a>
			</li>
		</ul>
		<h5>
			Building And Maintaining a complex frontend codebase - Martin Savelkoul
		</h5>
		<p>
			<a href="http://www.flickr.com/photos/marvos/4077979207/in/set-72157622616776549"><img src="http://farm3.static.flickr.com/2523/4077979207_44f823231d_m.jpg" class="left" alt="Martin Savelkoul at Fronteers 2009, by Marien van Os" title="Martin Savelkoul at Fronteers 2009, by Marien van Os"></a> Martin spoke about the processes and techniques they use at <a href="http://mirabeau.nl/">Mirabeau</a> for organizing their front-end code to help with things like client hand-overs, version control, and build processes. Everything he talked about was good practice, but none of it was new to me; and the case study he showed wasn't what I would consider "complex."
		</p>
		<h5 style="clear:both;">
			The Future State of Layout - <a href="http://www.the-haystack.com/">Stephen Hay</a>
		</h5>
		<p>
			<a href="http://www.flickr.com/photos/marvos/4078735152/in/set-72157622616776549/"><img src="http://farm4.static.flickr.com/3571/4078735152_a7e8c1f38a_m.jpg" class="left" alt="Stephen Hay at Fronteers 2009, by Marien van Os" title="Stephen Hay at Fronteers 2009, by Marien van Os"></a> Stephen discussed the three competing layout modules currently under consideration for CSS3: <a href="http://www.w3.org/TR/css3-grid/">CSS3-grid</a>, <a href="http://www.w3.org/TR/css3-layout/">CSS3-layout</a>, and <a href="http://dev.w3.org/csswg/css3-flexbox/">CSS3-flexbox</a>. All three of these proposals allow you to specify a layout for your elements in CSS independent of the element source order -- which means no more tedious mucking around with floats and negative margins to implement grid-based page designs.
		</p>
		<p>
			Unfortunately, the only <em>native</em> browser implementation that exists right now is CSS-flexbox in Firefox. There is a <a href="http://code.google.com/p/css-template-layout/">jQuery plugin that implements the CSS3-layout functionality</a>, which is interesting. Stephen seemed to favour this proposal, and I like it, too. Your CSS effectively contains an ascii art representation of what the layout will look like. It's a very visual representation, and is easy to explain and understand. Combined with <a href="http://hacks.mozilla.org/2009/06/media-queries/">CSS3 media queries</a> (different than CSS2 media <em>types</em>), CSS3 layout will completely change how we provide support for multiple resolutions, media, and devices in our sites.
		</p>
		<ul>
			<li>
				<a href="http://www.the-haystack.com/presentations/fronteers09/">Slides: The Future State Of Layout</a>
			</li>
		</ul>
		<h5>
			Understanding JavaScript Testing - <a href="http://ejohn.org/">John Resig</a>
		</h5>
		<p>
			<a href="http://www.flickr.com/photos/marvos/4077981785/in/set-72157622616776549/"><img src="http://farm4.static.flickr.com/3478/4077981785_06ebd89a2b_m.jpg" class="left" alt="John Resig at Fronteers 2009, by Marien van Os" title="John Resig at Fronteers 2009, by Marien van Os"></a> When you talk about <em>JavaScript testing</em>, what you usually mean is testing whether a piece of JavaScript works correctly <em>on a page in a web browser</em>. Does panel <i>A</i> expand when you click button <i>B</i>, for example. You are testing DOM interactions -- with all the cross-browser fun that brings -- as much as the actual algorithms.
		</p>
		<p>
			John noted that there are <em>many</em> JavaScript frameworks available for running unit tests on client-side code: <a href="http://docs.jquery.com/QUnit">QUnit</a>, <a href="http://www.jsunit.net/">JSUnit</a>, <a href="http://developer.yahoo.com/yui/yuitest/">YUITest</a>, etc. He demonstrated that writing such a framework is not even all that hard. What <em>is</em> hard is <a href="http://ejohn.org/blog/javascript-testing-does-not-scale/"><em>scaling</em> this kind of testing</a>. When you have half a dozen major browsers to support, each with potentially dozens of variations, how do you effectively manage your test suite?
		</p>
		<p>
			John has recently been <a href="http://ejohn.org/blog/test-swarm-alpha-open/">working on TestSwarm</a>, a distributed continuous integration JavaScript testing solution. You point a set of clients at a central server, and the server distributes tests for the client to run. At the moment, TestSwarm.com exists to support testing for some of the most popular JavaScript libraries (jQuery, YUI, Dojo, et al.), but you can <a href="http://wiki.github.com/jeresig/testswarm">download the code</a> to run your own server and set up your own swarm of clients to for your own projects.
		</p>
		<ul>
			<li>
				<a href="http://www.slideshare.net/jeresig/understanding-javascript-testing">Slides: Understanding JavaScript Testing</a>
			</li>
		</ul>
		<h5>
			Even Faster Web Sites - <a href="http://stevesouders.com/">Steve Souders</a>
		</h5>
		<p>
			<a href="http://www.flickr.com/photos/marvos/4077982469/in/set-72157622616776549/"><img src="http://farm3.static.flickr.com/2771/4077982469_09c63f4c6d_m.jpg" class="left" alt="Steve Souders at Fronteers 2009, by Marien van Os" title="Steve Souders at Fronteers 2009, by Marien van Os"></a> Steve Souders literally <a href="http://www.amazon.co.uk/gp/product/0596529309?ie=UTF8&amp;tag=legenofthesun-21&amp;linkCode=as2&amp;camp=1634&amp;creative=19450&amp;creativeASIN=0596529309">wrote the book</a> on web site performance. (And its <a href="http://www.amazon.co.uk/gp/product/0596522304?ie=UTF8&amp;tag=legenofthesun-21&amp;linkCode=as2&amp;camp=1634&amp;creative=19450&amp;creativeASIN=0596522304">sequel</a>, too.) He created <a href="http://developer.yahoo.com/yslow/">YSlow</a>, <a href="http://stevesouders.com/hammerhead/">Hammerhead</a>, <a href="http://spriteme.org/">SpriteMe</a>, and writes extensively about performance on his <a href="http://www.stevesouders.com/blog/">blog</a>. Front-end performance is a subject very close to my heart, and I was <em>very</em> excited that he was speaking at Fronteers this year.
		</p>
		<p>
			The theme of his talk was <i>Fast By Default</i>. There is a lot of research and information available that shows how much the perceived speed of a web site depends on front-end performance, and how much of an impact this speed (or lack of it) has on the <a href="http://www.stevesouders.com/blog/2009/10/06/business-impact-of-high-performance/">bottom line</a> for a business. So why don't more businesses spend more time on it? Because it's actually still quite hard.
		</p>
		<p>
			Steve highlighted several tools that can help with this, though. <a href="http://www.aptimize.com/">Aptimize Website Accelerator</a>, for example, is a drop-in software solution that automatically applies optimizations like rolling up multiple JS and CSS files to reduce HTTP requests, minifying and gzipping JS and CSS resources, and spriting of CSS background images. <a href="http://www.webpagetest.org/">WebPageTest.org</a>, a web version of the <a href="http://pagetest.sourceforge.net/">AOL PageTest tool</a>, gives extensive performance statistics and optimization tips for any page you choose to submit. <a href="http://www.showslow.com/">ShowSlow.com</a> uses <a href="http://code.google.com/p/showslow/">showslow</a> to collect and chart YSlow performance statistics over time, so you can see trends for your pages. <a href="http://spriteme.org/">SpriteMe</a>, Steve's own tool, analyzes a web page and gives you ready-made CSS sprites and sample CSS code to optimize your background images.
		</p>
		<p>
			He also talked about progressive rendering, the techniques available for parallel downloading of script resources, and recent innovations in this area, such as <a href="http://googlecode.blogspot.com/2009/09/gmail-for-mobile-html5-series-reducing.html">reducing startup latency</a> by putting script inside <em>comments</em> so that it the code isn't parsed as soon as it is downloaded. Instead, you wait until the code is needed, remove the comment markers (<code>/* */</code>) and <code>eval</code> the whole block.
		</p>
		<ul>
			<li>
				<a href="http://stevesouders.com/docs/fronteers-20091105.pptx">Slides: Even Faster Web Sites</a>
			</li>
		</ul>
		<h4>
			Friday 6 November
		</h4>
		<h5>
			Ajax Security - <a href="http://crockford.com/">Douglas Crockford</a>
		</h5>
		<p>
			<a href="http://www.flickr.com/photos/marvos/4081328176/in/set-72157622616776549/"><img src="http://farm3.static.flickr.com/2536/4081328176_4ccdd6d5e1_m.jpg" class="left" alt="Douglas Crockford at Fronteers 2009, by Marien van Os" title="Douglas Crockford at Fronteers 2009, by Marien van Os"></a> Douglas Crockford really knows how to weave a good narrative. He leads you through important and complex material with the grace of a great storyteller -- his presentations often feel like documentary films. In this one, he talked about Ajax security.
		</p>
		<p>
			The core of the security problem with "Ajax" (using that as a convenient shorthand for third-party script inclusion) is that third-party scripts have the same rights on a page as scripts from the host site. Third-party script can take over the page, and there is no way for the user to know that what they see is not part of the application. If the script is malicious by default, we call this a XSS (cross-site scripting) attack. But even well-intentioned inclusions can turn sour, as <a href="http://www.nytimes.com/2009/09/15/technology/internet/15adco.html">the New York Times found back in September</a>. Basically, as soon as you include third-party script, you <em>give up control of your page</em>. Douglas put it succinctly as follows:
		</p>
		<blockquote cite="http://crockford.com/codecamp/ajaxsecurity.ppt">
			<p>
				A mashup is a self-inflicted XSS attack. (Advertising is a mashup.)
			</p>
		</blockquote>
		<p>
			(Digression: Adverts are the bane of my life. If you want to include banner ads on your site, an ad network will typically give you a piece of JavaScript to insert on your page wherever you want the ad to appear. This JavaScript will typically be some of the most hideously tortuous code you have ever seen. It will reveal a positively Lovecraftian chain of <code>document.write()</code> calls, <code>eval()</code> statements, and nonsensical browser hacks that <em>eventually</em> result in a 2MB Flash file being pulled over a 28.8kbps network connection from somewhere in Kazakhstan. Advert code is the closest thing modern science has to the <a href="http://www.infinityplus.co.uk/stories/blit.htm">Berryman Logical Imaging Technique</a>. I hear that the CIA used to teach terrorist suspects JavaScript just so they could expose them to advert code, and break their wills.)
		</p>
		<p>
			However, it turns out that by adopting an <a href="http://en.wikipedia.org/wiki/Object-capability_model">object-capabilities model</a>, third party scripts can be secured. I didn't understand object capabilities the first time I came across them (at <a href="http://sunpig.com/martin/archives/2007/11/26/atmedia-ajax.html">@media Ajax in 2007</a>), but this presentation made the principles clear. Douglas's <a href="http://www.adsafe.org/">ADSafe</a> defines a <em>safe subset</em> of JavaScript, and an API with which the code can get access to the DOM. The <a href="http://www.jslint.com/">JSLint</a> tool has an ADSafe mode that allows you to statically check a JS file and prove that it conforms.
		</p>
		<p>
			What we need now is for advert publishers to start publishing adverts for the <em>modern web</em>:
		</p>
		<ul>
			<li>Adverts that do not expose our sites to XSS attacks (ADSafe compliant)
			</li>
			<li>Adverts that can be loaded unobtrusively instead of with <code>document.write()</code> calls, so that we we can avoid the performance penalties of inline code (and the hacks we sometimes use to get around them anyway)
			</li>
		</ul>
		<p>
			Unfortunately, site owners are not in a position of power here. The advert publishers have code that "works": so long as you stick to their guidelines, it loads in virtually any browser with JS enabled -- at the expense of performance. They don't own the sites on which the ads appear, so they are not the <em>target</em> of security vulnerabilities. As Douglas put it towards the end of the presentation:
		</p>
		<blockquote cite="http://crockford.com/codecamp/ajaxsecurity.ppt">
			<p>
				The advertising problem is serious. The publishers must go as one to the advertising industry and demand basic standards of ad quality.
			</p>
		</blockquote>
		<p>
			Afterwards, I was chatting with <a href="http://www.windgazer.nl/">Martin Reurings</a> and <a href="http://twitter.com/samfosteriam">Sam Foster</a> about this. One of the options we discussed was creating some kind of action group like the <a href="http://www.webstandards.org/">Web Standards Project (WaSP)</a> to fight for sanity and standards in web adverts.  (Might this even be grounds for another WaSP task force?) This has been going round in my head ever since, and I want to write more about it soon. If you have an interest in this subject, please leave a comment below.
		</p>
		<ul>
			<li>
				<a href="http://crockford.com/codecamp/ajaxsecurity.ppt">Slides: Ajax Security</a>
			</li>
		</ul>
		<h5>
			Using HTML5 Features In IE8 - <a href="http://blogs.msdn.com/petel/">Pete LePage</a>
		</h5>
		<p>
			<a href="http://www.flickr.com/photos/marvos/4080568403/in/set-72157622616776549/"><img src="http://farm4.static.flickr.com/3533/4080568403_fe016b21b1_m.jpg" class="left" alt="Pete LePage at Fronteers 2009, by Marien van Os" title="Pete LePage at Fronteers 2009, by Marien van Os"></a> Pete spoke about some of the features available in IE8 that were not there in previous versions, such as mutable DOM properties, native JSON, and the selectors API. Not all strictly HTML5 features, but hey. He also highlighted the <a href="http://blogs.msdn.com/ie/archive/2009/09/15/supporting-web-standards-development-with-superpreview.aspx">SuperPreview</a> tool (part of the Expression Web suite) that allows you to preview web pages side-by side in various browsers, e.g. Firefox and IE8. It also has the IE6 rendering engine built in to it, so you can even use it to test IE6, IE7, and IE8 on the same machine, without resorting to unsupported hacks. This is very cool, and there is even a free version available (<a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=8e6ac106-525d-45d0-84db-dccff3fae677&amp;displaylang=en">SuperPreview for IE</a>), which is limited to comparing pages in the different versions of IE, but which is still very useful for doing compatibility work.
		</p>
		<ul>
			<li>
				<a href="http://fronteers.nl/_downloads/2009/html5-features-in-ie8.pptx">Slides: Using HTML5 Features in IE8</a>
			</li>
		</ul>
		<h5>
			The Type We Want: Using Fonts On The Web - <a href="http://snook.ca/">Jonathan Snook</a>
		</h5>
		<p>
			<a href="http://www.flickr.com/photos/marvos/4080568939/in/set-72157622616776549/"><img src="http://farm4.static.flickr.com/3494/4080568939_32ac48220a_m.jpg" class="left" alt="Jonathan Snook at Fronteers 2009, by Marien van Os" title="Jonathan Snook at Fronteers 2009, by Marien van Os"></a> Native web fonts are big right now. With the release of Firefox 3.5 earlier in 2009, we have reached a critical mass of browsers that support embedding of fonts with <code>@font-face</code>. Okay, so you have to have the font in several different formats (TTF, EOT, SVG) for it to render in all of the supportable browsers, but at least it's <em>possible</em>. Well, technically, at least. There's still that whole licensing issue.
		</p>
		<p>
			Jonathan has done a lot of <a href="http://snook.ca/archives/html_and_css/becoming-a-font-embedding-master">research into web fonts</a> recently, and in this presentation he took us through all the available options, from text replacement techniques (<a href="http://wiki.novemberborn.net/sifr3/">sIFR</a> and <a href="http://cufon.shoqolate.com/generate/">Cufón</a>), right up to WOFF support in Firefox 3.6. There are many different things to consider to get <code>@font-face</code> fonts to work correctly (and legally) on as many browsers as possible, but the results are lovely. Give it another year or so, and we'll be wondering how we ever built sites without them.
		</p>
		<ul>
			<li>
				<a href="http://www.slideshare.net/jonathansnook/the-type-we-want-2438381">Slides: The Type We Want</a>
			</li>
		</ul>
		<h5>
			The Challenges And Rewards Of Writing A 120K JavaScript Application - Robbert Broersma
		</h5>
		<p>
			<a href="http://www.flickr.com/photos/marvos/4080569407/in/set-72157622616776549/"><img src="http://farm3.static.flickr.com/2610/4080569407_b8b6b2a1a2_m.jpg" class="left" alt="Robbert Broersma at Fronteers 2009, by Marien van Os" title="Robbert Broersma at Fronteers 2009, by Marien van Os"></a> <a href="http://xopus.com/">Xopus</a> make a WYSIWIG XML editor for the web. It's a big application -- more than 120,000 lines of code in about 1,150 files -- and Robbert talked about some of the challenges they have in getting it to perform well. For a user, the responsiveness of the application while typing is crucial: the browser cannot be allowed to freeze up while it is processing keystrokes, and the user must not have to pause typing just to let the browser catch up with what they have done. Xopus therefore makes extensive use of event handling queues, and <a href="http://www.nczonline.net/blog/2009/08/11/timed-array-processing-in-javascript/">chunked processing</a> with <code>setTimeout()</code> calls to keep everything running smoothly.
		</p>
		<h5>
			Roll Your Own Effects Framework - <a href="http://mir.aculo.us/">Thomas Fuchs</a>
		</h5>
		<p>
			<a href="http://www.flickr.com/photos/marvos/4080569779/in/set-72157622616776549/"><img src="http://farm3.static.flickr.com/2697/4080569779_8dd993419f_m.jpg" class="left" alt="Thomas Fuchs at Fronteers 2009, by Marien van Os" title="Thomas Fuchs at Fronteers 2009, by Marien van Os"></a> Thomas Fuchs is the author of the script.aculo.us UI framework. However, for small projects sometimes a library like that can be overkill. So Thomas has developed <a href="http://github.com/madrobby/emile">Émile</a>, a tiny and utterly beautiful library that provides basic but useful animation effects: colour transitions, movement, and easing. And when I say tiny, I really mean <em>tiny</em>. It fits into 50 lines of JavaScript code, and minified and gzipped weighs in at less than 1K.
		</p>
		<p>
			Because it is so small, Thomas was able to guide us through it line-by line in less than an hour. He clearly explained all the principles behind the effects that the library provides, and showed precisely how to implement them all. At each step he showed the problems that could arise, and what he did in code to circumvent them. The Emile library is a delightful piece of tight, elegant code; the presentation itself was a masterpiece of education.
		</p>
		<ul>
			<li>
				<a href="http://mir.aculo.us/2009/11/07/a-50-lines-of-code-javascript-animation-framework-say-hello-to-emile/">Blog Post: A 50 Lines-of-Code JavaScript Animation Framework: Say Hello to Émile</a>
			</li>
			<li>
				<a href="http://script.aculo.us/downloads/emile.pdf">PDF: Roll Your Own JavaScript Effects Framework</a>
			</li>
		</ul>
		<h5>
			Object Oriented CSS - <a href="http://stubbornella.org/">Nicole Sullivan</a>
		</h5>
		<p>
			<a href="http://www.flickr.com/photos/marvos/4080571909/in/set-72157622616776549/"><img src="http://farm3.static.flickr.com/2703/4080571909_7980010cbe_m.jpg" class="left" alt="Nicole Sullivan at Fronteers 2009, by Marien van Os" title="Nicole Sullivan at Fronteers 2009, by Marien van Os"></a> CSS is a funny old thing. I'm starting to think that of the three pillars of modern front-end web development (semantic HTML, unobtrusive JavaScript, and CSS), CSS is actually the hardest to do <em>well</em>.
		</p>
		<p>
			There are many CSS frameworks available that assist in setting up things like grids and typography, and many of these advocate some kind of "modular" approach, though what exactly "modular" means can vary. But all of these approaches are very hard to <em>scale</em> once you get up to sites (or applications) with tens, hundreds, or even thousands of different pages, layouts, or widgets. Knowing how to create cool new CSS3 gradients, rounded corners, and transitions is one thing; making that CSS re-usable, efficient, and maintainable and for a large-scale site is a whole different ball game.
		</p>
		<p>
			Nicole Sullivan reckons that modular CSS -- in this context, taking "modular" to mean CSS specific to a visible block of content on a page -- is fundamentally a mistake. I have often <a href="http://skyscannergeeks.net/2008/10/maintainable-css-modular-to-the-max.html">used</a> exactly such a modular approach specifically to isolate modules from each other: if you want to change the styling of one module, you don't run the risk of screwing up something else. As Nicole points out, however, this approach results in your CSS expanding linearly with the number and complexity of your modules, and does not allow for effective re-use of code, or good design consistency.
		</p>
		<p>
			Object-oriented CSS is an approach that Nicole has been <a href="http://www.stubbornella.org/content/2009/02/12/css-doesn%E2%80%99t-suck-you%E2%80%99re-just-doing-it-wrong/">writing about for some time now</a>. It's a pattern for designing re-usable content modules by making better use of the CSS <em>cascade</em>. It's the cascade, in conjunction with carefully structured HTML, that allows us to use object-oriented techniques like inheritance encapsulation for styling our HTML. To be honest, when I first started reading about OOCSS earlier this year I was skeptical, but I have gradually been coming round to it, and am starting to appreciate its subtlety and usefulness now. I'm not sure if it is the ultimate answer to creating effective CSS, but it is definitely an important piece of the puzzle.
		</p>
		<ul>
			<li>
				<a href="http://www.slideshare.net/stubbornella/the-cascade-grids-headings-and-selectors-from-an-oocss-perspective-ajax-experience-2009">Slides: Object-oriented CSS</a>
			</li>
		</ul>
		<h5>
			The Future Of Web Applications - <a href="http://almaer.com/">Dion Almaer</a> &amp; <a href="http://benzilla.galbraiths.org/">Ben Galbraith</a>
		</h5>
		<p>
			<a href="http://www.flickr.com/photos/marvos/4081331020/in/set-72157622616776549/"><img src="http://farm4.static.flickr.com/3122/4081331020_67f89fcdeb_m.jpg" class="left" alt="Dion Almaer and Ben Galbraith at Fronteers 2009, by Marien van Os" title="Dion Almaer and Ben Galbraith at Fronteers 2009, by Marien van Os"></a> Poor Ben was really sick with the flu, and should have been in bed rather than on stage. But he made it all the way through to the end nonetheless, and they closed the conference with one of their classic inspirational rallies, guaranteed to leave you with a smile on your face and a spring in your step.
		</p>
		<p>
			They talked about all the things that excite them about the future of the web, such as canvas, GPU acceleration, and web workers, which will allow us to build applications that previously would only have been possible as platform native apps. "Mobile" featured heavily, of course, as it did throughout the conference. They are firmly convinced that the future lies with "devices" -- not just mobile phones, but anything outside the traditional PC form factor. And I'm pretty sure they're right.
		</p>
		<p>
			The biggest challenge ahead is going to be keeping "the web" as a flourishing common platform, and not allowing the device space to splinter into incompatible proprietary walled gardens. This isn't a far-future challenge, either -- it's happening <a href="http://dashes.com/anil/2009/11/the-web-in-danger.html">right now</a>.
		</p>
		<h4>
			Wrap-up
		</h4>
		<p>
			Fronteers 2009 was a <em>fantastic</em> conference. The quality of speakers and presentations was great, and the spectrum of technologies they covered was just right. There were plenty of opportunities for chat and networking, and even the lunchtime food was pretty good. (Long queues, but that's only to be expected.) My thanks to all the organizers and volunteers who made it happen: great work, guys. I'll definitely be there again next year.
		</p>]]>
        
	
	
	
    </content>
</entry>

<entry>
	<title>The Heavy - How You Like Me Now?</title>
	<link rel="alternate" type="text/html" href="http://www.sunpig.com/martin/somethingnice/2009/#002220" />	
	
	<id>tag:www.sunpig.com,2009:/martin//18.2220</id>
    
	<published>2009-11-02T22:48:19Z</published>
	<updated>2009-11-02T22:56:46Z</updated>
    
	
	
	<summary>The Heavy - How You Like Me Now? on YouTube. Deliciously funky.  From their album The House That Dirt Built.  Also on MySpace: http://www.myspace.com/theheavy73</summary>
    <author>
        <name>Martin</name>
        <uri>http://www.sunpig.com/martin/</uri>
    </author>
    
    
    <content type="html" xml:lang="en" xml:base="http://www.sunpig.com/martin/">
	
	
	
        <![CDATA[<p><a href="http://www.youtube.com/watch?v=sVzvRsl4rEM">The Heavy - <i>How You Like Me Now?</i></a> on YouTube. Deliciously funky.  From their album <a href="http://www.amazon.co.uk/gp/product/B002GYS1FO?ie=UTF8&tag=legenofthesun-21"><i>The House That Dirt Built</i></a>.  Also on MySpace: <a href="http://www.myspace.com/theheavy73">http://www.myspace.com/theheavy73</a></p>]]>
	
    </content>
</entry>

<entry>
	<title>The developer&apos;s mantra</title>
	<link rel="alternate" type="text/html" href="http://www.sunpig.com/martin/archives/2009/10/20/the-developers-mantra.html" />	
	
	<id>tag:www.sunpig.com,2009:/martin//2.2219</id>
    
	<published>2009-10-20T21:15:27Z</published>
	<updated>2009-10-21T07:49:47Z</updated>
    
	<summary>I&apos;d like you to take the time to learn the developer&apos;s mantra: The Tester is always right. I will listen to the Tester. I will not ignore the Tester&apos;s bug reports. The Tester is god. And, if this ever happens again, the Tester will personally rip your lungs out. This...</summary>
	
	
    <author>
        <name>Martin</name>
        <uri>http://www.sunpig.com/martin/</uri>
    </author>
    
        <category term="Development" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="Techie" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="abi" label="abi" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="babylon5" label="babylon 5" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="development" label="development" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="ivanova" label="ivanova" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="mantra" label="mantra" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="scifi" label="sci-fi" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="sf" label="sf" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="software" label="software" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="testing" label="testing" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://www.sunpig.com/martin/">
	
        <![CDATA[<p>I'd like you to take the time to learn the developer's mantra:</p>

<blockquote>
<p>The Tester is always right. I will listen to the Tester. I will not ignore the Tester's bug reports. The Tester is god. And, if this ever happens again, the Tester will personally <em>rip your lungs out</em>.</p>
</blockquote>

<p>This comes courtesy of <a href="http://sunpig.com/abi/">Abi</a>, who subverted the <a href="http://en.wikipedia.org/wiki/Babylon_5">Babylon 5</a> <a href="http://en.wikiquote.org/wiki/Babylon_5#A_Voice_in_the_Wilderness.2C_Part_1">mantra</a> for the purposes of educating inexperienced developers.</p>

<p class="center"><img class="center" src="http://sunpig.com/martin/images/2009/10/master-and-commander.jpg" alt="Ivanova and Sutherland" title="Ivanova and Sutherland" /></p>

<p class="center"><object width="340" height="285"><param name="movie" value="http://www.youtube.com/v/7xO9Vr_nBE8&hl=en&fs=1&border=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/7xO9Vr_nBE8&hl=en&fs=1&border=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="340" height="285"></embed></object></p>]]>
        
	
	
	
    </content>
</entry>

<entry>
	<title>Neko Case at Paradiso, Amsterdam, 19 Sep 2009</title>
	<link rel="alternate" type="text/html" href="http://www.sunpig.com/martin/archives/2009/10/11/neko-case-at-paradiso-amsterdam-19-sep-2009.html" />	
	
	<id>tag:www.sunpig.com,2009:/martin//2.2218</id>
    
	<published>2009-10-11T11:01:07Z</published>
	<updated>2009-10-11T10:12:18Z</updated>
    
	<summary>I was somewhat miffed when I discovered that Neko Case was playing Amsterdam in February this year by checking her web site a few days after the intended gig, and finding that she had had to cancel it because of an illness. On the one hand, I had missed seeing...</summary>
	
	
    <author>
        <name>Martin</name>
        <uri>http://www.sunpig.com/martin/</uri>
    </author>
    
        <category term="Music" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en" xml:base="http://www.sunpig.com/martin/">
	
        <![CDATA[<p><a href="http://nekocase.com/"><img class="left" src="http://sunpig.com/martin/images/2009/10/middlecyclone.jpg" alt="Middle Cyclone album cover" title="Middle Cyclone album cover" /></a>I was <em>somewhat</em> miffed when I discovered that <a href="http://www.nekocase.com/">Neko Case</a> was playing Amsterdam in February this year by checking her web site a few days after the intended gig, and finding that she had had to cancel it because of an illness. On the one hand, I had missed seeing her; but on the other hand I would have missed seeing her anyway. Hmm.</p> 

<p>Fortunately, her autumn tour brought her back to the Netherlands, where she played <a href="http://www.paradiso.nl/">Paradiso</a> on Saturday 19th September. Abi and I managed to wangle babysitting for the evening, so we could both go.  It was a lovely Saturday, and we cycled in to town and had a burger at <a href="http://www.burgermeester.eu/">Burgermeester</a> before the gig.  We had a delightful evening, but as concerts go it wasn't that great.</p>

<p>Although Neko was in fine voice, she looked tired and unhappy. Kelly Hogan, the second vocalist in the band, did all the talking between songs, occasionally throwing a line to Neko only to be rebuffed with a shrug.  It was only towards the end of the set, when the end was in sight, that she even cracked a smile and started to engage a little with the audience.  I know that she had had to cancel at least one gig earlier this tour because of illness (Edinburgh), so it's possible she still wasn't feeling right. However, the overall vibe I got from the stage was aloof and reluctant, which was disappointing.</p>

<p>Having said that, the actual performance was good.  Neko's voice is one of the modern wonders of the world, and Kelly Hogan's provides a great accompaniment. The band was clearly comfortable playing together, and <a href="http://www.jonrauhouse.com/">Jon Rauhause</a>, hunched in intense concentration over his banjo and steel guitar, was a special treat.</p>

<p>They played through most of the new album <i>Middle Cyclone</i> and a helping of favourites from earlier albums. "<a href="http://www.nekocase.com/downloads/maybe_sparrow.html">Maybe Sparrow</a>" was a definite crowd-pleaser early on, but the songs from <i>Blacklisted</i> were the ones I liked best, with "I Wish I Was The Moon" in the middle of the set being my personal highlight.  It seemed to me that "The Train From Kansas City" right at the very end was where the band really seemed to shake loose and enjoy themselves the most.  It's just a pity that they didn't light up earlier on.</p>

<img src="http://sunpig.com/martin/images/2009/10/nekocase_eutour_fall2009.jpg" class="center" alt="Neko Case European Tour Fall 2009 Print"  title="Neko Case European Tour Fall 2009 Print" />

<h4>Set list:</h4>

<ol>
<li>Things That Scare Me (<i><abbr title="Blacklisted">BL</abbr></i>)</li>
<li>Maybe Sparrow (<i><abbr title="Fox Confessor Brings The Flood">FCBTF</abbr></i>)</li>
<li>People Got A Lotta Nerve (<i><abbr title="Middle Cyclone">MC</abbr></i>)</li>
<li>Fever (<i><abbr title="Middle Cyclone">MC</abbr></i>)</li>
<li>Hold On, Hold On (<i><abbr title="Fox Confessor Brings The Flood">FCBTF</abbr></i>)</li>
<li>I'm An Animal (<i><abbr title="Middle Cyclone">MC</abbr></i>)</li>
<li>Middle Cyclone (<i><abbr title="Middle Cyclone">MC</abbr></i>)</li>
<li>The Pharaohs (<i><abbr title="Middle Cyclone">MC</abbr></i>)</li>
<li>Margaret vs. Pauline (<i><abbr title="Fox Confessor Brings The Flood">FCBTF</abbr></i>)</li>
<li>Deep Red Bells (<i><abbr title="Blacklisted">BL</abbr></i>)</li>
<li>I Wish I Was The Moon (<i><abbr title="Blacklisted">BL</abbr></i>)</li>
<li>Polar Nettles (<i><abbr title="Middle Cyclone">MC</abbr></i>)</li>
<li>Red Tide (<i><abbr title="Middle Cyclone">MC</abbr></i>)</li>
<li>Prison Girls (<i><abbr title="Middle Cyclone">MC</abbr></i>)</li>
<li>The Tigers Have Spoken (<i><abbr title="The Tigers Have Spoken">TTHS</abbr></i>)</li>
<li>Alimony (Harry Nilsson cover)</li>
<li>That Teenage Feeling (<i><abbr title="Fox Confessor Brings The Flood">FCBTF</abbr></i>)</li>
<li>This Tornado Loves You (<i><abbr title="Middle Cyclone">MC</abbr></i>)</li>
</ol>

<p>Encore:</p>

<ol>
<li value="19">Vengeance Is Sleeping (<i><abbr title="Middle Cyclone">MC</abbr></i>)</li>
<li>Never Turn Your Back On Mother Earth (<i><abbr title="Middle Cyclone">MC</abbr></i>)</li>
<li>Train From Kansas City (<i><abbr title="The Tigers Have Spoken">TTHS</abbr></i>)</li>
</ol>

<p><abbr title="Middle Cyclone">MC</abbr> = <i>Middle Cyclone</i>, <abbr title="Fox Confessor Brings The Flood">FCBTF</abbr> = <i>Fox Confessor Brings The Flood</i>, <abbr title="Blacklisted">BL</abbr> = <i>Blacklisted</i>, <abbr title="The Tigers Have Spoken">TTHS</abbr> = <i>The Tigers Have Spoken</i></p>]]>
        
	
	
	
    </content>
</entry>

</feed>