Saturday, October 10, 2020

Simple baked salmon


I've been at home for the past week, not because of the lockdown in Israel but because it's the "Festival of Booths" during which traditionally (in our company) office workers use their holiday days and stay at home. This isn't to say that I've been idle - the work on the Priority cross referencer and Delphi unicode programs is evidence of that.

As a result of being at home, I decided to change my cooking/eating habits: instead of making a pot full of chicken breast or meat balls with vegetables for the entire week, I bought a 'plank' of salmon, cut it into portions and every day I would bake a portion in the oven, served along with steamed vegetables.

The recipe is extremely simple: spread a sheet of baking paper on an oven pan, drip a few drops of olive oil on the paper, rub a salmon portion in the oil and leave it with the skin upwards. Bake in the oven at 180°C for 15 minutes. Serve along with steamed vegetables. Simple, nutritious and above all, tasty.

Next week it's back to the office so I'll get out the trusty slow cooker and cook up a batch of meat balls and vegetables.

Friday, October 09, 2020

Converting a Delphi 7 semi-unicode program to Delphi 10

Possibly the simplest exam in the Occupational Psychologist's armoury is a program that requires the user to list 20 phrases that describe herself ('I am ... ') and 20 phrases that do not describe herself ('I am not ...'). The program displays itself in four languages - Hebrew, English, French and Russian - but until recently, the output that the user entered appeared as either Hebrew or English. We bought a 'Russian' keyboard and added Russian to one computer, in the naive hope that words that the user types in Russian would appear as such in the output file (an INI file).

Extremely naive: the output file consists of question marks where there should be Russian. After researching the topic, it turns out that the output file should be opened as follows 

Old style: datafile:= TIniFile.create (ffn); New style: datafile:= TMemIniFile.create (ffn, TEncoding.UTF8);
The 'TEncoding.UTF8' is the magic invocation required to create an INI file with Russian (or other unicode) characters; this also requires using TMemIniFile and a modern version of Delphi. Painstakingly I created a version of the exam in Dephi 10 (Seattle), replacing all the Hebrew characters that had been inserted directly into the program with either 'updated' Hebrew or appropriate resource strings. I eventually managed to test this program on the 'Russian computer', and indeed the INI file contains Russian characters.

At the same time I have been trying to create a program that will successfully read a database file. I have come to the reluctant conclusion that there is a bug with the ClientDataSet component that prevents me from using it. But the TSQLQuery component works correctly: I remembered that I wrote one or two programs using a TListView instead of a TDBGrid, where the list view is populated by a TSQLQuery, so I can use this alternative approach. But that wasn't the real problem....

It turns out that the 'surname' and 'forename' fields in the database table containing the examinee details were defined with the wrong character set - WIN1251, Russian - instead of WIN1255, Hebrew. I tried several times to convert from one to the other but with no success. Eventually I decided to delete these fields from the database, redefine them as WIN1255 then read in all the original data files in order to populate the name fields. This worked well, although there are about 15 entries in the database with identity numbers but no names. I can copy these from a working version of the database.

Going back to Delphi 10, every attempt to read this new database file failed. I'm not sure what the real reason is, but I discovered that I could access the database via my program only after I moved it to a directory that does not descend from 'users'. In the program that is to read this database, I replaced the dbGrid with a list view, and after dealing with the required method of inserting data into the list view, I could finally see data - but the Hebrew was not displaying correctly (each character appeared as a black diamond). I had researched this topic earlier this morning and had found the solution: the Hebrew fields should be accessed in queries in the following method cast (surname as varchar (16) character set unicode_fss). This method did indeed give me readable Hebrew text. Below is a screen shot of the program.


What's to come? I had removed all the functionality of the results program so that I could concentrate on displaying the data. Now I will restore all the functionality, which hopefully will not require many changes. After that, I can concentrate on reading an INI file with Russian characters, inserting the data into the database and then displaying it. Fortunately, the data (i.e. the phrases that each examinee wrote) appear to be coded as WIN1255 so I won't have to reinsert the data. As the data is sent directly to Word for output, the 'cast' trick may not be required. 

Of course, I will have to see what happens with Russian characters: I may have to add a new field to the table in UTF-8 coding to store the Russian properly.

Wednesday, October 07, 2020

Completing the second version of PrioXRef

I spent several hours yesterday and today working on the Priority Procedure Cross Referencer and Fault Analyser (PrioXRef). I finished off the deceptive assignment statement (:C = (:B = 1 ? 2 : 3) initialises :C but it does not initialise :B) then continued working on other kinds of statements. I noticed that at one stage, some variables were being marked as unused after their definition, which I know is wrong. It turned out that the code that reads comments was not working correctly and caused the program to skip over a large chunk of the program. I wrote a routine that sort of works but I wasn't happy with this and tried to find a better solution. 

The problem is that two characters have to be detected in order to end a comment (*/) and my routine had great difficulty in doing so. It doesn't help that I often used long comment lines (like /****************/ to mark sections in my code: these were causing the problem. After thinking about the problem for several hours, I decided eventually to 'cheat': I used the Delphi function pos that looks for a substring in a string, making the detection of */ very easy. Thinking about it now, this is hardly 'cheating' as I am using several other Delphi constructs, but the idea was to write the lexical analyser using standard Pascal as much as possible.

Once I got past the comments, other things became clearer. I added references to ERRMSG and WRNMSG that weren't in my original plan; this was very easy to do and adds value. When I thought that I had developed the program as much as possible, it then occurred to me to display the references in a tree view instead of as multiple lines of text. This is definitely easier to read. I'm still keeping the original 'block of text' so that the references can be exported as a file. Adding the references to the tree view was fairly simple, but now looking at the screen shot, I see that an extraneous colon has been added.

For all the help that  PrioXRef can bring to the table, there are still areas that can give a programmer grief. I have just spent a frustrating hour trying to figure out why an interface procedure that I wrote several months ago had suddenly stopped working. The interface is for the SUPPLIERS screen and naturally uses fields from the eponymous table. I eventually discovered that the problem was that I was accessing the default purchase order type, a pointer to which is held in the table SUPPLIERSA. There was no record in this table for the supplier that I was testing and so my query result was empty. The rationale behind extension tables (such as SUPPLIERSA) is that one can define for this table fields that are used by only a subset of the suppliers and so save space in the database. 

I should add a heuristic to PrioXRef that tables whose name ends in A should appear in queries with a question mark (e.g. SUPPLIERSA ?), which is Priority's way of saying 'this is a left join'. This would take a fair amount of work as PrioXRef tends to ignore table names that appear in FROM clauses (which is where the question mark would appear): it's only interested in tables that have LINK statements.

PrioXRef can be downloaded here.



Monday, October 05, 2020

Continuing the development of the Priority Cross Referencer (PrioXRef)

I've been working on this program for several days, adding more and more definitions. I thought that I had reached a saturation point this morning, and so decided to write a new tokeniser that would be more streamlined rather than the ad hoc structure that exists at the moment. But in doing so, I discovered that I also have to rewrite a fair amount of the lexical analyser that too was very ad hoc

One advantage that the program has is that it is intended to work on procedures that have already passed the internal syntax checker and so there is no need to check all kinds of pathological structures.

This is going very slowly as I spent a few hours working solely on handling variables and their initialisation. I am concentrating on the following three statements

:A = 10; :A = :B = 10; :A = (:B = 1 ? 2 : 3);

The first statement should be easy to handle, but it required a change in the new 'GetChar' routine. The first version of this along with the new tokeniser would return four tokens for the first line, namely :A, =, 10 and ;. This makes parsing the line unnecessarily difficult: there should be a 'one token lookahead' but the routine needed to look at the following two tokens. So I changed the routine so that there are now two tokens (:A and 10), and the equals sign can be 'seen' when handling :A. The next token still has to be retrieved; if its first character is a digit then the identifier is being initialised and everything is good (this is the first line). But if the first character of the following token is a colon, then apart from handling :A, the following token (:B) should be put back into the input stream. 

Tomorrow I will handle the third statement. I think that the key to handling this properly is the opening bracket before :B; this will indicate that some form of expression is about to appear. :B will be referenced but it won't be marked as an initialisation.

Friday, October 02, 2020

Weight at the beginning of Oct 2020


I have been too embarrassed to write about my weight in the past few months. Despite all my walking and swimming, my weight has slowly been increasing over the past six months or so; maybe only 100g in a week, but always increasing. When it reached 80 kg a few weeks, I realised that I had to take action; I examined my diet to see what I could reduce. At first I thought it was the slice of bread with peanut butter that I would eat at 6:15 am that was intended to reduce pangs of hunger during the morning, so I cut out the peanut butter for a while - no difference. Even cutting out the bread made no difference.

Then the penny dropped: as a source of iron and other minerals, I have been eating a handful of raw almonds every day. As these aren't particularly tasty, I added another handful of cashew nuts: these two supplement each other very well in nutritional terms. Unfortunately they also contain no small amount of (good) oil and so they contribute quite a few calories to the diet.

Two weeks ago I stopped taking the nuts with me to work; my weight dropped by 400g last week and by another 700g this morning. Mission accomplished. Maybe I'll go back to eating raw almonds but I won't return to eating cashew nuts - these have salt or something added that always leaves me wanting to eat more (the same doesn't happen with almonds). Anyway, this morning my weight had dropped below 79 kg and I would very much like it to drop another 2 kg. This is definitely possible.....

I don't remember if I mentioned it here, but about a year ago I bought some 'almond butter' - the same as peanut butter but made from almonds. I don't think that I managed to eat more than one slice of bread with almond butter, it was so unpalatable. I used some whilst cooking, but most of the container found its way to the bin.

This weight loss has made me feel very happy and enthusiastic this morning.

Tuesday, September 29, 2020

Birthday (song)

About a month ago, I was considering which song I would choose for the Yom Kippur song evening, should it take place. Originally I was going to use 'I like the sound of falling rain', but at some stage I heard the song 'Birthday' by Chani Livneh, which is a song that I have always liked since I first heard it in about 1986, but had long forgotten.

Finding the words wasn't a problem but working out how to play it was more complicated. Although Livneh wrote the song, it shows the arranging chops of Matti Caspi. Somewhat unusually, it's in 3/4, but there seem to be a few 'hiccups' in the B section of the song. After listening to the song in order to learn it, I noted that it is has an opening section starting on Am and finishing on G; this section is repeated, having two bars merged into one towards the end and then finishing on Gm. The B section starts off with a descending bass line played twice before leading into an ascending bass line - this section is quite weird harmonically as apart from the bass line (Gm - Eb - Gm6 - Gm7), the tune spends most of its time on A, making the opening chord Gm9. The B section is repeated, but like the A section, the second time around is subtlely different from the first time.

Eventually I had the chords and melody sequenced, more for reference purposes than as part of the final arrangement. I worked on various approaches, finally arriving at something suitable; it's not exactly how I had intended, but it's not bad. I ignored the rhythmic hiccup in the B section by extending the sung note as opposed to shortening the bar.

Singing as usual was problematic; unlike my usual recording technique, I sang to a version in which the tune was playing, in order to aid my accuracy. I think that a few takes were required after which parts were taken in order to compile a complete version. I had more difficulty than usual in achieving a good vocal sound; unusually I didn't use any reverb but rather a short analog delay that sounds good for most of the time (there are a few staccato notes where it does not sound so good).

I don't know whether this version will ever see the light of day.

Following is a translation of the lyrics (mainly Google translate with some additions and corrections by me)

The cake is in the oven, the candles are all ready, 
A birthday is not just for children. 
And I was sad when I thought in the morning, 
How I have passed my years? 
My pockets are empty of surprises. 
Smiles are not something that come too easily, 
And outside the sun is shining whereas for me, another groove [on my face] is engraved. 
And for the hundredth time I see how I have lived my life in a tunnel of darkness. 
The candles on the cake quietly light up the time. 

And now is the time. God, give me strength 
To stop the minute race on the clock,
To watch and breathe as the grass grows, 
And to get up and sing in his honor. 
And now I know clearly: The greatest gift that can only be taken, 
It's the same feeling when you're seeing for the first time 
That the sun has never shone like this 
And the rain has never sounded so beautiful, 
The candles on the cake give me light as a gift.

Saturday, September 26, 2020

Priority procedures cross-referencer


I spent a few hours on Thursday evening, more than a few hours yesterday and several hours today working on the Priority procedures cross-referencer and hopefully completing it.

As in the army, everything divides into three. For this program, the first stage is parsing the input file, then displaying the references and finally displaying the analysis. The first stage can also be split into three: the tokeniser, the lexical analysis and the storage. A token is a string extracted from a text file; for example, if the current line is 'select part, partname from part', then there are five tokens: 'select', 'part', 'partname', 'from' and again 'part'. In programming languages with regular syntax, the tokeniser is normally quite straight-forward, but it turns out that the procedural SQL language of Priority does not have regular syntax and cannot be considered to be context free.

Two examples of the ad hoc syntax: I want to note when a variable is initialised and when it is not. Initialisation can occur in one of two forms: either there is an equals sign after the token (e.g. :SEARCHNAME = '12345') or the keyword INTO precedes the token (e.g. SELECT DAY INTO :DAYS). These two opposite options (one prefix and one postfix, to use the technical terms) make it complicated to program. Another syntactic problem is the colon - :. Normally this serves to mark variables, e.g. :DAYS, but it can also be used to separate between two clauses in a ternary comparison (e.g. :DAYS < 7 ? 3 : 5). 

The correct tokenisation of table aliases (e.g. GENERALLOAD F1) took quite a bit of time.

Storage of the identifiers and their references is by means of a binary tree; this part was based on the cross referencer that I found a few days ago which was written in standard Pascal. The references are stored in a queue for each node. I added a few fields to these variable types in order to store further information: the type of identifier (variable, cursor, table) and the operation in progress at the reference (e.g. variable initialisation, opening a cursor, linking a table). This part was simple. Displaying the references was also fairly straight-forward.

The analysis part is dependent on the type of identifier: there are certain checks for variables, certain checks for cursors and certain checks for tables. I found a method to make these checks as stream-lined as possible.

I tested the program by running it alternately on a short test file into which at times included deliberate errors (so that I could check that the errors were being picked up) and on the file for the procedure that I wrote a few days ago. Every time I would look at the references, noting mistakes that had to be fixed. Now I'm 99% confident that I've correctly parsed the files and have correctly denoted variable initisalisation (this was very complicated). Running the finished program on my procedure finds three variables that were initialised and never used. These can be safely deleted from the procedure.

My next step is to publicise the program within a small community, inviting examples of procedures whose analysis appears to be wrong. Maybe there are other checks that need to be added.

Friday, September 25, 2020

Accordion

After losing out on the dulcimer a few weeks ago, I came to realise that one of my hobbies is collecting musical instruments. I ran a search on Ebay later and came up with this gem, a Stephanelli miniature accordion. The price with postage was about £45, which was the winning price for the dulcimer. 

The accordion arrived a week ago, securely packed, and has now taken its place of honour in the music room, next to the concertina. In a few years, I'll try and teach one of my grandchildren how to play it.



Thursday, September 24, 2020

Return to lockdown - keeping myself occupied with new programming projects

Due to the high number of people being found positive for Covid-19 in Israel and the exponential rate of increase, it has been decided that some form of lock down will be enacted over the next few weeks. In a sense, this isn't much of a problem, as Monday is Yom Kippur, which means that Sunday wouldn't be a work day for most people. Then the week after that is 'the festival of booths', during which many people don't work anyway. At the time of writing, I don't know whether my company is to be closed or to work in some reduced form, so I don't know what will happen to me next week.

One way or another, I'm going to have plenty of spare time on my hands. Just as well, as I have two programming projects that I want to execute during this time. The first is an update of one of the OP's multilingual exams - there are problems running this with Windows 10. I started examining the problem last week in a modern version of Delphi; I think that I know what the problem is but I haven't had the time to do anything apart from thinking about the problem. I'm fairly certain that there is interference between the use of a string table resource file and the clientdataset component. If I can't find a simple resolution, I may have to abandon the clientdataset, instead outputting 'rich text' files that will somehow have to be combined to create a final output file.

The other project is quite grandiose: over the months, I've collected various mistakes that I have made whilst programming procedures in Priority and that were not noted by the in-built syntax checker. The idea is to check things that are not caught by the internal program, to supplement it and not replace it. Simply put, I want to write an external syntax checker that will check things like matched LINK/UNLINK pairs, uninitialised variables and a few other problems. I've been devoting a fair amount of thought as to how to store the data of such a program; traditional cross reference programs in Pascal used linked lists, and indeed I found such a program yesterday evening. But I would like to have a much more modern interface and use types such as stringlists and similar. A stringlist is ideal for storing what would have been an array of identifiers but isn't so useful when additional data regarding those identifiers is required.

I will no doubt continue to debate the subject in my mind until I commence coding; at the moment, my inclination is to take the old school cross referencer and adapt it to the Priority SQL syntax. This will be a complex task that would have to be done one way or another, so it's probably better to start with something that works so that I can concentrate on the syntax and not on how everything is stored. A cross referencer is a good idea anyway: it makes finding references to a variable much easier. I started writing a long program in Priority yesterday afternoon and finished writing and debugging this morning: this is 270 lines long which is fairly long but not too complicated. During the writing process, I moved pieces from place to place within the program (primarily moving non-variant operations out of loops, to be technical) and sometimes these edits slightly mangled the text. I discovered a new bug: a variable will always start with a colon (e.g. :DAYS); in the course of one of these edits and pastes, I had a variable named ::DAYS which is not the same as :DAYS. 

A cross referencer helps in finding variables that appear only once; this can mean that either the variable is superfluous as it is never used, or more problematic, it is a variable without value (as in the above case of ::DAYS). I wasted an hour yesterday on another procedure, trying to figure out why a value being saved in a variable was not being written later on. Eventually I saw the problem: the value was saved in :PARTCOST but was later accessed as :PARCOST. A cross referencer would find this immediately.


Sunday, September 06, 2020

What a weekend!

In true British style, I suppose that I should start with the weather: this allowed me to use such adjectives as 'torrid' and 'oppressive'. Friday morning started hot, and by about 3 pm, the temperature outside was 40°C. The air conditioner in the lounge was barely coping to keep inside to around 30°C, a condition that was severely challenged when I began cooking. Steam from the tomato sauce that I was making caused the temperature to rise in the kitchen. At one stage I turned on another air conditioner in the house in the hope that this would help, but it didn't; not only that, when I turned on the electric cooker, the main fuse blew! So I turned the second a/c off then restored power. Somehow we got through the evening although it was very hot. Saturday was very slightly better but still hardly bareable. Now it's Sunday morning and I'm at work with an air conditioner at my back so at least now I'm comfortable.

I had hoped to write that I was expanding my collection of musical instruments. I saw on Ebay that someone was offering for auction a dulcimer, along with case: there was one other bid at around £20 which would be a ridiculously low price. I entered a maximum bid of £30, and until one minute before the auction closed, it seemed that I would win the dulcimer for £27. To my surprise, dismay and disappointment, new bidders swooped in at the final minute of the auction and someone bought it for £45. Still a steal. I was disappointed for a few minutes but not for longer.

I installed a copy of Delphi 10.2 on my mobile computer which has been behaving better since I replaced its battery a week ago. The main advantage for me of using a modern version of Delphi is seamless unicode; so far, everything that I have seen is worse than Delphi 7. When compiling, there is a whirlwind of windows opening, resizing and closing which is annoying but has no affect on the final result.

I ported one of the exams that I had programmed for the OP: this one has a fairly simple interface but can display in four different languages, namely Hebrew, English, French and Russian. I 'shot myself in the foot' somewhat by choosing to port the version that displays unicode by virtue of the TNT components; these don't exist in Delphi 10, so my forms became devoid of controls. I eased the pain by using an earlier version of the exam. I found myself adding a certain amount of code controlling the position of the controls - Hebrew is read and written right to left, so labels have to be on the right, etc. Different fonts are required as well. The end result is a program that works like the original, only that it's 10 times larger. I didn't really gain anything from this.

Then I thought I would try to port the program that maintains the database for this exam. I wasn't expecting any of the earlier interface problems: the main problem would be the database driver. I was pleased to see that Delphi 10 has the dbExpress components so I didn't need to change these - that would be an arduous task - but I haven't succeeded yet in connecting the program to its database when it is running. At design time I did manage to connect one query: the output is unreadable. I'm going to continue working and reading about this: I need the correct 'database driver' for Firebird 2. Ironically my low level database manager works fine, but it's written with Delphi 7.

I wrote about some of these topics two years ago; last time I didn't have the database components so I couldn't do anything in that area. Now I have them but I still can't do anything with them.

Wednesday, September 02, 2020

Wedding stairs

It has become normal for couples a few hours prior to their wedding to have a 'photo shoot' in some scenic location. We've discovered that an enterprising photographer has been using the steps at the back of our house as a location for these wedding photos.

I don't think that there's anything remarkable about these stairs and the accompanying foliage (which can't be seen too well in the photo), but maybe it's sufficiently exotic for the photographer. 

I should mention that neither the photographer nor the couples come from the kibbutz which might explain why they've chosen our stairs: when one enters the kibbutz and travels around the 'outside road', the view isn't particularly pretty. If one considers the road to traverse a rectangle, then the entrance is at the bottom right hand corner and we are in the top left hand corner: we're the second house from the corner. It might well be that the photographer entered the kibbutz, turned right at the entrance (I think that these days there isn't much of an option to turn left as this leads to a building site), started driving around the road and stopped at the first location which took his fancy. 

Whilst I don't think that we should charge the photographer for the use of the stairs, it might have been prudent from his point of view to ask permission. The thought that people have their wedding photos taken on our steps amuses us somewhat.

It's hard to believe but we're already in September - time seems to fly. I'm more aware of this than most, as my early morning walk (at 5:30 am) now starts in almost darkness, and the evening walk is also partially in darkness. We're fast approaching the vernal equinox, so this isn't too surprising. Saturday swimming - for the few Saturdays left before the season closes - will start now at 9 am.

Sunday, August 30, 2020

Evening ferry

As the weekend was free of children and grand-children (coincidentally, both of my children were in the north of Israel), I had plenty of time to complete a song which I had begun about a month ago. I am writing the following for myself whilst the memories are still fresh in my mind - I doubt that the nitty gritty details will be of much interest to anyone else.

Most of the music was written in the middle of July when I sat down at the piano and started playing something that sounded like a lullaby. I had been reading a music analysis of Nick Drake's songs, paying attention to the fact that the melodies in several of his songs start on the third beat of a 4/4 bar; this isn't an anacrusis (starting the tune a beat or half a beat before each bar). The original idea had an eight bar sequence in G which was first repeated then played three semitones higher (in Bb), followed by a final repetition in G. I sequenced this initial idea and played with it a bit, eventually realising that it was quite boring and would be better if there were one sequence in G followed by one in Bb. Further tinkering with the music led to an introduction which includes the sequence G F9 Em Cm7b5 - the final chord not being one that I normally use.

Shamelessly I pinched a few arrangement ideas from an alternative version of the arrangement which I created for my wife's masked song, but eventually the arrangement became autonomous. I also played around with the drumming, starting off with what sounds like a heart beat, then half time then normal time. A few evenings ago, I decided to change the instruments playing the introduction and coda, replacing them with real live electric guitar.

The words as usual were problematic. For a few weeks, there were no words or direction at all; one evening whilst walking the dog I hit on the idea of trying to convey the feeling that I had whilst sitting in a cafe in Gavrio after the last ferry had left for the day. I remember the same sort of feeling when we stayed at Yosemite national park in America before the birth of this blog: those that had come for the day had gone home, leaving the beautiful area to be explored by those spending the night there. It's an extension of something which we've been doing since that trip to America in 2005: instead of being day tourists, we've tried to travel to one location and become 'locals', seeing things that the day tripper wouldn't normally see.

Over a few days last week, I managed to write three enigmatic verses, but as usual I was lacking words for the bridge section. These came whilst showering on Friday night and getting into bed: every few minutes I would get up, race to the computer then add a couplet.

Yesterday I devoted my time to recording the song. After swimming, my first task was to play the guitar parts; this was fairly easy and only a few takes were required. Singing the song as usual wasn't quite so easy but again, not too many takes were required. I spent some time creating a harmony for the bridge from which I developed a choral sound, but this seemed inappropriate, although later on I would use a similar idea for the second bridge. Mixing, surprisingly, went very quickly; I remember doing this about ten times for an earlier song, trying to achieve an appropriate volume for my vocals with respect to the music, but yesterday the final mix was either the second or third attempt.

Friday, August 28, 2020

Time sheets and perceived value

As this blog entry is connected to my thesis topic, I think it only fair that I start with news about the final stage in my doctoral studies - the viva exam. It would be more accurate to write 'start with the lack of news' - the administrator of the doctoral programme informs me that the external examiners are very busy and that he has yet to fix a date for the viva. Onto a case in my company which I would have liked to include within the case studies presented in the thesis - although it's too late for that. Maybe I can bring it up in the viva as an example of how not to deploy an enhancement.

The CEO decided a few months ago that he would like certain departments to keep time sheets, showing on what specifically they have been working on (i.e. the number of a project, or the number of an engineering change) as well as including more general information, such as participation in meetings with customers or training. One can understand his point of view: it might well be that we are spending more hours on these activities than we are budgeting for, or to paraphrase Peter Drucker, one can't manage something without measuring it.

The task was passed on to the CFO, my manager; she along with the network administrator and I looked for programs which manage time sheets. Specifically we were looking at the sort of program that lawyers, accountants or architects would use to record billable hours. My first idea, that the external programs in use could manage time, was a dead end. Whilst Microsoft Word keeps a record of hours during which a document is open, the engineering programs that we use do not have this functionality. We found a few programs with which I played: these programs led me to believe that there is a continuum of approaches. At one end, there are programs that are geared to recording working hours (when a person clocks on or off) and that the task management was bolted on afterwards. The other end has a very programmatic database approach which was much more to my liking, but also twice as expensive as the work hours program (no names). I had also considered creating a module in Priority to handle the time sheets, and seeing the database approach strengthened my position.

I could already see that whilst the work hours program was easy for the end user (there are interfaces for the web and for mobile phones), it would be problematic to create the initial tasks. The CEO presented several requests which could not really be achieved using this program; they could be approximated but not really to the depth that he wanted. The database program had no external interface: it's a program that has to be installed on each user's computer.

Even before I had started work on a specification for a Priority based program, it was clear that there were certain advantages in using Priority: it's a known technology, it's flexible, it's already installed and it's (essentially) free - there would be no marginal cost in using a new module, provided that I wrote it. A further advantage is that several of the tasks could be created automatically as a result of events happening within Priority, such as the opening of a new project. There are also disadvantages, which basically boil down to the requirement to having Priority open at all times in order to have automatic time recording (i.e. Priority knows and can record the current hour when a button is pressed); this requirement would not be met for one group of users.

After receiving the go ahead to prepare a demonstration program, I spent several hours over one weekend working furiously on the module. Every now and then I would take the dog for a walk, during which I managed to solve problems that had arisen as well as considering new ideas. I showed the module (via Teams) to the CEO and CFO, from which more requests arose, which I solved over the following days. It would be accurate to say that there is a lack of fit between the interface required and the paradigm of Priority forms; I would say that I managed to obtain about 95% fit.

Then we showed the module to representatives of the two groups who would initially be using it: the engineers and the planners who interface between the salespeople and customers on one side and the engineers and production on the other side. I had predicted in advance that their reaction would be negative and I was not disappointed. Whilst they understood what the CEO stood to gain from the module, from their point of view it was 100% overhead which they could do without. Even after I explained that most of the tasks would be opened automatically and that the user interface was extremely simple, they were still adamant in their opposition.

As a test, I defined a few tasks for the CEO who barely uses Priority; after five minutes of training, he was able to report that the module was extremely easy to use. Of course, the ability to extract data in any form conceivable goes without saying. I have yet to hear anything from the other users who were supposed to test the module.

Why was I not surprised that the users would be against using the module? Because from their point of view, the perceived value of the module is not even zero, it's negative. Quoting my thesis, the Technology Acceptance Model (TAM) is based on four components, all based on the individual: perceived usefulness, perceived ease of use, the individual's evaluative judgment of the IT system and the individual's motivation to use the system (Davis, 1989). I can easily imagine that at least the first two components of the TAM would receive negative scores; some of the users (especially their managers) are strong users of Priority so at least the third component is positive. I imagine that their reaction would be even stronger if we tried using an external program.

Quoting the abstract of the thesis, "the research shows that companies that develop a tested framework for deploying enhancements are able to reap the promised benefits and so improve their business performance. The research also shows that user resistance is a major problem that has to be overcome in order to achieve a successful deployment". We managed to complete the first two stages of the seven stage framework, viz. the identification of a misfit (stage 1) and the preparation of a technical specification that defines the advantages that would accrue from the enhancement, the disadvantages and the financial cost (stage 2). We floundered on the third stage - obtain the signed agreement of all stakeholders on the specification, involving senior management wherever necessary.

I haven't heard any more on the topic of time sheets for the past few weeks, probably because almost all of the participants in the last Teams meeting on this subject are also involved to some extent with a much more important project, including the reception and installation of new equipment in one of the factories, the problems with getting technicians from Italy to install the equipment, and software interfaces (including a program that I wrote that receives a file from a design program then builds appropriate parts and a BOM based on the data).

A final quote from my thesis: there is no attempt to assess the economic validity or benefit of specific enhancements; there is no comparison between enhancements that provide economic value and those that merely satisfy whims. Does this proposed enhancement really provide economic value or is it a whim of the CEO?

Friday, August 21, 2020

New CPAP machine (part 2)

After nearly a week with the new machine - I uploaded the statistics file to the manufacturer's website in order to see the statistics. As I noted previously, the data is presented in the form of histograms, but clicking on a bar will give the numerical data. I am very pleased to see that most nights there have been four or less apneic events per hour, which is very good. This is probably more to do with the new mask than the new machine.

I developed a very simple spreadsheet into which I added the data: this is a bit awkward as the web site shows data per type of event (hours of sleep, apneas, leaks), what might be termed a vertical presentation, whereas the spreadsheet and my CPAP data program require a horizontal presentation, i.e. all the data for one date together. It took only a few minutes to copy the data into the spreadsheet and a bit longer to write a new module in my CPAP program to read the spreadsheet. Now that I have data, I will try to read the statistics file directly in order to discern any structure.

As for the 'CPAP pillow' - I don't have much to say about this. It doesn't seem to make much of a difference and it's not that easy to get the mask to lie in the cutaways. I'm going to continue with it for the time being. Strangely, its firmness doesn't seem to matter at all.

Sunday, August 16, 2020

New CPAP machine

One is supposed to purchase a new CPAP machine every five years - at least, in Israel we are entitled to receive participation from our health insurance once every five years. The first machine that I had (not the one on the left) had internal problems after three years so I had an incentive to replace it when the five years were up.

At the time, one needed to go to an ENT doctor who would give a referral to the sleep doctor who would then write a 'prescription'. As my current machine (the one on the left) has not given me any problems, I decided not to bother with the trouble of seeing these doctors for what should be an automatic process.

On the other hand, one should replace the mask every year; I have been somewhat lax about this, even though one receives full participation and so the mask doesn't cost anything. I phoned the CPAP company the other day and ordered a mask; I was persuaded to buy a new machine at the same time. It seems that the requirement for the two doctors has been dropped: one can buy a new machine and request participation once every five years.

So I ordered a new machine a few days ago which was delivered on Friday. This is a very smart looking device although it took me a while to find where the SD card resides (the data from the machine are written to this card). Along with the machine, I also received a new mask and even a 'CPAP pillow'. 

The mask 'fell apart' when I awoke during the first night for a toilet visit, so I had to reconnect the part which separated while still half asleep and almost in darkness. This stunt did not repeat itself last night, although there are a few parts which I want to glue together on the mask. There is a part called the pressure modifier that disappeared from my previous mask and caused a terrific leak. I had to put sellotape over the holes which ameliorated the problem somewhat but not totally. Gluing this piece of plastic will prevent coming loose on this mask.

As a result, it might well be that I had much fewer apneic events over the last two nights; I can't tell as the machine records its data in a different format to its predecessor. Stored on the disk are several files, one of which being a file in JSON format (if that means anything to you, dear reader) that I can read, but I don't know yet what the various numbers mean. One can upload this file to a website that presents the data but only in a graphical manner: I want numbers!

I have written to the company that manufactures the machine in the hope that they will reveal the format of the file so that I can write my own parser and so input the numbers directly into my CPAP/walking program. At least, I hope that they will show how I can see numerical data in their web app and not just graphs; I'm a 'tables' man and not a 'graphical' one.

And as for the CPAP pillow: this link gives one an idea what I'm writing about. It's a sculptured pillow with two cut-aways (as we would call them on a guitar) that enable one to lie on one's side and have the mask fit into the cutaway. It's true that I had back pains when I first started with CPAP because of the difficult of finding a suitable sleeping position with the mask, but that was a long time ago. Last night, the pillow was harder than I'm used to, but I fell asleep and didn't even wake up in the middle of the night, so at least the pillow didn't cause problems. On the other hand. I did swim and walk a lot yesterday so I was also fairly - and honestly - tired.

The new machine's shape (think of a giant wedge of Toblerone) caused me to wonder how I could put it in a small suitcase, should we ever go on holiday again. The answer came to me this morning: leave the machine at home and take the old machine on holiday. Not only that, I can store the old machine in the small and smart suitcase which I always take with me as personal baggage: I put the CPAP machine, laptop computer, cables and medicines in this suitcase, so I have the most important things with me at all time, even if our luggage gets lost.


Saturday, August 08, 2020

Masked songs

There was a full moon a few days ago, which means that the Hebrew date was the 14th of Av. For reasons unknown to me, this date marks 'the festival of love', in stark contrast the fast day of 9th Av, which commemorates the destruction of the second temple.

The cultural committee on the kibbutz decided to celebrate the locked down love festival in an unusual way: members were invited to sing a love song and act it out for the camera whilst being masked and generally incognito. The public were required to identify the singers, and the least identified singer would receive a prize. 

Even though the anonymity should mean that there would be no voting blocs (see my blog about the last kibbutz song festival), this opportunity didn't tempt me. To my surprise and secret delight, my wife, though, was interested and she had a song in mind. So I spent a great deal of time creating a suitable arrangement for this song; the key was fine, but I had to slow it down to only 70 bpm, which is the slowest tempo I have ever used. After several revisions, I developed an arrangement which met with the artist's approval.

Recording the vocals was quite easy: my wife is much better at pitching than me (i.e. singing in tune), but her timing is not particularly good. I had to count her in a few times, and even so, I can hear parts of the tune which are out of time. After mixing the song, the final track was about 3 minutes 15 seconds long. We were then told that the song had to be a maximum of 2 minutes 40 seconds, so I had to mutilate the song in order to meet this requirement. Chopping out the introduction, link in the middle and coda did the trick.

The singers were filmed last Saturday, but in order to achieve surprise, each singer was called at a different time, so none of them knew who the others were. Yesterday evening, the completed nine clips were shown via YouTube, and members had to guess who they were. This was surprisingly hard: we managed to identify three out of the other eight singers but had not a clue who the others were.

The singer who was least identified was still recognised by 32 people, which means that my wife was recognised by more than this number. This surprised us somewhat as we imagined that few people had heard her sing in recent years.

What was - IMHO - the worst song naturally won the prize for the best song. There is no accounting for taste.

The video can be seen here.

Monday, August 03, 2020

Musicians that I have heard of who share my birthday

1926 - Tony Bennett
1939 - Jimmy Nicol (temporary Beatles drummer in 1964)
1946 - John York (The Byrds)
1953 - Ian Bairnson (Pilot; plays the guitar solo on Kate Bush's "Wuthering Heights")
1963 - James Hetfield (Metallica)

There is also a musician called Kirk Brandon who was born on the same day and year as me, but I have no idea who he is.

Sunday, July 26, 2020

Peter Green RIP

There was a time, in my 'knowing very little about popular music' period of late 1969 that Peter Green was my favourite guitarist. He was the leader of Fleetwood Mac, named after his drummer and bassist - there's modesty for you. During 1969, they had quite a few hit records, where the music was certainly not pop but also not blues.

"Albatross" is probably the most well known and also the least typical; there was my favourite "Man of the world", along with "Oh well" and "Green manalishi". Green seemed to be making his own furrow with songs that stand up well 50 years on. I wrote about these songs and their effect on me many years ago.

But then something happened; Green became an LSD casualty and dropped out of the music scene. Although he did make a few records after leaving his own band, nothing much came of them. He certainly dropped off my radar, and I adopted other favourite guitarists: at first Mick Abrahams and then Richard Thompson.

He died a few days ago, apparently "peacefully in his sleep". May he continue to sleep peacefully.

Monday, July 13, 2020

Swimming pool reopened

There was an absurd situation over the weekend when public swimming pools (and as such, the kibbutz swimming pool) were closed, but swimming pools connected to hotels were open (and even allowing the entrance on non-hotel guests). As many people pointed out, the chances of getting infected with Covid-19 whilst in the swimming pool is almost zero, and is certainly zero for those who are seriously swimming (as opposed to loafing and playing around). Finally the special Covid-19 task force/government committee has made a good decision and is reopening the pools. I don't know what else is being reopened and what is being closed, but the pool is the only thing that interests me.

So it's back to swimming on Friday.

Sunday, July 12, 2020

Judy Dyble, RIP

I have just read about the death of Judy Dyble, who was the first singer in Fairport Convention, way way back in 1967, when she was Richard Thompson's girl-friend. She wasn't a distinguished singer, in the same way that Sandy Denny was, but she did make an instrumental contribution to their first album, playing recorder and electric autoharp, as well as singing. She reprised her freaky recorder in the instrumental break of 'Jack Of Diamonds' at Cropredy 1997.

I got to meet Judy at Cropredy 2000: she was a nice enough person. I also have her autobiography which I bought a few years ago when it was published, which gives an alternative view of the beginnings of Fairport.

She also had a connection to the nascent King Crimson: for a while she was the girl-friend of Ian McDonald who was playing with Giles, Giles and Fripp before they metamorphosed into KC. As such, she appears on a demo recording of 'I talk to the wind', a song which changed greatly from its original arrangement to the one on ITCOTCK.

Judy made a return to music in the last two decades; I have on my music players a modern version of ITTTW in which the chords have been mucked up. She sings with little expression and I don't really like that track.

Funnily enough, whilst walking the dog this afternoon, I was thinking about how old the current Fairporters are, and when they intend to give up playing. What is rewarding is the prominence that the notice of her death received: I saw it on the Guardian website, but the same announcement appeared also on a BBC website as well as other places. I wonder whether Simon Nicol or Ashley Hutchings will publish something on the topic.

Thursday, July 09, 2020

Swimming pool closed

The high number of new Covid-19 infections in Israel in the second wave (over 1000 a day, which is more than the peak during the first wave) has lead to certain restrictions being put back in place. Most of them have no effect whatsoever on me, but the one specific restriction which will affect me is the forced closing of the kibbutz swimming pool (surely the chlorine in the water will kill the virus?). 

Due to the virus, the OP hasn't been at work for the last four months, and so instead of spending up to two hours with her on a Friday morning, we have a short chat and then I head to the swimming pool for a brief swim - this is in addition to Saturday mornings. So even I though I am deliberately swimming less in each session as compared to last year, I am actually swimming more. I even purchased a new waterproof mp3 player which seemed to be better than my original machine, but since copying files to it, my computer can't identify the player when it is connected.

Last week I had my blood pressure measured a few hours after swimming: 120/77, which is very good. On Monday I underwent an ergometric stress test, which means walking on a treadmill while being attached to an ECG machine. At first, the treadmill moved slowly and was flat; every few minutes the speed would increase automatically as well as the angle. After several minutes, the treadmill finally got to a speed at which I felt comfortable, walking very fast - I could have carried on at this rate for quite some time. But then the speed changed once again and simply became too fast for me to walk so I asked to stop. After all, the name of the game is not to show how much stamina I have but rather how the heart performs when under stress.

Why did I do this? During the lockdown, I noticed that my feet - especially the right foot - were swelling up, and it was painful to move them. Although that extreme swelling has not returned, I still see every evening that my right foot is somewhat inflexible. The swelling is due to liquid leaking from somewhere in the body, and so my doctor ordered a few tests. The first was ultrasound of the veins in the thighs - nothing wrong there. The stress test was next, and I have an echocardiogram examination in another two weeks. I had one of these four years ago which didn't show anything noticeable.

And it turns out that because of these tests, I was once again denied the chance to give blood. I had hoped that there would be no more problems, especially considering my last haemoglobin test which was relatively high for me. But no.

Saturday, June 13, 2020

First swim for this year

The opening of the kibbutz swimming pool was delayed this year because of Covid-19, but it is now open (it might have been open since last week). Today I had the opportunity of making my first swim of the year. It was very similar to the first swim of last year: my left arm starting hurting after a few lengths but the pain disappeared as I carried on. My right ear hurt - this is something new. I couldn't get my swimming headphones to work, even though I supposedly charged them the day before. As the day was hot (the temperature reached 37°C in the afternoon) and the water was cool, the difference between the two (which is what we feel) was great: I felt like I was swimming through ice for the first length. 

Oh yes: I swam 16 lengths, which seems to be my distance for my first swim; I wonder how far I'll swim next week. Then I came home and after showering and drinking tea, I fell asleep for an hour.

[Edit from a few days later] I didn't charge the mp3 player at all. I mistakenly tried to plug the usb adapter directly into a computer, forgetting that I had a special cable for this. Today I found the cable, and connected everything, after which the player began showing a red light: presumably a sign of charging.

Monday, June 08, 2020

The background behind another song that is used for Israeli folk dancing

The story that I told in a blog a few days ago reminded me of a similar story. Every weekday for at least 40 years, the Army radio broadcasts at 4 pm a programme normally composed of 'classic' Israeli songs. Sometimes these songs are well known but frequently they are lesser known (at least, to me). I don't listen to this program frequently - I would only hear it when I had spent a day in Tel Aviv and was returning home with a colleague in his car.

One day a song was played that I recognised as it is used as the tune for another Israeli folk dance (which also I learnt in the early 80s), 'Nahal Naaran'. Hearing the song in the relative quiet of a car (as opposed to the distorted version played when dancing) enabled me to listen to it properly and I was most appreciative of it.

Once at home, I found the song on You Tube (as referenced above) and started to read about its background, primarily who sung. I could identify the man who seemed to be the lead singer but I was also mildly interested to discover who the others were. To my great surprise, I discovered that the female singer in the song is a member of my kibbutz!

Of course I had to write a gushing message that evoked an interesting response. Since then, the singer (who is probably now approaching the age of 80 and not someone with whom I have much contact) has become a friend of mine.

Sunday, June 07, 2020

Is it OK to have a PhD thesis with shortcomings and inaccuracies?

I'll have to define this blog entry as a 'guest posting' as I have written almost nothing of what appears below. What is not mine will appear in italics and in black.

A few days ago, someone asked the question "Is it OK to have a PhD thesis with shortcomings and inaccuracies?" on the Academia Stack Exchange, beginning with the statement "I recently defended my PhD thesis and was awarded a pass with some minor corrections. I am due to submit the final version of my thesis very soon." Hopefully I will soon be in the same position (the latest news is that the external examiner has suggested a few dates in July).

The best answer was The thesis is a "good" one if you have passed and will be awarded your degree. Don't overthink it. You have learned something from producing it that you can leverage into future work. That is, in lots of ways, a big advantage. If your advisor is also happy and wants to work with you on any future extension, you have a positive outcome, if not a perfect one. On the basis of this answer, someone commented People forget that a PhD is a 'learning degree'. Too often, completion is treated as the end, when really it is only just the beginning. If you learned something and can express that you know how or why errors occurred and what they mean for your work, then you have proved you justify being awarded your PhD. A PhD is about the process, not the end result.

Back to me: there is a huge difference between the academic and lay understandings of a doctoral degree. A lay person believes that a doctorate shows how clever a person is, and that the doctorate discovered new knowledge (that might have been true once). The academic understanding is that the degree is an apprenticeship in performing research; it is unlikely in these days that anything startling new will arise from a doctoral thesis, but it is a good base from which to start further research.

Saturday, June 06, 2020

A musical day

A starting point for today's story could equally be yesterday evening, a week ago, two years ago or even 42 years ago... I think I'll start from there. In the 1970s and 80s, kibbutzim used to have a weekly evening of Israeli folk dancing. When I emigrated in September 1978, there weren't enough people on my kibbutz who were interested in folk dancing so we used to combine with a neighbouring kibbutz and a neighbouring moshav. There was a new dance (to me) which I learnt fairly quickly: it had lots of bouncing around and was very fast, and dancing it produced a great deal of endorphins. I never managed to catch the name of the song, but it was a girl and boy singing alternate verses.

Over the years, I've enjoyed dancing this dance but still have never managed to learn the name of the tune. The recording to which we used to dance probably wasn't too clear and anywhere I was too busy bouncing around and trying not to collide with any one to catch the name of the song.  It was played the other week at the harvest festival (itself a strange event because of Covid-19), although I wasn't fast enough to record it on my mobile phone.

Yesterday evening I decided to make a brief recording of me playing the tune on the piano; I thought that I would send it to someone more versed than I in Israeli music during the period 1948-78, while it still had a charm of its own and was less western European in its attitude. This morning I sent my recording to a colleague and she replied within ten minutes. Here is the song which I know, and here is someone teaching the dance to a different version of the song, which is called 'The flower seller'.


Once I was finished with this song, I watched part of a documentary about the Tamla Motown label ('Hitsville') which was very interesting. Tamla was part of my childhood but it was not something which I ever grew close to, instead admiring it from afar.

Part of this inspired me to write some lyrics. At the beginning I worked out the music to a new song, whose arrangement I've been working on ever since. Unfortunately I've never been able to write any words for it, apart from an incomplete verse which I wrote at the beginning. Today I went back to the song, and within about ten minutes (literally - the writing went incredibly quickly) I wrote another two verses and a middle section, including rhymes and proper scansion. It makes me wonder how I can be barren for so long and suddenly the whole thing pops out.

After a rest, I thought I'd try my hand (or my voice) at recording the vocal. Instead of getting out the mike stand and microphone, I thought that I'd try the headset which I use for Team/Zoom meetings. This worked out very well - at least, after I turned off the air conditioner which was affecting the microphone badly. One take and I was done. Listening to the playback, I realised that the tune for the middle section was almost exactly the same as another of my songs, so I had to sing this part again with a different tune. This went quickly and I was also able to slot the new verse into the time line without ruining anything else.