Let's say you have a directory of backups looking like this: .\ \-> user1\ \-> [date1]_[time1] \-> [date2]_[time2] \-> some more sub directories with date and time in the name \-> user2\ \-> [date3]_[time3] \-> [date4]_[time4] \-> some more sub directories with date and time in the name \-> some more user sub directories Where … Continue reading Deleting old backups
My improved version of IMAPCopy
IMAPcopy is a tool written by Armin Diehl. Its purpose is to copy emails from one IMAP server to another (or from one IMAP account to another) including the folder hierarchy and even the read status. It's a command line program written in Delphi and fpc. Since I am currently migrating a mail server I … Continue reading My improved version of IMAPCopy
Extended = Double in Lazarus Win64
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
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