Digital Magpie

Ooh, ooh, look - shiny things!

Stroke Me Gently

Excellent article over at Gizmodo about the whole security theatre dance that we’re forced to do any time we want to fly these days. My favourite quote:

I don’t have a problem with being searched at all – in fact, if you guys think it’s necessary, I’d be the first to admit that I look a little bit suspicious before I’ve had my first cup of coffee in the morning – but if you’re going to stroke me gently in front of hundreds of people, you’d better buy me a fucking drink first, is all I am saying.

Rearranging the Apples

Some insightful analysis about the recent Apple reorganisation (a.k.a. Scott Forstall getting shit-canned) from Matt Drance:

Not only is this a profound increase in responsibility for all three of these top executives, it’s a profound change in Apple’s organization going as far back as I can remember. There’s a long-standing pattern of separating watershed products important to the company’s future. The Mac and Apple teams. Mac OS X and Classic. The iPod division. iOS and Mac OS X. Suddenly, Tim Cook has pulled the reins in. Federighi owns software. Ive owns design. Cue owns services. Period.

While it looks like this is something that asn’t exactly planned in advance, it seems like some people at Apple have been hoping for it for a while now. According to Om Malik:

Forstall’s firing was met with a sense of quiet jubilation, especially among people who worked in the engineering groups.

For my part, I’m mainly interested in seeing what happens to the UI now that Jony Ive is in charge of it, hopefully the misguided move towards skeuomorphic interfaces will be taken out back and shot.

VLC Versions

So I started up VLC just now and was greeted with this update notification:

VLC media player 2.0.4

This is a major update that fixes a lot of regressions of the 2.0.x branch of VLC.

We are introducing an important number of fixes and improvements for all playback, notably for Blu-Ray, DVD, HLS, Ogg and MKV files; but also for Youtube, Vimeo, Koreus and Soundcloud.

New support for the OPUS audio codec, including multichannel and streams. …

How the fuck is going from 2.0.3 to 2.0.4 the correct version bump for a major upgrade?

Jeez…

Category Counts in OctoPress Revisited

As an improvement on an older shell script, here’s a rake task to list all of the categories in your blog, along with post counts for each of them:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
desc "count the number of posts in each category"
task :count_categories do
  require 'yaml'

  counts = {}

  Dir.glob('source/_posts/*.markdown').each do |f|
    post = begin
      YAML.load(File.open(f))
    rescue ArgumentError => e
      puts "error: parsing #{f} - #{e.message}"
    end
    cats = post['categories']
    if cats.respond_to? "each"
      cats.each {|c| counts[c] = counts[c].to_i + 1}
    else
      counts[cats] = counts[cats].to_i + 1
    end
  end

  counts.sort_by {|k,v| v}.reverse.each {|k,v| puts "#{v} #{k}"}
end

Just add this to the end of your OctoPress Rakefile and you’re good to go.

NetBeans Rich Client Platform

I’m in the process of dusting off some old Swing based apps to use more modern code, and also add some useful new features to them. At the same time I’m going to move the apps to use a more structured framework, as this should allow me to share more common code between the apps.

Picking a Platform

There are a number of options out there, including:

JSR-296 is basically dead in the water at this point, and while there are a few forks doing the rounds I’m not really confident enough in any of them to want to move a reasonably sized codebase to it.

Eclipse uses a different UI toolkit altogether so it’s really a nonpstarter for this excercise, although it would be a good option if starting a new project from scratch.

Jide is a swing component vendor and a relatively new entrant into the RCP space. JDAF has some things going for it: it has the best platform integration of any framework, with much better native fidelity (e.g. message dialogs look OK on Mac OS X and Gnome) than either Eclipse or NetBeans. It also has some handy built-in support for document-centric apps. The downsides are that unlike the other offerings here it’s a commercial product, and it’s much less ambitious in scope than either Eclipse or NetBeans, presumably as many of the other features that these offer are also Jide products (e.g. their docking framework). I also found myself fighting to work with it’s limited data model support.

NetBeans seems to e a good fit for the apps that I’m converting, and it plays well with standard Swing idioms so it should be quite easy to port the code over. Recent releases have extensive support for annotation based configuration as well, which should ease the learning curve.

One downside is that most of the tutorials and documentation assume that you will also be using NetBeans as an IDE, which I won’t be (I use IntelliJ), still, NetBeans RCP has pretty good Maven support so it shouldn’t matter too much.

Setting Up a Project with NetBeans RCP

Here’s how to create a project and add a module to it:

You can then open this up in IntelliJ as a Maven based project and start editing away.

Adding additional modules (e.g. myviews, &c.) is as simple as rerunning the last command and re-importing the maven model (or enabling auto-import in IntelliJ).