I solved it my self and no one here helped(or even replied) so I'm NEVER coming here back EVER again.
So finally you've come back.
I solved it my self and no one here helped(or even replied) so I'm NEVER coming here back EVER again.
So finally you've come back.
There was a king who abdicated his throne for a woman.
word, sword, rods
simple
I do not have any sample but code, but do have some suggestions for mixing Java + AJAX:-
GWT is a great framework for developing Ajax based applications in Pure Java.
jMaki is another AJAX framework which can be used with Java on the Server side.
And I would suggest you checking out JSF (Java Server Faces).
Heres another one a bit more oriented towards the technical side.
http://java.sun.com/docs/books/tutorial/javabeans/index.html
Any pointers as to what is exactly happening in your application and what it is supposed to do or what errors you are getting would be nice.
Now if you are referring to this :-
while (input != "x") {
Then I wish to inform you that in Java you cannot compare strings directly with "==" or "!=", you need to use the equals(String) or equalsIgnoreCase(String) method of the String class.
Also "==" and "!=" would only check if the two references point to the same object as in the below case :-
String str1="Alpha";
String str2=str1;
In the above case (str1==str2) would return true. But consider the following case :-
String str1="Alpha";
// Using this constructor inorder to stop the java compiler from optimizing.
String str2 = new String("Alpha");
In this case, (str1!=str2) would return true, As they would be referring to different objects. However str1.equals(str2)
or str1.equalsIgnoreCase(str2)
or vice versa would always reurns true as their "contents" are the same.
Actually to convert from .doc to .pdf via Java I could not find a direct method, But I found a two step process,
Anyone for carrying on this game .... kind of like making it a series.
Verruckt24, I guess the O.P. by now must have already figured out how to accomplish this task.
"bertt" is the culprit who revived this thread older than almost 6 months and whats worse he doesn't even provide a decent answer, let alone use code tags or anything else.
Well the book I had was called Java 1.2. I don't remember what kind of java I had because I didn't know about versions but I believe I had Java Version 1.2
Exactly that explains the reason why like myself you too have opted for the BufferedReader, Scanner just never existed during our initial console programming days in Java.
I don't write console applications either but when I first begun I knew from my book only the BufferedReader.
That was most probably because when we learnt Java, java.util.Scanner did not exist.
I started learning Java from the 1.4.2 version of the JDK, and Scanner was introduced only in the 1.5 version and since console input is not so widely used by many of us, we opted to stick with good ol' BufferedReader.
Insert all the Strings that the user enters in to the args[] string array, since this array is being passed to each successive call of main, So you will have a list of all entered keywords in this array.
In order to check for repetitions just check if the entered word is present in the args[] array.
But instead of calling the main recursively I recommend you delegate this responsibility to some other method and let that method call itself recursively.
We believe what we want to believe so if we want to believe we are saying the truth, so be it.
Does a Python swallow its prey whole ?
-116
You will need to maintain a reference to the previous element also in the above code. Because as per your requirement you want to insert the new element before the element "temp" is holding a reference of when you are traversing the queue.
Now let us take analyse your code one line at a time :-
QueueNode temp = front;
This is fine, you are declaring the temporary reference to your start of Queue.
while(temp != null){
if (temp.info > x)
Now your while condition states that you will should go through to the end of the queue. However there is a problem if your "if" condition, Consider you list contains the following elements :-
2 3 4 9 10
And you wish to insert the value "7",
Because of your "if" condition temp will enter the "if" block only when it is pointing to "9". And since this is a singly linked list you cannot traverse backwards. So you cannot insert "7" in the correct position in the list. For that you will need to also maintain a reference to node in your queue preceding the node to which "temp" is currently referring to.
temp.info = new queueNode(x);
Now over here this statement at least appears to be incorrect. Although I do not know your structure for class "queueNode", I am guessing "info" should be of type "int". Also you are overwriting directly the value present at the current location, You should …
to
Though we all agree that a few deviations/off-topic discussions foster a healthy forum environment, way too many off-topic posts, preachings and taunts dilute the topic in consideration and gives the forum a bad name.
So I guess you are tilting at its O.K. to do it once in a while.
Though I agree with you on a logical note, the rules need to be followed.
But technically they aren't breaking anything in daniweb Member Rules ;) ... or is it ... (not that you can't add to it) :P:D !!!
May be this javdocs link will clear up all the possible ways to get Strings :-
http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html
I suggest avoid using StringTokenizer class its a legacy class, to quote the javadocs of version 1.4.2:-
StringTokenizer is a legacy class that is retained for compatibility reasons although its use is discouraged in new code. It is recommended that anyone seeking this functionality use the split method of String or the java.util.regex package instead.
I would suggest using regular expressions similar. Of course in the end you will definitely have to use Integer.parseInt() (or Float.parseFloat() or ..) to convert the numbers from the string to their appropriate types.
This is the best resource for learning how to use regular expressions in Java.
Well it depends she could be using a Priority Queue, in which members are organized in the ascending or descending order.
Also priority queue implementations may vary, some may do the selection of element to be removed at deletion time while others may do the sorting at insertion time so that elements in queue are always in a sorted order (based on priority which is what the O.P. wants here) for deletion.
Now to do the above, you will have to traverse your queue until you find an element that is greater than the element you wish to insert and then fit in your element there. Also let us see what you have tried.
<EDIT>
Also just my two cents, according to me a Linked List based implementation would be lot easier to implement than an Array based implementation.
java.lang.ArrayIndexOutOfBoundsException: -1
Although I haven't gone through your entire code and neither followed up on the post, The above error strongly suggests that you are performing a Pop operation on an empty stack "stackArray2" (with Head as "evaltop")
But ~s.o.s~ considering the questions asked in this thread and the request made in the subsequent post by the O.P. its pretty clear that this thread was not going anywhere ..... so why not salvage it by going Off Topic, And I have hardly seen this hijacking happen when questions are actually genuine.
And anyway as you said, we always have you to do the clean up :P :D
-1114
You two do not really know where to stop teasing. Why do you constantly mock all new comers? Don't you think that one person saying "No, we will not do it for.." is clear message that if other side does not show some effort will get nothing out here?
verruckt24 you been already asked to stop this is polite way.
Consider this as last warning message for all of you. One post with adequate reply is enough!If you feel there are not enough quality post here you are more then welcome to start your own thread and discuss what is you current project, how do you go about etc.
Come on Peter its not as bad as you make it sound, Plus its fun to read such threads once in a while.. :) ... Remember the other thread in which masijade was on a rampage.
Yipppeeeeeeeeeeeeeeeeeeeeeeee we won !!!!!!!!!!!!!!!!
:) :D :cool: :twisted: :P :icon_biggrin: :icon_cool: :icon_mrgreen: :icon_evil: :icon_smile:
:) :) :D :cool: :twisted: :P :icon_biggrin: :icon_cool: :icon_mrgreen: :icon_evil: :icon_smile:
:) :) :) :D :cool: :twisted: :P :icon_biggrin: :icon_cool: :icon_mrgreen: :icon_evil: :icon_smile:
:) :) :) :) :D :cool: :twisted: :P :icon_biggrin: :icon_cool: :icon_mrgreen: :icon_evil: :icon_smile:
998
And we are almost at the finish line ........
994
990
986
982
978
974
970
Time and Tide wait for none
966
Really, I need to ask more questions then !!! :P
962
Well honestly speaking I found Swing to be quite powerful, but if you still want to look at some third party toolkit, you could take a look at SWT (The Standard Widget Toolkit.)
958
954
I asked for was some help, which I thought was the whole pupose of this site, but you have to be a jerk about it
The only Jerk I see is you who needs to be spoon fed with a solution to all his lifes problems.
Because I am working on an assignment for a Java class I am taking and am not sure what I am doing.
If you are not sure what you are doing, then you do not deserve to pass that class do you ???
So now I am not sure what have I done incorrect?
Let me guess you took the course which contained Java in it.
You were the one treating me like I was an IDIOT
I guess you already proved yourself one, putting all that time and energy to writing this big post instead of concentrating on the clue I gave you.
I am not a CODER, so don't give me CRYPTIC answers I can't understand!
If you are not a coder then why do you even bother coding.
So can we CLUE me in as to where I need to put it?
Already gave you one look more closely at your "if" statements.
And considering your tone you can forget about a ready made answer from me. May be another poster might be kind enough to do some charity work for you.
I tried to put them below my prompts for hours worked and pay rate but that didn't work either.
Now I do not wish to be rude here but if you use common sense I guess any one can decipher that you cannot check whether a value is negative or positive BEFORE YOU HAVE EVEN READ IT from the console.
<EDIT>
Also it did not work because, closely monitor your "if" statements, all the "if" statements would be executed if and only if the user enters "stop" (for the employee name), now lets see if you can figure it out why ?
The reason they are not working is because you are putting your "if" checks before you have even read them from the console.
So where is the problem ??