alan little’s weblog archive for august 2005

one that got away

23rd August 2005 permanent link

But before I go, a cheeky re-post of an old piece from 2001 that I found whilst looking round the dusty attics of my pre-blog photography pages.

Imagine a photograph. A low hill in the New Mexico desert. Sagebrush under a black stormcloud sky. A red dirt road runs up diagonally leftward from the bottom right of the frame. At the top of the hill, a windmill glows against the black sky, pinpointed by the last gleam of the sun before the storm closes in.

I thought “wow, look at that” and didn’t stop. Two days before it had dumped a metre of snow in one night – Easter Sunday 1999, and the biggest snowfall of the year according to the locals I talked to. Driving my rented four wheel drive across the Jemez mountains west of Santa Fe the day after the blizzard was great fun – starting in the morning, with the whole day to get myself out, or hope for somebody to come by, if I got stuck. But this time it was five in the afternoon, I had thirty miles of dirt road to go before I got to the highway, then another fifty to the next small town and motel. I wanted to stop and get the camera out but I told myself not to take a stupid risk for the sake of a picture. By the time I reached what passes for civilization in northwestern New Mexico it had been snowing hard for ten miles.

Ansel would have screeched to a halt anyway, set up his tripod and eight by ten view camera in two minutes, and produced another Moonrise, Hernandez. And either got caught out in the blizzard or not, but not cared too much either way.

Some of the ones you don’t get stick in the mind’s eye the most. Besides, it probably looks better there than I could have managed on film.

related entries: Photography

hating css (part three)

22nd August 2005 permanent link

I bloody hate bloody css (part three).

Did you know that if you have several <div>s floated inside another <div>, and you want some more text to appear below the floated <div>s, then merely putting the text at the end of, or after, the enclosing <div> doesn’t work? The text appears to the right of the first row of floats. That to fix this you have to use the ugly and non-obvious hack described here?

I didn’t, but several frustrating subway journeys’ worth of trial & error (when I could otherwise have been doing something interesting) later, I do now. As a result my yoga pictures page now has a somewhat more modern look, and a lot more useful links, than it had previously.

And that’s it for a while. Our wedding party is this weekend. The Russian guests already started arriving last weekend and I pick my folks up from the airport tomorrow. After the party we have a week’s honeymoon; if I take my laptop it will be strictly for backing up photos.

the strength of weakness

22nd August 2005 permanent link

A Monday Family Life Vignette.

Suppose you and your two year old son have just had a Difference Of Opinion on the subject of whether you should finish eating your breakfast, or immediately go and build lego houses (whose inevitable fate is to be admired for a moment then smashed to the ground). You are aware that too much giving in to toddlers’ demands is Bad For All Concerned in the long run – and you want to eat your breakfast. Toddlers meanwhile are not big on concepts like Seeing The Other Person’s Point Of View and Accepting Defeat Gracefully.

So he decides to Continue Diplomacy By Other Means. You are to be dragged bodily from the breakfast table into the room where the lego is. He takes hold of your hand. No problem, you think, you are six times his weight. Ah, but … he has more at stake in this than you do and furthermore, you soon realise that if you let go, or pull back suddenly, he will either crash backwards into the cooker or fall full length on the tiled floor. You don’t want that to happen. Slowly, reluctantly, but inevitably, you start to rise from your chair …

Parents of toddlers will recognise this scenario immediately. I’m sure this isn’t the only sphere of human endeavour where it occurs.

synergies may fulminate

18th August 2005 permanent link

Therefore, synergies effects may be fulminate.

… concludes Paragraph Six of Section 4.2.1.4, “Risks and Issues”, of a software specification I’m reviewing this afternoon.

The company where I’m currently working has a rule that all formal software documents should be written in English, because (a) it’s a subsidiary of a British company and (b) a lot of the development work is being done in India, where German language skills are thin on the ground. As a rule I try to avoid making fun of imperfections in my German colleagues’ English documents. It’s unahimsic to take the piss out of people, and furthermore people who live in glass houses … there’s no way in the world I could write a 70-plus page specification in German and not have bits in there that a native speaker would find difficult to understand and/or funny.

I do, however, think it’s slightly odd to have documents that are the basis of large, expensive software development contracts written in somebody’s second language and not reviewed by a native speaker (by which I mean reviewed purely for language, which isn’t what I’m supposed to be doing here). The general standard of English in these things is pretty good, but there are often bits that are ambiguous, that don’t say what the author appears to think they say – or, on rare occasions like this one, that are flat-out incomprehensible.

I can’t see that there’s any risk of betraying commercial secrets by quoting this. I wish my client’s competitors the best of luck trying to guess what it might conceivably mean.

adventures in cookery

15th August 2005 permanent link

Cookery lessons I have learnt lately:

Instant dosa mix, impulse bought because you happened to see it in the shop: disaster. Pan full of sticky goop. Get your rice, get your beans, get your methi seeds and do it the way your teacher in India taught you: success. In cookery, as in yoga, shortcuts rarely produce good results. Following the traditional method takes more time and effort, but does produce consistently good results.

But the day after your successful masala dosa party, eating leftover coconut chutney with frozen shop-bought chapatis seems like a pretty sad reminder of a day trip with a friend in India, where our packed lunch was light, fresh, buttery chapatis made that morning in his mother’s farmhouse kitchen, and salty, spicy coconut chutney with red chillis and coconuts fresh from the tree on his father’s farm. Those were good times. These are too but … those were too.

I do make my own coconut chutney, but with dried coconut from the shop – Bavarian city planners having unaccountably forgotten to line every road with coconut palms as they do in India – and of course it’s not the same. I can make my own chapatis but, as one of my cookery gurus explained to me, it’s something you really need to practice every day – like yoga – and I don’t. Shop-bought ones do taste terribly of preservatives.

related entries: Yoga

more languages and languages

13th August 2005 permanent link

Ian Bicking has more to say about the complexities of using python and unicode to deal with languages that don’t easily and conveniently map one written character to one sound or one unicode code point, in the form of a pointer to some very useful notes and links from Aaron Lav.

Aaron is mainly interested in Chinese. In Ian’s comments I pointed out that things aren’t completely straightforward in Indian scripts & languages either:

There are all sorts of messy hacks in Unicode.

Take Devanagari for example. Devanagari is the Indian script used to write classical sanskrit, hindi, nepali, marathi and some other languages adding up to the mother tongues of several hundred million people. So quite important to get right really. Devanagari is a kind-of-syllabic alphabet in which consonants are normally are read as including an implicit "a" sound - so "t" is read as "ta". (Unless it's at the end of a word in hindi, I believe). There are supplementary characters to replace the "a" with other vowels or suppress it completely at the end of a word (except in hindi, where it's suppressed automatically anyway at the end a word. I think).

There are also compound consonants, e.g. the "tr" in the word "sutra". These have their own written characters, which are (mostly) recognisable as combined versions of the two root characters. These ligature characters are not conventionally regarded as letters in their own right even though they are written/printed as single characters, and they don't have their own unicode code points. Instead the "tra" in "sutra" is written as three code points: Ux0924 TA, Ux094D VIRAMA to suppress the implicit A in TA, Ux0930 RA.

So how many characters is Ux0924Ux094DUx0930?

It's one on the printed (rendered) page. Linguistically it's normally regarded as two, TA & RA combined. It certainly isn't three, using the VIRAMA to signal a ligature in that way is a Unicode hack not a part of the real script. (Nor is it six, as some idiot who didn't know they were dealing with a utf-8 encoded version might conclude from counting bytes).

(Sorry for the lots of words and no visible examples. It's late at night, I don't know if your comments system would handle unicode examples correctly, and even if it does several browsers - basically all Mozilla variants - don't display devanagari ligatures correctly anyway. I raised this as a bug nearly a year ago, no sign of progress. Presumably all Indian hackers are southerners and don't care if hindi-speaking northerners get to read stuff on the web or not)

UPDATE: having thought a bit more about it, the “length” of the unicode sequence Ux0924Ux094DUx0930 (त्र) depends on what you want to use it for. In different circumstances it can reasonably be said to be any of:

I think (3) is the least common use case, although I suspect it is both what Ian would regard as “correct” and what most unicode libraries would tell you.

related entries: Programming

404 not found

12th August 2005 permanent link

More metablog navel-gazing: a year or two ago, the vast majority of the 404 not founds in my site logs were worms looking for IIS vulnerabilities. I notice in my latest batch of logs that these have decreased dramatically; I assume there are a lot more of them in the wild than there were a year or two ago, so ISPs and hosting companies must have got a lot better at filtering the bastards out before they actually reach the hosting servers. Well done chaps, keep up the good work.

This means, however, that nearly all the 404s I’m now getting are entirely my own fault for not running my link checker as often as I should. Most of them are internal links, some aren’t. I apologise for example to photographer Jim Nilsen, whose pictures would have been seen by 190 more people if I hadn't screwed up my link to them. Being fixed.

the public wants what the public gets

11th August 2005 permanent link

Looking at my site logs I discovered that this blog now (finally) gets more page views than my Mysore Diary from three and a half years ago; also that my other most-viewed page is my yoga pictures page, largely because it’s the number five hit on a google search for “yoga pictures”.

There’s not much there though. That’s fine in terms of the actual pictures – quality over quantity, although I could certainly vary them a bit and add a few now and again. But the layout is primitive and dull-looking, with very few links to my other pages. That needs to change if the page is de facto one of the main gateways to alanlittle.org. Being changed.

kali ray

6th August 2005 permanent link

Last week I went to a yoga class with well-known American yoga teacher Kali Ray. I’m perfectly happy that ashtanga vinyasa yoga is right for me, and in general I don’t go to other kinds of yoga class these days, but big-name famous yoga teachers don’t some to Munich every day and I was curious. (I wrote these notes for a yoga message board, but then it seemed a shame not to get maximum mileage out of them)

General Atmosphere: too many pastel cotton salwar kameezes and fixed smiles, and not enough faded sweaty lycra, for me to be completely comfortable. That’s just my personal cultural prejudice, your mileage may vary. (I’m completely comfortable with rotund elderly Indian guys teaching classes in their underwear)

Format of the class: chanting, asana, pranayama, meditation.

Chanting: om nama shivaya. Fine by me: I enjoy a chant now and again, and have the utmost respect for Lord Shiva. Not sure if it’s completely ok to get non-Hindu beginners to chant this though; it might offend their religious beliefs if they knew what they were chanting, which they probably didn’t.

Asana: Very gentle beginners’ practice (about half the people said they had no prior experience of this kind of yoga) but still interesting.

General principles: emphasis on mindulness of the breath (ujayi, but no bandas), breath-movement synchronisation and “natural alignment” without strain. Different levels of flow series, but always ok in a more advanced class to do an equivalent from an easier series if you can’t do something. Asanas approached by breathing in and out of them several times (described here as kriya, we would call it vinyasa) before holding.

Session heavily based around gentle spine-flexing exercises: cat arches, cobra-to-child-pose vinyasas … seems like a good idea for a beginners’s class.

Kali Ray’s assistant Tom comes round with verbal assists and gentle adjustments, and is clearly a very good and confidence inspiring yoga teacher.

Cobra – we don’t do this in ashtanga. Good to have a chance to play with it and feel how the diaphragm and upper back work in it. David Coulter in his anatomy book recommends a low cobra lift with no assist from the hands as a diaphragm exercise – I can see why.

A simple sitting twist - easy baradvajasana variation without the foot in half lotus, but held for long enough to get a really good rotation. Kali Ray says think of rotating the vertebrae one by one, not turning the torso as a unit. Not sure if I did, but good advice.

Shoulderstand variations with the feet up the wall, arching the hips away. Helping beginners to learn to get the upper back straight and upright without too much strain or balance worries.

And a deceptively simple little killer that I will be adopting on a regular basis. Lie on your back with your butt against a wall and legs up the wall. Take your right leg and rest your ankle on your left thigh, just below the knee. The ankle bone or just above should be on the thigh, not the foot or the ankle joint. Then, keeping your left heel on the wall, gently bend your left leg. Hold your right foot in your left hand, gently ease your right knee towards the wall with your right hand. Keep your hips pressed to the floor – if you don’t, nothing happens. If you do, hoo-ee. If you don’t feel this really strongly in the rear hip and glute, then I assume that unlike me you can aready do leg behind head easily.

Pranayama: very gentle. Single-nostril breathing, no retentions.

Meditation: short (5 to 10 minutes?) sitting meditation. Beginners allowed to sit with their backs against the wall – better, I think, than having them try to sit upright when they can’t and strain their lower backs.

related entries: Yoga

the kids are alright (part two)

6th August 2005 permanent link

There are those who believe the internet is a bad influence on childrens’ education. Well …

Maria and I got married in March at Munich Registry Office with my brother and a few local friends. In a few weeks we’re having the big party with family and friends from England & Russia.

I was on the phone today to a friend in England who is planning to drive over with his family. He says his boys, aged about 9 and 7 (apologies if I’m a year or two off) have already planned their Deutsches Museum itinerary, and are lobbying hard for an outward journey via the Zeppelin Museum at Friedrichshafen.

on languages and languages

3rd August 2005 permanent link

Not much blogging lately, because I’ve been spending the time I would otherwise have spent writing (a) reading the utterly amazing Shantaram – more on that later, maybe – and (b) looking, again, for a web framework I can use for personal projects.

Regarding the web framework: because this is for something to use in my severely limited spare time, I want something that's quick to learn, and written in a language that’s powerful, elegant and enjoyable to use.

The language criterion immediately rules out C#/.Net and anything using java or perl. That would seem to leave python, ruby, smalltalk or lisp as the ovious language choices. Lisp appears, based on brief googling, to lack decent cross platform open source implementations; it’s a language I'd be interested in looking at one day if I ever have time, but not for now.

So what are the options in python, ruby & smalltalk?

Looking at python first, because I already have some time invested in learning the language and I like it … learnable in limited time immediately strikes Zope off the shortlist. Others? Too many. Although I’m doing this for personal use, if I’m putting my scarce and valuable time into learning something, I would like it to have reasonable-looking prospects of future support & development and maybe long term commercial potential. I briefly experimented with webware, which certainly appears to work, and cherrypy which I thought looked elegant and quite appealing, but neither of them looks very convincing to me in terms of momentum & long term prospects. The latest buzz thang in the python web world is django. Django looks like it could be interesting if the immediate pre-launch buzz actually does translate into longer term momentum, but it has one absolutely crippling flaw that disqualifies it from any serious consideration until they fix it, because …

… my other absolute must criterion, that the boring clumsy restrictive cobols-for-the-21st-century (Java, C#) do seem to get right and the fun, powerful, elegant open source languages by and large don’t, is the ability to work in a sensible way with text in languages other than English. Some of the projects I have in mind involve working with text in Russian and Sanskrit; and one thing I’ve learned from six years working in commercial IT in Germany is that the first thing you do to any prospective vendor’s software is throw a few umlauts in, then laugh and send them away when it immediately collapses in a heap.

The authors of django don’t initially seem to have given much thought to

what every working programmer should know. All that stuff about "plain text = ascii = characters are 8 bits" is not only wrong, it's hopelessly wrong, and if you're still programming that way, you're not much better than a medical doctor who doesn't believe in germs.

… although at least they now realise they have a serious problem with inability to handle non-ASCII data. Ian Bicking, too, has been getting frustrated lately with problems with python’s silly default string encoding and the way setting it to something sensible instead is made deliberately difficult and obscure. Although in my experience, once you have set it to something sensible – utf8 instead of ascii – assuming you have the access rights to do so in the python installation you happen to be using – then text handling in python is reasonably trouble-free.

UPDATE: Martijn Faassen points out, as I did in Ian’s comments, that changing the default encoding in your own python setup, and then coding happily along on the basis that the default encoding is something sensible, will cause your code to break when other people with stupid default encodings try to use it. And Glyph Lefkowitz in an excellent article tells us why we should all get used to the idea of explicitly handling Unicode and abandon the childish assumption that 8-bit byte strings are of any use whatsoever for representing text. He’s right, but that doesn’t mean lots of people will pay attention and do as he says.

One of the things that deterred me from taking a closer look at Ruby on Rails when I first heard about it, is that ruby’s handling of unicode appears to be significantly inferior to python’s. This isn’t just my impression – a search on comp.lang.ruby soon reveals lots of ruby-knowledgeable people saying it too.

With ruby, though, it isn’t just a case of American programmers forgetting to think about the other 95% of the world. It’s far more interesting than that – the Perfect as the enemy of the Good. Ruby’s author, Yukihiro “Matz” Matsumoto, being a very smart Japanese programmer, is probably more aware of and better informed about internationalisation and character set issues than almost anybody. The problem is that being both very well-informed and Japanese, he is acutely aware of Unicode’s faults and failings and possibly shares the commonly held Japanese view of it as a grossly inadequate Eurocentric racist kludge. (From what I understand, the early versions were grossly inadequate for Chinese & Kanji; that was fixed to some extent in later versions but some serious problems, plus probably quite a bit of lingering mistrust caused by the early versions, still remain).

Matz apparently has ideas & plans, possibly even a prototype, of a Grand Unified Solution To Everything in the field of text handling that will be vastly superior to Unicode. Sadly, though, it Isn’t Ready Yet; and until it is, current production versions of ruby are left to struggle on with a half-baked stopgap implementation of utf8. Which is kind of sad for what otherwise looks like a very nice language.

And Smalltalk? I did a Smalltalk project years ago, and I remember the language being very nice to develop in but impossibly slow at runtime on circa-1990 PCs. I assume Moore’s Law has long since fixed that. Python was the first OO language I worked with since then that was sufficiently nice in its own right that I didn’t resent it for the crime of Not Being Smalltallk. Smalltalk these days has a reputedly good cross platform open source implementation in the form of Squeak, and a strong contender for the current title of Most Interesting Web Framework in the form of Seaside. I downloaded them both and they worked first time. But. Squeak is such a wierd self-contained world, I really don’t feel I have the time or the motivation to get into learning my way around it just for the sake of a web framework. Quick googling also makes it far from clear how complete, stable and well-integrated its Unicode support is. So not just now. I appreciate that this may be my loss.

related entries: Programming

all text and images © 2003–2008

< july 2005 september 2005 >