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,862 other subscribers

Archive for August, 2018

Boot CDs (bootable from USB stick as well) for aiding PC recovery

Posted by jpluimers on 2018/08/10

  • Windows PE 10 x64 based: [WayBack] Hiren’s BootCD PE Hiren’s BootCD PE (Preinstallation Environment) is an emergency boot disk based on Windows 10 PE x64. It is being developed for the new age computers, it supports UEFI booting and requires minimum 2 GB RAM.After boot, it finds and installs many common drivers like graphics, sound, wireless and ethernet card for your hardware. So that you can connect to a WIFI or Ethernet network.
  •  Syslinux/Grub4dos/FreeDOS based: [WayBack] Ultimate Boot CD – Overview

–jeroen

Via:

Posted in Power User, Windows | Leave a Comment »

VLOOKUP Example Spreadsheet & Tutorial | Productivity Portfolio

Posted by jpluimers on 2018/08/10

Because I tend to forget how to use this:

Excel VLOOKUP tutorial with an example spreadsheet & video. The article shows how to lookup the values from one column to use in another worksheet column.

Source: [Archive.isVLOOKUP Example Spreadsheet & Tutorial | Productivity Portfolio

–jeroen

Read the rest of this entry »

Posted in Excel, Office, Power User | Leave a Comment »

How to tell if your site is served via CloudFlare | Igor’s Blog

Posted by jpluimers on 2018/08/10

Based on [Wayback/Archive.isHow to tell if your site is served via CloudFlare | Igor’s Blog, I’ve changed the script a little bit.

I’ve tested it with one of the domains from the Cloudbleed list (a pretty OK indication the site is using cloudflare) and a the example.org site that does not:

# curl -sI https://feedly.com | grep "Server\|__cfduid\|CF-RAY"
Set-Cookie: __cfduid=d779ee6e244349cf06e2707771a9185e21492589239; expires=Thu, 19-Apr-18 08:07:19 GMT; path=/; domain=.feedly.com; HttpOnly
Server: cloudflare-nginx
CF-RAY: 351e5e9af8971497-AMS
# curl -sI https://example.org | grep "Server\|__cfduid\|CF-RAY"
Server: ECS (ewr/15BD)

Domain Source: [Wayback/Archive] pirate/sites-using-cloudflare: Archived list of domains using Cloudflare DNS at the time of the CloudBleed announcement

–jeroen

via: [WayBack] https://www.igorkromin.net/index.php/2017/04/18/how-to-tell-if-your-site-is-served-via-cloudflare/ – Joe C. Hecht – Google+

 

Posted in *nix, *nix-tools, Cloud, Cloudflare, cURL, Hosting, Infrastructure, Power User | Leave a Comment »

Why Skylake CPUs Are Sometimes 50% Slower – How Intel Has Broken Existing Code – Alois Kraus

Posted by jpluimers on 2018/08/09

[WayBack] Why Skylake CPUs Are Sometimes 50% Slower – How Intel Has Broken Existing Code – Alois Kraus reports that the PAUSE instruction on Intel Skylake architecture takes an order of magnitude longer than on previous architectures.

This impacts spinlock code in .NET 4.x and .NET Core 2, and likely impacts other spinlock code as well. The .NET core fix gets back-ported to .NET 4.x.

Since Delphi XE, the Delphi RTL code has borrowed ideas from .NET implementing this kind of code, so I filed [WayBack] QualityCentral: 144063 PAUSE instruction on Intel Skylake takes order of magnitude longer: important for SpinWait/SpinLock code (because Google can index it).

It is no coincidence that a Senior Scaleability Engineer at Booking.com mentioned it on his G+ stream ([WayBack] The “Pause” instruction changed timing dramatically in Skylake. Spinlock implementation based on pause will need adjustments. – Kristian Köhntopp – Google+) as changes like this can heavily impact server systems.

–jeroen

via: [WayBack] The “Pause” instruction changed timing dramatically in Skylake. Spinlock implementation based on pause will need adjustments.I hope a fix for this will be back-ported for many Delphi versions. – Jeroen Wiert Pluimers – Google+

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

Reminder to self: write up which refactoring options might work under what circumstances

Posted by jpluimers on 2018/08/09

Reminder to self to elaborate on:

–jeroen

Posted in Delphi, Development, Software Development | 2 Comments »

Delphi 2007 – when you lost your Borland.*.Targets file during a Windows upgrade

Posted by jpluimers on 2018/08/09

When upgrading Windows, it will create a fully new %windir% for you.

Any files an application installed files in them will be gone, and appear in a %HomeDrive%\Windows.old

If you’ve deleted that directory because you thought all your applications worked, or the Windows 10 upgrade automagically deleted the Windows.old directory by itself after some grace period, then you might be in trouble.

One of those applications is Delphi 2007. I wrote about a different issue on x64 Windows on that product before: Delphi on Windows x64: solution when project compiles fine under IDE, but not using MSBuild.

Basically it puts these files in %windir%\Microsoft.NET\Framework\v2.0.50727:

  • Borland.Common.Targets
  • Borland.Cpp.Targets
  • Borland.Delphi.Targets
  • Borland.Group.Targets

Those will be gone if you deleted the Windows.old directory.

If you are lucky, the files are also in this directory to copy back to %windir%\Microsoft.NET\Framework\v2.0.50727 and %windir%\Microsoft.NET\Framework64\v2.0.50727:

C:\ProgramData\{B59CE2E6-B15A-4F23-BD0E-72BF2ADDC3C7}\core\7EFD2DA3\6C948720

And if you’re not, you can find them here too: https://gist.github.com/anonymous/ab801cd925e5e634518fd5592eb2a46e

–jeroen

via:

Read the rest of this entry »

Posted in Delphi, Delphi 2007, Development, Software Development | Leave a Comment »

ngHttp2 and OpenSSL win32/i386/x86 and win64/x64_86 (a.k.a. x86_64) builds for Windows

Posted by jpluimers on 2018/08/08

[WayBack] ngHttp2 DLLs has a simple a version scheme. The build inside the Windows PHP distribution includes these version numbers. The TreadSafe versions work as plug in replacement for github.com/grijjy/DelphiScalableClientSockets/tree/master/Bin which is used by github.com/grijjy/GrijjyFoundation/blob/master/Grijjy.Http.pas#L11. You obtain them via [WayBack] PHP For Windows: Binaries and sources Releases; and at the time of writing these were the most recent versions:

[WayBack] OpenSSL DLLs has a much more complex version scheme, as they are numeric but OpenSSL releases are not.

  • DLLs have four numbers a.b.c.d
  • OpenSSL versions have three numbers and a letter a.b.c.x
  • The letter matches the fourth digit, though the ones marked with * have not been used yet:
    # letter # letter # letter # letter # letter remark
    1 a 6 f 11 k 16 p 21 u
    2 b 7 g 12 l 17 q 22 v *
    3 c 8 h 13 m 18 r 23 w *
    4 d 9 i 14 n 19 s 24 x *
    5 e 10 j 15 o 20 t 25 y *
    26 z *

[WayBack] Index of /SSL has “Pre-compiled Win32/64 libraries without external dependencies to the Microsoft Visual Studio Runtime DLLs, except for the system provided msvcrt.dll.”

These work no matter what development/deployment stacks you use (including a Visual Studio based stack).

The most recent version as of writing is 1.0.2o, which maps to 1.0.2.20 which contains libeay32.dll and ssleay32.dll for both the i386-win32 and x86_64-win64 build (not sure why they both use 32 in the name):

openssl-1.0.2o-i386-win32.zip
openssl-1.0.2o-x64_86-win64.zip which supports x86_64 as this site is about the only one using x64_86 in the name

Background reading:

These binaries are for instance used by (most of them are behind or far behind on the OpenSSL version):

  • Avira Antivirus
  • subversion
  • git mingw64
  • VMware Tools
  • Microsoft OneDrive
  • Delphi Indy communications library

Speaking of which: this is a recent Delphi wrapper around libeay32.dll: [WayBack] GitHub – lminuti/Delphi-OpenSSL: Delphi implementation of OpenSSL

–jeroen

Posted in Delphi, Development, OpenSSL, Power User, Security, Software Development | 2 Comments »

Some tips for your Delphi project options hierarchy

Posted by jpluimers on 2018/08/08

Over the years, various Delphi versions have cluttered the Project Options hierarchy quite a bit. This means that when you walk this hierarchy in the Project Options dialog, you will see many bold entries, indicating they have been changed for that level in the hierarchy.

The most important tip is to keep as much as possible at the top level, preferably using relative paths or paths containing $(...) macros.

I usually fill these entries there:

  • “All configurations – All platforms”
    • “Conditional defines” having the base conditional defines
    • “Output directory” (usually including a relative path that includes .\$(Platform)\$(Config)
    • “Search path” with .\$(Platform) when you nave libraries containing DCU files per platform
      • You can even do $(Platform)\$(Config) here if these DCU files are different for configurations (DEBUG/RELEASE) as well.
    • “Unit output directory” so each application gets a unique path (so I include .\$(SanitizedProjectName)\$(Platform)\$(Config) or .\$(Platform)\$(Config)\$(SanitizedProjectName) in the path)
    • Unit scope names (based onSource: Delphi unit prefixes for VCL applications)
  •  “Debug configuration – All platforms”
    • “Conditional defines”: add DEBUG
  • “Release configuration – All platforms”
    • “Conditional defines”: add RELEASE

I include the $(SanitizedProjectName) because it has the name of your project, which I documented at Source: Delphi XE8 does not adhere the $(PROJECTNAME) in a “Unit Output Directory”, but does recognise $(SanitizedProjectName) including many other macros.

Note:

A long time ago, +Uwe Raabe explained that you can use $(SanitizedProjectName) in your project settings to include the actual project name in https://plus.google.com/+DavidNottageDelphiExpert/posts/PcW8CwMQGmH

This works great for DCU output, but not so well for EXE output: when using for instance C:\Binaries\$(SanitizedProjectName) as target, the debugger cannot find the executable as the compiler puts it in the wrong place.

Example with a fresh console project:

0. Ensure C:\Binaries exists and you have write access to it
1. Set Output directory to C:\Binaries\$(SanitizedProjectName)
2. Set Unit output directory to .\$(SanitizedProjectName)\$(Platform)\$(Config)
3. Run:

---------------------------
Error
---------------------------
Could not find program, 'C:\Binaries\%SanitizedProjectName%\Project1.exe'.
---------------------------
OK
---------------------------

The executable is actually at C:\Binaries\Project1.exe, so the compiler does not take the “\$(SanitizedProjectName)” bit into account.

Anyone with a fix for that?

Via [WayBack] A long time ago, +Uwe Raabe explained that you can use $(SanitizedProjectName) in your project settings to include the actual project name in https://pl… – Jeroen Wiert Pluimers – Google+

Uwe Raabe

To make the compiler use the correct path the SanitizedProjectName item must be located before its use in the dproj file. DprojNormalizer assures that since version 2.2.1 and ProjectMagician does so, too. Thus my Project1.exe is written correctly to C:\Binaries\Project1\Project1.exe here on my system.
Unfortunately that won’t fix the main problem, which is that the call to the debugger doesn’t resolve this variable in the first place. Currently I don’t know how this could be fixed.
You may try
$(MSBuildProjectName)

It looks like the .dproj is this using itself too, for instance as this part:

    <Import Project="$(MSBuildProjectName).deployproj" Condition="Exists('$(MSBuildProjectName).deployproj')"/>

–jeroen

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

E2026 or W1023 – take your pick (:

Posted by jpluimers on 2018/08/08

[WayBack] A compiler curiosity I’ve learned today … – David Berneda – Google+: depending on if TEST is defined or not, you get E1026 or W1023.

// This works:
{$IF Declared(Test) and (Test>=100)}
{$ENDIF}

// This not:
{$IF Declared(Test)}
{$IF Test>=100} // "E2026 Constant expression expected"
{$ENDIF}
{$ENDIF}

The W1023 can be alleviated by replacing 100 with +100.

Note that both errors have been documented since at least Delphi 2007:

–jeroen

Source: A compiler curiosity I’ve learned today: // This works: {$IF Declared(Test) …

Posted in Conference Topics, Conferences, Delphi, Development, Software Development | 2 Comments »

Finally: RAD Studio August 2018 Roadmap – Embarcadero Community

Posted by jpluimers on 2018/08/07

While many were expecting the 10.3 release by now, it should now be available towards the end of 2018. If that means better quality, I’m all for it [WayBack]: RAD Studio August 2018 Roadmap – Embarcadero Community.

The slides are still in image form (I never understood the lack of PDF), but luckily there is [WayBack] August 2018 Roadmap Commentary from Product Management – Community Blogs – Embarcadero Community.

The 10.3 feature I like most is the work on records: default constructors, destructors and copy operators. This will lead the way for nullable types, on which I gave a session in 2009 on the work I did in the 2007-2009 timeframe on non-generic nullable types, and Jim on generic nullable types:

I never got around to follow up on Reminder: rebuild my Nullable Types based on Class Operators in Delphi, so hopefully the Delphi team will deliver that next year.

Via: [WayBack] Just in: RAD Studio August 2018 Roadmap (https://community.embarcadero.com/article/news/16638-rad-studio-august-2018-roadmap) and PM Commentary blog pos… – Marco Cantù – Google+

–jeroen

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