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 2021

Het hopelijk tijdelijke afscheid door Haagse Insider🕵🏻‍♂️ (@HaagseInsider) | Twitter

Posted by jpluimers on 2021/05/13

Gisteren was er een (hopelijk tijdelijk) afscheid door [Archive.is] Haagse Insider🕵🏻‍♂️ (@HaagseInsider) | Twitter.

De indrukwekkende draad is helaas niet beschikbaar op Archive.is, maar wel beschikbaar op het web archief.

Sowieso wens ik meer rust en afstand voor HaagseInsider. Daarnaast duim ik dat het een weerzien wordt.

jeroen

Posted in Power User, SocialMedia, Twitter | Leave a Comment »

Delphi: EInvalidOp exception, might just mean you have a use-after free scenario, or an out-of-bounds value

Posted by jpluimers on 2021/05/13

Quite some time ago, I was researching spurious exceptions in a Delphi application, then finally replicated them in a unit test suite.

One of them was occurring almost all of the time: EInvalidOp.

It is one of the floating point exceptions (incidentally exampled at [WayBack] Exceptions: Declaring Exception Types) all inheriting from the [WayBack] EMathError Class:

EMathError is the base class for floating-point math exception classes. EMathError itself is never raised.

The following exceptions descend from EMathError:

Meaning
Parameter out of range
Processor encountered an undefined instruction
Floating-point operation produced result too large to store
Floating-point operation produced result with no precision
Attempt to divide by zero

Run-time exception information is saved in fields provided by [WayBack] EExternal.

Use-after-free

In my first case (which I described in delphi – Invalid floating point operation calling Trunc()), not all input scenarios had been tested in a certain scenario. In a production environment, one of the inputs was really high.

In a later case, the actual cause was not a floating point problem at all, but a use-after-free scenario that overwrite a floating point value with something not so compatible also causing a simple Trunc statement to fail in the same way.

In that case, the production data could never reach the big numbers that failed, so no new tests were needed.

–jeroen

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

Golang written: nefertiti-tradebot.com

Posted by jpluimers on 2021/05/12

[WayBack] dutchdelphidude on Twitter: “ik doe nu dit ermee nefertiti-tradebot.com … “

nefertiti-tradebot.com

–jeroen

Read the rest of this entry »

Posted in Development, Go (golang), Software Development | Leave a Comment »

Reminder to self: check if @NS_online finally accepts email addresses having a plus sign in them

Posted by jpluimers on 2021/05/12

Quite a while back, @NS_Online (Dutch railroads) did not accept plus signs in email addresses. I verified a few times over the years and not much progress.

This is a reminder to myself to re-check.

Edit 20230418: it has started working, see further below.

Below the fold the Twitter thread that started with [WayBack] Jeroen Pluimers on Twitter: “Toch jammer dat @NS_online valide email adressen met een plus-teken erin weigert.… “

Hopefully by now they retraced themselves from the bad company of many other parties failing to adhere to clear and long existing internet standards: [WayBack] User:Me at work/plushaters | Mozilla Community | FANDOM powered by Wikia.

Their web care team and their developers made some very inexcusable assumptions there:

  • questioning the use of a + in email addresses
  • questioning the email address used
  • diminishing the popularity of using a + inside email addresses
  • when you never heard of something, it does not exist
  • you can validate an email address without actually trying to deliver it

Some links on email addresses and their validity:

Read the rest of this entry »

Posted in Development, Power User, Software Development, Web Development | Leave a Comment »

FastMM4: turn warnings W1047 and W1048 off

Posted by jpluimers on 2021/05/12

(Tagged FastMM4 as that’s the first code I saw these warnings to be turned off)

Delphi 7 introduced introduced warnings for unsafe constructs like W1047 and W1048 so you could prepare your code for the first Delphi .NET compilers .

The oldest online documentation on this is in Delphi 2007:

After Delphi 2007, the .NET compiler got shelved, but the errors and warning stayed as they serve a good purpose for native code as well.

Delphi 2007 did not document any of the other directives.

Unlike the D2007 documentation, however, the UNSAFECODE should be written UNSAFE_CODE as with using {$WARN UNSAFECODE ON}, you will get this error:

E1030 Invalid compiler directive: 'UNSAFECODE'

Looking at the library code and example code that ships with Delphi, these are the valid $WARN compiler directives having to do with UNSAFE:

  • UNSAFE_CAST (since Delphi 7, but only used in Vcl.WinXPanels.pas introduced in Delphi 10.2 Tokyo and up)
  • UNSAFE_CODE (since Delphi 7, but still documented as UNSAFECODE)
  • UNSAFE_TYPE (since Delphi 7)
  • UNSAFE_VOID_POINTER (since Delphi XE3, as precursor to the NEXTGEN compilers)

The ultimate source for these is the file DCCStrs.pas that has shipped since Delphi 2009: [WayBack] warnings – Identifiers for Delphi’s $WARN compiler directive – Stack Overflow.

A problem is that current documentation still lists the wrong name in many places:

This one finally got it right: [WayBack] Warning messages (Delphi) – RAD Studio

UNSAFE_TYPE W1046
UNSAFE_CODE W1047
UNSAFE_CAST W1048

Note it also documented UNSAFE_VOID_POINTER:

UNSAFE_VOID_POINTER W1070

[WayBack] W1070 Use of untype pointer can disrupt instance reference counts (Delphi) – RAD Studio

And these warning messages still do not contain the directives, but do explain the underlying code construct better:

You have to use these directives:

// Get rid of "W1047 Unsafe code 'ASM'", "W1047 Unsafe code '^ operator'", "W1047 Unsafe code '@ operator'" and similar

{$WARN UNSAFE_CODE OFF}

// Get rid of "W1048 Unsafe typecast of 'TFreedObject' to 'PByte'" and similar

{$WARN UNSAFE_CAST OFF}

Back in the days, some people were not amused and disabled the warnings, for instance in [Archive.is] Re: How can I eliminate these warnings in Delphi 7 which did not appear in Delphi 5. – Google Groups:

Dennis Passmore:
I have one include file that I usually include in all projects as follows—– WarningsOff.inc —————-
{$IFDEF CONDITIONALEXPRESSIONS}
  {$IF CompilerVersion >= 14}
{$WARN SYMBOL_PLATFORM OFF}
{$WARN SYMBOL_DEPRECATED OFF}
{$WARN SYMBOL_LIBRARY OFF}
{$WARN UNIT_DEPRECATED OFF}
{$WARN UNIT_LIBRARY OFF}
{$WARN UNIT_PLATFORM OFF}

{$WARN UNSAFE_TYPE OFF}
{$WARN UNSAFE_CODE OFF}
{$WARN UNSAFE_CAST OFF}

  {$IFEND}
{$ENDIF}
———————and it gets ride of all unwanted warnings in the IDE or even DCC32.exe when compiling the project
from the command line.

I just add the following line to the project .dpr file and do not worry about the rest.

{$I WarningsOff.inc}

Dennis Passmore

“If you cannot conceive the idea you
will never achieve the desired results”

I disagree with such an approach, as those warnings have their purpose.

Knowing how to selectively disable/enable them however, is important.

–jeroen

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

Solved: Very slow speed on SSD |VMware Communities (via “Building a lab with ESXI and Vagrant – DarthSidious”)

Posted by jpluimers on 2021/05/11

Via [WayBack] Building a lab with ESXI and Vagrant – DarthSidious while researching the possibility of running Vagrant (software) – Wikipedia on VMware ESXi – Wikipedia for building and distributing development environments:

[WayBack] Solved: Very slow speed on SSD |VMware Communities “solution” that seems to work for ESXi 6.5 and 6.7:

ESXi 6.5 includes a new native driver (vmw_ahci) for SATA AHCI controllers, but that introduces performance problems with a lot of controllers and/or disks.

Try to disable the native driver and revert to the older sata-ahci driver by running

esxcli system module set --enabled=false --module=vmw_ahci

in an ESXi shell.

Reboot the host to make the change effective.

which solves it for some who now get much faster results:

Your suggestion worked for me, now i am getting avg speed 250Mbps from SATA III SSD .

ssd.jpg

Hope will get the full I/Ops from SSD.

However:

One issue I still have is that my 4 port Syba PCIe controller card now vanishes after disabling vmw_ahci and I am restricted to using the SATA ports on the motherboard.

and you need backups:

WARNING: Doing this at least for me erases all the VMs on the aforementioned drive. Migrate as needed.

There was no response for a more permanent fix:

What is the permanent fix for this issue, should we expect a corrected native driver from VMware, or will this require a firmware upgrade on the part of the drive vendors?

and there seem to be other bottle-necks:

tried the command on a 6.7.

Deploying an OVA and I am getting 22.82….

I have a Samsung 860 EVO mSATA 1Tb SSD.

i re-enabled it, I got max 11.81.

Kind of crappy either way. Not SSD speeds IMO.

–jeroen

 

Posted in Development, ESXi6.5, ESXi6.7, Power User, Software Development, Testing, Virtualization, VMware, VMware ESXi | Leave a Comment »

Gasexplosie en grote brand aan Westestraat in Sassenheim

Posted by jpluimers on 2021/05/11

De buurt was tot laat afgesloten (veiligheid, onderzoek, genoeg redenen), dus voor nachtopvang van mijn verstandelijk beperkte broer moeten zorgen omdat Wlz zorginstelling geen crisiszorg kon leveren en op WSW werk geen leidinggevende beschikbaar was om zorg af te stemmen.

Voor mijn off-line geheugen (bijna allemaal via [Archive.is] #sassenheim hashtag on Twitter):

–jeroen

Read the rest of this entry »

Posted in About, Personal | Leave a Comment »

Chrome supported extension IDs

Posted by jpluimers on 2021/05/11

I wonder how you can programmatically open a Hangouts link from Chrome?

These dit not help:

So did some more digging.

TL;DR: did not find a solution; so any help is appreciated.

I found the IDs of then in [WayBack] extensions/common/constants.cc – chromium/src.git – Git at Google

namespace extension_misc {
const char kPdfExtensionId[] = "mhjfbmdgcfjbbpaeojofohoefgiehjai";
const char kQuickOfficeComponentExtensionId[] =
    "bpmcpldpdmajfigpchkicefoigmkfalc";
const char kQuickOfficeInternalExtensionId[] =
    "ehibbfinohgbchlgdbfpikodjaojhccn";
const char kQuickOfficeExtensionId[] = "gbkeegbaiigmenfmjfclcdgdpimamgkj";
const char kMimeHandlerPrivateTestExtensionId[] =
    "oickdpebdnfbgkcaoklfcdhjniefkcji";
const char kProdHangoutsExtensionId[] = "nckgahadagoaajjgafhacjanaoiihapd";
const char* const kHangoutsExtensionIds[6] = {
    kProdHangoutsExtensionId,
    "ljclpkphhpbpinifbeabbhlfddcpfdde",  // Debug.
    "ppleadejekpmccmnpjdimmlfljlkdfej",  // Alpha.
    "eggnbpckecmjlblplehfpjjdhhidfdoj",  // Beta.
    "jfjjdfefebklmdbmenmlehlopoocnoeh",  // Packaged App Debug.
    "knipolnnllmklapflnccelgolnpehhpl"   // Packaged App Prod.
    // Keep in sync with _api_features.json and _manifest_features.json.
};
// Error returned when scripting of a page is denied due to enterprise policy.
const char kPolicyBlockedScripting[] =
    "This page cannot be scripted due to an ExtensionsSettings policy.";
}  // namespace extension_misc

The odd thing is that the source does not match the Chrome web store designation:

Hangouts ExtensionId Source name Web store name
nckgahadagoaajjgafhacjanaoiihapd kProdHangoutsExtensionId Google Hangouts
ljclpkphhpbpinifbeabbhlfddcpfdde Debug Google Hangouts (Extension, Beta); GOOGLE CONFIDENTIAL – FOR INTERNAL USE ONLY
ppleadejekpmccmnpjdimmlfljlkdfej Alpha Google Hangouts (Extension, Debug)
eggnbpckecmjlblplehfpjjdhhidfdoj Beta Google Hangouts (Extension, Alpha)
jfjjdfefebklmdbmenmlehlopoocnoeh Packaged App Debug 404 error
knipolnnllmklapflnccelgolnpehhpl Packaged App Prod Google Hangouts; Hangouts Chrome App is deprecated. Please switch to the Hangouts Chrome Extension.

You can not start the extensions in a tab; they need to start their view through the extension.

So these links do not work:

  • chrome-extension://nckgahadagoaajjgafhacjanaoiihapd/mainapp.html?uv_main_window
  • chrome-extension://ljclpkphhpbpinifbeabbhlfddcpfdde/mainapp.html?uv_main_window
  • chrome-extension://ppleadejekpmccmnpjdimmlfljlkdfej/mainapp.html?uv_main_window
  • chrome-extension://eggnbpckecmjlblplehfpjjdhhidfdoj/mainapp.html?uv_main_window
  • chrome-extension://jfjjdfefebklmdbmenmlehlopoocnoeh/mainapp.html?uv_main_window
  • chrome-extension://knipolnnllmklapflnccelgolnpehhpl/mainapp.html?uv_main_window

–jeroen

Read the rest of this entry »

Posted in Chrome, Development, Google, GoogleHangouts, Power User, Software Development, Web Development | Leave a Comment »

file – String format procedure similar to writeln – Stack Overflow

Posted by jpluimers on 2021/05/11

Cool Format feature from [WayBack] file – String format procedure similar to writeln – Stack Overflow:

The cool thing about using Format is that you use for Format Strings not only to parameterize things like width and precision inside that Format String, but also as parameters like you normally would provide values.

You can get very close to using a width of 8 and a precision of 2, like the example in your question.

For instance, to quote the documentation:

Format ('%*.*f', [8, 2, 123.456]);

is equivalent to:

Format ('%8.2f', [123.456]);

That is a much overlooked feature of Format and Format Strings.

Edit 20250910:

This was part of my answer¹ there to mimic WriteLn formatting behaviour which was not even documented at the now deleted [Wayback/Archive] Standard Routines and I/O.

Normally deleted information like above results in worse information at their current documentation site.

This time however was an exception: the current documentation is better².

¹ the start of my answer:

Read the rest of this entry »

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

Connectors/cables for Serial Attached SCSI and SATA – Wikipedia

Posted by jpluimers on 2021/05/10

Since I always get confused with SAS and SATA connectors, some tables from Wikipedia:

  • Serial Attached SCSI Connectors- Wikipedia
    Codename Other names Ext./int. Pins No of devices / lanes Comment Image
    SFF-8086 Internal mini-SAS, internal mSAS Internal 26 4 This is a less common implementation of SFF-8087 than the 36-circuit version. The fewer positions is enabled by it not supporting sidebands. SFF 8086.jpg
    SFF-8087 Internal mini-SAS, internal mSAS, internal iSAS, internal iPass Internal 36 4 Unshielded 36-circuit implementation of SFF-8086. Molex iPass reduced width internal 4× connector, 12 Gbit/s capability. SFF-8087 SMC.jpg
    SFF-8088 External mini-SAS, external mSAS, external iSAS, external iPass External 26 4 Shielded 26-circuit implementation of SFF-8086. Molex iPass reduced width external 4× connector, 12 Gbit/s capability. SFF 8088.jpg
    SFF-8470 InfiniBandCX4 connector, Molex LaneLink External 34 4 High-density external connector (also used as an internal connector). SFF 8470.jpg
    SFF-8482 Internal 29 2 lanes This form factor is designed for compatibility with SATA but can drive a SAS device. A SAS controller can control SATA drives, but a SATA controller cannot control SAS drives. SFF-8482 SAS Plug - Bokeh at f22.jpg
    SFF-8484 Internal 32 or 19 4 or 2 High-density internal connector, 2 and 4 lane versions are defined by the SFF standard. SFF-8484 straight connector.jpg
    SFF-8485 Defines SGPIO (extension of SFF 8484), a serial link protocol used usually for LED indicators.
    SFF-8613 (SFF-8643) Internal 36 4 or 8 with dual connector Mini-SAS HD (introduced with SAS 12 Gbit/s) SFF-8643 SMC.jpg
    SFF-8614 (SFF-8644) External 4 or 8 with dual connector Mini-SAS HD (introduced with SAS 12 Gbit/s) SFF-8644 cable.jpg
    Sideband connector Internal Often seen with 1× SFF-8643 or 1× SFF-8087 on the other end – internal fan-out for 4× SATA drives. Connects the controller to drives without backplane or to the (SATA) backplane and optionally, to the status LEDs. Sideband.jpg
    SFF-8680 Internal
    • 1
    • (2 ports)
    SAS 12 Gbit/s backplane connector
    SFF-8639 Internal 68
    • 1
    • (2 ports)
    • SAS 12 Gbit/s backplane connector;
    • revision of the SFF-8680.
    • Also known as “U.2”.[17]
    SFF-8639.jpg
    SFF-8638
    • Four 1x ports at up to 24 Gb/s each;
    • two 2x ports at up to 48 Gb/s each;
    • one 4x port at up to 96 Gb/s.
    SFF-8640
    • Four 1x ports at up to 24 Gb/s each;
    • two 2x ports at up to 48 Gb/s each;
    • one 4x port at up to 96 Gb/s.[18]
    SFF-8681
    • Two 1x ports at up to 24 Gb/s each;
    • one 2x ports at up to 48 Gb/s each.
  • Serial ATA: Cables, connectors, and ports – Wikipedia

    Data

    Standard connector, data segment[42]
    Pin # Mating Function
    1 1st Ground
    2 2nd A+ (transmit)
    3 2nd A− (transmit)
    4 1st Ground
    5 2nd B− (receive)
    6 2nd B+ (receive)
    7 1st Ground
     — Coding notch

     

    • A seven-pin SATA data cable (left-angled version of the connector)

    • SATA connector on a 3.5-inch hard drive, with data pins on the left and power pins on the right. The two different pin lengths ensure a specific mating order; the longer lengths are ground pins and make contact first.

    Power

    Standard

    Standard connector, power segment
    Pin # Mating Function
     — Coding notch
    1 3rd 3.3 V Power
    2 3rd
    3 2nd Enter/exit Power Disable (PWDIS) mode
    (3.3 V Power, Pre-charge prior to SATA 3.3)
    4 1st Ground
    5 2nd
    6 2nd
    7 2nd 5 V Power, Pre-charge
    8 3rd 5 V Power
    9 3rd
    10 2nd Ground
    11 3rd Staggered spinup/activity
    12 1st Ground
    13 2nd 12 V Power, Pre-charge
    14 3rd 12 V Power
    15 3rd

    A fifteen-pin SATA power connector (this particular connector is missing the orange 3.3 V wire)

    Slimline

    Slimline connector, power segment
    Pin # Mating Function
     — Coding notch
    1 3rd Device presence
    2 2nd 5 V Power
    3 2nd
    4 2nd Manufacturing diagnostic
    5 1st Ground
    6 1st

    Micro

    Micro connector, power segment
    Pin # Mating Function
    1 3rd 3.3 V Power
    2 2nd
    3 1st Ground
    4 1st
    5 2nd 5 V Power
    6 3rd
    7 3rd Reserved
     — Coding notch
    8 3rd Vendor specific
    9 2nd

    A 1.8-inch (46 mm) micro SATA hard drive with numbered data and power pins on the connector.

–jeroen

Posted in Hardware, Power User, SAS/SATA, SFF-8087 | Leave a Comment »