Friday, November 29, 2024

Goodbye F25

At the beginning of the month, I wrote1 about the F25 Cell phone stand with wireless speaker, noting that whilst I could hear the person on the other end of the call clearly, they couldn't hear me. After a few days of frustrating use, I stopped using the device.

An Internet search found a device that seems to provide a solution closer to what I want: the SYNC 20 (M) USB-A, but that website frustratingly does not provide prices. I suspect that this device costs much more than what I am prepared to pay.

Yesterday, I happened to be in the local shopping mall, so I went into a store that sells mobile phones and accessories. I asked them whether they had the sort of device that I was looking for; they didn't but suggested a few options.

And then the penny dropped: the devices that they were offering provided sound from the bluetooth speaker, but one had to speak into the phone as this is where the microphone is. I very strongly suspect that this is the same as the F25: one hears through the device's speaker, but the microphone is the phone's. Thus if I keep the phone in my pocket, it's not surprising that I wouldn't be heard on the other end. This means that if I want to be heard, I will have to keep the phone in the stand - which is not what I want to do.

After leaving the store, the cheap and cheerful solution occurred to me: when I sit down to work, I will take the phone out of my pocket and leave it on my desk. Should someone call me, I will use the speakerphone function on the phone. This may not be exactly what I'm looking for, but it's good enough.

In the mean time, I'm offering the F25 for adoption.

Internal links
[1] 1855



This day in history:

Blog #Date TitleTags
52229/11/2012Uncle once more!Blood pressure, Uncle, Acupuncture
98729/11/2016End of November/TV seriesTV series, Cold feet
127729/11/2019A 'new' DVD recorderDVD
136029/11/2020New favourite drinkPersonal

Tuesday, November 26, 2024

Delphi logging

In my Delphi programs, I often have the need (or desire) to write data to a logfile which is a simple text file. I've always used the following code that is based on "old style Pascal I/O".

procedure TMainForm.Write2Log (const s: string); var f: textfile; begin assignfile (f, logfilename); if fileexists (logfilename) then append (f) else rewrite (f); writeln (f, datetimetostr (now), ' ', s); flush (f); closefile (f); end;

For reasons that I have never been able to establish, this sort of code is frowned upon by some Delphi developers. I have eventually got around to converting the procedure to regular Delphi code.

procedure TMainForm.Write2Log (const s: string); // the Delphi way var outstring: string; fs: TStream; begin if not fileexists (logfilename) then fs:= TFileStream.Create (logfilename, fmCreate OR fmShareDenyNone) else begin fs:= TFileStream.Create (logfilename, fmOpenWrite OR fmShareDenyNone); fs.Position:= fs.Size end; try outstring:= datetimetostr (now) + #9 + s + #13#10; fs.WriteBuffer (outstring[1], length (outstring)) finally fs.Free end end;

To me, this seems unnecessarily low level - adding the tab, carriage return and line feed to the string and passing the length of the string to be output. There is also a small bug in that code - in unicode days, length (outstring) is not equal to the number of bytes to be output. But I'm writing non-unicode programs, so I'll get by. 

I wondered whether it's possible to create the stream on program startup - thus there will be no need to destroy the steam each time. Of course, the end of the file has to be 'seeked' (or in English, sought). Although this works, no other program is able to open the log, somewhat negating the whole idea of a logfile.

As it happens, variations of my old-style code can be found on the Internet, for example here, although it should be pointed out that the linked article is from 2005. Various techniques are shown, but as all I want/need to do is append a line at the end of the file, reading the file (e.g. stringlist.loadfromfile) then adding the line and writing it back to disk (stringlist.savetofile) seems like overkill, especially if the file has many lines.

Incidentally, an alternative version uses Pointer (outstring)^ instead of str[1]; although the result is the same, some consider that using the typecast to pointer makes it more clear what the expression is (the first character in the string). I'm not so sure.



This day in history:

Blog #
Date
TitleTags
144326/11/2021
Opening Excel from a thread and displaying a fileProgramming, Delphi, Office automation, Threads
169026/11/2023
Guitar thoughtsGuitars

Monday, November 25, 2024

Counting beats with Matthew Halsall

For the last few days, I've been listening again to the Matthew Halsall playlist: I definitely prefer his earlier, sparser, recordings to his most current album, 'An ever changing view1'. So I'm sitting at my desk, playing 'table percussion', when I notice that a piece from the album 'When the world was one' is in 74 time. Whilst the track list given at Bandcamp  for the album is 60 minutes long, the mp3 at YouTube that I have plays for 81 minutes, thus enabling me to ascertain that I am referring to the track 'Tribute to Alice Coltrane'. The youtube video adds as a bonus an alternate take of the piece at the end of the album, so more beats in 74. And now that I'm paying attention, the track that follows (presumably 'Jura', also a bonus track) is in 54 time. And to think that I considered that most of his pieces are in 3! The album "Into forever" starts with a few songs in common time - but then these songs are sung, as opposed to everything else in the Halsall oeuvre.

I think that this piece is the one to which I was referring when I wrote in the blog referred to above "here and there are lines that I might have played myself". Obviously at the time I was listening to the melody and not so much to the rhythm.

I've been trying to explain to my wife about time signatures, but not only does she appear not to understand, she also thinks that I'm weird when I walk around the house counting 1-2-3-4-5 or 1-2-3-4-5-6, etc. Thus when she sees Elizabeth Zharoff2 doing the same, or even better, a video that I saw the other day, she understands that the counting is some obscure musical ritual.

Internal links
[1] 1658
[2] 1804



This day in history:

Blog #
Date
TitleTags
6125/11/2006
LoveBeatles
11025/11/2007
MIDI keyboard funMIDI
31225/11/2010
Algorithm for quickly drawing activity networksMBA, Project management
43125/11/2011
Crisis averted: no need for oral surgeryTeeth
77825/11/2014
Meeting with a colleagueDBA

Saturday, November 23, 2024

Management email problems

One of the users of my Management 'ERP' program has suddenly become unable to send emails via the program. As all the necessary definitions are contained within the database, it's not a problem of a wrong definition. An attempt to debug using a simple program that I wrote once that sends a standard email via Gmail and outputs all the status messages failed to send the email, but it's not clear (at least, to me) what the problem is. "Something to do with the user's computer" was my lame explanation; as it happens, the same non-result happens when I run that test program on my mobile computer, but this didn't lead to any further insights.

When discussing this problem with the OP yesterday, I had the idea that maybe instead of calling the 'send mail' function in the Management program, the email would be sent via a separate, auxiliary, program, in a similar fashion to the auxiliary program that I discussed1 a month ago.

So yesterday afternoon, I spent a few hours working on this. There were two major problems: the program should have to wait for the thread that sends the email to finish before closing itself, and that on my computer, the program is located at c:\program files\...... As a filename had to be passed to the auxiliary program, it made sense to write a console application (as is the previous auxiliary program) and get the filename via the use of the paramstr function. But the space in 'program files' causes paramstr to malfunction, producing two strings that have to be concatenated in order to get the filename.

Eventually this sort of worked but I wasn't very happy about it. Sometime during the night, I realised that I could use the 'OnTerminate'2 event to establish when the thread finished, solving the first problem. But at about 5 am, a new idea struck me: instead of executing an auxiliary program, have a constantly running program (a 'daemon') poll a given directory and send from there any email files that may have been stored there. Of course, having had this idea, I had to examine it from various angles and consider the polling code, and as a result I couldn't get back to sleep.

Later on, I realised that the idea of an auxiliary program was doomed from the start: although the program might be stored on the server, it would be executed from the user's computer and the original problem would still occur. Having a program that constantly runs on the server would solve this problem.

Only a minor change - and in fact, a simplification - was required in the management program; basically if the user is defined as 'aux mail' then the file holding the email is saved in one directory, otherwise the file is saved in a different directory and the email sending thread is executed.

In the daemon, I got around the 'waiting for the thread' problem by the program never closing. It has a timer that wakes up once every five minutes; first it checks to see if there are any files with the 'msx' extension in the mail directory - if there are, these files are deleted. Then the programs checks to see if there are any files with the 'msg' extension in the directory - these are the email files. If so, a loop runs over these files: the file is copied to a new file with the 'msx' extension, this filename is passed to the email thread and finally the msg file is deleted (so that it won't be found again).

After I finished working on this and checking that emails are indeed sent (and received), I had the idea that the management program should try to execute the mail program, and so the mail program had to have a semaphore that prevents it from being executed more than once. This is easy to add, as is the code to the management program to execute the mail program. Then I realised that the original problem is liable to occur again: the user runs the management program on her computer and so a new instance of the mail program will run on her computer - and probably won't be able to send email. So I removed the offending line from the management program; I'll have to remember to add the mail program to the startup list on the server. 

We'll see how well this works during the coming week.

Internal links
[1] 1840
[2] 1838



This day in history:

Blog #Date TitleTags
30923/11/2010The gravy boatCooking
31023/11/2010Copper socks 2Health, Copper
109323/11/2017Two more people have passed awayObituary

Tuesday, November 19, 2024

Vindicated!

I wrote1 just over one year ago About once a month, the 'Unhalfbricking' version of 'Who knows where the time goes?' gets played on the radio, but recently it seems to be played once every few days. My wife has become extremely enamoured of the song (finally, after 43 years of marriage) and asked me to add it to her telephone playlist. She then asked if there were any other songs that she might like - I could think of at least one hundred - and so I sent her "I'll keep it with mine".

It occurs to me now that IKIWM has several similarities to WKWTTG in terms of harmony  - although in fact it should be written the other way around, as IKIWM was written in 1964 by Bob Dylan and WKWTTG was written in 1968 by Sandy Denny. Both start off with a chord stream that can be seen as I ii iii ii; after that the chords used by the songs differ but their gross structure is quite similar. The Dylan song is unusual (for Dylan) in its use of the bVI chord (every time I hear the Hollies' "He ain't heavy", my mind always plays the piano riff from the Dylan song - played by Denny - when the Hollies' song also reached the bVI song) whereas Sandy's has the unusual iv chord - A minor - that is especially striking when it comes after the iii chord, G#m. Not only that, iv is the relative minor of bVI - if both of the songs were in the key of E major, then one song has Am and the other has C; almost the same notes.

There are further, formal, correspondences: both songs have three verses, neither song has a chorus, and both feature each song's title as the last line of every verse. Dylan does this frequently whereas Denny does it less often.

The arrangements also are similar with Richard Thompson playing guitar obbligatos. There is a world of difference between the original Strawbs' version (Sandy solo) and the Fairport version, and today I wonder how much the arrangement of WKWTTG was inspired - if at all - by what they did with the Dylan song.

Could I renew my old channel of communication with Simon Nicol in order to check my hypothesis? Probably not as I strongly suspect that the email address that I have for him has not been current for at least a decade.

My wife also recognises Nick Drake on the radio; he too gets played once every few days, primarily "Northern Sky".

Internal links
[1] 1685



This day in history:

Blog #Date TitleTags
64919/11/2013What's in a name?Israel, Personal
90419/11/2015Even dogs in the wildIan Rankin
118619/11/2018E dorianSong writing, Music theory
127419/11/2019The luxury of digital recordingMIDI, Kibbutz, Song writing
144119/11/2021Tables in Word documents opened in a threadProgramming, Delphi, Office automation, Threads
155319/11/2022DBA updateDBA
168819/11/2023Network upgrades and printer problemsComputer

Monday, November 18, 2024

Shel Talmy, Peter Sinfield RIP

Shel Talmy was a legendary producer from the 1960s who worked in Britain, despite his being American. His initial and major clients were the Kinks and the Who although he worked with many other acts. He even produced an early mix1 of VdGG's "The least we can do". This morning, the Guardian announced his passing.

From YouTube, I learned earlier this morning of the passing of Peter Sinfield, who was one of the initial members of King Crimson. Sinfield wrote the lyrics for their first four albums; I find some of them brilliant, others are unnecessarily obtuse and there are those that are irrelevant.

Both these people have my respect, but they are very peripheral to my listening habits. 

Internal links
[1] 655



This day in history:

Blog #Date TitleTags
14518/11/2008Lonely at the topMIDI, Randy Newman
30518/11/2010How to save money when ordering books from abroadBook depository
30618/11/2010Alesis Q49MIDI, King Crimson, Antibes
52118/11/2012Warming up for DBA examDBA
77718/11/2014Enron's spreadsheetsDBA, Excel
155218/11/2022Fairport newsFairport Convention
168718/11/2023The musical group reconvenesMusical group

Sunday, November 17, 2024

More hours spent improving the blog manager program

Yesterday I spent several hours working on the blog manager program (BMP); this time can be divided into three sections: (a) adding functionality for which I had an idea before programming; (b) fixing the startup code once again; (c) improving something that occurred to me whilst I was working.

Way way back, just over two years ago, I wrote1 it occurred to me that I could make a useful extension, and allow my program to execute the Internet browser and display a given blog. So I added an 'address' field both to the 'entries' table and to the form that allows me to enter or edit an entry. In writing/copying that quote, I utilised the 'address' field in order to find the link to that blog - it's much faster to do so in the BMP that via the online blogger site. 

Since then, I've been adding the address to every blog that I've written, and in an informal way I've been adding addresses to older blogs. Again, because the online blogger site's interface doesn't make this easy, I would request to display a tag then iterate over all the blogs with that tag, adding addresses to those that lack them.

This was somewhat ad hoc, so yesterday I had the idea of first creating a list of all tags that have entries without addresses, sorted by descending count; double clicking on a line should bring up the actual entries for that tag that lack an address. Then I can iterate over these blogs and add their addresses.

At first I tried to use the existing ShowTags form, as this already has a certain amount of functionality built-in (or rather, I've already added this). But it seemed that I was fighting the existing code all the way, and that the advantages that would accrue from using the existing form were overshadowed by the overhead. So I decided to create a new and much simpler form (NoAddress) to show the tags that lack addresses.

For some currently unknown reason, I was not able to display this list sorted in descending order. After banging my head against the computer screen for a while, eventually I hit upon a solution that will technically sort in ascending order but will display in descending order.

select tags.id, tags.name, count (*), 200 - count (*) as final from tags inner join tag2entry on tag2entry.tag = tags.id inner join entries on entries.id = tag2entry.entry where entries.address is null group by 1, 2 order by 4, 2

This is a kludge but it works. Once I had this out of the way, I could write the query to collect all the entries that lack an address by a given tag in order to pass this to a new instance of the ShowEntries form. I also added the code to graph the top ten tags, should I be so inclined to see this.

Then it occurred to me that if I had added all the addresses lacking in the ShowEntries form, that form should somehow update the tags shown in the NoAddress form, reflecting that some entries now had addresses. At first I thought to do this by passing some form of parameter to ShowEntries, but this would change (not necessarily break) a certain amount of code. It would be much easier for the ShowEntries form when it was about to close to send a message to the main form that would look for child forms of type TNoAddress and tell them to refresh. This is more complicated to write in English than it is to program! I also added a 'secret' flag that will cause the entries to be shown in reverse order - this saves a key press. Displaying the entries in reverse order causes them to be in the same order as shown on the web site.

To my chagrin, I discovered that 90 of the 174 blogs tagged 'DBA' were lacking an address. So I toiled to add the addresses of all the blogs. This will also have reduced the number of entries lacking addresses for other tags, as there are the BMP informs me that 41 tags are paired with tag=DBA.

Having got all of that out of the way, I then discovered that once again2 the program would not work on my mobile computer. Instead of the usual error message that I had seen before, I was now getting a message that the database connection was missing (or similar). Eventually I realised that the code was blanking the location of the database file but was not providing a new location. The solution to this follows, moving code that was previously in the OpenDatabase procedure to BeforeConnect. A few hours later, it occurred to me that this code will prevent me from accessing the 'other' blog on my development machine and will also not set the 'fileprefix' variable, but this won't matter very much.

procedure TDm.OpenDatabase (index: word); begin dbnum:= index; datadir:= IncludeTrailingPathDelimiter (ExtractFileDir (application.exename)) + 'data\'; mutex:= TILMutex.Create (progname); end; procedure TDm.SQLConnection1BeforeConnect(Sender: TObject); var pname, dir: string; begin if not fileexists (dm.SQLConnection1.Params.values['database']) then begin case dbnum of 0: begin pname:= 'Perceptions'; fileprefix:= pname; end; 1: begin pname:= 'PPP'; fileprefix:= 'Programming pitfalls in Priority'; end; end; fileprefix:= fileprefix + ' '; with TRegIniFile.create (regpath) do begin dir:= ReadString ('firebird', pname, ''); free end; with sqlconnection1 do begin close; params.values['database']:= dir; loginprompt:= false; end; end; end;

I checked this code by running it on my mobile computer and trying to access the second database; this worked, but when I tried to run the 'show singleton query' (i.e. tags that have been used precisely once), I received a syntax error in the query. This was easily dealt with, and then I saw that in order to show the singleton entry, I was using code that had since been refactored into a procedure in the data module. So I replaced the duplicate code with a simple procedure call.

Now I can spend my idle time by adding addresses to entries - the next tag on the list is 'Holiday' with 53 entries. I imagine that I will kill two birds with one stone, as slightly further down the list is 'Italy' with 43 entries; I doubt that there are many - if any - old entries about Italy that are not connected to holidays.

Internal links
[1] 1538
[2] 1846



This day in history:

Blog #Date TitleTags
64817/11/2013TV series updateTV series, DCI Banks
127317/11/2019Song festival 2019Kibbutz, Song writing

Saturday, November 16, 2024

New CPAP mask (2)

After nine days with my new mask1, I'm getting more comfortable with it and learning how to connect all the straps in the dark. I try to keep the 'right cheek' strap connected all the time so that I only have to connect (or disconnect) the 'left cheek' strap. It's much harder to set the mask up if both straps are loose.

As expected, the data from the machine shows a great improvement from the final weeks of the old mask. There are no leaks at all, and most nights have either 0 or 1 apneic events per hour, meaning that my sleep get interrupted less and so I should feel more rested. 

One night, the 'deep sleep' count was 124 minutes which is about twice as high as it's ever been. I don't pay much attention to this measure as it seems to have no correlation whatsoever with my perceived quality of sleep, and I don't remember anything special about that night.

Internal links
[1] 1853



This day in history:

Blog #Date TitleTags
64716/11/2013Song festivalMIDI, Kibbutz, Song writing
135816/11/2020Vinyl log #32Vinyl log, Heron
168616/11/2023Counting beats with Van der Graaf Generator (4) - Whatever would Robert have said?Van der Graaf Generator

Thursday, November 14, 2024

Counting beats with Jasmine Myra

Continuing my occasional series of blogs1where I note the time signature used in pieces, it is time to look at the music of Jasmine Myra. In instrumental music, the use of 34 time is far more prevalent than it is in vocal music and so JM has pieces in 3, pieces in 4, and there's even one piece in both, though obviously not at the same time*. As I noted before, my favourite piece "Knowingness"2 begins in 34 time then moves to 44 for the second half.

Today her music was again playing in my headphones when suddenly I noticed that the piece "Words left unspoken" (written about not being able to part with her grandmother who died in hospital during the Covid-19 lockdown) is in 54 time - or at least, I think it is. It's very difficult to establish where the 'one' is, and without this, one can't determine the rhythm properly. Normally the advice given is to listen to the drums, and if that doesn't work, then listen to the bass, as one of these instruments will emphasize the first beat of each bar. In the studio recording of this piece, the string quartet's lines do not start on the one.

* Although this is possible - it's called a '3 against 4 polyrhythm'. I've done it in my songs a few times, but only for a few bars at a time, having six crotchet triplets in a bar of 44

Internal links
[1] 1686
[2] 1742



This day in history:

Blog #
Date
TitleTags
6014/11/2006
The BandRandy Newman, The Band
14314/11/2008
WokCooking
30314/11/2010
Sumptuous SundayCooking, Slow cooker
51814/11/2012
Inside the DOCU program (1)Programming, Delphi
77614/11/2014
Matching a computer language to the problems it needs to solveProgramming
135714/11/2020
Cold Feet, series 9TV series, Cold feet
144014/11/2021
Sleeping even more deeplyCPAP, Binaural beats, Sleep

Wednesday, November 13, 2024

Peripheral edema (2)

I wrote1 two months ago about peripheral edema: how my legs - especially the right one - swell. Since then, I've attended an appointment with a cardiologist who tended to discount the theory that one of my blood pressure medicines is causing the problem. As he said, medicines don't distinguish between left and right, and so there should be swelling in the left leg and foot.He sent me for an ultrasound scan of the veins in my legs; this showed nothing unusual. 

When I returned to my GP, I pointed out that the swelling is much reduced, implying that the weather is the primary cause and the bp medicine a secondary cause. She opted to do nothing for the time being, and to wait until the swelling becomes problematic, probably in another eight months time. The most important thing, she told me, is that my heart is fine. As I told her in my previous appointment, "I keep a close watch on this heart of mine"2, but she didn't get the reference (hardly surprising).

Internal links
[1] 1830
[2] 1776



This day in history:

Blog #
Date
TitleTags
10913/11/2007
My body is falling apartApnea, Anaemia, Teeth, Bursitis
42813/11/2011
Kindle arrivesKindle
42913/11/2011
Relieving the pressureMBA, Finance
77513/11/2014
Another Priority interface - multiple import filesProgramming, ERP, Office automation
90213/11/2015
The latest addition to our musical menagerie ... and peppermint foodMusical instruments, Peppermint

Tuesday, November 12, 2024

Karla's choice

Three weeks ago, I wrote1 about the announcement of this book that caught me - and probably many other people - totally by surprise. Since then, I have finished reading the book, although the actual process by which I read the book (I'll explain below) left me rather unsatisfied.

The first words that I read of the book were the author's note and the opening of the first chapter - these were available from the a link in the Guardian article, although I should point out that later they were replaced by other material, also from the first chapter. 

The author's note was very interesting, although it had very little to do with the book itself. It explained how Nick Harkaway (a nom de plume - Nick is the youngest son of JlC, aka David Cornwell) came to write the book. NH is aware of the problem of Smiley's age2, linking it to the age of Karla. But for the latter, an extra, possibly previously unknown, datum is added: [he] served as a kitchen boy on a train in 1904 (also in Tinker Tailor). Remember this when reading the book.

So what's the book about? Initially it is about the search in Britain for a Hungarian publisher called László Bánáti who has disappeared; shortly after, it transpires that he is better known - at least, to the Circus - as Ferencz Róka, a veteran Centre agent. After tracing some of his movements in London, the search of Róka then moves to the continent, giving the author a chance to introduce all manner of characters, some of whom we met in 'The spy who came in from the cold' and some we will meet in TTSS. The plot thickens and possibly over-thickens.

Why was I unsatisfied by the way I read the book? After the initial meeting with the opening words on a web page, I found a copy of the audio book. As I had just received a new pair of headphones (replacing the unsatisfactory pair that I described3 a month ago), I thought that I would try them whilst listening to an audio book. I found this to be very unsatisfying for a few reasons - I could listen for only about half an hour at a time as I walked the dog in the morning and evening, and had to concentrate entirely on the reading (no thinking about other problems!). Names especially became mangled, especially as there were several non-English names and words in the opening chapters. But probably what I missed the most was the ability to go back to the beginning and reread something that wasn't initially clear.

I had listened to about half of the book when the epub version arrived, so I quickly transferred my allegiance to that. I lightly reread the book to where I had left the audio version, then continued with computer and Kobo. I've noticed that over the past few weeks I haven't been concentrating as much as I usually do when reading, discarding several books after having read their first chapter. Thus I don't know whether it's me being unorganised or it's the book itself that is causing my dissatisfaction. I shall try and reread "Karla's choice" in one dedicated sitting - we are promised a power cut on Friday morning from 7am - 11am, and this will be an excellent time to read as there will be nothing else that I can do.

"In universe", one problem that I noted was that the identification of Bánáti as Róka was made by Bill Haydon. As we discover in TTSS, Haydon is a Russian mole; surely it would have been better for a mole to keep his mouth shut here instead of blowing Róka's identity. As the Circus had been unaware of Róka's presence in Britain and his role, it seems unlikely that Haydon would have been briefed about Róka in the past and so wouldn't have been able to use the opportunity to get rid of someone who is out of favour with Centre. Anyone else, e.g. Toby Esterhase, a Hungarian himself, could have made this identification without problem. On the other hand, Haydon does try to take hold of the investigation, presumably after having discussed it with his controller, so this attempt does make sense. Maybe I am reading too much into this; it could be, as David Lodge puts it in 'Nice work', an aporia, a figure of undecidable ambiguity, [an] irresolvable contradiction. I doubt that I will ever learn if this was laziness on the author's part or genuinely intended.

Control does wonder what Róka's role was in Britain, but little to no effort is expended in discovering what it might be. I see this as an authorial problem and not one of the Circus. In the book, the pace heats up once the action leads to Europe and the British connection is forgotten.

And wither Karla and his eponymous choice? All through the book I wondered when this was going to appear, and it's only around the last two chapters that what it is becomes clear. The final chapter reads more like an epilogue than part of the story.

I recall that I had to read TTSS several times before it achieved clarity in my mind. I read "The Honourable Schoolboy" whilst travelling around America by bus, which is most certainly an unsuitable environment for reading material of this nature, and so that book too took a long time to become assimilated. On the other hand, the third part of what was to be called the Karla trilogy, "Smiley's People", was clear from the start. So not understanding the grand design of this book on its first reading is not necessarily a failure on my part or on the author's part.

Internal links
[1] 1843
[2] 1070
[3] 1842



This day in history:

Blog #Date TitleTags
14212/11/2008Seasons - a songMIDI, Song writing
30212/11/2010What are the 10 songs that defined one's tastes?King Crimson, Van der Graaf Generator, Beatles, Richard Thompson, Randy Newman, The Band, 1971
64612/11/2013Minimalistic arrangementsMIDI
77412/11/2014Navigating by machineMobile phone
98612/11/2016Headphone amplifierComputer, Musical instruments
135612/11/2020Date set for doctoral oral defence!!!!DBA

Monday, November 11, 2024

F25 followup

In yesterday's blog1 about the F25 mobile phone stand, I wrote I thought that it should be possible to play music from the computer via this device, thus obviating the need for headphones. This does work, but so far, I have been unable to answer a phone call whilst music is playing.

I didn't have the time yesterday evening to check this, but this morning I performed a simple experiment. The phone is paired to the F25; when I turn the computer's bluetooth on and try to connect to the F25 (it is already paired), I get the message That didn't work. Make sure your Bluetooth device is still discoverable, then try again.

In other words, coupling between two devices is permitted but a ménage à trois is not! Well, it was worth a try.

Internal links
[1] 1855



This day in history:

Blog #
Date
TitleTags
14111/11/2008
AccidentMotorbikes
168511/11/2023
Wartime radioSandy Denny, Nick Drake, Randy Newman, Paul Simon

Sunday, November 10, 2024

F25 Cell phone stand with wireless speaker

Most of the time when I am sitting at my desk, I am listening to music via headphones. Should someone telephone me, I have to fumble my phone out of my pocket and answer. Frequently I need to work on the computer whilst speaking on the phone; if I'm holding the phone with one hand then I have only one hand free to type on the keyboard, which is difficult. My usual method of dealing with this is to request a moment from the person on the other end of the line while I connect a headphone/microphone set to the phone (not the same headphones that I use to listen to music).

I am always open to an improvement in this situation, so when I saw the F25 Cell phone stand with wireless speaker at Temu for just under 100 NIS, I thought that this might prove to be a solution. This arrived a few days ago and I immediately put it to work. At first I put my phone in the holder, but a few minutes I realised that this was unnecessary as the bluetooth connection works upto 10 metres.

For the first few phone calls that I received, those who called me said that they couldn't hear me too well, so I cranked up the volume (there's no separate microphone and speaker volumes) and this seemed to work.

Whilst walking the dog (once again), I thought that it should be possible to play music from the computer via this device, thus obviating the need for headphones. This does work, but so far, I have been unable to answer a phone call whilst music is playing. This is in contrast to what is written in the manual.

Fortunately there appears to be some form of Internet support so I'll write to them and see what happens.

Incidentally, this item is no longer available1 from Temu; neither is it available from Amazon.

Internal links
[1] 1842



This day in history:

Blog #
Date
TitleTags
77310/11/2014
Literature review: second draft completedDBA
98510/11/2016
Data collectionDBA
109010/11/2017
INTQUANT and REALQUANTPriority tips

Saturday, November 09, 2024

Beneath a scarlet sky

I'm not sure how I became aware of this book; I suspect that it popped up when I was looking for books whose action took place around Milan and/or Como. Whatever the source, I have spent the past week reading it on the Kobo. 

Initially I was put off by the introduction that begins "In early February 2006, I was forty-seven and at the lowest point of my life." I've read books that start like this before, where the "I" is a character, the narrator of the book, and not the author herself. I was therefore somewhat dubious about this introduction and didn't read it too closely.

The story itself is that of a 17 year old youth from Milan, beginning in June 1943. Italy was occupied by the Germans (if I recall correctly, the Italian army had surrendered by this time, but doing so only caused more Germans to flow into Italy), and when the book begins, the first bombing raid of the Allies on Milan takes place. The protagonist, Pino Lella, is sent to a retreat, Casa Alpina, in the far north of Italy, initially in order to evade the bombing, but he is soon put to work by the priest running the retreat/summer school, whereby he learns various paths in the hills about the retreat. I realised before Lella did that he was learning these paths in order to escort Jews out of Italy and into Switzerland.

After several months of this activity, he is warned by his parents that his 18th birthday is about to happen, and when it does, he will be conscripted into the army. He is thus advised to volunteer and by pulling strings, he gets into the Organization Todt, the German military engineering organisation whose job in Italy appears to be building defensive positions for the army and for extracting various resources from the locals. By a series of events that seem to be more fictional than fact, Lella becomes the chauffeur of the Todt General in Italy, Major General Hans Leyers.

Levers travels around northern Italy, driven by Lella who takes as many covert notes as he can that are then passed on to the Allies. Towards the end of the book, set in late April 1945 (i.e. the end of the war), Levers - who was arrested by Lella but apparently had cut some deal with the Americans - calls Lella by his partisan codename, "Observer". Whilst this does Lella's head in, it is never explained.

Is the story real? The pre-introduction states "Though based on a true story and real characters, this a work of fiction and of the author’s imagination." There has been a great deal of discussion about the truth in this novel - see here and here.

Does it matter? Author Mark Sullivan states at the beginning that this is fiction based on fact, and so can be seen as similar to most of the books written by Robert Harris - historical novels based on fact (most of them are 20th century histories). Taken as a story, it is very gripping and also informs on a part of the 2nd World War that is not so well known. 

The roles of the Catholic priest in Casa Alpina and the Cardinal of Milan in saving Jewish lives was not known to me (and seems surprising) but apparently the priest, Father Re, was named to the “Righteous Among the Nations,” an honor given by Yad VaShem, the Israeli World Holocaust remembrance center, to those who selflessly risked their own lives to save Jews. This is something that I can easily check: the Yad VaShem website lists 766 Italians; there is no Re on that list, neither is seminarian Giovanni Barbareschi (mentioned several times in the book) nor Cardinal Schuster. Of course, these may be pseudonyms. 

The Wikipedia page about General Levers tells a different story to that of the book's, including that Levers provided assistance to his neighbor, Ginevra (Bedetti) Masciadri (recognized by Yad Vashem as Righteous Among Nations on October 13, 2004). The Wiki article ends with the sobering note: researchers and historians refute the author's casting and reimagination of Leyers in the role of an antagonist in command of the Organization Todt operating group in Italy, and several details and accusations about the role of both Leyers and Organization Todt operations in Italy established as ahistorical and inauthentic, casting a shadow that a number of details in the story told by the book were fabricated by its author.

As a book, this is a very gripping story, and should be taken as such. But as fact, probably much less so.



This day in history:

Blog #
Date
TitleTags
42709/11/2011
Feeling the pressureMBA, Finance
118509/11/2018
Improving a solutionProgramming, Priority tips
143909/11/2021
The department of bright ideasProgramming, Problem solving

Friday, November 08, 2024

New CPAP mask

The beginning of November is when I order a new CPAP mask. There's nothing sacred about this date; simply the first time that I ordered a mask without machine was in November/late October of some year. As the health fund pays for a new mask once a year, it makes sense to order at the same time every year.

The mask that I have been using for the past few years is now obsolete; I was sent a new mask whose picture appears on the left. This is a much lighter mask, missing some of the structure that the previous mask had. Also, taking it off will be much easier as there is a hook-like device at the end of the head strap.

It's just as well that a new mask has arrived as over the past few weeks the machine has been reporting leaks every night. This is probably because the mask hasn't been sitting firmly on my face because the strap's velcro closure has been weakening and frequently opening. Although the new mask has a velcro closure - that's how one adjusts the length of the straps - the hook will mean that I will be applying less pressure on the straps. 

I'm not explaining this very well; the new mask, because of its structure, should not suffer from the same problems as the old mask.

Something strange: whilst looking for a picture to post here, I came across the company's site. They are offering the mask for 799 NIS to those who order from the site, as opposed to the regular price of 999 NIS. I was charged 1600 NIS! Whilst it's true that I don't actually spend that amount as I get reimbursed in full, it seems as if the company is exploiting the health fund and charging more than they should. I wonder who orders from the site - I phone the company and verbally order; maybe next year I'll order from the site and save the health fund some money.



This day in history:

Blog #Date TitleTags
64508/11/2013Sorting in Excel via Delphi automationProgramming, Delphi, Excel, Office automation
90008/11/2015Conceptual changeDBA
90108/11/2015900 blogsMeta-blogging
143808/11/2021DBA updateDBA
155108/11/2022First rain of the yearWeather

Wednesday, November 06, 2024

Guy Fawkes night

It's a shame that Israel does not celebrate Guy Fawkes night because yesterday evening, 5 November, would have been the perfect timing for the modern equivalent of the Gunpowder plot. Instead of burning an effigy of Guy Fawkes in bonfires, many Israelis would have been only too pleased to burn an effigy of Binyamin Netanahu, our populist Prime Minister.

Why especially last night as opposed to many other nights over the past two years, you may ask. Because Prime (as his equivalent is referred to in the book 'Precipice' by Robert Harris that I recently read) once again fired his defense minister, this time doing it face to face with a 'termination of employment' letter in a meeting that apparently lasted three minutes. Gallant, the previous defense minister will be replaced by a puppet of Prime.

Quoting the Globes article referenced above, Netanyahu said, "In the midst of a war, more than ever, full trust is needed between the prime minister and minister of defense. Unfortunately, although in the first months of the war there was such trust and there was very productive work, in recent months that trust between the minister of defense and myself has been broken."

Whilst that might well be true, many people feel that Gallant was concerted with doing his job to the best of his ability - in other words, defending Israel and defeating its enemies. He was hampered by a Prime Minister who as always seems to be more interested in continuing his rule, whatever the cost. Let us not forget whose 'conception' was shattered a year ago.

As National Unity party leader MK Benny Gantz said in response,"This is politics at the expense of national security."

People took to the streets last night in a repeat of the previous "Night of Gallant"1 although it is doubtful whether these demonstrations will have any effect. This is when the effigy should have been burnt.

This political move comes after a very tense week in which it has been revealed that an advisor of Prime who lacks a sufficient security clearance has been leaking secret data to foreign newspapers. Also it appears that documents relating to cabinet discussions on defense have been doctored after the event. Another blot on the PM's secretariat.

Having a puppet for defense minister means that Prime will be able to remove much of the army's leadership, those who stood firm on the topic of enquiries into the management of the war, especially the events of 7 October. Gallant stood firm in defense of the army and wanted for heads to roll in the political circles should heads fall in the army. Now the politicians will not be called to account for their actions ... once again.

Where are our elections?

And talking of elections, at 10 am, 6 November 2024, it seems fairly certain that once again the American president will be that pig of a man, Donald Trump. I don't know who is emulating who, but Trump and Netanyahu is a marriage made in heaven -- and hell for all those who don't agree with them. Read Yuval No'ach Harari's latest book, "Nexus"2 for an explanation of populism.

I'm not a happy camper today.

Internal links
[1] 1596
[2] 1848



This day in history:

Blog #
Date
TitleTags
5906/11/2006
ShoppingVan der Graaf Generator, Peter Hammill, Musical instruments, Keyboard
21506/11/2009
Eliza Carthy, "Red"Morse, Eliza Carthy
30106/11/2010
Trains and mealsCooking, Trains, Slow cooker
108806/11/2017
Forty years agoPersonal, Sandy Denny, Heron
118306/11/2018
Intermediate thesis submitted!DBA
143606/11/2021
Opening Word from a thread and displaying a fileProgramming, Delphi, Threads
155006/11/2022
Appearances in my school's ChroniclesPersonal, Bristol Grammar School
185106/11/2024
More dopamineProgramming, Blog manager program

More dopamine

Following on from yesterday's blog1 about a slightly more complicated SQL query replacing iteration over a cursor, today I implemented the required change. It was a bit different from the code that I described yesterday as I already had the tag count and so did not need to use count (*) and group by.

While I was working on this, a solution popped into my mind for a problem that occurs only with the first blog of each month. Adding the blog itself is no problem - normally I do this when the 'this day in history' form is showing - but I receive the contents of the blog after having done this; frequently 'tomorrow'. In order to show the blog, I request all the blogs from 'the beginning of the current month', but since there is only one blog, the contents of the blog will be displayed instead of a list of blogs. But as there is no content yet, nothing gets displayed. Of course, I could request all the blogs from 'the beginning of the previous month', but then I get all the blogs that I don't necessarily want to see.

The solution - as always - is simple when it's formed. A new form displays a listing of the files that are in the directory that the program accesses - normally only one file will be there - the new one. The program reads the file name that will include the full directory name as well as the 'htm' suffix (e.g. 'c:\db programs\data\Perceptions dopamine rush.htm) and extracts the name of the blog entry itself ('dopamine rush'). It then checks to see that there is a blog entry with that title but with no contents, and if so, the regular code for reading the contents is executed, which also deletes the file after it has been read.

Once I had finished writing this, of course a new idea revealed itself that was very simple to implement: display the contents of the new blog entry. This will happen every time that I import contents, not only with this special case.

Internal links
[1] 1850



This day in history:

Blog #Date TitleTags
5906/11/2006ShoppingVan der Graaf Generator, Peter Hammill, Musical instruments, Keyboard
21506/11/2009Eliza Carthy, "Red"Morse, Eliza Carthy
30106/11/2010Trains and mealsCooking, Trains, Slow cooker
108806/11/2017Forty years agoPersonal, Sandy Denny, Heron
118306/11/2018Intermediate thesis submitted!DBA
143606/11/2021Opening Word from a thread and displaying a fileProgramming, Delphi, Threads
155006/11/2022Appearances in my school's ChroniclesPersonal, Bristol Grammar School

Tuesday, November 05, 2024

Dopamine rush

I'm currently reading the book "Coders: the making of a new tribe and the remaking of the world" by Clive Thompson. I initially thought that I had not read the book before, but evidently I have as I left digital notes throughout the book. I wonder whether the title of this book subconsciously inspired the title of my song, "Looking for his tribe". I'm sure that there's a line in the book about the dopamine rush that comes from writing successful code, but I can't find it now.

So, in search of some dopamine, I considered what I could add to my blog manager program. After some musing, I thought that it would be 'neat' to take a list of blogs (e.g. those from the current month) and graph the most popular tags contained in those blogs. I have a graphing unit and I also wrote a query that returns the tag count - I use this to prepare the table that I display at the end of every 100 blogs.

I had to modify that query slightly in order to insert values into the temp table so that they could be passed to the graph unit. My first attempt was as follows

insert into temp (instance, id, chardata, payload) select inttostr (inst), tags.id, tags.name, count (*) from tags inner join tag2entry on tag2entry.tag = tags.id inner join temp t1 on t1.id = tag2entry.entry where t1.instance = :p1 group by tags.id, tags.name

That sql query won't actually work as written because of the 'inttostr (inst)' statement. I am actually building the query as text then adding it to the TSqlQuery component because as far as I know, one can't use a parameter in the select clause. Although the query compiled without error, no results were graphed; after examining the code, I realised that I had used the wrong instance number in the query but had passed to the graph unit the correct instance. As written in 'Coders' and quoting Seymour Papert, No program works right the first time.

When I used the correct instance number, the tag counts were graphed. Immediately I could see that whilst the correct tags were displayed, there were too many of them for to display all their names. I remembered that in previous uses of the graph unit, I had limited the number of tags to be displayed to 10. In those uses, the values had been inserted via a cursor, so I could maintain a count of how many tags had been inserted. Here I was using the 'insert into/select from' syntax, so I was forced inspired to use an SQL command that I rarely use; the first line became 'select first 10' and so only ten values were inserted into the temp table and then displayed.

Whilst this did indeed display only ten values and these ten were displayed in ascending order (a trick of the graph unit), they weren't the correct ten values. I had to sort the query first before selecting the first ten, and so at the end of the query I added the line 'order by 4 desc'. The use of the index 4 means that the query result should be sorted by the fourth field in the select statement, namely count (*). This field doesn't have a name exactly so the index solved that problem.

Now I do have the top ten tags for a given range of blog entries graphed. As is my wont, I contemplated this code whilst walking the dog and realised that the previous queries that I had written to display a top ten of tags could be simplified/complicated by using this syntax. I alluded to this two paragraphs ago when I wrote the values had been inserted via a cursor; whilst the SQL code would be slightly more complicated, the program code itself would be greatly simplified. I'll save that dopamine rush for later.

Internal links
[1] 1844



This day in history:

Blog #
Date
TitleTags
127205/11/2019
Draft thesis reviewDBA
135505/11/2020
First rainPersonal, Weather
143505/11/2021
Counting beats with Van der Graaf Generator (3)Van der Graaf Generator, Time signatures
154905/11/2022
November 5Israel, Literature, Peter Robinson