Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 01/18/21 in Posts

  1. Another set of binaries... Am I the only one that is completely allergic to binaries from unknown sources?
  2. Thank you. I just did like you suggested 🙂 https://github.com/TDDung/DelphiFMX-BASS
  3. Thank you for your help that was good sense. I discovered that the issue lies in my input data that was empty at times and not in System.pas ! Problem solved ! Thank you again JP
  4. The leak detection tool is known to work well. Please post on the madExcept forum. Applying Occam's Razor, you should entertain the possibility that there are defects in your program that this tool is notifying you of.
  5. Primož Gabrijelčič

    Messageloop in Omnithread task

    Variant 1: Use a 'procedure' worker (`procedure Worker(const task: IOmniTask)'). Then you can implement your message loop inside. Variant 2: Use a `TOmniWorker` descendant (as in my example). It will implement its own message loop. Variant 2a: Override parts of the TOmniWorker message loop (but I actually don't remember anymore how that is done 😠 ). You can handle most stuff with Variant 2. In addition to timers you can call Task.RegisterWaitObject to connect code to any waitable handle. See demo 31_WaitableObjects for more information. Read more here: http://www.omnithreadlibrary.com/book/chap07.html#lowlevel-iomnitask-registerwaitobject.
  6. Gary Mugford

    Customizing source editor

    I use the Delphi IDE Theme Editor to apply the base colour scheme, which was green-apache. Then I went about making the system greener as far as backgrounds, choosing in most cases to make the background a shade of green enough different that your eye could spot the difference while still maintaining the whole GREEN is good for the eyes sort of thing. I also made the default font 14pt because, as a senior citizen, BIGGER is better. As mentioned, Consolas is the choice of fonts. I like the ones and the slashed zeroes. Once you are finished playing with the editor, save your theme to a name of your choosing and then apply your master work. As mentioned, I like the background, but there are days where I go to a second theme that is darker green in the background with the slightly lighter background of this theme being swapped for it. Look at the enabled breakpoint line to get what I'm saying. Again, I understand that this is not everybody's cup of tea. Some will have a preference for bold and non-bold. Yes, some will actually want italics in the comments just for familiarity's sake. But RRuz's work providing a quick library of starting points, allowing you to build up a set of themes for specific work ... I can see having a theme for debugging. I forgot that I DID have to do some cleaning up IN Delphi. The comment block was that pinkish red ON A BLACK BACKGROUND. I THINK that was the only post-IDE Theme Editor change. The marked block was money green on navy blue. Yeah, those are the differences. Sorry about that. GM
  7. Mike Torrettinni

    Customizing source editor

    I've been using red colored numbers this week and I really like it! They stand out enough but not distracting. 😉
  8. Andrea Raimondi

    Cross-platform messaging system

    Hi, Yes it may be redone, probably, but it would go against the "current" of what that library is trying to accomplish and it would be unnaturally convoluted to do it. And yes, whenever I can, I write message driven apps. I find reasoning about message flows much easier than using events and such. I can also share code much more easily and because one of my rules is that "Messages often are features" that allows other people to reason about the flow and the behaviour in much easier to understand ways. The final advantage is that such architecture fosters statelessness which means you have much broader reach and need to pay attention to what you do 😄 The purpose there is not so much readability (which is part of it) but also consistency. I find lack of begin/end pairs in initialization/finalization very bad because you don't get the lines and you can't easily collapse them (please do give it a try: both work when you use begin/end). Moving things is also a lot easier for you could - for example - create a new InitYaddaYaddaYadda and just cut and paste the whole block. Finally, keep in mind that this is an example and chances are thart in my actual prologue/epilogue there mayt be a lot more stuff.
  9. Here are some timings: sorted reverse half random QuicksortInteger(1000000): 0.05787 0.06269 not done 0.16328 QuickSortPlusInteger(15)(1000000): 0.04744 0.04995 0.24928 0.14548 TimSortInteger(1000000): 0.00214 0.00252 0.00981 0.16411 QuicksortString(1000000): 1.36692 1.00144 not done 1.16640 QuickSortPlusString(15)(1000000): 1.38534 0.99298 0.81605 1.23809 TimSortString(1000000): 0.06285 0.09036 0.16268 1.86726 Sorting 1 million integers or strings respectively. The strings are simply generated with IntToStr for numbers 0 to 999,999 and compared with CompareStr. This means that Sorted, Reverse and half for strings is not really correct, because '10' < '2' etc. I need to fix that, but this is not too bad a dataset for sorting tests either. (I just googled and found that apparently there are some test datasets for sorting algorithm performance. I'll have a look into that.) The numbers are the time in seconds for a single run on my computer. As you can see, TimSort is faster than all of them with the exception of random data, where it is still in the same ballpark. The test program is in the subdirectory Tests\SortingTests. Please note that with the exception of TimSort, these sorting algoritmms are not implemented for best performance but for convenience: They are abstracted from the data and use callbacks to compare and swap items. TimSort currently works directly on the data and uses a callback only for comparison, but my goal is to abstract the algorithm from the data in a similar manner, if possible.
×