2,040 Posted Topics
Re: You do not understand how a program works. This may be a bit of trouble to explain to you... OK, let me try by looking at your code inside the main() method. [CODE] // Declaration Part: // What you do here is to declare what variables and their type to … | |
Re: Think about it in real life first. How do you count number of item purchased? Each time an item is ringed (scanned), the number of item is increased by 1, correct? Now, which method in the CashRegister class is represented as ringing up an item? If you found it, what … | |
Re: You cannot simply use subList[i].BubbleSort(); like that. The class SubScriber does not know how other class is using its definition. The class that implements an array of SubScriber must do the job. What you may want to do is to create a class or a method to do the sort. … | |
Re: If you are going to use determinant to compute inverse matrix, write it down by hand and see how it is done first. Then you should get some idea about what you should proceed... | |
![]() | Re: If you are talking about accessing database while browsing, yes and no for only JavaScript. Of course, you would need Ajax (which is Asynchronous Java Script And XML) to deal with dynamic database accessing between client & server. Now, I am not sure about "isn't block by browsers, but restricts … |
Re: Why don't you cout reg_confirm in your else statement to see why reg_confirm doesn't match or null? | |
Re: As Alemonteiro said, JavaScript alone can't do it. You may need a plug-in to help JavaScript. This site [url]http://www.xarg.org/project/jquery-webcam-plugin/[/url] may be some thing you would be interested in. Or you could look at this [url]http://www.ajaxcam.com/[/url] to see how the person did it. | |
Re: I agree with Momerath, but my explanation is that if the criteria is not discrete (in this case, it is a range) and they are not the same type (in this case is a mixed of clock time, number of calls, and minutes), if-else statement will be the answer. | |
Re: Hmm... Do you think log(nlogn) is equal to (logn)(logn)??? By the way the value of a factorial will eventually be bigger than polynomial anyway. If what you wrote is right, it becomes wrong (not bounded) when c<x. | |
Re: If you want only the specifically check only acctNum.getText().length()!=10, you could take the if out and use if-elseif-else statement instead of use only if-else statement. :) [CODE] if (...) { // check for the length } else if ( ... ) { // the rest of checking } else { … | |
Re: Look at what js libraries the page is included... [CODE] <script type="text/javascript" src="js/mootools-1.2-core-nc.js"></script> <script type="text/javascript" src="js/mootools-1.2-more.js"></script> <script type="text/javascript" src="js/excanvas.js"></script> <script type="text/javascript" src="js/moocirclepack.js"></script> [/CODE] Do you have all of those library files (.js) in your "js" folder where the HTML file is located? If not, you won't be able to display … | |
Re: I agree with gusano79. What you really need to do here is to come up with rules to obtain 2 end points of each line you are going to display. You could use tangent, maybe? | |
Re: Better yet... str.split(/\s*,\s*/) which will get rid of white spaces before and after comma... This would take care of "ab,c, de , g,h,i" as an array with elements ["ab", "c", "de", "g", "h", "i"] instead of ["ab", "c", " de ", " g", "h", i"] as the suggested above post. … | |
Re: If you are using JavaScript to display images, it must be either all images are loaded or you call the server to render the HTML portion with image. Please remember that JavaScript is client side and will read only the current loaded data of the page. The page cannot display … | |
Re: Do you ensure that you download a correct version? Also, did you try to redownload? What platform are you using? What Java are you using? | |
Re: What Chrome version are you using? It could be a bug as [url]http://code.google.com/p/chromium/issues/detail?id=3607[/url] Also, you should be able to format your own display. Don't use their default toString() as you are using now. | |
Re: Are you talking about programming stand point or command line? I don't think there is a command line for that as in UNIX. If it is programming, it depends on your input. If it is just pure String, you can implement a static class/method using replaceAll() with regular expression. If … | |
Re: Certain syntax and functions exist in C++ but not in C, and vice versa. What you need to do is to compile it and see where the error is. Then look for a substitute to the syntax or function to replace with... No, I am not going to do it … | |
Re: If you do the normal submit, the page will reload. What you need is Ajax part to do the submission for you, so that your page will not reload but only a portion of what you want will be reloaded. I'm not familiar with JQuery to use Ajax. You may … | |
Re: Not sure if you need to add a quotation around the $teamH??? Haven't done PHP for over 4 years... | |
Re: First, forget about GUI and work on the mechanism of the core. Once you can get a correct output, incorporate GUI using the return output from the core in the way you like... Is that what you are looking for how you can go? ;) | |
Re: In Java, collection is a little bit different from what you are showing here. Also, it depends on how you implement recursive. You could add the value and call recursive function, or you call the function and let it return what you want back to you. Anyway, a simple idea … | |
Re: If you dynamically add element to a page, you should use something that can dynamically search elements on the page as well. In this case, a simple way is to use document.getElementsByTagName("input") and then check for the same "name" you just add. However, the way you add will create duplicated … | |
Re: And what other things else did you see when you ran your program? | |
Re: I'm trying to follow your code here... [CODE] for (; ; ) { while (nodePtr) { // count the depth of 'left-hand' nodes s.push(nodePtr); if (s.size() > depth) depth = s.size(); nodePtr=nodePtr->left; } // problem here, if the tree has only "right hand" node, it will prematurely break if (s.empty()) … | |
Re: Hmm... I'm very confuse about what [b]K[/b] requirement is? Can you give an example of N and K values that could satisfy your result? At the moment, it is very obscured to me. What you are doing would go into an infinite loop too. [CODE] // Let's talk about your … | |
Re: No, but a certain plug-in on a certain browser (such as FF) may allow you to do so. The reason is that when a page is done loading, the script would have already been called and finished. As a result, normally you have no control until scripts have done their … | |
Re: At line 8, if you want to loop n time, you should start your variable from 0 to n-1 as [CODE]for (int i=0; i<n; i++)[/CODE] The way you do right now is from 1 to n-1. For your variable "x" you should use "int" instead of "double" and then cast … | |
Re: There is a library to be include. Not sure what it is called... Something that has sys/... in it. | |
Re: What NormR1 said was this line [CODE]if (gender==m && height>72)[/CODE] change it to [CODE]if (gender=="m" && height>72)[/CODE] and you need to update all other 3 more where gender==m is. You could also use [CODE]if (gender.equals("m") && height>72)[/CODE] that will be safer in general but not in your case. But with … | |
Re: So what the relationship among all listbox here? Do you have any certain rules, such as listbox1 + listbox2 + listbox3 - listbox4? Do you have a separate output display element after you done with it? | |
Re: The algorithm to produce a valid solution depends on how your data structure is going to be. Do you concern about the speed or space? Brute force would be the easiest way but not really good for this. What you may need to think about could be as followed: 1)Start … | |
Re: Sorry... What is isprint() function for? From my first glance, you didn't save any chars while you are masking the incoming string... | |
Re: What I don't understand is that why the book gives an example which does not really show the efficiency of the switch-statement. This example could easily be done and easier to understand using if-else statement... | |
Re: You could keep your total credit hours & total credit earned outside the "for" loop. Also, the display line should definitely be outside the loop. Then, you can compute the GPA after you done collecting data. [CODE] /* Example... Student A enter 4 classes. Class 1 with 3 credit hours … | |
Re: I don't know Genshi, but normally a library file should be put in a specific folder of the frame work. It is not in the same location where HTML files are. Look for a folder in your frame work where other script are located. If you see a bunch of … | |
Re: And could you explain how it doesn't work? Not compile? Run time error? How do you produce the error or "not work"? I don't have C++ compiler on hand, so can't just do it for you. Sorry. | |
Re: I guess the way I do is different. Normally, I would start with the mechanism to accomplish the task without GUI first. In this case, I would implement and complete a class that can add a list of String, and return a reverse display as String. Then I will implement … | |
Re: Could you show us the algorithm written in the book? Is it similar to the pseudo code from [URL="http://en.wikipedia.org/wiki/Heapsort"]WikiPedia[/URL] (quoted below)? [CODE] /* function heapSort(a, count) is input: an unordered array a of length count (first place a in max-heap order) heapify(a, count) end := count-1 //in languages with zero-based … | |
Re: Eh? I don't really understand what you want here, sorry. There is a list below about why I don't understand you. 1) Are you trying to solve 1 or 2 problems in the same program? I don't see any relationship between arithmetic and friend/sibling/etc? 2) Why did you upload the … | |
Re: Actually, you should do the check on the server side. The reason is that JavaScript can be disabled and that would allow users to go directly to the page anyway. What you need to do is checking for log-in before you render the page. If the user has not logged … | |
Re: To read value from an array... [CODE] // Let say newarr contains [1, 2, 3, 4] var c=0 for (var j=0; j<newarr.length; j++) { c += newarr[j] // add each value in newarr to c } // if all elements in newarr are integer, you will get 10 // if … | |
Re: If the display is in a frame, Firebug should still allow you to see the code in HTML. Right click on the frame and there should be an option for you to select and do something with it. | |
Re: Struts is a web frame work using Java as back end. I am not sure this forum is the right one for you to ask questions related more toward web frame work. Also, how much do you know about Struts in term of the frame work, not the Java language? | |
Re: I took the code and tried it, it worked fine for me. Though, I got an error when compiled after I just copied and pasted the code because my box is Linux. I need to change the code from [CODE]fr = new FileReader(path+"\\"+files);[/CODE] to [CODE]fr = new FileReader(path+"/"+files);[/CODE] in order … | |
Re: Hmm... Not sure... in line 22 [CODE]private final Context myContext;[/CODE] You put "final" to your myContext variable but then you attempt to assign a value to it in the constructor??? | |
Re: Do you have anything inside any column of the table? And how did you specify your CSS? IE has different box model and could render differently too. |
The End.