News for hackers. Stuff that matters.
Re:The most copied StackOverflow snippet of all time is flawed by nathan_gold on Wednesday September 27, 2023 @11:11AM (#37675800)
I'm curious what answer GPT will return.
Re:The most copied StackOverflow snippet of all time is flawed by chriscosma on Wednesday September 27, 2023 @11:39AM (#37676289)
GPT-3.5 returns:

    public static String convertBytes(long bytes) {
        String[] suffixes = {"B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"};
        if (bytes < 1024) return bytes + " " + suffixes[0];
        int exp = (int) (Math.log(bytes) / Math.log(1024));
        return String.format("%.2f %s", bytes / Math.pow(1024, exp), suffixes[exp]);
    }
Re:The most copied StackOverflow snippet of all time is flawed by a1o on Wednesday September 27, 2023 @12:12PM (#37676860)
So the code from the dude in the blog post here
Re:The most copied StackOverflow snippet of all time is flawed by Sprocklem on Wednesday September 27, 2023 @02:00PM (#37678559)
Not quite. ChatGPT incorrectly mixes up SI and non-SI units.
Re:The most copied StackOverflow snippet of all time is flawed by elzbardico on Wednesday September 27, 2023 @11:23AM (#37676013)
Probably this one as this is the most common on the corpus it was used to train it.
Re:The most copied StackOverflow snippet of all time is flawed by Denote6737 on Wednesday September 27, 2023 @11:15AM (#37675844)
Given how unreliable it is probably, 418 - I'm a teapot.