Jump to content

David Heffernan

Members
  • Content Count

    3712
  • Joined

  • Last visited

  • Days Won

    186

Everything posted by David Heffernan

  1. I mean if you have a bunch of files that need to transformed once, then writing delphi code isn't the most efficient. You'd just use a scripting language to make the change and throw the code away. But if you have a Delphi product that needs to repeatedly perform this transformation then that's not going to be useful.
  2. If this is a one time transformation then it's easier with a scripting language
  3. This is just going to be the age old issue that most Windows code expects floating point exceptions to be masked, and Delphi's RTL unmasks them. So, mask floating point exceptions when you call into Python, and unmask them when the Python call returns. Or just mask them always if you don't care about floating point exceptions. Of course, the floating point support for changing floating point control state is not thread safe in the Delphi RTL as I have been saying for more than a decade now.
  4. David Heffernan

    calculete time in delphi

    It still doesn't make any sense to me why you wouldn't just use TStopwatch.
  5. David Heffernan

    calculete time in delphi

    No idea why you wouldn't use TStopwatch
  6. David Heffernan

    stringreplace character in all string

    I'm sure your function would give the same result. Did you read the earlier posts? They explain what is going on.
  7. David Heffernan

    stringreplace character in all string

    Why is that better than StringReplace? How does it relate to the problem in this thread?
  8. David Heffernan

    Move a Function or Procedure to a Unit??

    Get Martin Fowler's book on refactoring.
  9. David Heffernan

    Encrypting string

    Fair enough. Let's just switch to PHP then and be done with it. Bruh.
  10. David Heffernan

    Encrypting string

    Nothing there is useful. Hard to get past the basic sin of treating a string as if it were a byte array.
  11. David Heffernan

    Encrypting string

    It doesn't much matter what the thing is that you encrypt. What matters is who encrypts it, and who has knowledge of the key or keys used to encrypt and decrypt. That's what I mean by usage. As for how you do it, convert the text to binary using a well defined encoding, e.g. UTF8, and encrypt that. Encryption algorithms work with binary data not text.
  12. David Heffernan

    Encrypting string

    It depends on what your usage is
  13. David Heffernan

    Your Delphi verion does not support COMMAND

    Pro has command line compiler
  14. David Heffernan

    Strange stack overflow message

    Answer found in the code which we can't see.
  15. David Heffernan

    Cannot write to GetLibraryPath (Android)

    Save the file to a directory where you have write permission
  16. David Heffernan

    stringreplace character in all string

    Also, this isn't how to display binary in a hex editor.
  17. David Heffernan

    stringreplace character in all string

    Big lesson here is always to show a proper minimal but complete reproduction. It wasn't clear what the problem was from the first post which was descriptive. Code doesn't lie.
  18. David Heffernan

    stringreplace character in all string

    Should be #0 rather than '#0'. Your code is replacing the text '#0' which doesn't appear in the string.
  19. David Heffernan

    stringreplace character in all string

    Can you show what the output of your code is. It should be easy to produce a minimal complete program, a console app, that demonstrates the behaviour that you are struggling with.
  20. David Heffernan

    Reading a binary file hangup without error

    But it's not text, you can't treat it as text, and there's nothing to learn. What you should learn is how text is encoded. Why not do that?
  21. David Heffernan

    Opinions about Pascal vs C/C++ IDE

    Both Matlab and R seem completely inappropriate for this usage scenario. But R is not graphical software. It's best thought of as a scripting language designed for statistical use.
  22. David Heffernan

    Reading a binary file hangup without error

    You aren't going to be able to display the contents of a binary file in a rich edit control like this. If you want a hex editor, then display each byte as hex.
  23. It will work fine so long as you use the virtual constructor and all your classes override that correctly. If you passed in an anon method that creates and returns a newly minted form, that would allow other constructors to be used. To me this is pointless though. It's a really common pattern, it's only a handful of lines. I don't really see the benefit. I mean, if you were trying to centralise some logging or other aspect, then it would make sense. Otherwise I don't really see the benefit. Also the name sucks. Should include the fact that the form is shown modally.
  24. David Heffernan

    How to set TBytes array to the file size ?

    Well you have all of the information you need in a byte array. The index into the array is the address, and the byte value at that index is your value. Job done.
  25. David Heffernan

    How to set TBytes array to the file size ?

    You already read every byte!! The real problem here is that you can't explain what you are trying to do. What do you mean about getting every address? An exe file isn't a list of addresses.
×