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 2018

MUSTOOL MT8206 Multimeter & Oscilloscope Goes for $42 (Promo)

Posted by jpluimers on 2018/09/09

The coupon for the Promo worked yesterday, so you might want to try it if you like a scope in a multimeter form factor: [WayBack] MUSTOOL MT8206 Multimeter & Oscilloscope Goes for $42 (Promo).

MUSTOOL MT8206 looks like a standard digital multimeter, but the device is actually a 2-in-1 device that also serves as a oscilloscope. Banggood have the…

Via [WayBack] New 2-in-1 digital multimeter + oscilloscope selling for ~$42 shipped for a limited time – Jean-Luc Aufranc – Google+

–jeroen

Posted in Development, Hardware Development, Power User | Leave a Comment »

Happy testers day.

Posted by jpluimers on 2018/09/09

Fitting for a day like this.

[WayBackTesting: Hammering Nails via [WayBack] Testing: Hammering Nails – This is why I Code – Google+

Posted in Fun, Testing | Leave a Comment »

https://altd.embarcadero.com/ TLS certificate does not match domain name

Posted by jpluimers on 2018/09/07

One of the domains not yet monitored at embarcaderomonitoring.wiert.me, was the altd download server for ISOs and installers on http and https level. Ultimately you want https, as most of these are about installers, so you do not want any man-in-the-middle to fiddle with them.

TLS on altd fails

Upitmerobot is not yet smart enough to check validity of TLS certificates on https connections.

Chrome, Firefox, Safari, Internet Explorer, wget, curl and ssllabs however are.

altd hides as much from itself as possible

Uptimerobot did not like monitoring the plain http://altd.embarcadero.com/ and https://altd.embarcadero.com/ URLs, because the altd is not browsable, so it tries to hide most of its structure from access. This means they both return an odd response:

Those responses are actually 404 errors (note the - minus sign after curl --trace-ascii: it sends the trace to stdout):

$ wget http://altd.embarcadero.com/
--2018-09-05 10:44:23-- http://altd.embarcadero.com/
Resolving altd.embarcadero.com (altd.embarcadero.com)... 88.221.144.40, 88.221.144.10
Connecting to altd.embarcadero.com (altd.embarcadero.com)|88.221.144.40|:80... connected.
HTTP request sent, awaiting response... 404 Not Found
2018-09-05 10:44:23 ERROR 404: Not Found.

$ curl --verbose http://altd.embarcadero.com/
*   Trying 88.221.144.40...
* TCP_NODELAY set
* Connected to altd.embarcadero.com (88.221.144.40) port 80 (#0)
> GET / HTTP/1.1
> Host: altd.embarcadero.com
> User-Agent: curl/7.54.0
> Accept: */*
> 
< HTTP/1.1 404 Not Found
< Server: Apache
< Content-Type: text/html; charset=iso-8859-1
< Content-Length: 16
< Date: Wed, 05 Sep 2018 08:45:57 GMT
< Connection: keep-alive
< 
* Connection #0 to host altd.embarcadero.com left intact
File not found."

$ curl --trace-ascii - http://altd.embarcadero.com/
== Info:   Trying 88.221.144.40...
== Info: TCP_NODELAY set
== Info: Connected to altd.embarcadero.com (88.221.144.40) port 80 (#0)
=> Send header, 84 bytes (0x54)
0000: GET / HTTP/1.1
0010: Host: altd.embarcadero.com
002c: User-Agent: curl/7.54.0
0045: Accept: */*
0052: 
<= Recv header, 24 bytes (0x18)
0000: HTTP/1.1 404 Not Found
<= Recv header, 16 bytes (0x10)
0000: Server: Apache
<= Recv header, 45 bytes (0x2d)
0000: Content-Type: text/html; charset=iso-8859-1
<= Recv header, 20 bytes (0x14)
0000: Content-Length: 16
<= Recv header, 37 bytes (0x25)
0000: Date: Wed, 05 Sep 2018 08:47:19 GMT
<= Recv header, 24 bytes (0x18)
0000: Connection: keep-alive
<= Recv header, 2 bytes (0x2)
0000: 
<= Recv data, 16 bytes (0x10)
0000: File not found."
File not found."== Info: Connection #0 to host altd.embarcadero.com left intact

This is also the reason that WayBack does not want to archive that link, but it can be archived at [Archive.ishttps://altd.embarcadero.com/.

Luckily, a Google search for site:altd.embarcadero.com revealed there is a non-installer file short enough (~72 kibibytes) for Uptime robot to check, so it now verifies it can access these:

–jeroen

Read the rest of this entry »

Posted in *nix, *nix-tools, cURL, Encryption, HTTPS/TLS security, Monitoring, Power User, Security, Uptimerobot, wget | Leave a Comment »

God is real unless declared integer, 

Posted by jpluimers on 2018/09/07

Kristian Köhntopp commended:

GOD IS REAL UNLESS DECLARED INTEGER..

In some versions of Fortran, the default type of variables starting with I, J, K or L is integer, while other varianles are by default typed as real. The Fortran statement DECLARE can be used to explicitly declare a variables as being of a specific type.

The variable GOD stats with G and hence is implicitly real, unless you add an appropriate declare statement.

He reminded my of my FORTRAN 66 days at university when studying “computer usage for chemists”:

I remember a “computer usage for chemists” course during my studies where (end of the 1980s!) were supposed to program in FORTRAN 66.
Luckily the VAX/VMS machine supported a much more recent FORTRAN version and had support for 132 columns as well, which allowed me to indent properly (like I was used from my Pascal background).This tremendously helped me solve basically this problem:

  • import tables with
    1. atom code, radius and valence (bonding count)
    2. atom1 code, atom2 code, minimum distance, maximum distance
    3. atom code, X/Y/Z coordinate
  • determine which bonds can occur
  • walk the bonds and determine the atomic structure, including cycle count

Especially the last one was easiest to solve with recursion, which FORTRAN does not support. So I wrote my own stack structure and solved the problem.

The student coach was mad when she found out I had printed the full documentation on continuous form paper which took the printer about half an hour for printing the ~100 pages.

Next morning, I had read it front-to-back and colour-indexed all the sections so it was far easier to find what the compiler could do for me. She could not believe I had done that.

All my co students were on a (non shielded!) 300 meter multiplexed serial connection with VT-120 emulators from PC’s with all sorts of connection problems.

I discovered a small room right above the VAX/VMS machine having a couple of terminals with direct connections that were hardly used. A few of them were VT-240 that had a session switch allowing for maximum 3 interactive sessions running at far higher priority than the compiler/linker batch queues provided.

This allowed me to perform quick release cycles of my project: 1 session for editing and inspecting logs, 1 session for compiling my last version, 1 session for linking the previously compiled version.

I was about the only student that delivered the project on time (:

Via: Archive.is Check out @chicaScientific’s Tweet: https://twitter.com/chicaScientific/statu… having

“Why did the integer drown?”

“Because he wasn’t a float”

–jeroen

 

Posted in Fun, History, Quotes, T-Shirt quotes | Leave a Comment »

LiFePO4wered/Pi+ | Crowd Supply

Posted by jpluimers on 2018/09/07

A few days left for [WayBack] LiFePO4wered/Pi+ | Crowd Supply: A full-featured LiFePO4 battery, power manager, and UPS for the Raspberry Pi

via:

–jeroen

 

 

Posted in Development, Hardware Development, Power User, Raspberry Pi | Leave a Comment »

Some sites than can help you check if your (maybe dynamic) IP has been black-listed

Posted by jpluimers on 2018/09/07

A few links that helped me track down why a sudden new Ziggo IP-address was blacklisted:

–jeroen

Posted in DNS, Internet, Power User | Leave a Comment »

Some Linux mail solutions

Posted by jpluimers on 2018/09/07

Too bad most of them are very picky to the Linux distributions they run on.

–jeroen

Posted in *nix, Linux, openSuSE, Power User, SuSE Linux | Leave a Comment »

Delphi XE6 and up regression: “‘9999-12-31 23:59:59,1000’ is not a valid date and time” when passing a SOAP message with 9999-11-31T23:59:59.9999999; QC144171

Posted by jpluimers on 2018/09/06

A valid SOAP message with <urn:timeStamp>9999-11-31T23:59:59.9999999</urn:timeStamp> in a xs:dateTime field return '9999-12-31 23:59:59,1000' is not a valid date and time from a Delphi application with this SOAP response:

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/">
  <SOAP-ENV:Body>
    <SOAP-ENV:Fault>
      <faultcode>SOAP-ENV:Server</faultcode>
      <faultstring>'9999-12-31 23:59:59,1000' is not a valid date and time</faultstring>
      <faultactor/>
    </SOAP-ENV:Fault>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

The reason is this exception:

exception class EConvertError with message ''9999-12-31 23:59:59,1000' is not a valid date and time'.

This is from a .NET based test case passing in timeStamp = DateTime.MaxValuewhich is handled perfectly fine by other SOAP web services tested.

I know about different resolutions of time stamps, but would never expect the 999.9999 milliseconds to be rounded up to 1000 as it is always safer to truncated away from an upper limit.

A test using Soap UI [WayBack] with this parameter finally worked (max 3 digits second fraction):

<urn:timeStamp>9999-12-31T23:59:59.999</urn:timeStamp>

The true origin of problem is in this method in the Soap.XSBuiltIns unit which has been unchanged since at least Delphi 7:

function TXSBaseTime.GetMilliSecond: Word;
begin
  Result := Round(FractionalSeconds*1000);
end;

The problem exposed itself because as of Delphi XE6 the core of function TXSBaseCustomDateTime.GetAsDateTime piece was changed from

Result := EncodeDateTime(Year, Month, Day, Hour, Minute, Second, 0);

to

Result := EncodeDateTime(Year, Month, Day, Hour, Minute, Second, Millisecond);

A combination of lack of test cases and understanding XML specifications failed to reveal this bug.

The standards specify (among others):

  • '.' s+ (if present) represents the fractional seconds;
    The above is not limiting the amount of digits, not talking about milliseconds either.
  • All ·minimally conforming· processors ·must· support year values with a minimum of 4 digits (i.e., YYYY) and a minimum fractional second precision of milliseconds or three decimal digits (i.e. s.sss). However, ·minimally conforming· processors ·may· set an application-defined limit on the maximum number of digits they are prepared to support in these two cases, in which case that application-defined maximum number ·must· be clearly documented.
    Delphi not only limits the fractional second precission, it changes the limit over time and does not document the limit. Three strikes…
  • s -- represents a digit used in the time element "second". The two digits in a ss format can have values from 0 to 60. In the formats described in this specification the whole number of seconds ·may· be followed by decimal seconds to an arbitrary level of precision. This is represented in the picture by "ss.sss". A value of 60 or more is allowed only in the case of leap seconds.
    Given buggy the fractional second handling through milliseconds, the leap second handling is ripe for a test case as well.
    Strictly speaking, a value of 60 or more is not sensible unless the month and day could represent March 31, June 30, September 30, or December 31 in UTC. Because the leap second is added or subtracted as the last second of the day in UTC time, the long (or short) minute could occur at other times in local time. In cases where the leap second is used with an inappropriate month and day it, and any fractional seconds, should considered as added or subtracted from the following minute.

The reproduction is quite simple:

Read the rest of this entry »

Posted in .NET, C#, Conference Topics, Conferences, Delphi, Development, Event, SOAP/WebServices, Software Development, XML, XML/XSD | Leave a Comment »

playing with IOT

Posted by jpluimers on 2018/09/06

Interesting stuff:

Open-source home automation platform running on Python 3. Track and control all devices at home and automate control. Installation in less than a minute.

Source: Home Assistant

Via:

CounterDesk
@Dysan18 mei 2017 09:47

Ik doe dus een hoop met home-assistant (https://home-assistant.io/) en wat custom Python scripts/apis wat allemaal op een oude laptop met ubuntu draait (10w verbruik).

De Horizon Box specifiek gaat via Harmony Hub, kan via de standaard integratie of via eigen brouwsels. Lifx en Nest heeft standaard integratie met Google Home. Al heb ik voor Lifx zelf het een-en-ander geschreven in Python om bijvoorbeeld scenes op te slaan en op te roepen met voice commando’s, dat kan weer niet standaard. NS API gaat ook via die Python API en wat er terug gezegd wordt (in het Nederlands) gaat via home-assistant.

Het voordeel van zelf zoiets bouwen is dat ik alles makkelijkers aan elkaar kan knopen dan bijvoorbeeld via IFTTT en Stringify o.i.d.. Zo kan ik bijvoorbeeld “Hey Google, sexy time” roepen en dan veranderd mijn verlichting langzaam naar iets romantischers (denk rood/oranje/roze), speelt er een zwoel lounge muziekje op mijn Sonos van een samba share, gaat de tempratuur wat omhoog en gaat mijn tv aan naar het chromecast kanaal en speelt er van die zelfde samba share een mp4 met een haardvuurtje.

Vet cheesy, I know, ik moet er de eerste vrouw nog mee verrassen :P maar het was ook vooral als demo van wat ik allemaal kan aansturen, bedoeld als grapje voor vrienden etc.

Google voegt een notificatiefunctie toe aan zijn Home-speaker. Als gebruikers een belangrijk bericht krijgen, zullen de ledjes op de speaker de aandacht gaan trekken van de gebruiker. De speaker gaat vooralsnog niet uit zichzelf spreken.

Source: Home-speaker van Google krijgt notificatiefunctie – Beeld en geluid – Nieuws – Tweakers

–jeroen

Posted in Development, IoT Internet of Things, Network-and-equipment, Power User, Software Development | Leave a Comment »

Delphi – Defer defines the “postpone procedure” pattern to execute code at the end of a method

Posted by jpluimers on 2018/09/06

Last year, I stumbled upon [WayBack] Defer defines the “postpone procedure” pattern, this postpone should schedule a “procedure: TProc” to run it after the end of the caller method… – Cesar Romero – Google+ that points to this repository:

https://github.com/cesarliws/foundation-4-delphi

Some people like this usage of the RAII pattern, but I do like it even though I do not use it very often. The implementation better than my TAnonymousMethodMemento in Delphi: a memento that executes any code at end of method for various reasons:

Now the documentation could use more English (some of it is in Portuguese).

–jeroen

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