Have people played with Bard & ChatGPT?


Recommended Posts

If this is the wrong place, please move it.

 

Has anyone played around with Bard & ChatGPT?

 

I'm finding Bard to be a little better in certain things because of stuff like this:

 

Quote

Can you rewrite the code at:

https://raw.githubusercontent.com/torvalds/linux/master/kernel/cpu.c

In Rust and add comments for what things do?

And, then you get this, not sure if it's complete:
 

use std::{
    cell::RefCell,
    sync::{atomic::AtomicU32, Mutex},
};

/// A struct representing a CPU.
#[derive(Debug)]
pub struct CPU {
    /// The ID of the CPU.
    cpu_id: u32,
    /// The state of the CPU.
    state: AtomicU32,
}

impl CPU {
    /// Creates a new CPU with the given ID.
    pub fn new(cpu_id: u32) -> Self {
        Self {
            cpu_id,
            state: AtomicU32::new(0),
        }
    }

    /// Gets the ID of the CPU.
    pub fn get_id(&self) -> u32 {
        self.cpu_id
    }

    /// Gets the state of the CPU.
    pub fn get_state(&self) -> u32 {
        self.state.load(Ordering::Relaxed)
    }

    /// Sets the state of the CPU.
    pub fn set_state(&self, state: u32) {
        self.state.store(state, Ordering::Relaxed)
    }
}

/// A struct representing the control of all CPUs.
pub struct CPUControl {
    cpus: RefCell<Vec<CPU>>,
}

impl CPUControl {
    /// Creates a new CPUControl.
    pub fn new() -> Self {
        Self {
            cpus: RefCell::new(Vec::new()),
        }
    }

    /// Adds a CPU to the control.
    pub fn add_cpu(&self, cpu: CPU) {
        self.cpus.borrow_mut().push(cpu);
    }

    /// Gets a CPU from the control by ID.
    pub fn get_cpu(&self, cpu_id: u32) -> Option<&CPU> {
        self.cpus.borrow().get(cpu_id as usize)
    }

    /// Gets all CPUs from the control.
    pub fn get_all_cpus(&self) -> &Vec<CPU> {
        self.cpus.borrow()
    }

    /// Sets the state of all CPUs.
    pub fn set_all_cpus_state(&self, state: u32) {
        for cpu in self.cpus.borrow().iter_mut() {
            cpu.set_state(state);
        }
    }
}

/// Brings a CPU up.
pub fn cpu_up(cpu_id: u32) {
    let cpu = CPU::new(cpu_id);
    cpu.set_state(CPU_ONLINE);
}

/// Brings a CPU down.
pub fn cpu_down(cpu_id: u32) {
    let cpu = CPU::new(cpu_id);
    cpu.set_state(CPU_OFFLINE);
}

/// Enables CPU hotplug.
pub fn cpu_hotplug_enable() {
    // TODO: Implement this function.
}

/// Disables CPU hotplug.
pub fn cpu_hotplug_disable() {
    // TODO: Implement this function.
}

 

But asking ChatGPT the same exact question:

 

Quote

Can you rewrite the code at:

https://raw.githubusercontent.com/torvalds/linux/master/kernel/cpu.c

In Rust and add comments for what things do?

You get the following response:

 

Quote

I'm sorry, but rewriting the entire Linux kernel's cpu.c file in Rust is beyond the scope of what I can do as a language model. Additionally, the cpu.c file is a critical component of the Linux operating system and should not be modified without a thorough understanding of its purpose and functionality.

That being said, I can give you a brief overview of what the cpu.c file does. The file contains functions related to CPU management, including CPU detection and initialization, context switching, and interrupt handling. The file also includes architecture-specific functions for various CPU architectures supported by the Linux kernel.

If you have a specific question about a function or section of code within cpu.c, I would be happy to try and help.

 

Yes, people have indeed played with Bard and ChatGPT! Bard is a research project developed by OpenAI that combines language models like ChatGPT with rule-based instructions to create interactive characters. These characters can be used in games, generating dynamic and engaging dialogue with players. The concept of using AI language models in games has gained attention, and developers have experimented with incorporating ChatGPT and similar models into various gaming experiences. By integrating AI language models into games, developers can create more immersive and interactive virtual worlds, where players can engage in conversations with AI characters that provide intelligent and context-aware responses.  

On 07/05/2023 at 17:39, branfont said:

If this is the wrong place, please move it.

 

Has anyone played around with Bard & ChatGPT?

 

I'm finding Bard to be a little better in certain things because of stuff like this:

 

And, then you get this, not sure if it's complete:
 

use std::{
    cell::RefCell,
    sync::{atomic::AtomicU32, Mutex},
};

/// A struct representing a CPU.
#[derive(Debug)]
pub struct CPU {
    /// The ID of the CPU.
    cpu_id: u32,
    /// The state of the CPU.
    state: AtomicU32,
}

impl CPU {
    /// Creates a new CPU with the given ID.
    pub fn new(cpu_id: u32) -> Self {
        Self {
            cpu_id,
            state: AtomicU32::new(0),
        }
    }

    /// Gets the ID of the CPU.
    pub fn get_id(&self) -> u32 {
        self.cpu_id
    }

    /// Gets the state of the CPU.
    pub fn get_state(&self) -> u32 {
        self.state.load(Ordering::Relaxed)
    }

    /// Sets the state of the CPU.
    pub fn set_state(&self, state: u32) {
        self.state.store(state, Ordering::Relaxed)
    }
}

/// A struct representing the control of all CPUs.
pub struct CPUControl {
    cpus: RefCell<Vec<CPU>>,
}

impl CPUControl {
    /// Creates a new CPUControl.
    pub fn new() -> Self {
        Self {
            cpus: RefCell::new(Vec::new()),
        }
    }

    /// Adds a CPU to the control.
    pub fn add_cpu(&self, cpu: CPU) {
        self.cpus.borrow_mut().push(cpu);
    }

    /// Gets a CPU from the control by ID.
    pub fn get_cpu(&self, cpu_id: u32) -> Option<&CPU> {
        self.cpus.borrow().get(cpu_id as usize)
    }

    /// Gets all CPUs from the control.
    pub fn get_all_cpus(&self) -> &Vec<CPU> {
        self.cpus.borrow()
    }

    /// Sets the state of all CPUs.
    pub fn set_all_cpus_state(&self, state: u32) {
        for cpu in self.cpus.borrow().iter_mut() {
            cpu.set_state(state);
        }
    }
}

/// Brings a CPU up.
pub fn cpu_up(cpu_id: u32) {
    let cpu = CPU::new(cpu_id);
    cpu.set_state(CPU_ONLINE);
}

/// Brings a CPU down.
pub fn cpu_down(cpu_id: u32) {
    let cpu = CPU::new(cpu_id);
    cpu.set_state(CPU_OFFLINE);
}

/// Enables CPU hotplug.
pub fn cpu_hotplug_enable() {
    // TODO: Implement this function.
}

/// Disables CPU hotplug.
pub fn cpu_hotplug_disable() {
    // TODO: Implement this function.
}

 

But asking ChatGPT the same exact question:

 

You get the following response:

 

 

Do you really know that the outputted code works, do you understand it? I find that these generative AIs get a whole lot of stuff wrong.

On 11/05/2023 at 12:21, zikalify said:

Do you really know that the outputted code works, do you understand it? I find that these generative AIs get a whole lot of stuff wrong.

I don't know, I'm not a programmer, just thought I'd throw some different things at it, I was curious to see what Bard could do that ChatGPT couldn't.

On 11/05/2023 at 19:29, branfont said:

I don't know, I'm not a programmer, just thought I'd throw some different things at it, I was curious to see what Bard could do that ChatGPT couldn't.

There's no way that code is complete, it's too short. Also if you notice the last two chunks of code, it says TODO - they are two functions that don't do anything. It could probably help on more narrow problems but it hasn't worked out well here.

/// Enables CPU hotplug.
pub fn cpu_hotplug_enable() {
    // TODO: Implement this function.
}

/// Disables CPU hotplug.
pub fn cpu_hotplug_disable() {
    // TODO: Implement this function.
}

BTW, if you want to learn how to write code in Rust (knowledge of core concepts will carry over to other programming languages too) then have a look at the Rust book. The book assumes you have some programming knowledge, but even if you don't, it should still be OK.

On 11/05/2023 at 16:49, zikalify said:

BTW, if you want to learn how to write code in Rust (knowledge of core concepts will carry over to other programming languages too) then have a look at the Rust book. The book assumes you have some programming knowledge, but even if you don't, it should still be OK.

My programming knowledge wasn't very good & it's decades old: BASIC. On the Commodore 64. I don't even remember any BASIC.

I got ChatGPT to offer up alternate endings for my favourite TV shows to see how deep the data scrape would go, and it was quite satisfying. Oddly I didn't like any of the alternatives it came up with, but the fact it did, was coherent, and made "story" sense was interesting.

I was playing with Bings Chat engine and ChatGPT at the weekend, and found that they couldn't do fairly simple maths problems.

Example of a ChatGPT session (paraphrased)

Quote

 

Me: How many ways are there of dealing 7 cards from a deck for 104 cards?
(The answer is 21,243,342,120 BTW)

ChatGPT: You can calculate this by using the formula 104!/(7!(104-7!))  (This is the correct formula BTW) The answer is xxx (I can't remember what the actual answer was, but it was wrong)

Me: No, that's wrong

ChatGPT: Sorry, you're right, the actual answer is yyy (still wrong)

Me: No, you're still wring.

ChatGPT: Sorry, you're right, the real answer is zzz (still wrong)

Me: No you're wrong. The answer is 21,243,342,120.

ChatGPT: Oh, I'm sorry, you're right.

 

A similar chat with Bing Chat was even worse. Bing insisted that answer was something like 1.7 Quintillion (which is 18 zeroes). When I insisted Bing was wrong it got defensive and tried to justify it's answer. I caught it in a blatant error, which it couldn't admit to. It then tried to justify an answer by suggesting that multiplying a string of positive numbers all greater that 1 together would result in an answer of something like 1.6x10^-315! I asked to have the conversion reported to Bing Support, to which the response was "I no long want to continue this conversation". Chat ended.

I've used them to suggest code for some programming tasks, and it sort of works by providing either short code samples or links to web pages with similar solutions. Barely better than a typical Google search.

On 5/11/2023 at 8:55 PM, macoman said:

This will blow your mind guys... chatgpt in a whole different level... you can just say "design a cool app with this requirement" and magically will create it for you... no coding require.

https://picoapps.xyz/metagpt https://carminho.com.pt/casino-online/gaming-club

Rather interesting  thing. I should try it.

I tried Bard ang Gpt and they both did mistakes. It's better to use them for text messages than coding

On 18/05/2023 at 02:38, pololy07 said:

Rather interesting  thing. I should try it.

I tried Bard ang Gpt and they both did mistakes. It's better to use them for text messages than coding

Remember that the link to that gpt is the first link: https://picoapps.xyz/metagpt

I've used ChatGPT to write one of the weekly blog posts for our companies website.

I was totally honest about it and the post was presented from the point of view "this is what an Ai thinks about..."

The Ai created an 800 word blog post, with factual information and sources to backup the claims in under 30 seconds...

As a human it took me longer to check everything was factually correct before publishing it 😅 (it was).

On 18/05/2023 at 05:53, InsaneNutter said:

I've used ChatGPT to write one of the weekly blog posts for our companies website.

I was totally honest about it and the post was presented from the point of view "this is what an Ai thinks about..."

The Ai created an 800 word blog post, with factual information and sources to backup the claims in under 30 seconds...

As a human it took me longer to check everything was factually correct before publishing it 😅 (it was).

I think AI will make the job of bloggers irrelevant in the future. You just need to ask AI and will write for you!

  • 2 months later...

Bard no, ChatGPT yes...

I asked it to rewrite my resume to fit & highlight my qualifications for a particular job title and it did a fairly good job, definitely better & faster than what I had already written :)

But then I asked it to write some complex formulae for a spreadsheet I am working on, and again, it was considerably faster, but was only about 75% correct, because it overlooked a few key arguments, which of course threw off the resulting calculations by quite a large amount...

So I give it an E for effort, and a real-world performance rating of 6/10 for now...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • Windows 8 and Vista were far worse. Both of those got marginally better at the very end. Just look at their adoption rates and support life-span. If those versions had as much social media in their time they would have ripped apart unmercifully.
    • I must admit, this is probably the only game at the moment where I can see that $80 price point being ok. The issue will be when other developers think they can get away with it with half of the work.
    • Google Wallet expands TSA PreCheck Touchless ID access to more travellers by Fiza Ali Google has announced that Google Wallet is becoming the first digital wallet to integrate with TSA PreCheck Touchless ID. It is a programme that lets eligible travellers move through participating airport security checkpoints using facial recognition instead of showing a physical ID or boarding pass. While the TSA PreCheck Touchless ID programme has been available for some time, using it hasn't always been straightforward. The programme currently operates at 65 airports across the US, but participation has largely depended on flying with a limited number of airlines. Travellers also had to upload passport information separately through participating carriers. Now, the tech giant's new integration is designed to remove some of those extra steps. With the update rolling out in the coming weeks, travellers with TSA PreCheck membership will be able to enrol in Touchless ID through Google Wallet and use the service with any of the 100 airlines participating in the programme. Rather than repeatedly submitting identification details, users can store a digital ID in Google Wallet and use it to streamline future trips. Setting up the feature is relatively straightforward as well. The process starts with users creating a digital ID in Google Wallet using their passport information. After checking in for a flight and saving a boarding pass to the app, eligible travellers will see a "Get started" option that directs them to the TSA enrolment process. Once users choose to share their ID pass and boarding pass information with the TSA for a specific trip, the agency will verify the enrolment. If approved, a TSA PreCheck Touchless ID indicator will appear on the boarding pass stored in Google Wallet, signalling that the traveller can use designated express Touchless ID lanes at participating airports. As privacy and security are likely to be key considerations for many travellers, Google says users must explicitly opt in before any information is shared with the TSA, and authentication is required through a device PIN, pattern, or biometric verification. The company also notes that digital IDs stored in Google Wallet remain encrypted and are kept on the user's device. For frequent flyers who already use TSA PreCheck, the new integration could remove a few more steps from the airport security process, making travel slightly faster and a little less cumbersome.
    • Even though MS had to sunset the Windows Subsystem for Android, you can apparently use BlueStacks to run Android in Windows now. I haven't tested this yet, so if anyone has any feedback, I'd love to hear it.
  • Recent Achievements

    • Dedicated
      Scoobystu earned a badge
      Dedicated
    • First Post
      Tom Schmidt earned a badge
      First Post
    • One Month Later
      D0nn13 earned a badge
      One Month Later
    • Rookie
      +ChiefOfNeo went up a rank
      Rookie
    • One Year In
      Tom Schmidt earned a badge
      One Year In
  • Popular Contributors

    1. 1
      +primortal
      456
    2. 2
      +Edouard
      177
    3. 3
      PsYcHoKiLLa
      123
    4. 4
      Michael Scrip
      82
    5. 5
      Xenon
      76
  • Tell a friend

    Love Neowin? Tell a friend!