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

Archive for 2024

When you broke code, finding back where it got broken is easier if you have small change increment (i.e. bisection and binary tree search)

Posted by jpluimers on 2024/09/26

A while ago [Wayback/Archive] b0rk (Julia Evans [Wayback/Archive) wrote an interesting Tweet on finding back where you broke code of which the OCR text reads like this:

strategy: change working code into broken code

If I have a working version of the program, I like to:

  1. go back to the working code
  2. slowly start changing it to be more like my broken code
  3. test if it’s still working after every single tiny change
·      ⬊˙˙⸳              OH THAT’S WHAT BROKE IT!!!

I like this because it puts me back on solid ground: with every change make that DOESN’T cause the bug to come back, I know that wasn’t the problem.

by JULIA EVANS @bork wizardzines.com

This is similar (her arrows were of varying length) to using a binary search algorithm hunting for where the code was broken using bisection: repeatedly halving your search space to quickly zoom into the problem.

Another important aspect is that small commits while fiddling to solve an issue can help you determine what small commit was actually solving the issue.

Read the rest of this entry »

Posted in Algorithms, Conference Topics, Conferences, Development, DVCS - Distributed Version Control, Event, git, Mercurial/Hg, Ruby, Software Development, Source Code Management, Versioning | Leave a Comment »

86Box is a cool IBM PC emulator: it even supports modem emulation and SLiRP. Serial BBS galore over the internet all over again!

Posted by jpluimers on 2024/09/25

A while ago, I learned about 86Box an “IBM PC emulator for Windows, Linux and Mac based on PCem that specializes in running old operating systems and software that are designed for IBM PC compatibles.”

Until then, I mostly used DOSBox for emulation (which I had known after Windows 2000 dropped DOS support), but sometimes DOSBox doesn’t cut it as it emulates DOS (now mainly for gaming), not a full x86 based PC.

The toot pointing me at 86Box was [Wayback/Archive] mr_daemon: “So, 86box has gotten General Modem Emulation… internet over SLiRP…” – untrusted.website (with the image that is on the top right in this blog post)

Read the rest of this entry »

Posted in 86Box, DOSBox, Emulators, LifeHacker, Power User | Leave a Comment »

NTFS Sparse Files For Programmers

Posted by jpluimers on 2024/09/25

Need to check this out some day: cs.exe compiled from [Wayback] sparse.zip which you can download from [Wayback/Archive] NTFS Sparse Files For Programmers

Read the rest of this entry »

Posted in C, C++, Development, NTFS, Power User, RoboCopy, Software Development, Visual Studio C++, Windows, Windows 10, Windows 11 | Leave a Comment »

Ringzer0: “Support your local OSS Devs ” – Infosec Exchange

Posted by jpluimers on 2024/09/24

Important, as it is the only way to keep your development stack functioning well: [Wayback/Archive] Ringzer0: “Support your local OSS Devs ” – Infosec Exchange

Read the rest of this entry »

Posted in Awareness, Conference Topics, Conferences, Development, Event, Open Source, Software Development | Leave a Comment »

string – Check if MyString[1] is an alphabetical character? – Stack Overflow (and how Embarcadero broke one of the product version neutral redirects)

Posted by jpluimers on 2024/09/24

Quite a while ago [Wayback/Archive] string – Check if MyString[1] is an alphabetical character? – Stack Overflow asked by [Wayback/Archive] User Jeff was answered by [Wayback/Archive] Andreas Rejbrand:

The simplest approach is

function GetAlphaSubstr(const Str: string): string;
const
  ALPHA_CHARS = ['a'..'z', 'A'..'Z'];
var
  ActualLength: integer;
  i: Integer;
begin
  SetLength(result, length(Str));
  ActualLength := 0;
  for i := 1 to length(Str) do
    if Str[i] in ALPHA_CHARS then
    begin
      inc(ActualLength);
      result[ActualLength] := Str[i];
    end;
  SetLength(Result, ActualLength);
end;

but this will only consider English letters as “alphabetical characters”. It will not even consider the extremely important Swedish letters Å, Ä, and Ö as “alphabetical characters”!

Slightly more sophisticated is

function GetAlphaSubstr2(const Str: string): string;
var
  ActualLength: integer;
  i: Integer;
begin
  SetLength(result, length(Str));
  ActualLength := 0;
  for i := 1 to length(Str) do
    if Character.IsLetter(Str[i]) then
    begin
      inc(ActualLength);
      result[ActualLength] := Str[i];
    end;
  SetLength(Result, ActualLength);
end;

Back in 2011 I added a comment that for more than a decade would redirect to the most current documentation on the IsLetter method:

+1 for using IsLetter which checks the Unicode definition for being a letter or not [Wayback] docwiki.embarcadero.com/VCL/en/Character.TCharacter.IsLetter

Back then, Delphi X2 was current, so it would redirect

  1. from [Wayback] http://docwiki.embarcadero.com/VCL/en/Character.TCharacter.IsLetter
  2. to [Wayback] http://docwiki.embarcadero.com/VCL/XE2/en/Character.TCharacter.IsLetter
  3. then to [Wayback] http://docwiki.embarcadero.com/VCL/XE2/en/Character.TCharacter.IsLetter
  4. ending at [Wayback] http://docwiki.embarcadero.com/Libraries/XE2/en/System.Character.TCharacter.IsLetter

After a long outage in 2022 (see The Delphi documentation site docwiki.embarcadero.com has been down/up oscillating for 4 days is now down for almost a day.) only the Alexandria help was restored.

This killed the above redirect.

Luckily [Wayback/Archive] George Birbilis noticed that and commented this:

@JeroenWiertPluimers the correct link now is: docwiki.embarcadero.com/Libraries/Alexandria/en/…

In order to refer to the most recent Delphi version, now you have to use [Wayback] http://docwiki.embarcadero.com/Libraries/en/System.Character.TCharacter.IsLetter.

This redirects:

  1. via [Wayback] http://docwiki.embarcadero.com/Libraries/Alexandria/en/System.Character.TCharacter.IsLetter to
  2. to [Wayback] https://docwiki.embarcadero.com/Libraries/Alexandria/en/System.Character.TCharacter.IsLetter

The above breaks the help integration from older Delphi products which is bad. It is also bad because it makes it harder to port legacy Delphi code to more modern Delphi versions.

Hopefully the above gives you a bit insight how the docwiki help system was designed and what is left of that design.

–jeroen

Posted in Communications Development, Conference Topics, Conferences, Delphi, Development, Encryption, Event, HTML, HTTP, https, HTTPS/TLS security, Internet protocol suite, Power User, Security, Software Development, TCP, TLS, Web Development | Leave a Comment »

Thread by @LetheForgot to @SwiftOnSecurity on Thread Reader App – Windows boot recovery

Posted by jpluimers on 2024/09/23

[Wayback/Archive] Thread by @LetheForgot on Thread Reader App:

What we did was use the advanced restart options to launch the command prompt, skip the bitlocker key ask which then brought us to drive X and ran “bcdedit /set {default} safeboot minimal“which let us boot into safemode and delete the sys file causing the bsod.

Not scalable at all but let us get vital systems running while we try to solve the bootloop en masse

Don’t forget to renable normal booting afterwards by doing the same but running “bcdedit /deletevalue {default} safeboot

Just in case another event like the 2024 Crowdstrike debacle happens.

--jeroen

Posted in Encryption, Power User, Security, Windows | Leave a Comment »

Fixing the date/time of a ST-977 or ST-977T weather station

Posted by jpluimers on 2024/09/23

A long time ago I asked about the manual for a Daryis ST-977 weather station, but got no response from the manufacturer or anyone else.

So about 9 months later the topic came back up and I did get some responses, most suggesting to use the SET button which I already tried earlier.

I retried and found out the button was both bouncing and needed to be held for a really long time (15+ seconds!) to even switch to “edit” mode.

With 4 AA batteries in the base it at least should survive a power outage and hopefully by now we have switched away from using daylight saving time in Europe so no time changes are needed in the future.

Later I found out the FCC was on the external sensor and could find back a manual of a similar model:

Read the rest of this entry »

Posted in Hardware, LifeHacker, Power User | Leave a Comment »

For my link archive: Power (and Energy) | Die wunderbare Welt von Isotopp

Posted by jpluimers on 2024/09/20

Since the prices of solar panels have fallen considerably and the prices of batteries are expected to fall as well:

making the  conclusions of [Wayback/Archive] Power (and Energy) | Die wunderbare Welt von Isotopp the most important bit of his article:

Read the rest of this entry »

Posted in LifeHacker, Power User, Solar Power | Leave a Comment »

Nederland: Overzicht schoolvakanties 2024-2025 | Schoolvakanties | Rijksoverheid.nl

Posted by jpluimers on 2024/09/20

[Wayback/Archive] Overzicht schoolvakanties 2024-2025 | Schoolvakanties | Rijksoverheid.nl

Voor Nederland zelf:

Vakanties schooljaar 2024-2025
Regio Noord Regio Midden Regio Zuid
Herfstvakantie 26 oktober t/m 3 november 2024 26 oktober t/m 3 november 2024 19 oktober t/m 27 oktober 2024
Kerstvakantie 21 december 2024 t/m 5 januari 2025 21 december 2024 t/m 5 januari 2025 21 december 2024 t/m 5 januari 2025
Voorjaarsvakantie 15 februari t/m 23 februari 2025 22 februari t/m 2 maart 2025 22 februari t/m 2 maart 2025
Meivakantie 26 april t/m 4 mei 2025 26 april t/m 4 mei 2025 26 april t/m 4 mei 2025
Zomervakantie 12 juli t/m 24 augustus 2025 19 juli t/m 31 augustus 2025 5 juli t/m 17 augustus 2025

--jeroen

Posted in LifeHacker, Power User | Leave a Comment »

Linear Algebra | Mathematics | MIT OpenCourseWare

Posted by jpluimers on 2024/09/20

In case I ever need to refresh my linear algebra knowledge, this series of videos is where to start: [Wayback/Archive] Linear Algebra | Mathematics | MIT OpenCourseWare

The videos: [Wayback/Archive] Video Lectures | Linear Algebra | Mathematics | MIT OpenCourseWare

Via: [Wayback/Archive] Santiago on Twitter: “The best linear algebra course out there. PERIOD. For Free! MIT’s Professor Gilbert Strang. Go through these videos, and you’ll never ever have a problem with linear algebra again!”

–jeroen

Posted in LifeHacker, Mathematics, Power User, science | Leave a Comment »