Jump to content

Edwin Yip

Members
  • Content Count

    431
  • Joined

  • Last visited

  • Days Won

    3

Posts posted by Edwin Yip


  1. As @Stefan Glienke has pointed out, we have TVarRec, Variant and TValue to deal with situation of:

     

    • The type of the parameter is uncertain

     

    But in addition to the above situation, open array parameters are designed to deal with even more complex situation:

    • Both the types and number of parameters are uncertain. The most well-known case is the Format function.

     

    However, I think the OP is heading to a wrong direction to use open array parameters for simplifying the example code he's given. There is at least one better solution:

    procedure DoSomething(const AParam: string); overload;
    begin
      // procedure body here
    end;
    
    procedure DoSomething(const AParam: Integer); overload;
    begin
      DoSomething(IntToStr(aParam));
    end;

    The overloaded procedures eliminate the use of the `if` statement and make the code simpler and easier to read.

    Just my 2 cents.

     

    Edit 1: Please note, 'less lines of code' <> simple, 'more lines of code' <> complexity

    Edit 2: One more benefit of my above alternative method - More user friendly to the clients (that uses the DoSomething procedures). Because the clients can see exactly the type of the parameters to provide, and this is exactly the advantage of statically typed languages over dynamically typed languages such as JS .

    • Like 5

  2. 55 minutes ago, pyscripter said:

    Putty splits the ssh functionality into different executables.  ssh is provided by plink.exe.  The project converted to a dll only psfpt.exe.

    Oh sorry, I guess I'm wrong on this part - there is no header translation for SSH yet.

    It's just that the author has stated that "SSH shell and SCP features will probably be added in a future version."

     

    That being said, I'm very interested in the SSH feature provided by your library!


  3. 9 hours ago, pyscripter said:

    I guess you mean opinions 😀.

     

    I was not aware of tgputtylib, but it is commercial and only covers sftp.

    Yes, I meant opinions :D And thanks for sharing them, I now have a clearer understanding of your great project!

    However, TGPuttyLib is open sourcehttps://github.com/superflexible/TGPuttyLib

    And yes, it currently supports only sftp. On the other hand, I guess it's quite easy to also add SSH functions because the header's already translated, just Delphi classes were lacking. The author used to say he has a plan for it.


  4. Well done! This project makes me existing :)

     

    Just recently I needed to implement a SFTP feature, I first tried the only two existing libssh2 wrapper for Delphi, they both are kinda out of dated, one of them is the one your project page points to. Both failed to pass my initial tests against SFTP servers on both Windows and Linux.

    I then resorted to https://www.syncovery.com/tgputtylib/ and it worked like a charm. 

    Just my two cents. If possible, would love to hear about your options on all the already available options and your decisions behind developing this new, promising wrapper!


  5. On 6/25/2020 at 9:10 AM, MarkShark said:

    cloned the SynEdit2 repository, made a branch (I think that's the correct thing)

    This is not the correct process as I understand it, you should:

    - Fork the repository on github web, so you that have your own repository that you can permission to make changes

    - Clone your forked repository to your local pc

    - Change the source code as needed (following the contribution rules, if any)

    - Commit and push your changes to your forked repository

    - Make a pull request to the original SynEdit2 repository, and wait for acceptance

    • Like 4

  6. 2 hours ago, pyscripter said:

    A more advanced wrapper for Scintilla was in http://myarmor.users.sourceforge.net/.   I had some involvement in the initial development.  But it died many years ago.

    A more up to date  wrapper exists in the Inno Setup source code https://github.com/jrsoftware/issrc/tree/main/Components.  However it is based on Scintilla 2.22, when the current version is 4.4...

    It seems that the myarmor DelphiSci wrapper is more feature-rich, but as you said, it's for v1.x and it's too old, not sure if it works with the latest version.

    the InnoSetup version also suffers the same issue.

     

    On the other hand, the github DScintilla I posted above works with 4.x (at least the version back in a year or so).

    Actually the DScintilla wrapper communicates with Scintilla through the SendMessage windows API, so it's quite easy to adopt new features.

    And don't forget , Scintilla is crossplatform (but not wrapper for Delphi on Linux or Mac).


  7. 1 hour ago, pyscripter said:

    What are the key features missing in Synedit:

    • Better Unicode handling:
      • Better support for wide characters e.g. Chinese ideograms (爾雅爾雅爾雅爾雅)
      • Support for surrogate pairs (two widechars correspond to one glyph)
      • Combining characters (e.g. Åström ḱṷṓn)

    I'm using the official SynEdit github repository, it seems that it supports Chinese characters?


  8. And right after this discussion, Mr. Arnaud Bouchez, author of mORMot, just released a new memory manager for FPC (both Windows and Linux) based on FastMM4!

     

    http://blog.synopse.info/post/2020/05/07/New-Multi-thread-Friendly-Memory-Manager-for-FPC-written-in-x86_64-assembly

     

    I kinda feel that the new release of FastMM5 and the consequent discussions stimulated him to take the challenge ;) Is it so, @Arnaud Bouchez ?

    • Like 1
×