- Strength to Increase Rep
- +15
- Strength to Decrease Rep
- -3
- Upvotes Received
- 358
- Posts with Upvotes
- 282
- Upvoting Members
- 128
- Downvotes Received
- 56
- Posts with Downvotes
- 47
- Downvoting Members
- 36
Re: "It requires a very unusual mind to undertake the analysis of the obvious" -Alfred North Whitehead | |
Re: [QUOTE=MosaicFuneral;869504]Coffee, all day, a whole pot. The only real American food is corn dishes. I think, I'm going to be real American, today, and break-out the corncob pipe.[/QUOTE] If a big, fat, juicy hamburger isn't American then I don't know what is. | |
Re: How so? Please post your solution so that if someone comes across your thread in a search (or is just reading the thread like I am) they can see it. | |
Re: ^ No, that is not what he wanted. He just wants any 0's to be removed from the array. I thought I already answered this in another thread last week but in any case it's pretty simple so I don't understand why all of you guys are making it seem … | |
Re: For what it's worth I agree with Masijade (about learning to code GUIs by hand first, then moving on to builders if you want to). Doing so was very helpful to me and it made it a lot easier to use the GUI builder as well. If you jump into … | |
Re: else if (Balance <100) Balance = 0; count = count +1; System.out.println("Balance at Month " +count+ " is " +Balance+ " after making a payment of " +MonthlyRepayment ); That's because you set MonthlyRepayment to 100 initially and then you never set the variable to anything else. If you want … | |
Re: I'd be willing to bet that if you changed your code to this, then your code would work. I've never actually seen somebody use "File" as an argument to a Scanner, so excuse me if I'm wrong, but I don't think it should be used. File is a class that … | |
Re: [QUOTE=Radhika...;1012475]sum=0; for(i=0;i<n;i++) for(j=0;j<i;j++) sum++; what is the actual running time of this code??[/QUOTE] Not positive, but it's probably theta (n * n!) = theta (n^2). The reason I'd say that is because the outer loop is O(n) and the inner loop is always one less than whatever the value is … | |
Re: Error check your code and tell us at what point your code doesn't work and show us the method where it doesn't work. If you can't do that then you won't get any help. | |
Re: And the unofficial way would be to put the code in a method, then call the method in the appropriate places. | |
Re: The person who posted above me is completely wrong. Assembly is faster than any other code if you use/code it correctly. It could be that the optimizations the compiler made for the C++ code were good optimizations, whereas the code you wrote was poorly designed and written. | |
Re: I don't see why you need a DecimalFormat, I don't think it is necessary. And what is your question? | |
Re: The reason it gives you trouble is because when the user enters an integer then hits enter, two things have just been entered - the integer and a "newline" which is \n. The method you are calling, "nextInt", only reads in the integer, which leaves the newline in the input … | |
Re: As for S.o.S's reply, you would expect it to infinitely loop, since you want to continuously check the file for updates. In other words it is supposed to infinitely loop so I don't see why you have an issue with that. Maybe I didn't understand the issue. Anyway, I'll give … | |
| Re: [url]http://www.csee.umbc.edu/courses/undergraduate/341/spring09/projects/proj5/HuffmanExplanation.html[/url] Is that helpful at all? One of the projects I did in school. I don't know if that is "static" huffman coding or adaptive... I always assumed it was the only huffman coding TBH. |
Re: Routers can use queues. I'd elaborate but if you want to use it as an example, it'll force you to research it first to figure out the correct terminology/phrasing for an example. | |
Re: Einstein couldn't speak fluently when he was nine. His parents thought he might be retarded. | |
Re: It looks ok to me. Pseudocode doesn't really have a "standard" format (that I know of) - if an experienced programmer were writing that pseudocode, it would look a bit different - but I think you covered most of the steps, which is the important thing. A program wouldn't just … | |
Re: If you define a method as taking an int parameter (which is how your AccelerateSpeed() method is defined) you need to pass it an int when you call the method. And if you re-read James' post, he was saying that you have a variable 'speed' declared at the class level … | |
Re: For your add (should be called insert?) method: 1. You have to first figure out what index they want to add the item at. If the index they want to add the item at is the empty, then just insert it and you're done. 2. If the index is not … | |
Re: Make a new thread. Ask your question in it. | |
Re: [url]http://java.sun.com/docs/books/tutorial/uiswing/components/filechooser.html[/url] Read through that tutorial, it should be helpful to you. Courtesy of a post by peter budo that I found by searching daniweb. | |
Re: Maybe I am overlooking the obvious, but why can't you use the depth property to help you test for an AVL tree? | |
Re: Nice first post. Hope you have a good time with that program that the OP said doesn't work that was written years ago. | |
Re: [URL="http://java.sun.com/j2se/1.5.0/docs/api/java/io/FileWriter.html#FileWriter(java.io.File,%20boolean"]Putting text at the end of an existing file[/URL] ^ I'm pretty sure using FileWriter with the constructor that has "append" as one of the arguments will allow you to write to a file without deleting its contents first. To use FileWriter: PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter("foo.out"))); [URL="http://java.sun.com/j2se/1.5.0/docs/api/java/io/BufferedWriter.html"]The … | |
Re: JW1234: Binary code and machine code are the same thing. | |
Re: You should validate the employee's salary in the employee's module (i.e. the employee module should not exit until they have entered a valid salary). Same for the other modules. It makes the "main" part of your pseudocode more concise, and leaves the obvious tasks to the modules that they belong … | |
| Re: I don't know what line 12 is because you didn't use the code tags correctly. If you had, it would have put line numbers there. Anyway: Check out the String class's toCharArray() method. Once you get your char array, iterate backwards over it, printing out each character. If you want … |
Re: Yes. In your "main package" you can add a folder called resources. In that resources folder you can put your files. Then you can export the project as a Runnable Jar File in eclipse by going to File->Export->(Choose Java Option)->Runnable Jar File. Here is a code sample to get you … |