Jump to content

Alexander Elagin

Members
  • Content Count

    198
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Alexander Elagin

  1. Alexander Elagin

    The interfaces in Delphi are bad?

    You mean something like CORBA interfaces as implemented as FreePascal? They are exactly this: a set of methods, not refcounted.
  2. Alexander Elagin

    Difference between Pred and -1

    Pred() and Succ() are simple iterators defined for enumerable simple data types. If only they could be overloaded for other data types (lists, collections, whatever... maybe even for yield support) their usefulness would be much higher.
  3. Alexander Elagin

    Drone control from mobile

    There is nothing difficult. You can use a serial port (if the host PC doesn't have one, a simple USB-to-COM adapter will do) as a simple communication channel - serial data exchange has been used for decades in multiple industrial applications built with Delphi. In fact, this is the area (custom hardware control / monitoring) where Delphi is used in many companies, but of course most of these applications never appear in public.
  4. Alexander Elagin

    what is the possibility of having a rest/soap webapi in Delphi 2007

    There is well known RemObjects SDK which I think still supports even Delphi 7. Some interesting information regarding JSON support is here: https://talk.remobjects.com/t/how-to-call-rest-server-with-json/18771 . A standard SOAP support has been a part of Delphi RTL since forever and usually works without problems.
  5. Alexander Elagin

    HxD hex, disk and memory editor

    I have been using HxD since.. well... 2009 or 2010, I think. This is an excellent tool!
  6. Alexander Elagin

    FireDAC Postgresql performance vs ADO SQL/Server performance

    ExpressQuantumGrid by default (in the Bound mode) fetches all data from the database table and then uses it for the fast local filtering / sorting / etc functions without further database operations (unless an update is required). There is another mode (Server mode) where data is fetched as needed but in this mode local grid filtering is limited.
  7. Alexander Elagin

    Why upgrade?

    You haven't tried to use the Linux debugger yet, have you? The 64-bit debugger in 10.1 is a piece of cake compared to 10.3 Linux one...
  8. 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...
  9. I always remember the Peter Gottschling's description of a program comment from his book "Discovering modern C++":
  10. 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/
  11. 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.
  12. 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.
  13. 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.
  14. 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;
  15. 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/
  16. 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/
  17. Alexander Elagin

    Any update on the v10.3.3 release?

    Deja vu
  18. 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.
  19. 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.
  20. 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; ....
  21. 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.
  22. 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.
  23. Alexander Elagin

    Call to create a form to return a value?

    Please check the controls in TCurrentCustJobsForm. The OK button (or whichever control is closing the form) must have ModalResult property set to mrOk or mrYes.
  24. Alexander Elagin

    Call to create a form to return a value?

    type TCurrentCustJobsForm = class(TForm) .... public class function Execute(out Value: Integer): Boolean; end; ...... class function TCurrentCustJobsForm.Execute(out Value: Integer): Boolean; var F: TCurrentCustJobsForm; begin F := TCurrentCustJobsForm.Create(nil); try Result := IsPositiveResult(F.ShowModal); if Result then Value:= F.SomeFieldOrPropertyOrEtc; finally F.Free; end; ...... if TCurrentCustJobsForm.Execute(iRecord) then (* Value selected and valid *) else (* user closed the form without selecting anything *)
  25. Alexander Elagin

    Rules for changing cursor to HourGlass and back

    Today one cannot write two simple methods and be happy. There must be classes, interfaces, factories, patterns etc - that's the serious approach . Have you seen the FizzBuzz Enterprise Edition ?
×