2,040 Posted Topics
Re: 1)You are attempting to create methods inside the main() method. You need to take them outside the main(). Then you call them in main() instead. 2)Each method outside the main(), you may not need "static" keyword to make the method static. You should learn how to use "static" method in … | |
Re: You have already done it correctly (without any help I believe & congrate) in the other post, so you should mark this post as solved. :) | |
Re: If you use "clear()" from coins which is an ArrayList, you will remove all elements! Take line 44 in your Purse class out of the loop. A better idea is to implement a method that clear the purse for you (to hide the information). Implement a method inside your Purse … | |
Re: Hmm... There are so many things to talk about your code... But I will keep it for your later improvement of your own code. Anyway, when you want to keep looping for playing, you need the while-loop to cover the whole part from random guessing numbers (and why numbers anyway???) … | |
Re: My first question is... What would happen if you call the System.exit() in the finally clause from the middle of the exception stack level? Would that terminate the program without going up to the top level? [CODE] try { ... } catch (Exception e) { ... } finally { System.exit(1); … | |
Re: This is Java forum... Not JavaScript... Also, the script has window.open which will open a new windows. You could, however, use frame/iframe tag to display the content of link. The down side is that you loose the ability to bookmark the page. | |
Re: Off topic first, even though JavaScript is very loose in type checking, your design should not use typeof() too much. It could get tricky in the future. On topic, how about convert the typeof() to a string and compare each string with it instead of using Debug.log()? [CODE] var typeOfTime … | |
Re: The events you are looking for may be onunload & onbeforeunload (non-standard) events. However, these events are tricky and may not be able to achieve what you want. The reason is that these events would be fired when you leave the site via links or click on the "back" button. … | |
Re: If you want to keep it that way, you need to get rid of the for(int i=0... loop. Instead of that loop, declare a variable type int and initial it to 0 outside the while-loop ( i.e. int cnt=0; ). Then use it in place of "i" variable in the … | |
Re: If you want to find a largest number which is always a positive number, declare a variable outside the do-while loop and initial it with any value below 0. Then right after each input from a user, compare the value with the variable of largest number you have. If the … | |
Re: Hmm... I can't recreate the event you are talking about... I always get the focus with document.getElementById(commentid).focus(). Not sure... But could you delete the closing tag of "input"? There is no closing tag for "input" by the way (and never was). PS: What browser are you using? | |
| |
Re: What gem version are you using? What Rails version are you using? | |
Re: How about... [CODE] for (int n=1; n<5; n++) { do something } .-----. | Start | '-----' | V +-------+ | n = 1 | +-------+ |<---------------------------------------------+ V | ' ' | / \ +--------------+ +---------+ | ' n<5? ' --yes--> | do something |-->| n = n+1 |--+ \ … | |
Re: And what it is supposed to be for a negative value? Also, it wouldn't work because the returned string has a "-" sign in front. If you want to sum only, then use Math.abs() on your "aNum" before you use the String.valueOf()??? | |
Re: Use view source and you should see .php links... If you try to enter an invalid URL, you would see a link to support with .php in it. | |
Re: 1)Line 21, The clockid should be initial to 0, not a function. [CODE]var clockid = 0;[/CODE] 2)Line 23, This is an odd way of your implementation. You could simply use... [CODE]seconds += 1;[/CODE] 3)Line 24, The document.quiz does not exists. This is an incorrect reference to an element of HTML … | |
Re: You need to use Ajax for it. I think you are talking about Struts. You can look at this example [URL="http://www.roseindia.net/struts/struts2/struts2ajax/ajax-login-form.shtml"]http://www.roseindia.net/struts/struts2/struts2ajax/ajax-login-form.shtml[/URL] or this tutorial [URL="http://struts.apache.org/2.x/docs/ajax.html"]http://struts.apache.org/2.x/docs/ajax.html[/URL] for more information. | |
Re: Because your disp(Short) is not the first choice for "short" (look at "Short" is a class, not primitive)? So Java casts the "short" to "int"? If you look at it, Java cannot cast a "long" to "int" (loss of precision?) but it can do "long" to "Long"... | |
Re: Are you converting this from C++ or C by chance? The syntax of your code looks very close to C++ or C. You cannot use the syntax in Java. Also, there are certain differences between them... It looks like you are trying to print out an upper case character in … | |
Re: Hmm.. How about change the way you do inside the function... Let say you get the max length of the list before hand. The condition is still there... [CODE] # the starting refnum is equal to (length of the list -1) (define (print-all(list refnum)) (cond [(>= 0 (length list)) (print-all(list … | |
Re: Hmm... Very difficult to read what in the picture because of the low resolution. Anyway, here is what I got from it... [CODE] +---+---+---+---+---+---+ | 1 | 1 | 1 | 0 | 0 | 1 | +---+---+---+---+---+---+ | 1 | 1 | 1 | 1 | 1 | 1 … | |
Re: Did you add JQuery libraries to it as in the tutorial? I'm not sure about the version, but it may not be relevant. I did mine in pure JavaScript though... But not with a little tween effect. :P | |
Re: In line 16, take out the "onclick" event. [CODE] <input type="submit" name="Update" value="" class="highlight_input_btn fr"> [/CODE] Then change your line one to... [CODE] <form name="registerform" class="registerform" action="http://www.projectdisobey.com/disobeyclothing/?page=myaccount&type=editprofile&chagepw=1" method="post" onsubmit="return chk_form_pw()"> [/CODE] | |
Re: You may want to look at this forum link [URL="http://stackoverflow.com/questions/1586341/how-can-i-scroll-to-a-specific-location-on-the-page-using-jquery"]http://stackoverflow.com/questions/1586341/how-can-i-scroll-to-a-specific-location-on-the-page-using-jquery[/URL]. It may answer what you want to do. | |
Re: It doesn't work with "getElementById()" function because the function is being called before your dom is built (and page is not rendered yet). As a result, the function throws an error because the div element with ID "myString" doesn't exist at the point when the function is being called. The … | |
Re: Well, you could start with extending the class? [CODE] public class Guitar extends StringedInstrument { ... } [/CODE] Then think about how to implement a guitar object. | |
Re: C++ is not a web application language. And if I understand what you want, you could simply display other website inside a frame/iframe and have your own content over it. | |
Re: You just need to check merge the whole response back and split them. Then put each content into the right element. An example is below. You could do it in many other ways as well. [CODE] if (xmlHttp.readyState == 4) { // you should check the status 200 as well??? … | |
Re: Hmm... You need to update this line... [CODE]document.getElementById(arrDiv[x]).style.display = disp;[/CODE] There are 2 values you can use for the display. "none" is for hiding and anything else (preferred null) to get rid of "display" style. i.e... [CODE] document.getElementById(arrDiv[x]).style.display = "none"; // for hiding document.getElementById(arrDiv[x]).style.display = null; // for showing [/CODE] | |
Re: 1)Session timeout should be implemented on the server side. The server knows the time when the last HTTP request is called. If the next request is longer than the time limit, you could simply drop the request and display session time out. 2)There are many time counter in PHP and … | |
Re: The problem is that you print out a message on every single check of your sub string from split(). What you may want to do is to create a boolean variable outside the loop and set it to true. Then inside the loop, if there is anything that cause the … ![]() | |
Re: It is your homework. Who would know better than you do about what you are talking about this somewhat pseudo code? Also, there are many unknown variables in the code... 1)Is "seq" a global variable? Because it just pops up in the function without declaration. 2)Where does "x" come from? … | |
Re: Do you want to show sum of each row? You are on the right track up until line 15. What you need is to add up the "sumc" with the value you just assigned to - nos[i][l] - not add the values as you are doing now (hard-coded). Also, you … | |
Re: No James, you may be misunderstanding. That's not what it should be. The person wants a user to click on "roll" button to start rolling and then click on "stop" button to stop the roll right away. So Timer should not be used in here. The problem is in RollDicePanel's … | |
Re: You just dumped huge compacted code portion to the forum. Sorry, I am not going to sit down and look at it. Also, please do not hijack other's thread. You should create your own. | |
Re: It is in VBA. [CODE] Dim byt As Integer <-- declare variable Dim acc As Integer <-- declare variable If txt = "" Then lbl = "0" Else For i = 1 To Len(txt) <-- go through the loop from 1 .. text length byt = Asc(Mid(txt, i, 1)) <-- … | |
Re: You just need to have another set of variables to keep the division. Do not reassign your variable a, b, or c at all. [CODE] // i.e. int tmpA = a; do { diga = tmpA % 10; suma+= diga; tmpA = tmpA / 10; } while (tmpA > 0); … | |
Re: The class itself doesn't seem to be wrong. How do you call or instantiate the class object in your other class/method? | |
Re: Huh? I always use a plain text editor to code Java, Ruby, Perl, etc... Tools or IDEs are tools. This means it should not be a necessary component in your coding. It is to aid you to make life easier. Do not rely on them too much... Edited: Forgot to … | |
![]() | Re: This looks to me very similar to a language grammar. It looks good to me. I assume that epsilon is the terminated value. OK, from this site [URL="http://web.cs.wpi.edu/~kal/PLT/PLT4.1.2.html"]http://web.cs.wpi.edu/~kal/PLT/PLT4.1.2.html[/URL] describing how to eliminate left recursion. [code] For each rule which contains a left-recursive option, A --> A alpha | beta introduce … ![]() |
Re: Maybe you need to read about java classpath when you compile a Java file? ([URL="http://download.oracle.com/javase/1.3/docs/tooldocs/win32/classpath.html"]http://download.oracle.com/javase/1.3/docs/tooldocs/win32/classpath.html[/URL]) | |
Re: Try this... Change... [CODE] public static void main(String args[]){[/CODE] to [CODE] public static void main(String[] args){[/CODE] | |
Re: Hmm... I'm not sure about how you use the getline() function. Does the getline() also attempts to add "\0" to the end of your array when you have already filled up each array with 3 values? | |
Re: 1.Please use the "Code" tag next time... 2.What is your error? What does it say? 3.You declare "display()" method twice? | |
Re: You need to form the range in your if-else statements. [CODE] if (Gal <= 4000000) { // better use less than or equal to & also number is a number ... } else if (Gal>4000000 && Gal<=10000000) { // 2nd range ... } else { // anything exceeding 10 mil … | |
| |
Re: What you need is all combinations of the set. Then the break down is done after you have all the combinations. If you notice how each element arranges in the solution, you would know what I mean. Now, a link solution and explanation about how a combination works is at … | |
Re: Are you talking about ROBDD or just BDD? | |
Re: Try "Grease Monkey"? Also, you need to override the function in "window.onbeforeunload". If your site got redirected (hijacked), you need to clean your site now. Also, check all your code for vulnerabilities. PHP page is usually easy to XSS which results in adding malicious content to the page. |
The End.