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 March, 2019

Some notes on loosing performance because of using AVX

Posted by jpluimers on 2019/03/20

It looks like AVX can be a curse most of the times. Below are some (many) links that lead me to this conclusion, based on a thread started by Kelly Sommers.

My conclusion

Running AVX instructions will affect the processor frequency, which means that non-AVX code will slow down, so you will only benefit when the gain of using AVX code outweighs the non-AVX loss on anything running on that processor in the same time frame.

In practice, this means you need to long term gain from AVX on many cores. If you don’t, then the performance penalty on all cores, including the initial AVX performance, will degrade, often a lot (dozens of %).

Tweets and pages linked by them

Kelly raised a bunch of interesting questions and remarks because of the above:

I collected the above links because of [WayBack] GitHub – maximmasiutin/FastMM4-AVX: FastMM4 fork with AVX support and multi-threaded enhancements (faster locking), where it is unclear which parts of the gains are because of AVX and which parts are because of other optimizations. It looks like that under heavy loads on data center like conditions, the total gain is about 30%. The loss for traditional processing there has not been measured, but from the above my estimate it is at least 20%.

Full tweets below.

Read the rest of this entry »

Posted in Assembly Language, Development, Software Development, x64, x86 | Leave a Comment »

Keep a Changelog

Posted by jpluimers on 2019/03/20

Lot’s of tips (and translations!) on how to Keep a Changelog [WayBack].

There are lots of useful tips, ranging from content (how to write, what to include) to technicalities (order of entries, unreleased, version numbering, date format) that might seem unimportant but in practice makes using the changelog.

The really cool thing: the site has a changelog of itself showing the best practices.

via:

–jeroen

Posted in Development, Documentation Development, Encryption, Let's Encrypt (letsencrypt/certbot), Security, Software Development | Leave a Comment »

During git mv (rename): “unable to unlink old” “invalid argument”

Posted by jpluimers on 2019/03/20

I had an error when doing a rename (mv) in git “unable to unlink old” “invalid argument”. This appeared to be a process having a lock on that file.

In my case, this was a bit hard to track down (I used Process Explorer for it), as the culprit was SourceTree running git in the background to keep an eye on changes in the repository because it has a file system watcher on the repository tree and a different process was writing log files in the same directory structure.

Can you still follow? I had a hard time so here it is in manageable bits:

  1. By default SourceTree has a file system watcher on your repositories
  2. If that watcher fires, SourceTree runs a background git process to get the current state of the repository
  3. If you perform UI actions, SourceTree runs a foreground git process to perform the action
  4. SourceTree does not have a mechanism to wait for the background git process to finish before running the foreground process
  5. I had had another process running that logged into a relative directory that happened to be within the repository tree (but using files excluded by .gitignore)

Basically SourceTree should do two things:

  • keep track of the background process and not fire a foreground one
  • do not start the background process for files excluded by .gitignore

I tracked down what happened using these tips:

–jeroen

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

How can I open a cmd window in a specific location? – Stack Overflow

Posted by jpluimers on 2019/03/19

Based on [WayBack] How can I open a cmd window in a specific location? – Stack Overflow:

cmd /K "pushd ""D:\Versioned Stuff\wiert.me"""

The quoting is required for paths having spaces, so I always include them just in case I ever have a path with spaces.

If I want it with bash, then I run it as follows:

cmd /K "pushd ""D:\Versioned Stuff\wiert.me""" && "C:\Program Files\Git\bin\bash.exe"

Documentation: [WayBack] CD Change Directory – Windows CMD – SS64.com

–jeroen

Posted in CommandLine, Console (command prompt window), Development, Power User, Software Development, Windows | Leave a Comment »

openssl: checking out RSA private key files in .rsa and .pem format

Posted by jpluimers on 2019/03/19

While checking out an issue with the SSH server for ContinuaCI issue (see info below), I wanted to look at the files leading to the issue: .pem and .rsa files with the private key for the SSH server.

So I browsed through my series of openssl related articles to see if I already had made a script better explaining the cryptic openssl command-line parameters. I didn’t have it yet, but it turned out to be really simple:

C:\ProgramData\VSoft\ContinuaCI\SSHD>"C:\Program Files (x86)\Git\usr\bin\openssl.exe" rsa -in server_keypair.rsa
writing RSA key
-----BEGIN RSA PRIVATE KEY-----
...
-----END RSA PRIVATE KEY-----
C:\ProgramData\VSoft\ContinuaCI\SSHD>"C:\Program Files (x86)\Git\usr\bin\openssl.exe" rsa -in server_keypair.rsa -text
Private-Key: (1024 bit)
modulus:
    ..:..:..:.....
publicExponent: 35 (0x23)
privateExponent:
    ..:..:..:.....
prime1:
    ..:..:..:.....
prime2:
    ..:..:..:.....
exponent1:
    ..:..:..:.....
exponent2:
    ..:..:..:.....
coefficient:
    ..:..:..:.....
writing RSA key
-----BEGIN RSA PRIVATE KEY-----
...
-----END RSA PRIVATE KEY-----
C:\ProgramData\VSoft\ContinuaCI\SSHD>"C:\Program Files (x86)\Git\usr\bin\openssl.exe" rsa -in server_keypair.pem
Enter pass phrase for server_keypair.pem:
unable to load Private Key
2675996:error:06065064:digital envelope routines:EVP_DecryptFinal_ex:bad decrypt:evp_enc.c:529:
2675996:error:23077074:PKCS12 routines:PKCS12_pbe_crypt:pkcs12 cipherfinal error:p12_decr.c:108:
2675996:error:2306A075:PKCS12 routines:PKCS12_item_decrypt_d2i:pkcs12 pbe crypt error:p12_decr.c:139:
2675996:error:0907B00D:PEM routines:PEM_READ_BIO_PRIVATEKEY:ASN1 lib:pem_pkey.c:141:
C:\ProgramData\VSoft\ContinuaCI\SSHD>"C:\Program Files (x86)\Git\usr\bin\openssl.exe" rsa -in server_keypair.pem -passin pass:password
unable to load Private Key
2675996:error:06065064:digital envelope routines:EVP_DecryptFinal_ex:bad decrypt:evp_enc.c:529:
2675996:error:23077074:PKCS12 routines:PKCS12_pbe_crypt:pkcs12 cipherfinal error:p12_decr.c:108:
2675996:error:2306A075:PKCS12 routines:PKCS12_item_decrypt_d2i:pkcs12 pbe crypt error:p12_decr.c:139:
2675996:error:0907B00D:PEM routines:PEM_READ_BIO_PRIVATEKEY:ASN1 lib:pem_pkey.c:141:

The command-lines use the [WayBack]rsa tool with:

  • the -in parameter
  • (for the first file) the -text parameter to dump it into human readable form
  • (for the second file) the -passin parameter with a [WayBackpass phrase argument pass:password.

The server_keypair.pem file (having the header -----BEGIN ENCRYPTED PRIVATE KEY----- and footer -----END ENCRYPTED PRIVATE KEY-----) was a password protected RSA private key where somehow ContinuaCI had the wrong password for.

I’m not sure it’s a good idea that the server_keypair.pem file has not password at all.

Read the rest of this entry »

Posted in Continua CI, Continuous Integration, Development, OpenSSL, Power User, Security, Software Development | Leave a Comment »

Are these really Windows compiler unsupported Delphi Intrinsic Routines?

Posted by jpluimers on 2019/03/19

Odd, the [WayBack/Archive.is] Delphi Intrinsic Routines – RAD Studio indicates quite a few compiler intrinsics are not available on Windows.

I wonder if this list is correct:

Routine Description DCC32 DCC64 DCCOSX DCCAARM DCCIOSARM DCCIOSARM64 DCCIOS32
System.AtomicCmpExchange AtomicCmpExchange is used for comparing and exchanging memory values. Allowed.png Allowed.png Allowed.png Allowed.png
System.AtomicDecrement AtomicDecrement is used for decrementing memory values. Allowed.png Allowed.png Allowed.png Allowed.png
System.AtomicExchange AtomicExchange is used for exchanging memory values. Allowed.png Allowed.png Allowed.png Allowed.png
System.AtomicIncrement AtomicIncrement is used for incrementing memory values. Allowed.png Allowed.png Allowed.png Allowed.png
System.BuiltInArcTan Calculates the arctangent of a given number. Allowed.png Allowed.png
System.BuiltInArcTan2 Calculates the arctangent angle and quadrant of a given number. Allowed.png Allowed.png
System.BuiltInCos Calculates the cosine of an angle. Allowed.png Allowed.png
System.BuiltInLn Calculates the natural logarithm of a real expression. Allowed.png Allowed.png
System.BuiltInLnXPlus1 Calculates the natural logarithm of (X+1). Allowed.png Allowed.png
System.BuiltInLog10 Calculates log base 10. Allowed.png Allowed.png
System.BuiltInLog2 Calculates log base 2. Allowed.png Allowed.png
System.BuiltInSin Calculates the sine of the angle. Allowed.png Allowed.png
System.BuiltInSqrt Calculates the square root of X. Allowed.png Allowed.png
System.BuiltInTan Calculates the tangent of X. Allowed.png Allowed.png

Especially since this compiles fine with the DCC32 compiler:

program CompilerIntrinsicsConsoleProject;

{$APPTYPE CONSOLE}

{$R *.res}

var
  I, J, K: Integer;
begin
  System.AtomicCmpExchange(I, J, K);
  System.AtomicDecrement(I);
  System.AtomicExchange(I, J);
  System.AtomicIncrement(J);
end.

–jeroen

Posted in Delphi, Delphi 10.3 Rio (Carnival), Development, Software Development | 3 Comments »

Periods of drought reveals historic landscape and soil changes

Posted by jpluimers on 2019/03/18

Periods of long drought can reveal historic changes in the landscape and soil.

One example was posted last year at [Archive.is] Je bent een Sassemer als … of the natural ice staking area in Sassenheim, The Netherlands, which is part of a polder.

Historically, creeks were running through it, and later on drainage tubes were laid into the ground:

Read the rest of this entry »

Posted in History, LifeHacker, Power User | Leave a Comment »

How to Block Ads on YouTube App for Android?

Posted by jpluimers on 2019/03/18

The Android Google YouTube application is showing more and more ads, mostly irrelevant, and has moved the “skip video” button outside of the “countdown timer” control. 

Right now, there is no video – not even short videos lasting like 10 seconds – that goes without ads.

Time to research [WayBack] How to Block Ads on YouTube App for Android?.

The  most promising solutions:

–jeroen

Posted in LifeHacker, Power User, SocialMedia, YouTube | Leave a Comment »

My message was blocked – Google Product Forums

Posted by jpluimers on 2019/03/18

Cool: https://support.google.com/mail/?p=RfcMessageNonCompliant

So Google does RFC checkking: [Archive.isMy message was blocked – Google Product Forums and shows bot the above link and this in the SMTP protocol:

“Our system has detected that this message is not RFC 5322 compliant,”

After that is the actual reason (for instance no From).

–jeroen

Posted in GMail, Google, Power User | Leave a Comment »

GitHub – ArchiveTeam/googleplus-grab: Archiving Google+.

Posted by jpluimers on 2019/03/18

Soon this is a thing of the past, but for just a few more days, you can help: Archiving Google+.

Either run this project: [WayBack] GitHub – ArchiveTeam/googleplus-grab: Archiving Google+.

Or even better: run the appliance, and help the WayBack machine with any archiving projects setup by the virtual appliance: the [WayBack] ArchiveTeam Warrior – Archiveteam.

See some of their other pages for more background information:

You can donate both to the archive team, and the internet archive:

How is G+ archiving doing?

The tracker is well under way: [WayBack] Googleplus tracker Dashboard. History: archive.is 1; archive.is 2

Read the rest of this entry »

Posted in ArchiveTeamWarrior, Development, G+: GooglePlus, Google, Internet, InternetArchive, Power User, Python, Scripting, SocialMedia, Software Development, WayBack machine | Leave a Comment »