Forum: Java Jan 14th, 2009 |
| Replies: 8 Views: 1,493 Ah, so then calculate M, as defined by the wikipedia site (http://en.wikipedia.org/wiki/Magic_square) Salem provided and ensure the calculated sums match M? |
Forum: Java Jan 14th, 2009 |
| Replies: 5 Views: 465 Oh I didn't mean that your post wasn't called for ~s.o.s~, I certainly respect a featured poster such as yourself. I actually skimmed the original post and didn't notice he mentioned JavaScript hehe.... |
Forum: Java Jan 14th, 2009 |
| Replies: 8 Views: 1,493 Oh gosh, your code is rather confusing... I think it's because I'm not sure what your methods and variable are meant to do. If the algo is taking that long to compute the answer (does it give the... |
Forum: Java Jan 13th, 2009 |
| Replies: 4 Views: 1,507 Hmmm, so you're developing a web application using JavaEE hey? So depending on whatever the user typed in web form, you want to search for a matching city... then the SQL statement you have will not... |
Forum: Java Jan 13th, 2009 |
| Replies: 5 Views: 465 I'm a bit perplexed... since this topic is in the Java forum I'm assuming that some Java programming is involved. As such, I'm imagining a Java Applet since we're speaking about something that's web... |
Forum: Java Jan 13th, 2009 |
| Replies: 8 Views: 1,493 I'd like to help... but I have no knowledge of magic squares or the mentioned algorithm... or perhaps I do and it just sounds foreign. Care to explain what a magic square is? An example would... |
Forum: Java Jan 13th, 2009 |
| Replies: 6 Views: 1,107 Please marked this post as solved, thank you. |
Forum: Java Jan 13th, 2009 |
| Replies: 4 Views: 1,507 I'm not sure why you said 'no,' sillyboy? But yes, since chicago1985 instantiated the object to null, there wouldn't be anything to 'get.'
What concerns me is that he actually declared the... |
Forum: Java Dec 18th, 2008 |
| Replies: 12 Views: 1,098 When I said, 'Where ... refers to the code after the line String s = inFile.readLine();' I meant all of the code. A loop will allow for a set of instructions to be executed 0, 1 or more times. If all... |
Forum: Java Dec 17th, 2008 |
| Replies: 13 Views: 1,407 Oh! So that's what that was :D hehe it shouldn't be in an if statement though. |
Forum: Java Dec 17th, 2008 |
| Replies: 13 Views: 1,407 uh hum I just gave you the answer! If you run the loop I gave you and set n to 100 you'll see that comp will have a final value of 4950.
But the idea is rather simple, you can count individual... |
Forum: Java Dec 17th, 2008 |
| Replies: 13 Views: 1,407 I wouldn't say your code is wrong... like I said, the selection sort can be done in many ways. Here's the algo from Wikipedia (http://en.wikipedia.org/wiki/Selection_sort):
for i ← 0 to n-2 do
... |
Forum: Java Dec 17th, 2008 |
| Replies: 12 Views: 1,098 Aww I can see that you need sleep hehe you'd need a looping structure to read the entire file! I guess I could have given you a better hint!
The basic idea is that you'd read from the file while... |
Forum: Java Dec 17th, 2008 |
| Replies: 13 Views: 1,407 Oh!! My bad, I completely read the question incorrectly... actually I was so off I wonder how I managed to confuse myself that much lol
You aren't keep track of the number of comparisons you're... |
Forum: Java Dec 17th, 2008 |
| Replies: 12 Views: 1,098 Oh yes I was actually going to comment on that. As it stands your program would only cater for the first line because you're only asking it to read the first line. In order to read the entire file... |
Forum: Java Dec 17th, 2008 |
| Replies: 13 Views: 1,407 So my first question would be: what are you comparing? I only see that you've implemented the Selection Sort... are you wanting to compare different methods of carrying out the selection sort?
... |
Forum: Java Dec 17th, 2008 |
| Replies: 12 Views: 1,098 Hi there, I'm not entirely sure why you're running that for loop that contains the undeclared variable. Remember that the end of line terminator is not returned by the readLine() method of... |
Forum: Java Dec 17th, 2008 |
| Replies: 4 Views: 1,144 Not a problem :) If you found your solution, please mark this thread as solved. |
Forum: Java Dec 4th, 2008 |
| Replies: 4 Views: 1,144 Read this thread: http://www.daniweb.com/forums/thread42410.html
You'll find that there are multiple ways to do what you need. I suggested getResource(). |
Forum: Java Dec 4th, 2008 |
| Replies: 5 Views: 493 Ah well then doesn't that answer your question about logging in? Comparing input with predefined values in your program seems perfectly acceptable for your application. I guess what you want to know... |
Forum: Java Dec 3rd, 2008 |
| Replies: 8 Views: 1,620 lol that was funny! The Timer class is definitely the way to go. And since the Timer class uses ActionEvents, the way the count down is displayed is controlled by you (that is, the ActionEvent can be... |
Forum: Java Dec 3rd, 2008 |
| Replies: 5 Views: 493 I agree with stephen84s, you need some sort of overall view of how the different parts of your system pull together.
Generally if you have an applet, it would probably have to communicate with a... |
Forum: Java Dec 3rd, 2008 |
| Replies: 2 Views: 490 Interesting... I haven't actually dealt with applet windows before but there is a method setResizable() that belongs to the Frame class. I believe this method will prevent the user from resizing the... |
Forum: Java Dec 2nd, 2008 |
| Replies: 3 Views: 596 While there isn't a stringent specification for these files, I doubt Microsoft Excel will allow such character encodings. So I tested it out... I copied one of the characters you gave as an example... |
Forum: Java Nov 5th, 2008 |
| Replies: 2 Views: 409 You make use of certain classes that aren't part of the standard Java API so I'm unable to really follow the code you've given. I did notice that you create a Pixel array in method decryptPicture()... |
Forum: Java Oct 15th, 2008 |
| Replies: 6 Views: 720 I agree with Ezzaral. Since you've declared the class attributes (or class variables) as being private, there would be no way for yo to access the values stored in those variables outside of your... |
Forum: Java Oct 7th, 2008 |
| Replies: 4 Views: 668 Indeed the problem at hand it rather complex and evolutionary programming has given results much better than previously employed mathematical models. There input set space has too many dimensions... |
Forum: Java Oct 7th, 2008 |
| Replies: 2 Views: 479 lol well said Ezzaral! As per rules, member help other members with programming... we don't give out solutions > we assist in making them work. Regardless, your question is very vague, you have to be... |
Forum: Java Oct 7th, 2008 |
| Replies: 6 Views: 720 Oopsy, didn't see your reply there Ezzaral. I agree with you! Only stuff up the main method when you're experimenting on small pieces of code.... only for the brave at heart hehe |
Forum: Java Oct 7th, 2008 |
| Replies: 6 Views: 720 Hi there, well your approach is actually one of the best ways to pass data between classes. One usually does this via the class constructor just as you have in the parking ticket class.
The class... |
Forum: Java Oct 3rd, 2008 |
| Replies: 3 Views: 1,625 The program I'm trying to automate input to isn't a Java program but your solution does sound interesting. Suppose that it was the case that the required resources are declared private, would it even... |
Forum: Java Oct 1st, 2008 |
| Replies: 3 Views: 1,625 Hi guys, I'm not really sure how to ask this or what to even search for. I want to write a Java program that can feed data into another program. If the other program had command line parameters then... |
Forum: Java Aug 5th, 2008 |
| Replies: 7 Views: 11,071 sabithpocker, so that's how you'd access an image? I agree that the image can be included in the generated jar file. However, my feeling is that the file will not be accessible via the Java code... |
Forum: Java Jun 9th, 2008 |
| Replies: 11 Views: 982 Hi there, just curious, why do you want to use a char array and not a String object? Possibly using a char array would save memory or be faster, but if you used strings, then there are methods that... |
Forum: Java Jun 6th, 2008 |
| Replies: 2 Views: 296 Alex is correct:
There is already a LayoutManager that will allow you to achieve your goal. It's called the GridLayout and you should certainly check the Java Docs on that one. Here is code from... |
Forum: Java Jun 6th, 2008 |
| Replies: 3 Views: 1,197 I think I might have made the same mistake. The way Scanner works, is by matching patterns in some stream. When you use nextInt() it will attempt to find an integer value in the input stream. If it... |
Forum: Java Jun 6th, 2008 |
| Replies: 13 Views: 8,008 Alex said:
Well that's not exactly true; the gradient (i.e. rate of change) of a Sin curve depends on the input. Though I did misread the part about the circle, my bad :icon_redface:
Good work... |
Forum: Java Jun 4th, 2008 |
| Replies: 1 Views: 1,108 I think it's because you're using the start command. This command actually asks Windows to execute the command and since you're using dir this will result in Windows opening up a command prompt. I... |
Forum: Java Jun 4th, 2008 |
| Replies: 5 Views: 891 I've not checked if Alex is correct, but as per your question regarding the storage of your array information. It can so easily be done by writing the entire array object to a file.
The is a... |
Forum: Java Jun 4th, 2008 |
| Replies: 13 Views: 8,008 Hi guys, drawLine() doesn't require the points to vary. In fact drawLine(10,10,10,10) would simply result in a point being drawn.
It's Math.PI because all constants, as per the Java convention,... |