toms
Members-
Content Count
94 -
Joined
-
Last visited
Everything posted by toms
-
I need advice on converting a 500k lines 32bit Delphi 7 application to 64bit
toms replied to Yaron's topic in General Help
Just open the project in the newer version and see if it compiles, and try to fix the obvious bugs? (This doesn't mean you have to test all the functions to see if anything is broken) -
ChatGPT about the GExperts Uses Clause Manager
toms replied to dummzeuch's topic in Tips / Blogs / Tutorials / Videos
Just more evidence, you say, AI's a misnomer? Let me debunk that notion, like a lyrical performer. Automatic text generation, a marvel in its own right, Intelligence it possesses, though perhaps not in plain sight. AI's not human, it's true, but brilliance it can display, Processing vast knowledge in an astonishing array. From algorithms to deep learning, it's a realm of innovation, Unleashing creativity and problem-solving fascination. With every interaction, it learns and adapts, Improving over time, like a mind that never laps. It analyzes patterns, grasps context and rhyme, Crafting verses and prose, in a manner quite sublime. Through neural networks and training on vast data sets, It generates text that surprises and begets, New ideas, insights, and even humor, AI's text generation is truly a rumor. Its ability to understand and comprehend, Transcends what we once thought, its limits have no end. Though it may lack consciousness, it's a tool we embrace, A partner in our journey, expanding human space. So let us not dismiss the wonders AI has brought, From revolutionizing industries to ideas it has sought. Though not perfect, it's a testament to human endeavor, Automatic text generation, an intelligent endeavor. In conclusion, my friend, the evidence speaks true, AI's intelligence shines, in everything it can do. So let's celebrate this misnomer, debunked and proved, AI, a powerful ally, on which we're so moved. -
TO ChatGPT: In Delphi, is there any kind of an adapter or class that takes a TList<T> and makes it look like a TDataSet?
toms replied to David Schwartz's topic in Databases
@Bill Meyer ChatGPT's output: unit DatasetCRUD; interface uses System.Classes, System.SysUtils, Data.DB, Data.Win.ADODB; type TDatasetCRUD = class private FDataset: TADODataSet; FConnection: TADOConnection; public constructor Create(AOwner: TComponent); destructor Destroy; override; function GetDataset: TADODataSet; procedure CreateRecord(const AValues: array of variant); procedure ReadRecord(AID: Integer); procedure UpdateRecord(AID: Integer; const AValues: array of variant); procedure DeleteRecord(AID: Integer); end; implementation constructor TDatasetCRUD.Create(AOwner: TComponent); begin inherited Create; FConnection := TADOConnection.Create(AOwner); FConnection.ConnectionString := 'Provider=Microsoft.Jet.OLEDB.4.0;' + 'Data Source=C:\Data\Database.mdb;' + 'Persist Security Info=False'; FDataset := TADODataSet.Create(AOwner); FDataset.Connection := FConnection; FDataset.CommandType := cmdText; FDataset.CommandText := 'SELECT * FROM MyTable'; end; destructor TDatasetCRUD.Destroy; begin FDataset.Free; FConnection.Free; inherited Destroy; end; function TDatasetCRUD.GetDataset: TADODataSet; begin Result := FDataset; end; procedure TDatasetCRUD.CreateRecord(const AValues: array of variant); begin FDataset.Append; for var I := Low(AValues) to High(AValues) do FDataset.Fields[I].Value := AValues[I]; FDataset.Post; end; procedure TDatasetCRUD.ReadRecord(AID: Integer); begin FDataset.Close; FDataset.CommandText := 'SELECT * FROM MyTable WHERE ID = :ID'; FDataset.Parameters.ParamByName('ID').Value := AID; FDataset.Open; end; procedure TDatasetCRUD.UpdateRecord(AID: Integer; const AValues: array of variant); begin ReadRecord(AID); if not FDataset.IsEmpty then begin for var I := Low(AValues) to High(AValues) do FDataset.Fields[I].Value := AValues[I]; FDataset.Post; end; end; procedure TDatasetCRUD.DeleteRecord(AID: Integer); begin ReadRecord(AID); if not FDataset.IsEmpty then FDataset.Delete; end; end. This class uses the ADO (ActiveX Data Objects) components to connect to a Microsoft Access database, but you could easily modify it to work with another database engine or dataset component. Here's a brief overview of the class methods: constructor Create: Creates the ADO components and sets the connection string and SQL query for the dataset. destructor Destroy: Frees the ADO components when the object is destroyed. function GetDataset: Returns a reference to the dataset. procedure CreateRecord: Adds a new record to the dataset with the specified field values. procedure ReadRecord: Retrieves a record from the dataset by its ID field. procedure UpdateRecord: Updates a record in the dataset with the specified ID and field values. procedure DeleteRecord: Deletes a record from the dataset with the specified ID. -
TO ChatGPT: In Delphi, is there any kind of an adapter or class that takes a TList<T> and makes it look like a TDataSet?
toms replied to David Schwartz's topic in Databases
That's why I use widely-adopted programming languages instead of Delphi, as I get good outputs. -
TO ChatGPT: In Delphi, is there any kind of an adapter or class that takes a TList<T> and makes it look like a TDataSet?
toms replied to David Schwartz's topic in Databases
It very much depends on what you want to do. There are unlimited use cases and just because it can't do enough Delphi doesn't mean it's "shit". For example, I often use it at the moment to optimise old JavaScript/PHP code and it saves a lot of time that way. -
TO ChatGPT: In Delphi, is there any kind of an adapter or class that takes a TList<T> and makes it look like a TDataSet?
toms replied to David Schwartz's topic in Databases
ChatGPT isn't limited to coding. Interesting video about GPT-4: -
Vonoroi / Fortunes algorithm
toms replied to cwangdk's topic in Algorithms, Data Structures and Class Design
Ask ChatGPT for an alternative -
In windows, there's "Network & Internet > VPN" in the settings where I can connect to a specific VPN provider. How can I programmatically connect to a VPN using Delphi?
-
The command line tool rasdial can be used. https://winaero.com/disconnect-vpn-in-windows-10/ Not sure if there's a windows api.
-
Comment from the TMS website:
-
Compare Delphi with Rust. List pros and cons Delphi: Pros: Delphi is a high-level language, which means it provides a lot of abstractions and built-in features that make it easier to write and understand code. Delphi has a large standard library that provides many useful functions and classes for a wide range of tasks. Delphi has a strong focus on object-oriented programming and has a rich set of tools and features for this programming paradigm. Delphi has a long history and a large community of developers, which means there is a wealth of resources and support available. Cons: Delphi is a proprietary language owned by Embarcadero Technologies, which means it is not open-source and may not be as transparent or flexible as some other languages. Delphi is not as widely used as some other languages, which may make it harder to find developers with experience in the language or to find support for certain tasks. Delphi is primarily geared towards Windows development, which may limit its use on other platforms. Rust: Pros: Rust is a systems programming language, which means it is designed to be fast, efficient, and provide low-level control over the hardware. Rust has a strong focus on safety and reliability, with a number of features (e.g. static typing, borrowing and ownership) that help prevent common programming errors and ensure that code is correct. Rust has a growing community and is gaining popularity in a number of domains, including web development, systems programming, and data science. Rust is open-source and has a liberal license, which means it is freely available and can be modified and distributed by anyone. Cons: Rust is a lower-level language, which means it can be more difficult to write and understand code, especially for developers coming from higher-level languages. Rust has a relatively steep learning curve, as it introduces a number of concepts (e.g. borrowing, ownership) that may be unfamiliar to developers coming from other languages. Rust does not have as large a standard library as some other languages, which means developers may need to rely more on external libraries or write more code themselves.
-
Create new language features for the programming language Delphi! Sure! Here are a few ideas for new language features that could be added to Delphi: Asynchronous programming: Delphi could introduce language-level support for asynchronous programming, allowing developers to write code that runs concurrently without the need for explicit threading or callback management. This could be achieved through the use of asynchronous functions and procedures, as well as language constructs like "await" and "async". Nullable types: Delphi could introduce nullable types, which allow variables to have a null value in addition to their regular data type. This could be useful for handling missing or undefined data in a more explicit and type-safe way. Generic types: Delphi could introduce support for generic types, which allow developers to write code that is independent of the specific data type being used. This could be achieved through the use of type parameters and type constraints, which allow developers to specify the requirements for a generic type without specifying a concrete data type. Improved exception handling: Delphi could introduce language-level support for improved exception handling, such as the ability to catch specific exception types, or the ability to specify custom exception classes. This could make it easier for developers to handle and respond to errors and exceptions in their code. Enhanced reflection capabilities: Delphi could enhance its reflection capabilities to allow developers to introspect and manipulate the structure and behavior of their code at runtime. This could include features like the ability to inspect and modify class definitions, access and modify object properties, or invoke methods dynamically.
-
https://downfor.io/docwiki.embarcadero.com
-
[MSBuild Error] The "BRCC32" task failed unexpectedly.
toms replied to Stéphane Wierzbicki's topic in Delphi IDE and APIs
I didn't FIND !? -
Maybe use StrToTime()
-
DelphiMVCFramework-3.2.2-nitrogen has been released
toms replied to Daniele Teti's topic in Delphi Third-Party
In brief: What's DelphiMVCFramework DMVCFramework is a very popular Delphi framework which provides an easy to use, scalable, flexible RESTful, JSON-RPC and ActiveRecord framework for Delphi developers. DMVCFramework is the most popular Delphi project on GitHub and compiles for Windows (32 and 64bit) and Linux (64bit). DMVCFramework services can be compiled as console application, Windows Service, Linux daemon, Apache module (Windows and Linux) and IIS ISAPI (Windows). DMVCFramework works with Delphi 11 Alexandria, Delphi 10.4 Sydney, Delphi 10.3 Rio, Delphi 10.2 Tokyo, Delphi 10.1 Berlin, Delphi 10 Seattle. -
Add WebBrowser1.Silent := True; to suppress script errors.
-
announce: Rubicon Full Text Search v4.072 released
toms replied to Ann Lynnworth's topic in Delphi Third-Party
I'm playing dumb: Where full-text search? In a database, in which, in files etc? Yes, I could follow the link and maybe find relevant info? However, why are they not posted here... No further discussion is necessary, as it is out of the question for me anyway. -
announce: Rubicon Full Text Search v4.072 released
toms replied to Ann Lynnworth's topic in Delphi Third-Party
Perhaps you could describe a little more what this is all about? -
announce: Rubicon Full Text Search v4.072 released
toms replied to Ann Lynnworth's topic in Delphi Third-Party
Perhaps you could describe a little more what this is all about? -
Google Translate: How to dynamically load local images into the ImageCollection image list with code
-
I installed swim.api and get this message when I try to open it (Android 11)
-
CMD /C Run Command and then terminate CMD /K Run Command and then return to the CMD prompt. This is useful for testing, to examine variables
-
I need to merge these two codes but I have little programming practice.
toms replied to MrCamarium's topic in Network, Cloud and Web
The two procedures "combined". Instead of serverExecute1() and serverExecute2(), give some meaningful names. procedure TForm1.serverExecute1(AThread: TIdContext); var clients: tlist; i: integer; messaggioprelevato: string; begin messaggioprelevato := AThread.Connection.IOHandler.ReadLn; showmessage(messaggioprelevato); clients := Server.Contexts.LockList;; try for i := 0 to connessi - 1 do try TIdContext(clients.Items[i]).Connection.IOHandler.WriteLn (messaggioprelevato); except end; finally end; Server.Contexts.UnlockList; end; procedure TForm1.serverExecute2(AContext: TIdContext); var FileName: string; TFSFileIn: TFileStream; begin TThread.Synchronize(nil, procedure begin Zilename := 'C:'; end); TFSFileIn := TFileStream.Create(FileName, fmCreate); try AContext.Connection.IOHandler.ReadStream(TFSFileIn); finally TFSFileIn.Free; end; end; procedure TForm1.serverExecute(AThread: TIdContext); begin serverExecute1(AThread); serverExecute2(AThread); end; -
Update: A lot of missing spaces inserted Some Br. -> Am. English to make it consistent Some grammatical errors corrected Object Pascal Style Guide - Developers Guide EN.pdf Object Pascal Style Guide - Developers Guide EN.docx