alan little’s weblog archive for june 2005

yoga sutras text complete

27th June 2005 permanent link

My Yoga Sutras project now has the full sanskrit text, in Devanagari and romanised using the standard International Alphabet for Sanksrit Transliteration. The bits I’ve checked are correct, but I haven’t proof read the whole thing yet.

Coming soon: transliterator.py, a python module for transliterating between non-roman scripts and common romanised transliteration schemes. Version 0.1 will support devanagari with three common sanskrit transliteration schemes and (sort of) cyrillic. “Soon” means when I’ve finished checking the Yoga Sutras text that it generated and written (some, at least) documentation.

related entries: Yoga Programming

yogashchittavR^ittinirodhaH

24th June 2005 permanent link

योगश्चित्तवृत्तिनिरोधः

yogazcittavRttinirodhaH

yogaścittavṛttinirodhaḥ

Two things I would have found really useful for working on my Yoga Sutras project (full text coming soon) are (1) a single table showing at-a-glance the characters of the devanagari alphabet, their unicode numeric values, and their equivalents in three of the most commonly used transliteration schemes, and (2) a little program to take a transliterated text and convert it into unicode devanagari.

I couldn’t find either, so I wrote them. Here is the sanskrit-at-a-glance chart. I will be releasing the software as soon as I’ve fixed the (currently) last known bug, and finished checking the Yoga Sutras text it generated.

UPDATE: oops. A moment’s cross-browser testing on my Mac shows that the devanagari text displays just fine in Safari but not in Camino (the Mac version of Mozilla) or Opera. I’d be grateful to hear from anybody reading this how it goes in Internet Explorer on Windows.

related entries: Yoga

to swallow a beachball

23rd June 2005 permanent link

With the summer swimming season coming round, Maria bought Jack a beachball today. Then we noticed the label: “Not suitable for children under three years: danger of drowning or swallowing”. Well balls to that. I have a pretty good idea how much Jack can get in his mouth at one time, and it’s a surprisingly large amount, but it ain’t a beachball.

more testing python

23rd June 2005 permanent link

So I don’t fancy using doctest as my main test tool for python; but I do want to know the examples I’m putting in my documentation actually work. But I like py.test now, and I don’t want to have to use two test tools.

That’s ok. I can just call doctest from my py.test script. Like this:

import doctest
import mymodule

def test_doctest():
    """ Ensure that the examples in the docstrings work. """
    result = doctest.testmod(mymodule)
    assert  result[0] == 0

It works beautifully. Test tools are not one of the aspects of the python infrastructure that it’s easy to complain about.

related entries: Programming

мелодия

21st June 2005 permanent link

So I go into town to see if any of the local record shops have Han-na Chang’s recording of the Haydn cello concertos. They don’t; I pick up one by Anner Bylsma instead. The folks on rec.music.classical.recordings don’t think much of it, but I like nearly all the things I’ve heard by him very much, including ones other people don’t. I decide to trust my own opinion for a change and risk the eight euros.

UPDATE: Public opinion was right and this time I would have done well to listen to it. For once I’m not at all impressed by a record by Anner Bylsma.

While I’m there I notice that Munich’s classical record departments are suddenly flooded with CDs from Melodiya, the old soviet state record company. They’re mostly labelled in Russian. Aha – this gives me a competitive advantage over the other shoppers(*). I can read cyrillic script fairly fluently. I rarely understand much of what I’m reading, even in Jack’s picturebooks, but I can do names of composers and musicians (ya bolshoi kulturniy) and this is wall-to-wall Greatest Musicians Of The Twentieth Century – Sviatoslav Richter, David Oistrakh, Emil Gilels … – in probably amazing 1950s and 60s live recordings. Thankfully no early Borodin Quartet, because it already looks like my wallet could be in for a severe beating here. In the end I manage to get away with only one CD: Oistrakh and Richter playing violin sonatas by Bartok and Shostakovich.

(*) except the ones who went to school in East Germany

related entries: Music

currently listening to …

21st June 2005 permanent link

(actually, was on Sunday evening listening to) … local cellist Johannes Moser, with Ricardo Muti conducting the Bavarian Radio Symphony Orchestra, proving that Haydn was capable of writing music just as wonderful as anything by young upstarts Mozart and Beethoven.

Proving it in this case with his first Cello Concerto in C Major, which apparently was lost for years until somebody found a manuscript in an archive in the 1960s. I’d heard recordings of the piece before, and liked it, but hearing it live was stunning. Haydn gets overlooked, or underrated, these days in comparison to his two younger Vienna contemporaries because they, in their later years, largely invented the concept of music as the expression of the divinely gifted artist’s inner struggles and torments; and we these days, still living in the long shadow of romanticism, tend to think that’s what real Art-with-a-capital-A is all about. Haydn just wrote music, and had a great time.(*)

As somebody on rec.music.classical.recordings wrote:

we have come to value tragedy and irony over comedy and romance; that’s just our historical moment. We’ll get over it in time. In the meanwhile … Haydn sits there and smiles, patiently waiting for us.

What recordings would I recommend? I wouldn’t, because I’ve only heard two, by Jacqueline du Pré and Mstislav Rostropovich, and I don’t find either of them completely convincing. They’re ok, but both really too romantic for this music. The folks at rec.music.classical.recordings, on the other hand, have heard lots and have strong opinions on them. Han-na Chang has recorded it. I was very impressed when I heard her playing Prokofiev a few months ago, so that’s clearly one for the shortlist. There are samples of it here, but they don’t work with my version of the RealAudio Player.

Maria is generally unimpressed by all this effete Austrian chamber orchestra stuff, and doesn’t feel she’s had her money’s worth until she’s heard a big romantic orchestra belting something out. Preferably something Russian. But that’s ok because after the interval the Bavarian Radio suddenly swelled to 90-plus musicians (having presumably rounded up half the freelancers in Bavaria) for Scriabin’s Third Symphony. That’s a kind of music I personally find it hard to see the point of, although the big waves of sound were undeniably impressive.

(*) I also read on rec.music.classical.recordings that Haydn – whose music could easily be mistaken for the epitome of genteel respectability (or “aural wallpaper for aristocrats (albeit often superbly well done)”) – was in the habit of going out with his violin to folk music sessions in villages on his patron Count Esterhazy’s estate, “just for a few hours dear”, getting blind drunk and coming back days later claiming little or no recollection of what happened.

related entries: Music

photojournalism in the desert

18th June 2005 permanent link

Having been impressed by Stephen Bungay’s book about the Battle of Britain last year, I’m currently reading his one on El Alamein. Which I’m not finding so impressive.

The photos are interesting though. They’re contemporary press photos, taken by not-now-famous photojournalists of the time. A lot of them are pretty good, but it struck me that they’re good in a way that’s very different from the better known black & white photojournalism style of the 50s and ’60s. Even in small book reproductions you can see that these are technically lovely black & white photographs. Razor sharp, beautifully subtle tones – especially considering the harsh desert sunlight they were shot in. The lighting is consistently high key – predominantly pale tones, contrast and areas of heavy shadow not used heavily as compositional features. But the compositions are stiff, formal, posed-looking. Often because they were posed: Bungay mentions that one picture, famous at the time, shows Australian infantry assaulting their own cookhouse for the camera.

Partly, perhaps, the 1940s guys, although competent, just weren’t as good as some of the great photojournalists of the post-war years. (Raymond Depardon, whose career began in the 1960s, is the great desert photographer). There’s more to it than that though. It’s about differences in both equipment and attitude, with the equipment making the attitude possible. 1940s press photographers were mostly still using large format cameras with 4x5 inch sheet film. Crown Graphics and the like (on the Allied side: the Germans might have already had somewhat smaller Rolleis). With a piece of film roughly ten times the size of a 35mm negative, these things then – and still to this day – produced images with resolution and tonality no 35mm camera (and only digital cameras costing tens of thousands today) could come close to. But they were big, clumsy, slow-handling beasts, difficult to use rapidly in fast-changing situations like battlefields.

High quality small cameras shooting 35mm movie film were first developed in the 1930s by Oscar Barnack of Leica, followed by the first Nikon SLRs in the ’60s. Leicas weren’t widely available outside Germany until after the war, but when they were they made a whole new approach possible. They couldn’t come close to the technical quality of black & white pictures from the old press cameras, but their lightness and speed of use made a much more “authentic”, genuinely close-to-the-action-style possible. This goes along with much more fluid, spontaneous-looking composition.

The most famous postwar photo agency, Magnum, was founded in 1948 by a small group of already well known photographers including Henri Cartier-Bresson and American war photographer Robert Capa, whose photos of the Normandy landings in 1944 were one of the best known early example of the new style. The Magnum guys and others even took the technical limitations of what could be done then with tiny little black & white negatives and made them into a new and different photo-verité aesthetic: lots of heavy contrast to make strong compositional blocks, in place of smooth midtones and sharp detail. You couldn’t do those anyway with 35mm film, no matter how mechanically and optically wonderful your Leica was.

“Spontaneous-looking composition” doesn’t mean “pointing a camera at random and firing away”. The pictures of, to take two examples, Cartier-Bresson or the great contemporary war photographer James Nachtwey, are masterpieces of elegant composition. It’s just that they are such highly-practiced masters that they can do it quickly and almost unconsciously, watching for the moment in fast-moving situations. And maybe because they’ve trained themselves to do it instinctively, it isn't obvious what they’re doing. Not to me anyway. I’ve spent hours gazing at pictures by both of them, asking “How did he do that? Why does this have such a strong impact?” and not coming up with answers.

(The standard of photo reproduction in books, even in cheap paperbacks, seems to be higher than it was a few years ago - or maybe Mr Bungay’s publishers Aurum, who I haven’t otherwise heard of, are particularly good)

I’m writing this one the train, unfortunately, so I can’t look for online examples of the kinds of photograph I’m talking about. I might try to dig some up later.

related entries: Photography

testing python

17th June 2005 permanent link

I needed something to do automated testing of a python script for a project I’m working on. Python has several automated unit test tools, but choosing one of them turns out to be far easier than negotiating the python web frameworks labyrinth.

There is a testing module, unittest aka PyUnit, included as part of the standard python library. People don’t generally seem to like it much though – it’s a copy of Java’s JUnit and [therefore?] seems to be verbose and tedious to use. I had a brief look at it a while ago but didn’t get very far.

Next stop: check the blogs of a couple of widely respected python developers to see what they use/like. I recollected both Ian Bicking and Phillip Eby saying favourable thing about something called doctest, and it looks like I recollected correctly. Phillip likes it very much.

I don’t immediately fall in love with the look of the thing, though. Writing a simulation of an interactive python interpreter session inside a docstring seems kinda clunky.

I also notice, googling around, that there’s another thing called py.test that seems to be popular. Ian really likes it. I decide to give that a go.

I really like it too. A little manual path-fiddling required to get it installed and running, but once that’s sorted out it works first time, and it’s really clean and easy to use. A simple naming convention is all it needs: you write a test srcipt called test_whatever.py, containing methods & functions also named test_whatever. If you need it to, apparently it will search directories and directory trees for however many test_whatevers you care to produce; I only have one at the moment. test_whatevers contain normal succinct python code, no wierd or elaborate conventions required, that call the module you want to test and assert what you expect the results to be. py.test runs them and if anything doesn’t behave as expected, reports what actually happened in a very readable format that makes debugging easy. The documentation is pretty good too – a refreshing departure from the open source norm.

Having the test suite written in something as succinct and elegant as normal python seems like a promising way to avoid the biggest automated test problem I’ve had with other projects and other languages: you start off with a nice automated test suite and the best intentions, but maintaining the test cases gradually (or not gradually) becomes more effort than maintaining the actual code. Sooner or later you give up.

Overall impression so far: easily the best automated test tool I’ve used.

Here’s a more detailed and very helpful review by Grig Gheorghiu.

related entries: Programming

germans like rules

11th June 2005 permanent link

Dog Bites Man. But still, I found a little incident that happened to me this evening striking. In Germany, most minor road junctions have no stop lines or right of way markings, and there is a general rule that you give way to traffic coming from your right. Fair enough – clear, simple, safe. But like all rules, there are cases where blindly following it would result in doing something silly, so you should use your initiative.

Such as: I wanted to turn left, and there was a line of cars in the road I wanted to turn into. I was coming from their right, so I had right of way. But the road was narrow, there were parked cars and not enough room to pass. I would have had to turn, pull up behind the parked cars and wait for the other guys to go. That seemed silly, so instead of making the turn I waited and waved them through. The first guy got the idea and went; the second one went into into such a paroxysm of hand-waving shock and denial at being asked to Break The Rule that I gave up and did the silly manoeuvre anyway.

One nervous driver doth not a country make, and I freely admit that Germans in general are the best drivers of any country I’ve driven in – that being most of western Europe, India (even scarier than Italy) and the USA (generally ok apart from rush hour in Houston). I mostly put superior German driving down to the no speed limit autobahns. Freedom breeds responsibility; trundling along at 100+ mph yourself, whilst being suitably wary of and ready to give way to giant Mercs and low-flying Porsches that come up behind you like you were standing still, seems to train people in the right mix of competence and caution.

And: sometimes rigorously following rules produces good results. Germans have rigorous rules that they have followed for centuries about how to brew beer, some of which are written down in the famous 1516 Rheinheitsgebot (Purity Law). Result: Bavarian beer is the best in the world. See also Belgium, another notoriously bureaucratic and over-regulated country: world’s second best beer. (Some beer connoisseurs might say Belgium first, Bavaria second. They are wrong, but in any case I think few would dispute that those are the top two)

blogging advice

9th June 2005 permanent link

If you don’t have time to finish writing anything substantial, you can at least keep the momentum going by publishing inconsequential little five minute scraps. (The number of people who have emailed me in the last two days wishing me luck with my week as a single dad is – well, not huge, but more blog-related correspondence than I normally get in two days. Thanks folks). Alternatively you can publish embarrassingly unfinished skeletal drafts of more substantial things, on the basis that (a) again, it at least gives the feeling and appearance of having done something, and (b) you have more incentive to work on an embarrassingly unfinished skeletal draft if it’s out there in public for all to see, than if it’s sitting in the “Drafts” folder on your laptop and nobody else knows it’s there.

So, I have just published an embarrassingly unfinished skeletal draft of Alan’s online edition of the Yoga Sutras of Patanjali.

What’s that about then? As a barely-intermediate yoga practitioner with a barely-rudimentary grasp of sanskrit, I’m scarcely very well qualified to have opinions on the fundamental yoga text. But I do have a small collection of notes, quotes and thoughts on various bits of it and I thought I might as well pull them together, for my own benefit and in case they might be of interest to anybody else. Also, most of the online and paper editions I’ve seen have the sanskrit text in either devanagari or transliterated, but not both, and I find it useful to see both; and websites that have the text in devanagari often have it as images rather than proper editable, copyable, linkable text. (For good reason, as I quickly discovered – a lot of browsers still don’t display devanagari text properly. Presumably as India steadily becomes the software capital of the world somebody will eventually get round to fixing this). So if nothing else, my “edition” will at least have the devanagari text as proper text, plus a standard transliteration.

UPDATE: Lianne from yogalila points me at Kofi Busia’s site, which has the sanskrit text in a font that apparently displays correctly for her in Firefox, although it doesn’t for me in Safari. He also has audio of the Sutras being chanted.

related entries: Yoga

currently listening to …

8th June 2005 permanent link

… the always-magnificent L'Archibudelli playing Beethoven’s String Trio opus 9 no.1, in BBC Radio Three’s Beethoven Week.

I had to suffer through an hour of assorted horrible songs and silly wind trios to get to this marvellous piece of music, thus proving that even Beethoven had off days and sometimes scribbled things down because he needed the money – the BBC did say they were going to play all of it, and they clearly meant it.

Radio Three’s internet feed (RealAudio, and sound quality pumping my Powerbook’s headphone output through a proper amp and speakers is just fine) is here. Highly recommended.

related entries: Music

bbc beethoven week

7th June 2005 permanent link

Since I’ve been using del.icio.us for links-with-short-comments, I haven’t generally felt the need to link to things here when all I have to say about them is “go and read this”. Go, however, and read Brian Micklethwait’s magnificent piece on Beethoven’s Eroica on samizdata:

It is one thing to hear the first two chords of the Eroica for the hundredth time, in an age of stadium rock and hi-fi volume knobs on our CD players; quite another to hear these two explosions when they were the loudest and most bad-mannered musical noises that anyone had, until then, ever heard indoors.

Beethoven turned music from being the mere supply of aural wallpaper for aristocrats (albeit often superbly well done) into the supreme vehicle of personal artistic expression. Not even Mozart ever went as far as Beethoven did with the Eroica.

… and when you’re done (or, indeed, first) listen to Wilhelm Furtwängler’s utterly amazing December 1944 recording of it with the Vienna Philharmonic. I have nothing to add. Except – Brian, please do something about at least getting the archives on your own website back into working order, even if you don’t want to carry on putting new stuff there.

related entries: Music

delicious dilemma

7th June 2005 permanent link

But before I go off to be a single dad for a week, a few further random thoughts regarding del.icio.us

Clay Shirky’s essay on ontology and classifications – formal, top-down versus informal, bottom-up, with del.icio.us as an example of the lattter – is quite interesting.

Del.icio.us had a downtime on Sunday for a server swap. I’m sufficiently heavily invested in the thing – I basically keep all my links there, I don’t use bookmarks any more except for a few quick toolbar shortcuts (bookmark management in Safari is horrible anyway) – that this was quite alarming. “Back up my del.icio.us links”, which has been sitting in my to-do list under Odds & Ends To Maybe Do One Day for quite some time now, suddenly leapt to the top of Do Now.

Del.icio.us provides an rss feed of a person's links, but that didn’t do the job as it only includes recent items. A moment’s googling reveals the delicious.py python module which gives access to the full del.icio.us api, making it very easy to write a script that calls posts_all() to pull down everything for a user and saves the results to a file. Now I just have to remember to run the script from time to time.

The main problem with using del.icio.us as my main bookmark manager (the other main problem, aside from the fact that my bookmarks are on somebody else’s server that might go away at any moment) is that, as I said previously, “there are things I might want to bookmark that I wouldn’t necessarily want the whole world to know”. These turn out to be fewer than I thought they might be – I’ve always been somebody who habitually plays his cards close to his chest for no particularly good reason, so doing a large chunk of my personal note-taking in public is a novel experience – but here’s an example of something I won’t put there:

I was scanning other people’s links in one of the tags I use to see if there was anything interesting, and came across a user who I think, based on what s/he appears to be interested in, is somebody I know. “Know” in the virtual sense – never met, but I read their blog, they read mine, exchanged emails a couple of times. The convenient thing for me at this point would be to link to this person’s links with a note saying “keep an eye on these, I think this is XXX” . But since XXX – if that is indeed who it is – has chosen not to use his or her real name in this context, it would be rude in the extreme for me to go and blurt it out in front of everybody. (I’ve already been told off, on a previous occasion by a different person, for linking in my blog under somebody’s real name to their pseudonymous blog) So I'll just have to use a bookmark, which I’ll then lose or not have on the computer I’m using when I want to refer to it; or put a link on del.icio.us without mentioning the person’s name, so that the next time I notice it I won’t remember why I put it there.

UPDATE: I went to send an email to the person I thought this was, and noticed that yes, it is who I think it is, because the name they’re using on del.icio.us is their email address. So maybe outing them wouldn’t be “rude in the extreme”, just a bit gauche. I’m still not going to do it.

single parent

7th June 2005 permanent link

Oh well. My promised resumption of normal blogging activities may have to wait a little longer: Maria just left for a conference, so I am a single parent for a week. Woo hoo. Time to see what wild crazy bachelor activities a two year old boy and his forty-something dad can get up to.

Meanwhile, do women understand men better than men understand women?

Me this morning: Can I help you in any way?

Maria: What, help me pack? Are you mad? You’ll just say things like “how can you possibly need that many cosmetics & shoes?” Leave me alone

all text and images © 2003–2008

< may 2005 july 2005 >