Is it possible to compare notebooks?

General discussion about Mathematica features and functionality...
Forum Rules
By using the Wolfram Faculty Program Forum, you agree not to post any abusive, obscene, vulgar, slanderous, hateful, threatening, or sexually oriented material. Wolfram Faculty Program Forum administrators have the right to remove, edit, move or close any topic at any time should we see fit.

Personal Information: Posts in this forum may be viewed by non-members; however, the forum prohibits non-members from viewing your profile. Although your email address is hidden from both non-members and members, your account is initially configured to allow members to contact you via email through the forum. If you wish to hide your profile, or prohibit others from contacting you directly, you may change these settings by updating your profile through the User Control Panel.

Attachments: Attachments are not currently enabled on this forum. To share a file with others on this site, simply upload your file to the online storage service of your choice and include a link to the file within your post. If your school does not offer an online file storage and sharing service, the following sites provide free basic online file storage and sharing: Mozy, FilesAnywhere, Adrive, and KeepandShare.

Is it possible to compare notebooks?

Postby Robert_Schor » Mon Jul 12, 2010 5:05 pm

In developing software (whatever the language), I rarely "get it right" the first time. As the software evolves, I find that (for safety) I have multiple versions. When I want to reconcile the versions, I typically use a "compare" or "difference" utility to show me the changes, allowing me to "keep the good" and "replace the bad".

Is there a "user-friendly" way to do this with Mathematica notebooks? I can, of course, just do a compare with a good programming text editor, but then lose the formatting (and have to make notes on paper rather than editing within Mathematica). I looked for "Compare" in Mathematica Help, but didn't find anything useful.
User avatar
Robert_Schor
 
Posts: 4
Joined: Thu Jun 03, 2010 9:22 pm
Organization: University of Rochester
Department: Neurobiology & Anatomy

Re: Is it possible to compare notebooks?

Postby telefunkenvf14 » Mon Jul 12, 2010 7:04 pm

I'm not sure if there's a best approach here, but here are a few things to consider:

The most basic approach I use is to always name my files in CamelCase followed by the date, for example: MyDescriptiveFileName07122010. When you up the file again on a new day, immediately 'save as' the new date, and then continue working. Wash, rinse, and repeat.

A second approach is to use the package 'A Worklife Framework', by David Reiss ($90 for academic/student users). His package includes features to automate the backup process, etc., and sort of forces you into a particular type of work-flow. A 'Diary' acts as the main hub for any particular project. You can then create regular and 'scratch' notebooks and 'packages' (and all of these are kept separate and organized for you, along with data or other files necessary for the project). David's a really nice guy, BTW.

http://www.scientificarts.com/worklife/screencasts/index.html (Click here to watch some screencasts of what can be done with the package.)

Download a trial version here: (I recommend the 3.0 version, 30-day trial) http://www.scientificarts.com/worklife/trial.html

Possible issue with the above approaches... Multiple file versions flying around can be a headache if you work on two machines. One tool that has worked well for me is Windows Live Sync (http://sync.live.com/); there's also a version for Mac, from what I've read. I started using Live Sync after encountering some issues with saving over networks (files became corrupted; probably due to the way my home network is configured; bigger files seemed to be more problematic).

A final approach you might want to consider is the Wolfram Workbench 2.0. I use this more and more as a way to move chunks of 'keeper' code out of scratch notebooks. The REALLY nice thing about developing in Workbench 2.0 is the 'history' feature. This lets you compare specific bits of code with past versions, side-by-side, and there are a number of handy features for finding and replacing symbols, function templates, adding options to functions/symbols, etc. If you have 'premier service' you should be able to get it for free. :D

http://www.wolfram.com/products/workbench/videos/ (I recommend you watch the 'introduction', 'documentation' and 'working with code and packages' videos if you're not familiar with Workbench)

Good luck!

-RG
User avatar
telefunkenvf14
 
Posts: 46
Joined: Tue Apr 27, 2010 7:40 pm
Location: Lincoln, NE
Organization: University of Nebraska-Lincoln
Department: Economics

Re: Is it possible to compare notebooks?

Postby Robert_Schor » Mon Jul 12, 2010 8:32 pm

Thanks for the comments. My problem wasn't saving multiple versions (safely) -- I use Subversion and commit changes frequently. I'm more interesting in dealing with "now what did I change here?", or "How do I extract the "good bits" from these six in-development versions?" I'll take a look at WorkBench ...
User avatar
Robert_Schor
 
Posts: 4
Joined: Thu Jun 03, 2010 9:22 pm
Organization: University of Rochester
Department: Neurobiology & Anatomy

Re: Is it possible to compare notebooks?

Postby telefunkenvf14 » Tue Jul 13, 2010 1:48 am

I've never used Subversion. You actually have that set up with MMA?

I think Workbench's ability to compare code side-by-side may be what you want.

What other languages do you code in?

-RG
User avatar
telefunkenvf14
 
Posts: 46
Joined: Tue Apr 27, 2010 7:40 pm
Location: Lincoln, NE
Organization: University of Nebraska-Lincoln
Department: Economics

Re: Is it possible to compare notebooks?

Postby Robert_Schor » Tue Jul 13, 2010 2:11 pm

telefunkenvf14 wrote:I've never used Subversion. You actually have that set up with MMA?

I think Workbench's ability to compare code side-by-side may be what you want.

What other languages do you code in?

-RG


I'm uncertain what "MMA" means. I am using the "Tortoise" implementation of Subversion (search for Tortoise SVN) and a repository that has been set up on a Department server. I have created a "project" in the Repository for a folder where I keep my current Mathematica project(s) -- at the end of the day, I do a "Commit" to save any changes I make to the Repository. When I go home and want to "work on the latest version", I simply "Update" my home folder (or, if I'm "starting from scratch", I do a "Checkout"). In case I start to go down a "wrong path", I can always restore an earlier version ...

Not (yet) having Workbench, I did the "poor-man's approach" and opened the old and the new version in Mathematica in side-by-side windows and "let my eyeballs do the comparing". Not ideal, but better than working in the "raw" text form with a text editor's Compare feature.

I started programming in Fortran and PDP-11 Macro assembly language, moved to Pascal (which I still use, on occasion), then to Matlab (for data analysis). I've used MathCad for symbolic and algebraic work (much more intuitive than Mathematica), but I'm not sure it's "up" for my current project (hence my foray into Mathematica). I'm currently doing quite a bit of development with LabVIEW (which includes a Compare function in the development suite, fortunately, since the language is basically graphical).

BS
User avatar
Robert_Schor
 
Posts: 4
Joined: Thu Jun 03, 2010 9:22 pm
Organization: University of Rochester
Department: Neurobiology & Anatomy

Re: Is it possible to compare notebooks?

Postby telefunkenvf14 » Thu Jul 15, 2010 8:52 am

MMA is shorthand for Mathematica. (Hint: If you're in Mathematica and type 'mma' the program will use an auto input replacement and put 'Mathematica')

I've actually found that MMA (yes, I'm lazy) is quite intuitive, but it's important to learn the underlying fundamentals and how the language differs from some of the others you've seen. Most other languages seem to limit the paths one can take---and that can make learning them easier in the short run.

I'd highly recommend two books:

(1) Mathematica Navigator (get the 3rd edition and make sure it comes with the cd, which lets you install the whole book into the documentation center!!) You should be able to find it for around $50.
(2) Mathematica Cookbook (you may still be able to get it for $9.99; see my post: http://www.wolfram.com/faculty/forum/viewtopic.php?f=2&t=94#p185)

Finally, feel free to post examples of things that are causing you problems. The MMA user group, aka 'MathGroup', is also helpful. (http://groups.google.com/group/comp.soft-sys.math.mathematica/topics?gvc=2) If you ask questions, especially on MathGroup, make sure to provide examples and demonstrate that you've given an honest effort in solving your problem first though---the group is full of old pro's, some with little patience for time-wasters. (not trying to scare you off!)

Looks like you have an interesting array of programming experience. :) I also have Matlab and Maple, but rarely use them anymore. Most of my programming experience (prior to MMA) has been in SAS IML and Gauss. No compiling for me! :D

I'm currently trying to learn some Python, .NET, R, and SQL. (full plate...)

-RG
User avatar
telefunkenvf14
 
Posts: 46
Joined: Tue Apr 27, 2010 7:40 pm
Location: Lincoln, NE
Organization: University of Nebraska-Lincoln
Department: Economics


Return to General Mathematica Discussion

Who is online

Users browsing this forum: No registered users and 1 guest

cron