2,040 Posted Topics
Re: You need to create a Player class or something to hold all value you are looking for. Then in each line, you match the data and create an object and store it in your array. Oh, and you should use equals() method to compare string. It is safer. [CODE] // … | |
Re: Maybe this link [URL="http://download.oracle.com/javase/tutorial/essential/io/find.html"]http://download.oracle.com/javase/tutorial/essential/io/find.html[/URL]? Not sure if that what you mean... | |
Re: Because the index cards[1] is an object of String array. If I am not wrong, your current array contains... cards[0] = ["Spade", "Heart", "Club", "Diamond"] cards[1] = ["1", "2", ..., "K"] Try calling cards[2] to see if it throws an exception... That's because the way you declare it... You shouldn't … | |
Re: There are places you need to change in your code because you seem to excessively use "while(true)" and that is not a good way of doing in this case unless you are doing concurrent programming... [CODE] // first one public static int countMatches(String webpage, String keyword) { int count = … | |
Re: The variable "a" is declared inside "main()" scope. You cannot simply refer to it in other member function of the class - Choice(). Your function is quite a mess there... Also why do you use "for" loop in place of "while" loop? Even though it gives the same effect, I … | |
| |
Re: Because your if statement, which attempts to ignore certain keys actually, allows the symbols, it goes through from your "else" part which doesn't exists. You may try to put... [CODE] if (!e.ctrlKey && code != 9 && code != 8 && code != 36 && code != 37 && code … | |
Re: Hmm... I think you may need to read about Object Oriented Programming concept first before you tackle a problem in programming. You can read some basic at this link [URL="http://download.oracle.com/javase/tutorial/java/concepts/"]http://download.oracle.com/javase/tutorial/java/concepts/[/URL]. I understand that get right to programming may help you understand faster, but it is better off and will pay … | |
Re: I think so. However, a simple solution to this is to get a text editor that can find & replace a string... Why do you need a java program if you already have the tool? By the way, don't use Notepad because it .... Let say it is not a … | |
Re: In line 7, you initialize "marks" variable to 0. In line 21, you use it right away without assigning the input. As a result, all marks you are comparing are always 0. You don't need "marks" variable. What you need is to replace all "marks" variable with sNumb[i] from line … | |
Re: The document.write() will rewrite the portion which is the content of your div. That's why it disappear. You could create a separate function instead of an inline call like that to append the script tag inside. By the way, that's the same way of XSS hack where your code attempts … | |
Re: After looking more and more at your code, you have createList() function inside main()??? The for-loop in the main has an open curly bracket and only close once? | |
Re: Hmm... OK, where does "min" variable come from in this case? To find a minimum value in a collection such as an array, you need to set a variable with the greatest possible value. Then you iterate through the collection/array and compare the value from the collection with the variable … | |
Re: Old thread... It was created 3 years ago... | |
Re: In line 13, once your shape has height greater than 15, it will grow in height (not width) non-stop until it looks like a line because line 20 will determine the growth??? | |
Re: Your algorithm looks OK to me. The only thing I am not sure about is that why you try to limit the display format right where you "declare" the taxtotal? The number of precision should be determined at the display, not at your declaration unless the taxtotal is a display … | |
Re: If you look closely, the value you are getting is the counting order from a=1, b=2, ..., z=27 :) You should formulate how to tackle the problem first. The way you do seems to be a bit off. Let say, you are counting frequency of ASCII character? Do you allow … | |
Re: Hmm... Not everyone gets the idea of concurrent programming. Please don't feel bad about it. I will try to explain as plain as I could... Anyway, think of synchronous as simultaneous instead. Two or more threads are running at the same time and share the same resources. While sharing the … | |
Re: [QUOTE] symbol: method pow(double,int) location: class Math [/QUOTE] That's what you need to look at, not "monthlyPayment" variable. It said that the method pow() accepts double & integer, but Math.pow() accepts double & double. Here is the link to the class doc [URL="http://download.oracle.com/javase/6/docs/api/java/lang/Math.html"]http://download.oracle.com/javase/6/docs/api/java/lang/Math.html[/URL]. | |
Re: To do this encryption, you have to break it into 3 parts - key generation, encryption, and decryption. You need to read how to generate a set of group which satisfies the rules. Please read about it at [URL="http://en.wikipedia.org/wiki/Generating_set_of_a_group"]http://en.wikipedia.org/wiki/Generating_set_of_a_group[/URL] to understand what it is. Read about elgamal encryption at [URL="http://en.wikipedia.org/wiki/ElGamal_encryption"]http://en.wikipedia.org/wiki/ElGamal_encryption[/URL]. … | |
| |
Re: Here is my two cents... 1)I am not sure that #1 is actually against Java. Nowadays, many of people have Java plug-in for their browser (and most of the time is automatically installed when you install JRE). You could use Java Applet to do the same work. 2)The GUI on … | |
Re: What kind of values or object are you talking about? Do you have a compare method to work with? There are various ways to deal with it, but it depends on what object you are storing in your array list and how they can be compared. | |
Re: At line 139 [code]for (int i = 0; currentData < Data.length; currentData++){[/code] you are assigning value to "i" but then you increment "currentData" variable instead??? | |
Re: >_< Too much code & script... Tired from reading after work :( Anyway, I want to clarify about JS is not safe to save to the database. If you are taking any content from a user and save it directly into your database, regardless it is from Javascript or from … | |
Re: In line 24, your "harada" class variable "left" is NOT initialized. When you create "hara" in your caller (main() method), the "hara.left" is not initialized yet. Then you try to call insert from the main(). Therefore, you cannot compare "hara.left" in your "insert()" method... I think that what Zaad intended … | |
Re: You are using "buttons" 2D array variable to hold the current status of the game, so what you need to do is to check inside the "buttons" variable if there is any consecutive same letter (except "-") up to a number of whatever you want. If there is, the owner … | |
Re: 4 1/2 years old post >_< | |
Re: What do you mean by "not printing"? Does the program compile? If so, what the result it displays when you enter a date? Could you show a sample data you enter and its result? | |
Re: Hmm... Can't recall the algorithm I used to check for collision in one class I took called "Computational Geometry" when I had to implement an object going through an obstructed environment from a starting position to an end position... I don't have the code in hand right now too... Have … | |
Re: Maybe this link [URL="http://stackoverflow.com/questions/1862070/how-can-i-programmatically-extract-a-preview-image-like-the-first-frame-from"]http://stackoverflow.com/questions/1862070/how-can-i-programmatically-extract-a-preview-image-like-the-first-frame-from[/URL] could answer what you want? | |
Re: Hmm... Well, could you run Java without its interpretor? I doubt it because Java is not that low level language... | |
Re: Yes, but you need to return the correct type. I think it is double. | |
Re: In line 19, the function prototype as... teachersList(char inTeacherName[15], char inTeacherID[5]) shouldn't be correct. Shouldn't what you need is teachersList(char[] inTeacherName, char[] inTeacherID)??? In line 22, you attempt to compare "next" pointer with null value -- if(next == NULL). I doubt that it is true unless you create an empty … | |
Re: Maybe it is like... Ax = B And the question is missing something there? | |
Re: What sort algorithm are you using in this case? Even though it looks like a [URL="http://en.wikipedia.org/wiki/Bubble_sort"]bubble sort[/URL] to me, I am still not sure. | |
Re: Look at your line 15 and 23 which are the constructor declaration. Your have only Player() and Player(String, int, int, int, int) but not Player(String, int) which you are trying to initiate. That's why you get the error. You need to implement another constructor as... [CODE] public Player(String MyName, int … | |
Re: On line 18, you need to rethink about how you read through a string and calculate a base 10 number from base 2. Look at this thread [URL="http://www.daniweb.com/software-development/cpp/threads/384907"]http://www.daniweb.com/software-development/cpp/threads/384907[/URL] and read the bottom part which is my post. You should see how it is calculated. Then use that in your loop … | |
Re: You mean you need to validate value "before" you send it out to the server? Then it is more likely JavaScript only. The Ajax part is only a part to send requests and receive back from the server for display. However, you still "have to" validate the data again on … | |
Re: How about how to do it step by step? "110" in base 2, to convert to base 10, you start with the right most number. The third position in a string = 0 * 2^0 = 0 The second position in a string = 1 * 2^1 = 2 The … | |
Re: If you want a step number, you need to pass the number to the function as well unless you have a global variable (which should not be there). To display what you are at, you could simply print out what you are trying to do before you return the value. … | |
Re: Just a quick question. In line 48 and 49, why do you need to do the arithmetic on the multiplied values? Both values in these lines are constant. [CODE] /* Line 48... Math.floor(Math.random() * (100 - 50 + 1) + 50); the same as Math.floor(Math.random() * 51 + 50); the … | |
Re: Do the #1 and you will need to change your constructor function to... [code] function Person(first, last, acode, phnumber) { ... } [/code] The reason is that you are using different form of function prototype. You are passing 4 arguments and you will need to change it. And your line … | |
Re: The doctype control parsing of the page in order to display it correctly. Can you recheck that you don't have any invalid HTML element tags in your HTML page? | |
Re: That is not easy to do because you will have to monitor the scrolling position. How about breaking the display into 2 divs, and then put the "fixed" part inside one of the div. The moving should stop once you scroll pass the div that the fixed part is in. | |
Re: On way to do it is to put the whole thing in a method. If it throws an exception, call the method again... [CODE] public void tryFile() { System.out.print("Enter file name: "); try { dataFile = scan.nextLine(); } // assume that scan is the class variable catch (Exception e) { … | |
Re: Oh and by the way, I tested your page and the ball wouldn't show up even though I clicked right on it. The message I saw is "Mile away" which is totally wrong. :P I am using FF version 7.0. | |
Re: If you want a static web page, you could use simple HTML to display links to each file in each folder. For example... [CODE] /* Your folder structure is... C:/ |_ MyHTMLFolder | |_ABC | |_file1 | |_file2 | |_file3 | |_file4 | |_file5 | |_DEF | |_file6 | |_GHI … | |
Re: OK, you are doing something wrong in this case. What do you think your ArrayList is containing after reading in? I understand that the first and second values are the row and column number. Now what other numbers in the ArrayList? Can you show us the sample data you attempt … | |
Re: If you run this code on a server, you must be a root - administrator - to do the command. What purpose are you trying to do here? A plank??? |
The End.