server_crash 64 Postaholic

Sorry, you might want to get it by the hostname:

java.net.InetAddress inetAdd =
java.net.InetAddress.getByName("www.ibm.com");
	System.out.println ("IP Address is : " + inetAdd.getHostAddress());
server_crash 64 Postaholic

Surely using terms like the italicised words is unecessary, rude, and an action which would invite yet more? Some people will certainly issue negative rep not for what you say but for the way that you say it.

Well crap, if I'm going to negative reputation, from now on I'm going to make it worth it.

server_crash 64 Postaholic

It doesn't bother me, but to some extent I find it so very stupid.

server_crash 64 Postaholic

thanx. one more question. is there a way to return the ip address to a java/c++ program?

This is how you can grab the client ip address:

InetAddress thisIp =
        InetAddress.getLocalHost();
     System.out.println("IP:"+thisIp.getHostAddress());

Remember to include that in a try catch clause, as that code could potentially cause an exception.

Also, writting a simple servlet would be easier:

String IP = req.getRemoteAddr();

req is an HTTPServletRequest Object.

server_crash 64 Postaholic

Yes. Actuallly, when you find the folder containing the source file(.java), you should notice the .class file is not in that same folder. If it is, then we have problems! Naturally it should be in the same folder as the source, but since your getting that error, let's hope it's not. If it is in the same folder, then we got some problems with the classpath which will be harder to fix.

server_crash 64 Postaholic

Say, do you by any chance have problems reading burned data from disk? Especially if the files on the disk are ziped files?

server_crash 64 Postaholic

I've had this problem creep up on me several times. Look at the box/case the cd's came in, and see what the max write speed is. Make sure you are at that, or below. Also, try a really slow speed such as 16 or 4, and see if that works. Most of the time this is the result of a picky cd writer. My writer seemed to do pretty good with tdk brand cds...I think that was the name.

server_crash 64 Postaholic

Can anyone verify this information? I'm deeply concerned about this because I defragment my Windows XP partition weekly to avoid waiting a long time later. I have several friends who are also doing this, and they may be in trouble as well.

Once a week is probably too often. Most people will have a new Computer by the time a HD would ware out from such an action, but I have no clue as to what the current/contemporary problems you might have.

server_crash 64 Postaholic

server_crash, there's an option called "Output Path" you can change. Is this what I'm looking for?

That's exactly what your looking for. Now, go find the directory where the source file is, and set the output to that directory.

server_crash 64 Postaholic

So do you want to store all information for one person in one LinkedList, or are you wanting to parse through it and store the Name, Address, and Phone number all in seperate LinkedLists?

server_crash 64 Postaholic

Are you using JNI to do this? What was the error that it gave you? If you think what you did is suppose to work, then do some System.out.println() statements and hopefully that might tell you were something is going wrong.

server_crash 64 Postaholic

server_crash, I'm using borland jbuilder 9 academic.

It will be hard for me too help because I don't have JBuilder. Ok, look for an option to change the properties of your project. If you find it, it should say something about the source path,classpath, or the output path. Change it to the directory containing the file your trying to run. That should clear it up.

server_crash 64 Postaholic

I wrote a very simple one not too long ago, actually, it was simpler than what your wanting. If you don't know much about programming, then you definitely have some work ahead of you.

As for the tutorials you'll need to read, there's a lot! You will want to read about Strings and String methods so that you can parse through all of the HTML code. Then, you got to worry about the Robot Exclusionary Standard, so you'll need to read about how to access files and all that good stuff. There's the java.net and java.io package you'll need to get familar with so you can create Streams, URls, and connections to the websites.
The java.sun.com site is the best place to look for those tutorials.
There's a lot more too it than that though. I really don't see how you can go into this not knowing much about the language and come out with something like that, but good luck. If you need anything else, let me know.

Here is some resources I looked at while creating mine, although in the end none of them turned out to be helpful..I just designed my own.
http://moguntia.ucd.ie/programming/webcrawler/
http://research.compaq.com/SRC/mercator/papers/www/paper.pdf
http://cis.poly.edu/suel/papers/crawl.pdf

server_crash 64 Postaholic

Here is a method I just wrote that calculates the elapsed days. I used the GregorianCalendar. You can calculate milliseconds, months, years the same way.

import java.util.*;

public class GetDays
{
   public int getElapsed(GregorianCalendar g1, GregorianCalendar g2)
   {
	int elapsedDays = 0;
	GregorianCalendar gc1 = null;
	GregorianCalendar gc2 = null;
	if (g2.after(g1))
	{
		gc2 = (GregorianCalendar)g2.clone();
		gc1 = (GregorianCalendar)g1.clone();
	}
	

	while(gc1.before(gc2))
	{
		gc1.add(Calendar.DATE,1);
		elapsedDays++;
	}
	
	return elapsedDays;
   }

   public static void main(String[] args)
   {
	GetDays gd = new GetDays();
	System.out.println("Days past:  " + 
	gd.getElapsed(new GregorianCalendar(2003,Calendar.OCTOBER,1),
		      new GregorianCalendar(2005,Calendar.NOVEMBER,2)));
   }
}
server_crash 64 Postaholic

I don't undestand what your doing, but I can tell you why the q thing probably didn't work.

Instead of this:
if (endl == "endl")

do this:

if (endl.equals("endl"));

Other than that, I can't help because I don't understand what your doing.

server_crash 64 Postaholic

Alright, some little fag in here gave me some more negative reputation. This is becoming rediculous. That's twice for this one thread. Whoever is doing this: You are the most childish and immature person here. By the way, you may think your making me mad, but I don't really care about the rep system.

Sunandoghosh, sorry if I offended you with my earlier post. We all make mistakes. I can't say that I haven't posted anything against the rules! So don't worry about your thread being closed. Some people are really touchy about the downloading topic, although they probably use file sharing networks also but wont admit it. Right now, I'm just a little pissed off at the stupid behavoir of some of the people that's given me negative reputation, I know it's not you though.

server_crash 64 Postaholic

I don't know if it's true or not, but I've heard defragmenting too often can ware out your HD. I guess that would result in running defrag several times in succession.

server_crash 64 Postaholic

Even better, maybe there's a way to access it through a c++ or java program!

thanx.

You can access a site through java without knowing the IP Address. look up the java.net.*; package.

server_crash 64 Postaholic

The fan not working could be a big possibility. I had one go out on my power supply and it caused some bad things to happen, but it wasn't with the display.

server_crash 64 Postaholic

Check with M$ windows updates, and see if they have an updated driver for your graphics card.

server_crash 64 Postaholic

I had this same problem not too long ago. Here is what I did to get rid of it:

http://www.wilderssecurity.com/showthread.php?t=75890

server_crash 64 Postaholic

You'll need to take a look at the GregorianCalender class.
I don't know much about it, but I do know that you'll have to do some calculating with milliseconds.

server_crash 64 Postaholic

Looks really good. I wouldn't change much at all. The only thing I would do is put the close() method in a finally clause, and add a decimalformat instance to the mix. Something like this:

import java.io.*;
import java.text.*;

public class Sales
{
	public static void main(String[] args)
	{
		double total = 0.0;
		BufferedReader br = null;
		DecimalFormat dec = new DecimalFormat("###,###.##");
		try
		{
			br = new BufferedReader(new InputStreamReader(System.in));
			boolean readMore = true;
			while(readMore)
			{
				System.out.print("Enter the product # -->  ");
				String prodNum = br.readLine();
				System.out.print("Enter the quanity -->  ");
				String numDesired = br.readLine();
				int number, quantity;
				try
				{
					number = Integer.parseInt(prodNum);
					quantity = Integer.parseInt(numDesired);
				}
				catch(NumberFormatException nfe)
				{
					System.err.println("cannot parse: " + nfe.getMessage());
					continue;
				}
				switch(number)
				{
					case 1:
					total += 2.98 * quantity;
					break;
					case 2:
					total += 4.50 * quantity;
					break;
					case 3:
					total += 9.98 * quantity;
					break;
					case 4:
					total += 4.49 * quantity;
					break;
					case 5:
					total += 6.87 * quantity;
				}
				System.out.print("Would you like to order more?  'y'/'n' -->  ");
				String decision = br.readLine();
				if(!decision.equals("y"))
				{
					readMore = false;
				}
			}
	     }
	     catch(IOException ioe)
	     {
		System.err.println("read: " + ioe.getMessage());
             }
             finally
	     {
		     try
		     {
			     br.close();
		     }
		     catch(IOException ioe)
		     {
			     System.out.println("Could not close stream");
		     }
	     }
		System.out.println("total cost = $" + dec.format(total));
	}
}

Other than that, You've done an excellent job.

server_crash 64 Postaholic

I dont know why u said like that (and it hurts being treated like that)...anyways i respect legitimacy and never knew that its more illegal than legal to download from such networks...

however the posts (except the one i quoted) has put things into perspective...

thank u...

Yeah, and you gave me some negative reputation.

thank u...

server_crash 64 Postaholic

It's whatever the JVM and JRE are pointing to. If your using an IDE, which I think you are, then the path should be pointing to the directory were the files are located, but in weird circumstances it's not.

What IDE are you using?
Have you looked at the folder that's "suppose" to cotain these files to make sure they are there?

server_crash 64 Postaholic

I've done part of the program but I don't know how to locate the root directory. P.S. I'm just asking you don't have to help if you don't want to.

I wasn't trying to be mean or anything. I've been yelled at several times becaues "I gave them the answer",that's why I said that. Of course it's no big deal on my part to help.


So, you want to locate the root directory of the floppy disc right?

server_crash 64 Postaholic

Yeah, that's pretty cool.

server_crash 64 Postaholic

I have an extremely good book. http://www.amazon.com/exec/obidos/tg/detail/-/0072226846/qid=1116930539/sr=8-1/ref=pd_csp_1/104-4773591-4255936?v=glance&s=books&n=507846

It covers everything, and includes some really tuff questions and practice tests.

server_crash 64 Postaholic

No, it's nothing with your code. The class file cannot be found. This is common while using IDE's. The source file is placed in one directory, while the class file somehow ends up in another, and the JVM is looking in the directory that stores the source. Make sure that you have the classfile in the correct directory.

server_crash 64 Postaholic

Don't worry about being a "noob". We all have to start somewhere. Start out with a BufferedReader to read from the command line:

BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

Once you have that, then you can read the product number and that good stuff.

Then just use a switch statement to test the input.

Show me what you have so far, and I can help further.

server_crash 64 Postaholic

Loading time will differ from app to app.

How big is this app that your using?

server_crash 64 Postaholic

Pretty cool, I like how the pictures are good quality. Keep up the good work.

PS: Did you create the installer also?

server_crash 64 Postaholic

Yeah, I would definitely go for the real thing. I don't like the portable games and stuff like that. Of course as Belema said, if you travel a lot then it could be necessary. Personally, I would just go with the console.

server_crash 64 Postaholic

I don't think there is. It's possible mozilla has a function like that, but I doubt it. You can look through the cookies if those haven't already been deleted. They should contain website info. Other than that, I guess your out of luck.

server_crash 64 Postaholic

java.sun.com is probably the best resource online.

There are a bunch of different sites you can find tutorials on, but I would stick with java.sun.com.

If you're just starting out java, I would probably recommend a book, but of course it's your personal preference of what fits you best.

server_crash 64 Postaholic

I wouldn't buy that thing.

server_crash 64 Postaholic

I bet you could get some help in the JSP forum.

server_crash 64 Postaholic

can you help plz!!!!!!!!!! :p

Ok, sorry. The webcrawler is tuff if you want a good one, even a descent one is hard. A very simple webcrawler is pretty easy, although you want have much to show for. Personally, I would stay away from it unless you really want to do something "big",or you have a lot of time dedicated to studying.

The flash card maker. That was a pretty easy one. It allows the user to do file operations as in saving and opening. Teachers would probably like something like this.

The hangman was the most fun, and the easiest. There are endless possibilities as to what you can make out of the game. I made mine an SAT helper game. It read from a file, and chose a random word out of 5000 words. It gave the user a hint, and it gave the definition at the end of the program.

It's really your choice, you have to decide.

server_crash 64 Postaholic

Sounds like a spanning tree problem. I think you invert the direction and go from there, or something like that.

server_crash 64 Postaholic

Well, there is the PrintStream class, but I would use the PrintWriter. Actually, if you want automatic flushing, then PrintStream would probably be better. If you want to stick with the PrintWriter, try calling the flush after a print() method, and make sure you are closing the connection after it is sent. You don't really need to close the connection, but you DO need to make sure you are calling the flush method AFTER the print statement.

server_crash 64 Postaholic

Here's a site that gives some good tips, although might not be what you want.

http://www.developer.com/java/other/article.php/603451

server_crash 64 Postaholic

My suggestions:

1. Bundle all classes and resource files in a jar file.
2. Try to preload the heavier files (e.g. sound files) in a background thread, instead of init() method.

server_crash 64 Postaholic

We can, but you'll need to show some effort.

server_crash 64 Postaholic

So you want us to help you do something illegal. Geez, I just can't imagine why that thread was closed.

server_crash 64 Postaholic

Seems kinda weird. Do you have any updated info on this?

server_crash 64 Postaholic

A personal thanks go out to Narue and Server_Crash who were extremely helpful and patient with me as I committed the usual "boneheaded" errors and followed the usual newbie learning curve.

Your very welcome. We all have to start somewhere in learning programming, even if it means making the small mistakes. I thought you showed great effort in trying to solve the problems you did have, which will help in your success later on. Congratulations on completing your bachelors degree, it's definately an honor at any age. Well, I was glad I could help, and I wish you good luck.
server_crash.

server_crash 64 Postaholic

Here's what I did for my final year project:

A simple webcrawler
hangman that helps you with the SAT
flashcard game that allows you to easily create flashcards

server_crash 64 Postaholic

I don't believe anything those people say. They can't predict the end of the world.

server_crash 64 Postaholic

Nice work guys, you did his homework for him.

server_crash 64 Postaholic

------Configuration: test2 - JDK version 1.5.0 <Default> - <Default>-------C:\Documents and Settings\crusse15\Desktop\ClientUI.java:71: ')' expected
String foundName = st.findName(String itemName);
^
1 error

it's probably with that line of code.
What you should be doing is this:

String foundName = st.fiindName(new String(" "));

or just

String foundName = st.findName(itemName);