Search Results

Search found 16680 results on 668 pages for 'long polling'.

Page 3/668 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • c++ address string -> long

    - by stefan
    I got an adress example: 0x003533 , its a string but to use it i need it to be a LONG but i dont know how to do it :S has anybody a solution? so string: "0x003533" to long 0x003533 ??

    Read the article

  • How do I view how many concurrent long polling requests there are on my server?

    - by Pascal
    My host is Joyent. My host says I have 15 process limit and prstat -J shows those processes but that doesn't tell me how many long polling requests are currently being served. I could record it myself but that would add alot of performance overhead. I need to know when the server is at its long polling limits. I know this limit occurs far before the memory or CPU is used up. From experimentation, I've already verified that the number of long polls open is NOT equivalant to the number of processes running, probably because each process has multiple threads, each serving a request. thanks.

    Read the article

  • SQL Server Table Polling by Multiple Subscribers

    - by Daniel Hester
    Background Designing Stored Procedures that are safe for multiple subscribers (to call simultaneously) can be challenging.  For example let’s say that you want multiple worker processes to poll a shared work queue that’s encapsulated as a SQL Table. This is a common scenario and through experience you’ll find that you want to use Table Hints to prevent unwanted locking when performing simultaneous queries on the same table. There are three table hints to consider: NOLOCK, READPAST and UPDLOCK. Both NOLOCK and READPAST table hints allow you to SELECT from a table without placing a LOCK on that table. However, SELECTs with the READPAST hint will ignore any records that are locked due to being updated/inserted (or otherwise “dirty”), whereas a SELECT with NOLOCK ignores all locks including dirty reads. For the initial update of the flag (that marks the record as available for subscription) I don’t use the NOLOCK Table Hint because I want to be sensitive to the “active” records in the table and I want to exclude them.  I use an Update Lock (UPDLOCK) in conjunction with a WHERE clause that uses a sub-select with a READPAST Table Hint in order to explicitly lock the records I’m updating (UPDLOCK) but not place a lock on the table when selecting the records that I’m going to update (READPAST). UPDATES should be allowed to lock the rows affected because we’re probably changing a flag on a record so that it is not included in a SELECT from another subscriber. On the UPDATE statement we should explicitly use the UPDLOCK to guard against lock escalation. A SELECT to check for the next record(s) to process can result in a shared read lock being held by more than one subscriber polling the shared work queue (SQL table). It is expected that more than one worker process (or server) might try to process the same new record(s) at the same time. When each process then tries to obtain the update lock, none of them can because another process has a shared read lock in place. Thus without the UPDLOCK hint the result would be a lock escalation deadlock; however with the UPDLOCK hint this condition is mitigated against. Note that using the READPAST table hint requires that you also set the ISOLATION LEVEL of the transaction to be READ COMMITTED (rather than the default of SERIALIZABLE). Guidance In the Stored Procedure that returns records to the multiple subscribers: Perform the UPDATE first. Change the flag that makes the record available to subscribers.  Additionally, you may want to update a LastUpdated datetime field in order to be able to check for records that “got stuck” in an intermediate state or for other auditing purposes. In the UPDATE statement use the (UPDLOCK) Table Hint on the UPDATE statement to prevent lock escalation. In the UPDATE statement also use a WHERE Clause that uses a sub-select with a (READPAST) Table Hint to select the records that you’re going to update. In the UPDATE statement use the OUTPUT clause in conjunction with a Temporary Table to isolate the record(s) that you’ve just updated and intend to return to the subscriber. This is the fastest way to update the record(s) and to get the records’ identifiers within the same operation. Finally do a set-based SELECT on the main Table (using the Temporary Table to identify the records in the set) with either a READPAST or NOLOCK table hint.  Use NOLOCK if there are other processes (besides the multiple subscribers) that might be changing the data that you want to return to the multiple subscribers; or use READPAST if you're sure there are no other processes (besides the multiple subscribers) that might be updating column data in the table for other purposes (e.g. changes to a person’s last name).  NOLOCK is generally the better fit in this part of the scenario. See the following as an example: CREATE PROCEDURE [dbo].[usp_NewCustomersSelect] AS BEGIN -- OVERRIDE THE DEFAULT ISOLATION LEVEL SET TRANSACTION ISOLATION LEVEL READ COMMITTED -- SET NOCOUNT ON SET NOCOUNT ON -- DECLARE TEMP TABLE -- Note that this example uses CustomerId as an identifier; -- you could just use the Identity column Id if that’s all you need. DECLARE @CustomersTempTable TABLE ( CustomerId NVARCHAR(255) ) -- PERFORM UPDATE FIRST -- [Customers] is the name of the table -- [Id] is the Identity Column on the table -- [CustomerId] is the business document key used to identify the -- record globally, i.e. in other systems or across SQL tables -- [Status] is INT or BIT field (if the status is a binary state) -- [LastUpdated] is a datetime field used to record the time of the -- last update UPDATE [Customers] WITH (UPDLOCK) SET [Status] = 1, [LastUpdated] = GETDATE() OUTPUT [INSERTED].[CustomerId] INTO @CustomersTempTable WHERE ([Id] = (SELECT TOP 100 [Id] FROM [Customers] WITH (READPAST) WHERE ([Status] = 0) ORDER BY [Id] ASC)) -- PERFORM SELECT FROM ENTITY TABLE SELECT [C].[CustomerId], [C].[FirstName], [C].[LastName], [C].[Address1], [C].[Address2], [C].[City], [C].[State], [C].[Zip], [C].[ShippingMethod], [C].[Id] FROM [Customers] AS [C] WITH (NOLOCK), @CustomersTempTable AS [TEMP] WHERE ([C].[CustomerId] = [TEMP].[CustomerId]) END In a system that has been designed to have multiple status values for records that need to be processed in the Work Queue it is necessary to have a “Watch Dog” process by which “stale” records in intermediate states (such as “In Progress”) are detected, i.e. a [Status] of 0 = New or Unprocessed; a [Status] of 1 = In Progress; a [Status] of 2 = Processed; etc.. Thus, if you have a business rule that states that the application should only process new records if all of the old records have been processed successfully (or marked as an error), then it will be necessary to build a monitoring process to detect stalled or stale records in the Work Queue, hence the use of the LastUpdated column in the example above. The Status field along with the LastUpdated field can be used as the criteria to detect stalled / stale records. It is possible to put this watchdog logic into the stored procedure above, but I would recommend making it a separate monitoring function. In writing the stored procedure that checks for stale records I would recommend using the same kind of lock semantics as suggested above. The example below looks for records that have been in the “In Progress” state ([Status] = 1) for greater than 60 seconds: CREATE PROCEDURE [dbo].[usp_NewCustomersWatchDog] AS BEGIN -- TO OVERRIDE THE DEFAULT ISOLATION LEVEL SET TRANSACTION ISOLATION LEVEL READ COMMITTED -- SET NOCOUNT ON SET NOCOUNT ON DECLARE @MaxWait int; SET @MaxWait = 60 IF EXISTS (SELECT 1 FROM [dbo].[Customers] WITH (READPAST) WHERE ([Status] = 1) AND (DATEDIFF(s, [LastUpdated], GETDATE()) > @MaxWait)) BEGIN SELECT 1 AS [IsWatchDogError] END ELSE BEGIN SELECT 0 AS [IsWatchDogError] END END Downloads The zip file below contains two SQL scripts: one to create a sample database with the above stored procedures and one to populate the sample database with 10,000 sample records.  I am very grateful to Red-Gate software for their excellent SQL Data Generator tool which enabled me to create these sample records in no time at all. References http://msdn.microsoft.com/en-us/library/ms187373.aspx http://www.techrepublic.com/article/using-nolock-and-readpast-table-hints-in-sql-server/6185492 http://geekswithblogs.net/gwiele/archive/2004/11/25/15974.aspx http://grounding.co.za/blogs/romiko/archive/2009/03/09/biztalk-sql-receive-location-deadlocks-dirty-reads-and-isolation-levels.aspx

    Read the article

  • android maps: How to Long Click a Map?

    - by vamsibm
    Hi. How do I long click on a mapview so that a place marker appears at that point on the map? I tried a couple ways without success: 1) Using setOnLongClickListener on the MapvView which never detected the longclicks. 2) My other idea was to extend MapView to override dispatchTouchEvent .. Create a GestureDetector to respond to longpress callback. But I was stuck midway here as I could not get a handle to my subclassed Mapview. i.e. MyMapview mymapview; //MyMapView extends MapView mymapView = (MyMapView) findViewById(R.id.map); //results in a classcast exception 3) The only other way I know how to try this is: Detect a MotionEvent.ACTION_DOWN and post a delayed runnable to a handler and detect longpress if the two other events: acton_move or an action_up, have not happened. Can someone provide thoughts on any of these methods to detect long presses? Thanks in advance. Bd

    Read the article

  • Long Double in C

    - by reubensammut
    I've been reading the C Primer Plus book and got to this example #include <stdio.h> int main(void) { float aboat = 32000.0; double abet = 2.14e9; long double dip = 5.32e-5; printf("%f can be written %e\n", aboat, aboat); printf("%f can be written %e\n", abet, abet); printf("%f can be written %e\n", dip, dip); return 0; } After I ran this on my macbook I was quite shocked at the output: 32000.000000 can be written 3.200000e+04 2140000000.000000 can be written 2.140000e+09 2140000000.000000 can be written 2.140000e+09 So I looked round and found out that the correct format to display long double is to use %Lf. However I still can't understand why I got the double abet value instead of what I got when I ran it on Cygwin, Ubuntu and iDeneb which is roughly -1950228512509697486020297654959439872418023994430148306244153100897726713609 013030397828640261329800797420159101801613476402327600937901161313172717568.0 00000 can be written 2.725000e+02 Any ideas?

    Read the article

  • Long URLs (Bitly and TinyURL)

    - by Sixfoot Studio
    I'm sitting with a problem where I need to pass more than 2000 characters from my Flash application to an HTML page which reads the information and displays the correct options made in the Flash app the person came from. All's good but on the final stage, when the user needs to post their choices to a form, the character cannot be sent because the string is too long. Is there a way to use a service such as Bitly or TinyURL to send these long string and for them to be "deconstruction" on the other end when the form is sent? Otherwise, is there another solution to this problem? Many thanks!

    Read the article

  • Long running stats process - thoughts on language choice?

    - by Josh
    I am on a LAMP stack for a website I am managing. There is a need to roll up usage statistics (a variety of things related to our desktop product), and I initially tackled the problem with PHP (being that I had a bunch of classes to work with the data already). All worked well on my dev box which was using 5.3 Long story short, 5.1 memory management seems to suck a lot worse, and I've had to do a lot of fooling to get the long term roll up scripts to run in a fixed memory space. Our server guys are unwilling to upgrade php at this time. I've since moved my dev server back to 5.1 so I don't run into this problem again... For mining of mysql databases to roll up statistics for different periods and resolutions, potentially running a process that does this all the time in the future (as opposed to on a cron schedule), what language choice do you recommend? I was looking at python (I know it more or less), java (don't know it that well), sticking it out with php (know it quite well). Thanks for any suggestions. Josh

    Read the article

  • Ajax long polling (comet) + php on lighttpd v1.4.22 multiple instances problem.

    - by fibonacci
    Hi, I am new to this site, so I really hope I will provide all the necessary information regarding my question. I've been trying to create a "new message arrived notification" using long polling. Currently I am initiating the polling request by window.onLoad event of each page in my site. On the server side I have an infinite loop: while(1){ if(NewMessageArrived($current_user))break; sleep(10); } echo $newMessageCount; On the client side I have the following (simplified) ajax functions: poll_new_messages(){ xmlhttp=GetXmlHttpObject(); //... xmlhttp.onreadystatechange=got_new_message_count; //... xmlhttp.send(); } got_new_message_count(){ if (xmlhttp.readyState==4){ updateMessageCount(xmlhttp.responseText); //... poll_new_messages(); } } The problem is that with each page load, the above loop starts again. The result is multiple infinite loops for each user that eventually make my server hang. *The NewMessageArived() function queries MySQL DB for new unread messages. *At the beginning of the php script I run start_session() in order to obtain the $current_user value. I am currently the only user of this site so it is easy for me to debug this behavior by writing time() to a file inside this loop. What I see is that the file is being written more often than once in 10 seconds, but it starts only when I go from page to page. Please let me know if any additional information might help. Thank you.

    Read the article

  • Can I get the IE debugger to break into long-running javascript

    - by Brian Deacon
    I have a page that has a byzantine amount of javascript running. In IE only, and only version 8, I get a long-script warning that I can reliably reproduce. I suspect it is event handlers triggering themselves in an infinite loop. The Developer Tools are limping horribly under the weight of the script running, but I do seem to be able to get the log to tell me what line of script it was executing when I aborted, but it is inevitably some of the deep plumbing of the ExtJS code we use, and I can't tell where it is in my stack of code. A way of seeing the call stack would work, but preferably I'd like to be able to just break into the debugger when I get the long script warning so I can just step through the stack. There is a similar question posted, but the answers given were for a not-the-right-tool, or the not terribly helpful advice to eliminate half my code at a time on a binary hunt for the infinite loop. If my code were simple enough that I could do that, it probably wouldn't have gotten the infinite loop in the first place. If I could reproduce the problem in firebug, I'd probably be a lot happier too.

    Read the article

  • Long To XMLGregorianCalendar and back to Long

    - by JD.
    I am trying to convert from millisecond time stamp to XMLGregorianCalendar and back, but I seem to be getting wrong results. Am I doing something wrong? It seems I am gaining days. // Time stamp 01-Jan-0001 00:00:00.000 Long ts = -62135740800000L; System.out.println(ts); System.out.println(new Date(ts)); // Sat Jan 01 00:00:00 PST 1 .. Cool! // to Gregorian Calendar GregorianCalendar gc = new GregorianCalendar(); gc.setTimeInMillis(ts); // to XML Gregorian Calendar XMLGregorianCalendar xc = DatatypeFactory.newInstance().newXMLGregorianCalendar(gc); // back to GC GregorianCalendar gc2 = xc.toGregorianCalendar(); // to Timestamp Long newTs = gc2.getTimeInMillis(); System.out.println(newTs); // -62135568000000 .. uh? System.out.println(new Date(newTs)); // Mon Jan 03 00:00:00 PST 1 .. where did the extra days come from?

    Read the article

  • Matrices of "long"s in Java/COLT?

    - by Darren Wilkinson
    I'm very new to Java/COLT so apologies if this is a dumb question... But, is it possible to define (2d) matrices of type "long" using the cern.colt.matrix stuff? If so, how?! I can find an abstract class for "Object" and a concrete implementation for "double", but then I am stuck... Thanks,

    Read the article

  • Python - Launch a Long Running Process from a Web App

    - by Greg
    I have a python web application that needs to launch a long running process. The catch is I don't want it to wait around for the process to finish. Just launch and finish. I'm running on windows XP, and the web app is running under IIS (if that matters). So far I tried popen but that didn't seem to work.

    Read the article

  • Disposing of Objects with long living dependencies

    - by Ray Booysen
    public class ABC { public ABC(IEventableInstance dependency) { dependency.ANewEvent += MyEventHandler; } private void MyEventHandler(object sender, EventArgs e) { //Do Stuff } } Let us say that an instance of ABC is a long living object and that my dependency is an even longer running object. When an instance of ABC needs to be cleaned up, I have two options. One I could have a Cleanup() method to unsubscribe from the ANewEvent event or I could implement IDisposable and in the Dispose unwire the event. Now I have no control over whether the consumer will call the dispose method or even the Cleanup method should I go that route. Should I implement a Finaliser and unsubscribe then? It feels dirty but I do not want hanging instances of ABC around. Thoughts?

    Read the article

  • PHP: Coding long-running scripts when servers impose an execution time limit

    - by thomasrutter
    FastCGI servers, for example, impose an execution time limit on PHP scripts which cannot be altered using set_time_limit() in PHP. IIS does this too I believe. I wrote an import script for a PHP application that works well under mod_php but fails under FastCGI (mod_fcgid) because the script is killed after a certain number of seconds. I don't yet know of a way of detecting what your time limit is in this case, and haven't decided how I'm going to get around it. Doing it in small chunks with redirects seems like one kludge, but how? What techniques would you use when coding a long-running task such as an import or export task, where an individual PHP script may be terminated by the server after a certain number of seconds? Please assume you're creating a portable script, so you don't necessarily know whether PHP will eventually be run under mod_php, FastCGI or IIS or whether a maximum execution time is enforced at the server level.

    Read the article

  • long processes php

    - by significance
    hi, i need to run a really long php script (four and half, five hours). the script sometimes runs successfully, but sometimes gets killed inexplicably (poss something to do with the shared hosting??). i think that the solution maybe to run the script is smaller chunks. in order to do this i have written a script that stores it's status & position in an xml file, and executes one chunk of the script, before moving the position on. i am having problems hooking up the last bit of the script, which should end the current process & re-execute the script. or maybe i am barking up the wrong tree completely! i have read through what i can find on SO and elsewhere but i'm still none the wiser :( please help!!! dan

    Read the article

  • Determining Long Tap (Long Press, Tap Hold) on Android with jQuery

    - by Volomike
    I've been able to successfully play with the touchstart, touchmove, and touchend events on Android using jQuery and an HTML page. Now I'm trying to see what the trick is to determine a long tap event, where one taps and holds for 3 seconds. I can't seem to figure this out yet. I'm wanting to this purely in jQuery without Sencha Touch, JQTouch, jQMobile, etc. I like the concept of jQTouch, although it doesn't provide me a whole lot and some of my code breaks with it. With Sencha Touch, I'm not a fan of moving away from jQuery into Ext.js and some new way of doing Javascript abstraction, especially when jQuery is so capable. So, I want to figure this out with jQuery alone. I've been able to do many jQTouch and Sencha Touch things on my own using jQuery. And jQMobile is still too beta and not directed enough to the Android yet.

    Read the article

  • long running process in asp.net C#

    - by user339323
    Hello All, I have a web application that has a long running (resource intensive) process in the code behind and the end output is a pdf file (images to pdf conversion tool) It runs fine..and since I am on a dedicated server, it is not at all a problem with respect to resources right now. However, I wonder that the system would reach its resource limits if, there are more than 20 users processing at a time. I have seen services online where the user enters their email and the processes are, I suppose, queued in the background and the results emailed with the 1st in 1st out method. Can someone please give me a start on how to implement this kind of logic in asp.net applications using C#? Thanks a lot in advance, Prasad.

    Read the article

  • long waiting time in linking

    - by ccanan
    Hi, here is the situation. I am using visual studio 2005. the solution contains lots of projects, 34 projects in all, and the start up projects depends on others. then in linking part, it'll wait a long time before the real linking starts. I am pretty sure it's because of too many projects depended, as when I use a solution with 10 of the 34 projects(keep other projects as headers&libs), it'll start instantly. so any one has any idea that I can reduce the waiting time? thx.

    Read the article

  • table row long press

    - by adoo42
    I have a table which is built dynamically based on how much data is present, if at all. I want to be able to long press anywhere on a the table row to be able to get some options to delete or edit etc. Is this possible? Remember I need to do all this without setting any XML as its dynamically built. Is this relevant to what I want to achieve? ` @override public boolean onKeyLongPress(int keyCode, KeyEvent event) { if (keyCode == KeyEvent.KEYCODE_BACK) { // do your stuff here return true; } return super.onKeyLongPress(keyCode, event); } ` any advice is appreciated.

    Read the article

  • Long to timestamp for historic data (pre-1900s)

    - by Mike
    I have a database of start and stop times that have previously all had fairly recent data (1960s through present day) which i've been able to store as long integers. This is very simialr to unix timestamps, only with millisecond precision, so a function like java.util.Date.getTime() would be the value of the current time. This has worked well so far, but we recently got data from the 1860s, and the following code no longer works: to_timestamp('1-JAN-1970 00:00:00', 'dd-mon-yyyy hh24:mi:ss') + numtodsinterval(int_to_convert/(1000),'SECOND' ); This wraps the date and we get timestamps in the year 2038. Is there a way around this issue? All of the documentation i've looked at the documentation and timestamps should be able to handle years all the way back to the -4000 (BC), so i'm suspecting an issue with the numtodsinterval. Any ideas suggestions would be greatly appreciated.

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >