2,040 Posted Topics
Re: If you already use an iterator, you should the iterator's method. The way you do (using for-loop from the list size) is unsafe and may cause problem. Use while(anIterator.hasNext()) is much safer. Now, are you sure that your addEnd() method is implemented correctly? If the result is unexpected, you may … | |
Re: Update lines 30~34 (remove the part `final JTextField`) because they are local & you added these local variables instead of the class variables. // should look similar to below t1 = new JTextField(10); t2 = new JTextField(10); t3 = new JTextField(10); t4 = new JTextField(10); t5 = new JTextField(10); Lines … | |
Re: Here is [an example](http://www.javapractices.com/topic/TopicAction.do?Id=62) of how to do the random number in Java (integer). From there, you should try to iterate through the array and categorize each value into your own bins (100 of them). | |
Re: In your find() line 109, you didn't check whether the *n* is null but attempt to access it right away. It is possible to be null if it is a leave without data. | |
Re: Just a side note. You could replace the pattern string in match() with a regular expression (regex), and that would give you a lot more usefulness. For example, `element.src.match("bulbon")` would attempt to match exactly "bulbon" word (case-sensitive). If you still want to make it case insensitive, you may have to … | |
Re: Even though I don't use JQuery, the syntax for line 17 looks odd. The [each()](http://api.jquery.com/each/) function could be applied to correct tag name, but not an element name or id? Am I wrong? You are attempting to go through elements with name/id "chestionar"? PS: Checking value with =='' allows a … | |
Re: Look back at your code, you could modify it to work with your new requirement. You already know how to use Scanner class. Instead of accepting integer using nextInt(), change it to nextLine() which will accept the whole line of user input as String. When you deal with each digit, … | |
Re: Your class format is incorrect. When you create a class with main() method and you want to test the class out, you should have the class constructor. Then you can implement other methods. Before you start coding, this [youtube video](http://www.youtube.com/watch?v=OL1xrsZAowM) (I searched on Google and it looks quite OK) may … | |
Re: You need to either upcase or downcase the input string before you test for palindrome. You could simply use toLowerCase() or toUpperCase() method to make all characters in the string to be either all lower or upper case. //i.e. str = scan.nextLine(); str = str.toLowerCase(); Line 22, `left<right` should be … | |
Re: It could be your GUI display. Can't really pin point anything unless I see some source code. | |
Re: And what part are you stuck? I don't know how to help you. | |
Re: The idea is to go through each pixel once, but work on filling into the pixel 4 times. In other words, you are enlarging it 4 times bigger than its original. It is difficult to explain in word, so I a'm going to show you how to do it with … | |
Re: A tree is not a search tree when it is used to store certain data that may not be comparable. For example, you want to store data that just need to fill into a tree with at most 3 branches. Though, the tree may require to know what the current … | |
Re: What does it mean by "not working"? How would we know what it is supposed to be? To be honest, I do not like the idea of using JavaScript to download files because of security issue. This is why browsers do not allow JavaScript in the first place (but Ajax … | |
Re: It would be declared as follows... public static ArrayList<A_CLASS_NAME> test() { // instantiate an empty array list of A_CLASS_NAME ArrayList<A_CLASS_NAME> theList = new ArrayList<A_CLASS_NAME>(); ... return theList; } | |
Re: Line 25, do you expect *user* to be on *streetNamesX* and *user2* to be on *streetNamesY* only? If that's the case, then this *if* statement would be OK. Though, you have gone through the loop but not keep the index. In other words, you are using a wrong loop format … | |
Re: What's wrong? You didn't tell us what the problem you are having. One thing I notice right away is that you have nothing in your main(), so you won't see anything when you run it. | |
Re: The background display in a table is from each table cell, not from the table itself. If you want to change the color, you need to change in each table cell (td), not from table tag. | |
Re: Line 9, you cannot declare an *int* as a method/function. Simply implement another method in your *rsa* class and name it something like *getPrimeNumberFromUser()* and return a prime number if the number entered by the user is valid. In other words, reimplement lines 9~33 in a method. Suggestions: 1) Your … | |
Re: Is MLM a Multi Level Marketing? What algorithm are you looking for? Please be more specific. What your current concept or idea you have so far? When you said *algorithm*, it could be any thing. You are talking about algorithm for data structure? Or you already have you data structure … | |
Re: It is obvious that you have no permission to access the folder. You need to check who (user) owns the current folder and what the permission is set to. PS: A script, to me, means it does not need to be compiled in order to run, such as Perl, Ruby, … | |
Re: It looks fine to me. My feeling is that your *last* variable is not stored correctly (the *last* variable is the same as the *first* variable node. However, you now need to debug what really happens. You could take lines 13~18 outside of the while loop. The reason is that … | |
Re: What is the error? What is the output before an exception is thrown? You may want [ListIterator](http://docs.oracle.com/javase/6/docs/api/java/util/ListIterator.html), not [Iterator](http://docs.oracle.com/javase/6/docs/api/java/util/Iterator.html). Iterator does NOT have previous() method. | |
Re: I'm also confused of what your code is supposed to do. You need to explain what your class is supposed to be doing, and how it is being used (under any circumstance). An example of input-output would be a very good start. Some comments on your current codes... Very important, … | |
Re: Line 8, try to change `personArray[j - 1].compare(temp) < 0` to `personArray[j - 1].compare(temp) > 0`. | |
Re: Line 15, you pop an object from the stack and do not store it, so it is gone if the value is not equal to the index you are comparing. You should *pop()* the object and store it in a variable before you do anything else. Because you pop one … | |
Re: A very simple solution is to use [regular expression](http://www.regular-expressions.info/) with matches() method of String class. You may need to read about what it is. It is not difficult, and you should try to understand it. It will be very helpful to you in the future when you deal with String. … | |
Re: A quick fix would be... (not very efficient) // change from this line a += values[j] + " "; // to if (!a.isEmpty()) { a += ","; } a += values[j]; | |
Re: You could simply implement everything because, to me, the project is not that big. The only part that needs to be incorporated is the content of the class. HTML5 already supports 3D rendering ([example](http://sixrevisions.com/web-development/how-to-create-an-html5-3d-engine/)). The animation part should be customized by you. If you already know JavaScript, it would be … | |
Re: Huh? Where is the code? By the way, the exception indicates that you are attempting to access the array at index 1, but the array contains only 0 or 1 index. /* An empty array has size of 0. There is no valid array index to access the array. The … | |
Re: What do you mean by "not working"? Does it mean that it doesn't correctly match or it doesn't display? I'm quite sure that your regex doesn't work in all cases because you are not utilizing regex advantages. If you are matching postal code that has multiple formats, you should attempt … | |
Re: Line 47 & 54, you declare variable *P* and *P1* (capital letters), but then later on you use *p* and *p1* (lower case letters) which is going to be null. In Java, variable name is case-sensitive. In other words, capital *P* is not equal to lower case letter *p*. You … | |
Re: Line 28, *hours* will never be equal to *counter*. The *hours* is incremented higher than *counter* before it can get out of the loop, so the *hours* variable will never be reset. The problem is that you excessively use **while** loop even though you do not need to. As a … | |
Re: Show us your effort that you are working on your assignment. | |
Re: You need *if*, *else if*, *else* statements, not only *if*. Currently, all punctuations will also be counted as consonent because they are not equal to any vowel. And if you use *else if* too, your *else* will cover all consonents (and special characters if you don't care). PS: I usually … | |
Re: Line 11, you need to compare x3,y3 with x1,y1 as well because there is a possibility that x1,y1 is the same as x3,y3. | |
Re: Line 10, do you have your own implemented of class *Int*? It should be *int*, not *Int*. Remember that all variable/class names Java are case-sensitive. PS: You have not done anything with the variable you created in your main() but expect the value to be updated??? | |
Re: In your server file line 40 and 43 Soutput = new ObjectOutputStream(socket.getOutputStream()); // line 40 Sinput = new ObjectInputStream(socket.getInputStream()); // line 43 Try this instead and let me know what happens... Soutput = new ObjectOutputStream(new BufferedOutputStream(socket.getOutputStream())); // line 40 Sinput = new ObjectInputStream(new BufferedInputStream(socket.getInputStream())); // line 43 Also, add the … | |
Re: You should install firebug plug-in when you work with Firefox. Anyway, here is the error given by the plug-in... ReferenceError: $ is not defined [Break On This Error] $(document).ready(function(){ filter.js (line 3) ReferenceError: $ is not defined [Break On This Error] $(window).load(function() { reset.js (line 2) | |
Re: @Agni, I don't think this is about programming, but it is about concept in computer science (something similar to formal methods and/or models). @israruva, *zeroliken* has already answered your question. Did you draw a diagram of the NFA yet? Use the diagram to determine the automata. | |
Re: Do you only want the ability to manipulate images while using any computer (or at school)? Would it be sufficient if you just use an online site to do that? Search Google with "image manipulation online" and you will see many website offer free online for image manipulation. Would that … | |
Re: What the error/exception are you getting? PS: this [link](http://www.daniweb.com/software-development/java/threads/129252/trying-to-use-javax.mail-to-send-e-mail) was posted 4 years ago and seems to be similar to what you are trying to do. | |
Re: You need a string for StringTokenizer. Then you define what delimiter you want the string to be split into token. You could look at this [link](http://www.mkyong.com/java/java-stringtokenizer-example/) for simple examples of how to use the class. PS: Your current main code would not pass compiler anyway because *telNo* is not declared … | |
Re: At first glance, you should use for-loop in the outside and while loop in the inside... I posted the exact algorithm in your original post in this [thread](http://www.daniweb.com/software-development/java/threads/436605/help-please-) (at the bottom most of the page). | |
Re: By glancing, you are returning nothing... `return this.num = newData.num;` is just an assignment of this.num... Do you want `return this.num == newData.num;` instead? Before going into definition, what does equal mean to you? When you deal with equals() method, it is very tricky because you have to think about … | |
Re: @vasile.manda, the post is 2 years old!!! Please do not hijack it but create a new post for your question. To answer your question, the first portion of the script is to obtain and compute a proper set of image size from the current client's display resolution. The second part, … | |
Re: I'm not sure what real-world applications you are looking for. Many in the open source are considered real-world? For example, this [declarative authentication](https://github.com/stffn/declarative_authorization) is a plug-in but a complete Rails web app. It is easy to use and integrate into your existing Rails app. I understand that it is difficult … | |
Re: Line 14, you initilise the **array** of ObjectQueue, but you have not instantiated the class object in the array. So each index in the array does not have an ObjectQueue object in it but null... You need to go through your array and instantiate each of the index. for (int … | |
Re: You need to look at the [Boolean API doc](http://docs.oracle.com/javase/6/docs/api/) which answers your question. It is one of the constructor of the class. By the way, Boolean class is a wrapper of primitive boolean. |
The End.