You find a lot of stuff when you are reorganizing your office #TP6 Library….
I must clean out my closets as well. I think I have similar stuff lying around.
–jeroen

Posted by jpluimers on 2016/02/11
You find a lot of stuff when you are reorganizing your office #TP6 Library….
I must clean out my closets as well. I think I have similar stuff lying around.
–jeroen

Posted in Delphi, Development, History, Software Development, Turbo Pascal | Leave a Comment »
Posted by jpluimers on 2016/02/10
Thanks User Josh Close – Stack Overflow. for answering the below on Stack Overflow: it got my Resharper Alt-Enter key workign again.
Re-apply Visual Studio keyboard scheme:
- (VS2013 latest ReSharper)
- ReSharper > Options > Environment > Keyboard & Menus > ReSharper Platform keyboard scheme: Visual Studio > Apply Scheme > Save.
- This will reset the shortcut keys for ReSharper.
- (older versions)
- ReSharper > Options > Environment > General > Visual Studio Integration > Apply
–jeroen
via: visual studio – Resharper Alt Enter not working – Stack Overflow.
Posted in .NET, C#, Development, Keyboards and Keyboard Shortcuts, Power User, Software Development, Visual Studio 2013, Visual Studio and tools | Leave a Comment »
Posted by jpluimers on 2016/02/09
Interview with by Andrew Hunt and David Thomas, the authors of The Pragmatic Programmer: From Journeyman to Master.
Many interesting quotes including:
Most people take DRY to mean you shouldn’t duplicate code. That’s not its intention. The idea behind DRY is far grander than that.
–jeroen
Posted in Agile, Development, DRY, Software Development | Leave a Comment »
Posted by jpluimers on 2016/02/04
I wrote about this before, named it a cardinal sin too, but I seem to have to repeat this:
When your product thinks the license is validate and quits without allowing the customer to save its work, then you’ve committed a cardinal sin.
Yes, I can talk about cardinal sins: I’ve been named after the artist Hieronymus Bosch (:
For me it is OK if a product checks for binaries that do not to the product (and not signed by the vendor) in the product directories and fails to start, or to present a nag screen that takes a while to disappear, or even to limit functionality.
But:
Given some recent posts and the fact that over the course of 10 different versions I lost days of work and at conferences I usually get multiple questions from people having suffered from this, I really had to bring this up again.
Posted in Delphi, Development, Licensing, Software Development | 7 Comments »
Posted by jpluimers on 2016/02/04
Back in the late 80s and early 90s of last century, engineers Richard E. Berry, Cliff J. Reeves set a standard that still influences the user interfaces and user experience of today: the IBM Common User Access.
I mentioned CUA a few times before, but since an old client of mine managed to throw away their paper originals in a “we don’t need that old stuff any more as we are now all digital” frenzy, I wanted to locate some PDFs. And I promised to write more about CUA.
If anyone has printed versions of the non-PDF documents below, please donate them to aek at bitsavers.org or scanning at archive.org as they are really hard to get.
A few search queries I used:
The PDFs I think are most interesting:
Posted in BitSavers.org, Development, Hardware, History, IBM SAA CUA, Keyboards and Keyboard Shortcuts, KVM keyboard/video/mouse, Power User, Software Development, UI Design, Usability, User Experience (ux) | 3 Comments »
Posted by jpluimers on 2016/02/03
A while ago I bumped into this: As of Windows 7 (and probably Vista), the standard Windows Common Item (Open and Save) Dialogs expect the main thread to be initialised with STA because it is easier to support apartment threading in single-threaded apartments because COM provides synchronization on a per-call basis and the Windows GUI APIs are not guaranteed to be thread safe.
Windows XP and Server 2003 didn’t enforce this for the classic Windows Open and Save Dialogs, so it only appeared when the software below got run on Windows 7 in a way too late time frame (but the market share of XP is still high).
The reason is that when using Delphi, the TOpenDialog and TSaveDialog will use the classic Open and Save Dialogs on Windows < Vista and fall-forward to the new Common Item Dialogs handled by TFileOpenDialog and TFileSaveDialog (both will not fall backward).
When you have your COM initialisation done wrong, your application appears to hang. Amidst the plethora of threads started by the COM subsystem, these two dead-lock:
Posted in Delphi, Delphi 10 Seattle, Delphi 2007, Delphi 2009, Delphi 2010, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Delphi XE6, Delphi XE7, Delphi XE8, Development, Software Development | 2 Comments »
Posted by jpluimers on 2016/02/03
Every once in a while, I need to see which EXE paths.
In [Wayback/Archive] this particular case, I wanted to see which [Wayback/Archive] Spring.Tests unit tests instances of [Wayback/Archive] Spring4D were running.
This case I needed to see which DevEnv were running (because somehow I got my .csproj bindings wrong).
Since [Wayback/Archive] tasklist nor [Wayback/Archive] pslist would cut it, I wrote two small batch files:
[Wayback/Archive] list-running-processes.bat:
| :: http://technet.microsoft.com/en-us/library/hh849832.aspx | |
| PowerShell Get-Process |
[Wayback/Archive] get-Full-Exe-Path-of-a-Running-Process.bat:
@echo off :: http://superuser.com/questions/768984/show-exe-path-of-running-processes-on-the-command-line-in-windows if [%1] == [] goto :help PowerShell Get-Process %* ^| Format-List Path goto :eof :help echo Syntax: echo %0 ProcessName echo Shows the full EXE paths of any running process with the ProcessName name. echo Example: echo %0 DevEnv echo Shows the paths of running Visual Studio processes
PowerShell to the rescue here: Both batch files use the PowerShell [Wayback/Archive] Get-Process cmdlet.
First I used [Wayback/Archive] Get-Member to see what Get-Process could return:
PowerShell Get-Process ^| Get-Member
Then I [Wayback/Archive] filtered the Path from Get-Process to figure out which Spring.Tests processes were running:
PowerShell Get-Process Spring.Tests ^| Format-List Path
resulting in:
Path : C:\Users\Developer\Versioned\Spring4D\Tests\Bin\DelphiXE\Spring.Tests.exe
The second batch file escapes the pipe (|) by using a carret (^), so it is passed from the command-line to PowerShell.
–jeroen
Posted in CommandLine, Development, PowerShell, Software Development | 2 Comments »
Posted by jpluimers on 2016/02/02
The interwebs is full of posts telling about how to create file and directory junctions**.
But there is little information about removing them and even less being correct: some suggest to del a directory junction (which just deletes everything in it but the junction).
Finally there is little information about listing all junctions, so lets start with that:
Deleting a link depends on the kind of link, not the kind of source.
Since symlink and hardlinks are for files, and directory symlink and junctions are for directories, this is how:
SysInternals – I wrote about them before – has a great junction tool. It can be used to create, delete and (optionally recursively) list reparse points. All usages allow for file and directory junctions.
This is about the **: actually they are reparse points; for files they are symlinks, for directories mostly junctions, but sometimes symlinks.
And actually the reason I wrote this blog post. As you also have hardlinks. Some combinations of files and directories with these kinds of links fail.
Lets first go to see what kind of links there are on a fresh Windows system.
This is the only directory symlink: C:\Users\All Users and junction will show it like this:
.\\?\C:\\Users\All Users: SYMBOLIC LINK Print Name : C:\ProgramData Substitute Name: \??\C:\ProgramData
It is unlike this directory junction C:\Users\Default User which junction will show as this:
\\?\C:\\Users\Default User: JUNCTION Print Name : C:\Users\Default Substitute Name: C:\Users\Default
Together with C:\Users\Default and C:\Users\desktop.ini they are hidden, so you need the /AH flag to show them using DIR (as a gist, since WordPress still screws up less than and greater than):
When you look at the examples below, it is odd to see that C:\Users\All Users is a SYMLINK and not a SYMLINKD as it points to a directory.
And yes, there are not so and very subtle differences between SYMLINKD and JUNCTION.
The examples are hopefully more complete than the complete guide.
Since symlinks are client side created and not verified until use, you can actually use mklink to create both file and directory symbolic links for a file. DIR shows them as SYMLINK or SYMLINKD.
A SYMLINK to a file actually works, but a SYMLINKD or JUNCTION to a file gives you an Access Denied error. Hardlinks get the attributes of the source (so delete hidden hardlinks using the DEL /AH option).
Example batch file:
| pushd %public% | |
| cd .. | |
| mklink desktop.ini.link desktop.ini | |
| dir desktop.ini.link | findstr desktop.ini.link | |
| type desktop.ini.link | |
| del desktop.ini.link | |
| mklink /D desktop.ini.link desktop.ini | |
| dir desktop.ini.link | findstr desktop.ini.link | |
| type desktop.ini.link | |
| del desktop.ini.link | |
| rd desktop.ini.link | |
| mklink /J desktop.ini.link desktop.ini | |
| dir desktop.ini.link | findstr desktop.ini.link | |
| type desktop.ini.link | |
| del desktop.ini.link | |
| rd desktop.ini.link | |
| mklink /H desktop.ini.link desktop.ini | |
| dir /ah desktop.ini.link | findstr desktop.ini.link | |
| type desktop.ini.link | |
| del /ah desktop.ini.link | |
| rd desktop.ini.link | |
| popd |
Example output:
| C:\Windows\Temp>pushd %public% | |
| C:\Users\Public>cd .. | |
| C:\Users> | |
| C:\Users>mklink desktop.ini.link desktop.ini | |
| symbolic link created for desktop.ini.link <<===>> desktop.ini | |
| C:\Users>dir desktop.ini.link | findstr desktop.ini.link | |
| 04/05/2015 07:04 PM <SYMLINK> desktop.ini.link [desktop.ini] | |
| C:\Users>type desktop.ini.link | |
| [.ShellClassInfo] | |
| LocalizedResourceName=@%SystemRoot%\system32\shell32.dll,-21813 | |
| C:\Users>del desktop.ini.link | |
| C:\Users> | |
| C:\Users>mklink /D desktop.ini.link desktop.ini | |
| symbolic link created for desktop.ini.link <<===>> desktop.ini | |
| C:\Users>dir desktop.ini.link | findstr desktop.ini.link | |
| File Not Found | |
| Directory of C:\Users\desktop.ini.link | |
| C:\Users>type desktop.ini.link | |
| Access is denied. | |
| C:\Users>del desktop.ini.link | |
| The directory name is invalid. | |
| C:\Users>rd desktop.ini.link | |
| C:\Users> | |
| C:\Users>mklink /J desktop.ini.link desktop.ini | |
| Junction created for desktop.ini.link <<===>> desktop.ini | |
| C:\Users>dir desktop.ini.link | findstr desktop.ini.link | |
| File Not Found | |
| Directory of C:\Users\desktop.ini.link | |
| C:\Users>type desktop.ini.link | |
| Access is denied. | |
| C:\Users>del desktop.ini.link | |
| The directory name is invalid. | |
| C:\Users>rd desktop.ini.link | |
| C:\Users> | |
| C:\Users>mklink /H desktop.ini.link desktop.ini | |
| Hardlink created for desktop.ini.link <<===>> desktop.ini | |
| C:\Users>dir /ah desktop.ini.link | findstr desktop.ini.link | |
| 08/22/2013 05:34 PM 174 desktop.ini.link | |
| C:\Users>type desktop.ini.link | |
| [.ShellClassInfo] | |
| LocalizedResourceName=@%SystemRoot%\system32\shell32.dll,-21813 | |
| C:\Users>del /ah desktop.ini.link | |
| C:\Users>rd desktop.ini.link | |
| The system cannot find the file specified. | |
| C:\Users> | |
| C:\Users>popd | |
| C:\Windows\Temp> |
When you try this for directories, you are in for a few small surprises.
A SYMLINK to a directory neither works as file nor as directory. A SYMLINKD or JUNCTION to a directory works. Hardlinks don’t work for directories with reason: limit the risk of cycles.
Example batch file:
| pushd %public% | |
| cd .. | |
| mklink desktop.ini.link desktop.ini | |
| dir desktop.ini.link | findstr desktop.ini.link | |
| type desktop.ini.link | |
| del desktop.ini.link | |
| mklink /D desktop.ini.link desktop.ini | |
| dir desktop.ini.link | findstr desktop.ini.link | |
| type desktop.ini.link | |
| del desktop.ini.link | |
| rd desktop.ini.link | |
| mklink /J desktop.ini.link desktop.ini | |
| dir desktop.ini.link | findstr desktop.ini.link | |
| type desktop.ini.link | |
| del desktop.ini.link | |
| rd desktop.ini.link | |
| mklink /H desktop.ini.link desktop.ini | |
| dir /ah desktop.ini.link | findstr desktop.ini.link | |
| type desktop.ini.link | |
| del /ah desktop.ini.link | |
| rd desktop.ini.link | |
| popd |
Example output:
| C:\Windows\Temp>pushd %public% | |
| C:\Users\Public>cd .. | |
| C:\Users> | |
| C:\Users>mklink desktop.ini.link desktop.ini | |
| symbolic link created for desktop.ini.link <<===>> desktop.ini | |
| C:\Users>dir desktop.ini.link | findstr desktop.ini.link | |
| 04/05/2015 07:04 PM <SYMLINK> desktop.ini.link [desktop.ini] | |
| C:\Users>type desktop.ini.link | |
| [.ShellClassInfo] | |
| LocalizedResourceName=@%SystemRoot%\system32\shell32.dll,-21813 | |
| C:\Users>del desktop.ini.link | |
| C:\Users> | |
| C:\Users>mklink /D desktop.ini.link desktop.ini | |
| symbolic link created for desktop.ini.link <<===>> desktop.ini | |
| C:\Users>dir desktop.ini.link | findstr desktop.ini.link | |
| File Not Found | |
| Directory of C:\Users\desktop.ini.link | |
| C:\Users>type desktop.ini.link | |
| Access is denied. | |
| C:\Users>del desktop.ini.link | |
| The directory name is invalid. | |
| C:\Users>rd desktop.ini.link | |
| C:\Users> | |
| C:\Users>mklink /J desktop.ini.link desktop.ini | |
| Junction created for desktop.ini.link <<===>> desktop.ini | |
| C:\Users>dir desktop.ini.link | findstr desktop.ini.link | |
| File Not Found | |
| Directory of C:\Users\desktop.ini.link | |
| C:\Users>type desktop.ini.link | |
| Access is denied. | |
| C:\Users>del desktop.ini.link | |
| The directory name is invalid. | |
| C:\Users>rd desktop.ini.link | |
| C:\Users> | |
| C:\Users>mklink /H desktop.ini.link desktop.ini | |
| Hardlink created for desktop.ini.link <<===>> desktop.ini | |
| C:\Users>dir /ah desktop.ini.link | findstr desktop.ini.link | |
| 08/22/2013 05:34 PM 174 desktop.ini.link | |
| C:\Users>type desktop.ini.link | |
| [.ShellClassInfo] | |
| LocalizedResourceName=@%SystemRoot%\system32\shell32.dll,-21813 | |
| C:\Users>del /ah desktop.ini.link | |
| C:\Users>rd desktop.ini.link | |
| The system cannot find the file specified. | |
| C:\Users> | |
| C:\Users>popd | |
| C:\Windows\Temp> |
–jeroen
Posted in Batch-Files, Development, Scripting, Software Development | 2 Comments »
Posted by jpluimers on 2016/01/31
Awesome read on bash Coding Style · drwetter/testssl.sh Wiki
Posted in bash, Development, Scripting, Software Development | Leave a Comment »
Posted by jpluimers on 2016/01/28
As part of some TFS related posts, I wrote about Find an installed tf.exe, then run it with the command-line parameters specified.
Below are some more batch files related to this. In each batch file, you can replace tf with call "%~dp0tf.bat" so the above batch file is executed first.
Posted in Batch-Files, Development, Scripting, Source Code Management, TFS (Team Foundation System) | Leave a Comment »