MathGroup Archive 2008

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: External packages, Manipulate, and MathPlayer

  • To: mathgroup at
  • Subject: [mg91710] Re: External packages, Manipulate, and MathPlayer
  • From: Jeff Bryant <jmbryant12 at>
  • Date: Sat, 6 Sep 2008 02:06:57 -0400 (EDT)
  • References: <g9qipl$4hv$>

   I'm not sure from your message exactly what form your authoring 
notebook is in, but some elements of your message seem suspect.

1) Packages require special attention in Demonstrations.

2) All code, except that which ships with Mathematica, must reside in 
the author notebook itself. You can't use Get or Needs on a third party 
package (the user may not have this package).

3) Encode[] should not be used for Demonstrations and may not even 
allowed to be uploaded by the security system. Demonstrations are "open 
code" which means methods of obscuring the code aren't allowed. In some 
cases, usually for compression reasons, data can be compressed using 
Compress[] and the resulting string can be stored and wrapped in 
Uncompress as in:

data := data = Uncompress[<large compressed string>]

But for packages the above shouldn't be necessary. (Note the caching 
trick which allows for compression to be maintained until runtime, but 
fast since it only needs uncompressed once during initialization)

4) You didn't specify at which point you are encountering problems. 
During authoring? Uploading? What errors are you getting?

The security system likely will complain about unknown contexts so using 
a custom package could trigger upload problems. Better to avoid these 
contexts and use the underlying code in the global context. Keep it simple.

If you still have problems, you can send the notebook directly to me 
(jeffb at and I will try to see if I see obvious problems. 
Make sure to provide any details such as errors, etc.

-Jeff Bryant
Wolfram Research, Inc.

dr DanW wrote:
> Has anyone figured out the rules for when you can Get[] an external
> package when you are creating a demo?  I am creating a demo where I am
> using some functions defined in another notebook, where this other
> notebook is just exporting initialization cells without any of the
> usual good-practice of BeginPackage[]...EndPackage[] or Protect[].
> This works fine without needing to Encode[] the resulting .m file.
> However, if in this auxiliary notebook I try to Get[] a third properly
> created package (with its own context and protected symbols) my demo
> cannot see any of the functions in it, whether or not I have used
> Encode[].
> The actual notebooks in question are too complicated to send to this
> group, and I have not yet been successful in isolating the problem to
> a simple set of notebooks that reproduce the problem.  I am sending
> this out in the hopes that somebody knows how to do this, because
> documentation on this issue seems to be a single paragraph on the
> Wolfram web site, and not that helpful.
> Daniel

  • Prev by Date: Re: genetic algorithms
  • Next by Date: Re: Rearrangement of expression
  • Previous by thread: External packages, Manipulate, and MathPlayer
  • Next by thread: Re: Re: External packages, Manipulate, and MathPlayer