Jump to content

dummzeuch

Members
  • Content Count

    3019
  • Joined

  • Last visited

  • Days Won

    108

Posts posted by dummzeuch


  1. Surprisingly difficult to find any Delphi implementation at all.

     

    Googling "5F3759DF" "delphi" finally turned up something:

     

    http://www.sql.ru/forum/actualutils.aspx?action=gotomsg&tid=190407&msg=20745512

    function FastInvSqrt(const Value: Single): Single; inline;
    var
      IntCst: Cardinal absolute result;
    begin
      result := Value;
      IntCst := ($BE6EB50C - IntCst) shr 1;
      result := 0.5 * result * (3 - Value * sqr(result));
    end; 

    and

     

    function FastInvSqrt(x: Single): Single;
    var
      xhalf: Single;
      i: Integer;
    begin
      xhalf := 0.5 * x;
      i := $5F3759DF - (PInteger(@x)^ shr 1);
      x := PSingle(@i)^;
      result := x * (1.5 - (xhalf * x * x));
    end;

    These are using different constants.

    (And some more in that thread, unfortunately I don't read Russian, so I don't know what the result of the tests were.)

     

    Nothing useful turned up for "5F375A86" "delphi" which is supposedly the optimal constant when using Newtons iteration.

     

    And "fastinvsqrt" "delphi" found some more:

    https://github.com/itchyny/fastinvsqrt/issues/1

    (In Chinese, no idea what they are talking about, it is not part of the official list in that project.)

     

    https://sourceforge.net/p/graphics32/mailman/graphics32-commits/?viewmonth=201109&page=0

     

     

     


  2. After I managed to update the license on elc today (thanks again to Matthias Eissing), I was able to compile and use GExperts in Delphi 10.3.2. So far without problems, but that does not mean much because I started and exited the IDE a few times and didn't do much more. I'm busy with other stuff (using Delphi 2007).

    • Like 1

  3. 18 minutes ago, David Heffernan said:

    What else could EmptyString be? 

    That's the point: Why have such a constant if it's much more to type and more difficult to read than the literal?

     

    The only case I would use such a constant is to have it symbolize an empty string e.g. in a configuration storage where for whatever reason using a literal '' is not possible.

    • Like 1

  4. Does a constant called EmptyString with the value '' make any sense to you?

     

    I think it is just confusing. I mean, when I see it used somewhere I assume that it has some special value that is *not* '', otherwise the programmer would have used a literal '', wouldn't he?


  5. I got Delphi 10.3.2 installed, but now it tells me my update subscription has expired (No it hasn't, I renewed for a year in May 2019). The old version was also telling me that it had expired but kept working because it was released before May. May sales representative, who I told about this, had no idea and since I was busy with other stuff I never followed it up. That's what you get for not persisting at such times.

    I probably need some updated license file for our license server. I'll try to get that on the way on Monday, but don't hold your breath for any updates or bugfixes to GExperts for Delphi 10.3.


  6. Everybody and his brother – ahem – sister is blogging about the latest Update for Delphi 10.3 which has been announced two days ago. As always, Embarcadero’s servers are overloaded and have been down for hours. I have now started downloading the ISO and my browser is telling me it should be finished in 90 minutes. I’m not convinced yet…

    The first feedback has been that GExperts seems to work with the new version but there is an access violation when exiting the IDE. I’ll give it a try once the download has finished and if I can actually install the new version.

    Everybody else of course is welcome to get the GExperts sources and compile their own DLL to test. I’m interested in feedback about self compiled DLLs more than about the last release. If somebody can track down the AV and maybe even propose a fix that would be great.

     

    (that's actually the full blog post from here:

    https://blog.dummzeuch.de/2019/07/20/gexperts-and-delphi-10-3-2/ )


  7. I think I asked that before: Is there a keyboard shortcut for activating the code editor?

     

    If I remember correctly the answers were: No, but you can use F12 to toggle between form designer and code editor, and F11 for a three way toggle between object inspector, form designer and code editor.

     

    Do I remember correctly?

     

    If yes, I have some good news for those who have missed this functionality (which definitely includes myself):

    I have just added a simple expert to GExperts that does nothing else but activate and focus the code editor.

     

    But that raises a question: What should the default keyboard shortcut be for this expert?

     

    So I resurrected Nicholas Ring's Delphi Shortcut Finder, in order to find out what is still available. But unfortunately this tool, useful as it is, basically is only a list of known shortcuts with a filter function, so it might miss shortcuts from possibly widely used tools which I simply don't know.

     

    I first thought about some F11 combination but it turned out that they are already taken, the same goes for F12. Then there is Shift+F3, but I think this is used for "Find Previous" in some tools.

     

    The obvious combinations with the E and C key are also already taken.

     

    Shift+F6 seemed to be free for now. (F6 calls IDE Insight and Ctrl+F6 switches between C++ source and header files.), so I assigned it as the default for the new expert.

     

    Or Is there a widely used plugin that uses Shift+F6?

    • Thanks 1

  8. 10 hours ago, Mike Torrettinni said:

    Can GExperts reformat this:

    
    procedure VirtualStringTree1GetText(Sender: TBaseVirtualTree; Node:
            PVirtualNode; Column: TColumnIndex; TextType: TVSTTextType; var CellText:
            string);

     

    into single line:

     

    
    procedure VirtualStringTree1GetText(Sender: TBaseVirtualTree; Node: PVirtualNode; Column: TColumnIndex; TextType: TVSTTextType; var CellText: string);

     

    In definition and/or in implementation. I think single line is much more readable, when it's a long unit with lots of methods.

    No, GExperts can't (because nobody answered that question yet).

    • Thanks 2

  9. 5 hours ago, Mahdi Safsafi said:

    Didn't know that GExperts implements such functionality. 

    Does it sort function implementation too ?

    No, it only sorts lines alphabetically in ascending or descending order. Optionally it ignores prefixes like "function" or "procedure". It does not work if the declaration spans multiple lines.


  10. One of the first things I do is delete those annoying comments the IDE inserts: Private/Protected etc. declarations.

    Apart from that I sometimes use the GExperts sort expert to sort the methods inside a section alphabetically. But normally I just let the IDE put them in whatever order it uses.

    • Like 3

  11. My version of Thunderbird (52.9.1) doesn't insert the prefix for a HTML fragment, but it shows the code as HTML code (the same goes for RTF fragment) No formatted text at all. I'll update and check the latest version too


  12. Copying as "Formatted text/RTF/HTML" does not create an html fragment but a document complete with CSS. Have you tried that? Of course it depends which of the three formats the receiving application inserts.

     

    OK, it won't work either. Thunderbird in that case simply inserts plain text. 😞


  13. 1 minute ago, PeterPanettone said:

    BTW, in the file \gexperts-code-r2671-trunk\Projects\DelphiXx103\GExpertsRS103_version.ini there is this typo:

     

    InternalName=GExperts for Delphi 10.3 Tokyo

     

    Shouldn't it be "Rio"?

    Ouch, I fixed the version number but not the name.


  14. 7 minutes ago, PeterPanettone said:

    BTW, I've found the Fragment prefix useless:

    
    Version:0.9
    StartHTML:0000000105
    EndHTML:0000002128
    StartFragment:0000001413
    EndFragment:0000002112

     

    This is something defined by Microsoft:

     

    https://docs.microsoft.com/en-us/windows/win32/dataxchg/html-clipboard-format

     

    When I paste such a fragment into Notepad++ (or the standard Notepad) I don't get these prefixes. So I guess it's Thunderbird which does not know how to handle it.


  15. This seems to be missing the CSS for the various span elements. It's possible that this was meant to copy multiple code fragments into the same document which already has got the CSS definitions. But I don't really know, I have never used or looked at this functionality before.


  16. I have just updated SynEdit to the latest version from GitHub. Since both, RTF and HTML-Snippets are generated using the functionality in SynEdit, this may solve the problem.

     

    But as I said: I haven't got any Winword license to test this.

     

    Could you please compile a new dll with the current sources and check?


  17. 42 minutes ago, Mike Torrettinni said:

    I very rarely use that view to open units, even when working on projects I'm not familiar with, I usually follow the code. It would be nice to have more detailed/advanced view, like all classes defined in each unit or similar.

    There is the structure view which displays all classes, fields, methods etc., global types, variables and constants as well as the uses clause (of the interface section only WTF?)


  18. I just tried to reproduce this, but I could not. The RTF-code saved to a file looks fine to me and pasting into Wordpad and Libre Office Writer also works as expected. So this might be a MS Word specific issue. I don't own any MS Word license that I could use for the test.

     

    I tried Delphi 2007 and 10.3 since you did not mention your version.

     

    Does anybody know of a tool that can display RTF clipboard contents as text (I only found some that strip RTF formatting from the text) or do I have to write one myself?

     

    @PeterPanettone what about the bug report? Maybe it's something in your file(s) that causes the problem.


  19. 3 hours ago, Darian Miller said:

    I believe Delphi XE2 was the best release for IDE stability and 32-bit VCL development.   

    If that's true, the IDE quality must have been atrocious in later versions, because in my experience XE2 isn't really stable. But maybe that's a matter of how you use them. I still prefer the Delphi 2007 IDE over the later ones, but again that might just be the way I use it. The 10.1 and 10.2 IDEs also seem OK, but I haven't used them much. 10.3 definitively is a step back: It's slow, it's ugly and its buggy.


  20. Since apparently nobody has ans answer and I was unable to find any settings or method to achieve this, here is the code I used:

    procedure TMyForm.ResizeTree(_vst: TVirtualStringTree);
    var
      c: UInt32;
      ws: WideString;
      cnv: TCanvas;
      Fnt: TFont;
      ThisWidth: UInt32;
      MinWidth: UInt32;
      Node: PVirtualNode;
      r: TRect;
      s: TSize;
    begin
      cnv := _vst.Canvas;
      for c := 0 to _vst.Header.Columns.Count - 1 do begin
        ws := _vst.Header.Columns[c].Text;
        GetTextExtentPoint32W(cnv.Handle, PWideChar(ws), Length(ws), s);
        MinWidth := s.cx + 10;
        Fnt := _vst.Font;
        Node := _vst.RootNode.FirstChild;
        while Assigned(Node) do begin
          _vst.GetTextInfo(Node, c, Fnt, r, ws);
          ThisWidth := r.Right - r.Left + 10;
          if MinWidth < ThisWidth then
            MinWidth := ThisWidth;
          Node := Node.NextSibling;
        end;
        _vst.Header.Columns[c].Width := MinWidth;
      end;
    end;

    It's probably not perfect but it worked for me (until I dropped the VirtualStringTree because it just added too much complexity for what I wanted to achieve, and replaced it with the much simpler TdzVirtualTreeView which I had to extend for my use case.) I particular I don't like the constant 10 pixels in the code.

×