Leaderboard
Popular Content
Showing content with the highest reputation on 12/19/19 in Posts
-
Most efficient way to delete multiple items from a TList<T>...
Anders Melander replied to Steve Maughan's topic in Algorithms, Data Structures and Class Design
Huh? You have heard of premature optimization haven't you? -
Blogged : Introducing DPM - a Package Manager for Delphi
Vincent Parrett replied to Vincent Parrett's topic in Delphi Third-Party
Made some progress today on IDE integration, screenshot below of my first attempt at doing a dpm restore in the IDE plugin. Very much early days with the IDE integration, but it was still a punch the air kinda moment when it worked first time! -
Why is my firebird database code unstable under load? (code included)
Daniel replied to Yaron's topic in Databases
Thanks, I will look into it. -
Blogged : Introducing DPM - a Package Manager for Delphi
Lars Fosdal replied to Vincent Parrett's topic in Delphi Third-Party
Pessimist = Experienced optimist 😛 -
Hello, I would like to let you know that the uploading permissions bug has been fixed in the latest TGPuttyLib version.
-
Anders, I love you, Merry Christmas!
-
Most efficient way to delete multiple items from a TList<T>...
Stefan Glienke replied to Steve Maughan's topic in Algorithms, Data Structures and Class Design
Of course but I am assuming that Steve is doing more with this list than just removing many items at once. My personal experience with collections and a lot of material I read and watched is telling me that the chances are kinda slim that a linked list will perform better in the overall usecase. Anyhow in the context of this question any discussion of this is moot and my first sentence in my first comment still stands. Anything else is a waste of time. -
Most efficient way to delete multiple items from a TList<T>...
Stefan Glienke replied to Steve Maughan's topic in Algorithms, Data Structures and Class Design
Ask google and read up on prefetchers and cache locality. -
That's a strange question. It's based on the experience that unnecessary nesting makes the code harder to read. Sure it's a personal preference, some like it, some don't (just google Early Return - I'm sure you will find one or two that doesn't advocate it), but at least one of your "if" blocks are complete superfluous and would be removed by the optimizer if it was worth anything. What's the relevance? Are you saying that because some simple rule based validator doesn't flag your code then it can't be improved? - Because I can spot several goofs in it.
-
It's a refactoring; It improves the readability of the code without changing the functionality.
-
Nice. But: Early Return ... if ParamCount < 2 then Exit; if not FileExists(ParamStr(1)) then Exit; if not System.SysUtils.TryStrToInt(ParamStr(2), ThisLine) then Exit; ...
-
Most efficient way to delete multiple items from a TList<T>...
Lars Fosdal replied to Steve Maughan's topic in Algorithms, Data Structures and Class Design
TList<T>.Pack( function (const L, R: T): Boolean begin Result := (L.Condition); end); -
Create multiple tasks without freezing the interface
DarkDucke replied to DarkDucke's topic in OmniThreadLibrary
It worked perfectly, thanks for the help! -
Why is my firebird database code unstable under load? (code included)
Zoran Bonuš replied to Yaron's topic in Databases
Exactly, just what I was about to recommend. You create deadlock because the new value of VIEW_COUNT depends on the old value, and due to the nature of multi-generation architecture a simultaneous transactions, there can be different old values, depending on the isolation settings of your transaction. Using generator/sequence for view_count circumvalents the problem for this specific update query. However, a proper transaction setting is preferred anyway. There is no magic solve-it-all setting, I recommend studing the docs too .. will most likely came in handy later anyway. -
Create multiple tasks without freezing the interface
Lars Fosdal replied to DarkDucke's topic in OmniThreadLibrary
Did the refactor solve your "always same I" problem? -
Create multiple tasks without freezing the interface
Lars Fosdal replied to DarkDucke's topic in OmniThreadLibrary
Is it about the pitfalls of variable captures? The simplest solution to that is to simply divide and conquer. Also - the queuing code you wrote, will only do five scrapings since you never descrement nCount when a task completes, nor do you retry the loop until there are no lines not containing 'done'. procedure TForm1.QueueScraping(I, Q: Integer); Async( procedure begin Memo1.lines.add('I=' + I.ToString() + ' Q=' + Q.ToString()); GetWebContent(I); end ).Await( procedure begin Memo1.lines.add('Done I=' + I.ToString() + ' Q=' + Q.ToString()); end); end; procedure TForm1.BitBtn1Click(Sender: TObject); var I, nCount : Integer; begin I := 0; nCount := 0; for I := 1 to StringGrid.RowCount-1 do begin if StringGrid.Cells[0, I] <> 'done' then begin inc(nCount); if nCount > 5 then Break; QueueScraping(I, nCount) end; end; end; -
[Spring4D] Remove collection elements
pietrt replied to Jacek Laskowski's topic in RTL and Delphi Object Pascal
You can also use the RemoveAll method: list.RemoveAll( function(const foo: TFoo): boolean begin result := foo.Value < 100; end); dict.RemoveAll( function(const aPair: TPair<string,TFoo>): boolean begin result := aPair.Value.Value < 100; end); -
That's a NASty bug. *SCNR*
-
Open Tools API - Project load/close notification
Vincent Parrett replied to Vincent Parrett's topic in Delphi IDE and APIs
Thanks @Uwe Raabe - IOTAIDENotifier was exactly I needed - first ever dpm restore on project load Still plenty to do but the basics are working -
Only in Windows 7/8 and older. Since Windows 8.1 you can set different scaling for different screens.
-
Why is my firebird database code unstable under load? (code included)
Dmitry Sh. replied to Yaron's topic in Databases
You must control transaction under Firebird ... ReadTransaction.Connection := FDConnection1; ReadTransaction.Options.ReadOnly := True; ReadTransaction.Options.Isolation := xiReadCommitted; ... SelectQuery.Transaction := ReadTransaction; http://docwiki.embarcadero.com/RADStudio/Rio/en/Managing_Transactions_(FireDAC) -
RAD Studio, Delphi and C++Builder 10.3.3: List of Patches We've released a number of patches for RAD Studio 10.3.3. To ensure you know about all of them, and can install correctly, here is a list and some overview information. If we release any others, we'll update this blog post with details. https://community.idera.com/developer-tools/b/blog/posts/rad-studio-delphi-and-c-builder-10-3-3-list-of-patches?fbclid=IwAR0EcZ8TvyWslDSLoMzHP64WcIrZtynO727eZyXC90aXpomENWm0OEKV17g
-
New Third Party section - DelphiHTMLComponents
Angus Robertson replied to Darian Miller's topic in Community Management
Or a less specific topic to cover HTML components from other developers as well, such as https://github.com/BerndGabriel/HtmlViewer Angus