Jump to content

SwiftExpat

Members
  • Content Count

    222
  • Joined

  • Last visited

  • Days Won

    9

Posts posted by SwiftExpat


  1. 1 hour ago, Stano said:

    the pictures speak clearly to the problem

    You show 2 instances of the IDE @ 28% cpu usage with only .2mb of memory. The executable is not even loaded into memory at that point, it seems like there are not enough resources.

    Is this a VM or physical machine? How old is the machine?


  2. I added my vote, a direct solution would be the best. I doubt this will get much traction, I see you waiting since 10.3.

     

    As a workaround, what does GExperts not solve? (it is not the cleanest, but add some requirements and at least someone can evaluate it for a expert)

    1. Identify second instance - Solved, you have the screen above
    2. Close second instance - easy, just get the PID of ide and kill it / close it
    3.  switch to first? - is this really necessary?

  3. 4 hours ago, Stano said:

    If I don't realize it, I cry

    Cry because both instances have the same source open and edits overwrite each other?

    Maybe we can dry those tears, but let's understand the problem.

     

    I love that proven procedure above, rest assured we all have our proven procedures with the IDE  🙂


  4. You could follow the example included with Delphi, %samples%\Object Pascal\RTL\Parallel Library . It is a good example of a thread updating the UI and when to call synchronize. Parallel for is covered in the example.

     

    Review / debug / step through that and you will know where to focus your reading and searches.

    • Thanks 1

  5. 7 hours ago, omnibrain said:

    I also don't understand what "FNC" means

    Literally it is Framework Neutral Components.  When you install FNC components, they are available for VCL and FMX. Both frameworks are covered under the same license.

    It is all Delphi code, so not really any baggage.  In the source code it is a series of IfDef that adjusts for VCL or FMX.

    Likely the FNC version is a port of the vcl only component https://www.tmssoftware.com/site/diagram.asp

    FNC tends to be lighter on features, cheaper on the license.  VCL and FNC are both actively developed at TMS.

    The idea is that you learn the component properties, which are the same across VCL, FMX, lazarus and Web, and the component works the same regardless of the framework.

     

     

    • Thanks 1

  6. 34 minutes ago, Henry Olive said:

    600.005.0011

    1. split the string based on the delimiter
    2. for the last string in the list, ('0011')
    3. convert to integer (11) and increment (12)
    4. convert the int back to a string ('12')
    5. compare the lengths and then loop to add in the padding zeros ('0012')
    6. concate the list back to 1 string

  7. 9 hours ago, Incus J said:

    It looks a little bit over my head at first glance

    Many of those lines are just there just to be able to place break points and verify what lines are actually executed (or not executed ) when the application terminates.

     

    9 hours ago, Incus J said:

    what is the actual purpose of the OnDestroy event property in the object inspector

    Think of the situation where you need a child window, when that window is destroyed ( destroyed and closed are not the same ). In the parent window you would call free on the child window to have the destructor called.

     

     


  8. I thought about this one quite hard today, a bit of fun learning, and here is my suggestion.  FMX has the following mapped:

    procedure TPlatformCocoa.Terminate;
    begin
      FRunning := False;
      FTerminating := True;
      TMessageManager.DefaultManager.SendMessage(nil, TApplicationTerminatingMessage.Create);
      NSApp.terminate(nil);
    end;

    So in my app I implemented it as this , similar to what they recommend for android.

    unit dmDestroyMe;
    
    interface
    
    uses
      System.SysUtils, System.Classes, System.Messaging;
    
    type
      TDestroyVersion = class
      public
        VersionString: string;
        constructor Create;
        destructor Destroy; override;
      end;
    
      TDestroyMeDM = class(TDataModule)
        procedure DataModuleCreate(Sender: TObject);
        procedure DataModuleDestroy(Sender: TObject);
      private
        FVersion1, FVersion2: TDestroyVersion;
        v1, v2: string;
        msgSubId: integer;
        procedure ApplicationTerminatingHandler(const Sender: TObject; const Msg: TMessage);
      public
        { Public declarations }
      end;
    
    var
      DestroyMeDM: TDestroyMeDM;
    
    implementation
    
    {%CLASSGROUP 'FMX.Controls.TControl'}
    {$R *.dfm}
    { TDestroyVersion }
    
    uses FMX.Forms;
    
    constructor TDestroyVersion.Create;
    begin
      VersionString := '1.2.3.4';
    end;
    
    destructor TDestroyVersion.Destroy;
    begin
      VersionString := '0.0.0.0';
      inherited;
    end;
    
    procedure TDestroyMeDM.ApplicationTerminatingHandler(const Sender: TObject; const Msg: TMessage);
    begin
      v1 := '0.0.1.0';
      Fversion1.Free;
      v2 := '0.1.0.0';
    end;
    
    procedure TDestroyMeDM.DataModuleCreate(Sender: TObject);
    begin
      v1 := '2.0.1.0';
      v2 := '3.1.0.0';
      FVersion1 := TDestroyVersion.Create;
      FVersion2 := TDestroyVersion.Create;
      msgSubId := TMessageManager.DefaultManager.SubscribeToMessage(TApplicationTerminatingMessage,
        ApplicationTerminatingHandler);
    end;
    
    procedure TDestroyMeDM.DataModuleDestroy(Sender: TObject);
    begin
      FVersion2.Free;
      TMessageManager.DefaultManager.Unsubscribe(TApplicationTerminatingMessage, msgSubId, true);
    end;
    
    end.

    I will keep looking for the QP issue,  but honestly this is one they expect you to implement.  I just did not have the experience when I saw this the first time around.

    DestroyMe.zip

    • Thanks 1

  9. On MacOS the process is killed, so the app never gets to shutdown correctly.  I opened a support ticket with Embarcadero and was not given a resolution to this.

     

    I ended up with a timer to save state every x seconds 😞  Maybe someone else has a better solution.

    • Thanks 1

  10. It is worth reporting in QP.

     

    As a work around you could create a link and then add that linked folder to the end of your search path.

    Creates a symbolic link.
    
    MKLINK [[/D] | [/H] | [/J]] Link Target
    
            /D      Creates a directory symbolic link.  Default is a file
                    symbolic link.
            /H      Creates a hard link instead of a symbolic link.
            /J      Creates a Directory Junction.
            Link    Specifies the new symbolic link name.
            Target  Specifies the path (relative or absolute) that the new link
                    refers to.

     

    • Thanks 1

  11. 1 hour ago, Ian Branch said:

    Is there a Windows API that tells if there are any OS updates waiting to be installed?

    https://docs.microsoft.com/en-us/windows/win32/api/_wua/

     

    You should almost be able to follow this C# example

    https://stackoverflow.com/questions/64203306/c-sharp-get-pending-windows-updates-updates-that-cant-be-found

     

    Also you might prototype it in powershell just to make sure you are getting the results you want before you spend time writing Delphi code.

    here is almost a step by step

    https://mcpmag.com/articles/2016/06/23/finding-pending-updates.aspx


  12. You can also get the line size with sysinternals coreinfo, output looks like this:

    Logical Processor to Cache Map:
    **----------  Data Cache          0, Level 1,   32 KB, Assoc   8, LineSize  64
    **----------  Instruction Cache   0, Level 1,   32 KB, Assoc   8, LineSize  64
    **----------  Unified Cache       0, Level 2,  512 KB, Assoc   8, LineSize  64
    ************  Unified Cache       1, Level 3,   32 MB, Assoc  16, LineSize  64
    --**--------  Data Cache          1, Level 1,   32 KB, Assoc   8, LineSize  64
    --**--------  Instruction Cache   1, Level 1,   32 KB, Assoc   8, LineSize  64
    --**--------  Unified Cache       2, Level 2,  512 KB, Assoc   8, LineSize  64

     


  13. 7 minutes ago, Lajos Juhász said:

    remove the period and when I tried to compile it I got this error.

    If that happens consistently, then you might be able to trace the last unit compiled using sysinternals process monitor. Having that might help you work backwards into a "reproduce failure package".  You would have to judge if that activity is worth the effort, and i honestly do not know if it will fix anything for you.

     

    I always disable Enable Unit Directory Cache under Computer\HKEY_CURRENT_USER\SOFTWARE\Embarcadero\BDS\22.0\Compiling


  14. The client only knows / reacts to what it sends receives, so it could stay established. Sending keep alives is still a possible strategy.

    You can still have a timer on a router expire and the router will not send anything to the client(s). at that point it should be a re-transmit.

     

    It is still worth asking your network guys to understand if there is anything in the middle. Especially a load balancer in front of that HTTP server.


  15. 14 hours ago, David Heffernan said:

    Are companies really not prepared to teach people?

    They are not even planning on having full time trained staff. An MBA will tell you something like, "IT should be 1% of budget".

     

    The employer believes (plans) they have 2 options, outsource the project at a fixed price (which is never really fixed) or hire 3-4 low cost developers. 

     

    The last developers I worked with in Brazil explained the situation, school is on the first floors of a tall building. Floors 7-8 were for our company, and our competition had floors 11&12. So when they go down for coffee at street level they are recruited, for a small pay increase, so naturally you they jump after 6 months.  I don't blame them, it is better pay.  School is also heavily sponsored by Microsoft and Oracle, so no surprise what they were trained in.

     

    The contract negotiators go in a room and promise to provide a complete solution and a fully trained staff at a fixed cost (except travel expenses and ...). And they substitute players whenever they feel like it (see the above, just a different angle).

     

    So no it does not compute. If you are the full time company employee, you will be looking for that career change. The circle just continues.

     

     

×