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 1,860 other subscribers

linux – How do I increase the scrollback buffer in a running screen session – Stack Overflow

Posted by jpluimers on 2016/09/04

The man page explains that you can enter command line mode in a running session by typing Ctrl+A, :, then issuing the scrollback <num> command.

Source: linux – How do I increase the scrollback buffer in a running screen session – Stack Overflow

Posted in Uncategorized | Leave a Comment »

Lock screen dialer shortcut gone in 6.0 – Android Forums at AndroidCentral.com

Posted by jpluimers on 2016/09/02

Solution:

  1. Go to Settings
  2. Click Apps
  3. Click
  4. Gear Icon
  5. Click Default Apps
  6. Click Assist & voice input
  7. Click Assist app.
  8. Changing that to None instead of Google App puts the dialer shortcut back on the lock screen, but it also disables long pressing the home button to launch the Google App/Now.

–jeroen

Source: Lock screen dialer shortcut gone in 6.0 – Android Forums at AndroidCentral.com

Posted in Android Devices, OnePlus Two, Power User | Leave a Comment »

tf: show changeset details on the console

Posted by jpluimers on 2016/09/02

By default the changeset command in tf.exe shows a dialog showing a list of all files in that changeset.
I wanted that list to be dumped on the console for further processing.

Luckily there is a /noprompt option for that:

call "%~dp0tf.bat" changeset /noprompt %*

The above tf-show-changeset-details-on-console.bat batch file uses tf.bat that hunts for the location of tf.exe.

–jeroen

Posted in .NET, Development, Software Development, Source Code Management, TFS (Team Foundation System) | Leave a Comment »

Raspberry Pi voordeel set | SosSolutions.nl

Posted by jpluimers on 2016/09/01

Raspberry Pi voordeel bundels. Raspberry Pi supersnel en gratis bij u thuisbezorgd! Want bij ons geldt; voor 16:00 besteld? Morgen in huis!

Source: Raspberry Pi voordeel set | SosSolutions.nl

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?

Project Options with ellipsis button

–jeroen

Via: Object Inspector Keyboard Shortcuts – RAD Studio

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:

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:

Printer is not currently printing.

Printer is not currently printing.

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:

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:

  1. Press the “Setup…” button in the “Print Selection” dialog when printing source code, then “OK” in the “Print Setup” dialog:
    Print Selection dialog

    Print Selection dialog

    “Print Setup” dialog.

  2. Uninstall the security updated marked in blue (Security Update for Microsoft Windows (KB3177725):

    Security Update for Microsoft Windows (KB3177725)

    Security Update for Microsoft Windows (KB3177725)

–jeroen

Read the rest of this entry »

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.TeeVCLMinorVersion is what you see when installed.
  • TeeVCLBuildVersion is what is on the bug report site.
  • TeeChartVersion is 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 »