A Better Way to Share Notebooks with Mathematica Online

Kelvin Mischo 
Wolfram Research, Inc.

Join the Conversation #WolframTechConf

Mathematica Desktop Notebooks

When emailing notebooks or posting on the web

Organization is sometimes difficult, especially for the recipient

Version control is sometimes difficult (who might not have most recent courseware update)

Wolfram Cloud vs Mathematica Online

Wolfram Cloud is the central enabling infrastructure for all Wolfram’s cloud products and services

Hosting and computation power for applications (web or otherwise)

Cloud storage (documents, web sites, data sets)

iOS and Android Wolfram Cloud app

Full NB’s in browser or app

Available private cloud environment

Plus many things that are only possible since it’s integrated with Wolfram Language

Wolfram Cloud is a technology- licensed via Wolfram Development Platform, Mathematica Online, and/or Wolfram Programming Lab

Share Notebooks with CDF

Wolfram Cloud eliminates the need for users to download CDF Player

Simple image processing application within a notebook

logo=Import["https://www.wolfram.com/development-platform/images/wolf-logo.png"]

Manipulate[Blur[logo, i],{i, 1, 10}]

Notebook results can be shared with CDF running on Wolfram Cloud

CloudDeploy[
Manipulate[Blur[logo, i],{i, 1, 10}, SaveDefinitions->True],
Permissions->"Public"
]

Notebook results can also be embedded into a Course Management System

EmbedCode[
CloudDeploy[
Manipulate[Blur[logo, i],{i, 1, 10}, SaveDefinitions->True],
Permissions->"Public"
], ImageSize->{400,350}
]

This essentially uses the CMS infrastructure to share notebook results

Share Notebook with Mouse-Driven Interface

Unified language for computation, web site creation, and web hosting

Start with a random sample of words

RandomSample[{"hat", "cat", "dog", "house", "car", "chair", "pants"},3]

WordTranslation["hat", "English"->"French"]

Can Table over CloudDeploy to create unique form and unique hyperlinks

urlList=Table[CloudDeploy[2],{3}];
ranWordList=RandomSample[{"hat", "cat", "dog", "house", "car", "chair", "pants"}, 3];
URLInsert=RotateRight[urlList,-1];

formList=Partition[Riffle[
Table[With[{quiz=quiz},
FormPage[{
{"transWord", "Translated Word:"}-> "String"
},
Function[If[#transWord==WordTranslation[ranWordList[[quiz]], "English"->"French"][[1]], "Correct!", "Incorrect, Try Again."]],
AppearanceRules-><|
"Title"-> Row[{Style["Translate English to French:", Blue],"&nbsp",Style[ranWordList[[quiz]], RGBColor[0.65, 0.07, 0.19]]}],
"Description"-> Hyperlink[Style["Click for Next Problem", 16], URLInsert[[quiz]]]|>
]],
{quiz, 1,3,1}
],
urlList
],2
];

Table[CloudDeploy[i[[1]], i[[2]], Permissions->"Public"], {i, formList}]

Full Notebooks in Browser

Sample courseware

Sharing Full Notebooks

Menu in Mathematica Online for sharing notebooks

Wolfram Language for larger groups

Store group of WolframID’s as a PermissionsGroup

group=CreatePermissionsGroup["KelvinWTC2016", {"kelvinm@wolfram.com", "adorsett@wolfram.com"}]

Change Permissions for a CloudObject to be the PermissionsGroup

obj1=CloudObject["BlurLogo.nb"]

SetOptions[obj1, Permissions->PermissionsGroup["KelvinWTC2016"]->{"Read"},
AutoCopy->True]

CloudShare[obj1, PermissionsGroup["KelvinWTC2016"]]

Email is automatically sent; notebook is in recipients list of notebook files in Mathematica Online

Running a Class with Mathematica Online

Databin to collect WolframID’s for a much larger class or audience

Create a Databin to store WolframID’s

bin=CreateDatabin[]

Create a web site to collect WolframID’s from students or audience

f=FormPage[{
{"first", "First Name:"}-> "String",
{"last", "Last Name:"}-> "String",
{"email", "WolframID / Email:"}-> "String",
{"dept", "Department / Field:"}->{ "Mathematics", "Physical Science", "Computer Science", "Life Science", "Engineering", "Finance/Business/Economics", "Social Science", "Other"}
},
(DatabinAdd[Databin["g2sjzmEs"], {#first, #last, #email, #dept}];
Rasterize[PieChart[Tally[Values[Databin["g2sjzmEs"]][[All,4]]][[All,2]], ChartLegends->Tally[Values[Databin["g2sjzmEs"]][[All,4]]][[All,1]]]])&,
AppearanceRules-><|
"Title"-> "Wolfram 201 Course",
"Description"-> "Add contact information to course roster"|>
];

CloudDeploy[f, Permissions->"Public"]

Shorten the URL and create name that is easier to type

URLShorten["https://www.wolframcloud.com/objects/44e9f7b8-6c98-41b6-a910-825c30ba2c0e", "KelvinWTC2016"]

Take a quick look at the data set

Values[Databin["g2sjzmEs"]]

Running a Class with Mathematica Online

Use Databin to add to PermissionsGroup

AddUsers from PermissionsGroup created earlier

AddUsers["KelvinWTC2016", "troys@wolfram.com"]

PermissionsGroup["KelvinWTC2016"]["Members"]

Grab the WolframID’s from the Databin created by the web site form

emails=Intersection[Values[Databin["g2sjzmEs"]][[All,3]]]

Expand the PermissionsGroup from 3 WolframID’s to everyone from web form

AddUsers["KelvinWTC2016", emails]

PermissionsGroup["KelvinWTC2016"]["Members"]

Give the newly defined group permissions to read and write notebook. AutoCopy creates unique file in your account

SetOptions[obj1,Permissions->PermissionsGroup["KelvinWTC2016"]->{"Read","Write"}, AutoCopy->True]

At any point in the future, it’s possible to check permissions for a particular notebook

Options[CloudObject["BlurLogo.nb"]]

Running a Class with Mathematica Online

Wolfram notification to students pointing to NB

Custom notification to students pointing to NB

URL’s can have more memorable names when sharing with students

URLShorten[CloudObject["BlurLogo.nb"], "KelvinBlur"]

SendMail is better for custom messages

Table[
SendMail[
"To"->ddroplist[[3]],
"Cc"->"kelvinm@wolfram.com",
"Subject"->"Wolfram Technology Conference- web app",
"Body"->"Hi "<>ddroplist[[1]]<>",\n\nI'm sending this email during my talk at Wolfram Technology Conference- it's a great way to share a NB with a large group. Click here to view the first CloudDeploy example I showed today: \nhttps://wolfr.am/KelvinBlur\n\nThe URL requires a Mathematica Online login. If you need a trial, just respond and let me know.\n\nBest regards,\nKelvin\nWolfram Research, Inc"
],
{ddroplist, Values[Databin["g2sjzmEs"]]}
]

Snapshot of the custom email

Running a Class with Mathematica Online

Projects can be graded using CloudShare

Students duplicate, complete work, share back with instructor

CloudObject["BlurLogo.nb"]

Questions & Comments

Please send us feedback

Kelvin Mischo
kelvinm@wolfram.com