Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation since 02/06/25 in all areas

  1. This year, on February 14th, Delphi celebrates its 30th birthday. Over the past three decades, Delphi has proven to be a robust and versatile development environment, empowering developers to build high-performance applications with ease across multiple platforms: Windows, Linux, Android, iOS, and macOS. As we commemorate this milestone, I am also introducing a new book to help guide you into Delphi's fourth decade: Delphi Quality-Driven Development - A practical guide to testing and writing testable code. Useful to lone developers and vast teams alike, this book aims to demonstrate a variety of essential practices and techniques for making high-quality, testable code. There is a 25% sale going on until the end of February for the Delphi Quality-Driven Development ebook, and there you can also get an additional discount on other books if you add them to your order. https://dalija.prasnikar.info/delphiqdd/index.html To all my fellow Delphi developers: May your code compile quickly, your memory be manageable, and your code testable.
  2. Joshua Gardner

    pasfmt out now!

    We're excited to share the first public release of pasfmt, a free and open-source code formatter for Delphi. It is a complete and opinionated formatting tool. The latest release has support for: Complete line wrapping (and unwrapping) for all Delphi structures Configurable line length limit Removing trailing whitespace Change spacing around all tokens (e.g., operators and keywords) Parallel file formatting with directory traversal Removing repeated empty newlines Line ending normalisation To get started, either try our web demo, or download the executable (this one for Windows) and follow the getting started guide. Additionally, there is an IDE plugin with support for: In-editor formatting Format-on-save Cursor tracking You may be wondering how this tool compares to the existing formatters (e.g., GExperts, JEDI, Formatter.exe). This tool goes a lot further than the alternatives by having a complete opinion on how every line should be wrapped or unwrapped; the original layout is (almost) ignored. By ignoring most of the input format, it produces consistently styled code across a whole codebase. We hope that you enjoy pasfmt, let us know what you think!
  3. pyscripter

    SynEdit now has annotated Scrollbars.

    A new powerful highlighter called Omni (for omnipotent) has been added to SynEdit. Importantly, this highlighter allows the saving/loading of highlighter settings to/from ini files. The project now includes 189 new ini-based highlighters in addition to the 75 ones that were already included. Sample using the PowerShell ini-based highlighter. Notice that code-folding is automatically supported. Structure highlighting is also supported: A component editor has also been added that can be used at both design and run-time. See this discussion for details. This is based on a significant code contribution by Jan Fiala, the author of PSPad. Kudos to Jan!
  4. Stefan Glienke

    Looking but not finding...

    That comment didn't age well I guess
  5. Angus Robertson

    ICS V9.4 announced

    ICS V9.4 has been released at: https://wiki.overbyte.eu/wiki/index.php/ICS_Download ICS is a free internet component library for Delphi 7, 2006 to 2010, XE to XE8, 10, 10.1, 10.2, 10.3, 10.4, 11 and 12 and C++ Builder 10.4, 11 and 12. ICS supports VCL and FMX, Win32 and Win64 targets. The distribution zip includes the latest OpenSSL 3.0.16, 3.2.4, 3.3.3 and 3.4.1 for Win32 and Win64. Changes in ICS V9.4 include: 1 - Completed the ICS Application Monitoring system added in V9.3, designed to locally and remotely monitor ICS servers and applications, and to locally restart applications on demand or if they crash. It comprises a small TIcsAppMonCli client monitoring component that is added to ICS applications, usually Windows Servers, but also client applications. This client component communicates with a TIcsAppMonSrv server component, usually running as a Windows Service on the same server so it is able to restart applications, but can also support clients on a LAN. The monitoring server has web and Websocket servers, allowing remote browsers to view the state of all applications being monitored by the server with a continually updated web page. There is also ICS Application Monitor - Remote Manager application that provides remote monitoring of multiple ICS Application Monitor servers using Json web and Websocket requests on a single screen. 2 - The SMTP client component fixes a bug introduced in V9.3 which could corrupt the Content-Transfer-Encoding header line. 3 - In TWSocket, fixed a potential problem using multiple threads where a new connection opened very quickly (ie localhost) and then stalled due to an unexpected connection state. Made DataToString Unicode compatible, only used for diagnostic dump logs. 4 - In the HTTP client, fixed a check for an overflowing buffer when receiving very long headers that could cause failure detecting headers end. Made several URL validation functions public: GetProtocolPort, IsSSLProtocol, IsKnownProtocol and IsKnownProtocolURL. 5 - When creating PKCS12/PFX certificates, change the 3DES cipher to AES256 if the legacy provider is not loaded. 6 - In the TIcsFtpMulti component, skip download of zero length file by creating an empty file, previously this got SSL handshake error. Don't report directories as being downloadable, they are not. If extended passive mode allowed, send EPSV ALL at start so firewalls and NAT routers can handle sessions more efficiently. Added CheckBadUnicode property defaults to false, so that checks for bad Unicode to Ansi conversions with ? are skipped, allowing more complex paths without errors. 7 - The FTP server FEAT request now returns EPRT and EPSV which have been supported for IPv6 for years, but were not advertised for IPv4. 8 - The OverbyteIcsSnippets sample adds two new simple REST snippets to Get/Post Parameters that send them to an ICS server, and the server echoes back those params so you can check what was actually sent. 9 - When loading the OpenSSL DLLs, no longer check they are digitally signed for Windows XP, 2003, Vista and 2008, they don't recognise SHA-256 code signing, never tested since no longer have those old versions available. 10 - The TRestParams method AddItemSO to add a SuperObject now has an Escape parameter defaulting to True, so non-ASCII characters are escaped by default. 11 - The Proxy component TProxyTarget now has a SocketFamily property so target connections can be restricted to TSocketFamily values. Added property SrvTotSess count of server session connections for logging. 12 - In the HTTP Application Web Server, fixed a memory leak with multiple virtual PUT and POST documents. 13 - The OverbyteIcsJoseTst sample 'Sign/Verify Data' tests now support hashes other than SHA-256, selected from the Key and Signing Hash Algorithm drop down list. Also, a private key matching that selection is created automatically, including X25519. 14 - There is a new unit OverbyteIcsWinUtils that contains Windows API functions, built from selected Magenta Systems libraries, with functions needed to build and control Windows Service applications, accessing the Windows registry, Windows firewall, Windows tasks, hardware, and with simple encryption for passwords. Most of these functions are used by the TIcsAppMonSrv server component and IcsAppMon sample, but should have much wider use for Windows Service server applications in particular, like allowing firewall access. It's planned to move most other Windows specific function here for ICS V10. 15 - In the ICMP component, fixed a problem setting property PingMsg to the text to ping. 16 - In the TIcsIpStrmLog component, added method ListenStates which for logprotUdpServer and logprotTcpServer returns a multiline string listing the IP, port, SSL and state of all socket listeners. The CurSockets property now reflects actual TCP Server clients. 17 - In the TIcsMailQueue component, don't keep retrying email that is too short to send with no body or with no sender headers. Added more error handling if the SMTP component fails to build the EML spool file. 18 - In OverbyteIcsUtils, finished the cleanup of old Base64 functions by adding new IcsBase64 functions using TBytes internally to replace old Base64 functions that used AnsiChars, with no overloaded versions for simplicity. Old Base64 versions retained as deprecated for user applications, please update to the IcsBase versions. Added IcsTBytesCompare to compare two TBytes. Added IcsOutputDebugStr for Posix and Windows. Added IcsDateToAStr and IcsDateTimeToAStr with alpha month (Jan/Feb). 19 - The ICS C++ packages for C++ 10.4 and later have been updated with the correct paths for the three supported platforms, and all build and install correctly for Win32. Win64 should also build, but not Win64x Modern which needs fixes in a future release of C++ 12. The release notes for V9.4 are at https://wiki.overbyte.eu/wiki/index.php/ICS_V9.4 All ICS active samples are available as prebuilt executables, to allow ease of testing without needing to install ICS and build them all. There are four separate zip files split into clients, servers, tools and miscellaneous samples which can be downloaded from https://wiki.overbyte.eu/wiki/index.php/ICS_Samples Angus
  6. pyscripter

    New ChatLLM application.

    A new version 1.2.0 of ChatLLM has been released: New Features: Much improved rendering of responses on a par with the Web Chat interfaces of the LLM providers. Syntax highlighting of code (300 languages are now supported thanks to Prism). Support for DeepSeek models Support for reasoning models such as OpenAI's o1-mini and DeeepSeek's deepseek-reasoner. Exposed the temperature LLM parameter. Screenshots: Settings: User interface: Reasoning with deepseek-reasoner: And by the way DeepSeek is so much better than Gemini on Delphi coding.
  7. Stefan Glienke

    Guidance on FreeAndNil for Delphi noob

    The best practice is coding in a way that you don't need it
  8. dummzeuch

    pasfmt out now!

    If only there was a code formatter written in Delphi that is open source!
  9. Vincent Parrett

    Docking Example

    I can highly recommend the LMD Docking Pack - we have been. using it for a long time now and it's been rock solid.
  10. When using VarSameValue(), you can get a conversion failure if the 2 Variants are not holding compatible types. This is even stated in the documentation: So, you should first make sure the 2 Variants have the same type before comparing their values. This is just logical to do anyway, since if you know they have different types then there is no point in wasting resources to compare the values. When I make these small changes to TTestComponent, the "Could not convert variant" error goes away: procedure TTestComponent.SetCheckedValue(const Value: Variant); begin if (VarType(FCheckedValue) <> VarType(Value)) or // <-- ADD THIS! (not VarSameValue(FCheckedValue, Value)) then begin FCheckedValue := Value; CheckedValueChanged(); end; end; function TTestComponent.IsCheckedValueStored: Boolean; begin Result := (VarType(FCheckedValue) <> varBoolean) or // <-- ADD THIS! (not VarSameValue(FCheckedValue, True)); end; Now, that just leaves the problem of the 'CheckedValue.Type' property displaying "Unknown" for string values. That is indeed a bug in the default Variant property editor, which I have now reported to Embarcadero: RSS-2844; TVariantTypeProperty is broken for string values You can easily work around the bug, either directly in your component's property setter: procedure TTestComponent.SetCheckedValue(const Value: Variant); begin if (VarType(FCheckedValue) <> VarType(Value)) or (not VarSameValue(FCheckedValue, Value)) then begin FCheckedValue := Value; if VarType(FCheckedValue) = varString then FCheckedValue := VarToStr(Value); // <-- change the VarType to varUString CheckedValueChanged(); end; end; Or by deriving a custom property editor in your component's design-time package (if you don't have one, make one) to fix the bug directly: uses Variants, DesignIntf, DesignEditors, DesignConst; //... { TMyVariantTypeProperty } // unfortunately, TVariantTypeProperty is hidden in the implementation // of the DesignEditors unit, so we have to copy the entire class just // to change a couple of lines! const VarTypeNames: array[varEmpty..varInt64] of string = ( 'Unassigned', // varEmpty 'Null', // varNull 'Smallint', // varSmallint 'Integer', // varInteger 'Single', // varSingle 'Double', // varDouble 'Currency', // varCurrency 'Date', // varDate 'OleStr', // varOleStr '', // varDispatch '', // varError 'Boolean', // varBoolean '', // varVariant '', // varUnknown '', // [varDecimal] '', // [undefined] 'Shortint', // varShortInt 'Byte', // varByte 'Word', // varWord 'LongWord', // varLongWord 'Int64'); // varInt64 type TMyVariantTypeProperty = class(TNestedProperty) public function AllEqual: Boolean; override; function GetAttributes: TPropertyAttributes; override; function GetName: string; override; function GetValue: string; override; procedure GetValues(Proc: TGetStrProc); override; procedure SetValue(const Value: string); override; end; function TMyVariantTypeProperty.AllEqual: Boolean; var i: Integer; V1, V2: Variant; begin Result := False; if PropCount > 1 then begin V1 := GetVarValue; for i := 1 to PropCount - 1 do begin V2 := GetVarValueAt(i); if VarType(V1) <> VarType(V2) then Exit; end; end; Result := True; end; function TMyVariantTypeProperty.GetAttributes: TPropertyAttributes; begin Result := [paMultiSelect, paValueList, paSortList]; end; function TMyVariantTypeProperty.GetName: string; begin Result := 'Type'; end; function TMyVariantTypeProperty.GetValue: string; begin case VarType(GetVarValue) and varTypeMask of Low(VarTypeNames)..High(VarTypeNames): Result := VarTypeNames[VarType(GetVarValue) and varTypeMask]; varString,varUString: // <-- FIX HERE! Result := SString; else Result := SUnknown; end; end; procedure TMyVariantTypeProperty.GetValues(Proc: TGetStrProc); var i: Integer; begin for i := 0 to High(VarTypeNames) do if VarTypeNames[i] <> '' then Proc(VarTypeNames[i]); Proc(SString); end; procedure TMyVariantTypeProperty.SetValue(const Value: string); function GetSelectedType: Integer; var i: Integer; begin Result := -1; for i := 0 to High(VarTypeNames) do if VarTypeNames[i] = Value then begin Result := i; break; end; if (Result = -1) and (Value = SString) then Result := varUString; // <-- FIX HERE! end; var NewType: Integer; V: Variant; begin NewType := GetSelectedType; case NewType of varEmpty: VarClear(V); varNull: V := NULL; -1: raise EDesignPropertyError.CreateRes(@SUnknownType); else V := GetVarValue; // <-- move here for good measure... try VarCast(V, V, NewType); except { If it cannot cast, clear it and then cast again. } VarClear(V); VarCast(V, V, NewType); end; end; SetVarValue(V); end; { TMyVariantProperty } // fortunately, TVariantProperty is public in the DesignEditors unit, // so we need to override only 1 method in it... type TMyVariantProperty = class(TVariantProperty) procedure GetProperties(Proc: TGetPropProc); override; end; procedure TMyVariantProperty.GetProperties(Proc: TGetPropProc); begin Proc(TMyVariantTypeProperty.Create(Self)); end; procedure Register; begin //... // change the 2nd and 3rd properties if you want to reuse this editor for all Variant properties, eg: // RegisterPropertyEditor(TypeInfo(Variant), nil, '', TMyVariantProperty); RegisterPropertyEditor(TypeInfo(Variant), TTestComponent, 'CheckedValue', TMyVariantProperty); end;
  11. Joshua Gardner

    pasfmt out now!

    It is a fair enough question. In the context of a code formatter, it means that it has a strong opinion on what the code should look like. Predominantly, this manifests in having few or no configuration options and a highly consistent style. Other formatters like prettier, biome, and google-java-format call themselves opinionated.
  12. Glenn Dufke

    pasfmt out now!

    Great idea crumbled by rust. There are other languages which would have been more appropriate to use for the implementation and would make contributions easier. Sad. And to expand on that: When picking an implementation language, besides evaluating what solves the problem at hand, you also have to consider target community and who are going to deal with it down the line - especially for open source projects and that weighs higher than one's favorite language. Rust has a toxic community, an ecosystem mess akin to npm and overall just a poorly designed language with unnecessary complexity driven up by hype. (I know this from first hand experience of having to deal with rust projects before and digging inside the rust compiler) While some have drunk the rust kool-aid, I'd rather have seen Modern Object Pascal used or, if you want to be fancy, Zig. There are good reasons why many prominent projects are abandoning rust.
  13. pyscripter

    pasfmt out now!

    And incidentally, for whoever has not tried it, Delphilint from the same group, really rocks.
  14. dummzeuch

    12.3 or 13/14 as next?

    Have you seen the IDE using a phone booth recently?
  15. GabrielMoraru

    I refactor your old code for free!

    Hi there I started my own Delphi YouTube channel and I want to create more content. Therefore, I came up with this idea. Let me know... O:-)
  16. Oh, OK. Setting Active=False does stop listening for new connections, but it ALSO immediately closes any existing client connections, too. Then it waits for everything to finish cleaning up before it exits back to your code. If you want existing clients to continue their work uninterrupted, then yes. Try something like this: ShuttingDown := True; IdHTTPServer1.StopListening; Timer1.Enabed := True; ... procedure TMyForm.Timer1Timer(Sender: TObject); begin with IdHTTPServer1.Contexts.LockList do try if Count > 0 then Exit; finally IdHTTPServer1.Contexts.UnlockList; end; Timer1.Enabled := False; IdHTTPServer1.Active := False; Application.Terminate; end; ... procedure TMyForm.IdHTTPServer1CommandGet(AContext: TIdContext; ARequestInfo: TIdHTTPRequestInfo; AResponseInfo: TIdHTTPResponseInfo); begin if ShuttingDown then begin AResponseInfo.ResponseNo := 503; AResponse.CustomHeaders.Values['Retry-After'] := '5'; AResponseInfo.CloseConnection := True; Exit; end; // process normally ... if ShuttingDown then AResponseInfo.CloseConnection := True; end;
  17. OpenSSL has released maintenance versions of the four currently supported versions, 3.0.16, 3.2.4, 3.3.3 and 3.4.1. There is one high security fix for 3.2 and later relating to Raw Public Keys (RPKs), but these are disabled by default and not yet used in ICS, and a low level timing side-channel in ECDSA signature computation fix that needs hardware access to exploit. These OpenSSL versions are included with the final ICS V9.4 release. Windows binary zips are available from https://wiki.overbyte.eu/wiki/index.php/ICS_Download or https://www.magsys.co.uk/delphi/magics.asp In addition to the three DLL files, the zips include compiled RES resource files that contain the same DLLs, text files and version information, see the RC file. The RES file may be linked into application EXE files and code then used to extract the DLLs from the resource to a temporary directory to avoid distributing them separately. ICS V9.1 and later optionally support loading the resource file. Beware OpenSSL 3.4 exposed a minor ICS bug creating X509 certificate requests and creating CA signed certificates, which is fixed in V9.4. or a one line change for earlier versions. Also note when building the ICS packages for the first time with 3.4, there may be a dialog 'entry point could not be located', because the new DLLs are only extracted from the resource files when the first application is run, but the packages have built OK. ICS V9.4 defaults to using OpenSSL 3.4.1, provided the new OverbyteIcsDefs.inc files is installed, with an earlier version optional by changing the Defs file. Angus
  18. dummzeuch

    TCachedDatasource

    Just assume it's your IP, the company behind the AI will steal it anyway (actually it probably already has, because you pasted it into the chat).
  19. Is there any way to train an AI model with Remy's brain?
  20. Hi From the contacts I have from time to time following presentations or training courses, it seems that I'm better known for the video game coding part of my hobby than for the other stuff. It's true that I find it more fun (especially to stream on Twitch), but I also have utilities for Delphi developers created to simplify my life that I make available as binaries and source code on my GitHub account. App Stores Screen Captures Generator : to generate all the needed images from your screen captures when you have to publish your softwares on current app stores Copyright Pascal Projects : to add a copyright text in the header of each PAS/DPR files of a folder tree DProj To Windows Setup : to generate the Windows setup from Delphi deployment wizard data. It uses Inno Setup to create the install program and Exe Bulk Signing to sign the exe files. Exe Bulk Signing : a local and network signing program for Windows executables (exe+msix). It has an API you can use to integrate it in your projects like I did with "DProj To Windows Setup". Folder to FMX Image List : to create a FireMonkey TImageList to copy paste in your project or in a data module unit from all images in a folder tree. It fills the multires bitmaps depending on file names. Google Play Developer Banner Generator : to create a picture to use has your Play Store developer banner composed by a random collage of images you add to your project. I use it with icons of my Android apps. HTML Writer : to simply get HTML source code or WYSIWYG HTML content. I use Delphi HTML Components library in this program to have the WYSYWYG HTML editor and a memo for the source code tab item. Pic Mob Generator : my icons generator from basics layers or images, SVG, paths or rectangles. It export JPEG&PNG images, ICO and ICNS files. For the SVG I used RiverSoftAVG SVG Component Library, but next release will use Skia4Delphi. SM Code Generator : I use it in some multi players games, for EXE Bulk Signing API and client projects. The program generates Delphi code you only have to use in your projects to have a client / server solution to exchange formatted messages over IP. The library uses standard TCP sockets from Embarcadero (with no external dependencies). SVG Folder to Delphi Unit : to import SVG files as Pascal strings in your projects. I use it in some games with Skia4Delphi to show icons or sprites. The program generates a unit (compatible with Delphi 12.X and higher) with SVG found in a folder. Some of these programs are available from GetIt. The others will be submitted before the end of the year. The download links are on their GitHub repositories and will be added to their websites (which should be redirected to GitHub in the meantime). If you need changes in these programs or have suggestions, be free to tell here or as issues on their repositories. I'm also looking for ideas of simple tools to develop during live coding streams to show Delphi or web solutions. They are distributed as shareware programs. Contributions and sponsoring are welcome but not obligatory, and there are no program restrictions in the absence of a valid license. All features are available for free.
  21. SSL certificate of this site is expired ...
  22. One nice feature of the Delphi IDE that I keep forgetting are Component Templates. That means you drop and customize one or multiple components on a form and then give them a new name so you can easily create them again on a different form in a different program. https://blog.dummzeuch.de/2018/11/03/creating-component-templates-in-delphi/
  23. HeartWare

    What new features would you like to see in Delphi 13?

    Which is why I suggest a mode that works internally in 96dpi but shows (and allows edit) in the monitor's native DPI. Yes, it will mean that you are restricted to placing components on a 2x2 grid if your monitor is at 200% and the grid will be unsymmetrical if you're at 150%, but since all components will be locked into the same grid, you can still align the positions and sizes.
  24. Anders Melander

    Docking Example

    23929_tdocktabset_sample_application.ZIP Last time I looked, and it's been a while, the docking manager used in the IDE was a different one from the one in the VCL. The behavior of the VCL docking manager is (was?) hardcoded into TControl in a way that made it impossible to fix from the outside. I would say it depends on the users. I was talking about typical non-technical end-users. Obviously highly technical users, such as developers, have no problems using docking.
×