Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 06/27/24 in Posts

  1. Ali Dehban

    OpenAPIClientWizard

    Hey everyone, this plug-in is currently in beta version, so there may be some bugs or issues. I've already got some valuable advice from the great @Uwe Raabe but any contributions are welcome too, as I may not have much time to work on it until the end of July. I'll be improving it in time, so please be patient and help me make it better and production-ready. Please open an issue on GitHub with a sample specification file so that I can duplicate the error/bug to fix it. Best regards, Ali.
  2. Ali Dehban

    OpenAPIClientWizard

    A new Delphi plug-in for automatically implementing the client side of a Rest API is now available in beta version. Repository: https://github.com/AliDehbansiahkarbon/OpenAPIClientWizard Demo video: https://www.youtube.com/watch?v=7B7nSHIsV64
  3. ICS used to use self signed SSL/TLS certificates when there was nothing better, but issuing your own CA signed certificates is almost as easy and more friendly. ICS has a sample that does it manually, or the servers do it automatically, there is also a function to install the ICS root CA into the Windows store for clients. Angus
  4. David Heffernan

    DelphiVCL4Python

    For loads of scenarios the interpreter doesn't matter for performance.
  5. Nitpick at 10:30 - strings are always empty when not explicitly initialized like all managed types.
  6. David Schwartz

    OpenAPIClientWizard

    This looks awesome, long awaited option for Delphi. What Delphi versions does this support?
  7. dummzeuch

    What is the best AI at Delphi

    You have listed chatGPT. Which version(s) were you using? My own experience is that neither the free chatGPT nor Gemini are any good for producing Delphi code. I haven't tried any others.
  8. Lars Fosdal

    Best practices for working with a DB accessed via REST API?

    My hard-earned advice Refrain from replicating the database structures in the REST API. Think about the tasks you want to execute, and what data that is needed for these tasks. It doesn't matter how they actually are stored in the database, as it is the REST server's job to sort out what goes where and how. It also enables you to swap out the underlying database without changing the API itself. Use JSON data packages. The good thing about these, is that you can have missing or extra fields in both directions, making the API less fragile. If a value is missing and not critical, simply use a default instead. If an unknown value arrives, just ignore it. This moves the versioning to the API levels, instead of purely on the database. Try https://api.swaggerhub.com for building APIs. Swagger files, now known as OpenAPI definitions, are very useful as there are numerous dev tools that can use them to create both server -and client-side code or configuration. Do not expose primary keys in the APIs - if you need an actual unique key, create a GUID field in the database and use that as the unique id. It is way too easy to do serial breach attempts on queries where the PK is just an integer. Use secure connections - i.e. https. Make sure you use proper authentication. OAuth2 with limited time keys. Remember why it is called RESTful and obey the rules
  9. There are a few choices when it comes to native processing and rendering of Unicode text in Windows applications. Namely, GDI, GDI+, UniScribe and DirectWrite. I have been doing some research in the process of updating/fixing the Unicode handling in SynEdit. It appears that the future lies with DirectWrite. Here are some reasons: WPF is based on DirectWrite Recent Microsoft applications, such as the Windows Terminal, use DirectWrite The Windows App SDK (new name of Project Reunion) is using a new cross-platform version of DirectWrite called DWriteCore, which is mostly compatible with DirectWrite. So presumably, switching to DWriteCore, if needed, would be easy. DirectWrite has many advantages including: Can play with GDI well, so you can mix the two. Supports color fonts Handles Unicode such as emojis reasonably well. Supports bi-directional text (e.g. mixing Arabic with English) Provides GPU acceleration. The downside is that it is fairly complex and there is not much Delphi Code that is using DirectWrite. Also the Delphi header translations have bugs and have not been updated for years (see [RSP-36642] CreateGdiCompatibleTextLayout is declared wrongly in Winapi.D2D1 - Embarcadero Technologies for instance). Further to the discussion in Unicode string - how element iterating? - RTL and Delphi Object Pascal - Delphi-PRAXiS [en] (delphipraxis.net), I have created a little demo which showcases rendering complex Unicode text with DirectWrite and also provides a Grapheme enumerator for Delphi strings also based on DirectWrite. Here is a screenshot. The ListBox shows the graphemes of the text. It is custom painted with DirectWrite. The Emoji consists of 7 unicode codepoints. See also fdwr/TextLayoutSampler: Utility to display text via multiple Windows API's simultaneously (D2D, DWrite, GDI, GDI+). (github.com) The source code of the project is attached. DirectWriteTest.zip
×