Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 12/30/22 in Posts

  1. david berneda

    Beep for Firemonkey

    Needed a "Beep" equivalent function for Android, capable of playing a sound at a specific hertz frequency, and ended up porting and adapting a Java snippet. Its freely available, hope it might help: https://github.com/davidberneda/FMX_Tone_Beep regards ! david
  2. programmerdelphi2k

    Beep for Firemonkey

    hi @david berneda my contribution for your project, if it's possible! Keyboard colored to find your Musical Notes ( no "IF" anymore ) Play with mouse click Play with mouse moviment... (Ctrl + Mouse moving) Play your song notes (type your notes and play it) FMX_Piano_Keyboard_with_code_by_David_Berneda.zip
  3. dummzeuch

    AE BDSLauncher

    I might have missed it in your post, but for me the most important functionality for such a program would be to detect the correct Delphi version for a given project based on the contents of the dproj file. Of course that only matters if more than one Delphi version is available, and I'm probably an extreme in having all versions from Delphi 6 to 11 (with the exception of Delphi 8 ) installed on the same computer.
  4. esegece

    ChatGPT Example

    Hello, The API is very simple, you can use Indy to send the POST request and then parse the JSON response. Find below an example: function AskChatGPT(const aAPI, aQuestion: string): string; var oHTTP: TIdHTTP; oSSL: TIdSSLIOHandlerSocketOpenSSL; oStream: TStringStream; vPostData: string; oJSON: TJSONValue; oArray: TJSonArray; begin oHTTP := TIdHTTP.Create(nil); oSSL := TIdSSLIOHandlerSocketOpenSSL.Create(nil); Try oSSL.SSLOptions.Method := sslvTLSv1_2; oHTTP.IOHandler := oSSL; oHTTP.Request.CustomHeaders.Add('Authorization: Bearer ' + aAPI); oHTTP.Request.ContentType := 'application/json'; vPostData := Format('{"model": "text-davinci-003","prompt": "%s","max_tokens": 2048,"temperature": 0}', [aQuestion]); // send request oStream := TStringStream.Create(vPostData); Try result := oHTTP.Post('https://api.openai.com/v1/completions', oStream); // parse response oJSON := TJSonObject.ParseJSONValue(result).GetValue<TJSONValue> ('choices'); result := TJSonArray(oJSON).Items[0].GetValue<TJSONString>('text').Value; Finally oStream.Free; End; Finally oSSL.Free; oHTTP.Free; End; end; The function has 2 arguments, the API key (can be obtained from https://beta.openai.com/account/api-keys) and the message you want to sent to ChatGPT. The function just sends the API Key as a Bearer Token and POST the JSON message to the server. The server returns a JSON object that must be parsed to obtain the response text. I've attached the complete project with the required openSSL libraries. Kind Regards, Sergio chatgpt_esegece.zip
  5. Dave Nottage

    ChatGPT Example

    Why did you choose not to include those in your post? Do the quotes here really need to be escaped? Is that URL documented somewhere? I'm unable to find it
  6. Tom Chamberlain

    VM and Legacy apps

    I have been using VirtualBox for almost 10 years, always a clean install of Windows with a single version of Delphi per VM. I use a shared folder with the host for all the source, only the host talks with the repos. Delphi versions like 10 to 11 are always a new VM (enterprise lic for Windows) with a new repo chain for testing builds on a new version, just in case. I do make monthly backups of the VM images and use the CloneVDI tool to compact the image/drive to save space on the host. And I never use the VM's to access the internet outside of Windows updates and trusted 3rd party update tools that require access from the installed VM. Make sure you do not let your anti-virus scan the holder were the VM images live. This makes laptop replacement easy and with a couple of hand tweaks to the vbox file they can run (not at the same time) on my Linux machine if needed. I run multiple VM's all day long; dev and SQL VM with services to simulate the user environment.
  7. Fr0sT.Brutal

    VM and Legacy apps

    VirtualBox is my choice
  8. David Schwartz

    VM and Legacy apps

    I do all of my Delphi development inside of VirtualBox on a Mac. I used Parallels for a while, but they switched to a semi-subscription model where they forced you to buy an upgrade every time your OS changed, which was usually every year. I switched to VMWare Fusion, which had much longer paid refresh cycles. I like it, but went to work at a place where they used Oracle's VirtualBox, which was free and open-source, and have been using that now for several years. It gets updated regularly and handles everything I need. The only thing to really watch out for isn't the VM per se, but the Windows registration mechanism that can be annoying if you want to make several copies of a VM to host different versions of Delphi (or whatever) for historical needs. After not using one of these VMs for a while, MS will require you to re-register the OS or it will get very annoying. This is especially problematic if you upgrade a VM b/c the Windows installation will think you just replaced the hardware and want you to re-register it. So don't upgrade / update your historical VMs that are just there for backups.
×