Jump to content

Lars Fosdal

Administrators
  • Content Count

    3510
  • Joined

  • Last visited

  • Days Won

    115

Everything posted by Lars Fosdal

  1. Lars Fosdal

    What .PAS file does a form use?

    Version Control.
  2. Lars Fosdal

    Introducing My Delphi TFuture PPL For Thread Safe UI

    TEventually<T> 😛
  3. Lars Fosdal

    Introducing My Delphi TFuture PPL For Thread Safe UI

    But you are still blocking, if looping around a wait. Are you going to put a ProcessMessages in that loop?
  4. Lars Fosdal

    Introducing My Delphi TFuture PPL For Thread Safe UI

    Wait = Block. Events = Asynch w/o block.
  5. Lars Fosdal

    Recommendation on VCL development on 4k monitor

    I have a 5K 40" Lenovo, that can be split into two "virtual" displays. I can set up different resolutions and scalings on those when I need to test HighDPI. Generally speaking, the test results are so disheartening that I still stick with 100% scaling in the OS, and use BDS in DPI-Unaware mode.
  6. Lars Fosdal

    Introducing My Delphi TFuture PPL For Thread Safe UI

    Generally speaking I prefer offloading background tasks to a threadpool in-queue. The threadpool messages the main thread when the work is done. The main thread then retrieves the response from the threadpool out-queue.(i.e. mailbox principle). If there are multiple parallell tasks (i.e. a job), the main thread will need to know that, and whenever a thread completes, check if it fullfill the needs of the job and then fire off whatever should happen after the job is complete. There really is no single best way to deal with background processing - except ensuring that the main thread is not blocked.
  7. Lars Fosdal

    How to use Swagger via MARS REST API?

    I see there are several attributes relevant for the Swagger data, such as RequestParamAttribute, but I see very few examples of use. Github: search for "Param]" (without the quotes) I woud suggest you experiment with those to see what you get.
  8. Lars Fosdal

    How to use Swagger via MARS REST API?

    Ah, so how to generate complete Swagger info from your MARS API?
  9. Lars Fosdal

    How to use Swagger via MARS REST API?

    Not sure if I understand your question? Swagger is API documentation. Are you looking for how to generate code for MARS REST based on a Swagger definition?
  10. Lars Fosdal

    EHF Invoice Norway

    @audi30tdi We do all our EHF invoices through third party systems, so I have no Delphi code to offer. Are you looking for the specification of the EHF invoice document or code for sending the document to an http endpoint?
  11. Lars Fosdal

    RAD Studio 12.3: E2213 Bad packaged unit format

    Isn't that the type of error you get when you try to link a .dcu that is for the wrong platform?
  12. Apple's RAM and disk prices are ridiculous, but personally I'd go for at least 24GB and 1TB. My MBP M1 has 32GB/2TB.
  13. Lars Fosdal

    certificate error

    Looks fixed now.
  14. I have the weirdest issue. I just installed a fresh Delphi 11.1 + patches on a new, fully patched Windows 10 Enterprise laptop. For some weird reason - I can't debug. Breakpoints don't break. Exceptions break shows assembly code, says it is mixed mode, but no source lines show, and I can't trace to next sourceline. Yes, I am in 32-bit debug mode. Yes, the project has the debug settings and debug info included. Yes, the output folders have full access for the current user. Yes, there is only one set of DCUs in the path. Yes, there is only one .EXE file. Edit: Yes, they are debug DCUs Yes, line endings are CRLF Yes, current user has local admin rights As soon as my app starts, the breakpoints are grayed out. Edit 2: It does not happen to all apps. The problem app is about 600k lines. Tiny apps and a larger 1100k line app - no problems. What am I missing? Update - Possible causes? A developer on a non-corporate laptop does not have this problem. Another developer on corporate laptops have the same problem as me on both new and old laptops. That seems to indicate a Windows policy may be a factor here. Anyways - workaround: Project | Options | Linking | Include remote debug symbols: A tick here gave working breakpoints for us.
  15. Lars Fosdal

    JSON benchmarks

    IMO, if you need multiple values for a field, you should use a list element. Duplicate key/value pairs in JSON just doesn't make sense. https://JsonLint.com does not like them either.
  16. Sorry, no updates. Not using Delphi much, except from small utils. Haven't checked on the problem since 12.3.
  17. Lars Fosdal

    Option to set read topic on Unread Content list

    AFAIK, no. You could run it through an RSS reader. Perhaps there is one that can ignore topics the way you desire?
  18. Lars Fosdal

    Option to set read topic on Unread Content list

    @ŁukaszDe You find a topic uninteresting, but it keeps reappearing? Have you tried the "Ignore this topic" for a thread you don't want to read again?
  19. Yeah, THAT surfaced the dreaded error [dcc64 Error] NonNullableConstraint.dpr(41): Type parameter 'T' must be a non-nullable value type Half-baked patches are no fun. Edit - Also noticed that the Error ID is lost when using MSBuild.
  20. @Anders Melander I just tried my example code which failed before the April patch in the 64-bit IDE, targeting 64-bit Windows. It no longer stops compiling. program NonNullableConstraint; {$APPTYPE CONSOLE} {$R *.res} uses System.SysUtils; type TMyClass = class function Select<T:Record>(const selector: string):TArray<T>; end; TNotifcationRow = record const Query = 'SELECT * FROM v_server_notifications'; public Id: Integer; Name: String; Data: String; ByWho: String; CreatedWhen: TDateTime; function DataAsId: Integer; end; TServerNotificationArray = TArray<TNotifcationRow>; { TMyClass } function TMyClass.Select<T>(const selector: string): TArray<T>; begin end; procedure Test; var MyClass: TMyClass; Res: TServerNotificationArray; begin MyClass := TMyClass.Create; Res := MyClass.Select<TNotifcationRow>('foo'); // <- E2512 Type parameter 'T' must be a non-nullable value type end; { TNotifcationRow } function TNotifcationRow.DataAsId: Integer; begin Result := 0; end; begin try Test; except on E: Exception do Writeln(E.ClassName, ': ', E.Message); end; end.
  21. It is fixed. It is no longer necessary to remove the record constraint to avoid the non-nullable type error. Edit: Woops - missed that 64-bit thing... do you mean the 64-bit target, or the 64-bit compiler?
  22. Lars Fosdal

    Creating an app to play Youtube videos

    You can reserve a video against embedding, so that might be a factor?
  23. Lars Fosdal

    Recommended string format to work with UTF-8 databases

    Correct me if I'm wrong - but isn't the Delphi String automatically converted to/from UTF-8 (or other native db string formats) by FireDAC / Driver?
  24. Why convert when you can enjoy the verbosity and indentation in all its glory? https://www.rocketsoftware.com/en-us/products/cobol/visual-cobol 🙂
  25. Lars Fosdal

    Copy MSSQL Database

    I use PowerShell + dbatools module to do backups and restores, as well as check for space, database schema sync, check contents of DB and run scripts, etc.
×