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 the ‘Software Development’ Category

GitHub – DevExpress/testcafe: A Node.js tool to automate end-to-end web testing.

Posted by jpluimers on 2020/12/09

In my list of things to play with: [WayBack] GitHub – DevExpress/testcafe: A Node.js tool to automate end-to-end web testing.:

A Node.js tool to automate end-to-end web testing.
Write tests in JS or TypeScript, run them and view results.

https://devexpress.github.io/testcafe


  • Works on all popular environments: TestCafe runs on Windows, MacOS, and Linux. It supports desktop, mobile, remote and cloud browsers (UI or headless).
  • 1 minute to set up: You do not need WebDriver or any other testing software. Install TestCafe with one command, and you are ready to test: npm install -g testcafe
  • Free and open source: TestCafe is free to use under the MIT licensePlugins provide custom reports, integration with other tools, launching tests from IDE, etc. You can use the plugins made by the GitHub community or make your own.

Related:

  • [WayBack] A node.js tool to automate end-to-end web testing | TestCafe:

    Use TestCafe to write tests in JS or TypeScript, run them and view results. TestCafe runs on Windows, MacOS, and Linux and takes 1 minute to set up.

  • [WayBack] TestCafe: Web Testing Framework | DevExpress

    100% web-based functional testing framework with integrated visual test recorder, remote device testing, and natural JavaScript API

    • From download to recording your first test in less than 5 minutes — installer automatically configures your environment.
    • With TestCafe, you can run tests in any browser that supports HTML5 (including IE9+, Chrome, Firefox, Safari, Opera).
    • TestCafe is operating system agnostic so you can run tests on Windows, Mac or Linux machines.
    • Run tests on remote computers and mobile devices.
    • Run tests in multiple browsers and on multiple machines in parallel.
    • Run tests in the background on any machine.
    • TestCafe allows you to test web pages that require Basic and Windows HTTP Authentication.

Via:

Screen materials below the fold.

–jeroen

Read the rest of this entry »

Posted in Development, JavaScript/ECMAScript, LifeHacker, Power User, Scripting, Software Development, Testing, Web Development | Leave a Comment »

Delphi and SuperObject JSON support have a very different implementation

Posted by jpluimers on 2020/12/09

In the comments of [WayBack] Delphi and JSON Is there an overlay (eg in the form of a helper) for the JSON classes built into Delphi (System.JSON), which offered an interface simil… – Jacek Laskowski – Google+

SuperObject has a very different implementation for JSON support than the Delphi RTL System.JSON unit as explained by Dalija Prasnikar:

If you are thinking about replacing existing code that uses SuperObject with Delphi build in JSON library, you have another problem on desktop – non-ARC compiler. SuperObject classes are interface based (reference counted) and Delphi JSON is class based – non ref-counted.

These methods are not in the Delphi RTL because of the difference:

How to read a property value of an object ?

  val := obj.AsObject.S['foo']; // get a string
  val := obj.AsObject.I['foo']; // get an Int64
  val := obj.AsObject.B['foo']; // get a Boolean
  val := obj.AsObject.D['foo']; // get a Double
  val := obj.AsObject.O['foo']; // get an Object (default)
  val := obj.AsObject.M['foo']; // get a Method
  val := obj.AsObject.N['foo']; // get a null object

How to read a value from an array ?

  // the advanced way
  val := obj.AsArray.S[0]; // get a string
  val := obj.AsArray.I[0]; // get an Int64
  val := obj.AsArray.B[0]; // get a Boolean
  val := obj.AsArray.D[0]; // get a Double
  val := obj.AsArray.O[0]; // get an Object (default)
  val := obj.AsArray.M[0]; // get a Method
  val := obj.AsArray.N[0]; // get a null object

–jeroen

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

Tables with two headers • Tables • WAI Web Accessibility Tutorials

Posted by jpluimers on 2020/12/08

Since I always forget that you can have any cell marked as th to make it a header: [WayBack] Tables with two headers • Tables • WAI Web Accessibility Tutorials.

This is not just limited to top rows, you can use it any where:

  • in the left column
  • in any other row
  • in any other column
  • in individual cells

In addition, a table can also have a caption, which is not just useful for screen-readers: it benefits general readability.

Quoting the page:

For such tables, use the <th> element to identify the header cells and the scope attribute to declare the direction of each header. The scopeattribute can be set to row or col to denote that a header applies to the entire row or column, respectively.

Additionally, you can use the <caption> element to identify the table in a document. This is particularly useful for screen-reader users browsing the web page in “table mode” where they can navigate from table to table.

Examples on that page:

–jeroen

Posted in Development, HTML, HTML5, Software Development, Web Development | Leave a Comment »

WSA: Web-Service Addressing

Posted by jpluimers on 2020/12/08

I don’t do SOAP that often any more, so here some links on it and some notes on how one site used some of the fields:

A few observations from real life:

  • Inside the WS-Addressing realm:
    • Action has a URI indicating what to execute inside the service
    • From is basically abused because it
      1. is not used as a source endpoint but
      2. has an Address element that contains both Action and authentication
    • MessageID uses a uuid: based URI
  • Outside the WS-Addressing realm, in the main SOAP body:
    • Since is implemented using a non ISO-8601 compliant timestamp: it barfs on the second fraction and on the time zone (neither Z nor an offset based time-zone are accepted).

I did not know you could have uuid based URIs, as they are not mentioned here:

But apparently they have been in use for quite a while:

–jeroen

Posted in Development, SOAP/WebServices, Software Development, XML, XML/XSD | Leave a Comment »

delphi “tproc” with “array of const” – Google Search

Posted by jpluimers on 2020/12/08

Reminder to self: remember which of the open source libraries have:

  • a generic TProc<T> alike with an const values: array of const T parameter
  • a generic TProc<T> alike with a const value: T parameter

Google returned none that stuck:

The Delphi RTL does not contain them, and because they forgot setting them up with const parameters, these can never be changed:

[WayBack] System.SysUtils.TProc – RAD Studio API Documentation

TProc = reference to procedure;
TProc<T> = reference to procedure (Arg1: T);
TProc<T1,T2> = reference to procedure (Arg1: T1; Arg2: T2);
TProc<T1,T2,T3> = reference to procedure (Arg1: T1; Arg2: T2; Arg3: T3);
TProc<T1,T2,T3,T4> = reference to procedure (Arg1: T1; Arg2: T2; Arg3: T3; Arg4: T4);

More people are annoyed by this, for instance [WayBack] SysUtils.pas Why parameters of these anonymous not const? TProc = reference to procedure (Arg1: T1; Arg2: T2); TProc = reference … – Jacek Laskowski – Google+

SysUtils.pas

Why parameters of these anonymous not const?

TProc<T1,T2> = reference to procedure (Arg1: T1; Arg2: T2);
TProc<T1,T2,T3> = reference to procedure (Arg1: T1; Arg2: T2; Arg3: T3);
TFunc<T,TResult> = reference to function (Arg1: T): TResult;
TFunc<T1,T2,TResult> = reference to function (Arg1: T1; Arg2: T2): TResult;

  • David Heffernan's profile photo
    Because the designer made a bloody terrible mistake 
  • Asbjørn Heid's profile photo
    To be fair, const-ness is a bloody mess in Delphi…
  • Hallvard Vassbotn's profile photo
    It could have been solved if the const’ness had been seen as a implementation detail by the compiler (which it really is) and made const and non-const signatures assignment compatible.
  • David Heffernan's profile photo
    +Hallvard Vassbotn indeed, and it pains me that this has never happened
  • Hallvard Vassbotn's profile photo
    +Marco Cantu Any chance of a compiler improvement in the future with regards to relaxing const matching in signature assignments…? :)
  • Vincent Parrett's profile photo
    I’ve taken to defining
    TConstProc<T1,T2> = reference to procedure (const Arg1: T1; const Arg2: T2);for cases where I have full control.

  • David Heffernan's profile photo
    +Vincent Parrett I’m sure we all have our own versions of this. But it’s not much use for composition of course.
  • Vincent Parrett's profile photo
    +David Heffernan Yup. Since it’s unlikely the compiler will every be updated to make const an automatic thing, perhaps they could add const versions to the RTL.
  • Allen Drennan's profile photo
    Yeah, we end up making our own versions of these to add the consts in all our projects.
  • David Millington's profile photo
    Do file a QP, please. Major releases like the upcoming 10.3 are the time to make interface-breaking changes.

–jeroen

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

.NET: interfaces that inherit from multiple base interfaces

Posted by jpluimers on 2020/12/03

For my link archive:

Read the rest of this entry »

Posted in .NET, C#, Delphi, Development, Software Development | Leave a Comment »

Mike Cardwell’s Tech Blog: Twitter to RSS with Google Cloud Function – Grepular

Posted by jpluimers on 2020/12/03

Cool, on my list of things to tinker with: [WayBack] Twitter to RSS with Google Cloud Function – Grepular at Mike Cardwell’s Tech Blog

Source at [WayBack] Mike Cardwell / funcTwitter · GitLab, of which these are the most important bits:

Via [WayBack] Mike Cardwell on Twitter: “Twitter to RSS with Google Cloud Function”

–jeroen

Posted in Cloud Apps, Cloud Development, Development, Google, Google Cloud Function, Internet, Power User, RSS, SocialMedia, Software Development, Twitter | Leave a Comment »

I’m using Delphi XE 10.2: empty documentation tab means you need to update to either the documentation Hotfix or 10.2.3

Posted by jpluimers on 2020/12/03

If you see the Documentation tab like below you need to either:

The problem is caused by Embarcadero using mixed technologies in the Delphi IDE combined with their lack of testing due to not eating their own dog-food.

Too bad, as the documentation over the last versions has finally increased after a 10+ year steady decline.

Doing one technology right is hard, but having to mix multiple technologies into one product is extremely hard.

Via: [WayBack] I’m using Delphi XE 10.2. Whenever I click on the Documentation tab, I see the following uselessly rendered page. I can’t seem to resize it either. Anyb… – Graeme Geldenhuys – Google+

–jeroen

Read the rest of this entry »

Posted in Delphi, Delphi 10.2 Tokyo (Godzilla), Development, Software Development | Leave a Comment »

Lecture 9B | MIT 6.001 Structure and Interpretation, 1986 – YouTube

Posted by jpluimers on 2020/12/02

Great way of learning, as 1980s teachers show the power of just a chalk board for explaining things.

Holiday binge watching (and reading): Structure and Interpretation of Computer Programs. Favorite video in the series: https://www.youtube.com/watch?v=SLcZXbyGC3E – where the two wizard profs explain / ‘role play’ the register machine with the stack.

1980s style at its best – you don’t need infographics and animations – just a chalkboard.

Via

–jeroen

Read the rest of this entry »

Posted in Development, Software Development | Leave a Comment »

Making it dead simple to implement @haveibeenpwnd in your applications, including strength warning if found in @troyhunt’s password collection.

Posted by jpluimers on 2020/12/02

I wasn’t aware that Troy Hunt created an API [WayBack] for [WayBack] Have I Been Pwned: Check if your email has been compromised in a data breach.

He did, as I noticed through [WayBack] Michelangelo van Dam on Twitter: “Making it dead simple to implement @haveibeenpwnd in my applications, including strength warning if found in @troyhunt’s password collection. Check out to try it out yourself. #ImproveSecurity #haveibeenpwnd”.

There are in fact plenty of other packages, web-sites and apps using the API as seen on [WayBack] Have I Been Pwned: API consumers.

Many people ask “if it is safe” (often assuming passwords are sent in clear, or hashes are sent in full; my fear is that those people implement security somewhere).

It is safe:

PHP source is at [WayBack] GitHub – DragonBe/hibp: A composer package to verify if a password was previously used in a breach using Have I Been Pwned API.

There is also a [WayBack] composer package at [WayBack] dragonbe/hibp – Packagist.

A really cool thing on it is this:

This project was also the subject of my talk [WayBack] Mutation Testing with Infection where the code base was not only covered by unit tests, but also was subjected to Mutation Testing using [WayBack] Infection to ensure no coding mistakes could slip into the codebase.

Apart from the tests, the most important source is at [WayBack] hibp/Hibp.php at master · DragonBe/hibp · GitHub

Related:

–jeroen

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