Jump to content

Lars Fosdal

Administrators
  • Content Count

    3323
  • Joined

  • Last visited

  • Days Won

    110

Everything posted by Lars Fosdal

  1. Lars Fosdal

    For..to..step in Delphi

    The duplicate SetLength was a lazy way of avoiding the corner case math check. It may occasionally reduce the length of an array, which afaik is not that costly? Some points for doing it this way: - it is a reusable pattern without embedded logic in the loop, which gives readable code - we could do it the same way for a TArray<double> with fractional fractional increments - a similar pattern can be used to fetch pre-calculated arrays There are so many ways to use Delphi
  2. Lars Fosdal

    For..to..step in Delphi

    Not efficient, not tested, but fun 😄 User exercise - make a Range.AsDouble(0, 5, 0.25) type Range = record class function AsInt(const aFrom, aTo: Integer; const aStep: Integer = 1): TArray<Integer>; static; procedure Test; end; class function Range.AsInt(const aFrom, aTo, aStep: Integer): TArray<Integer>; var ix, n: Integer; v: Integer; begin n := ((aTo - aFrom) + 1) div aStep; SetLength(Result, n + 1); v := aFrom; ix := 0; while v <= aTo do begin Result[ix] := v; v := v + aStep; end; SetLength(Result, ix + 1); end; procedure Range.Test; var ix: Integer; begin for ix in Range.AsInt(0, 11, 2) do begin Writeln(ix); end; end;
  3. Lars Fosdal

    Stay-on-top for just our app?

    You can also consider handling the application wide WM_ACTIVATEAPP where WParam = 0 when you lose focus and 1 when you get focus- and then explicitly hide/restore your floating forms.
  4. IMO, as I've requested before - EMBT really need to consider ARM64 and VCL for RAD Studio. https://www.neowin.net/news/microsoft-is-now-accepting-arm64-apps-in-its-windows-10-store
  5. New official Embarcadero forums online http://community.idera.com/developer-tools/ The sign-up/login is a bit prickly at first, so keep your login name / login email and password at hand, and request a password reset if your get into problems.
  6. True. My point was that relying on the const keyword as "security against tampering" is - as David also points out - a bit of a gamble.
  7. Another variation type PTestRec = ^TTestRec; procedure Test7( const rec: PTestRec ); begin rec.Change( 7 ); end; ... Test7( @rec ); Writeln( rec.Value ); shows 7
  8. Lars Fosdal

    Advice on starting to work with databases

    Whichever DB you decide to use - don't expose the DB as remote storage for to your game clients, but use a REST interface or similar instead. This isolates the game client from the storage technicalities, and you can change the databases without having to change the game client. It also reduces the risk of someone meddling with the DB - at least as long as you handle the REST data properly and ward off SQL injection attempts.
  9. Precisely 🙂 More often, it is about devs doing operational care and maintenance, first line support, etc - or devs doing tasks such as second line failure / error analysis and verifying that a problem can be reproduced before escalating.
  10. Lars Fosdal

    New in 10.3: IDE UI Improvements in the Main Window

    Code Insight/Completion, Error Insight, Background Compilation - all depends on various parts of the compilers.
  11. what if you first extract it as a pointer, and then cast the pointer to TWndMethod?
  12. Lars Fosdal

    RSS feeds for new posts ?

    Both look more or less the same in the compact view.
  13. Lars Fosdal

    RSS feeds for new posts ?

    Using The Old Reader (https://theoldreader.com/), it seems like the rssalltopics.xml (Forums) gives the best readability, while the 1-new-topics.xml (New Topics) sort of mangle the contents. Both should probably be modified to contain "Delphi PRAXiS" instead of the "New Topics" / "Forum topics" - as the name doesn't really show up in the RSS readers. Forums: Embedded graphics is nice. Forums: Easier to read code snippets Forums: Clickable URL is nice. Forums: Showing something that resembles the original formatting is nice.
  14. Lars Fosdal

    RSS feeds for new posts ?

    I just realized
  15. Lars Fosdal

    RSS feeds for new posts ?

    How do the two differ? Do you plan to offer both?
  16. Lars Fosdal

    http://community.idera.com/ login woes

    Same problem. I also see the site is lacking https.
  17. Lars Fosdal

    Managing Version Information Across Builds

    Like @David Heffernan suggests, we override the version numbers from our Continua CI build server, using the same version/build number across all apps within the separate branches, and updating them through FinalBuilder parameters. Current versions: Devel is 2019.3.12.11451 and Pilot just went from 2018.11.6.5035 to Live 2018.11.6.36 As you can see, the version is y.m.d.BuildNo where the day is the planned release date. Devel build numbers start at y.m.d.10001 and are periodically reset. Pilots at y.m.d.5001 -> 5xxx Live at y.m.d.xxx + 1 We are trying to limit ourselves to three major releases per year, and avoid introducing breaking SQL Schema changes between the major releases. We still have too many hotfixes. The previous Live version had build number 353. Note that doesn't mean we had that many actual roll-outs, just that many commits 😛
  18. Lars Fosdal

    New in 10.3: IDE UI Improvements in the Main Window

    I got 32Gb RAM, and I rarely go above 18-20Gb - so I got a lot of RAM to spare for IDEs excessively wasting memory.
  19. Lars Fosdal

    fast file searching, what do you recommend, please?

    Well, I can't be 100% certain - but the problem began when I used it, and never happened again after I stopped using it - and I did that for two different periods, on two different computers.
  20. Lars Fosdal

    fast file searching, what do you recommend, please?

    I mostly search in specific trees, with a specific file extension, and with a text or regular expression, using TextPad 8. Fast enough with SSDs.
  21. Lars Fosdal

    fast file searching, what do you recommend, please?

    I used it for a while, but it caused my PC to die unexpectedly from time to time.
  22. Lars Fosdal

    FavIcon

    Works perfectly 🙂
  23. Lars Fosdal

    IDE Error Reporting problem

    It seems it no longer is possible to report errors via the Tokyo IDE?
  24. Lars Fosdal

    User settings - split logic and UI

    I've abstracted my app configs, using a model similar to Windows Registry, that either store into a Json file, or into Registry. From the app side, it is read at load, and write through on changes to ensure that changes are not lost. I've used a key TStorageKey = (StoredForUser, StoredForAllUsers, StoredForApplication, StoredForSystem); that maps to different locations in registry or file system to determine the scope of the config.
  25. Lars Fosdal

    New in 10.3: IDE UI Improvements in the Main Window

    Tokyo is pretty good, but if I switch between a lot of projects to build - I still eventually run out of memory. I wouldn't mind a 64-bit IDE down the road.
×