Jump to content

Mike Torrettinni

Members
  • Content Count

    1509
  • Joined

  • Last visited

  • Days Won

    3

Posts posted by Mike Torrettinni


  1. On 12/9/2022 at 9:24 AM, XylemFlow said:

    so I want to drive all the download traffic through my website.

    You might get better answers on forums related to website design... but, I have a simple /downloads page where php script does the downloading on Download button, there is no direct links. I don't have it designed this way because of ads, but I want to make sure they always download the latest version.

     

    On 12/9/2022 at 9:24 AM, XylemFlow said:

    My current web host is unlikely to provide enough bandwidth without me upgrading it

    I would multiply download file size with the download times you think you will get in a month, then you find the hosting that suits the download bandwidth. From my experience, the hosting packages don't just cut you off when you reach the max bandwidth, but they send multiple warning before you reach it. And then you can decide to upgrade or switch to another hosting, if that is easy for you to do. Don't forget that is pretty common to download zip files, so this can give you a little help with bandwidth.

     

    • Like 1

  2. Another one from the way back:

     

    this was a long function (500+ loc) and to skip all the unnecessary code and exit on first possible condition, I used ToExit label

    function Process: boolean;
    var vList: TStringList;
    label ToExit;
    begin
      Result := false;  
      vList := TStringList.Create; 
      ...
      // for fast execution, exit asap when condition is right
      if condition_to_exit then
      begin
        Result := True;
        goto ToExit;
      end;
      ...
    
      ToExit:
      FreeAndNil(vList);
    end;

     

    So many mistakes here, but It's been working 15+ years.  Ready for a makeover!

     

     


  3. I was sure I got rid of all Goto usage in my code. But I found this example today :

     

    for i := 0 to Length(vArray) - 1 do
    begin
      if vArray[i].SkipThisLine then
        goto labelSkipThisLine;
    
      ...
      ...
    
      labelSkipThisLine: // no code, do nothing with this data line
    end;

    This is probably close to 20 years old code, and never failed!

     

    I almost want to leave it there, just as a reminder it took me almost 20 years to get past the beginner level 🙂 

     

    • Thanks 2

  4. 1 minute ago, balabuev said:

    Thank for this hint. Did not checked yet, but it's definitely better than reopening the project.

    Let me know if it works for you. Sometimes I also switch between 32/64 platforms, because under 64bit it usually show more hints, if there are any hints.


  5. 3 minutes ago, balabuev said:

    Reopening the project each time is not an acceptable workaround. Effectively this makes Delphi 11.2 useless!

     

    Did you try switching between Release/Debug config? It helps my projects and I don't need to do the close and re-open.

     

    image.png.410d9eb95596248bbcfa6b0908787dcf.png

    • Like 1

  6. On 10/11/2022 at 6:23 PM, Ian Branch said:

    The passion behind not using 'with' is interesting.

    Also interesting is that I see no advocates.  Yes, yes, you will say "And the reason is....". 🙂

    To me it is just another tool in the tool box of the language.

    I can see and understand where concerns may be but as with any tool, used correctly, there is no issue.

    When I was using With a lot, I had the same view about With. But as it was already mentioned, a big disadvantage is using debugger with such a code. Very cumbersome, so I removed all With usage, except for a few basic forms, as in your example, for simple ShowModal - and these are in the process to be removed from using With, too!

     

    Do you use Virtual Treeview (TVirtualStringTree), have you ever looked into the code or try to figure it out? The usage of With is in every other method, including nested With!

    Such a great component, so incompatible with debugger!


  7. 7 minutes ago, Brandon Staggs said:

    Does anyone have any suggestions as to what I could do to try to make CTRL+CLICK work properly? In the past I found this problem with very large units and complex uses clauses, but that was many releases ago, and it doesn't seem to make a difference which unit I am looking at in a project where CTRL+CLICK doesn't work.

    When Ctrl+click stops working for my projects, I found the best and easiest way to get it to work, I just switch between Release/Debug configuration (and back) and you can see the Codeinsight process does something and Ctrl+click starts working again.

     

    So, if I develop in Debug and Ctrl+Click stops working, I double click on Release, wait 1s to see Codeinsight progress shows up, then double click to go back to Debug config:

     

    image.png.2e38b34779a3bc577bf43f38ea4ab4bf.png

     

    488.png.b56f5b4ff63066bd7d046e17a5126acb.png

     

    Annoying, but works almost every time and it takes about 5 seconds. So, not too bad.

     

     

    • Like 2
    • Thanks 2

  8. 3 minutes ago, David Schwartz said:

    have you considered making a helper method? Or a subclass?

     

    It really doesn't matter all that much, but they should be set together, not separately, IMHO

    I have TSplitter interposer in Commons.UI.SyncSplitters unit and method procedure SyncSplitters(aSplitter1, aSplitter2: TSplitter);. So all I do is use the unit and call SyncSplitters - which sets the Siblings, in one method. 

    Perhaps I'm already doing what you are suggesting.

    • Thanks 1

  9. On 9/12/2022 at 4:55 AM, David Schwartz said:

    Yes, I think they should be set together to ensure contextual integrity. Eg, a TSplitter.Constructor that takes the two splitters as parameters then sets their siblings appropriately.

    How would you use TSplitter.Constructor for splitters already on the form, to connect them?

    I already have UI set, don't want to create splitter controls when form is created, if that is what your suggestion requires. 


  10. 23 hours ago, FaFaFooey said:

    can anyone comment yet on Code Insight/LSP for Delphi?  specifically is there still that slight half-second delay when pressing ctrl+space to show the Code Insight window?  I know I'm being picky but I'm still on 10.2.3 because that half-second delay is like a small speed bump to my flow.  thanks!

    11.2 seems to have less delay than 11.1, almost no delay. Tested on fresh installation and medium sized project.

    I moved from 10.2.3 to 11.1 a few months ago and there are noticeable improvements.

     

    11.2 IDE seems quite less jittery than 11.1, smoother, less flicker.


  11. 3 minutes ago, Ian Branch said:

    So I was jus coming back to add that the TTimer is in an App Idle component.

    It looks for keyboard and/or mouse activity and if it doesn't see any for the time out period, 8 hours (240min), then it closes the App.

    Just wanted to say be careful with these numbers, if they are important... 8h = 480 minutes, right?


  12. 9 hours ago, HeartWare said:

    I'd use TJvSplitter from Jedi VCL, set their ResizeStyle = rsUpdate, and then on Splitter2's OnMoved event, I have this:

    I need to use rsPattern because of annoying flicker. I have multiple VirtualStringTrees and Scrollbox with multiple Frames and controls. But now I do see that OnMoved actually works when using rsUpdate or rsPattern.

     

    I prefer interposer solution, and no matter what control the Splitters resize, it just works when synched.


  13. 6 minutes ago, Uwe Raabe said:

    MMX visibility and position is stored with the layout, so just closing MMX will only hold as long as the layout is not changed. This is standard behavior for all IDE windows.

    I did all the steps above and it still shows up every time switching from form to code. New layout.

     

    Yes, IDE windows behave like that, until you save the new layout without them, then they don't appear anymore.

    I remember now, the change I made yesterday was to show Breakpoints debug window in normal layout. Perhaps this messed it up for MMX. But removing Breakpoints window is not fixing it, unfortunately,

     

    9 minutes ago, Uwe Raabe said:

    but I would not even think of closing MMX anytime, because I use it all over the place.

    I only use MMX sporadically, usually for cycling usage view feature. Not everyday usage, at this moment.

     

    I also have GExperts and CnPack and their experts/windows only show up on command. Not sure if MMX could use such a 'switch'.

     

    I searched for 'closing MMX' and no hits, so I guess is just my way of doing things, so no worries. 

     


  14. I used MMX in the past and all was good, but since yesterday I can't 'switch it off', so it doesn't show up every time I switch from form designer to code.

    So, as soon as I open and close a Form designer the MMX explorer window shows up. Switching F12 between code and Form, the MMX always show up even after I close the MMX, every time. 

     

    This happens on new empty project or in my projects. 

     

    Since yesterday I installed/uninstalled it at least 3 times, and was happening on every install. 

     

    So, is there an option I can use to show only when I want it, so I select it from the menu?

     

    Do I have any of these options set incorrectly:

     

    image.thumb.png.31977c0f312fb9558021c16617edb2f3.png

     

     

    Thanks!

×