Rollo62
Members-
Content Count
1812 -
Joined
-
Last visited
-
Days Won
23
Everything posted by Rollo62
-
Spring4D 2.0 sneak peek - the evolution of performance
Rollo62 replied to Stefan Glienke's topic in Tips / Blogs / Tutorials / Videos
Yes, I have projects with precompiled S4D and some earlier projects with S4D from sources, which I hold in different VM's and not need to compile very often. Still that is pretty much OK for me, even when compiling from Sources, but once V2.0 is released I might migrate all of them to the precompiled version. Big promise -
Spring4D 2.0 sneak peek - the evolution of performance
Rollo62 replied to Stefan Glienke's topic in Tips / Blogs / Tutorials / Videos
@Stefan Glienke Thanks for that nice library, its really outstanding. I still have to explore more of the billion features, and meanwhile I'm always looking "Spring-first" if I need a new feature What I always notice here, is that Spring.Collections.dcu is growing to be really by orders the biggest file in my projects, same as the compille time of Spring.Collections is the longest when compiling from source. In the Spring.Collections I see a lot of types defined, do you think that further separation and modularization of those types into separate units would help to limit the maximum file size to an acceptable level, if not reduce the overal size? -
Have you checked that ComHandle is valid and accessible ? Maybe the hardware behind has died or changed. Can you open and read the port with other tools ?
-
MulDiv( ) : Integer; in Delphi, cannot find this in the RTL (cross-platform)
Rollo62 posted a topic in RTL and Delphi Object Pascal
Hi there, I just wanted to use MulDiv, and my initial reflex was just take it , but: It seems not to be there in Systems, Math or the other, only in Winapi.Windows is the Windows version. I would bet my left finger that MulDiv should be there, am I missing something. The only thing I can find, from older messages, like this: function MathRound(AValue: Extended): Int64; inline; begin if AValue >= 0 then Result := Trunc(AValue + 0.5) else Result := Trunc(AValue - 0.5); end; function MulDiv(nNumber, nNumerator, nDenominator: Integer): Integer; begin if nDenominator = 0 then Result := -1 else Result := MathRound(Int64(nNumber) * Int64(nNumerator) / nDenominator); end; That looks a way over the top to me, why do they need floating point ? I will use it like this: function MulDiv(nNumber, nNumerator, nDenominator: Integer): Integer; begin if nDenominator = 0 then Result := -1 else Result := (Int64(nNumber) * Int64(nNumerator)) div nDenominator); end; But much better if someone can tell me where can I find a cross-platform, optimized version in the RTL ? -
MulDiv( ) : Integer; in Delphi, cannot find this in the RTL (cross-platform)
Rollo62 replied to Rollo62's topic in RTL and Delphi Object Pascal
Ok, thanks. But a simple MulDiv for Integer 32-Bit ? Nothing pops up. At least they are using the same method than I do for Int32. MulDiv64 := Int64((Int128(AValue) * Int128(AMul)) div Int128(ADiv)). -
Hi there, I'm trying to make the right choice for above, and tried some simple function. I also have seen a nice explanation about that from David When comparing both options, it seems to have only minor differences, see below. (Rx10.4.2) What I asked myself if there is any advantage of the record constructor over class function anyway, also in regard of the more modern CustomRecords ? type TRecConstructor = record private FValue : Integer; constructor Create( const AValue : Integer ); end; TRecClassFunc = record private FValue : Integer; class function Create( const AValue : Integer ) : TRecClassFunc; static; end; procedure TS4DunitX_Basic__Tests.Test01; var LRecCon : TRecConstructor; LRecCls : TRecClassFunc; begin LRecCon := TRecConstructor.Create( 42 ); LRecCls := TRecClassFunc.Create( 84 ); end; { TRecConstructor } constructor TRecConstructor.Create(const AValue: Integer); begin FValue := AValue; end; { TRecClassFunc } class function TRecClassFunc.Create(const AValue: Integer): TRecClassFunc; begin Result.FValue := AValue; end;
-
Advantages of record constructor over record class function, reviewed after CustomRecords
Rollo62 replied to Rollo62's topic in RTL and Delphi Object Pascal
Beside memory, I think of "constructor" Create as the necessary 1st step to setup an item correctly, before I can make use of anything from this item. Thats not the case for records, I could work without a "creation", that why I dislike the "Create" nomenclature for records and look for something that points out the difference. (and of course, I could name constructors anything else, but that makes it even more fuzzy). -
Advantages of record constructor over record class function, reviewed after CustomRecords
Rollo62 replied to Rollo62's topic in RTL and Delphi Object Pascal
Ok, I will leave the class functions then as-is, if this makes no practical difference. Concerning the "constructor" naming, has a somewhat different meaning IMHO, not so well fitting to records. I will stay with the naming convention "class function TMyRecord.Make(...) : TMyRecord; static;" instead of construtors then, to be sure not to mix both concepts. -
When will be binding to Swift libraries possible ?
Rollo62 replied to Rollo62's topic in Cross-platform
@Dalija Prasnikar Thanks, that is not so bad news than I expected. We better all vote for RSP-22944 then, to keep things moving. -
Out parameter is read before set
Rollo62 replied to Mike Torrettinni's topic in Algorithms, Data Structures and Class Design
Yes and no, I mean "out" is giving back a fresh variable to its caller. The state before should be considered undefined, it can exist, can have values, can be nil. I would say that in the 1. line inside the method, this does not exist, since the out parameter shall give back a new parameter. Whatever it was before shall not matter. From my opinion this is what "out" should originally stands for, even if it maybe can be misused somehow. On the other side, "var" brings in an existing parameter, inside the method, which can be used or changed at will. -
Out parameter is read before set
Rollo62 replied to Mike Torrettinni's topic in Algorithms, Data Structures and Class Design
The message tells you: The out parameter should be considered as not-existing inside the method, so it cannot be used before its creation. If you want to use it like that you maybe better consider to use a var parameter. -
Hi there, I checked the latest Spring4D master, and it seems that the TPair<K,V> was removed from Spring.Collections.pas TPair<TKey, TValue> = packed record Key: TKey; Value: TValue; constructor Create(const key: TKey; const value: TValue); end; I know this was redundant in System.Generics.Collections.pas, but now I have to include this unit to get access to TPair. From the philosophy of S4D I understood that Spring.Collections should be able to replace the System.Generics.Collections in the long run completely, so I wonder why this TPair was removed then, its used in many places. That means I need to keep a reference to both units now, if I need this. Does this really make sense, why was it removed, and why not for example moved, separated into another Spring unit ?
-
Oooh yes, maybe its too late and hot right now 🙂
-
Ok, thanks. So I thought the new released master is a newer one, and included all from the development branch. Then I better stay with the development branch.
-
Hi there, I used to have a free tier account for some years, but was not very active there. https://www.experts-exchange.com/ From my experience the coverage of Delphi was quite low, and maybe other topics like C#, JS, Java, PHP, C++ were maybe better covered. Maybe there is a kind of ranking of their abilities and quality ? I would like to know if anybody here is using this site, and if a full membership is worth the money. What are the strengths of www.experts-exchange.com , if not Delphi ? Can a full membership change the activity and quality of the answers in that channel ? Are the experts cross-platform, how well does www.experts-exchange.com can cover hardcore crossplatform topics ? I assume its a lot Web,Windows, DevOps biased (which is not bad eigher). Would be great if you could exchange your experiences, to help make decisions. I think this platform is over its zenith, since StackOverflow, but maybe you can proof me wrong.
-
You could look into TMessage and TMessageManager, which is used internally a lot, but probably not all events. Anyway, you could build something around this, also for custom events, it works quite reliable .
-
Are there any experiences with www.experts-exchange.com ?
Rollo62 replied to Rollo62's topic in General Help
Yes, of course I meant that the experts would get some profit from their support too, I assume that this was the business idea of EE in the first place . As a kind of micropayment "UpWork", for special answers, e.g. where Delphi user could get help to integrate Java . -
Are there any experiences with www.experts-exchange.com ?
Rollo62 replied to Rollo62's topic in General Help
Thanks for your opinions, I think we share the same thoughts about EE. Its a pity, for a real, payed support site it would be worth to pay money. -
@Remy Lebeau Interesting idea, so I assume you still generate the heavy DCU's, BPL, binaries etc. inside each VM, to keep them well separated. Does this help to reduce the overall VM size, if the sources were not inside the VM, I'm afraid not ? How about compile speed when using the transfer folders instead of VM folders, could you see any difference ? Since I use the host mainly as "empty, easy replaceable shell" for the VM's, I've tried to keep it clean and do everything in VM's inside, but a common source folder can make sense.
-
ScroogeXHTML 7.2 - RTF to HTML5 and XHTML converter
Rollo62 replied to mjustin's topic in Delphi Third-Party
@mjustin Nice product. I assume this works under VCL only, is that correct ? Since there were no infos about other platforms. -
I find it very convenient to have a common _Transfer\ folder, which is available on the host, and shared in all VM's. This helps to easily share files and data between the different VM's. Thos files were stored on the host, and in the VM's they were only virtually binded. Of course this is not intended to be opend for write from several VM's or the host at the same time, but just for manual exchange (e.g. for PAServer files, etc).
-
StringList container with ignore duplicates, non-sorted
Rollo62 replied to Mike Torrettinni's topic in Algorithms, Data Structures and Class Design
http://docwiki.embarcadero.com/Libraries/Sydney/en/System.Classes.TStringList.Add -
recompiling delphi source for Delphi Sydney
Rollo62 replied to Dave Novo's topic in RTL and Delphi Object Pascal
@Stefan Glienke Thanks, thats very interesting, I thought about these issues too, which would be the reasons though, and I assumed there could be many reasons (inline, generics, other references). Do you know if the "inlining" is the only reason that causes this issue ? -
Micro optimization: Math.InRange
Rollo62 replied to Mike Torrettinni's topic in Algorithms, Data Structures and Class Design
Need to be Edited again (lEditor lost all my text from 1st post). Seems mathematically correct, but may face internal integer overflows, to be tested in Delphi ... -
What is the correct approach to "phone home"?
Rollo62 replied to Der schöne Günther's topic in Project Planning and -Management
Me too And even a simple, virtual website provider with PHP will do, at very affordable cost.