queue

Ordered queue with two indices

Hi I need an ordered queue where objects would be ordered by primary and secondary value. class Object { int PrimaryValue; int SecondaryValue; } The position of an Object in the queue must be determined by PrimaryValue. Object with higher PrimaryValue must preceed object with lower PrimaryValue. However for two objects with the s...

C# Priority Queue

I'm looking for a priority queue with an interface like this: class PriorityQueue<T> { public void Enqueue(T item, int priority) { } public T Dequeue() { } } All the implementations I've seen assume that item is an IComparable but I don't like this approach; I want to specify the priority when I'm pushing it o...

Prototype/Scriptaculous Toggle Queue

I want to achieve an effect on a certain div with scriptaculous that does the following: The div will blindUp. After that effect is complete, the contents of the div will change. The div will then blindDown with the new contents. So I know there is the effect queue which is awesome, but how can the contents only after the blindUp eff...

Queuing Emails on App Engine

I need to send out emails at a rate exceeding App Engine's free email quota (8 emails/minute). I'm planning to use a TaskQueue to queue the emails, but I wondered: is there already a library or Python module I could use to automate this? It seems like the kind of problem someone might have run into before. ...

Is there a fix sized queue which removes excessive elemets?

Hi, I need a Queue with a fixed size. When I add an element and the the queue would overflow the fixed size it should automaticly remove the oldest element. Is there an existing implementation for this in Java or do I have to programm my own? Thanks in advance. ...

Stagger jQuery Animations

I want to animate a series of items in jquery 1.3, with each next item beginning halfway through the first animation. In otherwords, I want a half-queue effect. I attempted to use the below code, but it is not working. Does anyone have any ideas? $("h3").click(function(){ $(".projectItem").each(function (i) { if (i > 0...

How to associate an iterator to a collection in OCaml

I have these two classes in OCaml class type ['a] collection = object method add : 'a -> unit method clear : unit -> unit method iterator : unit -> 'a iterator method remove : 'a -> unit end class type ['a] iterator = object method hasNext : unit -> bool method next : unit -> 'a end And I need to cr...

Consecutive Ajax requests without jQuery/ JS library

I have an issue, mainly with IE. I need to be able to handle n queries one after another. But If I simply call my function below in a for loop IE does some strange things (like loading only so many of the calls). If I use an alert box it proves that the function gets all of the calls, and surprisingly IT WORKS! My guess is that IE need...

C++ std::queue::pop() calls destructor. what of pointer types?

Hi, I have a std::queue that is wrapped as a templated class to make a thread-safe queue. I have two versions of this class: one that stores value types, one that stores pointer types. For the pointer type, I'm having trouble deleting the elements of the queue on destruction. The reason is that I don't know a way to remove the items fr...

How to get current request num in jQuery ajax manager plugin?

Hi, I'm working on school project witch sends multiply ajax request at the same time. I'm using ajax manager plugin, here is link (http://www.protofunc.com/scripts/jquery/ajaxManager/jquery.ajaxmanager.js) Is there way to get current request number?? Best regards, ...

How can i compare queues in cpp ?

hi there i need to compare the size of 10 queues and determine the least one in size to insert the next element in creating normal if statements will take A LOT of cases so is there any way to do it using a queue of queue for example or an array of queues ? note : i will need to compare my queues based on 2 separate things in 2 situat...

What is the fastest producer consumer method in c#

Hi, I am trying to implement a queue thread that listen to some messages . What is the fastest way to do it , this is one-process mulitple thread application. Should I use Apache Qpid ? or just a regular .NET Blocking Queue Class (as in http://www.eggheadcafe.com/articles/20060414.asp)? I will be happy to hear your experience on this m...

TIBCO queue browser c# problem with iterating message for second time.

Hi I am creating a windows service which connects to 5 queues. The logic is it has only one handler for summary queue which get the message stating how many message should I be getting from rest of 4 queues. Once message is received in summary I go and browse using queue browser and it works perfect only for one time next time it doesn...

MPQueue - what is it and how do I use it?

I encountered a bug that has me beat. Fortunately, I found a work around here (not necessary reading to answer this q) - http://lists.apple.com/archives/quartz-dev/2009/Oct/msg00088.html The problem is, I don't understand all of it. I am ok with the event taps etc, but I am supposed to 'set up a thread-safe queue) using MPQueue, add ...

running multiple workers through a long qeue

I have a long mysql queue. I have 1 worker script that processes each queue. but as this worker is running, the database may be updated or get new row inserts. an example worker script get_current_queue = SELECT from queue... while(get_current_queue) { update_current_row_from_queue "processing" //some cpu intensive processing here ...

WCF: Efficiently consuming large numbers of singleton requests via SQL job?

I'm planning to build a console app to run as part of a SQL 2005 job which will gather records from a database table, create a request object for a WCF service, pass this object to the service for processing, receive a response object, and update a log table with its data. This will be for processing at least several thousand records eac...

What would happen in an thread unsafe .NET queue object?

I have a .NET queue object. The producer thread do the Enqueue operation, the data enqueued in the queue is a byte[] array, while the other consumer thread do the Dequeue operation on the same queue object. I use locks to handle concurrency. My code seems to work fine all the time, but yesterday, weird things happened. The data I got fr...

Stack and Queue, Why?

Why and when should I use stack or queue data structures instead of arrays/lists? Can you please show an example for a state thats it'll be better if you'll use stack or queue? Thanks. ...

Queue to Queue Propagation Issue

Hi, I am trying to propagate messages between two queues that are in the same database. I did exactly as it says here: askanantha.googlepages.com/Oracle_AQ-Example-MultiQueue.pdf The message is propagated successfully. The problem is that it doesn't to dequeue the message with the default subscriber of the destination queue. The only ...

erlang - how to limit message queue or emulate it?

Right now I am doing Process ! Message, but as i googled a bit, a message queue size is only limited to memory. I have a tree of processes where leaves generate messages and feed up to the root and i need to limit queue or switch to some another method of doing the same. more of it, sometimes Process gets messages from one leaf and some...