1. Barcelona '08

    We arrived in Barcelona a few days ahead of Primavera, to give us a chance to see the sights and relax a little. It's a compact city, although larger than I thought it would be, with a wide variety of flavours to the various districts. The weather has been variable, but never unpleasant.

    It is a very clean city, they seem to constantly empty the bins on a daily cycle, and there are recycling stations everywhere. The architecture is wonderful. Not just the Gaudi, which is as astonishing as you'd expect, but there's an adventurous sense to public space everywhere, interesting modern building nestling up against 14th century alleyways, and giant lumps of sculpture sprouting everywhere, in a manner you only rarely see in conservative old Britain.

    We've mostly been rehearsing our body clocks for the ever so slightly mental 5pm-5am Primavera schedule, and so we've not done so much cultural sightseeing, or eating out. I figured it can wait until the now inevitable follow-up visit.

    posted by cms on
    tagged as
  2. Appearing as part of Dot to Dot , an excellent city-wide music hullaballoo, spanning multiple venues. As the schedule didn't really sit very comfortably with my travel plans, flying out to Barcelona the next morning, I didn't really get a chance to see many sets, just some of Fight like Apes ( excellent ), Montreal's We are Wolves ( good stage moves ), Two Gallants ( dull enough to make me wander away and play Sonic the Hedgehog tennis on a nearby X-Box demo machine. Two thumbs up for Sonic Tennis, though ).

    In fairness, the latter looked like they might be quite interesting, given enough familiarity with the material, and I'm tempted to chance an album, but I wasn't really feeling it. And the main reason I was actually in the Trinity, was to catch the headliners, Spiritualized, one of my all time favourites.
    Spiritualized at the Trinity

    I thought they played a blinder. The Trinity is fast becoming one of my favourite Bristol venues, great sound, good bar, and it's incredibly handy to reach on foot. And they keep booking my favourite artists.

    The band were really together, there's the welcome return of the gospel backing singers, excellent lightshow, and J. Spaceman is looking great and singing better than he ever has, at least to my ears. New album out now-ish.


    posted by cms on
    tagged as
  3. It's been a few years now since I last went to Glastonbury, and the last few summers have been festival-free for me, save for local city-wide affairs like Venn . I came very close to attending the 'End of the Road' festival last September, tempted by a very me-friendly line up, but it wasn't very compatible with school term dates, and last summer's terrible run of weather just left me procrastinating about it until it was far too late to bother.

    In the U.K. there's almost too many to choose from now, spread right across the summer, with something happening seemingly every single weekend from May to September. This means that it's now becoming something of a stadium tour circuit, and with a depressingly production-line feel to the majority, it's increasingly hard to differentiate them.

    End of the Road didn't seem to have as many must-see bands this year, and so my attention wandered a little further afield. A couple of years ago, I noticed the Primavera Sound festival, in Barcelona had a line up of acts very much in tune with my way of thinking. I've wistfully looked at it every year since then, and this time around I've actually decided to go.

    It seems to be built around the music, with a thoughtful and genuinely alternative line up , very much my sort of thing. There's a great mix; bands I currently like very much and would really like to see ( Boris , Animal Collective , Okkervil River , Prinzhorn Dance School , Six Organs of Admittance , Om ), significant 'legacy' acts ( Devo , Public Enemy , Dinosaur Jr. , Shellac ), critically favoured 'name' acts ( Portishead , Cat Power , Rufus Wainwright ), favourite acts I've seen before ( De La Soul , Tindersticks , British Sea Power , Explosions in the Sky ), and, perhaps a new trend, bands with amusingly rude names ( Holy Fuck! , local outfit Fuck Buttons , and the charmlessly named Pissed Jeans ). My single line up complaint is that it's a European festival, and there's no dEUS , even though they have a new album out to promote.

    Like every festival, it's sure to be pointless attempting to programme any kind of strict itinerary. Events will indubitably conspire to wreck it. Given my estimate of at least 70% of the acts being the sort of thing I'd go and check out if they were playing locally, I think the best policy is to be mostly be guided by serendipity. Suggestions for things to check out are welcome!

    The festival site is next to the sea , and just a couple of km out of Barcelona itself. We're going for the whole week, flying out on the 24th and returning on the 1st of June. I've rented an apartment, right on the waterfront in Barcelonetta , which looks like it ought to be within fair walking distance of the site. This gives us a few days preceding to acclimatise, relax and see the sights before the festival properly starts.


    posted by cms on
    tagged as
  4. A party to celebrate Mrs S's impending 30th birthday.

    1978 party

    Lots of fun. Lots of great costumes. The standard of costume was high, people really made an effort. Even Andy wore a vaguely 70s T-shirt.

    I took plenty of photographs, but my tiny little Canon IXUS is tragically poor at indoor and low light photography. Here’s most of the ones that are worth sharing.

    posted by cms on
    tagged as
  5. Ever wanted to combine multiple individual PDF files into a single PDF document? Say you were scanning a paper document, a page at a time, and wanted to collate the digital pages back into a single document. Or collect together a number of similar PDFs you'd generated
    via 'Print to PDF', perhaps to send via email.

    You can do this incredibly simply in Leopard, without resorting to any additional software. PDF is such a fundamental component of Mac OS X, you can script operations like this using a very simple Automator workflow.

    Just build the following sequence of actions.

    1. Files & Folders: - Get Selected Finder Items
    2. PDFs: - Combine PDF Pages
    3. Files & Folders: - Open Finder Items

    Select all the individual pages in a Finder window, and then run the workflow. After a short wait, while the actions are run, a multi-page PDF will open in Preview. Choose 'Save As', to create a new file. Notice the optional Quartz Filter operations you can apply to the new document when you save.

    posted by cms on
    tagged as
  6. Another kind of iteration you often want to do when constructing programs, is to count things. Quartz composer provides the counter patch, which increments a running total when one of it's inputs switches from false to true. Similarly, it decrements the total whenever the signal to it's other input changes from false to true.

    By generating a regular true/false alternating value, and connecting this up to the increment line, you could generate a regular count. This composition demonstrates one way to do this. Using the Patch Time patch, a count of time in seconds is passed through a modulo 2 operator to generate a regular sequence of alternate 1s and 0s. This is connected up to the increment line of the counter, which then counts upward in integers.
    quartz composer counter generating stripe width

    The counter value is used to govern the stripe width of a vertical stripe pattern. As the patch runs, the stripe width increases every other second. This is a very simple display, but the bit generator and accumulator demonstrated are useful in a variety of ways. You can download a copy of this patch here .

    posted by cms on
    tagged as
  7. Quartz composer is a visual programming tool from Apple that ships as part of the Developer tools with Mac OS X 10.4 or later. It presents a visual object-oriented programming metaphor around Quartz and Core Graphics that allows you to simply compose graphical effects by connecting inputs and outputs of different objects together, graphically.

    You can use QC to build pipelines that respond to a variety of inputs, local or via peripheral interfaces to construct visualisers for a variety of source signals, such as MIDI, audio from the built in mic, video signals from an iSight camera, or even networked events from computers on your internet or LAN. It also can be used to procedurally generate graphics, which you can use to build fancy displays or screen savers. Some of the system screen savers that ship with OS X, like the 'word of the day' or the 'rss visualiser', are actually simple Quartz Composer scripts.

    It's an impressive tool, and ships with documentation and some examples of what you can do. You can achieve nice effects quite quickly, but there is still a learning curve to climb. As an example, a common thing you might want to do when constructing simple animating displays, is loop over a set of possible outcomes. Iterators are a common piece of the vocabulary of programming languages, but it took me a little while to figure out how to achieve this with the 'box and string' interface of this tool.

    Here is a simplistic solution solution I came up with. This sample patch demonstrates cycling over a fixed set by rendering live video from an iSight onto the surfaces of a 3d spinning cube, applying a cycle of realtime video filter effects to the image.

    quartz-composer patch editor

    You can follow the patch from left to right. The brains of the procedure is the multiplexer , which is a patch that selects one out of a set of possible numbered inputs, depending on the value fed into it's Source Index field. In order to generate a periodic iteration over the right integers, I'm employing a linear interpolator, with a range of 0 - 3 , over a duration of 20 seconds. Because this is generating floats, I'm plugging it through a Round patch, that grossly rounds it to the nearest integer, before feeding it to the multiplexer. To get an even rounded cycle, tweak the interpolater range down a step, -0.5 to 2.5. The rest of the sequence is simple - the video input is split through three filters, one of these paths is selected via the looping mechanism, and that output is connected to the Image property of the built-in cube patch.

    Here is the 7.1Kb .qtz file . It's not a terribly pretty end result, but it is quite impressive considering that it's such a tiny source file. The looping construct it illustrates is very simple, but could be used to build up any sort of repeated cycle over a set of different input paths, such as image files, or colour tones that you could connect to other patches to build cyclic displays.

    posted by cms on
    tagged as
  8. XCode has a nifty integrated debugger which is really a pretty wrapper around gdb . It lets you point and click, and drill down on things within the gui with ease, but still preserves access to the underlying raw gdb console and output. You can create breakpoints and watches, both literal and dynamic, step through your application as it runs, all the usual stuff.

    I'm not the world's greatest user of debuggers. I'm more likely to trace through things until they make sense using some combination of logging, print statements, paper and pencil, or my absolute favourite, just explaining your mystery problem out loud to a nearby third party, embarrassing yourself by spotting the obvious bug mid-flow. That last one sometimes even works with the dog. Sometimes though, you're stumped, and you want to set some watchpoints, step through your program as it executes, or just generally prod things mid-run, and poke around under digital rocks.

    Something I've been trying to practice recently is Test Driven Development . XCode 3 ships with support for the OCUnit testing framework built in. You can add a Testing target to your XCode project, and build up test case classes that use this framework, and the build tools know how to run these through the test harness. And so you progress, write a test for a feature, run the test harness, write code to pass the test harness, repeat. It's a great way of not only catching certain classes of bug before they happen, but perhaps more interestingly imposing a more minimal design focus on your application as you build it; you're automatically casting yourself more in the mind of a consumer of your application services, something I find really helps avoid over-design.

    At some point though you are likely to run into some kind of hard to understand failure case within a unit test, and find yourself reaching for the debugger. And then finding that the debugger doesn't work. This is because the runtime of your unit testing target is actually the separate test harness framework, and not your application target. The test harness is a regular application that's dynamically loading your test classes and running them. In order to be able to use the IDE to debug your unit tests, you just need to do a little extra configuration within your XCode project, as follows.



    The tool that runs the tests is called otest . You need to add this to your XCode Unit Test target as the executable. You can do this with the command ' New Custom Executable ' in the Project menu. Add /Developer/Tools/otest .

    Once it is added, set it as the active executable for the Unit Testing target, using Set active executable , in the Project menu. A green tick badge appears over the active exectuable in the xcode source list.

    otest as active executable

    The otest tool expects to be run with a certain environment, and arguments. There's a man page that describes them. You could run gdb against the otest executable from a shell in this fashion, but it means switching away from XCode. Alternatively, you can set up XCode to provide these when it runs your target by double clicking the otest executable in the source list to bring up it's inspector. The runtime settings you need to set are all on the Arguments tab.

    Add two arguments -SenTest Self and the name of your Unit test bundle, which will be the name of the Unit Test target with a '.octest' suffix e.g. "My Unit Tests.octest" . The quotes are important, if you have whitespace in your bundle name. Make sure that the order in the inspector list has '-SenTest Self' as the first element, and the bundle name the second, so that when they are concatenated to a command line, the switches come before the bundle name.

    otest executable arguments pane


    You also need to set two environment variables, in the lower pane of the arguments inspector, so that the dynamic linker can resolve your test components. The lower pane of the Arguments tab covers variables. Add two items to this list, DYLDLIBRARYPATH and DYLDFRAMEWORKPATH . Set both of these to be $(BUILTPRODUCTSDIR) which is the variable xcode build will populate with the correct destination of your compiled test cases object code.

    otest exectuabel environment variables pane


    With all of this set, you can just use the debugger within XCode. Click to set break points within the editor as you write your test cases, and the debugger will spring into action appropriately, whenever you build and run the test target.

    posted by cms on
    tagged as
  9. Once upon a time, I used to earn a living using awk to do neat things it shouldn't be used for. I never came up with anything as sexy as this though . These days, awk mostly stays in the toolbox, and I just use perl.

    posted by cms on
    tagged as
  10. Imagine the fun you could have sneaking round your local technology emporium and judiciously applying one of these labels to anything you think deserves it.

    posted by cms on
    tagged as
  11. It shows how infrequently I use it these days, but I yesterday found myself using a remote X client on my Macbook, and to put it bluntly, the X11.app as shipped with leopard is fucked. When I was working for IMDb, this would have scuppered my world. I can't decide if I even need it enough now to make it worth trying to fix.

    Update:


    Of course I had to try! Installing the latest community developed packages seems to fix most of the immediate problems, giving a useable X11. And the new code base, and launchd integration bring real improvements over Tiger. Now quartz-wm is open source, X11 on the Macintosh can be synchronised with X.org. It would be even better if Apple folded some of these fixes into official updates.

    posted by cms on
    tagged as