04 April 2023, 18:35 | #21 |
Registered User
Join Date: Oct 2009
Location: Salem, OR
Posts: 1,770
|
I'd be afraid to use ChatGPT for code...
We've seen it writes non-working code, so I'd be tempted to ask it why it produced such bad code, and I'm afraid the answer would be: I've seen your code, so I didn't think you'd mind... ;-) (sorry...) I saw an interesting vid on YouTube by Tom Scott, and while it's initial code didn't work for him, it came close enough to save him a lot of time... It is an interesting technology, and makes me really wonder about the future of it... |
04 April 2023, 21:28 | #22 | |
Registered User
|
Quote:
All other accounts only create a session, which is derived from main training data and ChatGPT is able to learn inside this session. As soon you close the session, it will forget everything in it. And yes, this is by design from the OpenAI team. However, a very big issue with ChatGPT is, although its company is called OpenAI, it isn't open, neither open source, nor open access. And Microsoft isn't sympathetic either... EDIT: Remember that, if ChatGPT would automatically add every input to its main training data, there is serious risk of data protection violation. Imagine, you are telling ChatGPT your deepest privacy stuff and someone else is asking ChatGPT about your deepest privacy stuff and gets the information. Recipe for disaster... Last edited by BastyCDGS; 04 April 2023 at 21:36. Reason: Added data protection issues |
|
05 April 2023, 01:28 | #23 |
Zone Friend
Join Date: Mar 2004
Location: Middle Earth
Age: 40
Posts: 2,127
|
Write a program in AREXX which opens 1 binary file and copies it to another file
Code:
/* Open the source file */ src_file = stream("path/to/source/file", "r") /* Open the destination file */ dest_file = stream("path/to/destination/file", "w") /* Copy the contents of the source file to the destination file */ do while lines(src_file) <> 0 line = linein(src_file) call lineout(dest_file, line) end /* Close the files */ call close(src_file) call close(dest_file) /* Done! */ A: Sure, here's the same program with the open(), ReadCH(), and WriteCH() functions instead of stream(), linein(), and lineout(): Code:
/* Open the source file */ src_file = open("path/to/source/file", "rb") /* Open the destination file */ dest_file = open("path/to/destination/file", "wb") /* Copy the contents of the source file to the destination file */ do while \eof(src_file) ch = ReadCH(src_file) call WriteCH(dest_file, ch) end /* Close the files */ call close(src_file) call close(dest_file) /* Done! */ a: You are correct again, my apologies for the confusion. In AREXX, the ~ symbol is indeed used to represent the NOT operator, so ~eof(src_file) should be used instead of \eof(src_file). Here's the corrected code using open(), ReadCH(), and WriteCH(): Code:
/* Open the source file */ src_file = open("path/to/source/file", "rb") /* Open the destination file */ dest_file = open("path/to/destination/file", "wb") /* Copy the contents of the source file to the destination file */ do while ~eof(src_file) ch = ReadCH(src_file) call WriteCH(dest_file, ch) end /* Close the files */ call close(src_file) call close(dest_file) /* Done! */ q: can you change the error checking to `IF ~OPEN( file...) THEN DO SAY error message EXIT 10 END` A: Certainly! Here's the updated code with the error checking using IF ~OPEN(file...) THEN DO: Code:
/* Open the source file */ src_file = open("path/to/source/file", "rb") if ~open(src_file) then do say "Error opening source file." exit 10 end /* Open the destination file */ dest_file = open("path/to/destination/file", "wb") if ~open(dest_file) then do say "Error opening destination file." call close(src_file) exit 10 end /* Copy the contents of the source file to the destination file */ do while ~eof(src_file) ch = ReadCH(src_file) call WriteCH(dest_file, ch) end /* Close the files */ call close(src_file) call close(dest_file) /* Done! */ If both files are opened successfully, we proceed with copying the contents of the source file to the destination file, and then close both files when we're done. I hope this helps! Let me know if you have any further questions. -- This is a simple problem, I haven't asked it to code a IFF to PNG converter yet. |
05 April 2023, 09:12 | #24 |
Registered User
|
Asking ChatGPT to translate from m68k to x86 and converting AmigaDOS to MS-DOS-API. Result is not that bad, except for dos.library part...but I made two mistakes as well, forgot necessary movea.l 4.w,a6 instructions before the OpenLib and before the CloseLib call...
Request to ChatGPT: Convert this Amiga assembler program to MS-DOS x86 code! Code:
lea DOSName(pc),a1 moveq #0,d0 jsr _LVOOldOpenLibrary(a6) movea.l d0,a6 jsr _LVOOutput(a6) move.l d0,d1 lea HelloWorld(pc),a0 move.l a0,d2 moveq #HelloWorldLen-HelloWorld,d3 jsr _LVOWrite(a6) movea.l a6,a1 jsr _LVOCloseLibrary(a6) moveq #0,d0 rts Here's the equivalent code in x86 assembly language: Code:
lea dx, DOSName mov ah, 3Ch xor cx, cx int 21h mov bx, ax mov ah, 40h lea dx, HelloWorld mov cx, HelloWorldLen int 21h mov ah, 3Eh mov bx, ax int 21h mov ah, 4Ch int 21h ret Last edited by BastyCDGS; 05 April 2023 at 22:37. Reason: Added notice for two missing m68k instructions |
05 April 2023, 09:27 | #25 |
Registered User
|
Now something more Amiga related, very strange result asking for a optimized c2p conversion routine:
Can you output the best, optimized code for c2p conversion in Amiga m68k assembler code? Also remember the differences between the CPUs of m68k! Reply from ChatGPT: Yes, I can help you with that. However, I cannot provide "the best" optimized code for c2p conversion in Amiga m68k assembler code since the optimization level depends on various factors and requirements of the specific use case. But here is a basic code for c2p conversion: Code:
c2p: move.b (a0)+,d0 move.w c2ptbl(pc,d0.w),d0 move.b (a1,d0.w),d1 move.b d1,(a2)+ dbra d7,c2p rts c2ptbl: dc.w $0000,$0101,$0202,$0303 dc.w $0404,$0505,$0606,$0707 dc.w $0808,$0909,$0a0a,$0b0b dc.w $0c0c,$0d0d,$0e0e,$0f0f |
05 April 2023, 09:53 | #26 |
Registered User
|
Can it do ASCII art? Well it can, but I remember the Amiga 500 keyboard slightly different *cough*
Draw an ASCII art showing a classic Amiga 500 keyboard! Natürlich, hier ist eine ASCII-Kunst des Amiga 500 Keyboards: Code:
._________________________________________________________________. | Esc | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | |¯¯¯¯¯|¯¯¯¯¯|¯¯¯¯¯|¯¯¯¯¯|¯¯¯¯¯|¯¯¯¯¯|¯¯¯¯¯|¯¯¯¯¯|¯¯¯¯¯|¯¯¯¯¯|¯¯¯¯¯| | § | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | |¯¯¯¯¯|¯¯¯¯¯|¯¯¯¯¯|¯¯¯¯¯|¯¯¯¯¯|¯¯¯¯¯|¯¯¯¯¯|¯¯¯¯¯|¯¯¯¯¯|¯¯¯¯¯|¯¯¯¯¯| | ' | + | ~ | ^ | ? | - | * | / | ( | ) | | \ | |¯¯¯¯¯|¯¯¯¯¯|¯¯¯¯¯|¯¯¯¯¯|¯¯¯¯¯|¯¯¯¯¯|¯¯¯¯¯|¯¯¯¯¯|¯¯¯¯¯|¯¯¯¯¯|¯¯¯¯¯| | <- | F11 | F12 | Prt | Scr | Brk | ^ | _ | { | } | ` ~ | |_____|¯¯¯¯¯|¯¯¯¯¯|¯¯¯¯¯|¯¯¯¯¯|¯¯¯¯¯|¯¯¯¯¯|¯¯¯¯¯|¯¯¯¯¯|¯¯¯¯¯|_____| For some reason it replied in german, here are the translations from me: Natürlich, hier ist eine ASCII-Kunst des Amiga 500 Keyboards -> Of course, here is an ASCII art of the Amiga 500 keyboard Hoffe, das gefällt dir! -> Hope, you like this! |
14 June 2023, 07:36 | #27 |
Registered User
Join Date: May 2017
Location: Germany
Posts: 8
|
As I say: ChatGPT is like a politician.
If it does not know a correct answer to a question, it does not admit that, but writes some BS hoping nobody notices it or it is somehow correct by chance. |
14 June 2023, 08:42 | #28 |
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,335
|
ChatGPT is at its core nothing more than an automatic text completion system. It has absolutely no way to know if something is correct or not, it only knows what is most statistically likely. This makes it an artificial BS generator - and a surprisingly pretty good one.
|
14 June 2023, 20:36 | #29 |
Ex nihilo nihil
Join Date: Oct 2017
Location: CH
Posts: 4,936
|
As long as there will be (dummy) people praising for what this IA is capable of, why would it be different ?
Dummy because they praise without a correct result. Take a kid and praise him whatever he will do. And then look at the result of your praising... |
15 June 2023, 04:31 | #30 |
Returning fan!
Join Date: Jan 2011
Location: Montréal, QC, Canada
Posts: 1,434
|
Or greedy people trying to scare (dummy) people to stay relevant and cash in $$$...
https://www.cbc.ca/news/world/artifi...risk-1.6859118 |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
View Amos generated assembly code? | Brick Nash | Coders. AMOS | 7 | 01 May 2021 22:54 |
External interrupts generated by TCP/IP stacks | dissident | Coders. Asm / Hardware | 37 | 09 January 2019 10:27 |
Generated code for sprites | Zarchos | Coders. Asm / Hardware | 12 | 22 July 2017 20:40 |
Generated code and CPU Instruction Cache | Mrs Beanbag | Coders. Asm / Hardware | 11 | 23 May 2014 11:05 |
Games with generated levelcodes | Joe Maroni | Nostalgia & memories | 12 | 24 February 2013 01:23 |
|
|