2,040 Posted Topics
Re: OK, if I understand you correctly, you want these divs to be placed in a random order, right? OK, I am going to show you only how to use the random and simply write it out directly to the document. However, there are other advanced and better way to deal … | |
Re: I think he/she wants to use the syntax as if it is public. @merse, no, I don't believe you can do that... | |
Re: You should not need any while loop anymore for pennies because there is no 0.1 pennies coin! Change line 86~89 to pennies = change; and see how it works... | |
Re: Do you have an extra empty line in the file? Or the file just ends right after "fourth 4"? You may try both to see what happen. | |
Re: [QUOTE]when i is equal to zero you are doing i-1 which i'm assuming is causing the error because fullname[-1] is out of range [/QUOTE] I don't think it is a case here because the -1 will drop out of the loop. Though, the issue is where 'i' is being use … | |
Re: If you are going to do this in recursive way, it sounds like a way to do with scheme (functional language) using CDR. :P Anyway, the idea to do this is... 1)Keep traverse through the list until you hit the last node 2)Return the last node back to the caller … | |
Re: I'm not sure if this is the case... One possibility, I have a feeling that the new div created has style as 'position:absolute' which allows div to be overlapping and ignores your line break tag. Another possibility (which I have not tested but just think) is that your outer scope … | |
Re: Sumit: IE has problem with dynamic setting 'visibility' style property. What you may do is to use CSS instead. [CODE] <style type="text/css"> .showDisplay { display: table; } .hideDisplay { display: none; visibility: hidden; } </style> // javascript part ... var m=1; function DisplayAddComment() { if(m==1) { document.getElementById("dvAddComments").className = "showDisplay" m=0; … | |
Re: From what I scan through the code, there are problems as followed: 1) Line 38, you increment 'top' before you do anything else which would cause trouble in assigning value to your array. If you don't see it, look at line 44, you will never assign value to a[0] but … | |
Re: Another simple built-in function is match(). It is similar to indexOf() but it returns a boolean instead. If it found the pattern (string or regexp), it will return true; otherwise, it will return false. [CODE] if("hasNoUnderscore".match(/_/)) { alert("Yes") } // use regexp to match else { alert("No") } if("hasNoUnderscore".match("_")) { … | |
Re: What is your question??? Anyway, line 129, where does 'ch' come from? | |
Re: Too vague requirement... The easiest way is to use a popup. Try to do it with alert() function first to see if the function is called correctly. | |
Re: Is that the full error trace you got? I would like to see the whole error tract list. The line mention in your error does not match with the code you posted. It is very difficult to pinpoint where the bug is. By the way, is your Enumeration a class … | |
Re: You could try depth first search (DFS) and store every file/folder found in a queue. If the element which is popped from the queue is a directory, go inside the directory and push all files/directories listed inside the directory into the queue. If it is a file, check whether or … | |
Re: If you want to do parsing manually from text, read it in line-by-line and try to find an index of the matching open and close tag. Of course, this would assume that all tags are done correctly (no invalid nested tags or no open-with-no-close tags). | |
Re: How did you implement your 'push' and 'more' functions? | |
Re: You created ps as a pointer, and you are attempt to use pointer of pointer to assign a value... I can't remember the exact syntax for this assignment... I am sure that someone else knows the exact syntax. | |
| |
Re: Do you mean you want to cooperate 'input' tag with a function call? You can use onclick() event. [CODE] //i.e. in javascript <script type="text/javascript"> function clickItAlready(arg1Str, arg2Num) { alert(arg1Str+":"+arg2Num) } </script> // in HTML <input type="image" src="/stellardonations/paypaldonate.gif" border="0" name="submit" onclick="clickItAlready('my string argument', 777)"> [/CODE] | |
Re: Your function 'chk()' takes 2 argument, but when you first call it you passed in only 1 argument -- chk(divs). As a result, the second argument is always null and cause the 'else' statement to be true all the time. Maybe you can try... [CODE] function chk(radioElement) { if (radioElement) … | |
Re: You are reading file in line-by-line. As a result, your name is read correctly (as a string), but the numbers are read as a string as well ("75,85,95,100,44"). What you need to do is to parse the string and break it into numbers. That's all you need to do. If … | |
Re: I am not a mootool user.... I don't know what the library requires... Why would you try to strip the library? It is a risk that you may break it. Also, it is not an easy task to strip a library if you do not understand script... The original file … | |
Re: Your error occurs in line 29 where you attempt to access mydouble[a][b] but you have never initialize mydouble array? This is one of the part that Java spoils those who learn how to program it. The problem is that Java initiates a value to primitive, so some new people assume … | |
Re: If you want only even number while going through, you could do it like... - Check whether the incoming number is an even number -- If it is not an even number starting number (snum) is equal to number+1 -- otherwise, starting number (snum) is equal to number - Iterate … | |
Re: The problem is not the loop, the problem is the regex... I am not sure how to go about it. | |
Re: Do you have to deal with an even number as well? Or there is no such a case? | |
Re: nettee: You could use JavaScript to manipulate color, but it would be quite messy. [CODE] // !modified from ryoonnet code above <html> <head> <title>My Table Page</title> <script language="text/javascript"> <!-- function changeColors(colorSet) { switch (colorSet) { case 1: document.body.style.backgroundColor="seagreen"; document.getElementById('firsttable').style.backgroundColor="darkseagreen"; document.getElementById('secondtable').style.backgroundColor="palegreen"; document.getElementById('firsttable').style.border="3"; break case 2: document.body.style.backgroundColor="khaki"; document.getElementById('firsttable').style.backgroundColor="beige"; document.getElementById('secondtable').style.backgroundColor="burlywood"; document.getElementById('firsttable').style.border="3"; break default: … | |
Re: I understand that it is difficult to understand recursive when you learn about it the first time. (I did have difficulty understanding it as well when I first learned about it.) One way to be more clear about it is to follow its iteration and write it down in a … | |
Re: I'm sorry, what is the algorithm to create the matrix? And could you show me your coding part if any? | |
Re: Basically, if you are dealing with error handling which is not from your own program but a user input, do it right after a user enters a value. Each time an input is from a user, check it right away to see whether or not it is correct data type … | |
Re: Look at line 9, if your segments value is greater than 1, you will have the same copy of variable inside your 'segment_form'.innerHTML. You are appending the same string up to the number of segments value! Is that what you want??? What is the real purpose of segments value? | |
Re: It does do the job, but your logic is flaw. [CODE] // example if(e >= 0) { Exchange = (exports + e); } else { Exchange = (exports - e); } [/CODE] Look at your code above. Let say Exchange is 0. Now when e is 10, the result for … | |
Re: What's the purpose of getInputContext()? Do you know what is returned? I read its [URL="http://download.oracle.com/javase/6/docs/api/java/awt/Component.html#getInputContext()"]api[/URL] and not sure why you did it that way? | |
Re: You don't need line 22. Also, in line 25, you should have j<side as well. | |
Re: 1)What does your 'node' class look like? 2)Because you use both 'head' and 'tail' while you don't completely understand linked list, you make a big mistake when you create a linked list. 3)You are not supposed to create a linked list inside its class! Do the creation outside the class. … | |
Re: Yes and no. It depends on where you declare the 'list' (not 'List') variable. If the variable is visible in the scope, you can call it in the function; otherwise, you will get an error when you compile your code. You should read about variable scope. [CODE] ///////////////// // 1st … | |
Re: Line 43, you assign value to cel = 0, and then you use it in line 44, you display the text accepted by the user and the cel (0). What you need to do is to accept the text from the user, convert it to whatever value you are supposed … | |
Re: OK, is each string line format always that way? I mean grade which may or may not followed by a sign(+/-), and then a number? If so, what you need is to read in as a line string. Then use split() to split the string using white space as delimiter … | |
Re: Line 15-17 and 19-21, you can just do... [CODE] var sideAsqrd = A*A; var sideBsqrd = B*B; var sideCsqrd = C*C; var AB = A + B;//side A + B to check if a triangle can be formed var AC = A + C;//side A + C var BC = … | |
Re: You need to swap sum+=ctr; line with ctr++;. Because you increase the counter before you add it, you are adding 2+3+...+11 instead of 1+2+...+10. | |
Re: And if it is wrong, what do you do? Your code does nothing but set visibility to false after one answers. Not sure why... | |
Re: Be careful! In your toString() for Reservation class, you did not initialize 'name' but use it in the method. Also, why do you need to return data after readFile()? Somehow, your data length is greater than 1. As a result, it goes into the loop when you call Sort() and … | |
Re: When time complexity is that way, it is usually related to recursive function (easier to explain). I do not have 5^n example but I have 2^n which is similar (constant^n). Check the fibonaci function time complexity. It has base case: n = 1 assume: T(n-1) = O(2n-1), therefore T(n) = … | |
Re: Looks like your 'fine' is a class's variable. When do you call returnTotalFine()? Have you called it before you call getTicket() in your first post, so the fine is computed before it is being compared? | |
Re: Ach, please use the [ code ] tag to post your code portion. It is very difficult to read a long code without the tag. :( Anyway, you want to get the newest and oldest message of a user by specifying a user name? The way you add messages is … | |
Re: I don't know what you are trying to do in your code? First, do you completely understand the problem before you attempt to implement it? Second, do you understand how a linked list is created & maintained? Last, your variable names are not meaningful; as a result, it is very … | |
Re: Line 59 to 62, you ask to get user input, but where do you store them? Also, you don't have pepperoni and cheese initialized but use them in your total cost calculation? | |
Re: This is too long code and is not inside a code tag... Anyway, it seems that people are having problem with read/write file in Borland. Not sure if this [URL="http://www.yevol.com/bcb/Lesson08.htm"]link[/URL] would help... | |
Re: Why do you allow user to pass a number for popping or peeking? When you pop, you always pop the one on the top (or at the bottom in your implementation), and the same is with peek. The only think you need to check when you do pop/peek is the … | |
Re: Well, the only way to do is on Mac box even though it is Java... Not sure if you can do it on your window or linux box. |
The End.