Jump to content

Carlos Tré

Members
  • Content Count

    42
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by Carlos Tré


  1. 11 hours ago, corneliusdavid said:

    But consider this, too: responding with a quick smiley-face or one word response (e.g. "Agree!") takes far less time and effort than doing research on a question you may not know for sure. People take what is said in these sessions as gospel so the answerer needs to be certain what they're saying is spot-on.

    In a session about FireDAC Q&A I'd think that'd have been an easy one, after all Firebird 4 is here for at least 4 or 5 months. But now I'm peace with that, I'll have to wait for update 1 to rollout. 

     

    Straying a bit off the topic, I watched a replay of you session and would like to thank you fir that, until then I wasn't aware of the DataSetAdapter for JSON. Not only for that, but your blog's article on Live Templates that led me an old article by Nick Hodges that was just what I've been looking for ages. I even suggested during Nick's session that he could write a book on the matter.

     


  2. 5 hours ago, corneliusdavid said:

    I think they were fielding questions as fast as they could but could only get to so many. It went over time as it was. I've been on that side of the screen and you just can't get to everyone's question or comment.

    But isn't it strange that they found the time to discuss "delphee" x "delpheye"? If there wasn't any time spent over such a silly dispute, I wouldn't have been do frustrated.

     

    Cheers,

    Carlos

     


  3. 1 minute ago, Lajos Juhász said:

     

    It was strange that on live panel at an Embarcadero event there was nobody to represent Embarcadero (just to answer technical questions).

    They preferred to answer questions on UniDAC, MySQL and, believe me, there were answers (yes, more than one) to delph-ee and delph-eye.


  4. 12 minutes ago, Lajos Juhász said:

    Dear Lajos,

     

    Thank you very much for taking the time to help me, I really appreciated it. It seems hard to believe, but I've just asked the same question in DelphiCon's session on FireDAC Q&A and was completely ignored. It seems as if Embarcadero is not very keen on supporting Firebird.

     

    Best regards,

    Carlos


  5. Dear fellow programmers,

     

    Can anyone tell me if Firebird 4 is fully supported by Delphi/FireDAC? Back in July I read a post, in a Google groups stating that there not support. Yesterday I tried again and the story was the same. During a talk by Carlos Canty yesterday it seemed to me that there were people already using it in production, so I am a little bit confused here. Has FireDAC been updated to work with FB4? If yes, since which version? I'm on Delphi 10.4.2 and just waiting for things workwise to calm a bit to migrate to Delphi 11.

     

    Thanks in advance.

     

    Best regards,

    Carlos


  6. On 10/30/2020 at 5:08 AM, dummzeuch said:

    I think the problem with the Menu Shortcuts expert is, that it only changes the shortcut for the menu item, not that for the associated action. I guess I'll have to look into this a bit further.

     

    @Carlos Tré It's odd that changing the action's shortcut does not change the shortcut of the popup menu entry. They both use an action with the same name. Maybe these are two different actions? Not impossible given the mess some of the IDE modules present.

    Well, let's add to the confusion a little bit:

     

    I left this thing completely alone as I have more pressing matters to address but, much to my surprise, yesterday I went for a Ctrl+Shif+Alt+D attached to a duplicate line command I use all the time, and as I hit Ctrl+Shif+ALt+F by mistake I noticed it had started working as expected at some point. I can't make any sense of it, Ctrl-D is still listed as the context menu hot key, and the only things in between are some windows updates ans restarts, and the latest IDE patch that, I guess, is not related at all. Go figure!

     

    This late reply is meant only as a feedback to those who kindly dedicated some time to help and educate me.

     

    Once again, thank you all very much.

     

    -- Carlos


  7. 51 minutes ago, Achim Kalwa said:

    @Carlos Tré I like the "Insert Row Below" feature very much, but I had to remove the Ctrl+Enter binding because that is already used for "Open File at Cursor", which I use regulary; but keeping Shift+Enter. And I translated strings and method names from Portuguese to English 😉

     

    @Achim KalwaCtrl+Enter is an old habit from the Brief days, way before Delphi entered the scene. I think it needs some tweaking, I don't quite like its behavior on long lines. As it is ver rare and I don't have much free time and lack the expertise and knowledge to work it out, I guess it will stay this way for the moment.

     

    I usually turn "English language mode" on to code as it is consistent with the programming language itself, but when I wrote that piece I was particularly mad at unnecessary anglicization that stormed into Brazilian Portuguese, particularly in TI lingo, and overreacted; 🙂

     

    Thank you for taking the time to come back and comment, I appreciated it very much.


  8. 2 hours ago, Achim Kalwa said:

    @Carlos TréVery interesting; I would like to use that expert, too. What's the name of that expert? Or did you write it yourself and are willing to share the code?

    I wrote it myself a few years ago, based on an article written by Cary Jensen that you can find here. Attached is the code for the expert in its current state, the changing of the format source key assignment is still a work in progress.

     

    Editor.zip

    • Like 1
    • Thanks 2

  9. 5 hours ago, dummzeuch said:

    @Carlos Tré It's odd that changing the action's shortcut does not change the shortcut of the popup menu entry. They both use an action with the same name. Maybe these are two different actions? Not impossible given the mess some of the IDE modules present.

    That's exactly what I think. I'll toy with it a little more over the weekend and see if I make any progress on this.


  10. 5 hours ago, David Hoyle said:

    Use GExperts to define an alternate keybinding for this rather go through the rigmarole of creating an expert to do this.

    Thank you very much for your answer. I already had an expert in place to change the editor's toggle insert / overwrite mode for I am a lousy typist and was going crazy hitting the insert key when home was intended. As for a hammer everything looks like a nail, I thought that was the way to go.

     

     

    13 hours ago, dummzeuch said:

    I leave the rest (enumerating the list and change the shortcut of the action as an exercise to the reader. 😉

    This is what I did:

     

    procedure TMelhoriasEditor.ReassignFormatSource;
    var
      LNTAServices  : INTAServices;
      LActionList   : TContainedActionList ;
      LAction       : TContainedAction ;
      LActionName   : string;
    begin
    
      Assert(Assigned(BorlandIDEServices));
    
      LNTAServices := BorlandIDEServices as INTAServices;
      Assert(Assigned(LNTAServices));
    
      LActionList := LNTAServices.ActionList;
      Assert(Assigned(LActionList));
    
      for LAction in LActionList do begin
        LActionName := LAction.Name;
        if LActionName.Equals('actFormatSource') then begin
          LAction.Shortcut := (vkF or scCtrl or scShift or scAlt);
          Exit;
        end;
      end;
    
    end;

    It changed the main menu entry shortcut to the intended Ctrl+Shift+Alt+F key combination, but ir doesn't fire the action. Also, as noted, the local menu entry still shows associated with Ctrl+D and would fire it in case I remove its association with "MatarTecla", a do-nothing method.

     

    This leaves wondering if there's a way to get the TKeyBindingProc value other than the way (IOTAKeyboardServices.LookupKeyBinding) I tried.  Or if I just didn't figured out the way to work  it properly. Unfortunately this seems to be way above my league. 

     

    Again, than you all for your precious time helping me.

     

    -- 

    Best,

    Carlos


  11. Dear fellows,

     

    I'd like to change the format code action assignment to Ctrl+Alt+Shfit+F, because Ctrl+D is very easy to hit unintentionally. Based on articles I found ou there I was able to simply kill it, but now I need to simply reassign its hot key, and I am at a total loss here.

     

    I have a very vage remembrance of coming across sample code for OTAPI that was an actual keyboard mapping, it was quite a while ago , I'm not sure I really did. I took a wild guess from what found and tried

     

     

    The relevant section of wat I did so far is 

     

    procedure TMelhoriasEditor.BindKeyboard(const BindingServices: IOTAKeyBindingServices);
    var
      LBindingRec       :  TKeyBindingRec;
      LFmtKeyBidingProc : TKeyBindingProc;
    
    begin
      (BorlandIDEServices as IOTAKeyboardServices)
        .LookupKeyBinding([Shortcut(Ord('D'), [ssCtrl])],LBindingRec);
      LFmtKeyBidingProc := LBindingRec.KeyProc;
      BindingServices.AddKeyBinding(
        [
          Shortcut(
            Ord('F'),
            [ssCtrl,ssAlt,ssShift]
          )
        ],
        LFmtKeyBidingProc,
        nil
      );
      BindingServices.AddKeyBinding([Shortcut(VK_INSERT, [ssCtrl,ssAlt,ssShift])], AlternarModoInsercao, nil);
      BindingServices.AddKeyBinding([Shortcut(VK_INSERT, [])], MatarTecla, nil);
      BindingServices.AddKeyBinding([Shortcut(VK_RETURN, [ssCtrl])], InserirLinhaAbaixo, nil);
      BindingServices.AddKeyBinding([Shortcut(VK_RETURN, [ssShift])], InserirLinhaAbaixo, nil);
    //  BindingServices.AddKeyBinding([Shortcut(Ord('D'), [ssCtrl])], MatarTecla, nil);
    end;
    
    

    Could some kind soul put me in the right track, please? Also, am I dreaming about having seen such code for a keyboard mapping? 

     

    Thank you very much.

     

    -- Carlos

     

     


  12. 11 hours ago, Remy Lebeau said:

    Get rid of that assignment to the TIdHTTP.Request.AcceptEncoding property (unless you really want to try your hand at decompressing the data manually).  Instead, assign a TIdZLibCompressorBase-derived component, such as TIdCompressorZLib, to the TIdHTTP.Compressor property, and let TIdHTTP manage the AcceptEncoding property for you based on the compressor's capabilities.

    Thank you very much, now it works like a charm. Next step is filling a form fields, I hope I can translate you English explanation into "Indysh" by myself. We''ll see. 🙂

     


  13. Dear Kas Ob,

     

    Many thanks for help, very much appreciated.

     

    Quote

    This should be a problem as you telling the server that your request has content type, then you use simple GET without payload.

    1) check the working HTTP headers in the browser, either as Remy or google "browser developer tools network", 

    2) ContentType in the request most likely to be used with POST ( or PUT ), but not GET, so check the method in the browser too.

    A precious lesson you taught me here, it will most certainly will be of help in the future as well. The browser debugger was instrumental here.

     


  14. Dear Remy,

     

    Many thanks for your help, I'll try not to be PITA.

     

    Quote

     

    The fact that you are even getting an HTTP 403 error at all means the SSL portion is working fine, since HTTPS is encrypted and you are able to see a decrypted response. 

     

    If SSL was not the problem I set out to find what could it be that I was missing. As I told before, I'm a newbie to internet programming, and was unaware that I should set a few more properties. I'm not completely there yet, but made some progress and now there is no authorization error. The response I get is encrypted and I don't know how to decrypt it. Is this another property I must  set in order to solve it? Or shall I do further processing?

     

    As you probably must have noted by now, this is related to the problem I had with ICS, one that you kindly help me with. Having failed that POST attempt a few times I asked for and the webmaster set a lean and mean to get it working through a simple GET. And it did alright.

     

    Discussing my lack of experience on this matter with a fellow programmer, she suggested the change to Indy, so here I am 🙂

     

    This is the relevant part of the code that works

     

    procedure TForm1.btnGetClick(Sender: TObject);
    var
      LResp : string;
    begin
      IdHTTP1.Request.Accept := 'text/html, image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*';
      IdHTTP1.Request.AcceptEncoding := 'gzip, deflate';
      IdHTTP1.Request.UserAgent := 'Mozilla/4.0';
    
      IdHTTP1.IOHandler := IdSSLIOHandler1;
      IdSSLIOHandler1.SSLOptions.SSLVersions := [sslvTLSv1_2];
      IdLogFile1.Open;
      try
        LResp := IdHTTP1.Get('https://www.trivial.com.br/envia_arq3.php?senha=violeta&nome=tre');
      finally
        IdLogFile1.Close;
      end;
      Memo1.Lines.Add(LResp);
    
    

     LResp should get 'tre' and I get '*)Jÿÿ=h' instead. Also, the log file created is empty, most certainly due to something I'm missing again. The only property set at run time is the file name in the component, and the IsHTTP1.Intercept is set to the logger.

     

    Again, many thanks for all your help.

     

    Edit:

     

    The code began to work after setting the UserAgent property.

     


  15. Dear All,

     

    I'm not versed in HTTP a SSL, so excuse-me if I make any confusion.

    A FMX project I'm working on demands GET, POST, FTP and email receiving and parsing capabilities.

     

    I started with a simple GET do a HTTPS server, so I dropped a TIdHTTP and a TIdSSLIOHandlerSocketOpenSSL components in a bare form and configured as follows:

    • IdHTTP1.Request.ContentType  := 'application/x-www-form-urlencoded';
    • IdHTTP1.IOHandler := IdSSLIOHandler;
    • IdSSLIOHandler1.SSLOptions.SSLVersions := [sslvTLSv1, sslvTLSv1_1, sslvTLSv1_2];
    • IdSSLIOHandler1.SSLOptions.SSLMode apparently has no impact

    and then called IdHTTP1.Get(<https url>);

    In the application executable folder there are 3 files: libeay32.dll, ssleay32.dll and the application executable.

    The GET method raises an exception EIdHTTPProtocolException with the message 'HTTP/1.1 403 Forbidden', so I think I'm missing something very basic because the <https url> works in the browser, I just could't figure it out what that would be by going through both component's properties. Can you help me?

     

    Also, a long time ago I needed to use Indy in a project, and there were paid support available. Is there nowadays? As I said before, this line of work is not my strong suit and I don't want to be the PITA I'll probably be - I think I'll have many more questions.

     

    Best regards & TIA

    Carlos

     

     

     


  16. 1 hour ago, Remy Lebeau said:

    Also, make sure you submit ALL <input> fields that have a non-empty value - including the submit button itself!  Sometimes webforms have multiple buttons, in which case the webserver needs to know which one is performing the submission.

    Thank you very much for input, very much appreciated.

     

    How would I encode the submit button? Considering the code snippet

    input name="enviar" type="submit" value="Enviar">

    the URL encoded parameters shall be "senha=violeta&nome=tre&enviar=Enviar"

    (https://www.trivial.com.br/envia_arq2.htm?senha=violeta&nome=tre&enviar=Enviar)?

     

    -- Carlos

     

     


  17. 10 hours ago, FPiette said:

    You need to look at your form. "Action" is the URL you have to use to submit your form. "Method" is the way to submit if: Get or Post which maps directly to HTTP component. Then you have to look at all "input" tags to find the name of the items to send. Then you have to format a buffer with name/values pair and submit it.

     

    7 hours ago, Angus Robertson said:

    Also use TSslHttpRest instead of TSslHttpCli since this avoids you needing to use an SslContext in your application, look at the OverbyteIcsHttpRest sample.

    Thanks to both of you for your input, very much appreciated. I'll comeback and post the results.

     

    -- Carlos


  18. Dear All,

     

    I need to fill two fields in a form and then submit it. As I'm not well versed in this area, I come here and for some guidance.

    The page where they sit is coded as follows:

     
    <html>
    <body>
    <form id="form1" name="form1" action="envia_arq2.php" method="post">
    	
    Senha: <input  TYPE="password" NAME="senha" SIZE="12"><br /><br />
    Seu nome: <input  TYPE="text" NAME="nome" SIZE="12">
    <input name="enviar" type="submit" value="Enviar">
    </form>
    </body>
    </html>
    

    This is a FMX application, so I can't use TWebBrowser as I've found in several articles in the internet.

    Furthermore, even the VCL version I couldn't make work, after navigating to the page the Document property is nil, making it impossible to retrieve the fields as indicated in those articles.

     

    I then moved on to ICS TSslHttpCli, tried a few basic things, but I came up empty on the very first attempt where I just set the URL (https://www.trivial.com.br/envia_arq2.htm) and did a GET to try and see how to proceed from there. An exception is raised signaling a missing SSL Context. Perhaps this is not the way to go.

     

    Could you please kindly share some light on this?

     

    Thanks in advance.

     

    -- Carlos

     

     

     


  19. 18 hours ago, Javier Tarí said:

    I'm quite convinced to go the MVVM way, but your affirmation stopped me dead. Could you please tell why, so I can also abandon all hope? 

    It was past time I'd come back and share my conclusion.

     

    I'm not well versed in OOP, I'm just an old dog — *very* old, btw  — and lack the mind sharpness I used to have back in the day. The best I could come up with in order to make the implementation independent was to drop the interface approach completely and go the abstract class way. That better implementation tool or technology waiting around the corner will pose no problem. Also, they tend to be simple classes since they model data entry controls, so they don't require exhaustive testing.

     

    Thank you all for the input provided.

     

    Best,

    Carlols

×