2,040 Posted Topics
Re: It may be possible on FF using CSS but not sure about IE. Try this... [CODE] <style type="text/css"> .optionImg1 { background-image: url('image/path'); } .optionImg2 { background-image: url('image/path'); } </style> // in HTML <select> <option class="optionImg1">Option 1</option> <option class="optionImg2">Option 2</option> </select> [/CODE] | |
Re: @ajst I understand that it could help but it is not worth it. In big O time, it is still the same. If you really want to reduce the computation, why don't you use square root of x? You should have found a factor of a number before the number's … | |
Re: @kvass [i]einjelle[/i] has his math right on the first one but not the second. But his computation is NOT the same as computer computation because of mathematical operation preference. In math, if you do not give parenthesis to your expression, every operation has the same preference. Therefore, it is ambiguous … | |
Re: Please show your code. Also, don't forget to put your code in the [ code ] tag provided by the forum. | |
Re: You didn't use setSelectedFile(File) but you use getSelectedFile()??? Then what file are you actually selecting? Here is the JFileChooser [URL="http://download.oracle.com/javase/6/docs/api/javax/swing/JFileChooser.html"]API[/URL]. | |
Re: The link won't explain in depth about how to deal with button on JTable, believe me. I worked on it before. It shows you how to display a button, but the button itself does not work as a button. You need to add a listener to the button yourself because … | |
Re: Reading a file from local and reading a file on a webpage are 2 different approaches. Also, you should create a new thread instead of revive an old thread... | |
Re: @prem2 [I]masijade [/I]has already mentioned the replace() method of String class. You can use that to replace the string. For example, "d00000\n00000d".replace("\\n", "") will result in "d0000000000d" string. | |
![]() | Re: Do you have to implement your own sort() method? If you do, then you need to pick a sort algorithm (i.e. bubble sort, gnome sort, etc.) before you can do the sort. If you do not, use those Collection or Array methods as [I]mKorbel[/I] and [I]stultuske[/I] provided. |
Re: If you look at the code, line 10-11 are exactly the same as line 25-26. That's an error from copy & paste. I would suggest to change the z-index to higher when it is increasing regardless what it is, and change it to 0 when decreasing. Also, change your CSS … | |
Re: If your image has not been loaded to the view (HTML), changing your placeholder image src won't do anything. If you want, you could put all those images on to the HTML but hide them (display:none;visibility:hidden). Then the placeholder should display the image when its src is changed. | |
Re: Be very careful when you use float & int together. If you have float on your left hand side, you won't get a float when you use int in computation. Use double in place of float would make things easier but the rule is still the same. [CODE] float f; … | |
Re: Hmm... Why would you put the BigCorp class in the package as well while you are going to use it? You may delete the package from the BigCorp class and move the class up one folder level. Then import those 2 classes from the package [CODE] import BigCorp.Person; import BigCorp.Employee; … | |
Re: @Pnorq Your function is correct, but there are a lot going on. :) @kalleanka Use regular expression and replace() function. [CODE] var str = "xxx, yyy, zzz, sss,"; str = str.replace(/,\s*(\w+),\s*$/, "and $1") // Done! Case for any more than 1 -> xxx, yyy, str = str.replace(/,\s*$/, "") // Done! … | |
Re: You could start from replacing word by word. In a string, you attempt to search for the longest match first. For example... [CODE] cry -> aWordInYourLanguage cry out -> anotherWordInYourLanguage <== match this one first [/CODE] I think google also let those who own the language help them adding the … | |
Re: Did you open your file in the append mode? If you just open to write, by default it is overwritten mode. | |
Re: What is your current logic to the problem? I can give you a hint, use a search and iterate through the area until no more connected 1's is found. Don't forget to keep track of where you have already visited. The method could be recursive (easy to implement) or iterative … | |
Re: In line 5, you are expecting an element with name "workArea" but you are calling check2() with it? Where is your "workArea" element? | |
Re: One way to do is to store all the file content somewhere (in the memory if the file is not too big), manipulate the content (delete certain text), and then rewrite the content to file as new (replace the whole file content with the content in the memory or wherever … | |
Re: If you want to assign a value to each of your array while you are going through a loop, it would be easier to look at when you move the row loop to be inside the col loop. Also, you need to control the column position where you want to … | |
Re: You may need 'frame' or 'iframe' to load another HTML into your page. However, you will loose certain access functionalities using 'frame' or 'iframe' due to security. | |
Re: So you have Airplanes and Airports, but the Airplanes could have multiple attributes. Some of these attributes are mutual exclusive and some are shared. Question... Do both military and civil plane consist of cargo and passenger types? Not sure about what you said above. | |
Re: Hmm... Your event attached is incorrect. You try to attach Out() function but did not attach parameter to the function. As a result, it is ambiguous. I am not really sure here because I forgot how to use this closure function... Anyway, could you try... [CODE] if(img.addEventListener){ img.addEventListener('mouseout', function(evt) { … | |
Re: Each assembly compiler may be fit to certain architecture. Can't just say 'assembly' and can be used it all computer architectures nowadays. I did only MIPS32, MS Assembler, and the other one I cannot remember its name... Also, I am sure that assembly will help you understand atomic better when … | |
Re: Align what script??? I am not sure what you mean by 'aligning' the script? You mean the display HTML part? By the way, this is not going to work... Your code is too much and it would not help at all even in code tag. You may need to look … | |
Re: If your element is inside a div and the div is 100% in width, margin-left: auto; to your inner element should do it. If it is just an element inside a body tag or inside a div which does not have a width value specify, it won't work. | |
Re: You are close. You still need to verify the 'n' value first. And then you need to validate the grade with more than just less than 0. The requirement states that it must be between 0 and 100. Then, you need to keep track of how many number the user … | |
Re: It is possible if your site A accept the parameter via GET method. If so, you could construct a link and call the link instead of post. Though, it could be impossible if your data is very long or requires a lot of escaping... | |
Re: It seems that your server does not accept certain code format. It started after line 29 of your code. Could you try to delete the new line for your line 25 and 26 in the window.open(....) and make them to be one line instead? | |
Re: You computed points in line 250 & 251, but you did not put the points back to your "points" input tag value? By the way, there is a bug in your page. I didn't try to look at it but this is how I created it. 1.Open the page 2.Play … | |
Re: Not sure. Does it mean that a node could have multiple parents with multiple children OR have one parent with multiple children? Would it possibly become a circle? You could use ArrayList to store parent/children depending on your data. However, be very careful! Circle is dangerous for a linked list! | |
Re: Hmm.. I think it is IDE problem, it is not Java problem. You may look at [URL="http://netbeans.org/kb/docs/java/project-setup.html"]this[/URL] or another one is [URL="http://www.lampos.net/netbeans"]this[/URL] for further information about NetBeans import libraries. | |
Re: Hmm... Maybe you should read how to use Google map [URL="http://code.google.com/apis/maps/index.html"]API[/URL]? And you need to [URL="http://code.google.com/apis/maps/signup.html"]sign up[/URL] for a key to use it too for their own security (dns attack); otherwise, it won't let you use it. I can't tell you more because it depends on how you implement your … | |
Re: OK, your way is called 'hard-coded'. In other words, it is not flexible and your function is expecting the form element with name 'myform1'. If you pass in an argument of the DOM form to the function, it is much more flexible to deal with because the function can be … | |
Re: As Shanti said, the fix is to escape your double quotation in your string. The way you do creates an unterminated string. [CODE] /* document.writeln("<tr><td style="background-color:#FFFF00;">" + "test" + "</td></tr>"); |----------------|--------------|-------------------------|-| ^ ^ ^ ^ ^ ^ | | | ^ | | start start end expect start command string … ![]() | |
Re: Hmm... Obscure question. :P Is the interest computed at the end of each year or each month or each week or each day? :D Does the answer have to be in a whole year or decimal or year & month & day? ;) | |
Re: Line 35 in class Expression, you are missing semicolon at the end. [CODE] istream& inStream //inout [/CODE] | |
Re: You should google it... A sample I google for read/write file is [URL="http://www.javapractices.com/topic/TopicAction.do?Id=42"]here[/URL]. To concatenate files, the easiest way is to read the whole content of one file to your class variable and read the other to concatenate the already read content in your class variable, and then write the … | |
Re: You could get JavaScript library for it on the Internet for free. Use google to search for 'WYSIWYG editor javascript' and you should see many. I've been using [URL="http://tinymce.moxiecode.com/"]tinyMCE[/URL]. There are many others but the way to use them is a bit different from one another. | |
Re: In raw JavaScript, you need to remove all option elements inside your target combo box, and then repopulate options by creating option elements & append them to the target combo box. ![]() | |
Re: Hmm... What version of your Ruby? I believe it has to be at least 1.87 or higher, or maybe even 1.9... How did you install it? What platform are you using? | |
Re: You do not need to use backspace to go back to certain pages, but you just use the browser's cache (if what it is called this) instead. Each visited page is saved in a hash. Be careful, the way to deal with IE browser compared to other standard browsers may … | |
Re: Hmm... But go back to your original question, the last key to terminate or let the program to compute is still 'Enter' key not '=', isn't it? You are using 'nextLine()' and that's the reason why you cannot make it work. You need to read in each character and keep … | |
Re: I thought that the select tag would send only the value you selected if it is not a multiple selection? Hmm... Haven't played with Servlet for almost a year... Need to recall it... | |
Re: OK, you have 2 choices to do this - in JavaScript or SVG. If you are going to do it in JavaScript, it will be a bit difficult and may be slow because JavaScript is not for graphic rendering. You could check [URL="http://javascript.open-libraries.com/utilities/drawing/10-best-javascript-drawing-and-canvas-libraries/"]this link[/URL] for further javascript library you may … | |
Re: OK... The easiest way is using split() of String method... [CODE] public static void main(String[] args) { String a = "Phillips"; String[] b = a.split(""); for (int i=0; i<b.length; i++) { System.out.print(b[i]+" "); } } [/CODE] | |
Re: Instead of trying to make it work, you should redesign your application. It does not make sense to have a drop down list with check boxes in it... If you are doing that, it would be very confuse to users anyway... Also, please use good English (or understandable) when you … | |
Re: Hmm... Just give you a sample here for the future... [CODE] function replaceAllIndexPHP() { var elems = document.getElementsByTagName("a") for (var i=elems.length-1; i>=0; i--) { elems[i].href = elems[i].href.replace(/index\.php\?view=/i, "#") } } [/CODE] | |
Re: Sometimes your loop may look like... [CODE] while (true) { } [/CODE] This is a special case. Normally the loop is intended to keep going until a certain condition is met which is at an unknown time. Often times, you would find this in concurrent programming. In this case, you … | |
Re: Hmm... Why can't you use regex? What is the problem with it? [CODE] String str = ""e;This is just something&# 39;"; str = str.replaceAll(/"e;/, "\""); // or str = str.replaceAll(/\&# 39;/, "'"); // shouldn't have space as you said [/CODE] And if you want it to cover all HTML code, … |
The End.