Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 07/26/24 in all areas

  1. corneliusdavid

    Devin AI - Is it already happening?

    I don't understand why this would be a concern. Certainly, any AI built in would just be an interface to utilize your own AI account somewhere, right? Nothing would get automatically uploaded unless you hook it up and start using it. Just like Delphi has integration for git but you don't have to use git inside the IDE unless you tell it to and give it your account information. Am I missing something?
  2. corneliusdavid

    What is the best AI at Delphi

    It was interesting seeing this list and the responses as I've only used the free ChatGPT about a half dozen times--I haven't considered getting into it seriously. But I decided I should look through these tools listed here (didn't know there were so many geared for programming!) and get up to speed since AI is here and being used and talked about everywhere these days--I'm starting to see how this could be quite a time-saver for many things. Today, I was struggling with some untyped string parameters being passed into a function and it was failing to get the values properly after converting this old code from Delphi 5 to Delphi 12. I knew I had to add support for UnicodeCode types but I was struggling with how to get the value from the embedded pointer. I asked ChatGPT and it gave a pretty good answer--and it was correct but it only listed the new Unicode and WideString types. I wanted to be able to support ShortString as well. So, I posed the exact same question to Claude and it gave a nearly identical answer BUT included support for ShortString as well, noting the slightly different syntax (you have to dereference it while you don't with the new modern string types). I asked Claude about the difference and it gave a good answer about the history of string types and why ShortString has to be handled differently. I'm very impressed and am about ready to sign up for Claude! (I like what I'm reading about it's "project" feature as well.) Thanks all for your comments!
  3. Remy Lebeau

    Avoid parameter evaluation

    Not quite. You have implemented DoProcess() incorrectly, causing undefined behavior. The code compiles, but it will not behave correctly at runtime for certain types. For instance, try passing a single Char into it and your code will crash. That approach is wrong. You cannot treat all of those types the same way, as they are stored in different ways in the array. vtChar and ctWideChar are stored as individual values in the array itself (like integers are), whereas vtString is a pointer to a ShortString variable, whereas vtAnsiString and vtUnicodeString are copies of the data block pointer from inside of an AnsiString/UnicodeString instance, etc. You need to handle the various types individually and correctly, eg: procedure DoProcess(const Args: array of const); var i: Integer; begin for i := Low(Args) to High(Args) do begin case Args[i].VType of vtString: Writeln(Args[i].VString^); vtChar: Writeln(Args[i].VChar); vtPChar: Writeln(Args[i].VPChar); vtWideChar: Writeln(Args[i].VWideChar); vtPWideChar: Writeln(Args[i].VPWideChar); vtAnsiString: Writeln(AnsiString(Args[i].VAnsiString)); vtWideString: Writeln(WideString(Args[i].VWideString)); vtUnicodeString: Writeln(UnicodeString(Args[i].VUnicodeString)); vtInteger: Writeln(Args[i].VInteger); vtInt64: Writeln(Int64(Args[i].VInt64)); else Writeln('Type handling not implemented yet ' + IntToStr(Args[i].VType)); end; end; end; Also, see the MakeStr() example in this earlier post:
  4. Joseph MItzen

    Devin AI - Is it already happening?

    It all depends on the implementation. I believe JetBrains is offering their own LLM service in their IDEs now, but they've also added a completely local LLM that can perform whole-line auto completion. If hypothetically Embarcadero was offering their own LLM service, it could be turned on by default and people might not be happy about that. But I agree, as an excuse it seems a bit flimsy. I'm not sure why waiting longer would somehow lead to anything being more secure by design.
  5. CoeurdeLeon

    What is the best AI at Delphi

    I have been using AI since it came out more than a year ago. In the beginning Delphi requests for code almost always had errors and fictitious information. Things have gotten better but I still find a lot of errors. The AI tools I am using currently are: Amazon Q Developer Blackbox AI ChatGPT Claude 3 Sonnet Google Gemini mistral.ai Paid-GitHub Copilot Paid-Replit AI Paid-Tabnine Of all of these as of 5/16/24 I find Claude the best but still frequently lacking. Please add your AI favorites and comment on their delphi coding skills. Dick Maley
  6. Remy Lebeau

    Avoid parameter evaluation

    Since performance is in question, I would suggest taking this approach a step further and use 'array of const' instead of 'array of string'. That way, you can pass in integers and other fundamental types as-is and not invoke the overhead of converting them to strings unless you are sure you actually need to, eg: procedure Log(LogLevel: TLogLevel; const Args: array of const); overload; begin if CanLog(LogLevel) then begin // convert Args to a log message and write it out as needed... end; end; Log(llTrace, ['Test', GetLastError(), ...]);
  7. FreeDelphiPascal

    Devin AI - Is it already happening?

    I assure you, Copilot is doing a lot more than that !!!!!!
  8. TomF

    Getit Fails to Install Fast Reports D12.1

    I'm not quite sure - but I think I had a similar issue and solved it by installing Tee-Chart in Delphi. This installation of Tee-Chart can be activated during Delphi installation or later somewhere in the Delphi Tools/Features-menu.
×