Jump to content

Lars Fosdal

Administrators
  • Content Count

    3323
  • Joined

  • Last visited

  • Days Won

    110

Everything posted by Lars Fosdal

  1. Having an AI that can point out bugs or suggest improvements in MY code, is far more interesting than having purely AI generated code, IMO. On the other hand, I use the ISO8601 methods in System.DateUtils 😛
  2. Lars Fosdal

    Need a "Delphi programming guideline"

    Another good read is https://www.oreilly.com/library/view/framework-design-guidelines/9780135896457/ It is not Delphi specific, but the advice is sound and actively applied to C#/.NET code by Microsoft. Also - the book I wish I had read during my education days. https://www.oreilly.com/library/view/code-complete-2nd/0735619670/
  3. Lars Fosdal

    Fatal Error F2039 - Could not create output file

    Have you excluded the output folder from AntiVirus software? Also, have a look at https://learn.microsoft.com/en-us/sysinternals/downloads/process-explorer which can reveal what process that is holding the file.
  4. I stumbled on this: https://www.parallels.com/blogs/hyper-v-mac/ It doesn't say anything about TPMs, though, but https://kb.parallels.com/123975 mentions being able to run VMWare under Parallells - yet still no word on TPMs. Is that an approach you have explored?
  5. Lars Fosdal

    Fatal Error F2039 - Could not create output file

    Have you checked if an instance of the output app is still running? Does the problem persist if you restart the IDE?
  6. I assume you've already read: https://kb.parallels.com/en/122702 on TPMs? Duh, yes you had ><
  7. Lars Fosdal

    StacTrace

    Or, you invest in EurekaLog or MADExcept.
  8. I recently moved my Hyper-V Windows 11 VM from my old laptop to my new laptop. After using the Hyper-V manager Export / Import features, there was one extra step to make the TPM for the old VM work on the new machine. That step was essentially migrating a couple of certificates from the old machine to the new machine. https://robinhobo.com/how-to-move-or-restore-a-windows-11-vm-in-hyper-v-with-tpm-enabled-shielded-vms/ (Also read the comments in the article for helpful tips) I also have Windows 11 for ARM running with TPM enabled under Parallells on a MBP M1 Pro, but since I only have one Mac, I have not researched migration there. I abandoned VMWare for Hyper-V some years ago.
  9. Lars Fosdal

    Free installation error

    @WhitePortal Either your firewall, your router, DNS / hosts file, or your internet service provider, or something on the Embarcadero side of things is not letting your traffic through.
  10. Lars Fosdal

    swagger help needed

    Is that built on TMS Biz?
  11. Lars Fosdal

    swagger help needed

    That looks very promising, @Wagner Landgraf! I already have the code I need for pulling live specs and accessing the APIs. How deeply tied are the TMS Biz classes? Is the loaded Swagger/OpenAPI document class suitable for "plugging in" a custom class generator? I already have a set of framework classes that I want to create code for.
  12. Lars Fosdal

    Better way to maintain a list in a database table??

    Today, if you are in the enterprise, splunk logging is all the rage.
  13. Lars Fosdal

    Better way to maintain a list in a database table??

    The format was made before JSON was a thing, but I should have had a tab as the separator after the header. The logs were meant to be human readable and referenceable text for RegEx searching.
  14. Lars Fosdal

    Better way to maintain a list in a database table??

    Local text logs are very handy and low cost. Just to give you some ideas... Since I have servers in many places, I ended up with a scheme that named the logfile something like this AppName.MachineName.LogContext.yyyymmdd-day-hhmm.pid-nnnn.log where the timestamp is when the logfile was created. That gives me a unique log name, across apps, servers and instances, and I can filter on the timestamp part of the name when I want to delete logs that is older than my limit. In memory, I write log entries to a circular buffer, and I have a background thread that "burst" write the log every second to avoid having the logging thread lagging on file operations. The logfile contains a "header" for each line which is applied when the log entry is added to the buffer. line number {hh:mm:ss,nnn (threadid) memoryload} log text Also, ensure that you don't write secrets to the log file. This particular logfile grows to about 250MB per day and rolls over to a new file at midnight. So, make sure that you have a mechanism that ensure your logs don't grow to infinity and that you delete the old ones, or your storage will suddenly be depleted. Database logs are great if accessing the machine where your process runs is cumbersome security-wise. But: If the database is unreachable, you have a problem - also, writing to a database is far more costly than writing to a local file.
  15. Lars Fosdal

    swagger help needed

    Swagger (2.0) had a name transplant and is now known as OpenAPI (3.0). And... I now have literally hundreds of Swagger 2.0 APIs to translate to Delphi... Any news from you guys on Delphi and Swagger libs? Edit: Oh, btw - there is code in source\data\EMS.ResourceTypes.pas (D11.1) that generates rudimentary Swagger 2.0 specs in Json or YAML, but it contains numerous TO-DO comments. I guess the author never got to do them, and there doesn't seem to be anything to read Swagger or YAML.
  16. Lars Fosdal

    D11.2 + FireDAC + MySQL 64 bit not working

    I stalk everyone. That is the job of admins and mods. If you can't edit or delete the comment anymore - just PM me with the comments you want removed. Also - large fonts and colors does not improve communications. I am having a deja-vu here...
  17. Lars Fosdal

    D11.2 + FireDAC + MySQL 64 bit not working

    Please delete any incorrect information in your previous comments.
  18. Lars Fosdal

    OAuth2 bearer token example?

    I ended up writing a small class around THTTPClient from System.Net.HttpClient. No need for the humongous REST.* classes.
  19. Lars Fosdal

    Delphi 11.2 unofficial LSP patch

    Any company would add such a disclaimer when releasing unofficial "patches". It means: If it didn't work, don't blame us.
  20. Lars Fosdal

    English Version of GLibWMI??

    Alternatively, simply spawn a cmd.exe and execute net start / net stop commands. We've been doing that for years without any problems.
  21. Lars Fosdal

    JSON text validation...

    @chmichael - Have you been hacked?
  22. Lars Fosdal

    I get value=none

    Please, be civil.
  23. Lars Fosdal

    order by string same integer

    uses WinApi.ShLwApi, ... type TCompareLogical = class(TComparer<String>) function Compare(const Left, Right: string): Integer; override; end; function TCompareLogical.Compare(const Left, Right: string): Integer; begin Result := WinApi.ShLwApi.StrCmpLogicalW(@Left[1], @Right[1]) end; procedure TForm1.Button1Click(Sender: TObject); var LArr: TArray<string>; begin LArr := ['1','1.1','1.1.1','1.2.1', '1.1.1.1','1.1.1.2','1.1.1.3','1.1.1.4','1.1.1.5','1.1.1.6','1.1.1.7','1.1.2' ,'1.1.2.1','1.1.2.2','1.1.3','1.1.3.1','1.1.4','1.1.4.1','1.1.4.2','1.1.5','1.1.5.1','1.1.6','1.1.6.1' ,'1.1.6.2 ','1.2','1.2.1.1','1.2.1.10','1.2.1.11','1.2.1.2','1.2.1.3','1.2.1.4','1.2.1.5' ,'1.2.1.6','1.2.1.7','1.2.1.8','1.2.1.9' ]; var Comp := TCompareLogical.Create; TArray.Sort<string>(LArr, Comp); Memo1.Lines.AddStrings(LArr); Thanks, @Stefan Glienke, I didn't know about that function. I also did not know about HIERARCHYID in SQL, so thank you for that one, @mofareh ORDER BY Cast ('/' + acc_numb + '/' AS HIERARCHYID)
  24. Lars Fosdal

    "Always break line between else and if" vs. comments

    Well, I am not that consequent, so I'll make do, doing it manually. It did take me 30+ years to develop this style for readability, though. One of the benefits of breaking before then, is that it becomes easy to comment out parts of the if condition. One of the benefits of the hanging indent on single line statements, is that it is easy to spot where the full statement ends. Readability is cruical. Maintainability improves with readability.
  25. Lars Fosdal

    OAuth2 bearer token example?

    LOL, no 😄
×