The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,839 other subscribers

Archive for the ‘Software Development’ Category

Autoregister attribute for Delphi | Jon L. Aasenden

Posted by jpluimers on 2018/01/10

Interesting idea:

[WayBack] Wouldn’t it be nice if Delphi has an attribute that automatically registers your class for you? – Lennart Aasenden – Google+

Source at [WayBackAutoregister attribute for Delphi | Jon L. Aasenden

–jeroen

Posted in Delphi, Development, Software Development | Leave a Comment »

Anonymise of data is hard, not just for now, but especially preventing future de-anonymisation

Posted by jpluimers on 2018/01/09

Two very interesting videos showing some background information as it is extremely hard to anonymise data. Not just for now, but especially against future de-anonymisation efforts.

–jeroen

Posted in Development, Software Development | Leave a Comment »

Some FastMM scenarios require NeverUninstall because the System unit finalizes things innitialised in other units

Posted by jpluimers on 2018/01/09

You always have to be careful  with Delphi finalization sections cleaning up things that might have not created inside the corresponding initialization section. This is especially true for the System unit.

That one actually contains this little piece of code that is being called after FinalizeUnits is called which also fianalises external memory managers like FastMM:

finalization
{$IFDEF WEAKREF}
  InstHashMap.Finalize;
{$ENDIF}...
{$IFDEF MSWINDOWS}
 FinalizeLocaleDate;
 if PreferredLanguagesOverride <> nil then
 FreeMem(PreferredLanguagesOverride);
...

Which means that you will have to enable the NeverUninstall conditional define as soon as the InstHashMap has been used.

Most often that’s the case with FMX applications that heavily relies on weak references.

The same holds for PreferredLanguagesOverride which is used by SetLocaleOverride and can be worked around by performing this right at the end of the .dpr:

SetLocaleOverride('');

–jeroen

via:

Posted in Delphi, Development, Software Development | Leave a Comment »

How did this shit ever work? – The Isoblog.

Posted by jpluimers on 2018/01/09

Though I like Python, I can feel the pain when maintaining in other’s code: [WayBackHow did this shit ever work? – The Isoblog reporting [WayBacknetwork.py does not handle interface resets properly · Issue #663 · python-diamond/Diamond.

Via: [WayBack] How did this shit ever work? – Kristian Köhntopp – Google+

Image from Reddit: parodies on O RLY Books: [WayBackimgur.com/qErVcwA: Life on an Ops team…

–jeroen

Read the rest of this entry »

Posted in Development, Python, Scripting, Software Development | Leave a Comment »

Animation problems in Delphi Tokyo 10.2 update 2? Check bug RSP-19525

Posted by jpluimers on 2018/01/07

If you run into animation problems in Delphi Tokyo 10.2 update 2, then read [WayBack] … In particular I cannot use the use the animation to change the tab in a TabControl… – Raffaele Miola – Google+.

It is likely that  RSP-19525 (10.2 Tokyo Release 2 breaks Animation under Android – App hangs).

Some temporary fixes that might help you are here:

I think that for cross platform and especially mobile development means you need to use tools from vendors that live and breathe that, by constantly showing they master these subjects for instance having good apps in the app stores and examples that are regularly updated to the ever changing field.

I really wonder what the rest of the Delphi community thinks about that.

–jeroen

Posted in Delphi, Development, FireMonkey, Software Development | 1 Comment »

Record helpers can do wonders for code clarity.

Posted by jpluimers on 2018/01/04

A few people recently discovered the beauty of record helpers:

Record helpers can help any value type (which includes enumerated types) so you can add functions to enumerations.

Class helpers can help class types.

There are no interface helpers and likely won’t be there for a long while.

–jeroen

Posted in Conference Topics, Conferences, Delphi, Development, Event, Power User, Software Development | 2 Comments »

Delphi inner scoping is undefined. Please Embarcadero/Idera, come up with a formal language definition for Delphi

Posted by jpluimers on 2018/01/04

[WayBack] Hi there, this is pure curiosity only; but this compiler behaviour seems odd to me. What do you think?… – Agustin Ortu – Google+

The problems start when you prefix the outer class which you have to when using inner consts ([WayBack] Oh nice. Feel free to QP. Fails at least in Delphi XE8. … – Jeroen Wiert Pluimers – Google+).

The big problem in both cases is a formal language specification. The lack of a formal language specification makes it very hard to predict the effect of use cases or generate them for testing.

So this post is yet another request: Please Embarcadero/Idera, come up with a formal language definition for Delphi.

Read the rest of this entry »

Posted in Delphi, Development, Software Development | 2 Comments »

mappings between counters, structure and Task Manager columns – Memory Performance Information (Windows)

Posted by jpluimers on 2018/01/03

I copied the tables from [WayBackMemory Performance Information (Windows) as even Microsoft managed to let information “disappear” for EOL products (the en-US version already “disappeared”):

System Memory Performance Information

The following table associates memory object performance counters with the data returned by the memory performance functions in the MEMORYSTATUSEX, PERFORMANCE_INFORMATION, andPROCESS_MEMORY_COUNTERS_EX structures, and with the corresponding information displayed by Task Manager.

Memory object counter (unless otherwise noted) Structure Task Manager Performance tab for Windows Server 2008 and Windows Vista Task Manager Performance tab for Windows Server 2003 and Windows XP
Available KB MEMORYSTATUSEX.ullAvailPhys andPERFORMANCE_INFORMATION.PhysicalAvailable Subtract usage value shown in Memorygraph from Physical Memory (MB): Total Physical Memory: Available
None MEMORYSTATUSEX.ullTotalPhys andPERFORMANCE_INFORMATION.PhysicalTotal Physical Memory (MB): Total Physical Memory: Total
Committed Bytes PERFORMANCE_INFORMATION.CommitTotal System: Page Filefirst value (in MB) Commit Charge: Total
Commit Limit MEMORYSTATUSEX.ullTotalPageFile andPERFORMANCE_INFORMATION.CommitLimit System: Page Filesecond value (in MB) Commit Charge: Limit
Free & Zero Page List BytesWindows Server 2003 and Windows XP:  This performance counter is not supported. None Physical Memory (MB): Free Not applicable
None PERFORMANCE_INFORMATION.CommitPeak None Commit Charge: Peak
None PERFORMANCE_INFORMATION.HandleCount System: Handles Totals: Handles
None MEMORYSTATUSEX.ullAvailPageFile None None
Pool Nonpaged Bytes PERFORMANCE_INFORMATION.KernelNonpaged Kernel Memory: Nonpaged Kernel Memory: Nonpaged
Pool Paged Bytes PERFORMANCE_INFORMATION.KernelPaged Kernel Memory: Paged Kernel Memory: Paged
Pool Paged Bytes + Pool Nonpaged Bytes PERFORMANCE_INFORMATION.KernelTotal Kernel Memory: Total Kernel Memory: Total
Processes (Objects object) PERFORMANCE_INFORMATION.ProcessCount System: Processes Totals: Processes
Thread Count (Process(_Total) object) PERFORMANCE_INFORMATION.ThreadCount System: Threads Totals: Threads
Cache Bytes + Sharable pages on the standby and modified lists PERFORMANCE_INFORMATION.SystemCache None System Cache
Cache Bytes + Modified Page List Bytes + Standby Cache Reserve Bytes + Standby Cache Normal Priority Bytes + Standby Cache Code BytesWindows Server 2003 and Windows XP:  Except for Cache Bytes, these performance counters are not supported. None Physical Memory (MB): Cached Not applicable

 

Process Memory Performance Information

The following table associates process object performance counters with the data returned by the memory performance functions in the MEMORYSTATUSEX, PERFORMANCE_INFORMATION, andPROCESS_MEMORY_COUNTERS_EX structures, and with the corresponding information displayed by Task Manager.

Process object counter Structure Task Manager Processes tab for Windows Server 2008 and Windows Vista Task Manager Processes tab for Windows Server 2003 and Windows XP
Handle Count None Handles Handles
Page File Bytes PROCESS_MEMORY_COUNTERS_EX.PagefileUsage Commit Size for all processes except the System process. For the System process, Page File Bytes is always 0. VM Size for all processes except the System process. For the System process, Page File Bytes is always 0.
Page File Bytes Peak PROCESS_MEMORY_COUNTERS_EX.PeakPagefileUsage None None
Pool Nonpaged Bytes PROCESS_MEMORY_COUNTERS_EX.QuotaNonPagedPoolUsage NP Pool NP Pool
Pool Paged Bytes PROCESS_MEMORY_COUNTERS_EX.QuotaPagedPoolUsage Paged Pool Paged Pool
Private Bytes PROCESS_MEMORY_COUNTERS_EX.PrivateUsage Commit Size VM Size
Thread Count (Process(<image name>) for the specified image) None Threads Threads
Virtual Bytes MEMORYSTATUSEX.ullTotalVirtualMEMORYSTATUSEX.ullAvailVirtual None None
Virtual Bytes Peak None None None
Working Set PROCESS_MEMORY_COUNTERS_EX.WorkingSetSize Working Set (Memory) Mem Usage
Working Set Peak PROCESS_MEMORY_COUNTERS_EX.PeakWorkingSetSize Peak Working Set (Memory) Peak Mem Usage
Working Set – PrivateWindows Server 2003 and Windows XP:  This performance counter is not supported. None Private Working Set Not applicable
None PROCESS_MEMORY_COUNTERS_EX.QuotaPeakNonPagedPoolUsage None None
None PROCESS_MEMORY_COUNTERS_EX.QuotaPeakPagedPoolUsage None None
None MEMORYSTATUSEX.ullAvailPageFile None None
None MEMORYSTATUSEX.ullTotalPageFile None None

 

–jeroen

Posted in Development, Software Development | Leave a Comment »

Michael Kaplan Obituary – Berkowitz-Kumin-Bookatz | Cleveland Heights OH (and a whole bunch of info in zero width Unicode stuff)

Posted by jpluimers on 2018/01/02

I totally missed the passing of Michael Scott Kaplan some 2 years ago, so a belated R.I.P. is in place.

Obituary for Michael Kaplan, Michael Scott Kaplan, 45, passed away Wednesday, October 21, 2015, in Redmond, WA, after a brave battle with MS for 25 years. He was a lead software developer for Microsoft.

Source: [WayBackMichael Kaplan Obituary – Berkowitz-Kumin-Bookatz | Cleveland Heights OH

Michael was the leading source on i18n, L10N, Unicode, sorting, normalisation and other things having to do with languages, representations and writing.

Besides that he was a really nice guy of which I enjoyed his MSDN materials.

Other people enjoy that too, so I’m glad his writings have been archived: [first archive.is, second archive.is, WayBackSorting it All Out: Archives

Here are some additional links:

More on miloush.net:

Read the rest of this entry »

Posted in Ansi, Development, Encoding, internatiolanization (i18n) and localization (l10), Software Development, The Old New Thing, UTF-8, UTF8, Windows Development | Leave a Comment »

Reinstalling atom.io: getting the user-installed package list then re-installing it.

Posted by jpluimers on 2018/01/02

Sometimes your Atom installation gets so unstable that the quickest solution is a reinstall. For that you need to get a list of user-installed packages, then re-install them.

On Windows your Atom Package Manager apm is here (but not in the path), where the first is version specific and the latter the most recent version:

%LOCALAPPDAT%\atom\app-1.18.0\resources\cli\apm.cmd
%LOCALAPPDATA%\atom\bin\apm.cmd

On Mac OS X, it is here and in the path:

/usr/local/bin/apm
/Applications/Atom.app/Contents/Resources/app/apm/node_modules/.bin/apm

Save your packages:

apm list --installed --bare > package-list.txt

Install packages:

apm install --packages-file package-list.txt

For my own memory, the settings folders:

  • Windows: %USERPROFILE%\.atom
  • Mac OS X: ~/.atom

–jeroen

via:

Posted in atom editor, Development, JavaScript/ECMAScript, Node.js, Power User, Scripting, Software Development, Text Editors | Leave a Comment »