-
Content Count
3416 -
Joined
-
Last visited
-
Days Won
113
Everything posted by Lars Fosdal
-
Enums and generics
Lars Fosdal replied to Mike Torrettinni's topic in Algorithms, Data Structures and Class Design
It is tricky to do a generic helper class for Enumerations, since there is no constraint that will allow you to use enum operators. There are workarounds, but not pretty ones. As for having to use a constant table - why not use the actual type name? There is System.TypInfo function to convert an enum to a string which reflects the actual type name. http://docwiki.embarcadero.com/Libraries/Sydney/en/System.TypInfo.GetEnumName Result := GetEnumName(TypeInfo(TProjectType), Ord(Self)); There also is the reverse http://docwiki.embarcadero.com/Libraries/Sydney/en/System.TypInfo.GetEnumValue -
@RDP1974 - I moved the post and delete the three "reposts". If you happened to post in the wrong category, ask a moderator to move it. Please don't do reposts/cross-posts.
-
Delphi implementation of Aberth–Ehrlich method and precision problem
Lars Fosdal replied to at3s's topic in Algorithms, Data Structures and Class Design
Wrong floating point precision when choosing overloads https://quality.embarcadero.com/browse/RSP-27488 Reduction of precision from integer to single rather than double https://quality.embarcadero.com/browse/RSP-27499 Another case of silent reduction of precision https://quality.embarcadero.com/browse/RSP-27500 -
Delphi implementation of Aberth–Ehrlich method and precision problem
Lars Fosdal replied to at3s's topic in Algorithms, Data Structures and Class Design
Can it be that some of the known FP expression precision issues come into play here? -
Invalid Compiler Directive: 'MESSAGES'
Lars Fosdal replied to Incus J's topic in ICS - Internet Component Suite
It was based on this: https://stackoverflow.com/questions/12788870/conditionally-compile-units-for-fmx-or-vcl I never mix VCL and FMX form code in projects myself, but I guess the problem here is that the "defined" depends on FMX.Types already being in scope. My approach would probably be to use an interface or a proxy class to hide the actual VCL/FMX accesses. -
No worries. The only benefit of custom draw is if the column title is wider than the actual column.
-
System.GetMemory returning NIL
Lars Fosdal replied to dummzeuch's topic in RTL and Delphi Object Pascal
@Kas Ob. - The 32-bit IDE is running on WoW. My IDE crashes too. Out of memory or it simply hangs in an internal deadlock. Several times per day. But - it has never crashed or trashed my Windows 10 Enterprise 1909 system. My uptime is typically about a month, i.e. until the next security patches. RAD Studio, Visual Studio, VS Code, PowerShell 7, MS SQL Server Manager, MS SQL Server, a large number of remote desktops, Excel, Outlook, OneNote, Teams, Discord, Chrome with too many tabs, Apex SQL Diff, Beyond Compare, VirtualBox, and the invaluable Process Hacker. I was thinking of the software you write - if it has page file issues - you either have HW spec issues, or you have allocation strategy issues. -
System.GetMemory returning NIL
Lars Fosdal replied to dummzeuch's topic in RTL and Delphi Object Pascal
"suffered from potential degradation" ? Either you suffer, or it is entirely potential. "The guys" ? -
System.GetMemory returning NIL
Lars Fosdal replied to dummzeuch's topic in RTL and Delphi Object Pascal
If your software has issues with page file involvement - your machines are not up to spec. -
Invalid Compiler Directive: 'MESSAGES'
Lars Fosdal replied to Incus J's topic in ICS - Internet Component Suite
If you need VCL/FMX conditions in your own code, this works: {$DEFINE HAS_VCL} {$IF DECLARED(FireMonkeyVersion) and (FireMonkeyVersion >= 16.0)} {$UNDEF HAS_VCL} {$DEFINE HAS_FMX} {$IFEND} -
System.GetMemory returning NIL
Lars Fosdal replied to dummzeuch's topic in RTL and Delphi Object Pascal
@Kas Ob. My last three laptops have had 32Gbs of RAM. Page file involvement is pretty rare. -
August 2020 GM Blog post
Lars Fosdal replied to Darian Miller's topic in Tips / Blogs / Tutorials / Videos
A forum is a place for reasoning and discussion. SO, not so much. What do you prefer? I guess most people go to SO to get an answer, provided one exists, and if not - use a forum. Edit: I gave up on SO for asking questions a long time ago. -
Surely there are better characters in Unicode that you can use? ↑ / ↓ #$2191 / #$2193 ˄ / ˅ #$02C4 / #$02C5 ▲ ▼ #$25B2 / #$25BC Optimal solution could be a custom draw, but... is it worth the effort?
-
August 2020 GM Blog post
Lars Fosdal replied to Darian Miller's topic in Tips / Blogs / Tutorials / Videos
But SO is not a forum. Questions that are ... unprecise ... get eradicated fast and hard. -
August 2020 GM Blog post
Lars Fosdal replied to Darian Miller's topic in Tips / Blogs / Tutorials / Videos
Looks like YAME. Yet Another Marketing Event. -
August 2020 GM Blog post
Lars Fosdal replied to Darian Miller's topic in Tips / Blogs / Tutorials / Videos
https://community.idera.com/developer-tools/p/forums has some traffic, but I wonder how they will address the need for sub-forums that are not strictly Delphi... -
August 2020 GM Blog post
Lars Fosdal replied to Darian Miller's topic in Tips / Blogs / Tutorials / Videos
We're gonna need more moderators And... perhaps some anger management classes -
QP: 30444 Component Palette - extra tabs for selecting components
Lars Fosdal posted a topic in Delphi IDE and APIs
Added this suggestion today. https://quality.embarcadero.com/browse/RSP-30444 -
Is interposer class really best to customize TPanel.Paint?
Lars Fosdal replied to Mike Torrettinni's topic in VCL
I use the same approach as @FPiette -
Why should I use good source control versioning system?
Lars Fosdal replied to Mike Torrettinni's topic in Tips / Blogs / Tutorials / Videos
Oh Emm Gee - that was scary 😄 -
The socket error is caused by something already using the port that you try to bind. F.x. if you run a http server, it defaults to port 80, but there may already be something else on your machine using port 80.
-
Class fields as parameters or refer to fields directly?
Lars Fosdal replied to Mike Torrettinni's topic in Algorithms, Data Structures and Class Design
I prefer using method parameters instead of fields as parameters for reentrancy and thread safety. This allows for a parallel model or recursive model Result := SharedObject.Search('Value'); vs this, which does not allow parallel calls or recursive calls SharedObject.SearchField := 'Value'; Result := SharedObject.Search; -
What "Project analyzers" out there.
Lars Fosdal replied to Tommi Prami's topic in Delphi IDE and APIs
I used to use Peganza, but I stopped renewing it, since I used it so seldom. My current approach in principle Build project with detailed MAP file enabled Extract the unit list to a separate file Load the unit list in a PowerShell script Define the include paths in the PS script Walk the paths/files and search for the objectives, using PS -
IDE plugin to remove Explicit* from .dfm files
Lars Fosdal replied to Tommi Prami's topic in Delphi IDE and APIs
I think I preferred to keep wondering, TBH. It seems very clunky.- 7 replies
-
- ddevextensions
- ide
-
(and 3 more)
Tagged with:
-
IDE plugin to remove Explicit* from .dfm files
Lars Fosdal replied to Tommi Prami's topic in Delphi IDE and APIs
I wonder what the back story for the existence of those Explicit.... fields are.- 7 replies
-
- ddevextensions
- ide
-
(and 3 more)
Tagged with: