Jump to content

David Heffernan

Members
  • Content Count

    3493
  • Joined

  • Last visited

  • Days Won

    172

Everything posted by David Heffernan

  1. No idea what type myPointer is. A simple 10 line program would reveal all.
  2. David Heffernan

    DCPCrypt v.2.0 - 64-bit?

    Code is utter shite anyway. Just cast @InData to PDWORD and use pointer arithmetic already. I would imagine that FixInsight would give the warnings you want.
  3. David Heffernan

    DCPCrypt v.2.0 - 64-bit?

    Every time you cast a pointer to a 32 bit integelral value, you are truncating. This is 64 bit porting 101. longword(@InData) That's truncation.
  4. David Heffernan

    Playing with Windows Fibers by emulating Python Generators

    I thought they'd been removed because they weren't useful. They were added for SQL server and in the end it turned out they weren't useful for that application.
  5. David Heffernan

    EXE Speeds: Delphi vs. FPC?

    I'm baffled. Both of these statements are wrong. Delphi is known to be produce very poor and inefficient code. Although I'm not qualified to comment on FPC's code gen.
  6. David Heffernan

    Can I use managed C# DLL in unmanaged Delphi application ?

    Yes. Probably the easiest way is with UnmanagedExports but it can also be done with COM. You may need to create a wrapper C# DLL to bridge the interface.
  7. David Heffernan

    Remove quotes from a string

    Looks like your json parsing code is wrong but you didn't show any code. Very hard for us to say what's wrong with your code when we can't see it. Don't be shy.
  8. Exactly. Why reinvent the wheel? And if you absolutely had to implement VPN in Delphi code, then hire an expert that has implemented VPN before.
  9. David Heffernan

    "Incompatible parameter lists" when using Types.T*DynArray?

    Using TArray<T> is better because it doesn't have type compatibility issues like this. It makes it easy for different libraries to interop. Because the different libraries don't need to know about each other and declare types in a shared unit.
  10. David Heffernan

    "Incompatible parameter lists" when using Types.T*DynArray?

    This doesn't seem to hang together. Could you provide a complete program to demonstrate the issue. I get that if you need to support pre generics versions then TArray<string> is out but if you don't need to support those ancient versions then this for is much preferable.
  11. David Heffernan

    while TStream_TryRead() do

    I didn't see that condition documented. I also hadn't realised that some streams can read fewer than the requested bytes but there still could be more left. That does seem a strange design choice. If you can wait for at least one byte then surely you can wait for all requested.
  12. David Heffernan

    while TStream_TryRead() do

    I not advocating the repeat. I think the TryRead is nice. Class helper for TStream would be good. I general TryXXX methods tend to be useful in loads of places.
  13. David Heffernan

    while TStream_TryRead() do

    Weird repeat loop. I'd do: repeat BytesRead := Stream.Read(Buffer, BufSize); until BytesRead < BufSize;
  14. David Heffernan

    .exe File not outputting

    It's because the second arg must refer to writeable memory and UniqueString ensures that. A websearch on CreateProcess and UniqueString will yield many discussions of the issue.
  15. David Heffernan

    bitmap is not displayed

    At this point, you probably need to sort it out yourself. You seem to have decided to take an approach that won't work. Given that nobody can make it work, you need to come to that realisation yourself.
  16. David Heffernan

    .exe File not outputting

    Why are you asking the shell to create a cmd process which in turn creates another process. Use CreateProcess and miss out the cmd middle man.
  17. David Heffernan

    PythonEngine and VCL.PythonGUIINPUTCOMPONENT not working

    Seems like a good place to start. Why keep asking here if when the answer comes, you don't heed it?
  18. David Heffernan

    PythonEngine and VCL.PythonGUIINPUTCOMPONENT not working

    So what is the question?
  19. David Heffernan

    bitmap is not displayed

    WinProcs? Why are you working with code from the 1990s? Where did that code come from?
  20. David Heffernan

    Spring4d in Linux

    Is this a minimal do nothing program? Or is your actual application logic there?
  21. Likely a defect in your code. You'll need to start debugging.
  22. David Heffernan

    Rounding issue

    There will be other calculations where that isn't the case
  23. David Heffernan

    Rounding issue

    Floating point can be tested for exactness too. Your idea of doing floating point calcs and then rounding to 4dp before equality testing is still subject to issues. If there are differences after the floating point calc, then the round to 4dp could fall on different sides of the rounding boundary. Always in these discussions there needs to be more specifics of the calcs involved.
  24. David Heffernan

    Rounding issue

    Why would you be calling power and then truncating to 4dp and comparing for exactness?
  25. David Heffernan

    Rounding issue

    Seems like bad advice. Why would you do this?
×