The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,839 other subscribers

Archive for the ‘Software Development’ Category

Is there any way to record a keyboard macro in the IDE?

Posted by jpluimers on 2018/05/22

Yes there is, but it only does code editor commands. It’s been there since at least 1998 (read Delphi 4), probably all 32-bit versions and maybe even the 16-bit Delphi 1 version.

via:

–jeroen

PS: the G+ thread at … had these comments:

Ondrej Kelle
Reminds me of my keyboard macro manager, later adopted by GExperts: [WayBack] 19145 Keyboard macro manager

Thomas Mueller (dummzeuch)
… which I recently extended to actually display and edit those macros.

[WayBack] Edit keyboard macros with the Macro Library expert – twm’s blog

Posted in Delphi, Development, Software Development | 1 Comment »

GDPR for database professionals and DBAs. Poster.

Posted by jpluimers on 2018/05/17

A poster showing how to prepare your Oracle database for GDPR. Wait for the email download link by visiting GDPR for database professionals and DBAs. Poster (they mention to be GDPR compliant in [WayBack] their policy), or look at the WayBack machine to download it now.

One takeaway for me: you also need to scrub backups when removing someone your records.

Via: [WayBack] sqldev.tech/gdpr_poster – Michael Thuma – Google+

–jeroen

Posted in Communications Development, Database Development, Design Patterns, Development, Software Development | Leave a Comment »

Expand your Collections collection – Part 2: a generic ring buffer – grijjy blog

Posted by jpluimers on 2018/05/17

For my Delphi link archive: [WayBackExpand your Collections collection – Part 2: a generic ring buffer – grijjy blog.

–jeroen

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

Delphi Mqtt Clients

Posted by jpluimers on 2018/05/16

For my link archive via: [WayBackDelphi Mqtt Client (Use Indy)https://github.com/wizinfantry/delphi-mqtt-client – 오대우 – Google+

Background reading:

–jeroen

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

Delphi: a pattern for a generic factory, this one for components, but can be uses for anything having a base class like a TThread descendant.

Posted by jpluimers on 2018/05/16

Generics and constraints in Delphi is still a bit of pain.

A while ago, I needed a factory for threads. It was more convoluted than I meant it to be, so I had a short chat with Stefan Glienke.

He came up with an example similar to the one below. I tore it apart so you can on each line see what the compiler dislikes.

This fails, but was kind of how I wanted it to be:

type
   TFactory = record
     class function Manufacture<T: TBaseClass, constructor>(parameter definitions): T;
   end;

class function Manufacture<T: TBaseClass, constructor>(parameter definitions): T;
begin
  Result := T.Create(parameter values);
end;

Which means I need to update Delphi Constraints in Generics – RAD Studio XE documentation wiki

The factory:

type
  TComponentFactory = class
    class function CreateComponent<T: TComponent>(AOwner: TComponent): T; static;
  end;

class function TComponentFactory.CreateComponent<T>(AOwner: TComponent): T;
var
  ComponentClass: TComponentClass;
  Component: TComponent;
begin
  ComponentClass := T;
  Component := ComponentClass.Create(AOwner); // you can't do `T.Create(AOwner)`
  Result := T(Component); // you can't do `Result := ComponentClass.Create(AOwner);`
end;

The usage:

var
  Component: TButton;
  Owner: TComponent;
begin
  Owner := Application.MainForm;
  Component := TComponentFactory<TButton>.CreateComponent(Owner);
  Component.Parent := Owner;
end;

Full source example is at: After a discussion with Stefan Glienke: a pattern for a factory, this one for components, but can be uses for anything having a base class like a TThread descendant.

In the mean time, Spring4D has added the [Archive.is] Spring4D: TActivator record with many CreateInstance methods that allow you to create instances of classes for which you just have type information.

–jeroen

This fails:

type
   TFactory = record
     class function Manufacture<T: TBaseClass, constructor>(parameter definitions): T;
   end;

class function Manufacture<T: TBaseClass, constructor>(parameter definitions): T;
begin
  Result := T.Create(parameter values);
end;

view raw

readme.md

hosted with ❤ by GitHub


type
TComponentFactory = class
class function CreateComponent<T: TComponent>(AOwner: TComponent): T; static;
end;
class function TComponentFactory.CreateComponent<T>(AOwner: TComponent): T;
var
ComponentClass: TComponentClass;
Component: TComponent;
begin
ComponentClass := T;
Component := ComponentClass.Create(AOwner); // you can't do `T.Create(AOwner)`
Result := T(Component); // you can't do `Result := ComponentClass.Create(AOwner);`
end;


var
Component: TButton;
Owner: TComponent;
begin
Owner := Application.MainForm;
Component := TComponentFactory<TButton>.CreateComponent(Owner);
Component.Parent := Owner;
end;

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

Delphi WSDL default importer settings

Posted by jpluimers on 2018/05/15

Note to self (as the WSDL importer has trouble with WSDL files that include XSD files having xsd:group definitions), the default settings of the importer in the UI:

-Oa -Od -Oe -Of -Oh -Oi -Oj -Oo -Op -Ot -Ou -Ov -Ox

This matches the output from the WSDLImp.exe default settings as well (larger screenshots below):

I suspect the reason is that the command-line importer does, but the wizard does not, show an exception during processing:

*Error*: D:\Playground\iECK DT2.0 services v2.1.1\xsd\ECK-DT2-CatalogServiceSchema-v2.1.1.xsd
> Access violation at address 0059DBA4 in module 'WSDLImp.exe'. Read of address 00000000
Done : D:\Playground\iECK DT2.0 services v2.1.1\wsdl\ECK-DT2-CatalogService-v2.1.1.wsdl>0
Writing: D:\Playground\iECK_ImportWSDL\ECK_DT2_CatalogService_v2.pas

Hopefully more on that later.

Both the IDE expert and console based WSDLimp will write the output .pas file and the output file of both tools has the same content.

–jeroen

Read the rest of this entry »

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

Delphi – finding published event handlers that have lost their binding from the DFM

Posted by jpluimers on 2018/05/15

The scripts in these links didn’t work well enough for me:

So I’ve been working on a GExperts based solution (because that gave me a nice starting point). It’s not fully done yet, so here are a few things I’ve used:

(Reminder to self: contact David Hoyle who knows a lot about the OTA).

–jeroen

Read the rest of this entry »

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

State.of.dev

Posted by jpluimers on 2018/05/15

Reminder to self: more than a year later, see the progression of [Archive.isState.of.dev, a project that visualizes the current state of development split by key topics.

Or basically a split graph of the one on the side into various graphs by topic.

Current state: Home – State.of.dev

Past state: WayBack (hopefully it got the graphs archived by now).

The author is Yvo Schaap – Medium who also wrote the very interesting post [WayBackWhy your business needs a good downturn – CTO Insights – Medium.

–jeroen

Read the rest of this entry »

Posted in Development, Power User, Software Development | Leave a Comment »

Nick Craver on Twitter: “GDPR Erasure is fun, because you are required to disassociate the fact it happened as well, or at least disassociate it from the person. So when a regulator audits you, how can you prove you did it? Yeah let’s just ignore those pesky details.”

Posted by jpluimers on 2018/05/10

GDPR is vague, so you bump into things like [WayBackNick Craver on Twitter: “GDPR Erasure is fun, because you are required to disassociate the fact it happened as well, or at least disassociate it from the person. So when a regulator audits you, how can you prove you did it? Yeah let’s just ignore those pesky details.”

This seems to be a viable solution: [WayBackAdam Surak on Twitter: “We’re removing everything and keeping hash of login/email… “

–jeroen

Read the rest of this entry »

Posted in Development, Software Development | Leave a Comment »

fremag/MemoScope.Net: Dump and analyze .Net applications memory ( a gui for WinDbg and ClrMd )

Posted by jpluimers on 2018/05/10

It’s a great too, so I need to invest more time into using MemoScope.Net – Dump and analyze .Net applications memory ( a gui for WinDbg and ClrMd )

Way too manny features to describe here, so get that at the GitHub repository below.

  • Heap statistics
  • Query instances
  • Instance content and references
  • Compare dumps
  • Threads and stacks
  • Deadlocks
  • Delegates
  • Dump process memory

Source: [Archive.is/WayBackfremag/MemoScope.Net: Dump and analyze .Net applications memory ( a gui for WinDbg and ClrMd )

Via Matthijs ter Woord.

–jeroen

Read the rest of this entry »

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