BestJewSinceJC 700 Posting Maven

The fact that people would just post complete answers to a problem like this is just insulting to me. I don't know about some of the other legitimate posters here, but I make an attempt to give people enough help so that they can learn things without giving them a cookie cutter solution.

BestJewSinceJC 700 Posting Maven

I already told you to get rid of that inner while loop. You only need the do while loop, you do not need two loops. If you don't get that, that's fine. But please tell me why you don't understand so that I can help you better.

BestJewSinceJC 700 Posting Maven

because of the ambiguities it can create when a class inherits from two superclasses with the same method signature: which version should be called?

Which is exactly what I thought the issue was, except I do not see how it is any different from implementing two interfaces with the same method signatures in some of their methods, so I did not post that for fear of confusing you. But now that you've found the info on your own we can discuss. :)

P.S. It is not JavaAddicts fault, whether or not he already knew that bit of information, you could have easily googled for the info before even posting this thread.

BestJewSinceJC 700 Posting Maven

You're much better off either asking a more code specific question here or relying on the people you work with rather than a vague question like the one you provided. From the fact that you said 'extension point' I'm assuming you are working in Eclipse RCP, since I have worked in it before and that's the only place I've heard that term? Regardless, please provide some more detailed information.

BestJewSinceJC 700 Posting Maven

You could read each line of the file into an array. Since you would know that the current line is at an index less than the lines after it, you could use that knowledge to compare characters without a problem.

BestJewSinceJC 700 Posting Maven

Yeah, obviously it is just how Java was written. But the reason for that was, in no small part, based on C++, where multiple inheritance can get very messy. I don't remember the issues very well (as I'm not a cpp programmer), but one issue is that naming of methods can get messy. But in Java, interfaces (and implementation thereof) can serve the same purpose as multiple inheritance.

BestJewSinceJC 700 Posting Maven

You aren't declaring your while loop properly because of the ';'
For examples of how to correctly use while loops, use google, but for any type of loop, you need to put brackets around what you want to happen. Quick example for you

//acceptable
while(someVariable == false){
 //do stuff here!!!
}

Oh, and it should be 'break' not 'Break'.

BestJewSinceJC 700 Posting Maven

Is that maybe because Unix commands don't execute when you aren't in a Unix environment.. ?

BestJewSinceJC 700 Posting Maven

The government also has the power to print money. lots of it! A measly 14 trillion, ha, just a drop in the bucket!

But when the government abuses that power, the money becomes worthless.

Salem commented: Just like Zimbabwe - 14Tn wasn't national debt, it was a loaf of bread. +0
BestJewSinceJC 700 Posting Maven

He is not using a removeAll method with no arguments. Perhaps you didn't notice but that method takes as argument a collection and removes those elements that are inside the collection.

Yeah, I was confused because I'm using to seeing the no-argument version, even though I looked at his code. I got it now after reading the API, sorry for the misunderstanding.

@ OP

You wanted to use ==? You realize that will compare memory addresses or references? Oh, and if you don't implement the equals method, the method will be inherited from Object (or somewhere along the hierarchy), so you may not get the behavior you want anyway. You could research this by looking at the code and seeing how it is implemented.

BestJewSinceJC 700 Posting Maven

Well, where is your code to find the quadrant? You mentioned that you already wrote it, but you did not post it. Personally, I would just drop that piece of code into the Test2 class you created (or whatever your main class is). You could also put it in your Circle class, though. Since what quadrant you are in has nothing to do with the point itself (it has to do with where the point lies relative to the Circle's center, which is information the Point should not necessarily know about, I wouldn't put it in the Point class, though). However, programmatically speaking, you could put it anywhere you want, and still end up with a functioning program. I'd just personally put it in the main driver class, Test2, (aside of creating an interface that defines the quadrant method and forcing Circle to implement that interface, which really, would be better).

Anyway, sorry for going on a ramble that is probably confusing. If you attempt to put your quadrant method in your main class and get it working, post any problems you have while doing so, and I will help.

BestJewSinceJC 700 Posting Maven

If you want help doing it by using a HashMap you'll have to wait for jwenting. I don't understand why a HashMap would be useful for your purposes at all. It seems to be redundant to me, jwenting will have to explain why he suggested that (he may have had good reason, I just don't see it if there is one). And I already told you in my previous post how to do it using your current ArrayList. Simply put the code I provided in a nested for loop, and count the number of times you see each item, and you are done. You hardly have to do anything.

BestJewSinceJC 700 Posting Maven

Probably the classic uberprogrammer would be Hugh Jackman in Swordfish, machine-gunning the keyboard in a life-and-death situation while getting oral taunts from John Travolta and oral sex from someone else.

Die Hard franchise is pretty good too. The 'mac commercial guy' hacks into all kinds of systems that he's never been on before in seconds. Haha.

BestJewSinceJC 700 Posting Maven

I have to disagree with jwenting here. If you are already using an ArrayList then why use an additional data type that doesn't even help you in any way?

Do the following:

1. Write a for loop that iterates over your entire array.
2. For each element in the array, test if it is equal to the thing you want to compare it to (your word) using the equals method. *
3. If they are equal, increment a count.

* Since you have a String inside of a Word Object, the way you'd use the equals() method is as follows:

String currentWord = arrayWords.get(i).getWhatWord();
if (currentWord.equals(wordYourLookingFor)){
//do stuff
}

Also, you seem to be confused, because your variable is named whatWord. In one case, you want to search for a particular word to see how many times its in the array. But why don't you just made your ArrayList an ArrayList of Strings instead of one of Words?

BestJewSinceJC 700 Posting Maven

Not to dissuade you if this is a learning experience, but don't expect a perfect product with JMF. I wrote a simple media player and the audio did not play back as well as I had hoped. And certainly not as well as mainstream media players, even for the same audio files.

BestJewSinceJC 700 Posting Maven

Also, I noticed that you named your char variable 'Choice'. By convention, variable names are supposed to be lowercase. Here are acceptable variables named:

someVariableName;
another_variable;
myVariable;

Here are some unacceptable names:
VariableName;
Current;
myvariable;

Of course, those are not descriptive variable names (and variable names should be descriptive), but those are the conventions for syntax.

BestJewSinceJC 700 Posting Maven

1. Number is a class name. If you want to declare a 'Number' variable, you have to do it like this:

//Make sure you use a valid constructor
Number numberName = new Number();

//An alternative way
Number anotherNum = null;
//Somewhere later in the code, before you use the variable
anotherNum = new Number();

2. The do while loop was a good idea, however, you do not need the inner while loop whatsoever.

3. In order to test whether a number is even, consider the modulus operator. The modulus operator gives you, as an answer, the remainder of division. So 10 % 3 will be 1, since 10/3 is 3 Remainder 1. Another example: 15 % 4 = 3 because 15/4 = 3 remainder 3.

BestJewSinceJC 700 Posting Maven

Your question didn't make sense to me. Explain.. differently.

BestJewSinceJC 700 Posting Maven

You can only have one class in each .java file, and the classname must be the same as whatever is before the .java. Does that answer your question?

BestJewSinceJC 700 Posting Maven

Search the forum first. I'm pretty sure whether its for a neural network or anything else is immaterial. What you want to know is how to convert an image to a vector, period. Am I right?

BestJewSinceJC 700 Posting Maven
BestJewSinceJC 700 Posting Maven

JavaAddict: Good suggestions but for the one suggestion, it shouldn't matter if he implemented equals() since he is using the removeAll method. Right?

OP: If none of JavaAddicts solutions work, please post all of your code and I will run it and play with it and help you figure out what is wrong. JavaAddict is giving you good help, but sometimes there is only so much you can do by looking at the code when the code is complex.

BestJewSinceJC 700 Posting Maven

Look at the javadoc for scanner: http://java.sun.com/j2se/1.5.0/docs/api/java/util/Scanner.html

where do you see a method called read? None exists. Hence your error.

BestJewSinceJC 700 Posting Maven

Glad you got it to work, mark the thread as solved

BestJewSinceJC 700 Posting Maven

Here is what i have so far
what i want is the have all three integer line up on one line.
and look as: the 3 different integers are : 13, 27, 14

Use System.out.println() to do that. For example,

System.out.println("The three different integers are: " + int1 + " some more text here " + int2);

Try that out, see what it prints, then adapt that examples to your requirements. Also, you've probably already realized this, but ignore musthafa.

BestJewSinceJC 700 Posting Maven

Maybe you should be clearer... :icon_wink:

Yes, for sure I should've been. And jonsca: nice, lol.

BestJewSinceJC 700 Posting Maven

No, because you hard-coded the values in, you never prompted the user. But you knew that. So what are you asking .. ?

BestJewSinceJC 700 Posting Maven

Nope, talking about adroit.

BestJewSinceJC 700 Posting Maven

@ WaltP, are you following me around to make snide remarks, or is that a serious comment? If it's serious, please elaborate.

And these considerations would always want them to hire individuals well established in their fields, experts as some might like to call them, ready to deliver what they promise from day one (so to speak) so that the organisation can address their primary concern.

Even though we assume that some organisation might even have enough heart to employ a person under the pretext that he might grow with experience, who's ready to pay the cost if he/she doesn't.

Every company in the world that hires 'new hires' or college students or anyone just joining the workforce is making an investment based on the hope that the people they hired possess talent of some sort. Presumably most of those people are not well established in their field and many have not ever had a career job before at all.

BestJewSinceJC 700 Posting Maven

And as verruckt so kindly pointed out, your response was not necessary because all of the issues had already been cleared up. Your mention of needing the bugs to be listed was unnecessary because the problem was already answered without that information.

BestJewSinceJC 700 Posting Maven

You can't use spaces. If you want to name your variable total of cars you simply cannot do that, so use total_of_cars instead. So yes... using invalid syntax is a sure way to cause errors.

Also, the number of errors you get does not necessarily matter. In other words, you could be getting 15 errors, change something, then get one... but that does not mean that your code is better or that you are on the right track. If you pay attention to your errors and fix the earliest errors first, you will be doing things right, even if after you make the fix, it says there are more errors. You need to read the errors, understand what they say (and if you don't, look them up on google or ask about what the error means here). Then fix them and if more show up, you'll still be comfortable with knowing that what you did was correct, and the error you just fixed was hiding more serious errors. Think of it as a good thing.

BestJewSinceJC 700 Posting Maven

The error JavaAddict is referring to basically means that either node or node2 were not properly set (i.e. the Object was never created, for example), or that at some point, you explicitly set the reference to null. If you look at where you said node = log and node2 = log, you should trace the origin of 'log' because there is a good chance that log itself was not properly set.

BestJewSinceJC 700 Posting Maven

Post a new thread for a different topic. If the question you asked in here was answered, you should mark the thread as solved with the blue link at the bottom of the thread.

BestJewSinceJC 700 Posting Maven

Interesting, if I ever get the urge to join on that I'll look into clients that have alerts, thanks for the info.

BestJewSinceJC 700 Posting Maven

im just saying that a company dont just hire all pure smart programmers... they can give a chance to average programmmer.... coz. they will grow from work experience. of course u must have a smart lead programmer that will lead the team.

I agree with your conclusion, but not with your reasoning. The major reasons that a company doesn't hire all "pure smart programmers" are twofold. First, not all pure smart programmers have social skills, and many companies are interested in more than just programming skill: they're interested in communication skills, which make for better teamwork, a better work environment, and more company and individual growth due to communication. Second, even if everyone's "other" non-programming skills were equal, it would be almost impossible to design a process whereby the best programmers always got picked for the job.

That's all my own opinion obviously, and we'll see if anyone else has any thoughts on the matter.

BestJewSinceJC 700 Posting Maven

How is it pronounced in French? (If you're able to give another of those examples for this one..)

BestJewSinceJC 700 Posting Maven
BestJewSinceJC 700 Posting Maven

But what problem are you having? You just posted code with no apparent errors or explanation.

BestJewSinceJC 700 Posting Maven

Jemz -

You can use PrintWriter's print(String) method in order to make sure your text ends up aligned properly. Since all that will be printed is the String that you supply, you can output whatever you want, followed by spaces, other text, whatever, and then when you want to go to the next line simply print the String "\n". Alternatively you could call PrintWriter's println method once, printing out everything that you want to be on the current line, and it will skip to the next line for you.

Of course, everything I said above also applies to the method JavaAddict showed you, except the class's methods he showed you are obviously different. Show us some code.

BestJewSinceJC 700 Posting Maven

1. Use a File Object, connect it to the correct pathname of the file you want to read from.
2. Use a Scanner Object, when you create the Scanner, pass in the File Object you created earlier
3. Use Scanner's methods to read in the appropriate type.

BestJewSinceJC 700 Posting Maven

But how I gona to make sure every number from 1 to 8 are come out in a pairs?

You would just use the method randomInt twice to get a pair. If you mean that you wouldn't want a duplicate value in your pair, then you would keep calling it until you didn't have two of the same values in your pair.

BestJewSinceJC 700 Posting Maven

Not necessary if you are talking about exceptions in general and not the Exception class. Exception classes which extend RuntimeException and Error can be used in the throws clause without forcing the client or the consumer to catch them. This is normally done for documentation purposes but is perfectly legal and common scenario.

I'm not sure if I was talking about Exception [class] or Exceptions in general, but I realized that additional piece of information you mentioned after I posted, hence the edit with the link. Thanks for clarifying though as I should've made it more clear.

BestJewSinceJC 700 Posting Maven

The lookup would probably be performed in constant time. Otherwise why bother having a numerical key for your database table? I don't know what algorithm you're talking about though. I'd assume it is, at least conceptually, just an array of some sort. Then when you want to get all the info the lookup is done and all the data is returned.

BestJewSinceJC 700 Posting Maven

Well, when you're using the IRC, if you have it in a tab that isn't currently showing - is there some alert when someone else joins/posts?

BestJewSinceJC 700 Posting Maven

Hi guys just wanting some help with exceptions. I understand the try and catch concept but I struggle more with the throw and throws concept, it is my understanding (that may be incorrect), that you a method can be like

public class thisMethod throws whateverException

Am I right in thinking that 'whateverException' is a written exception class? Now I dont understand any further than this or why it would be done.

And what is the purpose of the throw and catch idea? is it that you want the error to be controlled in the right class of your code?

Thanks in advanc e guys

"whateverException" is any class, whether it be from a standard Java library or a class that you yourself created, that extends Exception. So in some hierarchy, it must extend Exception in order to use the throws keyword. To help you understand why you'd want to declare a method like that, consider the following example: the Java Integer class's parseInt method is declared as 'throws Exception (of some sort)' because it allows the programmer calling the method to catch the Exception and deal with it however they see fit. So it enables the programmer who calls the method to deal with the Exception, if one occurs, and respond appropriately.

Click to see the Integer class's parseInt method.

So essentially, declaring, in the method header, that a method throws an Exception, forces the programmer calling the method to deal with an Exception if one …

BestJewSinceJC 700 Posting Maven

http://www.youtube.com/watch?v=cL9Wu2kWwSY

50 years and a single computer will be more powerful than the entire human population. rad.

Yet still not capable of any thought beyond what it was programmed to think, which is a severe limitation.

BestJewSinceJC 700 Posting Maven

In the whole "Is this word really used" debate no one brought up its use in Organic Chemistry (http://en.wikipedia.org/wiki/Gauche_effect). Scores of college sophomores are introduced to it and they don't even know how lucky they are.

@GrimJack, I always find it fun to pronounce adroit as English. It feels like I'm rebelling against that French class feeling. Now if only I can get that gow-chee pronunciation to catch on.

Yeah, it is apparently also used in some programming language, which I saw the other day on google. Here it is:

http://practical-scheme.net/gauche/

BestJewSinceJC 700 Posting Maven

To make the components fit the entire screen, you could programmatically intercept the user's 'maximize' action (using WindowListener). Then, when the user hits maximize, you can use this technique to get the screen size. Then set the size on the JFrame using setSize to the size that you just got using the Toolkit class (as seen in the link). You might have to play around a bit with setting the JFrame's size, I don't remember exactly but you might need to call revalidate() on the JFrame after doing so, or resizing the JPanel might do it as well. I honestly don't remember but try each of those things, hopefully my suggestion about how to get the screen size and using WindowListener is helpful. If you have any more questions don't hesitate

BestJewSinceJC 700 Posting Maven

If you follow the daniweb rules pertaining to how to post a question, which are found in a thread at the top of this forum, we'd be glad to help. Basically you need to post as much information as possible (about your problem), show effort in solving the problem on your own, and ask specific questions about why you need help.

BestJewSinceJC 700 Posting Maven

Hi Dave,

Your snippets weren't hard for me to find because in 'site search' under 'thread prefixes' there is an option that says 'code snippets'. Combined with entering your username in the username to search for field, it wasn't very hard at all to find your snippets. Also, as an aside, I've usually found daniweb pretty easy to search, the interface is pretty standard and I do like how you can search by type of thread like that.