Search Results

Search found 532 results on 22 pages for 'intervals'.

Page 13/22 | < Previous Page | 9 10 11 12 13 14 15 16 17 18 19 20  | Next Page >

  • Java threadpool functionality

    - by cpf
    Hi stackoverflow, I need to make a program with a limited amount of threads (currently using newFixedThreadPool) but I have the problem that all threads get created from start, filling up memory at alarming rate. I wish to prevent this. Threads should only be created shortly before they are executed. e.g.: I call the program and instruct it to use 2 threads in the pool. The program should create & launch the first 2 Threads immediately (obviously), create the next 2 to wait for the previous 2, and at that point wait until one or both of the first 2 ended executing. I thought about extending executor or FixedThreadPool or such. However I have no clue on how to start there and doubt it is the best solution. Easiest would have my main Thread sleeping on intervals, which is not really good either... Thanks in advance!

    Read the article

  • AIR: sync gui with data-base?

    - by John Isaacks
    I am going to be building an AIR application that shows a list (about 1-25 rows of data) from a data-base. The data-base is on the web. I want the list to be as accurate as possible, meaning as soon as the data-base data changes, the list displayed in the app should update asap. I do not know of anyway that the air application could be notified when there is a change, I am thinking I am going to have to poll the data-base at certain intervals to keep an up to date list. So my question is, first is there any way to NOT have to keep checking the data-base? or if I do keep have to keep checking the data-base what is a reasonable interval to do that at? Thanks.

    Read the article

  • [Cocoa] Temporarily disabled NSArrayController filterPredicate, or consult ManagedObjectContext?

    - by ndg
    I have an NSArrayController which is bound to a class in my Managed Object Context. During runtime the NSArrayController can have a number of different filter predicates applied. At certain intervals, I want to iterate through my NSArrayController's contents regardless of the filter predicate applied to it. To do this, I set the filterPredicate to nil and then reinstate it after having iterated through my array. This seems to work, but I'm wondering if it's best practice? Should I instead be polling my Managed Object Context manually? NSPredicate *predicate = nil; predicate = [myArrayController filterPredicate]; [myArrayController setFilterPredicate:nil]; for(MyManagedObject *object in [myArrayController arrangedObjects]) { // ... } [myArrayController setFilterPredicate:predicate];

    Read the article

  • Best way to store 3 pieces of data as a single entry

    - by Matt
    For a game server, I want to record details when a player makes a kill, store this, and then at intervals update to a sql database. The part i'm interested in right now is the best method of storing the kill information. What i'd like to pass to the sql server on update would be {PlayerName, Kills, Deaths}, where the kills and deaths are a sum for the period between updates. So i'm assuming i'd build a list along the lines of {bob, 1, 0} {frank, 0, 1} {tom, 1, 0} {frank, 0, 1} then on update, consolidate the list to {frank, 14, 3}etc Can someone offer some advice please?

    Read the article

  • Database caching on a shared host

    - by tau
    Anyone have any ideas how to increase MySQL performance on a shared host? My question has less to do with overall database performance and more to do with simply retrieving user-submitted data. Currently my database will create caches at timed intervals, and then the PHP will selectively access the static files it needs. This has given me a noticeable performance boost, but I am worried about a time in which I have so much data that having to read in big files in PHP will actually be slower. I am just looking for ideas for shared hosting solutions; I am not going to get my own server anytime soon. Thanks!

    Read the article

  • What is the simplest method to fill the area under a geom_freqpoly line?

    - by mattrepl
    The x-axis is time broken up into time intervals. There is an interval column in the data frame that specifies the time for each row. The column is a factor, where each interval is a different factor level. Plotting a histogram or line using geom_histogram and geom_freqpoly works great, but I'd like to have a line, like that provided by geom_freqpoly, with the area filled. Currently I'm using geom_freqpoly like this: ggplot(quake.data, aes(interval, fill=tweet.type)) + geom_freqpoly(aes(group = tweet.type, colour = tweet.type)) + opts(axis.text.x=theme_text(angle=-60, hjust=0, size = 6)) I would prefer to have a filled area, such as provided by geom_density, but without smoothing the line: UPDATE: The geom_area has been suggested, is there any way to use a ggplot2-generated statistic, such as ..count.., for the geom_area's y-values? Or, does the count aggregation need to occur prior to using ggplot2?

    Read the article

  • iphone moving direction using accelerometer

    - by Ruchir Shah
    Hi, I want some help on UIAccelerometer class. I want to find some way to find out or distinguish when I wave iphone device from right-to-left and the left-to-right. I am getting x,y,z values as well as interval value. I am also getting velocity and distance calculated from normal physics rule. Distance = (prevDist + sqrt(pow((prevx - acceleration.x), 2) + pow((prevy - acceleration.y), 2) + pow((prevz - acceleration.z), 2))) Velocity = (Distance * timeintercal) { here distance means newdistance-prevdistance and timeinterval for that distance } When I am moving iphone device right-to-left then left-to-right I am getting total distance traveld in both direction and velocity at regular intervals. Can you help me how I can find out that I am moving iphone device left-to-right or right-to-left? Help would be appreciated. Thanks.

    Read the article

  • Using polyfit to predict where the object falls ?

    - by ZaZu
    Hi there, I have information of an object being thrown at a parabolic pattern. There are 30 images in total taken at specific intervals from the start position till the end. Now I have managed to extract the x,y coordinates of the object being thrown in all 30 images... I think that using polyfit (or maybe polyval ? ) may help me predict where the object will fall after the first 15 images ... I just want to know, how can polyfit be used with the 30 x,y coordinates I have ? ( I have a loop to extract each image from a mat file 1 row at a time until 30 .. and then plot that image .. so should I use polyfit in the same loop before/after the plot ??? Any ideas ?? Thanks !

    Read the article

  • Temporarily disabled NSArrayController filterPredicate, or consult ManagedObjectContext?

    - by ndg
    I have an NSArrayController which is bound to a class in my Managed Object Context. During runtime the NSArrayController can have a number of different filter predicates applied. At certain intervals, I want to iterate through my NSArrayController's contents regardless of the filter predicate applied to it. To do this, I set the filterPredicate to nil and then reinstate it after having iterated through my array. This seems to work, but I'm wondering if it's best practice? Should I instead be polling my Managed Object Context manually? NSPredicate *predicate = nil; predicate = [myArrayController filterPredicate]; [myArrayController setFilterPredicate:nil]; for(MyManagedObject *object in [myArrayController arrangedObjects]) { // ... } [myArrayController setFilterPredicate:predicate];

    Read the article

  • How to connect to the process

    - by Polaris
    I have WPF Application. My Application consist of 2 exe files: Notifier.exe and MainApp.exe. Notifier is system tray popup application which check the remote server in equal intervals and get the list of current documents of user. When user click on one of the documents in list in Notification popup I open MainApp.exe and show required document in new tab. But When user click on another document in list it open new MainApp.exe process. Question: How Can I connect specific (already opened) process in the operating system and create some object in it?

    Read the article

  • How do I reset a countdown timer when it reaches 0? (Xcode 4)

    - by Zac Prunty
    first question and I have researched the heck out of this and can't seem to find any answers. I would like to implement a countdown timer in my app that starts at 30 seconds and resets when it hits 0. It will count back by 1 second intervals. I have played around with the resources that Apple provides and I can't seem to implement the NStimer to do as I just explained. Are there any suggestions on how I could code this? I would eventually like to link this to a button that will start the timer when it is pressed. I appreciate any advice on this topic!

    Read the article

  • Approaches to timing out sessions on a web app using AJAX autorefreshes

    - by Braintapper
    I'm writing a web application that autorefreshes data with an AJAX call at set intervals. Because it's doing that, server side user sessions never time out, since the last activity is refreshed with every ajax call. Are there good client side rules I could implement to time out the user? I.e. should I track mouse movements in the browser, etc., or should I point the AJAX calls to URLs that don't refresh the session? I like that my AJAX calls hit a session-enabled URL, because I can also validate that the user is logged in, etc. Any thoughts in terms of whether I should even bother timing out the users?

    Read the article

  • for loop will not loop

    - by Bjørn Jostein Aurheim
    I have a for loop that I will use to compute time intervals to add to an ArrayList. The problem is that I can not prove that the for loop is being executed. Nothing is printed when using the system.out.println() statement, and nothing is added to the array from inside the loop ... any sugestions? // lager tidspunkter og legger disse inn i en Array kalt tider tid.setTimer(16); tid.setMinutter(0); tid.setSekunder(0); tider.add(tid.asString());// String "16:00" is added as it should System.out.println("tiden er: "+tid.asString());// gives 16:00 printed for(int i=0;i>12;i++){ System.out.println("er i løkken");// gives nothing printed tid.increaseMinutter(30); System.out.println(tid.asString());// gives nothing printed tider.add(tid.asString()); }

    Read the article

  • how do i insert spaces into a string using the range function?

    - by user1319219
    If I have a string, for example which reads: 'Hello how are you today Joe' How am I able to insert spaces into it at regular intervals? So for example I want to insert spaces into it using the range function in these steps: range(0,27,2). So it will look like this: 'He lo ho w ar e yo u to da y Jo e' It now has a space at every 2nd index going up to it's end. How do I do this does anyone know? thanks.

    Read the article

  • NetNamedPipe: varying response time when communication is idling

    - by Sven Künzler
    I have two WCF apps communicating one-way over named pipes. All is nice, except for one thing: Normally, the request/response cycle takes zero (marginal) time. However, if there was a time span of, say, half a minute without any communication, the request/response increases up to ~300-500ms. I looked around the net and I got the idea of using a heart beat/ping mechanism to keep the communication channel busy. Using trial and error I found that when doing a request each 10 seconds, the response times stay low. Starting at around 15s intervals, the "hiccup" response times begin to appear. Now I'm wondering where this phenomenon is originating from. I tried setting alle conceivable timeouts on both sides to 1 minute, but that did not help. Can anybody explain what's going on there?

    Read the article

  • Keeping Track of Dependant Third-party Library Releases

    - by Sonny
    I am building a web application that is dependent upon several third-party libraries. What is a good strategy for making sure that you're always using the most fully patched versions? A simple method would be to keep the versions written down and visit the websites at regular intervals, but I am looking for some way to get the information 'pushed' to me if possible. I figured that there might be others out there who have needed to do the same thing and have worked out a good solution. Here are a few libraries I am using: Zend Framework jQuery HTMLPurifier Markdownify InnovaStudio WYSIWYG Editor Fancybox MojoZoom

    Read the article

  • Fastest way to find sum of digits on big numbers

    - by dada
    I have some big numbers (again) and i need to find if the sum of the digits is an even number. I tried this: finding the sum of the digits with a while loop and then checking if that sum % 2 equals 0 and it's working but it's too slow for big numbers, because i am given intervals of numbers and if the input is 1999999 19999999999 then my program fails, i cannot complete within the time limit which is 0,1 sec. What to do ? Is there any other faster way to do this ? EDIT: The input 1999999 19999999999 means it will start with 1999999 and check all the numbers like i wrote above until 19999999999, and because we are talking about big numbers (< 2^30) my program is not worthy.

    Read the article

  • Is it a good idea to close and open hibernate sessions frequently?

    - by Gaurav
    Hi, I'm developing an application which requires that state of entities be read from a database at frequent intervals or triggers. However, once hibernate reads the state, it doesn't re-read it unless I explicitly close the session and read the entity in a new session. Is it a good idea to open a session everytime I want to read the entity and then close it afterwards? How much of an overhead does this put on the application and the database (we use a c3p0 connection pool also)? Will it be enough to simply evict the entity from the session before reading it again?

    Read the article

  • hibernate distributed 2nd level cache options

    - by ishmeister
    Not really a question but I'm looking for comments/suggestions from anyone who has experiences using one or more of the following: EhCache with RMI EhCache with JGroups EhCache with Terracotta Gigaspaces Data Grid A bit of background: our applications is read only for the most part but there is some user data that is read-write and some that is only written (and can also be reasonably inaccurate). In addition, it would be nice to have tools that enable us to flush and fill the cache at intervals or by admin intervention. Regarding the first option - are there any concerns about the overhead of RMI and performance of Java serialization?

    Read the article

  • Which "platform" should we use for a notifier-component?

    - by cwap
    Hi all We need to develop a notifier component. What it will do, is to scan a database at given intervals (say, every 15th minute), to see if any notifications needs to be sent out. We're running on Windows, and so we've been looking into either a Windows Service or the Windows Task Scheduler. Our biggest concern is the robustness of our implementation. If it, for some reason, crashes, can it be auto-restarted the next interval? Can we use custom logging logic, to take care of crashes? I'd like an educated guess on what to use here :) Feel free to say if you need additional info, to make such a guess.. Props will be given if someone could make a short listing of the pros n cons of a windows service vs. the windows task scheduler. Also, it should be noted, that we aren't set on either of these, so if you have any alternatives, please, do post away. Thanks in advance :)

    Read the article

  • SQL: Is it quicker to insert sorted data into a table?

    - by AngryWhenHungry
    A table in Sybase has a unique varchar(32) column, and a few other columns. It is indexed on this column too. At regular intervals, I need to truncate it, and repopulate it with fresh data from other tables. insert into MyTable select list_of_columns from OtherTable where some_simple_conditions order by MyUniqueId If we are dealing with a few thousand rows, would it help speed up the insert if we have the order by clause for the select? If so, would this gain in time compensate for the extra time needed to order the select query? I could try this out, but currently my data set is small and the results don't say much.

    Read the article

  • APNS Sending Frequent Notifications to Device

    - by user564447
    I'm trying to mimic a pager with my app by sending push notifications to the user until he or she responds. My thought was to send a push every few seconds and play the default sound on arrival. Not perfect, but better than nothing. It's working all right. However, I am finding that the sound starts to stutter/interrupt a bit after a few notifications have been sent -- as if it's trying to play the sound more than once. This happens even if I only send the push every 10 seconds. I just tested it at 20 second intervals and even then it starts to sound interrupted after about 10 times. Any idea how to resolve this so each message plays the sound crisply? p.s. Testing performed on an iPad.

    Read the article

  • JavaScript apparently waits for each AJAX call before sending another in a loop

    - by itako
    Hello. Straight to the point: I have this javascript: for(item=1;item<5;item++) { xmlhttp=new XMLHttpRequest(); xmlhttp.open("GET",'zzz.php', true); xmlhttp.send(); } And in PHP file something like this: usleep(5);die('ok'); Now the problem is javascript seems to be waiting for each ajax call to be completed before sending another one. So the first response gets back after approx. 5 seconds, next after 10 seconds and so on. That's a very simplified version of what I do, since the real script involves using cURL in PHP and jQuery as JS lib. But the problem remains the same. Why do responses come back in 5 second intervals?

    Read the article

  • Why are there performance differences when a SQL function is called from .Net app vs when the same c

    - by Dan Snell
    We are having a problem in our test and dev environments with a function that runs quite slowly at times when called from an .Net Application. When we call this function directly from management studio it works fine. Here are the differences when they are profiled: From the Application: CPU: 906 Reads: 61853 Writes: 0 Duration: 926 From SSMS: CPU: 15 Reads: 11243 Writes: 0 Duration: 31 Now we have determined that when we recompile the function the performance returns to what we are expecting and the performance profile when run from the application matches that of what we get when we run it from SSMS. It will start slowing down again at what appear to random intervals. We have not seen this in prod but they may be in part because everything is recompiled there on a weekly basis. So what might cause this sort of behavior?

    Read the article

  • C#. Struct design. Why 16 byte is recommended size?

    - by maxima120
    I read Cwalina book (recommendations on development and design of .NET apps). He says that good designed struct has to be less than 16 bytes in size (for performance purpose). My questions is - why exactly is this? And (more important) can I have larger struct with same efficiency if I run my .NET 3.5 (soon to be .NET 4.0) 64-bit application on i7 under Win7 x64 (is this limitation CPU / OS based)? Just to stress again - I need as efficient struct as it is possible. I try to keep it in stack all the time, the application is heavily multi-threaded and runs on sub-millisecond intervals, the current size of the struct is 64 byte.

    Read the article

< Previous Page | 9 10 11 12 13 14 15 16 17 18 19 20  | Next Page >