The first basic example in the documentation of SparseArray:

s = SparseArray[{{1, 1} -> 1, {2, 2} -> 2, {3, 3} -> 3, {1, 3} -> 4}]

when executed and saved in a notebook triggers the following warning when that notebook is reopened: "This file contains potentially unsafe dynamic content." Apparently this is true of every notebook that contains a (computed) sparse array.

Is there a reason for keeping users of sparse arrays in a high state of alert?

Edited to Add: A screenshot for the skeptics:

enter image description here

Edited to Add 2: This document was saved to "/Users/grant/Desktop". Saving a copy to "/Users/grant/Documents" produced a document without the warning. Apparently desktops are unsafe.

  • $\begingroup$ The warning is not down to that code. You must have other material in the notebook that uses Dynamic $\endgroup$ Jan 28 '15 at 20:35
  • $\begingroup$ I open a new notebook, paste the line above in, execute it to get an "Out[1]", save the notebook, quit Mathematica, restart Mathematica, open the notebook, and there it is. $\endgroup$ Jan 28 '15 at 20:38
  • $\begingroup$ Mathematica v.; OS X v. 10.9.5. $\endgroup$ Jan 28 '15 at 20:44
  • $\begingroup$ explanation and solution below. $\endgroup$ Jan 28 '15 at 20:52

In version 10 Wolfram introduced some dynamic panels in output objects. These are intended to provide some useful brief information (I guess) about what is stored.

enter image description here

Because these panels are dynamic they trigger an unsafe dynamic content warning if the notebook is not in a trusted path. I prefer to switch this dynamic panelling off, which you can do by setting this system option:

SetSystemOptions["TypesetOptions" -> "IconicElidedForms" -> False]

When you do that the dynamic panel no longer appears in the output and consequently you do not get any unsafe dynamic content warnings.

enter image description here

  • 3
    $\begingroup$ +1 for the SetSystemOptions. These dyanmic panels are a nightmare on the Raspberry Pi version. If no one objects, I think it is worthwhile to include the RPi tag for future visitors trying to optimize the FE on that system. $\endgroup$ Jan 28 '15 at 21:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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