Jump to content

Fr0sT.Brutal

Members
  • Content Count

    2268
  • Joined

  • Last visited

  • Days Won

    46

Everything posted by Fr0sT.Brutal

  1. Fr0sT.Brutal

    Why compiler allows this difference in declaration?

    I never saw naming the parameters but saw all these tremenous lists of overloads: one param, two param. three param, ... scary
  2. Fr0sT.Brutal

    Image32 - 2D graphics library (open source freeware)

    Only actual if there ARE pull requests... which is just a few %s of overall users.
  3. Very nice idea for testing BTW - change system settings to something wild and see if software stands it.
  4. CheckSettingsTimerOnTimer: if SettingsFileModifiedDate > LastCheckDate then ReadAndApplySettings
  5. I'd mark deprecated all functions that use global FormatSettings and this variable itself. Otherwise it's quite hard to track and kill all hidden usages
  6. Once I stumbled upon system ANSI encoding discussion and checked my apps with another ACP set in OS. That was a refreshing experience.
  7. Insignificant difference IMHO
  8. The code is pretty clear (surprise) but could be refactored to a single big "if" making goto's unnecessary if ( ((EditControl is TCustomEdit) and (length(trim((EditControl as TCustomEdit).Text)) < MaxLen)) or ... ) then ... Probably the author wasn't aware of short boolean eval so he didn't use AND operator.
  9. Fr0sT.Brutal

    What is this syntax?

    I used to have enums starting from 1 when I needed 0 value to have "null" meaning so that empty structures would be inited with "null". However, I didn't want that null belong to enum itself. So I did TEnum = (enOne = 1, enTwo, ...) enNull = TEnum(0) However, this is not portable (FPC appears much more strict regarding range checking) and lacks RTTI which I use widely so I changed declarations to TEnumNullable = (enNull, enOne, enTwo, ...) TEnum = enOne..High(TEnumNullable)
  10. Fr0sT.Brutal

    Parsing Text search expression

    I'm only aware of C having such generators. Nope, it was just a note about something slightly related to the subject 🙂
  11. Fr0sT.Brutal

    Parsing Text search expression

    Yes you're right. Btw RTL has a TParser class but it's intended for reading DFM files. Not a something reusable
  12. try ... except on E: Exception do ... raise E; end Gives scary and mystic AV somewhat later after the problematic line in OS callstack. Real PITA to find and fix.
  13. Fr0sT.Brutal

    Parsing Text search expression

    There are tons of various parsers. The problem is the syntax required - everyone could need a different one. Moreover, the more specific parser is, the more efficient it appears. Sometimes you don't even need to write a parser - just define the grammar and generate parser code from it. Alas, I'm not aware of such possibility for Delphi.
  14. Fr0sT.Brutal

    memory usage of TJPGImage

    Solving similar issue in my map control,. I came to 3-level cache: - Hot: Tbitmaps - Medium: PNGImages - Cold: TMemoryStreams Capacity of all levels is limited by memory and GDI handles. Comments in OSM.TileStorage.pas unit explain decisions I made
  15. Fr0sT.Brutal

    upcoming language enhancements?

    Ternary operator is just a sugar for me. I find myself using it pretty rarely because it often grows so much that it starts looking monstrous. Much more useful is || construction from C-like langs that frequently replaces ternary: res = smth ? smth : default and res = smth || default Async/await is what I use everyday, everywhere so they're my favorites.
  16. Fr0sT.Brutal

    memory usage of TJPGImage

    Save an image as bitmap, then you'll get an idea how much it takes in memory.
  17. You could also prepare input for processing: remove ^[\.,\d], replace , to . and convert invariantly
  18. Fr0sT.Brutal

    Can I use the TidHTTP component for this?

    It does its job pretty well. I recently implemented a request routine with it and I'm pretty satisfied though some things look overcomplicated (credentials, for example)
  19. Fr0sT.Brutal

    FTPS Passive Mode

    Hmm, I had to add main host override for passive mode to my mod of inet suite for different reason - when connection is secure, TLS session is reused only if host addresses are the same. But connection establishes with hostname and passive mode responds with IP - obviously no match.
  20. Fr0sT.Brutal

    Bug with formatfloat in crossplatform ?

    Repeat
  21. Fr0sT.Brutal

    Bug with formatfloat in crossplatform ?

    BAD advice. Really bad. Global variables are evil. Moreover, this variable won't update on change either. In VCL changes are auto-applied by TForm's internal message handler. FMX doesn't track system changes even on Windows (checked with 10.3). So it's up to you to refresh them. I'd advice you to use your own instance of FmtSett received by TFormatSettings.Create(SysLocale.DefaultLCID) with all Format functions and refresh them periodically or when they're used. Probably there's more clever option but I'm not aware of any.
  22. Fr0sT.Brutal

    Bug with formatfloat in crossplatform ?

    What happens if you explicitly create new TFormatSettings with current locale and call the function with resulting record?
  23. Fr0sT.Brutal

    How to get the actual UTC time??

    Well - yes. T_loc = T_utc + TZ where T_loc and TZ are configurable. So even if T_loc is correct, T_utc will be incorrect with incorrect TZ. What I meant is that TZ change won't affect T_utc. Btw, any time sync utility will likely show that T_utc is wrong in this case.
  24. Fr0sT.Brutal

    For loop does NOT go to the max

    Ranges of for loop counter are calculated once loop starts and won't change later. You'll either have to add another for loop inside or use another kind of loop (while, until + manual counter check and increment)
  25. Fr0sT.Brutal

    How to get the actual UTC time??

    What makes you think timezone plays a role here?
×