queue

Jquery : delay fadeOut & clearQueue dosn't work ?

Hello, I don't understand why this code doesn't work : function Messages(type,text) { console.log("In function Message"); $("#message").clearQueue(); console.log("clearQueue :"+$("#message").queue("fx").length+" effet in queue"); if($("#message").length > 0 && $("#message").not(":visible").length == 1) { $("#...

Does this seem like a reasonable approach to a concurrent set/queue combo?

Update: As Brian pointed out, my original idea did indeed have a concurrency issue. This was somewhat obscured by the signature of the ConcurrentDictionary<TKey, TValue>.AddOrUpdate method, which can lull a lazy thinker (like myself) into believing that everything--the set add as well as the queue push--will somehow happen all at once, a...

Can I use a multiprocessing Queue in a function called by Pool.imap?

I'm using python 2.7, and trying to run some CPU heavy tasks in their own processes. I would like to be able to send messages back to the parent process to keep it informed of the current status of the process. The multiprocessing Queue seems perfect for this but I can't figure out how to get it work. So, this is my basic working exampl...

python thread queue question..

Hell All. i was made some python script with thread which checking some of account exist in some website if i run thread 1 , it working well but if increase thread such like 3~5 and above, result was very different compare with thread 1 and i was checked manually and if i increase thread result was not correct. i think some of my ...

stack vs queuing ?

hello im still a student and im a bit confused about stacking and queuing ? first question is, what is the main diffrence between them two ? btw there is circular queuing beside normal queuing how about that ? how do they work ? is there any different ways to queuing? im useing php, is there a simple ( very simple or easy to read ) sa...

Cannot put object on Queue

I want to put an instance of scapy.layers.dhcp.BOOTP on a multiprocessing.Queue. Every time I call put() the following exception occures: Traceback (most recent call last): File "/usr/lib/python2.6/multiprocessing/queues.py", line 242, in _feed send(obj) PicklingError: Can't pickle <type 'function'>: attribute lookup __builtin__.f...

Asynchronous method queue in Javascript

I am attempting to implement an asynchronous method queue in Javascript as seen in this blog post Here's what I have so far: function Queue() { this._methods = []; this._response = null; this._flushed = false; } (function(Q){ Q.add = function (fn) { if (this._flushed) fn(this._response); else this._methods.push(fn); ...

How to extend bash shell ?

Hello, would like to add new functionality to the bash shell. I need to have a queue for executions. What is the easy way to add new functionality to the bash shell keeping all native functions? I would like to process the command line, then let the bash to execute them. For users it should be transparent. Thanks Arman EDIT I just ...

Extending python Queue.PriorityQueue (worker priority, work package types)

Hi! I would like to extend the Queue.PriorityQueue described here: http://docs.python.org/library/queue.html#Queue.PriorityQueue The queue will hold work packages with a priority. Workers will get work packages and process them. I want to make the following additions: Workers have a priority too. When multiple workers are idle the on...

when is a queue full?

I have seen many ways to check when a queue is full, but I don`t understand any, so in simple words when is a queue full? (If there is a code please make it in C++ or pseudocode) I have this code to check if the queue is full:- myFront != (myBack+1) % max (e.g. why isn`t it simply " myBack == max ") ...

Make my own FIFO Queue class for my own class object to fill it?

Hello. I am trying to make a FIFO Queue that is filled with my own class object. I found this example but if I replace < E > with < PCB > it does not work: import java.util.LinkedList; public class SimpleQueue<E> { private LinkedList<E> list = new LinkedList<E>(); public void put(E o) { list.addLast(o); } public E ge...

how to execute an for loop till the queue is emptyin c++

hello, i need to execute an for loop till the queue is empty my code queue<string> q; for(int i=0;i<q.size(),i++) { // some operation goes here // some datas are added to queue } ...

Producer Consumer queue does not dispose

Hi, i have built a Producer Consumer queue wrapping a ConcurrentQueue of .net 4.0 with SlimManualResetEvent signaling between the producing (Enqueue) and the consuming (while(true) thread based. the queue looks like: public class ProducerConsumerQueue<T> : IDisposable, IProducerConsumerQueue<T> { private bool _IsActive=true; pu...

Cancel documents in the printer queue from java in windows

Is it possible to cancel a print job once it has already been put into the document queue in windows with java code? ...

Can a C# blocking FIFO queue leak messages? What's wrong in my code?

Hello, I'm working on an academic open source project and now I need to create a fast blocking FIFO queue in C#. My first implementation simply wrapped a synchronized queue (w/dynamic expansion) within a reader's semaphore, then I decided to re-implement in the following (theorically faster) way public class FastFifoQueue<T> { priva...

track changes to a db blob

hi, in my web app the database has a blob(an xml file). The user is allowed to change the blob through a web interface. I take the blob show it in a html form, then the user can change some values and save it back. So the user submit request has a db save. For some tracking purpose I want to store the previous and current state of the ...

HTTP request queue with worker pool

Hello. I'm developing application in Java which connects to different web-servers via HTTP protocol (sends them request and waits for response). I would like to use pattern with queue and worker pool, so I'd like to know if there any frameworks in Java providing methods for this? ...

Fast data recording/logging on a separate thread in C#

Hello, We're developing an application which reads data from a number of external hardware devices continuously. The data rate is between 0.5MB - 10MB / sec, depending on the external hardware configuration. The reading of the external devices is currently being done on a BackgroundWorker. Trying to write the acquired data to disk with...

Use beanstalkd, for periodic tasks, how to always make a job replaced by its latest one?

Hi, all I am trying to use beanstalk for queuing a large number of periodic tasks (for example, tasks need processed every N minutes), for each task, if the last queued job is not completed (not reserved, i mean) when current job to be added, the last queued job should be replaced with current job, in other words, only the latest queued...

Python Queue - Threads bound to only one core

Hello, I wrote a python script that: 1. submits search queries 2. waits for the results 3. parses the returned results(XML) I used the threading and Queue modules to perform this in parallel (5 workers). It works great for the querying portion because i can submit multiple search jobs and deal with the results as they come in. How...