<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="http://feeds.feedburner.com/~d/styles/atom10full.xsl" type="text/xsl" media="screen"?><?xml-stylesheet href="http://feeds.feedburner.com/~d/styles/itemcontent.css" type="text/css" media="screen"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en"><title type="text">Solitude</title><link rel="alternate" type="text/html" href="http://solitude.vkps.co.uk" /><subtitle type="text">Technology. Code. Living relentlessly in the real world.</subtitle><updated>2008-10-11T09:10:06+00:00</updated><generator uri="http://wordpress.org/">WordPress</generator><id>http://solitude.vkps.co.uk/feed/atom/</id><link rel="self" href="http://feeds.feedburner.com/solitudevkps" type="application/atom+xml" /><entry><title type="html">Pre-merge Logs in SVN</title><link rel="alternate" type="text/html" href="http://solitude.vkps.co.uk/Archives/2008/10/11/pre-merge-logs/" /><category term="Uncategorized" /><author><name>Gary Fleming</name><uri>http://solitude.vkps.co.uk</uri></author><updated>2008-10-11T04:10:06-05:00</updated><id>http://solitude.vkps.co.uk/?p=669</id><summary type="html">Any time, after a little to long on a branch, that I go to merge back to trunk, I seem to forget the magic steps involved in making this easy. For my own reference, tag the head of the branch and then:


svn log http://example.com/url/to/branch --stop-on-copy


&amp;#8230; will get us the revision that the branch happened from. [...]</summary><content type="html" xml:base="http://solitude.vkps.co.uk/Archives/2008/10/11/pre-merge-logs/">&lt;p&gt;Any time, after a little to long on a branch, that I go to merge back to trunk, I seem to forget the magic steps involved in making this easy. For my own reference, tag the head of the branch and then:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;
&lt;pre&gt;
svn log http://example.com/url/to/branch --stop-on-copy
&lt;/pre&gt;
&lt;p&gt;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&amp;#8230; will get us the revision that the branch happened from. Let&amp;#8217;s say it&amp;#8217;s 27101.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;
&lt;pre&gt;
svn diff -r27101:HEAD http://example.com/url/to/branch --summarize
&lt;/pre&gt;
&lt;p&gt;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&amp;#8230; will let us know of all the files that have changed between that revision and the head of the branch.&lt;/p&gt;
&lt;p&gt;Then you&amp;#8217;re free to take a trunk check-out and do a merge with full knowledge of what&amp;#8217;s happened.&lt;/p&gt;
</content><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></entry><entry><title type="html">Film Fight: September 2008</title><link rel="alternate" type="text/html" href="http://solitude.vkps.co.uk/Archives/2008/10/05/film-fight-september-2008/" /><category term="Uncategorized" /><author><name>Gary Fleming</name><uri>http://solitude.vkps.co.uk</uri></author><updated>2008-10-04T16:08:26-05:00</updated><id>http://solitude.vkps.co.uk/?p=664</id><summary type="html">Unlike last month&amp;#8217;s quiet patch, this month there are 6 films to take in.
The Wackness is about a teenage drug dealer and his psychiatrist becoming friends and going over the edge. The relationship that grows between the two leads is well handled, seeming genuine for the most part, but the same cannot be said for [...]</summary><content type="html" xml:base="http://solitude.vkps.co.uk/Archives/2008/10/05/film-fight-september-2008/">&lt;p&gt;Unlike last month&amp;#8217;s quiet patch, this month there are 6 films to take in.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The Wackness&lt;/strong&gt; is about a teenage drug dealer and his psychiatrist becoming friends and going over the edge. The relationship that grows between the two leads is well handled, seeming genuine for the most part, but the same cannot be said for the somewhat forced love story between the teenager and the psychiatrist&amp;#8217;s daughter. The dialogue throughout is excruciating (it&amp;#8217;s supposed to be the nineties, so we get all kinds of street lingo), but there are some true horrors uttered between these two. Ben Kingsley excels as the psychiatrist but away from that there&amp;#8217;s just not all that much to see here. A fairly average film.&lt;/p&gt;
&lt;p&gt;The lack of decent US horror movies continues with the amazingly lacklustre yawn-fest, &lt;strong&gt;The Strangers&lt;/strong&gt;. There&amp;#8217;s nothing new or particularly well-done about this movie, taking in an alone-in-a-cabin plot and eventually getting to a pretty weak torture set-up towards the end. There&amp;#8217;s little to like here, with the only notable moments being the (predictable) arrival of a familiar face going wrong and some of the character set-up in the first act. After that, it was uninspired drudge.&lt;/p&gt;
&lt;p&gt;Seth Rogen and Evan Goldberg have made another great comedy in &lt;strong&gt;Pineapple Express&lt;/strong&gt;, the story of a dealer and one of his customers (Rogen) who are forced to go on the run after witnessing a brutal murder; not the most obvious set-up for a light and wacky comedy. The writers largely avoid a lot of the more obvious and moronic drug references and instead get into some great dialogue (Danny McBride has some of the best lines) and over-the-top, violent, physical comedy. It looked like the trailer would have the majority of the scenarios in it, but this is not the case, with near enough end-to-end laughs. A great (if not classic) comedy.&lt;/p&gt;
&lt;p&gt;It&amp;#8217;s courted a lot of controversy for it&amp;#8217;s use of Robert Downey Jr. doing a minstrel show and the heavy mocking of the mentally handicapped, but can &lt;strong&gt;Tropic Thunder&lt;/strong&gt; deliver as a comedy? The answer is: not particularly. Sure, it has some very funny moments (Downey Jr. provides most of these, with Danny McBride again bringing impeccable timing) but the whole thing feels quite like a place-holder. The plot is there to hold together some scenarios they writers had built up, but doesn&amp;#8217;t tell a compelling story. In the face of the far superior Pineapple Express, this suffers as another cheap-and-easy comedy. That&amp;#8217;s not to say it lacks any merit, but it&amp;#8217;s not a first choice.&lt;/p&gt;
&lt;p&gt;Could a fascist (autocratic) regime rise once again? That&amp;#8217;s the question that German-film, &lt;strong&gt;The Wave&lt;/strong&gt;, asks. Based on a required reading book in Germany, the story is that of a teacher who, during project week, builds a cult to show that anything is possible if you&amp;#8217;re not careful. We see a wide range of points-of-view, from the outraged to the the subsumed, all of which add a little extra. It&amp;#8217;s got a strong message, but falls down on depth: there are too many ideas here and not enough time to develop them, and those previously mentioned views don&amp;#8217;t go into as much detail as we might like. Ultimately, it&amp;#8217;s a good movie, but could have done with a bit of script editing to give it cleaner focus.&lt;/p&gt;
&lt;p&gt;Finally, &lt;strong&gt;Taken&lt;/strong&gt; is a fairly simple movie done extremely well. A man, who we soon learn is an extremely well-trained solder/agent, finds that his daughter who is holidaying in Paris has been kidnapped. Despite a fairly simple progression (the man hunts his daughter&amp;#8217;s kidnappers in as vicious a manner as you can imagine), it&amp;#8217;s surprisingly good. We see some excellently choreographed fight and action sequences, we see some well-directed and succinct storytelling, and just enough background for it to be somewhat believable. An over-long ending and odd pop singer subplot aside, this is a lean cut of action-thriller. Very good.&lt;/p&gt;
&lt;p&gt;The winner for September is a bit of a toss-up. Pineapple Express is excellent, but I think &lt;strong&gt;Taken&lt;/strong&gt; is slightly stronger, though both are very good in their respective genres&lt;/p&gt;
</content><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></entry><entry><title type="html">Film Fight: August 2008</title><link rel="alternate" type="text/html" href="http://solitude.vkps.co.uk/Archives/2008/10/03/film-fight-august-2008/" /><category term="Uncategorized" /><author><name>Gary Fleming</name><uri>http://solitude.vkps.co.uk</uri></author><updated>2008-10-03T12:07:29-05:00</updated><id>http://solitude.vkps.co.uk/?p=662</id><summary type="html">Yes, it&amp;#8217;s quite late again, which is surprising given there are only three films. Let&amp;#8217;s see how they get on.
First up is Get Smart, the story of a bumbling agent in a hand-wavingly explained government spy agency. Ostensibly a comedy, the director manages to fumble the fundamentals with the film suffering from poorly explained sequences, [...]</summary><content type="html" xml:base="http://solitude.vkps.co.uk/Archives/2008/10/03/film-fight-august-2008/">&lt;p&gt;Yes, it&amp;#8217;s quite late again, which is surprising given there are only three films. Let&amp;#8217;s see how they get on.&lt;/p&gt;
&lt;p&gt;First up is &lt;strong&gt;Get Smart&lt;/strong&gt;, the story of a bumbling agent in a hand-wavingly explained government spy agency. Ostensibly a comedy, the director manages to fumble the fundamentals with the film suffering from poorly explained sequences, predictability, an over-reliance on slapstick and poor stereotypes. There are funny moments in there (such as the brief fighter jet segment) and the cast (the otherwise excellent Steve Carrell and Alan Arkin) do their best, but there&amp;#8217;s simply not much here. A shame.&lt;/p&gt;
&lt;p&gt;Shane Meadows has created some of the finest moments in recent British cinema, from Dead Man&amp;#8217;s Shoes bleak and grimy revenge story to This Is England&amp;#8217;s look at hooliganism and growing up around the wrong people. Unfortunately his run seems to have run out with &lt;strong&gt;Somers Town&lt;/strong&gt;, the story of a boy who has run away to London and befriends a Polish immigrant. Ignoring the pretty obvious shoe-horning of adverts into the work, the plot and characters really lack any depth. The relationships seem hollow and forced, and nothing comes across as natural. Worse, the story really doesn&amp;#8217;t go anywhere, with a painful happy ending tacked in rather than dealing with any of the issues raised early on. Had the film focussed on the relationship between the Polish boy and his father, and their lives in London, then maybe it could have done something, but this cut shows the film as shallow; a real pity.&lt;/p&gt;
&lt;p&gt;Finally, &lt;strong&gt;Step Brothers&lt;/strong&gt; sees Will Ferrell reunite with collaborator John C. Reilly as two 40-year old brats who still live with their now-married parents. The problem here is that there are very few jokes or funny moments and they almost all extend from this one premise, making the film feel a bit of a one-note wonder. Sure, there are some very funny bits (the wife of Ferrell&amp;#8217;s brother is particularly good) but there&amp;#8217;s also a lot of dead weight and barely thought out ideas. Still worth seeing, but not up to previous films that duo have worked on together.&lt;/p&gt;
&lt;p&gt;So, it&amp;#8217;s a bit of a weak recommendation but the winner is &lt;strong&gt;Step Brothers&lt;/strong&gt;.&lt;/p&gt;
</content><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></entry><entry><title type="html">Film Fight: July 2008</title><link rel="alternate" type="text/html" href="http://solitude.vkps.co.uk/Archives/2008/08/23/film-fight-july-2008/" /><category term="Uncategorized" /><category term="Film Fight 2008" /><author><name>Gary Fleming</name><uri>http://solitude.vkps.co.uk</uri></author><updated>2008-08-23T09:35:02-05:00</updated><id>http://solitude.vkps.co.uk/?p=656</id><summary type="html">Only 4 films this month:
First up is Frank Darabont&amp;#8217;s take on Stephen King&amp;#8217;s The Mist. Amongst filmed versions of King&amp;#8217;s work, it ranks amongst the most subtle and controlled pieces. Rather than explicitly showing everything that happened (creatures coming from another dimension and covering the world in a deep fog) and giving us another brainless [...]</summary><content type="html" xml:base="http://solitude.vkps.co.uk/Archives/2008/08/23/film-fight-july-2008/">&lt;p&gt;Only 4 films this month:&lt;/p&gt;
&lt;p&gt;First up is Frank Darabont&amp;#8217;s take on Stephen King&amp;#8217;s &lt;strong&gt;The Mist&lt;/strong&gt;. Amongst filmed versions of King&amp;#8217;s work, it ranks amongst the most subtle and controlled pieces. Rather than explicitly showing everything that happened (creatures coming from another dimension and covering the world in a deep fog) and giving us another brainless monster/horror piece, Darabont has focussed on the real heart of the story: the tension between believers and non-believers, through a fairly cunningly chosen bunch of set-pieces. Slowly, different fears and prejudices seep through a group trapped in a supermarket until they inevitably turn on one another. The way this is done is masterful, and the climax is pretty heartbreaking, cheapened only slightly by an unnecessary denouement. The characters themselves are fairly one-dimensional, but that&amp;#8217;s the point: they&amp;#8217;re only aspects of ourselves. Very strong, subtle film-making, though perhaps a shade on the long side. Recommended.&lt;/p&gt;
&lt;p&gt;Jack Black continues to dominate Hollywood, moving into animated shenanigans with &lt;strong&gt;Kung-Fu Panda&lt;/strong&gt;, the story of a martial arts-obsessed panda who becomes entangled in a years old grudge match to become the best at kung-fu. It&amp;#8217;s happy enough, has plenty of laughs, and neat pieces, but is let down by a fairly mediocre performance by the titular character. Black is doing a watered down version of his normal schtick, without really emoting. He&amp;#8217;s a great presence, but not much of a voice actor. Still, there&amp;#8217;s enough in the film to make it watchable and even enjoyable.&lt;/p&gt;
&lt;p&gt;Pixar, on the other hand, are a powerhouse of animated movies and their latest release, &lt;strong&gt;Wall-E&lt;/strong&gt;, is no exception. This story of a lonely robot and his first love is set against the backdrop of environmental disaster, and humanity&amp;#8217;s laziness. Suffice to say it all works out the way you&amp;#8217;d expect, but the story is still worthwhile. More interesting is the style in which the story is told: almost no dialogue, beautiful animation and lots of brilliant realised characters. While it doesn&amp;#8217;t go into great depth on any of the key themes, something that is to be expected from a kid&amp;#8217;s film, it is a great story and well told. Another hit for Pixar.&lt;/p&gt;
&lt;p&gt;Finally, Christopher Nolan continues to redefine the superhero genre in &lt;strong&gt;The Dark Knight&lt;/strong&gt;. I&amp;#8217;ve discussed this film more than any other in recent memory and I agree with the pervading feeling: it&amp;#8217;s extremely good. Heath Ledger is incredible as the Joker, the tone is well set, the cinematography is exceptional, and it&amp;#8217;s a thoroughly enjoyable film. That said, it&amp;#8217;s not without flaws. Most notable is the burgeoning length and lack of clear focus. Building up Harvey Dent for the fall to become Two-Face was necessary, but then cramming so much of the character into the back half of the movie? It felt forced and pushed the film longer than it could comfortably sustain; that strand could and should have been picked up in the next part of the series. There&amp;#8217;s plenty of other cuts that could be made: most of the cast being rendered mere scenery compared to the scene-stealing joker. I could go on (and have in conversation) with list of problems with the movie, but ultimately I enjoyed it, and thought it was a compelling piece of film-making. I recommend it highly.&lt;/p&gt;
&lt;p&gt;I&amp;#8217;m a little torn for this months&amp;#8217; winner: should it be a subtle horror movie, a brilliant but light story, or a flawed but enjoyable blockbuster? They&amp;#8217;re all great films, but I think it&amp;#8217;s going to be &lt;strong&gt;The Dark Knight&lt;/strong&gt;, largely due to Ledger&amp;#8217;s perfectly-pitched attempt at the classic Joker character.&lt;/p&gt;
</content><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></entry><entry><title type="html">Fixing a Gap in Javascript</title><link rel="alternate" type="text/html" href="http://solitude.vkps.co.uk/Archives/2008/08/19/fixing-a-gap-in-javascript/" /><category term="Uncategorized" /><category term="Code" /><category term="Javascript" /><category term="Tutorial" /><author><name>Gary Fleming</name><uri>http://solitude.vkps.co.uk</uri></author><updated>2008-08-18T18:13:25-05:00</updated><id>http://solitude.vkps.co.uk/?p=654</id><summary type="html">An interesting problem: a bunch of Struts Nested tags generate HTML. Separately, we write some Javascript that makes use of getElementById() to find some of the generated elements. This works in Internet Explorer, but fails miserably in FireFox. Why?
Well, it turns out that Struts Nested tags generate elements that have a name attribute but not [...]</summary><content type="html" xml:base="http://solitude.vkps.co.uk/Archives/2008/08/19/fixing-a-gap-in-javascript/">&lt;p&gt;An interesting problem: a bunch of &lt;a href="http://struts.apache.org/1.2.8/userGuide/dev_nested.html"&gt;Struts Nested&lt;/a&gt; tags generate HTML. Separately, we write some Javascript that makes use of &lt;code&gt;getElementById()&lt;/code&gt; to find some of the generated elements. This works in Internet Explorer, but fails miserably in &lt;a href="http://www.mozilla.com/firefox/"&gt;FireFox&lt;/a&gt;. Why?&lt;/p&gt;
&lt;p&gt;Well, it turns out that Struts Nested tags generate elements that have a &lt;code&gt;name&lt;/code&gt; attribute but not an &lt;code&gt;id&lt;/code&gt;. Separately, IE actually does the wrong thing with &lt;code&gt;getElementById()&lt;/code&gt;: if a search by id fails, it will try to match by name; that&amp;#8217;s fundamentally broken. It&amp;#8217;d be fine if a bunch of libraries and other functions didn&amp;#8217;t prefer the use of ids, and if other browsers did the same thing. They don&amp;#8217;t and we&amp;#8217;re stuck with the mess. Let&amp;#8217;s clean it up.&lt;/p&gt;
&lt;p&gt;The right thing to do would be to &lt;a href="http://www.sixteensmallstones.org/ie-javascript-bugs-overriding-internet-explorers-documentgetelementbyid-to-be-w3c-compliant-exposes-an-additional-bug-in-getattributes"&gt;cripple the IE version into the correct behaviour&lt;/a&gt;. Now everyone agrees on what should happen.&lt;/p&gt;
&lt;p&gt;Let&amp;#8217;s assume, though, that this isn&amp;#8217;t possible, that there&amp;#8217;s a large dependency on this behaviour that cannot be changed for whatever reason: no access to the JS, unwieldy codebase that we don&amp;#8217;t have time to fix straight away (bad!), or something else. It&amp;#8217;s not really that important. If you need to go for the wrong solution, here&amp;#8217;s how:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;
&lt;pre&gt;
document.nativeGetById = document.getElementById;
document.getElementById = function(id){
  var el = document.nativeGetById(id);
  if(el == null){
    el = document.getElementsByName(id)[0];
    if(el != null){el.id=id;}
  }
  return el;
}
&lt;/pre&gt;
&lt;p&gt;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;That&amp;#8217;ll work and it&amp;#8217;ll even make sure subsequent calls use the native version of the function for extra speed. Now, there are a couple of small issues with this function and some pretty obvious optimisations, but I&amp;#8217;ll leave that as an exercise for the reader.&lt;/p&gt;
</content><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></entry><entry><title type="html">Neater Java</title><link rel="alternate" type="text/html" href="http://solitude.vkps.co.uk/Archives/2008/08/12/neater-java/" /><category term="Uncategorized" /><author><name>Gary Fleming</name><uri>http://solitude.vkps.co.uk</uri></author><updated>2008-08-12T02:13:01-05:00</updated><id>http://solitude.vkps.co.uk/?p=650</id><summary type="html">In Java 5, as all good Java developers will know, Sun introduced the enum type. Since I&amp;#8217;m sure anyone who is interested in what will follow knows that already, I won&amp;#8217;t bore you with the details but there&amp;#8217;s some decent historical information on Sun&amp;#8217;s reasons available. I&amp;#8217;m going to be talking a little bit about [...]</summary><content type="html" xml:base="http://solitude.vkps.co.uk/Archives/2008/08/12/neater-java/">&lt;p&gt;In Java 5, as all good Java developers will know, Sun introduced the &lt;code&gt;enum&lt;/code&gt; type. Since I&amp;#8217;m sure anyone who is interested in what will follow knows that already, I won&amp;#8217;t bore you with the details but there&amp;#8217;s some decent &lt;a href="http://java.sun.com/j2se/1.5.0/docs/guide/language/enums.html"&gt;historical information on Sun&amp;#8217;s reasons&lt;/a&gt; available. I&amp;#8217;m going to be talking a little bit about operations on enums, so let&amp;#8217;s get started by defining one:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;
&lt;pre&gt;public enum OrderState{
PENDING, CHECKING_CREDIT, PROCESSING, SHIPPED, RECEIVED, CANCELLED, RETURNED
}&lt;/pre&gt;
&lt;p&gt;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Each of those items in the enumeration represent some state that an order can be in; an order being anything you can buy from an online store. We&amp;#8217;re also going to have a variable called &lt;code&gt;currentState&lt;/code&gt; which will hold one of these enumerated items. Let&amp;#8217;s not think too hard about how accurate the model is, it&amp;#8217;s really just there as a simple example.&lt;/p&gt;
&lt;p&gt;Now imagine that one of our requirements is to enable a button if the currentState is one of several possible states, but not in any other state. For example, the &amp;#8220;Cancel&amp;#8221; button is enabled while the current state is &lt;code&gt;PENDING&lt;/code&gt;, &lt;code&gt;PROCESSING&lt;/code&gt;, or &lt;code&gt;CHECKING_CREDIT&lt;/code&gt;. We&amp;#8217;re doing a containment check, a pretty common operation. The standard Java approach would be:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;
&lt;pre&gt;if(currentState.equals(Order_State.PENDING)|| currentState.equals(Order_State.PROCESSING)|| currentState.equals(Order_State.CHECKING_CREDIT)){
    cancelButton.enable();
}&lt;/pre&gt;
&lt;p&gt;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Yuck! It gets the job done but that is some verbose and ugly code. We know that there&amp;#8217;s got to be a better way, and there is: the &lt;a href="http://java.sun.com/j2se/1.5.0/docs/api/java/util/EnumSet.html"&gt;EnumSet&lt;/a&gt; class. EnumSet is a somewhat overlooked Set implementation, specifically for grouping together items from the same Enum. I&amp;#8217;ll let you look into the details of the API, but there are some very handy methods, such as &lt;code&gt;range()&lt;/code&gt; and &lt;code&gt;complementOf()&lt;/code&gt;. As a bonus, they&amp;#8217;re also very efficient. How would our example look using an EnumSet?&lt;/p&gt;
&lt;p&gt;&lt;code&gt;
&lt;pre&gt;if(EnumSet.of(Order_State.PENDING, Order_State.PROCESSING, Order_State.CHECKING_CREDIT).contains(currentState)){
    cancelButton.enable();
}&lt;/pre&gt;
&lt;p&gt;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;That&amp;#8217;s much better. Rather than a bunch of ORs that look disconnected and have a lot of repeated syntax, we state pretty clearly what we want: build a set of states, and then see whether the current state is part of that set.&lt;/p&gt;
&lt;p&gt;There is another neater way of doing this, purely in terms of how syntactically nice it looks, though it requires a little helper function in the Enum. Add the following &lt;code&gt;in()&lt;/code&gt; method directly to the Enum type:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;
&lt;pre&gt;public boolean in(Order_State... args){
    return EnumSet.copyOf(Arrays.asList(args)).contains(this);
}&lt;/pre&gt;
&lt;p&gt;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Now, we can do our contains check like this:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;
&lt;pre&gt;if(currentState.in(Order_State.PENDING, Order_State.PROCESSING, Order_State.CHECKING_CREDIT)){
    cancelButton.enable();
}&lt;/pre&gt;
&lt;p&gt;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Very tidy: we&amp;#8217;ve got a single method call that expresses exactly what we&amp;#8217;re aiming for in a fluent manner. Now, it does have it&amp;#8217;s downsides like the helper function in the enum, and the fact that EnumSet is more efficient. I&amp;#8217;d suggest, though, that in 99% of cases you&amp;#8217;re not going to be caring about those few extra nanoseconds required to convert to a List first, and that the few seconds of developer time you save every time someone has to read and understand each version more than makes up for it.&lt;/p&gt;
</content><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">1</thr:total></entry><entry><title type="html">Postcode Lookups Suck</title><link rel="alternate" type="text/html" href="http://solitude.vkps.co.uk/Archives/2008/07/20/postcode-lookups-suck/" /><category term="Uncategorized" /><author><name>Gary Fleming</name><uri>http://solitude.vkps.co.uk</uri></author><updated>2008-07-20T13:07:34-05:00</updated><id>http://solitude.vkps.co.uk/?p=643</id><summary type="html">Websites which have address forms for UK residences, whether for buying new products, paying bills or registering interest, I have a simple request: do not presume your database knows my address better than me.
For the benefit of non-UK readers, let me explain. The UK has a system originally designed for mail delivery called the Postcode, [...]</summary><content type="html" xml:base="http://solitude.vkps.co.uk/Archives/2008/07/20/postcode-lookups-suck/">&lt;p&gt;Websites which have address forms for UK residences, whether for buying new products, paying bills or registering interest, I have a simple request: do not presume your database knows my address better than me.&lt;/p&gt;
&lt;p&gt;For the benefit of non-UK readers, let me explain. The UK has a system originally designed for mail delivery called the Postcode, which is similar to the US zip code system. Unlike zip codes, it&amp;#8217;s far more granular, generally resolving to a handful of addresses. In fact, most of the time, if you have a post code and house number, you can uniquely identify a particular delivery address. That&amp;#8217;s all that is needed: a &lt;strong&gt;G1 4BQ&lt;/strong&gt; and a &lt;strong&gt;35&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;In 7 characters, most people can be readily identified. That&amp;#8217;s the &lt;a href="http://puffbox.com/2008/06/23/the-power-of-postcodes/"&gt;power of postcodes&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;A lot of UK websites take this as an absolute fact with no room for error. They take the data from the Post Office, see that it works for them, and forget about it. You either fit the pattern, or your house doesn&amp;#8217;t exist. I&amp;#8217;m sure you can see where I&amp;#8217;m going with this.&lt;/p&gt;
&lt;p&gt;One big problem is that large parts of the UK have some form of communal housing: tenement blocks, modern apartment blocks, high-rises etc. This is where things break down. As well as having a house number (the 35 above), they will also have a flat number like 3/2 (floor 3, flat 2), 4D (floor 4, flat D) or any other variation on the above. This is where things get very hairy:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Most post-code lookup systems will offer you a list of possible matches, which often miss some of the variations. That&amp;#8217;s incomplete reference data.&lt;/li&gt;
&lt;li&gt;Most post-code lookup systems are never given updated data (compile once and you&amp;#8217;re done). That&amp;#8217;s poor data management.&lt;/li&gt;
&lt;li&gt;Most post-code lookup systems don&amp;#8217;t allow for changes to addresses. That&amp;#8217;s, again, poor data management.&lt;/li&gt;
&lt;li&gt;Most systems don&amp;#8217;t allow for even more complex forms, where a flat has a house number (35, two part flat number (3/2), and a block number (D); the combinations of these can come in endless forms (D3/2, 35 Example St vs. Flat 2, Floor 3, Block D, 35 Example St).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Most systems will fall flat in the face of any of these. While fixing these problems directly is hard (to near enough impossible), there&amp;#8217;s a very simple solution originally posited by Postel:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;Be conservative in what you do; be liberal in what you accept from others&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;Yes, it&amp;#8217;s the simple: just accept whatever your users, &lt;em&gt;the people who live at the address&lt;/em&gt;, put into your form. They know the correct answer far better than you ever will, so believe them when they put something in. If you want to help them by offering a post-code lookup, that&amp;#8217;s fine, encouraged even; but don&amp;#8217;t insist that they use it. That just hurts the usability of your system.&lt;/p&gt;
</content><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">5</thr:total></entry><entry><title type="html">Film Fight: June 2008</title><link rel="alternate" type="text/html" href="http://solitude.vkps.co.uk/Archives/2008/07/17/film-fight-june-2008/" /><category term="Uncategorized" /><author><name>Gary Fleming</name><uri>http://solitude.vkps.co.uk</uri></author><updated>2008-07-17T16:20:00-05:00</updated><id>http://solitude.vkps.co.uk/?p=641</id><summary type="html">5 more films for the fight&amp;#8230;
Gone Baby Gone is the long delayed directorial debut of Ben Affleck (delayed due to the theme of child kidnapping being a little too close to the bone over the last year), and as debuts go it&amp;#8217;s not bad. The mainstay of the plot is reasonable enough: kid gets kidnapped, [...]</summary><content type="html" xml:base="http://solitude.vkps.co.uk/Archives/2008/07/17/film-fight-june-2008/">&lt;p&gt;5 more films for the fight&amp;#8230;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Gone Baby Gone&lt;/strong&gt; is the long delayed directorial debut of Ben Affleck (delayed due to the theme of child kidnapping being a little too close to the bone over the last year), and as debuts go it&amp;#8217;s not bad. The mainstay of the plot is reasonable enough: kid gets kidnapped, private investigators who know the locals get involved, there&amp;#8217;s more than meets the eye. The performances are for the most part decent, with one outstanding performance put in by Ed Harris; one scene in particular, we see some absolute brilliance in his act. All that said, the film is too clever for its own good. There are too many attempts at pulling the wool over the audiences eyes or twisting a little bit too much for comfort. A shame, because the film is solid, if nothing outstanding.&lt;/p&gt;
&lt;p&gt;With the bar set to ridiculously low by Ang Lee&amp;#8217;s &lt;a href="/Archives/2003/08/02/Hulkish/"&gt;Hulk&lt;/a&gt;, the franchise reboot starring Ed Norton doesn&amp;#8217;t really have to work all that hard to improve. &lt;strong&gt;The Incredible Hulk&lt;/strong&gt; is, then, a pleasant surprise, in that it manages to get a lot of things right for the genre. It doesn&amp;#8217;t waste time on back story, origins or explaining relationships that are apparent by the interactions, accepting that people know everything they need to know about the Hulk mythos already. It gets moving, keeps a steady enough pace, holds interest, and then plummets with the action sequences towards the end. Sorry, but two CGI monsters who are not grounded in any approachable form of physics break any suspension of disbelief. It had been beating expectations until the final scenes, so to see a mindless fight that turns around for no good reason is a real waste.&lt;/p&gt;
&lt;p&gt;Imagine, for a second, taking an entire season of Prison Break and cramming it into 100 minutes; no wasting time on pointless threads that spur things on, no wasted attempts and feeling cheated by do-overs, just the escape: welcome to &lt;strong&gt;The Escapist&lt;/strong&gt;. Although it falls into a Brit crime caper directorial style at times, it manages to show a surprisingly amount of depth and care. The editing is also inspired. While often cutting early parts of a story (chronologically speaking) in amongst the ending is often just an awkward gimmick, cutting the escape and it&amp;#8217;s problems in amongst the planning scenes is surprisingly effective. In places that would otherwise be dead weight, tension is kept high. The &amp;#8220;But&amp;#8221;? The very final moments of the film pull back a needless reveal that cheapens the whole. Without it, it&amp;#8217;d be a strong film.&lt;/p&gt;
&lt;p&gt;The second of the Narnia films is, unexpectedly, worse than the first entry. &lt;strong&gt;Prince Caspian&lt;/strong&gt; is relatively rich source material (caveats about CS Lewis&amp;#8217; various leanings aside), so it&amp;#8217;s disappointing to see such uninspired cinema. We have a largely fluffer plot, terrible performances (some of the kids have gotten worse), dreadful accents, poor CGI battles and an afterthought love interest. If it wasn&amp;#8217;t for the cute mice, there&amp;#8217;d be next to nothing good to say here. Not worth seeing.&lt;/p&gt;
&lt;p&gt;Finally, &lt;strong&gt;Wanted&lt;/strong&gt; is the Hollywood debut of Timur Bekmambetov, previously of Night Watch/Day Watch fame. Based, barely, on a graphic novel of the same name, Wanted is about a fraternity of assassins who follow the path set out by the seemingly random machinations of fate and them bringing someone into the fold who begins to disrupt their way of life. There&amp;#8217;s plenty you could do with that as source material but sadly Timur has opted to make yet another piss-poor CGI heavy action yawnfest. The inconsistencies in this film make it painful to watch, the accents are atrocious (I&amp;#8217;ve seen James McAvoy act elsewhere, what happened here?), and the whole thing turgid. There&amp;#8217;s nothing worthwhile to recommend this film. It fails as an action film, as a story, and on every other level a film can. Awful.&lt;/p&gt;
&lt;p&gt;So, despite a regrettable finale, &lt;strong&gt;The Escapist&lt;/strong&gt; is this months winner!&lt;/p&gt;
</content><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">2</thr:total></entry><entry><title type="html">Film Fight: May 2008</title><link rel="alternate" type="text/html" href="http://solitude.vkps.co.uk/Archives/2008/07/06/film-fight-may-2008/" /><category term="Uncategorized" /><author><name>Gary Fleming</name><uri>http://solitude.vkps.co.uk</uri></author><updated>2008-07-06T12:37:38-05:00</updated><id>http://solitude.vkps.co.uk/?p=640</id><summary type="html">Another month, another 4 films&amp;#8230;
Iron Man is the first film in Marvel&amp;#8217;s attempt to reboot their film universe, after some fairly awful entries. The failings of this film are the same for most Hollywood action films: they&amp;#8217;re made for what is expected to be the lowest common denominator (that great, traditional cinema has a more [...]</summary><content type="html" xml:base="http://solitude.vkps.co.uk/Archives/2008/07/06/film-fight-may-2008/">&lt;p&gt;Another month, another 4 films&amp;#8230;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Iron Man&lt;/strong&gt; is the first film in Marvel&amp;#8217;s attempt to reboot their film universe, after some fairly awful entries. The failings of this film are the same for most Hollywood action films: they&amp;#8217;re made for what is expected to be the lowest common denominator (that great, traditional cinema has a more universal appeal is a debate for another post, but think of something like Goodfellas). The plot is fairly moronic, being nothing more than an attempt to tell the origin story quickly and get onto a series of CGI action sequences and cameos (for other Marvel characters). Big, loud, and fast. As the genre goes, it&amp;#8217;s not a terrible entry: Robert Downey Jr. is an inspired choice, even if Tony Stark has gone from obsessive alcoholic genius, the prototypical flawed hero, to brash-but-brilliant, crowd-pleasing asshole. Where it lacks good storytelling, it makes some inroads with the action. Watchable.&lt;/p&gt;
&lt;p&gt;The quiet, British indie film, &lt;strong&gt;Cashback&lt;/strong&gt;, has a decent premise: an art student obsesses over the female form (while working in a supermarket), often stopping time to fully indulge his compulsion. It&amp;#8217;s left purposefully opaque as to the extent and reality of this talent, flipping back and forth between assuming it&amp;#8217;s real or just his imagination. That&amp;#8217;s fine though: the frozen time scenes are merely a mechanism for exploring the character, and on that level the film is a success. Cashback suffers from being stretched too thin (perhaps as a result of being an expanded version of a short film) as some of the other characters and the plot lines are shoe-horned in or lack depth, notably his best friend. Still, it&amp;#8217;s a decent enough film when it focusses on it&amp;#8217;s stronger parts.&lt;/p&gt;
&lt;p&gt;Here&amp;#8217;s a concept: a horror film where it is abundantly clear that the nemesis, whether ghost, monster or zombie, has the main characters in a place where it can&amp;#8217;t be stopped, hurt or, for the most part, seen. &lt;strong&gt;Outpost&lt;/strong&gt; is that movie. You may think that this would make for quite a dramatic, fraught, survival piece but the opposite is true: it lacks tension or scares, and sadly lacks a coherent plot. For some reason, the Nazi ghosts are murdering a group of soldiers who stumble upon an abandoned bunker, making for some of the most conveniently capricious baddies you&amp;#8217;re likely to see. They can kill everyone at any time, but stick with one at a time kills until the plot calls for more. There are some decent elements (the creepy pale man) but they&amp;#8217;re never utilised as fully as they could be. Relatively weak.&lt;/p&gt;
&lt;p&gt;Finally, the much awaited &lt;strong&gt;Indiana Jones and the Kingdom of the Crystal Skull&lt;/strong&gt; shows that even the relatively sacred Indiana Jones franchise is capable of producing an absolute stinker. There is little to like about this film. The story is nonsensical, fan-pleasing hookum in the worst sense. It reads like fan fiction. You expect the author&amp;#8217;s favourite band to turn up and high-five Shia LaBeouf (who is awful in this), it&amp;#8217;s honestly that bad. The fun, family adventures (occult themes not withstanding) have been replaced by farce. The impeccably solid stunt-work has been replaced by piss weak CGI and ludicrous ideas. The evil ants climb up each other like a cartoon? Shia LeBeouf becomes Tarzan? &lt;em&gt;That&lt;/em&gt; accent was supposed to be acting? Tragically bad, and not so tragic that it&amp;#8217;s funny either.&lt;/p&gt;
&lt;p&gt;The winner for May 2008 is &lt;strong&gt;Cashback&lt;/strong&gt;. It wouldn&amp;#8217;t have won in many other months, but it&amp;#8217;s core is a good enough film to warrant a watch.&lt;/p&gt;
</content><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></entry><entry><title type="html">Film Fight: April 2008</title><link rel="alternate" type="text/html" href="http://solitude.vkps.co.uk/Archives/2008/07/04/film-fight-april-2008/" /><category term="Uncategorized" /><author><name>Gary Fleming</name><uri>http://solitude.vkps.co.uk</uri></author><updated>2008-07-04T15:27:13-05:00</updated><id>http://solitude.vkps.co.uk/?p=639</id><summary type="html">I know, I know, it&amp;#8217;s late again. It&amp;#8217;s been a fair while since I&amp;#8217;ve seen these but let&amp;#8217;s crack on anyway.
Funny Games is shot for shot remake of a German film of the same name (by the same director), about the commercialisation and desensitisation of violence in the media. Told through the eyes of a [...]</summary><content type="html" xml:base="http://solitude.vkps.co.uk/Archives/2008/07/04/film-fight-april-2008/">&lt;p&gt;I know, I know, it&amp;#8217;s late again. It&amp;#8217;s been a fair while since I&amp;#8217;ve seen these but let&amp;#8217;s crack on anyway.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Funny Games&lt;/strong&gt; is shot for shot remake of a German film of the same name (by the same director), about the commercialisation and desensitisation of violence in the media. Told through the eyes of a family who are held against their will, it takes us on a fairly dark journey, using some impressively lengthy shots to force us to keep watching. The direction and camera work is pretty flawless throughout, as is the dialogue; perfunctory and sharp. The film is an unerringly focussed on it&amp;#8217;s core questions of &amp;#8220;Have you seen enough yet?&amp;#8221; and &amp;#8220;Is this still entertaining?&amp;#8221; It succeeds masterfully. Highly recommended.&lt;/p&gt;
&lt;p&gt;Rod Hilton has done another excellent job of parodying &lt;strong&gt;&lt;a href="http://www.the-editing-room.com/21.html"&gt;21&lt;/a&gt;&lt;/strong&gt;, but I&amp;#8217;ll say a little more. What we have here is a good idea, done in the worst possible way. We have a film that is dumbed down as far as it will go: MTV style jump-cuts, paper thin characters, plot holes, awful dialogue, the works. It&amp;#8217;s been designed as a music video and, for a film about card counting, that&amp;#8217;s not good. Even if you want an easy film, I&amp;#8217;d say there&amp;#8217;s better fare on offer elsewhere. Avoid!&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In Bruges&lt;/strong&gt; is a bit of an odd mix: ostensibly a comedy, but with a thoroughly dark vein running through it. After a kill gone wrong, two hit men are ordered to hide out in Bruges where they begin to face up to what they&amp;#8217;ve done. Had the film continued with that, it could&amp;#8217;ve been very good. Sadly, it loses itself exploring the quirky characters they meet and the childish jokes that Colin Farrell&amp;#8217;s character passes off as banter. That&amp;#8217;s not to say it&amp;#8217;s entirely merit less: there are some laughs in here. In a quiet period, it might be worth a look.&lt;/p&gt;
&lt;p&gt;As is my obligatory remark for this kind of film, I love zombie films. Spanish horror, &lt;strong&gt;Rec&lt;/strong&gt;, is exactly that. Initially the single point of view handycam style gives it a Blair Witch feel (not a good thing), it quickly settles in. About a siege in an apartment block and the panic that surrounds the resident&amp;#8217;s attempts to escape, we see old conceits work remarkably well. The story is nothing more than ordinary (well doled out), but the visual impact is impressive.  Horrific in places, reasonably tense, but let down by a weak end sequence. A shame that the last scene lets it slip. Still worth a view.&lt;/p&gt;
&lt;p&gt;Finally, &lt;strong&gt;Persepolis&lt;/strong&gt; is an animated film from Iran (redubbed by an impressive American voice cast) following the fall of civil rights in Iran, and the eventual persecution of non-conformists. Told through the eyes of a young girl growing up and eventually viewing her heritage from afar, Persepolis is simultaneously wryly bleak and dimly amusing. The story is a worthwhile one, but often the pacing feels too slow and the feel too quiet. You sympathise with the main character&amp;#8217;s plight, but can&amp;#8217;t warm to her as a person. Not a terrible failing, but one that makes the film drag more than it could.&lt;/p&gt;
&lt;p&gt;The winner for April is &lt;strong&gt;Funny Games&lt;/strong&gt;, a dark vision and a pointed question combined into an excellent piece of cinema.&lt;/p&gt;
</content><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></entry></feed>
