Raspberry Pi voordeel bundels. Raspberry Pi supersnel en gratis bij u thuisbezorgd! Want bij ons geldt; voor 16:00 besteld? Morgen in huis!
Author Archive
Raspberry Pi voordeel set | SosSolutions.nl
Posted by jpluimers on 2016/09/01
Posted in Development, Hardware Development, Raspberry Pi | Leave a Comment »
Delphi: Alt+Down Arrow is the keyboard shortcut for ellipsis buttons
Posted by jpluimers on 2016/09/01
Thanks Primož Gabrijelčič for reminding me on Stack Overflow that Alt + Down opens the dialogs behind ellipsis buttons in the Delphi IDE.
It’s the CUA and Windows short-cut to open drop-down lists (comboboxes) and for opening drop-down list for a property in the object inspector, but I never realised also would work for these ellipsis buttons.
This was my original stack-overflow question: Is there a keyboard shortcut for the ellipsis buttons of the Project Options in the Delphi IDE?
The Project Options in the Delphi IDE has a few option (like the
Search Path) each with an ellipsis button (the one on the right having only three dots...in the image below) to pop-up a dialog.What keyboard shortcut activates that button?
–jeroen
Posted in Delphi, Delphi 10 Seattle, Delphi 10.1 Berlin (BigBen), Delphi 2005, Delphi 2006, Delphi 2007, Delphi 2009, Delphi 2010, Delphi x64, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Delphi XE6, Delphi XE7, Delphi XE8, Development, Keyboards and Keyboard Shortcuts, Software Development | Leave a Comment »
Mercurial/Hg; syntax/tips for amend commit adding/reming files to latest (non-pushed) commit
Posted by jpluimers on 2016/09/01
Sometimes your latest commit isn’t what you intended. Fixing can be done, but isn’t always obvious hence these links:
- Until you do a pull,
hg diff -c tip, orhg tip -pgets you the diff of the latest local commit
via Mercurial: Easy way to see changes from last commit – Stack Overflow. hg commit --amendfile allows you to add/update a file to the latest commit.
via Mercurial: how to amend the last commit? – Stack Overflow.- Removing a file from the latest commit is a bit more tricky as it depends if the file is new, or existing. Example is below.
More details via Remove file from a commit in Mercurial – Stack Overflow. Examples
Remove a new file from a commit:
cp somefile.txt somefile.txt.bak
hg forget somefile.txt
hg commit --amend
If the file was new (i.e. you had used hg add).
If that file already existed try:
cp somefile.txt somefile.txt.bak
hg revert somefile.txt --rev .~1
hg commit --amend
cp somefile.txt.bak somefile.txt
–jeroen
Posted in Development, DVCS - Distributed Version Control, Mercurial/Hg, Software Development, Source Code Management | Leave a Comment »
Workaround for Printing from Delphi (or the Delphi IDE): three strikes and you get “Printer is not currently printing.” – yes I mentioned “Delphi 8!”
Posted by jpluimers on 2016/08/31
Recently when printing the 3rd time and up, you get this error in many Delphi programs and the Delphi IDE:
In the past this only occurred when you used a TPrinter and forgot to call BeginDoc.
But now it always occurs after reusing the same TPrinter instance for the 3rd time and up. Since the Delphi Galileo based IDEs (8 and higher; likely older ones as well: the source code printing hasn’t changed in a long time). The error actually occurs twice: after starting a source code print job, but also after cancelling the same failed source code print job.
The second error stroke me as odd, so I went searching for “printer is not currently printing” “IDE” leading to this stack overflow question: c++builder – Why is TPrinter (XE7) suddenly having problems today? – Stack Overflow [WayBack].
The pattern there is using the
Printer()function which has been the way the (un)official code examples have shown for ages (Delphi 2007 Printers.Printer Function [WayBack]; earlier examples like Delphi 7 [WayBack] usually in PDF files).Like in the Delphi 7 “5-32 Developer’s Guide” page example:
procedure TForm1.Button1Click(Sender: TObject); var r: TRect; i: Integer; begin with Printer do begin r := Rect(200,200,(Pagewidth - 200),(PageHeight - 200)); BeginDoc; Canvas.Brush.Style := bsClear; for i := 0 to Memo1.Lines.Count do Canvas.TextOut(200,200 + (i * Canvas.TextHeight(Memo1.Lines.Strings[i])), Memo1.Lines.Strings[i]); Canvas.Brush.Color := clBlack; Canvas.FrameRect(r); EndDoc; end; end;(Yes, that’s back in the D7 days when examples were still using with and not using try/finally statements for resource cleanup).
Actual cause and permanent fix
The printing problems are caused by various recent Windows updates part of MS16-098:
- KB3177725 MS16-098 may cause printer problems – Microsoft Community
- KB3176493 for Windows 10 and KB3177725 for Windows 7 broke printing in – Microsoft Community
Though MS16-098: Security update for Windows kernel-mode drivers: August 9, 2016 mentions the issue without a fix, KB3177725 in MS16-098: Description of the security update for Windows kernel-mode drivers: August 9, 2016 mentions both the issue and a permanent fix:
After you apply this security update and you print multiple documents in succession, the first two documents may print successfully. However, the third and subsequent documents may not print.
To resolve this issue, install update 3187022. For more information, click the following article number to view the article in the Microsoft Knowledge Base:
3187022 Print functionality is broken after any of the MS16-098 security updates are installed
This article describes printing issues that occur after any of the security updates that are described in Microsoft Security Bulletin MS16-098 are installed in Windows. You can fix these issues by installing the update that is described in this article. Before you install this update, check out the Prerequisites section.
This update applies to the following operating systems:
- Windows Server 2012 R2
- Windows 8.1
- Windows RT 8.1
- Windows Server 2012
- Windows Server 2008 R2 Service Pack 1 (SP1)
- Windows 7 SP1
- Windows Server 2008 Service Pack 2 (SP2)
- Windows Vista SP2
No solution for Windows 10 yet…
Until you install the fix: workarounds
For your own code (Thanks Remy Lebau for your answer), add this code for your BeginDoc call:
MyPrinter.Copies := MyPrinter.Copies;
You might want to keep including this in your code as you’re never sure when the end-users apply which Windows update.
For the Delphi IDE either:
- Press the “Setup…” button in the “Print Selection” dialog when printing source code, then “OK” in the “Print Setup” dialog:
- Uninstall the security updated marked in blue (Security Update for Microsoft Windows (KB3177725):

Security Update for Microsoft Windows (KB3177725)
–jeroen
Posted in Delphi, Delphi 10 Seattle, Delphi 10.1 Berlin (BigBen), Delphi 2006, Delphi 2007, Delphi 2009, Delphi 2010, Delphi 8, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Delphi XE6, Delphi XE7, Delphi XE8, Development, Software Development | 2 Comments »
UCL as a Delphi package name suffix – remember before the KSDev days?
Posted by jpluimers on 2016/08/31
A while ago, I noticed the UCL as a suffix in a few 3rd party Delphi package names.
It was from a version close to the very first FireMonkey release. FireMonkey is based on the OpenGL based VGScene (and in part DirectX based [WayBack] DXScene) which was bought form KSDev in 2011.
Contrary to VGScene and DXScene, the early versions of FireMonkey were buggy and when updating to a new version you had to cope with a lot of breaking interface changes. In Delphi XE2 for instance, there were two totally different implementations (FMX for Windows and OS X; FMI for iOS) that merged after Delphi XE3.
Around Delphi XE6 it became more stable and now – apart from some design issues I wish they had done differently – it is coming along sort of OK for Windows and for cross-platform development.
Compared to the VCL you have a lot less HiDPI issues but the designer is much more layered (which gives you the same design-time pain as WPF) and the default “Live Binding” is still buggy as hell (though if you use something like MVVM or roll your own UI bindings it becomes bearable).
A long time ago – during the Kylix era – Borland developed the cross-platform CLX library which – for the UI part – was based on Qt and ran on both Windows and Linux.
It looks like before the KSDev take over there seemed to be a UCL (would that have been for Universal Component Library or Universal Control Library?) as the name pops up in quite a few package names.
Browsing through the source code I could not find any hints so I really wonder what UCL was about. Was it again based on Qt (which compared to the Kylix era has become much more mature and has widespread use) or a different technology like LCL (given that in Delphi XE2 they used FreePascal to compile for iOS)? I rule out OpenGL as otherwise the VGScene acquisition would have been done a lot earlier.
–jeroen
Posted in Delphi, Delphi 10 Seattle, Delphi 10.1 Berlin (BigBen), Delphi 6, Delphi 7, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Delphi XE6, Delphi XE7, Delphi XE8, Development, FireMonkey, Kylix, OS X FMX, Software Development | Leave a Comment »
defunkt/gist – ruby gist gem to upload github gists from the console
Posted by jpluimers on 2016/08/31
Cool! No more copy-paste, just upload examples directory from the console through the Ruby gist gem:
The gist gem provides a gist command that you can use from your terminal to upload content to https://gist.github.com/.
Yes, you need Ruby and RubyGems. Deal with it (:
Of course there are more of these, see A list of Gist clients..
–jeroen
via: defunkt/gist.
Posted in Development, Ruby, Software Development | Leave a Comment »
Getting the internal TeeChart version numbers
Posted by jpluimers on 2016/08/30
Even though TeeChart uses a year and minor version number during installation, that’s not the only version number available or used.
For instance their bug reporting site bugs.teechart.net uses build versions.
They are easy to get for your product: just look at the units TeeConst, VCLTee.TeeConst or FMXTee.Constants having consts like these:
TeeChartVersion =String('9'); // Cast to String to force CPP *.hpp generation as AnsiString instead of AnsiChar
TeeProductName =String('2015');
TeeVCLMinorVersion ='.15'; // ie: '.01' '.02' , etc
TeeVCLBuildVersion ='150420'; //YYMMDD
TeeVCLBuildVersionInteger = 150420; // <-- Same as above as integer number
You probably get the drift:
TeeProductName.TeeVCLMinorVersionis what you see when installed.TeeVCLBuildVersionis what is on the bug report site.TeeChartVersionis in the package names.
It’s sort of documented as well: Steema Central • View topic – How to find TeeChart version number at runtime?
–jeroen
Posted in Uncategorized | Leave a Comment »
Cool little trick to show all the preset variables for your GCC/Clang compiler
Posted by jpluimers on 2016/08/30
Thanks David Berneda for sharing this a while ago:
Cool little trick to show all the preset variables for your GCC/Clang compiler:
clang -E -dM - < /dev/nullI’ve always wondered how to get these. Some are kind of surprising, especially since there are 320 of them, at least on my system.
On my system (Mavericks, I wish the sw_vers console tool would tell that): 170 lines.
Posted in Apple, C, C++, Development, Mac OS X / OS X / MacOS, OS X 10.9 Mavericks, Power User, Software Development | Leave a Comment »
4K/5K monitors: when your RDP session has small black bands limiting the height/width to 2048/4096 pixels
Posted by jpluimers on 2016/08/29
Just found out why on some Windows versions, the RDP sessions form my 4K monitor has some small black bands on top/bottom: older versions of Windows limit their RDP server to 4096 x 2048.
A 4K monitor will not hit the width limit (as 4K cheats: it is usually “just” 3840 pixels wide), but it does hit the height limitation (2160 is slightly more than 2048: you miss 112 pixels that show as two small black bands).
A 5K monitor is worse: it will hit both limits (5K does not cheat: at 5120 × 2880 it is exactly 5*1024 pixels wide) so you miss 124 pixels horizontally and a whopping 832 pixels vertically.
Don’t buy a 5K monitor yet if you do a lot of RDP work to older Windows versions.
The link below has a table listing various Windows versions, but it omits end-of-life versions so I’ve done some testing: Windows XP, Windows Vista, Windows Server 2003 and Windows Server 2003 R2 share the same limitations as Windows Server 2008 most likely because their latest service packs share the same RDP 6.1 version.
I updated this in the table:
Posted in 4K Monitor, 5K monitor, Displays, Hardware, Microsoft Surface on Windows 7, Power User, Windows, Windows 10, Windows 7, Windows 8, Windows 8.1, Windows 9, Windows Server 2003, Windows Server 2003 R2, Windows Server 2008, Windows Server 2008 R2, Windows Server 2012, Windows Server 2012 R2, Windows Vista, Windows XP | Leave a Comment »
certificate – What is a Pem file and how does it differ from other OpenSSL Generated Key File Formats? – Server Fault
Posted by jpluimers on 2016/08/29
The canonical answer on extensions and formats like csr, pem, key, pkcs12, pfx, p12, der, cet, cer, crt, p7b, crl, PEM, PKCS7, PKCS12, PKCS10, DER, text, binary, ASN1: certificate – What is a Pem file and how does it differ from other OpenSSL Generated Key File Formats? – Server Fault.
Oh and it contains some openssl conversion tips as well, though this link has more: DER vs. CRT vs. CER vs. PEM Certificates and How To Convert Them.
–jeroen
Posted in Encryption, OpenSSL, Power User, Security | Leave a Comment »










