polling

Why are touch events destroying my Android framerate?

拈花ヽ惹草 提交于 2019-12-29 21:19:21
问题 I'm developing a game for Android. It's got a lot going on but is running reasonably smoothly. That is, of course, until the user touches the screen. While they're touching it, onTouchEvent is called (with action = ACTION_MOVE , x = 0 and y = 0 ) roughly once every ten milliseconds at what appears to be a fairly high priority, as it absolutely obliterates the framerate. As soon as the touch ends the framerate returns to its nice state. I've tried having onTouchEvent handle input for the game

Using setInterval() to do simplistic continuous polling

心已入冬 提交于 2019-12-29 03:33:07
问题 For a simple webapp that needs to refresh parts of data presented to the user in set intervals, are there any downsides to just using setInterval() to get a JSON from an endpoint instead of using a proper polling framework? For the sake of the example, lets say I'm refreshing status of a processing job every 5 seconds. 回答1: From my comment: I would use setTimeout [docs] and always call it when the previous response was received. This way you avoid possible congestion or function stacking or

Implementation of simple polling of results file

笑着哭i 提交于 2019-12-25 07:59:25
问题 For one of my dissertation's data collection modules, I have implemented a simple polling mechanism . This is needed, because I make each data collection request (one of many) as SQL query, submitted via Web form, which is simulated by RCurl code. The server processes each request and generates a text file with results at a specific URL ( RESULTS_URL in code below). Regardless of the request, URL and file name are the same (I cannot change that). Since processing time for different data

Python select.select, select.poll: Corrupted Double-linked List

人盡茶涼 提交于 2019-12-25 05:23:22
问题 I have a rather large client-server network application, written in Python. I'm using select.poll to provide asynchronous capabilities. For the past six months, everything has worked fine. However, recently I changed some things and allowed the client to reliably log-off from the server. It appeared at first glance that the client was never receiving the request, and furthermore, it was blocking. When I killed the process with , I received the following output: *** glibc detected *** /usr/bin

Python select.select, select.poll: Corrupted Double-linked List

℡╲_俬逩灬. 提交于 2019-12-25 05:23:06
问题 I have a rather large client-server network application, written in Python. I'm using select.poll to provide asynchronous capabilities. For the past six months, everything has worked fine. However, recently I changed some things and allowed the client to reliably log-off from the server. It appeared at first glance that the client was never receiving the request, and furthermore, it was blocking. When I killed the process with , I received the following output: *** glibc detected *** /usr/bin

How to poll email with hosted solutions? PHP or ASP

非 Y 不嫁゛ 提交于 2019-12-25 03:56:08
问题 I have been looking for some time now but i cannot really find a good way to process an emial box using a hosted solution as justhost or asphost . Now my instinct tells me to write a service .. but i cant install it on either hosts. Is there any other clever way to over come this problem using any thing from PHP to .NET? 回答1: Assuming your webserver is running *nix, you should use crontab to create a cronjob that'll run automatically at your specified times. If your server is running any form

What is a good setTimeout interval for polling in a IE?

≯℡__Kan透↙ 提交于 2019-12-25 03:07:30
问题 I have an ActiveX object (who source code I have) running in a browser (IE). The ActiveX object has a UI, which raises events. I want to respond to those events in the browser. I don't want to invoke JavaScript functions from the ActiveX object events: and therefore, instead, I want the JavaScript to poll a method of the ActiveX object (to say, "do you have any events to report?"). I'll do that with code like this: function findActiveXObject() { return document.getElementById('MyActiveXObject

How are USB peripherals' bIntervals enforced?

只谈情不闲聊 提交于 2019-12-25 02:44:33
问题 I have a FullSpeed USB Device that sends a Report Descriptor, whose relevant Endpoint Descriptor declares a bInterval of 8, meaning 8ms. The following report extract is obtained from a USB Descriptor Dumper when the device's driver is HidUsb: Interface Descriptor: // +several attributes ------------------------------ 0x04 bDescriptorType 0x03 bInterfaceClass (Human Interface Device Class) 0x00 bInterfaceSubClass 0x00 bInterfaceProtocol 0x00 iInterface HID Descriptor: // +bLength, bCountryCode

Check if file is modified deleted or extended using python select.kqueue()

有些话、适合烂在心里 提交于 2019-12-25 02:14:27
问题 Hi I am having a hard time understanding how to use the BSD only python module classes select.kqueue and select.kevent to setup a watch for file write events. I want to a python program to respond whenever a text file is written to by another process. My test code goes as follows: import os myfd = os.open("/Users/hari/c2cbio/t.txt",os.O_RDONLY) my_event=select.kevent(myfd,filter=select.KQ_FILTER_VNODE,fflags=select.KQ_NOTE_WRITE|select.KQ_NOTE_EXTEND) # I now create a kqueue object and a

Polling every 10 seonds

瘦欲@ 提交于 2019-12-25 01:53:35
问题 In the code below, I had the expectation that this would create a polling loop that would fire off every 10 seconds to get a "job status report" from the server. It seems it is creating over 100 calls per second. I got my education from this excellent article , but I seem to be misreading it. function UpdateEstimates() { var request = { jobID: ExportVM.get("ticketID") }; var jqxhr = $.ajax({ type: "GET", url: AppGlobals.serverURL + "GetJobStatus", data: request, contentType: "application/json