hsauro
Members-
Content Count
102 -
Joined
-
Last visited
-
Days Won
2
Everything posted by hsauro
-
Oops sorry. Teach me a lesson for posting.
-
What framework, VCL or FMX?
-
It does more than trivial code. Even with trivial code, if it a long bit of trivial code, the AI is a time saver.
-
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.
-
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.
-
That's an impressive piece of software that I hadn't come across before. It would be hard to compete with today's dominance of Python in science but nevertheless, this is a nice piece of software in looks and functionality.
-
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.
-
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.
-
But you can now link lib files with your CPas since you say “Now you can link in static C libs directly into Delphi:”?
-
What’s the relationship with what you can do with to this article from rudy http://rvelthuis.de/articles/articles-cobjs.html Is it that you can now link lib files?
-
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.
-
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
-
Thanks, I’ll give it a try.
-
This looks very interesting. One question, are tuning up the AI for Delphi specifically or are you just using the AI as provided?
-
Returning numpy array constructed in Delphi back to python call
hsauro posted a topic in Python4Delphi
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. -
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()
-
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.
-
I saw that interface, I wondered if that would be something relevant. I’ll look into it
-
Looking for a couple of good "starter" Delphi books
hsauro replied to t2000kw's topic in General Help
I particularly like https://www.amazon.com/Delphi-XE2-Foundations-Chris-Rolliston/dp/1477550895 -
Returning numpy array constructed in Delphi back to python call
hsauro replied to hsauro's topic in Python4Delphi
It works! I can return a numpy array and list easily. Thank you! -
Returning numpy array constructed in Delphi back to python call
hsauro replied to hsauro's topic in Python4Delphi
I updated the sources yesterday afternoon. I'll take another look at the repo. I see there are some changes from 9 hours ago. I'll update to see if that helps. -
Returning numpy array constructed in Delphi back to python call
hsauro replied to hsauro's topic in Python4Delphi
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); -
Returning numpy array constructed in Delphi back to python call
hsauro replied to hsauro's topic in Python4Delphi
I updated to the latest 2023 version of delphi4python. It required some changes but it works without issue. The ability to automatically wrap either a class or an instanciated object requires hardly any effort on the Delphi side. I still need to figure out how to return a numpy array from Delphi to python, via a python call at the Python end. -
Out of curiosity I checked the original GitHub link, the page has vanished.
-
What new features would you like to see in Delphi 13?
hsauro replied to PeterPanettone's topic in Delphi IDE and APIs
I do Windows/Mac tools, so for me I’d like to see improvements to FMX, particularly the grid so that it had some of the same functionality as the VCL version. Some small improvements to the FMX TMemo would be nice as-well. I wish they would open the FMX to others so that the community could help since it seams Embarcadero is resource limited. The last thing that would be nice to have is the ability to generate webassembly. I’m starting to develop more and more client side web tools. I’ve used pas2js with success but Delphi must be one of the last major compilers not to support webassembly.