Skip to main content
15 votes

Implementing Local HTTP Server

The following is a sample implementation of a simple HTTP server in Wolfram Language code only: https://github.com/arnoudbuzing/wolfram-server You send it a POST request where the body data of the ...
Arnoud Buzing's user avatar
10 votes

Implementing Local HTTP Server

Starting in Mathematica 12, there is a built-in function SocketListen that can start a web server and respond to HTTP requests. ...
Flux's user avatar
  • 366
7 votes

Using ImageJ filters directly from Mathematica through J/Link

This is not an answer to the main question on how to do it in Mathematica but merely one possible reason why this whole thing might not be achievable. In Java, your exact example looks like this <...
halirutan's user avatar
  • 113k
7 votes
Accepted

How to launch a separate Java VM on each sub-Kernel?

I opened a case with WRI ([CASE:3994742]) where they provided a supported solution. A Java process can be launched on a sub-kernel by calling ReinstallJava on the ...
Edmund's user avatar
  • 42.4k
7 votes

A JAVA Program wants call Mathematica's Reduce function to solve equation and get the result

The problem is that your Reduce returns a result of type Inequality. But then you're trying to read it as String. That's the wrong type to use, Java doesn't know what a type of Inequality is. You can ...
Andreas Lauschke's user avatar
6 votes
Accepted

J/Link stealing focus from the Front End on OS X. Workaround?

You can prevent the focus from being lost by setting certain system properties to true before calling any awt functionality: ...
WReach's user avatar
  • 69.1k
6 votes

What does it mean that GUIkit is being deprecated?

It is an indication that It is no longer under active development (or, really, any). Bug reports may be ignored unless they have severe impact (like security issues). You should try to port existing ...
Itai Seggev's user avatar
  • 14.2k
6 votes
Accepted

How to convert a Java BufferedImage to a Mathematica Image?

Courtesy of this post, one solution is to use java to get the PNG data then import it to Mathematica as Image. For that you need ...
Ben Izd's user avatar
  • 9,474
5 votes

Incorrect number or type of argument when using Jlink to call setAccessible

After reviewing this again How to call a java method that takes a boolean (not Boolean)? I noticed that both setAccessible methods required a primitive boolean, not a Boolean object. Thus, all of ...
Todd Johnson's user avatar
5 votes

Update Java used by Mathematica 10

You may use ReinstallJava with the CommandLine option. ...
Edmund's user avatar
  • 42.4k
5 votes
Accepted

How to create keypress simulation program?

A summary to all the stuffs: ...
Wjx's user avatar
  • 9,630
5 votes
Accepted

Prevent JLink from using a DisabledPreferencesFactory with Java on Linux

From the comments around the code snippet posted, I would guess that $disablePrefs is not an exported function from the JLink package, but instead is a private ...
Jason B.'s user avatar
  • 69.2k
4 votes

Add new JDBC Driver to connect Mathematica to SQL database

In the case where you want to use an updated driver in preference to an older one shipped with Mathematica, AddToClassPath[ ...path..., Prepend -> True]. For ...
Chris F Carroll's user avatar
4 votes
Accepted

How to get the image in the clipboard with a J/Link method?

It is quite ambitious to extract an image in an arbitrary format from the clipboard using only JLink. This is because the code must anticipate variations such as ...
WReach's user avatar
  • 69.1k
4 votes
Accepted

When using Java objects through JLink, how can I multitask the objects?

Create a Java class implementing the Producer / Consumer design pattern. See also: Producer-Consumer problem. The class below is an example. Then in Mathematica instantiate the class and submit all ...
nilo de roock's user avatar
4 votes

Implementing Local HTTP Server

In 2023 new players joined our game TCPServer - a general purpose tcp-server written using only WL HTTPServer - an extension to TCPServer to manage GET/POST requests WebSocketServer - an extension to ...
Kirill Vasin's user avatar
  • 1,255
4 votes
Accepted

Need J/Link values returned in 1D instead of 2D format (i.e., not exponents, fractions, on multiple lines)

It's all right there in the name: evaluateToOutputForm. If you want it InputForm, use ...
Itai Seggev's user avatar
  • 14.2k
4 votes
Accepted

Change DataStructure (or maybe just a symbol) from JLink/Java program

I've tested this code with Mathematica's default JDK (version 11.0.12, Mathematica 13.0.1). Assume I've run an echo server on 127.0.0.1:8000. Let's import ...
Ben Izd's user avatar
  • 9,474
3 votes

J/Link HMAC Base64

The recently released version 11.3.0 introduced BaseEncode which would be useful here. A complete example (including the HMAC computation) in Mathematica: ...
ilian's user avatar
  • 25.5k
3 votes
Accepted

J/Link HMAC Base64

Use Base64`encodeBase64String -- with a capital "B". The expression: ...
WReach's user avatar
  • 69.1k
3 votes

Is there any way that convert entire mathematica code to java or python?

I am not exactly sure what you mean by "trace coding", but in general, the Mathematica evalution methods are very complicated, and could be documented better. Again, in general, in any computer ...
Somos's user avatar
  • 4,917
3 votes

Implementing Local HTTP Server

Yes (and using pure Mathematica or WolframEngine) https://jerryi.github.io/tinyweb-mathematica/
Kirill Vasin's user avatar
  • 1,255
3 votes

Is it possible to get the locations and dimensions of all boxes in a StandardForm expression renderation?

Details depend of your specific needs but it seems that information you desire is at least partially accesible via FrontEnd`UndocumentedGetSelectionPacket. ...
Kuba's user avatar
  • 137k
3 votes
Accepted

How to get a audio file's duration time in Mathematica?

Now,in Mathematica 11. Using Duration function make it more easily: Import["ExampleData/car.mp3", "Duration"] Or ...
partida's user avatar
  • 6,836
3 votes

Missing ticks and numbers on a plot when using JLink + Mathematica 11.3

I found the solution: Usually in the Plot[] function, the FrameTicks option is set to Automatic, which in Mathematica 9.0 or 10.0 "always" translates to True. But for some reason in Mathematica 11.3 ...
SevenEvos's user avatar
3 votes
Accepted

OpenSQLConnection fails - due to some Java problem?

I received the following from Wolfram and it worked for me: As a workaround, please try the following: Download Microsoft mssql jdbc driver zip fie from https://docs.microsoft.com/en-us/sql/connect/...
HJensen's user avatar
  • 547
2 votes

Installing RLink on Linux

For Ubuntu 15.10 64 bits, I had to modify hebaElkholy's form slightly. ...
Otto Linsuain's user avatar
2 votes
Accepted

What does the function StartJava do?

Thanks to @J.M., it was discovered the StartJava was a deprecated function, replaced by InstallJava, which is used to launch the ...
hmir's user avatar
  • 141
2 votes

Clearing the JavaClassPath at Runtime in JLink

I use ReinstallJava[CommandLine -> DIRJAVA, ClassPath -> DIRBOTA]; where DIRJAVA is the directory of a JRE I installed myself, and DIRBOTA is the ...
nilo de roock's user avatar
2 votes

Convert a Java object to interface via J/Link

I had this same confusion when first interacting with java (using the exact same library) - all the functions I want to use take an IAtomContainer as their input, ...
Jason B.'s user avatar
  • 69.2k

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