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

Archive for the ‘Event’ Category

Batch files and parentheses

Posted by jpluimers on 2018/10/31

Answering [WayBack] delphi – post-build event with multiple if/copy combinations only execute if first file does not exist – Stack Overflow made me do a quick search for parentheses handling in batch files. TL;DR: it is a mess.

But it reveals some interesting links:

–jeroen

Posted in Batch-Files, Conference Topics, Conferences, Development, Event, Scripting, Software Development, Windows Development | Leave a Comment »

A Key’s Odyssey – the path of a keystroke message through the VCL

Posted by jpluimers on 2018/10/09

Blast from the past, but still relevant, this article by Peter Below:

This article follows the path of a keystroke message through the VCL. You will learn how the key processing is implemented, how the OnKey events work and what intervention points for the programmer can be found in the whole process. In addition, things like message processing are explained, and you will learn how to trace messages in the debugger from the message loop to their eventual destination.

Source: [WayBackA Key’s Odyssey

Via: [WayBack] Vcl.Controls.pasprocedure TWinControl.CNKeyDown(var Message: TWMKeyDown);..if IsMenuKey(Message) then Exit; … – Attila Kovacs – Google+

-jeroen

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

To help understanding combinations of boolean operators: Truth table – Wikipedia

Posted by jpluimers on 2018/10/04

Most software developers know they exist, but some (including me) find them hard to visualise, especially for combinations of operators, or for less common operators: the Truth table – Wikipedia.

The common operators that everyone seems to understand are these:

  • logical true
  • logical false
  • logical negation
  • logical and
  • logical or
  • logical xor

It becomes harder with a series of combinations, for instance series of and (not ...) and (not ...) and (not ...) – not to be confused with nand, similarly or (not ...) or (not ...) or (not ...) – not to be confused with nor, which both can be transformed according to the De Morgan’s laws – Wikipedia:

In set theory and Boolean algebra, these are written formally as

{\displaystyle {\begin{aligned}{\overline {A\cup B}}&={\overline {A}}\cap {\overline {B}},\\{\overline {A\cap B}}&={\overline {A}}\cup {\overline {B}},\end{aligned}}}

Using truth tables

Read the rest of this entry »

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

Not just C++: Thoughts on Dealing with Signed/Unsigned Mismatch – IT Hare on Soft.ware

Posted by jpluimers on 2018/10/02

[WayBack] C++: Thoughts on Dealing with Signed/Unsigned Mismatch – IT Hare on Soft.ware.

I have seen things like this happen in way to many places, not just C/C++:

static_assert( -1 < 1U );//fails!

Take away:

Never ever use explicit casts merely to get rid of warnings (whether signed/unsigned or otherwise)

A way to set various C/C++ compilers apart: [WayBack] GitHub – shafik/determine_c_or_cpp: Determine programatically C from C++ as well as various versions

Via: [WayBack] C++: Thoughts on Dealing with Signed/Unsigned Mismatch – IT Hare on Soft.ware: Kevlin Henney – Google+

–jeroen

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

A Case Study in Not Being A Jerk in Open Source – Kevlin Henney – Google+

Posted by jpluimers on 2018/09/28

Comments on [WayBack] A Case Study in Not Being A Jerk in Open Source – Kevlin Henney – Google+:

  • Ever notice that a lot of the people that can make big things happen can also be jerks sometimes? Torvalds, Gates, Ellison, Jobs, McNealy, Musk.
  • Jeroen Wiert Pluimers

    +Kevin Powick yup. Maybe we need to learn to live with it.

    At the current client I explained the teams that sometimes I do stupid things, both in code and in communications, and I expect them to tell me about them, just like I am telling them they do stupid things. Of course making compliments both ways work in a similar fashion.

    We Dutch are accustomed to make compliments, so I am trying to break them out of the “Doe maar gewoon, dat is al gek genoeg”, as they already create very good stuff, but both they and I are convinced together we can take that to a next level.

    Last week I did my first “Jeroen’s demo hour” showing stuff that happened in their development cycle over the last two weeks.

    Somewhere in the first third was “look here: you see artifacts of some re-use by copy actions; it can be dangerous, just look at this obscure unnoticed bug. I need to watch myself, because sometimes I do this too”, and in the final 10 minutes while demoing some C# code – which is new to them – “look at this variable: it has the wrong name because I copy-pasted it, so if you review my code, just let me know how had this is”.

Maybe time to include some code review examples in a conference session topic…

Some ideas at The 10 commandments of navigating code reviews | TechBeacon

–jeroen

Read the rest of this entry »

Posted in Agile, Conference Topics, Conferences, Development, Event, LifeHacker, Power User, Software Development | Leave a Comment »

Conference idea: re-do my git based version control session with a good set of examples and screenshots backing it

Posted by jpluimers on 2018/09/27

An interesting thread that starts as a gitlab / Delphi IDE integration question, resulting into a nice discussion of tooling to use: [Archive.is] Are there any videos (not written stuff, but actual videos) that show how you’d set up and use the built-in versioning in Tokyo IDE with a gitlab repo? … – David Schwartz – Google+

If I find time, I will try to re-work my git conference session to be much more practical.

–jeroen

Posted in Conference Topics, Conferences, Development, DVCS - Distributed Version Control, Event, git, GitHub, GitLab, Software Development, Source Code Management | Leave a Comment »

Modern Object Pascal Introduction for Programmers

Posted by jpluimers on 2018/09/25

[WayBackModern Object Pascal Introduction for Programmers

via:

–jeroen

Posted in Conference Topics, Conferences, Delphi, Development, Event, Object Pascal, Pascal, Software Development | 4 Comments »

The 10 commandments of navigating code reviews | TechBeacon

Posted by jpluimers on 2018/09/20

[WayBack] The 10 commandments of navigating code reviews | TechBeacon:

How to survive, and thrive, in the sometimes-caustic world of code reviews.

Summary:

  1. Thou shalt not take it personally
  2. Thou shalt not marry thy code
  3. Thou shalt consider all feedback
  4. Thou shalt articulate thy rationale
  5. Thou shalt be willing to compromise
  6. Thou shalt contribute to others’ code reviews
  7. Thou shalt treat submitters how thou would like to be treated
  8. Thou shalt not be intimidated by the number of comments
  9. Thou shalt not repeat the same mistakes
  10. Thou shalt embrace the nits

Via: [WayBack] Kevlin Henney – Google+: The 10 commandments of navigating code reviews

–jeroen

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

I tend to forget there is a record intialiser TPair.Create(Key, Value) – via: delphi – TDictionary populated during create example code – Stack Overflow

Posted by jpluimers on 2018/09/18

I tend to forget that since TPair – introduced in Delphi 2009 – has had a TPair.Create(Key, Value)record initialiser since Delphi 2010, though only fully documented since Delphi XE4:

With some spart short methods, Cosmin Prund shows a really nice helper at [WayBack] delphi – TDictionary populated during create example code – Stack Overflow allowing a call like this:

  with TDictHelper<Integer, string> do
    Dict := Make([P(1, 'one'), P(2, 'two')]);

His answer has all the details (including describing the pros and conse), so here is only the helper:

uses
  SysUtils, Generics.Collections;

type
  TDictHelper<Key, Value> = class
  public
    class function P(const K:Key; const V:Value): TPair<Key, Value>;
    class function Make(init: array of TPair<Key, Value>): TDictionary<Key, Value>;overload;
    class function Make(KeyArray: array of Key; ValueArray: array of Value): TDictionary<Key, Value>;overload;
  end;

{ TDictHelper<Key, Value> }

class function TDictHelper<Key, Value>.Make(init: array of TPair<Key, Value>): TDictionary<Key, Value>;
var P: TPair<Key, Value>;
begin
  Result := TDictionary<Key, Value>.Create;
  for P in init do
    Result.AddOrSetValue(P.Key, P.Value);
end;

class function TDictHelper<Key, Value>.Make(KeyArray: array of Key;
  ValueArray: array of Value): TDictionary<Key, Value>;
var i:Integer;
begin
  if Length(KeyArray) <> Length(ValueArray) then
    raise Exception.Create('Number of keys does not match number of values.');
  Result := TDictionary<Key, Value>.Create;
  for i:=0 to High(KeyArray) do
    Result.AddOrSetValue(KeyArray[i], ValueArray[i]);
end;

class function TDictHelper<Key, Value>.P(const K: Key;
  const V: Value): TPair<Key, Value>;
begin
  Result := TPair<Key, Value>.Create(K, V);
end;

–jeroen

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

TIdHTTPWebBrokerBridge example for a standalone Indy based SOAP service

Posted by jpluimers on 2018/09/12

Since I tend to forget what bits and pieces are needed for TIdHTTPWebBrokerBridge, the below code piece from:

The [WayBack] WebReq.WebRequestHandler Function returns a reference to the global [WayBackTWebRequestHandler object. This object manages all the Web modules in the application, and creates Web request and response objects when the application receives HTTP request messages: TWebRequestHandler keeps a pool of active Web modules. In response to a request from the application, TWebRequestHandler creates a request object and assigns it to one of the active Web modules.

The code below is the Indy counterpart of hooking up a classic WebSnap WebBroker (you could also hook the Web.WebBroker.Application.WebModuleClass to TMyWebModule instead of the WebRequestHandler.WebModuleClass, as Web.WebBroker.Application.WebModuleClass is a TWebApplication which inherits from TWebRequestHandler).

Read the rest of this entry »

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