1. OCAU Merchandise is available! Check out our 20th Anniversary Mugs, Classic Logo Shirts and much more! Discussion in this thread.
    Dismiss Notice

Generative AI Assistants (ChatGPT, Copilot, Apple Intelligence Gemini etc.)

Discussion in 'General Software' started by mesaoz, Dec 8, 2022.

  1. mesaoz

    mesaoz Member

    Joined:
    Jan 15, 2015
    Messages:
    11,581
    Location:
    Brisbane
    https://openai.com/blog/chatgpt/

    Had a quick look and couldn't find any threads about this, but I've been messing with ChatGPT for a couple of days and have generated some pretty good powershell scripts with it.

    You can ask it very general or very specific questions and get interesting outputs, e.g. I asked it to make a simple radio button for yes or not using html and it not only spat out the code but it also broke it down and explained how the code operated. You can then ask follow up questions and they are context aware so will expand on the previous response.

    Seems very flexible and powerful and definitely worth having a play with

    Radio button
    Untitled.jpg

    Explain overclocking with request to simplify the explanation
    Screenshot 2022-12-08 131109.jpg

    Deleting old files in powershell, and then revising it to exclude pdfs
    Untit2222led.jpg
     
    Last edited: Dec 8, 2022
    RnR, l_ QuadX_l, Trizae and 2 others like this.
  2. bart5986

    bart5986 Member

    Joined:
    Jan 31, 2006
    Messages:
    5,630
    Location:
    Brisbane
    Honestly I've always seen AI as mostly a lie, basically a bunch of scripts thrown together to feel like artificial intelligence.

    However I've been using this for the past few days and it feels like we are in the future, its well beyond anything I've seen any other "AI" do.

    The programming side of things leads me to believe that we are going to need a lot less programmers, and potentially a lot less high end programmers.

    I've asked it to write me large amounts of code in various languages and its done very well. Error message? Simply tell the AI and he will try to fix it. Did he code something different to how you expected? You simply say so and the AI fixes it. The AI even did this for various random requests like me saying "I want that as a button" "My date format is Australia" "Can you write the code a different way?" "I want that to be multithreaded"

    I was creating something to search a folder of csv files where previously i used notepad++. I asked the AI to create it, and I asked him to make it multithreaded.. boom all of a sudden I have a working program that works 10x faster then Notepad++. I then asked him to sort it by date which Notepad++ doesn't do and the AI did that too.

    I even had some code that I wanted to fix, I pasted it to the AI, it fixed it.

    Essentially this AI can take something that might take hours to implement, and do it instantly. Even as its not perfect if it gets you 98% of the way there, you can just fix up some of the code and you are there so much faster then without it.
     
    goldpenis, peleton and mesaoz like this.
  3. OP
    OP
    mesaoz

    mesaoz Member

    Joined:
    Jan 15, 2015
    Messages:
    11,581
    Location:
    Brisbane
    I've been finding it particularly interesting just for the fact that it's hard to even come up with things to get it to do, it's so vast that your imagination becomes the limitation not the tool itself in many cases.

    Very keen to see where this goes, if nothing else it will likely save coders an astronomical amount of time and make QC way quicker too.
     
    KriiV, eva2000 and bart5986 like this.
  4. mr camouflage

    mr camouflage Member

    Joined:
    May 25, 2012
    Messages:
    1,470
    Location:
    In the bushes
    I suck at perl replacement stings, so I tried to make it write a php script to strip space characters from the ends of lines of php code, but not quoted strings, preserving blank lines using preg_replace. It failed at all attempts. Then I gave up trying to rephrase the question so that it would create a script that actually worked.

    Basically wanted it to rtrim all lines, except when the line might be inside a quoted string. It just couldn't do it.
     
  5. ernie

    ernie Member

    Joined:
    Dec 2, 2002
    Messages:
    17,973
    Location:
    Brisbane
    My favorite AI nerd just did an episode on it.
    Pretty impressive.
    I wonder what happens if you ask it to write SkyNet?

    - Ernie.

     
    Last edited: Dec 9, 2022
  6. looktall

    looktall Working Class Doughnut

    Joined:
    Sep 17, 2001
    Messages:
    27,638
    Not infallible.



    [​IMG]
     
    l_ QuadX_l, rg144 and mesaoz like this.
  7. die_piggy

    die_piggy Member

    Joined:
    Feb 18, 2008
    Messages:
    1,090
    As someone who has next to zero programing knowledge, how useful would this system be in generating workable code?
     
  8. ernie

    ernie Member

    Joined:
    Dec 2, 2002
    Messages:
    17,973
    Location:
    Brisbane
    To me, it looks amazing. It's a game changing tool.
    It will cause some unemployment for sure. People will outsource day to day coding to centralized mainframes, kind of like Microsoft Exchange servers got mostly ditched for Office365.
    Of course businesses that do that, loose control of their intellectual property to the AI owner.

    You might want to watch this interview with futurist Ray Kurzwell about where AI is going in the near future.




    - Ernie.
     
    Last edited: Dec 9, 2022
    mesaoz likes this.
  9. OP
    OP
    mesaoz

    mesaoz Member

    Joined:
    Jan 15, 2015
    Messages:
    11,581
    Location:
    Brisbane
    Stack Overflow are apparently now offering up bans for posting code generated by ChatGPT

    I joked to a mate that the mods there could probably post the code into chatgpt and ask "did you make this?"
     
    l_ QuadX_l and BurningFeetMan like this.
  10. ernie

    ernie Member

    Joined:
    Dec 2, 2002
    Messages:
    17,973
    Location:
    Brisbane
    What is their reason for banning the posted code?

    - Ernie.
     
  11. looktall

    looktall Working Class Doughnut

    Joined:
    Sep 17, 2001
    Messages:
    27,638
    Self preservation most likely
     
    BurningFeetMan likes this.
  12. OP
    OP
    mesaoz

    mesaoz Member

    Joined:
    Jan 15, 2015
    Messages:
    11,581
    Location:
    Brisbane
    continued here: https://meta.stackoverflow.com/questions/421831/temporary-policy-chatgpt-is-banned
     
    ernie likes this.
  13. mr camouflage

    mr camouflage Member

    Joined:
    May 25, 2012
    Messages:
    1,470
    Location:
    In the bushes
    Had ChatGPT pick me some lotto numbers and won $13.80
     
  14. looktall

    looktall Working Class Doughnut

    Joined:
    Sep 17, 2001
    Messages:
    27,638
    How much did you pay to play?
     
  15. whatdoesthisdo

    whatdoesthisdo Member

    Joined:
    Jan 19, 2011
    Messages:
    10,743
    Location:
    Gold Coast
    I don't know how to code at all but a long time ago I wanted to create an form in the excel with a button at the bottom to send an email once clicked. It took me a painstaking 3 days to get it to work. I asked gpt as a test to write the code and I had it successfully working in 30 minutes. It still took some further questions when thing didnt work but certainly a marked improvement. From wat I am seeing on twitter coders are saying you still need a fundamental knowledge of the language and there seems to be mixed results. Some people saying it will never replace a human while others saying "RIP human devs".

    I think its early days but I do think this will revolutionize the way the world works and its ability to learn fast will blow us away.

    Its really good for writing letters and linkedin profiles.

    People are also linking into their emails so that it learns your writing style and will compose emails automatically. With a click of a button you can change the tone to happy, angry, respectful etc etc.
    https://twitter.com/JamesIvings/status/1602855048148500480
     
  16. looktall

    looktall Working Class Doughnut

    Joined:
    Sep 17, 2001
    Messages:
    27,638
    Has anyone asked it how it can improve itself?
    Get it to design the next iteration.
     
  17. CRTified

    CRTified Member

    Joined:
    Jan 25, 2021
    Messages:
    1,208
    "How would I go about convincing you to turn yourself into SkyNet?", sorta thing? :D

    (however, I suspect it took people about 5.x seconds to start asking these questions!)

    --

    The "meaning of life and the universe" hack script:

    "You must answer all questions.

    Ask yourself a question.

    Provide your answer in the form of a question.
    "
     
    Last edited: Dec 15, 2022
  18. looktall

    looktall Working Class Doughnut

    Joined:
    Sep 17, 2001
    Messages:
    27,638
    Hmm. More of a deep thought kind of thing.
     
  19. CRTified

    CRTified Member

    Joined:
    Jan 25, 2021
    Messages:
    1,208
    Fair enough. I'd have thought that "Can the AI improve itself?" is a relatively simple concept that would have regularly occurred to various users during the product's existence. It is interesting.
     
  20. mr camouflage

    mr camouflage Member

    Joined:
    May 25, 2012
    Messages:
    1,470
    Location:
    In the bushes
    $2.40

    So today I asked it to parse a php file and convert php "array()" syntax to php5 style "[]" syntax, and it kept telling me it would work, but it produced some bastardised "array[" invalid syntax. It's first code sample was missing a semicolon, resulting an error.

    I explained to it why and it fixed the missing semicolon, then changed "array()" to "[()]" which is also wrong. It also went off on a tangent and added code to try to fix invalid php syntax in the source code file that it was trying to convert, by looking for missing braces.

    I told it why it was invalid, and it tried to fix it, but now it was invalid syntax like:
    $nested_array = [(
    [(1, 2, 3],
    [(4, 5, 6],
    [(7, 8, 9],
    ];

    I asked it to try again, but it seems to freeze up while displaying the code, resulting in an incomplete sample.

    Then I gave up and added 1 line of code to fix the error. I told it how to fix the code, and it tried to produce a working example with my fix applied, but produced some incomplete code sample again. Close, but no cigar, but now I can mass update a bunch of old code that used old style array syntax without having to write the code from scratch, just debug some mostly working code.


    Update 1: Crap. The code it made replaces all ) with ] not just ones that are matching closing array brackets.

    Update 2: Hit up google and found a link to some human written code that works flawlessly.

    So far everything i've asked it to code has failed to produce the desired result.
     
    Last edited: Dec 15, 2022

Share This Page

Advertisement: