Jump to content

Lars Fosdal

Administrators
  • Content Count

    3416
  • Joined

  • Last visited

  • Days Won

    113

Everything posted by Lars Fosdal

  1. Lars Fosdal

    Move objects to a second Data Module

    or Retire. Sometimes, there is new software out there that can do the job.
  2. Lars Fosdal

    macbook pro M1, running Delphi IDE

    Both this thread and the article you linked is nearly two years old.
  3. Lars Fosdal

    Is there a Delphi equivalent of WriteStr ?

    Added example: caveat - specifiers from the top of my head šŸ˜›
  4. Lars Fosdal

    Is there a Delphi equivalent of WriteStr ?

    I see. How many of these do you need to replace? If it is not a massive number, I would go for Format. It can both left and right pad with spaces if so is required, but converting the WriteStr formats will be a chore. WriteStr(s2, 'x = ', x:10:4, ', y = ', y:10, ', s = ', s:20); s2 := Format('x = %10.4f, y = %10d, s = %-20s, [x, y, s]); The usual f'up here is to either missalign the format string and the number of params, or have the wrong type variable in relation to the format specifier.
  5. Lars Fosdal

    Is there a Delphi equivalent of WriteStr ?

    UliGerhardt's solution could be wrapped - but it would be challenging to make threadsafe. It would treat s2 like a file, and write to the file. With a helper class, it would be possible to read the last written content out from s2 as a String again. Is it unthinkable to simply replace WriteStr(s2, with Writeln( ?
  6. Lars Fosdal

    Need a "Delphi programming guideline"

    They are trying. But - unfortunately they are trying the marketing way, not the grassroot growth way.
  7. There is another guide to the Delphi Programming language.
  8. No, you uploaded a compressed binary to GitHub. Link removed.
  9. Well, I guess it is logical... old fruit will turn "gammel" šŸ™‚
  10. gammel (Nor) = alter (Ger), but the etymologi is proto-german. Interestingly enough: age (Eng) = alder (Nor), which descends from aldr (old Nor), which again stems from alter (Ger)
  11. A good way to share sources and projects, is to use GitHub or similar.
  12. Lars Fosdal

    WideString.c_bstr() operation in 11.2

    @Roger Cigol Did you switch to the new compiler?
  13. I had to try it, @Attila Kovacs Lars Fosdal: write a poem about clouds in old norse My bad for imprecise instructions as it wrote a poem about "clouds in old norse" rather than about "clouds" in old norse. Lars Fosdal: pƄ gammelnorsk So I asked it to translate it to old norse - and albeit I am not 100% fluent, it is mostly understandable and looks credible. I fed finally fed that to Google Translate, which identified it as Icelandic - and that language is indeed closely related to Old Norse. Not perfect, but not half bad either. It can be a fantastic tool, that can create even more fantastic bullshit unless you are careful with your parameters and your proof reading.
  14. Lars Fosdal

    More precise countdown

    @johnnydp - What is the time precision that you need? Do you need start/one-shot/stop precision, or do you need start/repeat task every interval until/stop? If you are talking more accurate than 15.6ms (Windows default), you are most likely looking at highly CPU intensive custom code or kernel driver assisted timing. In addition, you need to factor in the code required to "complete" the event.
  15. That is great, because YAML - Yikes Awful Markup Language
  16. Lars Fosdal

    Unsupported 16-bit resource in *.RC file

    There is another possible cause: Some of your D6 .dfm files may be saved in binary format, and not as a text .dfm. In D6, open the .dfm files and see if you can view / save them as text.
  17. Lars Fosdal

    New Installation of Rad Studio 10.2 (Tokyo)

    That is about as relevant as commenting "Buy a Volkswagen" on a "How do I fix my Mercedes" post.
  18. Lars Fosdal

    Alphabet Index for navigation on ListView?

    /off-topic I am an Android user. I like apps that work the way Android works. The contact list in Android 13 f.x. shows the current letter group and lets you scroll faster or slower within the current group or to the next or previous group. My suggestion would be that you let the OS "playbook" decide how to navigate in the "native" way, rather to have one solution for all platforms? /on-topic I don't know what kind of component you would use for the letter list, but I assume it is a panel. You have the list of letters - BFTZ - i.e. you have the sizes you need? ch = Client window height n = number of letters ih = character height + spacing height TopOffset = (ch - (n * ih)) div 2; CharPos = 1 .. n CharOffset = TopOffset + ((CharPos - 1) * ih) From this you should be able to create the boxes that you need to do rendering and hit testing on?
  19. Lars Fosdal

    A book about Object Pascal Style Guide

    Less duplicated code -> less work to fix a duplicated error Less duplicated code -> less work to modify a duplicated behaviour Less code -> less chance for errors Less code -> easier to maintain Easier to maintain -> easier to add new features Modern quality code -> shorter time to market
  20. Lars Fosdal

    Alphabet Index for navigation on ListView?

    I assume you want to "stretch" the alphabet to vertically fill the available space. Is this a touch interface or a desktop UI? Is it possible that you could need to scroll the Alphabet list as well? I.e. make the vertical list longer than the height of the screen? It could become awfully fiddly on a mobile display otherwise.
  21. Lars Fosdal

    your own DB vs. 3rd-party?

    The more "fancy" you go, the more unusual challenges you'll meet. I like vanilla. It goes with everything, and the problems I get, have already been solved by others. I think the real question is - Do I need actual SQL abilities or do I just need a basic keystore (key = value(s)). If you need SQL, you need to know - How scalable does it need to be - Do I want to go free/self-hosted or paid/hosted (or the variations in between) - Usually, you get what you pay for. If you just need a keystore, someone else needs to chip in, as I've only done SQL DBs. MongoDB was all the rage for a while in the web store world. Not sure if it has been superceeded by something newer and more shiny? This is true - but even so, enterprise solutions are swinging heavily towards cloud hosting and third party services. That is worth noticing.
  22. Lars Fosdal

    IsValidDate fails after the Year 9999

    The next Y2K like problem is already in 2038, when the 32-bit int that holds a Unix timestamp wraps to a negative number. Aka The Epochalypse.
  23. Lars Fosdal

    A book about Object Pascal Style Guide

    Is it possible to do a divide and conquer - split up the problem into multiple revisions - modernize bit by bit, or is it a house of cards...
  24. Lars Fosdal

    Cross platform HTTP client with proxy support?

    I have a MBP M1 Pro, but I don't have a proxy service to try it on, otherwise I would.
  25. Lars Fosdal

    Cross platform HTTP client with proxy support?

    h:=THTTPClient.Create; h.ProxySettings.Create(<IP>,<PORT>,<USER>,<PASS>); h.Get(<URL>); h.Free; The AV problem is that line two should have read: h:=THTTPClient.Create; h.ProxySettings := TProxySettings.Create(<IP>,<PORT>,<USER>,<PASS>); h.Get(<URL>); h.Free; but, as the documentation says - it would not have made a difference, as the OS settings always take effect on MacOS (and iOS).
Ɨ