Finding Damo

The story of a man, his job, two cats and the meaning of success.

Archive for the tag “AI”

ChatGPT

The first SAC for VCE Software Development is to solve a series of programming challenges using a programming language and GUI. I pose a series of challenges to assess the students’ knowledge of the software.

This year I’m working with Python and PyQT6. When the whole ChatGPT conversation started up I thought I’d see how well the AI could complete my course.

It turns out, quite well!

So the first challenge is to create a simple program that takes three grades and has buttons for average, sum and one that tells you whether the students passed or failed.

I thought about the language and gave ChatGPT this prompt:

Aquinas College has requested that I develop a prototype reporting system using PyQT6 and Python 3.10.  The GUI should take three scores (each out of 100) entered into a form. The form should also contain the following:

Sum button to display the sum of the three scores in a label when selected.

Average button to display the average of the three scores in a label when selected.

The program must ensure that data has been entered into all the score textboxes.

Pass/Fail button to display Pass if the sum of the scores is 150 or over, Fail to be displayed if the sum of the scores is less than 150, when clicked.

Clear button to clear all the textboxes and the label when selected.

Exit button for the user to exit the application when selected.

ChatGPT responded:

To implement the reporting system using PyQT6 and Python 3.10, follow these steps:

  1. Create the GUI using PyQT6 library, add three textboxes for the scores, and five buttons for sum, average, pass/fail, clear and exit.
  2. Connect the buttons with the appropriate functions using signals and slots mechanism.
  3. For the sum button, implement a function that reads the values from the three textboxes, adds them and displays the result in a label.
  4. For the average button, implement a function that reads the values from the three textboxes, calculates the average and displays the result in a label.
  5. For the pass/fail button, implement a function that reads the values from the three textboxes, adds them and checks if the sum is 150 or over. If yes, display “Pass” in the label, otherwise display “Fail”.
  6. For the clear button, implement a function that clears the textboxes and the label.
  7. For the exit button, implement a function that closes the application.
  8. Implement data validation for the three textboxes, to ensure that data has been entered into all the score textboxes.

This is a high-level overview of the steps to implement the reporting system. The actual implementation would require writing code and making use of PyQT6 and Python 3.10 features.

Cheeky me:

ChatGPT:

Yes, I can write the program for you. Here is an example code for the reporting system using PyQT6 and Python 3.10:

Lots of code later. I pasted into Python and ran it. It worked, but was a bit dodgy, so:

And it just worked!

I want to take this further. I could ask the AI to fiddle with the layout. I could try to add in images. I was going to ask it to add in internal documentation, but thought I’d given it enough to do.

I also want to have this conversation with the students. Explain that completing programming challenges in this way won’t help them learn the basics behind the code. But once they have the basics, this could be an awesome way to learn to debug code. It’s a great way for students to break down a problem (so they can give it to the ChatGPT).

I am actually excited about ChatGPT. We can only hope that it is an evolution for education rather than something the government/education departments just try to squash to keep the status quo.

I’m not overly optimistic:

Every Sparrow that Falls: the Final Chapter.

The voice in his head sounded desperate. But.

‘Who are you?’ Chuck asked. ‘What are you doing in my head?’ His mind was trying to convince him that everything was fine. But it wasn’t fine. He’d been shot at. His head was killing him. So was the radiation. And now he had voices in his head. And nobody ever thought that was a good sign.

Friend, his head told him. Here to help. Dying. Stop. Stop radiation.

‘Are you a min-min?’ he asked. He still didn’t quite trust the energy blobs. His only response was a sense of puzzlement. He felt puzzled. ‘I mean, one of the energy balls.’ And comprehension dawned on him.

Yes. Min-min. Dying!

Chuck felt a sense of urgency during that last statement. He realised with shock that Caitlin was right: the radiation was dispersing the energy balls. And the energy balls were alive. They were killing his guides. Had killed them, for all he knew.

Yes! Stop it!

‘Cait!’

‘Is it working? I can-’

‘Turn it off! Quickly! We made a mistake!’

‘You made a mistake!’ Caitlin retorted. ‘No, no, never mind,’ she continued as he tried to repeat his plea, ‘I am a professional. I turned it off as soon as you told me. Your skin won’t stop burning until we get you treated. And that should be soon. Get back to the ship.’

‘I’m coming,’ Chuck said. ‘You won’t believe this. I’m hearing voices.’

‘What won’t I believe?’ Cait asked.

‘Ha, ha. I’m on my way.’ Chuck signed out and prepared to run.

Go now, the voice said. Plenty of time.

The laser beam burned a hole in the back of his left boot as he hit the stairs running.

 

Back in the sunlight, Chuck slowed.

‘Who are you?’ he asked. There was a long pause. ‘Well?’

Wait, came the voice. Difficult. Looking for speech. Ah, there it is.

The change in his passenger’s language was immediate and obvious.

We are human, said the voice. It was female, from its cadence. It was like a voice remembered, one that had spoken only moments before, but it bypassed his ears. When your ancestors left the planet I am assuming you are from Earth originally?

Chuck went to nod, realised that might be completely useless, and said ‘Yes.’

When your ancestors left, she continued, many stayed behind. Some were mad. Most were useless. A very few were brilliant. We fought the machines and subjugated them. We concentrated on restoring the planet. The main obstacle to that was humanity itself. And then we realised that we could live forever without our bodies. It seemed like a fair trade. Immortality and a planet restored for the simple price of our flesh.

‘I don’t know,’ Chuck said. ‘I kind of enjoy my flesh.’ He looked back over his shoulder, remembering. ‘Wait! Your friends, the min-min. Did they survive?’

The moment these words formed in his mind to be spoken, a great wave of sadness hit him. Tears welled up in his eyes.

No, she said. They were dispersed.

‘You were close to them?’ he asked.

No. But emotions are always experienced strongly within the host. I cannot help it. I am sorry. The loss of the team is unfortunate. We rarely reproduce, especially with the machines being so belligerent. But no, I was not close to them. There is your ship!

Chuck’s eyes were drawn to the ship. It was a lot further away than he should have been able to recognise it. A pleasant side effect. Pleasant.

‘You’re female?’ he asked.

Yes, she said. Apologies. My name is Flip. Philipa Nias. I grew up in Melbourne the city you are in now and was lucky enough to be involved in the last conversions. I dont honestly know why we bothered to keep our gender-alignments. I think it is just a part of who I am. And you can stop thinking whatever youre thinking. I can feel your hormone levels rising.

Chuck blushed.

‘We’re almost there,’ he said. ‘What are you going to do? I need to go back to the ship for radiation treatment. I’ll need to make a proper report about my experiences since arriving, including the existence of a new life form or three. Are you coming with?’

Flip considered this. Off the planet? The radiation would disperse me.

‘I’ll ask Cait, but I think that we are shielded enough for you to come aboard safely.’

Something new to ride, Flip mused. Chuck felt himself being persuaded, which was an unusual sensation. They arrived at the ship. I think I should. Yes, that would indeed be an experience.

Feeling unusually happy, Chuck whistled as he ran through the pre-launch activities that would get him and his invisible passenger off the planet. As he was packing away the last of the supplies he had removed from the ship, his eye caught the corpse of a small bird. He tried to look away, but his gaze was fixed.

Wait, Flip said. Please. We need to bury him.

Chuck thought: ?

I owe him, Flip said. As I owe you. Please.

Nodding, Chuck dug a small hole in the soft earth and placed the sparrow gently into it. He covered the bird with soil and replaced the grass divot.

Do you still have religion? Flip asked him. The Bible? God?

‘Well,’ Chuck said. ‘Gods. There are a good number of them. But there is The One God. Not that anybody believes He’s the only one any more. He had a Bible.’

Not a single sparrow can fall to the ground without your Father knowing, it says. Thats what makes a Rider. Take care of the individuals and the world will be fine.

‘That sounds like a plan,’ Chuck said. ‘Who knows what will come from this meeting of two individuals?’

All thanks to that little guy, said Flip. Oh dear. Im starting to sound like you now. Before we go, I think theres one person that should come with us. She established a link and gave her friend the invitation. Chuck caught the gist of it through their shared thoughts.

 

‘Hang on, Captain who?’

 

Space: The final frontier.

Every Sparrow – Chapter 8

The glow of the energy balls gave off very little light as Chuck descended into the depths of the building. There was a low hum that he associated with machinery. Maybe the min-min, not able to communicate with him directly, had brought him to a computer of some kind, to attempt a link that way.

There was a sudden whine, the blobs scattered and a beam of red light lanced through the darkness and burned a line across his scalp.

Or, he thought, dropping to the ground, they couldnt kill me using their microwaves so they decided to try a more direct approach.

The stench of burning hair filled his nostrils and he slapped at his head. The whine repeated and he rolled desperately to one side, narrowly avoiding a second deadly beam.

‘Stop shooting at me!’ he yelled, crawling to his feet and diving to safety in the darkness. Unfortunately, between his current location and safety was a steel cabinet, which he struck hard with his forehead. The third shot missed him because of the erratic movement of a semi-concussed man.

As the whine rose in tempo for the fourth time, he found the edge of the cabinet and crawled around the side. He had no idea where the beam was coming from, or whether he was still a target from this new vantage point, but his head felt exactly as if he had just dived headlong into a metal cabinet, and his thoughts were scattered.

The whine of the beam remained at a mosquito-buzz pitch for a moment and then the weapon powered down.

Chuck slumped against the cool metal of the cabinet and waited for the world to stop spinning. His brain seemed to be still rattling inside his head and to make matters worse, his skin was itching again.

All around him was the high-pitched meaningless chatter of the coloured blobs. They must be telling the shooter where he was hiding. He had to get back upstairs, to the relative safety of a world he never thought he’d call ‘alien’.

‘Scout to ship. Cait, come in. I’m in trouble!’

‘How did you manage that?’ Cait asked.

‘Ambushed. Trapped. Something shooting at me,’ Chuck said, trying to focus his thoughts. ‘My hair is on fire. The min-min sent me into a trap. I’ve got to get out!’

‘Holy hells. You’re not kidding, are you?’

‘Why would you think that I was?’ Chuck asked, incredulous.

‘Oh, I don’t know. Does “Aargh!’ ring a bell?’ Cait asked.

‘Fair enough. Look, I’m going to make a break for it. Can you do anything from up there?’

‘I don’t think so, but- wait. If I narrow the scanner beam onto your location, I think I can flood the very immediate area with radiation.’

Chuck tried to get his rattled head to process that statement.

‘You’re going to irradiate me?’ he asked. ‘And that’s what you call “helping”?’

‘It’s a slim chance, but there’s a possibility that it could disrupt those “min-mins”, which will mean you can get back to the ship without being followed.’

‘And if it gets dark, I won’t need a torch, because I will glow in the dark!’

‘Don’t be a baby. We have anti-rad treatments up here,’ Caitlin said. ‘I think – yes. There it is. Say when.’

Chuck could see the faint glow coming down from the top of the stairs. It was only a few long strides away to the first step. He was well into the room before his attacker fired the first time. He should be fine.

‘OK, go,’ he said. He pulled himself into a crouch. His skin was prickling, and then-

‘Right. Done it,’ came the voice from the ship. The prickle turned into a burn. At the edge of his range of hearing, the high-pitched chatter had turned into a squeal.

Got em, he thought. He stood. The whine of the laser started up again. Chuck spun but as he readied to run, his legs buckled, and the pain in his skull doubled.

Wait, said a voice in his head. You must stop! Make it stop!

‘That’s not me!’ Chuck muttered.Cait to the rescue

 

Post Navigation

%d bloggers like this: