自动保存笔记本(或 mathematica 中的其他类型文件)文件 [英] Automatically saving notebook (or other type files in mathematica) files

查看:52
本文介绍了自动保存笔记本(或 mathematica 中的其他类型文件)文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我现在有时会遇到这个问题,部分原因是由于 Microsoft Office 会自动保存您正在使用版本和自动恢复处理的文件,因此我很懒惰.

I have been facing this problem for sometimes now, a laziness caused in part by the fact that Microsoft Office automatically save files you are working on with versions and automatic recovery.

很多时候,当我在 mathematica 中创建一个新笔记本来做一些测试或其他事情时,我经常忘记保存我正在做的事情.

Many times when I am starting a new notebook in mathematica to do some tests or whatever, I often forget to save what I am doing.

时不时地,根据我使用的电脑,电脑会崩溃,我所做的所有漂亮的工作都会永远消失......

Every now and then, depending on the computer I am using, the computer crashes and all the beautiful work I was doing is lost forever...

有没有办法绕过这个每隔五分钟疯狂保存我的文件的另一个方法?文件版本控制如何?

Is there a way to get around this other that manically saving my files every five minutes? How about file versioning?

顺便说一句:使用 MMA V8

BTW: Using MMA V8

推荐答案

关于自动保存,您可能需要查看 NotebookAutoSave 选项,该选项可以通过 Fromat-> 设置为 True;选项检查器.你必须选择Selected notebook",然后去Notebook Options ->文件选项,并将NotebookAutoSave 设置为True.然后,您的笔记本将在每次评估后保存.这是否是一个令人满意的解决方案,当然要视情况而定.

Regarding autosaving, you may want to check out the NotebookAutoSave option, which can be set to True through Fromat->Option Inspector. You have to choose "Selected notebook", then go to Notebook Options -> File Options, and set NotebookAutoSave to True. Then, your notebook will be saved after every evaluation. Whether or not this is a satisfactory solution, of course depends on the situation.

但我的经验是,最可靠的方法是培养 CTRL+S 反射——这个方法永远不会让我失望,而且效果很好.

But my experience is that the most reliable way is to develop a CTRL+S reflex - this one never lets me down and is working quite well.

至于版本控制,使用包要容易得多,为此您可以使用 WorkBench,它通过 Eclipse 插件集成了对 CVS 的支持和对 SVN 的支持.对于笔记本,我建议您参考this SO 主题.您还可以找到this Mathgroup一些兴趣的讨论.

As for the versioning, it is much easier with packages, for which you can use WorkBench which has integrated support for CVS and support for SVN via Eclipse plugin. For notebooks, I refer you to this SO thread. You may also find this Mathgroup discussion of some interest.

编辑

对于 M8,出于自动保存的目的,您也可以运行

For M8, for auto-saving purposes you can probably also run

RunScheduledTask[NotebookSave[EvaluationNotebook[]],{300}]

但我暂时无法测试此代码

But I can not test this code at the moment

EDIT2

我刚看到这个帖子Toolbag 存储库 - 这也可能是问题中自动保存部分的替代方案(但另请参阅有关计划任务与 Dynamic 的相对优势的评论中的讨论)

I just came across this post in the Toolbag repository - which may also be an alternative for the autosave part of the question (but please see also the discussion in comments on the relative advantages of scheduled tasks vs. Dynamic)

这篇关于自动保存笔记本(或 mathematica 中的其他类型文件)文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆