2,040 Posted Topics
Re: Could we see your script? Not sure how you did it. By the way, when you do the selection, did you attempt to check the DOM for parent/neighbor nodes instead of only the text selection? | |
Re: You need to solve the problem in maths first before you attempt to do the programming. Now, let's look at how math problem is like... 1) What the problem is asking for? If you still don't know, a key word is "sum" of something. 2) How each item price is … | |
Re: The code is not intuitive at all; besides, there are "for" loop in place of "while" loop... Not a good practice... Anyway, the break statement will stop only the inner most loop, but will not stop the infinite loop which is from the "n" variable. Why? Because "checker" variable will … | |
Re: Just a quick question, does your tracker count "refresh" page as well? Also, does it prevent web crawlers too? I'm not sure that the page your Ajax sent back is a valid web page to be called by a simple request for the page... | |
Re: > two letters, a hyphen, last two digits of the year its from, another hyphen, then 3 letters What other criteria or restriction of those set of letters/numbers? The simpliest way to check string is to use regular expression. It may be a bit over your head for now, but … | |
Re: Try to change the CSS definition to... .hover{ display: inline-block; position: absolute; background: transparent url(images/menu_bg.png) center no-repeat; } Then see what happen? | |
Re: Huh? Too broad question. Please be more specific? A Java bean? :P | |
Re: Line 35 & 54, unreachable statements -- no need to be in there. When you have if-else statement and both return a value, any codes below it will be unreachable. As pritaeas said, inner most of your if-condition should return something, or the last statement (return false) will be executed. | |
Re: Your requirement is not clear. 1)When you said automatically calculate the total of addition, does it mean each time you type in a number? Or each time you change the whole number? Or each time you click a button? 2)Where is your HTML? | |
Re: First, you need to design how you want your number display to be. For example, you could force each display number as a block (4 characters). Then replace your line 40 with a block of code or a display function to display the number as a block. In other words, … | |
Re: Do you want the replacement to be in the same 'div'? If so, you could 'hard-coded' the function; otherwise, pass in the div ID you want it to be replaced to (below). // Be careful, this function does NOT verify incoming arguments. // If element of divId does not exist, … | |
Re: As James said, a Date object no longer handle date the way you want. Even parse() method of Date class is deprecated. You can look at the [SimpleDateFormat API](http://docs.oracle.com/javase/6/docs/api/java/text/SimpleDateFormat.html). | |
Re: > but in c++ we use <iostream.h> and <conio.h> where we use cin and cout from these libraray functions but we dont inherit anything .we use normally we dont write like class base:public derieved there is no inheriting property Yes, you can write OO programming in C++ as well. Even … | |
Re: You should keep a boolean flag as a member variable inside your keyboard listener. It should work similar to "shift," "ctrl," and "alt" keys. If a specific key is pressed, turn the flag to true. Then when the next key is pressed, check whether the specific key flag is true. … | |
Re: If you are talking about dynamically create an Object (class) in Java with user-defined name, you cannot do that. If you are talking about dynamically assign an attribute (or is being called as variable) of an object (class) with user-defined value, then it is possible. // sample class object named … | |
Re: The way you use your condition is wrong. One equal sign means "assign" but two equal sings means "comparison" of 2 values. In your case cameraImage= should be cameraImage==. | |
Re: Sorry, I'm not sure what you really want. Do you have an existing page with an existing iframe element with the said URL? Do you want to replace the "CURRENT+WEBSITE+URL+HERE" text from a current existing iframe URL? | |
Re: You need to understand what "currentStudent" variable is being used in the script. In your case, it is an array index. It seems that you do not understand or have knowledge about array. You need to look it up for its fundamental concept online now before you go any further. … | |
Re: Your alphabet validation is wrong and that will always return false. The reason is that line 39 and so on will be guaranteed that the j!=checkOK.length because the lenght of checkOK is always 27 and it will be true if and only if your character is '_' (an other checks … | |
Re: If you look closely, there are a couple things in your code that are off. 1) Start from looking at line 60, what are you doing there? What is the consequence of doing that? 2) Look at how you use the loop to display your array value at line 53. … | |
Re: If you are looking for uploading from a command line with FTP, you can check FTPClient class from apache (org.apache.commons.net.ftp.FTPClient) for uploading. Remember that it reads only ASCII file type. If you want a web interface, JSP is also a way to go. | |
Re: You are confusing between front-end and back-end unless you are thinking about Java applet. Still, I think this forum is for Java core, not for a website unless (again) you are talking about the back-end algorithm. To answer your question, yes you can do JSPs for the front-end (display) of … | |
Re: Stop reviving old thread! Look at the last date posted before replying. Also, your code is not completed + not in a code tag! | |
Re: So the value in the middle of each line will be 2^(n-1)? What is the maximum you accept for the value of n? Because the n will be used to determine the height of the pyramid. Also, the value in the middle could have different length. How would you deal … | |
Re: ... Reply to your own thread instead of create a new one... Try the code below... Not sure if it is working because I didn't test. [CODE] import javax.swing.*; import java.awt.*; public class Ejer1 { public static void main(String [] args){ JTextArea jt = new JTextArea(); jt.setText("Set it this way"); … | |
Re: If you have specified a class for the element, you could simply do it as... [CODE] .myclass { color: black; } .myclass a:link { color: black; } .myclass a:hover { color: black; } .myclass a:active { color: black; } .myclass a:visited { color: black; } [/CODE] It is depending on … | |
Re: The implementation is tricky depending on how you want it to be. Do you have to implement the tree using only one ArrayList? Are you allowed to implement your own class to act as a tree node/leaf? Is there any constraints to the ArrayList you can make (i.e. limitation of … | |
Re: It is not really. What you need now is to get the width & height of the applet window every time right before you draw those ovals. The only relative X, Y position that may need to be added is when the size of applet is very close to your … | |
Re: Can you retrieve each image frame from the video? That's the first thing you need to do. After you can obtain each image frame, there are many ways to do the object detection in an image. However, there are many factors you may need to restrict your detection rules. How … | |
Re: You are passing a NULL value [icode]node *x=NULL;[/icode] to the insert() function. Then in your insert() function, you attempt to access "next" from the NULL pointer? That's the problem. They are all NULL. Do you have to pass in a node pointer to the insert() function? Is that one of … | |
Re: What you are doing is fine if you call the function only once. There are a couple things to be modified though... [CODE] function squareCube(selectRowNum, selectPower) { var rowNumber=10; // default is 10 var powNumber=3; // default power is 3 // if the value is a number and greater than … | |
Re: How do you want to validate the content? Do you want to validate on submission? Do you want to validate each of them while data is being entered? Or do you want to validate after the content in each box is changed? Please be more specific when you ask a … | |
Re: Old thread... It's annoying to see old thread gets revived for nothing... Also, I usually use setTimeout() function to deal with sleep/wait anyway. | |
Re: If you are asking for an algorithm, Knuth-Morris-Pratt algorithm is a good algorithm to search a substring in another string ([URL="http://en.wikipedia.org/wiki/Knuth%E2%80%93Morris%E2%80%93Pratt_algorithm"]http://en.wikipedia.org/wiki/Knuth%E2%80%93Morris%E2%80%93Pratt_algorithm[/URL]). You can search for other algorithm as well, but this algorithm is very easy to understand to me. | |
Re: You gave only fragment of codes with no comment. Anyway, after looking at your code, I have some unclear points with your code. 1)Why do you start your weight queue in descending order? Don't you need to do it in ascending order? 2)I am not sure why you need only … | |
Re: Huh? You already have the method to call for the total time for service in your Register class. What you need is to implement it by iterating through all of the customer in its own line, add all the customer's service time - getServiceTime() - and return the total value. … | |
Re: If you want an offer only once, you need the server side database. Cookies can be tampered and/or delete. You will be offering special price all the time if you use cookies. ![]() | |
Re: A few comment on your condition check... [CODE]if (strings[1] != stan && new File(files[1]).exists())[/CODE] What are "strings[1]" and "stan"? Are they String? If so, you should not use "!=" to compare but equals() method instead (as strings[1].equals(stan)). Also, what is in "files[1]"? Is it a file name or is it … | |
Re: The script replaces the original link of anchor tag ('new_file.htm') with movie link. If Javascript is off, the script will not replace the link -- the original link is used. | |
Re: I guess your set up for project properties is not correct. Look at these 2 posts from other forum [URL="http://www.velocityreviews.com/forums/t141385-how-to-create-executable-jar-in-netbeans-ide.html"]http://www.velocityreviews.com/forums/t141385-how-to-create-executable-jar-in-netbeans-ide.html[/URL] and [URL="http://forums.netbeans.org/topic12864.html&highlight="]http://forums.netbeans.org/topic12864.html&highlight=[/URL]. You may see your mistake? | |
Re: When you are talking about "slow" computer, what is the specification for that? Java also relies on memory (for JVM). So if you are talking about 486 with 66 MHz and 32 MB of RAM (I still have it tuck away in my attic :(), then it is still OK … | |
Re: How about adding z-index style to your menu? | |
Re: 1)Define a function with similar structure as your "main()" method, but the return value is "double" instead of "int" and the arguments in the parenthesis must match the incoming type of Amount, Rate, and Year. 2)Copy the whole part where you make the mark and put them inside the newly … | |
Re: In my opinion, it should be BigTheta(n^2) still. If we take a look at the average case time complexity equation, it becomes (n^2+n)/2. The upper bound is O(n^2) for sure and the lower bound is BigOmega(n). If you are talking about Big Theta of an average case, the value which … | |
Re: I don't know what "else" you are talking about. Please post the content instead of link to a file... Also, do not expect that people here will do it for you. You need to show your afford and your code first. | |
Re: In firefox, you may need...[CODE]document.getElementById('elm2').style.height = 600+"px"[/CODE] But that could break IE8 and below... So you may need to check for what browser it is being viewed from. | |
Re: The first function gives you more flexibility and ease in calling and passing variables. The second is an inline which has more control but at the same time is more difficult to construct especially when you need to pass in variables. It is good to use the call as a … | |
Re: You could use screen.width & screen.height to check for resolution. However, this doesn't mean the size of window of the browser, but the whole screen size. | |
Re: You can try this oracle link [URL="http://download.oracle.com/javase/1,5.0/docs/guide/plugin/developer_guide/using_tags.html"]http://download.oracle.com/javase/1,5.0/docs/guide/plugin/developer_guide/using_tags.html[/URL]. |
The End.