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 August, 2020

In the series “avoid Variants when coding in Delphi”: the comparison operator

Posted by jpluimers on 2020/08/18

For Variant types, the = comparison operator in Delphi maps to the VarCompareValue in the Variants unit.

That function fails to handle various comparisons and for some it knows it can handle raises a VarInvalidOp through various code paths (like CheckType) to VarInvalidOp because the implementation limits itself to varEmpty..varUInt64, which I think means that these are unsupported:

  • varRecord
  • varStrArg
  • varObject
  • varUStrArg
  • varString
  • varAny
  • varUString
  • varArray
  • varByRef

This fails when using the = operator:

What is this code supposed to do, if v1 and v2 are variant arrays with the same content?

if v1 = v2 then
  WriteLn('equal')
else
  WriteLn('not equal');

Spring4d has a function SameValue in the Spring.pas unit which handles more cases, at least the case when both operands are arrays having the same content.

Source: [WayBack] I think I may have mentioned that I hate Variants: What is this code supposed to do, if v1 and v2 are variant arrays with the same content? if v1 = v2… – Thomas Mueller (dummzeuch) – Google+

Thanks to Thomas Mueller and Stefan Glienke for this.

–jeroen

Posted in Delphi, Development, Software Development | Leave a Comment »

Some PlantUML links I needed for complex component diagram editing

Posted by jpluimers on 2020/08/18

A while ago, I had to create a bit more complex component diagrams than the simple ones I used to create in PlantUML.

Some links that helped me:

UML2 style examples for skinparam that are equivalent:

skinparam component {
  Style uml2
}
skinparam {
  componentStyle uml2
}

Read the rest of this entry »

Posted in Development, Diagram, PlantUML, Software Development, UML | Leave a Comment »

Block or ignore someone – Computer – Hangouts Help

Posted by jpluimers on 2020/08/17

Blocking persons (for instance for sending you materials that in G+ would be a T.O.S. violation) is only possible by blocking them, not by reporting them.

Most hangouts users however do have a G+ account, so you can request a block there.

Relevant links:

–jeroen

 

 

 

Posted in G+: GooglePlus, Google, GoogleHangouts, Power User, SocialMedia | Leave a Comment »

Guidelines for representing your business on Google – Google My Business Help

Posted by jpluimers on 2020/08/17

For my link archive: [WayBack] Guidelines for representing your business on Google – Google My Business Help

–jeroen

Posted in Google, GoogleMaps, GoogleSearch, LifeHacker, Local Guides, Power User | Leave a Comment »

Dirvish

Posted by jpluimers on 2020/08/17

I think it was Thomas Mueller pointing to this, but I’m not sure as I found it in a browser tab from long ago: [WayBack] Welcome to Dirvish

Dirvish is a fast, disk based, rotating network backup system.

With dirvish you can maintain a set of complete images of your filesystems with unattended creation and expiration. A dirvish backup vault is like a time machine for your data.

Dirvish was originally created by jw schultz .

Before starting, I want to read these:

–jeroen

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

Copying photographic film with the Nikon D810 and a shoe box | Nikon Rumors

Posted by jpluimers on 2020/08/14

Cool idea:

Copying photographic film with the Nikon D810 and a shoe box by Anthony McKee (www.anthonymckee.com): While many photographers are keenly waiting for the new Nikon ES2 film digitising adapter set to arrive in stores, I have been making use of my own Nikon film copying kit that I put together a while ago using a Nikon

Source: [WayBackCopying photographic film with the Nikon D810 and a shoe box | Nikon Rumors

 

–jeroen

Posted in Nikon, Photography, Power User | Leave a Comment »

Firewall whitelist for Windows Update

Posted by jpluimers on 2020/08/14

In the end, this list worked on a Fritz!Box, but I still do not know which other subdomains and protocols they silently let pass:

windowsupdate.microsoft.com
*.windowsupdate.microsoft.com
*.update.microsoft.com
*.windowsupdate.com
download.windowsupdate.com
download.microsoft.com
*.download.windowsupdate.com
test.stats.update.microsoft.com
ntservicepack.microsoft.com
update.microsoft.com
*.update.microsoft.com
*.download.microsoft.com
windowsupdate.com
wustat.windows.com
login.live.com
mp.microsoft.com
*.mp.microsoft.com
www.update.microsoft.com
support.microsoft.com
www.msftconnecttest.com

Some source materials:

–jeroen

Read the rest of this entry »

Posted in Fritz!, Fritz!Box, Internet, Power User, Windows, Windows 10, Windows 7 | Leave a Comment »

Why do so many of the small heatsinks use 3M 9448A Double Coated Tissue Tape?

Posted by jpluimers on 2020/08/14

I wonder why so many of the small heatsinks you can buy on for instance Amazon or ebay, use 3M 9448A Double Coated Tissue Tape.

The 3M 8805 Thermally Conductive Adhesive Transfer Tape is so much better (or the twice as thick 3M 8810 Thermally Conductive Adhesive Transfer Tape).

The first is for just sticking, the second for sticking and heat transfer:

Examples of the wrong stuff:

–jeroen

Posted in LifeHacker, Power User | Leave a Comment »

PowerShell: checking minimum version

Posted by jpluimers on 2020/08/13

Nowadays, often your PowerShell code uses features unavailable in older PowerShell versions. When running it on a version that is too old, you usually get an error message, for instance like this:

Unable to find type [Ordered]: make sure that the assembly containing this type is loaded.

Back in the days, this was a new feature introduced in PowerShell 3.0: [WayBack] Use cases of [ordered], the new PowerShell 3.0 feature – Stack Overflow

It is way friendlier to show a message indicating the version is too old in stead of throwing this error.

That’s where the # Requires Version 3.0 directive comes in: [WayBackabout_Requires | Microsoft Docs.

Adding this line to the top of a script gives output like this on a stock Windows 7 SP1 system that has PowerShell 2.0:

# PowerShell -f List-Delphi-Installed-Packages.ps1
The script ‘List-Delphi-Installed-Packages.ps1’ cannot be run because it contained a “#requires” statement at line 1 for Windows PowerShell version 3.0. The version required by the script does not match the currently running version of Windows PowerShell version 2.0.
+ CategoryInfo : ResourceUnavailable: (List-Delphi-Installed-Packages.ps1:String) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : ScriptRequiresUnmatchedPSVersion

Note that PowerShell 3.0 is also the minimum version for debugging it in Visual Studio Code (which means you do not have to use PowerShell ISE any more; it is still there , but so far behind as a development tool that many prefer Visual Studio Code):

–jeroen

Posted in CommandLine, Development, PowerShell, PowerShell, Scripting, Software Development | Leave a Comment »

PowerShell: finding WSD printer details enumerating through HKLM\SYSTEM\CurrentControlSet\Enum\SWD\DAFWSDProvider

Posted by jpluimers on 2020/08/13

WSD seems the way Microsoft Windows 8+ does printing, which makes it a lot harder to find the IP address of a printer, for instance to configure a Mac to print to it.

The key seems to be enumerating over HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\SWD\DAFWSDProvider.

Some links that should help me doing this:

–jeroen

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