2,040 Posted Topics

Member Avatar for NICEGUY123

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] // …

Member Avatar for Taywin
0
193
Member Avatar for Ryden

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

Member Avatar for Ryden
0
96
Member Avatar for sirlink99

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 …

Member Avatar for Taywin
0
224
Member Avatar for askylitcity

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

Member Avatar for Taywin
0
146
Member Avatar for Sunshine2011

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 …

Member Avatar for dluz
0
101
Member Avatar for new_2_java
Member Avatar for Mahesha999

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 …

Member Avatar for Taywin
0
669
Member Avatar for shootingrubber

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 …

Member Avatar for shootingrubber
0
188
Member Avatar for Ranek

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 …

Member Avatar for Ranek
0
180
Member Avatar for kmbl84

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 …

Member Avatar for kmbl84
0
127
Member Avatar for RobotFX

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 …

Member Avatar for RobotFX
0
3K
Member Avatar for ravi543

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?

Member Avatar for ravi543
0
101
Member Avatar for Stjerne

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 …

Member Avatar for JeffGrigg
0
166
Member Avatar for sidrules1984
Member Avatar for Mi_99

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???

Member Avatar for Taywin
0
110
Member Avatar for Mz. Jackee

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 …

Member Avatar for Mz. Jackee
-1
150
Member Avatar for Sunyata

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 …

Member Avatar for Taywin
0
143
Member Avatar for stereomatching

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 …

Member Avatar for Taywin
0
1K
Member Avatar for fraandres

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

Member Avatar for Taywin
0
221
Member Avatar for mrjillberth

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]. …

Member Avatar for mrjillberth
0
1K
Member Avatar for bennetk2
Member Avatar for mnmo88

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 …

Member Avatar for phoenix_2000
0
260
Member Avatar for anand01

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.

Member Avatar for anand01
0
3K
Member Avatar for Blink383

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???

Member Avatar for Taywin
0
372
Member Avatar for FreePuppy

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

Member Avatar for Taywin
0
191
Member Avatar for ARaza110

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 …

Member Avatar for ARaza110
0
172
Member Avatar for judeabao

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 …

Member Avatar for Taywin
0
165
Member Avatar for parani
Member Avatar for Vidgie65

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?

Member Avatar for Taywin
0
293
Member Avatar for Labdabeta

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 …

Member Avatar for Labdabeta
0
215
Member Avatar for Jessurider

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?

Member Avatar for Taywin
0
146
Member Avatar for Dante2

Hmm... Well, could you run Java without its interpretor? I doubt it because Java is not that low level language...

Member Avatar for JeffGrigg
1
406
Member Avatar for gahhon
Member Avatar for gahhon
0
149
Member Avatar for Wootens

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 …

Member Avatar for doug65536
0
115
Member Avatar for lynn21
Member Avatar for Rashakil Fol
0
138
Member Avatar for a.muqeet khan

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.

Member Avatar for a.muqeet khan
0
223
Member Avatar for woomichael

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 …

Member Avatar for Taywin
0
147
Member Avatar for math_girl123

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 …

Member Avatar for Taywin
0
90
Member Avatar for vinothaviji

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 …

Member Avatar for Taywin
-1
125
Member Avatar for meli123

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 …

Member Avatar for Taywin
0
280
Member Avatar for NoUserNameHere

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

Member Avatar for Taywin
0
93
Member Avatar for sun-tzu

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 …

Member Avatar for Taywin
0
707
Member Avatar for AODfan

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 …

Member Avatar for Taywin
0
202
Member Avatar for cjohnweb

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?

Member Avatar for Taywin
0
2K
Member Avatar for deceivingrakesh

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.

Member Avatar for Taywin
0
128
Member Avatar for ferretfool0x77

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) { …

Member Avatar for skoiloth
0
240
Member Avatar for sanstepsan

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.

Member Avatar for Taywin
0
91
Member Avatar for vasuv

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 …

Member Avatar for Taywin
0
107
Member Avatar for aanders5

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 …

Member Avatar for aanders5
0
364
Member Avatar for valestrom

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???

Member Avatar for Zssffssz
0
166

The End.