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.
Friday, July 04, 2008
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....
Labels:
Corinne Bailey Rae,
programming,
prolog,
Randy Newman
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).
Labels:
ambient music,
cold feet,
dvd,
programming,
satie
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?
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 -
- 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.
- 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.
- 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.
Labels:
delphi,
programming,
resource files,
stringtable,
unicode
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
Heatwave
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:
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
ERP
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.
Labels:
Brian Viner,
dog,
dvd,
Ian Rankin,
management exams,
programming,
psychology,
Van der Graaf Generator
Sunday, March 23, 2008
Clarification
In my previous entry, I wrote "Israeli youth do not read Orwell or Eliot in school; they read the Bible (in what seems to me to be the least most important subject, even less useful than trigonometry)."
I didn't mean to give the impression that the Bible (old testament) is less valuable or even less literary than Orwell or Eliot, although that is exactly what I did. If my fellow workers would quote the Bible at appropriate moments, then I would be pleased. But it seems that the Bible is taught more as a historical story and less of a moral approach to life, and that's why fewer people quote it.
If someone can find a reference which will help us in purchasing strategies, I would like to be the first to know.
Teaching at schools seems to miss the point frequently. The point about trigonometry is not the trigonometry itself but the fact that it introduces new mathematical tools into the student's toolbox, a new way of looking at the world. As I frequently say when I see Excel being used for something for which it is not the appropriate tool, "when the only tool you have is a hammer, every problem looks like a nail". Schools are more geared to teaching the students the specific knowledge, instead of training them how to generalise the knowledge in the hope that they might use it in a completely different situation.
I was going to write "Literature informs computer science - how quaint!", but then I remember that in Stephen Levy's book about the Macintosh, "Insanely Great", the developers (especially Jef Raskin) did exactly that - look to literature and art in an attempt to improve their product, and make it more "human" as opposed to more "computer".
Another example: I was explaining to someone the other day how modular our ERP program (Priority) is, and how there is very little "program" - all the screens and all the reports are actually defined in database tables, and the "program" loads these screens or runs the reports as necessary. Thus it is virtually indefinitely extensible. One day later, I was talking with my occupational psychologist about the 'aptitudes' program which we have been developing, which contains several different mini-exams (finding the odd one out, vocabulary, etc). I had only developed a very early - but functional - version of the program, in which every mini-exam had its own table (and structure), its own data entry screen and its own exam screen. She wanted to extend the program without me having to add infrastructure, and then it occurred to me that I should write the program in the same vein as the ERP - allowing the administrator to define new exams, to enter the questions and even display them in a modular structure. I spent most of yesterday doing that.
Friday, March 21, 2008
Literary allusions
I sometimes wonder whether my colleagues at work think that I'm a little weird. Instead of talking about football or the wonderful dish I cooked the other night or even work, I tend to insert little pieces of culture which seem to come from nowhere.
People's ringtones are a rich source of information to be shared. Yesterday I found myself telling people about the pentatonic scale after hearing someone's Japanese sounding ringtone, and indeed my own general ringtone is a souped up, syncopated version of Eric Satie's "Gymnopedie" (which I got from a colleague who simply thought that it sounded nice). I actually bought a disc of Satie the other day, which I find quite pleasing and relaxing, although I must admit that I prefer a chamber orchestra to solo piano.
During a discussion about stock control and purchasing strategies, the immortal words of George Orwell suddenly entered my head.
He who controls the present controls the past
He who controls the past controls the future
He who controls the past controls the future
How apposite! One part of the purchasing strategy looks at the average use of raw material over the past few months, the number of months being variable. Normally it's six months, but I could change this. He who controls the present controls the past - changing this variable can cause changes in the average use, especially if it's a new part. Future orders in part (excuse the pun) depend to a certain extent on this average, and so he who controls the past controls the future.
As usual, no one knew what I was talking about.
Another pair of quotations from '1984' also finds favour in these quarters, especially when talking about databases and user privileges:
Knowledge is power
Ignorance is strength
Ignorance is strength
Most of the time I don't actually express these literary allusions but keep them to myself, because I know that most lack the references. Israeli youth do not read Orwell or Eliot in school; they read the Bible (in what seems to me to be the least most important subject, even less useful than trigonometry). As opposed to earlier generations of British schoolboys, I didn't have much Shakespeare forced upon me (that's why I was reading Orwell or Eliot), but I did pick up a little S, here and there. Playing The Young Cato in our school's production of "Julius Caesar" made me appreciate his language much more than trying to read his unpenetratable plays, but Israelis read even less than I did (although I think that all of S's plays have been translated into Hebrew). References to Brutus tend to fall on deaf ears, although people do know about knifing in the back.
Possibly I read '1984' and its soulmate 'Animal Farm' too young. I know that I was genuinely frightened by these books, both by the physical violence displayed in the former, but also in the latent violence present throughout. The thought that people could change their ideological outlook overnight is something that dismays and frightens me to this day - and in a way, I've been a party to it myself. I have often compared the ideological switch of the kibbutz movement (from "share and share alike" to "take what you can get") to the overnight changing of allegiances in '1984' (we have always been at war with Eastasia) - but again, few seem to know what I am talking about.
Sunday, March 16, 2008
Chava Alberstein
Last night we went to see veteran Israeli singer Chava Alberstein at the concert hall on the kibbutz. In thirty years of Israeli concert going, I've never seen her before. I'm sure that this is more my fault than hers, although I'm equally sure that she hasn't been performing for the past few years. There are no excuses though when she appears on our doorstop.
Chava plays competent acoustic rhythm guitar; supporting her were another acoustic guitarist playing lead lines, yet another acoustic guitarist who sometimes doubled the leads, sometimes harmonised the leads and sometimes played supported the rhythm. There was also a percussionist who made interesting sounds on a variety of instruments. I very much enjoyed the first ten or fifteen minutes of the show but then it began to pall, basically because every song started to sound the same. A ray of sun shone through the clouds when the percussionist suddenly played a few notes on some kind of marimba (I couldn't see as for me he was positioned right behind Chava).
A highlight of the first part of the concert was an acapella song (accompanied only by percussion) which worked on three levels. First of all, the song itself - an observation of paranoia whilst in passport control - was witty; secondly, the singing was divine; and most important, the stark nature of the song broke up the boring dynamic which had been established, and enabled the audience to refresh their ears.
After this song, the band went electric - one guitarist took up an electric, the other a bass and the percussionist went to trap drums. The result would have shamed an average garage band. They weren't bad, but they weren't very good. The drummer, who uptil now had been fairly impressive, was very limited on the kit, whereas the guitarist preferred twiddling around in a fruity tone which didn't add much. The bassist was almost inaudible.
Fortunately, this assault on the senses ceased, and then the third part of the show began, again in acoustic mode. The final song was one of Chava's most famous - and most moving - "Like a wild flower", the tale of a girl who finds herself as an outcast in kibbutz society and decides to leave.
The whole concert could be viewed on several levels, each with a different mark -
- the songs - generally of a high quality
- the singing - excellent (and let us not forget that Chava has been performing for 40 years)
- the arrangements - good, up to a point
- the dynamics - non existent
- the phrasing - four to a bar and very disappointing
The final, unaccompanied, song was actually a microcosm of the problem. Being a song which the entire audience had waited to hear, they all joined in. The phrasing of the first verse was very much on the beat and very standard. But by the time the third verse had come around, very few of the audience were still singing (maybe they don't know all the words), and syncopations were finally happening almost every line.
The rhythmic aspects of the evening were also disappointing. One waltz, one song which might have been in 12/8, and the rest in fairly straight-forward 4/4. No sambas, no bossa novas, no syncopations and no variations. No wonder I felt bored after fifteen minutes.
For the weeks prior to the concert, I had been wondering whether I should try and approach Chava after the concert. Several of her songs had meant a great deal to me in earlier days, but I haven't really listened to her in the past twenty years, and I know that performers are much more interested in what they are doing now rather than some forgotten song from 30 years ago. The solution came to me one day when I was walking the dog and listening to cover versions of songs which I had recorded. One of those songs - and in fact the only song which I have ever recorded in Hebrew - was a song which Chava made famous, albeit in 1975. I decided to give her a disc with that one song on it, along with a letter telling her how much some of her songs had helped me learn Hebrew all those years ago. This way I wouldn't have to talk to her.
And indeed I didn't talk to her. When my wife and I ascended the stage (as we do after most of the concerts to say a personal thank you to the performers), we were stopped by some official character who took my package and said that he would make sure that Chava got it. So much for all the indecision whether I should have my picture taken standing next to her. My email address was included in the letter, but I'm not going to hold my breath waiting for a reply.
Back to blogging
I haven't been here for a while, for various reasons, most of them totally uninteresting (like two weeks of flu). When I did decide that it was time to start blogging again, I was cut off out of my account and couldn't remember the password. No problem, says Blogspot/Google: press here and we'll send a letter to your email account giving instructions.
Yes, well the letter did indeed arrive but was coded in some strange unreadable language. All attempts at turning it into something recognisable failed. So I tried several different pages at Google in an attempt to rectify the situation, and eventually one sent me a readable email with a link to a page which enabled me to reset the password. Obviously, as otherwise you wouldn't be reading this.
Most of the last few weeks have been spent furiously coding, either at work in our ERP system, which is slowly but surely yielding to my wishes, or at home in the second job. Lately I've been working a lot on Word Automation; it's a subject which isn't covered very well, especially not for someone working in Delphi. I have to read the information contained on several different sites in order to get working code, and even then it's still a process of trial and error to get something that I want.
I've just learnt how to automate tables, and more importantly how to get them to autosize. The result is quite attractive.
Monday, January 28, 2008
Brains and mirrors
Last week I caught the tail end of a programme screened on BBC Prime about the function of the brain. This is a subject which has interested me for the past few years, so I made sure to arrange my schedule such that I could watch the programme last night. Three main points were introduced during the episode:
- Babies upto the age of six months are able to recognise and differentiate between the faces of primates (lemurs were the animal used) as opposed to babies over the age of nine months
- First impressions are very important
- Humans learn to read people's expressions and so try and understand what other people are thinking. In so doing, we mirror their body language
The moral of the first point is "use it or lose it". According to the brain, a baby has 1.5 times the amount of synapse connections that an adult does, because it has to learn so much. One of the things which it doesn't need to use is the ability to differentiate between primates, and so this ability withers over time.
The second two points are very important and are known collectively as "mirroring". This information was very familiar as I had been reading about it over the past two months in a book called "Social intelligence". The book goes into far greater depth than the programme did, of course, but as they say, a picture is worth a thousand words.
I found this book very interesting for a few reasons. Whilst reading a book by Martin Seligman, I became aware of the fact that my social skills aren't particularly well developed and that this is an area in which I could improve. I looked for something in this subject on the Internet and found "SI"; as it happened, the same evening I was in a book shop and found the exact same book on the shelves (maybe slightly more expensive than via Amazon, although once the shipping is figured in, maybe not) so I bought it. Reading it made me aware how much difficulty I have at times in reading people's expressions, and how my body language is frequently different from my companions (in other words, I don't mirror very well).
When taken to a more extreme level, such problems are one of the features of Asperger's syndrome, and if one continues on the same continuum, one eventually gets to autism. Whilst there is no possibility that anyone could ever consider that I have Asperger's, I do recognise the inability. Knowing about this allows me to do something about it.
The other reason why the book was interesting was that intellectual types like myself need these things spelt out, whereas other, more visceral, people know these things automatically. I also need the intellectual explanation, about mirror neurons and spindle cells, rather than the simplistic explanation as offered by the television programme.
As the programme wasn't subtitled into Hebrew, my wife had difficulty in following it, but I was able to explain the content to her. I was also glad that I was able to talk to her about such subjects as most people aren't particularly interested in an off the cuff chat about mirror neurons et al (Asperger's flag flying).
Labels:
Martin Seligman,
psychology,
social intelligence,
The brain
Tuesday, January 08, 2008
Sleep, part five
Whilst there are other things happening in my life (like our offices moving from where they were to a new site 5km away), most of them are day to day things which most people know about and have experienced. This seemingly narcisstic obsession with my health - and especially with my sleep problems - is designed to help other people who may find themselves suddenly confronted with these problems and would like to hear from someone who has already experienced them.
I've been back and forth to the sleep lab several times. Even though the technicians there are actually employees of companies that sell CPAP machines, they are more interested in finding the right machine and the correct settings to match each person individually rather than simply selling the most expensive machine that they can find.
The original test showed a horrifying 65 breathing episodes per hour; my first week of CPAP reduced that figure to 10, a huge increase. Even so, the technician was not impressed, and noticed that the data showed that air was leaking from the mask, thus causing the pressure to be higher than necessary. He adjusted the mask, and after another week, the data showed only 3.5 apnea an hour, an eighteen fold decrease.
The next session involved changing the CPAP mode: instead of automatically adjusting its pressure, it now works at a constant (and fairly low) pressure. I was waking at least twice a night, and the hours when I awoke corresponded with the highest pressures. Since that change, I have been able to sleep with the mask on all night! I do wake, but I can fall asleep again without too much difficulty. The next problem to be solved is the effect of the mask on my face - the nightly pressure leaves me feeling its imprint throughout the day.
I am pleased to say that I am no longer tired during the day, a sign that the treatment is working properly.
On another subject, I had another dental appointment yesterday. The result of my previous examination was that the crown needs to be replaced (yet again) in order to fit the new shape of the tooth, following the root extraction. So yesterday I had the crown removed (via drilling and demolishing - it doesn't come out easily) and now I have a new temporary crown. In another few weeks the tooth will be examined again and then we go once more through the sickening process of preparing a new crown. I jokingly asked whether I can use the casts of my teeth from the previous time, at least for the lower jaw - anything to avoid the making of casts again.
Subscribe to:
Posts (Atom)

