real-time

How does the method scheduledExecutorService.scheduleAtFixedRate() ensures real-time execution?

混江龙づ霸主 提交于 2019-12-13 02:23:41
问题 Because I'm executing a time critical task every second, I compared several methods to find the best way to ensure that my task is really executed in fixed time steps. After calculating the standard derivation of the error for all methods it seems like using the method scheduledExecutorService.scheduleAtFixedRate() leads to the best results, but I don't have a clue why it is so. Does anybody know how that method internally works? How does it for example in comparison to a simple sleep()

plotting the real time data after certain specified interval in Matlab

时光总嘲笑我的痴心妄想 提交于 2019-12-13 02:09:49
问题 I have a question that I dont know how to figure it out. I am plotting my real time data obtained from temperature sensors in MATLAB. The sensor software generates the text file for each sensor and updates it after every minute. What do I have to do if I want the plot to be updated after certain period of time; let's say after 10 or 20 values or after every 5 mins. 回答1: You could use a timer. Reusing the code of Nzbuu, it would be something like the following function ReadAndUpdate [X,Y] =

Postgres LISTEN/NOTIFY - low latency, realtime?

坚强是说给别人听的谎言 提交于 2019-12-13 01:57:40
问题 I am planning to use postgres LISTEN/NOTIFY aproach to get insert time(actual transaction commit time) of records in a table. To achieve this, I plan to do the following. I issue a notification during insert time as shown below. BEGIN; INSERT INTO table_name(id, ...) values (id,....); select pg_notify('test_channel', 'id - ' || id || ' trans start time - ' || now() || ' notify start time - ' || clock_timestamp()); END; And then I plan to use https://pythonhosted.org/psycopg2/advanced.html

What's the difference between a watermark and a trigger in Flink?

你。 提交于 2019-12-12 18:27:27
问题 I read that, "..The ordering operator has to buffer all elements it receives. Then, when it receives a watermark it can sort all elements that have a timestamp that is lower than the watermark and emit them in the sorted order. This is correct because the watermark signals that not more elements can arrive that would be intermixed with the sorted elements..." - https://cwiki.apache.org/confluence/display/FLINK/Time+and+Order+in+Streams Hence, it seems that the watermark serves as a signal to

Build an RT-application using PREEMPT_RT

会有一股神秘感。 提交于 2019-12-12 13:47:29
问题 I would like to write real-time Linux programs while using the real-time PREEMPT_RT. I found the official Wiki (https://rt.wiki.kernel.org/index.php/HOWTO:_Build_an_RT-application). There are some code examples but I would like to get the explanation of the possible RT-functions. Thank you, 回答1: It is important to underline that PREEMPT_RT is a patch that changes the internal code of the Linux kernel to reduce the maximum latency experienced by a user-level process. This is done by changing e

Continuesly streaming audio signal real time infinitely, Python

我只是一个虾纸丫 提交于 2019-12-12 10:14:56
问题 I have a simple question, while streaming audio signal from audio jack in Python, using pyaudio library how can I keep streaming the audio signal until I choose to "stop" the program. Example: The way we capture our web camera frames infinitely under a infinite while loop. For example: In this code(take from link)that records the stream just for 5 seconds what will be the modification that will serve my purpose import pyaudio import wave import numpy as np CHUNK = 44100 FORMAT = pyaudio

How to do Realtime/fast processing of GPS data in web application?

点点圈 提交于 2019-12-12 09:02:08
问题 I am writing a web application for mapping Real-time GPS coordinates on Google maps coming from a GPS device, for fleet managment. Since the flow of data is very fast from the GPS device to web application for database it becomes very heavy and the database is being queried every 5 seconds(via AJAX from web browser running the website) it becomes more heavy. Keeping the updates in real-time is becoming very difficult a lagging of 30 seconds to 60 seconds is created between the actually update

Which is “better”. AtomicIntegerArray (1/0 as true/false) versus AtomicBoolean[]?

空扰寡人 提交于 2019-12-12 08:27:06
问题 I am very curious about that. If you use AtomicIntegerArray with values 0 and 1 you can accomplish the same thing of an AtomicBoolean array. Example: final AtomicIntegerArray array1 = new AtomicIntegerArray(10); array1.compareAndSet(3, 0, 1); // 0 = false and 1 = true // exactly the same thing of: final AtomicBoolean[] array2 = new AtomicBoolean[10]; for(int i = 0; i < array2.length; i++) array2[i] = new AtomicBoolean(false); array2[3].compareAndSet(false, true); Which one do you think is

Why aren't all methods displayed in VisualVM profiler?

青春壹個敷衍的年華 提交于 2019-12-12 07:57:07
问题 I am using VisualVM to see where my application is slow. But it does not show all methods, probably does not show all methods that delays the application. I have a realtime application (sound processing) and have a time deficiency in few hundreds of microseconds. Is it possible that VisualVM hides methods which are fast themselves? UPDATE 1 I found slow method by sampler and guessing. It was toString() method which was called from debug logging which was turned off, but consuming a time.

FB Realtime API not/inconsistently notifying for certain connections (music, movies, books, tv)

人走茶凉 提交于 2019-12-12 07:39:49
问题 I'm currently running into an issue with Facebook's realtime API. I wish to subscribe to a number of things on a users profile, including their "Likes" in the Music, Books, TV and Movies categories. I get the correct information when I query via FQL and the Graph, but Facebook is not pinging my notification endpoint when those entries change on a users profile. The subscription and verification are fine. Here is the active subscription from Facebook from my App: ["object"]=> string(4) "user"