Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 07/11/25 in Posts

  1. I just released my NCG library as open source on GitHub. The full library description and documentation here. Discussions: I think it might be the only NGS Pascal library out there... The program works quite fine but it speed is not impressive... on the other hand is does not have any optimization and it is single threaded. If you have multiple patterns to look into the "big" image, each one could go into a thread. On a CPU with 12 cores, like mine, this code could easily behave as and OCR 🙂 Pre-compiled demo program also available. Enjoy. ____ Related to image processing: You will find also some basic image processing code in my LightSaber lib. There is another library that I will make it also open source that adds metadata to an image, so you can autorotate it based on exif, add "stars" to it (how much you like, it), pregenerated thumbnail (to save some time CPU next time you show it), etc. So, stay tuned... 🙂 ____ PS: On Git hub, vote only the libraries you like 🙂 🙂 🙂 I invest time in those that get votes 🙂
  2. Hi All I'm looking at getting QuickJS working in Delphi. Sadly my C skills are not at the level needed to get anything to build in CBuilder or Visual Studio these days - it's not the same language I used 30+ years ago. There are a bunch of forks of this project, and I am pretty sure I have tried them all but have yet to get a completely successful build - probably because I don't know what I am doing. Ideally I'd like to be able to generate Win32/Win64 object files that I can link into delphi, or if that isn't feasible then a dll that I can load. Prefer C++ Builder but failing that Visual Studo 2022 is also an option. The C code apears to be written for GCC and supports Win32 via MINGW. I am willing to sponsor someone to work on this if needed. DM me if interested. Timeframe is asap!
  3. Hi everyone, I wanted to share the main updates in version 1.1.0 of DelphiGenAI (OpenAI wrapper for Delphi) here—mainly to offer what I can to the community, and maybe get some feedback if anyone feels like weighing in on my approach. Main Updates Compatibility with the Latest OpenAI Features (including Remote MCP & Code interpreter) Ready-to-Use Templates Two archives (TestGenAI_VCL.zip and TestGenAI_FMX.zip) let you copy and paste any snippet from the documentation and test it out, with no complicated setup. Variety of Code Snippets For each feature: synchronous, asynchronous (event/callback), and asynchronous with async/await. The idea is to allow everyone to compare the approaches and pick the one that fits them best. Documentation That’s Directly Usable All markdown examples can be tested as-is within the supplied templates. A Gradual Learning Path The aim: make it easier to learn about AI in Delphi, whatever your starting level, and to keep things as accessible as possible. About This Approach I’m not an experienced “Delphi old-timer” and I don’t know the community very well yet; that’s why I chose to offer several approaches (synchronous, asynchronous, and async/await) for each example. But maybe that’s not really necessary—maybe some would prefer strictly asynchronous, or even just synchronous? I’d be interested in your thoughts or experiences on this (no pressure—just curious, and trying to do what's most helpful). Also Tried on Other Wrappers I’ve used the same principle in a Delphi wrapper for Deepseek. Depending on the feedback I get here, I’ll decide whether to take this approach with a few other wrappers I’ve put up on Github. Thanks in advance for reading, and best wishes to all.
  4. pyscripter

    Interesting read about Sleep(0/1) and SwitshToThread

    By the way, TThread.Yield is the cross-platform way to call SwitchToThread.
  5. DelphiUdIT

    Interesting read about Sleep(0/1) and SwitshToThread

    I think all is linked to the time of SO post, 15 years ago. Talking about CPU here is about CORE, when there are multiple CPU other things come in play and the sleep is the last of the issues. Take care now ( @Kas Ob. told this) that the real life is different: no one use affinity with one thread (yes, I do it but for really unique needs), the threads work are balanced by ITD (Intel Thread Director) that acts between OS and hardware, and also Windows may have changed some logics. If you look at your thread (not the one in the example that's "blocked" by Affinity), you'll see that it's "moved" by core during its lifetime. That is, a thread doesn't necessarily always run in the same core. So, if Microsoft were to say that SwitchToThread works in a certain way with modern hardware... well, I wouldn't be so sure, or rather, not in the context we're imagining, given that the load distribution is dynamic.
  6. Shano

    Deploying Delphi 12.3 iOS App to iOS Device

    Firewall was off on the Mac already. Closed down and restarted and messed around with some settings and it all started working. Just another Delphi refreshing issue from the looks of things.
  7. Remy Lebeau

    $DEFINE: how does it work?

    Pascal code is compiled top-down in a single pass. DEFINE, IFDEF, etc are compiler directives that are evaluated only at compile-time. The resulting code is fixed, it cannot be changed at runtime. If you try to IFDEF something before it has been DEFINE'd, the result will be False. Hence the name IF-DEFined. In any case, DEFINE/IFDEF is not the correct solution for your problem anyway. You are making a decision based on data known only at runtime, so you need to add an extra parameter to your function that is called at runtime (you need to add a Sender parameter, too), eg: function doTheReport(Sender: TObject; Bo: Boolean); begin if Bo then Result := DoCharges(true, -1, False, False, False, lg('CLOSE CHARGES'), '1', dm2.SysDate.FieldByName('date').AsDateTime) else Result := DoCharges(Sender=nil, -1, False, False, False, lg(TDsFancyButton(Sender).Caption), '', 0, dm2.SysDate.FieldByName('date').AsDateTime); end; function selectReport(Sender: TObject); begin doTheReport(Sender, Sender = good1); end; Alternatively: function doTheReport(Sender: TObject); begin if Sender = good1 then Result := DoCharges(true, -1, False, False, False, lg('CLOSE CHARGES'), '1', dm2.SysDate.FieldByName('date').AsDateTime) else Result := DoCharges(Sender=nil, -1, False, False, False, lg(TDsFancyButton(Sender).Caption), '', 0, dm2.SysDate.FieldByName('date').AsDateTime); end; function selectReport(Sender: TObject); begin doTheReport(Sender); end;
  8. Good story, thanks for sharing, Kind of impressive that it took just 4 people (2 devs) to do all that, and probably to the users it was just some new boxes and buttons, nothing so different than they were used to. Not so bad for a system that probably was +20 years old. These Delphi tales always astonishes me. Everybody knows one or a couple of cases like this. Obviously, if the company had kept a little system maintenance about let's say each 5 years, the system wouldn't have so many problems. But almost nobody does that. For sure, it paid itself hundred of times. Anyway, Better late than never. Congratulations.
  9. Hi @Stuart Clennett, it's a bug! 🙂 Thanks for spotting it. The TMARSFireDAC.InjectMacroValues and TMARSFireDAC.InjectParamValues implementations assume every TFDAdaptedDataSet actually has a Command (not nil). TFDMemTable do not have Command assigned. Workaround: if you do not need your memory table to be included as the result of Retrieve method, you can decorate it with the RESTExclude attribute: [RESTExclude] FDMemTable1: TFDMemTable; However, I just fixed this in the "develop" branch of MARS repository: https://github.com/andrea-magni/MARS/commit/b6299926671b00e75981c47a74375d9c51c529ca Another workaround would be to change your copy of TMARSFDDataModuleResource.Retrieve and change this line: if LDataSet is TFDAdaptedDataSet then to this: if (LDataSet is TFDAdaptedDataSet) and Assigned(TFDAdaptedDataSet(LDataset).Command) then The MARS.Data.FireDAC.DataModule has nothing special, it is provided as an example of use, you can copy it, change it... it is obviously the counter-part of a TMARSFDResource but there no direct deal with the specific class, just matter of the shape of its methods (types returned, GET/POST selection, ...). Thanks, Andrea
Ă—