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

FemFM – 〝50% vrouw in je oor, of we zappen door!〞

Posted by jpluimers on 2024/03/30

[Wayback/Archive] FemFM – 〝50% vrouw in je oor, of we zappen door!〞 werd in 2024 gelanceerd vlak voor de Women’s History Month en Internationale Vrouwendag door Felienne Hermans.

Felienne is bekend van bijvoorbeeld haar promotieonderzoek naar de impact van Excel op de samenleving, maar vooral van haar drive te onderzoeken hoe zo veel mogelijk mensen – ongeacht hun achtergrond – kunnen leren programmeren), Joy of Coding, de Hedy programmeertaal (met veel support voor andere alfabetten dan wat we in de westerse wereld gebruiken) en haar boek The Programmer’s Brain: What every programmer needs to know about cognition.

Ze is enorm goed in haar werk, en komt daarmee regelmatig in aanraking met vooringenomenheid over vrouwen. Daar verbaast ze zich terecht over, en ook dat het lastig om content (op allerlei soorten gebieden) te consumeren gemaakt door vrouwen. Dat overkwam haar bijvoorbeeld bij het luisteren naar muziek op de Nederlandse radio: daar kwamen veel meer mannelijke artiesten aan bod dan vrouwelijke.

Vandaar FemFM, en Felienne zou Felienne niet zijn als de source code niet openbaar was, dus hier wat linkjes:

Read the rest of this entry »

Posted in Audio, Awareness, Development, IceCast, Inclusion / inclusive society, Java, Java Platform, Media, Power User, Python, Scripting, Software Development, Web Development | Leave a Comment »

Skip line while debugging in Chrome developer tools – Stack Overflow

Posted by jpluimers on 2024/03/27

[Wayback/Archive] Skip line while debugging in Chrome developer tools – Stack Overflow (thanks [Wayback/Archive] Matas Vaitkevicius for both asking and answering):

Last comment from dev says:
We’re going to hold off on this feature for now. It’s complexity is high and it’s not common enough a workflow. One could also just comment out the lines and hit ctrl-s to get the same effect, pretty much. Status: WontFix –
The workaround is to comment out the line you want to skip and press Ctrl+S.

The problem is that the workaround fails when you have used the Chrome Dev Tools to format the source code: then you cannot edit the formatted code.

The workaround for that is cumbersome, but doable as in this bug report:

Read the rest of this entry »

Posted in Chrome, Debugging, Development, Google, JavaScript/ECMAScript, Power User, Scripting, Software Development, Web Development | Leave a Comment »

My Ultimate PowerShell prompt with Oh My Posh and the Windows Terminal – Scott Hanselman’s Blog

Posted by jpluimers on 2024/03/21

Via [Archive.is] Kevin on Twitter: “Gotta say this looks amazing and I actually didn’t know you can customize the command line on Windows this far. Read this blogpost by @shanselman , highly recommended. 👇 “

For my link archive: [Wayback] My Ultimate PowerShell prompt with Oh My Posh and the Windows Terminal – Scott Hanselman’s Blog

Read the rest of this entry »

Posted in CommandLine, Development, Power User, PowerShell, PowerShell, Scripting, Software Development, Windows, Windows 10, Windows Development | Leave a Comment »

Publish your results through “wa11y.co: Wordle Accessibility” to allow visual impaired much easier and pleasant access to your results #a11y

Posted by jpluimers on 2024/03/19

I wish Wordle would be more accessible, but alas after all this time it still isn’t.

Luckily there is [Wayback/Archive] wa11y.co: Wordle Accessibility

At the end of your Wordle game, click “Share” to copy your result then paste it below to generate descriptive text.

It is open source on GitHub at [Wayback/Archive] cariad/wa11y.co: Makes Wordle results accessible. (most of it is written in JavaScript)

I first bumped into it via:

Read the rest of this entry »

Posted in accessibility (a11y), Development, JavaScript/ECMAScript, Scripting, Software Development, Web Development | Leave a Comment »

Use Remembered Arguments for a Package During Upgrades · Issue #797 · chocolatey/choco

Posted by jpluimers on 2024/03/06

I totally missed this feature got implemented: [Wayback/Archive] Use Remembered Arguments for a Package During Upgrades · Issue #797 · chocolatey/choco. I also seem to be lucky I have not tried it out yet (:

I bumped into it via [Wayback/Archive] Chocolatey Software | Notepad++ 8.4.4, which had this interesting comment:

If you want Notepad++ 32 bit and you want it to stay on 32 bit with upgrades, ensure you are on Chocolatey 0.10.4 (or newer). Then add `-x86` to your installation arguments. Then turn on the remembered arguments feature with ‘choco feature enable -n useRememberedArgumentsForUpgrades‘ – this will ensure that `-x86` gets passed on upgrade when running `choco upgrade all`. For more information on how this works, see https://github.com/chocolat…797

First of all, if you started using Chocolatey at or before 0.14, the useRememberedArgumentsForUpgrades feature is disabled by default and kept that way even after upgrading to the most recent version. You can see executing choco feature list on a system that started with Chocolatey:

Read the rest of this entry »

Posted in Chocolatey, Development, Power User, Scripting, Software Development, Windows | Leave a Comment »

Oh boy, VB.NET and JavaScript both have a `with` keyword too!

Posted by jpluimers on 2024/03/05

Last year, within a week, I saw two tweets of languages that, like Pascal, have a with statement as well:

  1. [Archive.is] Shawn Wildermuth 💻☕🎸🎥🎮 on Twitter: “JavaScript’s Forgotten Keyword (with)”
  2. [Archive.is] John Kaster #BlackLivesMatter on Twitter: “@suited_aces @marcocantu @delphijunkie @JimMcKeeth @jpluimers I present “with”… “

The first points to an article that shows the JavaScript implementation of with is very similar to the Pascal one: [Wayback] JavaScript’s Forgotten Keyword (with) – DEV Community.

Just in case some of my readers do not know my opinion of the Pascal with statement  (it even has it’s own blog category), I really think you should not use it Delphi: you should avoid the with statement as it makes your code less future proof.

The reason not to use it is called [Wayback] Accidental Shadowing in computer language speak (it also can rear its head when you define variables at different block levels like for instance this golang example: [Wayback] Warning for accidental variable shadowing with block scope – Technical Discussion – Go Forum).

Even the JavaScript specification advises against using the with keyword in [Wayback] with – JavaScript | MDN

**Warning:**Use of the with statement is not recommended, as it may be the source of confusing bugs and compatibility issues. See the “Ambiguity Contra” paragraph in the “Description” section below for details.

There have been various proposals to extend the Delphi implementation of the with statement to make it more resilient to Accidental Shadowing by forcing the usage to be prepended by a . (dot) or alias, as for instance seen in [Wayback] Re: “with” Coders are Monsters – delphi / [Wayback] delphi • View topic • “with” Coders are Monsters:

This is in fact what the second twitter messages pointed to: a VB.NET example doing just that: prepend with a dot: [Wayback] Maarten Balliauw on Twitter: “Looks like using With makes it pretty clean!… “

I was not even aware that VB.NET had it, but it has: [Wayback] With…End With Statement – Visual Basic | Microsoft Docs

And it has similar debugging issues as with Delphi as per [Wayback] The VB.NET ‘With’ Statement – embrace or avoid? – Stack Overflow:

Find the beginning of a With statement and set a breakpoint. Step to the next line (so you’re hiding the first line right under the if block). Highlight it, then ‘Add Watch’. You should see this: ‘With’ contexts and statements are not valid in debug windows.

–jeroen

Posted in .NET, Delphi, Development, Go (golang), JavaScript/ECMAScript, Pascal, Scripting, Software Development, VB.NET, With statement | Leave a Comment »

ShellCheck – shell script analysis tool

Posted by jpluimers on 2024/02/22

Cool: [Wayback] ShellCheck – shell script analysis tool

ShellCheck finds bugs in your shell scripts

It needs a shebang at the start of a script (like #!/usr/bin/env bash) to recognise the kind of shell, then does amazing analysis.

It is open source at [Wayback/Archive.is] koalaman/shellcheck: ShellCheck, a static analysis tool for shell scripts with excellent documentation including explaining screenshots like

It’s not just available on-line or on the command-line, but also integrates with many code editors (like [Wayback/Archive.is] ShellCheck – Visual Studio Marketplace: Integrates ShellCheck into VS Code, a linter for Shell scripts.) and CI/CD pipelines.

Via: [Wayback] bash – error conditional binary operator expected in compound branch – Unix & Linux Stack Exchange (thanks [Wayback] Cyrus!)

–jeroen

Posted in *nix, *nix-tools, ash/dash, ash/dash development, bash, bash, Development, Power User, Scripting, Software Development | Leave a Comment »

Walls and Ladders when pasting e-mail on account sign-up forms: Paste It – Chrome Web Store

Posted by jpluimers on 2024/02/06

In a game of Walls and Ladders (similar to Arms Race), the Ladders usually win, see the references at the end of the post.

The actual “game” in this case is more and more sites trying to build walls prevent pasting credential related information like user IDs (often e-mail addresses) or passwords often citing “more safety” or “less security risks”, and users get taller ladders wanting to do just that because of their own security concerns:

[Wayback/Archive] Stef 🎈 on Twitter: “Dear mobile/web-apps, please never never disable copy and paste “due to security reasons”. -everybody with a password manager.”

The walls will always loose so it is better to invest the money for the walls into other security measures.

Given that most of the risks are web-sites getting that information exfiltrated, I wish they put more energy into bolting down that side of the security risk side than the hampering legitimate users entering that information in the first place.

Since so many of these sites have leaked my information in the past, any email address I use for activating an account is like 50 characters long. Something I am not going to type once (because of typing mistakes) and definitely not twice (to confirm I did not make typing mistakes).

Read the rest of this entry »

Posted in Authentication, Chrome, Clipboard, Development, Google, HTML, JavaScript/ECMAScript, Power User, Scripting, Security, Software Development, Web Development | Leave a Comment »

bloomberg/memray: Memray is a memory profiler for Python

Posted by jpluimers on 2024/01/22

For my link archive as one day I will need this:

Via this cool [Wayback/Archive] Thread by @1st1 on Thread Reader App that has these tweets:

  1. [Wayback/Archive] Yury Selivanov on Twitter: “WOW. Bloomberg finally opensourced memray—a new versatile memory profile for Python. Can’t way to use it. Thread 👇”

  2. [Wayback/Archive] Yury Selivanov on Twitter: “1. It’s fully open source (Apache 2), grab it here: …”

  3. [Wayback/Archive] Yury Selivanov on Twitter: “2. Until now you never could have such a deep insight in how your app allocates memory. The tool is a must for any long-running services implemented with Python. With memray you can generate flame charts or all allocations and trace absolutely everything.”

  4. [Wayback/Archive] Yury Selivanov on Twitter: “3. And this must be a Python snippet of the month:”

    Image

    @pytest.mark. limit_memory("24 MB")
    def test_foobar():
        # do some stuff that allocates memory
  5. [Wayback/Archive] Yury Selivanov on Twitter: “4. It’s sophisticated enough to peek into native code. So you can profile your numpy and pandas code with it. And it has a live mode. You can just run your code and see how it allocates memory as it runs. 🤯”

  6. [Wayback/Archive] Yury Selivanov on Twitter: “5. A little birdie mentioned to me that @pyblogsal is one of the active contributors in memray. Let’s keep it a secret 🫢”
  7. [Wayback/Archive] Yury Selivanov on Twitter: “6. This is a Python client to @edgedatabase as it establishes a connection to the DB. cc @fantix @elprans”

  8. [Wayback/Archive] Yury Selivanov on Twitter: “7. Wow, this thread is blowing up. Here’s a link to my Spotify… err,”

–jeroen

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

For your next job interview: One-Line FizzBuzz Solution in Python 3 | by David Sanchez | CodeX | Medium

Posted by jpluimers on 2024/01/18

[Wayback/Archive] One-Line FizzBuzz Solution in Python 3 | by David Sanchez | CodeX | Medium

print('\n'.join(['fizzbuzz' if x%15 == 0 else 'buzz' if x%5 == 0 else 'fizz' if x%3 == 0 else str(x) for x in range(1,101)]))

(Yes, one can do similar list comprehension and conditional expression constructs in other languages to get one-liner solutions)

Via:

–jeroen

Posted in Development, Python, Scripting, Software Development | 1 Comment »