Jump to content

David Heffernan

Members
  • Content Count

    3586
  • Joined

  • Last visited

  • Days Won

    176

Everything posted by David Heffernan

  1. David Heffernan

    Running python code in Delphi threads

    My recollection of Lutz's work is that Learning Python is the book of his to read. As for the Python 2 vs 3 distinction, I'd be less worried about that. That's more about syntax details than concepts. A really good work written for Python 2 is better than an average work for Python 3. The differences between 2 and 3 aren't significant conceptually.
  2. David Heffernan

    True thread parallelism with P4D and Python 12

    Python is very good at managing change in my experience.
  3. Well I'd not want to use rtl code to convert float to string anyway because it doesn't get it right for all floats
  4. I've seen other reports similar to this. It smells like an emulator bug.
  5. David Heffernan

    Is it a problem if I create more threads than host CPU has ?

    Why would that be? Would it be because you asked a technical question without offering any details. Using more threads than processors can be effective when some of the tasks aren't CPU bound. A good example would be writing to or ready from disk. Accessing memory as the task I would not expect to be amenable to using more threads than processors. Usually computers have greater peak CPU throughput than memory throughout. So if the work is purely memory access then I'd expect CPUs to be idle. Because the memory access should be the bottleneck. You are quite right when you point out that nobody can advise you accurately without knowing your precise needs.
  6. David Heffernan

    Is it a problem if I create more threads than host CPU has ?

    Just use thousands of threads and get results yesterday, simples. No, if you use too many threads then your will get results slower. How do you even think computers work?!!
  7. David Heffernan

    Is it a problem if I create more threads than host CPU has ?

    There won't be a problem, but it just won't be efficient to use more threads than processors. My question for you is why you want to do that?
  8. David Heffernan

    Is it a problem if I create more threads than host CPU has ?

    Depends what the threads are doing
  9. David Heffernan

    %G equivalent in FormatFloat?

    You can't suggest that without knowing what the numbers represent.
  10. It's as necessary as it always was if you are using a pre Unicode Delphi. And yeah it's still around. Code doesn't vanish. Why would anyone develop it for compilers that aren't developed??
  11. Most of the tnt components map cleanly to standard vcl components iirc
  12. My take on this is that you want to start making changes in your Delphi 7 code base that don't change the meaning of the program there, but mean that it will compile and work as expected in both ANSI and Unicode Delphi. In an ideal world you'd be able to do all that work preparing for the switch and reach a point where you can compile with both ANSI and Unicode Delphi, and the program works the same. Then you can cut the chord to Delphi 7 and commit to Unicode Delphi. Then you do the second piece of work which is to get the code working on 64 bit.
  13. David Heffernan

    C++ / windows.h and data alignment

    That blows my mind!!
  14. David Heffernan

    C++ / windows.h and data alignment

    Sounds a little implausible
  15. David Heffernan

    C++ / windows.h and data alignment

    Obviously Microsoft's header files handle struct alignment correctly
  16. I've never in my life seen it written like that. Sure it works. But when you read it, it's not familiar and so it makes you think about it. Impedence. Patterns matter.
  17. What's especially awesome about the VCL code is that it writes the for loop in a really weird way as for var I: Integer := 0 to -1 + Items.Count do with the -1 before the count, and that seems to have taken from Setting the drop down width of a Combobox in Delphi – twm's blog (dummzeuch.de) which in turn is taken from Sizing the ComboBox Drop Down Width (thoughtco.com)
  18. David Heffernan

    Using inline variables inside loops

    I think the asker knows this. The question though is how many variables are there for an inline var inside a loop. Is there one variable? Or is the N variables where N is the number of times the loop body executes? That's the question being asked as I understand it. The answer is that there is one variable. Seems like this is the opposite behaviour from C# https://stackoverflow.com/q/271440/505088 Personally I feel like Delphi has a poor design choice here. I'd expect a local variable that is defined inside a scope, to have a lifetime that was that scope. With the C# design you can achieve both possible behaviours by defining the variable inside or outside the loop body. In Delphi you have to resort to putting the body in a separate procedure. The we have C++ which allow capture by value or variable as specified by the programmer in code. That would also give the same flexibility but without requiring extraction to separate procedure. Or am I wrong? I'm basing this on reading and not practical experience so I may have misunderstood.
  19. David Heffernan

    Load DLL from resource, bypassing a file?

    If you can distribute one file you can distribute more than one. This always feels like a pointless discussion. Solving a problem that doesn't exist.
  20. David Heffernan

    Rad 12 Beta - Link to News

    Usually each release comes with a bunch of bugs fixed, and a new set of bugs released into the wild. I do think the product is slowly getting better though.
  21. David Heffernan

    Delphi TOIOBE index lifted in May 2022?

    Do they treat you differently when you answer?
  22. David Heffernan

    Delphi TOIOBE index lifted in May 2022?

    Who cares about TIOBE? It's just irrelevant.
  23. David Heffernan

    When will we have a 64-bit IDE version ?

    It's strange that if this is what you want that you ask for something else. Classic XY problem.
×