Friday, December 25, 2020

Covid-19 vaccine (2)

As opposed to the autumnal weather of yesterday, when the outside temperature reached a high of 11°C, today is warm and sunny, 20°C. Great weather for a walk.

I was pottering around this morning at home when my wife announced that someone had posted on one of the kibbutz Whatsapp groups that the vaccination centre in the local town was empty and waiting for customers. Within a few minutes we were in the car, heading for the town.

As announced, the 'centre' (really a large room with partitions) was empty of people being vaccinated, so swiftly we had our personal data noted, answered the standard questions about feeling well, etc, received warnings about possible side effects then had the vaccination. Despite the size of the syringe and the needle, the actual penetration of the skin and insertion into the shoulder muscle was barely felt.

After waiting 15 minutes outside of the room in order to ensure that there were no immediate side effects, it was back home ... and to a great feeling of relief.

I thought that booking an appointment for Sunday evening would put us at the vanguard of the people being vaccinated, but this morning I spoke to a few people on the kibbutz, all older than me, and they had all been vaccinated; I was slightly miffed. On the other hand, someone at work who is older than me but lives in a town in the north of Israel received an appointment for the middle of January.

According to the local news, Israel is first place in the world with regard to the number of people vaccinated per 100 residents. It's amusing to note that a week ago people were worried about the vaccine and were vacillating as whether to have it; now everybody is rushing to be vaccinated!

We receive a second dose in a month's time, and the health authorities reckon that by March they will be able to remove many of the restrictions in place. Let's hope that this is so.

Thursday, December 24, 2020

High blood pressure

Two and a half months ago, I wrote "Of course, I also have to monitor my blood pressure: if it starts rising then I will have to see my GP who will recommend new medication. It will be very easy to see whether his [the cardiologist] opinion is correct.". Well, the swelling in my legs disappeared after a few days but my blood pressure shot up and these days is around 160/100, which is far too high!

I have seen my GP a few times and she has been trying out different combinations of medications in order to reduce my blood pressure. So far, nothing seems to have worked, including the previous medication that I was taking (apart from the one that caused the swelling). In return, I've been suffering from bad headaches about every other day; sometimes my migraine medication works and reduces the headache, but more often than not I am stuck with a headache for hours. 

As a result of the combination of headaches and blood pressure, I have noticed that my level of patience has been reduced to about zero, which is making my daily work problematic. I can no longer accept the failings of my fellow workers, whether it is the noise that they make (when I am in the factory) or their inability to think for themselves.

In order to reduce this stress, I decided (along with the advice from my manager) to work a few days from home. Last night, the Israeli government decided on another lock-down to start from Sunday evening (just when I'm about to be vaccinated!) so in a sense I'm simply starting the lock-down a few days earlier. The only real advantage that I have in working in the factory is that I have easy access to a printer, but as I rarely print documents, this sole advantage is completely outweighed by all the disadvantages.

Not only that, yesterday it started raining and hasn't really stopped yet (although the rain is far from continuous). As a result, I am once again sitting by the dining room table surrounded by computers and looking out of the window at the view of the kumquat tree which is currently flowering.


Here is a picture of my view: very autumnal. At the moment, the only thing that I want to is to get rid of these headaches that might be a function of the high blood pressure (this is folk wisdom; it hasn't been proved that high blood pressure causes headaches). Once the blood pressure is lowered, there is a good chance that I will become more patient and more able to suffer the niggles of everyday life.

Of course, we will still be locked down, high blood pressure or not, so I will be saving myself the annoyances connected to my physical workplace in the factory.

Wednesday, December 23, 2020

Covid-19 vaccine!

A few weeks ago, it seemed that Israel was managing to keep the second wave of Covid-19 infections under control, but since then, the daily number of new infections has been steadily increasing. The threat of 'the British mutation' that spreads faster than the 'original' version will only serve to increase the number of new infections. Thus we have been following closely the news about the vaccine.

They say that 3.8 million doses will arrive in Israel by the end of the month (which is next week), enough for 1.9 million people to be vaccinated. The first in line are the health services, then people in old age homes and then people over 60 (yeah!). Of course, the first person to be vaccinated was our Prime Minister (hopefully not for much longer) on Saturday evening. Since then, we've been hearing various reports about the availability of the vaccine.

The news yesterday evening carried out a comparison between the four national health funds as to when one can make an appointment. I don't want to get into an explanation of the different health funds so accept the explanation that it's like there are four National Health Services running side by side. One health fund is already vaccinating, two others are giving appointments for the next few days whereas my health fund is giving appointments from mid-January to February; naturally, this health fund is the biggest and hence the slowest. I said to my wife that they will no doubt decrease the waiting time after this public shaming.

So I wasn't too surprised this morning when the kibbutz nurse issued a notice that our health fund is now accepting appointments for a central clinic in the local town. I tried first of all via the normal telephone number but of course no one answered; there was a pre-recorded message that suggested to make an appointment via their web site.

At first the web site didn't respond, but after a refresh, I was able to make an appointment (the first available) for Sunday evening. My wife came in a bit later and I made an appointment for her about half an hour later. Hopefully we will be able to be vaccinated at the same time.

Next update on Monday.....


 

Monday, December 14, 2020

John Le Carré (1931-2020)

I first became aware of John Le Carré in the summer of 1975 when I spent a few months in Israel. Someone gave me a copy of "Tinker Tailor Soldier Spy" (TTSS) to read and I found it very intriguing. True, there was a fair amount of the book that I found difficult to digest, spy novels not being a genre that I was familiar with at the time, but the general style and level of invention was engrossing. When I returned home, I presumably bought my own copy and began reading it until deeper understanding descended upon me. I hate to think how many times I have read this book since, or how much time I have devoted to developing a complete understanding (not to say that the time was wasted, but rather enjoyable).

The next Le Carré book that I read was the atypical "Naive and Sentimental Lover"; I don't recall now how I found out about this book but I remember reading it on the way to Winter Activities (as we called the winter Habonim camp) in 1976 where I was to spend a week cooking [I think that I saw a copy at a newsagents in the railway station]. For some reason, I travelled there alone which makes me wonder now what I was doing in the days previous to that journey. Anyway, the book had me scratching my head as it was completely different to TTSS. I doubt that I have read this book the whole way through more than two or three times.

Getting back on track, the next Le Carré book was "The honourable schoolboy", which I purchased at Heathrow Airport on the way to my first trip to America in August 1978. This book accompanied me on all of my travels for the next three weeks, even when it wasn't necessarily suitable reading. I have gone through this book several times and found parts of it - especially Jerry's covering of the South Asian wars - hard going. I still don't completely understand the hidden message of the ending.

I emigrated a few weeks after returning from America, so from here on my sources became somewhat limited. I picked up some of the earlier books in a second hand book shop in Rehovot that I frequented at the time, including the infamous "Spy who came in from the cold" (TSWCIFTC), which I didn't appreciate sufficiently at the time. I'm still not sure whether the point of "The looking glass war" was an attempt by the Circus to get rid of its competitors. The books prior to TTSS are set in the 1960s (if not earlier) and so seem to take place in an alternative universe: so many things have changed since then (I mean things like social levels, restaurants, bars, etc) that I find it hard to relate to these books. TSWCIFTC is much better than the other two books and displays the tortured story line development that TTSS has (nothing is what it seems to be on the surface).

I recall that my Israeli newspaper of the time published a few advance chapters of "Smiley's People" (in Hebrew) so I was familiar with some of the background to the story and didn't find it as complicated as its predecessors. This book is definitely simpler than TTSS.

From hereon, I would buy each book as it appeared; most of them I read once or twice without engaging with them, but there are two standout books from this period, "The little drummer girl" and "The night manager". Both of these I have read many times, both of these have been converted into TV series and I have commented several times on them. What amazes me about these two books is the amount of invention that occurs; they are such rich books, not only in terms of their literary style but also the events that are described and the thinking that created those events. 

That said, there has always seemed to be one false note about TLDG: when did planning this operation begin? The book starts with a bombing in West Germany that is supposed to be the initial event, but the whole story of Charlie at the weekend seminars took place at least a year previously. Was it really Michel who spoke at one seminar or a plant? The time line of events prior to the bombing seems a bit woolly to me (maybe it's my lack of understanding).

In recent years, there was the autobiographical "Pigeon Tunnel" and the biography that I read six months ago. In recent years, there were the intriguing "Legacy of spies" (classic Le Carré that has to be read after TSWCIFTC) along with the less classic "Agent running in the field".

Apart from the exquisite planning, what I have always liked about these books is the rich writing style. There will be no more but there is plenty enough to satisfy everybody. I see that I have written about JLC only 15 times over the past 14 years, but I can assure any reader that JLC is one of my favourite authors, along with David Lodge and Robert Silverberg. All three have stopped writing, but all three possess invention along with an eloquent writing style, so that reading their books is always a pleasure.

[Edit] Grrrh! How could I forget "A perfect spy"? Especially since it's so autobiographical. I also enjoy "The Russia house", but to be honest, I prefer the film to the book in this case. 

Saturday, December 12, 2020

How could I have known? (new song)

This song was partially inspired by 'The Undoing' TV series that is in itself based vaguely on the book 'You should have known'. I thought that it would be an interesting exercise to write from the viewpoint of Grace, the titular wife and mother who should have known.

I started off with what I thought was the chorus three weeks ago, but this was not much more than a false start; the main idea that remained was that the song be in 3/4 time. Two weeks ago I changed slightly the chord sequence for the 'chorus' which meant that the verse music had to be completely rewritten (the chorus ended on E and the verse started with A minor; now the chorus ended on B and the verse had to start in E minor). Last Friday I was playing around with the song and wrote the verse and the tune, which was centered around the note B; the chord sequence was Em Dm C F, so the B is initially the fifth then the sixth then the major seventh then the augmented fourth: interesting harmonies. 

I began sequencing the song with these chords and tune; I added a middle section with a rising bass - B (over Em), C (C), C# (A7), D (Em7). During the week I worked on an arrangement which still was fairly basic. Yesterday I had the time to start writing the words; during the week I had been thinking about the opening 'statement', and once this was down, the rest of the words came fairly quickly, although I changed a few here and there during the next few hours. The arrangement also became finalised, meaning that it was time to record vocals.

These required a few takes but in the end I had what I originally thought would be the vocal track. Listening back to it again this morning, I decided that it wasn't confident enough and certainly was too 'polite', a failure of most of my work. I didn't have a chance to do much about this during the day except think how I could make it less polite. The answer was to sing it angrily, as someone would be who had been duped in the fashion of the book. This evening I got the chance to sing it, as loud and as angrily as possible; I feared that I had recorded the vocal with too high a level, thus leading to distortion, but this worked quite well: slightly distorted and certainly not polite! I didn't bother with autotune as the vocal was near enough in tune throughout, and the autotune would probably diminish the impact. One take, albeit with a punch-in at the beginning, and it was nailed. A few mixes later and I had a completed product.

Unlike some of my songs, I don't mind publishing the lyrics here

How could I have known? How could I have known? True, there were no signs Not even a hint Nothing was out of place You said that life was just fine You were happy with me The sun shone upon us both You had me duped How can love remain? Should our love remain? I thought you were true But in the end You have betrayed me so You took me for a fool Whilst playing the field Leaving me on my own You told me lies Always a face for each person you knew with a Separate face kept for me Recalling each one took a fair bit of skill but now You’ve been revealed as a freak Where does that leave me? What choices do I see? I’m left on my own, Wondering how I can restore my life Trust has been destroyed Certainty lost Leaving me bruised and scarred I stand alone

In terms of arrangements, I notice that of late there aren't instrumental 'fills' every four bars; in fact, there are no instrumental lead lines throughout the verses. In other words, the arrangements are much less 'busy' than my earlier efforts, which now seem somewhat overdone.

Thursday, December 03, 2020

Train journey

I was persuaded (coerced?) into travelling to Tel Aviv yesterday in order to induct a new employee. This is the first time that I have travelled by rail in the past nine months. I deliberately set off late (8:50 am - that's three hours later than my usual travelling time) so that there wouldn't be many people on the train. And indeed there weren't. One has to make a reservation for a particular train in advance (but no more than 48 hours in advance) so that the railway company can be sure that there aren't too many people travelling on each train. The compartment in which I set can hold somewhere around 80 people, I think. Yesterday there were four people in it. 

Because I travelled at a non-peak hour, I had to wait for 50 minutes for a connecting train, instead of the normal 5-10 minutes which was very annoying. Coming back, I had to wait for a 'mere' 20 minutes, but there were more people on the train. One has to wear a mask all the time in the stations and on the train, of course. One is also not allowed to eat on the train (I started eating a pear but was cautioned not to do so by the conductor).

Verdict? It's definitely possible to travel by train but at the moment there's no overwhelming reason to do so.



Tuesday, December 01, 2020

Viva result

As I noted in an earlier blog, there are five possible outcomes of the viva:
  1. to award the degree as is
  2. to award the degree subject to minor amendments 
  3. to require resubmission of the thesis with major amendments without a further viva 
  4. to require resubmission of the thesis with major amendments with a further viva  
  5. to fail the candidate.
Of these outcomes, the final one should never happen as the supervisor should only recommend the candidate to submit the thesis when it is complete in the supervisor's opinion. Failed theses are the supervisor's fault! The first outcome is very rare whereas the second is the most common. Of course, this outcome is the one that I expect like to have for my thesis.

Now onto the viva. My supervisor (who was 'present' during the entire Teams meeting but was not allowed to talk) said that I acquitted myself well: I wasn't belligerent, I didn't freeze, I didn't waffle and I didn't bluff. But as I have tried to say in the past, the viva is not examining 'me' but rather examining the thesis: why did you do this and why didn't you do that?

I was prepared for that type of question, but I wasn't prepared for the depth of some of the questions. For example, chapter 2 talks about ERP systems: it gives background, reasons for adopting ERP, the ERP life style, comparison of four systems and material on 'horizontal' software. For some reason, the external examiner thought that this was part of the literature review; no, I said, it's to give background. One can't talk about enhancing ERP systems without knowing what an ERP system is. Why did you only compare four systems? Maybe the material on horizontal software is not relevant? I explained why I chose those four systems; I also explained that I felt that if I had left out some of this material, I would have been asked why it wasn't there. You can't win either way.

To cut a long story short, the verdict on the thesis centered on two issues. The framework for developing and deploying enhancements appears "like a rabbit from a magician's hat" (as I put if after the examiners had had their pound of flesh) and does not follow on logically from the literature review. The methodology was not sufficient for their liking, lacking a validity stage.

I was given the worst possible result (apart from failure): either accept a lesser, compensatory, Master of Research degree (that no one has ever heard of, along with a loss of pride) or resubmit the thesis with major amendments, including obtaining new data on the basis of a revised methodology, followed by a further viva. There is no guarantee of passing even after this, and failure here means complete failure (probably with the compensatory degree).

I was stunned; my supervisor was also surprised. My initial comment was why didn't the research committee and the final review pick up on these topics? After the viva finished, my supervisor and myself had a brief chat via Skype; obviously no decisions should be made until the examiners' report is received. He thinks that I should be able to finish the necessary work in under a year.

I took the dog for a walk and considered my position. The best way of looking at things is that I have submitted my thesis to another research committee review and it has been found wanting. The examiners will present a report of what needs to be fixed, so I can work according to this report and create a new thesis that should answer their requirements.

When life gives you lemons, make lemonade.

[Addendum] I neglected to write that the examiners thought that the topic was very interesting and (for some reason) timely. What they didn't say (in my words as I am assuming this) is that it's a shame that it was ruined by poor methodology.

About the research committee: the document that they saw was upto and including the literary review and synthesis along with a certain amount about the pilot study that had yet to take place. If there is any blame to be placed, it is on the review from a year ago. But even then, the reviewer did not see a document resembling the final thesis, which had doubled in size over the past year.

E-hour minus 4

My doctoral viva will start in another four hours. There isn't very much that I can do in terms of preparing material; it's more a question of being in the correct frame of mind. At today is the first of the month, I had several monthly reports to prepare, but as soon as I finished them (remarkably early) at 9:30 am, I came home.

I have just returned from taking the dog for a walk; my headphones were playing songs by Peter Hammill, and as I completed the walk, the song 'Confidence' began. A remarkable co-incidence! Times have changed somewhat since March 2011.

I'm going to read my DBA blogs to get me in the right mood, then I'm going to reread the thesis for what is probably the thousandth time. It certainly won't be for the last time as I assume that the examiners will require some changes, hopefully only minor.

Sunday, November 29, 2020

New favourite drink

A few months ago, I discovered that Israeli dairies are now selling a low lactose version of chocolate milk; this has 49 calories/100 gram, whereas non-flavoured low lactose milk has 50 calories /100 gram. In other words, the addition of the chocolate does not add calories, as opposed to when I make chocolate milk at home, as the chocolate powder is full of calories.

I started off with a modest two bottles (2 litres) a week but I didn't like rationing myself so I started buying 4 bottles a week. My wife has started drinking it occasionally as well as giving some to the grand-daughters so sometimes even 4 bottles doesn't seem enough. There have been weeks when there was no chocolate flavoured milk on the shelves so I bought the equivalent banana flavoured milk. I thought that I would prefer this but the taste is more synthetic and seems sweeter even though it isn't.

On Friday, which is when I make my weekly purchases, I saw that there weren't enough bottles of chocolate milk on the shelf, but there was one of 'nut choco'. In my naivety, I though that this was 'milk' made from nuts (in the same way that there is almond 'milk') with a chocolate flavour, so I was slightly surprised when I saw that it contained 99% 'real' milk. In other words, it's the same chocolate milk, but with an added nutty flavour. As I find the regular chocolate milk slightly lacking (the initial taste is chocolate, but the after-taste seems thin), this addition is very warmly received. It's now become my favourite cold drink; I wonder whether I will be able to buy another bottle during the week. 

As this flavour comes from a different dairy, its calorific content is slightly different (51 calories/100 gram) but not significantly so. Intriguingly, it's also cheaper; the regular chocolate milk is 136% more expensive than regular low lactose milk (13 NIS as opposed to 5.5 NIS), whereas the nut version (different dairy, remember) is about 100% more expensive. Maybe this is for an introductory period only; I'm going to take full advantage of this.

And by the way, I'm losing weight again. There were two weeks with a negligible 100 g loss, but on Friday I measured 500 g less than the week before, choco or no choco. The heavy walking seems to be paying off finally.

Friday, November 27, 2020

Preparing for the DBA viva

Today I had two video calls in preparation for the viva that will take place in another few days.

The much more important call was with my supervisor; I thought that we were going to have a mock exam but he started off by saying that there is no point in him improvising questions because probably the examiners will ask something else. He then continued to say that the examiners will not be 'out to get me' and will not ask questions such as 'what did you mean by ... on page 32' and similar. Instead, I should think of the exam as a discussion between colleagues. 

One interesting point came out of our discussion today: I feel that I older I get, the more open I am to compromise. There is a lack of 'ego', something that will be very important in the viva, but also in my research itself. I wrote about this in the thesis, albeit in different terms, when I discussed the confirmation bias. Frequently people who 'research' subjects are open only to ideas and statements that strengthen their point of view/beliefs, or as it is commonly put, they only hear things that confirm their original position. In the thesis, I state that I tried to be as free as possible from this bias, in that other people's ideas can strengthen the 'product', whether it is a thesis or an enhancement. The idea is to create the best possible product, utilising everybody's ideas. As I have written sometimes at work, I don't have a monopoly on good ideas. People start from different viewpoints that lead them to differing and sometimes surprising endpoints, and it is often my job to incorporate these various ideas into a whole, introducing a certain amount of synergy.

So, unlike some doctoral candidates (apparently), I am open to whatever suggestions and/or corrections that the examiners may have. We are trying to improve the topic, without regard to who suggests what. I think that anyway one has to lose one's ego to a certain extent when the entire doctoral process begins with the supervisor suggesting various options and changes.

My supervisor advised me to enjoy the experience as it is going to be the only time in which I can talk at great detail about my research with people who are interested in what I have to say. 

I said that I doubt that I am going to feel very nervous about the exam: first of all, I will be in my own home and so the surroundings will not threaten me. Secondly, the fact that I cannot fail removes a great deal of pressure; my supervisor mentioned one student who did fail, but that was because he was not prepared to take anyone's advice, not least the examiners'. I am going to view the viva like a meeting at work, when I try as much as possible (and not necessarily successfully) to lose myself in the subject and not get mired down in my personal agenda. 

The less important call was to the DBA administrator; this was mainly to check that the Teams software (which will be used for the exam itself) that I installed on my computer works properly. We use Teams at work, but that is within a closed user base, whereas here the meeting is a one off. From what I happened, I see that it is best to open Teams (it takes a long time to load completely) before clicking on the link to the meeting instead of doing it the other way around. That's the reason for having this call! 

The administrator closed off by saying that he would see me on Tuesday and that I should try to enjoy the experience as it is going to be the only time in which I can talk at great detail about my research with people who are interested in what I have to say. Does that sound familiar? True, I copied and pasted that sentence, but he did in fact repeat almost word for word what the supervisor said. This must be the party line, in the same way that the text says that 'the doctorate teaches one to become a researcher', and not a world expert in some arcane subject, as public belief would have it.

On to Tuesday! 

Monday, November 16, 2020

Vinyl log #32

Day Month Year Artist Title
16 November 1970 Heron (eponymous)

I've written here and there about Heron, the one penny tour and their first record. Today we can celebrate 50 years since I purchased it.

At the time, there was a company that was selling records by mail order; on every purchase one would receive a certain amount that one could utilise in order to buy more records. Being very young and callow, I thought that I could use this amount at the same time as buying records, but the company said otherwise. I remember that I ordered several records - the three record set of 'Woodstock', 'Watt' by Ten Years After, 'Full house' by Fairport Convention and 'Heron', having just seen them. I don't remember now which record became the free one, but I do have a memory of trudging through snow, meeting the postman and asking whether he had a record for me - quite trusting of him. This was 'Watt'; after listening to it, I was severely disillusioned and never listened to TYA again.

But Heron! My original favourites were 'Harlequin 2' and 'Lord and Master', but the second became unlistenable when my record player had 'an accident' and the record became scratched. These were the days of the stackable record player where one could prepare a few records to play and the autochanger would drop each one down in turn. After I ruined two records in this way (Sandy Denny's 'North star grassman' was another casualty), I stopped using the autochanger.

I found this record captivating, but I don't think that I truly appreciated it until I bought the cd and listened to it via headphones. One of the selling points about the record was that it was recorded in a field and so everything (or nearly everything) is recorded live. I can hear a few overdubs in 'Harlequin 2' but they don't really disturb me. It's so live that when Gerald Moore plays some acoustic lead guitar, he stops singing. That said, I've never figured out which guitarist is playing what on 'Upon reflection'.

For me now, the highlights begin with what was the last song on side one, 'Upon reflection', carrying on through 'Lord and Master' (no scratches now!) and culminating in the sublime 'Little angel', although I have to admit that the lyrics of this latter song leave me scratching my head as they don't seem to make too much sense ("so I won't ever know what it is you've been missing"). I love the way that the three singers trade lines between themselves (now that I think of it, this was a feature of The Band), and once, when writing to Steve Jones their keyboard player, I said that Heron could have been the British equivalent of Crosby, Stills and Nash!

My memories of listening to this record are combined with the winter camp of 1970 about which I will write no more, save to say that they are very happy.

Unfortunately, Heron's second album was a disappointment but I have always treasured this jewel of an album and frequently listen to it even now.

Saturday, November 14, 2020

Cold Feet, series 9

This veteran series, which I loved, crept back into our lives two weeks ago with the opening episode of series 9. I wasn't too impressed by that episode, but the second episode that we have just finished watching was something almost extraordinary.

First off was the appearance of the great Sunetra Sarker, better known in our family as Dr Zoe Hanna from Casualty. I wonder how many of the people watching this episode know that this is not the first appearance of Sunetra in CF: she had a brief appearance in series two as a possible one night stand with Adam. Maybe she foresaw her medical career with the statement "I'm not going to kiss those" (referring to Adam's testicles) which were black: Adam was then diagnosed with testicular cancer and if I remember correctly, underwent a partial orchidectomy (such a lovely word, such unpleasant connotations). Presumably she is going to have some form of relationship with David; initially a business relationship, but who knows where it might lead.

Even more surprising was the appearance of a young woman in the local court; just by chance Adam happened to be in the public gallery. She seemed familiar to him and eventually he realised: she was a girl that Adam and then wife Rachel (Helen Baxendale) were going to adopt as they could not conceive. As soon as the adoption went through, Rachel became pregnant (with Matt) and so they had to give up the adoption. We even saw a few images of Rachel - she was the best character in CF. One can assume that Adam will make contact with this woman in an attempt to atone for the fact that he did not adopt her ... and so her life did not improve and she ended up selling drugs, hence her court appearance.

Talking of best character, I have been impressed by the character of Pete. He was always at the butt end of everything: not the smartest, not the wittiest, not the most successful. He really has grown and showed in this episode his attention to other people. David's character has also improved over the years, whereas Adam has stayed near enough the same, if not regressed.

I write about these characters as if they were real people: a sign as to how much they have entered my life.


Another television series that promises to be more than worthwhile is 'The Undoing'. The series is based on the novel 'You should have known' by Jean Hanff Korelitz. I am reading the book at about the same pace as the series and it is interesting to note that the entire first chapter of the book, which is about Grace's book ('You should have known'), is not referenced in the series, at least not in the first episode. 

Grace is a marriage counsellor/therapist and the (fictional) book is based on her experiences with women who should have seen signs of incompatibility with their future partners but ignored them because they were dazzled by other features, or the fear of being alone was too great (I can understand this from personal experience). Of course, in the book by Korelizt, Grace also should have known various things about her husband. 

I purposely haven't read much more of the book as I want to see the television series unfold, but I have a good idea about what is going to happen.

The backdrop of rich, upper East Side women and social comparisons is somewhat tedious and I hope that this is going to disappear. Also, the book is set against a mild backdrop of Judaism that might cause some readers a degree of non-comprehension; this appears to be dropped in the series, not least because Grace's surname has been changed from Sachs to Fraser.

Thursday, November 12, 2020

Date set for doctoral oral defence!!!!

 

The first of a month is never a good day for me as I have several monthly reports to prepare in the morning. But I should be free by 11 am, which is 9 am GMT. 

So it's time to hit the thesis and learn it backwards. I have been looking at it on and off over the past few weeks but I haven't reached the meaty part - the methodology and the results - basically chapters 5-8. My supervisor also received notice so no doubt we will be scheduling a mock exam for next week.

Thursday, November 05, 2020

First rain

For the past week, the weather forecast has been predicting heavy rain on Wednesday/Thursday - and they were right! A few drops fell on Tuesday evening but these were just the preliminaries. It started raining, not particularly heavily, on Wednesday morning, but this cleared up after a few hours, and by the time I drove home in the afternoon, one wouldn't have known that there had been rain at all.

At around 7pm, rain started to fall ... and fall ... and fall. When the news wasn't concerned with the US elections, it was showing pictures of two coastal towns that were already suffering from flooding (this happens every year and nothing ever seems to be done about this). There was heavy rain in our area that continued throughout the night.

At about 11:30 pm, I awoke. I'm not sure whether this was due to the sound of the rain falling on a roof or whether it was because I was having difficulty breathing - I think the latter. I took the CPAP mask off my face and then noticed that there was no sound of air rushing out of the mask; the machine didn't light up, either. In other words - a power cut. Typical: there are always problems with the electricity supply whenever it rains. A message then appeared on our mobile phones, saying that the problem was regional: not only was our entire kibbutz without electricity, the neighbouring moshav was without power either.

I tried to fall asleep but it was difficult, what with the noise of the rain outside and a slightly blocked nose. Eventually the power returned at about 1:30 am and I was able to sleep.

The rain had ceased at some time during the night for there was no rain when I went for my morning walk at 5:30 am. True, there were puddles everywhere, but no water running down from the hill behind us. The rain and the power cut conspired to deprive the kibbutz of internet access so I couldn't access my mail. I assume that this is going to be fixed during the day because I have an internet meeting at 15:30 in which I will participate from home.

Presumably the lack of internet access is also preventing the kibbutz secretary from informing us how much rain fell during the night. 

Of course, there will be no more rain for another few weeks.


Edit: five minutes after writing the above, of course it started raining again....


Further edit: 44.5 mm rain fell during the last 24 hours on the kibbutz.

Tuesday, November 03, 2020

Overcoming the 'leading zero' leads to other problems with Excel

Just over a week ago, I detailed how I transfer strings that begin with a leading zero from my Delphi programs to Excel. Unfortunately the transfer mechanism causes problems with a different type of field: dates. Using the 'csv method', dates are passed as strings, so today's date should appear as 03/11/2020 (there's a leading zero here as well, but Excel knows that this isn't a number because of the slashes). The 'varArray method' has to format the columns prior to data being transferred: I use a constant xlDateFormat that is set to 'dd/mm/yyyy'. Surely this is correct as 03/11/2020 is dd/mm/yyyy.

But no: Excel seems to have a bug that causes the month and day to be swapped as long as the day is not greater than 12. So 12/11/2020 would appear as 11/12/2020 (American format) but the following day, 13/11/2020 would appear as 13/11/2020, which is apparently a month before the day that precedes it!

The initial solution was to use a different value for xlDateFormat: d/m/yyyy. This causes today's date to appear as 3/11/2020 which is much better than 11/03/2020 but still not totally correct. Writing this blog entry has caused me to wonder whether there is a better solution (drum rolls, please).

Counter-intuitively, the optimal solution is ... not to format date columns! 03/11/2020 appears as 03/11/2020. I live and learn.

Monday, October 26, 2020

I don't take any pleasure in being a Cassandra

I'm going to deviate from my normal topics for this blog and write about something at work, in the hope that I might better understand what has happened. 

Sometime around the end of March (when we were locked down and working from home), the factory in Karmiel took on a new worker whose job was never clearly defined to me, but turned out to be responsibility for improving work methods in the metal division, primarily with reference to Priority. In other words, this new worker and I interfaced on many levels. He came with a background of working in other companies in similar areas so presumably knew a thing or two.

Almost immediately came the clashes between us. He wanted to change almost everything regarding how the metal division is implemented in Priority (processes, actions, work centres, warehouses) as well as how the reporting itself is done. Whilst some of the changes were necessary and overdue, some of them seemed unnecessary and would lead to the imposition of even more overhead than exists today.

My biases are already becoming apparent in that previous sentence: something with which I agree is fine, but something with which I do not agree is unnecessary. Several times I tried to persuade this employee to write a complete business plan so that it could be scrutinised and criticised but this never happened. During the single day (in June) that I spent in the Tel Aviv offices since March, I had a meeting with both my manager (the CFO) and the managing director, trying to explain why some of the proposed changes were not good. In fact, they were not proposed, they were already on the way to being implemented. The Karmiel factory manager also participated in this meeting - he had been charmed/seduced by this new employee and was prepared to back every single move. Their attitude was that I was complaining due to 'sour grapes', that this new employee would succeed where I had failed and because of this, I was determined to bring him down, so that he would not be more successful than I.

Is this true? I sincerely hope not. Throughout the months that followed, I tried very hard to separate any personal thoughts that I might have had from professional criticism. I was forced to complain a few more times - especially after blitzes of emails - and was told that it is good that there is someone who is trying to move this most stubborn division forward. I cannot disagree with this aim, but there are ways of achieving this.

This person several times told me that he was a "bulldozer" and would succeed in both passing his reforms and getting them implemented. I have kept on the sidelines for the past few weeks, not because that I am trying to show that I am waiting for him to fail, but because I want to let him have a free run, letting others make the criticism. Does this mean that I am waiting for him to fail?

Anyway, yesterday I was very surprised to receive an email from my manager telling me that this employee had decided to quit at the end of the month.

How am I supposed to feel? To gloat over the fact that most of my predictions came true? I don't take any pleasure in being a Cassandra. So much for being a bulldozer who sees projects through to their end. I don't what the reasons were that caused him to quit - they may be entirely personal reasons with nothing to do with his job. It doesn't really matter; what I want to know is who is going to pick up the pieces and continue with all his changes that are in mid-flow, or who is going to revert them to how they were. At the moment, changes in processes, etc, are causing more problems than they are solving.

I don't want to say to anybody "I told you so" but maybe I don't have any option. There is nothing to be gained from doing so, but this is going to be very hard to escape from if I am the person who will be required to assess the damage (I don't see that any progress has been made).

There is supposed to be a meeting held today, one of a series, whose topic is improving the output of the factory. Most of the time the discussions are about the arrival and installation of new equipment and the changes that these new machines will cause to our work methods, but I have no doubt that time will be devoted to this change in personnel. Due to a pressing personal reason, I cannot participate in today's meeting. It has happened before that meetings have been rescheduled because I couldn't participate at the given date or time, so it might be that this meeting will be rescheduled for the afternoon.

As always, wait and see.

[Update from a few hours later] The meeting has indeed been rescheduled for Wednesday.

I thought it appropriate to give an example where my well- meaning advice was totally ignored. The person wanted stations on the shop floor to report production as they finish each job (good). To this end, he requisitioned a computer for each station, each armed with a bar code reader, and connected to the wired network. At one stage it appeared that each station would require a separate Priority license as well as a network license. A few months earlier, I had implemented a similar system for on-station reporting using wireless bar code readers that would broadcast their barcodes to one central computer; each message that the readers would send would include a prefix identifying the reader (in other words, the worker). This solution would be cheaper and easier to implement (in my humble opinion); this suggestion was totally ignored. It rose again in a meeting a week or so ago when one manager had visited another factory and saw how they were reporting, using wireless bar code readers. Why should 'the person' ignore this suggestion? Because someone else suggested it? Because I suggested it? Maybe this suggestion can be used now that he is going.

Friday, October 23, 2020

Overcoming the 'leading zero' problem in Excel

I see that I haven't written on the topic of Excel and automation for two years - I must be doing something right. In the management program that I wrote (and always extending) for the OP, there is frequently a need to output data to Excel. In order to facilitate this, I wrote a few standard routines that extract data from some form of query (this could be a clientdataset, an SQL query or a 'simple' query, hence the need for a few routines): these extract the data and output a CSV file along with column headings. Another routine is then called that inputs the CSV file into an Excel spreadsheet and displays it.

There is a well known problem with Excel - fields that appear to be numeric but are actually alphanumeric have leading zeroes truncated, as Excel 'thinks' that the field is numeric. In the OP's world, this problem applies to identity card numbers: many (including mine) begin with a zero (mine begins 0176), and when a csv file with this number is inserted into a worksheet, the field displays 176. Until now this hasn't been a problem, but a new (and somewhat nasty and patronising psychologist/analyst) has been working on data output from the management program and it annoys him that the leading zeros from identity numbers are being dropped.

My first solution was something similar to what Priority does: surround the field with quotation marks. I innocently thought that Excel would not display these marks but that's not the case. My 'solution' probably annoyed this psychologist even more as now he had to contend with strings like "0176". I had to find another solution.

Theoretically the problem could be solved easily by formatting the column that would hold the identity numbers, but this is a chicken and egg problem: formatting the data after it has been read in doesn't help as the leading zero has already been stripped, and formatting the column before reading in the file doesn't help because a new sheet is always created with the data. I thought that I might be able to hack the problem by including a non-displayable character before the string but this didn't work either.

Excel does have a method for inserting data into an existing spreadsheet - I used to see this frequently when trying to input text files - via a wizard that helps the user to insert the file correctly, handling character sets and delimiters with ablomb. I recorded the process as a macro but there were too many problematic statements for me to translate into the required Delphi format so I discarded this approach.

Then I remembered that I already have implemented a solution - the varArray approach. This allows one to create a sheet, format its columns then input the data in an 'underhand' manner. I adapted the code that I already have in one module to the module where I need it, and lo and behold, the leading zero problem had been solved.

I then removed the new code from the module and inserted it into the same general utility module that contains the other Excel routines. This required a few minimal changes and now there is an alternative method for exporting to Excel that both solves the leading zero problem and doesn't require an intermediate file.

After I reported on this improvement, the annoying psychologist condescendingly wrote to me to make sure that nothing else has been affected by this change. Obviously he's never heard of modular code.

Thursday, October 22, 2020

New bass guitar

Slightly over three years ago, I wrote about the semi-acoustic bass guitar pictured on the left. Some time after this picture was taken, I noticed that the side of the guitar was beginning to separate from the top. When eventually I got around to looking for a luthier to repair the damage, the whole body was falling apart. Thirty years the guitar lay dormant under my bed with no damage but a year hanging on the wall ruined it. I quickly removed the guitar and put it back under the bed but I doubt that it can be repaired now.

So the space on the wall became vacant. At various stages the 2019 bozouki and one of my mandolins have occupied this slot. Over the last few months I've bought a few new (to me) instruments and something told me that maybe now is the time to buy a 'proper' bass guitar. 

There are two main sources for buying instruments in Israel: one is a company with maybe ten or more shops throughout the country (I bought the Fender 12 string from one of the branches). I had a look at their web site, but the basses displayed there were far too expensive for my modest needs. Maybe they have cheaper items in the shops but I'm not about to visit one (because of the Covid lockdown that has now be relaxed somewhat). There is a music shop in Bet Shemesh but I don't know whether they are open let alone whether they have a suitable instrument. The other main source is a company whose main shop is in Jaffa - I bought the Washburn semi-acoustic here. Their web site was much more promising, with a variety of basses suitable for any pocket. They also offer a 40% discount and no delivery charge, making their goods very attractive.

After some deliberation, I plumped for the bass pictured on the left. It's branded Encore and is made in China but seems eminently suitable. It cost only 500 NIS, which is less than $150. We can spend more money that that in the butcher's. Although the web site said that delivery can take up to 14 days, it arrived three days after being ordered. Presumably they have the guitars in stock and are willing to sell at slightly above cost price in order to have some form of cash flow in these problematic days. They also sell 7/8 scale basses that are even cheaper and might be even more suitable; had I been in their shop, I would have tried both sizes, but I thought it more prudent to buy a full scale bass.

After tuning the guitar (it was slightly flat compared to the piano), I played a bit on Tuesday and a bit more yesterday. It's very easy to play the bass, but I have one small problem (or as my CEO would say, one challenge): because the scale of the bass is longer than a guitar, the distance between frets is greater. I am unconsciously fingering the neck as if it were a guitar, and as a result my fingers often land too far behind each fret, causing the string to buzz. Of course, I'm playing without looking at my fingers: if I paid more attention to the scale then I'm sure that my fingers would press the strings just behind each fret. I imagine that this would be less of a challenge had I bought the short scale bass.

As for the wall on which the new bass is hung: at first I hung the bass where its predecessor had been, but because the headstock (where the tuning pegs are) is longer, it was almost touching a shelf that had been added above the guitar. After thinking for a few minutes, I swapped the bass for the Gibson SG copy bought in 1976 that has a shorter headstock.


Tuesday, October 20, 2020

DBA update

Finally some news! The DBA coordinator informed me a few days ago that a tentative date for my viva exam has been set - 26 November. Apparently the external examiner had been unwell for some time (I don't know whether this was due to Covid-19 or something else, and it doesn't really matter).

Coincidentally, someone approached me via LinkedIn: it transpires that this person completed his doctorate at EBS earlier in the year, with his viva taking place via Zoom (or similar). When I informed him that I now have a tentative date and that I was going to start rereading the thesis, he pointed out that the examiners will probably ask about things that aren't in the thesis.

As it happens, I spent a few weeks at the end writing about topics that might have been expected to appear in the interviews but didn't (section 7.6, data lacunae) as well as hindsights obtained after completing the research and thesis (this section refers to section 7.6), so these sections should be good preparation.

Incidentally, the person from LinkedIn has chosen an unorthodox abbreviation for his doctorate: DrBA instead of DBA. This is a good idea as it differentiates between a DoctoR of Business Administration and a DataBase Administrator. In my line of work, I'm more likely to encounter the second type of person.

Saturday, October 17, 2020

Completing the story of porting an application to Windows 10/Delphi 10.2

The previous installment of this story had the application displaying people's names in unicode and allowing them to be edited. This means that the remaining parts are to read in the INI file that contains the answers from the user and then display them, via HTML and thence to Word.

Initially I tried saving Russian text into the database table via the database manager program, outside of Delphi. This was spectacularly unsuccessful so eventually I created a new database with the same structure but with the default charset UTF8. I then copied (by means of a simple program that I wrote) all the data from the old database to the new database, using the 'cast' trick (cast (surname as varchar (16) character set unicode_fss)) wherever necessary. I then renamed the original database to 'OldWhoAmI' and renamed the new database to 'WhoAmI'. Then I unregistered both databases from the database manager then registered the new one. This version allowed the saving of unicode text, especially Russian.

Once the database issue had been settled, it was much easier to continue porting the application. I restored the 'edit person' screen discussed in the second episode of this series to use data aware components; there was no need for tricks using 'cast' as the text was now unicode. Reading the data file, including Russian, required no changes that I can recall. 

Creating an HTML file that could be sent to Word required a few changes. Until now, I have been using the 'AnsiToUTF8' procedure whenever I wanted to output Hebrew; this is now superfluous so I had to remove all these calls. I also had to update all the Hebrew that was embedded in the program code. Once I had an HTML file that displayed correctly, I tried to export to Word; I received a mysterious error message, informing me that my file could not be found. Initially I thought that this meant my HTML file, but then I realised that it meant that the template could not be found. Once I updated the template, I could export the data to Word.

Conclusions for next time:

  1. Create a new database with the same table structure but with the UTF8 charset. Copy all data, using casts wherever there is Hebrew text.
  2. Register the new version of the database in the database manager (this isn't essential but it helps).
  3. Save the database in a specific directory.
  4. Porting is fairly simple. AnsiToUtf8 calls should be removed when HTML code is developed.


Friday, October 16, 2020

PrioXRef 3 - insert without parameters

Every day I've been checking the Priority cross referencer and fault analyser (XPrioRef) against a variety of my own procedures and every day I've come across new constructs that have to be handled. Yesterday I came across a real doozy (as Ned from 'Groundhog day' would say):

INSERT INTO PART SELECT * FROM PART ORIG WHERE PART = :PART;
For those who aren't au faire with SQL, this means 'insert into the (linked) table PART all the fields from the real table PART for all tuples where the part number is equal to the variable PART. As the variable can only have one value, it means that only one tuple gets copied into the linked table. Statements like these occur when the linked table is about to be sent to an external procedure.

Until now, XPrioRef has handled two kinds of insert statements: INSERT INTO <table> (<fields>) and INSERT INTO <table> <alias> (<fields>). The above statement has no alias and no list of fields; as the character after the table name on the first line is not an opening bracket, XPrioRef thought that the next token (it's a 'top hat', ^, that signals the end of the line) was an alias, so there was a reference to PART ^.  There is also a problem with the line count at this stage. Then the asterisk in the second line (which in this context means 'bring all the fields') was parsed as punctuation, causing the parser to be even more bewildered.

Handling the asterisk was easy (the character after 'SELECT' is checked, and if it's an asterisk then it's swallowed) but handling the first line was not easy. The next token after ^ had to be read, and if it's SELECT, then the 'insert into' part has been finished and then 'SELECT' is handled. 

This is all very ad hoc, something that I had tried to avoid, but it seems that the confusing syntax demands this. Of course, within the SQL engine there is a parser that has to execute the statement; I'm only trying to list references and determine what is happening at the time of the reference.

After adding a fix for this kind of statement, running PrioXRef on the same procedure produced the expected output. Now I wait for the next misreference to appear.

Monday, October 12, 2020

Cardiologist

In July, I wroteDuring 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. It often happens that by the time I return home from work, my feet and legs are like two blocks of wood. Fortunately, exercise - walking the dog - helps, as do my sport shoes, so I don't suffer so much in the evenings.

The final stage in the diagnostic sequence was a visit to a cardiologist. He asked me all kinds of questions, looked at the list of medications that I take and examined the various test results. His opinion is that the swelling is a side effect of one of the medications for lowering blood pressure, and so his recommendation is to stop taking the medication. The daily swelling should cease in a day or two. Of course, I also have to monitor my blood pressure: if it starts rising then I will have to see my GP who will recommend new medication. It will be very easy to see whether his opinion is correct.

Sunday, October 11, 2020

Continuing the story of porting an application to Windows 10/Delphi 10.2

I spent quite a few hours on Saturday working on the application that I discussed here. I started off by working on the database again: I wrote a program that would export the forename, surname and primary key of all the records to an INI file (this is with Window 7/Firebird 1.5, so there are no problems with unicode). Once I had this data outside of the database, I dropped those two fields then redefined them, this time with WIN1255. I then wrote a simple program to repopulate these fields from the INI file. So far so good.

On to the mobile computer with Windows 10, Delphi 10.2 and Firebird 2.5. As I seemed to be unable to use the clientdataset component, I was forced to use a simple query to access the data then display it by means of a listview component. The 'cast' trick worked well and now I could display all the records. I worked on the code to filter these records, and when that was done, I worked on a screen in which the user can edit personal data. As I couldn't use the clientdataset component, I had to create a screen with non-data aware components; this means extracting the data from the database with a query component then loading the data into the appropriate edit boxes. Should the user decide to accept the changes, the data from the edit boxes would be written back to the database with another query. 

This update query was actually a piece of serendipity: when I edited a person's name then wrote the data back to the database (into a field defined as WIN1255), the field in the database became gibberish. Of course! The solution was to add two new fields to the database table defined with character set UNICODE_FSS; the update query then wrote the data to these two fields correctly. But that's not much use if I want to use the WIN1255 fields in the main screen, so I wrote a simple query that updates the WIN1255 fields with the data from the UNICODE_FSS fields cast as WIN1255 (i.e. the reverse of what I had done previously). This actually worked first time!

Then I faced the problem of updating the tree view with the new data: I used the same approach as I use with a grid, namely delete the current record, extract the data for the new record from the database then add it to the list view. This worked on the second time - because I forgot to delete the current node first time around and so caused a key violation.

Whilst walking the dog, I wondered about the clientdataset component: I'm sure that it worked at some stage before I got bogged down with unicode issues. I decided to remove the Delphi installation completely then reinstall; this took a fair bit of time, but once it was finished, the clientdataset component resumed working. So I saved the list view version of the program in a different directory for backup purposes then set about restoring the grid and db controls - this went very quickly. Due to the unicode issues, I decided to continue using the new version of the 'edit person' screen with its non-data aware controls; my approach wouldn't work well with data aware controls as the data is read from one field but written back to another field.

The next stage will be to see what happens when the unicode INI file containing the Russian text is read. I may have to defined duplicate fields with character set UNICODE_FSS for this data. Supposedly the database knows in what language the user completed the exam as there is a language field in the 'people' table, but this field is always empty. I shall ensure that this field receives a value when there is Russian text so that the correct field in the 'results' table will receive the text and eventually be displayed.

With regard to the clientdataset, I wonder whether fields defined in the program (i.e. using the component in 'standalone' mode, not connected to a database) are automatically unicode. This isn't an issue for this program but it will be for the next program that will undergo porting.

And here is the answer to my question about unicode (someone had asked before me): 

You cannot store unicode characters in a field with the ftString field type, you should use the ftWideString field type. Data disappears in a field with ftWideString field type because the size of this field is zero by default. To solve this problem, you should set the Size property of this field to the value more than zero.

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.