Posts
 
Reputation
Joined
Last Seen
Ranked #71
Strength to Increase Rep
+15
Strength to Decrease Rep
-3
85% Quality Score
Upvotes Received
358
Posts with Upvotes
282
Upvoting Members
128
Downvotes Received
56
Posts with Downvotes
47
Downvoting Members
36
111 Commented Posts
~894.38K People Reached
Favorite Tags

1,678 Posted Topics

Member Avatar for vegaseat

"It requires a very unusual mind to undertake the analysis of the obvious" -Alfred North Whitehead

Member Avatar for Reverend Jim
15
13K
Member Avatar for Duki

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

Member Avatar for Dani
22
17K
Member Avatar for dsmush

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.

Member Avatar for Toby_6
1
3K
Member Avatar for Xeros606

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

Member Avatar for JamesCherrill
0
3K
Member Avatar for Archenemie

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 …

Member Avatar for dotxyteam
0
2K
Member Avatar for rudypooh786

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 …

Member Avatar for KAIWEN KEVIN
0
4K
Member Avatar for dmanw100

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 …

Member Avatar for JamesCherrill
0
968
Member Avatar for rupali

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

Member Avatar for jamie_13
2
50K
Member Avatar for ka-ii

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.

Member Avatar for JamesCherrill
0
15K
Member Avatar for k2k

And the unofficial way would be to put the code in a method, then call the method in the appropriate places.

Member Avatar for JamesCherrill
0
14K
Member Avatar for cpsusie

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.

Member Avatar for Zack_7
0
12K
Member Avatar for iMaZx

I don't see why you need a DecimalFormat, I don't think it is necessary. And what is your question?

Member Avatar for rproffitt
0
447
Member Avatar for Isky

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 …

Member Avatar for stultuske
0
21K
Member Avatar for hhappak

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 …

Member Avatar for rproffitt
0
5K
Member Avatar for elektro123

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

Member Avatar for Zlatan25
0
3K
Member Avatar for playagain

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.

Member Avatar for priya..
-2
12K
Member Avatar for vegaseat

Einstein couldn't speak fluently when he was nine. His parents thought he might be retarded.

Member Avatar for vegaseat
11
9K
Member Avatar for OrangeNaa

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 …

Member Avatar for channasrey7
0
1K
Member Avatar for Nikki_77

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 …

Member Avatar for stultuske
0
22K
Member Avatar for yingfo

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 …

Member Avatar for stultuske
0
922
Member Avatar for himanjim
Member Avatar for doha786

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

Member Avatar for JamesCherrill
0
4K
Member Avatar for imclumsy

Maybe I am overlooking the obvious, but why can't you use the depth property to help you test for an AVL tree?

Member Avatar for JamesCherrill
0
271
Member Avatar for debasisdas
Member Avatar for shivers20

Nice first post. Hope you have a good time with that program that the OP said doesn't work that was written years ago.

Member Avatar for stultuske
0
3K
Member Avatar for LooN_iE

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

Member Avatar for ncmathsadist
0
304
Member Avatar for ang19
Member Avatar for nickewus24

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 …

Member Avatar for heftytest
0
187
Member Avatar for sravan953

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 …

Member Avatar for JamesCherrill
0
609
Member Avatar for ChPravin

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 …

Member Avatar for devin.mcknight.102
0
8K
Member Avatar for kingarthur

What part of your code isn't working? Your code should be split into pieces/methods that each perform a specific task. You should be able to identify where the code isn't behaving as expected, either with a debugger or just by using print statements. Tell us where your code doesn't work, …

Member Avatar for JamesCherrill
0
665
Member Avatar for danibootstrap

[url]http://beej.us/guide/bgnet/output/html/multipage/index.html[/url] The above is the one my computer networks class used. I don't know how good it is compared to other guides, but it was good enough for me to get my projects working (with a little help from the fine members here :) ).

Member Avatar for funtom
0
346
Member Avatar for thijo

If you want to use that code, I'd suggest you simply copy and paste it into another file, and edit it so that it sends its output to a text file rather than prints it on the screen. You can use PrintWriter to do this.

Member Avatar for JamesCherrill
0
527
Member Avatar for christiangirl

If you expect a solution, please post the exact error code you are getting. It usually includes line numbers and method names, etc.

Member Avatar for stultuske
0
815
Member Avatar for joshmo

Probably, do a google search for them. If you're talking about simple differentiation and integration (i.e. power rule) then it is trivial anyway, and so is chain rule for differentiation. Why don't you mention the specific formula you're trying to code and then show some progress or ideas etc on …

Member Avatar for JamesCherrill
1
1K
Member Avatar for help_please

Steps to do your project: 1. Make a main class (You've already done this and posted it). 2. Make a class called Word. 3. The 'Word' class should have two instance variables: 'String theWord' and 'int count'. The 'Word' class should have a constructor that takes a String and an …

Member Avatar for JamesCherrill
0
599
Member Avatar for Aditya.gtbit

http://docs.oracle.com/javase/tutorial/uiswing/components/tree.html#select See the section on "Responding to node selection". When the selection changes, get the selection and use the JFileChooser's setSelectedFile method to set it accordingly.

Member Avatar for BestJewSinceJC
0
573
Member Avatar for bustersox

You should change your getHighestInRow method to take two parameters: The row number that you want to get the highest value of, and the array itself. Then in your main method you can use a for loop to loop over each row of the array, getting the highest of each …

Member Avatar for JamesCherrill
0
478
Member Avatar for Aska o.

Use your brain. This problem is practically begging you to have some level of intelligent thought. They didn't even ask for programming examples, they just asked for [I]examples[/I]. Are you really that dumb.. ?

Member Avatar for deceptikon
-1
450
Member Avatar for pinsickle

[CODE] //In a file called First.java public class First{ ... } [/CODE] [CODE] //File called Second.java public class Second{ .. main(){ First f = new First(); } } [/CODE] Put the classes in a package together... then you can create a new Object and use the class's methods.

Member Avatar for dimapoter
0
10K
Member Avatar for GrimJack
Member Avatar for pateldeep454
Member Avatar for svfox2000
0
323
Member Avatar for neti1987

It happens because changing the size of the column indirectly causes the layout() method to be called on your widget. In order to dynamically insert data into the table, you could just call layout() on the table after you add the data. Then you won't need to reset the column …

Member Avatar for stultuske
0
242
Member Avatar for BestJewSinceJC

Since I keep seeing people asking how to read the Integers from a File, I figured this simple snippet might be useful. What it does is it creates a new Scanner Object based on the File Object "test.txt" then it reads all of the Integers from that file, skipping over …

Member Avatar for Ezzaral
0
5K
Member Avatar for AmericanRogue

[url]http://java.sun.com/j2se/1.4.2/docs/api/java/io/BufferedReader.html#read%28%29[/url] [CODE]char c = (char)buffReader.read();[/CODE]

Member Avatar for kiail
0
1K
Member Avatar for sidereal

I don't understand the second half of your explanation, so hopefully this is useful to you. File class: [url]http://java.sun.com/javase/6/docs/api/java/io/File.html[/url] For example you can easily create a new file using the createNewFile method. There are plenty of useful methods in there.

Member Avatar for MastAvalons
0
440
Member Avatar for Jaks_maths

Umm you need a dynamic programming algorithm that uses subproblems and memoization to solve this adequately. Pretty sure all of the "solutions" listed in here are wrong.

Member Avatar for mariola
-1
1K
Member Avatar for AbdullahDar

Code snippets should be posted for working code, post a regular thread for questions in the future.

Member Avatar for _neo_
0
866
Member Avatar for CreativeCoding

Hey, Sean. Good to have you here. So what languages do you like? What are you interests as far as programming? Desktop or web oriented?

Member Avatar for transcue
0
150
Member Avatar for ahmedshayan

Your question pertains to computer science in general more than it does to java, maybe you should try posting in that forum?

Member Avatar for Ezzaral
0
3K

The End.