Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 07/24/20 in all areas

  1. Fr0sT.Brutal

    Book: Delphi Quick Syntax Reference

    I gathered most valuable ones of them in https://github.com/Fr0sT-Brutal/Delphi_Compilers (intended for library devs that have to support many compiler versions)
  2. Hi all, I'd like to share that my new book is almost out. Apress is working hard to put it in the market. We always discuss how we can bring new people to Delphi so I thought it would be a good idea to ease their way in by providing a quick up-to-date guide on the basics of the language. The book covers new features introduced in 10.4 Of course, a reference book is always useful to experienced coders as well; we all need a refresher every now and then πŸ™‚ I would like to cordially thank Dr. Holger Flick for reviewing the chapters; his experienced view guided me during the writing of the book. Regards, John 9781484261118.tif
  3. David Champion

    DevExpress FMX Grid

    DevExpress FMX Grid released to those on subscription https://community.devexpress.com/blogs/vcl/archive/2020/07/22/devexpress-fmx-grid-ctp-available.aspx Its a CTP - Community Techology Preview
  4. A binary search tree that uses objects as nodes will be crap if you are after the pure performance advantages of a BST simply because all the cache misses caused by indirection will blow it out of the window. Simply talking about the Big O of the algorithm does not tell the full story because it simply ignores all those factors.
  5. Fr0sT.Brutal

    Book: Delphi Quick Syntax Reference

    It could be not so much up to date but I keep adding stuff from time to time. Luckily not much things change at language level. Anybody is always welcomed to do pull request or fill an issue; I'll try to update the list to 10.4 in the near future
  6. David Schwartz

    Anybody up for an ethics question?

    I was looking for comments relative to my statement that "it's a programmer error" vs. my colleague who disagreed and believes the programmer did exactly what was asked -- and no more. This is a constant problem outsourcing to people from certain countries / cultures because they're taught to never ask questions on the assumption that the person who gave you the directions knew what they're talking about. So to fill gaps in specifications that cannot be ignored, they just make stuff up instead of asking about it. It wastes time and resources, and leaves a lot of people quite upset. "Why didn't you just ASK???" is a common refrain.
  7. Fr0sT.Brutal

    TIDHTTP -v- THTTPCLient

    THTTPClient uses high-level OS facilities and libs, TIDHTTP is based on low-level sockets and OpenSSL libs that must be provided for TLS to work. My guess is that Id is more feature rich but if you just need to poll some URL from time to time, THTTPClient is good choice
  8. Fr0sT.Brutal

    Centered message?

    Poor man's solution: Project group with all your 100 projects -> open in RAD -> build all -> go make yourself some tea
  9. Fr0sT.Brutal

    Running Tokyo 10.2.3 dcc32 from the command line

    You could look at https://github.com/Fr0sT-Brutal/Delphi_BuildScripts for inspiration
  10. David Heffernan

    Anybody up for an ethics question?

    And to think that the question was meant to be about ethics.
  11. Arnaud Bouchez

    Help with string extraction function

    This is not as simple as this. IIRC prefecthing has no difference between indexed (mov ecx, byte ptr [eax+edx]) or direct access (mov ecx, byte ptr[eax]). The reference material about instruction latency and execution pipelinging is https://www.agner.org/optimize/instruction_tables.pdf and it is highly depending on the CPU. https://www.agner.org/optimize is worth reading and understanding. https://lemire.me/blog/ is another very interesting blog about performance of text processing, from a lot of experience and actual knowledge. Branchless SSE code will be the faster in all circumstances... Then use a wall clock measure of full realistic process - not just measuring a loop.
  12. Arnaud Bouchez

    Help with string extraction function

    It depends on the complexity of the loop. For instance, about how variables are assigned to local stack variables or registers. If the use of the for-to index is not mapped into a register, then thatpointer[ i ] will be slower... Sometimes, just using a small local functions help the Delphi compiler make better register allocation, and may end up be faster... Remember πŸ™‚
  13. aehimself

    How to detect the active app

    GetTopWindow or GetActiveWindow, depending on your needs function SecondsIdle: DWord; var liInfo: TLastInputInfo; begin liInfo.cbSize := SizeOf(TLastInputInfo) ; GetLastInputInfo(liInfo) ; Result := (GetTickCount - liInfo.dwTime) DIV 1000; end;
  14. The binary tree is essential in programming, especially when you want to insert, remove, search and maintain an ordered list at the same time, with an excellent performance. I use it, but on a day-to-day basis we don’t use it that much because generally what we need is just a simple sorting, example List.Sort, or a list with a fast search, example TDictionary, or inserting, removing and sorting small lists (for example example lists with less than 200 items). The ordering of delphi uses QuickSort which has the same complexity / performance as adding + ordering a binary tree O (N * (Log N)). Just like the dictionary has similar performance in the search. But as I said, when you want to add, remove, search quickly and sort the same list, you better use a binary tree. Delphi does have support for this in TList<T>, you don't need to create a class or make implementations as alcinoe did, you just need to use for example TList<Integer>, and use List.BinarySearch to add, remove or search. Note: To add you will use BinarySearch because although it returns False, which is what it should return when it cannot be found, it also returns the Index, which is where this item should be, so you will insert the item in the position of that index that BinarySearch returned. That way you will already insert sorted, the list will always be sorted, that is, any operation like this will be very fast, because it uses BinarySearch which has the complexity O (Log N), so your list will be a Binary Tree. πŸ˜‰
  15. Attila Kovacs

    Anybody up for an ethics question?

    if you don't have "Plan B", you should not try to catch exceptions
  16. dummzeuch

    Running Tokyo 10.2.3 dcc32 from the command line

    Yes. Or you copy the code from the rsvars.bat file and append the msbuild line. Note that you need to check where the user actually installed his Delphi. E.g. I didn't install to %ProgramFiles%. You can get that information from the registry: HKEY_CURRENT_USER\Software\Embarcadero\BDS\21.0 -> RootDir
  17. dummzeuch

    Running Tokyo 10.2.3 dcc32 from the command line

    I somehow doubt that, even assuming that you skipped or at least dropped Delphi 8 like every sane person. Delphi 2005 and 2006 didn't use msbuild. [/smartass mode]
  18. Fossil would be a weird choice. Regardless of how good it is, it's not widespread. git is everywhere, and has so much tooling and resources available. Very hard to see past it.
  19. FredS

    Patch 2 for RAD Studio 10.4 now available

    One has to appreciate that the DOS installation of 'Patch 2' truly 'empowers application developers' πŸ™‚ All that's missing is deployment via floppy disks..
  20. Stefan Glienke

    Buggy Optimizer in Delphi 10.4

    https://xkcd.com/292/ just saying
  21. Dalija Prasnikar

    Patch 2 for RAD Studio 10.4 now available

    Honestly... I don't care if compiler broke your code... they released fix for compiler bug that broke my code...
  22. Marco Cantu

    Patch 2 for RAD Studio 10.4 now available

    (and sorry if I don't follow up, I'm out a few days)
  23. pyscripter

    Ssh library for Delphi

    Help wanted: libssh2 can be compiled so that it uses Windows CNG instead of OpenSSL, thus avoiding any dependence on other dynamic libraries. I wonder whether it would be possible to compile it into C obj files that can be linked into the Delphi executable. This would simplify the deployment greatly. Any help on this would be greatly appreciated.
  24. Would choose FreeNullminator, ... hasta la vista .... Object
  25. David Heffernan

    Typed constants in Delphi.

    The biggest issue with constants in Delphi are that typed constants can't be used in certain settings which require true constants to be used. The ones that come to mind are: 1. When declaring typed constants. 2. When declaring attributes. The inability to used typed constants in these settings is clear weakness in the language. There are probably more issues, but these are the ones that bite me. I'm tired of hearing justification for these limitations based on the current implementation. All this talk about single pass, interface vs implementation, writeable typed constants, etc. If the implementation limits you, change it.
Γ—