-
Content Count
3416 -
Joined
-
Last visited
-
Days Won
113
Everything posted by Lars Fosdal
-
I wonder if this was related to themes being disabled.
-
Initialize local variables at declaration
Lars Fosdal replied to PeterPanettone's topic in Delphi IDE and APIs
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 -
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.
- 29 replies
-
- delphi ide
- delphi
-
(and 2 more)
Tagged with:
-
Constructors + Destructors in class helpers?
Lars Fosdal replied to David Schwartz's topic in RTL and Delphi Object Pascal
Both class and record helpers could do with a real upgrade. The lack of inheritance and lack of support for Generics is crippling. -
Only us old-timers.
-
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.
- 29 replies
-
- delphi ide
- delphi
-
(and 2 more)
Tagged with:
-
Autocompletion for TEdits revisited
Lars Fosdal replied to dummzeuch's topic in Tips / Blogs / Tutorials / Videos
He recently and briefly resurfaced in Teams. https://www.theverge.com/2019/3/22/18276923/microsoft-clippy-microsoft-teams-stickers-removal -
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.
- 29 replies
-
- delphi ide
- delphi
-
(and 2 more)
Tagged with:
-
New VCL Style from DelphiStyles.com
Lars Fosdal replied to DelphiStyles's topic in Delphi Third-Party
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. -
New VCL Style from DelphiStyles.com
Lars Fosdal replied to DelphiStyles's topic in Delphi Third-Party
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. -
New VCL Style from DelphiStyles.com
Lars Fosdal replied to DelphiStyles's topic in Delphi Third-Party
I am at a loss for words. Do people actually use such styles? -
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.
-
Afaik, that info is outdated. Browsing other results for "google groups nntp" indicates there is none.
-
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.
-
It was pretty much dead, except for "new component spam".
-
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.
-
For an old thread with new content, you are positioned at the first unread new comment. If all new comments are shown on that page, the thread is marked as read. In the case that the following new comments "spill over" into one or more new pages of comments, I am not sure if you have to visit each page?
-
True. But changing the type of an xml field also requires the consuming xml parser to know that type has changed. So - if your client used the field as a number, converting the value into a double or integer - changing the content to a string would still be a breaking change, right? Hence, that is not really a feature of the format, since the actual interpretation depends on convention i.e. specification of parsing- and if the specification has changed, and your parser is still using the old spec - it breaks. But, yeah - we are off topic.
-
From what point of view? The standard XML parser barfs when a property appears that it is not aware of, while the TJson parser simply ignores it - so in that respect, Json appears as more resilient than XML. Edit: FYI, We generally pass most, if not all, numeric values as a string, since that gives us the NULL we need for numeric values as well.
-
My Bad - I had forgotten that you can't use GetDC for a printer. You need to use CreateDC. https://docs.microsoft.com/en-us/windows/desktop/printdocs/printer-output
-
Deep Dive into Design Patterns
Lars Fosdal replied to Primož Gabrijelčič's topic in Tips / Blogs / Tutorials / Videos
The book is on my desktop, under the 70-762 Developing SQL Databases book. I need to start reading. -
A more common issue could be if the file is accessible for read or not. Being written or otherwise held locked from another app, f.x. and whether a retry is desirable or not.
-
Wow, first time using repeat ... until
Lars Fosdal replied to Mike Torrettinni's topic in Algorithms, Data Structures and Class Design
You are right. I was confusing it with the i++ vs ++i effects. -
Wow, first time using repeat ... until
Lars Fosdal replied to Mike Torrettinni's topic in Algorithms, Data Structures and Class Design
@David Heffernan, isn't there a variation where the iteration is done before the statement? -
Can you set the TImage canvas info to the same properties as the printer canvas? From experience, the PPI / resolution / dimension puzzle comes into effect, and if the TImage is operating with different world coordinate resolution than the printer, you run into problems with scaling. If you use WinAPI GetDC and GetDeviceCaps on the printer - you should be able to get the info you need.