-
Content Count
2268 -
Joined
-
Last visited
-
Days Won
46
Everything posted by Fr0sT.Brutal
-
https://github.com/ccy/lzmasdk/tree/57cdd679924d4dc2747a1cdbbe1134e277a9d28a/Delphi
-
Comparing with tolerance is the only way of comparing floats isn't it? I wrote a little test procedure RunCompare(Epsilon: Double); const Base: Double = 0.1; var i: Integer; res: Double; begin res := 0; for i := 0 to MaxInt do begin if CompareValue(res, Base*i, Epsilon) <> EqualsValue then begin WriteLn( Format('Epsilon is %.17f: deviation at step %d', [Epsilon, i]) ); Exit; end; res := res + Base; end; end; procedure TestCompare; var i: Integer; EpsilonDiv: Int64; begin RunCompare(0); EpsilonDiv := Trunc(10E16); for i := 0 to 16 do begin RunCompare(1/EpsilonDiv); EpsilonDiv := EpsilonDiv div 10; end; end; it outputs Epsilon is 0,00000000000000000: deviation at step 8 Epsilon is 0,00000000000000001: deviation at step 3 Epsilon is 0,00000000000000010: deviation at step 8 Epsilon is 0,00000000000000100: deviation at step 29 Epsilon is 0,00000000000001000: deviation at step 73 Epsilon is 0,00000000000010000: deviation at step 262 Epsilon is 0,00000000000100000: deviation at step 928 Epsilon is 0,00000000001000000: deviation at step 2512 Epsilon is 0,00000000010000000: deviation at step 7415 Epsilon is 0,00000000100000000: deviation at step 23039 Epsilon is 0,00000001000000000: deviation at step 75679 Epsilon is 0,00000010000000000: deviation at step 261471 Epsilon is 0,00000100000000000: deviation at step 942813 Epsilon is 0,00001000000000000: deviation at step 2489005 Epsilon is 0,00010000000000000: deviation at step 7379011 Epsilon is 0,00100000000000000: deviation at step 23073610 Epsilon is 0,01000000000000000: deviation at step 76188297 Epsilon is 0,10000000000000001: deviation at step 264487878 0 is the value auto-calculated from both operands. As you can see, this epsilon starts to fail already after 8th step. So it seems one should provide explicit sane Epsilon for each Same|CompareValue call to be sure the desired result is achieved
-
Function with 2 return values ?
Fr0sT.Brutal replied to Henry Olive's topic in RTL and Delphi Object Pascal
Obviously for those applications that don't require ref count. And it could simplify importing interfaces from DLLs -
Function with 2 return values ?
Fr0sT.Brutal replied to Henry Olive's topic in RTL and Delphi Object Pascal
Well, they could change things to this: IPureInterface = interface end; IRefCountInterface = interface(IPureInterface) ... end; IUnknown = IRefCountInterface; and leave implicit default inheritance from IRefCountInterface. -
Function with 2 return values ?
Fr0sT.Brutal replied to Henry Olive's topic in RTL and Delphi Object Pascal
Analogy: one person could have blacksmith, cooker and plumber skills (implement these interfaces) and he could easily pass professional requirements (type check) because sets of skills are defined globally (interfaces declaration). So when somebody looks for a cooker (method with parameter of that interface) the person is allowed. Contrary, another person is blacksmith just because his father was blacksmith and taught him (inheritance). He can add some skills (implement new set of methods) but they will be personal and won't pass professional requirements (type check). -
ANN: Better Translation Manager released
Fr0sT.Brutal replied to Anders Melander's topic in Delphi Third-Party
Fair point -
ANN: Better Translation Manager released
Fr0sT.Brutal replied to Anders Melander's topic in Delphi Third-Party
Adding to binary is an x-platform way but if targeting only Windows, isn't it better to use UpdateResource ? And what's the sense of signing a file and then struggling with the signature instead of signing the prepared binary with all modules included? -
Function with 2 return values ?
Fr0sT.Brutal replied to Henry Olive's topic in RTL and Delphi Object Pascal
We could if Delphi supported multiple inheritance or mixins. But now - no, they're not much more than usual classes. -
Function with 2 return values ?
Fr0sT.Brutal replied to Henry Olive's topic in RTL and Delphi Object Pascal
And I wish there were pure interfaces without that refcount boilerplate. Two completely different models (required set of methods and refcounting) were mixed into one type. -
ANN: Better Translation Manager released
Fr0sT.Brutal replied to Anders Melander's topic in Delphi Third-Party
That was my question as well but from what Anders said I understood that language resources are built on the basis of compiled exe. Anyway the build script (topic starter is using build scripts isn't he?) could run two passes so the issue is solved. -
Break the task into steps. Implement all the steps you can. Ask for hints on the steps you can't.
-
Compare two TIntegerDynArray
Fr0sT.Brutal replied to shineworld's topic in RTL and Delphi Object Pascal
Guys you're saving on matches. CompareMem will eat all these nano-optimizations. -
ANN: Better Translation Manager released
Fr0sT.Brutal replied to Anders Melander's topic in Delphi Third-Party
Ah, that scheme. I was thinking about text files. Anyway resources could be added at post-build stage and application could extract them at 1st run and then relaunch. However, I agree this is the task for installer -
Function with 2 return values ?
Fr0sT.Brutal replied to Henry Olive's topic in RTL and Delphi Object Pascal
With changeable bits. I think it perfectly maps to Generics 😄 -
Function with 2 return values ?
Fr0sT.Brutal replied to Henry Olive's topic in RTL and Delphi Object Pascal
Guys don't you argue what's better - pliers or screwdriver? -
ANN: Better Translation Manager released
Fr0sT.Brutal replied to Anders Melander's topic in Delphi Third-Party
As resources -
ANN: Better Translation Manager released
Fr0sT.Brutal replied to Anders Melander's topic in Delphi Third-Party
Why not just include language files inside exe? -
Dynamic Test For Delphi, Code Coverage Report
Fr0sT.Brutal replied to hakki.degirmenci's topic in Software Testing and Quality Assurance
Launch that demo under coverage tool and control it via any kind of IPC. -
How to display one of several web pages at one URL
Fr0sT.Brutal replied to David Schwartz's topic in Network, Cloud and Web
Well, with a script you can do it. Just fetch page content, split to head|body and assign them to document.head|body.innerHTML. But you'll have to estimate all hacking possibilities and block them. -
Typical issue Server is incorrectly configured reporting its internal IP to external client. If touching the server is not an option at all, look for client option to ignore that IP in PASV and always use main server address for connection. You may also change the command to EPSV which is more modern kind of making data connection that doesn't require server IP at all.
-
Converting C++ API Post Request into Delphi Code
Fr0sT.Brutal replied to robhercarlos's topic in General Help
Universal solution: examine dumps of both requests and look for differences -
How to display one of several web pages at one URL
Fr0sT.Brutal replied to David Schwartz's topic in Network, Cloud and Web
Of course you can but how you suppose to inject website's common scripts and UI? And why would you have to change HEAD - custom scripts? -
How to display one of several web pages at one URL
Fr0sT.Brutal replied to David Schwartz's topic in Network, Cloud and Web
It seems similar to usual single-page app so what's your question? Just make sure the page won't be cached -
Have you looked for log usage in Indy docs? Usually such client classes have some logger property; however I've no idea with Indy. Do Indy versions in working and failing app versions differ? Anyway logging should decrease the guess area as now it's too broad. Maybe Indy in D11 asks for active data connection by default which is blocked by firewall.
-
JCL (Jedi Code Library) for Delphi - install problem
Fr0sT.Brutal replied to polasss's topic in Delphi Third-Party
Why not just install packages without that awkward obscure wrapper ?