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

Archive for June, 2020

How to Merge Folders on Mac OS X Without Losing All Your Files (Seriously)

Posted by jpluimers on 2020/06/22

And still the UI has not improved:

The default folder-merge behavior in Mac OS X is to erase the existing folder, deleting all its files rather than offering to merge them intelligently. Windows and Linux file managers have offered folder-merging for decades, but Macs still don’t.

[WayBack]How to Merge Folders on Mac OS X Without Losing All Your Files (Seriously)

Via: [WayBack] Yes, you’re reading that right — try to merge a folder like you would on Windows or Linux and you’ll lose all the old folder’s files if you click Replace… – Roderick Gadellaa – Google+

–jeroen

Posted in Apple, Mac, Mac OS X / OS X / MacOS, Power User | Leave a Comment »

Linux Containers – LXD – Try it online

Posted by jpluimers on 2020/06/22

Cool: live container for some 20 minutes usage at [WayBack/Archive.is] Linux Containers – LXD – Try it online.

Via: [WayBack] New European Data Protection Law coming soon! Beginning with May, 25 you’re no longer allowed to host private data outside the EC, e.g. in the U.S. or … – Joe C. Hecht – Google+

–jeroen

Posted in Cloud, Containers, Infrastructure | Leave a Comment »

“This app can’t run on your PC – To find a version for your PC, check with the software publisher.”

Posted by jpluimers on 2020/06/19

I had a problem running wmic. It was no a Dutch Windows 10, but the same will happen with any locale, so in English the error looks like this:

This app can't run on your PC

To find a version for your PC, check with the software publisher.

After which you get this on the command-line:

Access is denied.

In the Dutch version, the error is called this:

Deze app kan niet worden uitgevoerd op uw pc

Vraag bij de software-uitgever na of er een versie bestaat voor uw pc.

After which you get this on the command-line:

Toegang geweigerd.

Apparently, an executable is now an app, and PC is uppercase in English, but not in Dutch. I digress.

The un-cool thing is that [WayBack] Process Monitor – Windows Sysinternals | Microsoft Docs showed no Access Denied message at all.

What happened however, was that there was an empty %SystemRoot%\System32\wmic.exe, which gets executed because %SystemRoot%\System32 is earlier on the path than C:\Windows\System32\wbem\WMIC.exe.

Note that %SystemRoot% seems to be the new %windir%.

You can reproduce this by doing this on a command prompt window:

cd %temp%

rem > wmic.exe

wmic

The rem will create an empty wmic.exe. Because on Windows, the current directory is always on the path, it tries to execute the empty wmic.exe, which causes the error.

Do not run an administrative in the default %SystemRoot%\System32 directory

The actual cause was a combination of this:

  1. When running cmd as Administrator, it starts in %SystemRoot%\System32
  2. %SystemRoot%\System32 is early on the path
  3. Copy/Paste through a remote desktop connection is unreliable
  4. I copied a big bunch of output from the RDP session to my host to write some documentation
  5. I copied a new command from the host to run in the Administrative cmd
  6. What got pasted instead was the output, which created these empty files (which has some typos, I know) because output is of the form C:\path>filename:

    C
    conrol
    control
    defrag
    del
    Disable-ComputerRestore
    exit
    Get-ComputerRestorePoint
    net
    powercfg
    powershell
    powrcfg
    SystemProperties.exe
    vssadmin
    wmic
    wmic.exe

  7. I did not notice these files were created in  %SystemRoot%\System32

–jeroen

Posted in Power User, Windows, Windows 10 | Leave a Comment »

Computing History – The UK Computer Museum – Cambridge

Posted by jpluimers on 2020/06/19

On my places to visit:

The Centre for Computing History is a computer museum based in Cambridge, UK. With a collection of vintage computers and game consoles, many of the exhibits are hands on and interactive.

[WayBackComputing History – The UK Computer Museum – Cambridge.

When I bumped into it, this was their collection size, ranging from the 1960s until recent history:

Archive Statistics :

  • Computers = 993
  • Peripherals = 1446
  • Mobile Devices = 31
  • Game Consoles = 213
  • Video Games = 10259
  • Software Packages = 2605
  • Books = 2045
  • Manuals = 4106
  • Magazines = 9057

Looking at their archived brands (having [WayBack] MITS – Altair and [WayBack] Raspberry Pi in the collection) is such a joy.

Archiving the older parts is a tough job, as they stem from way before the web era, so information has been lost, parts are hard to source, a lot of hardware got thrown away or is hard to find at all, people have died. More on that at [WayBack] About – Computing History.

Without a physical visit, you can find what they have at [WayBack] Search Our Archive – Computing History.

The video below on their archive is impressive.

–jeroen

Read the rest of this entry »

Posted in 6502, 68k, Apple I, BBC Micro B, BBS, C64, Commodore, CP/M, dial-up modems, FidoNet, History, IBM SAA CUA, PowerPC, Tesseract, VIC-20, Z80 | Leave a Comment »

Creating a properly aligned partition with parted – twm’s blog

Posted by jpluimers on 2020/06/19

I like the deceptively simple, if you remind that percent signs are the way to go for GNU parted (not to be confused with gparted which is Gnome parted).

At [WayBack] Creating a properly aligned partition with parted – twm’s blog:

mkpart /dev/somedevice ext4 0% 100%

It gets rid of the dreaded “The resulting partition is not properly aligned for best performance”.

References:

Via: [WayBack] Parted is a flexible tool for working with partition tables under Linux. Unfortunately it sometimes seems rather stupid… – Thomas Mueller (dummzeuch) – Google+

–jeroen

Posted in *nix, *nix-tools, parted, Power User | Leave a Comment »

tfs – How to retrieve the hash for the current commit in Git? – Stack Overflow

Posted by jpluimers on 2020/06/18

Based on [WayBack] tfs – How to retrieve the hash for the current commit in Git? – Stack Overflow

Get current hash:

git rev-parse HEAD

Show summary of current commit, including hash:

git show --summary

Show all hashes of all branches (both in heads and in remotes) and tags:

git show-ref

Get current hash with a * marking if it is dirty:

git describe --always --abbrev=0 --match "NOT A TAG" --dirty="*"

The last one was [WayBack] answered by [WayBack] Rado:

display the full sha1 of the commit, but append an asterisk to the end if the working directory is not clean. …

Here is the one liner that does:
git describe --always --abbrev=0 --match "NOT A TAG" --dirty="*"
Result: f5366ccb21588c0d7a5f7d9fa1d3f85e9f9d1ffe*

Explanation: describes (using annotated tags) the current commit, but only with tags containing “NOT A TAG”. Since tags cannot have spaces, this never matches a tag and since we want to show a result --always, the command falls back displaying the full (--abbrev=0) sha1 of the commit and it appends an asterisk if the working directory is --dirty.

–jeroen

Posted in Development, DVCS - Distributed Version Control, git, Software Development, Source Code Management | Leave a Comment »

Delphi Exception handling code review reminders

Posted by jpluimers on 2020/06/18

I bumped into [WayBack]When an exception is nil in the exception handler – twm’s blog for some legacy code a while ago.

Some code review reminders:

  • raise Exception( is always wrong: no exception instance is created
  • Exception.Create( without a raise is wrong most of the times
  • except end is almost always wrong
  • except and finally in encompassing blocks often is a code smell

I need to check which ones are caught by [WayBack] Code Analysis Tool | FixInsight for Delphi (which is now at [WayBack] TMS Software | VCL, FMX, ASP.NET, .NET controls & components for Delphi, C++Builder & Visual Studio | TMS FixInsight Pro.)

--jeroen

Posted in Conference Topics, Conferences, Delphi, Development, Event, Software Development | Leave a Comment »

Lisette Sutherland: Work Together Anywhere | Lisette Sutherland | TEDxKaunas

Posted by jpluimers on 2020/06/18

[WayBack] TEDx Kaunas, 19 November 2017 – Lisette Sutherland:

“Remote workers aren’t trying to escape doing work. We’re trying to escape the Day Prison. We want to use technology to make better use of our time. We want to spend more time on things that matter to us and less time stuck in traffic.“

The site has the original transcript on the below video: Work Together Anywhere | Lisette Sutherland | TEDxKaunas.

Via: [WayBack] “People think that they want to be in the same place. But what they really want is fast communication” – Work Together Anywhere | Lisette Sutherland … – Marjan Venema – Google+

–jeroen

Read the rest of this entry »

Posted in Agile, Development, Software Development | Leave a Comment »

Chr equivalent for Unicode in Delphi 7 – Stack Overflow

Posted by jpluimers on 2020/06/17

From a long time ago: [WayBackchr equivalent for Unicode in Delphi 7 – Stack Overflow answered by David Heffernan:

Q

I need to initialize a Widestring in Delphi 7 but I can’t use chrfunction which is ANSI

var
  ws : Widestring;
begin

 ws := chr($FFFF) + chr($FFFF) + chr($FFFF);

end;

What can I use, then ?

A

I’m not sure there’s a simply way to do what you wish. You can convert a Word into a WideChar with a simple cast:

WideChar($FFFF)

but you cannot concatenate WideChar. So this is a compiler error:

WideChar($FFFF) + WideChar($FFFF)

You could use a helper function to get the job done:

function InitialiseWideString(const chars: array of Word): WideString;
var
  i: Integer;
begin
  SetLength(Result, Length(chars));
  for i := 0 to high(chars) do
    Result[i+1] := WideChar(chars[i]);
end;

Then you can call it like this:

ws := InitialiseWideString([$0054, $0069, $006D, $0065, $0020, $0074, $006F, 
  $0020, $0075, $0070, $0067, $0072, $0061, $0064, $0065]);

–jeroen

Posted in Delphi, Delphi 7, Development, History, Software Development | 3 Comments »

Dynamically instantiating instances in Delphi without knowing their full type is hard

Posted by jpluimers on 2020/06/17

For my reading list: [WayBack] So am working on a particular .NET project and came across NewtonSoft JSON.NET Serializer, it allows you serialize Collections such as a generic list an… – Ugochukwu Mmaduekwe – Google+:

Stefan Glienke:
Serializing and mostly deserializing generics in Delphi is a major PITA because we don’t have such capabilities to dynamically work with them like in C# where you can easily create new generic lists at runtime where you don’t know the precise type T at compile time.

–jeroen

 

Posted in .NET, C#, Delphi, Development, Software Development | Leave a Comment »