Jump to content

hsauro

Members
  • Content Count

    104
  • Joined

  • Last visited

  • Days Won

    2

Posts posted by hsauro


  1. I remember Embarcadero doing a demo of WinUI back in 2022

     

    https://blogs.embarcadero.com/delphi-winui-3-demo/

     

    it looked much more complex than VCL or FMX and didn’t seem to be a productive system to use. Just doing a hello world program looks hard

     

    https://learn.microsoft.com/en-us/windows/apps/how-tos/hello-world-winui3

     

    They could make the API easier but to what benefit. As someone mentioned earlier it looks like you can get the same UI look using FMX. So I’m not sure what’s the real advantage is. Plus how long will MS support it until they move on to the next thing. I think it’s better for Embarcadero to spend their resources on making what they have better.

    • Like 2

  2. I think Claude3.5 has improved a lot in the last few months. It will even request outputs from runs to analyze. Note I don’t have subscriptions but use the free time they offer. The other thing I do is ask the same question to ChatGPT 4o and claude3.5 and look at both answers. Sometimes I have to suggest alternative approaches in order to help them. Sometimes one will fail while the other succeeds. I also tried copilot and it doesn’t seem to know much. In general I use them to write mundane boiler plate code, like reading a json file. I could write the code but asking the AI to do it is such a time saver. It lets one focus on the more creative parts of the coding.  It’s also much less stressful than asking questions on stackoverflow.


  3. 8 hours ago, David Heffernan said:

    Personally I compile openblas and other libraries into dlls and link to them. Not least because the performance is obviously much better than code compiled by delphi. 

    Same here. I still do all my UI in Delphi however. I still haven't found anything else that beats Delphi in terms of productivity for building UIs. I've used QT and wxWidgets and both required much more work to use and the results were still subpar, mainly because it's so hard to do iterative refinements to the UI. 

    • Like 2

  4. Depends what numerical methods you want. Runge-Kutta is straightforward to write, I know there are some Delphi versions on github. Wht kind of plotting functions were you looking for?

     

    Is this the site you meant https://www.compadre.org/OSP/ ?

     

    If so this looks more like a collection of mini apps rather than a reusable library. I could be wrong.


  5. 8 hours ago, limelect said:

    I’ve used and it seems to work ok. I think it’s a nice idea. I only encountered one minor edge case (can’t remember them now) but the developers quickly fixed the issue.


  6. 4 hours ago, PawelPepe said:

    Hi,

    I would like to ask you about some help with accessing Cloud Services like Dropbox / Google Drive / Microsoft One Drive.

    As far as I know, every Cloud gives access by some API.

     

    I want to be able to send a file (text file or Image file) into one of this services. Is that possible?

    I mean:

    1. User launches my application

    2. Loads an Image (for example bitmap.bmp)

    3. Chooses Cloud service provider

    4. Uploads file into cloud and generates download link

     

    I assume that user has full access to cloud service (has an account, password and all needed authorization data).

    Have any of you dealt with such an issue?

     

    Where can I find some help? Maybe some example code? Where to start?

     

    -Pawel

     

    It’s hard to do this right out of the box as there is so much documentation to absorb. I’ve not tried myself but others recommend using third-party libraries such a tms cloud. I don’t know if there are any open source libraries available.


  7. There is a reply to the query from skis-discuss. Not sure if it helps:

     

    On Intel machines we fairly unilaterally disable MSAA-based rendering techniques, so the intel OpenGL and Vulkan cases are quite likely rendering on the CPU and just uploading a texture. There is a chance, since this is a convex shape, that it's using an analytic convex path renderer.  When MSAA is available, we prioritize some faster tessellating path renderers. It looks like on nVidia the sample locations are different between OpenGL and Vulkan for whatever reason, but both show a similar variety of grayscale values. I would guess that this is MSAA4 and is using the atlas'ing path renderer, which uses a sample count from GrContextOptions::fInternalMultisampleCount.  This defaults to 4, but you can override it to 8 and get higher visual quality.  You can also set it to 0 to disable the offscreen MSAA-based techniques. 

     
    DirectX 11 is drawing a circle without any anti-aliasing. You can do the same in Ganesh by setting the SkPaint's antialias boolean to false, although this will be ignored if you've created a MSAA surface to render directly too

  8. Thanks for the additional information, it would have taken me sometime to figure it out how to do it.  The code works as given.  

     

    One way to make it more manageable, which I might try, is to add the docs as attributes to the methods, then use rtti to pick out the attribute before wrapping, add the information to a dictionary then call the wrapper.  The DocSever could then just look up the docs in the dictionary. 


  9. I'd like to add doc strings to functions (or methods) that are in a wrapped Delphi object. I can see how to do it when adding the methods manually using AddDelphiMethod but haven't been able to figure out how to do it when using  RegisterDelphiWrapper. I looked at the module RegisterDelphiWrapper creates but I couldn't see the methods in my Delphi object and I could trace where the methods were added,

     

    For example, given this class:

     

    {$METHODINFO ON}
      ThostAPI =  class (TPersistent)
         function getVersion() : string;
      end;
    {$METHODINFO OFF}

     

     

    and registering via:

     

     host := THostAPI.Create (controller);
     DelphiWrapper.RegisterDelphiWrapper(TPyClassWrapper<THostAPI>).Initialize;
     DelphiWrapper.DefineVar('host', host);

     

    I'd like to add a doc string to getVersion()
     

     


  10. Thanks for the reply. I tried a very simple example to try it out with no arguments, a method that just returns a list of NULLs but I'm getting a runtime error (I also used setitem to fill the list in case that was the problem, but same error). This is the method:

     

    function ThostAPI.NewList : PPyObject;
    begin
        Result := GetPythonEngine.PyList_New(5);
    end;

     

    and here is the runtime error when using this python code

     

    from app import host
    x = host.NewList ()
     

    TypeError: Call "NewList" returned a value that could not be converted to Python
    Error: Unsupported conversion from TValue to Python value

     

    I couldn't resolve the issue so I started to use the more low level calls (not using the wrapping unit) and I can return lists and numpy arrays to python. But it would be interesting to know what might be the issue with the above code.  The class that contains NewList is just:

     

    {$METHODINFO ON}
      ThostAPI =  class (TPersistent)
          function NewList : PPyObject;
      end;
    {$METHODINFO OFF}
     

    In the FormCreate I just have:

     

    initPython;

     host := THostAPI.Create ();
     DelphiWrapper.RegisterDelphiWrapper(TPyClassWrapper<THostAPI>).Initialize;
     DelphiWrapper.DefineVar('host', host);


  11. I'm using the WrapDelphiClasses unit to construct a Delphi class whose methods than can be called from Python. I have it working without problem for simple types and lists. However, I can't work out how to construct and return a numpy array to the python call. I'm generating data within delphi but I'd like to do some analysis from with Python.

     

    I looked at Demo35 and it describes the construction of a numpy array but I am not sure what to return from Delphi.  I am currently testing it with this small test case:

     

    function ThostAPI.getNumpy : Variant;
    var np: Variant;
         arr: Variant;
    begin
      np := Import('numpy');
      arr := np.array(BuiltinModule.range(10));
      result := arr;
    end;

     

    But when I call this from python it returns None. What is the right way to return a numpy array from Delphi?

     

    I'm currently using Delphi 11.3 and the python4delphi that came with getit,. I think however there is a newer version which could be the issue as I know some buffer code has been added.

     

     

     

     

×