From: Eli Zaretskii <eliz@gnu.org>
To: Philip Kaludercic <philipk@posteo.net>
Cc: stefan@marxist.se, emacs-tangents@gnu.org, mullikine@gmail.com,
rms@gnu.org, bugs@gnu.support
Subject: Re: Help building Pen.el (GPT for emacs)
Date: Sat, 24 Jul 2021 17:37:39 +0300 [thread overview]
Message-ID: <83czr7zsjw.fsf@gnu.org> (raw)
In-Reply-To: <875ywz23vs.fsf@posteo.net> (message from Philip Kaludercic on Sat, 24 Jul 2021 14:16:55 +0000)
> From: Philip Kaludercic <philipk@posteo.net>
> Cc: rms@gnu.org, mullikine@gmail.com, emacs-tangents@gnu.org,
> stefan@marxist.se, bugs@gnu.support
> Date: Sat, 24 Jul 2021 14:16:55 +0000
>
> > Sorry, I don't understand what you have in mind. Can you show an
> > example of useful code that could be copied verbatim into a program
> > without at least some renaming, without breaking the program?
>
> To take the example from the article I mentioned above
>
> public static String humanReadableByteCount(long bytes, boolean si) {
> int unit = si ? 1000 : 1024;
> if (bytes < unit) return bytes + " B";
> int exp = (int) (Math.log(bytes) / Math.log(unit));
> String pre = (si ? "kMGTPE" : "KMGTPE").charAt(exp-1) + (si ? "" : "i");
> return String.format("%.1f %sB", bytes / Math.pow(unit, exp), pre);
> }
>
> can be copied into a Java program, and assuming that there is no other
> method called humanReadableByteCount in the same class, it should
> compile and run without renaming or re-typing.
How would one know it's 'long' and not some other data type?
> CoPilot might generate this from a comment like,
>
> // Convert a byte count to a human-readable string
>
> since it is mentioned over 6000 times on GitHub (and this method even
> has a bug, as the article explains -- but that is a totally different
> issue).
That's not how AI works: it doesn't just count the number of times
something is mentioned. That usually leads to unsatisfactory results.
next prev parent reply other threads:[~2021-07-24 14:37 UTC|newest]
Thread overview: 75+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-30 4:36 Help building Pen.el (GPT for emacs) Shane Mulligan
2021-07-02 13:30 ` Jean Louis
2021-07-02 13:40 ` Jean Louis
2021-07-02 13:57 ` Jean Louis
2021-07-03 6:34 ` Shane Mulligan
2021-07-03 22:21 ` Jean Louis
2021-07-03 23:21 ` Arthur Miller
2021-07-03 23:42 ` Jean Louis
2021-07-12 3:24 ` Shane Mulligan
2021-07-17 23:53 ` Richard Stallman
2021-07-23 15:37 ` Jean Louis
2021-07-15 11:58 ` Stefan Kangas
2021-07-15 12:40 ` dick
2021-07-15 23:52 ` Shane Mulligan
2021-07-16 7:30 ` tomas
2021-07-17 0:33 ` Shane Mulligan
2021-07-17 7:54 ` tomas
2021-07-17 7:52 ` Jean Louis
2021-07-17 0:51 ` Richard Stallman
2021-07-17 2:36 ` Shane Mulligan
2021-07-17 9:01 ` Eli Zaretskii
2021-07-17 9:27 ` Shane Mulligan
2021-07-17 21:02 ` Shane Mulligan
2021-07-18 5:38 ` Jean Louis
2021-07-18 5:38 ` Jean Louis
2021-07-18 7:03 ` Eli Zaretskii
2021-07-18 8:00 ` Shane Mulligan
2021-07-19 17:00 ` Jean Louis
2021-07-23 6:51 ` Shane Mulligan
2021-07-23 10:12 ` Jean Louis
2021-07-23 10:54 ` Eli Zaretskii
2021-07-23 11:32 ` Jean Louis
2021-07-23 11:51 ` Eli Zaretskii
2021-07-23 12:47 ` Jean Louis
2021-07-23 13:39 ` Shane Mulligan
2021-07-23 14:39 ` Jean Louis
2021-07-26 0:16 ` Richard Stallman
2021-07-26 0:28 ` Shane Mulligan
2021-07-30 3:20 ` Shane Mulligan
2021-07-30 6:55 ` Jean Louis
2021-07-23 19:33 ` Eli Zaretskii
2021-07-24 3:07 ` Jean Louis
2021-07-24 7:32 ` Eli Zaretskii
2021-07-24 7:54 ` Jean Louis
2021-07-24 8:50 ` Eli Zaretskii
2021-07-24 16:16 ` Jean Louis
2021-07-24 16:44 ` Eli Zaretskii
2021-07-24 18:01 ` Jean Louis
2021-07-25 1:09 ` Richard Stallman
2021-07-24 1:14 ` Richard Stallman
2021-07-24 2:10 ` Shane Mulligan
2021-07-24 2:34 ` Shane Mulligan
2021-07-24 3:14 ` Shane Mulligan
2021-07-24 6:49 ` Eli Zaretskii
2021-07-24 7:33 ` Jean Louis
2021-07-24 8:10 ` Eli Zaretskii
2021-07-24 8:21 ` Jean Louis
2021-07-24 8:35 ` Jean Louis
2021-07-24 8:59 ` Eli Zaretskii
2021-07-24 16:18 ` Jean Louis
2021-07-24 16:45 ` Eli Zaretskii
2021-07-24 17:57 ` Jean Louis
2021-07-24 18:15 ` Eli Zaretskii
2021-07-24 7:41 ` Philip Kaludercic
2021-07-24 7:59 ` Eli Zaretskii
2021-07-24 9:31 ` Philip Kaludercic
2021-07-24 11:19 ` Eli Zaretskii
2021-07-24 14:16 ` Philip Kaludercic
2021-07-24 14:37 ` Eli Zaretskii [this message]
2021-07-24 14:49 ` Philip Kaludercic
2021-07-24 15:13 ` Eli Zaretskii
2021-07-25 1:06 ` Richard Stallman
2021-07-18 6:42 ` Eli Zaretskii
2021-07-17 21:35 ` Juri Linkov
2021-07-17 23:53 ` Richard Stallman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=83czr7zsjw.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=bugs@gnu.support \
--cc=emacs-tangents@gnu.org \
--cc=mullikine@gmail.com \
--cc=philipk@posteo.net \
--cc=rms@gnu.org \
--cc=stefan@marxist.se \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.