Tony VanHorn

Ranch Hand
+ Follow
since Dec 13, 2006
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Tony VanHorn

I will be back Friday to ask the questions. I have a busy week at school this week as I have a test in my system analysis class. Just didnt want you to think i gave up.

Tony
14 years ago
So everyone seems to come to this point at sometime. Here I am. I have checked through alot of the previous posts on the subject and now I am here with my hands in the air about to bang my head against the desk. I have specific questions about a specific class, however the nature of this course prohibits me from going into detail. I have read through the API and a few tutorials on the subject and I still don't understand a few things. If anybody has any good resources on the subject, or who may be willing to field a few questions by email or PM, let me know. I am not finished with OOP2 yet but I feel that I am close, and with Marilyn on vaca I thought it would be a good time to work ahead a bit. Any help would be greatly appreciated.

Thanks
Tony

PS. It doesn't look like I got my moose head for the basic set of assignments.
[ January 26, 2008: Message edited by: Tony VanHorn ]
14 years ago
Thanks. That definately makes sense.

Tony
14 years ago
I may be thinking unclearly, it is a tad early, but if i need to check a string to see if it is null, how would i go about doing this? My first guess was string.isNull(), but alas there is no method like that. So I went to my friend Google and everything I saw there said string==null. I guess I don't understand how this is possible. How can one compare the equallatiy of nothing? If it works, great, but I would sure love to understand the logic behind it.

Thanks for any enlightment,
Tony
14 years ago
yeah, so that was the way to go, the issue i had was my line of code was too long to repeat twice. I found in another thread that pulling that line of code into a method and then just calling the method twice would be a better choice. Thanks for the input.

Tony
14 years ago
I am struggling seeing this from a different perspective. I have a section of code that executes atleast once, but maybe twice and thats all. The two ways I have thought of this is:


or

So, anyone with another idea of how to handle this without a loop or repeated code? Any "hint" in the right direction would be greatly appreciated.
14 years ago
Any of the 2007 office components are using XML format, hence the .docx. They have done this so that you can take advantage of a feature that allows you to hover over formatting changes and see what the document will look like without having to actually select the change and then hit undo or choose a different one. You should be able to unzip the .docx file into its different parts, which include the XML for the main content.
15 years ago
Why do zero's and 'o' look the same? Anyway figured it out.
15 years ago
I am having issues with the code for these two programs. I have checked my code against the book and against the downloadable code from wickedlysmart.com. The code that I download runs fine, however mine throws up an error about the object being read in from the server.

This is the code where the object is being read in from the server


This is the code where the server sends the object:


And this is the code were the BeatBox sends the objects to the server to begin with:


Each time I try and send something it throws a ClassCastException. When it does the System.out.println(obj.getClass()); it shows the Object that was recieved has a class of Integer but everything I have sent has been a String. Any help on why this is doing it would be greatly appreciated. Any other code you might need just let me know

Tony
15 years ago
oh man, what have you gotten yourself into. Just kidding. Have fun and good luck, and don't get too frustrated on 1b and 4a and b. Those are the really tough ones. Happy trails.
15 years ago
I put everything in the hash map in all lower case. When I first check to see if the value is a key in the hashmap I used the .toLowerCase() and it would find the value. But while in the If statement I didn't use the .toLowerCase() on the value, so what should of been "twenty" was actually "Twenty" which isn't in the hashmap.
15 years ago
Yeah!! Got it figured out. I forgot to call the .toLowerCase() on my string, so it wasn't finding any keys in the hashmap that matched. And that threw the parse off. Sorry to ramble on in the last few post, but getting it out in words was definately a big help in figuring out the problem. You all are great listeners. I try and talk to my dog, but he just gets up an leaves. I think I annoy him. Anyway, thanks for the help and patience.

Tony
[ April 07, 2007: Message edited by: Tony VanHorn ]
15 years ago

Originally posted by Marilyn de Queiroz:

It seemed to work just fine for me -- unless it threw an Exception.



Wait, you mean that what I sent you worked fine for you on your machine? It compile and displayed properly? If that is the case then my stuff is fubar.

[EDIT]Okay, so I think I am making progress. I actually get a null on the screen now when I run the program. Not big success, but hey I am glad its just printing something. Marilyn, you said to populate the HashMap directly without an algorithm. Did you mean


[EDIT Again] So I verified that the HashMap was being populated correctly by printing out myHashMap.entrySet() but I continued to get a null being printed after that. Then I figured out what the problem was. In my main, I have a try/catch and using the ex.message I was getting a null. I change it to "I should be getting a Message here" and it shows up. So I am getting a exception, but with a null message. So how am I suppose to fix something when it doesn't tell me whats wrong? ex.printStackTrace();

[ April 07, 2007: Message edited by: Tony VanHorn ]
15 years ago
So, I change it to a String array and then added the two String arrays to my HashMap. Worked. Then when I pull it out I parse it to an int. Works. Did the whole javac -target 1.4 -source 1.4 FileName.java and it compiles. Yay, worked. Then I try and run it. It continues to do the same thing that it was doing before. It will start and end, but nothing prints up, no exceptions are thrown, no runtime errors.

Tony
15 years ago
So I did the whole compile with the 1.4 stuff, now I can't fill an Integer array with ints such as:

Integer[] myArray = {1, 2, 3};

The compiler says that they are incompatible types. I don't get it. And then when I try:

output += Integer.intValue(myHashMap[0]); it says inconvertable type.

/me bangs head on desk!

Tony
15 years ago