Jump to content

Attila Kovacs

Members
  • Content Count

    1977
  • Joined

  • Last visited

  • Days Won

    26

Everything posted by Attila Kovacs

  1. How do you do that? Using it in blurry mode? Because MMX forms are broken in DPI Aware App mode.
  2. How long does this "IDE hang" takes? Can you attach the hanging IDE process to a debugger like OllyDbg and step through until user code and track it down what part of the IDE / Module it causes?
  3. Attila Kovacs

    How to fix "Warning'

    just write sl:=StrArray(TDirectory.GetFiles(SourceDir)); and drop "Dir"
  4. @David Heffernan I admire your patience.
  5. https://stackoverflow.com/questions/1282015/the-fastest-way-to-compare-a-partial-string answered by "mat"
  6. Attila Kovacs

    Free EurekaLog license drawing

    Holy cow.
  7. Attila Kovacs

    Uniqueness and Security of domain name

    As François suggested, set up a resource in the domain which you check against, then you can manage the permissions from the background. And for your customers, -as many of us suggested-, create a separate dll. If you are concerned about leaking the internal dll to the customers, load the data in the internal dll from the internal resource.
  8. I think adding an "in my case" on the bottom of the second page of the thread is a little unfair.
  9. "percent" is not a unit neither "lot" is If you are already patching files from your customers, it would have been a little effort to test it yourself on your use case with realtime data and post the results. I don't think that this test which comparing Pos() with SubString() and giving a result of 0,00006 milliseconds difference, makes any sense.
  10. I see now what you mean, you are right about optimization part (just as 5 years ago). I had only this thread in my mind.
  11. He isn't using that code at all. At least not in the tests.
  12. StringReplace iterates only once over the string, there is nothing to solve. It's his tests where he is ignoring the fact that StringReplace not only replacing (or not) parts of the string, but also assigns the result to a new string. Those test are failing and by fixing it the differences are not that big any more. A couple of milliseconds on a loop with 10 million iterations.
  13. Why don't you fix your tests first? You misled yourself with faulty tests.
  14. Attila Kovacs

    AnsiPos and AnsiString

    to answer your original question: They are in different units, one in System.AnsiStrings the other in System.SysUtils, and either you are using them mixed or they are declared in random order in the uses list.
  15. Ok, well Yes, it doesn't use Pos to check if it needs replacing at all. System.SysUtils.StringReplace: "FoundPos := Pos(xOldPattern, Str, FoundPos);" Fail. Aha, I just noticed StrigReplace has rfIgnoreCase flag. 6th line in System.SysUtils.StringReplace: "if rfIgnoreCase in Flags then" Fail. Your test case: vNewStr := 'Fail.'; if Pos(cNoFind, cLongStr) > 0 then vNewStr := StringReplace(cLongStr, cNoFind, cReplace, [rfReplaceAll]); Writeln(vNewStr); Fail.
  16. Maybe you have a special, dedicated RTL shipped with Delphi. Was it in a golden envelope?
  17. It comes handy for my form designer zoom as the IDE shat full the dfm with explicit values after a forced DPI change on the designed form. thx
  18. Brrrr, the oldschool way is to use DB Aware controls, like TDBSpinEdit and set its datasource to point to the dataset you want. Then you can write: procedure OnClick(Sender: TObeject); begin if Sender is TDBSpinEdit then TDBSpinEdit(Sender).Datasource.Dataset.CheckBrowseMode; // for example end; But, depending on what you are trying to achieve in OnClick it's possible that you have to move that code into the dataset's or its fields' events. (If we are talking about VCL and I understand your issue correctly)
  19. @emailx45 what are you talking about? Do you have to flood every thread with some irrelevant google translated sh*t?
  20. Be positive. You can kill two birds with one stone.
  21. Attila Kovacs

    iPub Refit - REST API in simple way

    Wow, that was an unexpected twist. I hope it's already on the wish list or a bug report was filed as unsatisfactory mimicking of .net.
  22. SetWindow'sVisibleFlagTo( clChequered );
  23. EnableDisableWindow( Agree: boolean )
  24. Attila Kovacs

    iPub Refit - REST API in simple way

    Sorry I don't know what you mean and how to test serialization with an example of deserialization. There should be an option for nullables if "null" values should be serialized or not at all, but you will find this out by yourself one day if you start using this lib with php API's. Anyway, I tried to compile the lib with Berlin and there are couple of things which are only Tokyo+. (Very far from "perhaps XE7"). (Edit: even in Tokyo, System.JSON.Serializers is so buggy that it needs several workarounds) But System.JSON.Serializers.pas compiles fine under Berlin, thanks for bringing this unit to my attention.
×