2,040 Posted Topics
Re: Did you add the link right after the display? I do not know what you use in order to create the pop up. Would it be reading from the server? Please show me the code portion where you display the portion of the description after clicking on the flag. | |
![]() | Re: You could use compareTo() for string function. If compareTo() return -1, the string which calls the function is less than (shorter or alphabet comes before) the comparing string which is passed as an argument. It should find 0 or return -1 if it returns 1. [CODE] public int find(final String[] … |
Re: You need to attach the event to your page as well. You could attach the event at onload of body tag or you could simply run it. [CODE] function attachKeyEventToPage() { if (document.addEventListener) { // anything but IE // passing event to function as closure document.addEventListener("keydown", function(e) { convertEnterKey(e) }, … | |
Re: 1)Your variable 'myTime' should be declare without quotations. It is better to do it as integer rather than a string. 2)Your attempt to display time is odd. You must not hard-coded the prefix of the display or you would get it wrong no matter what. What you really need to … | |
Re: Hmm... That's one thing I missed from C++ in Java. :( @BroonoVilliam If you are allowed to use compareTo(), then go for it as [i]JamesCherill[/i] said. Otherwise, you may have to implement your own string comparison method. | |
Re: You are done with the reading data from file. :) The next step is to actually store the read-in data to a variable in order to do the sort & print out. Look at your FileLine class, you should have a constructor and class's variables. The constructor is to create … | |
Re: It's nice to see someone trying to share his/her idea. However, please be careful when you do this. First, your code works only on IE because other browsers do not have 'document.all' in JavaScript. Second, the way you implement CSS is a bit redundant. You could pull out the font-family … | |
Re: I am not sure how you want to 'hide' your menu item. In your doShow(), you hide it if it is being displayed when mouseover. Is that what you really want? In doHide(), I see nothing about hiding because you only remove the onFocus... Also, your code works only on … | |
Re: @sneha_mehta Your code handle only SQLException which is not complete. You still need to handle ClassNotFoundException which is the exception you got from your code... | |
Re: @new_developer Use regular expression to check. However, do you want to check that name has no number presented only? Are you sure about that? I will give you the solution for it first, and then I will tell you why you should not do it... [CODE] var str1 = "mystring" … | |
Re: (-_-) You are killing him in a long run... How would he actually learn how to implement? Reading other people's code doesn't really help learning but more on copying... Also, giving code like this would just keep leading him to your approach while his may not be this way at … | |
Re: It actually works, but the way you write out your array is wrong. You cannot print the array object out right if it is not char[]. You need to iterate through your array before you print out. [CODE] // change your line 31 to String taxes = "" for (int … | |
Re: Well, HTML and JavaScript are client side as [i]Luckychap[/i] said. If you are building a static web page (no database required), these two would be enough to build a web site. If you need to deal with database, then MySQL would be needed (unless you want to use other SQL … | |
Re: Why there are so many SIZE1??? Well, if I populate the random value, I may do it this way... [CODE] public static void main(String[] args) { final int SIZE1 = 100; //constant SIZE1 for the first array final int SIZE2 = 1000; //constant SIZE2 for the second array final int … | |
Re: Please post your code using 'code' tag. OK, here you go. 1)Are you creating 'Link' class as the inner class of your SingleLinkedCircular class? I don't think it is a good idea to put the 'Link' class inside your linked list. Take it out to be its own class. 2)You … | |
Re: You have to think what actually determines the value of '1' when the power is 0? In theory, if I remember correctly anything power to 0 is equal to 1 except 0. Therefore, when you go about looking for '1', you need to test for base==0 first, and then power==0. … | |
Re: [QUOTE]i dont know wat codes to be use! cause our professor just gave us that output and didnt teach us how to program that LIBRARY SYSTEM.. =( now where having some trouble in doing this project because all of my classmates are still newbie in programming... [/QUOTE] I am sure … | |
Re: Good for you to try to learn this. There are many rooms in your code for improvement, but I am not going to tell you all right now because it could be too much. Anyway, there are some immediate problem in the way you try. 1)Your trial image and ball … | |
Re: Because System.out.print() cannot be used right away inside a class! The class also needs a constructor. You need to put whatever you are doing inside another method for using later. In your main(), you cannot just call "new ATM();" but you need to assign it to a variable. I think … | |
Re: Is this JQuery or PHP??? Something doesn't look right. | |
Re: What you need to do is to create an Ajax link similar to [URL="http://www.alfajango.com/blog/rails-3-remote-links-and-forms/"]here[/URL] to send the selection to the server. Then in your controller, retrieve data and render a partial which will become the response to the client. In the partial, you can render whatever you like (a form … | |
Re: I agree with [i]JamesCherrill[/i] about the 'package'. It is annoying for me when I code something in a package and cannot test the class on its own main. I have to test it out from an outside class which imports the package class in. | |
Re: Hmm... Your solution is really a brute force. :P If you do it as stack-liked as [i]quuba[/i] said, it would be much easier and shorter. Also, you would go through the string only once, not twice - one for the whole string and the other for the array you created. … | |
Re: Ajax is just a JavaScript. If you know JavaScript, Ajax would be just another library you use. You can use w3school website tutorial. It looks fine to me. But if you want to get deeper, search on the Internet for more information. Ajax can deal with both xml and text. … | |
Re: May I see your code that you have done so far? | |
Re: [URL="http://download.oracle.com/javase/tutorial/"]Here[/URL] may be a good start. If you feel that the page is too intimidating, you may try [URL="http://www.freejavaguide.com/corejava.htm"]this one[/URL] instead. Still, you need to learn how to create a simple Java program, compile it, and run. Then, you can go on to the array part. :) | |
Re: The 'switch' statement cannot work with String type. It works with integer (or may be long) number only... By the way, this is not Java forum, it is JavaScript forum. Hope a moderator would move it to the right place... | |
Re: Hmm... You can do it that way in Javascript because the script is a weak type language. You could simply do like... [CODE] var multiDArray = new Array(); // then either push the array or assign it directly multiDArray.push(element1) // add the element to the end of array [element1] multiDArray[3] … | |
Re: 500 error means the problem occurs from your server side, not the browser or script code. Verify your server side code that it does not contain any error (when compile & run). There may be a certain input type that cause the exception in your server side code, and your … | |
![]() | Re: Please create a new thread for your own... Reviving almost 2 years old thread is not a good thing to do... Also, use the 'code' tag given by the forum to enhance your code display. |
Re: Why there are 3 loops??? Also, the curry brackets are not correct either... You should not post the code right way but rather tell them the algorithm or idea. Unless it is unclear, you could give some sample codes. | |
Re: @javaAddict I think it is not really too difficult because a beginner should be taught about the thinking process before starting to code. Or may be they have changed the way they teach in school about how to do the programming??? :( | |
Re: Even though your code may be working, there is an unsafe part which should not be implied this way... [CODE] int [][] Board= new int [15][15]; for(int r=0;r<Board.length;r++) { for(int c=0;c<Board.length;c++) { // <-- Dangerous!!! // should at least do for(int c=0; c<Board[r].length; c++) { System.out.print(" "+"_"+" "); } System.out.println(); … | |
Re: Hmm... Interesting there... Looks challenging for me to find the solution. Haven't done MIPS for 3+ years... The memory allocation is somewhat confusing but not too difficult to learn. I have already forgotten all of them though. :( #2 - If you use SPIM, you should see all the memory … | |
Re: As LuckyHarp said, your problem started at line 20 in your 2nd code portion. If you really look at the color enhancement of the code block, you should at least see something is wrong there. You are incorrectly composing your string while you want to write out in document.write(). As … | |
Re: Eh??? I am not sure what you mean here??? Also, why would it relate to Java??? Could you please explain again about this??? Are you saying you are attempting to open a java file to see its source code? Or you want to run a java class? | |
Re: You could use HashMap, but it depends on how you want it to be. In your given example, it would work perfectly (string size of 2 for the key). However, if you have to use an ArrayList, just sort the array when you insert a new element. [CODE] ArrayList<String> list … | |
Re: If I understand what you want, it means that you need to create another class which may or may not extend from the existing class. I would prefer not to extend but use it inside your new implemented class. The existing class object will become one of your class's variable … | |
Re: What you are doing right now is not using Ajax. You just submit the form to index.php and let it reload the page (index.php) again. If you are not going to use Ajax to deal with the display, you could send the parameter back to view in PHP, and then … | |
Re: Just implement the button or link to call your server side. Then use your server side to create the Excel file and stream it back to client. | |
Re: Just have a flag which may call goUp. Then switch it when it hits your top or bottom value. [CODE] boolean goUp = true; int cnt = 0; for (int i=0; i<18; i++) { if (goUp) { cnt++; } else { cnt--; } System.out.println(cnt); if (cnt==3) { goUp = false; … | |
Re: Hmm... Maybe [URL="http://en.wikipedia.org/wiki/Neural_network"]this[/URL] and [URL="http://en.wikipedia.org/wiki/Backpropagation"]this[/URL] may help you to understand how to do it? | |
Re: I am very confused with variables you used in the subroutine arguments! You keep changing it around and there is no comment at all... At least comment each input argument and gives an expected output. If you are stuck, write a pseudo code first. It looks like your algorithm is … | |
Re: How do you add your 2nd combo box into your form? If you do not add it as real select/option tag (modify DOM), it may not pick up the value. | |
Re: Hmm... Do you really need double quotation when you run command line??? I never have it in my command line compilation. [CODE] //i.e. >javac -classpath foo.jar MyClass.java [/CODE] | |
Re: Manipulating with 'display' property alone may not achieve what you want because the element area will still be preserved in the display but not visible to the client. In other word, it will still have an empty area for you after it has been display once even though it is … | |
Re: The problem is in line 10 where you keep the while loop going on forever. Even though it is possible to do it, it does not make sense at all to do it in your case. And because the loop keeps going on, finally your 'length' value will be greater … | |
Re: Also, please do not REVIVE an old thread! Create your own... | |
Re: Hmm... I don't know where you get the 'width' and 'height' from... By the way, line 17, I am not sure that you need 'else if' for y because it looks like you should check x and y separately. In other word, shouldn't it be 'if' instead? |
The End.