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.

Friday, August 30, 2019

Priority tip: beware of linked files when checking in Windbi

A few days ago, I was trying to debug some code which I had added to an existing procedure. The idea was to check whether a given part had ever been returned by a customer, so the code was something like
... AND NOT EXISTS (SELECT 1 FROM DOCUMENTS WHERE TYPE = 'N' AND ...
The code seemed correct but didn't work. I opened a WinDBI window to check my code, and of course it worked properly there. What could be wrong?

The answer came, as always, when I was doing something else (maybe I went to make a cup of tea) - check whether the DOCUMENTS table had been linked. Should this be the case, there will only be a record or two in this table, so it's fairly obvious that the record which I'm checking for won't be in the (linked) DOCUMENTS table and so the above will return true.

DOCUMENTS was indeed linked - but as it was at the beginning of the procedure, the line wasn't displayed on the screen and as I wrote, I was adding this check to code which I wrote some time ago and had forgotten the small details. No wonder I had forgotten to check this. The fix, of course, was simple
... AND NOT EXISTS (SELECT 1 FROM DOCUMENTS ORIG WHERE TYPE = 'N' AND ...
One simply gives the table an alias which ensures that the real DOCUMENTS table will be used. There are no links in WinDBI so the real table will always be used. This problem is similar to the one described here, so the moral is if something doesn't work in a procedure but does work in WinDBI, check for linked tables. It's so easy to forget.

Tuesday, August 27, 2019

Yet still more doctoring

My last post nearly ended with the words [my supervisor] will look at it over the weekend and provide feedback on Monday.  I actually received the feedback on Sunday: there were two specific issues which have to be addressed, and the feedback ended with these words: apart from [those issues], let's submit and get another pair of eyes on the document. So my supervisor thinks that I've finished!

I added more material to the final section, which I wrote about here, just over a week ago. 

In the final days of writing this thesis, I came across the book "Grit: The Power of Passion and Perseverance" (Duckworth, 2016), which defines 'grit' as passion and perseverance for especially long-term goals. There is no doubt in my mind that one has to be exceptionally 'gritty' in order to complete a doctorate: one has to begin with a passion for knowledge and then persevere over years in order to achieve the goal of completing the doctorate. This statement can be presented as the following 'equations': 

talent x effort = skill
skill x effort = achievement 

I have learnt how to perform a literature search, how to download the suitable papers (not always a simple task), how to read them and how to extract their importance. I have learnt how to weave together a tapestry of arguments from the knowledge extracted from those papers. I have learnt how to write (and rewrite) a long document which is patched together over the years and how to work with an editor (i.e. supervisor). Most importantly, I have learnt to persevere: almost all of the tasks which I perform both at work and at home are short-term, varying in duration from fifteen minutes to a few weeks. Aside from parenthood, this doctorate has been the longest ever project in my life and at times has been managed as a project, sometimes requiring me to allocate blocks of time in order to keep moving forward whilst simultaneously achieving other shorter term goals.


It was the OP who showed me the book 'Grit' in its Hebrew translation during our weekly meeting on Friday; I found a copy in English and read it over the weekend. The book is divided into three parts, and the first was enough for me. I found that the second and third parts were repetitive, repeating the message for those who hadn't cottoned on yet. 

I wrote many years ago about how school used to be very easy for me until about the age of 14, and how it wasn't until 1977 that I felt confident and more importantly, prepared for the second year university exams. Reading 'Grit' put things into perspective: until about 1970, my memory and ability to understand things quickly enabled me to glide through school. Other students weren't so well endowed and had to put effort into learning; I didn't. It was only a few years later that I developed enough grit (perseverance) to finish university with a good enough grade. 

Duckworth writes that one develops more grit as one grows older and I can definitely attest to that! I started the doctoral programme in 2012 so it's been seven years and I still haven't finished (although I'm very close). I doubt that I would have had sufficient grit in earlier years to last the distance.

Angela Duckworth is a respected psychologist; it turns out that she was a graduate student studying under Martin Seligman, about whom I have written in the (distant) past.

Saturday, August 24, 2019

Conclusions about what isn't being said

The other day, I started rereading "The cardinal of the Kremlin", which is one of Tom Clancy's better novels (still, it could do with some strict editing that would remove 15-20%). What caught my attention this time was Jack Ryan's role as an analyst, where he says something like "it's not so much my job to analyse what was said, but rather to analyse what was not said". It's always easier to look at what there is as opposed to looking at what isn't - what is being hidden, what isn't being shown and so on. This attitude percolates down to SQL where almost all queries select data which is stored within the database; it's harder and less intuitive to find what isn't there (for example, customers who haven't purchased anything in the last year).

With this on my mind, my attention wandered to the conclusions chapter of my thesis, where I had analysed points which had become clear during the interviews. I now thought that it would be a good idea to discuss points which hadn't arisen, for example inter-departmental co-operation. Continuing this train of thought, I realised that I should take each topic which had been presented in the literature review and discuss their influence on the results. This gives the section a structure, which is always important, but also gives an answer to a question which might be asked in the viva interview: why did you present literature on a given topic then not discuss it in light of the interview results?

The material which I had written previously provided about 50% of what was needed; having the structure of the literature review topics made it easier to focus on what could be concluded. Whilst doing so, I noticed one point that would be good for the 'recommendations for future research' section - business competence of IT workers. I started looking for papers on this topic and found several, although I have yet to read them and so do not know how relevant they will be to the thesis.

My supervisor had written that he intended to look at the current version of the thesis on Friday, which was the same day that I had this insight. I quickly posted a note to our message board, saying that I intended to restructure this section, which is one of the critical ones. In the evening, I saw that he had posted a note to say that he would wait for the new version. I uploaded the thesis and was rewarded with the comment that he will look at it over the weekend and provide feedback on Monday. So now I leave the doctorate for a few days and concentrate on other matters.

Sunday, August 18, 2019

What I did on my weekend

A few random notes before getting to the meat of this entry.

I repeated the 'beef stir fry' for Friday night dinner; as there were more diners, of course there was more food, but the wok was big enough. The dish went down very well so this will definitely be repeated. I'm still a bit wary of the sweet chili sauce - I would prefer something else but have yet to find something suitable. I wonder whether I should cook this in advance (a few hours, not a few days) and keep it warm in the oven, so that I don't have to tend a smoking wok when I could be on the floor playing with my (second) grand-daughter.

At the pool on Saturday, someone remarked to me that I am swimming much more than last year. Someone else said the same thing the week before. I find it interesting that people note how much I swim and are capable of comparing the number of lengths. Yes, I am definitely swimming more this year, and as I have commented before, it's much easier this year. I don't know whether this is directly due to loss of weight - it's probably more connected with improved stamina. Yesterday I swam 32 lengths without a break; I had to stop because of the urination issue. Last week I carried on swimming after a toilet break, but I was very tired when I got home, so yesterday I decided to stop before the urination. I wasn't particularly tired at home afterwards.

I have been walking longer distances - yesterday, I walked 4.85 km - in 46 minutes, which works out as 9:29 min/km or 6.32 km/hour. The further I walk, the faster I walk. Thinking about this on the way back (before I knew my speed), I realised that the reasons are (as economists would put) the unavoidable fixed costs (initial stretching and getting up to speed; the dog looking after her needs) take the same amount of time whether I am walking 2 km or 4 km, so their influence decreases the longer one walks. Also, the first kilometer of the walk has me going up a hill then down a hill, so a walk of two kilometers is going to be very hilly. After the hill, there is a stretch of just under 2 km which is flat, so obviously I can walk fairly fast here. By the time I get to the final kilometer, which has me walking up a hill, I am walking fast enough to overcome the difference in elevation.

My weight has now gone down to 77.2 kg!

But what I really wanted to write was this: after receiving some belated feedback from my doctoral supervisor (he had to undergo emergency surgery on his eye in the middle of July), I spent several hours working on the doctorate. He advised me to make an automatic table of contents: I had to learn how to do this although theoretically it was quite simple. For some reason, the toc displayed right to left which was very annoying; it took a while to figure out how to overcome this. Now, if I add more material, I only have to instruct the toc to recalculate the page numbers, which it does. I extended the technique to figures and tables; again I had the right to left problem. Here, for some reason, the page numbers didn't recalculate correctly so I had to change them manually. A big advantage of this is that the toc also displays in a window on the left hand side of the screen, which makes it very easy to navigate between sections. The final thesis will be in PDF format, so this advantage will be lost.

Apart from adding material to almost all the chapters, I added a new section at the very end, which I am going to quote here.

7.6 Personal reflections on the research
This section aims to reflect on the researcher’s personal experience over the course of this study. Even though there are many SMEs which use ERP systems in Israel (a majority appear to use Priority), there is very little interaction between the companies and so one often feels as if one is operating in a vacuum. Even though user conferences are held bi-annually, these tend to be focused on technical advancements by the implementing company which frequently are of little interest to those companies which use the system, whereas topics which are of interest to the users are not considered sufficiently 'sexy' by the implementing companies. For example, whilst the development tools are sufficient to create sophisticated enhancements, their interface has not been updated for a decade and their documentation is lacking.

Conducting this research enabled the researcher to realise that he is not alone and that other companies suffer from similar problems. Whilst deriving some consolation from this, it doesn't help in overcoming problems such as user resistance.

Researching the literature was at times frustrating and at other times very interesting.  Much intellectual satisfaction was derived from reading the literature and viewing it in a critical manner. What was apparent though is that very few users and/or system managers use ERP with reference to academic literature about ERP: everyone gets on with the job in what each considers to be the most suitable method. Many potential participants did not understand the intellectual reasons which lay at the basis of this research, and this lack of understanding may well be one of the reasons why they declined to participate.

There appears to be very little cross-fertilisation between academia and industry in this thesis' topic. This has caused a certain amount of disconnection and alienation for the researcher who views, as a result of this research, the ERP system and its usage in vastly different terms from most of the users.

It is not clear what impact this thesis will have on the researcher's professional future, especially considering his age (approaching retirement). Will the researcher continue in industry, trying to implement the conclusions of this research by improving the chances of enhancements to be utilised and thus approaching the dream of realising all the power of an ERP system? Will the researcher turn to academia – problematic considering that this research does not fit into the domain of any conventional university department? Will some form of hybrid solution be found: writing academic papers whilst continuing to work in industry?

What is clear, however, is that the prolonged period of doctoral research has answered a deep need in the researcher's life for intellectual stimulation.

Tuesday, August 13, 2019

Night walking (2)

Due to various commitments, I couldn't start yesterday evening's power walk until just after 8 pm, at which time it was already dark. So after putting the new collar on the dog, I turned it on so it was glowing bright red. I also turned on my head band torch.

After about five minutes of walking, I bumped into two other groups of walkers: two sisters coming home, and mother and daughter going out. The only illumination that both groups were using was their mobile phones - a poor source of light, and one has to hold it. My mobile phone is safe inside my trouser's pocket. They were all appreciative of my torch, but especially appreciative of the dog's collar.

I don't know whether it was because of the hour and relatively less humidity than most evenings, but I set a new record for distance walked this year (4.56 km) and surprisingly walked this distance at an average of 6.2 km/hour (44:19 mins). This is very encouraging. I haven't weighed myself the last two days, but on Sunday I saw that I had lost more weight, weighing in at 77.7 kg. The walking and swimming is paying off.

Friday, August 09, 2019

Beef stir fry

I saw a recipe (in Hebrew) for a beef stir fry the other week; it seemed interesting, and as I knew that tonight only my wife and I would be dining, it would be a good time for experimentation. I bought 500g of sirloin (in Hebrew, 'sinta'), cut into small strips by the butcher, which saved me having to do so.

About two hours before the meal, I unpacked the meat and gave it a light marinade of sweet chili sauce. Then I cut up vegetables: frozen green beans, carrots, yellow bell pepper, pumpkin and onion. I poured a few drops of soy sauce onto the pieces then put them in the fridge.

When it became clear that supper time was approaching, I heated some oil in the wok then added the strips of meat. I cooked the meat for about five minutes, turning it frequently to ensure that all the pieces had been cooked, at least to some extent. I then removed the meat from the wok and stored it in a glass dish.

Starting again with an almost clean wok, I added a little more oil, then added the onions and after a minute of two, all the vegetables. These had to be steamed more than fried, so after a few minutes of high heat and being turned frequently, I reduced the heat and covered the wok.

I steamed the vegetables for a few more minutes, occasionally lifting the lid and turning the vegetables until they were reasonably cooked. Obviously some of the vegetables - primarily the carrot pieces - weren't going to be cooked in this short period, but the idea was to cook them slightly whilst leaving them firm, providing crunchiness in the final product.



Finally I added the meat strips to the wok for final cooking. At the same time as the meat and vegetables were cooking in the wok, I prepared noodles. I've never done this before so I had to follow the instructions on the package: two cups of hot water to 50 g noodles, leaving them to sit for four minutes.

When I judged the food to be ready, it was time to serve. The final result was better than I expected, although next time I won't use sweet chili sauce but rather something else for a marinade, maybe something 'nutty' (although I'm not familiar with such a sauce). The final picture didn't come out too well because of the lighting: the portion was slightly more colourful than a brown lump.



I knew in advance that 500 g meat would be more than enough for two people but I ordered this amount of purpose so that there would be enough food left over for a few more days.

Thursday, August 08, 2019

Night walking

I've been very busy in the past few weeks, although not with anything worth writing about. Despite the heavy schedule, I've managed to fit in a long walk (3.75-4.15 km) every evening. Due to the heat (and sometimes the schedule), I've only been able to start walking at 19:30, and as the days are getting shorter, the final part of the walk has been in the dark.

I became aware of this problem a few weeks ago and decided to purchase a few items to make the walk safer: a 'head light' for me and a flashing collar for the dog. Five minutes with Ebay sufficed to order what I needed.

This is what I bought for myself: as always, it looks better in the picture than it does in reality. I think that the lamp appears here to be slightly larger when compared to the head band than what it really is. The lamp can be angled so that it points at the path just in front of the walker as opposed to lighting up the general area. I haven't decided which is better: I think that it's more important that approaching vehicles see me (there are very few at the time when I walk along the way) as opposed to lighting my path.

There are a few settings for the lamp: strong, normal, flashing and off. I used the strong setting but I may reduce it to normal.


The dog collar also comes with a few settings: quick flashing, slow flashing, completely on and completely off. I ordered a red collar which I set to quick flashing. I took a few pictures of the dog with the flashing collar but they all came out without the flashing. I'm not too sure whether the collar is sufficiently visible in the dark as the dog's ears seem to mask most of the light. 

Tonight was the first night that I needed the lamps, and then only on the return leg. 

Saturday, July 27, 2019

10 years of post-graduate study

Ten years ago, I wrote "As of yesterday, I am a fully paid-up student in an MBA programme which is being run at Ramat Gan college. The degree is awarded by Heriot-Watt University, or the Edinburgh School of Business". I didn't go deeply into the reasons for starting that MBA degree, and from there, the doctorate, but today I can state them simply as
  • wanting to alleviate my intellectual 'itch'
  • wanting to see whether I was worth something in objective terms
I can see that both those reasons were fulfilled - one might say, even over-filled. I have learnt a great deal throughout these years although to be honest, I haven't seen myself applying much of the material. What I have learnt is an intellectual rigour which I certainly do apply frequently. 

One thing which I do regret is not making more contacts. As I wrote during the MBA years, everything was anonymous and I only got to know a few people by name. Most people use an MBA degree as a means of making contacts, but that wasn't the case here. On the other hand, I doubt whether there were many ERP managers in the programme.

Friday, July 26, 2019

Smart watch? I call it 'stupid watch'

I ordered via the Internet for about $5 this soi disant 'smart' watch  which arrived a few days ago. Since then I have been scratching my head in order to discover how to charge the internal battery: the instructions say to separate the strap from the watch itself, which will reveal a USB plug. I did this, but the revealed 'plug' seemed somewhat unusual and was also at a strange angle which made fitting it into a computer USB port problematic. Today I finally figured out how to charge the battery, and after an hour or two, I was finally able to turn the watch on.

Originally the watch showed the time 00:00, but at some stage it managed to synchronise itself, so it is now showing the correct time and date. The skimpy instructions said to download a specific app on one's smart phone then to bind the watch to the phone via Bluetooth. So far, so good. It might well be that this binding caused the watch's hour to synchronise.

Apart from that, there has been virtually no contact between the watch and the phone. At one stage I accessed the 'healthy menu' on the watch which supposedly showed my pulse, blood pressure and oxygenation level (and broadcast them to the phone) but I take those values with a grain of salt. These values have been transferred only once. I've just come back from a dog walk which the phone reports as about 2000 steps but the watch seems blissfully unaware of this. Via the 'sports menu' I activated the 'walking' option but it seems not to recognise my steps. 

I bought the watch primarily in order to measure something about my swimming. If the walking is any indication, then I'm not going to get any information about the swimming either. As this watch is a no-name brand, there's no specific place from which I can get more detailed information. Maybe it will be like my mp3 player which has a terrible user interface but works well when one understands (or figures out by serendipity) how to use it.

Presumably I had high expectations which have not been matched. What do you expect for $5?

Thursday, July 25, 2019

Running a procedure from a screen trigger

My experience of Priority version 18.2 is that whenever I do any screen programming such as adding a field to a form or debugging a trigger, other users get an ugly error message on their screens which they promptly send to me. As a result, I have stopped doing such programming during the day (although I often prepare triggers in Notepad so that I can copy them later on).

In an attempt to improve the situation, I wrote a minimal trigger which then calls an external procedure (this was hinted at in an earlier post). This technique allows me to make changes in the procedure without updating the screen and so is very useful.

Of course, these procedures work when I run them, but it transpires that users have problems with them - they are lacking the required permission to run the procedure. There is a simple solution to this which I have to remember: the procedure has to be added to a menu and the users have to have permission to this menu option.

Sunday, July 21, 2019

Saturday swimming

As opposed to the previous Saturday, yesterday I woke up at 6 am, feeling fresh and sharp. I took the dog for a 3.5 km walk, had breakfast, put chicken drumsticks and frozen vegetables in the slow cooker for lunch then got ready for swimming.

This time I swam 30 lengths, being prevented once again from swimming any more by the need to urinate. I looked this up on the Internet and here is an explanation in layman's terms.
  1. The cold water [in the pool] leaches the heat of the blood vessels that lie near the skin surface.
  2. The blood vessels constrict, hence there is decreased flow of blood in the body’s extremities in a bid to conserve heat.
  3. This prompts a quick increase in blood pressure.
  4. The body responds to this by compensating for the increased arterial blood pressure by relieving itself of liquid.
  5. The quickest and easiest way for your body to do this is to pee. 
I get out of the pool and make my way swiftly but in a dignified manner to the toilet in the changing rooms. On my return, I drink a bottle of water, thus countering the mild dehydration which occurs in the pool. I seem to be the only swimmer affected by this: maybe the others pee in the pool (although I doubt it).

Yesterday I tried something new (not connected with urination): instead of simply moving my arms as part of the swimming motions, I tried stretching them out and tensing the muscles. The idea was to have a little more exercise. I've noticed that this year I'm swimming with much less effort than before: in the past, I had to concentrate on matters like breathing properly but this year the swimming seems effortless. Despite this, my throat dries out: that's what happens when one breathes through the mouth all the time. This is unpleasant when I have to swallow, but then I don't swallow when I'm swimming, only when I have a brief rest after every ten lengths.

Saturday, July 20, 2019

More on Movie Maker

I remember reading a few years ago a question which asked which version of Movie Maker (MM) was recommended for Windows 7 (it might have been Windows 8 or even Windows 10) as MM no longer comes bundled with Windows. The answer was version 6.2, which was regarded as a compromise between interface, functionality and memory handling. 

After the great disk failure, I had to find to find the source to this version again. I ended up with version 6.0.6002.18005 which had the interface and functionality that I remembered along with poor memory handling. The problems which I had yesterday when working with the Greece video were exacerbated when I tried to 'publish' the movie, i.e. create a composite which can be viewed by the computer, on the television or even on a mobile phone. The program choked after completing about 81% of the video: the resulting file was watchable but lacked the last few minutes (Delphi). I tried to publish the file several times, but each time it crashed at the same spot. I don't know whether there was something wrong with the video stream at this point or whether the program was not capable of more; I don't really care what the reason is, only that I didn't have a complete film.

I tried to find a solution on the Internet; I came out empty handed regarding the version which I have but there was a suggestion to use a more modern version, so I downloaded something which turned out to be MM 2012. This is 'abandonware' which is problematic. The interface is completely different, using the ribbon as in Office programs from 2007 upwards. The program read in the project file and pointed out that some functionality might be lost. Otherwise it seemed that the program could deal with the Greece video: publishing created an mp4 file which was just under 2GB in size (about twice the size of the file from MM 6). I transferred the file to a memory stick, then connected the stick to the television in order to watch in style. Most of the video was ok, but some of the pictures had not been rotated - this is probably what the warning message was about.

This morning, I reloaded the project file (there is now a new one with a different format) and tried to use MM 2012 to correct the rotations. First of all, the program runs very smoothly, which is a great improvement on the earlier version. I was able to find the pictures and rotate them, then publish the project. There are several publishing options available, each resulting in a different sized file. The one I'm using requires about 43 MB/minute; there's one format which requires about 170 MB/minute! There is also a more compressed format (about 10 MB/minute): I'll try that and see what the output is like.

It is not clear how to use the interface of MM 2012 in order to create a video from scratch. I shall have to play with it a little in order to learn it. There appear to be very few effects and transitions, which some might view as a loss: the only effects that I use regularly are rotating pictures and cross-fading between shots, so this isn't a problem. So far, I've found nothing like the 'story board' view which MM 6 has and makes creating videos easy. Should I start a video with MM 6 then transfer to MM 2012? Maybe.

Friday, July 19, 2019

Making the Greece holiday video

The OP is on holiday (again) so I have time on Fridays for my personal projects: the major one is completion of the video of our Greek holiday. I had worked on this in the past as the Andros section was complete; over the past few days I have completed the Athens/Delphi section. I am making the video by means of the program Movie Maker (MM), which works well when a video is only a few minutes in length, but slows down tremendously when working with a long video. The Greece video is just short of an hour in length, so progress in the past few days has been tortuous.

I discovered a new technique with this program - fading the audio track. In one of my previous holiday versions, I created and edited the audio clips outside of MM, trying to ensure that they were of the correct length. Today I found out how to do this within MM: one has to split the audio at the place where the fade is to begin, then marks the split portion as 'fade out' (or in). This was necessary as the pieces of music didn't match well with the video.

For the first twenty plus minutes (the entire Andros section), I used traditional Greek music featuring the bouzouki. I had to search quite hard to find something which wasn't fast and rhythmic. The Mars Hill section naturally has a soundtrack of hang drum; the changing of the guard, Segway and Delphi sections have a soundtrack of traditional lyre music.

Thursday, July 18, 2019

Sending data to a procedure

Within Priority, there exists a documented method for sending data from one procedure or trigger to another procedure or report. I use this frequently when building procedures which by means of the scheduler will send reports by mail. The procedure uses a local copy of one of the 'stack' tables (normally STACK which has precisely one field - ELEMENT - which is of course the table's primary key). For example,
:GROUP = 'NO_CNC'; EXECUTE WINACTIV '-R', 'TEST_NOPROD_METAL', 'STACK', :$.STK, '-g', :GROUP;
What if one wants to send an order to be printed? In this example, an entire record from PORDERS (purchase orders) is copied into a linked table of purchase orders, which is then sent to the WINHTML program.
INSERT INTO PORDERS SELECT * FROM PORDERS O WHERE ORD = :PORD; :FNAME = STRCAT ('D:/PR_SQL/GLASS/', :PAR2, '.pdf'); EXECUTE WINHTML '-d', 'TECH_WWWSHOWPORDER', 'PORDERS', :TMPORDERS, '-pdf', :FNAME;
Sometimes I want to be 'clever' - whenever I hear someone say that, there exists the possibility of making an error. When I want to expand a part's bill of materials, I use a similar technique of entering data into a linked table of parts, but I can also add specific data into a field, data which does not exist in the 'real' table of parts, e.g.
INSERT INTO PART (PART, PARTNAME, FATQUANT) VALUES (:PART, :PNAME, :QUANT);
where :QUANT is a variable which receives its value during the procedure. The very laboured point which I am trying to make here is that at a minimum, one has to insert into the linked table the unique key of the record, along with the automatic key, if it exists. I forgot this the other day when I was working on the procedure to print a chained list of meetings: at first, I used only the automatic key without success. Only when I added the unique key did the called procedure do its job. Had I used the 'INSERT INTO TEST_PHMEETINGS SELECT * FROM TEST_PHMEETINGS A' technique then I wouldn't have had a problem.

Later that evening whilst showering (which is where I do all my heavy thinking), I realised that I could have used a linked STACK table and pass the automatic key. Yes ... and no. This became clear to me during the training session for the meetings when I wanted to print just the current meeting: there would have been no result had I used the STACK technique, for the screen passes a record of meetings to the procedure. Fortunately I had used the correct technique for the printing procedure so this wasn't a problem.

So again: at a minimum, one has to insert into the linked table the unique key of the record, along with the automatic key, if it exists. It might well be easier simply to insert a complete record.

Wednesday, July 17, 2019

Losing weight

Although I have hinted in the past few months that I have been losing weight, I haven't made a clear statement on the subject.

On 8 Feb 2019 I weighed 83.0 kg and on 15 March I weighed 82.8 kg: I thought that this was the heaviest I have ever been but checking my records, I see that on 4 Oct 2013 I apparently weighed 85 kg! Obviously I must have done some dieting for my weight went down to 78.5 kg by 31 May 2014.

This morning I weighed myself and apparently I now weigh only 77.9 kg which means that I have lost 5 kg since February. My BMI is now less than 30 which is very good news. I wonder how much more weight I can lose ... and not regain.

Over the past few weeks, I have been slowly extending the distance that I walk in the evenings (or early Friday and Saturday mornings): on Sunday and Tuesday I walked just over 4 km in around 40 minutes, a pace of 10 minutes/km or 6 km/hour. This is on roads, including going up and down a hill, so there is more effort required than walking on the level for the same distance. I would have walked on Monday as well, but at around 2:30 pm I was suddenly struck by a headache and felt out of focus all afternoon and evening. I don't know whether it was a migraine as paracetamol seemed sufficient to take away the pain. I didn't go swimming on Saturday either as I woke up late (for me - 7:15 am) and was dopey until about 10 am. Obviously the body needs some rest.

All this is very good. I don't get a "walker's high" (i.e. release of endorphins) which is a shame: by the time I get home, my shirt is wet with sweat and I am breathing heavily. I drink a few glasses of cold water (calorie free!) to help me get my breath back. The dog breathes heavily as well.

Monday, July 15, 2019

'Meetings' module in Priority - complicated!

My CEO asked me several years ago to develop a module in Priority in which would be recorded all the visits to our display rooms by outside visitors. I developed something but no one used it and so it lay forgotten. About a month ago, the CEO again made the request as we now have a receptionist who is 'prepared' to enter the relevant data, so I examined what I had developed previously. 

The first major problem was that my original development assumed that visitors would already have an entry in the Contacts table of Priority, linked to a customer. The CEO specifically requested that this module be able to record details of any visitor, not just those who already have a record. This required adding three fields to the Visits table: name, mobile number and email. I went a bit further with this: if the name already exists in the Contacts table only once, the mobile number, email and customer will be taken from the Contacts table and added to the Visitors table. If the name exists several times, the user can choose one of the customers to which the contact is connected. I added a mechanism to connect the visitor to a customer post factum, assuming that a suitable customer had been created.

My original development included the possibility of chaining visits: if the outcome of a visit is a continued visit then the module would automatically add a new visit with the same details as the original visit but taking place a week later. On the basis of this chaining, I developed a report which would give details of all the chained meetings, including free text. This included some code to find the 'head' of a chain and then continue from there.

Whilst discussing the module with the receptionist who is going to enter the data (this was not the training session), I realised that a meeting could take place with several outside visitors. How would this work? My solution was to add a details table in which extra visitors could be added; in order to simplify reports, the contact details in the main screen would be added to this details table. As a result, any report which wants to list all the participants need access the details table only.

But this addition ruined the chained meeting report: apart from the singular data of a meeting (person, place, time, etc), there are also multiple data - the free text. Adding more multiple data - the participants - caused the text to appear for every participant. This is what happens with many documents in Priority: an order has a header, order lines and order text. One expects that each will appear separately. This is achieved by creating what we call an HTML document, which is a complicated type of procedure.

Here the real problems started and it took me a while to figure out what to do. My intention was to build a list of visits then send this list to the procedure which would print them out. First I had to develop the HTML document which is far from simple. There were two main "gotchas" -
  • The procedure starts with an INPUT stage, where there is a parameter PAR linked to the field DOCNO. As there is no screen with the same name as the Visits table, one has to enter into the continuation sub-form the name of the screen. This is the same as in WWWCUSTCAMPAIGN.
  • In order to display the name of each sub-report in the final document (e.g. 'Participants'), one enters the HTML definitions sub-form of the the sub-report and records D in the field 'display title'.
After a bit of playing around, I managed to get the HTML document to display as I wanted it. The next step was to write a separate procedure which would build the chained list of visits. I cannibalised my original procedure, getting the key fields for each visit then inserting them into a linked table of visits. This took a few attempts to get right, but eventually I succeeded. 

So now I have what seems like an effortless way of printing chained visits. Tomorrow I will be giving the training session so there may be more changes on the way. One problem which I can foresee is that at the moment all the participants have to come from the same company, or not come from any company at all. It is conceivable that they will want to document a visit in which participate several people from several companies. This will probably mean adding a customer field to the details table and changing the 'find person' code.

Thursday, July 11, 2019

The difficult negotiator returns

Several years ago, whilst in the middle of my MBA course on negotiation, I quoted a chunk of the text as it describes beautifully someone with whom I have to deal with occasionally at work. There is not one person that I know who has a positive relationship with this person, except perhaps his wife who also works with us - a clear conflict of interests.

Today this person telephoned me and proceeded to rant for several minutes, claiming that his emails are the epitome of clarity and that there must be something wrong with me that I don't understand grade 1 Hebrew. At the end of the call, I was shaking like a leaf and my mouth had gone dry: a pure physiological reaction to speaking (or rather, listening: he doesn't let me say anything and ignores most of what I have to say anyway ) to this person. 

A few minutes after this, my manager called to see whether I was OK. She didn't know about the above phone call but presumably intuited that something like this would happen. If I were not such a dedicated worker, I would go to a doctor to try and get sick leave: this person is causing me psychological and physical damage and it's not something that I can control. She is going to tell this person not to telephone me ever and that every communication must be by email. Let's see how long that will last.

When I managed to calm down sufficiently, I looked at the email which I had difficulty in understanding. It turns out that there is a small but very significant spelling mistake which totally changes the meaning of a sentence. No wonder that I misunderstood.

I sent another email, explaining that I had implemented the changes that he wanted and that he would have to make a small change to a certain screen in order to see the change. The response: "I don't understand". This is not the first time that he has written thus.

This is someone who berates me for not understanding his unclear Hebrew, but when I write something (and many people have told me how clearly I write), he doesn't understand. So I spell it out in complete detail whilst trying very hard not to condescend or patronise. 

This kind of person always has to have the last word and is always right, even when he is demonstrably wrong. We had another exchange of emails a week or so ago which left me scratching my head - he had made a mistake in a part number which I didn't understand. When I pointed this out in excruciating detail, he finally admitted that he had made a mistake. People on my side considered making a poster from that email.