Sunday, November 27, 2022

Communal grief

It's a very sad aspect of kibbutz life, but nothing brings us more together than communal grief, when a kibbutz member dies. Most of the time, it's the elderly that pass away, and more often than not this can be a relief for the family. But sometimes, when an unexpected death occurs ... it's a shock that everybody feels.

About 20 years ago, if not more, one kibbutz member died in a car crash on a Friday morning. He was a member in high standing, probably as old then as I am now. I hadn't had much contact with him, but as it happened, a few days before his death, I was showing him how to use the spreadsheet Paradox (that was later overtaken by Excel) in order to prepare budgets. His family organised an evening in his memory, itself an unusual event that shows how highly regarded he was. I volunteered to play a sad song, but before I did, I took the opportunity to speak to the audience about how in the days before his death, I had been working with him. On the Saturday night I had a dream (as I told the audience) that I was sitting with the kibbutz treasurer and wondering how we would complete the work of this member, from where we would find the data. Then he (the member who died) came into the dream and said that everything would be ok, and that we would manage without him. Then I tried to play the song, but my hands were so slippery that I probably didn't play too well.

Why am I writing all this now? Because we were informed about an hour ago that a 32 year old member and 'son of the kibbutz' had died. He had a growth in his brain; we had been given to understand that his health had improved, but hearing the sad news has knocked everyone for six. He was married and had two small children; they will grow up without knowing their father (a situation that has unfortunately not been infrequent in Israel). I personally didn't know him, but I know his parents and used to work with his grandparents before they retired.

There was supposed to be a joint meeting of three very important committees (I'm a member of one) this evening, but unsurprisingly it has been cancelled. No date has been announced yet for the funeral (it would normally be tomorrow, but there must be some reason for its delay) but I am sure that it is going to be a traumatic event.



This day in history:

Blog #DateTitleTags
14727/11/2008AchievementsProgramming, ERP
118727/11/2018Intermediate thesis accepted!!DBA
127627/11/2019Song festival 2019 - 2Song writing
135927/11/2020Preparing for the DBA vivaDBA
155627/11/2022GriefObituary, Kibbutz

Monday, November 21, 2022

Using the steam basket

Two weeks ago I wrote about purchasing a steam basket, or as it's called in Hebrew translated into English, a 'collapsible steamer lily'. Today was the first chance that I had to use it, in order to cook pearl barley with chicken, but keeping the barley separate.

This is the cooking tray with the basket and the chicken. On the chicken has been poured fig syrup and I've scattered on them purple onion slices that are supposed to be slightly sweeter than the regular onion (although they cost the same). In the top left hand corner is the steam basket and if one looks closely, the pearl barley can be seen inside the basket.

After adding liquid and cooking for 2.5 hours, the chicken was sublime, but I was more interested in the pearl barley. It seems that I put too much barley in the basket as the upper layer wasn't cooked. OK, I'll remember this for next time. Also, the chicken wasn't particularly brown as it was a few weeks ago. It seems that rolling the chicken in 'date honey' (ie 'honey' derived from dates) and olive oil is preferable to simply pouring the date honey and olive oil on top. This time I forgot the almonds.

Here's the same tray after cooking. It can be seen that the barley has risen higher in the basket, as the lower grains have swelled with the cooking liquid, but the top most grains are uncooked. After taking the basket out of the tray and transferring the barley to a normal pyrex dish, I added more liquid in the hope that over the next few days the under-cooked grains will continue to absorb liquid and improve. Taste wise, the barley was fine, but not as spectacular as the first time when I tried this (without the basket).

I wonder which is better from a nutrional point of view, pearl barley or quinoa. This site sets out various comparisons:

  • Quinoa provides a higher percentage of protein, vitamins and minerals.
  • Barley is lower in calories than quinoa.
  • Barley provides more fiber than quinoa.
  • Barley has a better glycemic index than quinoa.
More importantly for me, it appears that raw pearl barley has half the potassium content of raw quinoa on an equal weight basis (it also has only half the iron and magnesium, so it's not a complete win). So it looks like I'm going to switch to pearl barley whilst still cooking quinoa for my wife (whom I've converted) and family, or maybe I'll eat both at the same time.



This day in history:

Blog #DateTitleTags
2021/11/2005Hello again (Kate Bush)Kate Bush
30721/11/2010Improving the dual list box dialogProgramming, SQL, Dual list box
109121/11/2017Joe CoolGrandfather
127521/11/2019Thesis updateDBA, Health

Sunday, November 20, 2022

Belated discovery about indices and ClientDataSets

In my blogs database program, I wanted that one query would display a list of all tags, ordered by the number of appearances and by name. The number of appearances has to have descending sort, so that the first tag appearing is the most popular, whereas the last tag is the least popular. On the other hand, there are many tags that appear only once and it would be nice if these tags could be sorted in alphabetical order. In terms of SQL, this would be

select tags.name, count (*) as id from tags inner join tag2entry on tag2entry.tag = tags.id group by 1 order by 2 desc, 1
but because of the way that the indices are defined in Delphi, I am using the AddIndex call in the following manner:
qTags.addindex ('idx', 'id', [ixdescending], '', '', 0);
Whilst this gives me a descending index on 'id', it doesn't explain how to have one field sorted in descending order and one in ascending order. Maybe I have never come across this situation before, previously having allowed the user to sort by one field only, either ascending or descending.

After poking around a little, I found the answer here; this involves one of the mysterious parameters that are passed as empty strings to AddIndex. It turns out that one leaves the options set empty, then adds in the first string the name(s) of the field(s) that are to be sorted in descending order (the name of this parameter is 'DescFields', making it more explicit). The second string parameter is called 'CaseInsFields', controlling which fields are sorted by case and which not. In Hebrew this doesn't make any sense (which is probably why I've never come across this problem before), but in the blogs program, it would make 'At' come before 'as'. The command that I am using is
qTags.addindex ('idx', 'id;name', [], 'id', '', 0);


This day in history:

Blog #DateTitleTags
64920/11/2013More song festivalMIDI, Kibbutz, Song writing
65020/11/2013Stack OverflowProgramming

Saturday, November 19, 2022

DBA update

Just over a month ago, I sent an updated version of my thesis to my supervisor, and since then I've been waiting for his response. In the mean time, I learnt how to create an automatic list of tables and of figures, in a similar manner to the automatic table of contents. I also added some more material, especially to the 'conclusions from the data' section of the thesis. Since then, I've been waiting....

The supervisor's response came on Tuesday, so on Wednesday I set about implementing most of the changes that he requested. These were primarily writing about how I mitigated biases in the research and moving one section from the concluding chapter to a new 'research design' section in the methodology chapter. This new section also received new material about how each case study is going to be conducted, i.e. a description, a list of documents, a list of interviews and the interviews themselves. This allowed me to use a word that is new to me - quadripartite

I also completely excised a section in the results chapter that examined the pilot study in terms of the model that had been developed from the case studies. I understand his point of view, but there were also some interesting points that arose from the pilot case study.

Today I devoted some time to creating a document that listed the changes requested after my unsuccessful viva examination. I had most of the answers at my fingertips, but there was a request to discuss the interview questions and their development in the methodology chapter. I had done this a few days earlier in response to a similar request from my supervisor ('moving one section from the concluding chapter' that I wrote a few paragraphs ago alludes to this), but it leaves me somewhat uneasy. The final development of the interview questions was carried out after the pilot study, so to me this seems to be putting the cart before the horse. 

Reflecting on this now, what I think they mean is 'discuss where you got the ideas from for the original interview questions'. Using the 'rubber duck debugging' technique, I now realise that there were two sources: one was my original thesis (although I think that it would be a good idea not to mention this) and the second was the five models of engineering change that appear in the literature review. I will add this now to the thesis and the 'changes document'.

I hope that I will get a quick turnaround from my supervisor as time is running out.


This day in history
 
Blog #DateTitleTags
64819/11/2013What's in a name?Israel, Personal
90419/11/2015Even dogs in the wildIan Rankin
118619/11/2018E dorianSong writing, Music theory
127419/11/2019The luxury of digital recordingMIDI, Kibbutz, Song writing
144119/11/2021Tables in Word documents opened in a threadProgramming, Delphi, Office automation
155319/11/2022DBA updateDBA

Friday, November 18, 2022

Fairport news

I've been so busy with my own life in the past few months (and rightly so) that I missed a few items of Fairport news.

First off: Gerry Conway, the drummer since 1998, has announced his retirement: "I never expected to still be playing at 75, my Mum was always asking me when I’d retire! Well, I’m not retiring but looking forward to some new adventures. Thanks Fairport, we had some great times". It appears that Fairport might be returning to the acoustic four piece (i.e. no drums), but also that the great Dave Mattacks will be returning!

Secondly, today was published a book called "Gonna see all my friends - a people's history of Fairport Convention", that is described as a fully authorised history of Fairport Convention as told through over 300 fan memories. This is published as a 384 page limited edition hardback, meaning that it's going to be heavy (man) and that the postage is going to be expensive. I wonder whether I should delay ordering this, so that I can read what others have to say about it, or order straight away. The 'limited edition' phrase worries me, but it doesn't say how many copies will be printed, so 'limited' may mean that there will not be a reprint.

Tuesday, November 08, 2022

First rain of the year

Apart from a few drops of rain that fell over the past few weeks, last night and this morning was the first serious rain that has fallen this autumn - 5.3 mm. Of course, this was also the day that I had to travel first to Haifa and from there to Karmiel. No rain fell on me, but the view at Lod train station at about 6 am reminded me of an early scene in 'The Matrix' where the rain can be seen falling down the windows.

Sunday, November 06, 2022

Appearances in my school's Chronicles

I am currently reading a book ("How to change your mind") that mentions a Professor David Nutt. This name seems familiar to me, although I can't pinpoint why*. The David Nutt referred to in the book went to Bristol Grammar School, as did I, but he left in 1969, whereas I only started in 1967, so I very much doubt that I knew him. Looking through back numbers of the BGS Chronicles didn't find much either. Of course, once I started looking, I had to find references to myself.

The first comes in Chronicle vol 30 no 6 from July 1970 (that means that I'm in the fifth form, our third year). In my house's report, the following appears Metcalfe's had the effrontery to challenge our right to the title of House Quiz Champions and in the resulting contest our team of R.F. Pannel, R. Dean, N.B. Newman, A. Dean, R. J. Hill-Cottingham and D. G. Griffiths duly put the upstarts in their place. Any more challenges? Not only do I not remember such a competition, I also don't recognise a single name, even though they were in my house. Perhaps they were all older than me?

A year later I appear in vol 30 no 8 from July 1971 as one of those who had established [his] position in the [Junior Colts] hockey team. This I certainly remember, along with the opening statement Despite the fact that the XI won none of its matches, the season was not without encouragement:the team did rather better against its opponents than in the previous year.

The next appearance is in the following chronicle, vol 31 no 1 from February 1972 where I appear as a member of the Junior Colts cricket XI. In the following chronicle (vol 31, no 2) from July 1972, I make three appearances: one as a member of the Colts hockey XI, one as a 'house official' and again in the house quiz team: The Spring term opened with yet another challenge to our supremacy in House Quizzes from Warrens; M. Davies, R. Pannell, N. Newman and N. Hunter scored a memorable victory by 64-30 points. I remember being a 'house official' - I even won a trophy for my contributions to the house, but remember nothing about the quiz team. Again, the names don't ring any bells, although I see that R. Panell was still in the team.

In volume 31 no 3 from February 1973, I appear in the house report as one who coached the youngsters in rugby and as a 'house official' - I used to organise the 'house assemblies' once a week. I appear again in what appears to be the report from the library: N.B. Newman (6Sc.B2) [supplied] even greater quantities of popular paperback fiction. If you say so. These were probably cheap detective novels, but who remembers? Finally, I appear at the end of the list of those who "represented the 2nd XI [cricket]". Most of the names that appear are familiar to me. If one looks closely, one can even see a picture of me taken from the school play: standing far right in the front row with a headband (page 126).

Vol 31 no 4 from July 1973: we read that In the Senior competition we were within points of 1st place, and this was a truly one-man effort. A.J. Sykes swam in seven events, scoring 29 out of our total of 47 points. Unfortunately neither A. Plumb nor N. Newman had done any swimming since the previous Swimming sports, and the resulting 5th position in the final relay left us in 2nd place behind Cockitt's. The same report goes on to say that In the Senior Hockey K.O. Trott's reached the final, where they were extremely unlucky to be defeated by Warren's — at full time the teams were even on goals, but Warren's had had one more short corner which was sufficient to give them victory. The whole team, captained by J.R. Dolton, is to be congratulated on a fine performance. I have a sneaking suspicion that I wrote this house report, even though it appears under Stephen Plumb's name; I remember that I wrote one report, and the next one would appear only after I left the school. Part of the house report also carps about the concentration on games and requests more articles for the house magazine - this sounds like me writing.

Incidentally, it's interesting to read what the victors wrote, a few pages later:  The Spring Term was notable for its one major sporting success, that of the House winning the Open Hockey K.O. for the first time in many years. After a relatively easy passage, we came to what had been forecast as a very even final against Trott's [my house - NN]. The pundits were certainly right, for after a "competitive" match, we eventually emerged victors, 7-6 on short corners, after  the game had ended at two goals each at full time. It is easy to highlight the obviously telling contributions of the recognised Hockey players, but the final result stemmed much from the contributions of the "thugs" of the Rugby fraternity, notably Bob Stirratt and Nick Noble, and of a Junior Colt, Richard Mason. Not only have the reports become loquacious, we now have first names! 

Apparently I gave more books to the library, and I made a fourth appearance in this chronicle as a member of the 2nd XI (hockey), where it is written ... teamwork could be added to individual skills to bring many triumphs, culminating in the defeat of the O.B.'s, apparently the first time this has happened since the war. 

In volume 31 no 5, Winter 1973, I appear twice, once again as a donator to the library, and once in the house report  I would like to wish all the best to those members of the House leaving at the end of this term and include those who left at the end of last term, especially S. Plumb, N. Clewett, R. Cleave, S. Jay, D. Pollock and N. Newman, who have in their time contributed greatly to the House's running. We're back to initials.

I thought that this would be my final appearance, but in 1977 I crop up again, in Old Bristolians' News: Newman, Norman (67— 73), 360 Finchley Rd., London NW3 7AJ spent his first post school year with war and terrorism in a Kibbutz in Israel. In Sept. 74 he began a sandwich course for BSc (Hons) in Food Science at the Polytechnic of the South Bank, London,working his sandwich period (75—76) as an analyst with Schweppe's. Currently he is a microbiologist with the Public Analyst for Surrey. He expects to graduate in 1978\ and then emigrate to Kibbutz Mishmar David but in the meantime would welcome a meeting with any who remember him. Obviously I wrote this, but someone mangled it as I was not a microbiologist for the Public Analyst for Surrey (although this sounds impressive).

[* Edit from a few days later: I think my mind confused David Nutt with David Nott, who taught physics at BGS when I was there and might have become a house-master]

Saturday, November 05, 2022

November 5

I suppose that it's obligatory to note that today is Peter Hammill's 74th birthday. It's also Guy Fawkes Night (aka bonfire night), a celebration that played only a small part in my early years, and none at all afterwards. But blowing up Parliament ... that's something that I wouldn't mind doing today, in view of the results of the Israeli general election held a few days ago. 

I want to quote a paragraph from "The Rotters Club" (by Jonathan Coe) that takes place on Bonfire night

He held the sparkler up in front of my face and said, "Wait, wait".
I was already waiting. What else was there to do?
"Here you are", he said. "Look. What's this?"
At that precise moment, his sparkler fizzled out. I didn't say anything, so he supplied the answer himself. "The death of the socialist dream", he said....
But it was never going to happen. If there had ever been a time when it might have happened, that time was slipping away. The moment had passed. Goodbye to all that.

Indeed, I feel very much that the socialist dream is over in Israel as well, when there are only four MKs elected (out of 120) that belong to a socialist party. Our time has slipped away, our moment has passed.



This day in blog history:
Blog #DateTitleTags
127205/11/2019Draft thesis reviewDBA
135505/11/2020First rainPersonal, Weather
143505/11/2021Counting beats with Van der Graaf Generator (3)Van der Graaf Generator, Time signatures

Friday, November 04, 2022

Redesigning the 'blogs' program

Over the past few weeks, I've spent a fair bit of time with my 'blogs database' program and have been thinking about various improvements. Roughly speaking, the program (as like many others) can be split into two: the part that deals with entering/storing the blog entries and the part that deals with creating reports about the entries. Whilst the first part was handled well, the second part was totally lacking. The ideas that I've had, such as the 'this day in the blog history' don't fit into the paradigm established by the program, so I realised that I would have to redesign it and rewrite parts (as well as adding new parts).

Yesterday evening, while walking the dog, I was thinking some more and realised that I would like several different functions to output a list of blogs, each showing different data. This would mean using the multiple document interface (MDI) and displaying the same form several times. How would each instance of the form know what to display? I was thinking originally in terms of a temporary table that would hold the chosen data, but I quickly realised that this would not be sufficient. 

In Priority, there is a mechanism called 'link' that creates a new copy of a table; data is inserted into this copy and then displayed. Eventually the copied table is destroyed. For a few moments I thought about creating new tables then dropping them, but after a while I realised that I could greatly simplify this.  I added to the temporary table a new field, 'instance' that would be part of the primary key; each query would get a unique instance and store its data (entries) along with that instance. The form that displays the data would be sent the instance number and so would retrieve the correct data. When the form closes, it deletes the data from the temporary table and frees the instance number for further use. 

I worked all of this out last night and today I was able to spend a few hours working on the program and changing it around. Some parts - for example, choosing tags for an entry - have remained the same, whereas other parts have been slightly modified. The whole 'instances' idea worked perfectly. Using the same idea for tags is a bit more difficult as one query (unused tags) needs to display only tags whereas another query (entries per tag) needs to display both the tags and their counts. After fiddling around a little, I figured out how to handle this.

Another idea for a report was taking one popular tag (e.g. programming) and seeing how many times different tags have been paired with this tag. Then I could retrieve the entries that have the chosen combination of tags and show them in the the 'show entries' form. Expanding the program is much easier now.

Thursday, November 03, 2022

Have I found the solution to a cooking problem?

When discussing cooking chicken a few days ago, I wrote today's experiment: adding some pearl barley to soak up some of the excess liquid. I like pearl barley but my wife doesn't, so I've got to find a way of keeping the barley separate but also allowing it free access to the liquid. Well, I think I've found the solution, after examining the goods for sale in three different kitchen goods shops last night in the local shopping centre: translated literally, it's a 'collapsible steamer lily' (שושנת אידוי) which I assume in English is a steamer basket - and lo and behold! That's the correct name and here's an article about its use. My problem was finding the correct name for what I wanted. See here also.

The picture on the left shows how the basket will look when it's placed inside the oven dish: liquid can get in, but the contents can't get out. The middle picture shows how the basket looks when it's open: obviously this is when one puts the contents (e.g. pearl barley) into the basket. The right-hand side picture show the basket on its side, so that its legs can be seen (although not very clearly). I think that the legs would be opened if one wants to steam vegetables in an open saucepan, but not have the vegetables in contact with the liquid. One would put some water in the pan and then the basket: steam will come up from the water and cook the vegetables, but there would be very little leaching.

I won't get a chance to use this until next Friday night, but I'm looking forward to the opportunity. The pearl barley that I cooked with the chicken absorbed all the excess liquid, so it became very tasty after a day or two. Using the steam basket means that the barley will be served in a separate dish: if I want it to taste good after a few days, I will have to add to the saved barley some of the liquid from the chicken.


Note that I used the tip from a few days ago as to how to place pictures side by side, although this time, I've gone one stage further: I figured out how to put some blank space between them. In the HTML code for the picture, there's a command 'style = "padding: 1em 0...."'. Replace the 0 with a number like 10 or 15 and this will define the padding around each picture. I'm unsure as to whether 'px' (pixels) should appear after this number.

Wednesday, November 02, 2022

New song, with a little something extra

A couple of weeks ago, I laid down the basis of a new song. I wasn't too happy at first with the chord sequence to the first half of the verse as it is very similar to several other songs of mine, but at least the second half was more interesting. I sequenced a couple of verses along with an instrumental section that includes a modulation. Of course, no words.

Then along comes David Bennett Piano with another of his videos giving examples of common chord progressions. On the basis of this, I thought to myself that I could add a chorus to the song that would add some variety, especially as almost none of my songs have a chorus. I used a variation of one of the progressions that DBP talked about: I IV iv V (in the key of D, D G Bm A). I repeated this twice, then added another IV V at the end, just to make the sequence slightly less four square.

I then sat at the piano, played those chords a few times and came up with a melody that is centered on the note A. This note appears naturally in the D and A chords; it's the seventh over Bm, which is fairly regular, but over the G chord it becomes a ninth - somewhat unusual. I then added this chorus to the sequenced song and listened to it. I added an arpeggio'd guitar part for the chorus that really boosts the entire song, so much so that I now enjoy listening to it.

At first the chorus reminded me of an instrumental tune - the first part of the final track on the Lunasa album, "Merry sisters of fate", called 'the wedding reel'. Then, more unfortunately, it reminded me strongly of a newish tune of Fairport Convention*, about flying saucers over Banbury, with a 'doo-wop' chorus that uses the same chord progression. So I had to change my tune slightly. 

A few days later, I had a delicious thought: why not create an instrumental coda, or as it is known in the trade, a hidden track? This would begin with the same chorus tune then morph into 'the wedding reel'. In order to do this, I would, of course, need the notes to the reel. After some false leads, I found the tune in sheet music form. 

Yesterday I 'typed' in the notes and today I worked on the arrangement: the important thing was finding the right sounds that didn't saturate the aural space. I think that the arrangement still needs a little work, to be thinned out some more.


* It turns out that the Fairport song does not use this progression, so I'm safe on that count.

Tuesday, November 01, 2022

Big cloud

While walking the dog in late afternoon, my eyes were attracted to a slightly unusual cloud formation (as pictured on the left). First of all, this cloud seemed massive (in terms of other clouds), but the lighting was extreme. It's as if the sun was behind the cloud and lighting it, but in fact the sun was in the opposite direction, behind my back. Also at the hour of the walk, the sun was already red and going down fast (that's the problem with winter time - the late afternoon walks are now at dusk or after dusk when the light isn't so good).

It's as if the cloud were 'haloed'.
 

Monday, October 31, 2022

Extending cooking length for chicken

As I once wrote, I haven't blogged about food for several months, not so much because I haven't been eating but more because I haven't tried any new dishes. One Friday night a few weeks ago, there were complaints that the chicken drumsticks served were slightly undercooked, in that the meat didn't separate easily from the bone; they were cooked for 1.5 hours. So the next time that I cooked chicken, I gave the pieces another hour, and the results were so spectacular, no only in the ease of separating the meat from the bone but also in the taste, that I resolved to continue cooking for this extended time. 

Apart from the extra time, I also cover the chicken with parchment/baking paper and on top of that, aluminium foil. According to my wife, the paper prevents contamination of the food by chemicals emanating from the foil; this might be true, but it also has the effect of retaining liquid and not allowing the pieces to dry out. 

Since then I've carried out a few experiments: rolling the pieces in a mixture of olive oil and date honey (instead of honey) before placing them in the tray, adding water (with or without soup powder), adding almonds, and today's experiment, adding some pearl barley to soak up some of the excess liquid. I like pearl barley but my wife doesn't, so I've got to find a way of keeping the barley separate but also allowing it free access to the liquid. The next experiment will probably be removing the almonds (that don't seem to contribute very much) and adding plums.

The results have been spectacular!

I find this slightly ironic, as at the beginning of the year, I was conducting experiments with the Ninja grill to reduce the cooking time, and here am I extending the time. The Ninja has lain almost unused for the last six months: it seems that it's only going to be used for grilling steaks and my wife and I don't eat steak (our son does, though). It's the same story with every new cooking appliance: I use it exclusively for a few months, then go back to cooking in the oven.



From the 'this day in my blogging history', I discover that today is Tom Paxton's 85th birthday.

Sunday, October 30, 2022

Adding more old blog entries

Over the past few weeks, I've been adding more old blog entries: of the 599 non-recorded entries, I've so far entered 164. During this time, I've found myself adding additional tags to maybe 10% of those entries. I think that this is primarily because Blogger doesn't present an easy-to-choose-from list of tags: one can type the first letter of a tag and suggestions will be made, but this doesn't allow for the possibility of choosing a tag that exists but that I've forgotten about. I'm not going to update the online blogs but choosing tags for new blogs should be done by means of looking at all the tags in the blogs program. For example, I added a 'Greece' tag to blogs that were about Rodos, Santorini, Andros and Athens.

New ideas for the blog program: add a 'this day in history' button (in other words, display all the blogs that were entered on 30th October, regardless of year. This was quite simple, but first I had to see how Firebird refers to a day and a month that are contained within a date. The answer was slightly more complicated than how Priority refers to dates.

select * from entries where extract (month from curdate) = 10 and extract (day from curdate) = 30
(in the program, 10 and 30 are replaced by parameters). This query is different from the dynamic 'where' statement that the program (and others of its ilk that I have written) uses, so pressing this button creates the query and executes it immediately, thus short-circuiting the normal code. For the record, there are at the moment four blogs for 30th October:

ID Year Title
771 2014 Another good idea
1181 2018 Losing an old friend, gaining a new one
1433 2021 Binaural beats and deep sleep
1543 2022 Adding more old blog entries

Of course, accessing these blog entries in Blogger is not very easy because Blogger doesn't allow access via id number. Presumably these entries also have different tags. My blog program does allow direct access: clicking on the entry should open Blogger with the correct blog entry, at least for those entries that have the address stored. There are about 930 than don't!

The next idea will be much more complicated and will involve programming something that is completely outside my comfort zone, or even my knowledge bank. In the past, I knew how many blog entries there were for King Crimson (15); with the improvements from about a month ago, I now know how many of these entries also have the Van der Graaf Generator tag (6) and how many don't (obviously 9). I also know how many VdGG entries don't have the KC tag (16). I would like to display this data in a Venn Diagram. Not only that, I would like that the size of the two circles, as well as the overlapping area, be relative to the number of tags.

This will give me something to do in my spare time!

Saturday, October 29, 2022

The 8-puzzle

I have just received a communication from someone (unknown to me) via LinkedIn, asking about a computer program that I wrote (and continually revised) throughout the 1980s that solved the '8-puzzle'. I replied that I would have to get into my time machine and set it to return 34 years, but first I'll retrieve whatever shreds of memory I can find for the blog.

I came across this puzzle in a book written by David Levy; looking at the list of publications on his wiki page, this was probably 'Computer Gamesmanship: Elements of Intelligent Game Design' , published in the early 80s. One has to remember that I first 'met' a computer at the end of 1982: this was a teletype connected to a phone line that was connected to a PDP-11 computer about 20 miles away. I also had absolutely no background in programming, so this book talked about topics that were far above my ability. The 8-puzzle problem served as an introduction to all kinds of topics in computer science: how to draw a grid on a VT-100 screen, how to get direct input, how to check for legal moves, linked lists, hash tables ... there's a lot in there.

Looking for the 8-puzzle on the Internet now, I see that it's a favourite topic of computer science degree courses, which makes sense. I think that this site gives a good introduction to what the 8-puzzle is, who developed it (I remember it as a plastic toy from my childhood) and how to solve it with the computer. Note that this assignment is numbered COS 226 that probably means that this is an intermediate course in computer science. This site gives another good explanation of the puzzle and how to solve it.

I wish I had access to these web pages back in the day instead of having to stumble in the dark, teaching myself all kinds of techniques. All I had were a few pages in Levy's book and another book about data structures in Pascal, instead of detailed guides.

My program had two modes: user and computer. First the computer would create a random initial configuration, then the user would be given the opportunity to solve the problem, whilst the computer counted how many moves the user required. For my program, this mode taught me about user interface: how to react to user input and how to change the display depending on the input. 

But it was the second mode that was the more interesting: 'teaching' the computer how to solve the puzzle. Levy wrote about the 'minimax' algorithm, but it wasn't until one day I was in the computer science library of Bar Ilan university that I found out what this was. I imagine that I was doing some reserve army service in the lab at Tel Hashomer hospital, as the university was within walking distance (don't forget that I was/am a good walker; this was probably 2 km away). I acted like I had the right to access books and journals, and no one asked me who I was.

Every few months I would have a new idea as to how I could improve the evaluation function of the current configuration (basically, how far the current configuration is from the goal) in order to figure out what the next move should be. I also stored the various configurations for two reasons: I wanted to prevent the computer getting into a loop, and I wanted to look at the configurations myself to see how I would have acted. I remember now that I had a standard configuration that took me something like 37 moves to solve; any program version that took more moves needed to be improved. I also wanted to surprise myself and see whether the computer could solve this test configuration in fewer moves; after all, I'm no expert in this puzzle, and so it would be quite possible that the computer could beat me.

On the left is a picture of the solved 8-puzzle, or as we would call it in computing terms, the goal configuration. I note one major difference from this configuration and my goal configuration (that presumably came from the Levy book): mine had the empty space in the middle, so that the second row would be '4/ /5' and the third row would be '6/7/8'. This may seem like a minor point but it's very important.

Looking at the program code that has been stored here (I wonder how; did I give permission for this?), I am sad to say that although there are comments, they rarely state anything that is not obvious. There is certainly no explanation about the algorithm or how the evaluation function works. 

What Levy called IIRC the move generator (i.e. which tile should be moved next) appears to be implemented in the function makenode. Going back to the first picture of a real 8-puzzle, there are only two moves possible in this configuration: either the 1-tile would be moved down or the 5-tile be moved left. I would think that this latter move would be better then the 5-tile would be in the correct column but in the wrong row. Moving the 1-tile wouldn't appear to do much. But that's why the program has its evaluation function in order to calculate which move is better.
function evaluate (var p:square): integer; var i, tmp: integer; ch: char; blank: boolean; begin tmp:= 0; i:= 0; while i < 9 do begin i:= i + 1; ch:= p[i]; blank:= ch = ' '; if not blank then tmp:= tmp + table[(i-1)*9 + ord(ch) - zero] else tmp:= tmp + table[i*9]; if blank then if i <> 5 then tmp:= tmp + 2 else else case i of 5:; 2,4,6,8: if p[5] <> ' ' then if (p[preint[i]] <> prech[ch]) and (ch <> prech[p[5]]) then tmp:= tmp + 5 else else if p[preint[i]] <> prech[ch] then tmp:= tmp + 5; 1,3,7,9: if p[preint[i]] <> prech[ch] then tmp:= tmp + 3 end end; evaluate:= tmp end { evaluate };
The above is not spaghetti code: it's actually presented in quite a logical format, but there's no explanation. Earlier in the table there are definitions of tables used in this function, but these definitions are opaque: I don't remember why certain values were chosen or what they do. The name 'prech' implies to me that there function checked which tile preceeded which; apparently this was an effective approach. 

Friday, October 28, 2022

Unfamiliar photo from 10 years ago

My mobile phone was kind enough to display the photo (pictured below) with the caption '10 years ago'. I have no recollection of this photo whatsoever, but it clearly shows my father (then aged 90) and myself sitting on our balcony and talking about something. 




Thursday, October 27, 2022

Emergency surgery

Got you going, right? 

This wasn't emergency surgery on one of the family, but rather on my mobile computer. As can be seen in the picture on the left, the frame that holds the screen has warped and the screen is no longer attached to the frame. I'm not sure when this started (certainly before Bari), but for some time there has been a little difficulty in closing the top of the computer. This has been getting worse and worse until the other night, when the plastic hinge that holds the frame snapped in two and the screen almost fell out.

Of course, I could continue working without problem, but obviously I had to seek help as soon as possible. I sent the picture to my computer repairman and he said that it would be a very easy fix (although clearly the frame has to match the screen size). 

As I needed the computer for consultancy work yesterday (Wednesday), I took it to him at about 8:30 pm last night. I received a whatsapp message at 7:05 am this morning that the computer was ready. So I walked over to his house (on the other side of the kibbutz, a good work-out) and picked up the computer on which I'm typing now. I've forgotten what it's like to close the lid properly.


Tuesday, October 25, 2022

Roland J-6 minisynth: a serious musical instrument or an expensive toy?

Towards the end of September, I received (yet another) SMS from one of the musical instrument shops in Israel where I have purchased items. I had a look at their site and resisted the temptation to buy yet another guitar that would probably hang on the wall, gather dust and never get played. On the other hand, I saw that there was a synthesizer on sale for about 850 NIS, about $240. As the shop was prepared to spread the payments over two years, the cost each month would be 35 NIS, which the same cost as a few bars of chocolate. I decided that it was time to spoil myself and that I could afford the cost.

The manufacturer's website describes the device thus: The J-6 Chord Synthesizer is an endless well of musical inspiration, pairing a powerful chord sequencer with the lavish tones of the renowned JUNO-60 synth. Generate soul-stirring song ideas in seconds, and experiment with styles and variations to coax dancing lines and rhythmic patterns from your chords. Add lush effects to frost your sound, and expand your possibilities by interfacing with other AIRA Compacts, MIDI hardware, and music production software.

Only after ordering was I smart enough to go looking for videos about this device on the Internet.  Here are a few videos: one, two, three and four (there are more). The fourth video asks the very important question: is this a serious musical instrument or an expensive toy? In the time before the synth was delivered, I found the user manual on the internet and tried to figure out how I might be able to use it in order to turn it into a serious musical instrument. There is a sequencer contained within the synth but this has only 64 steps; I spent some mental time figuring out how I could use this within my recordings. The first conclusion was obviously that an entire song could not be sequenced within the synth, but it should be possible to record sections and paste them in to the multi-track recorder in the same way that I include my vocal parts. There were listed a huge variety of chords available, but these seemed not to be labelled so I would have to figure out by myself what each chord is.

The synth arrived yesterday and with no ado I began charging it, before playing with it slightly. The first thing that strikes one is its size: it's tiny, about the size of a trade paperback, 188 (W) x 106 (D) x 36.2 (H) mm! Obviously this isn't meant to be an instrument that one plays live!  I played around with it for a while and couldn't get much out of it (RTFM). The synth comes with a card embossed with a QC code holding a web address which when followed causes allows the owner (me) to register his purchase. The web site also contained an updated manual so I downloaded this and glanced through it. 

My first observation about the manual was that the chords have now been named; my second was that each chord family contains one chord per each chromatic note (i.e. for family #1, the chords are Cadd 9, C#M9/C, Dm7, D#M7, Cadd9/E, FM9, Dadd9/F#, Em7/G, F/A, Gm/Bb, G/b) where there is no direct correspondence between the 'note' being pressed and the chord played. In other words, pressing the A key will produce an F/A chord.  What if I want to play Am7 followed by BbMaj7? Do I have to play (and sequence) an Am7 chord from family #18 (that seems to contain the 12 minor chords), followed by a BbMaj7 chord from family #19 (all major seventh chords)? A better solution would be to transpose the keyboard by five semitones then play Em7 and FM7 from family #2. OK: how does one transpose the keyboard?

The manual explains the basics of working with the synth; for transposition, the manual says

1. Hold down the [SHIFT] button and press the [A (KEY)] keyboard button. This returns you to the transpose setting screen. 2. Turn the [TEMPO/VALUE] knob to edit the value. 3. When you are finished, press the [C (EXIT)] keyboard button on the left side.

I suppose that's reasonably clear although a bit confusing. Most of the other instructions are similar.

After fiddling around a bit and discovering odd snippets, I realised that I would have to learn to operate the synth in the same manner as I learnt how to write reports in Priority: read the manual/SDK, try out small things, then build on this knowledge in order to build larger things, and so on. I was somewhat confused at first as all the youtube videos had arpeggios running: I discovered that in order to do this, one has to press the 'chord' button then hold the desired key (e.g. A) for a few seconds: this will cause the synth to play the chord defined by the chord family according to the pattern defined with the defined sound. The arpeggio will play as long as the note key is pressed. But notice: one has to define a sound (there are 64 predefined sounds) that can be altered by changing its envelope and by adding delay and reverb; one has to choose the arpeggio pattern and one has to choose the chord family (and that's before the sequencer enters the picture). 

In other words, it's going to take some time before I can use this device in an intelligent manner. But at least, I now have a mental path as how to progress. 

It seems that in order to create a sound file on a computer, I have to connect the sound out socket (where headphones are connected at the moment) to the input on the computer's sound card. Supposedly MIDI data can also be recorded but how to do that is even less clear than how to choose the arpeggio pattern. This can wait for later.

I am going to try very hard in order to turn this tiny device into a serious musical instrument.

Sunday, October 16, 2022

Indexing blogs

Towards the end of 2014, I wrote a simple database program to record all the blogs that I write. The need for this came when I reached 700 blogs and wanted to table the most popular tags in the past 100 blogs. Whilst the blog site allows one to retrieve blogs according to tag, the possibility to retrieve by date is more limited. The external interface allows one to see how many blogs were written in a given month and in a given year, but the blogs themselves can only be accessed individually (the internal interface lacks this). As a database programmer, I am used to more sophisticated options, such as showing all the blogs that were written in a given time period with a given tag. There is no option whatsoever to access blog entries by number.

So I wrote that simple program: it allows me to record the blog titles and their tags (a blog can have more than one tag). The most sophisticated part of the program automatically outputs a 'league table' of tags and counts that I can paste into this blog, as I have done here, for example. I've been content with the program for nearly eight years, but the last few days have seen various developments (or more accurately and in the language of my thesis, enhancements).

The picture on the left shows the parameters tab - one can choose to retrieve from a given date, until a given date, from ID until ID and by tag (ignore for the time being the radio button 'choose multiple tags') and the combobox 'tag 2'). As can be seen (with a little difficulty), I have chosen to display all the blogs written since 01/10/2022.
The lower picture displays the result of that database query. At the moment, 6 blogs have been written since the beginning of the month: they are displayed along with their id number, which is not particularly useful, and the date they were posted (ignore the 'web' column for the time being).

My first improvement was to handle the problem that I couldn't simply switch to the 'data' tab in order to enter new blogs: first I had to retrieve a list of blogs (e.g. from today or the beginning of the month) and only then could I make new entries. In technical terms, the query that displays the blogs hadn't been opened and so I couldn't make new entries. The fix was first to determine when this event would occur (pressing on the 'add' button when the query is closed), then to retrieve the id of the last blog entered, then to increment this number by 1 and place it in the 'from id' edit box, and finally to simulate pressing the 'show' button. This may sound like a lot but it's only a few lines of code. Then I could add new blog entries that would be displayed, because their id would be greater or equal to the value in the 'from id' edit box.

Writing the above makes me realise that I have not made the other buttons ('edit', 'set tags' and others) 'unabled' when there are no blogs displayed. This is a program for my personal use and I am not likely to press one of these buttons! Anyway, I don't think that anything would happen if I pressed those buttons when no data is being displayed.

The second improvement embodied thoughts on a more general topic: I use the above two-tab dialog box frequently in the OP's management 'ERP' program and I use the blog program as a test bed for the ERP program. The 'tag' combobox allows the choice of only one tag: in English, the query would be 'show me all the blogs that have the tag <something>'. In the ERP program, this would be 'show me all the entries for customer X'. I would like to extend this by allowing what is technically called an 'or' query: show me all the blogs that have the tag <X> or those that have the tag <Y>.

I solved this by reusing the dialog box that allows me to choose multiple tags for a given entry (see the picture on the left). Instead of attaching tags to an entry, I created a new table, tmptags,  that consists of one field only, tag; the chosen tags go into this table instead of the 'tag2entry' table.

Then the query in the main form had to be changed in order to use the 'tmptags' table; this was very easy. More difficult was deciding when to bring up this dialog and choose the tags, and how the code called by pressing the 'show' button should use the 'tmptags' table or the tag chosen in the 'tag 1' comboxbox, if at all.

Once I figured this out, it occurred to me that I could make a useful extension, and allow my program to execute the Internet browser and display a given blog. So I added an 'address' field both to the 'entries' table and to the form that allows me to enter or edit an entry. Going back to one of the earlier pictures, the tick in the (new) 'web' column means that double pressing a line will cause that blog to be displayed.

My final improvement (as of last night, of course) was to allow the possibility of choosing two tags and displaying only the entries that have both tags (in SQL, this is an 'and' query). The implementation was fairly simple: add another combobox and alter once again the SQL code for the query. Unfortunately, this time the SQL is complicated, as the 'tag2entry' and 'tags' table have to be referenced twice, meaning that aliases have to be used. Not only that, an alias is required in both usages of each table. This leads to code that looks like this...
select id, case when address is null then 0 else 1 end as web, curdate, name, address from entries inner join tag2entry t2e1 on t2e1.entry = entries.id inner join tags t1 on t1.id = t2e1.tag inner join tag2entry t2e2 on t2e2.entry = entries.id inner join tags t2 on t2.id = t2e2.tag where 1 = 1 and t1.name = '....' and t2.name = '....'
The 'where 1 = 1' is simply a placeholder line for the 'where' clause; this will always be true and is probably ignored by the SQL engine. Its purpose is to allow the following clauses to begin with 'and'; there's no need to check whether a 'where' line has already been added when building the dynamic query.

I have to remember that if I alias one appearance of a table (e.g. tags) in a query, then all appearances of the same table have to be aliased. This probably is the basis for the tendency of beginning programmers in SQL Server to alias everything, regardless of whether there is a need to do so.

The next improvement will be probably be something like 'when was each tag last used', which could be extended to 'which tags haven't been used since date X'.



Following the recent entry about Gillian McPherson, I was interested in seeing what else I had written with the tag '1971'; almost nothing appeared. I thought that this was due to a problem in my code, but eventually I remembered that I hadn't entered the first 600 blogs into my program. As from last night, I intend to enter maybe ten old blogs a day; this isn't easy as noted above: the blogger interface doesn't allow me access by id number. I'll use the external interface (as shown in the picture on the left) to access all the posts in 2005 - these obviously will be numbered 1 - 22. From thereon, I'll have to calculate what will be the id of the next entry that I intend to save in my program.

I thought that somewhere I had documented how to insert two pictures side by side in a blog; here I wrote that I've learnt how to place two pictures side by side in the blog, but I can't find now how I did this. I remember that it had to be done in the HTML view and that no positioning be chosen, but I'm sure that there's more to it than that. I found this morning a blog that shows how to do this with a table, but that wasn't too successful either. After another search, I've found the page that I remember. I'm going to reproduce part of the solution here; this assumes that the pictures have already been loaded into the HTML page.

Each image is surrounded by an opening DIV line.

<div class="separator" style="clear: both;">

and a closing one

</div>

You need to remove all those lines of code.

Then finally for each image you will see this code

style="display: block; padding: 1em 0; text-align: center; "

Remove the display:block; part so that it looks like this.

style="padding: 1em 0; text-align: center; "

Then if you have done it all, when you goto Preview or Compose mode you should see all your images together.