Thursday, January 13, 2022

Desiccated apple slices

As I mentioned about a week ago, our Ninja grill has five functions: grill, roast, air-fry, bake and dehydrate. I've already grilled and air fried; maybe one day I'll roast some beef in the machine but I can't see myself baking anything. This leaves the 'dehydrate' function. I made a quick search looking for recipes and found three variations on the same thing: desiccated apple slices. 

One slices an apple into thin slices (I found that the slices that I cut from the apple weren't particularly thin, but that I was able to slice them in two once they had already been cut from the apple) and places the pieces in the Ninja vegetable dish, adding a little lemon juice (to prevent browning) and cinnamon. One then chooses the 'dehydrate' function whose default temperature is 60°C and default time 6 hours (!). I was tempted to turn the Ninja on at 9 pm before going to bed; true, it would finish cooking at 3 am whereas I get up at 5:30 am, but in that extra time the heating would be turned off and anyway the extra time would serve to further desiccate the slices. But my wife demurred....

So I left the slices in the basket, and turned the Ninja on when I got up in the morning. After three hours, I opened the lid and tasted a slice - chewy and not dry. An hour later, the slices had improved but still not there yet. After five hours, I tasted a slice and decided that the slices had been dehydrated sufficiently.

I am now eating those slices; they're ok, although I just ate a slightly thicker slice and can tell that this one was not totally dehydrated. Whilst it might be cheaper to make one's own apple slices, I don't think that I'll repeat this. Maybe it would work better with banana slices, but I'm not allowed to eat bananas any more - too much potassium, and of course, the dehydration has no effect on the potassium level.

Tuesday, January 11, 2022

Ninja chicken (2)

Today was the turn of chicken drumsticks to be cooked in the Ninja grill. The recipe (if it can be called that as it's so simple) requires that the air fry option be chosen, as for a whole chicken. After drying the drumsticks, brushing on them a thin layer of canola oil and sprinkling on them some oregano, the drumsticks were cooked for 10 minutes at 200°C, turned over then cooked for another 10 minutes.

It is recommended not to cook more than six drumsticks at one time; I cooked three, more as a test than as a complete meal. Canola oil is used because the smoke point of olive oil is 180°C and is liable to break down and cause smelly by-products at this higher temperature.

Again, the primary saving is in cooking time; I would often cook the drumsticks for an hour and a half (albeit at 180°C) although this is probably too long. I would also cook potatoes with the drumsticks - something that is missing here. I meant to put a halved potato in with the drumsticks but I forgot.

Monday, January 10, 2022

Displaying hints (2)

Continuing from yesterday's presentation about hints in a non-modal form, a more modern way of writing the code that I showed yesterday for hooking the application.onhint method would be

procedure TMyForm.ApplicationEvents1Hint(Sender: TObject); begin StatusBar1.SimpleText := Application.Hint; end;

This achieves the same result as my naive code but is much simpler. Unfortunately, it is also wrong as it again causes the active form to display hints that arise from other forms. Somehow there should be a way of checking from where the hint arises. Apparently the ApplicationEvents.OnShowHint event exposes the HintInfo object that includes a pointer to the control that created the hint, but I haven't seen an example of this, and the structure that I described yesterday (a grid on a tabsheet on a page control on a form) is liable to confuse this event.

The given solution is actually quite simple and depends on a function that tests whether the control creating the hint resides upon the current form.

function IsHintFor(AForm: TCustomForm): Boolean; var local: TControl; begin Result:= False; local:= FindDragTarget (Mouse.CursorPos, True); if Assigned (local) then Result:= GetParentForm (local) = AForm; end;

One places on every form that requires the hint handling a TApplicationEvents component, whose OnHint event is as follows

procedure TMyForm.ApplicationEvents1Hint(Sender: TObject); begin StatusBar1.SimpleText := Application.Hint;
end;

Easy peasy. So yesterday evening I went through the 'ERP' application and changed the hint-handling code in about 30 forms. I also added the above to a form template, meaning that I won't have to define this manually in the future.

Sunday, January 09, 2022

Displaying hints

In the OP's "ERP" program, recently I have been adding screens that display a list of items, normally dockets, where an action can be applied to the list, such as sending emails to all the people connected to the dockets, or changing the status of all the dockets retrieved. It is prudent to allow the possibility of removing a docket from the list (displayed in a grid) prior to executing the action, so I implemented a very simple 'remove' action that deletes the current item from the clientdataset that is in the background. This deletion does not delete the record from the database, of course.

Then it occurred to me that it might be beneficial to allow marking several items then deleting these in one go. At work, I jest that I am paid a bonus for every key press that I save workers; in this case, n + 1 key presses are required to delete several consecutive items as opposed to 2n key presses for single choices. So far, so good.

I then wanted a way to signal to the user that the grid accepts multiple choices. After turning this over in my head for a little while, I realised that the way to signal to the user is via a hint. There's nothing dramatic about this: the speedbuttons used in saved queries (see here) have hints defined. The standard mechanism for displaying a hint is a small window that opens near the control, displaying the help text, whenever the mouse hovers over the control. I can't explain exactly why, but this mechanism seems out of place; seemingly a better technique is to display the hint in a status bar at the bottom of the form.

The canonical method of displaying hints in a status bar is via the following code:

Constructor TMyForm.Create; begin inherited create (nil); ... Application.OnHint:= MyHint; ... end; procedure TMyForm.MyHint (Sender: TObject); begin sb.simpletext:= Application.Hint; end; procedure TMyForm.FormClose(Sender: TObject; var Action: TCloseAction); begin Application.OnHint:= nil; ... end;

I've used such code in several forms without any problem, but this time around, a warning light went on in my head: I keep on assigning application.onhint to a procedure local to a given form, but application is a global object! In other words, all hints will be displayed in the status bar of the last form to be created.  ☹️ I checked this out by creating two instances of the same form; one is active and one is inactive. When I moved the mouse over the inactive form, the hints appeared in the status bar of the active form. This approach is clearly wrong.

So how does one cause that each form displays only hints emanating from its own controls and not from other forms? After a great deal of spelunking, I found a partial solution that uses the undocumented messages CM_MouseEnter and CM_MouseLeave, that are sent whenever a mouse begins or stops hovering over a control. The form can trap these messages and display the appropriate hint.

This solution worked on one form but not on another; the first form had a grid placed directly to the form, whereas in the second form, the grid was placed on a tabsheet that is placed on a page control that is placed on the form. There was no way that my mouse messages approach would work here. It's time to escalate the problem to Stack Exchange.

... to be continued.

Saturday, January 08, 2022

Ninja chicken

The importers/distributors of the Ninja grills made an astute marketing decision when they managed to get one of their products placed in the Israeli 'Big brother' tv series. I don't watch such programmes but my wife does as do many other Israelis, and the demand for the grills was such that there was a three week month waiting period for them.

We purchased our grill (that has five functions: grill, air fry, bake, roast and dehydrate) a few weeks ago. We haven't done much with it so far: we grilled a few experimental steaks (that I don't eat) and I grilled some chicken breast with honey. Until now, I haven't been too impressed with the machine as it is recommended to grill only two portions at once. Today was a test of a different function: air frying. The test subject was a chicken.

The butcher was somewhat dubious that one could roast a chicken in the ninja (as the chicken would be too large), so we bought a small one. I found a recipe on the Internet that uses the air fry function - I wonder now why not use the roast function as that would seem to be more suitable.


The picture on the left above shows the closed ninja grill; the picture on the right above shows the uncooked chicken placed in the basket. There's plenty of room for some potatoes, had I decided to cook them as well. The recipe says to air fry for 30 minutes, after warming the ninja. The preparatory stage had finished when I took the second picture: the display is showing '[Add] food', so I added the food.

After 30 minutes, I opened the top and turned the chicken over, before air frying it for a further 30 minutes. On the chicken was olive oil and oregano.

The pictue on the above left shows the chicken at 'half time' and the one on the right shows it at 'full time'. The chicken tasted fine although it was somewhat bland (not necessarily a problem; I eat the breast which is always bland). We haven't had roast chicken for quite some time so I don't remember how roasting the chicken in the oven affects the taste.

Conclusions: cooking with the ninja required only 60 minutes as opposed to 90 minutes in the oven. I use the same temperatures (180°C) but the ninja has a smaller volume to heat and so should use less electricity (and of course, the cooking time is much reduced). On the other hand, one does have to clean the baskets in the ninja.

This experiment shows that one can easily roast a chicken in a ninja grill.

Note that I've learnt how to place two pictures side by side in the blog, although I would prefer a little space between them.

Friday, January 07, 2022

Fourth time around

Today was a crisp winter day: at 6 am, the skies were clear (although the sun wasn't up) and the temperature was a sprightly 11°C. By lunchtime the temperature had reached 22°C, making our afternoon walk very comfortable. Now (4 pm), we're starting the descent into darkness and lower temperatures. If only every winter day were like today.

But I'm not here to write about the weather: today I had my fourth Covid-19 vaccination, or my second booster, if you prefer. The announcement was made at the beginning of the week that over-60s would have the vaccination; via our health fund's website, I made an appointment for the next available slot, which was Friday morning. A minute later I logged on again to make an appointment for my wife - next Friday! Needless to say, I didn't make an appointment for her.

As I have probably written before, the vaccinations are done at the health centre in Bet Shemesh, which is sited at the end of a one way street with little parking. As a result, the road was almost impossible to traverse or park; as my wife still has an invalid badge on it, she felt entitled to take the vacant invalid parking spot in front of the building (if it had been me on my own, I would have parked a distance from the centre and walked).

Inside we saw about ten kibbutz members along with a similar number of town residents. I went to the ticket machine to get my reservation - R6 was my number. My wife received A35 - different queues. I was one of the few kibbutz members who bothered to book an appointment so I entered well before most of the others. Afterwards I had to wait about twenty minutes for my wife to come out.

So: yet another vaccination. A quick wipe of the shoulder, a prick, the muscle tightening, and then it's over. 10 seconds of exceedingly mild discomfort (and so hardly a discomfort: a light punch to the shoulder would have hurt more). Out of the three previous vaccinations, the only side effect that I had (twice) was a sore shoulder for maybe 12 hours, starting in the evening of the vaccination, so I'm not expecting anything more.

Of course, I'm hardly a person at risk of catching the omicron variant of Covid, as I stay at home most of the time, but one can never be sure. I do go out of the kibbutz every now and then, mainly for medical appointments (new sleep doctor next Tuesday!), so there does exist the small possibility of being infected. I believe that we'll all get infected at some stage, but that it will be a virus that causes almost no symptoms.

Wednesday, January 05, 2022

Sandy Denny would have been 75 years old today

One of the radio stations here in Israel just announced that had she lived, Sandy would have been 75 years old today. In her honour, they played "It'll take a long time", the opening track from her second solo album, "Sandy", from 1972. Tomorrow they promise to play many of her songs.

This isn't the first time they have played Sandy: quite often, the 'Unhalfbricking' version of "Who knows where the time goes" gets played, which is always a pleasure to hear.

I admit that apart from the songs that I have programmed onto my mp3 players (37 songs at various stages in her career: Fairport, Fotheringay, solo, Fairport, solo and a few demos), I don't hear that many outside of this group. I do have 'What we did on our holidays' and 'Unhalfbricking' ripped in their entirety on this computer to which I occasionally listen, but the unripped songs from 'Fotheringay', 'Fotheringay 2' and her solo albums remain a treasure that I am occasionally reminded of.

I find it hard now to listen to the early recordings, with all the beauty that they promised, and then remember her final recordings and what could be seen as a loss of talent and a tremendous waste. Who knows what would have happened had she lived; her early bandmates Richard, Simon and Ashley are still going strong whereas others have fallen by the way (Martin, Swarb, Trevor). Maybe at some time she would have regained her confidence and made good music?

Tuesday, December 28, 2021

Memory upgrade

Five and a half years ago, I wrote about purchasing a mobile computer; I'm surprised that it's so long ago (in computer terms). Since I started working at home, I've been using this computer as opposed to the mobile that I have from work, as mine has a bigger screen. I keep the other mobile ready in case I have problems; at one stage I used to keep one computer connected to work and use the other for Teams conversations.

I've noticed in the past few days that it's becoming more and more difficult to work with my home computer: it's slow in switching from one program to another. I use Remote Desktop Manager and Teams and Whatsapp and Chrome ... and there isn't enough memory for all of them. So Windows swaps out memory to disk, and it transpires that the disk is considered slow (at least, when compared to SSD). So these memory swaps make the computer seem even slower.

I got fed up with this. The original configuration had 6 GB memory installed - I went to my local computer hardware man and asked him to enlarge the memory as much as possible. The computer has 4 GB on board and another slot in which the extra 2 GB was installed, so the maximum that he could add was 2 GB (replacing the 2 GB memory chip with a 4 GB chip). So now the computer has 8 GB.

And it flies! Today was a real pleasure working with the computer. It seems that I was using the maximum possible, and a small increase in memory size brought a huge improvement in performance. A worthwhile enhancement. 

8 GB memory! I remember enlarging the memory of my first clone computer from 512 KB to 640 KB and feeling pleased. According to my calculations, 8 GB is more than 16,000 times larger that the memory in that first computer. 

Friday, December 24, 2021

Joan Didion, RIP

A formal obituary can be found here.

I first became aware of Joan Didion in the mid-70s: she was another author who appeared in Tom Wolfe's "New Journalism" anthology. I'm not sure that the word "enjoyed" can be applied to her chapter in the book about San Francisco in early 1967, but I found it very enlightening in historical terms, having been slightly too young to have read about that period when it occurred in real time.

Shortly after, I found her collection of articles, "Slouching towards Jerusalem": this definitely was enlightening. Of all the articles, the most interesting was "On keeping a notebook", written in 1966 but referring to events that happened a few years earlier. This was a most personal article and at the time this was exactly the sort of material that I was looking for. 

We forget all too soon the things we thought we could never forget. We forget the loves and the betrayals alike, forget what we whispered and what we screamed, forget who we were. I have already lost touch with a couple of people I used to be; one of them, a seventeen-year-old, presents little threat, although it would be of some interest to me to know again what it feels like to sit on a river levee drinking vodka-and-orange-juice and listening to Les Paul and Mary Ford and their echoes sing “How High the Moon” on the car radio. (You see I still have the scenes, but I no longer perceive myself among those present, no longer could even improvise the dialogue.) The other one, a twenty-three-year-old, bothers me more. She was always a good deal of trouble, and I suspect she will reappear when I least want to see her, skirts too long, shy to the point of aggravation, always the injured party, full of recriminations and little hurts and stories I do not want to hear again, at once saddening me and angering me with her vulnerability and ignorance, an apparition all the more insistent for being so long banished.

Whilst I did not sit on a river levee drinking vodka-and-orange-juice at the age of seventeen, I can very much appreciate the sentiment, especially about the twenty-three-year-old me. Whilst I never kept a notebook or a journal, I used to be a copious letter writer. Unfortunately, what I remember as hundreds of letters that I wrote before about 1985 are lost; sometime in the mid-80s, I started writing letters via a computer and so I have copies of all those letters. Then I moved on to blogging, which in many ways is simply the modern variant of a journal, except that here, blogs have a start, a middle and an end. They are not random jottings but are about something.

In the early 80s, I bought a copy of her latest book (as it was then), "The white album". This collection piqued my interest less: there was a chapter about Jim Morrison and the Doors and there was another chapter containing some information about amitryptiline, but otherwise I was left untouched. I bought a copy of one of her novels (I think this was "River Run") in the second-hand bookshop in Rehovot that I used to frequent, but I found this opaque.

Still, I found Joan to be a very intriguing person. I never had a clear mental picture of what she looked like so here is one from 1972.


Joan Didion in Vogue in 1972. Photograph: Henry Clarke/Condé Nast/Shutterstock


 

Wednesday, December 22, 2021

Janis Ian

When I emigrated, one of our group had the LP "Between the lines" by Janis Ian. In those days I was quite the magpie regarding music (as if I'm not, now) and so I taped the record. Over the years I came to love most of the songs on the album, and some time in the 1990s I bought the cd.

"At seventeen" was a very good song then, and even now, I greatly appreciate its lyrics. Janis writes in her autobiography: I was alone in the apartment, absentmindedly playing a little samba part on the guitar while I read an article about debutantes. The woman who’d written it was talking about her coming-out party, how excited she’d been before it, how flat she’d felt in the aftermath. The opening line was “I learned the truth at eighteen.” Interesting line, I thought. Might be a song in there somewhere. I hunted around for a melody to go with my samba lick, and tried the line. Nope, it didn’t scan. I needed another syllable. I learned the truth at seventeen, I sang to myself.... I stared at the paper. How could I write about high school girls, or prom night and homecoming queens? I hadn’t had any of those experiences. I thought about that for a while. There were plenty of other school things I had experienced. I knew what it was like to never be asked out on a date. I knew the sinking feeling when everyone else in class came in to find a valentine on their desk, and yours was empty. And I sure as heck knew what it was to feel clumsy and ugly. I could write this song, I was sure of it.

But to be honest, I love the opening two songs (including "At seventeen") and I love the last two songs, especially the closing song ("Lover's lullaby") but not so much the songs inbetween. The music theorist inside of me has to point out that the first two verses of "Lover's lullaby" are in 4/4 time but the rest is in 3/4.

At some stage I had on cassette a few more songs ("Jesse", "Stars") along with another album that included "Hopper painting" (that's the only name that I remember; maybe I only had this one song). Scouring YouTube didn't bring up many other songs, if at all. About a month ago, I went on a Janis Ian kick and discovered most, if not all, of her discography; certainly all of the pre-1990 records. I listened to most but didn't connect with them, especially her early   albums (with her breakthrough hit, "Society's child").

On the other hand, a record that might be called "Janis Ian II" captured me: this is the album that contained the aforementioned "Hopper painting", as well as several more songs that seemed extremely familiar. I find now that I am preferring this record to "Between the lines", although of course there has to be one song that I don't particularly like ("Hotels and one night stands"). Janis herself doesn't care for this album, writing It was painful, hearing songs that had seemed vibrant when I’d demo’d them reduced to flat, uninteresting recordings. Joe [the producer] was from Los Angeles, and my album ended up reflecting the current L.A. sound, over-smooth and dulled around the edges. I hated it. When I heard the mastered record Janis Ian II, I wanted to throw it out and start over again.

I beg to disagree. I very much like the piano based songs.

Below appears Janis as she looks today (or, at least recently).


Saturday, December 18, 2021

Further thoughts on running Excel from a background thread

As I'm on a thinking roll this morning, I thought that I would document some thoughts that I have about code that I wrote just under a month ago that runs Excel in a background thread. Specifically, I want to address the problem of passing two discrete ranges to Excel, where each range has to have a different format (for example, E:F should be integers and G:H should be floats). At the moment I can pass E:F,G:H (i.e. two ranges) but they will both receive the same format.

It seems that what is needed is to pass a stringlist, where the first string would be something like E:F,i and the second would be G:H,f. In other words, each string would be composed of two parts separated by a comma: first a range then a character indicating what the format should be (i=integer, f=float, of course).

That's a good idea.

A fruitful day, part three: continuing work on PrioXRef

I devoted about an hour and a half in the evening working on my Priority Cross-referencer and syntax checker. The details can be found on the other blog so I'm not going to write about them here. I just wanted to say that these hours were a bonus on top of what had turned out to be a very successful and fruitful day.

There are innumerous blues songs that start off with the words "I woke up this morning"; a quick search revealed "I woke up this morning/The blues all around my bed" (link); "I woke up this morning, feeling round for my shoes" (link); and "I woke up this morning with a awful aching head" (link). On the other hand, there's the perky song "You were on my mind" that also starts with "Well I woke up this morning and you were on my mind".

If I were writing such a song, it would start "I woke up this morning with ideas in my head"; it seems that the intellectual aspects of yesterday had passed from my left brain to the right, that started  ruminating on them, a process that lasted all night. As a result, my walk with the dog (and prior to that) had me thinking of

  • A replacement line for the new song "Building the life"
  • What to write in the latest draft thesis version
  • That I hadn't considered all the possible cases of 'LOOP' appearing in a Priority procedure. 
And now that I write that line about LOOP, I realise that there is also a case where RETVAL can occur outside of a cursor (after a 'select ... into' statement). Oops.

A fruitful day, part two: A conversation with my doctoral supervisor

As I noted about a week ago, my DBA supervisor had been ill with Covid-19 and then an ear infection took advantage of his weakened immune system, so it was a few weeks before we could talk about my last draft thesis version. He sent me some comments about a week ago that were easy to incorporate and  suggested that we talk on Friday about the problems that I saw with analysing the data from the pilot study.

As I told him, these conversations are always very valuable as they include a certain amount of brain-storming as well as giving me a push to continue work on this seemingly never-ending work (at this point I should state that I have exactly one more year to go - if I don't finish by December 2022 then that's that. I also paid tuition for this final year, a process that I don't want to go through again). The conversation brought up two new topics to be looked at - more material for the literature review - but more importantly shone a light on the direction of the research. It is so easy to concentrate on discovering whether and why the enhancements being studied succeeded, but that's not the real question, which is ...

How does the process of developing the enhancement affect the degree of success? Or in other words, would a failed enhancement have succeeded had the process been different/better? What could be done to improve the process in order to improve the probability of creating a successful enhancement?

The above three questions are really one; they're just phrased differently. And anyway, I'll have to translate them into Hebrew before asking them, so the subtleties may get lost (the subjunctive mood barely exists in Hebrew).

This morning, whilst walking the dog, I considered yesterday's conversation. At one stage I was tempted to run another pilot study that would include the above questions, but by our walk's end, I realised that the pilot did what it was supposed to do: check the methodology and suggest questions that weren't asked. The new questions can be asked in the 'real' research.

I'll probably work a few hours today and in the following days incorporating this new material and direction into the thesis. There will also be the new topics to research and possibly write about.


A fruitful day, part one: "Building the life" (new song)

Yesterday (Friday) didn't start off very promising - there was a light drizzle that doesn't help the plants but gets me wet. Weather like this always semi-paralyses me: I had to make a conscious effort to do things and not sit back and wallow in the dismal scene. I can see that this is going to be a very long blog so I'm going to split it into three, so readers that are interested in one topic don't have to read about something completely different.

Friday mornings generally start with a conversation with the Occupational Psychologist; following our hour-long conversation I generally spend two or three hours working on our programs - either a new module has to be added to the management program or there is a bug to be fixed. Yesterday our conversation was short and the programming was even shorter: there were a few bugs in a routine that I wrote several years ago. The bugs were easy to fix, which makes me wonder how many other land-mines are waiting to be triggered. Obviously I don't aim to write code with bugs and I do test my code, but it happens that I don't test sufficiently. Anyway, by 9 am I had finished with the OP (as opposed to 12 am or later on most Fridays).

What to do next? I have been working on a song for the past few weeks; like most (if not all) new songs, I think that this one is good. Over the weeks I've been adding little bits and pieces; on Thursday I added a bridge section - until then there had only been three verses. Unfortunately the bridge didn't connect well to the instrumental part that came after and I experimented with several chords until I found something that worked ... except that this required that the instrumental be lowered by a tone. Not a problem. The instrumental itself causes a very subtle modulation at its end, going up by a semitone - so now the final verse was a semitone lower than the first verse. Yesterday I dropped the entire song by two semitones as the tune (deliberately simple after the spider-like melodies that I've been writing lately) was pitched too high. As a result, I'm not really sure what chords are being played towards the end, making it difficult should I need to add anything. But no: as far as I'm concerned, the music is finished.

On the other hand, there were no words, as usual. I had a few blithe phrases that would fit the opening lines but I had no idea what the song was to be about, and without knowing, I couldn't write anything. I should note here that a few weeks ago I read the autobiography of Janis Ian and felt encouraged/challenged to improve the level of my lyrics, so knowing what the song was to be about was important. Another book which I have just finished reading (for the second time) is 'What Alice forgot' by Liane Moriarty (I wrote about this here). I realised that I could write lyrics about the problems that Alice and Nick (her estranged husband) face; the following paragraph was the catalyst.

“I’d be at work, where people respected my opinions,” said Nick. “And then I’d come home and it was like I was the village idiot. I’d pack the dishwasher the wrong way. I’d pick the wrong clothes for the children. I stopped offering to help. It wasn’t worth the criticism.”

I know how he feels, although I'm not as bad as he is in the house (after all, I'm the cook). As I had the time yesterday, I started work on writing the lyrics to a song that is now called 'Building the life'. Once I had them complete, I tried singing them (this is where lowering the key of the song came in), and a few phrases were changed. There was still one line that I wasn't completely comfortable with: it didn't express the exact sentiment that I wanted, but whilst walking the dog this morning, the perfect line entered my head.

At work he's considered a star in the making His word always carries weight He's thought as an asset, delivering value Embodying good as a trait He understands He recommends His opinion is highly treasured by all At 8 in the evening, he closes his laptop And heads out into the night His wife is not happy: he’s missed their son’s party There’s nothing he can do right He’s lost in thought She’s practical She is getting impatient with his failings When she is down, he is up When she is up, he is down When she is happy, he cries When she is smiling, he frowns Where is the balance between these two people? What compromise can be made? They both acknowledge their failures as partners But can their marriage be saved? He contributes She must accept
They together can build the life that they want

I can't stress enough that these lyrics are imagined! They are not about my wife and I even though the couplet "He’s lost in thought/She’s practical" is more about us than they are about Alice and Nick (so is the first verse).

On the technical side, I note once more how easy it can be to write lyrics once I know what I'm writing about; for example, the bridge section ('when she is down ...') came to me when I was on my way to my daughter's flat, not while I was sitting down and physically writing the words. In other words, once I'm in 'writing mode', the words can come quickly.

Sunday, December 12, 2021

Darwin and Covid-19

I thought that I had written that so far no one has made the connection between Darwin's survival of the fittest and the various Covid variants: surely each variant that 'catches fire' (the latest being omicron) should proliferate more than other variants - that's why it's the current variant to cause everyone worry. Presumably I had this insight after reading 'The planet of viruses' but I can't see that I wrote it there. Now I remember that I wrote it in a message to my doctoral supervisor after he told me that he had suffered from Covid.

Today I read the following: The mechanism was laid out by Charles Darwin more than 150 years ago: evolution through natural selection. If a person is infected with Covid but mounts a weak immune response, the infection can persist for months. In that time, antibodies neutralise some of the virus, but not the versions they bind to less well. These surviving viruses proliferate, mutate and undergo further selection – potentially leading to variants that evade immune defences. [source] 

One study showed that a particular sample of coronavirus [was traced] to a 36-year-old woman who was not receiving effective antiviral therapy. Tests revealed that she had harboured the Covid virus for 216 days, in which time it accumulated 32 mutations, making it similar to the vaccine-evading Beta variant.

The article goes on to consider that the variants are being established in people with weakened immune systems, such as those undergoing treatment for cancer or for HIV.

Saturday, December 11, 2021

Mike Nesmith, RIP

It's early 1967 and the 10 year old me is watching 'The Monkees' TV show and listening to their first record (along with a Jewish 10 year old girl who lived vaguely near me). Whilst I appreciated Micky Dolenz's singing voice (that's him in the background of the photo, 'playing' drums), I didn't like his on-screen persona; the Monkee I most identified with is Mike Nesmith: guitarist (note the electric 12 string guitar!), singer and songwriter. He is the third Monkee to die (yesterday?), leaving Dolenz as the sole survivor.

I find it intriguing now to note what were the qualities that attracted me: the musical parts (Nesmith was a 'real' musician) but also the somewhat shy and introspective character that he played. I remember very much liking the song "Papa Gene's blues" that got played a few times in the series and was on their debut record - this was a song that Nesmith wrote.

Of course, writing about The Monkees requires that one describe how the group was put together, what the goals of the producers were, how they were considered to be manufactured and how the group members expressed their dissatisfaction with all this, but I'm not going to go into this.

Several years ago, I looked for the Monkees' songs; there are a few on the first album  (especially "Take a giant step") that I think are very good and stand up well today, but for me, the most interesting song was written by Nesmith, entitled "You just may be the one": the rhythm of the opening verse lines is not exactly the simple fare for which the group are supposedly known. A tape of the recording sessions can be heard here: this is a fascinating audio documented about how the song was recorded and produced (by Nesmith). This version shows that the time signature of the song is 4/4; the opening lines are placed at odd places over the instrumental rhythm.

I listened somewhat to Nesmith's post-Monkees music but this was in a style that did not appeal to me. An obituary can be found here.

Sunday, December 05, 2021

The week of the virus

Last week started off with me reading a book called 'A planet of viruses' by Carl Zimmer. The version that I have was published in 2011, probably making it the first edition; I understand that there is now a third edition of the book. It's a good book in that it explains very well what a virus is and gives examples of several types of virus (because the book was published ten years ago, Coronavirus is mentioned briefly at the end in connection with SARS). But I found that it didn't go far enough in explaining things and found myself somewhat dissatisfied by the end. There also seems to be some confusion (maybe on my part) whether 'ten million viruses' means ten million separate virus entities (like ten million people) or ten million types of virus. There is a huge difference between the two. I imagine that the third edition is probably much better.

After completing that, I received a message from my DBA mentor, that he had been ill with Covid-19, "flat on his back for ten days" ... despite having been vaccinated twice.

As I noted in my previous blog entry, 'my body is like a barometer', I noticed that it was getting painful to swallow on Wednesday. By the evening, I was feeling much worse which is when I realised that I had been the recipient of a visit from my good friend the rhinovirus. I have just completed three days of feeling about 50% competent: either my throat aches or my nose drips (fortunately, not the two at the same time). I'm glad that this happened over the weekend as it didn't affect my professional life very much (I took Thursday off for personal reasons not connected with my health, but in retrospect, I'm pleased that I did). 

The worst part of this viral visit was at night: over the past few months I've been getting up about three or four times a night due to the diuretic effect of one of my medications, but the last few nights have seen me getting up six or seven times a night; this may be due to the increased amount of tea that I've been drinking, even though I try not to drink after about 6:30 pm. To add to my problems, last night I also had a mild nosebleed from my right nostril. This wouldn't be considered a problem, but having a nosebleed whilst wearing a CPAP mask is problematic. 

I've just looked at the CPAP data for the past few days (the last day with data is currently Friday); to my surprise, there were no apnea for the past three days, and the amount of deep sleep has been encouraging. The usage time is getting longer - Friday night had just over 10 hours - but as I always note, this isn't sleep time but rather the amount of time that the machine is working. On the other hand, my blood pressure has gone up.

Thursday morning was the date of my long awaited appointment with the new female sleep doctor. It turned out that the doctor was male, and that he is a 'lung doctor', not a sleep doctor. He was more interested in the pleural effusions that I had in late May/early June than anything to do with my sleep. Apart from a referral for a new chest x-ray that I was supposed to have done several months ago, and a partial referral to the sleep clinic in Hadassa hospital, the only thing that I learned from this appointment was not to place any value in the 'deep sleep' data provided by the CPAP machine. On the other hand, the apnea data is very good.

Following the doctor's observation about the deep sleep, I decided not to bother with headphones and binaural beats one evening. Funnily enough, after a few minutes of lying in bed, I began to feel 'lonely': I missed the noise! So I put the headphones back on and they do seem to help.

Wednesday, December 01, 2021

My body is like a barometer

I've discovered that I don't need a barometer or weather forecasts: my body tells me when it's hot or cold. The past few days have been very hot in Israel and as a result, my normally dry skin has become even dryer, making it very itchy. I checked the outside temperature, and our combined barometer/thermometer showed a maximum of 32.5°C; this explained why my legs were so itchy. I tried as much as possible not to scratch, but it's hard not to give in to temptation. I attempted to soothe/hydrate the skin on my legs with a variety of creams that were only partially successful.

Fortunately I was saved from the constant scratching by a change in the weather. Some time during the night I became aware that it was slightly painful for me to swallow, a condition that has yet to be alleviated by constant cups of tea. The reason for the pain is that it started raining just after 7 am (my half hour walk with the dog had me home at 6 am) and has been raining on and off since then.

I of course prefer neither hot nor cold weather, so that my body doesn't react.

Friday, November 26, 2021

Opening Excel from a thread and displaying a file

Three weeks ago, I wrote about programming a thread that would activate Word (in the background, of course) and cause it to display a file that was preprogrammed as an HTML page. I wrote then "the next step is to write similar code that will open Excel in a thread". Well, I wrote the Excel code; this was easy to do once I had the Word example.

Today I came across an example where the simple 'open Excel in a thread' code is not sufficient: it often happens that I want to format certain columns as integers or as dates (although as I documented a year ago, it's better not to format date columns) after the data had been passed to Excel. I would do this with the following two lines:

xlApp.Columns['B:F'].Select; xlApp.Selection.NumberFormat:= XLIntFormat;

I could not do this with the simple thread code as the xlApp variable is not visible to the calling program. The simple solution would be to add an optional parameter to the code that creates the thread; this parameter would be passed down the chain and used after the data had been inserted into Excel. A complication would be that there might be two ranges of columns that need to be formatted. 

Here's a further complication: normally I freeze the top line of an Excel file with the following code:

sheet.Range['A2'].Select; xlApp.ActiveWindow.FreezePanes:= true;

In a certain case, I wanted to freeze the top two lines, meaning that the range would have to be A3 and not A2. Could I do this with another optional parameter? It is my understanding (probably wrong) that there can only be one optional parameter per procedure. This was exacerbated when I thought that I would also have to pass another string parameter denoting which columns should be dates (in the end, I didn't need this). So I decided to use overloaded procedure definitions, a first for me.

I now have the following:

Procedure ThreadExcel (const AFileName: string); overload; Procedure ThreadExcel (const AFileName, intformat: string); overload; Procedure ThreadExcel (const AFileName, intformat: string; freeze: integer); overload; ... Procedure ThreadExcel (const AFileName: string); begin TExcelThread.Create (AFileName, '', 2); end; Procedure ThreadExcel (const AFileName, intformat: string); begin TExcelThread.Create (AFileName, intformat, 2); end; Procedure ThreadExcel (const AFileName, intformat: string; freeze: integer); begin TExcelThread.Create (AFileName, intformat, freeze); end;

I suppose that I also need a variation where there are no columns to be formatted, but a different 'freeze number' is required but I'll cross that bridge when I come to it (actually this could be done by passing afilename, a blank string and the freeze number). The possibility that there might be different types of format passed and/or multiple column selections is handled in the following code:

Procedure DoFormat (const fmt: string; aformat: string); var i: integer; cols: string; begin repeat i:= pos (',', aformat); if i = 0 then begin cols:= aformat; aformat:= ''; end else begin cols:= copy (aformat, 1, i - 1); aformat:= copy (aformat, i + 1, length (aformat)); end; xlApp.Columns[cols].Select; xlApp.Selection.NumberFormat:= fmt; until aformat = ''; end; ... if intformat <> '' then DoFormat (XLIntFormat, intformat);

Intformat could be 'A:B,E:F' in order to format two column ranges. Passing the format string as a parameter enables formats other than XLIntFormat ('#,##0') to be used. This procedure uses what might be termed 'old style' programming; modern day coders would probably use a stringlist in the following manner (this is unchecked code, so it may be wrong):

var i: integer; alist: tstringlist; begin alist:= tstringlist.create; alist.delimiter:= ','; alist.delimitedtext:= aformat; for i:= 0 to alist.count - 1 do begin xlApp.Columns[alist[i]].Select; xlApp.Selection.NumberFormat:= fmt; end; alist.free; end;
I wonder whether I need to add a comma at the end of the list.

Wednesday, November 24, 2021

Amitriptyline reduces the amount of deep sleep

After a week of excellent numbers for deep sleep, the data has reverted to a few minutes' deep sleep each night. I've noticed that sometimes my headphones aren't on my ears but have moved slightly; I have no way of discovering whether this is important. I've also noticed that frequently I wake up at around 11:30 pm with reflux arising from GERD, which I handle with omeprazole (a wonder drug). The reflux may arise from my evening medication, two of which can cause reflux. So yesterday I took the medication at 6 pm, a few hours earlier than my usual time.

This morning I read that amitriptyline, a medication that I take in a very low dose to prevent migraines might be causing sleep problems, as well as reflux. According to this site, Amitriptyline also reduces the amount of deep, slow-wave sleep (SWS), also referred to as ‘deep sleep’. During SWS our bodies are in housekeeping mode: our muscles repair themselves and new tissue is grown.

Like many of my medical problems, it all seems like a problem in balance,  where one medication improves something but causes something else. I'll try taking amitriptyline once every other day; I doubt that this will cause the migraines to reappear, but it might increase the amount of deep sleep. I wonder how long it takes the body to metabolise the drug: if I don't take it tonight, will last night's dose still remain in my body?

I have an appointment with a sleep doctor next Thursday; I intended to bring up the subject of increasing the amount of deep sleep even before I read the information about amitriptyline. Maybe she'll reduce the dosage (I see that there are pills with 10 mg - I take 25 mg pills, where 250 mg is the dosage for depression).

Friday, November 19, 2021

Tables in Word documents opened in a thread

Earlier in the month, I wrote about opening Word in a background thread. Today I had reason to revisit the code, as the Occupational Psychologist wanted a few bells and whistles. The first request was to add a flag to cause the document to be displayed in landscape mode - simple. 

The second request was harder: should the document display a table, then that table should have the 'Repeat table header on subsequent pages' flag set. I know how to do this in a live document (I need it for my doctoral thesis) so it was quite easy to create a macro that would set the flag. Unfortunately, it wasn't clear which object within Word executes (Selection.Rows.HeadingFormat = wdToggle); is 'selection' a table? Is it something else? I had the idea to iterate over any tables that might be found within the Word document but not only was this difficult, it also didn't work.

I decided to leave this request for later, but serendipity played its part: one Word document that the management program created was now displayed horizontally, but more importantly, the table header repeated on the second and third pages! How did this happen, I asked myself, as I hadn't figured out how to do this yet. I looked at the HTML code that the program creates and that Word displays: along with the <table> tag, I had also used the <thead> tag. Somewhere along the line, I had defined a style in which the font in the header section is one colour, and the font in the <tbody> section is a different colour. It appears that this tag also causes Word to display the table with repeating header sections!  This saved me a great deal of head scratching.

Sunday, November 14, 2021

Sleeping even more deeply

Of course, after writing my previous blog entry on this topic, there were three days with no deep sleep whatsoever. When I saw this about a week ago, I considered the situation and realised that I had loaded four pieces onto the mp3 player. Only two were 'aimed' at increasing the number of delta waves, with the other two intended for increasing 'happiness' (I'm not sure which wave that is or even whether there is a 'happiness' wave). So I deleted the two 'offending' pieces from the player and slept several nights hearing only the two delta wave pieces (that sound like humpback whales - it's not music).

I looked at the data today: since 05/11/21, the numbers have been 45, 31, 2, 20, 0, 55 and 46 minutes respectively. I think that the 2 minutes night was the day that I deleted the pieces (last Monday); there is no explanation yet for Wednesday's poor showing (0 minutes). That night also had a high number of apneic events.

I could have reasonably expected that Thursday's figures would be poor as I went to bed late and was up in the middle of the night with a blocked nose. The usage time agrees with this - only 402 minutes as opposed to 495 minutes the day before - but strangely there were no apneic events at all, along with 55 minutes deep sleep. On Friday night/Saturday morning I 'slept in' - 549 minutes, the longest since 1/10 - but again no apneic events and 46 minutes deep sleep.

So it looks like I've hit on a winning formula to increase the amount of deep sleep that I get.

Tuesday, November 09, 2021

The Department of Bright Ideas

At work, I introduced the concept of Engineering Changes (an existing module in Priority) several years ago in order to aid communication between sales (who sometimes sell products that have not yet been designed) and engineering (who have to design those products). Over the past few years, this chain has been extended to production, who have to manufacture those products. The traditional way of informing production was to print a copy of the product's blueprint and send it to production.

Someone - not me - suggested putting a terminal on the shop floor so that the workers could scan a bar code on the product, where this bar code contains the EC number. Magically the blueprint would appear on the computer's screen. This is fairly easy to do within Priority, as the bar code would lead directly to the EC record, where the path to the blueprint is stored. Then someone asked whether this could be done outside of Priority: my initial thought was that this would not be possible, as the required files are stored in a labyrinthic directory structure, where the target files are several directories deep. 

Then the penny dropped: I could write a program that receives a barcode for input then performs a recursive search starting with the top level directory in order to find the required file (displaying the file at the end is trivial). This would not be fast but at least it would work. Writing this recursive search was slightly tricky, as most of the examples that I found of recursive directory search simply create a list of all matching files as opposed to looking for one specific file. Another hurdle was that within one terminal directory there could be several files for the same EC - the most recent version is the target (coding this turned out to be much simpler than I originally thought).

So I wrote the program, going through several revisions, tested it at home with a much simpler directory structure and a barcode reader, then tested it at work. The program fulfils its requirements, although it's slow - because of the search.

Last night I was walking the dog when I had another bright idea: instead of constantly performing a recursive search for one target file, I could write a program that performs a complete recursive search, saving its results in a file, then update the current program to search the file (that is loaded into the program's memory via a stringlist). This of course is very fast. Should the target not be found in the stringlist, the original recursive search algorithm gets called; this would happen if a new EC has been created since the directory structure was last mapped.

Writing the mapping program was very easy, being based on the original program, but without the user interface and without the complications of looking for a specific file. I had trepidations about the amount of time that this program would required to create a complete map, but had I thought more deeply about it, I would have realised that it wouldn't require much more time than the current program required to find one file. True, I am 'pruning the search tree' the moment the target file is found, meaning that the original program doesn't have to search the entire directory tree, but I get the feeling that all the target files that are searched appear towards the end of the recursive search, so pruning doesn't save that much time.

But 'the proof is in the pudding': after writing the mapping program (and testing it at home), I ran it at work. The program required two or three minutes to build the directory tree! I had been thinking that it would take half an hour or more. Once I had the directory tree map/index, it was a simple matter to include this in the original program that now works very fast. It's not instantaneous, but I think that the slight delay is due to executing the PDF viewer.

Moral of the story: walking the dog provides one with time for unconstrained thought. As always, these bright ideas seem so simple in retrospect that makes me wonder why I don't think of them earlier. The reason is that we are curtailed, 'blinkered', restrained, in our thinking, and one has to get out of the work environment (by walking the dog) in order to free oneself of the restraints.

Monday, November 08, 2021

DBA update

I last wrote on this topic exactly one month ago, after having interviewed the CEO and after transcribing that interview. I quickly followed this up with another three interviews, each person with his own opinion of the enhancement's success. On the basis of how long it took me to transcribe the first interview, I took my supervisor's advice and sent the other three interviews to a company that specialises in court transcriptions.

After being told that the transcriptions would take about a week (they're not urgent) and paying (415 NIS, which is equivalent at the moment to about $130, the dollar being extremely weak against the shekel), I am still waiting. I have received various excuses and I'm getting to the point of wondering whether I've been defrauded.

Despite not having the transcriptions, I know basically what was said (and I can always listen to the interviews again, should I want to) and so was able to write my first round of conclusions: not only about the enhancement itself, but also (and more importantly) about the pilot study methodology.

I also read a few interesting papers two weeks ago; one is theoretical and the other builds on the theoretical basis to carry out research. The topic is beneficial non-compliance brought about by the use of workarounds. The author of the first paper (who is a contributor to the second paper) proposes that at times, non-compliance of company standards can actually be beneficial. Yes, I know that this sounds like an oxymoron but it is also an interesting idea in itself, and also something that I can use myself. In the case where the use of a workaround mean that the work gets done better, the idea and/or methods of the workaround should be incorporated into the fabric of the ERP system so that the standard procedure (that presumably is lacking in some respect or is too difficult to comply with) can be updated to something that works.

I feel like the Borg: you will be assimilated!

So I added at least a page on beneficial non-compliance (including a table) and wrote about ten pages on the pilot study before sending off this version to my supervisor. I know that the pilot study chapter is not complete, but I'm not sure what I should add. Hopefully now I can maintain momentum with the thesis.

Sunday, November 07, 2021

La Rossa

I'm still very high on my discovery of the 5/4 bars in VdGG's "La Rossa". The elongated bars make perfect sense when looking at the prosodic elements of the song as these bars highlight the 'if we made love now' lines. 

I wondered whether these flourishes are maintained in performance; I don't have handy a recording of this song from its time period, but at the moment the three piece band are touring in Scandinavia, and as luck would have it, a version of "La Rossa" was posted a few days ago. 

I have to admit that I don't like live VdGG very much; Hammill especially seems to ruin the songs that were so carefully wrought. 'Fortunately' his contributions to LR are almost inaudible, with Hugh and Guy putting out a tremendous sound. 

I listened closely to the middle section, and as far as I can tell, they played the rhythmic structure as it appears on record. I found it easier to identify the different bar lengths, and maybe I'll be able to transcribe this portion of the song, after all.

Saturday, November 06, 2021

Opening Word from a thread and displaying a file

I wrote eight and a half years ago (!) the following:  As I have noted, I have spent no small amount of time updating and expanding the use of email in the Occupational Psychologist's management program. Email is now sent via GMail and works very nicely ... except for one not so small problem: when one is sending an email with an attached file, the program apparently stops working for a minute or so. The solution to this problem is to send the email via a separate thread but until now I have lacked the programming knowledge to implement this.

Today I can rephrase this statement as follows:  As I have noted, output from the Occupational Psychologist's management program is frequently sent to Microsoft Word (and even more frequently to Microsoft Excel). There is one not so small problem with this: when one is running a report whose output is displayed by Word, the program apparently stops working for a minute or so. The solution to this problem is to open Word in a separate thread but until now I have lacked the programming knowledge to implement this.

I have tried this in the past but not succeeded. As it was so long ago, I have no idea what I did then, but now it was fairly simple to write the necessary code that worked the first time that I tried it! I think that I missed using CoInitialise/CoUnInitialise in the Execute procedure. The next step is to write similar code that will open Excel in a thread: there are many more places that call Excel to display data.

Here is the code:

unit Manage08at; interface uses Windows, SysUtils, Classes, MyOffice, ComObj, ActiveX, Variants; Procedure ThreadWord (const AFileName: string); implementation type TWordThread = class (TThread) private FFilename: string; procedure Execute; override; public constructor Create (const AFileName: string); reintroduce; end; constructor TWordThread.Create (const AFileName: string); begin inherited Create (False); FreeOnTerminate:= True; FFilename:= afilename; end; procedure TWordThread.Execute; var wrdApp, wrdDoc, wrdSel: variant; begin CoInitialize (nil); wrdApp:= GetWordObject; wrdDoc:= wrdApp.Documents.Add (wrdApp.Options.DefaultFilePath[wdUserTemplatesPath] + '\q400.dot'); wrdDoc.Select; wrdSel:= wrdApp.Selection; wrdSel.InsertFile (ffilename); deletefile (ffilename); wrdSel.WholeStory; wrdSel.Font.Name:= 'Arial'; wrdSel.Font.Size:= 11; wrdSel.homekey (wdStory); wrdapp.visible:= true; wrdSel:= unassigned; wrdDoc:= unassigned; wrdApp:= unassigned; CoUnInitialize; end; Procedure ThreadWord (const AFileName: string); begin TWordThread.Create (AFileName); end; end.
The only thing that is personal development in this code is the MyOffice unit that includes a procedure called GetWordObject that opens an instance of Word.

Friday, November 05, 2021

Counting beats with Van der Graaf Generator (3)

Twelve years ago, I wrote: "Yesterday, I heard "La Rossa" as a slow 12/8, and on that basis, the middle section became very interesting ("if we made love now..."): a bar of 3/4 followed by two of 4/4, repeated several times (that could be written as 9/8 followed by two bars of 12/8, to make the triplet beat clear)."

I was listening to the 2021 remix of the song (the only differences that I can hear is a guitar line in the introduction that isn't audible in the version familiar to me from 1976; along with one in the saxophone solo at the end where there are a few new phrases as well as some guitar 'chunks' at the very end) when suddenly I noticed yet another metrical peculiarity of this song, especially the middle section that I referenced above. This either displays metric modulation (three beats in the space of two) or something similar, but that isn't anything new for me.

What caught my attention was ironically the 'if we made love now' phrase at about 4:17 in the song: after having triplets and fours scattered around, that specific line (and its corresponding repeat at 5:22/3) has a five beat bar. The word 'now' is the first beat of five before the next chord change. The same thing happens at the end of the phrase 'it will change all there is yet to be': 'it will change' is one triplet, 'all there is' another triplet, and 'be' is the first beat of a five beat bar. Wow. 

The resources available to me now are more extensive than they were 12 years ago, and I'm going to try and bring this song to the interest one of the YouTubers who relish odd rhythmic constructions.

By chance, today is Peter Hammill's birthday.

Thursday, November 04, 2021

Sleeping deeply

I've been continuing my attempts to increase the amount of deep sleep that I get each night by means of listening to 'binaural beats'. 

I wrote a few days ago that "Last night [Friday 30/10] was much better in terms of sleep quality; I also awoke an hour earlier than I intended but still feeling refreshed". That's interesting as apparently I had only 5 minutes of deep sleep that night. I haven't felt any change over the past few weeks, but then I'm a 'morning man' and generally wake with a sharp mind. I often have good ideas whilst walking the dog at 5:45 am.

Since my last blog on the subject, I've been changing the conditions somewhat. I had switched to the 'over the ear' headphones from the swimming mp3 player, but after these kept on falling out, I decided to switch to a headset pair that I found in my spare parts drawer. As opposed to the first two sets of earplugs, these sit outside of the ear; I find that I get better sound quality this way than earplugs that have to be inserted at the correct angle. This headset is quite rigid, meaning that sleeping on my side is not too comfortable. 

I also switched mp3 players: I had written before that the swimming mp3 player is difficult to control. Either it got turned off one night or ran out of battery, but it wasn't working one morning. Despite charging it, I haven't been able to turn it on again. The night after this, I used my mobile phone, but the earphone plug didn't make a good connection. Belatedly I realised that I don't need to keep my 'good' mp3 player reserved for when I travel on the train - as I barely travel on the train these days. The player has built-in memory as well as an SD card, so I cleaned out the built-in memory then transferred my three pieces of binaural beats to the player. I set the player to play from its memory and reduced the volume somewhat. Since then this has been working well, although I must remember to charge it now and then (I woke up in the middle of last night to the sound of silence; I had to find the charging cable and connect it in darkness to re-enable the player).

I also mentioned last time that I had ordered the simplest pair of headphones that I could find. Despite being quoted a delivery date of a few weeks, these arrived two days ago and I was able to use them for the first time last night. Of course, I don't have any data for them yet, but subjectively they were lighter and caused less pain than their predecessors.

And as for readings:

Day minutes
Wednesday, 27/10 19
Thursday, 28/10 33
Friday, 29/10 0
Saturday, 30/10 5
Sunday, 31/10 21
Monday, 01/11 16
Tuesday, 02/11 29

I hope that the improvements of the past few days continue. Tuesday also registered a fairly high number of apneic events (10); I hope that this is a one-off. The problem with reading data from a few days ago is that I don't remember whether there were any unusual events on a given day.