2,040 Posted Topics

Member Avatar for seekdestroy

To get the element from ArrayList, use get(index) and you will get the card object. Then you can use getCard() from it to obtain the String for comparison. Is that what you are looking for?

Member Avatar for apines
0
13K
Member Avatar for digan

Your program has a problem at the accepting user input. Your count start from 1 but an array index starts from 0. Then you are attempt to assign the last index which does not exist! Initiate the count with 0 and the while condition to (count<quantity). To do the descending, …

Member Avatar for Anuradha Mandal
0
2K
Member Avatar for prakash2813

You can use JavaScript to read/write cookies. You may use cookies to act as session in JavaScript, but you should use server side for session. About how to read/write cookies, you can read it [URL="http://www.quirksmode.org/js/cookies.html"]here[/URL].

Member Avatar for Taywin
0
66
Member Avatar for CompSci_Guy
Member Avatar for Taywin
-1
1K
Member Avatar for triumphost
Member Avatar for djcrab
Member Avatar for Donnovan

In a linked list, you do not push anything. What you do is to hold on an object reference (for Java) which is pointing to your desired location. In this case, your 'last' variable is holding the last object reference. Though, I do not know what your 'index' value for? …

Member Avatar for Donnovan
0
101
Member Avatar for Buffalo101
Member Avatar for feoperro

The problem is the way you get image source (document.getElementById.("showHide").src == "Hide Table.bmp")). The return value may include all the domain name, so it will never be equal to what you are trying to do. You can try... [CODE] if (document.getElementById.("showHide").src.match(/Hide[^\.]*\.bmp/i)) { } [/CODE]

Member Avatar for feoperro
0
259
Member Avatar for sairakhalid

I saw fbody replied on one of the thread which should answers your question... Can't remember which one... But you need 2 stars in order to refer to the pointer of your 2D array element.

Member Avatar for sairakhalid
0
130
Member Avatar for divyakrishnan

Yes, you can but you would need ajax. Your menu link will call a JavaScript which uses ajax to obtain the new page content, and then replace the response content in your right div content. However, user would lose the ability to bookmark. Another way, which requires refresh the page, …

Member Avatar for divyakrishnan
0
88
Member Avatar for jmcorpse

What is trans in your argument? When you do carrying, you need to check whether the number will carry to the next digit or not. You should use while-loop instead of for-loop because you do not know whether the carry will cause the adding through out all digits. For example, …

Member Avatar for Taywin
0
85
Member Avatar for ace8957

There are a couple issues... First, you still need to create a new nodes inside your while loop for your new copied list. The only thing you copy from the original is 'element'. You are not allowed to use the original's node pointer for your new list. Second thing is …

Member Avatar for caut_baia
0
2K
Member Avatar for shasha123

And where is your code to show us? Also please use the [ code ] tag right on top of your message box when you post.

Member Avatar for Fbody
0
82
Member Avatar for vbx_wx

for(int j = 2; j <= i; j++) should be for(int j = 2; j <i; j++) or you will keep getting a number which is divisible by itself. Also... else { System.out.println(i + " "); } will keep printing 'i' even though the number is NOT a prime number. …

Member Avatar for apines
0
88
Member Avatar for avataralien

What you may do is to accept the user input as string, and then verify it before you put it in your date variable. If the input string is invalid, keep looping until you get the right format. Your should not use cin>>list[i].publish_date right away but rather put it in …

Member Avatar for Taywin
0
105
Member Avatar for pRincezZ_fe

You may start from trying to do video image capturing first... Read [URL="http://forums.sun.com/thread.jspa?threadID=626262"]this old[/URL] post from someone first... Then do the googling about it for more information.

Member Avatar for Taywin
0
91
Member Avatar for Valten1992

Not sure what your question is here... Do you have to implement your own sort()? Also, why score must be lower than 100? Is the possible highest score is 99? If the possible highest score is 100, you need <= instead of <.

Member Avatar for Airshow
0
223
Member Avatar for pRincezZ_fe

And what video lecture application are you talking about? Any other explanation rather than these 3 words?

Member Avatar for pRincezZ_fe
0
91
Member Avatar for ryoonnet

ryo: Please elaborate 'file encryption'? Do you mean using JavaScript to read in a file and output an encrypted content file?

Member Avatar for Taywin
0
109
Member Avatar for chmo

Line 10, you hard-coded the file you want to read in, but in line 29, your usage requires a file name? :P

Member Avatar for masijade
0
544
Member Avatar for 360anish

If you are going to use google, you need their API (javascript library). Not sure if they have this library available.

Member Avatar for 360anish
0
283
Member Avatar for dotbat

OK, if you want, you could read how to do it [URL="http://msdn.microsoft.com/en-us/library/17w5ykft.aspx"]here[/URL]... Don't misuse it though.

Member Avatar for dotbat
0
311
Member Avatar for vbx_wx

You may read [URL="http://www.sap-img.com/java/java-bitwise-shift-operators.htm"]this[/URL] for more tips.

Member Avatar for Taywin
0
110
Member Avatar for .waterboy

Yeah right, someone would code this for you. The problem is broken down into 2 parts - detect the boundary vertices while reading in and to compute the distance between the boundary. Even though the problem is interested, I am not going to do it for you without seeing your …

Member Avatar for Taywin
0
101
Member Avatar for Chalandria
Member Avatar for Eric Cute
0
273
Member Avatar for hamza123

Is this a question from your assignment??? Anyway, deleting a pointer(node) from a linked list without reconnecting it would cause you to lose all of the data which connect after the deleted node. As a result, memory leak would happen. There is a way to know that by traversing through …

Member Avatar for hamza123
0
98
Member Avatar for Sohelp

Hmm... I don't know... I would use it if the function is very short and straight forward. Not sure what the advantage is...

Member Avatar for Sohelp
0
250
Member Avatar for hassin

Also... Line 7 - you never initialized n, so nothing will be done in here ==> no loop Line 10 - Even you initialize n, you will never get this line to be printed out because a is 0 and n will never be 0 in order to get into …

Member Avatar for Buffalo101
0
124
Member Avatar for Armistice

Do you mean the while loop in the case '2'??? By the way, you can condense your loop to be more readable... [CODE] //*** from *** //priming read infile >> number; //looping count while (!infile.eof()) { if (number == numberinput) { count++; infile >> number; } else { infile >> …

Member Avatar for Armistice
0
155
Member Avatar for lisvonj

If you go back to what waltP said, orderNumber is a char, not an integer. So the line [CODE]while(orderNumber != SENTINEL)[/CODE] will always be true!

Member Avatar for lisvonj
0
145
Member Avatar for smithag261

Or in Javascript... :P [CODE] function sumDigits(val) { if (!isNaN(val)) { val = parseInt(val, 10) // ensure integer if (val>9) { var sum = val%10 // last digit number while (val>10) { // searching for the first number val = parseInt(val/10, 10) } alert(sum+val) // now what left is the …

Member Avatar for arkoenig
0
233
Member Avatar for azzman

You need the [ code ] [ /code ] tag whenever you post codes... It is very difficult to read without the tag... From scanning through, it could work, but what is your problem? Do you want to have a computer to play with a player? Then use a flag …

Member Avatar for griswolf
0
446
Member Avatar for goocreations

You should use recursive for this one. It will be much easier to use recursive. The idea is to swap 2 numbers, and then call the function again until you hit the base case (start==(end-1)). If you want to print out the result, you need only 3 arguments in this …

Member Avatar for goocreations
0
164
Member Avatar for anupam.j2ee

Use setTimeout() in JavaScript to display the time. You could simple search for a sample on how to do setTimeout() on the Internet.

Member Avatar for anupam.j2ee
0
107
Member Avatar for HBK_100

What is toupper() function definition? What's the exact error which is complained by the compiler?

Member Avatar for HBK_100
0
93
Member Avatar for dgreene1210

What do you mean by 'link'? And please put your code in [ code ] [ /code ] tag... Give me a headache when read your code... Anyway, you open a file using data_in.open("input.txt"); in the code. Just change the name of the file in order to read the file …

Member Avatar for Taywin
0
173
Member Avatar for kamweshi

It looks like it is calling processRequest twice. Could you try and change your doPost() to... [CODE] protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { doGet(request, response); } [/CODE] and you may need to declare visitCount as static?

Member Avatar for Taywin
0
106
Member Avatar for Slobodino

Wait... If you are talking about rectangular polygon, there is no such a 270 degree??? If you traverse a rectangular polygon, you will never change your turn ever (all left-turns or all right-turns)! As a result, you will always get 90 degree. Also, 270 degree is NOT a convex but …

Member Avatar for Taywin
0
104
Member Avatar for aznlitomik3

Why do you do everything again in the absolute() function for? What you need to keep track is the previous value you have computed thus far. Compare the value with the new value each time you get a new value. If the new value and the previous value are not …

Member Avatar for aznlitomik3
0
645
Member Avatar for ayooshkasmth

From looking at your screen shot, I believe you want to be able to calculate amount from checked items. That's what checkbox is for. The only issue you have is that you don't know how to use it. No, you aren't supposed to give multiple values to a checkbox but …

Member Avatar for Airshow
0
3K
Member Avatar for zulqarnain ali

Errr... It depends on how you read the input... Do you have to create sound signature too? This is not a common project for beginner. Why did you pick this project to do anyway?

Member Avatar for bobbyspeechrec
0
156
Member Avatar for Lando_

Eeek Borland... I used it in a class over 12+ years ago... The structure of your first for-loop is correct, but I am not sure that you can use 'char' as the type to do that. You need to use 'int' and start from 1, not 0. I believe that …

Member Avatar for Lando_
0
1K
Member Avatar for sciprog1

sciprog1: If a ball is a thread, you should implement the collision detection inside the Ball class, but you need to pass the boundary from Bouncing Ball display to it as well. Currently, it is done inside Ball class too, but the boundary is off (MAX_X and MAX_Y). The size …

Member Avatar for sciprog1
0
2K
Member Avatar for heidik

Does your file save each of the line in the same manner for the whole file? What I mean is that each line will contain exactly the same number of commas? If so, you can use find(",", startIndex) to find each string token you want for each line. You already …

Member Avatar for Taywin
0
4K
Member Avatar for schoenfelder.p
Member Avatar for HaKoNa MaTaTa

The only think I could suggest is to search on the Internet using "Javascript tutorial." You will see many links on it. You could start learning from any of those. The one from Brown university isn't that bad too. Then, you can try to practice. There are so many tricks …

Member Avatar for HaKoNa MaTaTa
0
125
Member Avatar for Kerrai

You need to read short-handed for regular expression. It is standard, so you use your search on the Internet should give you some ideas. For matching the first and second, you are talking about 'every single' character there. If you want, you need a '.' which means anything. And then …

Member Avatar for Taywin
0
132
Member Avatar for Sohelp

You aren't supposed to brute-force it. There is an equation to solve the approximation if I remember correctly.

Member Avatar for Sohelp
0
138
Member Avatar for burcin_erek

What is the equation you used in this computation? You initial 'i' but never assign a new value from user input; as a result, your factorial value is always 1.0. Again... I don't know what the equation is supposed to be...

Member Avatar for burcin erek
0
134

The End.