unofficial mirror of emacs-tangents@gnu.org
 help / color / mirror / Atom feed
From: Philip Kaludercic <philipk@posteo.net>
To: Eli Zaretskii <eliz@gnu.org>
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 14:16:55 +0000	[thread overview]
Message-ID: <875ywz23vs.fsf@posteo.net> (raw)
In-Reply-To: <83mtqcyn6h.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 24 Jul 2021 14:19:02 +0300")

Eli Zaretskii <eliz@gnu.org> writes:

>> > A sort function must state at least the data type before it can be
>> > compiled.  And if you are talking about pseudo-code that is data-type
>> > agnostic, then that's an algorithm, and is not copyrightable, AFAIK.
>> 
>> No, I was thinking about concrete code, that depending on the language
>> might even just rely on the standard library, especially if the language
>> has generics. Seeing how often SO code has been found in random
>> repositories[0], I don't think it is improbable that the trained models
>> might notice these patterns.
>
> 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. 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).

-- 
	Philip Kaludercic



  reply	other threads:[~2021-07-24 14:16 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CACT87JohxuswvDcqGOiQR7BrHoqJFG252QD6XjEuAPU2HSuWOw@mail.gmail.com>
     [not found] ` <CADwFkm=cN4W0Mgo_hYgwWgddoe=cXj5+WYJWnAHZmmd+rd7gKw@mail.gmail.com>
     [not found]   ` <E1m4YYb-0005Ds-GJ@fencepost.gnu.org>
     [not found]     ` <CACT87JqMZ+pbVDQ-5gZHMsGcfm04CoeKZn6sY5yy+1rnxCimOQ@mail.gmail.com>
     [not found]       ` <83im1948mj.fsf@gnu.org>
     [not found]         ` <CACT87JrCAi3Umdke6gL+_W_7k2j+21jsuT=1hq5kyOx19L2x+A@mail.gmail.com>
     [not found]           ` <CACT87Jo41S2FJKxfPs0qP=qkXvwvcc0xnf1X6oEkjuhmAJ6w3A@mail.gmail.com>
     [not found]             ` <YPO+bAMpqMhxDBxU@protected.localdomain>
     [not found]               ` <83lf642jeh.fsf@gnu.org>
     [not found]                 ` <CACT87JriMaF1kFjEE_8=8FEQpAi6sxr3x3vZT3rafjY=4mQgZg@mail.gmail.com>
2021-07-19 17:00                   ` Help building Pen.el (GPT for emacs) 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 [this message]
2021-07-24 14:37                                           ` Eli Zaretskii
2021-07-24 14:49                                             ` Philip Kaludercic
2021-07-24 15:13                                               ` Eli Zaretskii
2021-07-25  1:06                       ` Richard Stallman
     [not found] ` <YN8bZEJAkWyQwjrB@protected.localdomain>
     [not found]   ` <CACT87JpAcUfuRB01CcnfbL4yCTPyDoiG_WOzzxVvAW7rhj0=Mw@mail.gmail.com>
2021-07-23 15:37     ` Jean Louis

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=875ywz23vs.fsf@posteo.net \
    --to=philipk@posteo.net \
    --cc=bugs@gnu.support \
    --cc=eliz@gnu.org \
    --cc=emacs-tangents@gnu.org \
    --cc=mullikine@gmail.com \
    --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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).