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 May, 2018

dzComputerInfo: a small tool that shows a window on top of all other windows displaying the computer name and currently logged on user.

Posted by jpluimers on 2018/05/18

Interesting as bgInfo does not support top most windows or overlay: it only does the Desktop background, and you need to go through hoops to recreate the background on each logon:

Enter dzComputerInfo. It’s a small tool that I wrote the evening after the above incident which does exactly one thing: It shows a window on top of all other windows displaying the computer name and currently logged on user. Since the window is so small and it places itself automatically just above the start button, it does not really become a nuisance.

The tool and the source code is available from sourceforge, if anybody else thinks he has a use for it.

The G+ thread also the interesting comment by Gaurav Kale:

The Classic Shell Start button supports environment variables in its tooltip. So just specify: %username% on %computername% for the Setting called “Button Tooltip”. Then to see the currently logged on user and computer name, you just have to HOVER over the Start button!

–jeroen

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

kryo.se: iodine (IP-over-DNS, IPv4 over DNS tunnel)

Posted by jpluimers on 2018/05/18

iodine is a free (ISC licensed) tunnel application to forward IPv4 traffic through DNS servers (IP over DNS). Works on Linux, FreeBSD, NetBSD, OpenBSD and Mac OS X.

In light of

–jeroen

Posted in Power User, Security | Leave a Comment »

Local Guides Connect – Big news about reviews: now they’re worth 10 point… – Local Guides Connect

Posted by jpluimers on 2018/05/18

Reminder to check if it already rolled out on my smartphone: [WayBackLocal Guides Connect – Big news about reviews: now they’re worth 10 point… – Local Guides Connect .

It seems to work both on mobile and on maps.google.com/localguides/home

–jeroen

Read the rest of this entry »

Posted in Google, GoogleMaps, Local Guides, Power User | Leave a 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 »

Electronics components and resistor decoder colours

Posted by jpluimers on 2018/05/17

Cool video about basic electronic components explained:

It goes well with these posts:

Read the rest of this entry »

Posted in Development, Hardware 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 »