Jump to content

Attila Kovacs

Members
  • Content Count

    2071
  • Joined

  • Last visited

  • Days Won

    29

Everything posted by Attila Kovacs

  1. 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.
  2. I think adding an "in my case" on the bottom of the second page of the thread is a little unfair.
  3. "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.
  4. 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.
  5. He isn't using that code at all. At least not in the tests.
  6. 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.
  7. Why don't you fix your tests first? You misled yourself with faulty tests.
  8. 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.
  9. 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.
  10. Maybe you have a special, dedicated RTL shipped with Delphi. Was it in a golden envelope?
  11. 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
  12. 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)
  13. @emailx45 what are you talking about? Do you have to flood every thread with some irrelevant google translated sh*t?
  14. Be positive. You can kill two birds with one stone.
  15. 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.
  16. SetWindow'sVisibleFlagTo( clChequered );
  17. EnableDisableWindow( Agree: boolean )
  18. 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.
  19. Attila Kovacs

    iPub Refit - REST API in simple way

    The other way around. Sometimes you just have to send the values you want to change and if you send a "null" for a field the servers clears it's value on the server side too.
  20. Attila Kovacs

    iPub Refit - REST API in simple way

    I don't know, I don't think that it was in Seattle, as I said, it's not in Berlin. At least I can see now, that you can pass converters. I could not figure it out before, no time to check it now either. But it looks good, there are only two more things coming to my mind which is necessary to handle all kind of json rest services. -To be able to suppress the null values from the nullables (or a shouldmarshal callback/wallpaper) -To be able to send and receive pure arrays "[]" , some php api's are working that strange way Then it will be a really really nice allrounder.
  21. @Delphi-Laie This is really cool man! A suggestion, don't know if it's possible, when the column count is reduced it should not shrink the window width but widen the columns. (Maybe some value would also fit in the columns.) PS: if you delete the "0" in the field "Rotation" the app AV's and dies.
  22. Attila Kovacs

    iPub Refit - REST API in simple way

    TJsonDynamicContractResolver.SetTypeConverter Okay, everything clear now. This unit is based on the very same called in .net. But .net has nullable types and they also have: Well, and what do we have? Yet Another Useless Serializer. I'll stick with my modified REST.JsonReflect.pas where I can register converters and reverters on PTypeInfo base.
  23. Attila Kovacs

    iPub Refit - REST API in simple way

    This is it. You don't have to. System.JSON.Serializers has a JsonConverter() attribute for it. You can even easily implement that only the fields which are - changed or not null or whatever - should be marshalled. Brrrrr. Looks like I was wrong on that. Looks like it's still a decorating-horror. I'll need more investigation on the code.
  24. Attila Kovacs

    iPub Refit - REST API in simple way

    Either they forgot to ship System.Json.Serializers.pas for Berlin, or was not finished to the time, I've checked 2 installations and it's missing in both! I'm still fumbling around with REST.JsonReflect.pas I'm freaking out right now, the header says "Copyright(c) 2016-2018".
×