Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 10/14/21 in all areas

  1. There are many good reasons (and some not so good ones) for using P4D and one of them is to get access to the libraries available for python (another one is for application scripting), Quite a few of python libraries already make use of the available CPUs or even GPUs (e.g. Tensorflow, PyTorch, scikit-learn etc.). There is absolutely no benefit (maybe the opposite) in using multi-threading or multi-processing with say Tensorflow stuff. For other tasks you need to bear in mind: Avoid premature optimization and then identify and focus only on bottlenecks Tasks you implement in Delphi instead of pure python are likely to be much faster, even before you employ Delphi multi-threading. Use TPythonThread mainly to avoid blocking the Delphi main thread, but not as a tool to process things faster. You can use multi-processing as a last resort. In the vast majority of cases you should not need to do that. Make sure you know what you are doing before trying to use Python threads (and multi-threading in general) . Study Demo 33 in depth for instance. By the way the list of languages that have the same limitations as python in not being able to exploit multiple CPUs directly via threading, includes other popular languages such as JavaScript, Ruby and R. It is interesting that this limitation has not prevented their widespread adoption in an era in which the main increase in processing power comes from the increase in the number of cores.
  2. Attila Kovacs

    Where is the Welcomepage directory in Delphi 11 Alexandria?

    "mainly to allow for better High DPI support" ROTFL
  3. Lars Fosdal

    LSP - Alexandria

    How much semi-circular unit references do you guys have?
  4. I think you forgot the sarcasm tag 🙂
  5. Yeeees, HTML/CSS/JS has a really terrible High DPI support
  6. Serge_G

    Create a bitmap of selected control?

    I don't found the source I had in mind, but ... If there are no headers or footers procedure TForm1.ListView1ItemClick(const Sender: TObject; const AItem: TListViewItem); begin if AItem.Purpose=TListItemPurpose.None then begin memo1.Lines.Clear; memo1.Lines.Add('Item width '+(Listview1.width).ToString); memo1.Lines.Add('real Item width '+(Listview1.width-Listview1.ItemSpaces.Left-ListView1.ItemSpaces.Right).ToString); memo1.Lines.Add('Item Height '+Listview1.ItemAppearance.ItemHeight.toString); memo1.Lines.Add('real Item height '+(Listview1.ItemAppearance.Itemheight-Listview1.ItemSpaces.top-ListView1.ItemSpaces.bottom).ToString); memo1.Lines.Add('cursor '+Listview1.ScrollViewPos.ToString); memo1.Lines.Add(' Item toppos in list '+(AItem.index*Listview1.ItemAppearance.ItemHeight-Listview1.ScrollViewPos).ToString); memo1.Lines.Add(' real Item toppos in list '+(AItem.index*Listview1.ItemAppearance.ItemHeight- Listview1.ScrollViewPos+Listview1.ItemSpaces.top).ToString); end; end; With this, it's easy to make a bitmap extracted from ListView1.MakeScreenShot like this procedure TForm1.ListView1ItemClick(const Sender: TObject; const AItem: TListViewItem); var aBitmap : TBitmap; rect : Trect; begin if AItem.Purpose=TListItemPurpose.None then begin Rect:=TRect.Create(TPoint.Zero); Rect.Left:=Trunc(ListView1.ItemSpaces.Left); Rect.Top:=trunc(AItem.index*Listview1.ItemAppearance.ItemHeight-Listview1.ScrollViewPos+Listview1.ItemSpaces.top); Rect.Right:=Rect.Left+Trunc(Listview1.width-ListView1.ItemSpaces.Right); Rect.Bottom:=Rect.Top+Trunc(Listview1.ItemAppearance.Itemheight-ListView1.ItemSpaces.bottom); aBitmap:=TBitmap.Create; try aBitmap.Width:=Rect.Width; abitmap.Height:=Rect.Height; aBitmap.CopyFromBitmap(Listview1.MakeScreenshot,Rect,0,0); aBitmap.SaveToFile('itemtest.bmp'); finally abitmap.Free; end; end; end; result : Ok, I just forget to discount Scrollbar width, but that's the idea
  7. Uwe Raabe

    Delphi Package Manager - choices?

    My layout is a root folder that contains all external libraries as sub repos in a separate sub folder named lib, while the project is located in the source sub folder. This keeps the lib stuff out of the "search in files in project dir".
  8. Wagner Landgraf

    Delphi Package Manager - choices?

    I think the "problem" with Package Manager is that is has to be widely adopted by the community to be very useful. Because the key is that relevant libraries and 3rd parties are available in the package manager. "Unfortunately" Embarcadero is pushing GetIt so it's unlikely we will have a different one being widely adopted, I guess.
×