Tag Info

Hot answers tagged

20

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 ...


16

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. ...


14

Depending on the total size of the files, CDF may or may not be a good option. A file of a few MB is probably still ok, 10Mb or more is probably not. That said, this looks like a case for WebMathematica to me. It is fairly easy to set up, and looking at your description, you won't need an awful lot of interactivity (which, had you needed it, would be one ...


12

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. ...


11

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 ...


10

You cannot use CDF for this because you have textual import fields and these are not supported when you embed online. You will just get a big grey box. InputField cannot accept strings (non-numeric) for online CDFs unless you are Wolfram Research and can override it. (I'm guessing you don't want to pay many thousands for CDF Pro.) You also cannot import and ...


7

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;" *)


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

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.


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

In this case, I assume you want both, dynamic interactivity and pull large datasets from a database in real time. This can be done with a CDF notebook, and it doesn't require WebMathematica unless your notebook really needs to do much more computationally intensive work than your example code indicates. So here are the steps: Server Save your dynamic ...


5

Since it appears that you wish to use live input for your Timeline, webMathematica will be the best solution. CDF cannot accept anything but input from what is in the file itself. Documentation can be found here: http://www.wolfram.com/products/webmathematica/ User Guide is located here: ...


5

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 ...


4

There is no need to use Javascript to include CDF in a web page. Upload the CDF file (source.cdf) and the HTML page (index.htm) into a folder on the server. Keep both files in same folder for simplicity. Edit the index.htm file using a text editor and type this line in the HTML anywhere you want the CDF to show up and play in the web page: <embed ...


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]}


3

You could use a trigger in your database which fires when data is added or changed in your table to execute a piece of code; I don't know sqlserver but I assume that a trigger can execute some c++ or .Net code. That in turn could pass the data into Mathematica through NetLink. Mathematica would have to be set up to listen for the data of course. Actually ...


3

you can try to add the dll to your path list. Window->Preferences->Java->Installed JREs. Then choose your current JRE(JDK) or the one you are using and click Edit. Fill Default VM Arguments: -Djava.library.path="the pathhhh of dll" or Under Linux set LD_LIBRARY_PATH. Under Windows set PATH.


3

The answer depends on what you want to do with CDF documents. The standard version of Mathematica allows you to make CDF documents. A good example of what they can do is the stuff on demonstrations.wolfram.com. Basically, if you are content with making Manipulate statements with sliders and buttons, then you'll do well with the standard CDF document. You ...


2

There is no problem importing base-64 encoded images into Mathematica. Here is an example: a = Import["ExampleData/rose.gif"]; Export["a.b64", a, {"Base64", "PNG"}]; Import["a.b64", "Base64"] The data that you create with your JavaScript function are in the form of a URL that then gets translated by a browser to a displayed PNG image. You have to strip ...


2

No. But Dynamic and Button and so on just are not and cannot be supported. However, you can programmmatically generate CDF files, and put them onto your server. And in CDF's, when run through the CDF-plugin (on a Windows or OSX client; no Linux yet unfortunately) you can have Button etc.


2

Put a 2 in MSPConfiguration.xml like explained here <KernelNumber> 2 </KernelNumber> and then your kernels are used efficiently in that sense that if one kernel is busy serving one request, then another one is available if another request happens at the same time the first kernel is still running.


2

I post this exploration just for fun. Setup: B[z_] := ((z*(z - 0.5)*(z + 0.5))/((1 - 0.5*z)*(1 + 0.5*z))) sol = Quiet[{Re[#], Im[#], 0} & /@ (z /. Solve[B[z] == 1, z])]; sol2 = Quiet[{Re[#], Im[#]} & /@ (z /. Solve[B[z] == 1, z])]; Visualizing: Show[Plot3D[Abs[B[x + I y]] - 1, {x, -3, 3}, {y, -3, 3}, MeshFunctions -> (Abs[B[#1 + I #2]] - 1 ...


2

I want to plot the roots B(z)=1. I know that the roots of this equation on the unit disc How about this: ClearAll[z] b = ((z*(z - 0.5)*(z + 0.5))/((1 - 0.5*z)*(1 + 0.5*z))) sol = z /. NSolve[b == 1, z]; data = {Re[#], Im[#]} & /@ sol; Graphics[ { Circle[{0, 0}, 1], First@ListPlot[data, PlotStyle -> Directive[Red, PointSize[.03]]], Arrow[{{0, ...


2

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"}, ...


2

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 ...


2

Use Accumulate. Accumulate[{0, 6, 5, 4, 3, 2}] (* {0, 6, 11, 15, 18, 20} *)


1

Since the OP's graphic appears to also show the poles I would add those B[z_] = ((z*(z - 0.5)*(z + 0.5))/ ((1 - 0.5*z)*(1 + 0.5*z))) // Rationalize[#, 0] & // Simplify; roots = {Re[z], Im[z]} /. Solve[B[z] == 1, z]; poles = {Re[z], Im[z]} /. Solve[Denominator[B[z]] == 0, z]; Graphics[{AbsolutePointSize[8], {Lighter[Gray], Circle[]}, ...


1

Problem solved by restarting the Mathematica Kernel - it seems like an old version of the file was cached at some point and wasn't being reread. This appears to be a recurring problem, and restarting the kernel is the only way I've found to fix it. I'll leave this open for the moment, in case someone knows a good fix for this/reason why this occurred.


1

This seems to work. I think this sort of thing is probably dangerous -- well, unreliable. file = DataPaclets`GetDataPacletResource["CountryData", "CountryData.wdx"]; DataPaclets`CountryDataDump`$StreamCache["CountryData"] = OpenRead[file, BinaryFormat -> True] I don't have webMathematica, so I can't test it on that.



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