Sunday, 19 September 2010

new reading list

So it looks like there isn't a cheap way to buy this year's Booker Prize shortlist; even the almighty buying power of Book People hasn't been able to get the books down below fifteen quid each for the most expensive ones, which is too much.

This is a pity, because I was all geared up for a burst of modern-fiction-reading. So here's what I'm doing instead: I've found on my shelves six novels which have at some point in the past been shortlisted for the Booker, and I'm going to read them instead.

They are, in chronological order:
  • Small World by David Lodge (1984)
  • Amsterdam by Ian McEwan (1998)
  • English Passengers by Matthew Kneale (2000)
  • The Sea by John Banville (2005)
  • Sea of Poppies by Amitav Ghosh (2008)
  • Parrot and Olivier in America by Peter Carey (2010)

My chosen pseudo-random reading order is alphabetical by surname: Banville, Carey, Ghosh, Kneale, Lodge, McEwan. This puts the two which we already know won at either end of the list, pleasingly.

Thursday, 16 September 2010

musicals for the autumn

The autumn season starts this evening with Gypsy in Long Eaton. Here are five musicals happening between now and the end of the year that I find particularly interesting.

Gypsy, Erewash Musical Society, September 13th - 18th

You don't see very many Gypsies around: it has no work at all for an adult chorus, except some dancers who should really be very young, and I suspect that it's a hard sell in spite of its moderate cult status among theatrical people. It is more than seven years since the last one I saw. I've found it a hard show to love but the real excitement here is that we're at the Duchess Theatre in Long Eaton, back in use for the first time since it burnt down in 2003. A new small theatre right on my doorstep is a terrifically exciting idea. Let us hope that with improved facilities EMS and LEOS will lift their standards - they are two companies who have persistently seemed to play to amdram cliches, static staging, old young women, choruses looking out into the auditorium to see Auntie Joan at idle moments. Perhaps we will see some life breathed into them now.

Fiddler on the Roof, Derby Gilbert and Sullivan Company, October 8th - 9th

Like last year, Derby G & S are doing two shows at the Derby Theatre, the old Playhouse, in the same week. They'd run out of easily sellable Savoy operas pretty quickly if they did two of them every year, so this year they're doing HMS Pinafore for three performances, taking a day off, and then doing Fiddler on the Roof for three performances. This'll be the first time I've seen them doing non-G & S and all I really know is that they're taking it pretty seriously, because I saw Peter Bostock last night and he's grown a beard for it. We know that it will be well sung, of course, but there are potential pitfalls here. In G & S it is a matter of convention that you often cast people who are wildly the wrong age for the part, as you do in opera (apparently), and you can stretch especially the heroines (who are all supposed to be very young) quite a long way before anything breaks. Fiddler falls apart sooner if one or more of Tevye's five unmarried daughters is quite obviously getting on for 40 or if their suitors are middle-aged. And whereas Andrew Nicklin's direction of G & S is always wonderful, I've not been so impressed with his American musicals for Derby Opera and Rolls-Royce. So we'll see.

Beauty and the Beast, Good Companions, October 12th - 16th

We're going to be having Beauty and the Beast for breakfast, lunch, and tea, and probably in church on Sundays too, in the next couple of years, just as we had Thoroughly Modern Millie and before that Jekyll and Hyde, but even more so. Fortunately we have a couple of what should be good productions to get us going, this one and Nottingham Operatic's a few weeks later, so we can get an idea of it and then not need to sit through whatever Mansfield and Ashbeians and LEOS make of it. (If we like it enough after twice then we can go and see what John Lewin makes of it with Christchurch in January.) I am slightly too old to have seen the film when young so I am uncertain about what to expect. It was a big effects show on Broadway and I guess this production will be trying to make a splash - Good Companions are back at the Derby Theatre for the first time since I think 2002 and I don't think they'll be skimping.

Parade, Greasepaint Productions, October 26th - 30th

Everyone must come to see this! If you don't come to see a production of Parade when one's available, then you will have only yourself to blame when all there is in the world is people doing Mamma Mia and Full Monty and Disney. Parade is one of the hardest and darkest musicals out there and it is typical of Greasepaint that they should be willing to give it a go, having taken on similar challenges in recent years with Sweeney Todd and Ragtime. I have never seen it performed and really I have no idea how it plays. But I am really looking forward to finding out.

Titanic, Little Theatre Company, November 15th - 20th

The mind boggles. It really does. Burton Brewhouse is a horrid place to put on a show of any scale, a narrow awkward stage with nowhere to move scenery to and nowhere to put a band and the stage on floor level at the front with a million short rows of seats rising steeply into the sky away from you. Little Theatre Company are (or used to be) laughably bad at doing musicals; I haven't been back there since they rolled out an absolutely dreadful King and I four years ago. And Titanic is enormous in its scale and ambition and amount of skill required. What is going to happen here? But as I said just now, if you don't come and see this sort of thing then everybody's just going to do Disco Inferno and "Back to the 80s", whatever that may be, for ever. So come and see it! What's the worst that could happen? (Apart from it hits an iceberg and everyone drowns.)

I don't think these are necessarily going to be the best five musicals of the autumn (in fact if they are I'll eat my head) but they're five interesting ones that I am certainly going to be at. I'll keep you posted.

Sunday, 5 September 2010

how to think about RemoteViews

The RemoteViews mechanism in android is used in two crucial places which anyone writing apps is going to have deal with sooner or later: home screen widgets and status-bar notifications. But the documentation for it lacks a high-level overview and so it is quite hard to understand. Here is that high-level overview.

First, a RemoteViews object is not, whatever you might think from its name, a View. It is similar but don't fall into the trap of thinking it is a subclass; it is more like an alternative.

The RemoteViews mechanism is a way of letting one process pass a chunk of screen to another process to be displayed as part of the second process's layout. You create a RemoteViews object by specifying the layout xml file you're going to use for your chunk of screen and then calling a series of methods to populate the various bits of the layout.

These methods are exactly analogous to the ones you could call on a View object if you'd just used that layout xml in your own process, but there's no underlying View for them to be called on so what's really happening is they're getting stored up to be called later at display-time. When you've finished setting things up how you want them you pass the RemoteViews object to the other process, the one that's going to be doing the displaying.

In the common case you don't do this directly: when your RemoteViews is going into a notification you set it as a field of the Notification object and then when you pass that Notification to the NotificationManager it does the IPC for you, and when your RemoteViews is going into a home screen widget you pass it to AppWidgetManager.updateAppWidget and that does the IPC. When the second process receives your RemoteViews object, with it having been appropriately serialized and deserialized in a way you don't have to worry about, it calls the apply() method on it and then it gets displayed: at this point there actually is a View object and all the things that you did earlier get applied to it.

You can never yourself get to this View object: it's in someone else's process, after all. If at some point you need to change what's in the View you have to fiddle the RemoteViews object and then pass it again to the process doing the displaying, and it has to go through the applying process again.

A note on calling the setFoo methods: these methods don't map one-to-one onto the familiar methods you would use to set attributes of a View. So for example if your layout xml file contains a TextView element which you've given an id using the android:id attribute in your xml - say android:id="@+id/title" - then you don't have a TextView to call setText on but rather you must call setCharSequence on your RemoteViews object, specifying as your first argument the id of the TextView element (in this case R.id.title) and as your second the name of the method you really want to call, in this case "setText".  The third argument will then be the actual text you want to put into the TextView. This means that you can only get to methods of the eventual View which take a single argument, and only if that argument is of one of the types which RemoteViews supports. It also means that in effect your method type checking is put off until run time: if it turns out that there is no method setText(CharSequence) on a TextView, you get an exception when the other process tries to show your view and that's the first you know about it. So you have to be careful.  Observe also that you have to be more precise with thinking about types: there is no method setText(String) on a TextView but normally you can act as if there is because a String is a CharSequence so you will just get setText(CharSequence) instead. But if you try to do the same thing with RemoteViews, by calling setString instead of setCharSequence, then it won't work and you won't find out until you get the exception at run time.