Menu Sign In Contact FAQ
Banner
Welcome to our forums

ChatGPT discussion, and ChatGPT-generated post examples

Google on some lines in that code; it may show where it came from.

The ChatGPT coding is clearly been specialised for code fragments also, not just language. Or maybe not; maybe it “just works” using the same rules.

Administrator
Shoreham EGKA, United Kingdom

loco wrote:

I haven’t been programming in 15 years, but I find things like shown below impressive.

This is a very good example. First of all those capabilites are very impressive. It usually producess a solution which looks very good, it has the right ideas and approaches. As an exam question this would usually result in all or nearly all points.

But looking very closely at the proposed solution it will often have some very nasty little mistakes. Those are even harder to find as the solution looks so good.

Lets look at above example where it creates the threads:
It takes 125367 and devises it by 4 (as an integer). This is 31341. It then sets up search threads for ranges 0 to 31341, 31341 to 62682, 62682 to 94023, 94023 to 125364 and checks if the numbers in those ranges are prime.
But this way it forgets to check 125365, 125366 and 125367

So in the important case the number to check itself is prime this code would fail to detect this. A quick fix would be to make sure the integer resulting from the division by 4 is rounded up instead of beeing simply truncated of its decimals. This kind of error is very typical for the code I generated using Chat GPT so far.

Further it uses threads for better performance but then tries also all the even numbers if they can devide the number in question. This is not wrong but no human would do this and reduce the effort more or less in half and only check the odd numbers.

Last Edited by Sebastian_G at 29 Nov 20:21
www.ing-golze.de
EDAZ

Another example from today:

Me:


an objective c example which show show to obtain the year, month, day, hour and minutes from the cumulated number of minutes elapsed since 1st januaray year 2000

ChatGPT

// Assuming you have a variable `elapsedMinutes` representing the elapsed minutes since January 1, 2000.
NSInteger elapsedMinutes = 1234567; // Convert elapsed minutes to seconds NSTimeInterval elapsedSeconds = elapsedMinutes * 60; // Calculate the reference date (January 1, 2000) NSDate *referenceDate = [NSDate dateWithTimeIntervalSinceReferenceDate:0]; // Add the elapsed seconds to the reference date NSDate *targetDate = [referenceDate dateByAddingTimeInterval:elapsedSeconds]; // Create a calendar NSCalendar *calendar = [NSCalendar currentCalendar]; // Extract components from the target date NSDateComponents *components = [calendar components:NSCalendarUnitYear | NSCalendarUnitMonth | NSCalendarUnitDay | NSCalendarUnitHour | NSCalendarUnitMinute fromDate:targetDate]; // Access individual components NSInteger year = [components year]; NSInteger month = [components month]; NSInteger day = [components day]; NSInteger hour = [components hour]; NSInteger minute = [components minute]; // Print the results NSLog(@"Year: %ld", (long)year); NSLog(@"Month: %ld", (long)month); NSLog(@"Day: %ld", (long)day); NSLog(@"Hour: %ld", (long)hour); NSLog(@"Minute: %ld", (long)minute);

Again the solution looks very good. The only small issue is that the Apple reference date for the function [NSDate dateWithTimeIntervalSinceReferenceDate:0]; used is not 1st Januar 2000 but 1st Januar 2001. Again a tiny crucial error which is very hard to dected in a textbook quality answer…

Last Edited by Sebastian_G at 29 Nov 20:28
www.ing-golze.de
EDAZ

Just come across this BS when searching for fixing a particularly irritating android feature

It is just BS

Administrator
Shoreham EGKA, United Kingdom

johnh wrote:

Well yes but you could find the same thing on stackoverflow.com, which is indeed almost certainly where it came from.

Well, yes. It is a lossy compression of all text on the internet. I still find it impressive.

LPFR, Poland

I still find it impressive.

In a talking dog sense, sure. (Old talking dog joke, whose punchline is “It doesn’t matter what he says,. what matters is that he says anything at all”.

Yes, it’s impressive that humanity has managed to build such an effective bullshit generator. Sadly, it is only useful in contexts where bullshit is exactly what you want. Of which there are unfortunately very, very many.

LFMD, France

Peter wrote:

Just come across this BS when searching for fixing a particularly irritating android feature

It is just BS

Replace “Apps & Notifications” by “Apps” and “Recently revoked permissions” by “Unused apps”, and you have working (for me, on the version of Android I use) instructions.

ELLX

Not any more… (android 14 here). Apparently has not worked since android 11, when google removed any means of globally stopping the stupid OS automatically revoking permissions on apps not used for 90 days.

It can still be done with a rooted phone but then (unless you do more obscure stuff like a cloaked root, which I never got around to doing) you cannot run any banking etc apps.

This is a huge problem on the internet which is full of sites with “advice” which fail to mention which OS etc version they are applicable to, and then ChatGPT soaks up the crap and regurgitates it all over the place. Actually everything from ChatGPS is from stuff it soaked up in 2021. And 3 year old advice is so often worthless, yet ChatGPT generated content is everywhere, all over the internet.

ChatGPT is wonderful for stuffing a clickbait site, which is a big chunk of the internet, too.

Administrator
Shoreham EGKA, United Kingdom

Peter wrote:

Not any more… (android 14 here). Apparently has not worked since android 11

<shrug> I run Android 13, but there are so many variants… The upstream Google one might not have it, but a vendor one has it or vice-versa, etc.

ELLX

Looking beyond ChatGPT a bit:



Private field, Mallorca, Spain
Sign in to add your message

Back to Top