Jump to content

Fr0sT.Brutal

Members
  • Content Count

    2268
  • Joined

  • Last visited

  • Days Won

    46

Everything posted by Fr0sT.Brutal

  1. Fr0sT.Brutal

    Find UDP Server

    What's so terrible in IPv6?
  2. Fr0sT.Brutal

    Find UDP Server

    Too complex IMHO. Bonjour even requires DLL. But some concepts could be borrowed indeed
  3. Fr0sT.Brutal

    Find UDP Server

    Send broadcast message with specific payload and address/port of sender
  4. Fr0sT.Brutal

    Having fun with Delphi

    It will produce implicit finally section for strings anyway so not a big problem I suppose.
  5. Fr0sT.Brutal

    Delphi's code formatter vs. GExperts' code formatter

    There's quite simple logic behind - block comments of one possible style inside comments of another possible style.
  6. +1 for comparing to browser. Moreover, you don't even need Wireshark, just the browser's Dev tools with which you even can modify requests before sending.
  7. Fr0sT.Brutal

    Having fun with Delphi

    My variant: Url := TPath.CreateX('example.com') / 'sub' / 'sub1' / 'onemoresub' / 'index.html'; 'X' means 'Posix' path delimiters. Initially I used only platform-defined one but I needed both simultaneously (Posix-style for network addresses and Windows-style for local paths)
  8. Fr0sT.Brutal

    Delphi's code formatter vs. GExperts' code formatter

    Good old patch (aka diff) files ))
  9. Fr0sT.Brutal

    Detecting update versions in defines

    Wow, at least in 10.3 it works even with class members {$if not declared(TObject.Create)} BOO! // will be ignored {$endif} upd But not this way: {$if not declared(TObject.Foo)} BOO! // will be ignored {$endif} Seems this check only works for members that actually exist
  10. No. I'm scaling a 8-bit float value in the approx range 0.0..1.0 to the range 0..2^64-1 Actually parameterless Random generates such value already (I wasn't aware of that overload). Even though Random doesn't include the high boundary of specified range, rounding will produce this value
  11. Fr0sT.Brutal

    Common callback functions, or not?

    Event handlers and callbacks are more or less the same, I mean event handlers are callbacks (which is more general term). Usually event handlers in follow some additional traditions: - they're procedures not functions and if they return a value, they do it as 'out' parameter - they're optional, that is, an app won't crash if no handler is assigned (though it might do nothing useful then) - most of the time they're called as a reaction to an input or event; often the call chain provides mechanism of cancelling of further process (either by setting a flag of raising EAbort) I use explicit naming as callback when I have an obligatory method that must be assigned and return a value. TGetNameCb = function : string of object; TGreeter = class GetNameCb: TGetNameCb; procedure SayHi; end; procedure TGreeter.SayHi; begin WriteLn('Hi, ', GetNameCb); end; Of course it's just a matter of taste TGetNameEvent = procedure(out aName: string) of object; TGreeter = class GetNameEvent: TGetNameEvent; procedure SayHi; end; procedure TGreeter.SayHi; var Name: string; begin if not Assigned(GetNameEvent) then raise ..; GetNameEvent(Name); WriteLn('Hi, ', Name); end;
  12. Which ones? Performance was not mentioned
  13. (Random(X)/X)*High(UInt64)
  14. I suppose he meant that any other text should be processed as buffers just like JS, .Net etc do.
  15. Fr0sT.Brutal

    MiTeC DFM Editor 8.0.0

    I've never had to use components without sources neither had to modify forms inside. My regrets if you face this case often
  16. Fr0sT.Brutal

    MiTeC DFM Editor 8.0.0

    @limelect thanks for explanations. I got rid of binary DFMs completely since I started using VCS. Other cases aren't actual for me.
  17. Fr0sT.Brutal

    MiTeC DFM Editor 8.0.0

    Could someone explain the real use-case of this?
  18. Why not? Self-contained repos are very good. The source repo could be down, or it could contain a version which introduced some breaking changes that won't compile, or it could be just untested. No problem in using 3rd party units in own projects, IMHO
  19. Fr0sT.Brutal

    Range checking in library code?

    I wouldn't bother disabling the check. 1) I doubt it causes any noticeable perf loss compared to calling a method and manipulating an item 2) Memory corruption/reading corrupted memory is far more serious than tiny slowdown 3) From my POV and understanding, compiler directives should only control operations with simple types. Classes are out of scope and should use their own checks and exceptions. 4) If you really want to give a user the fastest access method, something like .RawList property would be quite obvious and representative.
  20. Fr0sT.Brutal

    IBX components - licence

    I don't think so. I suspect that IBX license is the same as for other RTL/VCL sources.
  21. Fr0sT.Brutal

    Opus codec

    BASS library seems to handle what you need https://www.un4seen.com/
  22. Fr0sT.Brutal

    fun coding challenge

    Quite trivial with recursion
  23. Fr0sT.Brutal

    Organizing enums

    Pretty good option!
  24. That feeling when guys are proudly announcing updating a software that you've never heard about.
×