Uncategorized

You are currently browsing the archive for the Uncategorized category.

There are lots of complaints from the creative industries, in particular the movie and music industries, about the threats that they are under from piracy and new forms of digital distribution. It’s often, but not always, the industry itself that complains and not the creatives. The outcome of this has been worrying in several ways.

Copyright terms have been extended to 70 years for sound recordings which, given the age we live in, is a terrible idea. Copyright, as with patents, was devised as a way to incentivise creatives to create new works by offering them exclusive control over those works for a limited period of time. That last part is extremely important here: why would we, as a society, risk our cultural heritage to benefit a handful of people? We wouldn’t and we shouldn’t. If we allow copyrights to be continually extended, there is a greater chance that we will lose, forever, those recordings that we were trying to protect in the first place.

Moreover, why would we want to increase the length of time it takes to be able to access our cultural heritage? If we could argue that it would encourage artists to produce more work because they knew that it would be protected for their lifetimes, then maybe that would do it; but we know that this is not the case. The vast majority of the money from term extension would go to record labels. We’d be given more money to people who already take the vast majority of the income from creative works for merely acting as intermediaries, while pushing most of the risk onto artists themselves.

The few artists who would benefit substantially from term extension are people like U2, The Beatles, and Cliff Richard i.e. giant name stars who are already multimillionaires. The vast majority of artists, who earn their living through touring, would see no meaningful benefit.

Essentially, we’d be losing more of our cultural heritage for a longer time, with nothing else to show for it, except for propping up the intermediaries of the industry who are unwilling to move with the times. This seems like a terrible idea to me.

Separately, we have the movie industry, who simply do not understand what consumers want but complain about declining revenues. It’s somewhat trite, at this point, to complain that the “cinema is best ads” are only being played to people sitting in a cinema and that the unskippable, lengthy and irritating anti-piracy warnings on DVD/blu-rays are only being shown to people who legitimately bought a copy of the film; trite, but still absolutely true. Perhaps barriers to watching a film, like these unskippable ads, or DRM that stops you watching the film at all, are part of the reason that people pirate movies?

That’s the thing: regardless of what’s happened before, we’re now at a point where some people pirate movies, and some people buy them. The key for the creative industries is a) not treat paying customers like thieves with constant annoyances, and b) trying to get non-customers over to the paying side.

Clearly, getting people to pay for something they’ve grown somewhat accustomed to getting for free is not easy. It’s a problem that’s been around for a long enough time that if it was, people would likely have done it by now. However, it might be worthwhile starting with some of the more obvious solutions:

  • Make it as easy and quick to watch a legitimate copy of something as it is to watch a pirated copy. This should be a no-brainer. The arguments about having DRM on digital copies and on discs has already been lost. If people want to pirate movies or music, it’s trivially easy to do, whether it has DRM or not. Stop putting barriers in the way of people who want to give you their money and more of them will give you their money.
  • Make legitimate copies as readily available as pirated copies. If you want to buy a digital copy of a movie, it’s extremely difficult to do so. There are basically no services (in the UK) where you can get access to a reasonable library of digital movies that can be bought to keep. If you want to buy a DVD, I can get my hands on pretty much anything that has been released. If you want a digital copy? No, you’re stuck with searching torrent sites. Simply make your content available in a free and open format and you’ll increase sales because, you know, it’s hard to make money when you aren’t selling the damn thing.
  • Make legitimate copies as high quality as pirated copies. After pushing for the HD era for many years, encouraging uptake of HD TVs, accept that full HD is now the default. It is not the premium option, it’s what people expect. There’s no reason not to do this other than thinking you can push people for another £5-10 to get an HD version of the film. HD is the default, if for no other reason than that’s what you’re competing with on the pirated side.
  • Make legitimate copies reasonably priced. Accept some basic truths. The era that people were willing to pay £15 for a brand new copy of something on day one is mostly gone (hardcore fans aside). You’re no longer competing against this weeks releases, you’re competing against every great film ever made. There are enough movies being made, and enough decades of classic film available, that there is simply no good reason to spend that much money on a great movie. We can all wait a few weeks until it drops down to a more reasonable price; and sales show that’s what most people do. That might be depressing, but it’s also true. That devaluation has already happened; and is another reason that when some people see “£22″ for the HD BluRay version of a film its so far from what they think the film is worth, they’ll either wait it out or pirate it. Decrease the gap by decreasing the price. I know the industry reaction has been to try the opposite: increase the value of the package, but it’s not a great strategy. Most people don’t care about the special 10-disk edition that they’ll never watch, and it won’t be very long before people see that Triple-Play packs (Blu-Ray, DVD and crippled digital copy bundled together) are merely the illusion of value. If you want to sell bonus content to the hardcore fans, that’s fine; but most people simply won’t care.
That’s it: create a simple, large, quality, open digital library of movies and the people will come. Stop worrying about cannibalising the sales of the many, many editions of the same movie you’ll release; those sales are already been heavily eaten into by something you get absolutely nothing out of. Give the people what they want. Really. Just what they want.

Code for machines. Code for machines. CODE FOR MACHINES.

I’ve mentioned Project Lombok before, as part of my Modern Java series. It’s a way of hiding some of the meaningless boilerplate code that machines need to interpret the programmer’s will; lines of code sacrificed to the compiler gods in the hope that they’ll do meaningful equality (and hashCode), or print objects nicely for The Log.

I spent a coding eternity (a year and a half) having my life made easy by Lombok: no more boilerplate getters and setters, no screen-filling equals methods that have the semantics that anyone half-way competent would have guessed, and no more toString(), that semi-mandatory serpent of concatenation. It was a paradise of clean, expressive code, built in the image of the domain. You could forget Lombok was even there, as it quietly did all the bad code for you.

That was then.

Now, having had Lombok ripped from my toolset, I realise just how much I miss it, and more importantly that it shouldn’t have to exist at all.

Classes shouldn’t have to be 90% boilerplate to make three fields behave in what is a defacto standard manner. Chances are the getters/setters are going to be plain vanilla, the toString is going to concatenate the lot together, and the equals/hashCode are going to follow the recommendation that was laid down as law ON PENALTY OF DEATH in Effective Java. Everyone who programs at a decent level in Java knows this; absolutely everyone except for Java itself.

I’m extremely grateful that Lombok exists to workaround the broken parts of the language, but it shouldn’t have to. Everything that Lombok does should be in the core. It’s time we had genuine properties. It’s time we had less noise, and more signal. Java is our stumbling, drunk of a language; and Lombok is the poor spouse that has to drag its sorry shell to its bed every night.

These missing parts, these default behaviours in all but implementation, are pieces of code meant purely for machines. We don’t need code for machines. We never need code for machines.

May was a decent month for cinema, with four films viewed…

Thor is not going to cause any great surprises: it’s a big budget, superhero-filled, special-effects-laden barrel of dumb fun; and fun it is. While a lot of films in this genre seem to think that just having enough explosions makes them worth seeing, Thor at least tries to build a story (and something of a mythos), and creates somes decent characters along the way. While Thor’s change of heart is as sudden as it is predictable, the supporting cast (particularly Loki and Odin) do enough to keep you distracted and the action moving forward. It’s worth seeing, even if it is as cheesy as you expect. (See my Thor Twitter review).

13 Assassins is the story of the last days of the samurai. The 12 best (and one other character) are charged with assassinating an evil feudal lord, knowing it will likely be their last act. From end to end, the film is excellent: we get some clear and utterly brutal reasons why the feudal lord must go, and an hour or so of strategic manoeuvring and character building to set-up the last act. What a last act it is: a 50 minute battle where the 13 take on 200 soldiers with every trick they’ve learned. It’s a spectacular fight scene, that manages to keep up the momentum throughout. An excellent film. (See my 13 Assassins Twitter review).

Attack the Block is an interesting debut by Joe Cornish (of Adam & Joe fame): while it’s clearly been shot on a low budget, this sci-fi comedy manages to turn this to its advantage, with monsters that are more frightening due to how difficult they are to see (they’re deepest black, except for their day-glo fangs). It manages to provide some good laughs, and reasonable horror moments, and in doing so is probably a success. It’s not fantastic, but is worth seeing. (See my Attack the Block Twitter review).

Finally, Win Win is most of what you expect from an indie film starring Paul Giamatti: the characters are likeable, but flawed; people learn important life lessons; and there is an underlying quirky wit to it. The story itself, that of a family that take in a teenage runaway who just so happens to be the wrestling champion that the father badly needs for his team, is pretty good, and you’ll feel for most of the characters along the way. This is a solid film, but not a stand-out. (see my Win Win Twitter review).

The winner for May is 13 Assassins, for it’s excellent pacing and that finale. Excellent.

April was a reasonable enough month, with 4 films in the fight.

First up, Source Code manages to find quite a neat balance between a techno-thriller and decent characterisation. Unlike most entries to the genre, it tries to stay jargon light and stay focussed on the plot at hand: a bomb went off earlier in the day and, while that cannot change, through some advanced technology, a former-soldier is forced to relieve the event again and again in order to find clues to stop a future attack. It’s to Jake Gyllenhaal and Vera Farmiga’s credit that you actually end up caring about this “virtual” environment as much as they do, buying into the hopeless exercise. It’s somewhat marred by an overly saccharine ending, but the tight runtime keeps everything going at a good pace. Worth seeing.(See my Source Code Twitter review).

Your Highness is a silly and ridiculous film that takes the usually stoic and noble concepts found in most fantasy films, and turns them into a run of toilet humour. It’s not high-brow in the slightest, but it manages to get just enough out of the jokes to keep funny. It starts to wear more than a little thin by the end, but stops before there’s nothing left. It’s certainly not a classic, but there are enough absurd moments (the mechanical bird) for it to be somewhat memorable. Good, not great. (See my Your Highness Twitter review).

Scream 4 manages to do something that should not have been possible after Scream 3: it squanders the franchise even further, gaining absolutely nothing along the way. The handful of decent scares and laughs are entirely mired by the huge number of predictable twists and dull moments. The new characters are all forgettable, and the returning cast are either in it for the money, or left as paper-thin caricatures. Bad. (See my Scream 4 Twitter review).

Finally, Cedar Rapids is an indie comedy that, while not a classic, is a surprisingly good film. Introducing Ed Helms as a painfully naive insurance salesman really slows down the movies opening (but does set up some awkward moments with his ex-teacher/lover), but the movie eventually finds some great moments for its characters to come alive. John C Reilly is excellent as an obnoxious, loud-mouthed competitor, with a good heart; being crude enough to be funny, but not so much that he’s repulsive. Well worth seeing. (See my Cedar Rapids Twitter review).

It’s another slightly tough month, but the winner is Source Code. The ending aside, it does a great job of making you sympathise with the lead and makes you want him to be able to change the unchangeable.

March was an okay month, with 5 films in the running.

First up, Drive Angry is a unabashed throwback to a time when action ruled all. If you’re looking for a film that has great lines, a sharp plot, or makes much sense at all, then you’re looking at the wrong film. Essentially, the film is about getting Nicholas Cage to play an action star again, with William Fichtner as a crazy demonic accountant-sidekick. It’s at its best when the action sequences are let go mad, and its worst when someone tries to shoehorn in a plot. It’s pure grindhouse, with all the good and bad that implies. Entertaining, despite being a bit terrible. (See my Drive Angry Twitter review).

Rango is one of the more interesting animated movies of recent times. What’s most striking about it are the visuals: this does not have the super-cute characters with oversized features you’ll find in most Pixar films. No, all the inhabitants of Dirt, the old western town it’s set in, are hideous little animals savaged by scars and warts. They bristle with character from the moment they appear, and set an interesting tone. Despite some risque lines here and there, it’s a fairly well-natured film about belonging, finding a place in the world and becoming a hero by being yourself. The plot won’t surprise, but it doesn’t have to when the rest of the package is so pleasant. Pretty good. (See my Rango Twitter review).

There have been many books and films about alien invasions, many are better than Battle: Los Angeles, some are worse. When it’s trying to build B-plots of past tension between the characters, you simply will not care. None of them are interesting enough, or well-portrayed enough, to warrant any attention. Where they are a little better is in the action sequences. The camera work here will put some off, falling somewhere between the Bourne Ultimatum (very shaky) and District 9 (pretty watchable) in the handicam-shake stakes. If you can follow it, there are some pretty great set-pieces, with some reasonably well done CG. It’s entertaining, but not good. (See my Battle Los Angeles Twitter review).

The Company Men is a little bit baffling. The economic downturn over the last few years is surely ripe for storytelling about families who are suffering the consequences, from professionals through the working classes. That’s not really what we get here: we get one company executive who is saddened by another, but lands just fine, and a reasonably well-off salesman who deludes himself for a while and then lands just fine. The film also fails to see any irony in a millionaire actor, playing a millionaire CEO, complaining about how the now derelict shipyards used to have good honest, hard-workers in it. Despite a pretty great cast, the performances are phoned-in in many places, probably because the characters are so utterly flat. It’s hard to care when no-one else does. A wasted opportunity. (See my The Company Men Twitter review).

Finally, Submarine is a distinctly indie debut from Richard Ayoade. It’s difficult to say what it’s about in a way that really captures the feel of the film. It has themes that are familiar, about love, loss, regret and making do, but doesn’t necessarily pursue them breathlessly. The fairly unlikeable lead (a self-obsessed teenager) lets his view of himself get in the way of being a decent human being. There are a number of other tangental threads that all connect in some way (his parents, a psychic, a bulled girl at school), but it’s not particularly tightly plotted, nor does it need to be. It did feel a little long, but there are enough amusing moments along the way to ease the rough pacing. Interesting. (See my Submarine Twitter review).

A difficult one this month: two entertaining action films, a cartoon comedy, a bland downturn tale, and a rough but interesting indie film. To my own surprise, I think I’m going to go with Submarine at the winner. While many of the films were good, I think this is the one I’d choose to watch again now.

I made a bad assumption about how JPA (with Hibernate) works a while ago, that came back to bite me recently. For a long time, I’d assumed that if you have an @Column annotation with a name attribute, that name would always be the name that gets used to match the field to a DB column i.e. @Column(name="someName") would always resolve to the DB column “someName”.

I was very much mistaken in that assumption.

When using Hibernate (and possibly other JPA implementations, I’ll need to check), it turns out that name just replaces the field name as it goes through the normal renaming process. That is, the name is still subject to all of Hibernate’s naming strategy code.

By default, that means that when using the ImprovedNamingStrategy (as most people are), “someName” becomes “some_name”. This is definitely a more db-like name, but took me a little by surprise when I saw this happening in someone’s code.

The lesson: never assume anything.

A relatively light February, with only two movies.

The Fighter, in many ways, is a film you’ve seen before. It’s underdog story about a boxer who gets beaten and eventually, with the love of a good woman, finds his way to glory isn’t particularly novel or surprising. No, what makes it stand out is the quality of the performances from the entire cast. Christian Bale as the titular character’s drug addict brother/trainer is outstanding. Seeing through every twitch and failing, he really makes the character stand out without seeming ridiculous, fully deserving his Oscar. Both Amy Adams and Melissa Leo put in outstanding performances (the later also Oscar-winning), as they tear at what they feel is best for the lead. You’ve seen the story before, sure, but never quite this well done. Very worthwhile. (See my The Fighter Twitter review).

Meanwhile, Paul sees Simon Pegg and Nick Frost team up with a CG alien (Seth Rogen) for a fun, if gentle, Saturday afternoon comedy. There are a lot of nice little nods for the sci-fi geeks out there, and some funny moments, but we’re not talking about a classic here. It’s got a good feel, and you could certainly watch a lot worse, but not even the surprise cameos can turn around the fact that this is a little better than average. Fun, but not fantastic. (See my Paul Twitter review).

As I’m sure you’ve guessed, The Fighter is the film fight winner for February.

If you buy a drill, you can can do whatever you like with that drill. Well, not whatever you like: you can’t use that drill as a weapon against someone, or using it on objects that you don’t own. You’d be arrested, beaten or feel other negative effects from society.

What you can do, though, is take it apart to see how it works. You can look at how they managed to fit a powerful motor into such a small space. You can see how the batteries are arranged for charging and replace them with something that holds much more power. You can replace any part with a part of your own choosing; putting together a simple set of instructions to give your drill twice as much torque, for example. You’ll likely void your warranty (as is fair) but, in short, you own that drill and it’s yours to play with.

That’s why I find it pretty ridiculous that George Hotz is being sued for doing the same thing with his PlayStation 3. He decided that he wanted to be able to run whatever he wanted to do on his own device (a computer that he paid for, just like a standard desktop) and set about figuring out how to do that. That’s a perfectly reasonable thing to do. I know not many people have the time, inclination or ability to do so but, just like the drill, it should be entirely up to the owner of a piece of property to decide what modifications they want to make to it.

Sony decided, instead, to sue him.

You see, a side-effect of being able to run anything on your own computer (in this case the PS3) is that you can run pirated software, if you choose to. George did not choose to do this. He merely put the instructions out there about how to run your own software on your own computer. It was other people who then misused these instructions.

That’s right: he didn’t break the law himself, but his modification made it easier for others to do so. He didn’t incite them to do so, he didn’t suggest that they should, he merely produced that side-effect. This is akin to blaming the drill modifier for someone else using a modified drill in in an illegal manner: unless they said “go attack someone with this modified drill”, it’s really got nothing to do with them.

The saddest part of this is that it could all probably be avoided. Rather than get involved in the fool’s errand of securing hardware against personal use (the determined will always find a way), manufacturers could open up their platform’s for such use in a reasonably controlled manner.

Hardware hackers wouldn’t need to resort to cryptographic attacks with bad side-effects, if the platform owner let them play with it to their heart’s content. Sony actually did this for a while with the OtherOs feature but cut it in a firmware revision — which ultimately caused these issues.

This is important. Sony are essentially arguing that we cannot change the things we buy; that features that we pay for can be removed and we can’t reinstate them to one degree or another; that computing commodities are rented and not bought; and that changes others make and misuse could potentially be our fault. None of this has been true in the past, and we mustn’t let it be true in the future.

free culture allows modification, remixing and derivation; particularly when we’re not infringing copyright. We should not lose sight of this as we enter an age of EULAs and commodities that we buy but, bizarrely, do not own.

People tend to build up systems for organising their data only after it’s really needed: we’ll gather related objects together haphazardly until it’s too late and we end up with a clutter. Nowhere is this seen more frequently than in people’s digital music collections.

Invariably, people just shove all of their music into a folder and hope for the best, neither organising or normalising the data. The result is that it’s difficult to find specific files, many files are missing vital metadata (like the artist name), and doing anything takes far longer than it should.

This need not be the case.

I’ve shown a few people who have been interested in organising their music collections the strategy I’ve built-up for keeping clutter free, and I’m going to share it with you. It’s not perfect, but it works well for me. (To be honest, I’m writing this so I can point anyone else who asks towards this guide.)

First of all, if all of your music is relatively popular and well known and you already use it as your main media player, just use iTunes. It has many shortcomings, but if you fit in that sweet spot then save yourself the hassle and just let iTunes take care of it all. That’s it, you lucky ones can go now. Lesson over.

Still here? Great. For anyone who has explored the world of music beyond iTunes, you’ll know that it won’t help fix your metadata or organise your music in a particularly useful way. My solution to that is built largely on top of the tools and music database provided by MusicBrainz, a collaborative way of discovering music metadata.

A little background: MusicBrainz aims to be the definitive reference source for online music. Over the last few years, volunteers have gathered a tonne of music metadata onto the MusicBrainz website and set about organising it. There are artists, releases, albums, singles, release groups, collaborations, and every piece of music information that you could need; all of it tagged with unique IDs. I say “every piece” but that’s overstating it. There will always be gaps in what MusicBrainz knows. The good news is that if you spot a missing release from your favourite artist, you can add it to MusicBrainz yourself and then everyone else gets to benefit from it.

Back to the task at hand. You’ll need to grab Picard, the MusicBrainz tagger, from their website. It’s available for Windows, OS X and Linux; and it’s ugly as sin on all of them. Seriously, it’s a terrible looking tool, but it’s very useful.

Once you’ve got Picard, the rest is easy:

  1. Create a Music folder – This should be empty at first, and represents the golden copy of your data. Absolutely nothing gets in here that hasn’t been properly tagged and vetted. It can be anywhere you like, but keep in mind that you’re going to want to back this up on occasion so keep it somewhere that makes that easy.
  2. Set-up Picard - In the Picard preferences, there is a setting for moving tagged files to a specific directory. Pick your new Music folder. You may also want to change the filename format and tweak some of the other settings, but I leave that up to you. Personally, I use “artist/release/artist – track title.mp3″ for filenames.
  3. Add music to Picard – There are a few ways of doing this, but you can drag and drop music directly into the left-hand panel, or use the add files/folders buttons. If you’ve added music from several albums at once, you probably also want to hit the “Cluster” button. This will attempt to organise the files into groups of untagged releases.
  4. Search for a matching release – Select the music you want to tag first, and hit lookup. Musicbrainz will try to use the file’s existing metadata to find a release that matches.
  5. Save your matches – If the release it finds looks correct, then save it. Your files will be tagged with all the extra metadata MusicBrainz knows about and an ID so you never have to match it up again, and moved to your Music folder. Once saved you can them remove the release from Picard altogether.
  6. Scan your misses – If MusicBrainz either couldn’t find a match or the match it finds isn’t correct, you can use the “Scan” button to try a different approach. This uses audio fingerprinting (like Shazam) to try and automatically match the music using the audio itself.
  7. Search Manually – Use Picard’s manual search to try and find the right release. If you find it, a “Tag” button will appear in the top-right of the release information. Click that, and the release gets imported into Picard so you can drag the music onto it yourself.
  8. Do It Yourself – Still no luck? Well, it’s time to get acquainted with the MusicBrainz website to add the artist and/or release yourself. This is pretty straight forward but there’s plenty of information on how to contribute. If you think your files already have some of the data you need to add a release, there is a Picard plug-in for creating a release from a Cluster too.

That’s it. Every time you get new music, follow from step 3 and you’ll keep your golden copy in good shape.

As a bonus, if you ever decide to reorganise your Music directory, you can import your tagged music into Picard and it’ll recognise all it. You can then make whatever changes you want (maybe change the filename format) and re-save.

If you happen to be on OS X then the Max CD ripper can automatically tag your files as it rips, as it has Musicbrainz integration. You set it up in the same way as Picard and query MusicBrainz before ripping to pull back all of the metadata.

Hopefully, this will be of some help to someone in organising their music and understanding MusicBrainz.

After months of using JPA/Hibernate almost exclusively, I got caught out on a relatively simple bug when using JDBC more directly (well, via Spring’s JdbcTemplate):

public List<SomeObject> fetchSomeObjects(RecordType recordType) {
  Map<String,Object> params = ...//Map creation;
  params.put("recordType", recordType);
  return namedParameterJdbcTemplate.query("select * from someObject where recordType =  :recordType",
    params,
    someRowMapper);
}

That was from memory, so it may be a little off, but it should give you the basics of what the code was doing. It looks okay to my eyes, but, of course, it wasn’t. When run an exception was being thrown from the bowels of the JDBC code saying that RecordType couldn’t be converted to a JAVA_OBJECT.

Odd, I thought. It had worked perfectly well with an in-memory database (HSQL) but now wasn’t working when deployed on a hosted database (SQL server).

I couldn’t spot it straight away, so a quick debugging session revealed the problem: JDBC doesn’t play nicely with enums. RecordType, an enum, was being passed to JDBC verbatim without any attempt for it to match up with the recordType column (a varchar column); and that just doesn’t work. You need to explicitly convert from an enum to a String.

Thankfully, it was a one-line fix:

params.put("recordType", recordType.toString());

It doesn’t read quite as neatly but it works. The fact that the original version reads quite well (the value for “recordType” is called recordType) actually makes the bug harder to spot. Now, back to JPA.

« Older entries