The Wiert Corner – irregular stream of stuff

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

  • My badges

  • Twitter Updates

  • 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 ‘Scripting’ Category

YOURLS/YOURLS: 🔗 The de facto standard self hosted URL shortener in PHP

Posted by jpluimers on 2026/04/28

In case I ever want to run my own URL shortener: [Wayback/Archive] YOURLS/YOURLS: 🔗 The de facto standard self hosted URL shortener in PHP

Via:

jeroen

Posted in Development, PHP, Scripting, Software Development, Web Development | Leave a Comment »

Memories of my AS/400 and OS/400 days: PUB400.COM – Your public IBM i server

Posted by jpluimers on 2026/04/22

[Wayback/Archive] PUB400.COM – Your public IBM i server:

Read the rest of this entry »

Posted in AS/400 / iSeries / System i, COBOL, Development, RPG, Scripting, Software Development | Leave a Comment »

Updating Microsoft Office on Windows from a batch file

Posted by jpluimers on 2026/04/21

This batch file works for modern Click-to-Run (sometimes called ClickToRun, Click2Run or C2R) based Office installations (note the odd lowercase microsoft shared which indeed is the actual directory name):

if exist "%CommonProgramFiles%\microsoft shared\ClickToRun\OfficeC2RClient.exe" (
  "%CommonProgramFiles%\microsoft shared\ClickToRun\OfficeC2RClient.exe" /update user
) else (
  echo could not find the Office Updater
)

This for sure does not work for MSI based Office 2013 and lower (which are updated through Windows Update anyway). Since I only have 2021 online (Click-to-Run) installs and higher to test with: those work fine.

Read the rest of this entry »

Posted in Batch-Files, Development, Office, Office 2021, Office Development, Power User, Scripting, Software Development, Windows, Windows Development | Leave a Comment »

Some pages that have lists of Amazon toplevel domains

Posted by jpluimers on 2026/04/16

Amazon has activities spread across many different countries and regions, heck they even own their own toplevel domain .amazon.

Yesterday in Online tools to test JSONPath Queries (plus a small list of Amazon top level domains) I wrote about the JSON parsing I did for Download your Kindle books soon, because Amazon will block them after February 25, 2025 .

The source of that list is [Wayback/Archive] Amazon operating domains by country. · GitHub [Wayback/Archive] in the file amazon-domains.json.

In the meantime, I finally managed to go through a list of old open browser tabs having more of such lists. Here they are:

Read the rest of this entry »

Posted in Development, JavaScript/ECMAScript, JSON, JSONPath, Scripting, Software Development, Web Development | Leave a Comment »

Remember: languages automatically evaluate const expressions

Posted by jpluimers on 2026/04/16

The first tweet below reminded me that few people seem to realise that const expressions are evaluated by the compiler/interpreter into the actual const value. Often this is called constant folding (though that can happen outside constant definitions too!)

Truckloads of source code I have come across in all kinds of languages where people put the calculated values in the expression like described here:

[Wayback/Archive] Kevlin Henney on Twitter: “For example: const int secondsInDay = 24 * 60 * 60; There is no need to calculate it yourself: const int secondsInDay = 86400; Or, related to what I’ve just seen: const int secondsInDay = 86400; // 24 * 60 * 60.

In languages that support rich enough types, you can even pass a typed constant like timespan, duration or period around:

[Wayback/Archive] David Kerr on Twitter: “@KevlinHenney The general point is well made of choir course. In java, etc you can pass a Duration object around, no need to interpret an in. Type safety, self documenting.”

My recommendation is to use an expression like the first and maybe document the calculated value (for instance for ease of bug hunting) like here

Read the rest of this entry »

Posted in Conference Topics, Conferences, Development, Event, Scripting, Software Development | Leave a Comment »

Online tools to test JSONPath Queries (plus a small list of Amazon top level domains)

Posted by jpluimers on 2026/04/15

I wanted to parse some JSON being sent back during an XMLHttpRequest (what a wrongly named call is that!) of which I grabbed the content using the web development tools of my Chromium based browser.

Input

I got this list of amazon top level domain names from research I did for my blog post Download your Kindle books soon, because Amazon will block them after February 25, 2025 . The source is [Wayback/Archive] Amazon operating domains by country. · GitHub [Wayback/Archive] in the file amazon-domains.json:

{
    "us": "https://www.amazon.com",
    "uk": "https://www.amazon.co.uk",
    "ca": "https://www.amazon.ca",
    "de": "https://www.amazon.de",
    "es": "https://www.amazon.es",
    "fr": "https://www.amazon.fr",
    "it": "https://www.amazon.it",
    "jp": "https://www.amazon.co.jp",
    "in": "https://www.amazon.in",
    "cn": "https://www.amazon.cn",
    "sg": "https://www.amazon.com.sg",
    "mx": "https://www.amazon.com.mx",
    "ae": "https://www.amazon.ae",
    "br": "https://www.amazon.com.br",
    "nl": "https://www.amazon.nl",
    "au": "https://www.amazon.com.au",
    "tr": "https://www.amazon.com.tr",
    "sa": "https://www.amazon.sa",
    "se": "https://www.amazon.se",
    "pl": "https://www.amazon.pl"
}

The list is far from complete, so tomorrow I will post some more sources in Some pages that have lists of Amazon toplevel domains.

The queries and results show you that the original JSONPath (2007) and its RFC 9535 definition (2024, just 2 years ago) do not support getting the key names of the above list the ~ part in the first query below fails, and only the second query works.

This means that finding the right tooling is important.

Example

Read the rest of this entry »

Posted in Conference Topics, Conferences, Delphi, Development, Event, JavaScript/ECMAScript, JSON, JSONPath, PHP, Python, Scripting, Software Development, TypeScript, Web Development | Tagged: | Leave a Comment »

Only available on Window, but sometimes useful, the Excel FILTERXML function

Posted by jpluimers on 2026/04/09

Some links on the [Wayback/Archive] FILTERXML function – Microsoft Support.

It is only available on Windows (because of the underlying XPath libraries used, I think it is MSXML), and “only” as of Excel 2013, but still can be useful.

Some links below on FILTERXML and related XPath information so I can more easily find their content back.

Notes:

  • FILTERXML only supports XPath 1.0
  • The quotes are huge, for one because I don’t use Excel enough to be an expert, but have enough software experience to sometimes want to use complex concepts in Excel. Having all this in one place helps me with that goal.
  • You need to ensure your data is either XML in a well-formed document format, or you can translate your data to well-formed XML.

The links and quotes starting with the question that sparked my interest:

Read the rest of this entry »

Posted in Development, Excel, Office, Office 2013, Office 2016, Office VBA, Power User, Scripting, Software Development, Windows, XML, XML/XSD, XPath | Leave a Comment »

Disabling the Windows News and Interests fly-out widget through the registry

Posted by jpluimers on 2026/04/08

I could not find a reliable per-user setting that works with just logoff/logon for Windows 11 like I found for Windows 10 in Disabling the Windows 10 and Windows 11 news (and weather) feeds.

So (for now?) there is only a global Globally which needs admin rights and a logoff/logon sequence:

:: requires admin
reg add "HKLM\Software\Policies\Microsoft\Dsh" /v "AllowNewsAndInterests" /t REG_DWORD /d "0" /f
echo logoff/logon to apply the change, or restart Explorer

Via:

Read the rest of this entry »

Posted in Batch-Files, Development, Power User, Scripting, Software Development, Windows, Windows 10, Windows 11 | Leave a Comment »

Excel: operations involving the last occurence of a substring (with examples getting the current Worksheet, Workbook and file/directory path)

Posted by jpluimers on 2026/04/02

Last month I wrote about CELL function looks interesting but beware: language nightmares coming up….

There I mentioned both formulas from [Wayback/Archive] Get sheet name only – Excel formula | Exceljet and [Wayback/Archive] Insert the current Excel file name, path, or worksheet in a cell – Microsoft Support failing to deliver the expected results

an official Microsoft example of obtaining the Worksheet name which I suspected would not work on systems allowing ] in path names. And indeed it is true: that case fails on both MacOS and Windows in the same way.

Here you see the failures of both the ExcelJet function and the ones from Microsoft Support on two operating systems:

Read the rest of this entry »

Posted in Conference Topics, Conferences, Development, Event, Excel, Office, Power User, Scripting, SocialMedia, Software Development, Twitter | Leave a Comment »

Sweep the Strait: Minesweeper, but in the Straitt of Hormuz (plus some tests with RawGit alternatives)

Posted by jpluimers on 2026/03/31

Forgot to schedule this one when I saw it two weeks ago: [Wayback/Archive] Sweep the Strait.

Apart from demonstrating that Trump never had a plan, does not and will not have a plan, it is cool to see Minesweeper developed in JavaScript, HTML and CSS mapped with some geodata onto a real map of the Strait of Hormuz.

Cool idea!

It has a function Windows 3.x UI with functional menu (Game -> New Game; Help -> How to Play)

At first, I thought the original developer is this:

However, in fact the developer is:

Read the rest of this entry »

Posted in CSS, Development, HTML, JavaScript/ECMAScript, Opinions, OS/2, Power User, Retrocomputing, Scripting, Software Development, Web Development, Windows, Windows 3.11 | Leave a Comment »