Saturday, March 30, 2019

New song

In one of the more lucid moments when I was ill with pneumonia at the beginning of the month, I sat down at the piano and began improvising. After a while, I discovered that I had created the basis of a new song. I then rushed (as much as is possible with pneumonia; it would be more accurate to write that I dragged myself) to the computer in order to enter the song into the sequencer, but also decided to record myself playing the one verse on piano by means of my mobile phone. It's a rough recording but good enough to remind me of what I had written: another one of these serpentine-like tunes which go up and down the keyboard, accompanied by chords which don't necessarily belong to a key or mode. After thinking about it for some time, I realised that the song was basically in A minor, although there are a few bits which are out of this key.

Over the days, I developed the song whilst arranging it: a middle, instrumental, section appeared, followed by a bridge. At one stage, the instrumental section was repeated as a coda, but this got changed later on. I also created a minimal version of the song - just some chordal instrument along with the tune: this was a guide version intended to help me write the words. Whilst doing so, I saw that I needed a few bars of music between the first two verses; the link between the sung bridge and the third verse also needed a few extra bars. It was probably at this stage that I realised that the tune did not match my vocal range: either I would have to lower it a bit and sing at the top of my range, or raise the tune and sing at the bottom of my range. In the end, I raised the song by four semitones, to C# minor, making the lowest note B below middle C.

Once the arrangement was nearly complete, I could write the words. On a Friday two weeks ago, I wrote the opening verse (after discarding my original lyrical idea); the following day I wrote the next verse, and just over a week ago I wrote the rest of the words. Of course, I was very interested in adding vocals to the music as soon as possible, as this helps me hear the entire song better (as a producer).

I made a few attempts at recording the vocals as well as mixing: I knew that I would eventually be discarding these vocals. This initial version had tentative singing, which shows how new the tune was to me. I always wonder how the Beatles could record a song which had been written only a few days before with such confidence, sounding as if they had been playing the song for months or years. I'm thinking of the pre-Revolver days, possibly even pre-Rubber Soul, when a complete song was recorded in one or two sessions, with no room for reconsideration.

Yesterday I had the time and space to record new vocals. My usual strategy is to record me singing all the song through a few times then make a composite version. If one take was good all the way through, then this would be used, but sometimes I mess up the words (even though I'm reading from a lyric sheet) or the phrasing, so I could have one take with two good verses and another take with the other verses. From this composite version, I then do 'breath removal' and tuning: these are technical and painstaking, but they make a big difference to the final product. Breathing sounds especially bad after equalisation and reverb. From this master, I might then extract lines for further manipulation, either for emphasing a part or for creating harmonies. As it happens, after all this, I wasn't happy with the vocals for the middle bit, so instead of singing it again, I extracted the necessary bars from the original vocal from last week and gave it some treatment.

After all this technical material, one can see that I am more interested in the music and the final production; what about words? As opposed to my last few songs which seem to be interested in telling myself something, this one was a throw-back to the days of 1975/6, starting "Where are the autumnal backstreets where we used to walk? Where are the leafy bowers where we used to talk?". They're not bad lyrics, but they don't mean very much to me, at least, not now. Sometimes lyrics which seem to be written off the cuff later turn out to be very perceptive.

Saturday, March 23, 2019

Wake up call

A few days ago, I had a routine blood test performed. These days, one can get most of the results the same day, so that evening, I was able to log on to the appropriate website and see the results. Most of these were fairly similar to my last set of results (although the cholesterol set of tests may have slightly improved), but one result set my alarm bells ringing.

The blood glucose level was 110 mg/dL, where the recommended range is 70-100; looking at the history of results from the site, there is a definite tendency to increasing levels.
DateConcentration
10/04/201497
07/08/201492
14/09/201498
19/10/201490
28/01/2016103
18/02/201694
27/08/201795
10/05/201899
21/03/2019110

The statistician in me would prefer more data points taken at more regular intervals but I think that the meaning is clear. Lest I suspect that there was a problem with my recent blood test (like eating ice cream after 8pm the evening before), there is a separate blood test called Hemoglobin A1c %, which evaluates the average amount of glucose in the blood over the last 2 to 3 months by measuring the percentage of glycated (glycosylated) hemoglobin (source). The normal range is 4.0 - 5.7%; my level was 6.1%. I have no history of this test for comparison. It is interesting to compare this level with overseas standards: The American Diabetes Association currently recommends an A1c goal of less than 7.0%, while other groups such as the American Association of Clinical Endocrinologists recommend a goal of less than 6.5%. In 2016, the ADA recommended that an A1c level of 6.5% as a cutoff level to diagnose diabetes (source).

I read somewhere (possibly on the health fund's site) that these elevated levels can be caused by the following factors
  1. A sugar rich diet
  2. Lack of exercise
  3. Some pre-existing condition in the body
I have control over the first two factors, so I will have to do my part with life style changes. I used to speed walk 5km every evening a few years ago, but this stopped after we 'changed' dogs. It's easy to find excuses, such as 'next week I have to travel to Karmiel on Tuesday and Wednesday, and to Haifa on Thursday' or similar. But I have to do something!

I am out of condition. Yesterday I walked just over 1.5km in 17 minutes before my right leg started hurting just above the ankle. Today I walked 2.2km in 23 minutes before the pain started, so at least I am improving. I shall have to force myself to find the necessary 30-40 minutes every day whenever possible.

I suspect that I am also developing lactose intolerance; apparently this increases (i.e. the body becomes less tolerant) as one gets older. One of my brothers in law has lactose intolerance and avoids milk and cheese almost completely. He is of Yemenite stock, which is traditionally lactose intolerant, whereas I am of European stock, which is traditionally tolerant. This is a problem for me as I drink 2-4 glasses of milk a day; I have learned to drink only one glass of milk when I am in Karmiel if I want to avoid pains and hiccups on the way home. It probably doesn't help my digestive system that I am sitting without moving for a few hours.

Fortunately, milk companies in Israel sell 'low lactose' milk with 2% fat; I bought a couple of cartons yesterday and have been drinking the milk with no ill effects. But at work this is going to be a problem: I can't see me taking a carton of low lactose milk to work and leaving it in a refrigerator without someone else using that milk, even if I label the carton. I think that the solution will be to keep it in a non-transparent plastic bag. But I can't see myself traveling to Karmiel (3 hours) with a carton of milk in my bag; I think that I'll ask the secretary there to buy me a carton for next week.

I assume that I will be summoned soon to our family doctor where we will discuss the blood results. I also intend to bring up the lactose problem. From what I have read, intolerance is not normally tested by clinical means but rather by symptoms and reducing exposure to milk. So I'm going to continue with the low lactose milk for a few weeks and see what happens.

Saturday, March 09, 2019

The Tel Aviv Saxophone Quartet

Yesterday evening, combined with a celebration of Women's Day, we were treated to a concert by the Tel Aviv Saxophone Quartet. Their personnel has changed from the photographs on their site: whilst the alto and baritone players are the same, the tenor and soprano players have changed. The new soprano player comes from our kibbutz (he and my son were childhood buddies) and the new tenor player comes from a moshav not too far away and went to school with a few kibbutz members.

I missed the beginning of the concert (8:30pm is too early for a Friday night) so there may have been a formal presentation of the quartet and its aims. I didn't catch the names of most of the pieces they played, but looking at a list posted on their site, I can see that they played a piece by French composer Bozza as well as what was originally a string quartet by Kodály, rearranged for a saxophone quartet.

The only piece whose name I did catch was the closer, six bagatelles by Ligeti. I found a performance of this on YouTube which gives an idea of what we heard last night (although without the choreography!). There it is played by a piccolo, oboe, clarinet, French horn and bassoon; obviously one part got swallowed up in the translation to four parts.

As is hinted by all the composers, the music was strictly 20th century, meaning that there weren't any 'tunes' nor chordal progressions. The pieces in no way are easy on the ear, although some of the Ligeti pieces were more textural as opposed to musical (that's not a criticism). Whatever, the playing and communication between the instruments was precise and impressive. The acoustic balance was excellent, achieved without microphones. The tone of all the saxophones was 'pure' as opposed to 'jazzy'. I often feel that the saxophone parts which I sequence are not realistic as there are no slurs or other modern affectations, but they would have been at home with the pieces played yesterday (although they would have stood out due to their simplicity).

Looking at the list of pieces by Ligeti,  I see that there is one called 'Clocks and clouds', written in 1972-3. There is a piece by National Health bearing the same name from about 1975; it wouldn't surprise me that Dave L. Stewart appropriated the name although I doubt that the content is similar. Stewart's one time collaborator Mont Campbell lifted a part from Vaughan Williams' 'Overture to The Wasps'.

Unfortunately I don't have a photograph from yesterday evening: the empty seat which I found was behind the baritone sax player. Even from straight on, I doubt that I would have achieved a good photograph as the players 'hid' behind their music stands. It never even occurred to me to record their playing.

Wednesday, February 27, 2019

Pneumonia again

My last minimal blog entry from Friday concluded with these words: I woke up yesterday with an aching throat; now I've got a cold, the likes of which I haven't had for a few years. On Saturday, I didn't feel any better and spent most of the day in bed. On Sunday, I went to the clinic for a throat swab, as my primary problem was pain whilst swallowing (dysphagia) along with the copious production of mucus. I stayed at home on Sunday and Monday, and by early afternoon I was beginning to feel better - especially my throat wasn't hurting as much.

But then I developed a headache and a fever and began to feel much worse: less mucus, much more coughing. Yesterday (Tuesday) I went again to the clinic and was surprised when I was ushered into the doctor's office without waiting and without an appointment. This doctor - a locum - listened to my presentation, examined me and then sent me to the neighbouring town for a chest x-ray. As my wife wasn't around, this meant that I had to saddle up the motorbike in order to get to the x-ray clinic. Fortunately, this is situated next to the railway station, which is very close to where I live.

After a few minutes waiting, I had two x-rays taken, then was sent back to my doctor. She was able to look at the pictures immediately (this is fine progress!) and was able to see that I had pneumonia. She gave me a prescription for antibiotics and for a mucolytic agent, saying that the (kibbutz) clinic had the antibiotic.

As it happened, there was a kibbutz member who had seen the doctor just before me; he too had been diagnosed with pneumonia and had been prescribed the same antibiotic. The nurse was dispensing him the antibiotic when we realised that the clinic had only enough for him; I did not fancy going back to town to the dispensary (I was very weak at this point). The member was very kind and suggested that he take one of the two packages of antibiotic whereas I would get the second package; I would return the package (or equivalent) when my wife sets the prescription filled. Since then I've taken three doses of antibiotic.

Looking at the previous time when I had pneumonia (almost exactly five years ago), the story is almost the same. Then I was diagnosed on the basis of the physical exam (a rattle in my lungs) whereas this time it was on the basis of the x-ray. I don't think that I am as weak now as I was then, but I am having difficulty in concentrating on anything that requires mental effort (writing this blog was difficult at times). People at work send me letters (to the internal mail server), seemingly unaware of my incapability; I haven't answered many. My phone is on 'quiet': I've noticed that a few people have tried calling but of course I did not reply. I communicate mainly by WhatsApp which is just as well as I can barely make a sound with my voice.

Friday, February 22, 2019

Glissando and staccato

Yesterday was the first time I've seen my elder grand-daughter for some time, so of course we had to play a little piano together. I tried to explain to her the terms glissando and staccato (and of course, legato); whilst she understood staccato, the glissando was beyond her. Not surprising really: it requires quite a bit of strength to press the keys properly.

I woke up yesterday with an aching throat; now I've got a cold, the likes of which I haven't had for a few years. This means I'll be keeping my distance from the grandchildren tonight.

Saturday, February 16, 2019

I can't sleep without CPAP

On Thursday evening at around 9pm, the power went out. Shortly afterwards we received a message on our mobile phones saying that the electricity company was working in the area and had caused the power cut, which was expected to last two hours. Like everyone else, we went to bed early.

There are three factors which help me sleep well: being relaxed (normally due to a hot shower just before going to bed), having a warm bed (an electric blanket in the winter) and my CPAP machine. It also helps to be tired. On Thursday I had none of the three factors and so I slept badly; I had great difficulty in falling asleep and when I did, the sleep quality was not good. It didn't help that my right nostril has a propensity to close at night; CPAP keeps it slightly open.

I got up at around 1am and sat in the lounge with my mobile computer and personal internet router in order to connect to work in order to check something. I stayed up until around 1:30am; before returning to bed, I checked the fuse box and also went outside to see whether the light on the landing worked. The electricity had yet to return.

Back in bed, I managed to sleep somehow until my phone alarm rang at 6am. Still no electricity. After taking the dog for a walk, I noticed that there were lights on in other buildings. I checked the fuse box again and saw that the circuit breaker was off; once I raised it, all the devices in our house started working. There were several beeps as devices announced their return to life; the lights came on as did the air conditioner. 

As far as I can remember, there hasn't been a night in the past ten and a half years when I haven't slept with the help of my CPAP machine. I have read that many people can't get used to it, but I can't get used to sleeping without it. Even in my darkest hours with pertussis (whooping cough), the CPAP machine kept me breathing - and just as well.

I was looking forward to a hot shower on Friday night before going to bed, but the water was only lukewarm. The electric blanket had warmed the bed so my body relaxed quickly. Of course, I was very tired so I fell asleep quickly. This morning we realised that the power cut had caused the timer on the water boiler to go out of sync which is why there was no hot water in the evening.

By asking other people, I established that the electricity returned at about 2:30am, much later than the electricity company said.

Saturday, February 09, 2019

1,200 blogs

Another 100 blogs gone: blog 1100 was posted on 24/12/2017 and blog 1199 was posted on 08/02/2019 - 13 and a half months, which means that my posting rate is slowing slightly compared to other years (e.g. 100 blogs in eleven months).

Here are the top tags, again with few surprises
PositionTagCount
1DBA13
2=Personal12
2=Priority tips12
4Holiday11
5mp37
6Programming6
6=Torino6
8=Delphi5
8=Headphones5
8=Obituary5
11Jewish holidays4

I'm in a very sombre mood at the moment: the shock of the funeral yesterday, the rain which has poured down almost without break since yesterday night, and the fact that the topic 'obituary' makes it into the top ten.

I found a few more pictures of Yair hiding in my mobile phone: this one is from four months ago, from our most recent 'company day'.

Friday, February 08, 2019

Black Friday

This morning, a colleague telephoned me to say that another colleague, the manager of the factory where we work, had died suddenly, and that the funeral would be today at 12:30pm. To say that I was surprised and shocked would be an understatement. This manager is not my manager, although we worked most of the time in the same building.

I was preparing mentally to give a eulogy at the funeral, but there were hundreds of people there (the deceased is one of seven brothers and two sisters), most of whom probably would want to speak, and also the man running the proceedings said that as it is Friday and some people have to travel long distances, there would be little time to prepare for the Sabbath, and so only the son and daughter would speak.

So I am going to write here what I might have said....

Just before leaving for this funeral, I heard about the death of a kibbutz member, MB. This man was the manager of Tzora Furniture who accepted me to work, 30 years ago. It is a sad coincidence that he died the same day as Yair, who has been the manager of TF for the past eight years. Yair and I used to speak most days, not only about work matters, but also about more personal topics. Despite the many differences between us, there are also many similarities: we're both near enough the same age (I'm slightly older).He has a son and daughter, I have a son and daughter. He was at my daughter's wedding, I was at his son's wedding. He had a grandson, I have a grand-daughter (in fact, two). 

We often used to compare notes about our grandchildren; Yair's eyes would light up when he spoke about his grandson and about the joy which he brought to his life. Yair even told me that his grandson has a special 'kiddush cup' for Friday nights when the family sits around the table.

At this point, I would have dried up and possibly choked up; I don't have anything more to say except for the fact that I am still in shock and unable to process the news. I don't know what is going to happen come Sunday morning when the workers, almost all of whom were at the funeral and as stunned as I was, turn up. 

The picture above shows Yair and myself captured at my daughter's wedding, nearly five years ago. It's not particularly flattering to either of us, but it's the only picture I have of my friend and colleague.

Wednesday, January 30, 2019

Yet another mp3 player

I last wrote on this topic at the end of August, exactly five months ago, saying "I have ordered yet another player from Ebay but this has yet to arrive so I can't comment on it". The player is a 4MB Ruizo: it has both internal memory and can accept a memory card. So loading this player simply involved me extracting the SD card from the Sansa Clip and inserting it into this player.

The good points of this player: it seems to run forever without being charged and it has a good sound. More importantly, it continues playing from exactly where it was when it was turned off, so theoretically this is the perfect mp3 player.

Why am I less than enthusiastic? The 'user interface' is extremely badly designed, seeming to me non-intuitive and inconsistent. When scrolling though a list, it seems obvious (to me, at least) to use the up and down arrows, but the interface requires using the left and right arrows. Every menu option seems to use the arrow keys in a different manner. Changing the volume is likely to succeed 50% of the time; the other 50% will do something random. I only discovered the 'continue playing from the same place' by serendipity a few weeks ago.

Another small but important point: the Sansa Clip had, as its name suggests, a clip which allows the player to be clipped on to a piece of clothing or to a belt. The Ruizo has a hole at the top which allows a lanyard (a piece of cord) to be attached; presumably this lanyard is then supposed to go around one's neck allowing the player to be like a medal. This is unsatisfactory. After thinking about this for a while, I realised that I can use a key chain - treat the player as a key, then hang the chain on my belt.

Since then I have ceased to use any of the player's options. I turn the player on - it starts from where it stopped previously. When I finish, I press on the round button in the middle for a long time (a few seconds). If I am lucky, there will appear on the screen 1 2 3; I continue to press on the round button until these figures disappear,  to be replaced by 'Bye bye'. I then turn off the player with the on/off switch. 

These simple operations give me what I need. Anything else is liable to pick a random song, or one which is much earlier in the playlist. As I have over a thousand songs on the card, I haven't got to the end yet, so I don't know whether the list will 'wrap around' and start again from the beginning. I'm not even sure if the songs are being played from the card or from internal memory; at one time I tried to set up a play list, but this seemed to play only songs from internal memory so I copied as many songs as I could from the card to the memory.

If it weren't for these interface problems, this would be an excellent player. A set of instructions came with the player, but these were largely incomprehensible, and as I wrote earlier, key usage is inconsistent. At the moment, this is the best player which I have, but it needs improvement.

Saturday, January 26, 2019

Thank heaven for system restore

Yesterday ended with me writing "I posted a question on the program's support forum". Due to the day's frustration, I was pessimistic about the chances of receiving a useful reply. Someone did post an answer, most of which was about updating drivers and similar. But the first sentence was the key: restore the system from a system restore point.

I was pleased to discover that my computer creates a system restore point every morning, so I could restore everything to how it was yesterday at 6am. After rebooting, I started the multi-track program, and yes! There was now audible output through the computer's sound card.

For about ten minutes, I tried recording vocals with the microphone connected directly to the computer's sound card but this was not good. So I then connected the external sound card to a USB port, connected the headphones and microphones ... and was able to make very clear recordings.

I sang the song through once, which seemed to be sufficient. Just at the end of the first verse, my telephone beeped which caused me to record a 'drop in' on the final line. Whilst editing the sound file, I saw that the beep occurred just after my singing, so I was able to silence this without needing the drop in. I then spent an hour or so tuning the lead vocal as well as separating strategic parts so that I could create harmonies.

I'm now listening to the finished song and everything seems to be fine. I'll master a version and listen to that for the next few days.

Friday, January 25, 2019

Frustrating day

Yesterday I surprised myself slightly by writing the final verse to the song that I wrote about a few months ago. Every so often I would tinker with the arrangement slightly, but finding words - or even a topic - seemed to be beyond me. About a month ago, I managed to write almost two verses, but threw them out a day later as they seemed to be repeating lyrically what I had written in an earlier song and they sounded very false. Since then, I have managed to write a verse a week, and yesterday, as I mentioned above, I wrote the final verse.

Today I had plenty of time on my hands, so I thought that I would record the vocals. I setup the microphone on the mike stand, plugged in and recorded a few takes. When I listened to them, the tracks had a terrible audio quality, as if they had been recorded at the bottom of a big hole. No amount of equalisation could save them. So I exchanged the microphone and headphones for the combination phones/mike which I used for several years, and recorded a few more takes. Whilst these sounded better, they were still very boxy. OK: I tried yet another microphone which I have. Slightly better but still bad.

At this stage, it occurred to me that the problem might not be with the microphones but rather with the cheap external sound card which I am using, that allows me to connect the microphone and phones to the computer via a USB connector. Years ago, I used to be able to connect the microphone to my 'music' computer and record with the multi-track recording program which I have. At some stage, recordings made this way started sounding bad, which is when I started to use the external sound card with Audacity to record on a mobile computer. Maybe I could try recording directly again.

At this point, the multi-track software ceased working: I get error messages about the sound card not being able to handle input. I tried different configurations but was unable to hear anything from this program. I should point out that other programs - wave editors and mp3 players - work correctly. Strangely enough, I was even able to use the multi-track program to mix the tracks which I had created, although this was not a good idea as the vocal wasn't synchronised with the music, apart from the poor quality of the sound.

So not only did I waste several hours trying to get a good vocal sound, I also managed to ruin the setup of the program which I need in order to turn the vocals into something which sounds good. Very frustrating.

I posted a question on the program's support forum, but I am not optimistic about getting a useful answer, primarily because I am using a very old version of the program.

Monday, January 21, 2019

Validity styles

Over the past six months, one of the psychologists employed by the OP for whom I consult has been working on developing new models, which explain inter alia the 'validity style' of an examinee's responses. These can vary from 'random' (in which the examinee hits one key repeatedly without reading the questions) to 'honest' and on to 'normal' as a default value. The psychologist sent me a list of rules which enable the program which displays an examinee's results to determine the style. He wrote the rules in pseudo-code:
If (INF == extreme && IR == extreme) then return RANDOM. If (INF == extreme) then return INFREQUENT. If (IR == extreme) then return INCONSISTENT. If (DEF == extreme || GI == extreme || (DEF == borderline && GI == borderline)) then return FAKE_GOOD. If (DEF == low) then return HONEST. If (CM == extreme) then return UNCOMMON. (Else) return UNCLASSIFIED.
I have implemented similar rule mechanisms in the past, but in each case they were always 'and' statements, like the first rule shown above. 'Or' statements seem to be more complicated, and 'short-circuit evaluation' should be used throughout. There was one rule which had both 'and' and 'or' statements which had me literally scratching my head how to implement this.

At one stage, I half seriously considered embedding a Prolog interpreter into the program, as these rules could easily be rephrased as Prolog rules, such as
random:- inf (extreme), it (extreme). infrequent:- inf (extreme). inconsistent:- ir (extreme). fake_good:- def (extreme). fake_good:- gi (extreme). fake_good:- def (borderline), gi (borderline). honest:- def (low). uncommon:- cm (extreme). unclassified:- true.
but I quickly backed down from this idea. The above mental exercise reminded me that in Prolog, 'or' statements are handled by having two similar rules. After this insight, it became easier to translate the rules into data stored in SQL tables.

Writing the interface code to store the rules was complicated as I identified three different possibilities: creating a rule with a clause, editing that clause and adding a new clause to an existing rule. Thus for 'or' statements, there would be two (or more) rules whereas an 'and' statement would require one rule with two (or more) clauses. Once I worked this out in my head, the implementation simplified.

Writing the code to evaluate the rules (the equivalent of a Prolog interpreter) took some time, primarily because I confused the short circuit evaluation with the value returned by the evaluation function as to whether a rule was proven. After debugging this code live several times, I finally figured out how it should be written. Testing the code on real data seemed to work, but in almost every case, the result was 'normal', which didn't really test anything.

So I added a 'validity style' field to the 'people' table and wrote an external program based on my code which would evaluate for all people who have been tested since 01/01/17 (about 4500 people) their validity style and store this value in the table. I ran the program then queried the table to find people who did not have a normal style. The result was no one, which I knew was incorrect. I went over the code line by line which seemed to be correct, but then I noticed that one query was not closed. This wouldn't make any difference if only one person is being tested (as in the production code), but for my testing code this was a bug. So I added the 'close' statement, ran the test again, and discovered the many people who have non-normal validity styles.

The next step is to check the complete output for these people in order to see whether the raw data supports the validity style. This isn't my problem.

Thursday, January 17, 2019

Under pressure but trying to escape

I see that it's been a few weeks since I last posted something here. That doesn't surprise me very much as nothing particularly interesting has happened so far this month, and I've been under a great deal of pressure (or, quite possibly, created for myself the pressure). I have known for two weeks that there would be two difficult meetings in which I had to participate - one at home (kibbutz) and one at work; as it happened, they were held day after day. The meetings have now passed; I won't say that I came out of them unscathed, but at least they weren't as bad as I might have suspected.

Another weight on my mind has been my doctorate: specifically, a failure to chase after people in order to interview them. As it happens, yesterday I completed an interview with one of my (former) pupils then wrote up the interview. Apart from asking former pupils, I also send 'cold emails' to any Priority using company that orders from my company - I can see from their order form which program they are using. This morning I received an answer from one of these cold emails, that someone is prepared to be interviewed! I must follow this up and interview the person next week. I should point out for my readers that these interviews last for about an hour and are conducted by means of the telephone. I downloaded an app for my phone last week which automatically records telephone calls; this worked well yesterday. In the evening I copied the files (the interview was interrupted a few times) from the telephone to my computer; I then listened to the interview and filled out the written report, stopping the interview whenever necessary. I am also translating and paraphrasing as I write.

I have also been planning this year's holiday which will be in Greece: some time in Athens and some time in Andros, which is a very green island (as opposed to Santorini) which is close to the mainland (the ferry ride is 'only' two hours). After playing around with dates and flights, I was able to book the hotel which we wanted in Andros, but was unable to do so with my first and second choices of hotel in Athens. It seems that there is something important happening on May 22nd, because both hotels were full on that date but had rooms for the previous and following days. Anyway, I booked with a third hotel which looks reasonably good.

And somewhere in the background, I have been listening frequently to the song "We can be together" by Jefferson Airplane. I first heard this song some years ago after having downloaded the 'Volunteers' album but wasn't particularly impressed - the song shares the same opening riff with the song 'Volunteers'.  Somehow recently my attention returned to this song and I've been listening to it closely in the past few days. I especially like the vocal harmonies of the 'chorus' and also appreciate the cognitive dissonance between the singing and the words, especially those of the second 'chorus' ("Up against the wall..."). There is a live version of this song on YouTube from the Dick Cavett show, broadcast the day after Woodstock (August 19, 1969) which is quite infamous, as the song was broadcast without censorship (listen and you'll hear why).  

A very good article about this song can be read here. I listen to the music much more closely to the words and can see that the article mentioned above misses a few musical things. Musically, the live Cavett version is inferior to the studio version which is not too surprising as there are some very interesting rhythmic changes happening throughout the song, which get somewhat mangled when played live. Most of the song has a straight-forward 4/4 beat (and one clip shows drummer Spencer Dryden thumping his drums in a normal rock rhythm) but other parts have a slowed down, possibly 3/4, rhythm. 

Tuesday, January 01, 2019

An SQL trap and how to get out of it

Today I spent about two hours trying to debug a complicated Priority procedure. After about half an hour, I managed to determine exactly where the problem lay, but I couldn't figure out why there was a problem. As it's cold and wet outside, I couldn't get up and go for a walk, turning the problem over in my head. Having a break for lunch didn't help either.

Here's the problematic code
INSERT INTO GLOB_TMPTREE (FATHER, SON, PIS, ORDI, USER) SELECT :PART, ORDERITEMS.PART, TEC_ORDIFEATURES.OPTIONCODE, ORDERITEMS.ORDI, SQL.USER FROM ORDERITEMS, TEC_ORDIFEATURES, TEC_FEATURES WHERE ORDERITEMS.ORDI = TEC_ORDIFEATURES.ORDI AND TEC_ORDIFEATURES.FEATURE = TEC_FEATURES.FEATURE AND TEC_FEATURES.FEATURECODE = 'PIS' AND ORDERITEMS.ORD = :ORD AND ORDERITEMS.TEC_U1 = :U1 AND ORDERITEMS.TEC_U2 = :U2 AND ORDERITEMS.ORDI <> :XLINE;
Leaving aside the specific details of the query, I am selecting data then entering it into a table. I checked (several times) that the actual query was returning data; even so, it was not being inserted into the table. The line before the quoted passage deletes all the lines in the table belonging to the current user so there shouldn't be a problem in inserting the data.

With the benefit of 100% hindsight, I can now say: when an insert fails, check the table's primary key. In this case, the primary key was composed of father, son and pis; it so happened that another user had tried to run the procedure but for some reason, the procedure didn't complete and certainly didn't clear up after itself. There were lines in the table for this other user - and it turned out that the primary key values for these lines were exactly the same as the ones I was trying to insert.

When I finally got to this stage, I deleted all the lines in the table (this is only a temporary table with a few lines at most); I then ran the procedure, and unsurprisingly it did exactly what it was supposed to do. I then added the 'user' field to the primary key which should prevent the same error from happening again.

So: when an insert fails, check the table's primary key! Maybe next time I'll remember this.

Monday, December 31, 2018

Love is all you need (film)

I had recorded some time ago a film whose unpromising blurb was something like 'Romantic comedy in which Pierce Brosnan attends his son's wedding in Italy'. As our Yes Max video recorder is due to be replaced today, I thought it prudent to actually watch the film before it gets lost. The first few minutes were disconcerting: a woman had gone to see an oncologist ... and they were speaking in some foreign language which I originally took be Swedish but turned out to be Danish. Then there was a scene with Brosnan as the CEO of a vegetable/fruit company ... not very promising. I fast forwarded about 15 minutes to a 'meet cute' between the above woman and Brosnan which was taken straight out of 'Cold Feet': the woman backs into Brosnan's car in an airport car park. This reminded me of the exchange between Adam and Rachel in CF: "Who was your driving instructor, Stevie Wonder?" "At least I had a driving instructor".

Once they calm down a little, it turns out that the woman is flying to Italy to attend the wedding of her daughter; strangely enough, Brosnan is flying to Italy to attend the wedding of his son. Of course, it is her daughter marrying his son. Cut to a local Italian airport and then to a drive along countryside which looks extremely familiar: they were driving on the road between Sorrento and Amalfi! From this point on, the charm of this area took over the film, which improved immensely. There were many romantic shots of the gulf of Naples, both early morning and evening, which placed Brosnan's villas in the hills above Sorrento, in the Sant' Agata area.

Apart from general scenic shots, there were a few places which I recognised immediately. There were a few shots of Marina Grande, which is right next to where we stayed in Sorrento the first time. When the ladies went "into town to buy clothes", there was a shot which started with the bell tower then ran down the lane where the 100m pizza was served and into a junction where we ate Gnocchi alla Sorrentina. The wedding took place in the cloisters of San Francesco (pictured on the left). It should be noted that all the locations in Sorrento looked cleaner and less run down than they did when we were there. The film was released in 2012, meaning that it was probably filmed a year earlier, whereas we didn't go to Sorrento until 2014, so the intervening years may have contributed to removing the sparkle from the locations.

There was one thing which nagged at me: wedding guests are seen arriving and departing from Marina Grande by boat. Apart from the fact that most boats leave from Marina Piccolo, why would one travel by boat from Sorrento to Naples (airport)? Obviously, the scenic factor plays a part, but Brosnan was shown arriving by car. Only when watching the credits did this become clear: they all arrived at Salerno airport, not Naples. This explains how come Brosnan travelled by car along the Amalfi coast and why the guests travelled by boat.

In the end, I found the film much more enjoyable than the opening minutes suggested.

Friday, December 28, 2018

Amos Oz (1939-2018)

I have just learned that esteemed Israeli novelist Amos Oz has died at the age of 79 from cancer.

I first became aware of Oz around 1975, when I read the English translation of his (then) most famous book, 'My Michael'. This was a story set in Jerusalem just after the creation of the state of Israel. Probably most of the allusions passed me by, but I remember going past certain buildings and thinking to myself that these were mentioned in the book. I read another of his books in translation a year or two later ('Elsewhere perhaps') which was set in a fictional kibbutz, one which was quite unlike the kibbutzim which I had already begun to know and love.

I emigrated to Israel in 1978, to a kibbutz called Mishmar David, whose closest neighbour is kibbutz Hulda, where Amos Oz was living. I remember that during the first weekend after emigrating, a group of us went to Hulda in order to use their swimming pool (we didn't have one at the time in Mishmar David). If I remember the story correctly, after we had left the pool, Amos Oz arrived with Jane Fonda.

A few years later, in an attempt to improve relations between the two kibbutzim (there were no arguments between the two ...), probably at Sukkot (when it is traditional to entertain guests), we went to Hulda and were hosted by several families. My wife was talking to the family that entertained us about their house, and our hostess said something like "I'll show you something else". She went outside, knocked on the door of the next apartment and was bidden to enter with us. "Thank you, Amos", she said. Only afterwards did my wife realise that we had been in the house of Amos Oz.

An apocryphal story which was making the rounds at this time had the treasurer of Hulda calling upon Oz and telling him that he was the most successful branch of the kibbutz (in monetary terms); the treasurer wanted to improve the income of this branch by allowing a few pensioners to work with Oz and so increase the work force.... Maybe this story loses something in translation.

A few years later, Oz and his family moved to the desert town of Arad in order to ease his son's asthma, and so our paths ceased to cross.

The last book of his which I bought was a non-fiction book about the Israeli elections in 1982, when Oz visited several cities, towns and settlements.

Saturday, December 08, 2018

Friday, December 07, 2018

24 hours and 180 degrees

Yesterday, shall we say, was not a very good day. In the morning, I travelled to Tel Aviv and got soaked to the skin. I don't like rain very much, but once I was wet, it didn't bother me any more as I couldn't get any wetter than I already was. I dried off slightly whilst in the train, but the rain at the other end of the journey ensured that I arrived home wet - I went straight into the shower, taking off my wet clothing and hanging it to dry. To add insult to injury, I tried to get some cash from the ATM at our local bank branch; the machine swallowed the card!

Overnight 70 mm (2.8inches) of rain fell on the kibbutz, which is a very large amount! About 11% of our annual rainfall. I was about to take the dog for a walk at about 4pm when there was a break in the rain, but by the time I had put on my raincoat (fortunately I have two, for the first got soaked in the morning) and put the dog on the lead, the rain had started again. We managed a walk later on in the evening.

This morning, a telephone call woke us at 5:40am; it was our daughter telling us that it was time for her to go to the hospital in order to give birth to her second daughter. At 10:30am, she sent us a message telling us that she had given birth to a 3.20kg baby! Our other grand-daughter has been with us for most of the day and will stay with us until tomorrow evening when presumably her father will come back to the kibbutz (he will stay overnight with his family in Jerusalem).

I had a nagging feeling that there was something important about 7 December, but it took me a while to figure out what it was. Aside from it being the sixth candle of Chanuka, it is also the 70th birthday of our kibbutz! So we'll always remember this date! Since the formal announcement via the kibbutz website an hour ago, our phones have been beeping every few minutes with congratulations from our friends.

There's no formal picture of our new grand-daughter, but we do have a picture of us lighting the candles.

And to add icing to the cake, I was able to get my debit card back from the bank and was able to withdraw cash.

My world has changed 180 degrees in the last 24 hours!

Wednesday, November 28, 2018

Executing a program and waiting for it to finish

At the beginning of the month, I wrote "The next stage in the process is to convert the xlsx file (after completion) to a tab delimited file by means of the increasingly valuable program which I wrote with Delphi 10. This turns out to be much harder than expected - a topic for another blog entry."

Here is that second blog entry. In the past, I have used the ShellExecute procedure in Windows in order to execute a program in the context of another program; here is some sample code (taken from a 'program launcher'):
chdir (extractfiledir (path)); cmd:= ini.ReadString (key, 'Cmdline', '') + ' ' + pdata + #0; ShellExecute (handle, 'open', pchar (path), pchar (cmd), nil, sw_show)
Whilst this procedure does what it is supposed to do, the executing program has no way of knowing when the child program finishes. Sometimes this is not a problem, but sometimes it is. In the context of converting an xlsx file to tab delimited, it is very important to know when the child program has completed.

There is a second procedure in Windows called ShellExecuteEx which both executes the child program and also waits for it to finish. I am sure that I used this procedure once in a program, but I couldn't find the code and so had to rewrite it from scratch. Unfortunately, some of the examples which I looked at were misleading, so it took me some time to figure out exactly what had to be done. Here is the code which executes the converter program:

var exInfo: TShellExecuteInfo; exitcode: DWORD; prog: string; begin With exInfo Do begin cbSize:= Sizeof (exInfo); fMask:= SEE_MASK_NOCLOSEPROCESS or SEE_MASK_FLAG_DDEWAIT; Wnd:= aHandle; lpVerb:= 'open'; lpFile:= pchar (extractfilename (prog)); prog:= extractfiledir (prog); if pos (' ', prog) > 0 then prog:= '"' + prog + '"'; lpDirectory:= pchar (prog); lpParameters:= pchar ('"' + f1 + '" "' + f2 + '" ' + flags); nShow:= SW_HIDE; end; if ShellExecuteEx (@exInfo) then begin while GetExitCodeProcess (exinfo.hProcess, exitcode) and (exitcode = STILL_ACTIVE) do Sleep (500); CloseHandle (exinfo.hProcess ); end;
I discovered that if the program to be executed has a space in its name (or more likely, in the directory name), then one has to put quotation marks around the name. Similarly, the parameters have to be protected by quotation marks. Since having written this code, it works very well in two programs of mine which execute the converter program.

This morning I had an epiphany about the above code: in a different program suite, there is a loader program which receives as input data from an examinee along with a list of exams (i.e. programs) that the examinee has to take. Each exam has to signal the loader program when it has been completed in order to cause the next exam to be executed. The loader program uses the ShellExecute method, which solves half of the problem; the second half of the problem (notification) is achieved by means of a complicated system of inter-program messages. Sometimes there are bugs with this method. It occurred to me this morning that I can drop all the message creating and receiving code: the launcher can use ShellExecuteEx in order to execute each exam, and of course, the launcher will receive a reliable message when the child program has completed. The child program doesn't even have to know that it is being run by the launcher, which simplifies a few things.

Tuesday, November 27, 2018

Intermediate thesis accepted!!

Following is the text of a letter which I received from the university today.

Dear No’am

I trust you are well.

The Doctoral Review Committee considered your intermediate thesis at their meeting this morning. I am delighted to inform you that they consider it to be of a very good standard and are happy for you to proceed to the main study.

You will soon receive detailed feedback from the reviewers via your supervisor. You are encouraged to discuss the feedback with your supervisor and address any issues to your supervisor’s satisfaction before progressing to the next stage.

Obviously it's a good idea to have undertaken a failed doctoral project before embarking on a successful one. The first time around, it took me eight months and one and a half attempts to get my research proposal accepted; second time, it took about three months, fighting my mentor almost all the way, to have the proposal accepted at its first meeting. The first time, it took about two years and two attempts to have the intermediate thesis accepted; second time, it took exactly one year and one attempt!

Of course, it's not such a good idea to have a failed project as it ate time and money which could have been put to better purposes. On the other hand, the experience gained from failing allowed me to know in advance what I needed to know in order to succeed. 

So what lies ahead? First, I have to see the detailed feedback - I suspect that the paragraph about feedback in the letter is boilerplate. Assuming that there is nothing serious there, the next step is to start the interviewing process. At the same time, I have to discuss how results will be presented in the thesis. It would have been much clearer how to present results in a thesis based on statistics which prove or disprove hypotheses.