Title | Tags | ||
---|---|---|---|
108 | New computer | Computer | |
517 | Remixing songs and playing live | MIDI, Guitars, Antibes | |
770 | Importing purchase orders | Programming, ERP | |
899 | Vinyl log 24 - 29 October | Van der Graaf Generator, 1975, Vinyl log | |
1542 | The 8-puzzle | Programming, Puzzles |
Sunday, October 29, 2023
Farewell, Avon SG copy
Saturday, October 21, 2023
Seventh chords
Name | Third | Fifth | Seventh | Notes in C |
---|---|---|---|---|
Dominant 7 | Major | Minor | Minor |
C E G Bb |
Major 7 | Major | Minor | Major |
C E G B |
Minor 7 | Minor | Major | Minor |
C Eb G Bb |
Minor Major 7 | Minor | Major | Major |
C Eb G B |
Half diminished 7 | Minor | Minor | Major |
C Eb Gb Bb |
Fully diminished 7 | Minor | Minor | Minor |
C Eb Gb Bbb |
7#5 | Major | Major | Diminished |
C E G# Bb |
7b5 | Major | Diminished | Minor |
C E Gb Bb |
Major7b5 | Major | Diminished | Major |
C E Gb B |
Major7#5 | Major | Major | Minor |
C E G# B |
Title | Tags | ||
---|---|---|---|
58 | Busy morning | Programming, Randy Newman, Paul Simon | |
642 | Paul Klee | Personal, Bristol Grammar School | |
1084 | Sumptuous Saturday Seven - baked hake with potatoes and vegetables | Cooking |
Friday, October 20, 2023
Sorting on two or more columns
Years ago, I developed a system whereby the data in a grid could be sorted according to any column, ascending or descending, by means of clicking on the column's title: shades of Excel, or indeed Priority. Now and then I wondered how difficult it would be to sort according to two or more columns, where any of them could be ascending or descending. This couldn't or shouldn't be something that is preprogrammed as one person might want to sort according to column 2 ascending, then column 1 descending, then by column 3 ascending then by column 4 descending - there are too many options to do this in advance. Another person might want a different order.
I thought about this seriously during this morning's early dog walk. I already have several bits that would need to be put together, primarily the dual list box, in order to choose which fields are required, and the advanced addindex code that allows sorting to be according to several fields where some could be descending. Yet there are a few more bits that need to be added to the dual list box: there must be a way of marking in the list box whether a field should be sorted descending, and the order of the fields in the list box is critical (not alphabetical!). There were a few more gotchas that became clear only after I started.
Of course, each 'sorter' would have to be saved according to screen and user - this put me in mind of the SavedQueries table. After a quick examination, I realised that I needed to add only one field to this table in order to be able to support the 'sorters' - a simple binary field. By means of a default parameter, I didn't even have to change any of the existing calls that insert data into this table. The details table required the addition of the two fields that I mentioned previously: the sort order and whether the field should be sorted ascending or descending.
The four fields chosen on the left (one descending) then have to be transferred to the calling form and an index built. At first, I thought that the code necessary to build the special index would have to be in the calling form, but after a while I realised that I could do this in the sorter form as the form receives a parameter to the query thus making this unit even more self contained. One small problem that I had was that the index would have to use each field's fieldname and not the displaylabel (these are displayed in the dialog). Once I got past this, I had to build the index - I wanted to use a constant index name, but as this would be invariant, I would have to delete the index should it exist then recreate it, meaning that I would have to check whether the index existed before trying to delete it. Counting from 'fieldslist.clear', the next three lines check whether the special index exists then delete it; the fourth line add the new index, the fifth line causes the query to be sorted according to the new index and the sixth line causes the query to be displayed properly.
if (showmodal = mrOK) and (cbSorters.text <> '') then begin s:= ''; reverse:= ''; dm.qSorterDistList.Params[0].asinteger:= getCBValue (cbSorters); dm.qSorterDistList.Open; while not dm.qSorterDistList.eof do begin n:= dm.qSorterDistList.fields[0].asinteger; s:= s + query.fields[n].fieldname + ';'; if dm.qSorterDistList.fields[1].asinteger = 1 then reverse:= reverse + query.fields[n].fieldname + ';'; dm.qSorterDistList.next end; dm.qSorterDistList.close; setlength (s, length (s) - 1); if reverse <> '' then setlength (reverse, length (reverse) - 1); with query do begin fieldslist.clear; getindexnames (fieldslist); if fieldslist.indexof (SpecialIDXName) <> -1 then deleteindex (SpecialIDXName); addindex (SpecialIDXName, s, [], reverse, '', 0); indexname:= SpecialIDXName; first; end; end; fieldslist.free; end;
I don't know how valuable the above code is because some of the hard work is done behind the scenes. I also don't know in the end how useful this unit will be - it only makes sense where there are both repeating and non-repeating data in a grid. For example, the main 'dockets' form of the management program displays docket number and customer name, amongst other things. Each docket number appears only once, so sorting by docket number is natural. But sorting by customer can display the docket numbers for each customer in a random matter; defining an index 'customer;docket id' would sort this out (pun intended).
Looking at this code later, one clear optimisation can be seen: there's no reason to rebuild the strings 's' and 'reverse' every time. This can be done only when the sorter is defined, saving the values in the database table, so that they can be retrieved whenever the sorter is chosen.
Edit from 23/10/23: I saw how to get rid of the need to check whether the special index exists. Instead of using a constant name for the index, it is now built on GetTickCount and so is effectively random.
with query do begin idx:= 'idx' + inttostr (gettickcount mod 16384); addindex (idx, s, [], reverse, '', 0); indexname:= idx; first; end;
|
|
Title | Tags |
---|---|---|---|
209 |
|
Lucky break | TV series, Films, Olivia Williams, William and Mary, Cold feet |
419 |
|
Firebird DB management tool (4) - Corrections | Programming, SQL, dbExpress |
641 |
|
More health issues | Health, CPAP |
767 |
|
The seach for serendipity | DBA, SQL |
894 |
|
Vinyl log 23 | Vinyl log, 1971 |
1268 |
|
This must be the place (2) | Personal |
1350 |
|
DBA update | DBA |
Thursday, October 19, 2023
Think again: the power of knowing what you don't know
Title | Tags | ||
---|---|---|---|
766 | Literature review: first draft completed | DBA | |
1267 | Juliet (naked) - the film | Films, Nick Hornby |
Monday, October 16, 2023
The running grave
This book is long! The length of the books seems to increase according to the position of the book in the series (i.e. the seventh is longer than the sixth that is longer than the fifth, etc); one wonders whether this length is justified. As opposed to books by Tom Clancy that could easily be trimmed by 30%, there is very little fat on this book. A great deal of the book is devoted to Robin's undercover stay; there's the secondary plot of the stalked actress - this is necessary as the actress plays an important part in a later section of the story.
Then we have the backdrop of mainly Strike's personal life - his uncle, his long time ex-girlfriend, his current very problematic squeeze and of course the will they/won't they sexual tension between Strike and Robin, ending the book with a broad wink to all shippers. Probably the sub-sub-plot of competition with a rival agency could have been dropped entirely without interfering too much, but on the other hand, this adds verisimilitude in that in real life one has to deal all the time with multiple issues that have no connection between each other but take up time and mental space.
Certainly the brief mentions of Brexit are fairly irrelevant; whilst this is a huge issue for Britain in 2016, it has absolutely nothing to do with the book. Other real time political events have not been mentioned in any of the other books* so this one seems slightly jarring, especially as Strike has no view whatsoever on the topic (it certainly doesn't affect his business).
One thing that eludes me is understanding the motivation of the UHC elders. Maybe I missed something (and I read the book carefully for the second time), but this seems to be lacking. Yes, "Papa J" can have sex with multiple partners including underage females, and yes, his wife seems to be a total sadist, but this doesn't seem to be sufficient to justify the creation of their "church" and the lengths that they go to in order to hide as much as possible. There is also very little mention of the good that UHC apparently does to justify its public side: there are mentioned various shelters for homeless people and drug addicts but this isn't gone into very deeply.
* Rereading an earlier Strike book, Career of evil, I see that this statement is untrue. Here we have a royal wedding and the killing of Osama bin Laden. The royal wedding (Kate and William) is a distorted mirror image of the disintegrating relationship between Robin and her then fiancé.
Title | Tags | ||
---|---|---|---|
1348 | PrioXRef 3 - insert without parameters | Programming | |
1538 | Indexing blogs | Programming, Meta-blogging |
Friday, October 13, 2023
Time out
About two weeks ago, I wrote about completing the "7/4 song", aka "The great escape". The arrangement was somewhat bombastic and featured several innovations (at least, for me), including several tracks for drums, some of which were panned and some not; the snare track had an echo that created an interesting effect. But listening to the song repeatedly (propably hearing it in my head and not so much listening to it) caused me to doubt the suitability of the arrangement; maybe something lighter would be better. So a few days ago I started with a copy of the then final MIDI file, then ripped out several instruments, including the drums and arppegiators, but leaving a few. I then rebuilt the arrangement in a different style, although the solos remain. After having completed this second version (that also went through a few iterations), I am now uncertain as to which version is better; I shall let time decide.
The song can be heard here.
Title | Tags | ||
---|---|---|---|
139 | Fotheringay 2 | Sandy Denny, Fotheringay | |
414 | Kindle | Kindle | |
640 | Tasks | Programming, Delphi | |
1265 | Acting like an MBA (a 'suit') | Personal, MBA |
Thursday, October 12, 2023
A military funeral
Title | Tags | ||
---|---|---|---|
18 | The six rings | Bar mitzva | |
293 | Cooking for Geeks | Cooking, Food science | |
515 | A new season, a new team | Maccabi Tel Aviv | |
639 | Sleep apnea | Health, CPAP, Apnea | |
1082 | Madam Secretary | TV series | |
1264 | Two (historical) events which I wish had never happened | Israel, Gap year | |
1347 | Cardiologist | Health |
Wednesday, October 11, 2023
Communal grief (2)
Title | Tags | ||
---|---|---|---|
207 | This tickled my fancy | Dog | |
638 | More books | Literature, Tom Clancy | |
1081 | Research questions | DBA | |
1346 | Continuing the story of porting an application to Windows 10/Delphi 10.2 | Programming, ClientDataSet | |
1535 | Another DBA update | DBA |
Sunday, October 08, 2023
The blackest day for 50 years - notes from a peripheral participant
Yesterday (Saturday, 7 Oct 2023), my wife woke me at about 6:30 am - "Wake up, there are booms outside" [booms in this context is the sound and pressure wave of a missile falling to the ground]. We turned on the television and saw the unpleasant and automatic messages from the Home Guard, showing where missiles were falling and where inhabitants had to get to air raid shelters or their internal security room. At first the locations were only settlements near the Gaza border, but slowly more and more targets appeared, further and further away from the border. As our bedroom doubles as the security room, we stayed where we were, but I closed the steel shutters to the window.
We saw that the locations were getting closer and closer to where we live and eventually the local sirens went off. At the same time, the list of locations included Jerusalem, a location that one would not expect to be targeted (what would happen should a missile fall on East Jerusalem, or worse, on one of the holy sites?). I have no idea of how much damage the 1,500 rockets fired at Israel caused, although I suspect that it was relatively little and that the barrage was more like covering fire.
By this time, the television news company had got its act together and had started broadcasting properly with correspondents situated at various locations. It was then that we heard that the enemy had overrun and occupied at least two kibbutzim near the border. The residents - my spiritual brothers and sisters - were all sitting tight in their security rooms, but this was an event that had not occurred since 1948 when a few kibbutzim were similarly overrun during the war of independence. There were some heartbreaking conversations between the television anchor and frightened kibbutz members hiding in their houses and playing possum. Each kibbutz has a primary reaction force composed of members, and these were trying to engage the enemy, with varying degress of success.
At the same time, filtering in were the first reports about an outdoor festival (what the British would call a rave) that inexplicably had been situated in the same general area. The enemy had arrived at this site and were shooting people; the festival participants had all run away, trying to get away from the enemy and in the hope of finding some shelter. Some survived, some were killed and some were taken prisoner.
Videos (filmed by the enemy) began to be shown of how they managed to breach the border wall, how they were strutting down the streets of Sderot and Ofakim (towns situated about 30 km from the border) and most painful of all, a Palestinian news reporter giving a summary whilst standing in a kibbutz; behind him could be seen enemies looting houses and storage areas, taking anything that came to hand.
All this time, more and more missiles were raining down on the south of Israel. The number of deaths began to rise and rise - 10 dead, 20 dead, 50 dead, 100 dead - along with an even greater number of injured people. One number that was never shown, primarily because of its negative affect on morale but also because it was simply unknown, was the number of prisoners - both soldiers and civilians - taken.
By nightfall, the situation had changed somewhat. There were very few rocket launches after about 4pm, but at 8pm - primary news time - again a huge barrage was fired, causing damage in cities around Tel Aviv. The air force had got its act together and was shooting at enemies trying to return to the Gaza strip along with the more familiar site of tall buildings (that house enemy headquarters) in Gaza being destroyed. Reserves had been called up and deployed at various locations, trying to free hostages and remove enemy forces.
Inevitably comparisons have been made between now and 50 years ago, the Yom Kippur war. Staring us in the face is the complete surprise and lack of intelligence; as the commentators say, this concerted and coordinated attack must have been planned and rehearsed for months, if not years, yet Israel "was caught with her trousers down". On the other hand, there is no comparison at all: then the battlefields were nowhere near civilian locations (especially in the south), and whilst some settlements were threatened on the northern front, the civilian population was never at risk. Yesterday the battlefields were kibbutzim and towns, with rockets raining down on the civilian population.
In the late afternoon, we heard about approaches made by the leaders of the two major opposition parties in the Knesset to join forces with the Likud party and form a time limited emergency government that could make rational and professional decisions about running this war. One leader indicated that the more extreme members of the government would have to leave (mentioning no names but we all know who he was talking about) whereas the other did not mention this. All other legislation would be put aside for the time being. Netanyahu cannot refuse.
The colossal damage that extremist politicans have caused in the past nine months may have given our enemies the impression that Israel has been torn apart by internal forces and that she is weaker, but in times of war, we are all united.
It is now 7:52 am on Sunday morning, 8 Oct 2023. I have just received a much-copied WhatsApp message saying that General No'am Tibon [a son of Tzora - NN] aged 62, an anarchist who demonstrates every weekend in Tel Aviv, drove from Tel Aviv in order to rescue his grandchildren who have been hiding without movement for 10 hours in Kibbutz Nahal Oz [a border kibbutz]. On his way, he picked up four soldiers, formed a squad, then staged a battle with five terrorists who were in the home [presumably where his grandchildren were]. He freed the children then drove home. A privileged person. [A fuller and more accurate version of this story, albeit in Hebrew, can be found here.]
This last sentence is extremely sarcastic as one of the epithets hurled at the opponents of the destruction of the judicial system is "Privileged person" - those who had life easy by growing up in a kibbutz and having doors opened for them in later life because they are white and educated... and ignoring the fact that almost all such privileged people served in the army and many reached high ranks. These are the true patriots.
Title | Tags | ||
---|---|---|---|
17 | Bar mitzva | Bar mitzva | |
205 | The girl who played with fire | Literature, Steig Larsson | |
292 | Misinformation | ERP | |
890 | How the mind works | Psychology, David Lodge | |
1429 | DBA: Pilot study 2 | DBA |
Friday, October 06, 2023
Belated discovery in Delphi: defining indexes on calculated fields
Many years ago, I showed how to define indexes on the calculated fields of a ClientDataSet in Delphi. I haven't had need to look at that code since, as I included the index creation code as a utility procedure in the management program. Today, however, I was working on a different program and wanted to sort the data in a clientdataset in descending order (using AddIndex). When I used the name of an existing field (i.e. one defined in the sql code), AddIndex worked, but when I replaced the name of the field with a calculated field, I repeatedly received an error.
After looking for information on this topic, I finally found the answer: the calculated field has to be defined as an internal calculated field (fkInternalCalc), not as a regular calculated field. Once this has been done, the index can be defined as follows
qSigHarig.Open; qSigHarig.addindex ('idx1', 'thissig', [ixDescending], '', '', 0); qSigHarig.indexname:= 'idx1'; qSigHarig.first;
Title | Tags | ||
---|---|---|---|
412 | Rest in peace | RIP | |
980 | Health update | Health, Theanine, Donating blood | |
1533 | Weight and bp confirmed | Health |
Thursday, October 05, 2023
The neuroendocrine system and my blood tests
Title | Tags | ||
---|---|---|---|
16 | Sudoko | Programming | |
203 | Old computer in new case | Computer | |
411 | Firebird DB management tool (3) - Bells and whistles | Programming, SQL, dbExpress | |
979 | DBA: Entering the final third of the doctorate | DBA | |
1079 | A kibbutz day | Jewish holidays, Obituary, Kibbutz | |
1178 | Geoff Emerick, 1945-2018 | Obituary, Beatles | |
1342 | Continuing the development of the Priority Cross Referencer (PrioXRef) | Programming | |
1428 | Continuing the BP saga | Health, CPAP, Blood pressure, Aldosterone |
Tuesday, October 03, 2023
A day spent studying
I took a day off yesterday* in order to continue my nutrition studies. I breezed through the section on the cardiovascular system then followed it by the musceloskeleton system. I tried working on the immune system, which is much more interesting than the musceloskeleton system and also more intimately connected to nutrition (undernutrition interferes with the immune system) but there was simply too much to learn in one go.
Whilst answering the multiple choice questions for these systems, I realised with a very heavy heart that the course requires memorising the material but not necessarily understanding it. The musceloskeleton system material was very much a 'naming of the parts' that makes learning hard but barely contributes to understanding (if not directly hindering).
I noticed a few ambiguities in the texts that were brought to my attention by some of the questions. As I asked, What is the difference between "formation of red blood cells" and "production of red blood cells" (apart from the fact that they have different names)? Formation and production appear to be synonyms.
Title | Tags | ||
---|---|---|---|
105 | Sandy Denny - Live at the BBC | Sandy Denny | |
762 | Watching the weight (once again) | Health | |
889 | More statistics functions with SQL | DBA, SQL, Statistics | |
1077 | The 'check-field' trigger | Priority tips | |
1177 | Knocking my head against a brick wall | Programming, Delphi, Priority tips |