Jump to content

toms

Members
  • Content Count

    94
  • Joined

  • Last visited

Community Reputation

29 Excellent

Technical Information

  • Delphi-Version
    Delphi 10.2 Tokyo

Recent Profile Visitors

2623 profile views
  1. 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)
  2. 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.
  3. @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.
  4. That's why I use widely-adopted programming languages instead of Delphi, as I get good outputs.
  5. 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.
  6. ChatGPT isn't limited to coding. Interesting video about GPT-4:
  7. The command line tool rasdial can be used. https://winaero.com/disconnect-vpn-in-windows-10/ Not sure if there's a windows api.
  8. toms

    ChatGPT Example

    Comment from the TMS website:
  9. toms

    Open AI Chat

    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.
  10. toms

    Open AI Chat

    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.
  11. toms

    Is Embarcadero's DocWiki down?

    https://downfor.io/docwiki.embarcadero.com
  12. toms

    HoursBetween

    Maybe use StrToTime()
  13. 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.
×