server_crash 64 Postaholic

I like to catch exceptions. I don't, however, throw some message up in the users face letting them know. I usually print something out to the console, and then deal with the error. lets say it's a calculator and the user entered a letter instead of a number...I would prefer to simply clear the text area, rather than throwing an error message up in the users face.

server_crash 64 Postaholic
      for (i = 0; i < Num.length(); i++)
        {
          a[i] = Num.charAt(i);
        }

You're grabbing numbers, so try parsing to a char:

a[i] = (char)(Num.charAt(i));

or try this:

a[i] = (Num.charAt(i)).charValue();
server_crash 64 Postaholic

I think you want javascript. Java can do this, but it's not going to be some script you plug into an html document and it runs. You could use jsp or servlets to EASILY get their ip.


By the way, if you just need to find their ip, got to the command line and type in:

ipconfig


That will give you the ip address and plus some.

server_crash 64 Postaholic

http://www.wallpaperview.com

Whats your favourite wallpaper site ?

I like sites that have wallpaper focusing on 3d art, nature, and space rather than softcore porn. ;)

server_crash 64 Postaholic

I need some programs
when program runnig show script , memory usage and modules.
please help me

:lol: :lol: :lol:

server_crash 64 Postaholic

Thank for the replies. That was actually exactly what I'm looking for. I have trouble thinking through the logical "non-sense" problems that are almost always at coding competitions. I was trying to think of a way to improve the way I look at problems and alogorithms in general, and the replies I got helped me out.

Thanks.

server_crash 64 Postaholic

I would put them into a String, create a String Buffer and then reverse it:


int x = 123;
String s = x+"";
StringBuffer sb = new StringBuffer(s);
sb.reverse();


That reverses the String, then you can parse it back to an int. I do have a recursive solution to this, but I would stay away from it.

server_crash 64 Postaholic

Sorry about that vex, I thought it would work. I'm looking for a solution right now, but I really thought that would work.

server_crash 64 Postaholic

I love the teach yourself in x amount of time. I've had a lot of books but most don't do such a great job of learning you the very basics. I've got the C++ in 21 days right now, and that is an excellent book. I think it's important to start out slow with a book like that, even though most people hate them.

server_crash 64 Postaholic

I would say most C++ developers are also Java developers and vis versa(or at least know the languages interchangably). Also, the C and C++ forums are together. Even though they are closely related, it's still two different languages. One more thing, we run out all the people who want us to do their homework for them!

server_crash 64 Postaholic

To create an array of Deck objects, you need to initialize the array with the amount of elements:

Deck[] d = new Deck[3];

Then,

d[0] = new Deck();


Like that....Let me know if you need a little more information.

server_crash 64 Postaholic

I know it's possible to connect two forums to one database, but I don't know where to change the table prefixes. This is phpBB, by the way. I'm using some kind of web hosting tools, so it didn't give me the opportunity to change the prefixes when I installed it. This is what I'm looking for: If a user registers at forum 1, they are automatically registered at forum 2.


If you can help out with anything, please post...It's much appreciated.

server_crash 64 Postaholic

PLEASE HELP HELP I NEED TO SUBMIT THIS IN 4 DAYS.
I DID TRY AND NOT ABLE TO PROCEED.. :mad:

Do it yourself.

server_crash 64 Postaholic

Please show some effort before asking for help.

server_crash 64 Postaholic
\|||/
          (o o)
 |~~~~ooO~~(_)~~~~~~~|
 | Please                             
 | don't feed the                   
 | TROLLS!                           
 '~~~~~~~~~~~~~~Ooo~~|
         |__|__|
          || ||
         ooO Ooo

Thanks,
Daniweb Troll Management Team.

server_crash 64 Postaholic

Use the Random Class. It's more random than Math.random();

import java.util.*;

public class RandomClassTest
{
	public static void main(String[] args)
	{
		Random randNumGenerator = new Random();

		int[] x = new int[7];
		for (int i=0; i<x.length; i++)
		{
			x[i] = (randNumGenerator.nextInt(100)+1);
		}
	}
}

Be sure to add 1 if you want to reach 100.

server_crash 64 Postaholic

Thank you, Cain and peter_budo.

You're welcome.

server_crash 64 Postaholic

My question: How important is it to learn and understand sorting algorithms and routines?

server_crash 64 Postaholic

Umm, yeah... well I guess... if you actually LIKE getting viruses, trojans, and other malware; not too many people like that though. :rolleyes:

You can get viruses on a computer?

server_crash 64 Postaholic

Jeff Langr's book is designed (as is HF Java) to be used in a classroom environment as well as for individual study.
As I said I proofread it :)

So that's why there's so many mistakes in it. :lol: :lol:

server_crash 64 Postaholic

Why on earh would someone want to open an attachment from a random address???

To find unique goodies.

server_crash 64 Postaholic

http://www.vim.org
All you need.

pshhhhh. All you need is JEdit. :cool:

server_crash 64 Postaholic

you should NEVER EVER put classes or jars from the JDK installation in your classpath.
It's not needed and can cause problems.

You SHOULD put the current directory ('.') in there or else pass it as a classpath to the java compiler and runtime always.

If you still get a NoClassDefFoundError you're missing something on your classpath, which will pretty much always be a library you need for some import or other.

You should have said something earlier before I led these people on for 40 posts!!!

server_crash 64 Postaholic

My Java books:

Teach yourself Java 2 in 24 hours --- Good if you want from ground up.
Java 2 Primer Plus -- Excellent book.
J2ee Core Patterns -- Haven't read it yet
Java 1.5, A developers notebook --- Excellent
Java 2 Certification -- Excellent
Head first servlets and JSP -- Excellent(although I haven't read all of it yet)


I liked the certification book and the head first servlets best. Those are jam packed with information.

server_crash 64 Postaholic

Sorry, we must have posted at the same time because I did'nt see that. But that's cool, I never checked 1.5's new Math features. It's good they added a few of those like log10.

server_crash 64 Postaholic

I see what it is. TextPad must come with extra classes that make things easier. A lot of times you will get things like this. I know normally you'll find an easier class to help out with reading and writing data.

To get the sine of a number in the normal methods:

Math.sin(x);


You won't be able to use those methods you have unless TextPad actually came with them, or you download them. I would suggest using the normal classes though.

server_crash 64 Postaholic
server_crash 64 Postaholic

Be prepared to take some time on it. The book by Kathy and Bert took me a LONG time to read! Not that I'm a slow reader, but you just can't zip through something that packed with information. I still don't think I'm ready for it. I've read some parts of the book twice but I've never took any of the practice exams and that's an important part.

server_crash 64 Postaholic

It seems that alot of forums are too afraid to allow HTML, are people just being paranoid?

Yes, they are sooooo paranoid.

server_crash 64 Postaholic

Well, none of those are functions in the math class.
You can find a list here:
http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Math.html

I can help you with a few of those:
To get the cube root:

Math.pow(base,3);

To get log base 10 of X:

int answer = Math.log(x)/Math.log(10);

To get hypotenuse a little more work is needed:

Math.sqr((Math.pow(a,2)+Math.pow(b,2));

I think that will work, not sure.

I don't know what you want on your last thing though.

server_crash 64 Postaholic

Basically it's like he said: look up sockets. The PrintWriter will probably be used, but you have your options open for choosing a Class that will read and write data. Split functionality up as much as you can when writing out the classes. And that's about all I have right now. Get a little done and we can help you more as he said.

server_crash 64 Postaholic

That's some dirty spyware. I had something like that once and it took forever to get it off. I'll try to find out what tools I used and get back to you.

server_crash 64 Postaholic

I was wondering when to use novell. Are there certain things to look for? Does it have advantages over server 2003? What about at a hospital, would it be a good idea to use novell when there is 1000 employees and most have 2 computers?

server_crash 64 Postaholic
\|||/
          (o o)
 |~~~~ooO~~(_)~~~~~~~|
 | Please                             
 | don't feed the                   
 | TROLLS!                           
 '~~~~~~~~~~~~~~Ooo~~|
         |__|__|
          || ||
         ooO Ooo

Thanks,
Daniweb Troll Management Team.

server_crash 64 Postaholic

I agree with you to some extent, but most of the usefull technology probably isn't going to wind up in just anyones hands. The reason so much useless crap is coming out, is because people are never happy. If someone asks you how much money you want and you say 100$, as soon as you get it you'll be wishing you ask for more. That's because humans are never satisfied and are always wanting something new. My uncle is a great example for buying useless junk all the time. He had a 4-5 hundred dollar pda but hardly ever used it, even though he's a network engineer. That's only one example, but he's got so much crap. Even though he's around 30, he has about EVERY gaming system on the market. But guess how much he plays them: almost never. It comes down to some technology being more useful to one person than another. We'll, I'm tired and going to bed.

server_crash 64 Postaholic

It's your structure. You need a while loop:

BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
char c;
do
{
c = (char)br.readLine();
}
while (c != 'e');

Something like that.

server_crash 64 Postaholic

Think it's like he said, it's case sensitive and wants the X capitalized. You can compile without it, but you won't get the warnings.

javac ProgramName.java -Xlint

server_crash 64 Postaholic

So what's your question?

server_crash 64 Postaholic

probably a live cd version. I wasted my time dual booting with mandrake and never use it. I think I might have but I can't find a driver for my wireless card.

server_crash 64 Postaholic

What do you suggest we do? Sit back and do nothing? I think we should be more ruthless with our tactics...Maybe not just bombing the crap out of the place, but definately opening a can on some people. These people don't follow rules and crap like we have to. I say drop the freakin UN and stomp some butt, while not worrying about what liberals and gay anti war people think. If they don't like it, then kick them out of the country and let them sit in a terrorist sanction and see how long they last. I gurantee you, that when they show up on tv and know they are about to get their head cut off on live television(this actually happens) that they will want to kill everyone of these people.

server_crash 64 Postaholic

Cain, these fundings you are talking about were indirect and incidental. First of all, we funded Sadam like this:

For a while we were giving to some charities..Millions and millions were given over time. Later we realized that instead of the proper people recieving it, it was Sadam secretely stealing the money from the charities. There was no way we could have known that at the time, and really nothing we could do about it but throw his smelly butt out of Iraq like we did. I'm not saying that was the cause of the war, by the way.

We funded Osama by giving him training. He was actually a well renowned person in his business though. No one suspected him of what he is now, or hated him like they do now. I don't know what made him hate the US, but something sure has. You know, if people want to come over here from other countries and recieve military training, a job, or whatever, they should be able to. There is no way to tell who is bad, and who is not.

server_crash 64 Postaholic

I love you Mr. Wenting.. :eek: (you know I'm joking right?)... Thanks for the help. I don't think anyone else could have explained as well as you have. Now, there is one more thing I don't understand: It's abtract, it's obviously made for implementation somewhere else in it's own form. But where is these different implementations, besides the one? Is it just for good design practice taking in mind potential growth in the future? Or is there actually more than one implemenation of the graphics class somewhere?

server_crash 64 Postaholic

You know, all of these london bombs make me wonder how well it's going over in Iraq. I mean, why would they be doing such a thing if they weren't really pissed off at supporting countries because they are getting beat. If supporting nations over there were getting beat, do you think they would still be doing this? Maybe I'm mixed up in my thinking.

server_crash 64 Postaholic

I don't understand the "success haters". I think google is AMAZING. The research and stuff they are doing is simply mind blowing...The same with Microsoft. Why bash the successful?

server_crash 64 Postaholic

JDialog. It will be just like creating a JFrame, but it's a dialog. A bit more complex, but it will do the job.

joshSCH commented: haha.. Thanks for helping me out when I was a complete idiot :) +7
server_crash 64 Postaholic

Oh oh, I got this. It's like this right? :

a = new b;

where a is a concrete fixture of b...Right? I know that's not exactly correct, but it's along that line. At first I was wondering why you would pass a parameter with the same name as the abstract class if it's concrete, but now I know. I probably made no sense just then.

server_crash 64 Postaholic

Do they not see it as a good thing? I've been thinking that Canada, Mexico, and the US, will combine currencies one day to compete with the Euro. I know they pretty much are, BUT they are not completely one currency. Would that be a good thing or a bad thing?

server_crash 64 Postaholic

Ok, so when you override the paint method and send it an argument, it creates the subclass of the graphics class?

server_crash 64 Postaholic

Thanks. I guess I'm going to have to change the way I'm doing things then. Maybe that's a good thing.

server_crash 64 Postaholic

For good practice I think it's best to put the braces after the data type:

String[]


That will save some confusion and readability down the road.