Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 12/19/19 in Posts

  1. Huh? You have heard of premature optimization haven't you?
  2. Vincent Parrett

    Blogged : Introducing DPM - a Package Manager for Delphi

    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!
  3. Lars Fosdal

    Blogged : Introducing DPM - a Package Manager for Delphi

    Pessimist = Experienced optimist 😛
  4. tobiasgiesen

    SFTP client

    Hello, I would like to let you know that the uploading permissions bug has been fixed in the latest TGPuttyLib version.
  5. PeterPanettone

    Open Url From Current Line

    Anders, I love you, Merry Christmas!
  6. 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.
  7. Ask google and read up on prefetchers and cache locality.
  8. Anders Melander

    Open Url From Current Line

    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.
  9. Anders Melander

    Open Url From Current Line

    It's a refactoring; It improves the readability of the code without changing the functionality.
  10. Anders Melander

    Open Url From Current Line

    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; ...
  11. TList<T>.Pack( function (const L, R: T): Boolean begin Result := (L.Condition); end);
  12. It worked perfectly, thanks for the help!
  13. 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.
  14. Did the refactor solve your "always same I" problem?
  15. 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;
  16. pietrt

    [Spring4D] Remove collection elements

    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);
  17. Sherlock

    Why do I get the strange ones??

    That's a NASty bug. *SCNR*
  18. Vincent Parrett

    Open Tools API - Project load/close notification

    Thanks @Uwe Raabe - IOTAIDENotifier was exactly I needed - first ever dpm restore on project load Still plenty to do but the basics are working
  19. Микола Петрівський

    IDE title bar anomaly?

    Only in Windows 7/8 and older. Since Windows 8.1 you can set different scaling for different screens.
  20. 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)
  21. Silver Black

    Current 10.3.3 patches

    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
  22. Angus Robertson

    New Third Party section - DelphiHTMLComponents

    Or a less specific topic to cover HTML components from other developers as well, such as https://github.com/BerndGabriel/HtmlViewer Angus
×