BestJewSinceJC 700 Posting Maven

On line 44 you said line = br.readLine(); but that shouldn't be inside of that if statement. You want to read in the next line when you're done looking at the previous line; so you should call br.readLine() inside of your while loop but after the for loop exits. You should also use print statements to debug ..

BestJewSinceJC 700 Posting Maven

Because you never called the reset method from within main.

public class ArrayReference {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		int[] array = {1, 2, 3, 4, 5};
		setArray(array);
		for (Integer i: array) System.out.println(i);
	}
	
	public static void setArray(int[] array){
		array[0] = 6;
		array[1] = 7;
		array[2] = 8;
		array[3] = 9;
		array[4] = 10;
		
		array = new int[5];
		array[0] = 1;
		array[1] = 2;
		array[2] = 3;
		array[3] = 4;
		array[4] = 5;		
	}

}

What you have to consider is what your 'array' variable actually points to. Changing the contents of your 'array' variable from another method will change the contents of 'array' back in main(). But changing the reference of the 'array' variable from another method will not change the reference back in main. Hence lines 20-25 in my above code have no affect on 'array' back in main because on line 20 what 'array' referred to changed, but only for the method I'm currently in.

BestJewSinceJC 700 Posting Maven

It prints twice because you put your print statement inside of a for loop that has two iterations.

BestJewSinceJC 700 Posting Maven
BestJewSinceJC 700 Posting Maven

am counting words that i have in a "input.txt" file on my computer...

What do you consider to be a "word"? Does it have to be in a particular dictionary? Or is your file guaranteed to only contain dictionary words separated by spaces? You haven't explained your problem sufficiently.

BestJewSinceJC 700 Posting Maven

There is no class called "Char". And you gave us the wrong error message, I'm pretty sure your compiler said "cannot find symbol - Char"

BestJewSinceJC 700 Posting Maven

How do you plan to count the number of words? Do you mean, like, words that would appear in the dictionary? If that is the case then you are going to need to do a dictionary look up of each possible word from your input file. If you count a word as anything preceded and followed by spaces, then that's a different story.

BestJewSinceJC 700 Posting Maven

No, there isn't. Just follow the directions, it told you what to do. And AFAIK you cannot add the same Swing component to multiple containers. It can only be added somewhere once.

BestJewSinceJC 700 Posting Maven

1. Restart your computer, click F8 while it is restarting
2. Boot into "safe mode with Networking"
3. Try to double click a program to start it. If double clicking is now working, then you probably have a virus on your computer. Whether or not you have a virus, the next two steps can't hurt.
4. malwarebytes.com -> download free version. Download it. Install it, run it.
5. download.com -> search for "ad-aware", download the first link which is the free version of ad-aware. Install & run it.

I hope after you follow those steps, your problem will be resolved. But you're in the wrong forum (this forum is not for computer help) and I'm not an expert on the subject. You might just have a really simple problem that has nothing to do with viruses. (I did a quick google search and I saw other users had problems like double click speed being set so high that they couldn't click that fast, etc)

BestJewSinceJC 700 Posting Maven

I don't really know how to elaborate on the compiler's error message. It literally says exactly what the problem is: you're using a variable "START" which was never declared, which is illegal. Either declare it or get rid of it. It looks useless to me; so delete it. And where you have break START; it should say "break;"

BestJewSinceJC 700 Posting Maven
//In a file called First.java
public class First{
... 
}
//File called Second.java
public class Second{
..
main(){
First f = new First();
}

}

Put the classes in a package together... then you can create a new Object and use the class's methods.

pinsickle commented: very helpful +1
BestJewSinceJC 700 Posting Maven

Perfect Dark (N64)

BestJewSinceJC 700 Posting Maven

The difference is that in the one case, the stupid investor makes a bad investment which causes them to lose money, whereas in the other case, Goldman Sachs does illegal behind the scenes work that dooms the investment(s) to failure from the very beginning.

BestJewSinceJC 700 Posting Maven

A device called HiHe that parses posts from this site and reposts the barely reworded content on Daniweb.

BestJewSinceJC 700 Posting Maven

1. What is your current job title?

Professional student

2. What education requirements did you earn to prepare you for this job?

I passed some classes. They let me take more.

3. What are the advantages/ disadvantages to this career choice?

You pay someone, you don't get paid.

4. What is an average workday like?

Shitty projects, very little sunlight.

5. Where did you start out on your career path?

In CMSC 100 level.

:)

BestJewSinceJC 700 Posting Maven

No. It is fraud. Legally.

BestJewSinceJC 700 Posting Maven

there is already a quote thread

BestJewSinceJC 700 Posting Maven

Isn't this a trig function?

BestJewSinceJC 700 Posting Maven

Huh? Your explanation makes no sense to me...

BestJewSinceJC 700 Posting Maven

I took it for you and I answered honestly but your answers won't mean anything. You can't apply generalizations to a community unless you know who that community is composed of...

BestJewSinceJC 700 Posting Maven

I agree with the previous posters. Don't learn the API, learn to use the API JavaDoc and Google to find what you need when you need it. As you build up experience you'll get to know the most common APIs, and you'll be able to copy/paste from things you have already written and debugged for many more (so never throw away any working code you've written).

Somewhat agreed on both points. Unless you are exceptionally good at organization, keeping every code you write is going to take longer as far as reusability than rewriting certain things will. But in general, holding on to modular code can't hurt. And unless you know a good bit of the API, it will be substantially harder to understand the other parts.

BestJewSinceJC 700 Posting Maven

what happens as a result?

BestJewSinceJC 700 Posting Maven

The first question you asked doesn't even require google. The question isn't about any specific software [if it is, you didn't mention it], it just requires common sense. Most of the others only require a little research and mostly common sense also. For example if you don't know what a "third party" is then look it up. Then look up what a "diagnostic tool" is. Combine the two concepts. Use your brain and think of some products that fit the definition. Write an answer.

Again, not rocket science... asking us to do your research for you is actually kind of insulting. There is a difference between not knowing what to research and being too lazy to research. You fit the second category.

BestJewSinceJC 700 Posting Maven

I'm sure this is not the right place to post this, but I thought I'd shout out to everyone to see if there's anyone can help. I have GOT to get off the internet more and I remember vaguely in the back of my mind from a million years ago that there is a kind of "alarm" you can install to restrict your internet use. Does anyone know what I'm talking about? The idea is that I would have to do other work during the day and not be constantly distracted by email and so forth. I can't find it anywhere. On Google all I get is stuff to keep the kids from looking at porn. Help! Would really appreciate it.

It's called self control, you can find it in aisle three

BestJewSinceJC 700 Posting Maven

Not all spammers are annoying, some are dead

Haha. Vegaseat's is pretty good too.

BestJewSinceJC 700 Posting Maven

Does it really matter? A jar file is an executable and therefore, should be sufficient . .

BestJewSinceJC 700 Posting Maven

No I'm here. Don't wait up at night. Later--

BestJewSinceJC 700 Posting Maven

The ONLY way is through extensive experience using them.
I doubt anyone knows every method and field in every class of even the core API and knows its correct usage.
And if such a person exists no doubt that knowledge is purely academic and he has no clue as to how to actually apply it to real world situations.

100% agreed. Make sure you learn concepts such as inheritance, polymorphism, interfaces, etc first - otherwise many of the methods in the Java API will not make much sense. I recommend either taking a course on Java or getting a decent beginner's book.

BestJewSinceJC 700 Posting Maven

You should explain your design step by step (like I did in my post above). Then tell us what pieces of code/ methods you have implemented for each part of the solution. Then we will tell you what you are doing wrong. That is how to code. Design first, then start coding.

BestJewSinceJC 700 Posting Maven

Code snips a waste of time? Maybe. It's just frustrating that the forums are stacked with the same questions, time after time. It's getting a bit stale. If there was an usable/obvious place to shove codey bits 'n' bobs, perhaps it would stop the repetitive wheel of strife. Just wishful thinking again. Easier to spend the time typing 'Needz code urgent. Help me now', I suppose.

How about mods choosing good bits of code from the forums from time to time and placing them in a hall of fame type thingy? Means you can't post to it, just snatched. Well, have to be sure it's original stuff though.

Nobody [that I saw] is arguing that code snippets are a waste. Only that people do not use the code snippets feature appropriately. If anything, people should post more code snippets - even if it is obvious and easy to the person posting it, there are always tons of people who it could help.

BestJewSinceJC 700 Posting Maven

It is forbidden to kill; therefore all murderers are punished unless they kill in large numbers and to the sound of trumpets.

-Voltaire

BestJewSinceJC 700 Posting Maven
BestJewSinceJC 700 Posting Maven

It passed in a String... T2('12').. scripting languages support operator overloading (I think that's the term)
Had it passed in an int you would've been right

BestJewSinceJC 700 Posting Maven

Post a new thread for your question. Don't hijack other people's threads. And posting email addresses is not allowed here - keep questions on the forums.

BestJewSinceJC 700 Posting Maven

So you start the int z at 0 and run it through the length of array and then add the value in the array to the sum if it's less than 10.

With the correction that you run it through the length of the array - 1, since the length of the array is actually longer than the highest possible index of the array, as Katana mentioned before.

BestJewSinceJC 700 Posting Maven

if they are both the same value, say both false, then the result is false? otherwise if it is false/true or true/false, the result is true?

what if they are both true? is the result true?

Exactly, everything you just said is correct. See my last post in this thread .

BestJewSinceJC 700 Posting Maven

John,

boolean whatever = first || second;

The above expression will store "true" into the variable "whatever" under the condition that first is true or second is true. If both "first" is false and "second" is false, it will store "false" into "whatever". So, to summarize, unless both "first" and "second" are false, the entire expression evaluates to true, and true gets stored into the variable whatever.

BestJewSinceJC 700 Posting Maven

It isn't a good or a bad practice. It just depends on what your application is. Usually passing a List to a constructor would be fine...

BestJewSinceJC 700 Posting Maven

Overall you need to cut out a lot of stuff. Only list your 3 most important jobs and give a brief description of what you did at those jobs and why it is relevant (what skills you learned). You were much too vague at certain points, for example, you mentioned web development projects, but didn't list any and didn't give any references. Of the "web site development jobs" that you did, list one or two of the most important ones, what the job was for, and what skill you learned there [example, php]. Cut out all the stuff about the description of a security clearance - companies that are interested already know what a security clearance is, and it just sounds weird to anyone else. And TBH, your job descriptions sound exactly like what I'd expect if I was applying for a job. Make it more specific to what you did/learned.

BestJewSinceJC 700 Posting Maven

Thanks for that contribution *sarcasm*

BestJewSinceJC 700 Posting Maven

well, those can be excused becasue the poster thought they were posting a question correctly.

the worst is these code snippet "programs" that with deprecated Turbo C libraries: they don't compile, they're so horribly written they're unreadable, and even if you take out the non-standard stuff, they're still broken and don't do what they're supposed to do.


.

Haha, still harping on the Turbo C, I see.

BestJewSinceJC 700 Posting Maven

You could also create your own class that mimics the Scanner class's functionality; you'd basically include a constructor that takes a File Object, and you'd implement your own next() methods, etc... in those methods you could call the Scanner methods and also implement your own custom functionality (calling the AudioClip)

BestJewSinceJC 700 Posting Maven

If you're planning to profit on these t shirts (which I assume you are) then you should also think of some normal-ish ones for people like me who wouldn't buy the "geeky sayings" ones.

BestJewSinceJC 700 Posting Maven

Most everything you said above is wrong. You can only implement interfaces not other classes. You can extend other classes in an inheritance hierarchy. Or if you want access to another classes public members you can simply instantiate a new Object of that classtype and then say object.variable

BestJewSinceJC 700 Posting Maven

Java and javascript are not the same languages.

BestJewSinceJC 700 Posting Maven

If you're just doing

number, operation, number, operation, number, etc
for example: 5 + 2 * 3 - 1

then you can just use a loop and some function calls. Integer.parseInt() will be useful here and so will the % operator (to decide if the position is odd -- because positions 1, 3, 5, etc are all numbers whereas the even positions are all operations.

BestJewSinceJC 700 Posting Maven

If you're in the terminal type "pwd" and then you'll know the file's pathname. Or you can navigate to the file's location and click properties on it and view the entire file path and copy paste it.

BestJewSinceJC 700 Posting Maven
((Math.abs(row-empty_row)!= 1) [B]&& (Math.abs(col-empty_col))[/B]

Why would that work? You are treating the returned value of Math.abs(), which is an integer, as if it can be tested for a truth value. In Java, only boolean types can be tested for truth. So you need to put something like this

((Math.abs(row-empty_row)!= 1) [B]&& (Math.abs(col-empty_col) > 0)[/B]

Expressions such as the one I posted above evaluate to either "true" or "false". In other words, Java looks at the returned value of Math.abs(), then looks at the operator, then looks at the value "0" on the other side of the operator and decides whether the expression is "true" or "false". In your code, you never compared the return value of Math.abs() to anything, and since the integer that it returned was not evaluated as "true" or "false" (since Java doesn't evaluate ints as true or false), it generated an error.

BestJewSinceJC 700 Posting Maven

Yeah, just specify the entire file path. You can also look into how to use getResource() but it can be difficult.

BestJewSinceJC 700 Posting Maven

I doubt the OP wants to reinstall. And to run malwarebytes he'll probably have to run his machine in safe mode.