Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation since 02/21/25 in all areas

  1. pyscripter

    SynEdit now has annotated Scrollbars.

    A new powerful highlighter called Omni (for omnipotent) has been added to SynEdit. Importantly, this highlighter allows the saving/loading of highlighter settings to/from ini files. The project now includes 189 new ini-based highlighters in addition to the 75 ones that were already included. Sample using the PowerShell ini-based highlighter. Notice that code-folding is automatically supported. Structure highlighting is also supported: A component editor has also been added that can be used at both design and run-time. See this discussion for details. This is based on a significant code contribution by Jan Fiala, the author of PSPad. Kudos to Jan!
  2. dummzeuch

    BIG changes

    I think we should stop feeding the troll.
  3. Stefan Glienke

    TParallelArray Sort Performance...

    Just a few new numbers of a not yet released parallel pdq sort - using the benchmark code from this comment earlier in this thread Fill array (double), elements count: 500000 Start sorting ... RTL TArray.Sort (ms.): 47 RTL TParallelArray.Sort (ms.): 35 Spring TArray.Sort (ms.): 12 Spring TArray.Sort_Parallel (ms.): 3 Fill array (double), elements count: 5000000 Start sorting ... RTL TArray.Sort (ms.): 551 RTL TParallelArray.Sort (ms.): 128 Spring TArray.Sort (ms.): 136 Spring TArray.Sort_Parallel (ms.): 64 Fill array (double), elements count: 100000000 Start sorting ... RTL TArray.Sort (ms.): 12724 RTL TParallelArray.Sort (ms.): 1884 Spring TArray.Sort (ms.): 3035 Spring TArray.Sort_Parallel (ms.): 675 Again - these numbers are fluctuating a bit because the benchmark is a "run once" benchmark and it depends on the current CPU state etc - also I did not tweak the threshold and CPU count yet - simply calling TTask.Run from System.Threading to fork some slices into parallel execution. But overall it does not look too bad, doesn't it?
  4. Stefan Glienke

    Virtual class methods and properties

    It appears that Marco lacks the technical understanding to evaluate this issue. I left a comment.
  5. loki5100

    What are the performance profilers for Delphi 12?

    Hi, i just made a new performance profiler for delphi 12 that have the advantage to work on iOS and Android too! it's about instrumenting the source code, it's work pretty well. you can found it here : https://github.com/MagicFoundation/Alcinoe?tab=readme-ov-file#alcinoe-code-profiler
  6. Anders Melander

    Problem using SpinEditEx in Delphi 12.1

    FWIW, my wife who speaks "human" tells me that my directness was indeed impolite. So sorry, I guess.
  7. AI is just a tool. It has its uses. It's not going to do everything. Yes it's over hyped. But that does not mean it has no value. As usual the value lies somewhere in between what the hypers and the doubters say.
  8. Stefan Glienke

    Namespaces in Spring4d code

    The claim that it compiles faster is bogus - prove me wrong. Most compile time from spring4d comes from generics, which I reported years ago. Also, my suggestion for third-party libraries is to pre-compile them, which removes any dependency on the project options in your project. Currently, Spring4d supports down to XE, and as long as that is the case, I am not putting even more conditionals into the code than there already are.
  9. Dalija Prasnikar

    Guidance on FreeAndNil for Delphi noob

    FreeAndNil is something that you will need to use rarely (it might depend on the kind of code you are writing). In places where your code needs it logically it will be obvious that you need it and everywhere else you can use Free. The point that FreeAndNil can help you avoid errors and mistakes is full of holes. First, simple access after Free is usually easy to catch either by looking at the code (local variables) or by using memory manager in debug mode or other specialized tools. Next, FreeAndNil nils only single reference to the object instance. If you have multiple ones you will still have to deal with dangling pointers and you will need to learn how to use previously mentioned tools. Most of the problems with memory management in Delphi are caused by having multiple references to single manually managed object instance as such code is more complex. This is exactly the place where FreeAndNil cannot help you, but where using it will give you false sense of security. Another reason against using it everywhere, is that it obscures the code intent. Logically, FreeAndNil means that variable will be reused and this is important information. If you use it everywhere, you will have mush harder time reading the code and understanding its intent. And code which is harder to understand is also harder to maintain in the long run. Of course, that can be solved with comments, but then you will have to use them everywhere or you will never know whether some comment is missing somewhere. Manual memory management requires some discipline. thinking about the code you are writing enforces the discipline and makes you a better programmer. Taking the "easy" path where you will slap FreeAndNill everywhere just so you can avoid accidental mistakes and thinking is going to cost you at some point. Many existing codebases where it is used everywhere cannot be easily migrated to not using it as it can be hard to determine where it is needed and where it is not (except for local variables) and they need to continue using it indefinitely in all places, as the only thing worse than using FreeAndNil everywhere is using it randomly. Consistence in code is the king. In my codebase I have less than 50 places where I am using FreeAndNil (I cannot tell the exact amount as I have many smaller projects and it is not easy searching through them as some contain fixed VCL code which uses FreeAndAil a lot, so I cannot easily count usage in my files only) One of the advantages of being a new Delphi developer is that you don't have a lot of existing code where FreeAndNil was used in places where it is not needed and now is the right time for you to decide whether you want to pollute your code with FreeAndNil and stick with it forever or not.
  10. Remy Lebeau

    Guidance on FreeAndNil for Delphi noob

    Use it ONLY when you NEED it. When freeing an object that is pointed at by a given pointer variable, and that variable may be used again later, then nil'ing that variable makes sense, as future code will be sensitive to what the variable is (or is not) pointing at. But, if the pointer variable is not going to be used after freeing the object, then there is simply no point is nil'ing the variable.
  11. Stefan Glienke

    Looking but not finding...

    That comment didn't age well I guess
  12. Hello Delphi Praxis community, I'm excited to share my new open-source project, AppWatcher: https://github.com/mbaumsti/Delphi-App-Watcher Have you ever faced the challenge of managing dozens of Delphi applications running on multiple network machines? Finding a convenient time window to replace executables can be a real headache. That's why I developed AppWatcher. AppWatcher is a Delphi component and applications that allows you to remotely control the stopping and restarting of your Delphi applications across your network. Here's how it works: Integrate the TAppWatcherClient component into your Delphi applications. Deploy the AppWatcher Agent on your client machines. Use the AppWatcher Master application to remotely control all your applications. Key features: Remotely stop applications with user notifications. Automatically restart applications after updates. Avoid using RDP or physically accessing each machine. Minimize downtime and streamline deployment. If you're looking for a solution to simplify remote application management in your Delphi environment, I encourage you to check out AppWatcher. Contributions and feedback are welcome! Thank you,
  13. Remy Lebeau

    Issues migrating away from Indy

    Just because modern OpenSSL is not directly in Indy itself yet does not mean there are no options for it at all. For example: https://github.com/JPeterMugaas/TaurusTLS Did you see this? https://www.indyproject.org/2024/10/20/sasl-oauth-support-finally-added-to-master/
  14. Attila Kovacs

    BIG changes

    It might also be worth considering a shift from forums to blogging platforms.
  15. Uwe Raabe

    How do I synchronize two TMemo scrolling? [Solved]

    It depends a bit what the exact use case is, but it probably can be achieved with a class derived from TMemo with the following extensions: type TLinkMemo = class(TMemo) private FLinkedMemo: TLinkMemo; procedure WMVScroll(var Message: TMessage); message WM_VSCROLL; procedure DoScroll(var Message: TMessage); public property LinkedMemo: TLinkMemo read FLinkedMemo write FLinkedMemo; end; procedure TLinkMemo.DoScroll(var Message: TMessage); begin var saveLinkedMemo := FLinkedMemo; try FLinkedMemo := nil; Perform(Message.Msg, Message.WParam, Message.LParam); finally FLinkedMemo := saveLinkedMemo; end; end; procedure TLinkMemo.WMVScroll(var Message: TMessage); begin inherited; if FLinkedMemo <> nil then FLinkedMemo.DoScroll(Message); end; In FormCreate you just assign both LinkedMemo properties: procedure TForm1.FormCreate(Sender: TObject); begin Memo1.LinkedMemo := Memo2; Memo2.LinkedMemo := Memo1; end; To avoid having to register this new control TLinkMemo you can use an interposer class declared before the form, either in the same unit or in a separate unit used in the interface uses clause. type TMemo = class(TLinkMemo); Note, that editing one of the memo will break sync between the controls.
  16. Stefan Glienke

    Guidance on FreeAndNil for Delphi noob

    The best practice is coding in a way that you don't need it
  17. dummzeuch

    pasfmt out now!

    If only there was a code formatter written in Delphi that is open source!
  18. Anders Melander

    High CPU usage

    https://joeduffyblog.com/2006/08/22/priorityinduced-starvation-why-sleep1-is-better-than-sleep0-and-the-windows-balance-set-manager/
  19. Stefan Glienke

    Namespaces in Spring4d code

    To avoid repeating the unit throughout the source code, you can declare an alias at the top and only explicitly put the unit name there. That, however, only works for non-generic types and consts. I wish it would also work for generics and routines.
  20. All this is grand but at the end I still have to tell the "AI" what to do, then keep correcting it by repeating what I said but with additions and changes and then again go over everything it gave me just to make sure it did it right. That is time I could have spent doing a proper documented design and then coding everything myself. I started coding because I love coding. As such I don't dread spending time to type out code to get stuff done and so I don't need a Artificial Non-Intelligence to do my coding for me. Asking A"N"I for information is like walking a mine field. Numerous times while testing A"N"I it gave me totally incorrect answers based on poor data from the internet or even non-existing functions. There is nothing the A"N"I can tell me that I cannot already learn from people like @PeterBelow, @David Heffernan, @Jim McKeeth, @Darian Miller, @Uwe Raabe, @Anders Melander, @Remy Lebeau, @Dalija Prasnikar, (missed a bunch, I am sure). Most of them have already laid down a rich treasure of knowledge and Delphi wisdom on the internet. Willingness to search and read on my part is required though.
  21. David Heffernan

    Check If File is what he claim to be

    This code would be much better if each check of file header was done with same same code, against a signature declared either in a constant, or maybe in a file that was linked as a resource. This would make the code much cleaner, without so much repetition, and would allow you to extend it very easily.
  22. Rick_Delphi

    BIG changes

    OK, I'm moving as far away from hand coding as possible. So, I'm looking for a company that wants to do the same. If you have new projects or legacy systems built with Delphi and you are looking to hire someone to replace coders or you just want to get started now with the AI code generating future, I'm available. PM me with your contact information and I'll be in touch.
  23. The standard Delphi TComboBox is based on WinAPI. Every item you add to the list triggers a WinAPI "SendMessage" call, which takes much (x100) longer than adding an item to a TStringList. To overcome this delay, with the help of AI, I designed a slimmed down replica of TComboBox based on TStringList: https://github.com/bLightZP/ZPComboBox If you have a form with lots of TComboBox drop down list components and it's not opening fast enough for you, try this. Limitations The only event supported is OnChange. The only style supported is csDropDownList. The pop-up listbox is shown in a pop-up window, so the underlying window's title bar changes color when losing focus. The styling is close to TComboBox, but not identical.
  24. Almediadev has been online for 25 years! We are happy to work with Delphi and C++Builder developers all these years! In this regard, you can buy products with a big discount! https://www.almdev.com https://www.delphistyles.com
  25. Joshua Gardner

    pasfmt out now!

    It is a fair enough question. In the context of a code formatter, it means that it has a strong opinion on what the code should look like. Predominantly, this manifests in having few or no configuration options and a highly consistent style. Other formatters like prettier, biome, and google-java-format call themselves opinionated.
×