Jump to content

David Heffernan

Members
  • Content Count

    3498
  • Joined

  • Last visited

  • Days Won

    173

Everything posted by David Heffernan

  1. David Heffernan

    TListView won't clear selection

    Make a minimal reproduction
  2. David Heffernan

    TListView won't clear selection

    Works fine here. Try it with a plain vanilla TListView to rule out the changes you have made.
  3. David Heffernan

    Uniqueness and Security of domain name

    Put the code that you don't want clients to have access to in a separate module/library/web service/etc. that is only available on your intranet.
  4. Bookmark this: https://softwareengineering.stackexchange.com/a/80092/14432
  5. David Heffernan

    Uniqueness and Security of domain name

    The question really is how much security you need. What would be the consequence of somebody outside your organisation getting access to this functionality?
  6. Sorting a reversed array is 100% from the real world. In a UI where you sort by a column ascending, and then sort by the same column descending.
  7. Earlier in the thread you said that the original problem from the SO question was driving this topic.
  8. Sample data might be useful. I'm amazed that you don't see the huge difference between your SO question and the code in this post. In this post you make one replacement. In the SO post you make five. That's the key issue here. And in five years you have not appreciated it.
  9. The code in this post doesn't accurately represent the code in your app which calls StringReplace repeatedly on the same string. As per the SO question.
  10. Your benchmarks are bogus because the real code replaces multiple strings. It is simple to make this code at least three times faster in the real setting.
  11. David Heffernan

    Yaml to json simple convert

    OK. In that case I definitely recommend the neslib parser. I myself use libyaml2 but neslib is good.
  12. Read back in the thread. He says that it's the same code as the SO question that he is trying to make go faster.
  13. The code is the code in the SO question which calls StringReplace multiple times.
  14. That's not the right way to solve this. The right way is to iterate over the string once rather than 5-10 times. Why would you want to iterate over the string so many times?
  15. David Heffernan

    Yaml to json simple convert

    It's really way easier in Python. Essentially a two liner, one to parse, and one to dump. That's how I'd do a one time conversion.
  16. David Heffernan

    Modernizing the Dev-C++ IDE

    I don't know about you, but I use the best tool for the job, not the best tool written in Delphi!
  17. David Heffernan

    Modernizing the Dev-C++ IDE

    Does anybody really see Dev C++ as being very useful these days? Unless I am mistaken, there are numerous IDEs now that far exceed what Dev C++ can do. Surely this is just a link about some work done on a legacy Delphi project. I can't believe the intent is to suggest that Dev C++ is relevant to C++ developers today.
  18. Leaving aside the issues that are commented on by other, instead of if Supports(fBaseFrameClass, ISupportTask) then (fBaseFrame as ISupportTask).CheckTask; surely you need var Task: ISupportTask; ... if Supports(fBaseFrame, ISupportTask, Task) then Task.CheckTask; Two changes: Ask the implementing object rather than the class whether or not the interface is supported. Use the three argument overload of Supports so that you can get the interface while you are querying for it.
  19. David Heffernan

    AnsiPos and AnsiString

    Take some time to find/write helper functions to do the sort of processing you need on these byte arrays and your code may even end up easier to read!
  20. David Heffernan

    AnsiPos and AnsiString

    AnsiString is no longer like an array of bytes because of the implicit encoding conversions that happen with that type. If you really have byte array data then perhaps a byte array is what you need.
  21. David Heffernan

    AnsiPos and AnsiString

    Why are you using AnsiString at all? Why aren't you using the string type?
  22. David Heffernan

    Yaml to json simple convert

    Trivial to do in Python. Read the YAML in, then dump to JSON. I'm assuming that this is a one time conversion. Because otherwise you'd use a YAML parser directly and wouldn't convert to JSON.
  23. What Mike is concerned about is that calling Replace is slower than filtering with Pos before calling Replace. In reality he is asking the wrong question. The right solution to the problem (see five year old SO question) is to iterate over the input string once rather than 5-10 times.
  24. Well there's your problem! Run through the string once only and you'll get a huge boost in performance. I described how to do that in my comment to your Q.
×