Group Abstract Group Abstract

Message Boards Message Boards

6
|
4.6K Views
|
11 Replies
|
11 Total Likes
View groups...
Share
Share this post:
GROUPS:

[WSG24] Daily Study Group: Getting Started with Mathematica and WL

POSTED BY: Arben Kalziqi
11 Replies
Posted 1 year ago

When do we expect to receive an email on final exam of the daily study group: Getting Started with Mathematica and Wolfram Language?

POSTED BY: Soomi Cheong

Hey Soomi! No final exam for this—just a quiz! (Also, I see your emails coming in but I'm way behind on everything that isn't Data Science Boot Camp right now!)

POSTED BY: Arben Kalziqi
Posted 1 year ago
POSTED BY: Soomi Cheong
Posted 1 year ago

Arben, the best instructor ever~ Yeah....

enter image description here

POSTED BY: Soomi Cheong
Posted 1 year ago

Awesome presentations this week.

Do you find yourself creating copies of notebooks or templates for each instance of a problem type? How do you manage gradual refinements of notebook templates? Are diff-ing and merging notebooks commonly done? Do you commonly create "hyperlinks" between notebooks? When do you recommend version control via Mathematica or Git?

POSTED BY: Ray Pereda

Thanks Ray! I can't say I'm the most organized notebook creator out there; back when I explicitly had research that I was working on with my notebooks I usually would just iterate live, keep comments, and save a new version of the notebook once I had made "significant enough" changes. I was often working with fairly chunky sets of data (high resolution topographies), so my workflow involved getting to the point where I'd do the relevant calculations, exporting to .mx, then commenting out the code and just reimporting the relevant things back in.

Here at Wolfram U, we do have a git repository where we keep all of our course materials. In some courses there are tables of contents which link to other notebooks, but largely we try and have everything web deployed (which we've mostly automated as well) so those links often just go to cloud notebooks rather than linking to local copies. Relatedly, there's some new functionality in 14.1 that may interest you: https://reference.wolfram.com/language/ref/Diff.html

POSTED BY: Arben Kalziqi

Somebody asked about useful resources about things like Histogram in today's session—here's a short list that has statistics-related materials which they may find relevant:

POSTED BY: Arben Kalziqi
Posted 1 year ago
POSTED BY: Ray Pereda

Subtle thing going on with NotebookDirectory[]—if the notebook exists at all as a file which was ever saved, then NotebookDirectory[] will return the save location, but it doesn't have anything to say about the "current state" of the notebook vs. its "saved state".

You can get something kind of related via NotebookInformation[]—namely, you can get a "saved" time and a "modified in memory" time. I thought that maybe taking their difference could be instructive, but I think that just running the code itself counts as "modified in memory", so you wind up getting the time in seconds since your last save with this:

Subtract @@ 
 Lookup[Association[NotebookInformation[]], {"MemoryModificationTime",
    "FileModificationTime"}]

As for the greyed out icon, maybe I can tell you another new thing re: macOS—the reason that that icon gets greyed out is that it's a fully-functional "link" to the file in question! When you have unsaved changes, the saved file and the "working file" no longer match up, so it greys out to indicate that the "link" is no longer active. But if you've got an up-to-date file open, you can drag that icon around and it will act like the file itself—that is, you could drag it onto this page to embed it in a post, or drag it over to an email to attach it, and so on.

In any case, I'm glad you're having fun with the code!

EDIT: However, if you're in another notebook, you can point to the Notebook of Interest as follows and this will work:

Subtract @@ 
 Lookup[Association[
   NotebookInformation[
    NotebookOpen[
     "path/to/NotebookOfInterest.nb"]]], {"MemoryModificationTime", "FileModificationTime"}]
POSTED BY: Arben Kalziqi
Posted 1 year ago
POSTED BY: Ray Pereda

Hey Ray! You should have gotten that notebook both in the recording email for that office hours session and in a follow-up to your latest email to us. As for seeing whether the notebook is currently saved to disk, the only relevant thing that comes to mind is the default OS-wise behavior in macOS that shows a little dot in the red "close" button to indicate that you have unsaved changes to the contents of the corresponding window. If you're okay with evaluating a line of code, NotebookDirectory[] will tell you where the notebook it's evaluated in is saved, or produce a failure message specifying that it isn't saved in the case that it isn't.

POSTED BY: Arben Kalziqi
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard