-
Content Count
3416 -
Joined
-
Last visited
-
Days Won
113
Everything posted by Lars Fosdal
-
A Curious Inheritance Problem... what pattern solves it?
Lars Fosdal replied to David Schwartz's topic in RTL and Delphi Object Pascal
We chose to do wrapper classes that further abstract the actual database types away from our code. Hence, in our code, there is no difference between running a BDE wrapped ADO connection and a FireDAC connection. Those classes use old school encapsulation to hide such differences from our code with very little overhead. -
TJson - Strip TDateTime property where value is 0?
Lars Fosdal replied to Lars Fosdal's topic in Network, Cloud and Web
Thanks! Neither suggestion is "perfect", but that gives me something to work with. I wonder how expensive it would be to do suggestion 1 for every structure that I use? There are supposed to be ways to plug in validators and converters for TJson & family, but the documentation is non-existent, and I don't want to take time to reverse engineer it all. -
We do all data change via SPs of which some do not do explicit transaction handling. The current SP call handling will detect if the call was a deadlock victim and rerun it if necessary - but that basically escalates the risk of yet another deadlock. The bigger sites have nearly a hundred pickers - so the odds for concurrent access = inevitable. We need to identify where we do not need exclusive access and explicitly use NoLock where appropriate. We need to identify where transactions will be feasible / required. We need to identify a best practice for resource allocation. The challenge is that the rules are complex and the dataset is dynamic (pallets are emptied and replaced many, many times during a day). f.x. get the best pick position for n items of article x with date requirement y which has the best fit for our pick route and least incoming traffic. To further complicate it, different clients have different rules for date requirements due to longer transports or specific rules per article for shorter requirements due to high turnover. The list of these varying parameters go on and on. If two clients make the same request at the same time - one has to be the winner of what may be a scarce resource, while the other needs a viable plan b. The pick request may consume the remaining items on one pallet, and then grab the rest from the next pallet - if there is one. To further complicate it, the allocation may need to be split onto multiple deliveries to multiple clients within the pick order. What is blatantly clear is that we currently are not doing it the optimal way.
-
Position filled - TINE SA - Norwegian language mandatory
Lars Fosdal replied to Lars Fosdal's topic in Job Opportunities / Coder for Hire
We found our man. -
Possible bug in debugger for Delphi 10.3.1
Lars Fosdal replied to Sherlock's topic in Delphi IDE and APIs
Debugger improvements were on the most recent roadmaps, wasn't they? -
Does anyone recognize that seemingly hardcoded address? The call stack indicates that it happens in Rio 10.3.1 source - but searching the source does not yield anything. Can it be Eurekalog that tries to tell me something about referencing a deleted or inaccessible piece of memory? #BAD: EAccessViolation: Access violation at address 0040CEEC in module 'MyApp.exe'. Read of address DEADBEE7. DBServer\INDUSTRIELL\DBName # 3017235 20.03.2019 13:23:06 (Brukerinterface, CRITICAL) MyApp_ClientId @ [0040CEEC] System._UStrAsg __________ CallStack [0040CEEC] System._UStrAsg [01561AF4] System.Generics.Collections.pas.{GridSet}TGridSet.TFieldValue<System.string>.SetValue (Line 4745, "System.Generics.Collections.pas") [0156241F] System.Generics.Collections.pas.{GridSet}TGridSet.TFieldValue<System.string>.CopyRow (Line 4745, "System.Generics.Collections.pas") [01558452] GridSet.TGridSet.CopyRow (Line 1002, "GridSet.pas") [01B92885] frmPSDExpeditionDeliveries2.TDeliverySet.UpdateFromDeliverySet (Line 4108, "frmPSDExpeditionDeliveries2.pas") [01B8F919] frmPSDExpeditionDeliveries2.TDeliveryGrid.RefreshByRouteList (Line 3671, "frmPSDExpeditionDeliveries2.pas")
-
Read of address DEADBEE7. - Source of this raise?
Lars Fosdal replied to Lars Fosdal's topic in General Help
Excellent analysis, Remy. As I often do, I did not ask the right question - which should have been: What sets dead memory references to $DEADxxxx? RTL? EurekaLog? OS? -
Delphi pitfalls: Enumerated types and for loops
Lars Fosdal posted a topic in RTL and Delphi Object Pascal
Not all for loops are created equal.Considerfor x in [value1, value2, value3]You would expect to see x vary in the order of the values in the list. However – if x and the values are of an enumerated type, looping the “list” does NOT loop in the apparent order of the constant, but in the order of the enumerated type declaration, such as it would for any set. Example at: https://larsfosdal.blog/2019/02/18/delphi-pitfalls-enumerated-types-and-for-loops/- 39 replies
-
- pitfall
- enumerated type
-
(and 1 more)
Tagged with:
-
It would have been so nice if the Tabs menu had been sorted by most recently used on top!
-
TurboPower component sets sub forums.
Lars Fosdal replied to Ian Branch's topic in Community Management
@Daniel - Sounds like a good idea, or what? -
Read of address DEADBEE7. - Source of this raise?
Lars Fosdal replied to Lars Fosdal's topic in General Help
The question is: Which programmer? What raises the AV? -
Read of address DEADBEE7. - Source of this raise?
Lars Fosdal replied to Lars Fosdal's topic in General Help
Also spotted: Read of address DEADC00B. Normally I'd expect to see things like this EUseAfterFreeError: Application made attempt to call method of already deleted object: $071EC5A0 OBJECT [TMyClass] 404 bytes. -
-
Ref. paths and VCS systems... We use standard paths C:\SomeFolder\Projects Common ThisCollection ThatCollection External Lib1 Lib2 Proj1 Proj2 We also use a $BIN environment var to direct the project outputs. Allows the team members great freedom for where to put their source, and where to direct the output. and try to ensure that all project search or include paths are on this form ..\Common\ThisCollection Those are stored in the .dproj which can be committed to the VCS. That also allows me to check out various versions Projects <- my typical working branch switched between trunk/pilot/live Projects.Rio <- while still on Tokyo, but testing Rio Projects.Trunk Projects.Pilot Projects.Live
-
Somewhat off topic, but related. Ctr+-F12 gives you a list of units to open, and I assumed it was from the search paths and project paths, Turns out that it also will look at the .dpr uses statement. Ideally, the paths should be relative... uses SomeUnit in '..\RelativeFolder\SomeUnit.pas' But, I had a stale test project in my project group where the uses path used an explicit path uses SomeUnit in 'c:\Obsolete.Path\to\RelativeFolder\SomeUnit.pas' So, pressing Ctrl+F12 gave me both of these - even if Obsolete.Path didn't exist.
-
I usually limit NOLOCK to queries for - data that is used as viewing info (i.e. not acted upon) - data that are currently in the custody of the client (i.e. not likely to be changed by other processes)
-
For Windows, the norm would be to install the font. AddFontResource could be used, but as you demonstrated, it doesn't seem to work as intended? For MacOS, I would also assume that installing the font is recommended. I've not used custom fonts with FMX on Android or iOS, so I can't answer that.
-
I literally do that failing Generics Ctrl-Click several times a day. I guess I am a slow learner 😛 I also wish that the Insight mechanism would deduce the most likely class types in scope and let me select one as jump target, and not ALWAYS send me to the virtual/abstract declarations of the base class.
-
Virtually, yes. Seriously busy days atm. Themed IDE = Lipstick on pig. I just deadlocked the IDE while trying to abort a compile/run - F9 then Escape -> Not responding.
-
Is there a FixPack for 10.3.1 ?
-
The new IDE skinning is a disaster. So! freaking! slow!
-
What happens if you install the font in Windows and just try to use it the same way as any other font? (Saw that was answered already). AddFontResource is a WinAPI call, so if you plan for cross-platform FMX code, you should not use it. Also, https://docs.microsoft.com/en-us/windows/desktop/api/wingdi/nf-wingdi-addfontresourcea says that return value for success = the number of fonts installed, and 0 = failure.
-
Read queries can lock and be deadlocked in MS SQLServer. https://aboutsqlserver.com/2011/09/28/locking-in-microsoft-sql-server-table-of-content/
-
Grammarly is a nice Chrome plugin for spell-checking in any edit box. https://chrome.google.com/webstore/detail/grammarly-for-chrome/kbfnbcaeplbcioakkpcpgfkobkghlhen
-
Also, if it is your own old post, you can also check your activities on your profile.