Emil Mustea
Members-
Content Count
12 -
Joined
-
Last visited
-
Days Won
1
Everything posted by Emil Mustea
-
Interfaces, to abuse or not abuse?
Emil Mustea replied to Clément's topic in Algorithms, Data Structures and Class Design
Be aware of: https://stackoverflow.com/a/20387132 It's a better way to use TFrame only as a view with minimum code and use a separate "controller" where to use aggregation and delegation. -
Please look at "RAD Studio 10.3.2" in the following link: https://community.idera.com/developer-tools/b/blog/posts/rad-studio-roadmap-may-2019 I think best option is to keep 10.3.2 for a while because 10.4 has deep changes: LSP for Delphi and unified memory management.
-
Remote Desktop with ICS
Emil Mustea replied to jbWishmaster's topic in ICS - Internet Component Suite
These programs first they try a direct connection - if the port is not blocked it works, if it's blocked and the router/firewall is UPnP, it adds an inbound rule which grants exterior access only for the lifetime of the program. Don't expect your company router to be UPnP enabled. If direct connection doesn't succeed then third-party server owned by TeamViewer/GotoMyPC/WebEx/etc is used as a middle man forwarding messages between those 2 parties, but usually works with direct connection. Establishing connection is not the hard part, having a very good real-time algorithm for capturing/transferring images/mouse without flicker/lag from one party to another is the hard part. -
Is there a component that allows me to include proper digital signatures
Emil Mustea replied to Dave Novo's topic in Delphi Third-Party
quick search: https://www.secureblackbox.com/kb/help/ref_howto_pdf_sign_sign.html https://www.gnostice.com/nl_article.asp?id=187&t=How_To_Digitally_Sign_A_PDF_Document_In_Delphi http://www.tmssoftware.biz/flexcel/doc/vcl/samples/delphi/printing-and-exporting/signing-pdfs/index.html I didn't try any of this. -
Smart Pointers - Generics vrs non-generic implementastion
Emil Mustea replied to pyscripter's topic in RTL and Delphi Object Pascal
To summarize: Who wants maximum performance like "classic" use it like this var obj := Shared.Make(TTestObj.Create)(); "obj" is object and will be free it at the end of the procedure; otherwise, use it: var obj := Shared.Make(TTestObj.Create); "obj" is interface and will be free it at the end of the block and every access has a small penalty of an anonymous method call. -
Custom Managed Records Coming in Delphi 10.3
Emil Mustea replied to Marco Cantu's topic in RTL and Delphi Object Pascal
instead of writing s.Value.Add('one'), you write s.Add('one'), where "s" is a record but point to the only member of that record, which is in our case a TStringList. So you have member lifting. -
Custom Managed Records Coming in Delphi 10.3
Emil Mustea replied to Marco Cantu's topic in RTL and Delphi Object Pascal
1. I get to used with inline declaration 🙂 2. You wrote "instance of a record" - in this case we need member lifting. If TAutoFreeRecord returns generic type of that parameter, then it's like the example I gave. -
Custom Managed Records Coming in Delphi 10.3
Emil Mustea replied to Marco Cantu's topic in RTL and Delphi Object Pascal
I think if we use copy constructor we can create smart pointers like this: procedure DoSomething(OtherParameters: string; New: TAutoFreeRecord); //here "New" record is created by copy constructor var s: TStrings; begin s := New.Of(TStringList.Create); s.Add('one'); s.Add('two'); //here "New" goes out of scope and will destroy "s" (custom destructor) end; or with inline declaration: procedure DoSomething(OtherParameters: string; New: TAutoFreeRecord); //here "New" record is created by copy constructor begin s := New.Of(TStringList.Create); s.Add('one'); s.Add('two'); //here "New" goes out of scope and will destroy "s" (custom destructor) end; It was very nice if managed records in 10.3 had member lifting. In that way we could escape declaring "New"; New.Of will return instead a record which the only member could be lifted and used as a TStrings. -
Directions for ARC Memory Management
Emil Mustea replied to Marco Cantu's topic in RTL and Delphi Object Pascal
Yes, you are right, we still need member lifting. Until then, the nicest remains Interface use like Primož said: uses Spring; var ms := Shared.New(TStringList.Create); ... -
Directions for ARC Memory Management
Emil Mustea replied to Marco Cantu's topic in RTL and Delphi Object Pascal
Sorry, it's my mistake. I forgot the "var": (inline declaration with type inference) begin var sl := New.Of(TStringList.Create); sl.Add("One"); sl.Add("Two"); //here the record "New" goes out of scope, runs the it's destructor which will free the instance on which "sl" points to end; Better: with inline declaration will stay alive until the block end, not until routine end. -
Directions for ARC Memory Management
Emil Mustea replied to Marco Cantu's topic in RTL and Delphi Object Pascal
quote from: http://blog.marcocantu.com/blog/2018-october-Delphi-ARC-directions.html If "managed records" from 10.3 have destructor like I understand, there is no need for default property/member lifting. Will be possible super cool (and readable) construct like this: begin sl := New.Of(TStringList.Create); sl.Add("One"); sl.Add("Two"); //here the record "New" goes out of scope, runs the it's destructor which will free the instance on which "sl" points to end; I hope I'm not missing something. Mr. Marco Cantu, can you confirm the "managed records" from 10.3 have destructor? -
Directions for ARC Memory Management
Emil Mustea replied to Marco Cantu's topic in RTL and Delphi Object Pascal
The quote is from: https://delphisorcery.blogspot.com/2015/01/smart-pointers-in-delphi.html Can somebody confirm that the "new" record type will have a default property? so will not have to write .Value in smart pointers. Indeed this will be really cool and really useful as automatic memory management: var s: Shared<TStrings>; begin s := TStringList.Create; s.Add('one'); s.Add('two'); //here "s" will be realeased automatically because is a record end;