Jump to content

David Heffernan

Members
  • Content Count

    274
  • Joined

  • Last visited

  • Days Won

    13

Everything posted by David Heffernan

  1. David Heffernan

    Laufleistung

    No, that is the device that measures mileage
  2. David Heffernan

    Laufleistung

    No English speaker I know, here in the UK, would say anything other than mileage. This is one of those words whose meaning is now detached from its etymology.
  3. David Heffernan

    Passing back a string from an external program

    Well, there are plenty of types for which races lead to errors. But how races manifest is not part of what defines them. A race is simply unserialised access to a shared resource. There aren't multiple definitions of this term.
  4. David Heffernan

    Passing back a string from an external program

    This is the dictionary definition of a race
  5. David Heffernan

    JSON string value

    I don't buy that argument. People are using the software now. And software is never finished. There is always more to be done. So if you wait until it is done, then you never document it. My personal experience, and very strongly felt, is that writing documentation is a key part of finalising and debugging specification. So many times have I experienced this. Only when you write the documentation do you realise some of the issues that users will face. Deal with them before releasing and you don't have to spend as much time in back compat hell. My view is that writing documentation in a timely fashion actually saves time and resources in the long run.
  6. David Heffernan

    JSON string value

    Python documentation is excellent. Likewise C# documentation. And so on. Delphi is an outlier here.
  7. David Heffernan

    Passing back a string from an external program

    Reading the stdout of the child process is a very easy way to do this.
  8. David Heffernan

    DelphiTwain on 64-bit

    You followed the instructions for 64 bit compilers, made the necessary change to the code outlined on the page you linked, obtained 64 bit drivers etc?
  9. It's not clear whether you mean 64 bit Windows, or 64 bit iOS or 64 bit Linux.
  10. David Heffernan

    getProcessAffinityMask failure handling in OTL

    Silent failure as you propose does not seem very useful to me. Surely better to use RaiseLastOSError in case an API call fails.
  11. David Heffernan

    JSON string value

    Why did you decide that 2 is the answer?
  12. David Heffernan

    JSON string value

    Hmm, rather perplexing conclusion. How did you arrive at it?
  13. David Heffernan

    JSON string value

    https://stackoverflow.com/q/11785963/505088
  14. You might consider buying the book if you want it.
  15. David Heffernan

    track process execution

    No need to hook anything. And in any case, what would you hook? Every process in the entire system? The system raises WMI events when processes are created and destroyed. https://stackoverflow.com/questions/47147099/is-there-a-way-to-recieve-a-event-about-a-process-starting-in-windows
  16. David Heffernan

    A YAML Library for Delphi

    This looks mighty cool. Kudos to you once again. In my codebase at work we use an in-house bespoke wrapper of libyaml. The big difference from yours, I suspect, is that we needed to support very large files, and opted for a SAX type interface.
  17. David Heffernan

    GetMemory vs. GetMem

    But actually, that turns out to be completely wrong. At least in XE7 malloc is implemented as function malloc(size: size_t): Pointer; cdecl; begin Result := AllocMem(size); end; which is pretty lame because AllocMem is zeroising the memory. And potentially throwing an exception. So, a somewhat bogus attempt to implement malloc. Perhaps what is really going on is that GetMemory is the function that you need to call if you want to allow GetMemory(0) to return a pointer to a block of memory, ie. that GetMemory(0) <> nil. But I'm not convinced by that either since the C standard demands that malloc(0) returns a value that cannot be dereferenced, which may or may not be null. Or perhaps it is just a function that returns nil in case of error rather than raising an exception.
  18. David Heffernan

    GetMemory vs. GetMem

    I'd read that as "GetMemory exists so that the Crtl unit can implement malloc".
  19. David Heffernan

    Good design for "file was just saved" message

    Sure, if you ask for an audit, then you want to see the outcome no matter what. But a program that yaps when it manages the to successfully save a file is poor UI. In fact, I've never ever seen such a program.
  20. David Heffernan

    Good design for "file was just saved" message

    Much more valuable is not to show any dialog at all and not to ask them to make a choice about whether they want to see it, and just have the program do the right thing.
  21. David Heffernan

    Good design for "file was just saved" message

    Last thing I want to see from an application is a modal dialog telling me that the app just did what I told it to.
  22. David Heffernan

    converting a C enum to Delphi

    You can read the C standard to find out how it handles that enum. Then double check with a compiler. I mean you surely aren't going to commit this without double checking with a C compiler?
  23. So TParallel doesn't service the synchronize queue?
  24. As for that zip file, you synchronise the pop but not the push. Anyway, replace the code with a lock and take it from there.
  25. There are other forms of locks that you might use. For cross platform code you'd use a monitor.
×