Tuesday, December 24, 2019

4 records @ 50

As the year 2019 draws to a close, I celebrate four records which were recorded in 1969 and still sound as fresh as they did then. In order of recording ....

The Beatles - Abbey Road. I don't have any recollection of ever sitting down and listening to this record at the time although it must have been played frequently in the background. The only real memory that I have is of someone on the kibbutz where I was in 1973 who used to play 'I want you (she's so heavy)' constantly. As I have written before about the Beatles, their songs used to creep in by osmosis. But when compared to the other records in this small list, they were no longer the kings of music in 1969.

King Crimson - In the court of the crimson king. I wasn't aware of this record until about February 1970 but it had an extreme effect on me - at least, side one did. Now more than then I appreciate the woodwind arrangement of 'I talk to the wind'; this is excellent as it stands, but is light years better than the early versions of this song which exist.

Fairport Convention - Liege and Lief. Talk about extremes: this record is at a completely different place in the music universe compared to the previous record, yet they were recorded within two months of each other. I don't listen to this enough these days. I saw on YouTube a few weeks ago a documentary about Fairport - or more specifically, about Liege and Lief, which reawakened my interest in it.

Van der Graaf Generator - The least we can do. This was recorded in four days at the end of 1969 and is a companion piece to King Crimson, as I've written before. I heard this in its entirety a few days ago; the first two tracks are still as powerful as they ever were, whereas the other four songs pale in comparison to VdGG's later work (especially 'Godbluff' or 'Pawn Hearts') - but they're still better than the crimson king!

But in 1969, I had yet to hear any of these records (except for maybe 'Abbey Road'). I had my first guitar and was beginning to learn how to play it. I took it with me to the five day winter camp which would have started just before the new year. One of the leaders had brought an Israeli record which they played quite frequently, from which we learnt two songs. The first was about Russian Jewry, which was starting to become an issue at this time. The second was a song about peace, but what was striking about it was the excellent arrangement - already it seems that I had an ear for this. I worked out the chords (they weren't too difficult) but for some reason was relegated to playing 'bass guitar' when some of us performed the song at the closing party. We weren't to know at the time but the instrumentalists were to metamorphosise into the excellent Israeli group, Kaveret. When my parents went to Israel for the first time in April 1970, I asked them to buy this record for me (somehow I knew what it was called and who it was by).

Years later, I realise that the best song on the record is neither of the two that we played all the time, but rather the title song of the album - בהיאחזות הנח"ל בסיני. Over the past few months I've been working now and then on an arrangement of this song which I intend to present at next year's Yom Kippur evening. I've been working mainly from my memory of the song, which makes it slightly different to the YouTube version. I also found what seems to be a demonstration version by the song's author which is far worse than the YouTube version. 

This song is very interesting, both lyrically and musically. Each verse starts off with the author 'seeing' something, except that every verse uses a different verb. The song mentions 'Good old Israel' which I don't remember being a concept in 1969, although of course, I'm not an expert on this. Musically, each verse has a slightly different structure, which maintains interest. Even more interesting is that the most dominant chord in the song (which is played for maybe a third of the song) is a minor 6th chord, which is normally very sad and somewhat dissonant.

Friday, December 20, 2019

Another black Friday

As I was returning from my early morning walk with the dog, I met a fellow kibbutz member who told me of the death of one of our neighbours, Etti Kormes. I knew that she had been very ill and hospitalised, but I had been given to understand that her situation had improved as she had returned home from hospital. "So young", said the member, "only 71". Her funeral will be on Monday afternoon.

After telling my wife about Etti, a message came through on the kibbutz WhatsApp group: another member (Teo) had died. He was much older, whose eldest child is in her fifties; I accompany her singing at Pesach. As it happens, I referred obliquely to this member while writing about the funeral of another member: he is the "elderly kibbutz member who rambled". His funeral will be on Sunday afternoon, which is also the first candle of the Chanuka festival. It won't be a very festive festival.

Such is life.

Saturday, December 14, 2019

Sour grapes (Song festival 2019)

Let's say that you're sixteen years old and a member of the closely knit and highly supportive youth population of the kibbutz. There are two songs presented by members of this population in the song festival and you are allowed to vote for two songs. Who do you vote for?

Thus it was no surprise that with approximately 75% of the voting audience being under the age of 18, the two teenager songs came first and second (out of eleven). There were many older people in the audience but I suspect that many either didn't want to vote or couldn't understand how to vote (via a mobile phone application).

My song came last with hardly any votes. It's not surprising that I am bitter about the entire experience.

There was one other song which had a good chorus, but the ratio between verse and chorus was far too high which lessened the impact of the choruses. The other songs tended to wander around and were far too long. My song was concise and to the point.

I think that I proved my point about not wanting to sing my song; as I wrote six years ago: I don't like the competition aspect for two reasons: first, a kibbutz is supposed to be an egalitarian society and the idea of competition is supposed to be eschewed; secondly, people vote not necessarily on the merits of the song that they have just heard for the first time but more probably on the merits of the performance and also possibly according to family affiliations. The identities of the lyricists and composers were not disclosed till the end of the evening, but one could see who was singing; in certain cases, this could lead one to make an informed guess as to the identities of the writers. It's fairly clear that if I'm singing anything, it's going to be a song that I wrote.

I don't know how true the organiser's statement about having difficulties in finding singers (which forced me to sing) is true. On the one hand, one song was sung by someone who might still be in the army and learnt the song very quickly, giving credence to the organiser's statement. On the other hand, two songs were sung by trios (one person singing in both), several were sung by duos and only a few were solos. So someone could have been extracted from one of those trios or persuaded to sing two songs.

I'm fairly certain that someone called the evening a celebration; I call it a degredation. I feel much worse about yesterday than I did six years ago, because I felt that my song was very catchy and would have a good chance of winning had there been a level playing field.

The only consolations that I can take are
  • two performers told me on Friday morning that they couldn't get my song out of their heads after hearing it in rehearsal the previous evening. 
  • I sent the song to a few friends via mobile phone two weeks ago and they were very complimentary
  • while making a condolence visit a few weeks ago to someone whose mother had just died, this person surprised me by saying how much he appreciates the amount of time and attention that I invest in preparing songs for the Yom Kippur evening.

Tuesday, December 10, 2019

Business rules in a BPM screen

One can define rules in a BPM screen (the Priority documentation does not explain this acronym which I assume means Business Process Management) in the same way that one defines rules in screens. These rules generally allow users (or groups of users) to change the status of a document according to the value of named fields within the document; these rules can also prevent users from changing status.

I came across an interesting example this morning: in the Customer Orders BPM, there is a rule which allows members of a certain group to change the status of an order from 20 to 60 (the statuses themselves are not relevant here) as long as the 'product bundle' field is not CAD. I had to update this rule to prevent them also from changing the status if the 'product bundle' field is not GLASS. Although one can write a rule with three conditions, this can't be done if there are two 'not equal' conditions.

A translation of the rule into simple English would be: allow users of the group 'Engineering' to change the status of the order from 20 to 60 provided that the product bundle is not CAD and the product bundle is not GLASS. Let's test this rule in our mind: if the value of product bundle is 'Jim', then both conditions are true and so the user can change the status. If the value of product bundle is 'CAD', then one condition will be false, meaning that the rule fails and the user cannot change the status. The same thing happens if the product bundle is 'GLASS'. In other words, one can define this kind of rule as long as there are available conditions - unfortunately, versions of Priority below 19 provide exactly three conditions (I saw a demonstration of Priority v19 a year ago and I think that it allowed more than three conditions).

As it happens, the rule had a spare condition so I could have written the rule with two conditions checking the value of 'product bundle'. For didactic reasons, I am going to assume that there is only one condition available that checks the product bundle. In this case, a function has to be written, but it is somewhat counter intuitive. Here is the condition in simple English: check for equality between the order's product bundle and the value which gets returned from the following condition 'if the product bundle is GLASS or CAD then return ! else return the order's product bundle'. So, if the product bundle is GLASS, the condition checks the value ! against the order's product bundle, which fails, as would a product bundle CAD. 'Jim', on the other hand, passes.

In Priority-speak, the rule is
(:$.MODELNAME IN ('GLASS', 'CAD') ? '!' : :$.MODELNAME)
which is more concise than the explanation in English. 

Sunday, December 08, 2019

The new DVD: what I have learned in a week

First of all, the DVD is a Samsung SH895M model which is a pretty good machine. It comes with an internal hard disk with 250 GB capacity which can "record approximately 421 hours of video when in EP 8 hour mode". I don't need this capability as the Yes Max machine has the hard disk and can record two programmes at once.

The machine accepts both DVD+R and DVD-R disks, which is good as I have nearly 50 blank -R disks which were previously useless. Inserting a +R disk will cause the machine to format it whereas no formatting is required for a -R disk. At the other end of the recording process, finalising a -R disk will create a menu on the disk whereas a +R disk has no menu. I'm going to record the various tv shows which I have saved on the Yes Max (The Newsroom, Madam Secretary, etc) onto -R disks and record films onto +R disks.

I did succeed in connecting the DVD to the television screen via HDMI; I had to change the HDMI resolution to 1080i first. Unfortunately, the screen is displaying a message about problems with the HDMI cable which is annoying; I haven't found a way to solve this yet. I may try a different resolution and I may try replacing the cable (the current cable is very long, so a shorter one might be more successful. Also the socket on the television is problematic). At worst, this means disconnecting the HDMI and going back to a lower quality picture.

Today we had a short power cut which taught me several things. First of all, the DVD's clock had to be reset - not important and not a problem. The major problem was that the DVD had to have its input redefined to use the AV2 socket; theoretically this should be simple, but as both the DVD and the screen are made by Samsung, the DVD remote affects them both! This can make certain actions easier, but setting the input is not one of them. Every time I pressed the 'source' button, the source on the screen would change, not the source to the DVD. In the end, I turned off the television screen and pressed 'source' a few times until AV2 appeared on the tiny DVD screen. Then I turned the television back on.

One thing which I haven't discovered how to do yet is give each recording a separate title (e.g. S3E1). This isn't too important as I can title the entire disk, but it would be nice to know. It seems that there are certain functions (such as this or setting the recording format) which can only be accessed via the remote control. I think that this is a bad design and it would have been better to put these definitions in the control program of the DVD.

Friday, November 29, 2019

A 'new' DVD recorder

At the beginning of 2019, we got a new Yes Max receiver which connects to the television via an HDMI cable, giving us a good quality picture. Once this was connected up, the television would display a strange message about HDMI when the DVD recorder was the input source. As the receiver was connected to the recorder and the recorder to the television, I assumed that the message meant that it was no longer possible to record from the Yes receiver to the DVD recorder. As a result, the DVD recorder lay dormant for a long time.

About two months ago, I decided to buy a small DVD player so that we could show our grand-daughter animated films when she comes to visit on Saturdays. The player came with an HDMI cable, and though at first I had problems getting a signal on the television screen from the DVD, eventually I succeeded. The screen would display a message about problems with the HDMI cable, but the impression that I got was that there are problems with the screen. 

It then struck me that this was the same message that I was getting at the beginning of the year when I tried connecting the DVD recorder to the screen. As the DVD recorder doesn't have HDMI output, I ordered a converter from RCA to HDMI which should allow the recorder to connect. When the converter arrived, I had no luck with it, but I was able to connect the DVD to the screen via the old RCA cable. 

Then I discovered that in the months of misuse, the disk drive had stopped working. It was unable to format new disks and was unable to play prerecorded disks. One should remember that the disk drive within the recorder has already been replaced once, and so it was likely to fail again. I didn't fancy dealing again with all the problems that I had and so gave up the idea of getting the DVD working again.

After vainly looking for DVD recorders on the Internet, it struck me that I might be able to find one via Ebay. I ran a quick search and discovered that there were several used machines available via auction, so I participated in one and won! The cost was about £30, but postage was about £40! Even so, it would be well worth the money. The seller was a hospital charity shop who probably deserve every penny. I wonder how long this machine is going to last.

The machine arrived the other day but only today did I have the opportunity to collect it from our local post office. After opening the extensive packing, I discovered to my dismay that there were several output sockets but no real inputs; the only input in was via a SCART socket. Fortunately I still have a few SCART cables, so I connected on end to the DVD and the RCA sockets to what I assumed were the output sockets on the Yes Max. I then connected an HDMI cable from the DVD to the screen.

To my surprise, I had chosen the correct sockets on the Yes Max, but the screen was showing the usual message about problems with the HDMI cable. This is when I finally realised that the problem must lay with the screen and not with the machines or the HDMI cables. Eventually I took another SCART to RCA cable, connected the SCART end to the DVD and the RCA to the screen. Now the Yes Max is connected both directly to the screen and to the DVD which then connects to the screen.

I put a new disk into the DVD player which automatically formatted it! Then I started recording the first of several films and television programmes which have backed up over the year. We're back in business! 

Wednesday, November 27, 2019

Song festival 2019 - 2

I conducted a series of WhatsApp messages with the festival organiser the other day. Apparently he is having difficulty in finding enough singers for all the songs and so asked me whether I would be prepared to sing the song that I wrote. I told him that I preferred not to, so that the song would not be identified as by me - if there's going to be voting then I would prefer that the song be anonymous. In the end I acquiesced and agreed to sing the song.

Or rather, 'sing' the song. There aren't going to be any live musicians - everything will be sung to prerecorded accompaniment. This allows me to do what I did several years ago - record the vocals in advance and mime on the night. If I am going to sing, then I want that the song be slower (it was recorded at 110 bpm) and in a slightly lower key. The slower pace allows me to change the phrasing of the tune slightly, for the better.

Yesterday I started on a new arrangement for the song, where about 50% of the original notes played remain. The new arrangement is simpler and I've removed a few instruments. I thought that I would start with just half a chorus (the chorus is a four bar phrase played twice), but then I remembered that I wanted to force the chorus on the audience which is why it was played twice. Thinking about this on the way home, I decided to remove the four bar introduction and replace it with one bar from the coda.

My headphones are currently playing early Beatles songs that I hear when walking the dog; it struck me that I could paste in the final five chords from 'Please please me'  as the coda - no one would know any different and it sounds different. It took a bit of work to find the harmony parts for the two flutes, but that's all done now. This sequence (C Eb Ab G C) doesn't sound as strange in my song as it does in 'Please please me', because the last two chords of the verse and the first chord of the chorus are also Ab G C (or at least they would be if the song were in C; it's now in Bb).

I'll probably record the vocals on Friday or Saturday; in fact, I'll have to as the festival is probably next Friday night.

Thursday, November 21, 2019

Thesis update

I last wrote on this topic just over two weeks ago. It took me more than a few days to start work on revising the thesis following the review, as the mild viral infection was replaced by several migraines. The last ten days have been very windy and very dry and these seem to be ideal conditions for migraines. I made a doctor's appointment for last Sunday: she checked me out, but everything seemed to be ok. The only way to get through the migraines is to take the pain killing pills as soon as possible and to grin and bear it. Today has been fine.

I had a chat with my supervisor on Monday when we went over the review. The most important thing for me to find out was the degree to which I have to follow the reviewer's comments. I quite agree with some of his comments but strongly disagree with other comments. "That's fine", says my supervisor, "as long as you explain why you have chosen to present the material in its current format".

Last weekend I spent some time on the first chapter, moving certain topics out into the literature review, throwing out one section which seemed unnecessary, and moving other sections around in the chapter. To continue my music analogy, I was 'playing with the arrangement' in order to achieve a better flow.

This was emphasized by the supervisor: structure the material as if you are telling a story - and not in the post-modernist style of having flashbacks and flash-forwards in order to complicate matters for the reader. The goal is simplicity combined with explanations.

Part of my problem is that the introductory chapter was based on my original research proposal, which is supposed to be based on literature references with little personal input. If the main question of the reader now is "why (are you telling me this)?", then the original question was "who says?". But now I can write unfettered from these demands. So I added at least another page if not more to the introduction, explaining why the research is important; also, what is novel and what is original.

An idea crept into my mind whilst walking the dog at 4:40 am the other morning; this material found its way into the introduction, contributing almost another page. Then I had an idea for the introduction to the literature review.

This section began with a perfunctory paragraph stating which topics would be covered along with the vanilla statement that these topics were chosen as they are relevant both to the use of ERP in SMEs, and to the management of ERP enhancements. My idea was to replace this with a paragraph on each topic in the literature review, explaining at length why each one was included. Some were marked as being background material and one was took a leaf out of textbooks by being marked as 'one can skip this material on first reading'. Two simple paragraphs were replaced by two pages of meaningful material.

This is what I want to continue doing throughout the rest of the thesis.

Tuesday, November 19, 2019

The luxury of digital recording

Following on from what I wrote the other day about a song I wrote in Hebrew for the kibbutz song festival: I rewrote a few lines and in doing so, I removed the infelicities from the words and from one line where the words didn't really fit the tune (too many syllables). 

I then had to rerecord the vocals; at first I thought that I could keep the final verse, but it turned out that there had been changes in every verse and so I had to sing the whole thing though again (it's only a short song but a bit too fast for me to sing comfortably). Fortunately I had fewer problems this time and was able to mix a revised version of the song reasonably quickly.

Whilst walking the dog, I had been thinking of including a modulation, although I wasn't too sure of its position within the song. As I wrote yesterday, the verse finishes with the deceptive cadence Ab -> G, which also returns the song to the key of C, after a mild flirtation in Eb. All I had to do was add a bar between the end of the third verse and the beginning of the final choruses; the instruments play an A chord in this bar. This required me to transpose all the notes in the final choruses by a whole note (for now the song is in D and not C), a task which I accomplished in a matter of seconds.

I then imported the new MIDI file into Reason and exported a new wave file. With regard to the vocals, I calculated how much time the extra bar would require then inserted silence lasting for this interval (just under two seconds) into the vocal track. Using pitch correction software, I then transposed the vocals of the final choruses again by a whole note, imported the edited track into the multi-track recording program then mixed the whole thing again.

Total time required: less than five minutes. This is the luxury of working with digital recording tools. If I were working in an analog situation, I would have to get the musicians back to the studio in order to record the final section again in the new key. The singer would also have to sing the choruses in the new key (I could splice in some new tape for the silence). Total time required: at least an hour, once the people were in the studio. It might well take longer to bring them together, although if we were in the middle of recording an album, the musicians and singer would presumably be present all the time.

My wife thinks that the song is 'charming' although she doesn't want to sing it live.

Sunday, November 17, 2019

Song festival 2019

The last week has been very painful: hot weather (32ºC) with strong winds; this is exactly the kind of weather that triggers migraines. It's been so long since I last suffered from a migraine that I didn't recognise the feelings at first, and it was too late by the time I realised what was happening. Thankfully Friday and Saturday were migraine free, but this morning the pains started again. I checked that I had enough pills and that their 'use by' date has not passed (I've forgotten the English term).

It looks like we're going to have another song festival this December. I normally write tunes for other people, but the one set of lyrics which I was sent would have been very difficult to set to music; so I would write my own song, music and lyrics. I had decided in advance that the music would be in a major key and would start with a catchy chorus, not my usual cup of tea. A tune suggested itself for the chorus, and the verse tune followed on quite easily. I set the song in the key of C, not because it's particularly easy to play, but rather because it fits my vocal range. 

I decided also to cut down on the harmonic tricks of which I am fond; this one has only one mild trick. The verse begins F G Am (so far, no surprises) then Fm which is the critical chord, allowing the tune to modulate from C to Eb. The second half of the verse has the chords Eb Fm Ab and then modulates back to C with a G chord. There isn't much melody: every bar of the verse generally contains several syllables set to the same note. I did want something which is easy to hear and sing along with.

After a long time with no words, except for the chorus, couplets have been entering my head over the past few days. I 'wrote' several while walking around the kibbutz and used my mobile phone as a notebook in which to note these couplets. When I sat down to put the words together, some of these couplets stayed and some were replaced. It was very interesting to note that there are no verbs in the lyrics (apart from the final two lines): the lyrics are basically a series of slogans strung together which describe our kibbutz. It's easier to do this in Hebrew than in English, although it was very hard technically with the stresses, emphases and grammar. There are still one or two lines which need improvement.

Once I had a complete set of lyrics, I thought it time to record a demo. Originally the song had only two verses but that made it very short, so while working on the arrangement I added another verse - for which I had to strain in order to write the words.

I then recorded a few vocal takes. This proved more problematic than usual as my computer seems to be suffering from old age and slows down every now and then. This caused the vocal to be out of time with the music. In the end, I had to resort to singing one verse at a time then stitching the whole thing together.

I have absolutely no intention of singing this one live! Apparently this year all the songs are going to be sung with playback with no live musicians, so I'll work a bit more on the arrangement. But I must remember that people are going to hear the song once and once only so subtlety is not called for. This isn't a song which requires a great deal of love or even attention.




After having written the above, I took another look at the lyrics and the lines which require improvement. Fortunately the order of the lines doesn't make much difference (apart from the final verse), so I switched a few lines around with slightly changed lyrics in order to fix the song. Now I'll have to rerecord parts of the song.

Tuesday, November 05, 2019

Draft thesis review

I have finally received the draft thesis review of the work which I submitted at the end of September. This process took much longer than I had expected; inexplicably the review is dated 28 October, but I received it on 4 November, a week later.

The review is detailed, fair and easy to understand - there are no remarks which are wrong or incomprehensible. Unfortunately, it looks like a great deal of work will be required to bring the thesis up to standard. Some of this is due to the fact that portions were written in advance -  parts referring to the actual research were written for the intermediate submission, at which stage the research had yet to take place and so was written in the future tense. This now has to be recast in the past.

Another point mentioned is the the abstract, which was written well before the initial research proposal was written and has remained almost without change. This important part of the thesis does not provide an insights [sic] into what the findings indicate, why these findings are important, and the overall contribution of the research to both academia and practice.

My idea of presenting the data in a 'horizontal' manner (answers from all companies for each question presented together) did not find favour with the reviewer, who wrote it might be more appropriate to present each company separately. I beg to differ; I don't know whether I have to accept everything that the reviewer writes.

I can make an analogy between writing a thesis and making a record. The thesis supervisor is the record producer, who suggests what material should be included and how it should be presented, trying to make it as good as possible. The research committee is comparable to the record company's A&R men (this may be a dying function) who lend what should be an unbiased ear to the product (thesis/record) and make further recommendations. The external examiner is the general public, who decide whether the record sells. According to this analogy, the draft thesis reviewer is equivalent to a music critic, and this is where the analogy breaks down. Musicians rarely listen to critics, but I have to.

Obviously I would like to start work on updating the thesis as soon as possible, but I think that this process is going to have to wait a few days as at the moment I am suffering from a mild viral illness whose major effect is slowing me down to about 50% of my usual pace, making me very weak (and affecting my concentration and spelling as I had written 'weak' as 'week'). It has also given me a tongue canker which mainly makes itself felt when I swallow (because the tongue is pressed to the palate, thus putting pressure on the canker and causing pain). I imagine that this will blow over in a few days; in fact, today already seems better than yesterday: let's say I'm working at 60% capacity.


Saturday, November 02, 2019

CPAP readings

Today I uploaded data from my CPAP machine to my database; it was very interesting to compare the readings from the past ten days (when I have been at work) to the ten days preceding (when I was on holiday). I walked about the same distance over both periods, probably slightly more during the holiday period as I didn't have 'Karmiel days' (even though I managed slightly over 10,000 steps when I was last in Karmiel).

I slept slightly more when I was on holiday then when I have been at work, which is not too surprising as I get up early (normally 5:30 am, 4:30 am when I'm travelling) when I'm working. What is interesting is that the number of apneic events per hours was in single figures since returning to work, whereas the number varied from 11-20 per hour when on holiday. Obviously I'm more tired when at work (not surprising) and so I sleep better with fewer apneic events.

Thursday, October 31, 2019

Coincidence or deliberate reference?

The protagonist of John Le Carré's new novel "Agent running in the field" is a confirmed player of badminton (club champion), and as such makes his introduction in the book.

Rereading the fascinating "The spy and the traitor" by Ben Macintyre, I am struck by the fact that Oleg Gordievsky, the eponymous spy and traitor, was a badminton player. There was an attempt to recruit him to MI6 with a female badminton player but this approach failed.

I wonder whether this was a coincidence or a deliberate reference in JlC's book to real life events.

Macintyre's book is, of course, essential reading for all fans of JlC, to read how things are done in the real world.

Sunday, October 27, 2019

Agent running in the field

This is a new John le Carré novel which I pre-ordered and so was able to download it onto my Kindle on the day of its publication last week. As this day was a Wednesday, I was able to read it on the way to Karmiel and on the way back. I finished it before I arrived home, so it required about three hours reading.

Unlike some of JlC's novels from the 90s, it was an easy and entertaining read - but not particularly deep. To those who think that all JlC's novels are like Russian matryoshka dolls, full of deception and conspiracy, where nothing is what it appears to be: this is not one of those novels. In fact, this one was fairly straight-forward, with only a few twists in the tale (one I guessed in advance, another took me by surprise, although it didn't seem to be particularly important).

It was an interesting read, but no more than that. Certainly not classic JlC. The writing, of course, is a pleasure to read, but that doesn't compensate for the relatively slight plot.

Sunday, October 20, 2019

This must be the place (2)

I've just come across one of the funniest versions of this Talking Heads song which I wrote about last year. Highly recommended to break the ice!


Saturday, October 19, 2019

Juliet (naked) - the film

I was mildly surprised a few days ago when I saw that our local television film channel would be showing the film adaptation of Nick Hornby's "Juliet (naked)" book, to which I have referred several times on this blog. I didn't even know that the book had been filmed. My first thought was that Hornby has a very high ratio of films to books - "Fever pitch" (twice), "High fidelity", "About a boy", "A long way down" and now "Juliet (naked)". The unfilmed (as yet) books are "How to be good", "Slam" and "Funny girl"; the last book would make a good film.

As I have probably written ad nauseam, I dislike films (or television series) based on books that change things for no apparent reason. This film was no different: whilst there were changes which made sense, others were annoying. The lamest change of all was giving protagonist Tucker Crowe the email address 'tucker.crowe@aol.com'! Really! Surely the obsessive fans would have tried this in their attempt to contact their hero. In the book, Crowe chooses for his email address the name of a minor character from one of Charles Dickens' books (I don't remember it off-hand) from which no one would have made the connection to Crowe. On the basis of this moniker, Annie brings Crowe some Dickens' novels when she visits him in hospital.

The main characters didn't match up physically to how I envisaged them: Duncan should have been shorter, pudgier and less self-confident whereas Annie should have been taller (I have to admit that I was very taken with the actress who played Annie - Rose Byrne - who is Australian, which explains her varying accent). The look I envisaged for Tucker Crowe was as a younger version of Richard Dreyfuss in "My life in ruins"; I'm fairly sure that the book describes him as having short cropped hair. On the other hand, the town councillor was pretty much as I expected him.

So: I was underwhelmed. The parts of the book which spoke to me did not come over in the film and so we were left with a fairly lame and unlikely tale. It will be interesting to see what my wife thinks of the film.

Monday, October 14, 2019

Priority: LIKE cannot accept a variable

I wanted to write a form trigger which is dependent on the value of a certain field (the number of a previous order). Unfortunately, this field is not bound but rather a simple text field, which means that instead of it holding values like KL191234 (this would be the previous order number), it holds values like 1234, 191234 or even 1234/5. This is problematic, but one evening the answer came to me: use the standard SQL keyword LIKE, where the order number is preceded by *. Thus KL191234 will be matched by *1234 or *191234 (but not *1234/5). On this basis I wrote the following code, where TEST_PREVORDER holds the value of the previous order
:PREVORD = 0; SELECT ORD INTO :PREVORD FROM ORDERS WHERE ORDNAME LIKE STRCAT ('*', :$.TEST_PREVORDER) AND CUST = :$.CUST; GOTO 99 WHERE :RETVAL <= 0;
The syntax checker told me that there was an error with STRCAT. In order to combat this, I placed the STRCAT function before the query, assigning its value to a variable, then used this variable in the query. This did not help matters.

Eventually I realised what the problem was - LIKE (at least, in its Priority definition) cannot accept a variable as its parameter; it has to be a 'naked' string like '*T' or 'T*'. As usual, this doesn't seem to be defined anywhere, but I discovered that I had commented on this a few years ago (not on this blog).

So add this to the growing list of improvements for Priority SQL. The syntax checker
  1. should check that every cursor which is opened is also closed.
  2. should check that every LINK has a matched UNLINK (this is probably very difficult)
  3. should allow LIKE to take a variable as its parameter
The final code became
/* Stupid code required because LIKE cannot accept a variable as a parameter */ :TPO = :$.TEST_PREVORDER; :TLEN = STRLEN (:TPO); GOTO 4 WHERE :TLEN = 4; GOTO 6 WHERE :TLEN = 6; GOTO 8 WHERE :TLEN = 8; GOTO 99; LABEL 4; :TPO = STRCAT (ITOA (YEAR (SQL.DATE8) MOD 100), :TPO); LABEL 6; :TPO = STRCAT ('KL', :TPO); LABEL 8; :PREVORD = 0; SELECT ORD INTO :PREVORD FROM ORDERS WHERE ORDNAME = :TPO AND CUST = :$.CUST; GOTO 99 WHERE :RETVAL <= 0;
Note that the code 'falls through' the labels: if TPO is '1234', then the code will jump to label 4, where TPO becomes '191234'. Then the code for length 6 executes: TPO becomes KL191234. Then the code for length 8 executes - which is the real code. In other cases, there would be another GOTO on the line before 'LABEL 6' but here it is not required.

Sunday, October 13, 2019

Acting like an MBA (a 'suit')

I wrote a few months ago about 10 years of post-graduate study, mentioning that I have learnt a great deal throughout these years although to be honest, I haven't seen myself applying much of the material. Thinking about this the other day, I realised that this statement isn't quite true.

Over the past few months, the CEO set up a series of weekly meetings at Karmiel, discussing various aspects of the work there. These meetings are one after the other, so I arrive at about 8:45 am, immediately join one meeting, then return home several hours later after participating in six or seven consecutive meetings. I make contributions to these meetings, but sometimes it's very difficult to get a word in when the CEO is talking strategy. The CEO has withdrawn himself from these meetings from the beginning of September, passing the chairmanship to a vice president so I have found myself making more and more contributions, finally acting like an MBA. 

Also, the new manager of the furniture factory (appointed after the sudden death of my friend Ya'ir) came without a business background (one wonders why he got the appointment), so I have been working with him on a weekly or fortnightly basis, bringing him up to speed and explaining all kinds of things; basically being an MBA. The other day, he once again expressed his thanks for the time that I have devoted to him; I told him that, apart from this being part of my job, it has also been instructive and enjoyable for me as well. This allows me to come out of the shade of the CEO and to apply material which I learnt during the MBA studies.

I think that there should be a raise in my salary, but I have my doubts whether this will happen (although nothing will happen if I don't ask). As I remarked to the furniture manager, when things go well, one doesn't investigate problems too deeply, but when business results are poor (and they have been recently), one investigates thoroughly. How can one justify a salary increase when results are poor? 

There are two other aspects of salary which ought to be taken into account. One is scarcity: how scarce is the ability that one brings to a job? This assumes that everyone can perform manual labour, so this is not scarce and results in a low wage. Few people can successfully manage a company, so this ability is scarce and should be awarded proportionally. I think that even fewer people can combine between business knowledge and the ability to enhance an ERP system: I provide a various scarce ability and so should be suitably rewarded.

The other aspect is responsibility: again, manual workers have little or no responsibility for the final product or how well a company performs, whereas responsibility increases as one ascends the management chain. I advise but do not take business decisions; my responsibility is lower than one might think. My work has little effect on the bottom line. I can make people more efficient but I can't make the company more successful.

Saturday, October 12, 2019

Two (historical) events which I wish had never happened

My friend the rhinovirus came to visit two days ago, so since then I've been displaying all the usual symptoms: blocked nose, disappearing voice and especially general weakness. Fortunately it is holiday time here so I don't have any commitments in the next few days, thus allowing me to recover without causing any complications.

I found it very difficult to get to sleep last night; as a side effect of the virus, I'm not walking 5 km in the evenings and so my body is not physically tired. To add to my problems, I had an over-active brain last night and all I could think about was two events which happened to me in 1974. One has to suspend one's belief that these events really happened.

As one might recall, I was in Israel for the first half of 1974. The first event happened when the group was in Jerusalem, so it was presumably in January 1974. I had travelled from Jerusalem to spend a weekend with a family in Netanya; I would return by train.  It's hard to accept this now but there were trains from Nahariya to Tel Aviv and from Netanya to Jerusalem 40+ years ago; the 80s were a bad decade for Israeli trains.

Somehow, we knew that there was a train leaving at about 5 pm (how we knew this is interesting as there wasn't an Internet which would show times) for Jerusalem and one about 10 minutes earlier for Tel Aviv. I was driven to the train station where there was a train waiting; without checking, I went to alight this train, whereupon it started moving. Without thinking, I stood on the step, holding on to the handles of the carriage, like in Wild West films. The train picked up speed, and I'm still holding on - from the outside. After about ten/fifteen minutes, someone must have noticed me, for the train stopped. I was able to open the door and enter the train. Of course, I was shaking like a leaf.

In the train, I came across a member of Kibbutz Bet Ha'emek (where we were based). Whilst talking to him, I discovered that of course, I had alighted the train to Tel Aviv, which was a few minutes late as opposed to alighting the train to Jerusalem. I don't remember talking to the train conductor, but soon the train stopped at a station (I remember it being Bnei Barak, which doesn't make sense for a train from Netanya to Tel Aviv) where I disembarked. Shortly afterwards came the Jerusalem train and off I went. The old train station in Jerusalem was at the beginning of the Hebron Road, which was a kilometre or so from the seminar centre.

The second event happened a few months later when we were solidly in the midst of the 'work period'. I had decided to spend a weekend at Kibbutz Mevo Chama in the southern part of the Golan heights; this was the kibbutz where the most recent emigrants from British Habonim had settled, and it was assumed that the next group - to which I would belong - would also settle there. Despite having been there for two one week periods, I hadn't developed any real feel or liking for the kibbutz, so presumably I thought that going there for a weekend would be an attempt to improve my liking.

Reconstructing from memory, I must have left Bet Ha'emek on a Thursday afternoon, travelling by bus to Tiberias, from where would leave another bus to Mevo Chama at 8 pm. Unfortunately, I arrived a few minutes after this bus departed, so I was stuck in Tiberias. In retrospect, it might have been more prudent to return home (if this were possible), but instead I decided to spend the night there. Having very little money (I only needed to pay bus fares), a hotel or hostel was out of the picture. With little choice, I decided to sleep on a park bench near the police station; I think that I had explained to them my position and they suggested that I spend the night in the park. One must remember that this was shortly after the war and everyone was suspicious of strangers.

Although it was warm, it was very uncomfortable sleeping on a bench which I suspect was not long enough (and I'm not exactly tall). I woke in the early morning and made my way to the bus station; presumably it being Friday, there wouldn't be a bus at 8 pm but rather at 2 pm. Unwilling to wait another eight hours or so, I decided to take a bus to kibbutz Ein Gev, which whilst being on the right sight of the Sea of Galilee, was also next to the sea, whereas Mevo Chama was at the top of a high cliff, overlooking the sea.

I don't remember now how I got from one kibbutz to the other; presumably I must have hitched a lift for some of the way (north to Samech Junction, which is just above the '92' mark on the map, then east and up, finally south on '98'), but I do remember walking part of the way, with blackened vehicle wrecks by the sides of the road - don't forget, this was a few months after the war.

Eventually I arrived at the kibbutz and had yet another dismal time there, which near enough sealed the fate of this kibbutz for me - NO! I must have returned 'home' safely with no memorable incidents.

While writing this memoir, I first thought that I never returned to Mevo Chama, but that isn't so. In 1999 (?) we rented a small holiday home near the sea of Galilee (it would be in the top left hand corner of the map), and one day we took the children to the Golan and to Mevo Chama. We walked to the club house where I had celebrated my 16th birthday, admired the views, then drove on. Also at some stage we had visited the hot springs at Hamat Gader, which is a few kilometres south and east of Mevo Chama; I had been there in 1974 before the site had been developed in a tourist attraction.

There used to be a parlour game which we used to play where one would describe two incidents, one which happened and one which was imagined. The other players would have to guess which incident was true and which was not. I always used the railway story along with some invented story which would sound reasonable for me - and no one ever guessed that the railway story really happened to me.

Thursday, October 10, 2019

Cosmology

Over the past week, I've been reading a very interesting book entitled "The 4% universe: dark matter, dark energy and the race to discover the rest of reality", written by Richard Panek. This is a subject which has always fascinated me and the book gives good explanations about the subjects covered.

Especially interesting to me at the moment are the discussions about doctorates: in the sciences, these are supposed to follow the scientific method which is composed of three stages:
1. make observations
2. propose a theory which explains those observations
3. make predictions on the basis of the theory.

A good example of the above method is Mendeleev and his periodic table of elements. Various facts were known about the elements which had been isolated by 1869; Mendeleev proposed a theory which could explain those facts, but he also made predictions about elements which had yet to be discovered. When new elements were discovered, their properties were checked against this theory and the predictions confirmed.

Unfortunately, doctoral theories in social sciences (and business administration is placed here) don't usually present testable theories.

The book begins with the discovery of the cosmic background radiation which had been predicted and found by accident in 1965. It then goes on to discuss the work of Vera Rubin who worked - at first in isolation - on galaxy rotation rates. From there, super novae are discussed, and in my opinion, this is where the book gets bogged down, as there are two competing teams and it's difficult (at least, for me) to remember who belongs to which team.

The findings of Rubin (and originally those of Hubble in 1929) show that the galaxies are speeding away from us and that the rate of acceleration is also increasing. The estimated mass of the galaxies cannot account for this, implying that there is mass which we cannot see - the eponymous dark matter (which, to be topical, is the name of Randy Newman's most recent record). Without going into the calculations, it appears that we can only see and measure 4% (4.5%) of the universe!

With a neat piece of synchronicity, it was announced a few days ago that one of the winners of the 2019 Nobel prize for physics is Jim Peebles, who appears frequently in the above book. The citation is for 'theoretical discoveries in physical cosmology'.

Tangentially, Frederik Pohl's "Gateway" series is about cosmology: at the end of the second book, there is discussion of the missing mass (dark matter) and a supposition that someone is causing the universe to contract (which would require even more matter and/or energy) in order to restart the universe with different parameters (for example, the mass ratio between protons and electrons). One character wrote a doctoral thesis on this subject which was not accepted, as it did not produce testable predictions (unlike in real life).

Without going into the subject very deeply, there are about six numbers which are observed that do not evolve from theory; changing these numbers would cause the universe as we know it not to exist, or at least to change drastically (for example, changing the value of one parameter would prevent the existence of stars). This is known as the 'Goldilocks principle', and I own a book by Professor Paul Davies which explains this (unfortunately, the book is harder to read than the Gateway books or even 'The 4% universe'; also I have it in print and not Kindle). Why Goldilocks? Because these numbers produce a universe which allows human beings to exist, and so the universe is 'just right', like Goldilocks' porridge. This is also known as the 'anthropic principle'.

I would love to know how Pohl researched that series and whether he originally conceived just the initial book or the entire series. The style and structure of the first book is different from the others, so there is reason to support the suggestion that the other three books were not originally planned. Also, the first book dates from 1977, which is prior to several large steps in cosmology (as discussed in '4%'; for example, the inflation theory of Guth dates from 1980) whereas the others could have been based on new discoveries and/or theories. 

Sunday, September 29, 2019

Many rivers to cross

This is the latest installment of the DCI (now Detective Superintendent) Banks series. Previous reviews have started Once again it's the end of July, and as always, there is a new DCI Banks book to devour ... this year the book seems to be late, being published on 19 September. Ten days have passed and I have read the book twice.

I suggested last time that the entire Zelda plot-line ...does set up a story line which could be the next Banks book: I guessed this correctly. Like most novels of this ilk, there are two separate story lines, although this time they barely connect. One story is about Zelda and one is about a murder on Banks' "turf". 

The book was engrossing although it doesn't impress me - or connect with me - as some of the other books. One lesson which can be taken from the book applies to the field of problem solving - after all, being a detective means solving problems, specifically how and when someone was killed. In the first pages, a minor police character (who has had bigger roles in earlier novels) suggests a line of enquiry, and this line is followed almost until the end when it appears to be false. So much for keeping one's options open.

DI Annie Cabbot is relegated to a supporting role and hardly gets anything to do, so we are certainly not privy to her inner thoughts. Earlier star Winsome Jackson is barely mentioned, having a problematic pregnancy, so most of the police side of the novel is carried by Banks and DC Gerry Masterson. Presumably this is because so many pages are devoted to the Zelda story line.

There are some nice musical touches: Banks goes to a Richard Thompson concert at the beginning of the book and is suitably impressed (although his daughter isn't). He is the recipient of a Martin D-28 guitar (no less; models can be bought on Ebay from 1300 - 10,00 Euro! List price at the Martin guitars site is 'only' $3,599) sent by his musician son, Brian, who announces that his group, the Blue Lights, is breaking up and that he is considering a new career as a producer. It will be interesting to see whether this leads anywhere.

And of course, author Peter Robinson continues to title his books after classic songs, this one by Jimmy Cliff (and probably a more well known version by Joe Cocker), which has one of the lamest rhymes I have ever heard. A very minor character says this sentence.


Many rivers to cross
But I can't seem to find my way over
Wandering, I am lost
As I travel along the white cliffs of Dover

Are there any better rhymes with "over"?

Saturday, September 28, 2019

Understanding the UNLINK command in Priority

I get the feeling that 'UNLINK' is one of the most misunderstood commands in Priority (and I'm not insinuating that I understand it perfectly).

First, what does LINK do? The LINK mechanism creates a temporary copy of a given database table. And what does UNLINK do? The UNLINK command stores the temporary file in the specified (linked) file and undoes the link. More importantly, The linked file is initially empty of data. All subsequent operations that refer to the original table are actually executed upon that temporary file, until the UNLINK command is encountered. You cannot link the same table more than once prior to an UNLINK. If you do, the second (and any subsequent) LINK to that table will return a value of –1.

Developers use the LINK/UNLINK commands frequently in two main contexts. The most frequent use is in procedures, where a linked table (most frequently STACK4) is used to store data collected during the procedure; this data is then passed on to a connected report which uses the linked table. One soon discovers that there is no need to call UNLINK at the end of the procedure.

In more complicated procedures, consisting of several steps, the linked table might be referenced in several of those steps, in which case it is prudent to unlink the table at the end of each step and relink it at the beginning of the next step. Not calling UNLINK will lead to problems as I mentioned in an earlier tip.

The second most frequent use is again in procedures where data is stored prior to it being used to update data in a screen by means of an interface. Again, one discovers that the procedure will work correctly even if the UNLINK is omitted.

So what's the problem? One can (and one frequently does) write interface code which is run in a screen trigger. There are several important (and not particularly documented) differences between code which runs in a procedure and code which runs in a trigger. The most obvious difference (in the case of linked files) is that one cannot link a table to an external parameter as one normally does (e.g. LINK STACK4 TO :$.STK) because the concept of an external parameter is inappropriate in the context of a trigger. Instead, one has to create a temporary file (SELECT SQL.TMPFILE INTO :TMPFILE) then link a table to this temporary file (LINK GENERALLOAD TO :TMPFILE). One always checks whether the link succeeds; should the link fail, one can call an error message in a procedure, but in triggers, one normally silently jumps over the interface code when the link fails. As a result, whatever the trigger is supposed to do does not happen.

I have been receiving complaints from a group of users that certain functionality in one screen has disappeared. Every time I check their complaints, I find that the code works. I wasn't listening closely enough: in certain circumstances (which for them is the normal way of working), the code does not work and a certain field does not get updated. I could see where the specific code was but it seemed correct to me. In order to help me further understand the problem, I inserted debugging code, which would give me the result of the SELECT SQL.TMPFILE operation and the subsequent LINK operation. Once I had this, the problem became clearer.

The SELECT statement worked correctly, but the LINK was returning a value of -1, which is explained as you cannot link the same table more than once prior to an UNLINK. The penny dropped: linking Generalload to the temporary file was failing because Generalload was already linked. But where?

My initial reaction was to alias the generalload table (LINK GENERALLOAD TB6 TO :TMPFILE) and use the alias for all insert commands within the trigger. This caused the update to work properly. Thinking about this further, I realised that there must be at least one other trigger for this screen which does not UNLINK generalload. I looked at all the triggers for this screen and discovered to my horror that there were five or six cases where I had neglected to UNLINK generalload after using it in interface code. Today I had the opportunity to add all the missing UNLINKs.

The reason why one can get away with not using UNLINK in a procedure is that the code is called only once. A screen activates multiple triggers and so it is essential that every LINK is matched with an UNLINK. Make this a habit to do this always!

It's a shame that the syntax checker does not attempt to check unmatched LINKs. The checker does find several kinds of mistake, but there are a few which it doesn't look for. I have noted somewhere that whilst a repeated declaration for a cursor is noted, not closing the cursor is undetected. Unmatched LINKs fall in the same category of mistake. I get the feeling that the syntax checker was written many years ago, has not been updated and no one knows how to update it.

Friday, September 27, 2019

Blood test results

As I expected, I received most of the results from my blood tests yesterday evening.

The most important result, as far as I am concerned, is the level of free glucose in the blood. This has dropped from 110 mg/dL to a much more reasonable 96 mg/dL,  taking me out of the pre-diabetes range, although of course there is still room for improvement. On the other hand, the  hemoglobin A1C % had a more modest reduction from 6.1 to 6.0, which is still outside the recommended range. This test is for glucose bound to red blood cells and indicates a value that was correct to about three months ago. 

An interesting result was the value for uric acid; a high level of this compound in the blood causes it to crystallise out of the blood, leading to gout, from which my father suffers. My level has almost always been over 8 mg/dL, which is off the scale; this time it had dropped to 6.9 mg/dL, which is within the normal range.

Both HDL (good) cholesterol and LDL (bad) cholesterol levels increased slightly. The most important number for all the cholesterol tests is the ratio between total cholesterol and HDL: the lower the better. My ratio is now 3.8, which is the lowest value that I have ever achieved - good!

The final important result for me is haemoglobin: this has risen from 13.0 g/dL to 13.6 g/dL, a value that now brings me onto the lower values of the scale - as opposed to having too low a level and being in danger of anaemia. 

All these improvements can be attributed to dietary changes along with the vast increase in exercise over the past six months. These results are very encouraging, meaning that I should continue doing what I have been doing. I am supposed to make an appointment with my dietician in order to discuss these results, but as we are now entering the high holiday period, I imagine that the appointment will be in November (if not December).

One change which I have yet to adopt is eating red or yellow bell pepper slices at home whenever I feel hungry. I have to make the habit of cutting up one pepper on Friday morning and another on Saturday morning so that I always have the slices available. If I can do this during the week, there is no reason why I can't do this at the weekend. The primary gain is the reduction in calories, but also bell peppers are very good sources of vitamin C, which in turn helps the absorption of iron.

Thursday, September 26, 2019

Two important events

Two important events in my mundane life occurred today.

I had a demi-annual blood test; I should have most of the results by this evening. The results for free glucose, bound glucose, cholesterol and haemoglobin are of great interest and will cast light upon the changes in life-style which I have made over the past six months. Of course, these results will also influence how I continue.

I submitted the first version of my draft doctoral thesis this morning. As 'Introduction to Business Research 3' (chapter 1.3.2) states: The final draft thesis is submitted to the DBA Research Committee for final review prior to going forward for viva voce examination. After reviewing the final draft thesis, the DBA Research Committee may require modifications before accepting the thesis. The thesis can go forward for viva voce examination only when it has been accepted by the DBA Research Committee.  According to my supervisor, only one person reads the thesis without passing it on to the research committee, as opposed to two people reading and making recommendations to the committee. This difference is important as the next meeting of the research committee is scheduled for mid-November which means about seven weeks of doing nothing for the doctorate.

So I've cleared my desk of obligations; I now have several days' holiday in front of me (it's the Jewish New Year on Sunday, so after today, my next day of work is next Wednesday) with nothing planned to fill them. Maybe I'll work on the video of Pisa/Torino from last year.

Tuesday, September 24, 2019

Grand-daughter pictures

Grand-daughter #2 recently evolved from a static blob to a mobile blob (age 10 months), crawling all around the house. Unfortunately, I'm rarely at home when the grand-children come to visit so I don't have many opportunities to be with her. The other day, though, I did come home early and had the chance to play with both my grand-daughters. We also used the opportunity to take a few photos - I don't think that I have a single photograph with this grand-daughter. So here we are.

I look strange to myself in the pictures where I am not wearing glasses, so I'm presenting here one with and one without.


Wednesday, September 11, 2019

Mobile phone problem ... solved

I am writing this for my own benefit should the same problem occur in the future.

Today I was in Karmiel where I had meetings all day, so I set the phone to 'vibrate' and also used the AutoSMS app, which sends a message to anyone who tries to contact me. The phone was working at lunchtime because I could send WhatsApp messages. On the way home, I noticed that I couldn't unlock my phone: the lock screen would appear, I would enter the PIN which was accepted and then the screen would go blank. This happened time and time again.

The easy way to solve this would be to turn the phone off - but I couldn't achieve this. After reading the manual, I discovered why I couldn't turn the phone off: I was pressing the wrong buttons. There are three buttons on the right hand side of the phone, from top to bottom: volume up, volume down and power. In order to turn the phone off, one presses the power and volume down buttons for a few seconds (that is, the bottom two buttons on the right hand side).

Voila! I managed to turn the phone off. When I turned it back on, everything was working again. The first thing which I did was turn off the AutoSMS app - this might have been the cause of the problem.

Tuesday, September 03, 2019

Priority tip: another thing to be aware of

I'm going to describe something which isn't a bug in the strict sense of the word, but will cause Priority to act in a way that we don't want and is unexpected.

There is code in almost every screen to record changes; frequently, there are fields in the screen for which changes are not logged and so we have to add them to our own screen triggers, using the same mechanism for storing the changes. There is a table called GEN_CHANGE_LOG which holds data about changes for most screens and there is a standard procedure for entering data into this table (#INCLUDE TRANSORDER_p/BUF2-CH).

Now down to specifics: I added code a few years ago to the PARTPARAM screen to record changes in the default warehouse of the part using the above procedure. The original value of the field being checked is stored in a variable called OLDVALUE and the new value is stored in - you guessed it - NEWVALUE. As the name of the trigger came after the standard POST-UPDATE-CH trigger, my code executed after the standard code. This shouldn't be a problem as the order of checking should make no difference. 

But unfortunately it does. I noticed in the changes log for a few parts that the default warehouse had been changed from 'M' to 'M'. How could this be, when the warehouse names are something like M271 or M504? Why was the trigger storing only one character when the field itself has four characters? I looked at the standard trigger and noted that it was saving the value of a field that could be either Y or empty. Priority handles single character strings in a different manner from longer strings; this gave me the clue that somehow the standard trigger was defining the length of OLDVALUE and NEWVALUE to be single character strings, so that when my trigger executed, only the first character of the value would be stored.

There's no way of redefining the length of a string (AFAIK) in Priority, so I had to look at the problem with some lateral thinking. The solution was to change the name of my trigger so that it executed before the standard trigger. I implemented this and checked: lo and behold! Now warehouse names are being stored in their entirety and are not truncated.