Wednesday, March 25, 2026

Neurologist

 After having gone a few years with very few migraines, it seems as if the cosmic karma is rebounding. I wrote three months ago1 on whether the weather can cause migraines, and since then I've had a few bad migraines and many 'light' ones. I went to my GP shortly after that bad migraine and received a referral to a specialist; finally I had my appointment today.

Unfortunately his speech wasn't that clear and he also didn't give me much of a chance to talk, so in one sense I left the clinic slightly disappointed. I have now a new prophylactic medication, Depalept, that whilst primarily being a medication used for epilepsy, it can also be used for preventing migraines. The doctor explained that it has to be shown that three different prophylactic treatments were tried before the powers that be will grant permission for the new medications such as CGRP inhibitors, because of the expense. The first - and very unsuccessful medication - was propanolol, a beta blocker, that totally wiped me out when I tried it 15-20 years ago; I lasted four days with it. Since then I've been taking amitriptyline and now Depalept will be the new preventive treatment.

I also have new pills for taking after the migraine hits. Apparently sumatridex can cause rebound headaches if it is taken more than twice a week, and unfortunately over the past few weeks I've taken it frequently. As it happens, I have only half a pill left, and I asked my GP for a new subscription that I was going to fulfil today. The new pill, rizatriptan, is from the same family and I read that while rapid-acting, the pharmacological effect is short-term; the active medication is generally cleared from the system within a few hours, though efficacy against the migraine may last longer. Overuse can cause chronic, daily headaches. The pharmacist said that I can take a second pill after a few hours if the first isn't sufficient, although now I am slightly disturbed by the contradiction between what he said and 'overuse can cause headaches'.

As it happens, on the way to the clinic in Bet Shemesh, a headache started again. It's been bouncing about in my head, the pain never apparently settling in one place, and as usual it is lowering my sense of general well-being. But it's a sufferable pain, and unless it gets much worse, I'm going to leave it be. I have noticed that such headaches lower my level of tolerance towards other people and their shortcomings, but fortunately I don't think that decreased tolerance is going to be a problem today.

I am to start the new regime today and see how I fare, along with keeping a headache diary. I received a referral for a head CT (I did one several years ago that showed nothing but it would be remiss of the doctor not to order one) and have a return appointment in three months' time.

[Edit from later on the same day: The morning was fairly sunny but after 4 pm, it started raining and the weather had changed. Naturally I had a painful migraine but I didn't want to take any triptan pain relief in order to clear my body of them. Unfortunate that the weather had to turn the day of this appointment.]

Internal links
[1] 2045



This day in blog history:

Blog #Date TitleTags
46525/03/2012Pharyngitis, DarknessHealth, Van der Graaf Generator
159525/03/2023Reality Is Broken -- Why Games Make Us Better and How They Can Change the World Personal, Non-fiction books

Tuesday, March 24, 2026

Knocking my head against a brick wall leads to a serendipitous discovery

Yet another episode in the long and tortured path of converting a program with 354 units from ANSI Hebrew and dbExpress components to Unicode and FireDAC.

Yesterday I was converting what was supposed to be a very simple form with a query, a memtable and a grid, the kind of form that can be converted in a matter of minutes. Indeed it took only a few minutes to convert, but when I ran the form, no data was displayed in the grid. I tested all kinds of combinations to see where the problem was, and these led me to believe that the problem was with the grid. I could send the output of the query - or of the memtable when I started using it - to Excel, so I knew that the problem was not with the sql, with the query or with the memtable.

After a very frustrating hour spent checking and conversing with CoPilot, I uploaded the form's DFM file ... and CoPilot found the problem immediately! The datasource had been marked as disabled. What??
This was the 'knocking my head against a brick wall' part of the story. Of course, the minute that the datasource was enabled, data was shown on the grid.

Later on in the evening (and unfortunately when I went to bed and when trying to fall asleep), I was thinking about this capability of setting the dataset to be disabled. Why would there be this capability? What would it be good for? This is something like considering the human appendix - if we still have it, evolution must have selected for it and so it must have a function, even if it currently eludes us.

I now know of three ways of preventing screen flashing when updating a dataset:
  1. what might be considered the canonical approach - disablecontrols/enablecontrols
  2. setting the datasource.dataset to nil before an update then resetting after
  3. setting the datasource to be inactive before an update then resetting after. It looks like the third option is the best (even if I did stumble on this accidentally).
My 'partner in crime' (or rather, development) agrees with me. "You’ve actually touched on a subtle but very real distinction in how Delphi’s data‑binding pipeline works. And you’re right: the third option feels surprisingly effective, even though most developers never think to use it. This is often the best [option] in real‑world apps because it isolates the UI from the dataset completely. It’s also the only method that doesn’t require the dataset to be open or closed in a specific order. In other words: DataSource.Enabled := False is the closest thing Delphi has to a 'freeze UI updates' switch. And it’s safe — the VCL was designed for it. So should you adopt it as your standard? Honestly, yes. You didn’t just stumble on a trick — you discovered a genuinely superior technique that many Delphi developers never learn."

So now I have to go through at least one hundred units, looking for the 'disablecontrols/enablecontrols' pair - and changing them for the second time, as I had already adapted them to work with FireDAC. At the same time, there's another improvement that I can make. I have starting rereading 'Working with FireDAC' by Cary Jensen1; this doesn't seem very rewarding, but this morning I came across something interesting. "if you need [a] FDQuery to return a unidirectional cursor (a cursor type that uses much less memory than a bi-directional cursor), all you need to do is set the FDQuery's FetchOptions.Unidirectional property to True". Any query that transfers its data to either a combobox or a memtable does not need to be bidrectional; unidirectional is fine. Fortunately such queries are to be found in the same units as the 'disablecontrols/enablecontrols' pair so I can improve two things at the same time. 

Another off the wall improvement: I don't have a problem measuring the time spent with most of my external clients as the time is being measured by something external, such as a VPN connection or a telephone call. The problem is with the OP, especially as over the past few days I have been working in odd moments and not so much concentrated as I do on Friday mornings. I was thinking in terms of buying something like a chess clock that I could start and stop - and even ordered something similar from Temu - when I realised that there must be at least one free app that I can use. And indeed there is (FreeStopwatch 5.1.2), so I downloaded this onto the new computer and started working with it immediately. Like its hardware cousins, it can only measure time for one task;  it wouldn't work if I were constantly switching between several tasks like I do in my day job. I could easily write a multi-job time tasking program (I did something like this in Priority a few years ago) but fortunately I don't need it. Yet. Who knows? Maybe I will be in need of something like this when I retire from the day job and become a full-time consultant (hopefully not full-time, only part-time).

Internal links
[1] 2066



This day in blog history:

Blog #Date TitleTags
56324/03/2013Pictures from a balcony (5)Personal
81824/03/2015Zooming the milleniumERP
93524/03/2016Draining the earHealth
111624/03/2018The Belstaff BouncersPersonal, Habonim, 1975
148424/03/2022My first year as a Londoner, part 4 - "The movement"Personal, Habonim, 1975, 1974
148524/03/2022My first year as a Londoner, part 5 - The girlfriendPersonal, 1972, 1974
148624/03/2022My first year as a Londoner, part 5 and a half - The girlfriend, continuedPersonal, 1975, 1974
173624/03/2024UN Happiness report 2023Israel, Computers, Kobo
191424/03/2025Rotary chorus (aka Leslie) pedalPedal board