continuous

Android How to run an AsyncTask every second?

ぐ巨炮叔叔 提交于 2019-12-07 02:54:34
问题 I'm new in Android and not really knowing how to deal this problem: I have an AsyncTask which reads a position (X,Y,Z) from a XML file. As this position changes every second, I want, after I push a button (called with "StartListener") to read and draw every new position CONTINUOUSLY and stop reading it when I press the button again... Somebody can help me? - Here is a part of my MainActivity (For the moment my app reads and draws a position only when I press the button...) private

Stream a continuously growing file over tcp/ip

血红的双手。 提交于 2019-12-05 18:48:38
I have a project I'm working on, where a piece of Hardware is producing output that is continuously being written into a textfile. What I need to do is to stream that file as it's being written over a simple tcp/ip connection. I'm currently trying to that through simple netcat, but netcat only sends the part of the file that is written at the time of execution. It doesn't continue to send the rest. Right now I have a server listening to netcat on port 9000 (simply for test-purposes): netcat -l 9000 And the send command is: netcat localhost 9000 < c:\OUTPUTFILE So in my understanding netcat

Jenkins: how to save changelog for build

眉间皱痕 提交于 2019-12-05 02:07:43
问题 I have Jenkins-CI and C++ project under SVN. How to save changelog between successfull builds into text (or html) file ? Does Jenkins have any variable/temp file with content of .../changes page? 回答1: Here is XPath code that can get you the changeset for a given build id via Jenkins API: http://[jenkins_host]/api/xml?depth=2&xpath=//build/id[text()='${BUILD_ID}']/../changeSet (Put actual build id instead of ${BUILD_ID}). This can be used by a script (say, a Pyhon script utilizing Python

How to get a continuous Touch Event?

非 Y 不嫁゛ 提交于 2019-12-04 02:57:42
问题 My class extends View and I need to get continuous touch events on it. If I use: public boolean onTouchEvent(MotionEvent me) { if(me.getAction()==MotionEvent.ACTION_DOWN) { myAction(); } return true; } ... the touch event is captured once. What if I need to get continuous touches without moving the finger? Please, tell me I don't need to use threads or timers. My app is already too much heavy. Thanks. 回答1: Use if(me.getAction() == MotionEvent.ACTION_MOVE) . It's impossible to keep a finger

Jenkins: how to save changelog for build

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-03 17:19:23
I have Jenkins-CI and C++ project under SVN. How to save changelog between successfull builds into text (or html) file ? Does Jenkins have any variable/temp file with content of .../changes page? Here is XPath code that can get you the changeset for a given build id via Jenkins API: http://[jenkins_host]/api/xml?depth=2&xpath=//build/id[text()='${BUILD_ID}']/../changeSet (Put actual build id instead of ${BUILD_ID}). This can be used by a script (say, a Pyhon script utilizing Python Jenkins ) that collects changeset results in the end of every build and stores them in a temp locations. After a

Create a continuous distribution in python

馋奶兔 提交于 2019-12-01 07:12:12
问题 I am having trouble creating a continuous distribution in python and its really beginning to annoy me. I have read and re-read this python guide (scipy guide) and it hasn't helped my problem. My code reads: import sys import scipy.stats import numpy def CDF_Random(N,NE,E,SE,S,SW,W,NW,Iterations): WindDir = [0,45,90,135,180,225,270,315] Freq = N,NE,E,SE,S,SW,W,NW mydist = scipy.stats.rv_continuous(#My problem is what to write here) cdf_rand=mydist.rvs(size=Iterations) return (cdf_rand) if _

Create binned variable from results of class interval determination

最后都变了- 提交于 2019-12-01 05:53:23
I want to create a binned variable out of a continuous variable. I want 10 bins, with break points set from whatever results from a jenks classification. How do I assign each value to one of these 10 bins? # dataframe w/ values (AllwdAmt) df <- structure(list(X = c(2078L, 2079L, 2080L, 2084L, 2085L, 2086L, 2087L, 2092L, 2093L, 2094L, 2095L, 4084L, 4085L, 4086L, 4087L, 4088L, 4089L, 4091L, 4092L, 4093L, 4094L, 4095L, 4096L, 4097L, 4098L, 4099L, 4727L, 4728L, 4733L, 4734L, 4739L, 4740L, 4741L, 4742L, 4743L, 4744L, 4745L, 4746L, 4747L, 4748L, 4749L, 4750L, 4751L, 4752L, 4753L, 4754L, 4755L, 4756L

How to draw a continuous curved line from 3 given points at a time

二次信任 提交于 2019-11-30 09:47:15
I am trying to draw a continuous curved line in flash. There are many methods but none of the ones I have found so far quite fit my requirements. First of all, I want to use the flash graphic api's curveTo() method. I DO NOT want to simulate a curve with hundreds of calls to lineTo() per curved line segment . It is my experience and understanding that line segments are processor heavy. Flash's quadratic bezier curve should take less CPU power. Please challenge this assumption if you think I am wrong. I also do not want to use a pre-made method that takes the entire line as an argument (eg mx

Creating a continuous heat map in R

别说谁变了你拦得住时间么 提交于 2019-11-30 07:13:16
问题 I have a series of x and y coordinates that each have a distance attached to them. I would like to create a heat map that displays the average distance for every point within the x and y ranges as a heat map. Since the points are not spaced evenly from each other in a lattice-like shape, the method would require some kind of smoothing function that clusters data and calculates the average for each point the vicinity and then representing that average with a color. So far, using ggplot2 , I

JS counter continuously updating

。_饼干妹妹 提交于 2019-11-29 11:55:34
How to implement a live and persistent number counter on a site So I was looking at this question (^) and I want to do the exact same thing except a little different. I need one of these that counts up 15.8 cents per second from the numb $138,276,343 Preferably I would like to have the commas like a normal dollar amount. Any way I could get this working? I'm stumped. Like the poster of the above question, I don't have much JS knowledge. This took me quite a long time to answer since I had to create my own format currency function. A live demo can be found here: http://jsfiddle.net/dm6LL/ The