-
Content Count
2268 -
Joined
-
Last visited
-
Days Won
46
Everything posted by Fr0sT.Brutal
-
What's so terrible in IPv6?
-
Too complex IMHO. Bonjour even requires DLL. But some concepts could be borrowed indeed
-
Send broadcast message with specific payload and address/port of sender
-
Having fun with Delphi
Fr0sT.Brutal replied to Attila Kovacs's topic in Algorithms, Data Structures and Class Design
It will produce implicit finally section for strings anyway so not a big problem I suppose. -
Delphi's code formatter vs. GExperts' code formatter
Fr0sT.Brutal replied to dummzeuch's topic in GExperts
There's quite simple logic behind - block comments of one possible style inside comments of another possible style. -
THttpCli get request fail with 404 Bad Request result
Fr0sT.Brutal replied to drazde's topic in ICS - Internet Component Suite
+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. -
Having fun with Delphi
Fr0sT.Brutal replied to Attila Kovacs's topic in Algorithms, Data Structures and Class Design
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) -
Delphi's code formatter vs. GExperts' code formatter
Fr0sT.Brutal replied to dummzeuch's topic in GExperts
Good old patch (aka diff) files )) -
Detecting update versions in defines
Fr0sT.Brutal replied to Vincent Parrett's topic in RTL and Delphi Object Pascal
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 -
Random unsigned 64 bit integers
Fr0sT.Brutal replied to julkas's topic in Algorithms, Data Structures and Class Design
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 -
Common callback functions, or not?
Fr0sT.Brutal replied to Mike Torrettinni's topic in RTL and Delphi Object Pascal
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; -
Random unsigned 64 bit integers
Fr0sT.Brutal replied to julkas's topic in Algorithms, Data Structures and Class Design
Which ones? Performance was not mentioned -
Random unsigned 64 bit integers
Fr0sT.Brutal replied to julkas's topic in Algorithms, Data Structures and Class Design
(Random(X)/X)*High(UInt64) -
Is the missing System.TStringHelper SetChars in Chars property on purpose ?
Fr0sT.Brutal replied to Rollo62's topic in RTL and Delphi Object Pascal
Available since XE6-7 IIRC. -
Is the missing System.TStringHelper SetChars in Chars property on purpose ?
Fr0sT.Brutal replied to Rollo62's topic in RTL and Delphi Object Pascal
I suppose he meant that any other text should be processed as buffers just like JS, .Net etc do. -
I've never had to use components without sources neither had to modify forms inside. My regrets if you face this case often
-
@limelect thanks for explanations. I got rid of binary DFMs completely since I started using VCS. Other cases aren't actual for me.
-
Could someone explain the real use-case of this?
-
Anyone knows of a good Delphi library encapsulating Stripe payments?
Fr0sT.Brutal replied to Andrea Raimondi's topic in Delphi Third-Party
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 -
Range checking in library code?
Fr0sT.Brutal replied to Stefan Glienke's topic in Algorithms, Data Structures and Class Design
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. -
I don't think so. I suspect that IBX license is the same as for other RTL/VCL sources.
-
BASS library seems to handle what you need https://www.un4seen.com/
-
Quite trivial with recursion
-
Organizing enums
Fr0sT.Brutal replied to Mike Torrettinni's topic in Algorithms, Data Structures and Class Design
Pretty good option! -
Embarcadero working with MVPs on (some) Delphi source code
Fr0sT.Brutal replied to Javier Tarí's topic in Tips / Blogs / Tutorials / Videos
That feeling when guys are proudly announcing updating a software that you've never heard about.