Jump to content

Lars Fosdal

Administrators
  • Content Count

    3416
  • Joined

  • Last visited

  • Days Won

    113

Everything posted by Lars Fosdal

  1. Lars Fosdal

    Enums and generics

    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
  2. Lars Fosdal

    best component for web media player

    @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.
  3. 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
  4. Can it be that some of the known FP expression precision issues come into play here?
  5. 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.
  6. Lars Fosdal

    Grid Sort indicator

    No worries. The only benefit of custom draw is if the column title is wider than the actual column.
  7. Lars Fosdal

    System.GetMemory returning NIL

    @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.
  8. Lars Fosdal

    System.GetMemory returning NIL

    "suffered from potential degradation" ? Either you suffer, or it is entirely potential. "The guys" ?
  9. Lars Fosdal

    System.GetMemory returning NIL

    If your software has issues with page file involvement - your machines are not up to spec.
  10. 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}
  11. Lars Fosdal

    System.GetMemory returning NIL

    @Kas Ob. My last three laptops have had 32Gbs of RAM. Page file involvement is pretty rare.
  12. Lars Fosdal

    August 2020 GM Blog post

    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.
  13. Lars Fosdal

    Grid Sort indicator

    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?
  14. Lars Fosdal

    August 2020 GM Blog post

    But SO is not a forum. Questions that are ... unprecise ... get eradicated fast and hard.
  15. Lars Fosdal

    August 2020 GM Blog post

    Looks like YAME. Yet Another Marketing Event.
  16. Lars Fosdal

    August 2020 GM Blog post

    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...
  17. Lars Fosdal

    August 2020 GM Blog post

    We're gonna need more moderators And... perhaps some anger management classes
  18. Added this suggestion today. https://quality.embarcadero.com/browse/RSP-30444
  19. Lars Fosdal

    Is interposer class really best to customize TPanel.Paint?

    I use the same approach as @FPiette
  20. Oh Emm Gee - that was scary 😄
  21. Lars Fosdal

    Debug Expert

    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.
  22. 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;
  23. Lars Fosdal

    What "Project analyzers" out there.

    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
  24. Lars Fosdal

    IDE plugin to remove Explicit* from .dfm files

    I think I preferred to keep wondering, TBH. It seems very clunky.
  25. Lars Fosdal

    IDE plugin to remove Explicit* from .dfm files

    I wonder what the back story for the existence of those Explicit.... fields are.
×