GPT-4 writing Xojo code

I never use “Cruise Control”, as the opposite I think users give less attention to others cars. They keep left line or middle line even if there is not any cars on their right.
Note: In France, you’re suppose to overtake on the left, never on the right.

Sometimes we’re not agree if things are better or not :wink: .

1 Like

My car has “autopilot” that maintains speed (within distance limits of other vehicles) and automatically steers the car to keep it in its lane. I would never trust a “full self-driving” car at this point, and I never use autopilot while local, but it one long 8-10 hour drives it’s wonderful - far less fatiguing, and I don’t feel it makes me any less attentive.

2 Likes

Care to explain what it is ?

There are several AI interfaces out there. Bing has one (Bing is a web browser).

Edit: Correction: Bing is a search engine.

Ok, so, the long road:
I went to Firefox, asked google for Bing, ask my question and get a standard “Google” / “Yahoo”… answer.
image

So, you have to do something to activate “AI interfaces out there”.

After seeking some times at that page, I saw nothing AI related in Bing.

I googled “bing ai write code” and got a bunch of hits.

Nothing (excepted 12700000 found hits).

Better use Opera: you get a shortcut to ChatGPT (and maybe others).
second search:

@Emile_Schwarz you need to use microsoft edge under windows 11 to have access to bing AI.

Thank you Jean-Yves. :joy:

It’s so refreshing to be able to just disagree with someone and move on. Thank you.

Microsoft invested a hefty amount of money into ChatGPT and has integrated it into their product including their search engine Bing. They included the Bing Chat using ChatGPT v4.0 in their Bing browser on Mobile and Edge Browser on Windows 11. I think they are integrating it across the board. The beauty of it is that it is free to use.

Apart from code writing, it was the first to incorporate search with their AI engine.

If you are using Mac, they do have a Dev Edge version of Edge which comes with Bing AI Chat. Not sure if you need to still be on the waitlist or just a Microsoft Account would do

https://www.microsoft.com/en-gb/edge/download?form=MA13FJ

Thank you for your answer.

That is the case.

I tried Safari using Edge Windows User Agent, but nothing.

Just curious.

You need to be logged in to a Microsoft account to use it.

Has anyone tried the optimized version for coding? :

I think it’s this version that is integrated to Github Copilot.

Directly in the IDE, you type a comment, and the service translates it into code just below :

As of March 2023, the Codex models are now deprecated. Please check out our newer Chat models which are able to do many coding tasks with similar capability> Blockquote

Well chat models which i use since 2 months (free version)
may give you a general idea for programming (as a computer analyst so you may get an idea how to set up your program databases etc.) but if you need a help to create code you get many errors…
I do not know if paid version is better updated and error free but anyway we are living the early stages of AI.
After some years time perhaps it will have voice recognition feature and voice generator so you will be able instead of chat with the use of keyboard to start speaking with AI.

The new July 20th update on GPT-4 has improved Xojo code generation a lot.

I just asked it: Write me a Xojo function that takes HTML as a string input and finds the first <img tag that has a .svg file type as the src and returns the path to that .svg file as a string. Make sure to account for the html using either single or double quotes for its attributes.

It cranked this out on the first try and worked perfectly:

Function findFirstSvgPath(htmlInput As String) As String
    Dim re As New RegEx
    Dim match As RegExMatch
    Dim tag As String
    Dim svgPath As String
    
    ' Regular expression pattern to find img tags
    re.SearchPattern = "(<img[^>]+>)"
    
    ' Find the first img tag
    match = re.Search(htmlInput)
    
    ' If an img tag is found
    If match <> Nil Then
        tag = match.SubExpressionString(0)
        
        ' Regular expression pattern to find src attribute
        re.SearchPattern = "src\s*=\s*[""']((?:.(?![""']?\s+(?:\S+)=|[>""']))+.svg)[""']"
        
        ' Find the src attribute
        match = re.Search(tag)
        
        ' If src attribute is found and it's an svg file
        If match <> Nil Then
            svgPath = match.SubExpressionString(1)
            Return svgPath
        End If
    End If
    
    ' If no svg file is found, return empty string
    Return ""
End Function

'This function goes through the HTML input string and returns the first instance of an svg file path it 
'finds in an image tag, or an empty string if none are found.
'
'It's important to note that working with HTML in this way can be error-prone due to the flexible nature 
'of HTML syntax. It's typically better to use a dedicated HTML parsing library if one is available for your 
'language of choice. As of my knowledge cutoff in September 2021, Xojo does not have a built-in HTML 
'parsing library, but there may be third-party libraries available that can provide this functionality.
'
'The regular expressions used here are simplistic and may not account for all possible variations in 
'HTML syntax. They are meant to illustrate the basic concept, not to be a comprehensive solution.
2 Likes

I can see a mistake with it. It won’t really matter, but it’ll match imagexsvg too.

So we all just need to get really good about describing the problem to an AI? If we could accurately and completely describe the problem, would we really need the AI?

1 Like

So, we will no more need a Language Reference in a near future ?

Please explain the process of getting access to GPT-4. I’ve gone to OpenAI’s site and have some “code” id. For a while, I had access - a “playground” - to asking GPT-3 questions but It seems I’ve reached some limit. Though I’ve sent messages to OpenAI, I’ve heard nothing back.

The number $20/month rings a bell. Do they have a link you use to sign up and have your credit card changed (with auto-renew each month)?