Jump to content

Lars Fosdal

Administrators
  • Content Count

    228
  • Joined

  • Last visited

  • Days Won

    3

Lars Fosdal last won the day on January 18

Lars Fosdal had the most liked content!

Community Reputation

60 Excellent

1 Follower

Technical Information

  • Delphi-Version
    Delphi 10.2 Tokyo

Recent Profile Visitors

197 profile views
  1. Lars Fosdal

    Pitfalls of Anonymous methods and capture

    Close, its a Self-Contained Compilable Example, sometimes also called a SSCCE, i.e. a Short SCCE. I'll rewrite the article for better readability.
  2. Is this related to databases?
  3. Lars Fosdal

    Pitfalls of Anonymous methods and capture

    There is one, but you "wasn't about to download some project from a file sharing site" (i.e. a zip file with source code from Google Drive)
  4. Lars Fosdal

    Pitfalls of Anonymous methods and capture

    @David Heffernan If you added me to your Ignore list here on DP, I would be totally fine with that.
  5. Lars Fosdal

    Pitfalls of Anonymous methods and capture

    Which is why my post specifically pointed out that there is a link to the SCCE in the blog post?
  6. Lars Fosdal

    Pitfalls of Anonymous methods and capture

    Yes, the examples leak. I didn't want to clutter it up with too much housekeeping code. Thank you, Uwe, for enlightening me on variable vs value capture. IMO, the compiler could need a hint or warning if a variable capture happens in a loop, because it is really easy to overlook. I use a number of variations on this to do dependency injection. It really helps with avoiding pulling too much project specific code into general code and keep the libraries isolated from each other. This code in particular is part of a web server that (now correctly) supports a configurable collection of JsonRPC protocol handlers. The web server knows nothing about Json, and the protocol handlers knows almost nothing about http.
  7. Code that looks correct, and appear to compile alright, but which doesn't execute well. Can you spot the error? See my blog post for a link to a SCCE. var Handler: THandlerClass; hType: THandlers; begin Broker.Clear; for hType in [foo, bar] do begin case hType of foo: Handler := TFoo.Create; bar: Handler := TBar.Create; end; Broker.AddHandler(Handler.OnHandle); end; end; https://larsfosdal.blog/2019/02/08/delphi-pitfalls-of-anonymous-methods-and-capture/
  8. Lars Fosdal

    10.2 Tokyo unable to report issues from within the IDE

    What do we know about the state of 10.3 Rio in this context?
  9. Lars Fosdal

    Cross-platform discovery of device name and user name?

    https://developer.android.com/training/id-auth/identify Would this be usable to get some sort of username / identity? Perhaps there is something similar on iOS as well?
  10. Does anyone know if there are existing libs out there that can extract this across all FMX platforms? - Current user - Device name
  11. Lars Fosdal

    Request for advice: FireMonkey and Frames

    So basically just like for VCL. Nice.
  12. Lars Fosdal

    Request for advice: FireMonkey and Frames

    @Rollo62 Can you exemplify how you "load via runtime into TRectangles" ? In my current app, I want to instantiate the frame onto a TTabItem.
  13. When creating frames runtime in VCL, there are a set of tweaks that need to be applied to make the frame behave properly after creation (setting parent/owner etc). Are there similar tricks needed for FireMonkey, and are there other pitfalls related to dynamically creating frames at runtime? Is it better to drop the frames on the main form at design time?
  14. SSD disks are usually connected via SATA (Serial ATA) or PCIe using the NVMe protocol. The first does not do parallel operations, while the second does. However, the speed benefit of the latter is when writing large amounts of data in parallel to individual areas. When deleting files, the OS is rewriting minor amounts of data in a shared area that needs to be integrity managed i.e. shared access locking, so I would suspect that there is no gain to parallelizing deletion of files.
×