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

Archive for 2018

Horace Dediu on Twitter: “Personal computing, the first 40 years.… “

Posted by jpluimers on 2018/06/01

[WayBackHorace Dediu on Twitter: “Personal computing, the first 40 years.… “

–jeroen

Read the rest of this entry »

Posted in History, Power User | Leave a Comment »

“Unknown function at TMethodImplementationIntercept”

Posted by jpluimers on 2018/06/01

Reminder to self: when you get Unknown function at TMethodImplementationIntercept in a Delphi stack trace from the Exception.StackTrace property or FastMM memory report:

  1. Ensure you generate a .MAP or .TDS file with full debug information
  2. Copy the .MAP or .TDS files to directory of your EXE.

Via:

The Exception.StackTrace was introduced in Delphi 2009 that extended these [WayBackException Members:

Some notes:

  • Fields where you can put hooks in; if there is no hook in place, they won’t be used:
    • [WayBackException.GetExceptionStackInfoProc Field GetExceptionStackInfoProc: function (P: PExceptionRecord): Pointer;
      • This function is called to return an opaque data structure that contains stack information for the given exception information record. This function will be called when the exception is about to be raised or if this is an external exception such as an Access Violation, called soon after the object is created.
    • [WayBackException.CleanUpStackInfoProc Field CleanUpStackInfoProc: procedure (Info: Pointer);
      • This function is called when the destructor is called to clean up any data associated with the given opaque data structure.
    • [WayBackException.GetStackInfoStringProc Field GetStackInfoStringProc: function (Info: Pointer): string;
      • This function is called to return a string representation of the opaque data structure returned by GetExceptionStackInfoProc

TMethodImplementationIntercept was introduced in the System.Rtti unit of Delphi XE6 [WayBack]:

–jeroen

Example code:


unit ExceptionHelperUnit;
interface
uses
System.SysUtils;
type
ExceptionHelper = class helper for Exception
public
function Describe: string;
class procedure RaiseNotImplementedException(const aClass: TClass; const aMethodName: string);
class function GetStackTrace: string;
end;
implementation
uses
System.RTLConsts,
System.SysConst;
type
EStackTraceException = class(Exception); // EProgrammerNotFound to make it really clear this is only to be used in very limited places ??
{ ExceptionHelper }
function ExceptionHelper.Describe: string;
var
lStackTrace: string;
begin
Result := inherited ToString();
if Self is EInOutError then
if Result = System.RTLConsts.SInvalidFileName then
Result := System.SysConst.SInvalidFileName;
if Assigned(StackInfo) then
lStackTrace := StackTrace
else
lStackTrace := 'empty';
Result := Format('Exception'#13#10'%s at $%p: %s'#13#10'with StackTrace'#13#10'%s', [ClassName, ExceptAddr, Result, lStackTrace]);
end;
class function ExceptionHelper.GetStackTrace: string;
begin
try
Result := 'Get StackTrace via Exception.';
raise EStackTraceException.Create(Result) at ReturnAddress;
except
on E: EStackTraceException do
Result := E.StackTrace;
end;
end;
class procedure ExceptionHelper.RaiseNotImplementedException(const aClass: TClass; const aMethodName: string);
begin
raise ENotImplemented.CreateFmt('Method %s.%s is not implemented.', [aClass.ClassName, aMethodName]);
end;
end.

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

Regex – Does not contain certain Characters – Stack Overflow

Posted by jpluimers on 2018/06/01

I had to find strings containing ” of object”, but not starting with a “)”, so the regex became this:

[^)] of object

Source: [WayBackRegex – Does not contain certain Characters – Stack Overflow

–jeroen

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

Delphi needs a few more wizards – verify dpr against dproj and check both against files on disk

Posted by jpluimers on 2018/05/31

There are a few experts Delphi needs for project management:

  • verify the .dproj against the .dpr as these get out of sync often, especially in multi-person or multi-branch projects
  • verify .dproj and .dpr against files on disk (often there are files on disk not in the Project Manager; Visual Studio has this nice [WayBack“Show All Files” button that helps fixing this there)

via [WayBackIs there a way to export the file structure of a Project from the Project Manager view to a txt file? – John Kouraklis – Google+

Atilla Kovaks posted a small bash script to get started: [WayBackhttp://pisil.de/prfiles.sh.txt

–jeroen

Read the rest of this entry »

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

The .NET garbage collector sort-of documented: coreclr/garbage-collection.md at master · dotnet/coreclr

Posted by jpluimers on 2018/05/31

Very interesting read: “Garbage Collection Design” by Maoni Stephens at [WayBackcoreclr/garbage-collection.md at master · dotnet/coreclr.

It’s part of this series of documents:

The Book of the Runtime

Welcome to the Book of the Runtime (BOTR) for the .NET Runtime. This contains a collection of articles about the non-trivial internals of the .NET Runtime. Its intended audience are people actually modifying the code or simply wishing to have a deep understanding of the runtime. Below is a table of contents.

at [WayBackcoreclr/Documentation/botr at master · dotnet/coreclr

I got there via these links:

–jeroen

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

CVE-2017-11509: Firebird fbudf Module Authenticated Remote Code Execution – Firebird News

Posted by jpluimers on 2018/05/31

Ouch (despite one needs authenticated access): [WayBack] Firebird fbudf Module Authenticated Remote Code Execution – Firebird News

Here is the description for CVE-2017-11509

An authenticated remote attacker can execute arbitrary code in Firebird SQL
Server versions 2.5.7 and 3.0.2 by executing a malformed SQL statement. The
only known solution is to disable external UDF libraries from being loaded. In
order to achieve this, the default configuration has changed to UdfAccess=None.

This will prevent the fbudf module from being loaded, but may also break other
functionality relying on modules.

Here is the Debian security page with the issue : CVE-2017-11509

The thing I am really not happy about is that the 90 day limit has been overdrawn by about 180 days (see https://www.tenable.com/security/research/tra-2017-36)

Related:

Via:

–jeroen

Posted in Database Development, Development, Security, Software Development | Leave a Comment »

Coding is not “fun,” it’s technically and ethically complex — Quartz

Posted by jpluimers on 2018/05/31

Interesting read: [Archive.is/WayBackCoding is not “fun,” it’s technically and ethically complex — Quartz

via: [WayBack] Coding is not for everyone – Kevin Powick – Google+

–jeroen

Posted in Development, Software Development | Leave a Comment »

Some useful Visual Studio Keyboard bindings – via my comment at “Allow for floating windows · Issue #10121 · Microsoft/vscode · GitHub”

Posted by jpluimers on 2018/05/30

The thread at [WayBack]: Allow for floating windows · Issue #10121 · Microsoft/vscode · GitHub made me discover a few things, which I have commented there.

Reminder to self: find the Windows keyboard shortcuts as well.

Thanks @steinhh for the CmdK O keyboard combination. I was not aware of that yet and I am going to use this next week on a multi-monitor system to see how well that works.

Your tip made me found the PDFs below and made me make the lists/screenshots below as well.

Terrific! Thank you, thank you!

The bindings (on Mac) I found with their screenshots:

  • CmdShiftP: show all commands
    screenshot 2018-05-20 15 27 30
  • CmdK O: open current file in new Window
  • CmdShiftN: open a new window
    screenshot 2018-05-20 15 27 00
  • CmdK CmdR: open keyboard shortcuts reference PDF for current OS in the default web-browser
  • CmdK CmdS: open keyboard shortcuts editor
    screenshot 2018-05-20 15 24 07

The keyboard shortcuts editor has a search which can find bindings on the keybinding name itself or the command name:

  • screenshot 2018-05-20 15 31 58
  • screenshot 2018-05-20 15 33 19

–jeroen

Posted in Development, Software Development, Visual Studio and tools, vscode Visual Studio Code | Leave a Comment »

Akismet GDPR notification: enabled

Posted by jpluimers on 2018/05/30

I saw the below notification recently, but it was already enabled.

Akismet & Privacy.

To help your site be compliant with GDPR and other laws requiring notification of tracking, Akismet can display a notice to your users under your comment forms. This feature is disabled by default, however, if you or your audience is located in Europe, you need to turn it on.

Please enable or disable this feature. More information.

–jeroen

Read the rest of this entry »

Posted in Development, GDPR/DS-GVO/AVG, Power User, Privacy, SocialMedia, Software Development, Web Development, WordPress, WordPress | Leave a Comment »

Class Constructors/Destructors are special initialization/finalization sections – via Popping the hood. – Community Blogs – Embarcadero Community

Posted by jpluimers on 2018/05/30

I wasn’t sure what the order of class constructors/destructors was with respect to initialization/finalization sections. [WayBackClass Constructors. Popping the hood. – Community Blogs – Embarcadero Community explains that there is more to it than below summary, but it is a good start:

If a given class constructor is eligible to be invoked (ie. it was linked into your application), it will run immediately before the initialization section for the unit in which the class is implemented. The class destructors will be invoked immediately after the finalization section for the unit in which the class is implemented.

–jeroen

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