Tag Info

Hot answers tagged

11

You could use RunScheduledTask or its relatives for this. For example, to append a random integer to catch once every two seconds you could do something like catch = {}; task = RunScheduledTask[AppendTo[catch, RandomInteger[10]], 2]; You could also use CreateScheduledTask which is similar to RunScheduledTask except that the task won't be started ...


7

The short answer is: no, Mathematica is simply not suitable for time-critical applications. There are several reasons for this: Mathematica is a slow interpreted language and the time taken by various operations can be close to your threshold of milliseconds There are several things that may interrupt the Mathematica kernel while it's doing ...


6

Here's my first stab at a solution based on the idea of a closure. Maybe it has some elements that you can draw on for inspiration. Function to create a timer function makeTimer[] := Module[{start = AbsoluteTime[]}, Switch[#, "now", AbsoluteTime[] - start, "lap", AbsoluteTime[] - start, "reset", (start = AbsoluteTime[]; 0)] &] Timers ...


5

Here is a letter I got regarding this question from premier service technical support: Thank you for taking the time to send this in. Unfortunately, I do not believe this functionality currently exists in Mathematica and I have forwarded the suggestion that it be included in a future release of Mathematica to the developers in charge of this area. ...


4

How about using ScheduledTask? This sets up a Monitor button that if pushed, starts monitoring the given directory ($UserBaseDirectory). If you set timeRes to a smaller value, you can get closer to realtime updating. By specifying nb beforehand, one can redirect printing to the actual notebook. The monitor checks if there is any newly added file in the ...


3

Here is my sample code using JLink. It's not a foolproof code, but if someone know haw to do better, please let me know. The following code let Mathematica connect with T3Open Trading Software (Italian Broker WeBank), it expose some api that you can call with tcp socket. In this example I'm going to pass a list of options code (Terna Call) and take the ...


2

The basic idea is to install a virtual MIDI device software on your Mac and change the system default MIDI output to that virtual device. Mathematica will play into it, and the device can at the same time function as a MIDI input for Logic/GarageBand. http://www.johanlooijenga.com/tools/5-apps/12-virtual-ports.html It would be easier if you could change ...


2

Spawn1701D's idea to use $IgnoreEOF is interesting, but unfortunately this flag doesn't work at all in version 9, and it doesn't work when reading from files in version 8. Instead we can use the tail Unix utility to prevent Mathematica from stopping to read input. Create a pipe: mkfifo mmpipe Execute tail -f mmpipe | math. tail will keep feeding ...


1

After some research I've found this partial solution: Step 1: Open Excel (if you have it!) Step 2: Open Excel Link Needs["ExcelLink`"] Step 3: If you don't have any DDE Link for Excel, simulate real time data using Dynamic[Refresh[Excel["B1"] = RandomInteger[100], UpdateInterval -> 1]] Step 4: Import back to Mathematica your simulated data a = ...


1

You have to set the variable $IgnoreEOF to True. Actually as the first job you can give the command MathKernel -noprompt -script /home/rob/Desktop/init.m where in init.m you have the command $IgnoreEOF = True



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