Leaderboard
Popular Content
Showing content with the highest reputation on 08/21/25 in Posts
-
You can also just hit >> This will run no test at all, but populate the window with all available tests.
-
My last excursion to Google Gemini was successful at the end, but kinda bumpy still. I started out by asking Which gave me three possibilities ask the user for the key, use hardware keys or DPAPI. It also explained (quite lengthy) what the pros and cons of each solution are. I was kinda looking for DPAPI anyway so I went for that with That resulted in naming the API calls CryptProtectData and CryptUnptotectData stating they should be declared in Winapi.CryptDPAPI.pas or more general in Winapi.Windows.pas. The main advantage being the lack of a password entirely, everything being managed by Windows itself. It then presented me with some example code unit MyDPAPIUnit; interface uses Winapi.Windows, Winapi.CryptDPAPI, System.SysUtils; function ProtectData(const AData: TBytes; const ADescription: string = ''; AForLocalMachine: Boolean = False): TBytes; function UnprotectData(const AData: TBytes; var ADescription: string; AForLocalMachine: Boolean = False): TBytes; implementation function ProtectData(const AData: TBytes; const ADescription: string = ''; AForLocalMachine: Boolean = False): TBytes; and so forth. Of course a first compile with me integrating this into a test project failed, because there is no Winapi.CryptDPAPI. I am a nice person, am I not? Well of course Gemini then said I was totally right, and that indeed everything required could be found in WinAPI.Windows. Then rambled on about why it got so confused, and basically blaming Embarcadero for not consistently placing specific API segments in their own units like has happened with WinAPI.Messages or WinAPI.ShellAPI. It then presented me with a corrected unit ready to be integrated into my project...or so it thought. In its implementation of ProtectData and UnprotectData it used a constant for a specific flag, and that did not go over well with the compiler: Here is what it said then 😄 It then fixed the unit by defining the needed constant correctly. But alas, more errors incoming. I'm still trying to be nice and perhaps lead the machine to realize its own mistakes 🙂 Yeah, it did not react to that slight hint but gave me a crash course on DPAPI. Only after I wrote basically rubbing its nose in the mess, it finally noticed and responded accordingly OK, I thought, that looks good. But it took a bad turn quickly yet again, because it continued with the following and provided me with a "revised" version of the unit where the only correction was more comments, and the constant was now called CRYPTPROTECT_LOCAL_MACINE_FLAG. Oh, goody. Now it really should work, but I didn't bother with a test compile, I was still feeling merciful and wrote I'm guessing by now it is trying to get rid of this issue as fast as possible, because the explanations and excuses are getting shorter and lamer Well, d'uh! So finally it comes up with the perfect reason: And follows up with the perfect solution for the home run: Note the proud addition of the checkmark, so this must be official... it even updated the entire unit. Now it must be right.... but wait, how did this get started again? I'm getting pretty good at shattering this machines dreams. I believe it's on to something here This actually sound correct, so I gave the revised unit a go. And it worked as expected. So that was about an hours worth of work, then had a lunch break and came up with some ideas for improvement. So with renewed strength and the feeling of being on the home stretch I wrote It obliged gladly and even provided me with a sample snippet of how to call this glorious code, which it also explained in depth. Actually this could be a nice side effect of AIs, if one takes the time to really read all that jibber jabber. Buuuuuuuut, again, the unit would not compile because how the AI thought TFileStreams needed to be handled. (I'm already out of patience...this short into the second half, oh my) It then went on and on and finally concluded that this wasn't even necessary because of how TFileStream.WriteBuffer takes care of that automatically. So that was needed to be done was to remove these erroneous calls to inexistent methods...Done, the newly improved unit was presented with a nice remark at the end Yeah, we'll see about that, I have more nuisance to test you with Prompt answer You see that too? Now it's just buttering me up! I sense troubles ahead. To my surprise, the new version worked right away. So I got bold Just that one method...but Grrr...at this point I was happy with the one change for the Protect method, and ignored the Unprotect. Copying only parts of the code now. It worked. Again I was provided with samples for calling and quite extensive explanations on the whys and hows. A neat learning experience I completed by asking some questions concerning this technique and security aspects (i.e. could one know how this file was encrypted?)) and possible issues when running this in a Citrix environment. I feel the answers given where quite good and sounded altogether correct. All in all this has been a pretty cool experiment with the free version of Google Gemini 2.5 Flash. I know there is a Pro version, but I'm not yet ready to spend money on that. Please note I did the session in German, so some translation errors might have slipped in either on my side or the AIs. The entire session can be viewed here: https://g.co/gemini/share/a6d5936220bf
-
How to organize networkcomponent
Angus Robertson replied to Berocoder's topic in Network, Cloud and Web
I would do option 3, fork and translate for the non-Chinese market, and hope the developer realizes it's to his benefit to update both Chinese and English repositories. Angus -
For me, I use AI with Delphi sparingly. But in two cases, it's helped quite a bit: 1) recalling seldom-used functions when I can't remember the right keyword but can describe the problem; and 2) writing unit tests. For web stuff, yes, it's great! The overall consensus, though is that it's not replacing our jobs any time soon: Measuring the Impact of Early-2025 AI on Experienced Open-Source Developer Productivity
-
Define conditional symbol in .dpr
DelphiUdIT replied to Vandrovnik's topic in RTL and Delphi Object Pascal
No, not in performance. The advantage is that you don't have to delete the traditional WIN64\Release directory for each individual project. When you erase the disk (1 second), you delete all the temporary directories for all your running projects. And, I have SSD, don't use the disk .... -
compiler C++ compile times: Clang (bcc32c) vs. Borland (bcc32)
David P replied to Michaell's topic in General Help
Michaell, are you using a pre-compiled header? -
suggestion for 2 new su forum: AI usage and AI coding
Javier Tarí posted a topic in Community Management
IMHO, I believe we should have: * One new subforum about using AI from Delphi (not to help with Delphi coding, but for using AI from our Delphi programs * One new subforum on AI agentic coding in/for Delphi: AIs and agentics frameworks (Claude Code, Codex, Cursor...) and it's use as help with Delphi coding -
suggestion for 2 new su forum: AI usage and AI coding
Javier Tarí replied to Javier Tarí's topic in Community Management
Ok, I'll do that But my personal opinion is: that's a mistake; those topics are already capital, although Delphiers are still sleepy about them -
[Info & Feedback] DelphiGenAI v1.1.0 — Sharing Updates and an Educational Approach
Maxidonkey replied to Maxidonkey's topic in I made this
I have just updated the DelphiGenAI wrapper to support the OpenAI APIs. Below is the list of changes made compared to version 1.1.0. These enhancements are designed to fully leverage the capabilities of the GPT-5 model while ensuring optimal compatibility with previous models. You can find the complete repository here: https://github.com/MaxiDonkey/DelphiGenAI Version 1.2.0 JSON Normalization Before Deserialization New GenAI.API.Normalizer module (TJSONNormalizer, TWrapKind, TNormalizationRule) to unify polymorphic fields (e.g., string vs. object). Direct integration into the HTTP layer: new Get(..., Path) | Post(..., Path) overloads enabling targeted normalization of a JSON subtree before object mapping. Canceling Background Requests New Responses.AsyncAwaitCancel(response_id) method to cancel an asynchronous response (background = true), with full callback support (OnStart, OnSuccess, OnError). Streaming Enhancements Extended typed coverage for streaming events and outputs (MCP, Code Interpreter, Image Generation, etc.) via new Responses.OutputParams classes (TResponseOutput*, TResponseImageGenerationTool, TResponseCodeInterpreter, etc.). New Types and Parameters InputParams: full coverage for computer interactions, local shell, MCP, web search, code, image generation, reasoning, text/JSON formats, tool choice/hosted tool, and file search filters. OutputParams: states (Created, InProgress, etc.), events (Added, Delta), usage metrics, and statistics. New enums: TOutputIncluding, TReasoningGenerateSummary, TFidelityType, etc. API v1/chat/completions New parameters: prompt_cache_key (prompt caching) safety_identifier (stable ID for safety monitoring) verbosity (low / medium / high) API v1/responses New parameters: max_tool_calls prompt (template reference via TPromptParams) prompt_cache_key, safety_identifier stream_options, top_logprobs, verbosity Structured System and Developer Messages New overloads: TMessagePayload.Developer(const Content: TArray; const Name: string = '') TMessagePayload.System(const Content: TArray; const Name: string = '') Improves parity between plain text and structured content flows. -
Define conditional symbol in .dpr
dummzeuch replied to Vandrovnik's topic in RTL and Delphi Object Pascal
You cannot define a symbol in the .dpr file to be available in the units (it will be available in the .dpr file itself though). You must put it into the .dproj file (Project -> Options). Alternatively you can define it in an include file and include that file in all units that require the symbol. That latter approach is used by most libraries because a library cannot add anything to the project options. -
TGridify, convert a flat table into a pivot-grid in one line of code
Lajos Juhász replied to david berneda's topic in Delphi Third-Party
This is off topic. The rumor says she got divorced and kept the house, yacht and the private jet.- 3 replies
-
- pivot-table
- datamining
-
(and 2 more)
Tagged with: