48

For the TL;DR crowd The Wolfram Cloud is envisioned as the precursor to the omniscient central computer often depicted in science fiction. It runs on the Wolfram Language (WL) and the Wolfram Knowledgebase (KB). The Programming Cloud lets you write web applications in WL hosted on their infrastructure. This targets commercial developers, with a huge ...


21

Here is one solution based on encoded package. To create a pack you have to create a .m file (in this case mailPack.m). There is one example using gmail configuration: BeginPackage["mailPack`"] sendMail::usage="sendMail[subject, body, to, file] send mail using myMail"; Begin["`Private`"] sendMail[subject_,body_,to_,file_:None]:= SendMail[ "To"->to,...


16

You are looking for $CloudEvaluation system variable. For example: $CloudEvaluation (* False *) and CloudEvaluate[$CloudEvaluation] (* True *)


16

Tips: When you put stuff in the cloud it's good to use your short URL in the URI (or copy it in after to shrink down the link length and scariness): CloudPut[1, "user:b3m2a1/whee"] CloudObject["https://www.wolframcloud.com/objects/b3m2a1/whee"] The cloud happily makes this really easy. Say we just want to distribute some expression to someone. All we ...


14

I have no personal experience with versioning/sharing in Mathematica yet, but my group and I have come to the point where we have to consider these options, so I have been looking around a bit. I can't say that I have any definitive answer, but this is what I've learned from perusing this community's archive. First of all, in order to share Mathematica ...


13

Cloud symbols are stored in cloud objects (under $CloudSymbolBase) and local symbols are stored in local objects (under $LocalSymbolBase), which can be addressed using CloudObject and LocalObject respectively. DeleteFile can be used for both cloud and local objects, for example DeleteFile[CloudObject["MySolution", $CloudSymbolBase]] DeleteFile[...


13

In my opinion, Mathematica's XML template feature makes this quite easy. You'd write your HTML code for each page using XML templates, and then populate the templates with data as necessary using TemplateApply. The collection of XML templates that make up the website would be what other systems call a "theme". This can be used either to build a static ...


12

The quick fix is to use Manipulate's SaveDefinitions, making it responsible for storing dependencies: f = Sin[x]; CloudDeploy[ Manipulate[Plot[f, {x, 0, t}], {t, 1, 15}, SaveDefinitions -> True] ] I don't know if that is expected, maybe Documentation sticks to the wording precisely here. So it happens because f is not needed to evaluate Manipulate (it ...


12

This small note describes the method I use. I've been using this method for years. (all of my web site is written in Latex actually, and converted to HTML. First I used to use latex2html then switched to tex4ht few years ago as it is better supported and it comes with texlive). To use Mathematica to generate HTML, the idea is to mix Latex inside the ...


12

I haven't used these submarined functions for EC2, but I have found the S3 functionalities in this package to be extremely useful. Since there is currently no documentation in v11.3, I thought at the very least I could share a brief guide to the most important operations. Setup AWS CLI AWSLink uses the AWS command line tool under the hood, so you need ...


12

I'm not sure yet what exactly changed – maybe the underlying "Reference.nb" stylesheet or our handling of N or Inherited (see below). We don't officially support documentation notebooks in the cloud yet (so we don't actively test that stylesheet), but, of course, this should "just work". So it's a little embarrassing this got slower. Sorry. In cases like ...


11

In general, packages need to be placed in the Applications directory within $UserBaseDirectory. $UserBaseDirectory has different locations on different systems. With standard Mathematica, we can just evaluate $UserBaseDirectory to find this location, e.g. on a Windows system: $UserBaseDirectory (* "C:\\Users\\JoeUser\\AppData\\Roaming\\Mathematica" *) ...


11

This is not an anwser to produce live/production code for websides. (yet) I guess it's not what you want because its not very sophisticated but one could use MMA to make a good html code emitter directly from Mathematica Expressions. We just write a function html which repeatedly calls itself on the subexpressions till it reaches "atomics" we can directly ...


11

Good to hear it (almost) works! The header is a docked cell, so, to remove it, you could evaluate SetOptions[EvaluationNotebook[], DockedCells->{}] in the notebook (before you publish it to the cloud). To upload a whole directory to the cloud, you can use CopyDirectory["localpath", CloudObject["cloudpath"]] (with localpath and cloudpath set ...


10

Is this what you are after? SetOptions[ EvaluationNotebook[], CellEpilog :> ( SelectionMove[EvaluationNotebook[], All, EvaluationCell]; SelectionMove[EvaluationNotebook[], After, CellContents]; ) ]


10

Fun Example I've made use of that here. I stuck the notebook in an accordion with an opener-thumb so I could generally display the page with it closed: But people reading the tutorial can click on the thumb to open a notebook in which to run the code: Explanation Yes! And it's easy! The trick is to use the notebook that gets loaded here: "https://...


10

What you are getting is not "CDF format" but a Mathematica Dataset. You should also note that you are trying to convert and serve a dataset that has 45716 entries. This might well run into limits (cputime, memory, transfered data) of an APIFunction. I am also not sure whether WRI will allow you to provide a possibility to download complete resource-data ...


10

I made use of an undocumented API for Mathematica cloud notebooks to write a little set of JavaScript functions that can be used to do just this, parsing Mathematica cells out of a browser URL. I then put this up here: https://www.wolframcloud.com/objects/b3m2a1/WLFiddle I have to other versions of this for slightly different use cases, too: https://www....


10

They work, but you need to a) write stylesheet notebook expression or b) edit in desktop > upload and then set StyleDefinitions programmatically. Additionally SetOptions[EvaluationNotebook[], StyleDefinitions -> ...] may not refresh styles automatically but if you reopen the notebook it should be ok. Try it on a saved cloud notebook and reopen it: ...


9

Edit: For more on this Context trick see this: Importing an mx file into a context And just as full disclosure here's a note on it circumventing Protected: Mr. Wizard discovers context reassignment Original: So we can circumvent this with the Context[x]="new`" trick, I think, plus a versioning file to track things. We'll set up a $uploadVersion symbol ...


9

I thought I'd just briefly lay out what I do so people don't have to go to the link to my blog post in the question. The packages for all this junk are here, here, and here. Look for the things with Pelican and Py starting their names and the WebSiteDeploy function. The autodoc pages are here, here and here Step 1: pelican I wrote a venv wrapper, installed ...


9

This is largely answered by this guide page: https://reference.wolfram.com/language/guide/CloudFunctionsAndDeployment.html But I'll give a slightly expanded version of that. You can think of the I-O cloud functions by putting them into two groups: functions that mirror the conventional file system counterparts (Put to CloudPut, Save to CloudSave, etc) ...


9

You can use CloudObjects and CloudDirectory to find your files: objects = CloudObjects @ CloudDirectory[] {CloudObject["https://www.wolframcloud.com/obj/carlw/Base"], CloudObject[ "https://www.wolframcloud.com/obj/carlw/Copied Files"], CloudObject[ "https://www.wolframcloud.com/obj/carlw/Marathon"], CloudObject[ "https://www.wolframcloud.com/obj/carlw/...


9

Upload the file TensorSimplify.m to Base/Applications in your WolframCloud. Then <<TensorSimplify` loads the package.


8

If by matrix input you mean a grid of input cells, then I believe you have to make it yourself. Here's an example. (* Create a list of field names *) fields = Flatten@Outer[ "x" <> ToString@# <> ToString@#2 -> "Number" &, {1, 2, 3, 4, 5}, {1, 2, 3} ]; fieldNames = First /@ fields; (* Take a FormObject and create a grid of ...


8

So, let's hope this will be fixed in the next version. Until then this simple workaround, using "Binary" as an intermediate format, will do it: CloudDeploy@ FormFunction[{"data" -> "Binary"}, ( CloudPut[#data, "excelFile"]; "Uploaded XLSX" ) & ]...


8

It is not a secret how many credits are used by a certain type of operation: This information is available here.


8

It turns out to be a simple issue of geography: if your userid is registered in one geographic location, WPC appears unable to produce reports if accessed from a different geographic location. Rather counter-intuitive for a cloud service, I would say.


8

Read was only necessary because of a bug. It has now been fixed according to Joel Klein's answer. "Execute" doesn't seem to be enough. You also need to give users permission to read: obj = CloudDeploy[ FormFunction[{"country" -> "Country"}, Show[#country["Flag"], ImageSize -> 600] &, "SVG"], Permissions -> "rx"] Follow up: I asked ...


8

Instead of having FormFunction directly convert CSV input into a table of values, upload the CSV file to a CloudObject and do the CSV import in the cloud: CloudDeploy[ FormFunction[{"x" -> Interpreter[Restricted["UploadedFile", "CSV"]]}, Dimensions[Import[#x, "CSV"]] & ], FileNameJoin[{$CloudRootDirectory, "CSVRestrictedUploadedFile"}], ...


Only top voted, non community-wiki answers of a minimum length are eligible