26

Here are the two ways I have successfully used MongoDB with Mathematica. AFAIK much of this would also apply to similar DBs such as CouchDB. A. Easy way One working example used a third party Mongo supplier such as 28msec.io and use URLFetch e.g. With this supplier you can both read from and write to the database using HTTP GET and simple query strings. ...


25

Here is a list of the most important differences: webMathematica is a server side technology (the Mathematica code runs on the server) while Mathematica code contained in a CDF-Document runs on the client, either in the standalone player or the browser-plugin. This of course has many important consequences, see the sections below for more details. The UI ...


17

Maybe it is worth mentioning that webMathematica sites can be viewed without downloading and installing the 197 MB plugin. A lot of users (in companies, banks, institutions) just are not allowed to install anything at all and IT departments do not like big uncertified plugins. Furthermore a webMathematica page you can view on a any tablet or mobile phone. ...


16

Mathematica can also connect to Neo4J via the REST API. Instructions for use on OS X: 1. Install Neo4j 2. start the webserver $ sudo apachectl start 3. start Neo4j (installation in usr/local/bin) $ neo4j start 4. Make sure all is working 127.0.0.1:7474 Examples: URLFetch["http://localhost:7474/db/data/node", {"StatusCode", "Content"}, "Method" -&...


14

What you did with setting the "com.wolfram.jlink.libdir" property will work. Perhaps you didn't enter the correct path, or you used the wrong JLinkNativeLibrary.dll file (meaning you used the 32-bit one from JLink/SystemFiles/Libraries/Windows, instead of the 64-bit one from JLink/SystemFiles/Libraries/Windows-x86-64, or vice-versa). But you really shouldn'...


14

For MongoDB instead of using the Rest interface using urls as suggested by Mike, you can use the Java driver. Here's the proof of concept that should allow a lot of fruitful things ... I'm still amazed by the possibilities offered by JLink. Prerequisites Install MongoDB, for example on Windows http://docs.mongodb.org/manual/tutorial/install-mongodb-on-...


12

I have an open-source MongoDB Mathematica driver here: https://github.com/zbjornson/MongoDBLink. There are quick setup instructions and an overview in the readme. It's built on the official Java driver, like @faysou's answer, but it's optimized to reduce the JLink overhead when serializing/deserializing many documents. It also transparently maps some of the ...


12

Here is one example of how to create a neo4j connection using JDBC driver from this git. The steeps are: 1- Put the JAR file (neo4j-jdbc-2.0.1-SNAPSHOT-jar-with-dependencies.jar) together with other jar drivers in: FileNameJoin@{ $InstallationDirectory, "Contents/SystemFiles/Links/DatabaseLink/Java"} 2- Restart you Mathematica 3- Now, using Movie Graph ...


10

The different HTML entities are stored in System`Convert`MLStringDataDump`$HTMLEntities on version 9 and from here, it's a simple StringReplace: StringReplace["<select></select>", System`Convert`MLStringDataDump`$HTMLEntities] (* "&lt;select&gt;&lt;/select&gt;" *)


9

Install version 11.3 of the player, write your script.wl and run wolframscript -f script.wl If you want a GUI check https://github.com/mmatera/iwolfram and run jupyter remotely. On AWS VM run jupyter-notebook --no-browser --port=7000 then on you local machine ssh -NfL localhost:7000:localhost:6001 <IP>)


8

Something like: ExportString[Cell[TextData["<select></select>"],"Text"],"HTML","FullDocument" -> False] produces: <p class="Text"> &lt;select&gt;&lt;/select&gt; </p> which might also be a good start.


8

I think what you want is script style. You can enter letters in that style in two ways: For example, \[ScriptCapitalT] $\mathcal{T}$ or alternatively by the keyboard commands ESCscTESC Other letters would be entered in complete analogy by replacing T witht the letter you want. All the available glyphs are found in the "special Characters" palette ...


7

From Oleksandr's comment: This usage is not permitted by the Mathematica license: you need webMathematica, even if technically you don't. Practically speaking, it's not possible with no extra software at all since Mathematica has no facilities to work with TCP sockets, but you can use Java, a .Net language, or C to fill in the gaps. The specific ...


7

Inspired by @eldo's ContourLabels, a variation that gives color-coded points for labels: ListContourPlot[RandomReal[1, {10, 10}], InterpolationOrder -> 3, PlotLegends -> Automatic, Contours -> 10, ContourLabels -> (Tooltip[Graphics[{PointSize[.02], Hue[#3], Point[{#, #2}]}][[1]], Column[{Row@{"{x, y} = {", #, " , ", #2, "}"}, Row@{"z = ", #...


6

Wolfram Language version 11.3 now has support for interfacing with MongoDB. You can connect to a MongoDB database via MongoConnect. For example, connecting to a database running locally: In[1]:= Needs["MongoLink`"] client = MongoConnect[]; MongoGetDatabaseNames[client] Out[2]= {"Test", "admin"}


6

You probably shouldn't put that package into the $InstallationDirectory, there are $BaseDirectory for system wide installations of packages and $UserBaseDirectory for user specific installations (As Alexey Popkov has indicated these did supersed $AddOnsDirectory and $UserAddOnsDirectory of earlier versions. These still exist for compatibility, but probably ...


6

Trigger an external event Edit Don't you dare to close this question! :) I've to say, that for the Java/MathPackage part of this answer I've used Workbench plugin within eclipse/Juno and again I've to agree with @halirutan that this is not a time saver at all. It took me more time to configure this etc. than to write the code. I am already a user of the ...


6

Is this what you had in mind? data = {{1, 1, 1, 1}, {1, 2, 1, 2}, {1, 1, 3, 1}, {1, 2, 1, 4}}; ticks = {#, ToString[# t]} & /@ Range[4] ListDensityPlot[data, Frame -> True, FrameLabel -> {"a", "b"}, FrameTicks -> {ticks, ticks}]


6

After @Hans comment, get much more clear how to do it in webMathematica. It could't be simpler. IMO, the best way to see how it works, after install webMathematica, is going into: tomcatDirectory\webapps\webMathematica\Examples\AJAX. Let's see for example the ReturnDate.jsp file: <msp:evaluate> If[ $$fullDate === "true", DateString[], ...


6

Define random using SetDelayed so that each time it is used it gives a different random vector: lngth = 834; rndm := RandomVariate[NormalDistribution[0, dt^.5], lngth - 1] Instead of using a loop you can use Prepend[Accumulate[rndm] gamma + mu dt + .0158, .0158] to get a random vector of length 834. You can use the above with Table to generate as many ...


5

"Any engine compatible with Servlet 2.4 or later, such as Apache Tomcat" http://www.wolfram.com/products/webmathematica/technology/?tab=Specifications I really don't know much about Geronimo, but it seems to support servlet 2.5 (via Tomcat.)


5

This is node.js that creates a local server if you are experimenting. Again this isn't legal to use on something other then a local port. var http = require('http'); var loc = "C:/Users/a/Desktop/node.m test"; http.createServer(function (req, res) { res.writeHead(200, {'Content-Type': 'text/html'}); var exec = require('child_process').exec, child;...


5

I believe this is a duplicate. I just note that Grad can provide all the partial derivatives in one step. I just post this not to encourage all multiple rule lists but to limit typing: rep = {{x -> 1, y -> 3, z -> 0}, {x -> 0, y -> 1, z -> 2}, {x -> 0, y -> 0, z -> 6}, {x -> 7, y -> 6, z -> 8}, {x -> 7, y -&...


5

Currently APIFunction / CloudDeploy works only with the Public Cloud or an Enterprise Private Cloud. So either you need an EPC on your side or you can use WebMathematica or Mathematica (WebMMA license required anyway). Though WebMMA does not support APIFunctions anyway so you'd have to adapt it to create JSP based api interface. Let's hope someone in WRI ...


4

In webMathematica there is already MSPGetMessage[] So if you do something like mess = MSPGetMessages[]; you have a list of messages. E.g., if you had an error for 1/0 "1\nPower::infy: Infinite expression - encountered.\n 0" Notice that $MessageList gives just {HoldForm[Power::infy]}


4

data = Table[ Sin[i + j^2], {i, 0, 3, 0.1}, {j, 0, 3, 0.1}]; ListContourPlot[data, Epilog -> {PointSize[Large], Red, Point[{{5, 15}, {10, 5}}]}]


4

Framed[ContourPlot[Sin[x y], {x, 0, 2}, {y, 0, 2}, Contours -> Join[Range[0, 0.9, 0.1], Range[0.91, 1, 0.01]], Frame -> {{True, False}, {True, False}}, ColorFunction -> "Pastel", ContourStyle -> Join[Table[Directive[Brown, Thick], {10}], Table[Directive[Dashed, Thin], {9}]], ContourLabels -> Function[{x, y, z}, Text[Framed[z], {x,...


4

If you have a look at the "webMathematica/Examples/PlotScript/PlotScript.jsp" example : <%@ taglib uri="http://www.wolfram.com/msp" prefix="msp" %> <html> <head> <script> function plot(f) { win = window.open( "PlotScript1.jsp?fun=" + URLescape(f.fun.value) + "&x1=" + URLescape(f.x1.value), "plot", "toolbar=...


4

You could try using f[x_, y_, z_] := x^3 + y*z + z^2*x Derivative[1, 0, 0][f][x, y, z] %/.{x->1,y->3,z->0} Derivative[0, 1, 0][f][x, y, z] Derivative[0, 0, 1][f][x, y, z]


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