2,040 Posted Topics

Member Avatar for FUTURECompEng

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 …

Member Avatar for jalpesh_007
0
307
Member Avatar for anandschiru

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 …

Member Avatar for anandschiru
-1
281
Member Avatar for yalda.zand.35

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).

Member Avatar for Taywin
0
157
Member Avatar for nah094020

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.

Member Avatar for Taywin
0
217
Member Avatar for rubai

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 …

Member Avatar for Taywin
0
568
Member Avatar for Szabi Zsoldos

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 …

Member Avatar for Szabi Zsoldos
0
144
Member Avatar for akocnivek

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, …

Member Avatar for Taywin
0
167
Member Avatar for mcmanuel20
Re: HELP

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 …

Member Avatar for JamesCherrill
0
154
Member Avatar for babi.meloo

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 …

Member Avatar for JamesCherrill
0
2K
Member Avatar for Yarra

It could be your GUI display. Can't really pin point anything unless I see some source code.

Member Avatar for Yarra
0
149
Member Avatar for koppche
Member Avatar for Taywin
0
136
Member Avatar for Otter992

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 …

Member Avatar for Taywin
0
198
Member Avatar for nah094020

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 …

Member Avatar for Taywin
0
653
Member Avatar for alanlee9898

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 …

Member Avatar for alanlee9898
0
566
Member Avatar for efth

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; }

Member Avatar for efth
0
322
Member Avatar for utchia

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 …

Member Avatar for Taywin
0
139
Member Avatar for Kayla1993

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.

Member Avatar for Kayla1993
0
180
Member Avatar for eburlea

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.

Member Avatar for eburlea
0
24K
Member Avatar for nimmo

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 …

Member Avatar for Taywin
0
153
Member Avatar for sagaragrwal197

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 …

Member Avatar for Taywin
0
333
Member Avatar for alfiechiong

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, …

Member Avatar for Taywin
0
174
Member Avatar for taylor.mitchell.353

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 …

Member Avatar for Taywin
0
162
Member Avatar for RozenKristal

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.

Member Avatar for stultuske
0
271
Member Avatar for Seswing142

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, …

Member Avatar for Seswing142
0
98
Member Avatar for Yoink

Line 8, try to change `personArray[j - 1].compare(temp) < 0` to `personArray[j - 1].compare(temp) > 0`.

Member Avatar for Yoink
0
3K
Member Avatar for taylor.mitchell.353

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 …

Member Avatar for taylor.mitchell.353
0
333
Member Avatar for oneoderja

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. …

Member Avatar for Taywin
0
152
Member Avatar for anonb
Member Avatar for deben.salemme
0
137
Member Avatar for solomon_13000

A quick fix would be... (not very efficient) // change from this line a += values[j] + " "; // to if (!a.isEmpty()) { a += ","; } a += values[j];

Member Avatar for Taywin
0
115
Member Avatar for EonsNearby

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 …

Member Avatar for Taywin
0
109
Member Avatar for jcatrett5150

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 …

Member Avatar for Taywin
0
173
Member Avatar for millsy007

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 …

Member Avatar for Taywin
0
376
Member Avatar for anandschiru

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 …

Member Avatar for Taywin
0
343
Member Avatar for Malymieczek

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 …

Member Avatar for Malymieczek
0
131
Member Avatar for Lushomo
Member Avatar for babi.meloo

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 …

Member Avatar for Taywin
0
1K
Member Avatar for Kayla1993

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.

Member Avatar for Taywin
0
94
Member Avatar for Pyler

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???

Member Avatar for Taywin
0
216
Member Avatar for jakubee

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 …

Member Avatar for Taywin
0
1K
Member Avatar for keven.pirritano

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)

Member Avatar for keven.pirritano
0
156
Member Avatar for israruval007

@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.

Member Avatar for Taywin
0
155
Member Avatar for dancks

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 …

Member Avatar for Taywin
0
195
Member Avatar for lena1990

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.

Member Avatar for Ezzaral
0
244
Member Avatar for linezero

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 …

Member Avatar for JamesCherrill
0
306
Member Avatar for saraalaa.khodeir

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).

Member Avatar for Taywin
0
183
Member Avatar for strizh

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 …

Member Avatar for stultuske
0
182
Member Avatar for navi17

@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, …

Member Avatar for vasile.manda
0
2K
Member Avatar for BrackishWater

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 …

Member Avatar for Taywin
0
117
Member Avatar for mobility42

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 …

Member Avatar for mobility42
0
304
Member Avatar for sapure

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.

Member Avatar for sapure
0
249

The End.