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.