Jump to content

Dalija Prasnikar

Members
  • Content Count

    1137
  • Joined

  • Last visited

  • Days Won

    105

Dalija Prasnikar last won the day on June 12

Dalija Prasnikar had the most liked content!

Community Reputation

1512 Excellent

Technical Information

  • Delphi-Version
    Delphi 11 Alexandria

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Dalija Prasnikar

    Introducing My Delphi TFuture PPL For Thread Safe UI

    And that is still true. This value will be available at some point in the future, when you try accessing the value. If that value is not calculated by then, the call will wait until it is. The future guarantees that you will be able to get the value at that specific point without having to worry about whether it is actually ready or not. If you want to access that value immediately, then you don't need future. If you want to avoid blocking UI, then again you don't need future, just run the code in the task or other kind of background thread. Also you should not compare Delphi with other languages that support async/await and which will not block the UI. If you want a future which works with callbacks you should not use PPL future but something else. I have one variant here https://github.com/dalijap/code-delphi-async/tree/master/Part4/24.2 TValue future
  2. Dalija Prasnikar

    Introducing My Delphi TFuture PPL For Thread Safe UI

    You don't and that is the whole purpose of blocking Future, to wait until the result can be used. If you don't want to block, then don't use future at all. Just use task instead. You are trying to solve the problem that does not exists. Task is async, future is just a blocking task. Trying to make PPL future async is pointless.
  3. Dalija Prasnikar

    Introducing My Delphi TFuture PPL For Thread Safe UI

    It can be useful if you have some code running between the point where you start future and point where you retrieve its value: LFuture := TTask.Future<Integer>(...); // start future task // ... some other code LFuture.Value // use future value If you just start future and then immediately ask for its value then future is completely useless: LFuture := TTask.Future<Integer>(...); // start future task LFuture.Value // use future value
  4. Dalija Prasnikar

    Introducing My Delphi TFuture PPL For Thread Safe UI

    The whole point of Delphi Future implementation is to be a blocking call. Now, we can discuss whether this kind of design is useful or not and in which circumstances. However, your improved Future is mostly useless. Instead of creating a future and then resolving it in additional task (you are involving two threads here) you should just run the code in the task and that is it. Simply use TTask.Run( procedure begin var LValue := (...); TThread.Queue(nil, procedure begin LogReply('Result: ' + LValue.ToString); // update UI on main thread that service the TTask end); end); No need to overcomplicate things.
  5. This has only been an issue if you make a mess out of your code design. In rare situations where you do need circular references using implementation section in one unit will suffice. I doubt that proposed changes would bring too much overall benefit and they would require extensive rework of the existing compiler architecture. There is existing feature which would be more beneficial for code organization: class helpers. Currently there is only a single supported helper in scope and having multiple ones would allow breaking down more complex code and organizing it into separate files. Implementing those would be a much simpler task, consistent with the existing architecture.
  6. Dalija Prasnikar

    What does [ref] attribute actually dows

    I think that original need to introducing [ref] was the need to force passing value parameters as references so they would match some cross platform API. I don't remember whether that was merely a difference between 32-bit and 64-bit Windows platforms, or there were other OS involved. I also don't remember whether C++ Builder support also had something to do with it. AFAIK, Allen Bauer explained this somewhere. I am not sure if this was only on his blog or it was also mentioned on old forums. New FreeAndNil implementation came years later and it merely used the feature that was introduced for other reasons.
  7. Dalija Prasnikar

    Alignment of group of controls

    Some additional options. You can view form or frame as text and doing the copy paste there. It is faster than doing it in the designer. Another way is aligning other panels to the bottom, and then aligning them back to top in order you want them.
  8. Few notes. First, when using free AI variants, your code will end up in the AI training data. And I wouldn't trust paid versions either. You need to be very careful that you don't give AI access to sensitive code that contains data which should not end up there. It is also very easy to do that by accident and it is prudent to run AI interactions in restricted environment like VM where you will have only non sensitive code. Next, anything that AI gives out needs to be carefully reviewed by human. AI often hallucinates and sometimes those hallucinations are not as obvious. This is especially important for code which requires some detailed explanations about how it works and why or some reasoning only person who wrote the code can answer (or the reasons are written in some other documents like specifications or design). Similar goes to writing tests with AI help. One of the huge problems with AI usage, is that with time, reviewing its output becomes a mundane task and this is where mistakes can more easily creep in.
  9. Dalija Prasnikar

    Moving from W10 -> W11

    You can fix that to show old menu options. Works fine. See https://superuser.com/q/1674122/464320
  10. Dalija Prasnikar

    Moving from W10 -> W11

    I would go back to Vista or Win 7 in blink of an eye. I would be thrilled if I could have stayed on Win 10, too. Windows 11 is by far the worst Windows version ever (and I could not believe this was possible after Windows 8). There are zero new features I want to have and they messed up everything else. For start half of the things no longer cannot be configured. Taskbar height is too big, colors and icons are awful, Windows theme even worse (selection colors, checkboxes, and similar), you need ten clicks more to do things, fonts are total nightmare and cannot be uninstalled. Whoever designed that Cascadia Mono font needs to be tarred and feathered. It is absolutely illegible and half of the websites are using is as the default monospace font. And this is just scratching the surface...
  11. Dalija Prasnikar

    OtlParallel Memory Leak

    Thread safety has nothing to to with speed. Strings are reference-counted and string assignment is not atomic operation. Assigning string variable from multiple threads can mess up the reference count and cause memory leaks and crashes. Yes. Access to the string needs to be protected (that includes other code that accesses that string even if it is just being read from). But, if the leaks are still there, then there are most likely some problems in other code you haven't posted. Which Delphi version are you using?
  12. Thank you! I would never do that. Disagreement does not imply lack of respect. It was not meant to bother you. This is why I also put a smiley at the end of my sentence. The point was to bring attention to your posts which are hard to read because of your AI usage. AI can be helpful, especially for communication and I know people who are able to communicate their thoughts better with the help of AI. However, that involves using AI very lightly and mostly for translating and fixing text they actually wrote. When you give AI more freedom to write things for you, the effects will commonly be the opposite. I am finding your posts where you used AI extremely hard to read. They are long and unnecessarily wordy. Another problem (not that relevant here and now) is that when one can clearly recognize something being AI generated more than having some light AI touches, one cannot be sure whether you are actually discussing something with a person or merely an AI. Are the points and arguments used really the ones that the person has tried to make or it is just something AI put there? It is hard to have a conversation in such situations. Nobody is trying to prevent anyone from using AI. You are free to use it all you like. I am not sure what you mean by spying or using third party tools. I am neither spying on you, nor I am using any tools for AI detection. As a Stack Overflow moderator, I have seen first hand the huge amount of damage AI can cause. The amount of posted AI answers there (where vast majority of them are completely incorrect AI slop) is not measured in thousands. It is measured in tens and hundreds of thousands. There are users who posted hundreds and even thousands AI answers. Imagine how much more of such posts would be there if AI would be allowed there. The site would be overflowed with AI. The only reason why AI is forbidden there is to preserve the site as repository of knowledge and a place where you can go and get help from actual experts in their field. Unfortunately, the only means moderators have to fight such influx of AI answers is to remove all and every one where some AI usage is detected (even when it is used merely for translating). We cannot easily distinguish between post which were fully AI generated and ones that were merely improved by AI. On the scale of Stack Overflow, with only handful of moderators removing AI, we cannot judge the correctness of each and every answer. Unfortunately, it would. You cannot add feature without removing the time needed to do implement said feature, from something else. That means less improvements in already used frameworks (VCL and FMX), less bug fixes, less IDE improvements. Embarcadero is not Microsoft, nor Apple, nor Google. They need to pick what they will do carefully to maximize benefits to all customers, which means focusing on the things that cannot be easily provided by 3rd party.
  13. Dalija Prasnikar

    OtlParallel Memory Leak

    Actually it is not nonsense at all. This is the source of your memory leaks. String assignments are not thread-safe.
  14. @bravesofts Maybe you would have better chances of convincing people if you would write your own thoughts instead of letting AI write them for you Delphi already has VCL and FMX frameworks. Feature wise it makes very little sense for Embarcadero to introduce yet another visual framework. Wrapping WinUI can be done through 3rd party, it doesn't have to be supported by Embarcadero. I would prefer that they focus on things that cannot be provided by 3rd party, like: compiler, debugger, language features, IDE functionality....
  15. Dalija Prasnikar

    Delphi 12.3 is available

    Yes, but the new 64-bit compiler is about compiler bitness, not platform. That means that compiler is no longer 32-bit process and can use all available memory on the system.
×