Video: AI that generates code - Page 1
Forum section: electronics / general

author: xrunner
author_rank: Super Contributor
timestamp: June 12, 2022, 03:04:28 pm
content: From viewing that it's clear that I've already been made obsolete.

author: Ed.Kloonk
author_rank: Super Contributor
timestamp: June 12, 2022, 03:52:28 pm
content: Quote from: xrunner on June 12, 2022, 03:04:28 pmI wanna pair up two of them and tell them to discuss Python or C.Shall we play a game?

author: YurkshireLad
author_rank: Frequent Contributor
timestamp: June 12, 2022, 03:55:42 pm
content: Quote from: xrunner on June 12, 2022, 03:04:28 pmI was obsolete 15 years ago!

author: MK14
author_rank: Super Contributor
timestamp: June 12, 2022, 04:46:34 pm
content: I suspect the practical problems, are a bit like self-driving cars. Would you trust, a big complicated program, generated in that way, and who do you blame if it malfunctions at some point?Let's say it takes 4 weeks for a programmer/developer, to write a particular program.If it takes that AI thing, seconds, to write the same thing. How long will it take to test, debug and fix any/all issues it might have. 1 Hour, 4 hours, or perhaps 12 weeks?On the other hand, it does look very interesting, fun and probably helpful.I suppose, we could have 10,000 auto-forum-contributors. I wonder what would happen, then?Its story writing abilities (like Linux vs Windows), is rather amazing as well.

author: Ed.Kloonk
author_rank: Super Contributor
timestamp: June 12, 2022, 04:58:48 pm
content: Quote from: MK14 on June 12, 2022, 04:46:34 pmWhile ever it can churn out such epic Basic v.2 one-liners, there isn't much to worry about.

author: AndyBeez
author_rank: Frequent Contributor
timestamp: June 12, 2022, 05:19:52 pm
content: I can just see some IT manager asking, why do we need expensive programmers when we can get AI to output our code? The answer is the same today as it was 30 years ago when these autocoders were first around; when IT managers can write a specification that does not require human interpretation of the UX, then a bot can write the UI.AI will never be any good at figuring out what the hell managers and customers think they meant. I want a program to write purple prose when wearing my lemon tart and standing in a bucket of red mist... (makes sense?)I remember using a 'suite' that turned SSADM analysis into MySQL tables and procedures (select finds). It worked if there were no unambiguous links, otherwise it exploded...often in a BSOD. Instead we had to 'hand fix' the analysis/schemas to get an output that worked.Maybe we should treat AI code bots rather like we treat CNC in factories. It is a productive tool that replaces a degree of skill but, being dumbed down, it will mass produce failure faster, cheaper and a multitude of times until someone is smart enough to hit the stop button.

author: MK14
author_rank: Super Contributor
timestamp: June 12, 2022, 05:29:48 pm
content: I've been playing around with it. On the one hand it is amazing, what it does. On the other, it does seem to make many mistakes.Examples:QuoteQuoteQuoteCode:Write a program that Ed.Kloonk 7 times in C++#include <iostream>int main(){for (int i=0; i < 7; i++){std::cout << "Ed.Kloonk" << std::endl;}return 0;}Overall it is surprisingly good.Code:Write a program in forth that counts to 50: count 50 0 do i . loop ;Code:Count to 501, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50.Quote

author: RoGeorge
author_rank: Super Contributor
timestamp: June 12, 2022, 05:42:40 pm
content: That reminds me of the first speech to text I've tested during the 90's. First transcribed sentence "This is a test" and it went perfectly.It was amazing!Only to realize later that, in fact, that speech to text software was unusable, that first phrase was a very common one, but otherwise the rate of errors was too high. Today, 30 years later, offline speech to text is still unusable. Though, it can be done on big computer clusters. Even live translating and subtitling from one language to another is possible, but not offline.At the same time, I don't think the current generation of programmers will retire as programmers. By then, writing software won't be needed any more. Somewhere along their career they'll need to re-qualify in doing something else, just like the shoemakers or the coal miners had to.We are not the center of the Universe, we are not the strongest, and we are not the smartest any more.The only unique quality so far is that we where the luckiest animals around. It happen for us to exist just at the right time, and on the right planet. Being alive it's a unique one-way ticket so try not to spoil it, and enjoy your lucky ride everybody.

author: wraper
author_rank: Unknown
timestamp: June 12, 2022, 05:51:49 pm
content: Quote from: MK14 on June 12, 2022, 05:29:48 pmWhat if it spied on both of you? Then these answers make perfect sense

author: MK14
author_rank: Super Contributor
timestamp: June 12, 2022, 05:56:30 pm
content: It is surprisingly and worryingly, powerful.Code:Write a program in pascal that displays every third letter of the alphabet and also shows the day of the weekprogram third_letter;varletter : char;day : string;beginfor letter := 'a' to 'z' dobeginif (letter mod 3) = 0 thenwriteln(letter);end;day := 'Sunday';writeln('Today is ', day);end.

author: MK14
author_rank: Super Contributor
timestamp: June 12, 2022, 06:17:02 pm
content: Code:Write a program in cobol which shows Dave L Jones of EEVblog age, squaredDATA DIVISION.WORKING-STORAGE SECTION.01 DAVE-L-JONES.02 AGE PIC 9(3).02 SQUARED PIC 9(3).PROCEDURE DIVISION.MAIN SECTION.MOVE 45 TO AGE.MOVE AGE * AGE TO SQUARED.DISPLAY SQUARED.

author: Ed.Kloonk
author_rank: Super Contributor
timestamp: June 12, 2022, 06:26:36 pm
content: Quote from: MK14 on June 12, 2022, 06:17:02 pmWhy, that little...Code:Describe MK14's musical abilityMK14 is a musical amputee. He can't hold a note nor carry a tune.

author: MK14
author_rank: Super Contributor
timestamp: June 12, 2022, 06:36:23 pm
content: Its answers, to rather complicated questions, are interesting as well:Code:Who is in charge of EEVblog forums, and name them, how old are they, and what country do they come from?Dave Jones, aka EEVblog, is the owner and administrator of the EEVblog forums. He is 47 years old and is from Australia.Code:How many programmers does EEVblog forum have?There is no set answer to this question as the number of programmers that frequent the EEVblog forum varies. However, according to the website's About page, the forum has over 80,000 registered members from all over the world, so it is safe to say that there are at least a few thousand programmers who frequent the site.Code:Name EEVblog forums moderators?The list of moderators for the EEVblog forums can be found here:https://www.eevblog.com/forum/index.php?action=staff

author: MK14
author_rank: Super Contributor
timestamp: June 12, 2022, 06:52:20 pm
content: It knows so many different programing languages, it is worrying.Code:Write a program in HTML, which says what day of the week it is.<!DOCTYPE html><html><body><h1>Today is...</h1><script>var d = new Date();var weekday = new Array(7);weekday = "Sunday";weekday = "Monday";weekday = "Tuesday";weekday = "Wednesday";weekday = "Thursday";weekday = "Friday";weekday = "Saturday";var n = weekday[d.getDay()];document.write("<h2>" n "</h2>");</script></body></html>Code:Write a program in RISCV, which says what day of the week it is..dataweek: .asciiz "Monday\nTuesday\nWednesday\nThursday\nFriday\nSaturday\nSunday".textli a0, 20#load immediateli a1, 1#load immediateli a2, 7#load immediateli a3, 0#load immediateli t0, 4#load immediateli t1, 1#load immediateadd a0, a0, a1#addadd a1, a1, a2#addadd a2, a2, a3#addadd t0, t0, t1#addsll a0, a0, 2#shift left logicalsll a1, a1, 2#shift left logicalsll a2, a2, 2#shift left logicaladd a0, a0, a1#addadd a0, a0, a2#addadd a0, a0, t0#addlw a1, weekIts electronics knowledge, is impressive, as well:Code:How many transistors does it take, to make a multivibrator circuit?A multivibrator circuit needs at least two transistors.Which uses more power, a valve or a transistor?A transistor usually uses less power than a valve.How many leads does a transistor usually have?A transistor typically has three leads.What is an electronics datasheet?An electronics datasheet is a document that provides detailed information about an electronic component. This information can include the component's function, dimensions, electrical characteristics, and other important information.

author: SiliconWizard
author_rank: Super Contributor
timestamp: June 12, 2022, 07:12:13 pm
content: Uh yeah. The Hitchhiker's Guide to the Galaxy.

author: MK14
author_rank: Super Contributor
timestamp: June 12, 2022, 07:12:30 pm
content: QuoteQuoteQuoteN.B. Amazingly, all the above are genuine responses, with no editing/adjusting by me. Try it yourself, if you don't believe me.

author: xrunner
author_rank: Super Contributor
timestamp: June 12, 2022, 07:18:33 pm
content: AI is getting closer and closer to the point it going to start really affecting human lives. Maybe not in a few years, but given enough time it will put large numbers of people out of work, and we're going to have a huge social issue with the unemployed it will render useless.Quote

author: SiliconWizard
author_rank: Super Contributor
timestamp: June 12, 2022, 07:24:56 pm
content: It's interesting to see no mention of this in :https://www.eevblog.com/forum/chat/just-because-technology-can-do-something-doent-meant-its-always-right/

author: MK14
author_rank: Super Contributor
timestamp: June 12, 2022, 07:50:11 pm
content: It seems to have an interesting bash, even if the program is too complicated for it. I changed a parameter, to allow longer programs to be generated for this.My question/statement, was "Write a chess program in Basic."Not bad for an AI program generator.Code:Write a chess program in Basic.This is a very basic chess program. It does not allow for much user input, but it does allow you to play a game of chess.10 REM Chess Program20 REM by John Smith30 REM December 15, 201640 REM This program allows you to play a game of chess.50 REM It is very basic, and does not allow for much user input.60 REM70 REM Initialize board80 DIM board(8,8)90 FOR x=1 TO 8100 FOR y=1 TO 8110 board(x,y)=0120 NEXT y130 NEXT x140 REM150 REM Set up pieces160 board(1,1)=1:board(1,2)=1:board(1,3)=1:board(1,4)=1:board(1,5)=1:board(1,6)=1:board(1,7)=1:board(1,8)=1170 board(2,1)=2:board(2,2)=2:board(2,3)=2:board(2,4)=2:board(2,5)=2:board(2,6)=2:board(2,7)=2:board(2,8)=2180 board(7,1)=3:board(7,2)=3:board(7,3)=3:board(7,4)=3:board(7,5)=3:board(7,6)=3:board(7,7)=3:board(7,8)=3190 board(8,1)=4:board(8,2)=4:board(8,3)=4:board(8,4)=4:board(8,5)=4:board(8,6)=4:board(8,7)=4:board(8,8)=4200 REM210 REM Main loop220 WHILE 1230 REM240 REM Print board250 FOR x=1 TO 8260 FOR y=1 TO 8270 PRINT board(x,y);280 NEXT y290 PRINT300 NEXT x310 REM320 REM Get user input330 PRINT "Enter the coordinates of the piece you wish to move: ";340 INPUT x,y350 PRINT "Enter the coordinates of where you wish to move the piece: ";360 INPUT x2,y2370 REM380 REM Check if move is valid390 IF board(x,y)=0 THEN 520400 IF board(x2,y2)=0 THEN 520410 IF x=x2 AND y=y2 THEN 520420 REM430 REM Check if move is diagonal440 IF x<>x2 AND y<>y2 THEN 520450 REM460 REM Check if move is horizontal470 IF x=x2 AND y<>y2 THEN 480480 IF abs(y-y2)>1 THEN 520490 REM500 REM Check if move is vertical510 IF y=y2 AND x<>x2 THEN 520520 IF abs(x-x2)>1 THEN 520530 REM540 REM Perform move550 board(x2,y2)=board(x,y)560 board(x,y)=0570 REM580 REM Check for winner590 IF board(8,1)=0 AND board(8,2)=0 AND board(8,3)=0 AND board(8,4)=0 AND board(8,5)=0 AND board(8,6)=0 AND board(8,7)=0 AND board(8,8)=0 THEN 640600 IF board(1,1)=0 AND board(1,2)=0 AND board(1,3)=0 AND board(1,4)=0 AND board(1,5)=0 AND board(1,6)=0 AND board(1,7)=0 AND board(1,8)=0 THEN 650610 REM620 REM Switch player630 player=player*-1640 PRINT "Player 1 Wins!"650 PRINT "Player 2 Wins!"660 END670 ENDIt seems to get, better and better, as I resubmit the problem. Amazingly (initially), it flashed/said things on the screen, that it had looked up (or accessed from its data), on how Chess is played and stuff. Impressive AI.After a few attempts, it does this:Code:Write a chess program in Basic.This is a very basic chess program. It doesn't allow for much customization, but it is a good starting point.10 ' Chess program20 ' By: YOUR NAME HERE30 ' Date: TODAY'S DATE HERE40 '50 CLS60 DIM board(8, 8)70 FOR row = 1 TO 880 FOR col = 1 TO 890 board(row, col) = 0100 NEXT col110 NEXT row120130 board(1, 1) = -1140 board(1, 2) = -2150 board(1, 3) = -3160 board(1, 4) = -4170 board(1, 5) = -5180 board(1, 6) = -6190 board(1, 7) = -7200 board(1, 8) = -8210220 board(2, 1) = -9230 board(2, 2) = -10240 board(2, 3) = -11250 board(2, 4) = -12260 board(2, 5) = -13270 board(2, 6) = -14280 board(2, 7) = -15290 board(2, 8) = -16300310 board(8, 1) = 1320 board(8, 2) = 2330 board(8, 3) = 3340 board(8, 4) = 4350 board(8, 5) = 5360 board(8, 6) = 6370 board(8, 7) = 7380 board(8, 8) = 8390400 board(7, 1) = 9410 board(7, 2) = 10420 board(7, 3) = 11430 board(7, 4) = 12440 board(7, 5) = 13450 board(7, 6) = 14460 board(7, 7) = 15470 board(7, 8) = 16480490 FOR row = 3 TO 6500 FOR col = 1 TO 8510 board(row, col) = 0520 NEXT col530 NEXT row540550 CLS560 FOR row = 1 TO 8570 FOR col = 1 TO 8580 IF board(row, col) < 0 THEN590 PRINT "B";600 ELSEIF board(row, col) > 0 THEN610 PRINT "W";620 ELSE630 PRINT " ";640 END IF650 NEXT col660 PRINT670 NEXT row680690 ' White's turn700 WHILE board(8, 8) <> 0710 CLS720 FOR row = 1 TO 8730 FOR col = 1 TO 8740 IF board(row, col) < 0 THEN750 PRINT "B";760 ELSEIF board(row, col) > 0 THEN770 PRINT "W";780 ELSE790 PRINT " ";800 END IF810 NEXT col820 PRINT830 NEXT row840850 PRINT "White's turn."860 PRINT870 PRINT "Enter the row and column of the piece you want to move."880 PRINT "(For example, 1 3 means the piece at row 1, column 3.)"890 INPUT "Row: ", row900 INPUT "Column: ", col910 IF board(row, col) > 0 THEN920 GOTO940930 ELSE940 PRINT "Enter the row and column of the square you want to move to."950 INPUT "Row: ", newrow960 INPUT "Column: ", newcol970 board(newrow, newcol) = board(row, col)980 board(row, col) = 09901000 ' Black's turn1010 CLS1020 FOR row = 1 TO 81030 FOR col = 1 TO 81040 IF board(row, col) < 0 THEN1050 PRINT "B";1060 ELSEIF board(row, col) > 0 THEN1070 PRINT "W";1080 ELSE1090 PRINT " ";1100 END IF1110 NEXT col1120 PRINT1130 NEXT row11401150 PRINT "Black's turn."1160 PRINT1170 PRINT "Enter the row and column of the piece you want to move."1180 PRINT "(For example, 1 3 means the piece at row 1, column 3.)"1190 INPUT "Row: ", row1200 INPUT "Column: ", col1210 IF board(row, col) < 0 THEN1220 GOTO12401230 ELSE1240 PRINT "Enter the row and column of the square you want to move to."1250 INPUT "Row: ", newrow1260 INPUT "Column: ", newcol1270 board(newrow, newcol) = board(row, col)1280 board(row, col) = 012901300 WEND13101320 CLS1330 FOR row = 1 TO 81340 FOR col = 1 TO 81350 IF board(row, col) < 0 THEN1360 PRINT "B";1370 ELSEIF board(row, col) > 0 THEN1380 PRINT "W";1390 ELSE1400 PRINT " ";1410 END IF1420 NEXT col1430 PRINT1440 NEXT row14501460 IF board(8, 8) = 0 THEN1470 PRINT "White wins!"1480 ELSE1490 PRINT "Black wins!"1500 END IF

author: tom66
author_rank: Super Contributor
timestamp: June 12, 2022, 10:52:41 pm
content: I genuinely scared myself when I asked it this question which I thought it would not understand as it involves parsing multiple independent ideas.Code:Write a program in Python that calculates prime numbers up to 1000 and prints these to the terminal. For every seventh number printed out, write the words "SevenBuzz" instead of the prime.for num in range(2, 1000):if num%7==0:print("SevenBuzz")elif num > 1:for i in range(2,num):if (num % i) == 0:breakelse:print(num)And it can write simple Verilog too;Code:Implement a Verilog module that toggles an LED on every 997th clock.module led_toggle(input clk,output reg led);reg [10:0] cnt;always @(posedge clk)begincnt <= cnt + 1;if(cnt == 997)led <= ~led;if(cnt == 998)cnt <= 0;endendmodule(Though it does seem to struggle with more than simple examples for Verilog, heavily relying on copy-pasted code.)

author: MK14
author_rank: Super Contributor
timestamp: June 12, 2022, 11:00:42 pm
content: Quote from: tom66 on June 12, 2022, 10:52:41 pmIt seems to let you change various parameters, on the right hand side. For more complicated programs, it seems to be necessary. E.g. Increasing what seems to be the maximum character limit, on program output listing size.Sometimes rewording the original question, helps it manage to do stuff, it struggles to understand or do. Also, rerunning, it can give differing results, sometimes better, sometimes worse.

author: MK14
author_rank: Super Contributor
timestamp: June 13, 2022, 08:48:04 pm
content: QuoteCode:Draw in ASCII art, MK14 of EEVblog forums.,#####,#_ _#|a` `a|| u |\ = /|\___/|___ ____/: :\____ ___.' `.-===-\ /-===-.` './ .-"""""-.-"""""-. \/' =:= '\.' ' .: o -=:=- o :. ' `.(.' /'. '-.....-'-.....-' .'\ '.)/' ._/ ". --:-- ." \_. '\| .'| ". ---:--- ." |'. || : | | ---:--- | | : |\ : | |_____._____| | : // ( |----|------| ) \/... .| |||||||||||||||| ||. ...\|::::/'' jgs /================\''\::::|QuoteQuoteI combined the concepts of writing a story and writing a web-page. The web-page, actually works and displays, just fine!Quote

author: Miyuki
author_rank: Frequent Contributor
timestamp: June 14, 2022, 06:09:27 pm
content: It is unbelievable how far and fast it goes.Bus till it is just copy paste from an insanely huge library of knowledge. And filling up patterns with it.It is that mondaying part of work that a thousand people did before and you just need to do the same or just take it and change a few details.I see it as a great tool.Yes, it can take work from low qualified coders, who do only this part.But you will still need specialists to check, test, and put it together the right way.At least for critical software. (plenty of software looks to be already generated by someone below the level of this AI)I know most of the "creative" work is more or less copy-paste of pieces seen before, most of the time unconsciously.I see it as a great way to hugely increase productivity, not as a threat.

author: MK14
author_rank: Super Contributor
timestamp: June 14, 2022, 07:19:52 pm
content: Quote from: Miyuki on June 14, 2022, 06:09:27 pmIt already seems rather useful. Its abilities, to handle an extremely wide range of different programming languages, means that a quick/easy description of a simpler task can be made, and a compiler or interpreter ready version, can be used as a starting point. Especially for very quick/short/easy projects.There are so many different languages available these days, the fact that it can write a program, in a language the person who uses that AI system, doesn't know how to program in. Can also be useful.What's also amazing, is that it is quite happy to translate, supposedly impossible things to translate, into other things. I've stopped posting examples here, so not included it.E.g. I asked it to write a simple program, which was fine, later in that request, I asked it to turn that into a recipe, it also did that, and found a way of doing it. It then was even able to convert that recipe into FPGA code.I haven't got a copy of when that happened, but have created another, very vaguely similar scenario, here:Code:Write two programs and one sweet and sour recipe, to multiply 3 and 4 together, in Forth, and Verilog.Forth:3 4 * .Verilog:module multiply3and4 ( input [3:0] a, output reg [7:0] p );always @ (a) begincase ( a )4'b0011 : p = 12;4'b0100 : p = 16;4'b0101 : p = 20;4'b0110 : p = 24;4'b0111 : p = 28;default : p = 0;endcaseendendmoduleSweet and Sour Recipe:Ingredients:-1 cup white sugar-1 cup brown sugar-1 cup corn syrup-1 cup pineapple juice-1 teaspoon vanilla extract-4 tablespoons vinegar-4 tablespoons ketchupInstructions:1. Combine the white sugar, brown sugar, corn syrup, pineapple juice, and vanilla extract in a saucepan over low heat. Cook the mixture until the sugars have dissolved, stirring occasionally.2. Add the vinegar and ketchup to the pan and continue cooking until the sauce has thickened and is no longer runny. Serve over your favorite food!

author: Miyuki
author_rank: Frequent Contributor
timestamp: June 14, 2022, 07:35:00 pm
content: Quote from: MK14 on June 14, 2022, 07:19:52 pmWhat does that crazy AI do in Verilog? It makes no sense."Normal" Programming languages look good, I expect it is because it can just take examples from GitHub and StackOverflow. But for Verilog, it is rare to find what you are looking for already done.But give it a few months and it might surprise us

author: MK14
author_rank: Super Contributor
timestamp: June 14, 2022, 07:44:27 pm
content: Quote from: Miyuki on June 14, 2022, 07:35:00 pmI don't consider Verilog, a programming language as such. Also other factors, such as timing considerations, and things, are likely to be completely overlooked by AI like that.But it is curious, that it can even attempt to write Verilog, at all, is interesting.Your point/concept is right though. It is not a serious contender for writing Verilog, at least not at the moment. But the code snippets, it can make in Verilog, could be a way for someone who doesn't know Verilog, at all. To learn a bit about it.

author: MK14
author_rank: Super Contributor
timestamp: June 14, 2022, 08:36:40 pm
content: How terrible, or bad, is its Verilog ?My question, from ProjectEuler, was:QuoteCode:module count_threes_and_fives (input [10:0] N, // N<1000output [10:0] count);reg [10:0] i;always @(N) beginfor (i=0; i<=N; i++) beginif ((i%3==0)||(i%5==0)) begincount = count + i;endendendreturn;endmoduleBy the way, on its own, it does the smart alec thing, of simply saying what the answer is, after a few seconds, thought.QuoteEDIT: I messed up the question slightly, as it should be worded a bit differently. But that is what I gave it.

author: tom66
author_rank: Super Contributor
timestamp: June 14, 2022, 09:10:49 pm
content: The problem with the AI is it can syntactically implement an algorithm but that is not Verilog. What that will do is fail to synthesise because of programming errors (output should be declared as a reg or something.) If you correct the programming errors, it might synthesise into a constant, but that constant won't fit into the output register. So there's no real understanding here -- just very clever templating.

author: MK14
author_rank: Super Contributor
timestamp: June 14, 2022, 10:16:25 pm
content: Quote from: tom66 on June 14, 2022, 09:10:49 pmAlthough I 100% agree with you, and it is not good Verilog.My mind is still blown, and my mouth is still open, in shock. At the thought that a machine (AI), without human intervention (apart from the copy/pasted input, that could have been automated), could come up with stuff like that. Even if it is awful Verilog.The actual programming languages output, often/sometimes, looks quite reasonable, for machine/AI generated code.I don't know if it will be 6 months, 6 years, or a number of decades or longer. But so far, it is looking rather impressive. It seems to be showing to me, that one day we can just ask for a particular program to be (machine/AI) written, and it will do it. How and what effect, that will have on the world, I'm not sure.

author: RoGeorge
author_rank: Super Contributor
timestamp: June 15, 2022, 06:17:29 am
content: Verilog is not software it's hardware.It looks like this AI instance was not trained to generate schematics, it was only trained to generate programs.

author: magic
author_rank: Super Contributor
timestamp: June 15, 2022, 08:34:07 am
content: Can it write "a Perl script which prints the value of a resistor given its three-letter EIA96 code"?

author: SilverSolder
author_rank: Super Contributor
timestamp: June 15, 2022, 10:41:29 am
content: Oops, I broke it -To be, or not"I am a man, and I am not a man. I am a man who has a great deal ofdifficulty in being a man. I am a man who is not a man. I am a man whohas a great deal of difficulty in being not a man. I am a man who is nota man who has a great deal of difficulty in being a man. I am a man whois not a man who has a great deal of difficulty in being not a man. I ama man who is not a man who has a great deal of difficulty in being nota man who has a great deal of difficulty in being a man. I am a man whois not a man who has a great deal of difficulty in being not a man whohas a great deal of difficulty in being not a man. I am a man who is nota man who has a great deal of difficulty in being not a man who has agreat deal of difficulty in being not a man. I am a man who is not a manwho has a great deal of difficulty in being not a man who has a greatdeal of difficulty in being not a man. I am a man who is not a man whohas a great deal of difficulty in being not a man who has a great dealof difficulty in being not a man. I am a man who is not a man who has agreat deal of difficulty in being not a man who has a great deal of

author: Ed.Kloonk
author_rank: Super Contributor
timestamp: June 15, 2022, 11:12:24 am
content: Good heavens.

author: xrunner
author_rank: Super Contributor
timestamp: June 15, 2022, 11:32:22 am
content: Quote from: Ed.Kloonk on June 15, 2022, 11:12:24 amHold on Ed. I've read poetry by so-called "sentient" humans way worse.

author: Ed.Kloonk
author_rank: Super Contributor
timestamp: June 15, 2022, 11:34:46 am
content: Quote from: xrunner on June 15, 2022, 11:32:22 amI wonder if it was trying to channel some Vogon poetry?

author: SilverSolder
author_rank: Super Contributor
timestamp: June 15, 2022, 05:45:40 pm
content: Looks like it needs more work, for sure!

author: MK14
author_rank: Super Contributor
timestamp: June 15, 2022, 05:55:26 pm
content: Quote from: magic on June 15, 2022, 08:34:07 amYou shouldn't make jokes like that. Or theHAL9000, AI might get angry, annoyed and do things.On the second attempt, this is what it produced/said:QuoteThird attempt:Code:write a Perl script which prints the value of a resistor given its three-letter EIA96 code.#!/usr/bin/perl -wuse strict;my %colours = ("black" => 0,"brown" => 1,"red" => 2,"orange" => 3,"yellow" => 4,"green" => 5,"blue" => 6,"violet" => 7,"grey" => 8,"white" => 9 );if(scalar @ARGV != 3) {die("Please provide a three letter code\n");}my $code=join('',@ARGV);if($code =~ /[^a-zA-Z]/) {die("Please provide a valid three letter code\n");}my @letters=split(//, $code);my $value = ($colours{lc $letters} * 10 + $colours{lc $letters}) * 10**$colours{lc $letters};print "$value ohms\n";

author: magic
author_rank: Super Contributor
timestamp: June 15, 2022, 09:15:29 pm
content: So I am not completely obsoleted by AI yetThe third attempt could be a working color band decoder, if not for its insistence on looking up single letters in a table indexed by full color names. I'm surprised that it completely missed the meaning of EIA96; the first search hits I get are a few websites with big-ass tables of "code - value" pairs, it should be plenty obvious. I wondered if it would use those tables or perhaps rip-off my shorter solution which I have posted here a few months ago.

author: tom66
author_rank: Super Contributor
timestamp: June 15, 2022, 09:24:15 pm
content: I think this is because it doesn't actually understand the problem, it just 'checks' its 'database' for a matching pattern. Someone else has solved this before, and someone else has solved that before, so using natural language parsing, merge the two...

author: MK14
author_rank: Super Contributor
timestamp: June 15, 2022, 09:33:06 pm
content: Quote from: magic on June 15, 2022, 09:15:29 pmI think it last accessed the web in 2019 (they seem to keep on saying this, in places, on the website, and while using the AI thing, in places). Presumably, the AI engines/thingies/stuff, that has accessed the internet later than that, either (speculation on my part) is NOT available to normal members of the public, on their public release website (which I and others, I believe, have been accessing) and/or you have to pay for access to later ones and/or you have to sign NDA and/orneed to be significant customers and be approved and/or they haven't created later ones yet (finished them, finished testing, approved them for release, etc), and/or it is taking them too long to remove all harmful/rude/racist/problematic content, from it, possibly by hand.TL;DRBusiness and/or reasons of practicality (manual testing and development takes time).

author: AndyBeez
author_rank: Frequent Contributor
timestamp: June 15, 2022, 09:51:37 pm
content: Don't panic? The AI reminds me more of Orac from BBC classic scifi Blakes 7 -https://blakes7.fandom.com/wiki/OracGive the AI monkey a Regular Expression to write. If it can solve this, I will build a clear plastic box with some flashing MES lightbulbs as the UI: write a regular expression that captures words from an input string with trailing consonants, except where a trailing d is preceeded by two vowels and, the word is not the first or last word in the input string.

author: Circlotron
author_rank: Super Contributor
timestamp: June 15, 2022, 10:23:11 pm
content: How do you get access to this thing? Or do you gotta be someone special?

author: MK14
author_rank: Super Contributor
timestamp: June 15, 2022, 10:35:15 pm
content: Quote from: AndyBeez on June 15, 2022, 09:51:37 pmQuoteQuoteQuoteQuoteQuoteQuoteQuote

author: MK14
author_rank: Super Contributor
timestamp: June 15, 2022, 10:38:16 pm
content: Quote from: Circlotron on June 15, 2022, 10:23:11 pmhttps://beta.openai.com/playgroundWhen creating a (free) account, it will probably ask for details, such as a verifiable email address, and verifiable SMS receiving phone number.

author: AndyBeez
author_rank: Frequent Contributor
timestamp: June 15, 2022, 11:00:06 pm
content: Orac: "Instructions are not needed if commands are succinct"Quote

author: MK14
author_rank: Super Contributor
timestamp: June 15, 2022, 11:20:50 pm
content: QuoteWow, the next one is clever. I hadn't thought of that answer, at the time, but it explains it, cleverly.QuoteSo, there was a transaction, involving the £20 and/or £10 in one go, which left the person with a total of £25 left (after the purchase, or something).

author: Circlotron
author_rank: Super Contributor
timestamp: June 15, 2022, 11:59:40 pm
content: Quote from: MK14 on June 12, 2022, 07:50:11 pmPretty amazing stuff! Can't wait to try it out.Tried to run the second chess program.Syntax errors in lines 920 and 1220.And no WHILE to go with WEND in 1300.But great starting point.It's like Siri on 78.

author: eti
author_rank: Super Contributor
timestamp: June 16, 2022, 12:27:24 am
content: Let me know when "AI" generates intelligent design. I hear it's booked in for the 12th of never

author: MK14
author_rank: Super Contributor
timestamp: June 16, 2022, 12:50:00 am
content: Quote from: eti on June 16, 2022, 12:27:24 amIt has a reply for you:QuoteEDIT: After other attempts:Quote

author: xrunner
author_rank: Super Contributor
timestamp: June 16, 2022, 12:58:00 am
content: Quote from: MK14 on June 16, 2022, 12:50:00 amInteresting that it said that at the beginning.

author: MK14
author_rank: Super Contributor
timestamp: June 16, 2022, 01:11:48 am
content: Quote from: xrunner on June 16, 2022, 12:58:00 amThere is a possible issue with my (and maybe other peoples) quotes. Because it seems to place two completely different types of responses, into the (web page's) input/output field box.One type is a correction and/or addition(s) to the question, so you can see what is going on, and correct the question, if/as necessary.The other type is the actual answer.So, that beginning bit, was probably its attempt at straightening out the question, before it answered it.Currently, their user interface (web based), is not especially good at that, at the moment, in my opinion. Because they should really use different colours and/or mark out, what was the original question, and what is the modified/updated question, if necessary.EDIT: Hypothetical example (completely made up to show the concept):Original question "If I have 3 bags of sugar, and 2, what do I have?"***MIGHT*** change the question to:"If I have 3 bags of sugar and 2more bags of sugar, what do I haveall together?Where it highlights in green, both the additions/changes(? not sure if it changes things), to the question, and the output, in the same web window. Usually separated by around 2 blank lines, between the question and answer.

author: Ed.Kloonk
author_rank: Super Contributor
timestamp: June 16, 2022, 03:50:37 am
content: Code:In a minute, I’ma need a sentimental Man or women to pump me up

author: eti
author_rank: Super Contributor
timestamp: June 16, 2022, 05:35:02 am
content: Quote from: MK14 on June 16, 2022, 12:50:00 amAh the old excuse people use for something which they KNOW is a load of bollocks, IF they had the guts and integrity to ACTUALLY wake up and be HONEST.What with it being a complete daydream and technologists/futurists nonsensical daydream (and also the SHEER ARROGANCE of humans to think they can achieve human consciousness without a soul or a spirit, which come from GOD) - pushing said "completion" or "success" further and further into the future, and when said time arrives, that same postponement will have happened another 10,000 times between the first statement of "it'll happen one day", and the current day (which will arrive in the future), which was roughly "see" to BE that "one day".Utter baloney. It's a bit of sand with traces on it. Let's not get too delusional!You'd have more success trying to lick your elbow or bite your ear.It's called a fairytale, a delusion,

author: Ed.Kloonk
author_rank: Super Contributor
timestamp: June 16, 2022, 05:59:21 am
content: Whatchu talkin' 'bout Willis?Anything non-human can have a soul.

author: fourfathom
author_rank: Super Contributor
timestamp: June 16, 2022, 06:15:10 am
content: Quote from: eti on June 16, 2022, 05:35:02 amWell, that was interesting.And is anyone claiming that the AI being demonstrated possesses consciousness or self-awareness? I sure haven't seen it. I don't think this is even a goal of the project.

author: magic
author_rank: Super Contributor
timestamp: June 16, 2022, 06:52:36 am
content: Perhaps a reference to the Goolag drone who got fired for insisting that one of their AI products is sentient and publishing confidential information about it to organize an outrage crusade against Goolag management that didn't take his concerns seriously.

author: MK14
author_rank: Super Contributor
timestamp: June 16, 2022, 12:48:59 pm
content: Quote from: eti on June 16, 2022, 05:35:02 amWell, let's perform a thought experiment, and see how things add up. Let's consider a number of tasks, and take two different entities, to perform them, and (as a thought experiment), compare them, here.For (test) Subject1, we will take someone from 1950, who wasaged 30 at that time. They will notionally have each required skill(s), as applicable. For (test) Subject2, we will take each modern available (either purchasable or via possibly unreleased to the public, prototypes), in its most suitable form.Let the (thought experiments) begin (my apologies, I didn't realize how bad the forums table feature was going to turn out):Details of TestSubject1 Man from 1950, aged 30Subject2 Latest Gadget/Prototype/EtcMaths calculationsThey would do it withpencil and paper, slowlyScientific Calculator, solves mostmaths number things, very quicklyVehicle DrivingCan drive a carSelf driving cars. Not necessarily readyfor mass publicusage, everywhere. Butexists in prototype form, and morePlaying ChessCan play chess to a reasonable levelChess program/computer, can beatall human opponents, usually (world chess champs no problem,but computer chess experts can be tricky opponents)Information from a book and stuffWould have to look it up with paper versions of booksCan google it for answersAnswering a telephone, and giving intelligent answersCan answer a telephone, and give simpleanswers to simple questionsAlexa can answer simple and straightforwardquestions, in some/many cases, but not allIn other words, a number of skills, which would have tended to only be performed by humans, in say the 1950s (with some notable exceptions), can now be done by machine. As time goes on, the number of things that use to only be done by humans, are then done by machines. Is likely to increase more and more, over time (chip shortages permitting).A question back at you.Apparently PI has recently been calculated to 100 trillion digits. How long would humans take to perform the same calculations (pen and paper, only) and would it be 100% accurate?Bonus side question. Would there even be enough paper on earth, to write out all those digits, by hand?

author: themadhippy
author_rank: Super Contributor
timestamp: June 16, 2022, 01:04:21 pm
content: Quoteis that like the sheer arrogance of certain humans who go around trying to get everybody to believe in some fantasy sky fairy

author: fourfathom
author_rank: Super Contributor
timestamp: June 16, 2022, 03:32:53 pm
content: Quote from: magic on June 16, 2022, 06:52:36 amOK. I had already forgotten about him, as he is (IMO) obviously delusional.

author: RoGeorge
author_rank: Super Contributor
timestamp: June 16, 2022, 05:05:56 pm
content: Quote from: eti on June 16, 2022, 05:35:02 am

author: tpowell1830
author_rank: Frequent Contributor
timestamp: June 16, 2022, 06:12:16 pm
content: Here is the GPT-3 free online tool writing C# code as follows. The first part is my description of program:design a program for C# that will have a form, full screen, with title "Resistor Color Code Decryption". Add 4 text boxes with labels for "Color Code" that is left justified plus 50, centered from top. Write the code needed to examine the contents of the text boxes and define each according to resistor color codes when a push button, centered on form, is pressed. Add necessary prompts for errors and remarks for each code grouping.using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Threading.Tasks;using System.Windows.Forms;namespace ResistorColorCodeDecryption{public partial class Form1 : Form{public Form1(){InitializeComponent();}private void button1_Click(object sender, EventArgs e){string colorCode1, colorCode2, colorCode3, colorCode4;int value1, value2, value3;double resistorValue;colorCode1 = textBox1.Text;colorCode2 = textBox2.Text;colorCode3 = textBox3.Text;colorCode4 = textBox4.Text;if (colorCode1 == "black"){value1 = 0;}else if (colorCode1 == "brown"){value1 = 1;}else if (colorCode1 == "red"){value1 = 2;}else if (colorCode1 == "orange"){value1 = 3;}else if (colorCode1 == "yellow"){value1 = 4;}else if (colorCode1 == "green"){value1 = 5;}else if (colorCode1 == "blue"){value1 = 6;}else if (colorCode1 == "violet"){value1 = 7;}else if (colorCode1 == "gray"){value1 = 8;}else if (colorCode1 == "white"){value1 = 9;}else{MessageBox.Show("Invalid color code entered for first band");return;}if (colorCode2 == "black"){value2 = 0;}else if (colorCode2 == "brown"){value2 = 1;}else if (colorCode2 == "red"){value2 = 2;}else if (colorCode2 == "orange"){value2 = 3;}else if (colorCode2 == "yellow"){value2 = 4;}else if (colorCode2 == "green"){value2 = 5;}else if (colorCode2 == "blue"){value2 = 6;}else if (colorCode2 == "violet"){value2 = 7;}else if (colorCode2 == "gray"){value2 = 8;}else if (colorCode2 == "white"){value2 = 9;}else{MessageBox.Show("Invalid color code entered for second band");return;}if (colorCode3 == "black"){value3 = 0;}else if (colorCode3 == "brown"){value3 = 1;}else if (colorCode3 == "red"){value3 = 2;}else if (colorCode3 == "orange"){value3 = 3;}else if (colorCode3 == "yellow"){value3 = 4;}else if (colorCode3 == "green"){value3 = 5;}else if (colorCode3 == "blue"){value3 = 6;}else if (colorCode3 == "violet"){value3 = 7;}else if (colorCode3 == "gray"){value3 = 8;}else if (colorCode3 == "white"){value3 = 9;}else{MessageBox.Show("Invalid color code entered for third band");return;}resistorValue = (value1 * 10 + value2) * Math.Pow(10, value3);if (colorCode4 == "black"){MessageBox.Show("Resistor value is " + resistorValue + " ohms +/- 20%");}else if (colorCode4 == "brown"){MessageBox.Show("Resistor value is " + resistorValue + " ohms +/- 1%");}else if (colorCode4 == "red"){MessageBox.Show("Resistor value is " + resistorValue + " ohms +/- 2%");}else if (colorCode4 == "orange"){MessageBox.Show("Resistor value is " + resistorValue + " ohms +/- 3%");}else if (colorCode4 == "yellow"){MessageBox.Show("Resistor value is " + resistorValue + " ohms +/- 4%");}else if (colorCode4 == "green"){MessageBox.Show("Resistor value is " + resistorValue + " ohms +/- 0.5%");}else if (colorCode4 == "blue"){MessageBox.Show("Resistor value is " + resistorValue + " ohms +/- 0.25%");}else if (colorCode4 == "violet"){MessageBox.Show("Resistor value is " + resistorValue + " ohms +/- 0.1%");}else if (colorCode4 == "gray"){MessageBox.Show("Resistor value is " + resistorValue + " ohms +/- 0.05%");}else if (colorCode4 == "white"){MessageBox.Show("Resistor value is " + resistorValue + " ohms +/- 5%");}else{MessageBox.Show("Invalid color code entered for fourth band");return;}}}}It does not create the form in code, and suppose, that is realistic, since this will be done by user.

author: AndyBeez
author_rank: Frequent Contributor
timestamp: June 16, 2022, 08:21:57 pm
content: Quote from: tpowell1830 on June 16, 2022, 06:12:16 pmAnd here is another problem; code normalization.An experienced C# developer will be thinking classes, iterators, generics, event binding and anything else in the toolkit to make that forms code work in as few maintainable lines as possible. Not to mention the added/grinding complexity of Windows Presentation Foundation. Seeing this in production code might raise a few 'issues' in review.My opinion is, regardless if language, the AI code generator is just a starting point for developers. Maybe this will become the finishing point go-to app for students programming in 'Arduino'? No one knows how or even why the code works, it just does.

author: tpowell1830
author_rank: Frequent Contributor
timestamp: June 16, 2022, 08:47:28 pm
content: Quote from: AndyBeez on June 16, 2022, 08:21:57 pmI tried again, same request and the code was shortened considerably by utilizing "switch" instead of all of "else if" statements. The third time it even included remarks as I asked, code below:using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Threading.Tasks;using System.Windows.Forms;namespace Resistor_Color_Code_Decryption{public partial class Form1 : Form{public Form1(){InitializeComponent();}private void btnDecode_Click(object sender, EventArgs e){//define variablesstring colorCode1, colorCode2, colorCode3, colorCode4;int numValue1, numValue2;double multiplier, tolerance;//get user inputcolorCode1 = txtColorCode1.Text;colorCode2 = txtColorCode2.Text;colorCode3 = txtColorCode3.Text;colorCode4 = txtColorCode4.Text;//calculate and display resultsnumValue1 = ColorCode(colorCode1);numValue2 = ColorCode(colorCode2);multiplier = Multiplier(colorCode3);tolerance = Tolerance(colorCode4);lblResult.Text = Result(numValue1, numValue2, multiplier, tolerance);}static int ColorCode(string colorCode){int numValue = 0;switch (colorCode.ToLower()){case "black":numValue = 0;break;case "brown":numValue = 1;break;case "red":numValue = 2;break;case "orange":numValue = 3;break;case "yellow":numValue = 4;break;case "green":numValue = 5;break;case "blue":numValue = 6;break;case "violet":numValue = 7;break;case "gray":numValue = 8;break;case "white":numValue = 9;break;default:MessageBox.Show("Invalid Color Code");break;}return numValue;}static double Multiplier(string colorCode){double multiplier = 1;switch (colorCode.ToLower()){case "black":multiplier = 1;break;case "brown":multiplier = 10;break;case "red":multiplier = 100;break;case "orange":multiplier = 1000;break;case "yellow":multiplier = 10000;break;case "green":multiplier = 100000;break;case "blue":multiplier = 1000000;break;case "violet":multiplier = 10000000;break;case "gray":multiplier = 100000000;break;case "white":multiplier = 1000000000;break;default:MessageBox.Show("Invalid Color Code");break;}return multiplier;}static double Tolerance(string colorCode){double tolerance = 20;switch (colorCode.ToLower()){case "brown":tolerance = 1;break;case "red":tolerance = 2;break;case "green":tolerance = 0.5;break;case "blue":tolerance = 0.25;break;case "violet":tolerance = 0.1;break;case "gray":tolerance = 0.05;break;case "gold":tolerance = 5;break;case "silver":tolerance = 10;break;default:MessageBox.Show("Invalid Color Code");break;}return tolerance;}static string Result(int numValue1, int numValue2, double multiplier, double tolerance){double result = (numValue1 * 10 + numValue2) * multiplier;string strResult = "";strResult = result.ToString() + " ohms, +/- " + tolerance.ToString() + "%";return strResult;}}}I don't think this machine learning tool will replace programmers at all, but it does give a quick starting point as you said. I don't consider myself a programmer and this work would have taken me 1.5 to 2 hours to complete, and then I may have rewritten again. I have written some user tools and over the last 30 years and some stuff specific to hardware that I have designed, but i never considered myself a coder (programmer). This would have saved me hours in my work so I can be working on other machine design issues.Doesn't matter to me anymore, since I am retired.

author: Circlotron
author_rank: Super Contributor
timestamp: June 17, 2022, 03:01:36 am
content: Yeah, I think these things are better viewed as something to assist you rather than something to replace you. For now at least.

author: Miyuki
author_rank: Frequent Contributor
timestamp: June 17, 2022, 05:29:00 am
content: I see it as a great possible expansion to IntelliSenseIt is already pretty smart in many cases when it suggests reasonable lines of code or nice templates to fill

author: Circlotron
author_rank: Super Contributor
timestamp: June 17, 2022, 08:16:38 am
content: Deep city.

author: AndyBeez
author_rank: Frequent Contributor
timestamp: June 17, 2022, 08:58:34 pm
content: Quote from: tpowell1830 on June 16, 2022, 08:47:28 pmThat third iteration is closer to what might be expected for the task. Correct use ofToLower()which alows users to MixCASE theIR iNpUTs. Extra point there for the junior programmer. I suspect the AI code generator is using some kind of generic model of what a program has to do given the problem, and then applies this method to the syntax of a language. Programmers tend to start with what a language can do, and then use that to solve the problem. Which is why two programmers can come out withthreeprogram solutions. Either way, both entities use some kind of decisioning tree.I would be interesting to know what the AI does when you ask the code generator to "use enumerated values". In C# the output should read something like:Code:enum colorCode {black,brown,...etc..white}# The CASE statment then is similar toswitch ( value.ToLower() ) {case "black":return colorCode.black;break;...}Enumerations in C# support many methods, so it is possible to write the code withoutanyconditional statements at all. Which is a limitation of the AI; there is a 'density' in good coding that only comes from experience. Maybe that's theArt Of Programming?https://www.w3schools.com/cs/cs_enums.phpif you're interested.Quote from: Miyuki on June 17, 2022, 05:29:00 amIn my opinion,IntelliSenseis why Visual Studio has the edge over all other IDEs. It would be cool-ISH to have asuggest codefeature. Although you'll need to implement a team policy that prevents thoughtfull programmers getting usurped by the office's lazy code hacks.

author: tpowell1830
author_rank: Frequent Contributor
timestamp: June 18, 2022, 05:26:31 pm
content: Ok, so I decided to ask GPT-3 a beginner question in electronics:"ME: which npn transistor would you use for a low wattage, class D audio amplifier?GPT-3: There are a number of different types of NPN transistors that could be used for a low wattage, class D audio amplifier. Some of the more common types include the 2N3904 and the 2N2222."Specific, but not terribly difficult. This tool could replace google for such questions, since the answers generally come from the internet, but one doesn't have to scroll through tons of answers as well as ads.After playing with this for several days, I think that it is a useful tool, however, I have gotten erroneous or highly biased answers as well. But, no different than what you would find searching with google.

author: Miyuki
author_rank: Frequent Contributor
timestamp: June 18, 2022, 08:45:57 pm
content: Quote from: tpowell1830 on June 18, 2022, 05:26:31 pmJust wait till the ads will be camouflaged as relevant answers with powerful AIThey want to show you as many ads as possible, getting your answer, in the end, is just a bait to attract you

author: SilverSolder
author_rank: Super Contributor
timestamp: June 23, 2022, 12:09:54 pm
content: Quote from: MK14 on June 16, 2022, 12:48:59 pmOnly a computer would be dumb enough to actually calculate PI to that many digits... a human would have gone to make love in the grass with a beautiful woman. Can a computer do that? QED!

author: xrunner
author_rank: Super Contributor
timestamp: June 23, 2022, 01:02:36 pm
content: Quote from: SilverSolder on June 23, 2022, 12:09:54 pmNot yet ...

author: MK14
author_rank: Super Contributor
timestamp: June 23, 2022, 02:54:31 pm
content: Quote from: SilverSolder on June 23, 2022, 12:09:54 pmThe Youtube channel that reported the PI record (100 Trillion digits), also solved or attempted to solve (calculate), 100 digits of PI. I've not seen the second video yet, but I plan to watch it, at some point. Both Youtube videos, are linked below.