Note to self: In Lazarus Win64 there is no floating point type Extended, it's mapped to Double. So, overloading something like: [delphi] function TryStr2Float(const _s: string; out _flt: Extended; _DecSeparator: Char = '.'): Boolean; overload; function TryStr2Float(const _s: string; out _flt: Double; _DecSeparator: Char = '.'): Boolean; overload; function TryStr2Float(const _s: string; out _flt: Single; … Continue reading Extended = Double in Lazarus Win64
Author: dummzeuch
Warning: RAD Studio 10.2.2 Tokyo February 2018 Patch has issues
Embarcadero just released a patch for RAD Studio 10.2.2. I downloaded and installed it, and regretted doing that: It breaks linking projects with runtime packages, like GExperts, any other IDE expert and probably also most component packages. See here for a discussion. I submitted a bug report as RSP-19914.
Web Proxy Autoconfiguration
Since the last time I looked up how to configure the Web Proxy, apparently somebody came up with WPAD - the Web Proxy Auto-Discovery Protocol (Or maybe I simply missed it). The idea is quite neat: In the dhcp server, add an entry where the browser can request an url which in turn returns the … Continue reading Web Proxy Autoconfiguration
how resolvconf generates /etc/resolv.conf
In olden times, we would add entries for name resolution to /etc/resolv.conf and be done with it. Nowadays, with these newfangled scripts that change the configuration all the time, this file simply gets overwritten by a tool/library called resolvconf, so if we want to add something permanently to it, we must do it somewhere else. … Continue reading how resolvconf generates /etc/resolv.conf
Switching a XenServer VM from HVM to PVM
(Disclaimer: I am by no means an expert with XenServer. So please don’t take anything you read here for granted. It’s my own experience and what I found in documentation and online.) Switching a XenServer Linux VM from hardware assisted virtualization to paravirtualization nowadays is quite simple, since most Linux distributions already come with a … Continue reading Switching a XenServer VM from HVM to PVM
Fake TSpeedButton based on a TBitBtn – updated
I have made a few changes to the code in Fake TSpeedButton based on a TBitBtn: I replaced all that line drawing with a call to the WinAPI function DrawEdge. I set both bitmaps to Transparent. I moved the bitmap generation to a sub procedure. Thus I got rid of about 20 LOC. That's negative … Continue reading Fake TSpeedButton based on a TBitBtn – updated
Fake TSpeedButton based on a TBitBtn
When you google for TSpeedButton and Focus a lot of hits are where people ask how to set the focus to a TSpeedButton and the answer of course is, that it isn't possible because TSpeedButton descends from TGraphicControl which does not have a window handle and therefore cannot receive the input focus. And that is … Continue reading Fake TSpeedButton based on a TBitBtn
Beware: IOTAComponent.GetPropValue needs 4 bytes for an enum
The ToolsAPI interface IOTAComponent declares two methods for getting property values: [delphi] IOTAComponent = interface(IUnknown) // [...] { Given the index or name, returns the property value. The untyped var must be large enough to hold the returned value. If the property is a descendant of TPersistent, the return value is a IOTAComponent. For properties … Continue reading Beware: IOTAComponent.GetPropValue needs 4 bytes for an enum
Clone a Linux system without imaging it
When I want to clone a Linux system (or the boot partition/drive of any operating system), I usually use Clonezilla and make a image of the boot disk or boot partition. Unfortunately those image files can become quite large and it is a pain in the lower back to restore them on a smaller hard … Continue reading Clone a Linux system without imaging it
Installing Webmin on Ubuntu 16.04 LTS (Xenial Xerus)
The instructions how to install Webmin on Debian (and thereby also Ubuntu) seem a bit outdated because edits to the file /etc/apt/sources.list should be replaced by adding a file to the directory /etc/apt/sources.list.d/. So, instead of adding deb https://download.webmin.com/download/repository sarge contrib to the file /etc/apt/sources.list create a new file /etc/apt/sources.list.d/webmin.list with that content and possibly … Continue reading Installing Webmin on Ubuntu 16.04 LTS (Xenial Xerus)