1,306 Topics

Member Avatar for
Member Avatar for Eclip7e

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 …

0
178
Member Avatar for 9tontruck

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. …

Member Avatar for 9tontruck
0
445
Member Avatar for CPT

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 …

0
189
Member Avatar for ajay.joshi.56

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; …

0
99
Member Avatar for tahity1

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 …

Member Avatar for VernonDozier
0
125
Member Avatar for ja3n

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 …

Member Avatar for ja3n
0
3K
Member Avatar for FUTURECompEng

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.

Member Avatar for FUTURECompEng
0
294
Member Avatar for testie

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 == …

Member Avatar for dx9_programmer
0
762
Member Avatar for thelostboy

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\ …

Member Avatar for JorgeM
0
65
Member Avatar for RaXaaa

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 …

Member Avatar for RaXaaa
0
120
Member Avatar for anisha.silva

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 …

Member Avatar for caKus
0
237
Member Avatar for anisha.silva

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 …

Member Avatar for Momerath
0
136
Member Avatar for shanna62

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 …

Member Avatar for shanna62
0
141
Member Avatar for anisha.silva

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 …

Member Avatar for nmaillet
0
186
Member Avatar for SAM2012

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: // …

Member Avatar for SAM2012
0
288
Member Avatar for mobility42

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 …

Member Avatar for mobility42
0
304
Member Avatar for losh177

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 …

Member Avatar for dimasalang
0
311
Member Avatar for superchica08

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 …

Member Avatar for Lerner
0
1K
Member Avatar for superchica08

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 …

Member Avatar for chaau
0
4K
Member Avatar for NewGuy2Prog

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 …

Member Avatar for JamesCherrill
0
175
Member Avatar for rithish

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 …

Member Avatar for WaltP
0
141
Member Avatar for BoulderMen

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, …

Member Avatar for BoulderMen
0
160
Member Avatar for zychos

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 …

Member Avatar for zychos
0
192
Member Avatar for priya_pawar

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 …

Member Avatar for Ancient Dragon
-1
174
Member Avatar for delta_frost

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 …

Member Avatar for TrustyTony
0
181
Member Avatar for anisha.silva

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 …

Member Avatar for anisha.silva
0
1K
Member Avatar for Stagnant

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. > …

Member Avatar for WaltP
0
3K
Member Avatar for anisha.silva

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 …

Member Avatar for anisha.silva
0
233
Member Avatar for SAM2012

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

Member Avatar for SAM2012
0
310
Member Avatar for nagarjuna844

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; …

Member Avatar for np complete
0
350
Member Avatar for Aska o.

[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 …

Member Avatar for deceptikon
-1
451
Member Avatar for anisha.silva

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 …

Member Avatar for Momerath
0
107
Member Avatar for sidvb1

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 …

Member Avatar for triumphost
0
1K
Member Avatar for lim9I

#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()) { …

Member Avatar for rubberman
0
229
Member Avatar for qwazy

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 ; …

Member Avatar for qwazy
0
2K
Member Avatar for Eagletalon

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 …

Member Avatar for Eagletalon
0
998
Member Avatar for manaila

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 …

Member Avatar for manaila
0
181
Member Avatar for mynamekbk

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 | …

Member Avatar for Kwetal
0
260
Member Avatar for Cragsterboy

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 …

Member Avatar for Taywin
0
204
Member Avatar for shanki himanshu

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 …

Member Avatar for JamesCherrill
0
154
Member Avatar for zeusprog

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 …

0
109
Member Avatar for empror9

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 …

Member Avatar for empror9
0
749
Member Avatar for shanki himanshu

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?

Member Avatar for Ancient Dragon
0
92
Member Avatar for diwakar.hembrom
Member Avatar for SHASHWATH

I have used queue but I cant figure out how to write code to display horizontal(bfs) and vertical binary search traversal

Member Avatar for WaltP
0
209
Member Avatar for dschuett

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 …

Member Avatar for AleMonteiro
0
2K
Member Avatar for Geeksoftie

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

Member Avatar for jimzandueta
0
144
Member Avatar for srinivaskolli

> 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 …

Member Avatar for srinivaskolli
0
2K
Member Avatar for TTTHXC

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 < …

Member Avatar for Reverend Jim
0
737
Member Avatar for sianpunky

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 …

0
68

The End.