Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Submission of p-code

Subject: Submission of p-code

From: Yumnam Kirani Singh

Date: 8 Feb, 2008 16:45:39

Message: 1 of 46

Is submission of p-code allowed in MathWorks File-exchange center?

Subject: Submission of p-code

From: D. Ismay

Date: 8 Feb, 2008 17:55:03

Message: 2 of 46

Yumnam Kirani Singh wrote:
> Is submission of p-code allowed in MathWorks File-exchange center?

Think about the target audience -- my read of the Fex is to teach,
demonstrate, provide convenient solutions to common problems, and so on.
  I don't know of any specific filter, but if potential users decide
they don't like your code (whether open or protected), it won't get
downloaded and will eventually disappear from the list. Simple, yes?

Subject: Submission of p-code

From: Vihang Patil

Date: 8 Feb, 2008 18:09:02

Message: 3 of 46

Yumnam Kirani Singh <kirani.singh@gmail.com> wrote in
message
<24497039.1202489169219.JavaMail.jakarta@nitrogen.mathforum
.org>...
> Is submission of p-code allowed in MathWorks File-
exchange center?

Yes, it is definately allowed.
P-Code will safe gaurd your IP, and give you satisfaction
of sharing your design.
Vihang

Subject: Submission of p-code

From: Helen Chen

Date: 8 Feb, 2008 20:47:02

Message: 4 of 46

Yumnam Kirani Singh <kirani.singh@gmail.com> wrote in
message
<24497039.1202489169219.JavaMail.jakarta@nitrogen.mathforum.org>...
> Is submission of p-code allowed in MathWorks File-exchange
center?

Hi Yumnam -

You are welcome to submit your p-code as long as it is
accompanied by the m-file. As someone else posted on this
thread, our community value is for learning and teaching
others how to use MATLAB. If you can't see how the code is
written, the file is of little use.

While we are talking about submissions, I'd like to remind
everyone that if you are bundling a bunch of files together,
please zip the files prior to submitting. We cannot accept
tar, rar or other compression file types as the File
Exchange infrastructure needs to find the zip file type to
index or reporting. Submitting the file in the appropriate
format will expedite our review and approval of the file.

Please feel free to contact post other questions or contact
me directly should you have any further questions.

Best wishes to all,
Helen Chen
for the MATLAB Central Team

Subject: Submission of p-code

From: Paul Mennen

Date: 13 Feb, 2008 00:01:04

Message: 5 of 46

"Helen Chen" <helen.chen@mathworks.com> wrote in message
> You are welcome to submit your p-code as long as it is
> accompanied by the m-file. As someone else posted on this
> thread, our community value is for learning and teaching
> others how to use MATLAB. If you can't see how the code is
> written, the file is of little use.

I disagree with this sentiment. Sometimes there can
be value in sharing p-code. For example I have submitted
a plotting routine (called plt) in pcode format and it has
been on the file exchange for years now. Many users of my
plotting routine have emailed me to say that plt has
revolutionalized the way they use Matlab, so I think it
has value. Once it was even chosen as "pick-of-the-week"
and in fact the latest version is far more useful than
when it earned this honor.

Many .m files are included in the plt release, but the
goal of these files is to teach one how to use plt, not
how it works internally.

I have have no commercial interest in promoting plt and so
there is no impediment to distributing the .m source.
In fact when a user complained about this I often sent them
the source, and usually lived to regret it. There are
several reasons for this. Foremost is that most attempted
modifications are misguided. Sometimes the desired feature
is already available or there is an easier way to accomplish
the desired end. (I'd rather hear from the user about
what they would like to plot and how they want it to look).

Secondly, even if the user has a good enhancement idea,
they are rarely successful at implementing it. This is
because I developed plt over several years and it has grown
into a complex, and tricky to modify piece of code (even
for me). I think this is not unusual for advanced GUI
driven interfaces. Once they modify the code, it inevitably
doesn't work and they come back to me to explain why. (So
again I would prefer to make the modifications myself).

~Paul

Subject: Submission of p-code

From: James Tursa

Date: 13 Feb, 2008 06:59:09

Message: 6 of 46

"Paul Mennen" <nospam@mennen.org> wrote in message
<fotc00$arf$1@fred.mathworks.com>...
>
> Sometimes there can be value in sharing p-code. ...
>
> ~Paul
>

Yes, that is certainly true and I agree with all of your
points. But frankly I am a little surprised that the
Mathworks allows p-code submissions since it would seem to
allow a program (either intentionally from an
ill-intentioned programmer or unintentionally from a bad
programmer) to do nasty things without the downloader being
allowed to look at the source code and look for potential
problems first. Like "what is that system call really doing
to my disk drive? Why is this program trying to read some
files and then send e-mail? I thought this was just a
plotting program." etc. etc. What guarantee is there that
the associated m-file in the post was actually the one used
to generate the p-code? Does the Mathworks actually check
this and provide some protection here? I don't know.

James Tursa

Subject: Submission of p-code

From: Vihang Patil

Date: 13 Feb, 2008 07:07:17

Message: 7 of 46

 What guarantee is there that
> the associated m-file in the post was actually the one
used
> to generate the p-code? Does the Mathworks actually check
> this and provide some protection here? I don't know.
>
> James Tursa

So are we expecting a new genre of viruses called the "p-
code" virus? Sounds exciting and terrifying. I hope Norton
and other antivirus solution providers think of this
possible threat.
Vihang

Subject: Submission of p-code

From: Bruno Luong

Date: 13 Feb, 2008 08:18:04

Message: 8 of 46

"Paul Mennen" <nospam@mennen.org> wrote in message
<fotc00$arf$1@fred.mathworks.com>...

>
> Many .m files are included in the plt release, but the
> goal of these files is to teach one how to use plt, not
> how it works internally.
>

There are those who just want a black box, and then there
are those who want to know how it works internally for
better use.

I believe the leaning of the second group of people is more
efficiency and in the longer run they will go father.

Computer programing - in its purist form of practicing -
needs to *prove* the programs work in the way those programs
were specified. Such proof is almost impossible when a black
box has been used.

Bruno

Subject: Submission of p-code

From: Yumnam Kirani Singh

Date: 13 Feb, 2008 08:18:28

Message: 9 of 46

First, let us know what happens to your hard drive?

Subject: Submission of p-code

From: Bjorn Gustavsson

Date: 13 Feb, 2008 09:36:02

Message: 10 of 46

Yumnam Kirani Singh <kirani.singh@gmail.com> wrote in
message
<15290243.1202890738880.JavaMail.jakarta@nitrogen.mathforum.org>...
> First, let us know what happens to your hard drive?
>
Nope. Nope. Nope.

Then years of my work will be lost.

This is of course a nightmare worst case scenario that might
never happen, but to have the option to read the code, and
to know that others also have the option to read the code is
an incredibly strong insurance that no such malicious code
get through.

If you want to keep your ideas hidden, then that's one
business model, but that does not go well together with open
source - which I think is what FEX is fundamentally built upon.

Subject: Submission of p-code

From: Doug Schwarz

Date: 13 Feb, 2008 14:27:20

Message: 11 of 46

In article <fou4ft$enh$1@fred.mathworks.com>,
 "James Tursa" <aclassyguywithaknotac@hotmail.com> wrote:

> "Paul Mennen" <nospam@mennen.org> wrote in message
> <fotc00$arf$1@fred.mathworks.com>...
> >
> > Sometimes there can be value in sharing p-code. ...
> >
> > ~Paul
> >
>
> Yes, that is certainly true and I agree with all of your
> points. But frankly I am a little surprised that the
> Mathworks allows p-code submissions since it would seem to
> allow a program (either intentionally from an
> ill-intentioned programmer or unintentionally from a bad
> programmer) to do nasty things without the downloader being
> allowed to look at the source code and look for potential
> problems first. Like "what is that system call really doing
> to my disk drive? Why is this program trying to read some
> files and then send e-mail? I thought this was just a
> plotting program." etc. etc. What guarantee is there that
> the associated m-file in the post was actually the one used
> to generate the p-code? Does the Mathworks actually check
> this and provide some protection here? I don't know.
>
> James Tursa

I agree completely and just so Paul (and everyone else) doesn't think
this is hypothetical I will say that this is exactly why I have never
been even slightly inclined to download and try plt. Not because I
think Paul is doing something I don't like, but because it is against
the spirit of the FEX and from it I can learn nothing.

Of course, if I don't know and trust the author I would also not run
p-code for those other reasons as well.

--
Doug Schwarz
dmschwarz&ieee,org
Make obvious changes to get real email address.

Subject: Submission of p-code

From: Paul Mennen

Date: 13 Feb, 2008 23:29:02

Message: 12 of 46

> I agree completely and just so Paul (and everyone else)
> doesn't think this is hypothetical I will say that this
> is exactly why I have never been even slightly inclined
> to download and try plt. Not because I think Paul is
> doing something I don't like, but because it is against
> the spirit of the FEX and from it I can learn nothing.

> Of course, if I don't know and trust the author I would
> also not run p-code for those other reasons as well.
> Doug Schwarz

I'm not sure Doug, if you are putting me in the category of
trusted authors or not. You've probably seen my posts on
this group for years both posing and answering questions.
Not sure if that counts for much, but also many people have
used plt and a few of my other submissions and nobody has
ever posted that I was up to some nefarious purpose. If you
have ever downloaded a shareware application, you know there
is some risk in every one. But the benefit is large as well
because of the huge variety of applications and tools that
we can find that may help us in our work.

I always like to say that there are three important
protections that should be used to protect ourselves against
both intentional and unintentional destructive software. In
order they are: Backups, Backups, and Backups :) The beauty
of these three protections, is they also protect us from the
most common reason of data loss (accidental deletions, and
other forms of pilot error).

Perhaps education is the major goal of FEX, but that doesn't
mean it is the only one. If a useful tool is provided, what
is the harm in that? I'd like to point out that plot makes
called to the lower level Matlab GUI objects (figure, axes,
line, etc.) in much the same way that plt does yet no doubt
you have happily used plot despite the fact that you don't
have the source code to it.

Even though I think of plt as a tool, that is not to say you
can't learn anything from it. plt uses colors and the mouse
differently that plot for a distinctly different "look and
feel". The calling sequence style (for all but the simplest
plots) is somewhat different as well.

All this is demonstrated with clearly written and commented
examples (with source code!). This may give you ideas about
how you may want to design your next graphical user
interface whether plt is used or not. In addition, compared
with the native matlab style of workspace plotting, plt
includes a distinctly different implementation, which some
users have told me makes the whole idea practical.

Looking at the source code to plt would not likely add to
your learning experience. It would more likely add to your
frustration. Probably the same would result if you had
access to the source to plot, since it is probably just as
complex.

If none of that interests you that is fine. There are
thousands of submissions on FEX and most users are
interested in only a small fraction of them. However to
declare my submission "against the spirit of the FEX" is
perhaps a bit harsh and a disservice to other users who
might find my submission both useful and educational.

~Paul

Subject: Submission of p-code

From: Doug Schwarz

Date: 14 Feb, 2008 03:45:00

Message: 13 of 46

In article <fovufu$gt0$1@fred.mathworks.com>,
 "Paul Mennen" <nospam@mennen.org> wrote:

> > I agree completely and just so Paul (and everyone else)
> > doesn't think this is hypothetical I will say that this
> > is exactly why I have never been even slightly inclined
> > to download and try plt. Not because I think Paul is
> > doing something I don't like, but because it is against
> > the spirit of the FEX and from it I can learn nothing.
>
> > Of course, if I don't know and trust the author I would
> > also not run p-code for those other reasons as well.
> > Doug Schwarz
>
> I'm not sure Doug, if you are putting me in the category of
> trusted authors or not.

Paul, I'm sorry if I wasn't clear! I absolutely put you in the category
of trusted authors! I was saying that *if* I did not trust the author I
would not run p-code because of those security concerns.


[snip]

> Perhaps education is the major goal of FEX, but that doesn't
> mean it is the only one.

Agreed.


[snip]

> If none of that interests you that is fine. There are
> thousands of submissions on FEX and most users are
> interested in only a small fraction of them. However to
> declare my submission "against the spirit of the FEX" is
> perhaps a bit harsh and a disservice to other users who
> might find my submission both useful and educational.

Hey, I don't have any authority; it's just an opinion and I stand by it.
I don't mean to hurt your feelings -- I'm sure you've spent a lot of
time on plt and find it to be useful. I'm sure lots of people agree.
But *in my opinion* the spirit of the FEX includes full disclosure. I'm
not saying anything about the quality or usefulness of your code. Keep
in mind that, as a consultant, I have to stand behind everything I
provide for my clients so I can't be giving them p-code written by a
third party. If I can't give it to a client then there's no point in
adding it to my repertoire.

--
Doug Schwarz
dmschwarz&ieee,org
Make obvious changes to get real email address.

Subject: Submission of p-code

From: per isakson

Date: 14 Feb, 2008 22:13:01

Message: 14 of 46

"Paul Mennen" <nospam@mennen.org> wrote in message
<fovufu$gt0$1@fred.mathworks.com>...

<snip> discussion on the value of pcode (e.g. plt) in FEX

> ... This may give you ideas about how you may want to
> design your next graphical user interface whether plt
> is used or not. ...

I certainly appreciate the submission, plt. I have played
with it and picked up ideas about user interaction and the
design. Thanks Paul.

/ per

    

Subject: Submission of p-code

From: Paul Mennen

Date: 14 Feb, 2008 22:59:02

Message: 15 of 46

> Hey, it's just an opinion and I stand by it.
> I don't mean to hurt your feelings --

I respect that you were just honestly expressing
your opinion. Certainly no offense taken.
Yet I can rarely resist a good debate ... hence my post.

> as a consultant, I have to stand behind everything I
> provide for my clients so I can't be giving them p-code
> written by a third party.
> Doug Schwarz

Why not? I'll explicitly give you permission to do so,
if indeed I haven't already implicitly done that by
publishing it on the FEX.

In once sense you are already doing that by relying on
Matlab. TMW has lots of their code hidden via p-code as
well as by other means. Granted I'm not in the same league
as TMW, yet I've found bugs that TMW was unwilling or not
able to fix. There is one area I would stand above:
If you find a bug or deficiency in my code that I am not
able to correct, I'd happily allow you to take a crack
at fixing it. This is a promise that TMW would never
match :)

~Paul

p.s. Thanks per !

Subject: Submission of p-code

From: Doug Schwarz

Date: 15 Feb, 2008 05:38:01

Message: 16 of 46

In article <fp2h3m$mok$1@fred.mathworks.com>,
 "Paul Mennen" <nospam@mennen.org> wrote:

> > as a consultant, I have to stand behind everything I
> > provide for my clients so I can't be giving them p-code
> > written by a third party.
> > Doug Schwarz
>
> Why not? I'll explicitly give you permission to do so,
> if indeed I haven't already implicitly done that by
> publishing it on the FEX.

Hi Paul,

It's not a legal issue. I suspect, as you say, publishing it on the FEX
takes care of that. I want to say it's an ethical issue, but that's not
it either. I guess I'm just not comfortable doing it. I didn't write
it and I can't see what it's doing so I can't vouch for it. Again, I
don't actually have any doubt that it's benign, but I can't *prove* it.


> In one sense you are already doing that by relying on
> Matlab. TMW has lots of their code hidden via p-code as
> well as by other means. Granted I'm not in the same league
> as TMW, ... [snip]

The league you're not in is financial responsibility. You have nothing
to lose; TMW has lots.

The client pays TMW for MATLAB. The client pays me to develop code with
MATLAB. The client pays you nothing. If something doesn't work right
it's my responsibility to fix it, not yours and I can't change plt. It
doesn't matter that you're a nice guy and are more than willing to help
me out. You might be busy with something else. If I want to use third
party code that's open and I find a problem I can fix it myself. It's
under my control and I'm comfortable with this. I'm not comfortable
with a black box.

If a client came to me and wasn't satisfied with the default plotting
capability of MATLAB I wouldn't hesitate to recommend plt for use at the
command line, but I won't require it for any software I write.

--
Doug Schwarz
dmschwarz&ieee,org
Make obvious changes to get real email address.

Subject: Submission of p-code

From: Helen Chen

Date: 15 Feb, 2008 22:23:03

Message: 17 of 46

Thanks to all who are participating in this very
interesting thread. There are really good arguments on both
sides from both a philosophical and a tactical level. I
really do appreciate your points and your passion about our
community!

That said, it is our policy at MATLAB Central that all p-
code published must have the supporting m-files supplied.
This is our current policy and practice which I stated
earlier.

It is possible that in the past, we have missed some files,
and some have been posted. For this, I do sincerely
apologize for the confusion. We will try to be consistent
about this during our file review activities.

It is possible that at some time in the future, we may
inventory existing submissions and ask authors to either
supply the supporting m-files or remove them from the site.

Sincerely,
Helen Chen
for the MATLAB Central Team

Subject: Submission of p-code

From: Paul Mennen

Date: 26 Feb, 2008 01:36:02

Message: 18 of 46

> There are really good arguments on both
> sides from both a philosophical and a tactical level.
> Helen Chen

I haven't seen any good arguments on this thread or
elsewhere on why p-code should be banned from the File
Exchange. Doug makes some good points on why he doesn't want
to use downloaded p-code but even he admits that such code
may be beneficial to others in the Matlab community.

The most appropriate format for the vast majority of the
File Exchange files is certainly .m and most submissions
would use that format regardless of whether .p code was
allowed. For the few submissions where .p code is more
appropriate, what is the harm in allowing it? Each user has
the option of downloading it or not.

If there isn't a good reason for the policy, wouldn't it
make more sense to re-evaluate the policy instead of
scowering the file exchange to expunge files that users may
find useful? Also it appears not everyone at TMW has the
same opinion. The TMW plt reviewer clearly knew it was a .p
file yet still thought it merited the POW distinction (pick
of the week).

> That said, it is our policy at MATLAB Central that all p-
> code published must have the supporting m-files supplied.

That's inconsistent at best. It makes no sense to submit
both p-code and m-code. (The p-code is quite easily
generated from the m-code). The reason for p-code's
existence as it was explained to me was to allow m-code to
run without revealing the source. So what is the advantage
of distributing p-code along with the source that generates it?

~Paul

Subject: Submission of p-code

From: dpb

Date: 26 Feb, 2008 02:26:50

Message: 19 of 46

Doug Schwarz wrote:
...

> If a client came to me and wasn't satisfied with the default plotting
> capability of MATLAB I wouldn't hesitate to recommend plt for use at the
> command line, but I won't require it for any software I write.

But that has no bearing on the usefulness in general nor as a
recommendation against p-code as a submission mechanism on FEX.

If your circumstance is such that you can't use anything that isn't open
source, so be it, but don't try to make your justification as something
that is of any import to anyone else.

$0.02, imo, ymmv, etc., etc., ...

--

Subject: Submission of p-code

From: John D'Errico

Date: 26 Feb, 2008 02:42:02

Message: 20 of 46

"Paul Mennen" <nospam@mennen.org> wrote in message
<fpvqe2$gti$1@fred.mathworks.com>...
> > There are really good arguments on both
> > sides from both a philosophical and a tactical level.
> > Helen Chen
>
> I haven't seen any good arguments on this thread or
> elsewhere on why p-code should be banned from the File
> Exchange. Doug makes some good points on why he doesn't want
> to use downloaded p-code but even he admits that such code
> may be beneficial to others in the Matlab community.

But I have not seen any good reason offered
on why one would insist on submitting a
p-coded file.

P-code goes against the open source basis
of the file exchange.


> The most appropriate format for the vast majority of the
> File Exchange files is certainly .m and most submissions
> would use that format regardless of whether .p code was
> allowed. For the few submissions where .p code is more
> appropriate, what is the harm in allowing it? Each user has
> the option of downloading it or not.

When is it ever appropriate? If you can't give it
away, then you should not be giving it away.
Sell your work if you wish. p-code is surely
appropriate there.
 
> If there isn't a good reason for the policy,

There is a very good reason.

If p-code is accepted, then it won't be that
long before a p-coded file turns up with a
keylogger built in, or some other viral nasty.
Build it into some otherwise useful utility,
then silently steal the shirt off the back of
your unsuspecting user.

> > That said, it is our policy at MATLAB Central that all p-
> > code published must have the supporting m-files supplied.

Something I entirely agree with.

John

Subject: Submission of p-code

From: Bill

Date: 26 Feb, 2008 03:30:20

Message: 21 of 46

And just when you thought it was safe to outside, consider
this: I won't use one piece of code that is p-, mex- dll,
Active-X or any non-m sourced material. If your piece is
so great, offer it for sale with a guarantee.

I want code that will live forever in the Matlab world,
that will survive the inquisition of a trial discovery
(Oh, the reason my missle warhead flew back at the jetliner
that launched it was because the trajectory code was a p-
code from the Mathwork's user submitted website. The
author was really pround of it and promised that it was bug
and sneak circuit-free).

Gimme a break. We used to call this ego-coding: You are
just so proud of it and don't want to share.

Your effort will die on the vine.

Subject: Submission of p-code

From: James Tursa

Date: 26 Feb, 2008 05:07:02

Message: 22 of 46

"Bill " <william.nospam.a.cobb@gm.com> wrote in message
<fq014c$ejo$1@fred.mathworks.com>...
> And just when you thought it was safe to outside, consider
> this: I won't use one piece of code that is p-, mex- dll,
> Active-X or any non-m sourced material.

By "mex-dll" I presume you mean compiled mex files without
the Fortran or C/C++ source code. I consider mex source code
to be open as much as m-code is. The user can see everything
in a Fortran or C/C++ source file and examine it before
compiling and running it. All of my FEX submissions so far
have been mex source code (no dll), either to be compiled by
the user into useful (I hope) functions to be called by
anyone (even non-mex programmers), or as examples for other
mex programmers to use.

James Tursa

Subject: Submission of p-code

From: John D'Errico

Date: 26 Feb, 2008 13:08:01

Message: 23 of 46

"James Tursa" <aclassyguywithaknotac@hotmail.com> wrote in message
<fq06pl$8sl$1@fred.mathworks.com>...
> "Bill " <william.nospam.a.cobb@gm.com> wrote in message
> <fq014c$ejo$1@fred.mathworks.com>...
> > And just when you thought it was safe to outside, consider
> > this: I won't use one piece of code that is p-, mex- dll,
> > Active-X or any non-m sourced material.
>
> By "mex-dll" I presume you mean compiled mex files without
> the Fortran or C/C++ source code. I consider mex source code
> to be open as much as m-code is. The user can see everything
> in a Fortran or C/C++ source file and examine it before
> compiling and running it. All of my FEX submissions so far
> have been mex source code (no dll), either to be compiled by
> the user into useful (I hope) functions to be called by
> anyone (even non-mex programmers), or as examples for other
> mex programmers to use.
>
> James Tursa
 

Yes. mex, when accompanied by the source, is
fine for anyone. Although I won't look at those
submissions because I don't do C. I heard a
rumor once that it causes cancer in laboratory
rats. 8-) Of course, I may have been the one
who started that rumor, but have you ever seen
a laboratory rat who programmed in C and
survived?

Without the source code its no longer portable,
a big problem for someone on a different OS
than you.

John

Subject: Submission of p-code

From: Yi Cao

Date: 26 Feb, 2008 14:03:02

Message: 24 of 46

>
> But I have not seen any good reason offered
> on why one would insist on submitting a
> p-coded file.
>

I submitted most of my files in open-code except one,
Bidirectional Branch and Bound Minimum Singular Value
Solver (B3MSV). I do have a genuine reason to do so. The
code is a result of my research work, which I do think it
has both scientific and educational values. Therefore, I
wish to submit it to FEX. I also wish to put a reference of
the FEX link in the paper, which I submitted to a journal
to describe the work so that readers of the paper are able
to find the code. However, I do not wish to open the source
code before the paper actually published. For this reason,
I submitted the code in p-code and included the FEX link in
the paper before it was submitted. My intention is to
update the code with the source code after the paper
actually published. I cannot think of any other alternative
way, which is able to satisfy all requirements without
using p-code.

Yi

Subject: Submission of p-code

From: John D'Errico

Date: 26 Feb, 2008 14:27:02

Message: 25 of 46

"Yi Cao" <y.cao@cranfield.ac.uk> wrote in message
<fq166m$bnn$1@fred.mathworks.com>...
> >
> > But I have not seen any good reason offered
> > on why one would insist on submitting a
> > p-coded file.
> >
>
> I submitted most of my files in open-code except one,
> Bidirectional Branch and Bound Minimum Singular Value
> Solver (B3MSV). I do have a genuine reason to do so. The
> code is a result of my research work, which I do think it
> has both scientific and educational values. Therefore, I
> wish to submit it to FEX. I also wish to put a reference of
> the FEX link in the paper, which I submitted to a journal
> to describe the work so that readers of the paper are able
> to find the code. However, I do not wish to open the source
> code before the paper actually published. For this reason,
> I submitted the code in p-code and included the FEX link in
> the paper before it was submitted. My intention is to
> update the code with the source code after the paper
> actually published. I cannot think of any other alternative
> way, which is able to satisfy all requirements without
> using p-code.
>
> Yi

I'll admit to some minor sympathy for this
reason. But it seems to me that if its just
a time lag before the paper is published,
then why not just choose to wait to submit?

The problem is that if you do submit the
p-code, then what happens if you never
get around to changing it back to the
m-file version?

So lets concede I might be willing to trust
your p-code. Then why can't some other,
less scrupulous individual, post their viral
p-code? They too will claim to be waiting
for publication.

John

Subject: Submission of p-code

From: Yi Cao

Date: 26 Feb, 2008 15:49:03

Message: 26 of 46

>
> I'll admit to some minor sympathy for this
> reason. But it seems to me that if its just
> a time lag before the paper is published,
> then why not just choose to wait to submit?
>

If so, I could not include the FEX link in the paper. Then,
readers of the paper would not know where to download the
code.

> The problem is that if you do submit the
> p-code, then what happens if you never
> get around to changing it back to the
> m-file version?
>

I will because it is my interest as well to make the code
educationally valuable.

> So lets concede I might be willing to trust
> your p-code. Then why can't some other,
> less scrupulous individual, post their viral
> p-code? They too will claim to be waiting
> for publication.
>
> John
>

If open code is important for making decission whether or
not to download the code, then just wait until the paper is
published and the m-code is submitted.

Yi

Subject: Submission of p-code

From: Matthew Simoneau

Date: 26 Feb, 2008 16:37:02

Message: 27 of 46

Yi, we can work with you to give you a URL. Feel free to
contact the administrator, files@mathworks.com, and explain
that you'd like to submit something, which determines the
ID, but to have the submission left "unapproved" until the
paper is published. This way we don't need to make an
exception to our P-code policy.

Subject: Submission of p-code

From: Tim Davis

Date: 26 Feb, 2008 17:16:01

Message: 28 of 46

"John D'Errico" <woodchips@rochester.rr.com> wrote ...

> Yes. mex, when accompanied by the source, is
> fine for anyone. Although I won't look at those
> submissions because I don't do C. I heard a
> rumor once that it causes cancer in laboratory
> rats. 8-) Of course, I may have been the one
> who started that rumor, but have you ever seen
> a laboratory rat who programmed in C and
> survived?

John brings up a good point here ...

<humor>

It's well known lack of C in rats at C leads to scurvy,
although rats *in* C tend to drown before they die of
lack of C. Or maybe those are just pi rats (rats(pi)
for you purely M coders).

(no fear, I will go nowhere near making any puns about
P code ... none what-so-ever).

</humor>

;-)

Subject: Submission of p-code

From: John D'Errico

Date: 26 Feb, 2008 17:26:02

Message: 29 of 46

"Tim Davis" <davis@cise.ufl.edu> wrote in message
<fq1hgh$p72$1@fred.mathworks.com>...

> (no fear, I will go nowhere near making any puns about
> P code ... none what-so-ever).
>
> </humor>
>
> ;-)

OH MY GAWD! Now I understand the
meaning of the phrase "IP address"

Its just down the hall.

(Hey, Tim refused. Not me.)

John

Subject: Submission of p-code

From: Doug Schwarz

Date: 26 Feb, 2008 17:35:28

Message: 30 of 46

In article <fpvqe2$gti$1@fred.mathworks.com>,
 "Paul Mennen" <nospam@mennen.org> wrote:

> > There are really good arguments on both
> > sides from both a philosophical and a tactical level.
> > Helen Chen
>
> I haven't seen any good arguments on this thread or
> elsewhere on why p-code should be banned from the File
> Exchange. Doug makes some good points on why he doesn't want
> to use downloaded p-code but even he admits that such code
> may be beneficial to others in the Matlab community.

Please do not generalize my statement. I made that statement about
plt.p only because through your participation in this newsgroup I have
gotten to trust you.

I am completely in support of not allowing p-code as a policy and it's
not reasonable for TMW to allow p-code from some individuals and not
others.


> The most appropriate format for the vast majority of the
> File Exchange files is certainly .m and most submissions
> would use that format regardless of whether .p code was
> allowed. For the few submissions where .p code is more
> appropriate, what is the harm in allowing it? Each user has
> the option of downloading it or not.

When is it ever an advantage to the user to have p-code in lieu of
m-code? Never. It is only ever an advantage to the author. You must
understand why the use of p-code is risky. For some reason you don't
want to believe that that risk extends to your p-code. Only you know
for sure that your code is benign, no one else does.


> If there isn't a good reason for the policy, wouldn't it
> make more sense to re-evaluate the policy instead of
> scowering the file exchange to expunge files that users may
> find useful? Also it appears not everyone at TMW has the
> same opinion. The TMW plt reviewer clearly knew it was a .p
> file yet still thought it merited the POW distinction (pick
> of the week).

A dissenting opinion from a MathWorker does not change the policy.
Beside, I think it's likely that the reviewer simply did not think about
these issues. That's why policies exist, so each employee doesn't have
to think through each issue.


> > That said, it is our policy at MATLAB Central that all p-
> > code published must have the supporting m-files supplied.
>
> That's inconsistent at best. It makes no sense to submit
> both p-code and m-code. (The p-code is quite easily
> generated from the m-code). The reason for p-code's
> existence as it was explained to me was to allow m-code to
> run without revealing the source. So what is the advantage
> of distributing p-code along with the source that generates it?

None whatsoever. I conclude that the policy should be amended to
disallow p-code completely.

Paul, I don't know why you are so hesitant to release plt.m as that is
your business, but if you want to distribute plt.p you are free to set
up your own web site and do so.

--
Doug Schwarz
dmschwarz&ieee,org
Make obvious changes to get real email address.

Subject: Submission of p-code

From: Paul Mennen

Date: 26 Feb, 2008 23:21:02

Message: 31 of 46

"Bill " <william.nospam.a.cobb@gm.com> wrote
> Oh, the reason my missle warhead flew back at the jetliner
> that launched it was because the trajectory code was a p-
> code from the Mathwork's user submitted website.

I was talking about my plt tool for exploring the data in
your workspace or specific variables that you specify.
What that has to do with controlling your missile isn't
clear to me. Plotting requires a human (or perhaps a real
smart monkey) to interpret, and I suspect if a human was
part of you missile warhead control loop, he/she would
be the least reliable link. Regarding your control loop,
I'm not even sure you should trust .m code from the FEX.

> The author was really proud of it and promised that it
> was bug and sneak circuit-free.

Anyone who promises that their code (executable or source)
is bug free is likely quite inexperienced and would cause
me to be even more wary of their code. Any modestly
complex, interesting, or novel piece of software probably
has bugs. Granted that without the source code, you would
have no way to fix the bugs on your own. But for some code
you probably don't even want this ability. If your compiler
screws up, is your first inclination to role up your
sleeves to dig in? If someone offered you a tool to make
your programming easier (say a better lint or some such
thing) would you refuse to use it on your missile project
just because the source code was not provided?

> Gimme a break. We used to call this ego-coding: You are
> just so proud of it and don't want to share.
> Your effort will die on the vine.

Now now, just because I was offering something that you
happened not to want is no reason to get insulting. I'm
no more an ego maniac than the many thousands of shareware
and freeware authors out there offering tools in executable
forms. I have my reasons for keeping the .m private which
I already stated. Although I was starting to soften up
after reading some of the more polite posters ... until
that is, I read your posting.

~Paul

Subject: Submission of p-code

From: Yi Cao

Date: 27 Feb, 2008 15:01:03

Message: 32 of 46

"Vihang Patil" <vihang_patil@yahoo.com> wrote in message
<fou4v5$jfi$1@fred.mathworks.com>...
> What guarantee is there that
> > the associated m-file in the post was actually the one
> used
> > to generate the p-code? Does the Mathworks actually
check
> > this and provide some protection here? I don't know.
> >
> > James Tursa
>
> So are we expecting a new genre of viruses called the "p-
> code" virus? Sounds exciting and terrifying. I hope
Norton
> and other antivirus solution providers think of this
> possible threat.
> Vihang
>

From R14 onwards, 'depfun' should be able to get rid of
such risks since it can show almost all calling dependency
of the questioned p-code. Of cause, depfun cannot always
detect all dependent calls and some calls may even never
happend. However, by saying so, there is also a similar
risk in m-file if the file is too long (such as a GUI code)
for a human being to check what is going on in the code.
Does anyone realy check a GUI file you downloaded line by
line? A GUI file can also produce a figure file, which is
in binary code. Would anyone question the safety of such a
file? It may hide a 'virus' in it!

So, in my opinion, safety is not a valid argument to ban p-
code in the FEX. However, I can accept the educational
argument.

Yi

Subject: Submission of p-code

From: Vihang Patil

Date: 27 Feb, 2008 15:49:02

Message: 33 of 46

Wow!!!!! What a debate this thing on P Code is going on.
Know I know, why we all people using Matlab are so
emotionally bonded to it.
The reason!! A small question by the O.P "whether a P Code
is allowed on FEX", lead to such a long resoning and
discussion.

This is something, I guess computer or AI can never do.
It would have had been much more simpler
Like
O.P: "whether a P Code is allowed on FEX"
A.I: No
O.P: Why?
A.I: Matlab Policies...
THE END!!!
<giggles>

And I thought putting a Rocket on the Moon was much more
easier. But Hats off to all of us "THE MATLABEERS"

*/ <Humor>

It goes down much easier with "Matlab and Beer"
Cheers to All!!!

Vihang

Subject: Submission of p-code

From: Tim Davis

Date: 28 Feb, 2008 00:14:03

Message: 34 of 46

Yo ho yo ho, a pirate's life fer me.

I am a sorry pirate mate
with nary a hair upon my pate.
I likes to steal at quite a rate,
all the codes ya'll create.
With codes in C for odes at sea,
and codes in M fer the rest of 'em.

I'll sing a tale or sorry ode
of matrices, I know 'em cold.
But when I looked into the M
to see what methods he used for 'em,
and ask to know, if truth be told,
the algorithm, could it be knowed?
Alas it was p-code!

Yo ho yo ho, a rats(pi) life fer me!

Subject: Submission of p-code

From: Yumnam Kirani Singh

Date: 28 Feb, 2008 04:59:27

Message: 35 of 46

Nice ode! I posted a message yestarday regarding the marketing prospect of p-code. But unluckily no a single response I recieved. I have developed a code for prevention of software and music. I am thinking of marketing plan for it.

Subject: Submission of p-code

From: roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)

Date: 28 Feb, 2008 06:37:08

Message: 36 of 46

In article <2939092.1204174797418.JavaMail.jakarta@nitrogen.mathforum.org>,
Yumnam Kirani Singh <kirani.singh@gmail.com> wrote:
> I have developed a code for prevention of software and music. I am
> thinking of marketing plan for it.

Code for the prevention of music? So if I have a laptop
with me on the bus and someone turns up their music player too loud,
would I be able to run your program and remotely control their
music volume? What happens if they are listening to Industrial Rap
or something else that one would be very hard pressed to define
as being "music" ?
--
   "No one has the right to destroy another person's belief by
   demanding empirical evidence." -- Ann Landers

Subject: Submission of p-code

From: Vihang Patil

Date: 28 Feb, 2008 10:20:08

Message: 37 of 46

roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson) wrote in
message <fq5kqk$250$1@canopus.cc.umanitoba.ca>...
> In article
<2939092.1204174797418.JavaMail.jakarta@nitrogen.mathforum.
org>,
> Yumnam Kirani Singh <kirani.singh@gmail.com> wrote:
> > I have developed a code for prevention of software and
music. I am
> > thinking of marketing plan for it.
>
> Code for the prevention of music? So if I have a laptop
> with me on the bus and someone turns up their music
player too loud,
> would I be able to run your program and remotely control
their
> music volume? What happens if they are listening to
Industrial Rap
> or something else that one would be very hard pressed to
define
> as being "music" ?
> --
> "No one has the right to destroy another person's
belief by
> demanding empirical evidence." -- Ann
Landers


I guess he left the word "Piracy" out
I think he has probably developed a P=Code that prevent
software and music piracy
O.P:"I have developed a code for prevention of software
and music" <"piracy">.
Vihang

Subject: Submission of p-code

From: Yumnam Kirani Singh

Date: 28 Feb, 2008 11:08:08

Message: 38 of 46

Sorry for confusion created due to missing of the word Piracy. ( Prevention of software and music piracy), as Patil suggested.

Subject: Submission of p-code

From: roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)

Date: 28 Feb, 2008 13:07:21

Message: 39 of 46

In article <30502146.1204196918764.JavaMail.jakarta@nitrogen.mathforum.org>,
Yumnam Kirani Singh <kirani.singh@gmail.com> wrote:
>Sorry for confusion created due to missing of the word Piracy. (
>Prevention of software and music piracy), as Patil suggested.

Software alone CANNOT prevent software or music piracy. The best
software alone can do is slow piracy down. Seriously.

The fact that your source code will be encrypted in the .p file
just slows down breaking your encryption. Do you think that
"DVD John" had access to the source code when he broke DVD
encryption?

--
   "Any sufficiently advanced bug is indistinguishable from a feature."
   -- Rich Kulawiec

Subject: Submission of p-code

From: Paul Mennen

Date: 14 Mar, 2008 17:47:02

Message: 40 of 46

> Paul, I don't know why you are so hesitant to release
> plt.m as that is your business, but if you want to
> distribute plt.p you are free to set up your own web
> site and do so.
> Doug Schwarz - dmschwarz&ieee,org

Well part of it is that it is an embarrassing mess ...
I've been planning on cleaning it up and adding
comments for some time now :)

I just fixed a few bugs and put an update of plt on the
file exchange. I still think for this type of tool most
users are better off not looking at source code, so I still
have it in .p format. However Doug and others have convinced
me that some people really do need the .m source before
considering any matlab code so I have decided to provide it.

I decided to put it on my own site instead of the File
exchange since I was worried about what rights that
gives TMW for it. I don't mind if you guys use it, even
for money making propositions, but I don't think it would
be right for TMW to do that. (Ok, like most authors, I
probably have an inflated view of my program's utility,
but that's my reasoning.)

So if you want the source, just go to my web site
(www.mennen.org) and click on the plt link (almost
at the top of the page). You can convert it to .p
if you like to see that it is the same as the version
on the file exchange.

~Paul

Subject: Submission of p-code

From: Star Strider

Date: 19 Mar, 2008 03:55:22

Message: 41 of 46

"Helen Chen" <helen.chen@mathworks.com> wrote in message
<foif46$17n$1@fred.mathworks.com>...
> Yumnam Kirani Singh <kirani.singh@gmail.com> wrote in
> message
>
<24497039.1202489169219.JavaMail.jakarta@nitrogen.mathforum.
org>...
> > Is submission of p-code allowed in MathWorks File-
exchange
> center?
>
> Hi Yumnam -
>
> You are welcome to submit your p-code as long as it is
> accompanied by the m-file. As someone else posted on this
> thread, our community value is for learning and teaching
> others how to use MATLAB. If you can't see how the code is
> written, the file is of little use.
>
> While we are talking about submissions, I'd like to
remin'od
> everyone that if you are bundling a bunch of files
together,
> please zip the files prior to submitting. We cannot
accept
> tar, rar or other compression file types as the File
> Exchange infrastructure needs to find the zip file type to
> index or reporting. Submitting the file in the appropriate
> format will expedite our review and approval of the file.
>
> Please feel free to contact post other questions or
contact
> me directly should you have any further questions.
>
> Best wishes to all,
> Helen Chen
> for the MATLAB Central Team



One concern I have about p-code is its portability. If TMW
decides to change the way the compiler writes p-code,
will "older" p-code files continue to run in the new
environment? With m-files this would not be a problem. It
would be relatively easy to delve into the m-files and
update commands that have become obsolete or whose
functionality has changed as MATLAB evolves. (I haven't
seen this mentoned but it's a long thread and I may have
missed it in my scanning.)

This is a technical issue I obviously know little about (I
don't routinely need to deal with it) so it may be a moot
point anyway.


Star Strider

Subject: Submission of p-code

From: Paul Mennen

Date: 19 Mar, 2008 16:00:20

Message: 42 of 46

"Star Strider" <skystriderDELETETHIS@ieee.net> wrote:
> One concern I have about p-code is its portability.
> If TMW decides to change the way the compiler writes
> p-code, will "older" p-code files continue to run in
> the new environment?

A valid concern, although it appears TMW makes an even
stronger effort for new versions to run old p-code
than for old m-code. (Or perhaps it is easier.) On
R2007b I've run p-code generated from versions as old
as R12.1 (2001) and I suspect even older would work.

The other direction is not true however. In general
p-code from newer versions do not run on older versions
of Matlab.

~Paul

Subject: Submission of p-code

From: Bill McKeeman

Date: 26 Mar, 2008 19:40:19

Message: 43 of 46

Just to clear up the situation on P-files in general, let
me offer the following information. With R2007b a new
algorithm was introduced for making P-files by changing
what the library function pcode.m actually does. Let us
call these the new-style P-files. MATLAB can no longer
make the old-style P-files.

Backward compatibility: MATLAB is able to execute old-style
P-files from much earlier verions. At some point in the
future, all of those old-style P-files will be deprecated,
and eventually they will not work. The workaround will be
to re-pcode the original M-file with a R2007b+ MATLAB.
Future versions of MATLAB are expected to run any new-style
P-file made with an older MATLAB, back to and including
R2007b.

Forward compatibility: Older versions of MATLAB will not
run M-Files that contain new features (of course). Except
for that, and perhaps some other unexpected future need to
change things, the new-style P-files are designed to be run
on any R2007b+ MATLAB.

Subject: Submission of p-code

From: Scott Hirsch

Date: 1 Apr, 2008 12:51:02

Message: 44 of 46

Just to make sure the horse is dead ...

There are two issues with a new version of MATLAB being able
to execute a p-file created in an older version. Bill
addressed what you could call binary compatible - the
ability for MATLAB to make sense out of the binary p-file.
There's also the issue of source code compatibility. I
wouldn't expect p-files to be any better than m-files in
this regard. i.e., if the corresponding m-file wouldn't run
(because it called an obsolete function, for instance), the
p-file won't run either.

Subject: Submission of p-code

From: Tim Davis

Date: 2 Apr, 2008 00:55:03

Message: 45 of 46

"Scott Hirsch" <shirsch.nospam@mathworks.com> wrote in message
> Just to make sure the horse is dead ...

To a dead horse, after choking on P-code:

The lanky beast on which I rode,
had had enough of dark P-code,
And when at last, at end of day,
When there was nothin' left to say,
I hitched my horse up to the post
upon The MathWorks newsgroup host;
I tied him with a lengthy thread,
and, by gum, he sure was dead.

Subject: Submission of p-code

From: roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)

Date: 2 Apr, 2008 01:05:16

Message: 46 of 46

In article <fsulh7$j2h$1@fred.mathworks.com>,
Tim Davis <davis@cise.ufl.edu> wrote:
>"Scott Hirsch" <shirsch.nospam@mathworks.com> wrote in message
>> Just to make sure the horse is dead ...

>To a dead horse, after choking on P-code:

Oh, there was some old P-code,
that swallowed a horse.
It died, of course.
--
  "The first draught serveth for health, the second for pleasure,
  the third for shame, the fourth for madness." -- Sir Walter Raleigh

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us