real-time

How to send messages to particular users Ratchet PHP Websocket

社会主义新天地 提交于 2019-12-31 22:25:17
问题 I'm trying to build a system where user can subscribe to a category on establishing connection to websocket server and then he will start receiving updates for that category. So far, I have worked with Ratchet and I am able to send message to all the connected clients but the problem is I don't want to send message to all the clients I just want to send the message to the clients who have subscribed the the particular category in which the messages was sent. PHP Code Chat.php <?php namespace

How to move x-axis grids on chart whenever a data is added on the chart

喜夏-厌秋 提交于 2019-12-30 11:53:49
问题 // gridlines are not moving along as the line point changes. what code should I add to make it look like the cpu performance chart? Series test1 = new Series(); Series test2 = new Series(); private void Form1_Load(object sender, EventArgs e) { test1.Color = Color.Blue; test1.ChartType = SeriesChartType.FastLine; test1.BorderWidth = 2; test2.Color = Color.Red; test2.ChartType = SeriesChartType.FastLine; test2.BorderWidth = 2; chart1.Series.Add(test1); chart1.Series.Add(test2); chart1

C# Real Time Try Catch

早过忘川 提交于 2019-12-30 06:29:10
问题 I'd like a response from someone who actually does real-time programming in C# or who really understands the language internals. I know that exceptions should not be used to handle normal processing, but only to detect error conditions. There is plenty of discussion on that topic. I'd like to know if there is any run time slow-down from simply having a try/catch block in place (which never catches an exception unless the program will have to end anyway). The try/catch block is inside a

matplotlib real-time linear line

放肆的年华 提交于 2019-12-29 09:21:52
问题 I am having a major setback on this question on a while now... import numpy as np import matplotlib.pyplot as plt plt.ion() fig = plt.figure(1) ax = fig.add_subplot(111) ax.set_title("linear realtime") line, = ax.plot([],[]) i = 0 while ( i < 1000 ): #EDIT: # this is just sample data, but I would eventually like to set data # where it can be floating numbers... line.set_data(i,i) fig.canvas.draw() i += 1 I am trying to draw a linear line in real time but I am unable to come up with the result

How to get an accurate 1ms Timer Tick under WinXP

旧巷老猫 提交于 2019-12-29 06:47:28
问题 I try to call a function every 1 ms. The problem is, I like to do this with windows. So I tried the multimediatimer API. Multimediatimer API Source idTimer = timeSetEvent( 1, 0, TimerProc, 0, TIME_PERIODIC|TIME_CALLBACK_FUNCTION ); My result was that most of the time the 1 ms was ok, but sometimes I get the double period. See the little bump at around 1.95ms multimediatimerHistogram http://www.freeimagehosting.net/uploads/8b78f2fa6d.png My first thought was that maybe my method was running

Brackets - Live Preview not working

女生的网名这么多〃 提交于 2019-12-29 05:20:09
问题 I found this awesome program(html editor) called Brackets and it's by Adobe. Now reason why i got the editor was because i wanted to Live Preview PHP code, but i found out later that i needed a Wamp Server. Now, i was in the mood of making an about page but i couldn't live preview. Live Preview Base URL is empty, and when i try to live preview, i get this: > http://puu.sh/aDkET/4209ec1192.png < and the lightning bolt is half orange(i heard it needs to be red to work). I have tried the lot...

How can I make realtime notification for user who are not login?

断了今生、忘了曾经 提交于 2019-12-28 04:32:07
问题 I use laravel 5.3 I created an online store website. If user logs in and chooses a product then okay button, there will be realtime notification in icon cart. My code looks like this : If user selects product and okay button, it will run this function : public function addNotificationCart() { Notification::send(auth()->user(), new CartNotification($cart)); } Then : public function toBroadcast($notifiable) { return new BroadcastMessage([ 'id' => $this->data->id, 'time' => $this->data->created

Periodically execute function in thread in real time, every N seconds [duplicate]

余生长醉 提交于 2019-12-28 03:55:10
问题 This question already has answers here : Run certain code every n seconds [duplicate] (7 answers) Closed 5 years ago . I have a threaded class whose loop needs to execute 4 times every second. I know that I can do something like do_stuff() time.sleep(0.25) but the problem is that is doesn't account for the time it takes to do_stuff() . Effectively this needs to be a real-time thread. Is there a way to accomplish this? Ideally the thread would still be put to sleep when not executing code. 回答1

Real time plot in MATLAB

。_饼干妹妹 提交于 2019-12-28 02:39:08
问题 I'm very new to MATLAB and I was trying to display a real time plot of some calculations. I have an N sized vector and I work with m values at a time (say m = N/4 ), so I want to plot the first m values and then as soon as the second m values are calculated have them replace the first plot. My approach was as follows: for i=1:N, ... //compute m ... plot(m); end; but it fails to update the plot in every loop and waits for all the loops to finish to plot the data. My question is: Should I use

what slows down GKSession's network throughput?

风流意气都作罢 提交于 2019-12-25 18:22:06
问题 I implemented an app that does real time broadcasting of music from one iphone to another based on Ray Wenderlich's tutorial about GKSession and Matt Ghallagher's tutorial on audio streaming. Everything worked perfectly.. until we've decided to replace the poker game UI with that of our own. The result is that suddenly the networking throughput drops dramatically. Below is a profiler snap shot of the server Here is a snapshot of the client of the original app and here is a snapshot of the