1,306 Topics

Member Avatar for
Member Avatar for becdudek

Hey, im getting the following error unreported exception Exceptions.IllegalValue; must be caught or declared to be thrown this is my method where im getting the error and i want to know why im getting this error because i declared that the exception was to be thrown. is it something to …

Member Avatar for becdudek
0
106
Member Avatar for becdudek

Hey Guys, i am supposed to write an implementation of The PriorityQueue interface in this user defined package, this is the first time im using iterator and so im having trouble. at the moment im getting the following error message [CODE]PriorityQueueLinked.java:11: PriorityQueueLinked is not abstract and does not override abstract …

Member Avatar for becdudek
0
210
Member Avatar for smkdude

Hello, I am in the process of writing a board game, and part of that game involves having a user click on a hexagonal tile, and when they do and certain conditions are met, the tile should change color to match the player's color. Below is a sample program which …

0
89
Member Avatar for bettybarnes

hi everybody! i have this code for queues but it doesn't execute due to final Queue s = new Queue(); what should i do with this? pls help me :( [CODE]// Testing the Queue class of the java.util package import java.util.*; import java.awt.*; import java.awt.event.*; import javax.swing.*; public class QueueTest …

Member Avatar for sergb
0
216
Member Avatar for cav

I recently set up a small LAN in my place by having my main computer with 2 NICs using one to connect to the internet and the other connecting to the other computer via a crossover cable - both PCs running XP. Everything seemed to have been running fine until …

Member Avatar for Byteman
0
146
Member Avatar for Olliepop

Hey guys So at the moment i'm making an online strategy game a bit like tribalwars.net. I'm having a problem with building construction, unit recruitment, travel times etc. For example.. When a user clicks "build" for a building, the building will be added to a queue and will be completed …

Member Avatar for diafol
0
96
Member Avatar for Fou7a

This is a code to solve a maze using A* search algorithm. When I run it, it gives me the following error: Exception in thread "main" java.lang.NullPointerException Can someone help me out? Below is all the code: [CODE] import java.util.List; import java.util.ArrayList; import java.util.Queue; import java.util.PriorityQueue; import java.util.Stack; public class …

Member Avatar for BestJewSinceJC
0
260
Member Avatar for Talguy

I am still working on my realtime application for my car that will be running on Minimal Ubuntu and the gtkmm library. My current application runs alright for a singly thread application. I am in the process of multi-threading it (still learning threads). What I thought would be the best …

Member Avatar for Talguy
0
685
Member Avatar for Silvershaft

Hey all! I got a little problem, well actually not so little when I try to go play something the graphic card crashes I get a notice on bottom right that it crashed and restored and sometimes I might get a bsod. It has worked well before, but it suddenly …

Member Avatar for caperjack
0
341
Member Avatar for Dewey1040

I have an assignment where I'm supposed to "implement a class, Point that represents a point in a three-dimensional space." and im supposed to "carefully design the interface for this class and include functions that appear to be useful for operating on points." I'm not fully sure what this is …

Member Avatar for mrnutty
0
164
Member Avatar for soUPERMan

Hey, i dont get any compile errors on this code but when i run it i dont get an evaluated value, what have i missed??? [CODE] import java.util.Scanner; import java.util.StringTokenizer; import java.lang.Math; public class main { static Stack<String> stack = new NodeStack<String>(); static final String operators = "+-/*^"; static Scanner …

Member Avatar for soUPERMan
0
110
Member Avatar for black_berry

Hello, I am trying to do a first fit allocation in java my problem is how do i keep track of which memory block i have cheked and if there are no suitable blocks put the job in a waiting queue. Thanks for all help [CODE] import java.util.*; import java.util.Scanner; …

Member Avatar for ACW1989
0
725
Member Avatar for ironstove

Hello, I am currently trying to implement A* search, and I am pushing all of the costs to travel from one node to the next via priority queue. The only problem I am running into is that when I use the pop() feature, I am getting back the highest node …

Member Avatar for JamesMatthew
0
166
Member Avatar for sho12345

Ok so today I tried translating the ever confusing pseudo codes that our books give us and this happened. First of all, queues and lists are built in functions in the c++ library right? I have a bunch of compiler errors that wont go away. Queue undeclared, list undeclared, ifstream …

Member Avatar for sho12345
0
274
Member Avatar for MWE_QUE

Thanks in advance for any help I can get. This is a que I need to add in to another program. It is almost straight out of the book, and a lot like my working stack implementation. It steps through correctly when I go line by line, but I'm not …

Member Avatar for nezachem
0
105
Member Avatar for red999

I implemented a BFS on a maze that I made, but the one problem that I have is that I do not know how to obtain the indices of the path that it took to solve the maze. Right now all my BFS algorithm does it prints out if it …

Member Avatar for WaltP
0
159
Member Avatar for cgalvani

The two classes from the Queueclass5.cpp program are displayed below. Please add another method which will search the Queue for a name which is supplied in its parameter and will return a Boolean value of true if the name is found, or false if not. The method will have the …

Member Avatar for mitrmkar
0
105
Member Avatar for black_berry

Hello, I have got a Java queue and i want to print out the smallest number in the queue. Right now my program prints out the first number in the queue. Here is the code: [CODE] import java.util.ArrayList; import java.util.Iterator; public class Assign1 { private final int MAX_QUEUE_SIZE = 5; …

Member Avatar for ~s.o.s~
0
112
Member Avatar for rogue005

I am doing a project on a print spooler. I am using multithreading to support multiple clients. The problem is that I need another thread on the server side to take care of the printing by extracting jobs from a priority queue. If the queue is empty the thread must …

Member Avatar for JamesCherrill
0
78
Member Avatar for tarheelfan_08

Hey guys, I am working on creating a dynamic queue and I am having some problems. I got my code wrote to set up the actual code but I am unsure how to put my information in and print it. I need to enter the following information in my queue …

Member Avatar for tarheelfan_08
0
182
Member Avatar for icelantic

I have to write a template function that tells me if two binary trees are equal in structure and in data. However whenever i call the function in my testing code, it tells me I have an undefined reference to it. I'm not sure what this means or how to …

0
41
Member Avatar for bgx90

Can anyone tell me why setprecision is causing this error at runtime: terminate called after throwing an instance of 'std::bad_alloc' what(): std::bad_alloc Aborted The program ran fine; after I added << setprecision(2) << to a series of output, I received the error when trying to run the program. I have …

Member Avatar for bgx90
0
119
Member Avatar for icelantic

Hi, first year programmer and the assignment is to use the stack and queue classes to write two functions. One checks to see if an array of parenthesis are balanced, the other to see if a stack and queue are insert equivalent. Here is my code. Assignment4.h [icode] #include <iostream> …

Member Avatar for nezachem
0
100
Member Avatar for bgx90

I need another set of eyes to look over this code. I must be overlooking something. I cannot figure out what the compiler's complaint is. When I try to compile, GCC gives me this error: sim.cpp: In function âint main()â: sim.cpp:21: error: ârunSimulationâ was not declared in this scope Can …

Member Avatar for NathanOliver
0
62
Member Avatar for achieve_goals

Hi! I am having trouble many a queue of Nodes. I have a class of Queue (user defined - as I am not allowed to STL), with methonds as enqueue(), dequeue() and getFront(). And also I have a class of Node with data and frequency in it. Now I have …

Member Avatar for mrnutty
0
91
Member Avatar for msr

Hello, I need a sorted stack/queue. I mean, the element removed from the stack must be the one with great priority. Stack dimension varies a lot (becomes bigger very fast). I need also to search and REMOVE elements in that stack. Does Java give some good implementation for this? What …

Member Avatar for ~s.o.s~
0
95
Member Avatar for tarheelfan_08

Hey guys, I have been looking into queue's and stacks this week guys and I decided that I would like to convert my current array into a stack. Does anyone know how to or can give me some assistance with the current code I have?? I really do not even …

Member Avatar for tarheelfan_08
0
152
Member Avatar for msr

Hello, I would like to have a PriorityQueue whose elementes are instances of different subclasses. For example: Event is an abstract superclass. Event1, Event2, Event3 are subclasses. Xpto<> is an interface and PriorityQueueXpto<> is a class that implements Xpto and extends PriorityQueue. [CODE]Xpto<? extends Event> a = new PriorityQueueXpto<????>();[/CODE] Is …

Member Avatar for msr
0
103
Member Avatar for R3Slick

Hello everyone, I'm having trouble with a code I need to write, I have never coded in C and I need to do this program in C. I have created my checksum code already and need to implement this: I need to send a complete ASCII file in 128 byte …

Member Avatar for R3Slick
0
207
Member Avatar for R3Slick

does someone know a code in c that will send a complete ASCII file in 128 byte packets to another file? So The sender takes the ASCII file as input and sends a 128 byte packet on the data queue

Member Avatar for R3Slick
0
197
Member Avatar for sm4ckth3monkey

Okay so I have been trying to get this program to work for a long time. Basically it reads a text file then populates a structure that is designed to point to the four locations around that object: up, down, left and right. I believe I have the program figured …

Member Avatar for sm4ckth3monkey
0
658
Member Avatar for neo_philiac

Hi, I got this piece of code from this forum and i was trying to modify it so that I can make it dynamic. I modified it a little bit to add multiple collapsible panels. But I need some help. 1. I need to add these panels dynamically. If I …

Member Avatar for moutanna
0
104
Member Avatar for ben1

The group has now been divided, my problem scenario is the following: There are 2 packing machines, which can pack any type of food, however this needs to be done one at a time. Each food type takes 10 secs to pack. The packing machines get the food from the …

Member Avatar for ben1
0
127
Member Avatar for losh177

Hi, I'm having some problems with an infinite loop. For some reason, the process 112 is not being send anywhere. What i'm suppose to to do is to mimic a CPU. Each line represents a process which the first number is the machine time that it suppose to be send …

0
133
Member Avatar for #define

hello everybody! i have a question that i want to reverse the queue in BigO(1) time and space without effecting its enqueue, dequeue ,print and other function. thnx in advance 4 answering

Member Avatar for Narue
0
83
Member Avatar for khess

If you are a PHP, Zend or IBM fan, today Zend and IBM announce a major release for IBM i-Series Servers. Zend Technologies and IBM are working together to offer PHP solutions for IBM i customers. Today Zend announced Zend Server for IBM i, a Web Application Server for applications …

Member Avatar for theighost
0
883
Member Avatar for daviddoria

Is there a data structure that lets me push and pop things onto/off of a queue, but also doesn't allow duplicates? E.g. I want [code] queue a; a.push(1); a.push(2); a.push(2); a.push(3); [/code] to only have 3 elements, because 2 was added twice so the second time it is just ignored. …

Member Avatar for mattjbond
0
168
Member Avatar for dmr215

I am kind of new to c++, i usually code in java and php. This is a program that is supposed to read in an input file with very strict syntax that will either create a new stack/queue (implemented subclasses of simpleList), or push a value onto one of those …

Member Avatar for tintin.iitk
0
165
Member Avatar for sjgman420

I dont even know where to start with this program. I have been really busy and he tells us what to do. If anyone could help with this it would be great. here is what it says to do ASSIGNMENT DESCRIPTION This program will simulate the card game WAR!. The …

Member Avatar for Freaky_Chris
0
885
Member Avatar for metdos

Hello Everyone, I'm trying to implement a Polymorphic Queue. Here is my trial: [CODE]QQueue <Request *> requests; while(...) { QString line = QString::fromUtf8(client->readLine()).trimmed(); if(...)){ Request *request=new Request(); request->tcpMessage=line.toUtf8(); request->decodeFromTcpMessage(); //this initialize variables in request using tcpMessage if(request->requestType==REQUEST_LOGIN){ LoginRequest loginRequest; request=&loginRequest; request->tcpMessage=line.toUtf8(); request->decodeFromTcpMessage(); requests.enqueue(request); } //Here pointers in "requests" do not …

Member Avatar for metdos
0
291
Member Avatar for HoldmysunnyD

Hey Daniweb, I'm back again! This time around, my assignment is to implement a binary tree, a tree node, and a binary search tree using the class definitions given to us by our teacher. Implementing the TreeNode was no trouble at all, but when I started on the Tree itself, …

Member Avatar for em-kay
1
283
Member Avatar for alexRivera

having trouble with the print and the main [CODE] #include <fstream> #include <iostream> using namespace std; struct Item { int value; Item *next; }; class Queue { protected: Item *fill; Item * remove; public: void addingtoqueue(int); int takeaway(void); bool empty (void); Queue (void); }; class Merge: public Queue { protected: …

Member Avatar for alexRivera
0
128
Member Avatar for hardik.rajani

Hi. I am using apache servicemix and apache activeMQ in my product. Here in case of HttpConnector i found a performance issue. If i increase number of total request at a time then as the number will increase exchange queue gets stuck on any of the component. After all the …

0
70
Member Avatar for masocha

defined('_JEXEC') OR defined('_VALID_MOS') OR die('...Direct Access class aca_module [ var $shownamefield = 0; var $receivehtmldefault = 1; var $showreceivehtml = 0; var $listIds = null; var $linear = 0; var $fieldsize = 10; var $introtext = null; var $redirectURL = null; var $showListName = 0; var $buttonUnregistered = _ACA_MOD_SUBSCRIBE ; …

0
71
Member Avatar for Merosansar

The code for sleeping barber problem. When the status of the barber is set to busy then the customer cannot have a hair cut and is added to the waiting queue. when the customer is set to free then the customer have a hair cut. Here the problem is that …

0
70
Member Avatar for vegaseat

Looking at the First In First Out (FIFO) data situation. Just like a line at the grocery store check-out. Its counterpart FILO would be like a stack of dinner plates.

Member Avatar for mitrmkar
2
234
Member Avatar for rogue005

I am using a PriorityBlockingQueue in my server program for a network printer manager, but the thing is whenever I print the size of the queue its always 1. I think it is cause i am using threads in my program to support multiple clients. How do i solve this …

Member Avatar for rogue005
0
143
Member Avatar for bananasplitkids

Im getting the wrong output. In my while loop for the else statement I want it to perform the subtraction operation and then put that data on the queue pq2. I put a cout statement to make sure that the data is on the pq2 queue. However Im getting weird …

Member Avatar for bananasplitkids
0
116
Member Avatar for johndoe444

from here: [url]http://weblogs.java.net/blog/emcmanus/archive/2007/04/cloning_java_ob.html[/url] [CODE]package serialclone; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.InvalidClassException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.io.ObjectStreamClass; import java.io.OutputStream; import java.util.LinkedList; import java.util.Queue; public class SerialClone { public static <T> T clone(T x) { try { return cloneX(x); } catch (IOException e) { throw new IllegalArgumentException(e); …

0
70
Member Avatar for tjlee87

Hi, I have trouble with the "enqueue" section of this code, can anyone here find the fault within my code. I've been working on this for over 15+ hrs and I can't not find what I am doing wrong here. If there is anything else I need to provide, I'll …

Member Avatar for tjlee87
0
110

The End.