Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 05/30/24 in all areas

  1. Anders Melander

    How to debug a Not Responding program element

    That's a classic - with an easy fix. Try Googling it and see if you can't fix it yourself; You'll learn more from that.
  2. Dave Nottage

    Delphi 11, FMX, Android, ListViewItem Wordwrap

    Set the WordWrap property on the TTextObjectAppearance item to True:
  3. pyscripter

    New ChatLLM application.

    I have created a new Delphi application called ChatLLM for chatting with Large Language Models (LLMs). Its primary purpose is to act as a coding assistant. Features: Supports both cloud based LLM models (ChatGPT) and local models using Ollama. Supports both the legacy completions and the chat/completions endpoints. The chat is organized around multiple topics. Can save and restore the chat history and settings. Streamlined user interface. Syntax highlighting of code (python and pascal). High-DPI awareness. The application uses standard HTTP client and JSON components from the Delphi RTL and can be easily integrated in other Delphi applications. You do not need an API key to use Ollama models and usage is free. It provides access to a large number of LLM models such as codegemma from Google and codelllama from Meta. The downside is that it may take a long time to get answers, depending on the question, the size of the model and the power of your CPU and GPU. Chat topics The chat is organized around topics. You can create new topics and move back and forth between the topics using the next/previous buttons on the toolbar. When you save the chat all topics are soved and then restored when you next start the application. Questions within a topic are asked in the context of the previous questions and answers of that topic. Screenshots: Settings using gpt-3.5-turbo, which is cheaper and faster than gpt-4: UI: Further prompting: The code is not actually correct (Serialize returns a string) but it is close. If you want to test ChatLLM you can download the executable.
  4. The gutter is too large in Delphi 12 even when I set the gutter to invisible. DPI: 192. Known issue?
  5. vfbb

    Slow rendering with SKIA on Windows

    @Hans♫ I think that could be a Google Skia limitation or issue, so the right place to report bugs is on https://issues.skia.org/, instead on QP. However, I have already opened a new conversation in the Skia group to obtain more information about this: Poor quality of anti-aliasing on NVidia GPU (google.com)
  6. Attila Kovacs

    Windows PATH length limit?

    That works only if [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem] "LongPathsEnabled"=dword:00000001 is set
  7. Willicious

    How to debug a Not Responding program element

    Last resort as it takes a while to paste in debug strings to every procedure, but if all else fails this is probably what I'll do In fact, calling it now that this is probably what I'll end up having to do
  8. Lajos Juhász

    How to debug a Not Responding program element

    Sometimes a logging can help. Log the start and finish of every action you take when the menu is executed (starting loading this / finished, starting that / finished). The part that does not have the finished event in the log is caused the hang.
  9. Hello Primož I need a (possibly slimmed down) version for Linux (console server apps for web servers). Very short-term. Are there parts that I could use? I am currently using Units: OTLCommon, Otl Parallel, Otlsync, OtlCollections Types: TOmniValue, TOmniBlockingCollection, IOmniBackgroundworker, IOmniWorkitem, IOmniTaskControl, TOmniMessage Would be important No. 1: TOmniValue No. 2.1: parallel tasks for background work No. 2.2: a simple pipeline to be able to perform tasks in a serial one after the other If not, I would probably have to switch completely to Delphi Original Parallel Programming Library. Would be a pity. Kind regards Thomas
  10. The most common way do text-processing in Delphi is to load a file into a TStringList and then process the text line-by-line. Often you need to save the contents of the StringList back to the file. The TStringList is one of the most widely used RTL classes. However there are a number of limitations discussed below: a) No easy way to preserve line breaks on Load/Save TStringList does not make any effort to recognize the type of line breaks (LF, CR or CRLF) in the files it opens, let alone save that for use on saving. b) Information loss without any warning or any option for dealing with that. Internally TStringList uses unicode strings, but when you save its contents to a file using the default encoding (ANSI), this may result in information loss, without getting any warning or having any means for dealing with that. TEncoding.GetBytes also suffers from that. c) No easy way to determine whether a file you loaded into a TStringList contained a BOM When you load a file (LoadFromFile method), the encoding of the file is stored but not the information about whether the file contained a BOM or not. The WriteBOM property is only used when you save a file. d) Last but not least, no easy way of dealing with utf8 encoded files without a BOM The default text file format in Linux systems, in Visual Studio Code and other editors, as well as in languages such as python 3 is utf8 without BOM. Reading such files with TStringList is problematic and can result in errors, because it thinks such files are ANSI encoded. You could change the DefaultEncoding to utf8, but then you get errors when you read ansi files. No effort is made to detect whether a file without a BOM contains utf8 sequences. Overall, it is desirable that, when you load a file using LoadFromFile and then you save it using SavetoFile, the saved copy is identical to the original. I am attaching a general purpose TStringList descendent that deals with all the above issues in case anyone has a use for that. XStringList.pas
×