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 the ‘Delphi’ Category

Spring4D How to correctly assign NULL to a Nullable type?

Posted by jpluimers on 2018/12/19

Since I tend to forget this: [WayBack] Spring4D How to correctly assign NULL to a Nullable type? this is correct? fDateTime = Null; or this? fDateTime := nil; – Jacek Laskowski – Google+

The preferred way is fDateTime := nil.

This is possible because of [WayBack] Delphi sorcery: How to create an operator overload that only accepts nil using a reference type (in this case interface) so no non-nil pointers can be passed:

type
  Nullable<T> = record
  strict private type
    Null = interface end;
  public
    class operator Implicit(const value: Null): Nullable<T>;
  end;

–jeroen

Posted in Delphi, Development, Software Development, Spring4D | 2 Comments »

Spring4D Conference

Posted by jpluimers on 2018/12/19

Do not forget the early bird sales ends soon for the Spring4D European Conference 2018 – Bergamo Italy, right before Easter 2019.

Both the original author and the current maintainer will be there, and it will be a great place to socialize with fellow Spring4D users.

Buy tickets: [WayBack] Spring4D Conference

Via:

–jeroen

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

Never ever put OutpugDebugString in code that is meant to run on production systems

Posted by jpluimers on 2018/12/18

I just saw this code in the Delphi RTL enabled for RELEASE builds of the procedure TThreadPool.TQueueWorkerThread.Execute; code:

{$IFDEF MSWINDOWS}
    OutputDebugString(PChar(Format('Thread Exiting: %d', [ThreadId])));
{$ENDIF}

Never, ever do this.

If you code review code that contains it: ensure it has some kind of compile time DEBUG conditional around it.

–jeroen

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

Getting started · MahdiSafsafi/DebugEngine Wiki · GitHub

Posted by jpluimers on 2018/12/13

Enabling stack traces in Delphi: [WayBack] Getting started · MahdiSafsafi/DebugEngine Wiki · GitHub:

Using DebugEngine stack trace when error occurs:

All what you need to do is to include DebugEngine.HookException unit into your project. And each time an error occurs, you will be able to get the stack trace from the point where the error occurred.

uses 
  DebugEngine.HookException;

{...}

procedure Foo;
begin
  try
    DoSomething;
  except
    on E: Exception do
      ShowMessage(E.StackTrace);
  end;
end;

You can get similar functionality with JCL.

Via [WayBack] Why Delphi (like other developer environments) natively not included full call stack for every exception? Or if this is possible, please tell me how (wi… – Jacek Laskowski – Google+

–jeroen

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

Initeresting CodeInsight ToolsAPI.pas bits IOTACodeInsightManager100, AllowCodeInsight, EditorTokenValidChars

Posted by jpluimers on 2018/12/12

Reminder to self: dig deeper in to this thread [WayBack] …In ToolsAPI.pas there’s IOTACodeInsightManager100 which is implemented by my custom CodeInsight manager… – Fl Ko – Google+

–jeroen

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

Still an interesting thought: I’d like the next update from Emb to NOT contain any new features at all – just a huge bundle of bug fixes

Posted by jpluimers on 2018/12/11

Still an interesting thought: [WayBack] Maybe we need a vote here but personally I’d like the next update from Emb to NOT contain any new features at all – just a huge bundle of bug fixes. We… – Chris Pimlott – Google+.

Especially the comments in it are well worth re-reading.

By now a new Delphi version should have been out, so I am curious how the balance between bug fixes and new features was.

Edit: Fixed bugs are features, so in my opinion Embarcadero should release only bug-fix updates and upgrades for at least two years.

–jeroen

PS: Nice G+ comment at [WayBack] Still an interesting thought: [WayBack] Maybe we need a vote here but personally I’d like the next update from Emb to NOT contain any new features at al… – Jeroen Wiert Pluimers – Google+:

Problem with new features is that they usually come with new bugs. Therefore new features take away developer capacity from fixing old bugs twice.

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

VirusTotal: Avira marks a Delphi built executable als false positive

Posted by jpluimers on 2018/12/06

Found out yesterday that Avira marks one of many Delphi 10.1 built executables as false positive; submitted, but VirusTotal shows it as false positive:

Related:

I think it was Avira too that interfered with my Delphi IDE compiling Delphi applications, especially resource compilation:

–jeroen

Read the rest of this entry »

Posted in Delphi, Development, Security, Software Development | 4 Comments »

Dependency Injection in Delphi: use Spring4D and Nick Hodges’ book

Posted by jpluimers on 2018/12/06

Over the past few months, various people asked me where to get started with Dependency Injection in Delphi.

First of all, get this book:

[WayBackDependency Injection In… by Nick Hodges [Leanpub PDF/iPad/Kindle]

This book covers Dependency Injection from A to Z.  In it you’ll learn about Constructor Injection, Property Injection, and Method Injection.  You’ll learn about the right and wrong way to use the Dependency Injection Container.

It’s well worth reading.

Then buy this book and continue reading; it’s more extensive but coming from a Delphi background it’s better to read Nicks’ book first:

[WayBackDependency Injection in .NET: Mark Seemann: 9781935182504

Dependency Injection in .NET, winner of the 2013 Jolt Awards for Productivity, presents core DI patterns in plain C#, so you’ll fully understand how DI works, covers integration with standard Microsoft technologies like ASP.NET MVC, and teaches you to use DI frameworks like Structure Map, Castle Windsor, and Unity.

Then start at these demo projects:

Finally read through these posts and what they link to:

Then compare what you learned with this:

Read the rest of this entry »

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

Delphi Indy “SSL routines:SSL23_GET_CLIENT_HELLO:http request” – means you get an http request, but expecting an https request

Posted by jpluimers on 2018/12/05

A client got this with Delphi Indy “SSL routines:SSL23_GET_CLIENT_HELLO:http request” and was confused.

The message means you get an http request, but are expecting an https request.

If you really want to, you can have one component service both http and https requests, though most of the time you really do not want to: you want to phase out http whenever possible.

Related: [WayBack] delphi – Can a single TIdHTTPServer component handle http and https request in the same time? – Stack Overflow

–jeroen

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

Behind the Scenes – Coolblue – alles voor een glimlach

Posted by jpluimers on 2018/12/05

The presentations from [WayBack] Behind the Scenes – Coolblue – alles voor een glimlach are on-line:

It was totally booked: [WayBack] Behind the Scenes – Coolblue – alles voor een glimlach

jeroen

Read the rest of this entry »

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