The Wiert Corner – irregular stream of stuff

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

  • My work

  • 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,842 other followers

Archive for the ‘Software Development’ Category

delphi – VCL events with anonymous methods – what do you think about this implementation? – Stack Overflow

Posted by jpluimers on 2017/10/19

A long time ago, Pablo Vizcay a.k.a. [WayBackpragmatic_programmer wrote some cool code at [WayBackdelphi – VCL events with anonymous methods – what do you think about this implementation? – Stack Overflow.

I still think it’s a very neat solution to bind method references to events.

type
  TNotifyEventDispatcher = class(TComponent)
  protected
    FClosure: TProc<TObject>;

    procedure OnNotifyEvent(Sender: TObject);
  public
    class function Create(Owner: TComponent; Closure: TProc<TObject>): TNotifyEvent; overload;

    function Attach(Closure: TProc<TObject>): TNotifyEvent;
  end;

implementation

class function TNotifyEventDispatcher.Create(Owner: TComponent; Closure: TProc<TObject>): TNotifyEvent;
begin
  Result := TNotifyEventDispatcher.Create(Owner).Attach(Closure)
end;

function TNotifyEventDispatcher.Attach(Closure: TProc<TObject>): TNotifyEvent;
begin
  FClosure := Closure;
  Result := Self.OnNotifyEvent
end;

procedure TNotifyEventDispatcher.OnNotifyEvent(Sender: TObject);
begin
  if Assigned(FClosure) then
    FClosure(Sender)
end;

end.

And this is how it’s used for example:

procedure TForm1.FormCreate(Sender: TObject);
begin    
  Button1.OnClick := TNotifyEventDispatcher.Create(Self,
    procedure (Sender: TObject)
    begin
      Self.Caption := 'DONE!'
    end)
end;

–jeroen

Posted in Delphi, Delphi 10 Seattle, Delphi 10.1 Berlin (BigBen), Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Delphi XE6, Delphi XE7, Delphi XE8, Development, Software Development | Leave a Comment »

Kristian Köhntopp – Google+

Posted by jpluimers on 2017/10/18

[WayBack] Kristian Köhntopp – Google+:

The S in IoT is for Security, and the U is for Update Policy.
 –jeroen

 

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

The Software Development Process – Science, Engineering, Art, or Craft? – CodeProject

Posted by jpluimers on 2017/10/18

On the long-read list: [WayBackThe Software Development Process – Science, Engineering, Art, or Craft? – CodeProject

 

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

GitHub – sinbad/spriterecolour: Sprite processor to allow dynamic recolouring

Posted by jpluimers on 2017/10/18

One day this will be extremely useful to me: [WayBackGitHub – sinbad/spriterecolour: Sprite processor to allow dynamic recolouring

Via: [WayBackSpriteRecolour, an open source sprite recolouring tool · SteveStreeting.com

TL;DR:

Read the rest of this entry »

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

Google’s AI can create better machine-learning code than the researchers who made it

Posted by jpluimers on 2017/10/17

[WayBack] Google’s AI can create better machine-learning code than the researchers who made it:

Google’s AutoML project has yielded significant advances in the ability for machine-learning systems to replicate and improve AI code.

Via:

–jeroen

Posted in AI and ML; Artificial Intelligence & Machine Learning, Development, LifeHacker, Power User, science, Software Development | Leave a Comment »

 
%d bloggers like this: