Jump to content

Lars Fosdal

Administrators
  • Content Count

    367
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Lars Fosdal

  1. Lars Fosdal

    10.3.1 has been released

    I use a cream colored background in the editor. I find that much calmer than looking at a black display.
  2. The joys of inherited problems. I am looking for a pattern or advice on how to best allocate a set of records to a specific requestor when there are multiple parallel requests, and there are multiple parallel request viewers. In practice: Allocate a set of deliveries to a user, when there can be multiple users requesting deliveries in parallel, and multiple users viewing the deliveries in parallel. The current SQL can give deadlocks both on allocations and on viewing, so something is definitively not right, and I need to improve on it. There is SO, where it all is an exercise in asking the question right... Are there other good discussion sites?
  3. Lars Fosdal

    New to Json

    https://jsonlint.com is very handy.
  4. I like the MS VS way better than the EMBT BDS way.
  5. Lars Fosdal

    P.I. Engineering XKeys keyboards

    I have a couple of XK16, an XK-60, and the XK-3 pedal that I rarely use these days. I used them a lot back when I was a PC gamer. Amazing hardware. Quirky software.
  6. Does any of you have experience with OPC over DCOM, using Delphi? We are looking for a library that is tried and known to work well, as there are a number to choose from at https://www.opcconnect.com/delphi.php
  7. Lars Fosdal

    Preferred OPC DCOM library for Delphi?

    Thanks, Uwe. We did consider that our best option as well. Now we just need Tetrapak to set up their OPC server correctly 😛
  8. Lars Fosdal

    Initialize local variables at declaration

    They would be uninitialized per iteration. Ref. AllocMsg - what can I say other than old habits die hard 😛 TPQ and ArtSum are regular objects retrieved from global shared pools and life cycle management happens elsewhere.
  9. I am quite fond of class variables of the Class of TSomeClass type. I use these for polymorph creation of class instance variables, typically handlers of some sort, but C# does AFAIK not have a similar construct, i.e. type as a variable. What are the best practice alternatives to using class variables? Am I limited to case / if then else factories or is there something more elegant around?
  10. Lars Fosdal

    Getit problem

    I wonder if this was related to themes being disabled.
  11. Lars Fosdal

    Initialize local variables at declaration

    This works well in our 10.3 production code, so it is not entirely useless. The THardAllocList is a TList<T>, though - not a TArray<T>. Several typeless inline declarations with initialization, and a inline string var with initalization. procedure TPSDTask_ImportCustomerOrders.ProcessHardAllocations(const aDeliveryId: Integer; const HardAllocations: THardAllocList); begin for var Alloc in HardAllocations do begin var TPack := GlobalTPackList.FindByTPackNo(Alloc.TPackNo, True, True); if Assigned(TPack) then begin var TPQ := TPack.GetQuantityOfArticleOnTPack(Alloc.ArticleId); var ArtSum := GlobalArticleSummaryList.FindByArticleId(Alloc.ArticleId); if ArtSum.QuantitiesAreEqual(Alloc.Quantity, TPQ) then begin if TPack.AllocatedDeliveryId = 0 then begin // Allokér TPack til leveranse var AllocMsg: string := ''; if TPack.AllocateToDelivery(aDeliveryId, AllocMsg, True) = rOK
  12. Lars Fosdal

    Forked VSCode for Delphi

    I use extensive logging, so that does clarify most of my threading issues - but sometimes, you simply need to get into the structures to understand where shit happens. At that point, I'd like my debugger to be well behaved. Unfortunately, it is not.
  13. Lars Fosdal

    Constructors + Destructors in class helpers?

    Both class and record helpers could do with a real upgrade. The lack of inheritance and lack of support for Generics is crippling.
  14. Lars Fosdal

    Decorating read-only controls

    Only us old-timers.
  15. Lars Fosdal

    Forked VSCode for Delphi

    Since it often is the actual thread interaction in a multithreaded server that is the cause for debugging - freezing other threads would be undesirable. I'd settle for a way to have breakpoints thread context aware so that I can choose to have breakpoints active in specific threads. A way to easily enable/disable breakpoints per active thread context.
  16. Lars Fosdal

    Autocompletion for TEdits revisited

    He recently and briefly resurfaced in Teams. https://www.theverge.com/2019/3/22/18276923/microsoft-clippy-microsoft-teams-stickers-removal
  17. Lars Fosdal

    Forked VSCode for Delphi

    Totally agree on the lure of RAD UI design and how it causes newbies to write code that is both relying on states in the UI as well as in their business model, instead of the UI reflecting states from the internal model and delivering changes to that model. As far as possible, I try to write my code without a UI, and I try to make the interfacing between the internal business logic and the UI as simple as possible, with the UI as far as possible being oblivious about why its values and settings are what they are. I often have separate reusable classes as glue between the UI and the biz objects, so that they remain isolated. The debugger is not fine when you venture past 32-bit single UI thread. The 64-bit Delphi debugger leaves so much to be desired, that it is better to do the debugging in a 32-bit version of the app. Multi-threaded debugging - combined with anonymous methods - often causes also the 32-bit debugger to stop working - such as not resuming after a break, or no longer breaking where it was supposed to. Debugging code that runs multiple identical threads is a challenge as there is no simple way to specify that you only want to debug a specific thread instance.
  18. Lars Fosdal

    New VCL Style from DelphiStyles.com

    I may exaggerate the problem, but there is a lot of abuse of the Flat UI as the new mantra of UI design. Windows 10 is packed with crappy flat UI, and so are a lot of web UIs too. F.x. I really miss proper use of ellipsis in menus and on buttons. I really miss the use of actual buttons - i.e. something that clearly appears as clickable. IMO - Applications are running on an OS-specific platform and should adhere to the OS behavior - so that when I change my OS skin, the application will follow, and clickable elements look the same everywhere. It is called consistency and helps with guiding the user. The ideal UI is "invisible" - and that does not mean that the button element is not visible, but that the behavior is so natural, you don't have to think about it. The UI should not get in the way of what you are using it for but lead and guide you through it so that you only need to think about what you are doing, and not about how you are doing it. For me, the best kind of skinning is the type that is able to visually adapt to the OS UI settings. My least favorite skinning is elements that visually distract from the flow of a UI, or that interfere with the "normal" UI metaphor for a platform. The great thing about DelphiStyles is that if the developer using it does it right - I can select a style that is pretty close to the standard OS style.
  19. Lars Fosdal

    New VCL Style from DelphiStyles.com

    We sure do, because this makes me cringe. Too much clutter. That said - I also hate the currently popular naked "flat UI" design philosophy which takes away most UI guidance and makes you guess if something is a link, a button, or just text - and you have to hover and/or click in the right places to find out.
  20. Lars Fosdal

    New VCL Style from DelphiStyles.com

    I am at a loss for words. Do people actually use such styles?
  21. Lars Fosdal

    Mark thread as read?

    That said - there may be other NNTP servers out there that propagate content from the usenet/alternet groups that also are on Google Groups, but if the group was initially made on Google Groups, it is not necessarily so that it is propagated out of Google Groups. Anyways - NNTP appears to be a thing of the past and there are other federation protocols replacing it in some arenas. IMO, it would have been nice if they revamped it with the necessary security/authentication measures.
  22. Lars Fosdal

    Mark thread as read?

    Afaik, that info is outdated. Browsing other results for "google groups nntp" indicates there is none.
  23. Lars Fosdal

    Using Indy for cross-platform TCP/IP

    My favorite approach is to have a connection thread handler that implements the "protocol" for the connection - using a input queue and an output queue to communicate with the owning thread, which in this case could be the main thread. This pattern is often called using mailboxes. I.e. the main thread posts a "task" to the thread input queue aka inbox, the thread loops with a small sleep to poll the inbox and deals with connects/disconnects and sends whatever needs to be sent over Indy to the remote host, collects the answer, and places it in the output queue aka outbox. The outbox can be polled in the main thread, or you can design the queue to post a message to the main thread, which then polls the outbox on receving the message. Protocol errors can also be posted as outbox events.
  24. It was pretty much dead, except for "new component spam".
  25. Lars Fosdal

    Mark thread as read?

    Google Groups do threading and there used to be NNTP support - but - it was a really bad spam hole so they removed the NNTP support.
×