0
$\begingroup$

NOTE: The prequel to my question has been answered before here

In the case of the question linked above, the author's code was available. But I would like to know if it is possible to reveal the code from a demo when the source code is not made available.

Example demonstration file can be found here.

GOAL HERE

How to release MMA demo files (NB or CDF) for distribution among class, and make sure that the user will not be able to see the back-end code by employing the technique as shown in this post answered by Jonathan

UPDATE: A comment from @Szabolcs

@Szabolcs "Select the manipulate, copy to another notebook, convert to input form there. But what's the point of this if the author code is available already?"

How do I restrict this? I do not want to reveal the code at all for my Manipulate. I just want to publish the demonstration alone using a notebook file.

demo

$\endgroup$
15
  • 1
    $\begingroup$ Select Source -> Download Author Code... I see the source code immediately. $\endgroup$
    – ktm
    Feb 14, 2019 at 15:12
  • 1
    $\begingroup$ It seems that OP intends to crack a code that is not shown by its author by intention, is it not? $\endgroup$ Feb 14, 2019 at 15:57
  • 2
    $\begingroup$ Select the manipulate, copy to another notebook, convert to input form there. But what's the point of this if the author code is available already? $\endgroup$
    – Szabolcs
    Feb 14, 2019 at 19:31
  • 4
    $\begingroup$ Please do not change the question. Open a new thread for a new question. Now the existing answers do not fit. $\endgroup$
    – Szabolcs
    Feb 15, 2019 at 15:13
  • 1
    $\begingroup$ BTW look up Encode and be aware that Mathematica is not terribly secure. A determined person may still be able to unlock your code. Example: With[{str = StringToStream[ "(*!1N!*)mcm\naZQzYV \ j/%/5#f$s@#K6cMR2?v\\ttttx`jv3._KTTV[VBmahZpd_!a8k!l+#+B'?kP,,>2\n\ nfplO6uDiA1Qpsg<h.E!oKc?\";(\\0 Yyhf(, "]}, Get[str]; Close[str]; ]. It defines fun upon evaluation. $\endgroup$
    – Szabolcs
    Feb 15, 2019 at 15:14

2 Answers 2

6
$\begingroup$

One method that I think works is to highlight the demonstration, copy it to a new Mathematica notebook, and then click "Convert to Input Form" on the cell.

Convert to input form.

The result of convert to input form.

$\endgroup$
2
  • $\begingroup$ Yes, so this is exactly what I want to restrict the user from doing so. Most Wolfram Demo have source code available, I want to release my own demo files to my peers without them able to do something like what you showed. Is it possible? If so how is basically my question. $\endgroup$ Feb 15, 2019 at 14:26
  • $\begingroup$ @abhilashsukumari if you wanted to ask about how to restrict access to the source code you should have asked about how to restrict access to the source code. Try asking that as a separate question. $\endgroup$
    – b3m2a1
    Feb 17, 2019 at 1:50
2
$\begingroup$

In the very end of the CDF document there find a button "Download source code". By clicking that you will have a Mathematica 11.2 notebook with the source code.

enter image description here

$\endgroup$
2
  • $\begingroup$ Read the NOTE in my question. I am specifically trying to see if it is possible to retrieve code when there is no explicit source code provided. $\endgroup$ Feb 14, 2019 at 15:42
  • 2
    $\begingroup$ It would be easier to respond if given an actual example of such a Demonstration. $\endgroup$ Feb 14, 2019 at 20:43

Not the answer you're looking for? Browse other questions tagged or ask your own question.