BestJewSinceJC 700 Posting Maven

http://docs.oracle.com/javase/tutorial/uiswing/components/tree.html#select See the section on "Responding to node selection". When the selection changes, get the selection and use the JFileChooser's setSelectedFile method to set it accordingly.

BestJewSinceJC 700 Posting Maven

http://www.asp.net/mvc

Ask a specific question if you expect a specific answer.. Otherwise read through the provided link

kvprajapati commented: :) +12
debasisdas commented: must read +9
BestJewSinceJC 700 Posting Maven

edit: I just realized that you're probably a student, and if so, you may be looking to use flat (normal) files. If that is the case then I would still recommend saving the images elsewhere and referencing them (perhaps just by a pathname, if your program is a desktop app), and you could save the text in a file. So the file would consist of your text sections + a pathname to the image. You could separate your text sections in hundreds of different ways. You should look into the Scanner class

Are you concerned about where to store and retrieve the images/text or how to store them? The answer to where is definitely to do it in a database. Assuming that you could be supporting multiple users, I would use a relational database and create several tables. One table would be for storing images (ID, image). One table for storing usernames (ID, username), one table for storing text entries, and one for storing the view you described (text areas + image).

The table for storing the view you described would have a foreign key referencing the users table as well as foreign keys referencing the image for the view and the text areas for the view.

Disclaimer: I'm NOT a database developer and this approach would definitely work, but for efficiency's sake you should wait for some other opinions on this one. (And in the meantime, describe your requirements more thoroughly)

BestJewSinceJC 700 Posting Maven

That's because I graduated, got a job, and stopped posting in there.

:p


edit: but I'm coming back now, in the java forum.

AndreRet commented: Funny! +0
BestJewSinceJC 700 Posting Maven

Use the Scanner class. There are tons of different ways you can do this with the methods in there, some involving regular expressions/Pattern, some with only the basic Scanner methods.

BestJewSinceJC 700 Posting Maven

If you're in a method, which you have to be, you could say "return;". I wouldn't worry about it too much if you have a working method though.

BestJewSinceJC 700 Posting Maven

Use an if statement.

boolean firstGuess = true;
long totalTimeMillis = 0;
if (firstGuess){
...
}

That should get you started

BestJewSinceJC 700 Posting Maven

russia being at the top of the list doesn't surprise me. they have a whole cyber army for goodness sake. (as does china i believe) where's the U.S.'s cyber army? =P

In their Mom's basement

Nick Evan commented: :) +0
BestJewSinceJC 700 Posting Maven

Thanks, the link is much appreciated. The fact that they aren't changing the objectives means regardless of how they change the test questions, the same topics will be covered, so that's good enough for me. Thanks for your help s.o.s.

BestJewSinceJC 700 Posting Maven

Oracle Certified Professional Java Programmer was formerly known as the Sun Certified Java Programmer certification. Does anyone know if the switch to Oracle has changed anything significantly, such as the questions that will be on the test? Or is it the same cert with a new name? The reason I ask is because it is easy to find materials to study for SCJP, but not for the new Oracle one.. do the materials for SCJP still apply?

Thanks

(btw - I did a search, plenty of SCJP questions, but don't see this one answered anywhere.)
(also, hi guys, long time no see :) )

BestJewSinceJC 700 Posting Maven

Changing the variable "size" in the Vizatuesi method has no affect on the value of the variable size that was originally declared in the paintComponent method. In fact, the 'size' variable in the paintComponent method and the 'size' variable in the Vizatuesi method are two completely different variables. When the Vizatuesi method is called, a variable called 'size' is created on the stack. This variable is completely separate from the size variable back in paintComponent.

bibiki commented: it's not the first time that BestJew answers my question right. +0
BestJewSinceJC 700 Posting Maven

I agree, well at least I think the moderator badges and stuff should be static and plain to see and carry the greatest weight of importance. However, it is probably something which is near the bottom of Dani's To Do list if she is considering changing it.

Doubtful. It simply isn't on Dani's list. Last week people were complaining about the lack of the aforementioned information, and Dani implemented the "invisible fix" (i.e. you have to highlight the name to view the stats). IMO this is valuing "cleanness of appearance" over usability.

BestJewSinceJC 700 Posting Maven

>> Never accused you of such. I used your post as a point of reference; just an example of the sentiment reflected by many, in the life of this thread and others similar, concerning the recent changes.

Fair enough, lets move on and be grateful that Daniweb doesn't look like the site that The Dude linked to.

:)

Nick Evan commented: Amen +0
BestJewSinceJC 700 Posting Maven

Thank you for making the "code" button darker. Maybe new members will use it more often now. Like other members have mentioned, the quotes are difficult to read. I currently either have to squint or move closer to my screen to read them. Making the font larger and darker would be helpful. Oh, and again, minor, but "Originally posted by cscgal" > "Quote originally posted by cscgal".

BestJewSinceJC 700 Posting Maven

I should have used the sarcasm tags. :idea:

~s.o.s~ commented: LOL? :) +0
BestJewSinceJC 700 Posting Maven

You're such a sweetheart Nick.

BestJewSinceJC 700 Posting Maven

You need one more closing bracket; you have more opening brackets than closing right now. Put another closing bracket after line 53.

BestJewSinceJC 700 Posting Maven

Btw Dani, something that would be really nice is if the links at the bottom had a way for you to use them within only a particular forum. For example, it'd be great if I was in the Java forum and I clicked 'unanswered threads' and only threads within the java forum showed up. Ditto for 'threads I've posted in', 'Today's posts' and 'Threads I've started'.

Ancient Dragon commented: Agree +0
BestJewSinceJC 700 Posting Maven

Camdaddy,

Don't be so offended, I don't know you, I've only seen one post from you on the forum and it was asking for other people to solve an assignment for you. Regardless of your motives, the reason for my assumption is pretty obvious. My assumption was apparently incorrect, and you've cleared it up. Leave it at that.

:)

BestJewSinceJC 700 Posting Maven

Humans only have a small understanding of why humans have the capacity to think, so why people always argue so strongly about artificial intelligence is beyond me. Maybe I have no education on the subject, but it seems to me that any "thinking" being done would involve a series of probabilities and choices, and an assignment of importance to certain information over other information - and however complex that is, it does not constitute thinking, IMO. Since the people who study the human brain have such a minute understanding of how it works, how can software duplicate a process that is much more complex than our current knowledge can comprehend?

BestJewSinceJC 700 Posting Maven

One more thing, the " Quote originally posted by Paul Thompson ... " seems awkward for some reason. Maybe nobody else thinks so, but I think it should be changed to "Originally posted by Paul Thompson ... "

If it was originally posted by someone, then it is obviously a quote, so the above statement is redundant.

lllllIllIlllI commented: wow, havent seen my name in a post that much ever :P +0
BestJewSinceJC 700 Posting Maven

The idea behind this is that if you're just directly quoting another post, it gets hidden by default, because it adds no new value to your post.

And again, since nobody has responded to my complaint: if it "adds no new value to your post", why not disallow its use altogether? It would seem that you have just stated that your feature is useless, yet you refuse to get rid of it: a contradiction.

BestJewSinceJC 700 Posting Maven

It has no code tags.

BestJewSinceJC 700 Posting Maven

On the old layout, the Mark as Solved button was easy to find and new members, and even some with nearly 200 posts, still rarely used it. Now it is, IMO, much too small. I knew the button would be somewhere and it still took me awhile to find. New members will never notice it where it is on this layout.

jephthah commented: good point +0
BestJewSinceJC 700 Posting Maven

Be clear with your questions, instanceof is a specific java statement that can be used (for example) in the following way:

if (x instanceof y){
   System.out.println("Cool");
} else System.out.println("No runtime error or compiler error here.");

And btw, I did understand your question after I read the quote, I'm just saying to avoid confusing language. Anyway, you can tell what kind of error it will produce by designing a program and attempting to run it. If it won't run it is a compiler error. If it runs but crashes its a runtime error. But with a little knowledge of inheritance you can probably deduce that if you try to instantiate one type (for example, class Whatever) and do something like Whatever c = new OtherThing .. where OtherThing is not a child of Whatever in the inheritance hierarchy, then it should generate a compiler error. Again, one test program is worth a thousand expert opinions, but read about inheritance and you will begin to understand. I could point out one by one what happens in your example above, but that won't help you learn nearly as much as writing a test program and seeing what an actual compiler does after reading a little bit about Java inheritance.

wildplace commented: helps a lot! +1
BestJewSinceJC 700 Posting Maven

Read on google and figure this out yourself. If you know how to pass by reference, declare a function, pass by value, subtract two ints, and use if statements to compare ints, then you can definitely solve this problem. If you can't do any of those things then read any basic C programming tutorial.

BestJewSinceJC 700 Posting Maven

As amusing and ironic as I find this, I don't think

"500 Internal Server Error

Servlet processing error


java.lang.NullPointerException
at com.thruport.jbird.core.JBirdFilterChain.doFilter(JBirdFilterChain.java:36)
at com.thruport.jbird.core.JBirdContext.processRequest(JBirdContext.java:1989)
at com.thruport.jbird.container.JBirdRequestHandler.execute(JBirdRequestHandler.java:159)
at com.thruport.jbird.server.TcpConnectionHandler.run(TcpConnectionHandler.java:56)
at java.lang.Thread.run(Thread.java:619)"

Should be at the top of the Java forum.

BestJewSinceJC 700 Posting Maven

Public should be "public"

BestJewSinceJC 700 Posting Maven

The real solution to this problem would be to use a boolean variable hasBeenUsed and set it to false initially. Then once your array is used, set it to true. That way you can check the variable later to see if it was ever used.

BestJewSinceJC 700 Posting Maven
while ( a != 0)
{
total += a;
}

This bit of code doesn't make sense. "a" is an array of doubles. So when you say "a", "a" is a reference/memory address. If you want to access the value stored in "a" you have to change the code to something like this:

while ( a[index] != 0)
{
total += a[index];
}

Where 'index' above is some valid index into the array, so if your array is of size 10, 0-9 would all be valid indexes. But using a while loop in this context doesn't make sense either, so I suggest that you use a for loop and do something like for(int i = 0; i < ARRAY_SIZE; i++) and put your calculations inside of that for loop.

jephthah commented: good +7
BestJewSinceJC 700 Posting Maven

You should set your initial lowest value to array[0], otherwise the lowest value variable will probably be initialized to 0, therefore, it will tell you the lowest value is 0 at the end.

flyingcurry commented: Thanks! +0
BestJewSinceJC 700 Posting Maven

Relax. It was a question, not an accusation. Nice rant though, now I'm a lot more likely to help you.

Ezzaral commented: Yeah, no kidding. Warm fuzzies abound! +10
BestJewSinceJC 700 Posting Maven

"An infraction of the rules" is the example. The word infraction being a synonym in that context for [breach, violation, infringement]. The language "given an infraction" comes from this definition and has only a slightly different meaning, i.e. to be given one means you were caught committing an infraction. I don't see what's complicated here. English has plenty of words that are similarly used.

jonsca commented: Yes +0
BestJewSinceJC 700 Posting Maven

mm m, I like to add a little salt, herbs, and sig spamming in my pasta dishes! Delicious!

jephthah commented: no one cares +0
BestJewSinceJC 700 Posting Maven

I would personally make an Object to represent the data coming out of the database, assuming that the data is related. If you want to stuff anything into an array, you can use an ArrayList (or Vector if you need it to be synchronized). If you don't need it to be synchronized use ArrayList. You can use something like ArrayList<Object> list = new ArrayList<Object>(); . I don't have a backround in databases so take that advice with a grain of salt, I'm avoiding being too specific lest I mislead you.

BestJewSinceJC 700 Posting Maven

As long as it gets the point across I could care less if Dani calls it No-No's

Nick Evan commented: I would vote in favor of "no-no" +0
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

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

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

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

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

Haha. I view most of the threads posted in this forum, and I have to admit, I am usually guilty of telling the member 'use code tags' but I rarely hit the report bad post button. I'll do it in the future if it'll make you that happy.

:)

Nick Evan commented: Thanks! +12
BestJewSinceJC 700 Posting Maven

Then why don't you do the obvious thing and put print statements in each of those functions, run the example, and see how many things get printed. This hardly looks like rocket science.

Rashakil Fol commented: maybe he's dumb +7
BestJewSinceJC 700 Posting Maven

Absolutely not.

kvprajapati commented: Aye. +9
BestJewSinceJC 700 Posting Maven

Jwenting: liability for damages and responsibility for criminal charges are completely different things. A parent might be liable for damages caused by a child (in certain circumstances), however, a parent is not criminally responsible for a child's actions unless they are involved in the child's actions:

1. Aiding or encouraging the behavior
2. Neglect of whatever the behavior is

Even if a child shoots someone, the parent is not necessarily legally responsible. You guys are acting like if a child went and robbed someone, the parent will have to serve jail time, which is simply not how it is. In that specific example, the parent might be legally responsible for payments to the person whose property was stolen, but they are not criminally held accountable for the theft. And even if the parent is found intentionally neglectful of the behavior, they will not be charged with the child's crime, they will be charged with a lesser crime (since they aren't the one who committed the child's crime!)

Poor parenting is impossible to measure, especially legally by people who don't know the parents. And poor parenting, again, is subjective. There are plenty of examples that you would call poor parenting which are not illegal whatsoever; so you're [ardav] arguing that after the sum of those examples, if the child commits some crime, the parent should then be criminally prosecuted?

BestJewSinceJC 700 Posting Maven

In the End, we will remember not the words of our enemies, but the silence of our friends. -Martin Luther King Jr.

Opportunity is missed by most people because it is dressed in overalls and looks like work. -Thomas Edison

BestJewSinceJC 700 Posting Maven

so my question is...
how can i make it possible to like write 2x^2+3x-1 and then make it possible for me(through the program) to separate all the parts..

sorry didnt write that the language im using is JAVA...thats kind of vital to know ;)

You're posting in the Java forum so we assume you want to use Java. As for the input - is your question how can you let the user input the items, or is it how can you parse the input? Parsing in this case means taking something like 2x^2 + 3x + 1 and programmatically separating it into logical parts (so that your program knows to treat it as 2x squared, plus 3x, plus 1).

Anyway, you have a variety of ways that you can have the user enter the input. Like you just showed, you could just let them type in something like 2x^2. Or you could design a GUI that had appropriate buttons on it where the user could enter their expressions. From the standpoint of parsing and error control, having a GUI where the user can enter their expressions would make your job much easier. If you let the user type anything they want, you have a high risk that they will enter something you don't know how to deal with.

BestJewSinceJC 700 Posting Maven

I am suppose to write a method that checks whether a string is a valid password. The password rules are:
1.) A password must have atleast 8 characters
2.) A password consists of only letters and digits
3.) A password must containt 2 digits

I need to write a test program that will ask the user to enter password and Display "Valid Password" if all the rules are followed othewise display "Invalid Password."

Can anyone help me get started...because i have no idea..
Any help is greatly appreciated.

Write 3 different methods. One to test each of the three rules that you just posted above. For example, method one should check to make sure the password has enough characters. You can use the String class for this; Google for "Java String" and start reading the API. One useful method is the length() method.

For part two you can check out the Character class, especially the isDigit method and the isLetter method. Ditto for part 3.

Salem commented: Nice +20