Jump to content

SwiftExpat

Members
  • Content Count

    222
  • Joined

  • Last visited

  • Days Won

    9

Posts posted by SwiftExpat


  1. I am not sure what the feature is called but for me this got better in  Delphi 11 after I eliminated all of my stray class "markers" down in the implementation section. I had renamed some classes but the old names were still there.

     

    Make sure those lines are valid, or something does not parse correctly.

    image.thumb.png.70cb7f573194803a223f893ec320cc6c.png


  2. Fellow Delphi Developers

     

    I would like announce version 2022.2.12 of RunTime ToolKit Marshal a component providing runtime inspection for VCL and FMX applications.

     

    For the Delphi 27 Anniversary a coupon for 27% off till Feb 27 is available --  Delphi27ANN

     

    Marshal provides:

    •  Object inspection for forms and datamodules
    •  Capture of change details and screenshots
    •  Application summary of compile options
    •  Data browsing an export for TDataSet descendants
    •  Execution of SQL for FireDac Connections
    •  

    Download Caddie as a demo to explore the features or from GitHub

    Follow along with this video to get an overview of inspection at runtime.

     

    Or click through the webstory

    https://swiftexpat.com/delphi27

     

    Follow this link for price info

    Take a look at the Wiki here:

     

    Thank you for looking and I welcome feedback

    SwiftExpat

    https://swiftexpat.com

     


  3. Since it is machine specific, does the application define the connection or use an existing ODBC connection? This could produce different results on different machines.

     

    Since you know the 3 columns that cause the query to fail, profile them to check for bad data.  Then you can understand what data in the column is getting truncated.

     

    SELECT  LENGTH( first_name ) len,   COUNT( * )
    FROM  employees
    GROUP BY   LENGTH( first_name ) ORDER BY len;

     

     

     


  4. 11 hours ago, Mike Torrettinni said:

     So, my project needs to have manually adjusted a setting that tells what the what the calling tool is and the starting point/directory.

     

    One item you might try is to use TPath to get the full path of a file in your working directory (the file does not need to exist).  That would give you the working directory at that time.

     

    program CheckWorkDir;
    
    {$APPTYPE CONSOLE}
    {$R *.res}
    
    uses
      System.SysUtils,
      System.IOUtils;
    
    begin
      try
        writeln('Working Dir = ' +TPath.GetDirectoryName(TPath.GetFullPath('pid.txt')));
      except
        on E: Exception do
          writeln(E.ClassName, ': ', E.Message);
      end;
    
    end.

    output:

    c:\Data>C:\Users\Coder\Documents\Embarcadero\Studio\Projects\OSUtils\TouchFile\Win32\Debug\checkworkdir.exe
    Working Dir = c:\Data\

    c:\Data>cd ibd

    c:\Data\ibd>C:\Users\Coder\Documents\Embarcadero\Studio\Projects\OSUtils\TouchFile\Win32\Debug\checkworkdir.exe
    Working Dir = c:\Data\ibd

    • Like 1

  5. On 8/13/2021 at 5:37 PM, Zoë Peterson said:

    The style objects also support nesting, and your version only includes the top-level of it.  

    I played a little more with this, but honestly it is no less code than what you already wrote, basically a recursive loop writing a JSON.

    On 8/12/2021 at 12:54 PM, Uwe Raabe said:

    Might be tricky to persuade the third party lib to create your new classes rather than its own.

    This statement form Uwe helped me understand the complexity better.  FNC gets the object type using RTTI, so I am not sure it is worth trying to trick / persuade it.

     

    StyleAPI is an example of how to seal an API.  Since the reference is via an include, I would be tempted to copy it and modify visibility.

     

    Zoe, you deserve a thanks for digging through the API and making an export with it.


  6. TMS FNC Core has a a library that works with published properties.  It is licensed with FNC. 

    TMS blog post describing it here:  https://biz.tmssoftware.com/site/blog.asp?post=646

     

    Here is your code forked / converted to work with FNC : https://github.com/SwiftExpat/vsf2json .  EXE and a json sample are in the releases so you can try it out if you like.

     

    I had to derive a class to include the list of style objects, but not much code to write at all.

      TExportStyleSource = class(TSeStyleSource)
      public
        function GetStyleObjects:TList;
      published
        property StyleObjects: TList read GetStyleObjects;
      end;


  7. 15 hours ago, PeterPanettone said:

    I would have to insert a small component (or create it dynamically) that creates a form holding the RunTime Inspector and maintains a mutual connection with that form?

    This is correct, you can see sample source code on Github here with compiled demos here. The component is a simple button which is appropriate for starting out. 

    In an established application I take the approach to not use any extra space on the form by utilizing an onclick event handler of a label. The FMX sample shows a click 3 times on a label to invoke, similar to the 7 long presses in Android.  This design allows you to ifdef out the code for your release and not modify the form. Note the ifdefs in the samples.

    15 hours ago, PeterPanettone said:

    So when the Inspector asks for a specific (updated) component property or when my app has to change a property value, then this connection gets these things done? Is that correct? 

    This is correct. This code maintains the tree of forms, data modules, components.  The Inspector loads the component details but is not automatically aware of changes that occur. On the Inspector tab there is a button that always allows you to reload.

     

    In general workflow it stays up to date, but depending on what events are assigned on the component you may need to reload. An example would be modifying the align edit1 from center to client, The Inspector updates the align property because it is aware it made the change.  The width still shows 100 as in the Inspector because it is unaware of the new width due to alignment. A click on the reload button will force it to load the current values.

     

    • Thanks 1

  8. At runtime my component "Marshal" creates a form dedicated for inspection.  This is where you inspect and have access to the components.

     

    My offline application "Caddie" captures your actions in Marshal and lets you review them later.  This is organized by application and is not connected to the runtime copy.

     

    Together they make up the Runtime Toolkit.  The challenge I attempt to solve is documenting modifications at runtime so you can ensure the correct changes are made in your source code.  I like Marco's original tool, but I found myself not remembering what I modified to fix my issue.

     

    I appreciate your features requirement clarification, but at this point I only do component inspection.

     

     


  9. Also worth mentioning from TMS is with the FNC UI pack you get an object inspector. Note in the documentation it calls out that you are inspecting published properties only. TMS FNC Object Inspector does not populate a tree of the application components, it is just the Inspector.

    https://www.tmssoftware.com/site/tmsfncuipack.asp?s=fncobjectinspector#features

     

    To your original question of all classes and objects, it is worth considering visibility and ownership.  The component tree is populated based forms / data modules owned by the application, then components owned by the form.  Consider if you are creating components at runtime and the owner is assigned to the form, if not then the component will not be visible.


    I have used it to inspect some of by business objects, with the condition that the property is published.  It also has events so that you can make properties read only at runtime. Take a look through the PDF and see if it fits your needs.

     

    If you desire a component tree you could build / buy something like my product,   I do not include a license to FNC UI pack, it is a separate purchase. Some youtube videos are available at https://swiftexpat.com that will give you an overview.

    image.thumb.png.ad2afae0ab690eda52b2ecb61394bd33.png

     

    • Thanks 1

  10. 55 minutes ago, dummzeuch said:

    I looked a the performance tab of Task Manager and saw that during the fast access (presumably from cache) no disk access was shown "Active time" was 0). During the slow access (presumably not from cache), disk access was shown ("Active time" was high). 

    For me this confirms it is cached. I would not waste time in perfmon.

    I would go with @Kas Ob. and his number 5.  I have never read into any of that material but it sounds like a logical boundary that the OS would not allow you to cross.


  11. Have you used Task Manager to watch the cache counter in the Memory tab? It is a good place to start before perfmon.

     

    While that disk might look local to you, it is likely on some storage array which could have some block caching. Consider how much RAM is on that server to cache with and how busy is that server when you are executing your programs.

     

    Perfmon with some counters set around physical disk, % idle time, read queue length, reads per second and  is a good place to start to see when it is actually hitting the physical disk and if it is waiting on disk. Compare your reads per second against run 1 an run 2.  Also grab the cache counters and look to see if any of them spike on a second run, this will give you an OS cache look.


  12. They are not nearly the same functionality, stick with TMS.

     

    I think of it like this, PY4D loads python39.dll into Delphi at the api level.  At this point you have an execution engine.

     

    As a developer you want / need to wrap your Delphi API to make it python friendly / usable. A justification would be to python enable your end users as some sort of marketing selling point.  I fear you would be teaching / debugging your end user python which is copy paste from the internet.

     

    It is valid large investment if you want to grow out of your application something like this where the Wing IDE is interacting with Blender.  Look at this as an example and just imagine the work to get there.

    https://wingware.com/doc/howtos/blender

     

     


  13. I do not have a solution for this, but have some thoughts to explore this further:

     

    Do you really need the IDE embedded in your application or could you treat it as a remote execution / debug scenario?

     

    Which code, Delphi or the Python script, do you need the user to be able to watch / step into?

    --how deep does the customer really need to watch into your Delphi code, first public level only?

     

    Could you use PY4D to host the interpreter and then remote attach to it with the IDE?
    --this is probably the path to aim for, it may require more wrapping of your Delphi code, but then you have options on the IDE side.

     

     


  14. Another way to solve the problem, when you need to add / modify to path, order is likely important.  Just run the command in python:

    import sys
    sys.path.insert(0, 'path/to/script')

     

    The engine has a property, PythonEngine.InitScript:

    PythonEngine.InitScript.Add('import sys');

    PythonEngine.InitScript.Add('sys.path.insert(0, 'path/to/script')');

     

    The benefit is when you attempt to run / unit test in python and need to modify the path. And if you use PyScripter as your python dev tool the approach will be reusable.

     

     

    • Thanks 1

  15. Christian,

     

    It sounds a lot like desktop heap limitation, most likely on the terminal server.
    A summary document to describe the problem is here: https://techcommunity.microsoft.com/t5/ask-the-performance-team/sessions-desktops-and-windows-stations/ba-p/372473

     

    The registry reference is here:

    https://docs.microsoft.com/en-us/troubleshoot/windows-server/performance/desktop-heap-limitation-out-of-memory

    the fix is in step 4: In the Value data section of the Edit String dialog box, locate the SharedSection entry, and then increase the second value and the third value for this entry.

     

    You can bump those values up 512 at a time and see if it helps. Unfortunately it is a reboot each time.

     

    For a more scientific approach, I found this from an MVP. https://thundaxsoftware.blogspot.com/2011/10/monitoring-desktop-heap-memory-and.html

     

     


  16. I should clarify, ongoing defects considered and compared, Delphi has no more stability problems on my AMD vs Intel laptop. I acknowledge that if the hardware gives me perceived stability, it is likely masking race conditions.

     

    My Intel laptop is not likely be more than 10-15% slower in this workload, both are SSD as David points to. Laptops suffer from heat, as soon as the processor gets hot it starts to throttle down. The new desktop has plenty of cooling so it stays at full throttle. Your goal with an AMD build has to be keep it cool to maintain full core speed. So the speed gain is likely staying at full throttle, with a little extra clock speed.


    If you are looking at a 5600 you should be running more than just Delphi to actually use those 6 cores and the cache you are buying.

    • Thanks 1

  17. I have been running 10.4.2 for 2 months on a AMD 5600X with no stability problems.  Mine is a desktop build, so cooling is easy to keep under control.
     

    The IDE is very responsive, LSP definitely performs better compared to my laptop,   Compile time is 20-30% improved.

     

    IDE stability is likely linked to the graphics card / driver underneath more than the processor. I did go very low end with an NVIDIA GT 1030 from a good supplier ASUS.

    • Thanks 1

  18. I am running 11.2.3 Big Sur on virtual box, XCode 11.5.  The downside is there is little graphics acceleration, so do not expect to test a UI application at real speed.   I would recommend 8GB ram for the VM and 4 procs.
     

    You can experiment with it from here, results will vary with hardware, just remeber to add the extras in VBOX:

    https://www.soupbowl.io/2020/04/macos-in-virtualbox/

    https://www.wikigain.com/create-macos-big-sur-iso-image/

×