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 2,161 other followers

Archive for October 20th, 2020

Object Pool versus Object Cache

Posted by jpluimers on 2020/10/20

I think an:

  • Object Pool is meant to set a maximum on the number of pooled objects because they are expensive in resource usage.
  • Object Cache is meant to store objects (but not cap it) that are expensive to create, but do not per se are expensive in resource usage.

For future reading:

–jeroen

 

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

Enable your device for development – UWP app developer | Microsoft Docs

Posted by jpluimers on 2020/10/20

From [WayBack] Enable your device for development – UWP app developer | Microsoft Docs:

Run these as administrator on the command prompt to:

Enable Sideloading

reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock" /t REG_DWORD /f /v "AllowAllTrustedApps" /d "1"

Enable Developer Mode

reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock" /t REG_DWORD /f /v "AllowDevelopmentWithoutDevLicense" /d "1"

Needed for WinAppDriver to test applications from Selenium or Katalon

When you run WinAppDriver without it, you get this:

C:\Users>"C:\Program Files (x86)\Windows Application Driver\WinAppDriver.exe"
Failed to initialize: 0x80004005
Despite WinAppDriver running fine as non-administrative user, the reason was given that it requires administrative privileges: [WayBack] Why does WinAppDriver.exe require developer mode? · Issue #165 · Microsoft/WinAppDriver · GitHub.

SetCapabilities name parameters and values

Various searches for what to pass as parameters to SetCapabilities failed, but the list is right at the README, but without any mention SetCapabilities, so search engines miss it with for instance “SetCapabilities” “WinAppDriver” – Google Search that only returned these links:

Supported Capabilities

Below are the capabilities that can be used to create Windows Application Driver session.

Capabilities Descriptions Example
app Application identifier or executable full path Microsoft.MicrosoftEdge_8wekyb3d8bbwe!MicrosoftEdge
appArguments Application launch arguments https://github.com/Microsoft/WinAppDriver
appTopLevelWindow Existing application top level window to attach to 0xB822E2
appWorkingDir Application working directory (Classic apps only) C:\Temp
platformName Target platform name Windows
platformVersion Target platform version 1.0

–jeroen

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

Class methods in Record vs Class in Delphi 2010 – Stack Overflow

Posted by jpluimers on 2020/10/20

A still relevant part for [WayBack] Class methods in Record vs Class in Delphi 2010+ – Stack Overflow is the distinction between class methods on both:

  • on classes they can be either regular (no extra keyword), static or virtual.
  • on records they can only be static, as there is no inheritance on records
    • this also holds for any helpers that are not class helpers (and presumably if they are ever created: interface helpers)

While class methods inside classes can be used in the same way, they can in addition have another goal: they can be virtual. Called from a class variable this can lead to different implementations depending on the current content of that variable. This is not possible for records. As a consequence class methods in records are always static.

Thanks Uwe Raabe for this insight!

One odd thing on class methods in classes, is that when they need to be static when they are the read or write backing of a class property.

When a class method is static, any calls from it to virtual (or dynamic) methods will not be handled as such: there is no class VMT for it (as because they are static, they do not have a self parameter).

–jeroen

PS: I realised later that part of the above was already in E2398 Class methods in record types must be static (Delphi) – RAD Studio

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

 
%d bloggers like this: