Re: Save a notebook state
- To: mathgroup at smc.vnet.net
- Subject: [mg111554] Re: Save a notebook state
- From: "David Park" <djmpark at comcast.net>
- Date: Thu, 5 Aug 2010 06:59:08 -0400 (EDT)
Why not add two Sections to your notebook. 1) Long Calculations would contain the calculations that take a long time. Presumably this would be evaluated only once, but sometimes you might want to go back, modify and recalculate. If you have x = longCalculation[...] then immediately redefine x to be the output, perhaps by writing x = and using Shift+Ctrl+L to get the previous output. The cells in this Section would not be Initialization cells. 2) Copy the redefinitions from the Long Calculations section into a Restart Section and make these Initialization cells. (Do not save as an auto generated package.) Again, presumably the redefinitions will evaluate quickly. Then when you open your notebook and start to evaluate in some third section the symbols will all be quickly initialized and you won't have to go through the long calculations each time. David Park djmpark at comcast.net http://home.comcast.net/~djmpark/ From: slawek [mailto:slawek at host.pl] I have got a medium size .nb notebook, but the "evaluate notebook" command take about half a hour. The "save" command save only input cells (and comments etc.) - but the context (the values of variables) are not saved. Therefore after "open" I must "evaluate" to restore the state of computations from a previous session. An example: after loading saved notebook with In[1] := x = Simplify(1+1+1) Out[2] = 3 I have two lines in the Mathematica front-end, but: a. no kernel is loaded; b. the value of x is not 3, because x is not defined. Is it a way to save the notebook with all results, variables etc. to avoid re-calculation of formulas? I.e. a save .nb with a dump the state of kernel? slawek