Jump to content

Alexander Elagin

  • Content Count

  • Joined

  • Last visited

  • Days Won


Alexander Elagin last won the day on October 30 2019

Alexander Elagin had the most liked content!

Community Reputation

64 Excellent

1 Follower

About Alexander Elagin

  • Birthday September 20

Technical Information

  • Delphi-Version
    Delphi 10.1 Berlin

Recent Profile Visitors

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

  1. Alexander Elagin

    Any Good tutorial on Parallel Programming Library?

    The problem is that OTL is unfortunately Windows only, where it wins hands down. On the other hand, PPL with all its quirks is cross-platform. When porting to Linux, I had to write two versions of the same code, ifdef'd to use OTL on Windows and PPL on Linux. Not an elegant solution but I did not want to touch the working Windows code...
  2. I always remember the Peter Gottschling's description of a program comment from his book "Discovering modern C++":
  3. Alexander Elagin

    TTimer equivalent with smaller interval

    Ok, I knew somebody must have implemented it already: https://blog.grijjy.com/2017/04/20/cross-platform-timer-queues-for-windows-and-linux/
  4. Alexander Elagin

    TTimer equivalent with smaller interval

    Look at CreateTimerQueue / CreateTimerQueueTimer. Nothing too difficult but needs a callback and probably an event and thread to wait on it.
  5. Alexander Elagin

    Why can't I install this monospaced font in Delphi ?

    Because this font family (JetBrains Mono) does not have some internal flag marking it as "monospace". Visual Studio / Windows terminal also do not recognise it as such. Let's wait for a service pack 😉 There is a discussion on this topic in Russian (https://habr.com/ru/company/jugru/news/t/484134/). In fact, I did not like the look of this font when I tried it in Notepad++, YMMV.
  6. I'd probably use a combination of shared memory and global event object. I.e. the sender and receiver both create a shared memory using CreateFileMapping() and MapViewOfFile(), then the sender fills the buffer located in the shared memory and sets the event, the receiver waits for this event and when it is activated grabs the data from the buffer and resets the event. The sender can also check the state of the event and if it is set (i.e. the receiver has not read the data yet) skip writing the next frame, etc. I do not think that the implementation is going to be too difficult.
  7. Like this? var S: String; F: TFileStream; B: TBytes; begin S := ''; F := TFileStream.Create('test.txt', fmOpenRead); try if F.Size > 0 then begin SetLength(B, F.Size); F.Read(B[0], Length(B)); S := TEncoding.ANSI.GetString(B); WriteLn('S = ', S); end; finally F.Free; end; end;
  8. Alexander Elagin

    How to use Open Street Maps with Delphi - cross platform?

    DevExpress also offers a map control which supports OSM: https://www.devexpress.com/products/vcl/map/
  9. Alexander Elagin

    How to get Linux installed?

    Yes, PAServer is needed to pull the necessary tools and libs from the target Linux machine. After this stage it is needed for deployment/debugging (but the Linux debugging in Delphi is a joke, simple WriteLn's in code can do better...) The best documentation I've seen so far is here: http://docwiki.embarcadero.com/RADStudio/Rio/en/Linux_Application_Development and here: https://chapmanworld.com/2016/12/29/configure-delphi-and-redhat-or-ubuntu-for-linux-development/
  10. Alexander Elagin

    Any update on the v10.3.3 release?

    Deja vu
  11. Alexander Elagin

    EMBT: Code Central is going away

    Maybe it is the time for someone with decent resources make a backup of the codecentral content (and structure, if possible)? I do not think that the data size is too huge given that it is built on the two decades old technologies. Probably it is just the matter of parsing the database and replicating it on something modern, probaly creating a better frontend.
  12. Alexander Elagin

    Best components for creating windows service apps

    The latest DDService version on the Torry site is dated 06 Oct 2013 : https://torry.net/authorsmore.php?id=7142 It contains packages up to XE5.
  13. Alexander Elagin

    Call to create a form to return a value?

    That's because the form must have a field or property of this type (like Customer: TCustomer), otherwise there is no place to copy the data from. Alternatively, if the form already has all the necessary data, you can manually fill the resulting record: .... if Result then begin Value.name := F.SomeNameField; Value.age := F.SomeAgeField; end; ....
  14. Alexander Elagin

    Call to create a form to return a value?

    It should have been class function Execute(out Value: TCustomer): Boolean; and TCustomer declared before the form, then everything would work.
  15. Alexander Elagin

    Call to create a form to return a value?

    Glad that it worked. Btw, now there is no need to have the FormClose handler with Action := caFree - the form will be freed by the calling class function (note the F.Free call), so you can remove this method too.