For my link archive:
- [WayBack] GitHub – ulid/spec: The canonical spec for ulid
- [WayBack] GitHub – rs/xid: xid is a globally unique id generator thought for the web
–jeroen
Posted by jpluimers on 2020/12/15
For my link archive:
–jeroen
Posted in Database Development, Development, PostgreSQL, Software Development | Leave a Comment »
Posted by jpluimers on 2020/12/15
Basically the below thread goes like this: [WayBack] GExperts / Bugs / #92 Grep cannot handle UTF-16 and UTF-32 pas files
AAA
, but not when running your tool under BBB
; these files fail: xxx.txt
and yyy.txt
AAA
and which version of our tool did you run under BBB
AAA
, but succeeds under BBB
Part of the [WayBack] Short, Self Contained, Correct Example are indeed in it, but without more details it is hard to reproduce.
So without the reporter providing those details, nobody, especially not on open source projects, is going to fix it just on that bug report.
Via: [WayBack] It’s time for a gift to all Delphi developers, a new Release of GExperts. Happy Holidays! (But do spend some time with your family rather than testing G… – Thomas Mueller (dummzeuch) – Google+
Which highlights another conceptual problem from the same bug reporter: expecting a new version to have a regression of all open bugs against the new version.
That’s not how the world works, if it has ever worked that way. If your issue is not mentioned in any release notes, then assume nothing happened. If you want to bump it up, then provide more details.
–jeroen
Posted in Conference Topics, Conferences, Development, Event, How to report bugs, Issue/Bug tracking, Software Development | Leave a Comment »
Posted by jpluimers on 2020/12/15
Every now and then I see code, where a class descending from TComponent
implements some interfaces, only interface references are used to the instances, and the expected behaviour is that the instances will free themselves when all the references went out of scope.
Bummer: TComponent
by default is not reference counted.
It is when you assign VCLComObject
an IVCLComObject
which is hell to implement (Delphi provides two of them: TVCLAutoObject
and TActiveFormControl
. They sound heavey, and are).
Do not go that way. If you need some form of ownership in a class implementing an interface, then descend the class from TInterfacedObject
, and add a field of TComponent
that is the owner of things that need to be freed later on. In the destructor, free that field.
Something like this:
unit InterfacedObjectWithRootUnit; interface type TInterfacedObjectWithRoot = class(TInterfacedObject) strict private FRoot: TComponent; function GetRoot: TComponent; strict protected property Root: TComponent read GetRoot; public destructor Destroy; override; end; implementation destructor TInterfacedObjectWithRoot.Destroy; begin if Assigned(FRoot) then begin FRoot.Free(); FRoot := nil; end; inherited Destroy(); end; function TInterfacedObjectWithRoot.GetRoot: TComponent; begin if FRoot = nil then FRoot := TComponent.Create(nil); Result := FRoot; end; end.
–jeroen
Posted in Conference Topics, Conferences, Delphi, Development, Event, Software Development | Leave a Comment »