Jump to content

Der schöne Günther

Members
  • Content Count

    726
  • Joined

  • Last visited

  • Days Won

    12

Everything posted by Der schöne Günther

  1. Der schöne Günther

    ANN: New Swagger/OpenAPI Client Generator for Delphi

    Just for my understanding as I went through the blogpost: This is a code generator for the mORMot library, not the Delphi RTL, correct?
  2. TValue is designed to hold any type, not just "simple" ones. There is no way to marshal a string representation like "(record)" or "(interface @ 02549BD0)" back into what they once were. Maybe what you are looking for is a mechanism to serialize any record/object in memory into a string (or raw bytes), store them, and later de-serialize them?
  3. Der schöne Günther

    Weird new IOS Issue-

    That site seems geolocked to the US, I only get an error 403. GeoPeeker - A tool for viewing sites from different geographic locations
  4. Der schöne Günther

    TChart Performance of whole form

    It has been a few years since we last tried to use TeeChart Pro on iOS/FMX but it was horrible. Drawing issues, performance was abysmal and power consumption was also pretty bad. In case you have an active subscription, you can raise an issue with Steema. If not, you're probably better off using a WebView and a free Javascript charting library.
  5. Der schöne Günther

    "for i in" goes in reverse

    In cases like this, I really love code editors and environments that can tell me right away to what type something infers by just tapping Ctrl+Alt...
  6. Der schöne Günther

    Colors, complementary, triadic

    "Finding" the other colours is just adding 180° (complementary) or 120° (triads) on the hue value of your HSL colour. Source: https://de.slideshare.net/slideshow/basic-color-theory-for-presentation-design-part-ii/53370835#44
  7. Der schöne Günther

    Colors, complementary, triadic

    Wouldn't it be sufficient to convert a RGB color to HSL? There is System.UIConsts.RGBtoHSL(..)
  8. Der schöne Günther

    Parallel.For optimization

    It seems like you are constantly resizing arrays (or creating new ones). I am not sure how much you can tweak/optimize the memory manager that ships with Delphi, but you might want to investigate other memory managers, like this fork of FastMM4: maximmasiutin/FastMM4-AVX: FastMM4 memory manager for Delphi and FreePascal (free pascal/Lazarus). A fork with improved synchronization between the threads that gives performance benefits on thread-heavy applications. Proper synchronization techniques are used depending on context and availability, i.e. umonitor/umwait, spin-wait loops, SwitchToThread, critical sections, etc (github.com)
  9. Der schöne Günther

    Thread leaks report (FastMM4)

    Most probably because it is like that in many other languages.
  10. Der schöne Günther

    Thread leaks report (FastMM4)

    I am absolutely bewildered. That is absolutely not true. See: Methods (Delphi) - RAD Studio (embarcadero.com) or: https://stackoverflow.com/a/39110161 This is the first time I ever heard something like this.
  11. Der schöne Günther

    Thread leaks report (FastMM4)

    I am astounded at both your claim that throwing exceptions in the constructor should generally be avoided.
  12. Der schöne Günther

    Essential Delphi Addins survey

    Under "File Management & Deployment" -> What is "Delphi Docker"? Is it related to Docker? Where can I find more information?
  13. Der schöne Günther

    Is there a way to check is the "user Idle" (no interaction)

    auto close or logout when no mouse activity - VCL - Delphi-PRAXiS [en] (delphipraxis.net)
  14. Der schöne Günther

    Speech to Text for Writing Code.

    I have tried the Windows 10 built-in "speech to text" for a disabled person, just for dictating simple texts, and it is absolutely abysmal. Meanwhile, Microsoft has acquired Nuance and its "Dragon" software, but I think its focus is nowhere on writing code by speech. Dragon - The World's #1 Speech Recognition Software | Nuance UK
  15. Der schöne Günther

    CTRL+C to a console app vs. TerminateProcess(..)

    I have a stupid question on how to "gracefully" terminate a Windows console application. I am not very familiar with how processes are established, how parent/child relationships are handled, consoles, all that. I might be missing basics. What I am doing: I have a central application with a VCL interface It uses CreateProcess(..) to invisibly spawn some console applications in the background Some are kept running 24/7, some are just started on demand, crunch some data, then terminate These console applications get their stdIn, stdOut and stdErr pipes redirected to some pipes I created in my central applications, so I can easily process their output, and control them (if they get controlled from stdIn). So far, everything worked like a breeze My issue now: I am now integrating another console application that just runs 24/7 and has no way of gracefully shutting it down It will only end on either pressing CTRL+C on a regular terminal, or by sending it a CTRL_BREAK_EVENT from my central application by using GenerateConsoleCtrlEvent. I know that Windows will "clean up" after the process has ended, but I am not sure if this way of shutting the process down is still a bit too "rude" My question: The documentation of the GenerateConsoleCtrlEvent function states "All console processes have a default handler function that calls the ExitProcess function." The documentation on ExitProcess gets into more detail of what it actually does, but I have a hard time understanding the implications. After sending the CTRL_BREAK_EVENT to the console application, my application will still give it a few hundred milliseconds to power down until it will resort to TerminateProcess but never has to, because the console application will finish within less than 5 ms. I am just unsure whether I am doing it right or maybe there is a better way of "gracefully" shutting down a console application that does not handle CTRL+C at all.
  16. Der schöne Günther

    What do you think of "Local Global variables"

    I think that is the whole point of these nested methods, that they can access all the local variables that were defined before them? I never use them. I have only seen them in some legacy code of ours, and in all cases it made a tangled mess of spaghetti even worse 🍝 I'm sure someone can find a valid use case, though.
  17. Der schöne Günther

    VCL Form Designer Zoom

    I remember this being the first question I posted, back in 2013, when I first started with Delphi 🥲 I couldn't believe there was no such thing, so I asked.
  18. Der schöne Günther

    Waiting for anonymous methods to complete

    Another simple option could be creating a System.Threading.ThreadPool, putting tasks in it and just destroying the Threadpool in the destructor of your TSomeClass. The Threadpool destructor will finish all tasks that are queued.
  19. That is indeed annoying, but we haven't stumbled upon a "real" bug. We are using String/DateTime conversion for Iso8601 from the System.DateUtils all the time.
  20. Der schöne Günther

    Disabled floating point exceptions are problematic for DLLs

    Strictly speaking, this is not exclusively related to Delphi 12, your DLLs would have suffered the same, if they were called from another non-Delphi application. I believe that if your code relies on a certain FPU behaviour, it should either fail-fast by aborting if the FPU is not set correctly, or temporarily alter it, and then restore it to the previous state via try..finally. In any case, that would be your DLL would have to be changed.
  21. Der schöne Günther

    Good delphi learning sites for new team member

    That's a super interesting concept, but the content appears to be around 15 years of age.
  22. Der schöne Günther

    Delphi - Direct2D - Paintbox drawing is flickering

    I am not familiar with Direct2D, but confused nonetheless - Wouldn't you need a HWND to paint into? And a TPaintBox is not a window control, it's a simple TGraphicControl descendant - Meaning you may probably paint onto your form or into that very panel, but I fail to see how a Paintbox is even remotely helpful. Thanks for updating the code snippet. Didn't know you can also create a TDirect2DCanvas pointing to a Canvas, instead of a HWND.
  23. Der schöne Günther

    State of an uninitialised variables..

    Yes, but we're just mere humans, and we don't even have a compiler that will help us by generating a warning. Even the gods from Embarcaddero occasionally trip over this, here is an example straight from the RTL itself: https://quality.embarcadero.com/browse/RSP-18300
  24. Der schöne Günther

    State of an uninitialised variables..

    I wouldn't really call those features - Rather oddities, quirks or flat-out defects 😬 You can hardly blame yourself for not expecting something like that.
  25. Der schöne Günther

    Real time desktop colors change like filters

    This surely isn't trivial. I once was about to make small tool for inverting the colors of windows that did not support a "dark theme" but I never really got started with it. It seems that you can use the (now deprecated) Magnification API to (selectively) transform colors or run filters on the whole screen (or just selected parts of it like rectangle areas or selected HWNDs): Magnification API overview (Applying Color Effects)| Microsoft Learn There is also its successor, the Desktop Duplication API - Win32 apps | Microsoft Learn which I had only used for grabbing screen data, not manipulating it. So I cannot say if it's a feasible solution for manipulating the colors.
×