I'm in Love with ChatGPT (1 Viewer)

kandert

New member
Local time
Today, 09:38
Joined
Jun 5, 2022
Messages
18
Chat GPT is my best friend for work
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 07:38
Joined
Jul 9, 2003
Messages
16,282
See this fascinating video discussing the latest improvements to ChatGPT-4

ChatGPT Code Interpreter - The Biggest Update EVER! - 2023_08_09​


I ran a Test:
I've tested it on my text snippets, the text snippets I'm referring to are my "speech to text" files recorded with voice notebook. Each "speech to text" snippet is downloaded to my download folder which quickly gets full of text files containing little snippets of text.

History:
One of the first things I did with chat GPT was to write some Python code to concatenate all of the text snippets into one file. To test the capabilities of this new version of Chat GPT-4 I took the text from my 2018 snippets and asked Chat to analyse it with a view to creating a blog.

Chat GPT-4 Analysis:
To perform the analysis Chat GPT-4 wrote Python code to count frequencies of words. ChatGPT didn't think this produced much useful information, I was not surprised because there is no structure - rhyme or reason - to my notes they are just what I happen to be saying, for example what I'm saying "right now" is being recorded and will be saved to a text file for future examination by chat GPT!

Blog Topic - INSERT INTO SQL Statement:
CHAT then analysed the text again and suggested several topics. I also lent a hand by providing a couple of hints based on my favourite subjects. We decided to write a blog about the INSERT INTO SQL Statement which I will post below.
 
Last edited:

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 07:38
Joined
Jul 9, 2003
Messages
16,282
The following is the essence of a Blog about the "INSERT INTO" SQL statement created by chat GPT. It's not a Blog as such, in the sense that it's something I want to publish. It is here as an example of what can be achieved with chat GPT. It obviously needs polishing, needs checking for errors, and there are substantial sections missing. CHAT has provided a nice framework, a good place to start from in creating a blog post.

Constructing SQL Statements in VBA: Best Practices and Tips

Introduction

SQL statements are the backbone of any database application, including those built with Microsoft Access. They allow for the retrieval, insertion, update, and deletion of data. In many scenarios, especially in VBA, we find ourselves needing to construct these statements dynamically based on various conditions. This article delves into the nuances of building dynamic "INSERT INTO" SQL statements in VBA, ensuring data integrity and efficiency.

The Basics of Dynamic SQL in VBA
Static SQL statements are hardcoded and don't change. While they're straightforward, they're not always practical. Dynamic SQL, on the other hand, is constructed at runtime. This flexibility allows for more responsive and adaptable applications, but it comes with its challenges.

Handling Data Types and Delimiters
Data types in SQL need to be delimited correctly to ensure the database engine interprets them as intended.
- Text: Text values should be wrapped in double quotes. In VBA, we achieve this using
Code:
Chr(34)
.
Code:
SurName = Chr(34) & SurName & Chr(34)
- Date: Date values are wrapped in hash marks, represented by
Code:
Chr(35)
in VBA.
Code:
DateOfBirth = Chr(35) & DateOfBirth & Chr(35)

Incorrect delimiters can lead to errors or, worse, unintended data insertions.

Building the INSERT INTO Statement
To illustrate the process of constructing an "INSERT INTO" statement, let's examine the
Code:
fAddRec
function:

Code:
Private Function fAddRec(SurName As String, OtherNames As String, DateOfBirth As String, PlaceOfBirth As String, Gender As Integer, StateOfOrigin As String, LGA As String, Attachment As String, PreviousSchool As String)
    ' Add Text Delimiters " = Chr(34)
    SurName = Chr(34) & SurName & Chr(34)
    OtherNames = Chr(34) & OtherNames & Chr(34)
    PlaceOfBirth = Chr(34) & PlaceOfBirth & Chr(34)
    StateOfOrigin = Chr(34) & StateOfOrigin & Chr(34)
    LGA = Chr(34) & LGA & Chr(34)
    Attachment = Chr(34) & Attachment & Chr(34)
    PreviousSchool = Chr(34) & PreviousSchool & Chr(34)
    ' Add Date Delimiters # Chr(35)
    DateOfBirth = Chr(35) & DateOfBirth & Chr(35)
    Dim strSQL0 As String
    Dim strSQL1 As String
    Dim strSQL2 As String
    strSQL1 = "INSERT INTO tblChildDetails(SurName, OtherNames, DateOfBirth, PlaceOfBirth, Gender, StateOfOrigin, LGA, AttachmentX, PreviousSchool) "
    strSQL2 = "Values(" & SurName & ", " & OtherNames & ", " & DateOfBirth & ", " & PlaceOfBirth & ", " & Gender & ", " & StateOfOrigin & ", " & LGA & ", " & Attachment & ", " & PreviousSchool & ")"
    strSQL0 = strSQL1 & strSQL2
    CurrentDb.Execute strSQL0
End Function

The function dynamically constructs the fields and values lists and then merges them to form the final SQL statement. By delimiting data correctly, it ensures that the SQL statement is properly formatted.

Executing the SQL Statement
Once the SQL statement is constructed, it's executed using:
Code:
CurrentDb.Execute strSQL
It's crucial to handle any errors that might arise, ensuring the application remains stable and provides informative feedback to the user.

Tips for Advanced SQL Construction
- Parameterized Queries: Instead of constructing SQL strings, using parameterized queries can safeguard against SQL injection attacks and ensure data integrity.
- Stored Procedures and Functions: For repetitive tasks, consider encapsulating your SQL logic in stored procedures or functions. This not only improves performance but also modularizes and organizes your codebase.

Conclusion
Building dynamic SQL statements in VBA is a skill that, when mastered, can significantly enhance your MS Access applications. While it offers flexibility, it's essential to remain cautious and adhere to best practices to ensure data integrity and application stability.

Further Reading/References
- Access World Forums
- Microsoft's official documentation on VBA and SQL
 
Last edited:

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 07:38
Joined
Jul 9, 2003
Messages
16,282
Here is a new and interesting time wasting opportunity!

 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 07:38
Joined
Jul 9, 2003
Messages
16,282
Text compression with LLM? Oh, and a thesaurus!

This is an interesting and slightly amusing project. Whether it will be of any use to anyone will remain to be seen!

 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 07:38
Joined
Jul 9, 2003
Messages
16,282

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 01:38
Joined
Feb 28, 2001
Messages
27,191
I've stepped away from this thread for a while and was surprised to see how much it had moved since my last visit.

The question came up and I didn't answer at the time, but to the best of my understanding, you cannot trademark, copyright, or patent anything that an AI created for you (story, art, a program) because you didn't solely create it. But, you say, it was my idea! True, but without a prior written agreement regarding disposition of ownership of the intellectual property, your claim is unclear. This happened to me many times when I was with the U.S. Navy as a contractor. Essentially, even though I wrote many programs during my 28 1/2 years in that position, I was creating work for hire and there was a clause in our contract to that effect. The Navy owned every line of code I ever wrote in that context. At every contract change, I always had to add a disclaimer to exclude my hobbyist writing AND had to assure that none of my prose EVER hit a Navy computer or storage device (not even a thumb drive) at any time. It is my belief that AI used indiscriminately will "poison" the claim of authorship. Nor are you likely to get the AI owner to sign such a disposition agreement.

Another question came up as a side issue: If I write code using Access or Python or C++, do I own that code? The question boils down to whether there is an AI component of any significance in the development environment. If all it does is translate code directly, you are probably in the clear. Even VBA being pseudo-compiled doesn't muddy the waters THAT much. The Access "Wizard" method of programming something might JUST BARELY squeak this into a VERY SLIGHTLY hazy area, since you didn't program the part that the wizard built. Access supplied that from a predefined library of templates to achieve the given effect. However, most of the time the copyright owner (Microsoft) isn't interested in small-office apps with limited marketing scope and (probably rightly) chooses to not bother pursuing small products for limited production exposure.

SLIGHTLY changing the subject, I used to watch a TV series called Numbers, which was usually a bit far-fetched in the application of sophisticated college-level mathematical analyses of crimes. Most of the time their violations of reality involved straining the low-end boundaries of the Law of Large Numbers - applying large-scale statistics to very small samples. OK, I'm a bit of a snob about that, trying to catch clever shows in not-so-clever errors in math or theory. So sue me for being an intellectual snob selectively.

However, one Numbers episode from 2009, "First Law", involved an AI project being built by DARPA that initially appeared to have created a "true" AI, one that was both sentient and self-aware. Turned out the program involved was more like ChatGPT that used massive prediction algorithms to synthesize the most likely response to whatever was said or suggested. It sounded REMARKABLY like what ChatGPT and other current AI systems actually do, but the show concluded that a "most probable conforming response" algorithm is NOT true AI and is not sentient or self-aware. In retrospect, the episode was both prophetic and accurate.
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 07:38
Joined
Jul 9, 2003
Messages
16,282
If I write code using Access or Python or C++, do I own that code?
I'd say you can't own the code you make with MS Access, 'cause where does it come from? Not from your own mind, like writing a story. You start with something Microsoft gives you, MS Access examples and knowledge base. You learn it, then use it in your own way.

But, it's fair to say that by mixing and tweaking that starting point you can make something new and yours, a bit like writing fiction.

In another sense, with all the blood sweat and tears you put into it you know it's yours!

So I suppose I am sitting on the fence again.
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 07:38
Joined
Jul 9, 2003
Messages
16,282
Turned out the program involved was more like ChatGPT that used massive prediction algorithms to synthesize the most likely response to whatever was said or suggested. It sounded REMARKABLY like what ChatGPT and other current AI systems actually do,

It's hard to gauge, but I often get the impression that ChatGPT is like one of those fancy salesman that tells you what you want to hear.
 

Jon

Access World Site Owner
Staff member
Local time
Today, 07:38
Joined
Sep 28, 1999
Messages
7,398
Who knows where the code came from first? If I wrote a line of code, then asked ChatGPT a question that produces the same line of code, who owns the copyright? Surely the originator. The fact that ChatGPT produces some code, who is to say they were first? Also, does this mean I should take OpenAI to court for copyright infringement?
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 07:38
Joined
Jul 9, 2003
Messages
16,282
Who knows where the code came from first?
In my early days of using Microsoft Access I came across people who had an astounding knowledge of VBA. I don't think they got that knowledge using the early iterations of Microsoft Access, I can't see how that would have been possible. My suspicion is they moved from the VB class of languages, I suspect vb6 was the equivalent to MS Access at the time and they brought their knowledge of vb6 into the Microsoft Access VBA world. Tracing the codes origins back down through Microsoft Access and vb6 would be an absolute nightmare.
 

Jon

Access World Site Owner
Staff member
Local time
Today, 07:38
Joined
Sep 28, 1999
Messages
7,398
In the near future, we will probably get specialist copyright AI bots who argue the case against one another, where it is so complex that no human can understand it. The side with the best CPU count wins. Perhaps Elon is the only one with a quantum AI bot that is so powerful, it out-argues everybody on the planet and he takes over the world through legal argument.

Are we on the verge of a dystopian future?
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 01:38
Joined
Feb 28, 2001
Messages
27,191
Who knows where the code came from first? If I wrote a line of code, then asked ChatGPT a question that produces the same line of code, who owns the copyright? Surely the originator. The fact that ChatGPT produces some code, who is to say they were first? Also, does this mean I should take OpenAI to court for copyright infringement?

There are/have been arguments regarding "irreducible minimum" for certain things that cannot be copyrighted or patented. The idea is that if you have reduced something to a provable minimum, it is too basic to be registered for ownership. For instance, the Schrodinger equations for atomic wave functions represent a minimum natural property of matter and thus, if owned at all, they are owned by Mother Nature. Or, let's say you derive a polynomial to compute the Sine function. That is too much based on the nature of pure math to be registered for ownership. At most, you can hope your name appears in a dry, dusty textbook some years later, being given credit for the derivation. So "Schrodinger" and "Euler" and "Faraday" have their names in print and that's about it.
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 01:38
Joined
Feb 28, 2001
Messages
27,191
It figures that this would eventually happen.


Who knows where the code came from first? If I wrote a line of code, then asked ChatGPT a question that produces the same line of code, who owns the copyright? Surely the originator. The fact that ChatGPT produces some code, who is to say they were first? Also, does this mean I should take OpenAI to court for copyright infringement?

The first issue is clarity of ownership. If there is reasonable doubt regarding who wrote what first, lawyers are going to make money out of - but it ain't going to be going into YOUR pocket.

The second issue is uniqueness. Depending on how much code is involved in various Access event routines, the simpler routines might be too small to qualify for copyright protection. The ultimate foolishness that I recall from getting into an afternoon giddy-fest after too long a morning was that someone wanted to copyright the word "IS" (the third-person singular present tense of "TO BE"). But of course you cannot copyright a single word even if you made up the word yourself.
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 01:38
Joined
Feb 28, 2001
Messages
27,191
where it is so complex that no human can understand it.

There was a story by David Gerrold, "When H.A.R.L.I.E. Was One", in which an AI named HARLIE designed a computer that could answer ANY QUESTION posed to it. But HARLIE was an AI and needed to justify its own existence, so the interface for the new machine - the Graphic Omniscient Device, or GOD for short - was so complex that it could only be used by HARLIE. Which means that GOD could manage the world and HARLIE would be its prophet.
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 07:38
Joined
Jul 9, 2003
Messages
16,282
# The Intricacies of Language: A Debate Between Uncle Gizmo and ChatGPT

The Origin of "Mankind"

**Uncle Gizmo**
"Let's start with the term 'Mankind.' I understand it originates from Old English, combining 'man' and 'kind.' It's fascinating how language evolves, don't you think?"

**ChatGPT**
"Absolutely! Originally, the term was inclusive, referring to humanity as a whole. But language is fluid, and its meaning and usage can change over time."

## ChatGPT: The Modern Debate

**ChatGPT**: "Speaking of change, there's a modern shift towards more inclusive language, like using 'Humankind' instead of 'Mankind.' What's your take on this, Uncle Gizmo?"

**Uncle Gizmo**: "Well, I see that change as politically motivated. It's not a natural shift; it's more about controlling the narrative. It reminds me of Newspeak in Orwell's '1984.' Language can be a tool for control, shaping how we think and what we believe. Orwell warned us about this."

**ChatGPT**: "Orwell's cautionary tale was indeed influenced by his life experiences, like his time in the Spanish Civil War. He saw how language and propaganda could be manipulated to serve those in power."


## ChatGPT: A Pivotal Experience—The Spanish Civil War

**ChatGPT**: "Orwell's disillusionment during the war led him to explore themes of power and control in his works, including '1984.' It's a fascinating intersection of personal experience and creative expression."

**Uncle Gizmo**: "Exactly, and it's why we should be cautious about how language evolves or is manipulated today. Orwell's warnings are more relevant than ever."
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 07:38
Joined
Jul 9, 2003
Messages
16,282
Chat GPT has an IQ of 155!

See time index 2 minutes! It's incredible...

 

jdraw

Super Moderator
Staff member
Local time
Today, 02:38
Joined
Jan 23, 2006
Messages
15,379
Chat GPT has an IQ of 155!

See time index 2 minutes! It's incredible...

Great video. It organizes many of our assumptions/predictions. Whether or not humans can agree on a meaningful, cooperative strategy vs the standard greed is a big question. That an AI machine will have many times the human IQ and a wealth of facts in most disciplines instantly is a construct we (the global we) need to recognize.
 

Users who are viewing this thread

Top Bottom