Jump to content

CoeurdeLeon

Members
  • Content Count

    33
  • Joined

  • Last visited

Everything posted by CoeurdeLeon

  1. CoeurdeLeon

    Updated XMLMapper

    A month ago Miguel Angel Moreno presented a video on new features in XMLMapper. Is the new version included in Delphi 11.3? Dick Maley
  2. CoeurdeLeon

    TEdgeBrowser how to clear the cache

    Can anyone tell me how to clear the TEdgeBrowser cache? I set EdgeBrowser.UserDataFolder :='C:\Temp\CPRSBrowserCache\'; The folder is created and never used, i.e., always empty. Cached data is being displayed rather than new data. If I open up the Edge browser and clear the cache then correct data is displayed in my TEdgeBrowser instance. Why is EdgeBrowser.UserDataFolder not being populated? How can I empty the cache? Dick Maley
  3. CoeurdeLeon

    How to create new FireDac components

    The US Veterans Affairs Medical Health Record system uses a database called Vista which is a FileMan/Mumps/M based DBMS. It is old. It is very fast. It is huge!!! Many arrogant vendors have tried to move this data to a MODERN DBMS system. Most have failed. The Medical Health Record System at VA is written in Delphi. It is called "CPRSChart". It is used my millions of users daily. The connections between the Delphi front end and the Vista backend are very complicated and arcane. Is there an open source framework for developing new FireDac connectors? I have not found any. I would like to develop a FileMan FireDac connector so that CPRSChart could communicate directly with the Vista database. How would you recommend that I proceed. Thank you. Dick Maley
  4. CoeurdeLeon

    Upgrading EurekaLog for Delphi 12

    I purchased "EurekaLog_7.11.0.1_Enterprise_for_RAD_Studio" with source code on January 21, 2021. The subscription ran out a year later. Since I purchased source code I decided to upgade EurekaLog so it would work with Rad Studio 12 Athens. To do this: I copied the Studio28 folder in the projects directory to Studio29. In the *.dpk and *.dproj files I replaced 28 with 29. In the "\Neos Eureka S.r.l\EurekaLog 7\Source\Common" directory I modified "ElDefines.inc" to add Delphi 12. With these changes "EurekaLogGroup.groupproj" successfully compiles and in the packages directory a new folder appears "Studio29". This folder is filled with the 290 bpl files and other files. When I try to install the packages I get the following message: "Can't load package E:\Installs\Studio29\EurekaLogExpert290.bpl. The specified module could not be found." The bpl's are there. What is the problem? Richard Maley
  5. CoeurdeLeon

    Upgrading EurekaLog for Delphi 12

    Good idea, but I do have it on the Library Path.
  6. CoeurdeLeon

    Change Install Location

    I am currently installing Rad Studio 11. I do not want to install it on the c drive. I could not find any way to change the location. I installed using the *.iso file. Is there a way to change the location? Dick Maley
  7. CoeurdeLeon

    Change Install Location

    Thank you I missed the Options button. Dick Maley
  8. Edwin This is very god. Thank you. Dick Maley
  9. CoeurdeLeon

    Code formatting in Delphi 12

    Delphi 11 stores the Formatter configuration files in C:\Users\?\AppData\Roaming\Embarcadero\BDS\22.0. I copied my Delph 11 formatter.config file to C:\Users\?\AppData\Roaming\Embarcadero\BDS\23.0. It worked.
  10. CoeurdeLeon

    Code formatting in Delphi 12

    My installation of Rad Studio 12 does have "Formatter.exe" in the bin directory. I added this to the tools menu and ran it against some Rad Studio 12 code. It worked fine, I am confident that the new long strings feature would not format correctly, but I am not sure. Can anyone tell me where the formatting configuration is stored in Rad Studio 11 so I can migrate it to Rad Studio 12? Thank you.
  11. CoeurdeLeon

    TGifImage TransparentColor

    How do I set the TransparentColor for a TGifImage? Thank you. Dick Maley
  12. CoeurdeLeon

    TGifImage TransparentColor

    Anders Thank you for your answer and for your many years of supporting the Delphi community. I was not aware of your blog. It is a treasure of information related to TGifImage. I have added it to my list of standard reference sources. Thank you. Dick Maley
  13. I am very interested. Email me at dickmaley@advdelphisys.com.
  14. CoeurdeLeon

    ChatGPT Example

    Does anyone have a working example where a connection is made with chatgpt, a question is asked and a response successfully returned. I have tried with both indy and ipworks components. I get a variety of errors. Here are 2 IPworks functions: Unit ads.ChatGpt; Interface Function ChatWithGPT(Const question, Api_Key: String): String; Function ChatWithGPT2(Const question, Api_Key: String): String; Implementation Uses ipwcore, ipwhttp, ipwrest, ipwtypes, System.SysUtils; Function ChatWithGPT(Const question, Api_Key: String): String; Var http : TIpwHttp; response: String; Begin http := TIpwHttp.Create(Nil); Try http.AddCookie('Authorization', 'Bearer ' + Api_Key); http.Get('https://api.openai.com/v1/chatgpt/chat?question=' + question); response := http.TransferredData; Result := response; Finally http.Free; End; End; Function ChatWithGPT2(Const question, Api_Key: String): String; Var rest : TipwREST; response: String; Begin rest := TipwREST.Create(Nil); Try rest.ContentType := 'application/json'; rest.OtherHeaders := 'Authorization: Bearer ' + Api_Key; rest.PostData := '{\"model\": \"text-davinci-003\", \"prompt\": \"" + question + "\", \"temperature\": 0, \"max_tokens\": 64}'; rest.Post('https://api.openai.com/v1/completions'); rest.XPath := '/json/choices/[1]/text'; response := rest.XText.Replace('\"', ''); Result := response; Finally FreeAndNil(rest); End; End; End. Richard Maley
  15. CoeurdeLeon

    Delphi job

    The job description can be found here. https://ncr.wd1.myworkdayjobs.com/en-US/ext_us/details/Software-Engineer-III_R0127327-3?q=delphi I applied about a month ago and have heard nothing. I would welcome a coding test. Where have all the Delphi jobs gone? Dick Maley
  16. CoeurdeLeon

    Anyone know why?

    The position in Frederick, Maryland is about 20 miles from my house. For the last 4 years this company has been advertising remote Delphi Developer positions working for the Legal & General America Headquarters located at 3275 Bennett Creek Ave in Frederick, MD 21704, United States. Many days I would receive 6 calls a day from different headhunters looking to fill this position. Frequently the connection is very bad (voip) and the indian accent is very difficult to understand. I have interviewed with one of the vendors trying to fill the position, Diverse Lynx. Eventually, I cut off all communications with this company because they appeared to be human traffickers and completely untrustworthy. I am a grey beard as was mentioned in one of the earlier posts. I could do the job with very little effort. Something is very fishy about this position in Frederick, MD. They are looking to fill the position for $50/hour. Dick Maley
  17. CoeurdeLeon

    Updated XMLMapper

    I fear the error is mine. The Beta package is 28.0.47741.2595 Launching XMLMapper from the tools menu and examining its about window I get The versions match. I was expecting to see the new filters on the left side. These are displayed when the schema view is selected. Miquel and Lars, thank you for your help. Dick Maley
  18. CoeurdeLeon

    Updated XMLMapper

    Miguel I have done just as you said And when I launch XMLMapper from the tools menu I get Is the new XMLMapper found someplace else? Dick Maley
  19. CoeurdeLeon

    Updated XMLMapper

    I have just finished upgrading to 11.3 and the first item I have installed is the new XMLMapper. I CANNOT FIND IT. All I can find is the old one. Where is it? Miguel, I really liked your recent webinar and look forward to your continued progress on this project. Dick Maley
  20. CoeurdeLeon

    Updated XMLMapper

    Will do
  21. CoeurdeLeon

    Updated XMLMapper

    Thank you Lars
  22. CoeurdeLeon

    SVG buttons in VCL or FMX

    Is there a simple way to use *.svg images in buttons in Delphi vcl or fmx applications? Thank you. Dick Maley
  23. CoeurdeLeon

    ChatGPT Example

    Thank you for all the responses. I would like to specially thank esegese (Sergio Gomez Cortijo). I was hoping to demonstrate a number of methods of connecting to chatGPT. However I have now modified that objective to connecting with GPT3. Listed below is a unit that either uses Indy or IPworks to query GPT3. The 3 functions work well for me and I hope they work for you. I had also wanted to have some functions that use the http get method, but none worked for me. Unit ads.Gpt3; Interface Function GPT3_IndyPostWithSSL(Const question, Api_Key: String): String; //Indy Post with SSL Function GPT3_IPWorks_PostWithRest(Const question, Api_Key: String): String; Function GPT3_IPWorksWithPost(Const question, Api_Key: String): String; Implementation Uses IdHttp, IdSSLOpenSSL, ipwcore, ipwhttp, ipwrest, ipwtypes, ipwxml, System.Classes, System.JSON, System.NetEncoding, System.SysUtils, Vcl.Dialogs, Vcl.Forms; Function GPT3_IndyPostWithSSL(Const question, Api_Key: String): String; //Indy Post with SSL Var http : TIdHTTP; JSON : TJSONValue; JSonArray: TJSonArray; PostData : String; SSL : TIdSSLIOHandlerSocketOpenSSL; Stream : TStringStream; Begin http := TIdHTTP.Create(Nil); SSL := TIdSSLIOHandlerSocketOpenSSL.Create(Nil); Try SSL.SSLOptions.Method := sslvTLSv1_2; http.IOHandler := SSL; http.Request.CustomHeaders.Add('Authorization: Bearer ' + Api_Key); http.Request.ContentType := 'application/json'; PostData := Format('{"model": "text-davinci-003","prompt": "%s","max_tokens": 2048,"temperature": 0}', [question]); Stream := TStringStream.Create(PostData); Try Result := http.Post('https://api.openai.com/v1/completions', Stream); JSON := TJSonObject.ParseJSONValue(Result).GetValue<TJSONValue>('choices'); Result := TJSonArray(JSON).Items[0].GetValue<TJSONString>('text').Value; Finally Stream.Free; End; Finally SSL.Free; http.Free; End; End; Function GPT3_IPWorks_PostWithRest(Const question, Api_Key: String): String; Var ipwrest: TipwREST; Begin ipwrest := TipwREST.Create(Nil); Try ipwrest.ContentType := 'application/json'; ipwrest.OtherHeaders := 'Authorization: Bearer ' + Api_Key; ipwrest.PostData := Format('{"model": "text-davinci-003","prompt": "%s","max_tokens": 2048,"temperature": 0}', [question]); Try ipwrest.Post('https://api.openai.com/v1/completions'); ipwrest.XPath := '/json/choices/[1]/text'; Result := ipwrest.XText; If Pos('"', Result) = 1 Then Result := Copy(Result, 2, Length(Result) - 1 + 1); If Copy(Result, Length(Result), 1) = '"' Then Result := Copy(Result, 1, Length(Result) - 1); If Copy(Result, 1, 4) = '\n\n' Then Result := Copy(Result, 5, Length(Result) - 5); Result := Trim(Result); Except On E: Exception Do ShowMessage(E.ClassName + ': ' + E.Message); End; Finally FreeAndNil(ipwrest); End; End; Function GPT3_IPWorksWithPost(Const question, Api_Key: String): String; Var http : TIpwHttp; response : String; JSON : TJSONValue; JSonArray: TJSonArray; Begin http := TIpwHttp.Create(Nil); Try Try http.ContentType := 'application/json'; http.OtherHeaders := 'Authorization: Bearer ' + Api_Key; http.PostData := Format('{"model": "text-davinci-003","prompt": "%s","max_tokens": 2048,"temperature": 0}', [question]); http.Post('https://api.openai.com/v1/completions'); response := http.TransferredData; JSON := TJSonObject.ParseJSONValue(response).GetValue<TJSONValue>('choices'); Result := TJSonArray(JSON).Items[0].GetValue<TJSONString>('text').Value; Except On E: Exception Do Result := 'Error: ' + E.Message; End; Finally FreeAndNil(http); End; End; End. Richard Maley
  24. CoeurdeLeon

    ChatGPT Example

    Esegece WOW!!! WOW!!! WOW!!! VERY GOOD!!! IT WORKS VERY WELL. Thank you. Richard Maley
×