Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 10/24/20 in all areas

  1. Hi Edwin, Ok, I've merged ksSES and ksS3 into a single code-base. I've added a VerifySender method to the SES interface also. Lots of refactoring of the units will allow us to easily add more API methods and hopefully branch out into other AWS services. https://github.com/gmurt/ksAws I've also added support for NetHttp and Indy via a Http interface unit. To use Indy, simply remove the "." (period) character from this define in the ksAwsHttpIntf unit. {.$DEFINE USE_INDY_HTTP} I'll close down the existing S3 and SES repos later today and direct everyone to the new ksAws repo.
  2. Reinier Sterkenburg

    DelphiVCL: Fantastic! But there are some issues

    Hi Anders, Yes I'm still around 🙂 and still using Delphi. Yeah, the Delphi Bug List, that as a nice project, which got so much better when you started helping. Likewise, good to see you are still here as well!
  3. I have been using WordPress for this blog for several years and always thought my setup was reasonably secure. Turns out that there is something called the WordPress REST API which allows to get quite a lot information about the installation without any security at all. Read on in the blog post.
  4. Guess what? The new GExperts release is here. There are lots of bug fixes and a few new features in the new version. https://blog.dummzeuch.de/2020/10/23/gexperts-1-3-17-experimental-twm-2020-10-23-released/
  5. Hi Edwin, I will modify the code today to abstract out the http interface. I was working last night on merging the ksS3 and ksSES code to use the same base classes. Working really well with both now sharing the same signature generation code. I’ve merged both ksSES and ksS3 into a more suitable ksAWS repo here which I’ll publish later today along with more functionality added to the ksSES interface. Kind regards, Graham
  6. Mike Torrettinni

    Common callback functions, or not?

    Oh, Ok, I wasn't sure what you are referring to. But you want the purple icon, right? OK, I just 'thanked you'.
  7. Kryvich

    Common callback functions, or not?

    @Mike Torrettinni I think procedures are more preferable than functions for events, because you can easily recognize where an event is called and where it is assigned. I mean FOnGetSearchTextLine := GetSearchTextLine; // Assigning s := GetSearchTextLine(123); // Calling in your initial design
  8. FPiette

    Common callback functions, or not?

    The idea is that when no event handler is assigned, the component/class/object works correctly. That's why they are procedure and returned values are passed as var argument, just like I have done in my example: function TSearchFrom.GetSearchTextLine(ADataIdx : Integer) : String; begin Result := ''; // This will be the search line if no event handler assigned if Assigned(FOnGetSearchTextLine) then FOnGetSearchTextLine(Self, ADataIdx, Result); end; Another design tips is that if an event is triggered several times, a procedure is created for that: procedure TSearchForm.TriggerGetSearchTextLine(ADataIdex : Integer; var SearchText : String); begin if Assigned(FOnGetSearchTextLine) then FOnGetSearchTextLine(Self, ADataIdx, Result); end; and then you'll write: function TSearchFrom.GetSearchTextLine(ADataIdx : Integer) : String; begin Result := ''; // This will be the search line if no event handler assigned TriggerGetSearchTextLine(ADataIdx, Result); end;
  9. FPiette

    Common callback functions, or not?

    OK, I understand better. Your design is correct. You need an event in the search form to get text line at given index. Each frame initialize the search form event to a handler. TGetSearchTextLineEvent = procedure function (Sender : TObject; aDataIdx: integer; var TextLine : String) of object; TSearchForm = class(TForm) private FDataIdx : Integer; FOnGetSearchTextLine : TGetSearchTextLineEvent; function GetSearchTextLine(ADataIdx : Integer) : String; public function Search(ADataIdx : Integer) : String; property OnGetSearchTextLine : TGetSearchTextLineEvent read FOnGetSearchTextLine write FOnGetSearchTextLine; end; function TSearchFrom.GetSearchTextLine(ADataIdx : Integer) : String; begin Result := ''; // This will be the search line if no event handler assigned if Assigned(FOnGetSearchTextLine) then FOnGetSearchTextLine(Self, ADataIdx, Result); end;
  10. That should be easy enough to account for, using Random(16) to generate 4 random bits that can be shifted into the UInt64's bits 0, 31, 32, and 63 which the shifted Random(MaxInt) values will never fill in, eg: var Num, Bits: UInt64; Num := (UInt64(Random(maxInt)) shl 32) or UInt64(Random(maxInt)); Bits := UInt64(Random(16)); Num := Num or (Bits and 1); Num := Num or ((Bits and 2) shl 30); Num := Num or ((Bits and 4) shl 30); Num := Num or ((Bits and 8) shl 60);
×