1,306 Topics
![]() | |
Hi guys so I am making function for my graphs (adjacency matrices) to return number of connected components using breadth first search algorithm. It almost works properly. It returns proper value if number of components is equal to number of vertices, but if number of components is smaller than number … | |
Here's what I am trying to do: **1. As long as my generic handler gets HttpRequest, push it into a queue and just return empty response so that the request sender does not wait for the long process. 2. A thread keeps checking if there is anything is the queue. … | |
i've just started learning the C# language and this is my first program to use threads. I don't understand why the consumer thread doesn't get called( only after the producer has stopped)and when it gets called it doesn't consume anything, also I've noticed that the majority of produced elements are … | |
void main (void) { /* create three message queue */ mesgQueueId1 = msgQCreate(MAX_MESSAGES,MAX_MESSAGE_LENGTH,MSG_Q_FIFO); if((taskIdOne = taskSpawn("t1",90,0x100,20000,(FUNCPTR)t1,0,0,0,0,0,0,0,0,0,0)) == ERROR) printf("generating task1 failed\n"); if((taskIdThree = taskSpawn("t3",90,0x100,20000,(FUNCPTR)taskThrees,0,0,0,0,0,0,0,0,0,0)) == ERROR) printf("generating task3 failed\n"); } void t1(void) { timer_t task1; struct itimerspec value; value.it_value.tv_sec = 3; value.it_value.tv_nsec = 0; value.it_interval.tv_sec = 3; value.it_interval.tv_nsec = 0; … | |
I am still new with c programming, I need to create queue with first in first out but it is going last in first out. Can someone give me advice in how to make it work. #include <stdio.h> #include <stdlib.h> #include <string.h> #define MAX_LENGTH 30 #define NUMOFEMPLOYEE 15 typedef struct … | |
Hi, I am trying to solve a maze using queues(no recursion) What I've done so far is that I can figure out whether or not the maze can be solved. What my next step should be is to list out STEP BY STEP how the maze will be solved. For … | |
public void Enqueue(int value){ node end = endList.next; end.next=null; endList.data=value; endList.next=end; endList=end; Here is my code for an Enqueue method but when I run it mylist.Enqueue(12); It gives me an error. Is something wrong with my method or am I testing it incorrectly? Thanks. | |
Im having some trouble putting together a linked list implementation of a queue. I'm getting a segmentation fault, which I believe is due to my empty() function because in an attempt to fix my empty() function, I made it determine empty based on (current_size == 0) instead of (front_p == … | |
Hi everyone, I am recieving this error when I attempt to connect the print queues to the user desktops " a policy is in effect that prevenst you from connecting to this print queue" These are Group Policys I have tried can anyone else suggest anything? User Configuration\Administrative Templates\Control Panel\Printers\ … | |
well I've been searching for this from hours now, and also tried to look in this forum. or maybe I dont know what is it called. I'm searching for a script to display featured products on my website, in a sqaure box on right side. but it shouldn't be so … | |
hi, so i have a question relating to sending data in a sequence. i have a class evenvent that reads the data from a txt file. that class has to send data to 2 comunication line async and sync. data sent to async is for ex: 'new' . data that … | |
Hi i have a method as below public void sendDataToCleint(ref UpdateClient uc,ref QueryClient qc,ref FailClient fc) { uc.setValue(false); qc.setValue(false); fc.setValue(false); while (_data.Count != 0) { string a = dataOUT(); string[] split = a.Split(new Char[] { ' ' }); if (split[1] == "NEW") { uc.setValue(true); qc.setValue(false); fc.setValue(false); uc.getData(a); // how do … | |
Hi, I'm new to the C++ programming world and am having a bit of difficulty understanding the difference between a container and container adapter. I thought a container such as a vector, deque and list that hold objects. And an adapter is defined as something that converts something else such … | |
hi, so got a question regargind sending a handler, i have a class for UpdateClient and it has a queue that holds data. this data sould be sent to ether P1 or P2 which are instances of process. Proxy anoher class has to keep track on who is the promary … | |
I have a queue class code is given below: struct ListNode { ListNode(int value); int value; ListNode* next; }; ListNode::ListNode(int value): value(value), next(nullptr) {} public class queue { public: queue(); ~queue(); bool Empty() const; int Next() const; void Enqueue(int value); void Dequeue(); void DisplayAll() const; int getP() const; private: // … | |
i am trying to load up my ObjectQueue variable objQueue with a task to run some operations on, and there i have a NullPointerException error. the error happens at: `objQueue[0].insert(Task);` I have declared the ObjectQueue variable in a similar fashion on other programs and have had no problem. sort of … | |
Hi, I'm having problems with line 37 in my Driver class. I know that I get that error because, according to Java, the variable Task, in the Driver, has not been initialized, but I do not see how I'm not initializing it. Thanks [CODE]import java.util.Scanner; import java.io.*; public class Driver … | |
Combining queue and stack link list? hello so here is my question i ave to connect a link lists together, one who behaves like a stack the other like a queue.the numbers used are 11 22 44 77 33 99 66. so the stack link list looks like this 66 … | |
How to display odd and even numbers from a queue link list? hello everyone i really need some help right now on this program. what this program is supposed to do is copy 11 22 44 77 33 99 66 into a linked list that behaves like a queue. the … | |
So i am seriously in need of help from someone or everyone on improving my program and any corrections if needed. I have listed my codes below and i am hoping to receive input, suggestions, corrections, and advice. Please remember, i am new to programming so please for those of … | |
hello iam trying a circular queue in linked list and array there are two questions for me 1.how can circular queue can be implemented in a normal linked list??i think it can be implemented in circular singly linked list right?? 2.if i implement it in array how i will connect … | |
I am trying to write a funtion to print the contents of a queue using ADT funtions. I composed the following code. It gives me a error of invalid type argument. Need help. int print_queue(QUEUE *queue) { int tempCount; int inputVal; while ((queue_count(queue)) != 0) { tempCount = queue_count(queue); queue_front(queue, … | |
I am getting the following errors when i gcc my code: 44) unixs1 $ gcc whoisserver.c whoisserver.c: In function `main': whoisserver.c:59: warning: passing arg 2 of `bind' from incompatible pointer type whoisserver.c:71: warning: passing arg 2 of `accept' from incompatible pointer type Undefined first referenced symbol in file bind /var/tmp//ccSx8OhK.o … | |
Write a program (in a single .c file) with a queue of strings implemented using array. You should write ite a queue type. The program reads a set of strings stored in a file (filename given on command line as argument) and inserts each string in the queue. Then it … | |
We had been assigned a problem in our Data Structures Laboratory that goes like this: Fill 4 queues with 10 numbers each(Ranging from 1 through 20).Each number need not be unique,i.e a number may be repeated in a queue.Remove an element from each queue.Say 1,3,11,6 are removed from queues 1,2,3 … | |
Hi, I an reading a txt file line by line and putting it in to a Queue<string> q = new Queue<string>(); when i execute the program I get a Argument Exception 'Source array was not long enough. Check srcIndex and length, and the array's lower bounds.' how do i handle … | |
So my program uses the list template as the towers and the values in them are disks. I used the push and pop methods with loops to display changing values due to user input. > Rules of the game: > 1. All disks are stacked into an initial tower. > … | |
so i have 4 list of words. what i want to do is for each list go through it and count the number of occurance the word has in the list and print the first 10. when it comes to saving the word and the number of occurance, how do … | |
Hi, I have a discrete event simulator for m/m/1 queue. How can I have a program based on priority queue using M/M/1 model. PLEASE help me to have an idea about priorities and thier implementations | |
Hi, I'm new to C++. plzz help me with this error. #include <cstdlib> #include <iostream> #define clauselength 85 //we will use index number to find out the clause number. //there are 88 clauses. as we start using index from 1 we have to add one to 89. using namespace std; … | |
[QUOTE=;][/QUOTE] Please help me to build a list of examples of stack and queue in real life situation... Conditions: The object concerned must only one object. And the object must be tangible. Example: Queue (FIFO): The bullet in a machine gun..(you cannot fire 2 bullets at the same time) Stack … | |
Hi, i have a txt file that i want to read from the program and add it to a queue. how to i read part of the file (say for ex 50 characters each) and put it to a queue. the file contains a story. string filePath = "C:\\"; try … | |
Here I have the classes Logger and Driver. Driver takes the singleton class of Logger, and logs the same statement 10000 times. I want to use this logger, so that it runs in the background and only logs every so often. This will force the program to not use too … | |
#include<iostream.h> class ADTqueue { private: int queue[10]; int head,tail; public: ADTqueue() { tail = -1; head = 0; } int empty() { if(head == tail+1) return (1); else return (0); } int full() { if(tail == 9) return (1); else return (0); } void append(int num) { if (!full()) { … | |
![]() | Hihi im very new to programming. Need help for this program. Im supposed to create a queue using an integer array. For input value > 0, program will insert value to queue ; input value = 0, program will remove least recently added value from queue if non empty ; … ![]() |
Hi there everyone... Allright my setting is this: I have written an C++ application that receives input from a user app, converts it to XML, and then posts it to our ERP (Syspro) through e.net COM objects using ActiveQt and in specific QAxObject... The problem is this: QAxObject inherits from … | |
I want to make every single change on a local database to also be *immediately* done on the remote database. The remote database is always online but the local one is not. I was hoping of using RabbitMQ to queue the records so they could be sent immediately when the … | |
Hello All, I have shell script which runs on unix box but recently we moved to windows box. I am completely zero in VB script I need you guys help to convert the below script to VB Thanks in advance for the help. CheckQDepth() { arch_log_file=`ls $arch_dir |grep $FNPARAM | … ![]() | |
Hi, im just doing some past exam papers for an exam I've got coming up and im struggling with Java generics, i cant seem to find any good examples to help me out. I've found small snippets of code but i really need a larger piece of code shown before … | |
public class QueueImpl<E extends Comparable<E>> { private int count; private class Node { private E info; Node next; } Node front; Node rear; public E peekMaximum() { Node temp = new Node(); temp = front; Node max = new Node(); max = temp; while(temp!=null) { System.out.println(temp.info); //if(temp.info>max) if((temp).compareTo(max))>0) // getting … | |
As usual I know I'm probably doing something stupid. I'm trying to write the program below but I seem to have handled my queue incorrectly. The problem could be in one of three places; the way i handle moving on to the next node, my addboard function or my printsol … | |
hello, i'm writing a code for non-preemptive shortest job first, everything is okay except to select the first process arrived in the queue. here is my code. #include<iostream> using namespace std; struct process{ int processId; int burstTime; int arrivalTime; }; int main(){ int numberOfProcesses; //number of process cout <<"please enter … | |
i have made a queue using STL. the queue contains strings only. how to check for a particular string if it present in queue or not? | |
combining of stacks with queues and real time applications | |
I have used queue but I cant figure out how to write code to display horizontal(bfs) and vertical binary search traversal | |
I have a problem whith my .change() function firing twice on my onClick. First of all, I know jquery has a .click function, but since my table (results) are bing displayed/pulled in dynamically from an $.ajax call I don't know of a way to bind .click since the content doesn't … | |
I was asked to write code for consumer and producer threads accessing shared queue in an interview with the given primitives ADDNEW.Process PROCESS.SET PROCESS.RESET ENTER CS EXIT CS LOOP EXIT LOOP WAIT# PROCESS | |
> Hi everyone, I have to implement a circular queue using linked list here. > We imagine a queue in a circular shape where we break at a point such that now it has 2 ends > Now we have to perform insertion and deletion at both ends one at … | |
i have a function in a module that requries integer values. these values are set by the user typing in two textboxes on the form. the texboxes contain Hexadecimal data in string form. function: Friend Function addNewCode(ByVal Location As Integer, ByVal Opcode As Integer) As Boolean If (Not LocStack.Count < … | |
Hello guys, need some help with my assignment. Currently i have already done with the Queue and random part but i'm not too sure how to carry on. Can anyone enlighten me. Thx. Below is the scenario Write an e-mail simulator that processes mail at an average of 40 messages … |
The End.