Album by Kristian Köhntopp: [WayBack/Archive.is] Two ways to unsubscribe from Booking Email Marketing. – Google Photos
Via: [WayBack] Kristian Köhntopp – Google+
–jeroen
Posted by jpluimers on 2020/10/30
Album by Kristian Köhntopp: [WayBack/Archive.is] Two ways to unsubscribe from Booking Email Marketing. – Google Photos
Via: [WayBack] Kristian Köhntopp – Google+
–jeroen
Posted in LifeHacker, Power User | Leave a Comment »
Posted by jpluimers on 2020/10/30
$$$$ is the parcel tracking code, and ####AA is the destination postal code without spaces:https://www.dhlparcel.nl/nl/consument/volg-je-pakket?tc=$$$$&pc=####AA&lc=nl-NL$$$$ is the parcel tracking code, and ####AA is the destination postal code without spaces:.postnl.nl/#!/track-en-trace/$$$$/NL/####AAPosted in LifeHacker, Power User | Leave a Comment »
Posted by jpluimers on 2020/10/30
I hate applications that globally install Windows shortcut keys without the setup/install either warn about it or make it configurable.
In this case it is about CardMinder Viewer that ships with the Fujitsu ix500 scanner and installs a global shortcut, by default Alt-F3.
CardMinder Viewer is especially bad because the “settings” are not in the application: the settings are part of the Windows notification area (usually on the lower left of your screen; many people call it “the tray” as it was called tray in the Cairo research that led to Windows 95 and Windows NT 3.5).
So here is how to get rid of the Alt–F3 shortcut to be stolen:
Posted in Fujitsu ScanSnap, Hardware, ix500, Power User, Scanners, Windows | Leave a Comment »
Posted by jpluimers on 2020/10/29
I used these links to find out what entries a Katalon .gitignore file should contain:
Combining the above, the .gitignore file needs to at least contain:
/.classpath /.project /.settings bin/lib/ Libs/ /bin /Libs .settings .classpath settings/internal /.svn /bin/lib/Temp*.class Reports/ .project /libs/Temp*.groovy bin/lib/ bin/keyword/
(funny that .svn should be in a .gitignore file and that various combinations of casing are used)
–jeroen
Posted in Development, DVCS - Distributed Version Control, git, Katalon, Software Development, Source Code Management, Testing | Leave a Comment »
Posted by jpluimers on 2020/10/29
I totally missed that this has been added in Delphi a long time ago (at least in Delphi 2007 or maybe even before): the {$EXTENSION zzz} or {$E zzz} Delphi directive that sets the file extension of the output: [WayBack] Executable extension (Delphi 2007)
[WayBack] Executable extension (Delphi 10.3 Rio) – RAD Studio explains this is equivalent to using the -TZ
The documentation explains the zzz to be a string, but in practice, using {$EXTENSION yyy.zzz} and {$E yyy.zzz} fail:
[WayBack] Little funny bug… I wanted to quickly make two x86 EXE builds, with 3GB and normal 2GB of available memory. Just to pass it for heavy testing, as 3rd… – Arioch The – Google+ explains how to use this as a trick to have a different extension for 3GB aware compiled 32-bit executables:
{$DEFINE g3} // or obvious {.$DEFINE g3} {$IFDEF g3} {$SetPEFlags IMAGE_FILE_LARGE_ADDRESS_AWARE} {$EXTENSION 3GB.EXE} {$ENDIF}This kind of work in XE2 but with two funny bugs:
- the IDE ignores it and shows filename.exe in the compile progress dialog
- linker partially ignores it and creates
filename.4gbinstead offilename.3gb.exe
I did know about the various $LIBxxx directives that were introduced in Delphi 2009 when it [WayBack] was released in 2008.
Related:
{$LIBPREFIX 'string'}, {$LIBSUFFIX 'string'}, {$LIBVERSION 'string'}One day, I might create an overview of which directives are valid in what Delphi versions. That would be a big change of List-Delphi-Installed-Packages.ps1, which would need at least these:
–jeroen
Posted in Conference Topics, Conferences, Delphi, Development, Event, Software Development | Leave a Comment »
Posted by jpluimers on 2020/10/29
Few people seem to know about the FastMM PushAllocationGroup method.
This search returned almost nothing: fastmm PushAllocationGroup -site:github.com -site:sourceforge.net -site:stackoverflow.com – Google Search.
These results were convoluted:
These posts were interesting though, but most of them did not get any deeper into the topic than “look at the FastMM source”:
There were the only post giving a bit more insight:
–jeroen
Posted in Conference Topics, Conferences, Delphi, Development, Event, FastMM, Software Development | Leave a Comment »
Posted by jpluimers on 2020/10/28
I will limit myself to software that needs Administrative elevation in order to be installed. This is the default use-case for Chocolatey. It is way way easier than installing software all by hand, but there are a few things you need to know, hence these notes.
Since the default use case is installing software that requires Administrative elevation during install, Chocolatey needs to run with Administrative privileges in order to perform these installs.
If you were hoping for a way around this (for instance by having a client/service architecture), then just stop here.
Even though such a structure could technically be created, getting it stable and working it correctly with a truckload of software to be installed (much of which not available as packages during Chocolatey development in the first place) is a task too big.
Think of the size of the Windows Installer team at Microsoft to get installers working in the first place, the extra effort needed by Chocolatey volunteers to get the installers working from the console, then another much more complex layer of getting them running from inside a service and communicating everything back and forth to a non-elevated command prompt would be a nightmare.
I won’t even mention the security steps involved to ensure the non-elevated command prompt has enough rights to send installation instructions to the elevated service.
So the first step is to have an elevated command prompt for Chocolatey.
Being elevated, and Chocolatey needing to download installers requires a local temporary place for them.
By default, that place is %Temp%\chocolatey of the administrative user that elevated the Chocolatey command prompt.
This directory can grow quite big, so dir, so – since there is no choco cleanup yet [WayBack] you need to either:
%ChocolateyInstall%\lib\choco-cleaner\tools\choco-cleaner-manual.batrd /s /q %Temp%\chocolatey% every now and then (cleans less than the above methods).Either the direct one below, or the more secure one (so you can inspect the intermediate [WayBack] install.ps1) at [WayBack] Installation using PowerShell from cmd.exe:
@echo off SET DIR=%~dp0% ::download install.ps1 %systemroot%\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -ExecutionPolicy Bypass -Command "((new-object net.webclient).DownloadFile('https://chocolatey.org/install.ps1','%DIR%install.ps1'))" ::run installer %systemroot%\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -ExecutionPolicy Bypass -Command "& '%DIR%install.ps1' %*"
If you want to get rid of it, use [WayBack] Uninstallation.
Besides the one above and below, there are many more [WayBack] Installation: more install options
Output of direct install as Administrator (disclaimers apply):
C:\WINDOWS\system32>powershell -NoProfile -ExecutionPolicy Bypass -Command "[System.Net.WebRequest]::DefaultWebProxy.Credentials = [System.Net.CredentialCache]::DefaultCredentials; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH="%PATH%;%ALLUSERSPROFILE%\chocolatey\bin" Getting latest version of the Chocolatey package for download. Getting Chocolatey from https://chocolatey.org/api/v2/package/chocolatey/0.10.11. Downloading 7-Zip commandline tool prior to extraction. Extracting C:\Users\JEROEN~1\AppData\Local\Temp\chocolatey\chocInstall\chocolatey.zip to C:\Users\JEROEN~1\AppData\Local\Temp\chocolatey\chocInstall... Installing chocolatey on this machine Creating ChocolateyInstall as an environment variable (targeting 'Machine') Setting ChocolateyInstall to 'C:\ProgramData\chocolatey' WARNING: It's very likely you will need to close and reopen your shell before you can use choco. Restricting write permissions to Administrators We are setting up the Chocolatey package repository. The packages themselves go to 'C:\ProgramData\chocolatey\lib' (i.e. C:\ProgramData\chocolatey\lib\yourPackageName). A shim file for the command line goes to 'C:\ProgramData\chocolatey\bin' and points to an executable in 'C:\ProgramData\chocolatey\lib\yourPackageName'. Creating Chocolatey folders if they do not already exist. WARNING: You can safely ignore errors related to missing log files when upgrading from a version of Chocolatey less than 0.9.9. 'Batch file could not be found' is also safe to ignore. 'The system cannot find the file specified' - also safe. chocolatey.nupkg file not installed in lib. Attempting to locate it from bootstrapper. PATH environment variable does not have C:\ProgramData\chocolatey\bin in it. Adding... WARNING: Not setting tab completion: Profile file does not exist at 'C:\Users\jeroenAdministrator\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1'. Chocolatey (choco.exe) is now ready. You can call choco from anywhere, command line or powershell by typing choco. Run choco /? for a list of functions. You may need to shut down and restart powershell and/or consoles first prior to using choco. Ensuring chocolatey commands are on the path Ensuring chocolatey.nupkg is in the lib folder
choco install #packageName#--yes to each install commandrefreshenv in each command-prompt to reflect any changes to the registry
cmd.exe or batch file: [WayBack] choco/RefreshEnv.cmd at master · chocolatey/choco · GitHubIf you run out of SSD or VM disk space, you can try compress using compact /c /s *.* in these directories:
C:\ProgramData\Package CacheC:\ProgramData\Microsoft\VisualStudio\PackagesC:\ProgramData\Microsoft\ClickToRun\ProductReleasesuseRememberedArgumentsForUpgrades: [WayBack] Chocolatey Gallery | Visual Studio Code 1.30.0 how to make /NoContextMenuFolders permanent.–jeroen
Posted in Chocolatey, CommandLine, Conference Topics, Conferences, Development, Event, Power User, PowerShell, PowerShell, Scripting, Software Development, Windows | Leave a Comment »
Posted by jpluimers on 2020/10/28
Reminder to self: write a longer article on Delphi mocking as Spring4D mocking is much better than Delphi Mocks, especially because of code-completion reasons.
Spring4D has a Mock record that can return a Mock<T> on which you can verify using methods like Received.
See:
I got some code that I need to dig up from an old project with many more Spring4D Mock examples.
Note that:
container.AddExtension<TAutoMockExtension>: [WayBack] unit testing – How to Mock Spring4D Events with DUnit – Stack Overflow.For now, these are a start [WayBack] Delphi Unit Testing : Writing a simple spy for the CUT – Stack Overflow:
Sounds like a use case for a mock (I am using the term mock here because most frameworks refer to their various kinds of test doubles as mock)
In the following example I am using DUnit but it should not make any difference for DUnitX. I am also using the mocking feature from Spring4D 1.2 (I did not check if Delphi Mocks supports this)
unit MyClass; interface type TMyClass = class private fCounter: Integer; protected procedure MyProcedure; virtual; public property Counter: Integer read fCounter; end; implementation procedure TMyClass.MyProcedure; begin Inc(fCounter); end; end. program Tests; uses TestFramework, TestInsight.DUnit, Spring.Mocking, MyClass in 'MyClass.pas'; type TMyClass = class(MyClass.TMyClass) public // just to make it accessible for the test procedure MyProcedure; override; end; TMyTest = class(TTestCase) published procedure Test1; end; procedure TMyClass.MyProcedure; begin inherited; end; procedure TMyTest.Test1; var // the mock is getting auto initialized on its first use // and defaults to TMockBehavior.Dynamic which means it lets all calls happen m: Mock<TMyClass>; o: TMyClass; begin // set this to true to actually call the "real" method m.CallBase := True; // do something with o o := m; o.MyProcedure; // check if the expected call actually did happen m.Received(Times.Once).MyProcedure; // to prove that it actually did call the "real" method CheckEquals(1, o.Counter); end; begin RegisterTest(TMyTest.Suite); RunRegisteredTests(); end.Keep in mind though that this only works for virtual methods.
–jeroen
Posted in Conference Topics, Conferences, Delphi, Development, Event, Software Development, Spring4D | Leave a Comment »
Posted by jpluimers on 2020/10/28
Reminder to self: [WayBack] performance – How can I produce high CPU load on Windows? – Super User
Poor-mans-solution is a batch file filling one core:
@echo off
:loop
goto loopTo stop, press Ctrl+C in the console.
Far easier is [WayBack] Tools To Simulate CPU / Memory / Disk Load – The Way I See It:
There is an old SysInternals tool from 1996 called “CPU Stress” that still works. (I just tried it on my Windows 10 laptop.)
Custom CPU load
It’s GUI based and allows you to run up to four threads at custom intensities. This allows you to tune the desired CPU load. As a rule of thumb: One thread with
Activityset toMaximumwill consume about 25% CPU. So as an example: If you run three threads at Maximum, your CPU load goes to about 75%.Portable
CPUSTRES.EXEis a portable download and does not require installation.
–jeroen
Posted in Development, Software Development, Windows Development | Leave a Comment »
Posted by jpluimers on 2020/10/27
If not done yet, try to improve this: [WayBack] Optional sort by name in LogMemoryManagerStateToFile · Issue #64 · pleriche/FastMM4 · GitHub
–jeroen
Posted in Delphi, Development, Software Development | Leave a Comment »
$RTTIdirective, you can use a little trick and redefine it in subclass inpublicsection asoverride; abstract;this will cause the RTTI to be generated. – Honza RFeb 5 ’16 at 8:02