Sunday, November 2, 2025

Pareto's Rule in data requirements

It always surprises me how many pieces of data or input you need to achieve a relatively small and simple task. In this case just a simple comment on a pdf-drawing. For the font you need: "name, size and color", the position needs: "X and Y coordinate" or "location BR" (BottomRight) and an "Angle" and finally it needs a "Markup template"; that is 8 pieces of information for one line of code to create the markup (and that is inline with Pareto's 80-20 rule). I'm storing all this info for later use as well, so it is a one-time exercise based on the provided drawing and markup requirements. This will keep it versatile or is that called agile nowadays (Miriam Webster: The meaning of AGILE is marked by ready ability to move with quick easy grace).  Fortunately I am not bound by budgets or time restraints.

 


 

Saturday, November 1, 2025

ClientDatasets (Memory tables)

 Blistering fast data loading and processing with TClientDataSet (using Delphi 13, 64 bit, September 2025 release), all records loaded and processed (279x) in under 0.5 second. Yes, you can learn something from Cary Jensen (https://lnkd.in/gQCQqxGt) and he is a really nice guy.

 



Renaming Utility

Another tool on the coordinator tool-belt, renaming files using pre-defined renaming templates, fully user driven. This one is not about speed but about versatility, consistency and flexibility and is redesigned to Delphi 13 using interfaces to keep memory usage in-check. At the same time all files will be revised to the standard revision index _R#. There is a file preview window to easily inspect a scanned document, so everything can take place in one application. Renaming can take place in the same folder or moved over to a user selected folder anywhere on the system. Files can be dropped (Current folder path will be changed to the dropped file path) or selected from the Current folder listing. I am using https://lnkd.in/g9TTA7MA (JAM Software GmbH) for the explorer-like components; they are awesome.



Main Code >> Singleton >> Interface(s)

This is the Delphi 13 development pattern I am using nowadays:
Call in Main code >> To a Singleton (Primoz G. style page 53) >> To an Interface. This setup keeps my main code very clean and crisp as the call is only ONE line (4 lines if you count definition and begin...end). This case handles 4 different actions identified by the Tag#.
To me the main code is uncoupled and it has no idea what the Interface does (Nick H. must be pleased with that, I am).
The below example results in only ONE call to the procedure that does the work "PU.StampSimple(.....). I am very pleased with the DRY result.

Primož GabrijelčičHands-On Design Patterns with Delphi - Hands-On Design Patterns with Delphi: Build applications using idiomatic, extensible, and concurrent design patterns in Delphi: Gabrijelčič, Primož: 9781789343243: Programming Languages: Amazon Canada

Nick Hodges: Dependency Injection in Delphi - Dependency Injection in Delphi: Hodges, Nick: 9781941266229: Books - Amazon.caDependency Injection in Delphi: Hodges, Nick: 9781941266229: Books - Amazon.ca

 




Monday, July 28, 2025

Maybe going to revive the blog with some Delphi ramblings

Timing procedure on execution duration.

After reading it in many books, and a need to know whether to go PPL (Primoz G says to better stay away from it if you can, in his book "Delphi High Performance"), I finally created a timing unit that makes sense to me. It keeps track of some data in a simple ".csv" file for analyzing with Excel or LibreOffice and doesn't have a huge impact on the procedural execution time.

Data: "PROJECT,APPLICATION,CLASS,METHOD,RUNTIME,COUNT,ITEM,COMMENT"

Application in procedure or function

begin

CLOCK.StartOfLife('TCheckFileForData.ProcessCncFiles');

//Do the work with some kind of loop

CLOCK.EndOfLife('Count,Item,Comment');

end;

I'm adding this to every procedure that I am expecting to take some time.

Advantage is also you can measure the effect of a refactoring or output to a form (usually this is pretty high).

Sometimes I need to check vast numbers of, fairly simple, CNC data files.

It is not uncommon to process 4-5000 files which will take about 4 seconds, the creation of an Excel report, on the other hand, will take about 9 seconds using a template.

(I am using a BeeLink SER8, Processor AMD Ryzen 7 8845HS with Radeon 780M Graphics, 3801 Mhz, 8 Core(s), 16 Logical Processora)

Pareto's Rule in data requirements

It always surprises me how many pieces of data or input you need to achieve a relatively small and simple task. In this case just a simple c...