12
$\begingroup$

I hope I am going insane and the I'm not seeing the snake about to bite me...

How does one view the code in the demonstration projects that one can download from wolfram.com?

It seems like all of them come down as an 'Authoring Notebook' and I cannot always get the notebook to show a view of the code the author used.

Some of the notebooks have the cells 'docked' and you can view the code by double clicking the cell. Others, do not show the icon on the cell brackets to open their content, but the demonstration still functions.

It appears the code is definitely available by looking at the plain text of the file.

Are authors encouraged to obfuscate the code in their demonstrations? If not please direct me to the snake...

$\endgroup$
3
  • 2
    $\begingroup$ Would you send a link to a particular demonstration, the code of which you have not been able to view? That way, we may see what you are experiencing. BTW, did you mouseover the places where the cell brackets normally appear. They may simply be hidden from view. $\endgroup$
    – DavidC
    Apr 29, 2013 at 1:56
  • $\begingroup$ @DavidCarraher demonstrations.wolfram.com/BayessTheoremAndInverseProbability $\endgroup$
    – Sinistar
    Apr 29, 2013 at 15:12
  • 1
    $\begingroup$ It is in the works to make this locating of author notebooks from the Demonstration pages a bit more clea. $\endgroup$ Apr 29, 2013 at 20:39

3 Answers 3

7
$\begingroup$

Usually you can scroll down the cdf and find a "Download Source Code" button:

enter image description here

Clicking this button downloads another notebook where the code is explicitly visible.

$\endgroup$
2
  • $\begingroup$ OUCH!!! Snakebite! Help!!! $\endgroup$
    – Sinistar
    Apr 29, 2013 at 15:13
  • 1
    $\begingroup$ Let me just note that this is quite ridiculous. $\endgroup$
    – rubenvb
    Nov 20, 2013 at 16:11
3
$\begingroup$

On other browsers/platforms, you may see this:

screen cap

and if you click on (preview) you'll see this:

screen cap 2

although you can't copy this, because it's a GIF...

$\endgroup$
1
  • 2
    $\begingroup$ But you can click "Download Author Code" and you will get the notebook where the code is explicitly visible. $\endgroup$ Feb 16, 2014 at 16:20
2
$\begingroup$

In order to see the code in the demonstration files, you simply click on the right bar of the section with the code, and select 'convert to input form'...

Then you can copy the entire code snippet and paste it into your new file, where it will then get syntax formatting & coloring.

convert cell to 'input form'

$\endgroup$
1
  • $\begingroup$ You don't get to see code in a demo file, that is precisely the issue that is discussed. You do not get to see the cell structure to do a Right Click. $\endgroup$ Feb 14, 2019 at 14:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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