Page 1 of 1

Integrating Mathematica Computations into LiveCode Program

Posted: Thu Oct 23, 2014 9:11 pm
by tjm167us
Hi guys,
Recently, Wolfram Research has created the ability to generate RESTful API's that can be called by external applications. I am interested in doing this for an application I'm working on (that will be predominantly written in LiveCode). Please see the post that I made to the Mathematica Stack Exchange forum (directed to the Mathematica crowd):

http://mathematica.stackexchange.com/qu ... pplication

I don't have any experience interfacing with RESTful API's, and thought I would be able to get what I wanted by simply:

Code: Select all

get URL <https address here>
put it into field "myField"
Where the https address has had a query string appended to it. Please note that if I were to take this URL and plug it into a web browser, the browser would return the result. Does anyone have experience with interfacing LiveCode with RESTful API's (or better yet, Wolfram Cloud)? Any help regarding this would be greatly appreciated!

Thanks,
Tom

Re: Integrating Mathematica Computations into LiveCode Progr

Posted: Thu Oct 23, 2014 11:46 pm
by [-hh]
Are you interested in this special way (to use this API)
or
are you interested in using Mathematica's online offers to have a factorInteger into your stack, no matter how?

For example you could link to
http://www.wolframalpha.com/widgets/vie ... ff830ad094
in a browser window or even embed the widget into a serving webpage

<script type="text/javascript" id="WolframAlphaScript8058bf500242562c0d031ff830ad094" src="http://www.wolframalpha.com/widget/widg ... "></script>

Re: Integrating Mathematica Computations into LiveCode Progr

Posted: Fri Oct 24, 2014 12:07 am
by tjm167us
Hi -hh,
I didn't realize that there was another way! Now, it's probably worth mentioning that FactorInteger[] was just an example. I will be performing computations in Mathematica that are more involved than that. Also, I would like to be able to have the standalone application work without Mathematica installed on the machine it's running on. If your idea was going to be running a local install of Mathematica to get the answer, I am still interested in hearing about that, but it won't accomplish my final goal! Honestly, I'm not particularly worried about meeting my end goal at this point though. I will probably not use Mathematica at all in my final implementation :p
Thanks,
Tom

Re: Integrating Mathematica Computations into LiveCode Progr

Posted: Fri Oct 24, 2014 1:07 am
by [-hh]
As long it's your own (free on Raspberry Pi) you can use the Mathematica kernel (= Wolfram) from LC via "shell", that is also via an ssh tunnel to remote machines.

Mathematica (= the frontend) had from its beginning the ability to use remote kernels, no matter on which platform they were running. You could already in this early stage send several parts of a job to different kernels for 'parallel' evaluation (needed an additional framework).
Meanwhile it is this easy: Let Wolfram do scripts (or usual Mathematica input files you attach). You don't have to use a special API for that.
But to use the result, you have to use the frontend or do the job of the frontend by yourself.
As a simple example you have to put in line breaks into the first 100000 digits of Pi because LC has limits for it's field display (max. line length).

Hope you have success! Good luck.

Re: Integrating Mathematica Computations into LiveCode Progr

Posted: Fri Oct 24, 2014 12:53 pm
by tjm167us
Thanks -hh. Any input regarding using the RESTful API implementation (if I chose to use Wolfram Cloud as part of my final application)?
Thanks,
Tom