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 November, 2022

Assorti Wegwerpoordopjes 15x verschillende types om te testen

Posted by jpluimers on 2022/11/08

[WayBack] Assorti Wegwerpoordopjes 15x verschillende types om te testen

Probeer goedkoop de juiste wegwerpoordoppen voor u te vinden.

[WayBack] Easy Instructions: Dutch

Via:

--jeroen

 

Posted in About, LifeHacker, Personal, Power User | Leave a Comment »

UTC and ISO 8601, or GTFO

Posted by jpluimers on 2022/11/08

Always schedule your meetings in UTC, and use ISO-8601 date and time notation. Because time zone conversions are hard, especially with so many daylight saving time conventions.

I want not just a “UTC or GTFO” shirt, but a “UTC and ISO-8601, or GTFO” shirt.

It means I do not agree with [Archive.is] Colin Nederkoorn on Twitter: “Pro tip: Don’t schedule recurring meetings in UTC if you live in a place with daylight savings.… “ with multi-time zone teams: having it in UTC will balance out the DST changes over the teams.

Some more relevant Tweets that triggered me writing this post:

Read the rest of this entry »

Posted in Algorithms, Development, ISO 8601, Power User, Software Development, UTC | Leave a Comment »

Stop using tail -f (mostly)

Posted by jpluimers on 2022/11/07

Some interesting bits from [WayBack] Stop using tail -f (mostly):

  • say you want to watch the file production.log:
    $ less +F production.log
    
    Important
    log
    information
    here
    
    Waiting for data... (interrupt to abort)

    Here you have pretty much the same behaviour you’d get with tail.

    Now let’s say something interesting appears, and you want to search all the occurrences of “foo”. You can just hit Ctrl-c to go to “normal” less mode (as if you had opened the file without the +F flag), and then you have all the normal less features you’d expect, including the search with /foo. You can go to the next or previous occurrence with n or N, up and down with j and k, create marks with m and do all sort of things that less(1) says you can do.

    Once you are done, just hit F to go back to watching mode again. It’s that easy.

  • When you need to watch multiple files at the same time, tail -f can actually give you a better output.

Related: [WayBack] shell – The ‘less’ command-line equivalent of ‘tail -f’ – Unix & Linux Stack Exchange

I prefer tail -F

-F – The -F option implies the -f option, but tail will also check to see if the file being followed has been renamed or rotated.

The less equivalent: less +F --follow-name

–jeroen

Posted in *nix, *nix-tools, less, Power User | Leave a Comment »

Autists usually are right (:

Posted by jpluimers on 2022/11/04

Dutch article “Autisten hebben meestal gelijk“.

Via:

jeroen

Posted in About, Autistic Spectrum/Autism, Personal | Leave a Comment »

SQL comma bullet point formatting: because AS is optional

Posted by jpluimers on 2022/11/03

Do you see the error below?

(note: OCR via [Wayback/Archive.is] Best Free OCR API, Online OCR, Searchable PDF – Fresh 2021 OCR Software)

SELECT
  license date
  expiration_date,
  renewal_due_date
FROM license
WHERE expiration_date IS NULL
AND processing != 'Automatic'
AND edition != 'Other'
expiration_date renewal_ due date
1 2016-04-08 09:50:00 [NULL]
2 2013-11-14 11:15:00 [NULL]
3 2014-11-20 14:51:00 [NULL]
4 2017-07-21 16:00:00 [NULL]
5 2018-12-17 14:37:46 2020-12-17 14:37:46

All of the expiration_date columns have values, which is contrary to the WHERE clause. This is because the table itself contains an expiration_date column, and the SELECT part aliases license_date into expiration_date.

The result is that you see rows that have expiration_date being NULL, but license_date having a value.

So I totally agree with [Archive.is] Mathias Magnusson on Twitter: “That is one reason I’m a form believer in comma bullet point in my SQL. Problems like that has bit me far too often due to som issue with commas.… “

This is how the SQL should have looked:

SELECT
  license date
, expiration_date
, renewal_due_date
FROM license
WHERE expiration_date IS NULL
AND processing != 'Automatic'
AND edition != 'Other'

Yes indeed: an alias of a column without the AS keyword is allowed in quite a few SQL dialects (they differ even more widely in SQL extensions like SQL/PSM, T-SQL, PL/SQL, SQL_PL, or ABAB).

Aliases are for output, cannot be used in WHERE (but can in ORDER BY).

You can see what happens (and how hard this can become on one line) with these two dbfiddle queries running on Microsoft SQL Server 2019 dialect (though it works similar in other dialects):

  1. select a b, c from (values (9, 1, 2), (8, 3, 4), (7, 5, 6)) t(a, b, c) order by b
    I saved it as [Wayback/Archive.is] SQL Server 2019 | dbfiddle: select a b, c from (values (9, 1, 2), (8, 3, 4), (7, 5, 6)) t(a, b, c) order by b
    Resulting in

    b c
    7 6
    8 4
    9 2

    It shows only the column names a and b, but note the table itself is aliased to t above as well.

  2. select a, b, c from (values (9, 1, 2), (8, 3, 4), (7, 5, 6)) t(a, b, c) order by b
    I saved it as [Wayback/Archive.is] SQL Server 2019 | dbfiddle: select a, b, c from (values (9, 1, 2), (8, 3, 4), (7, 5, 6)) t(a, b, c) order by b
    Resulting in

    a b c
    9 1 2
    8 3 4
    7 5 6

    It shows only the column names a, b and c, but note the table itself is aliased to t above as well.

I really wish various SQL dialects would force the SQL syntax to be (together with a hint that the alias would overwrite an existing field):

SELECT
  license date AS expiration_date
, renewal_due_date
FROM license
WHERE expiration_date IS NULL
AND processing != 'Automatic'
AND edition != 'Other'

That is not going to happen, so the second best is to wish for tooling to hint/warn about it, and provide better syntax highlighting for it. That seems work in progress by now:

Read the rest of this entry »

Posted in Conventions, Database Development, Development, OracleDB, PL/SQL, SQL, SQL Server, T-SQL | Leave a Comment »

Reminder to self: check to see the state of winget and if it is possible to install Windows Store applications from the command-line

Posted by jpluimers on 2022/11/02

While undergoing many treatments against rectum cancer, I saved the below tweets with a marker “The new windows package manager: aka.ms/winget“.

[Wayback/Archive] aka.ms/winget

Well, actually the first tweet is gone, now, but archived as [Wayback/Archive] Stefan Stranger on Twitter: “New Windows Package Manager #MSBuild2020… “

Read the rest of this entry »

Posted in Chocolatey, Power User, Scoop, Windows, Windows 10, winget | Leave a Comment »

SMLIGHT SLZB-06 – A Zigbee 3.0 to Ethernet, USB, and WiFi adapter with PoE support – CNX Software

Posted by jpluimers on 2022/11/01

Want: [Wayback/Archive] SMLIGHT SLZB-06 – A Zigbee 3.0 to Ethernet, USB, and WiFi adapter with PoE support – CNX Software

Startup SMLIGHT has launched the SLZB-06 Zigbee 3.0 to Ethernet, USB, and WiFi adapter with PoE support that works out of the box with open-source software such as Home Assistant and Zigbee2MQTT.

The device combines Texas Instruments’ СС2652Р microcontroller for Zigbee with ESP32 for WiFi, data transfer to Ethernet or USB, and peripheral functions such as LEDs and a button.The design is complemented with Microchip LAN8720 for Ethernet.

Read the rest of this entry »

Posted in Development, ESP32, Ethernet, Hardware, Hardware Development, Hardware Interfacing, IoT Internet of Things, Matter, MQ Message Queueing/Queuing, MQTT, Network-and-equipment, PoE - Power over Ethernet, Power User, Software Development, USB, WiFi, Z-Wave, Zigbee | Leave a Comment »