2,040 Posted Topics
Re: What is your question related to these JavaScript problems? What effort have you done here besides dumping all problems on the forum? Have you had any answer for these problems? Show us what you have done, and you may ask us to correct or get a feed back on your … | |
Re: You will have to make a decision about your cone drawing because you will encounter 2 different types of cone -- odd and even width. If it is an odd width, it is easy to put the tip of your cone in the middle, but how would you deal with … | |
Re: Well... It is somewhat straight forward... Though, you can implement this in many ways. You just need to decide and identify which portion of the code is being called many times, and then take that part out and put in a function. Also, the temperature computation part (min, max, average) … | |
Re: Because you are using % on its own in every single number, all iterating number is a prime number for you. Try to change j=2;j<=i;j++ to j=2;j<i;j++... Also, you are printing out the number when it is not divisible in your loop which is wrong... What you need is a … | |
Re: You use BankCount in line 385 to disable transaction button if its value is less than 1, but you never increase the value anywhere in your code while its initial value is 0. You need to add your own code to do the transaction (in this case it is subtraction) … | |
Re: I am not sure if it is the right way to remove a DOM element by assigning a 'null' value to it. Anyway, your delete function may look like this instead... [CODE] function deleteTask() { var selectedTask = 0; var taskSelected = null; while (selectedTask < document.forms[0].tasks.length) { if (document.forms[0].tasks.options[selectedTask].selected … | |
Re: What you need to do is one function to compare the value against the other's option list. One thing you did not clarify here is what you are going to do with the selected option a user has selected before the other select option is changed? My sample code below … | |
Re: There is no 'Exact' double. One way I would do is to work with it in integer or long, and divide it later to get double. Even though, there will always be an error because of epsilon value in computation for approximation, the error should not be cumulative as the … | |
Re: If you want a quick test on the class you are working on, add a main method in the class (could be at the bottom of your class implementation). A sample main() definition is below. [CODE] public class Bankaccount { // your class variables declaration // any other methods... // … | |
Re: Casting is to convert from one datatype/object to another. In this case, you would do Integer.toString(accID). Refer to [URL="http://download.oracle.com/javase/6/docs/api/java/lang/Integer.html"]Integer[/URL] api for more information. | |
Re: Because you use find() with one space, the end of the string does not have it. As a result, it doesn't see your last word. i.e. "are you".find(' ', 0) ==> found 3 --> print "are" "are you".find(' ', 3) ==> not found --> no print So what you need … | |
Re: You can partially achieve this by using onmouseover event. You can change the CSS of image opacity and border style, but you [b]cannot[/b] change the image's background color using CSS (but you can swap image out). | |
Re: Because you use your nod2 in the loop at line 39 and it becomes Null after it gets out of the loop in line 51. You cannot use it again to get inf in line 52. May be what you mean in line 52 is if(nr<nod3->inf) instead? | |
Re: If you are looking for a project topic, this forum may not be the place to ask for. What you need to do is to come up with an idea of what you want to do. Then create a project. To create a project, you must plan what you need … | |
Re: Next time when you post about problem, please include the detail of error which the compiler is complaining... I cannot remember which C++ compiler requires main() to return int. I used to code them both ways... But on a safe side, declare it as int... Anyway, you are attempting to … | |
Re: Condense it to... [CODE] if (((year%4)==0 && (year%100)!=0) || (year%400)==0) { // leap year } else { // not leap year } [/CODE] *** Note *** This works only with modern year (AD). If you are talking about BC, it is not correct. | |
Re: I agree that the constructor of the NewThread is non-sense... Why would you create a thread and then start it right away. In this case, the thread could have executed the loop inside its own class once before it sleeps in the ThreadDemo class loop... | |
Re: I don't really see your recursive method there? What you need is a base case for your recursive method. In this case the base case could be the end of string, and the base case return the number found... | |
Re: Mike: You may use CSS to control the div size as followed: [CODE] <style type="text/css"> div.scrollable { height: 200px; overflow: auto; } </style> [/CODE] In this case, you don't need to add 'view more' because the div area will automatically add a scroll bar to the viewing area if the … | |
Re: If you fix it to 2 times, you could just repeat it again in your code??? | |
Re: akondray: As jon said, Char object is not the same as String. Also, instead of trying to check the first char, why not check the whole words? You could use equalsIgnoreCase() method instead. You could take a look at [URL="http://download.oracle.com/javase/6/docs/api/java/lang/String.html"]String[/URL] api also. [CODE] String repeat = "y"; while ( repeat.equalsIgnoreCase("y") … | |
Re: Are you talking about server side? If so, what object are you using to hold the request? | |
Re: You are on the right track. What you really need to work on is your base case. The function should also return an integer in order to be recursive, or you won't be able to compare value returned from the deeper level function call. In this case, there should be … | |
Re: When you are saying 'searching for a box', what does it mean? You want to read in an image and produce another image which contains only the box? Sounds like computer vision. Anyway, you may need to do edge detection first, and then search for the box from the edge. … | |
Re: For your while loop, you are accepting 5 strings but you never SAVE any but OVERWRITE it again and again. As a result, you will have only the last string left to work with. What you need to do is to move your for-loop inside line_count while loop but below … | |
Re: Give any sample data to test it? And what output you get when you enter your sample data? Debugging other's code is not easy; besides, I have already forgotten about the algorithm... Need to read about it again... | |
Re: Old thread... By the way, there are 2 functions in the question... Which one is not working? | |
Re: nikc: Are these codes copied & pasted or you just typed in? There are a couple errors in the codes... [CODE] <a href= "JAVASCRIPT<b></b>:toTOp('chaiscaleigh')">2</a> </p><p> <a href= "JAVASCRIPT<b></b>:toTOp('chloe')">3</a> // You have extra string between javascript call syntax. // It must be javascript:toTop('..') // look at toTOp(), it must be toTop() … | |
Re: steel: Your purpose is ambiguous to me. Let see a use case here. 1)A user request to upload an image to the server??? 2)An upload file form is displayed 3)The user selects a file and submit 4)The file is uploaded on the server and a thumbnail of the image is … | |
Re: [QUOTE]SQLExeception [/QUOTE] Don't you see the misspelling? | |
Re: Maybe an array with even element number? Sorted? Unsorted? Instead of thinking as an array, just think as a list of numbers. It is the same, but the different is that array has index while a list of numbers is just a list of numbers. :P | |
Re: Agree with WaltP. Turbo C is very old and may not work with today hardware. Also, I am not sure that I would see any place still using Turbo C code... | |
Re: When you are thinking about loop, you need to think which part of your code will be rerun over and over again. Then, you plug in a loop and move the code inside your new loop. In your case, it looks like these code lines below are executing over and … | |
Re: You could use your servlet to display the pagevia your PrintWriter. Just write a string of HTML head and body to it. Try it by writing some html string to the writer first, so you would at least see what would be displayed on the web. | |
Re: Hmm... Just got it... What you need may be like this... [CODE] public int max(int[] v) { return helpFindMax(v, 0, v.length()-1); } private int helpFindMax(int[] v, int start, int end) { // This is the recursive method. // Do the search here and return the largest integer. } [/CODE] | |
Re: On line 84, you are missing a double quote to close off your onchange event. | |
Re: This is not C++ problem, but a logic problem. If you see that there are 3 numbers and 3 possible answers, possibility of involving 3 numbers to produce 3 different answers could be 1)each number may need a logical transformation or 2)pair numbers used in logical transformation... | |
Re: Then you need to look at your code on those lines. [CODE] public void setdepartmentName(String Department) { departmentName = Department_Name; // line 65 is here // The problem is that Department_Name is expected to be a variable, // but your function has only Department argument passed in; // as a … | |
Re: I think what you need to do is to take the onload into a variable and run it right away, and then run your function. A sample way to do it is below. [CODE] if (window.addEventListener) { // anything but IE if (window.load) { window.__load = window.load window.__load() // run … | |
Re: Too much code for me to look at right now... Going to bed soon... So I will answer only your first question. Your regular expression is incorrect. the {#} is not supposed to be used the way you do. If you want to match 3 of w's, just spell it … | |
Re: If you have a set of permutations, you could iterate through each of the word and use the word to search in your dictionary. (Use whatever search algorithm you want here, but I would suggest a binary search would be the best because it is sorted -- dictionary.) If you … | |
Re: Which Node class are you using? I am sorry, but I saw only Node interface on [URL="http://download.oracle.com/javase/6/docs/api/"]java 6 api doc[/URL]. I may be out dated... :( | |
Re: I guess you should start from how to read in data from a text file. You could look at [URL="http://www.roseindia.net/java/beginners/java-read-file-line-by-line.shtml"]this example[/URL]. Then what you need to do is to parse the data (all lines after rightSeat line) in those 3 parallel arrays as stated by Ezzaral. While reading the data … | |
Re: You can't just simply set font and color directly to JOptionPane. You need to create objects that can do that in a panel, and then set display. Refer to [URL="http://download.oracle.com/javase/6/docs/api/"]java 6 api[/URL] and look for class api. There are many examples on the Internet. You could search for one easily. | |
Re: sunnyday: If the message is not displayed, you may not correctly implement your ajax for the display part. If you do the reload, you will need to solve other subsequence issues; besides, users may have problems working on the page -- the page is automatically refreshed. How do you implement … | |
Re: In your code, you rely on 'read()' method to throw Exception because you do not completely understand the class methods. I believe that the method handles a null File object by returning null. ("If no registered ImageReader claims to be able to read the resulting stream, null is returned. ") … | |
Re: You are looking for is a functionality in WYSIWYG editor. You may search for window.getSelection() for FF or others, and document.selection.createRange() for IE. | |
Re: Actually, you could do either way (from fobos posts) depending on how you approach the text. If the text value inside textarea contains known string format and length that cannot be changed, you could use substring method. If you want to search for the substring, you could use regular expression … | |
Re: OK, I'm kind of confused about the purpose of your code... Let see your code... [CODE] public Vector createData() { Vector result = new Vector(); Vector rec = new Vector(); // the line below, where does 'ename' variable come from? Object[] value = new Object[] {"Employee Name",ename.getSelectedItem().toString()}; // rec => … | |
Re: Next time, post your error message. Don't just plain asking for help and dump your code on us... Not nice... OK, your code is fine. I could get it compiled and run without a problem (using javac command). |
The End.