Jump to content

Emil Mustea

Members
  • Content Count

    12
  • Joined

  • Last visited

  • Days Won

    1

Emil Mustea last won the day on December 9 2018

Emil Mustea had the most liked content!

Community Reputation

6 Neutral

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. 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.
  2. Emil Mustea

    10.3.2 as next or waiting for 10.4?

    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.
  3. Emil Mustea

    Remote Desktop with ICS

    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.
  4. 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.
  5. 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.
  6. 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.
  7. 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.
  8. 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.
  9. Emil Mustea

    Directions for ARC Memory Management

    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); ...
  10. Emil Mustea

    Directions for ARC Memory Management

    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.
  11. Emil Mustea

    Directions for ARC Memory Management

    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?
  12. Emil Mustea

    Directions for ARC Memory Management

    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;
×