Monday, December 22, 2008

Firebird flies

Yesterday and today I converted my 'cinema/dvd library' database program to work with Firebird. Like everything else, at first my steps were hesitant, but by the end, the conversion went quickly. I was even able to revise parts which I had already converted.

As opposed to the first program which I tried to convert, 'cinema' is mainly a data-out program. Getting data out of a database is always easier than entering it, and the speed of conversion reflected this.

There was only one minor sql syntax change needed: when I was using the BDE, if I wanted to sort by a calculated field, I would have to use an alias:
select,, count( as cnt
order by cnt desc

This doesn't work with dbExpress/Firebird, and has to be expressed as
select,, count(
order by count( desc

Thursday, December 18, 2008

BIts and pieces

The most important part of a television is its remote control. This has been brought forcefully to our knowledge over the past fortnight, ever since our remote stopped working. Such things didn't matter when I was growing up, as in those days we had only three television channels which could be hand tuned. Now we have over forty, plus AV inputs for dvd and video. It's impossible to get the tv to use those AV inputs using the manual controls. Fortunately today I finally got a replacement remote, and hopefully it will work with our tv.

On the way to get that remote control, I walked several kilometres in Tel Aviv. We are near the end of December, and the temperature was around 25 degrees Centigrade! I read an entry in Jeff Duntemann's diary about the temperature being minus 6 degrees - and he's using Fahrenheit. This works out to around minus 20 degrees Centigrade! There's a bit of a difference in temperature between where he is (Colorado) and I am (Israel).

But as we know, temperature is only a relative sensation: we can only say whether things are hot or cold, as opposed to saying 'hmm, it's 16.4 degrees in this room, better turn the heat on". So when I wake up in the morning and move from a warm bed into a cold living room, I only know that I am in a colder environment, and rely on the thermometer to tell me that it's 16 or 17 degrees. That could be the temperature of someone's warm summer day.

Tuesday, December 16, 2008


After writing on Sunday that I had 'cracked dbExpress', I went home confidently and tried duplicating Dr Bob's code. Nothing worked, and I got the same error messages as I had been getting previously from my own code.

Yesterday I looked at my code and Dr Bob's again, and eventually found what the secret ingredient was. It transpires that my test databases had been defined as 'sql dialect 1', whereas I was trying to access them as 'sql dialect 3'. Dr Bob's code used 'sql dialect 1', which is why it worked.

Following this eureka moment, things really did start falling into place, and I spent another hour or so tidying up code and trying different possibilities. I still have a few more ideas to check out which hopefully will make the code slightly more efficient.

Sunday, December 14, 2008


One of the programs which I have developed for my occupational psychologist needs to transfer relatively large amounts of data around the network, as it is retrieving pictures from a database. We have found that it is possible to work with this program only if the data resides on the same computer on which the program is running. This is not acceptable as we ideally want an administrator to update the 'clever' parts of the program from one computer, a secretary to enter new people's data from another computer, and people to sit the program's exams from other computers. Eventually we even want the program to work as standalone (I managed to convert our other programs to standalone by using stringtables).

Enter Firebird. This is a sql database manager (RDBMS) which can run as an embedded application, and so theoretically solve all our problems.

Downloading and installing the RDBMS was very easy, and within minutes I had set up a simple database, with the goal of accessing this from a Delphi program. Then the fun began.

I tried different sets of components before settling on the dbExpress set (to be honest, I could have stayed with the InterBase component set which comes with Delphi 7, as this seems to be equivalent). Unfortunately I couldn't find much documentation, and whatever sample programs I did find worked in such a way that all the data from a table was downloaded whenever a query was opened. As this seemed to be the complete opposite of what is needed from a db program (download as little as possible), these samples weren't much use.

I managed to cobble a program together which actually worked, but this required a fair amount of coding (especially coding insert and update queries) as opposed to letting the components do their work automagically. There had to be a better way, I kept telling myself.

Eventually I stumbled on some code by Dr Bob (not the Muppet), which at least showed the way to writing the code which I wanted. There was still a certain amount of work which I had to do myself, but eventually I nailed it. Now I have working code which can either insert a new record into a table, or take an existing record and edit it, posting the results back to the table.

Now this task is done, porting my application from BDE to Firefox will be fairly easy, if tiresome.

Thursday, December 04, 2008

Learning to walk

I've been going to physiotherapy twice a week since I recovered sufficiently from my accident. Most of the time, the treatment is "traditional" - massages and exercises of various kinds. Most weeks, the flexibility of my left foot is measured with a tape measure, which gives an idea of how much progress is being made (it seems that in the past week I have made negative progress).

This isn't to imply that everything is traditional: today I spent six minutes on an exercise bicycle, pedalling at just over 20 kph, and so managed to "travel" a shade over two kilometres. During most visits I also have ultrasound treatment; as opposed to the kind of ultrasound with which the body is explored (not only during pregnancies; I had a chest ultrasound a few months ago), this kind warms up the muscles within. To misquote an advert for beer from my childhood, it reaches muscles that other kinds of treatments can't. Presumably these treatments do have some effect although it's not obvious.

But today we made the leap into the 21st century with a neat piece of medical technology. In order to measure how well I am walking, an inflatable sole was inserted into my shoe. This sole has pressure sensors within, and is connected to a control box which was strapped to my leg with velcro. In turn, this box transmitted its telemetry to a nearby computer. When walking, one places pressure first on the heel and then on the toes; the apparatus measured how much pressure I was applying to these two areas.

Walking 'normally' with the apparatus showed that I was applying 100% of the 'normal' pressure on my left heel but only 50% of the normal pressure on my toes. The apparatus was then switched into learning/feedback mode, which meant that it beeped whenever I applied the correct amount of pressure on my toes. Whilst walking in this mode, I realised that I had been pressing my heel and then the arch (the area just before the toes) on the ground, but not the toes themselves (because it still hurts slightly). In order to get the apparatus beeping, I had to walk making sure that I touch three areas on the ground: heel, then arch, and then push off with the toes. After a few practice runs, in order to learn the new technique, the apparatus was put back into diagnostic mode; my heel pressure had reduced to 80%, whereas my toe pressure had increased to 80%.

I am reminded of an incident in a book by Robert Silverberg called 'The second trip', in which a 'newborn' soul is transported into an adult body. In the first few pages, the character has to teach himself how to walk in a foreign body, and he strides down a boulevard muttering "heel and toe, heel and toe". In real life, we learn how to walk in the second year of our life, and the technique becomes imbedded in a neural pathway, allowing us to perform the action without thinking about it again. So for the next few days, I am going to have to walk with a conscious style, in order to teach my brain what to do.

I have to reburn that neural pathway and teach myself again how to walk properly.

Sunday, November 30, 2008

Criminal Justice

We've been watching the television series "Criminal Justice", broadcast here only a few months behind its original broadcast in Israel. So far we've seen three episodes out of five, so I'm not looking at that wiki page to see how the whole thing turns out.

I actually had a nightmare about this programme last week, and there was another part in the third episode which gives me the chills whenever I think of it. I don't remember being so frightened by a television programme since ... when I was maybe seven or eight and used to hide behind a chair whenever the Daleks would appear on Doctor Who.

Prison seems to be frightening, not so much because of the lack of personal freedom (and hey, no one will be telephoning me to ask how to do such and such) but because of one's fellow prisoners. Maybe one should ask for solitary confinement; as it is, I'm quite capable of making my own pleasures so the solitary part wouldn't necessarily be too frightening.

Thursday, November 27, 2008


Work can be frustrating at times. Sometimes it's my fellow workers who frustrate, sometimes it's my work, and sometimes it's the lack of recognition.

Yesterday was a very good day at work for me, according to my metrics. I developed within our ERP program a module (well, a data-entry and retrieval screen) for monitoring commissions paid to architects, helped someone narrow down a report to contain data only about the customers she's interested in, finally figured out how to send a message to one user when any other user performs a certain action, and created a procedure which corrects the foreign currency exchange rate in copied price quotations.

The problem is that virtually no one understands what I do, and if they do have a glimmer, then they only see the results and not the work and time invested. And that can be very frustrating.

But I have to be my best critic, and applaud when I do something good (and criticise when I do something wrong). Sometimes that good feeling can last for more than an hour.

Saturday, November 22, 2008

Surreal moment

Whilst watching an item broadcast on Israel TV Channel One news last night, there were a few surreal moments. The item itself was a rather muddled feature on the wife of the President of Iceland, who is an Israeli born in Jerusalem. As it happens, I had read an article about this lady beforehand, so I was aware of her background.

Anyway, during the broadcast, the incidental music switched to pizzicato strings, and after a few bars, I was able to identify it as "Song of the Gulls" from King Crimson's fourth album "Islands". This was fairly surprising, but - how can I put this? - possible, as SOTG is quasi-classical and doesn't stick out like a sore thumb. A few minutes later, though, it became clear that whoever edited the item must like "Islands", as suddenly part of the guitar solo from "A sailor's tale" (also from that album) was heard! This is something which I would never play in polite company.

Whatever could be next? The weather forecast accompanied by the instrumental section of "21st century schizoid man"?

Tuesday, November 18, 2008

Lonely at the top

The big musical event of the year - in fact, the event of the year - for me was supposed to have been Randy Newman performing in Tel Aviv. The concert was set for November 23, I had bought tickets, I had followed the set lists of his performances during an American tour preceding his European tour ... and then the tour was canceled for health reasons. During the tour, Randy had confided that his right arm was giving him a great deal of pain, and this obviously was bad enough to enforce rest.

I had been very excited when the concert was announced (at the beginning of October) and then my enthusiasm died down, waiting to be revived before the concert. So at the time of the cancellation announcement, I wasn't jumping up and down with excitement, and so the cancellation didn't cause me to slash my wrists in disappointment. Maybe the man can reschedule for next spring. If it's been nearly 20 years since his last appearance in Israel (Jan 1989), I can wait a few more months or years.

The timing of the American tour was very apt as it allowed airings of a song rarely played by the man: "Mr President (Have pity on the working man)". America in late 2008 is obviously similar to America in 1929. "A few words (in defence of our country)" is also a song which quite possibly could disappear from the set lists, and I have had arguments regarding the future of "Piece of the pie": at the moment, the rich are not getting richer but are losing more money in the stock market than those who don't have any savings.

In anticipation of Randy's visit, I dusted off a set of recordings which I had made in 2001, "Newman sings Newman", which preserved for posterity my take on 13 Randy songs. Listening to this with fresh ears, I was saddened to realise that half of the vocals were out of tune, and those that weren't sounded as if they had been recorded onto cardboard. Whilst the arrangements were ok, the instruments sounded on the hokey side. So I took it upon myself to rerecord the entire record.

This actually went extremely fast as the arrangements were good and simple. I would take a song, make a few changes and corrections, import the MIDI file into Reason, choose some instruments, create a sound file and then sing over it. In most cases, I needed only one or two vocal takes to nail a song, and most songs were completed within a matter of hours.

Listening to the new recordings again, I realised that most were competent but not outstanding, and so decided to improve my take on "Lonely at the top". One evening was spent changing the instruments - the original version was very brassy, and I decided to soften it up. Yesterday evening was spent tuning the arrangement, inventing new instrumental lines (I had been fairly lazy originally) and changing the ending, which now owes a lot more to my style of harmonic thinking than to Randy's. I need to do another mix, as the ending still sounds a bit too abrupt.

I also needed to duplicate the final sung line, "Oh, it's lonely at the top"; I located this line in my vocal file, isolated it, created a new file with just this one line, reversed the stereo, and slotted it in at the correct point. I find this kind of editing fairly hard, but yesterday luck was on my side and the entire process took only a few minutes.

Saturday, November 15, 2008


Way back in June, I wrote the following: "Unfortunately, the song which I liked isn't on the record, which makes me wonder whether it was really her [Corinne Bailey Rae]. Every time I've tried searching for certain key lyrics in the song (I'm sure that she sang about "chasing paper"), I've found myriad references to The Beatles' "Two of us", and none to CBR."

I heard this song again on the radio and listened closely to the lyrics. It's not "chasing paper" but rather "chasing pavements", and armed with this information, I quickly tracked down the song's performer. Also a young British girl, albeit several years younger and living in London, as opposed to Leeds: Adele.

I like this song a lot, although I'm lukewarm regarding the rest of her record.

Friday, November 14, 2008


I purchased an electric wok about two months ago, but for various reasons I haven't had a chance to use it until this week. Before cooking a 'real' meal with the wok, I decided to have a practice run, heating up the leftovers of what was supposed to be a variant of Lancashire HotPot.

I read a fair amount about cooking with woks, and have developed the following rules:
  1. Heat the wok as hot as possible, so that oil placed within begins to smoke
  2. Cut the food to be cooked into small pieces so that it cooks quickly
  3. Put the food into the wok in the order of how long each item takes to cook- ie put the item which needs the longest time first
  4. Prepare everything before beginning to cook. Once the first item is in the wok, there is no time to prepare anything else.
Bearing these rules in mind, I took the potatoes from the hot pot (which unfortunately were slightly under-cooked) and diced them prior to placing them in the wok. These went in first, and after they had turned brown, I added the rest of the hot pot. The resulting dish was probably better the second time round than it was originally.

Tonight I cooked chicken and vegetables from scratch. Taking into account the fourth rule of wok cooking, in advance, I sliced a breast of chicken into small cubes, put it in a plastic container, added breadcrumbs and ground ginger, put the top on the container, shook it vigorously for several minutes and then put it into the fridge for an hour. I then diced half a green pepper, half a red pepper, half a yellow pepper and onion, to which I added drained sliced mushrooms. The vegetables sat in a bowl until I was told that it was time to start cooking.

I poured a little canola oil into the wok and turned the heat on full. When I saw vapours beginning to rise from the wok, I poured in the chicken pieces; I allowed them to sit for about 30 seconds and then started turning them. After about five minutes, I then added the vegetables and a little more oil, all the time stirring the mixture. After about another five minutes, the food was ready to serve, along with rice which I had cooked in the time between preparing the vegetables and heating the wok.

The result was a tasty, light and clean meal. A good cook learns from experience, but I'm pleased to say that this dish went very well and leaves little to be improved. I should point out that I am trying to use Chinese cooking techniques but with variations which suit our palate. So there'll be no forbidden foods (pork, shrimp, etc), no chili peppers, no soy sauce, and so on.

What I do need is a good spatula with which to turn the food. I'm using a wooden cake spoon but it's a bit awkward. I need something flatter and wider than the spoon so that I get the spatula underneath the food being cooked.

Wednesday, November 12, 2008

Seasons - a song

A songwriter naturally considers his last finished song to be one of his best - otherwise the song isn't finished. I wrote the following song at the beginning of October, echoing my feelings of how the summer and winter aren't productive seasons, but rather time which one has to survive. The music is very strong too. The song can be heard at my Soundclick page.


Summer; and the languid sun tries to melt our limbs
Horizons shimmer in the heat, frustrating all our whims
Distractions come in so many forms and in so many ways
And so we wile away all the months and all the days
Weeks slip into weeks, slide through the undertow
Come the season’s end, there will be nothing to show

Winter; and the feeble sun fails to warm our souls
The squashed days cause an endless night at the northern pole
Cold drizzle is the constant companion and forces one
To seek shelter before one starts to get work done
Numbed fingers can’t grasp pencils; it’s too hard to write
Ships crash in the fog when there’s too little light

But when the thaw comes, our minds rise and shine
Ripening in the spring time
And in the autumn we reap what we’ve sown
All year

Seasons flow across the year, always bringing change
Shifting all our attitudes as they wax and wane
The idyll time is a compromise between them all
Though who knows how we would behave should the climate fall
Warm waters, the gulf stream keeps an even keel
The seasons have control on how the body feels

Tuesday, November 11, 2008


Last time around, I wrote "I had a few health problems with both my legs (though not at the same time) which conspired to reduce my walking ability and taint my outlook on life whilst not being a major nor even minor threat to my general health". Little did I know.

On Saturday, 25 October, we had torrential rain for about an hour and a half. As I live on the edge of a forest and at the top of a hill, a lot of mud and small stones were washed down from the forest onto the main road which runs down the hill. Early on Sunday morning, I set off for work as usual on my motorcycle, got to the bottom of the hill, prepared to turn right ... and the motorbike continued straight on, as its wheels were coated in mud.

Emulating Bob Dylan, I had a minor motorcycle accident: a severely bruised left foot and ankle. Fortunately, x-rays showed that there were no broken bones. The doctor at the trauma clinic gave me 10 days off work, during which I could barely move. In the last couple of days there has been great improvement - time is the great healer - although I still can't walk properly and the ankle is still tender. Apparently at least another week is required before all the bruising, swelling and pain will disappear.

Tuesday, October 14, 2008

Where have I been all these months? Three months of silence are broken by a fully formed record review, which when posted to a music group of the Internet is followed by two separate people asking to repost the review to other music groups.

I've been hiding, I suppose: hibernation in the summer. I had a few health problems with both my legs (though not at the same time) which conspired to reduce my walking ability and taint my outlook on life whilst not being a major nor even minor threat to my general health. As usual, the Israeli summer was hot, hot, hot, and for a time my office premises weren't air conditioned, causing a severe drop in productivity after 2pm. No surprise that I would often clock in by 6:30am in order to get some work done in the cool and quiet. My brain works best in the mornings.

There have been books. There is a new Peter Robinson novel ("All the colours of darkness") which started out good but seemed to get sidetracked midway through. The ending had a good twist but seemed very out of place. After finishing the book, I realised that there was a similarity to the final Rebus book ("Exit music"): in both cases the detectives assume/believe that there is a much more murky story behind a murder than there really is, and spend the duration of the book chasing that belief only to find more mundane reasons.

Even better: there is a new David Lodge book entitled "Deaf sentence". As usual, this is about an academic, but this time he's retired so it's not exactly a campus novel. The academic (as is the author) is suffering from deafness, thus the pun in the title. Whilst the first third of the book is very entertaining, the final third turns to the sober side of life (or death, or deaf). Comedy has always been part of Lodge's work, illuminating and contrasting the dark places which his latter day heroes find themselves, but this time there is little comedy which can alleviate the final painful pages.

On the lighter side of life, I enjoyed romping through Keith Lowe's "Tunnel vision" which is about a young man having to visit each of London's 230+ stations in one day in order to win a bet which includes his credit card, passport and Eurostar ticket - for he's to be married the following day. There's nothing like a deadline to ensure drama, and this book has a very strict deadline. Maybe it's a bit too nerdy, maybe the characterisation of the bride is a little thin, but I very much enjoyed the book.

There's a passage in the opening pages of the book which reminded me of myself when I was a young teenager and came to spend a week with a friend in London:
If I had to put my finger on something, I'd say it was probably the map that first grabbed my attention. It was so complicated, so detailed and yet so ordered. When I was nine or ten years old I used to study that map until I could recite it, line by line. I discovered beautiful places with lovely sounding rural names, and in the absence of any idea about what such places looked like, I allowed my imagination to fill in the gaps. As far as I was concerned, Covent Garden probably had pretty amazing flower beds, and Shepherd's Bush was ... well, a bush owned by a shepherd. There was a farm at Chalk Farm, acres of unspoiled forest at St John's Wood, and a friendly family from Zurich who lived down in Swiss Cottage. There was also a place called White City, which I decided must be somewhere out of the Bible, a sort of heavenly Jerusalem. That was where the Angel would go on weekends when he got fed up with Islington. Or maybe it was a place where only white people were allowed, like buses in South Africa - I found myself feeling angry that despite being obviously holy me, the Blackfriars wouldn't be allowed in.

At the age of thirteen, I wasn't quite so callow, but even so the place names, especially those in rural Essex or Middlesex, could inspire my imagination.

Monday, October 13, 2008

Fotheringay 2

It’s very hard to know how to take this album. I am listening to it 37 years after it was recorded, taken out of its natural time line. Most of the tracks are familiar one way or another, and so it doesn’t come as such a shock, as say listening to “King and Queen of England” did in the late 80s. The eponymous debut album was an odd mixture, moving from the forgettable (“Peace in the end”, “Too much of nothing”), through the workmanlike (“Ned Kelly”, “Winter winds”) and onto the excellent (“Nothing more”, “The sea”, “The pond and the stream”, “The way I feel” and “Banks of the Nile”). It’s probably no accident that the lower rating tracks feature Trevor Lucas; I thought that his Fairport work was better than the hatchet job that Joe Boyd did on him, but both Fotheringay albums show that Sandy was far ahead. So one possible measure of excellence that could be applied to this album is how Trevor’s talents were utilized. We’ll see.

John the Gun: this is the first version of several which exist. Whilst this version is certainly better than any of the drunk and sprawling versions which Sandy was to record with Fairport, it sounds very polite compared to the vitriolic version which was to appear nine months later on “North Star Grassman” (NSG). The big surprise here is Sam Donohue’s spiraling saxophone solo which owes more to his son’s guitar picking that it does to jazz. Sandy’s vocal is better enunciated than it is on NSG, and there’s also a few minor changes in the tune. If I hadn’t heard the NSG version, this would earn an A, but in retrospect it earns A-.

Eppie Moray: Trevor makes his first vocal appearance. As this song was performed on a widely distributed BBC session, it’s not unfamiliar. Indeed, without examining it in great deal, the arrangement sounds the same. This is a very good performance with an excellent arrangement, especially the introduction which segues seamlessly from the opening track. Those in search of technical detail may be interested to note that Sandy’s vocal starts in the middle but moves to the right channel for the final few lines, indicating that her vocal was probably pieced together from a few takes. A-.

Wild mountain thyme: again this appears on the BBC session, giving the not-totally inaccurate impression that Fotheringay 2 would have a high percentage of traditional material (similar to Liege and Lief vs Unhalfbricking). This is the track which has had the largest amount of post-processing applied, and the care taken shows, producing a sublime ballad with Sandy’s voice at her best, hinting at what I thought was the beautiful person behind (little did I know). Describing this song feels like describing a wine: “warm, with hints of chocolate, leaves and blackcurrant”. Pat Donaldson hums along, there seems to be a hint of organ (courtesy of Rabbit) and the total is far in excess of its parts. Definitely an A.

Knights of the road: after three excellent tracks, Trevor Lucas gets his chance. This song turned up a few years later on Fairport’s transitional “Rosie” album, which could be attributed to “Fotheringay Confusion”. Another Lucas song, “The plainsman”, also appears on “Rosie”; apparently this was a Fotheringay recording with Dave Pegg’s bass replacing Pat Donaldon’s. In this case, KOTR is a different recording, although it’s quite similar; Gerry Conway’s four to the bar snare drum being a mockery of the otherwise excellent drummer’s usual tasteful accompaniments. A modulation after the first verse and chorus takes everything up a notch; this in itself is an interesting point. Normally, if there is only one modulation in a song, it will be towards the end, before the final verse or chorus, whereas a modulation after the first chorus tends to imply that there will be a modulation after every chorus. Nice chorus vocals, and a touch of syncopation in the fade out. Solid work, but not outstanding: B-.

Late November: probably the most familiar of all the songs on this album, due to its release on NSG, albeit with different vocals and added guitar (courtesy of RT). There exist other released versions of this song, each with a different vocal track laid over the same instrumental recording; I’m fairly sure that this version has yet another vocal track. Listen closely for the count-in at the beginning. How can I not award this excellent song (both in composition and execution) an A?

Restless: back to Trevor Lucas. Again, this song was resurrected by Fairport on their “Rising for the moon” album, which probably goes to show how strapped for material they must have been. This version is not a patch on what was to be, lacking Sandy’s ethereal harmonies. Nice 12 string guitar work at the beginning along with sensitive snare drumming give way to a more standard, Nashville like, instrumental track. Again a B-.

Gypsy Davey: those who bought the Carthage CD reissue of “Fotheringay” will already have this, although we are promised that this version has a different vocal track. A solid and imaginative arrangement of a traditional song which earns a deserved A-.

I don’t believe you: Trevor again. This is the only unfamiliar song on the disc (assuming that one doesn’t know the Dylan version) and the only disposable one as well. I can imagine how this would have raised Joe Boyd’s hackles, wasting his time recording this instead of other Denny jewels. I feel very much the same, and rate this song only as a C.

Silver threads and golden needles: it has just occurred to me that the front cover of the cd package might well be hinting at this song title. Part of the Fotheringay stage set, this was later to turn up on Sandy’s “Rendezvous” swan song, albeit with a brass arrangement. Here it’s softly strummed guitars, halfway between Wimbledon and Nashville, with a nice female harmony vocal on the title line. Pleasant but not outstanding: a solid B.

Bold Jack Donohue: another traditional song with a gruff but suitable Trevor Lucas vocal. Again part of the BBC recording, it’s not unfamiliar. This has a dramatic arrangement, with a few major chords thrown into the predominantly minor harmonies. The slow fade is very tasteful. The best solo TL appearance on the album, I mark it as B+

Two weeks last summer: see the comments about “Gypsy Davey”, although of course this song was written by Sandy’s first bandleader, Dave Cousings. This genuinely seems to be a different recording as the end sounds different, and there are harmony vocals. B+.

So there you have it: eleven songs, of which ten exist in other versions and only one of those in a radically different arrangement (STAGN). Two As, three songs marked A-, two B+, one B, two B- and one C: if only my O-level results had been as good (I was too busy listening to Fotheringay at the time to concentrate properly)! How does this rank again their debut? I think that this is a more concentrated effort with most of the tracks rated in the A-/B+/B continuum; it’s less polarized than the debut, although there are fewer really standout tracks. I also think that I would have rated this slightly higher had the record been released close to its recording, although I imagine that I would have preferred even then that the perfunctory Dylan cover be left off. Considering that vinyl albums optimally played 40 minutes, this cd is nine minutes over optimum, meaning that probably two songs would not have made the cut.

Saturday, July 12, 2008


I had an interesting trip down memory lane the other day when I discovered that the Hallmark TV channel is showing episodes from "Morse", the tv version of one of my favourite fictional detectives. As these programmes were made in the 80s and 90s, I only watched them haphazardly (maybe only when in holiday in Britain), and so I only barely remember them.

The episode which I saw was entitled "Flight of deception", and was written by Anthony Minghella, fan of Van der Graaf Generator, and later to be the director of "The talented Mr Ripley", amongst other films. I'm sad to say that it was fairly forgettable, with only the negative points about it being retained in my memory. Was Morse always so irritable? The programme also featured a laughable cricket match; obviously none of the actors had ever played cricket, because their moves were ludicrous. The 'whodunit' part of the story became fairly clear early on, which took away whatever was left of the story's enjoyment. There was one turn in the plot which completely surprised me, but that's all. One actor in the episode, whose name I didn't catch, played a baddie; a few years later he too was to play the part of a tv police inspector (whose name also escapes my memory).

I see that there are episodes from various seasons being shown during the week (some of which are repeats), so it will be interesting to see whether I fell on a poor example of the series or a representative. Of course, it may well be that my viewing perspective has changed in the twenty years since these programmes were made.

The Morse books were something else. Whilst certain aspects were very good, there were other aspects which became very annoying (mainly attributes of the author, having little to do with the story). At times there was a very patronising tone which became too much at time. Maybe just as well that the author caused his eponymous detective to die, because I'm not too sure that I would have continued buying the books. As there are 33 television episodes compared to 11 books, it is obvious that failures in the screen version can't be blamed on the books.

Sunday, July 06, 2008

Bacon numbers (3)

A correction to my original post on the subject: my program uses a breadth-first search algorithm. Prolog uses by default the depth-first search algorithm, along with backtracking, which can be simulated in Pascal using recursion (and indeed, the example which I quoted of trying to calculate which bills a customer has paid uses recursion).

Breadth-first uses an explicit list, instead of implicit stacks. Delphi's TStringList type serves this purpose admirably.

I added an extra twist to the final output: instead of simply listing the steps between actors, the connecting films are also named.

No more on this subject.

Friday, July 04, 2008

Bacon numbers (2)

I wrote before about matching Warren Beatty with Diane Keaton. If I ask the program to work that way, it can't find a match, but if I ask it to match Diane with Warren, a change which theoretically shouldn't make any difference, then it immediately answers with '2' (via Shelley Duvall).

Hmmm. Why does this happen? Should I use heuristics? Maybe the second person should be the one who has fewer movies in my collection.

Update: a quick debugging run with logging reveals the mistake. I had the wrong termination condition - the program should finish when there is a match or the list of candidates is empty. After changing the program slightly, it now finds the distance between Warren Beatty and Diane Keaton; slowly in one direction, quickly in the other.

Bacon numbers

I see that I've managed to pass an entire month without blogging. There have been experiences which have been too delicate to share here, and other experiences which aren't very interesting (mainly health issues).

There is some new (to me) music which has been floating around. An advance copy of Randy Newman's new cd, "Harps and Angels", his first of original songs since 1999's "Bad Love" has been played several times, but has not been received here as well as some of his earlier material. To my ears, it contains too much 12 bar blues based material, and that's not a musical form which I care for.

I've also been belatedly listening to British soul singer Corinne Bailey Rae's eponymous record. I'd seen some of her videos on VH-1 and hadn't been overly impressed. At the time, I didn't know that she was British. Her name came up whilst reading a detective novel, in which she was described as coming from Leeds; I checked this out and found it to be true. I then heard a song of hers on the radio which I very much liked, so I thought that it was time that I listened to her properly. Unfortunately, the song which I liked isn't on the record, which makes me wonder whether it was really her. Every time I've tried searching for certain key lyrics in the song (I'm sure that she sang about "chasing paper"), I've found myriad references to The Beatles' "Two of us", and none to CBR. The disc itself has worn out its welcome; it's not a keeper.

Over the past few months, I've been recording films from television onto DVD. After a while, I found myself recording the same film more than once, and so thought that it was time that I organise these discs. For someone like myself, writing such a database program would be simple and fun. At first, it started off with a table of actors (name only), a table of films (name only) and a table of cast lists, in which the actors were matched to the films, but after a while, my ambitions grew.

First off was a list of directors, although it turns out that apart from Woody Allen and Robert Altman, there are very few directors who have more than a sample showing in my collection. Then I added a link to the imdb site; clicking on a button would bring up a web browser pointing to the appropriate page. Then of course there were all kinds of reports about actors: how many times each actor has appeared in the films which I have, with which other actors they have worked and with which directors they have appeared. Simple, harmless fun.

Today I got up and thought to myself, "Bacon numbers". This wouldn't necessarily have to start with Kevin Bacon (who only appears in a few of the films which I have); rather, I could check connections between any two actors. Obviously the act of someone who has too much time on his hands. When I told this to my wife, she started laughing, as I expected her to do.

But from a programming point of view, this is a very interesting exercise. The algorithm needed, basically, is the same algorithm which is fundamental to the Prolog language, a language which has always intrigued and inspired me. I've written a few such programs (one was for accounting purposes: a customer has twenty bills outstanding and makes a payment without saying what it was for; the program tries various combinations of bills until it gets to the same total), but this one was a bit different.

Here's the algorithm:
1. Add to the list the id of the actor whose Bacon number we are trying to calculate
2. Remove the first name from the list and store it in a variable
3. If the target actor (eg Kevin Bacon as per the original) and this actor have appeared together in a play, then print the distance, and set a finishing flag
4. If they haven't appeared together, then get all the actors who have appeared with this actor and add them to the list, increasing the distance
5. If the query in stage 4 returns no answers, then finish, otherwise
6. Go to stage 2.

The actual implementation was much easier than I expected. I had to add a flag to each actor to show whether s/he had been inspected during the current search, but apart from this, I was able to implement the algorithm using two database queries and a listbox.

I've checked various combinations of people and have got back the expected results. For example, I don't have a film in which Meg Ryan and Gary Sinise have appeared together (maybe there isn't one at all). Their mutual Bacon number is 2, via Tom Hanks (MR and TH have appeared in two films which I have together, and TH and GS have appeared in one). For Woody Allen and Sandra Bullock, the number is 3 at the moment (WA -> Diane Keaton -> Keanu Reeves -> Sandra Bullock). Eventually the program will surprise me and return a smaller number than the one I am expecting.

The only real problem with this program is that it uses the Prolog convention of a closed universe. I was checking Warren Beatty with Diane Keaton; I know that they appeared together in "Reds", so their number is 1. But I don't have this film in my library, and so the program couldn't find any link. The only WB film which I have is "McCabe and Mrs Miller", and the actors there don't seem to connect.... Wait a minute! Shelley Duvall was in M&MM with WB, and she was in "Annie Hall" with Diane Keaton. Maybe I didn't add her name to those films....

Wednesday, May 28, 2008

Back pains

Ever since I've been using the CPAP machine, I've had back pain, which seems almost certainly to stem from the slightly unnatural positions which I have to assume whilst sleeping. For the last month or so, these pains have lasted for maybe an hour after getting up, but then dissipate. Unfortunately, in the past few days, the pain has been getting worse and longer.

Despite the fact that my wife has been rubbing my back with Ben Gay ointment the past few nights, the pains have continued, and on Tuesday they were extremely strong, lasting all day. I managed a few hours sleep last night, but the pain was so great every time I turned in my sleep, that I awoke at about 2am, whimpering with pain.

I discarded the CPAP mask and tried to assume a different position but the pain was still too great. I tried sitting in various chairs in the living room, but this too was painful. After a while, I remembered the pills which I had been given when I was suffering from bursitis several months ago; I took one of these along with two paracetamol. This combination obviously did the trick, for when the alarm radio turned itself on at 5:30am, my back was almost free of pain.

I was supposed to drive a car today to Haifa for my weekly meeting there (as opposed to taking the train), but it was obvious that I was in no fit state to drive. I decided in the middle of the night not to go, but instead visit the nearest clinic and see a doctor. I waited until 8:30am, then drove the few kilometres to the clinic (the kibbutz clinic is shut on Wednesdays). Fortunately I didn't have to wait long to see a doctor, and she confirmed my diagnosis, that the muscular pain is due to the various positions that the mask dictates. It turns out that the pill which I took was the correct one and that I should continue taking it once a day for the next few days. She also recommended physiotherapy.

Coming out of the clinic and into the parking area of a shopping centre, I was so groggy that I couldn't remember exactly where I had parked the car. I knew which way it was facing, but not in which lane. After five exceedingly worried minutes wandering around, I finally found it, unlocked and drove home, for to sleep an hour or so.

Now I'm not tired, but my back is still hurting mildly (not the extreme burning pain that I felt in my shoulder blades last night), and I've taken my pill. I pray for a good night's sleep. Nowhere in all the CPAP literature has anyone written or warned about such problems.

This afternoon I did some more work on my dvd database program - I added the concept of 'directors', and added some reports so that I can see which actors have worked with which directors, and vice versa. Although I haven't entered much data about directors, it is becoming clear that most directors have directed only one or two films which are in my collection. The few exceptions are Robert Altman and Woody Allen, both directors whose films I saw frequently during the 1970s.

Wednesday, May 21, 2008

Odd lots

I've been fairly active on e-bay lately, buying copies of British dramas on dvd. The most prominent of these purchases has been the five series of 'Cold Feet'; I didn't buy a box set for fear of shipping problems, but instead participated in several auctions until I acquired individually the entire set. Each season cost about three pounds, whereas the list price is much higher. Amazon lists most of the seasons at twenty pounds, but discounts them to six or seven pounds, not including postage. So my e-bay purchases were definitely at a sharp and worthwhile discount.

The problem with foreign-bought (ie non-Israeli) dvds is that they lack subtitles in Hebrew. This makes watching them problematic for my wife, whose listening to idiomatic English skills are not too high. But I've found it problematic as well; obviously, over the years I've got used to reading the subtitles and subconsciously using them to fill in gaps when I didn't hear properly what was being said. I've overcome this quite successfully by displaying the English subtitles, but have noticed that there are not infrequent discrepancies between what is being said and what is being displayed.

I have mentioned previously purchasing a disc of French composer Erik Satie's piano pieces. Whilst knocking around the Internet, I discovered musician Mike Dickson's mainly Mellotron based ruminations on the same material. Should one choose to download the music, beware that it comes as an ISO image file and so has to be treated differently than a series of wave files. I've listened to most of the album, and whilst the same as the piano disc, it is also different. It brings into focus a feeling which I've had about instrumental music - I concentrate too much on the music and too little on the whole. Obviously, the piano disc is wholly music, but the mellotron disc has atmospheric bells and whistles, and makes listening a holistic experience. I haven't got there yet.

I've mentioned before my recording dvd machine. Since its last visit to the technicians, it has been performing admirably. At the beginning of each week, I check our satellite tv provider's internet site and see which films are being broadcast during the week; I make a list of all those that I want to tape, including channel, day, time and duration. Then I record the films. I even sometimes get to watch them. We're having a Harrison Ford marathon on Friday/Saturday, which will allow me to record several films which I used to have on video.

As it's getting to the stage where I don't remember exactly what I do or don't have, I knocked together a small dvd database program the other day. This keeps track of the dvds and the actor who appeared in the dvd, so if anybody asks "Do you have any Jack Nicholson dvds?", I can answer positively, and even say which ones. I single out Jack because it seems that at the moment he appears in more dvds that I have than anyone else (although Harrison Ford may shortly overtake him).

Thursday, May 15, 2008

Friend from the past

I was out yesterday evening walking the dog when a voice hailed me with a nickname which I haven't been called for 35 years. I looked around and saw one of my oldest friends, someone whom I haven't seen it maybe 15 years.

We first met when we were 11, and were unseparable for several years. In later years, we went our own ways but still kept in touch.

I admit that one of my biggest problems is lack of personal skills, especially getting interested when other people talk about themselves. I admit that I'm not too interested in other people's lives. So it was a bit difficult talking with this old friend of mine.

He is my age, two or three months older, but for various reasons never settled down and only got married (or at least coupled) about five years ago. He has two children, aged two and four. When those children reach their teens, my friend will be in his sixties! True, he looks very well now, but what will he be like in ten years time?

Unicode resource files

I have mentioned in passing the 'flagship' product which I have developed with my occupational psychologist. This is not so much a product as a suite of programs -
  1. Admin - this is where all the tables are defined, and basically all the knowledge is here. I am constantly developing this program as we are always adding changes.
  2. Exam - this is what the user sees. This program presents 400 statements with which the examinee can either agree or not. The answers are stored in a file which gets passed on to the next stage. Very little development occurs with this program as it is supposed to be frozen.
  3. Results - in this program, the output file from the exam is read and various reports are created, based on the values in the output file and the in the various data tables.
'Admin' and 'Results' were separated into two programs in order to allow a certain amount of security. The worker who prints the results is not able to make any changes in the knowledge database.

The exam was initially in Hebrew only, but at some time, we translated the statements into English, and allowed the possibility of running the exam in this language. The statements were held in a table with a simple structure (id, text, alive [some statements are no longer presented]), and in order to allow the program to be run in English, I added a field to this table in which the translated statements are stored.

Originally, the exam was run in our lab against the database, but when the wish arose to deploy the exam on the Internet, I had to find an alternative solution. I did this by extracting all the statements from the database and storing them in stringtable format in a resource file. This had the added benefit that I could strip from the exam program all the code which handles the database, and as a result, the final program (including all the statements twice) is smaller in size than the original db-based exam.

As we say in Hebrew, "with the food comes the appetite". Once this had been done, the desire to add a Russian interface was aired. This makes a great deal of sense, as there are far more Russian speakers in Israel than there are mother-tongue English speakers, and in most cases, the Russians' Hebrew skills are far lower than the English speaking Hebrew skills.

So we sent the statements file off for translation, and this returned last week as a Word file filled with Cyrillics. I copied this file into Notepad, gave it the structure needed for a stringtable, and saved it with the 'rc' extension, signifying to all and sundry that this is a resource file. When I saved the file initially, I received a warning saying that if I saved it as an ANSI file, I would lose important information. So I saved it as Unicode.

Trying to compile this file with Borland's resource compiler, brcc32, did not meet with much success (although in retrospect, this might well have been because there were still errors in the resource file). Then I realised that even if I managed to create a compile resource file (with the 'res' extension), my program would be unable to read it, as unicode characters take up twice the space of 'ordinary' characters, and need special routines to read and display.

Following this, I spent the next few days learning about unicode characters under Windows, how to save them in resource files, how to extract them and how to display them. I found a freeware resource compiler which works admirably (gorc), and eventually found Delphi components which can handle unicode. I put everything together, and to my surprise and delight, the exam program can now be operated in Russian mode.

Now that this has been done, we can add even more languages, such as Spanish and even Swahili (gasp) without having to undergo the learning cycle of the past week.

I'm quite chuffed with myself.

Thursday, May 08, 2008

Amsterdam diary

I've been preoccupied with improving the algorithm which calculates averages and standard deviations in the occupational psychologist's flagship program over the past few days. I didn't measure how long the calculation took before I started making improvements, but it was around 10 minutes per scale. After some improvements, I finally timed how long one scale took - about 4.5 minutes. After a few simple improvements (basically moving sql queries out of a loop), it now takes about 280 milliseconds for one scale - 1000 times faster! Isn't it good that I have a dog - I can think about algorithms whilst walking her.

Of course, one could argue that had I written the program correctly at the beginning, it would have taken 280 milliseconds then. Well, yes, that's true; I did try in the original version to have a certain amount of optimisation, but I failed, and so opted to write a simple, but slow, version that worked. I thought that the program would be a one-off and so didn't invest too much time in writing. As it happens, more and more scales have been added for which the calculation has been run, and so the two hours (or so) which I spent today were a good investment.

Now back to Amsterdam. For incidental reasons, we arrived in Amsterdam last week, on 30 April. As any Nederlander will know, this is "Queen's Day", an equivalent to Israel's Independence Day (60th celebrated today) - or so I thought. The city centre was closed to traffic so we had been advised to take a train to Amsterdam Sloterdijk station, and from there a taxi to our apartment. Once ensconsed, our daughter took us by tram to Vonder Park, and from there we wandered around by foot.

The park reminded me slightly of Cropredy: crowds of young people drinking, listening to music and wearing silly hats or costumes which they would never dream of wearing any other day of the week. Amsterdam has a curious tradition of public urinals in full view; these were either in constant use or else jammed by beer cans. Another curious tradition is that instead of putting beer cans and other rubbish into bags or bins, people were just dropping their litter onto the streets. I have never seen such filth before, and I hope never again. We walked from the park to the funfair in Dam Square, and the streets became more and more crowded.

At Dam Square, we bought provisions in a supermarket, walked back to the general area of Vonder Park, and caught a tram back to our flat.

The next day we went on the 'water land' tour of Volendam and Marken. We started off by buying tickets at Amsterdam Centraal station, only to discover that the bus drivers were striking: whilst they were driving their buses according to the timetable, they weren't charging people for the rides. In other words, we needn't have bought the tickets (not that they cost much). On the way to the station, we noticed how clean the streets were; the cleaners must have been working all night in order to dispose of the debris.

Volendam was pretty, but reminded me of an English seaside resort (albeit without the beach). Nice but not wonderful. Whilst there, we visited a "factory" which makes clogs and cheese; quite interesting. After having fun with the buses, we eventually arrived at Marken. At first it began to rain, so we took refuge in their folk-lore museum, which appeared just at the right time. From there we walked on to the harbour, where we managed to find a restaurant prepared to serve us (all the restaurants were full - at 4pm!). After lunch, the sun came out, and everything looked much better.

On our second day, we went to Keukenhof gardens. I'm not much of a flower person, but this place simply took my breath away. It's only open for a few months each year, and fortunately we were there during those months. Stupendous.

After coming back to Amsterdam, we strolled around the Red Light district, which was rather less titillating (optional pun) than I had been led to believe. We had hot chocolate with whipped cream (an Amsterdam favourite) sitting by a canal, when my son phoned to say that Maccabi Tel Aviv basketball team had managed to win their semi-final game (see previous post).

On the way to Keukenhof, we had seen the crowds queuing to enter the Rijkmuseum in Amsterdam, and so decided not to spend our final day in the museums. We decided to spend the day in Delft, which turned out to be an inspired decision. My daughter had told us that she had never seen a ticket inspector on a Dutch train and that we needn't buy tickets, but such habits come hard. We hadn't been on the train more than five minutes before a ticket inspector did come round....

Touristy Delft is fairly small and can be covered fairly quickly. After a light Italian lunch, we set off for the Royal Delft factory, which is at the southern end of town. What we thought would be a swift walk turned into a long hike. The factory itself is interesting, but not overly so. I noticed that there was a Delft town tour train (?) which would call at the factory about an hour after our arrival, so we paced ourselves accordingly in order to avail ourselves of this service which would take us back into town.

Once there, I installed myself in a cafe in the lovely town square and ordered cold chocolate milk and applecake, whilst my wife went off to the market and my daughter to visit the churches. The service was abominable; it took maybe twenty minutes for my cake to arrive, ten minutes to eat, and maybe another twenty minutes for the bill to arrive. Just as it did, my wife turned up, and I ordered tea and cake for her. Eventually these arrived, and after she had finished, we began to wait for our waitress in order to pay the bill. We waited ... and waited ... and waited ... and no waitress. I think that she finished her shift at 6pm, and her replacement was unaware of us. At least we had refreshment; a couple at a nearby table arrived and waited (and waited, etc) for someone to come and take their order. My daughter said that we could get up and leave without paying (she obviously has taken to heart certain Dutch habits), but we went to the cash register and paid.

Four days in Amsterdam and its environs went quite quickly, and once we had got over the daily argument of what to do, we enjoyed ourselves very much.

Monday, May 05, 2008

Whoever would have believed it?

Israelis seem to be well acquainted with miracles, especially when they are connected with basketball. This season seems to be no different: Maccabi Tel Aviv in January seemed to be a hodge-podge of players, none of whom appeared able to play together as a team. Despite the above, Maccabi somehow managed to get into the Euroleague final four.

I was in Amsterdam whilst the semi-finals were played on Friday, so didn't see what happened. My son phoned at half-time to say that Maccabi were trailing by 16 points. Imagine my surprise when he phoned an hour later to say that instead of losing, Maccabi had actually won the game! Apparently this was Maccabi's game of the season, in the same way that they advanced to the final a few years ago after having played not too well throughout the year. If I recall correctly, their opponents that year (2006) in the final, as this year, were CSKA.

We left Amsterdam Sunday lunchtime; Israeli newspapers were distributed on the plane, and one could read a play by play account of this game. 'Miracle' in Hebrew is 'Ness', and as their opponents were from Sienna, the game had already earned the nickname 'Nessiena'.

As the final four is being held in Madrid, a few time zones to the west of Jerusalem, the championship game only started at 10pm our time. By this hour I was truly worn-out, and so opted to record the game on dvd (what a souvenir that would make if Maccabi won!) and go to bed. Even so, I stayed to watch the first quarter in which Maccabi and CSKA (another European powerhouse) were evenly matched.

First thing this morning was to check the score on the Euroleague website. As might be expected, CSKA won the game, although apparently it was neck and neck until the final quarter. Many were depending on Maccabi's unpredictability to be their trump card against the Russian machine, as it was against Sienna, but apparently not. I'll try and watch the game this evening.

Anyway, whoever would have believed it? Had anyone predicted in dark January that Maccabi would be playing in the Euroleague final, they would have been laughed out of court (although I imagine by then that CSKA were already a safe bet).

Now it's back to domestic matters. Maccabi have had one of their worst domestic seasons and are in danger of losing the championship. This does not mean that they won't be playing in Europe next year; apparently their participation has been guaranteed until 2012. But it may mean that two Israeli teams will be playing in the Euroleague next year. This has happened only once before, a few years ago, when the Jerusalem team also participated; they also lost almost all of their games.

Next posting: Amsterdam diary.

Sunday, April 27, 2008


Israel was gripped by a tremendous sharav (hot wind) during the past week. Fortunately, I was at home all week and so didn't have to work in an office without air conditioning. One morning - I think it was Thursday - the temperature was 30 degrees centigrade at 6 am! Here is a picture which I took of our barometer, which shows the temperature both outside and inside:

This rather crude picture was taken with my mobile phone with bad lighting; the top line shows the outside temperature and the lower line the inside temperature (if you look closely, you can see my reflection at the top). My wife doesn't believe me when I say that apparently it was 46.3 degrees outside! The remote sensor is not supposed to be in direct sunlight, but even so.... I've never seen a temperature as hot as that before. For those of you in the Fahrenheit system, that's 115 degrees!

Fortunately, at about 5pm, the temperature starting dropping ... and dropping ... and dropping. Friday was fairly normal, reaching a high of 31 degrees at about 2pm, but again by late afternoon, the temperature dropped to a reasonable level. Yesterday (Saturday) was wonderfully cool - a high of maybe 25 degrees, and today is similar. It seems that the heat waves are over for a period of time.

We're off to Amsterdam for a few days starting Wednesday morning. Maybe I'll add an entry from there.

Tuesday, April 22, 2008

Holiday week

It's Passover week, and my company has decided to close down, forcing everyone to take four days holiday. Some people are only too delighted to do so (one man was telling me how he is taking his entire family to Eilat for the holiday, which makes life much easier on his wife), whereas I tend to find little to do during such weeks.

I have been buying via e-bay dvds of the excellent British series "Cold Feet" for very low prices, and so this week has been an opportunity to watch them. I have the entire series on videotape, but I don't think that I've ever watched all of them in continuity (although I did see all the episodes twice on tv). There is a limit to how much emotion one can take in a day.

Regarding the computer, I haven't been doing much programming at home in the past few weeks as my psychologist friend has been on holiday. I thought that I would get back into the swing of things yesterday by programming a quick demo of something that we've been talking about but has been left aside as there have been more important things to do.

Then popped into my head the idea of writing a command line interface (CLI) for the databases. I use Borland's "Desktop database" program, but this is concerned primarily with describing a database (ie defining the tables in the database and defining the fields within each table) and
the possibilities of editing the data are very limited. I wrote a program which allows me to do three different kinds of operation:
  • meta-queries (list of tables in database, structure of table)
  • 'select' queries, which can be simple ones about one table, or complex joins
  • updates and deletions
Basically the program consists of a text parser and an sql engine; if the first word in the text stream is one of those connected with a meta-query, then the program executes this command. Otherwise all the text is passed to a 'query' component which is then executed and the results displayed.

The whole thing took about two hours to write and works well enough for what I need. The parser could do with improving, which is hardly surprising as it was written ad hoc without any prior thought, but it's ok. As it's only for my use, I'm not going to bamboozle it with improper commands.

Anyway, the reason for this program is that the demo which I wrote requires that values within a field in one of the tables be changed. Instead of doing this manually via Desktop Database, or writing a program which executes the 'update' queries, I thought that this CLI approach would be better as it is of course re-usable.

Monday, April 14, 2008

Visiting the vet

We took the dog to see the vet yesterday. My wife was worried about a little bump by the dog's right ear, which turned out to be nothing. While we were there, the dog also underwent treatment for worms (trying to force pills down her throat), vaccinations for rabies and other dog ailments, and a general checkup.

We discovered that Mocha (aka the hound of the Baskervilles) weighs a mere 40 kg; the poor vet had to lift her up whilst weighing himself so that we could determine this (in order to know how many anti-worm pills to give).

We also left behind a fair amount of the national debt.

Here is the dog herself in all her glory:

One gets an idea of her size when one considers the size of the couch behind her.

The photo was taken from my new (as from February) mobile phone, a Nokia 6288. At first, I really hated the phone, as I couldn't get it to do anything. The manual seemed worse than useless, as it told the user all kinds of information, everything but what I wanted to know. But after a while, things settled down, and I started to learn how to get the phone to do what I want it to do.

As I have reading glasses, I find it difficult to see who is phoning me when I'm not wearing the glasses. I discovered that I can take photos of people and then attach those photos to the person's contact record; now, when someone phones, I can see their picture and so know who is calling.

The phone also has a video call function which seems like more of a gimmick than anything else. I tried it with someone in the next cubicle, and it worked well enough, but of course it only works with other phones that have the same option. My son was always ragging me about my previous mobile phone, which admittedly was a very old model (but good enough for me). Even though he too has had his phone updated, he had to admit the other day that my phone is much better than his.

A mobile phone is one of the few items about which a man is prepared to brag that "mine is smaller than yours". With this new breed of phones, it seems that this trend is actually reversing.

Sunday, April 06, 2008

The night of the long knives

After a period of expansion, my company has needed to rein in its expenses by a certain extent. In the IT department, we've been spending money left, right and centre, most of which went to a central storage facility which was greatly needed. For the time being, our budget is being cut; this isn't too bad as some of the work which I am doing used to be farmed out to consultants at a non-trivial price. In fact, for years I've been trying to measure my work as a function of how much money I save.

But that isn't really what I wanted to write about: another source of saving is making people redundant. One group of people is being replaced by a sub-contractor (what we would call 'outsourcing' in the computer industry), whereas others are simply being sent home. Of the names that I have heard, several have a very low return on investment index (in other words, they don't contribute very much but cost a lot) and so by letting these people go, the company won't lose much productivity whilst saving money.

The most painful cut is that of a close colleague of mine, a young lad of 64. In the pre-merger days, he was one of the most important figures in the company, but since then his job has been continually downsized until now he too is costing a fair amount of money whilst contributing less. I say that he is "geographically challenged": had he be living in a different city, where his group's activities are based, then possibly he wouldn't have been the one to go.

Such acts of making people redundant cause fear and worry throughout the company. Everyone starts wondering whether they are contributing enough compared to their salary. Will there be more redundancies? What would I do if I were made redundant?

Someone came to talk to me this morning, another spring chicken of 60+ years. He was worried that he too might fall under the axe. I tried to convince him that as far as I see things, he is an essential person, even more essential than I am. Anyone who fired him would be committing business suicide.

Making people redundant might save a certain amount of money in the short run, but it tends to be a counter-productive move. The amounts saved are normally not very much, especially when compared to the savings which could be made by getting an additional 1% discount on all raw material purchases, for example, or decreasing the discounts which are given to customers.

Wednesday, April 02, 2008


I know that ERP means "enterprise resource planning", but in my case, it appears to mean "Enhanced Rate of Programming". I find that in terms of programming within our ERP system (writing 'straight' reports, writing complex reports, defining new tables and fields, screens and triggers), I find that my productivity is increasing by 25% a month (hard to quantify, but let's assume). I know that yesterday I programmed a trigger using a technique that I thought that I didn't know five minutes before I attempted it. Such an idea would never have occurred to me a week ago or a month ago. A year ago, I wouldn't have known what I was talking about.

Maybe ERP means "Exponential Rate of Programming" - 1.25 raised to the power of 14 gives the astonishing total of 22.7. This means that I am at least 20 times more effective than I was a year ago!

I wish that my pension fund would yield the same rate. The last eight months have been very disappointing, and it's heartbreaking to deposit good money into an investment fund only to see its value decrease. At the moment, it seems better not to invest.

Yesterday I devoted an hour to cataloging all these blog entries. It wasn't surprising to find that programming and MIDI are hot subjects here. What was interesting was to read posts from a few years ago, especially one written about this time. I was writing about Maccabi Tel Aviv basketball team and how they managed to get to the Euroleague final, despite not playing too well during the season. This year has been the same story; true, they haven't got to the final yet, but have a very good chance of doing so. Being one game up in the quarterfinals with homecourt advantage, they should get to the final four, and then everything is up for grabs.

Injury problems have caused many problems, and there seems to be big problems in filling certain positions. Yet Maccabi keep on winning (at least, winning the games that matter). It would be very interesting to hear commentary on one of their games from their opponents' point of view, but alas, such opportunities do not arise.

Monday, March 31, 2008

Lots of things to do

I received a package from Amazon a few days ago, containing the following
  • "Trisector", the new cd by Van der Graaf Generator
  • two Rebus books written by Ian Rankin, "The Falls" and "Exit Music"
  • one book written by Brian Viner about his life in the countryside
  • one book about cognitive therapy, called "Feeling Good" (or similar)
I am slowly working my way through the package for I have several activities competing for my spare time, to wit:
  • writing and updating programs for my occupational psychologist
  • taking the dog for long walks
  • writing important letters
  • watching films which have accumulated
Last year on the way to Santorini, I bought a dvd machine which records as well as plays, and so I've found myself recording several films a week. One ridiculous weekend not so long ago had me recording 6 films over 24 hours, as the satellite company showed good films in the run-up to the Oscars. I've had a look at this week's schedule, and there are "only" five films in the entire week which I want to record. Anyway, the machine has been fritzing for quite some time: I can record properly and finalise the discs, but when I put them back into the machine in order to watch them, the machine refuses to recognise them (even though the discs are readable on the computer). On Saturday the machine stopped initialising and so I knew that it was time to take the machine to be repaired. I had taken it a few weeks ago when it started acting up, but the technicians said that there was nothing wrong with it. This time there was no argument, and the laser within the disc drive was replaced. So far I've managed to watch 45 minutes of "Shirley Valentine", and today the machine will have its first real test when it is supposed to record "Local Hero" (one of my top films; my wife can't watch the bought version because it doesn't have Hebrew subtitles) via timer this afternoon.

Anyway - I have all these films taped - but I've only seen part of them. One needs personal time to watch and enjoy them.

Israel moved onto Summer Time on Thursday night, which means that it doesn't get dark until after 7pm. As a result, I can now take the dog for long walks after I get home from work; previously there were days when we could only manage a swift walk around the block before darkness fell. These walks take between 45-60 minutes, and whilst they give me physical exercise and a chance to unwind, they also take time.

I've been working very long hours this month writing programs for the occupational therapist. One exam has been converted for use externally - that is, we put it on the Internet, from where companies with which we are in contact can download and then administer the tests in their environment, sending us the raw results. The first thing which I did with the program was to convert it from using the BDE to using a resource stored stringtable, in which are stored all the questions, as well as various strings which are displayed on the screen. We are hoping to have the questions translated into different languages (Russian is the major target), and now the program can easily support this. Another problem which we encountered the other day was that the program cannot be run on a mobile computer (well, of course, it can be run, but the user interface depends on pressing keys on the numerical keyboard, and a mobile doesn't have these keys). Letting other people run this program tests it properly.

We are also developing an aptitudes exam, which has caused me to learn new things (like how to store a JPG image in a database and then display it) as well as looking at these programs in a new, more abstract, light.

Our flagship product, the program which reads and evaluates users responses, is continually undergoing changes. The output is becoming more and more sophisticated, and now we are tailoring it for the specific needs of external companies. These results, simply put, give a psychological profile of the person sitting the exam; initially they were used for communal settlements wanting to check whether prospective candidates would make successful settlers, but now we are trying to move into the business market, and so are trying to tailor the results so that they fit into a business orientated mode. We have added - on the basis of existing data - filters and aggregates to check how a candidate does in specific areas of management. Whilst the base of the program - and the exam - remain unchanged (and have to, in order that the statistic analysis which resides at the bottom layer is unaffected), I am constantly adding new tables in order to handle new ways of looking at the data.

I also realised the other day that I could combine several tables, each of which contains only an id and a name, into one table, containing id, name and type. I can't do it now, as those ids are not unique and of course are scattered amongst other tables, but if I find myself having to add a new table with an id/name tuple, then I will extend one of the currently existing tables. This is the approach which I used in the aptitude test, when we decided to store each examinee's occupation and educational level. Keeping a separate table for five or six entries has a high overhead.

So now it becomes apparent how little time I have for reading books. More about them later.