real-time

How to communicate with threads in Ruby?

丶灬走出姿态 提交于 2019-12-17 20:26:27
问题 I'm building a real time game, mostly chat based, and I need to have many of these chats running concurrently, receiving and sending data through web sockets. I have been told that instead of spawning one process per game, I should have one process with one thread per game (maybe using Event Machine). I'm using Juggernaut for the sockets part, it lets me send data to all the players in a game by using a publish/subscribe system: each player subscribes to one game. But how do I send data from

Python realtime plotting

你离开我真会死。 提交于 2019-12-17 18:44:03
问题 I acquire some data in two arrays: one for the time, and one for the value. When I reach 1000 points, I trigger a signal and plot these points (x=time, y=value). I need to keep on the same figure the previous plots, but only a reasonable number to avoid slowing down the process. For example, I would like to keep 10,000 points on my graph. The matplotlib interactive plot works fine, but I don't know how to erase the first points and it slows my computer very quickly. I looked into matplotlib

DIFFERENT TASKS ASSIGNED TO DIFFERENT INSTANCES OF FORK() OF A PROCESS IN C

≡放荡痞女 提交于 2019-12-14 04:23:58
问题 Can I assign different task to different instances of fork() of a process in C ? like for example: program.c has been forked 3 times int main() { pid_t pid; pid = fork(); pid = fork(); pid = fork(); } now to every instance of fork() I want to do different thing, Can I do this? with forks ? or any other method if favorable? :) PS: I am testing Real Time Linux and want to check the performance of the Context Switching through forks through Time Constraint. 回答1: You can use posix process.. posix

Facebook : Graph API Callbacks / Real-time API / Public Feed API

心不动则不痛 提交于 2019-12-14 03:50:24
问题 I'm working on a social media project where in I need to follow a few fanpages and listen to all whats happening on that particular page. I for a fact know that there are some data resellers like GNIP & Datasift who can provide me such data. I have tried both trials. What I want to know is that, is there a way to do this via the Facebook public feed & graph APIS, I know with this I'll be restricted only to a open posts, but that's ok for now. I have downloaded the Facebook C# SDK and I'm able

Java realtime writing file when it's opened

倾然丶 夕夏残阳落幕 提交于 2019-12-14 03:36:40
问题 I want to write data to file when it's opened, but it doesn't work. Calendar getTime works nice, System.out.println() proves this. Please, any idea, what's wrong...? Main class: public static void main(String[] args) throws IOException { // TODO code application logic here CurrentTime ct = new CurrentTime(); } CurrentTime class: public class CurrentTime { public OutputStream output; public InputStream input; public Process npp; CurrentTime() throws IOException { Timer t = new Timer(); npp =

Updating table from JSON/MYSQL with jQuery

巧了我就是萌 提交于 2019-12-14 02:14:11
问题 I'm curious as to what the most acceptable/effective approach is to using tables with data from json. I have one project in development where I need to update individual cells of a table, based on a mysql table. My X axis labels would be assorted dates (also pulled from mysql). The Y axis labels are times (These are always the same and as such could be generated statically). The content of the table would be available appointment slots (also pulled from mysql). This table is purely reading

real time plotting with Julia

我们两清 提交于 2019-12-14 01:17:20
问题 I am trying to plot a function evolving in real time with Julia. For that, I saw that GR package could be used in Julia, when I try to apply exactly the example given here : import GR GR.inline("mov") x = [0:0.01:2*pi] for i = 1:200 GR.plot(x, sin.(x + i / 10.0)) end GR.show() I get the following error message while executing the loop part : expected Real or Complex in #plot_args#12(::Symbol, ::Function, ::Tuple{Array{FloatRange{Float64},1},Array{Array{Float64,1},1}}) at /Users/myname/.julia

how can I use Solr to do real-time search

夙愿已清 提交于 2019-12-13 21:29:20
问题 now we use deltaImport to update data from db to index. but we have some information need a real-time search or near real-time search. what should I do if I use solr to solve this? 回答1: to generate near real-time-search i would update the data in small packages and also update the index in small packages every minute (index update needs only some seconds - depending on the size of new data) don't forget to optimize the index regularly 回答2: This post could be useful for you: Solr and Near Real

Faye in jruby on rails

让人想犯罪 __ 提交于 2019-12-13 16:55:33
问题 I have searched A LOT and couldn't find any resource that says I can use Faye with jruby. I have found this one that says that it doen't play well with jruby but it's really really old. Also I have found this that looks like they have implemented a Java native extension in order to support jruby?? Does anyone know if I can use it in a Jruby on rails project? Thanks! 回答1: From the creator of Faye: Yes, the server runs on JRuby. The client uses either WebSocket, EventSource, XMLHttpRequest,

How to pass the data from background process to another activity

旧街凉风 提交于 2019-12-13 16:27:22
问题 I could get the data appear saved in variable sbprint on screen from main activity. The varible sbprint i get from background activity that buffer bluetooth data. I want to log the data appear on screen to another class. The problem is i can't use serializable since the data always stream from my bluetooth module in real-time mode. The code based on here I use handler to update my UI from data buffered NOTE: I obtain shared preference inside handler (this is inside MainActivity.java) h = new