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,860 other subscribers

Archive for the ‘C++’ Category

What Every Programmer Should Know about How CPUs Work • Matt Godbolt • GOTO 2024 – YouTube

Posted by jpluimers on 2025/09/10

[Wayback/Archive] What Every Programmer Should Know about How CPUs Work • Matt Godbolt • GOTO 2024 – YouTube

Main takeaways for me:

  • CPU pipelines have grown a lot longer than I was aware off
  • there are many more internal registers than I was anticipating
  • clever ways to convert if statements to non-jumps

--jeroen

Posted in .NET, Assembly Language, C, C#, C++, Delphi, Development, Python, Scripting, Software Development | Leave a Comment »

Windows Data Types (BaseTsd.h) – Win32 apps | Microsoft Learn

Posted by jpluimers on 2025/07/22

A while ago, I had to figure out the field sizes for some Windows API functions. In the distance past, the base data types used to be defined in windows.h, but  over the decades that file has been split into various other files as there are far more than just the BOOL, int, UINT, DWORD, HWND, LPARAM and WPARAM data types. Currently the data types are defined in [Wayback/Wayback] Windows Data Types (BaseTsd.h) – Win32 apps | Microsoft Learn.

Note that C++ allows to specify bit field sizes for fields in struct composite data types, so under some circumstances, fields my have a different number of bits than you might expect from their data type.

Via [Wayback/Archive] c++ dword uint size – Google Search.

–jeroen

Posted in C++, Development, Software Development, Visual Studio C++, Windows Development | Leave a Comment »

Q145994: HOWTO: Calculate Dialog Units When Not Using the System Font | KnowledgeBase Archive

Posted by jpluimers on 2025/07/17

It is odd that Microsoft now verifies to an external party because most of the Microsoft KB articles got deleted: [Wayback/Archive] Q145994: HOWTO: Calculate Dialog Units When Not Using the System Font | KnowledgeBase Archive.

Part of them document aspects from Microsoft Foundation Class Library – Wikipedia which is still supported.

Via: [Wayback/Archive] How does the dialog manager calculate the average width of a character? – The Old New Thing:

Read the rest of this entry »

Posted in C++, Development, Software Development, Visual Studio C++, Windows Development | Leave a Comment »

Alan Turing Wrote Object-Oriented Code In C And Ran It On BEAM – De Programmatica Ipsum

Posted by jpluimers on 2025/07/16

I originally missed this as back then I was in the midst of managing trouble in my parental family, unaware I was already having rectum cancer. Then things went fast, not even including the Covid-19 years, so I was glad last year I got reminded of this mid-2019 article:

[Wayback/Archive] Alan Turing Wrote Object-Oriented Code In C And Ran It On BEAM – De Programmatica Ipsum writes a lot of interesting things on programming paradigms, starting with

In his rare 1994 book “Object-Oriented Programming In C” Axel Tobias Schreiner explains how to do inheritance, class methods, class hierarchies, and even how to raise exceptions using nothing else than pure, simple, pointer arithmetic-filled, ANSI C.

then arguing basically most of not all modern languages share the majority of programming paradigms and all these paradigms are repeats of the past:

These days, we are using the offsprings of multiple programming paradigms having unprotected sex with one another in a thoughtful orgy. PHP, C#, Perl, C++ and even Visual Basic have all closures, lambdas or anonymous functions now. F# and Scala can instantiate any class included in their corresponding vendor-provided frameworks. JavaScript implements functions as objects with a single method .call(). Haskell comonads are actually objects. Swift 1.0 implemented instance methods as curried functions.
But none of this is new. Smalltalk, arguably the precursor of object orientation, had collect and select methods which were the grandparents of our more common map and filter functional friends.

What sets modern languages apart is that they the majority covers all the paradigms you might need, just differing in how well they support the paradigm-du-jour.

It means programming language wars should have been a thing of the past for about two decades now.

Please let that sink in.

 

Oh: if you look for that ANSI C book, here it is: [Wayback/Archive] https://www.cs.rit.edu/~ats/books/ooc.pdf [Wayback PDF View/PDF View]

 

Via: [Wayback/Archive] De Programmatica Ipsum: “”In his rare 1994 book “Object…” – mas.to

--jeroen

Posted in .NET, C, C#, C++, Cloud, COBOL, Containers, Design Patterns, Development, Docker, Erlang, F#, Go (golang), Haskell, Infrastructure, Java, Java Platform, Kotlin, Kubernetes (k8n), ObjectiveC, OOP (Object Oriented Programming), Perl, Scala, Scripting, Software Development, Swift, VB.NET | Leave a Comment »

badamczewski/PowerUp: ⚡ Decompilation Tools and High Productivity Utilities ⚡

Posted by jpluimers on 2025/07/10

Below is a really cool tool-set for Visual Studio Code of which its development started when I was recovering from life-saving bowel-surgery during the series of procedures to get rid of my metastasised rectum cancer.

It supports decompilation of various languages (.NET C# and F#, GO, Rust and clang) into either x86 assembler or IR (Intermediate Representation, on the .NET side often also called IL for Intermediate Language) to research how well a compiler stack behaves.

[Wayback/Archive] badamczewski/PowerUp: ⚡ Decompilation Tools and High Productivity Utilities ⚡:

Read the rest of this entry »

Posted in .NET, C#, C++, Development, F#, Go (golang), Rust, Software Development | Leave a Comment »

Sequoiaview altrnatives

Posted by jpluimers on 2025/06/12

I wrote about Sequoiaview in depth in SequoiaView Homepage, made some research notes in “cushion treemap” delphi – Google Search and touched it slightly in A choco install list.

I never heard back from my request for Sequoiaview source code, and given ever increasing local storage media sizes, the speed of it now has become an issue, so I started looking to see if more alternatives have appeared and what sets them apart.

TL;DR

  1. There is the open source WinDirStat that runs as non-admin and is about as slow as Sequoiaview
  2. There is the closed source but free for personal use WizTree that requires admin elevation and is much faster than Sequoiaview and WinDirStat

Neither of them allow for a view that is cushion treemap only.

The reason that WizTree is fast is that it directly uses the NTFS MFT (Master File Table) to read the information from. This requires elevated permissions.

This is the same mechanism used by the Everything search tool, but unlike Everything, WizTree:

Read the rest of this entry »

Posted in C++, Development, Encoding, Mojibake, Software Development, UTF-8, Windows Development | Tagged: | Leave a Comment »

Podcast with @mattgodbolt of godbolt.org fame, on among other things becoming a verb, 6502s, exploring compilers, and application binary interfaces.

Posted by jpluimers on 2025/05/21

From a while ago: [Wayback/Archive] Kristian Köhntopp on Twitter: “embedded.fm/episodes/334 Embedded.fm  with @mattgodbolt of godbolt.org  fame, on among other things becoming a verb, 6502s, exploring compilers, and application binary interfaces.”

Read the rest of this entry »

Posted in .NET, C#, C++, Development, FreePascal, Pascal, Software Development | Leave a Comment »

Anyone any idea on the contributions of Embarcadero to the LLVM project?

Posted by jpluimers on 2025/04/30

With the huge dependency of Delphi on the LLVM project – basically none of their cross-platform support falls apart without LLVL – I wonder how much Embarcadero and their. mother company Idera contributed back to the LLVM project (which isn’t hard, see [Wayback/Archive] Contributing to LLVM — LLVM 20.0.0git documentation).

I tried these queries with remarkably few results:

The ones found were contributed by [Wayback/Archive] jwiegley (John Wiegley) · GitHub and [Wayback/Archive] atoker · GitHub. I could not find back who atoker is, but John Wiegley was part of the C++ Builder 1 team [Wayback/Archive] The C++Builder 25th Anniversary: Visual Development, the Power of the C++ Language and 2.5 decades of Continuing Excellence but made the patches while working for Boostpro, for instance [Wayback/Archive] [cfe-commits] PATCH [1/2]: Implementation of Embarcadero expression traits.

Hoping the above queries are not good enough: anyone having a more complete idea of the Embarcadero/Idera contributions to the LLVM project?

Especially in the light of this bsky post a while ago:

Read the rest of this entry »

Posted in C++, C++ Builder, Delphi, Development, Software Development | Leave a Comment »

Windows Installer is transactional, but combined with NTFS and installer processes is not fully: do more C:\Config.msi vulnerabilities exist? (plus a truckload of information on Windows SIDs)

Posted by jpluimers on 2025/04/10

Over the last years a few C:\Windows.msi vulnerabilities have been discovered (and fixed), of which some are linked below.

The core is that the Windows Installer tries to be transactional, and NTFS is, but the combination with installer processes isn’t.

That leads into vulnerabilities where you can insert malicious Roll Back Scripts (.rbs files) and Roll Back Files (.rbf files), and I wonder if by now more have been discovered.

So this post is a kind of reminder to myself (:

Oh, and I learned much more about whoami on Windows, as there  whoami /groups shows very detailed SID information. From that, I learned more on the internals of SIDs too!

Read the rest of this entry »

Posted in Blue team, C++, Development, Power User, Red team, Security, Software Development, Visual Studio C++, Windows, Windows Development | Tagged: , , , | Leave a Comment »

For my link archive: Counting the leading zeroes and ones in a binary number with C#

Posted by jpluimers on 2025/03/13

From a while back, but still interesting:

  1. [Wayback/Archive] Counting the leading zeroes in a binary number with C#
  2. [Wayback/Archive] c# – Getting the number of leading 1 bits – Stack Overflow (thanks [Wayback/Archive] Barry Kelly and [Wayback/Archive] SoapBox)

Especially the first link explains the algorithm very well and is similar to links referred to from the Stack Overflow question as it is based on counting ones (and leading ones are basically leading zeros but bit-inverted).

It also explains a cool thing for leading zeros: modern CPU have instructions which .NET Core.

Read the rest of this entry »

Posted in .NET, AArch64/arm64, Algorithms, ARM, Assembly Language, C, C#, C++, Delphi, Development, Software Development, x64, x86 | Tagged: , , | Leave a Comment »