|
hi
i need to know how to impliment port adress translation for a simulator program, can anyone help
many thanks
|
|
|
|
|
Hi
i know this is possile but i dont know how. i need to set up multiple IP adresses on a single machine using java and forward each IP to a specified port. can some one please point me in the right direction to creating multiple IPs on a single machine.
note this is for a simulator program and requires the possibility to create a few hundred IP's.
many thanks
rich
|
|
|
|
|
You can assign multiple IP addresses on a single machine by entering into the network adapter's properties and then open "Internet Protocol Version 4 (TCP/ IPv4)" properties. Press the advance button and add as many IP addresses as you want. And then use those IP addresses in java.
I hope I answered it right. (for vista)
|
|
|
|
|
thanks for your responce, yeah thats correct however i need to impliment these IP's at run time and dynamically. The program im creating is part of a server application and will need to create these IP's based on data from clients at runtime rather than creating them through TCP/IP settings before hand.
is there a way to impliment multiple IP's throught java code?
|
|
|
|
|
i tried alot. even searched through net. but could no find anything. one way is to add maximum number of ipaddresses in the list and keep a list in ur program. use the free one when a request comes.
|
|
|
|
|
Hi Everybody,
I have a file which I use for writing some output during the run of the program. I also want this file to hold the error stream, in case of a problem.
I created the following code, to check what happen:
PrintStream psMyFile = new PrintStream("myFile.txt");
FileOutputStream fos = new FileOutputStream("myFile.txt", true);
PrintStream psErrorStream = new PrintStream(fos);
System.setErr(psErrorStream);
for (int i=0; i<5; i++)
psMyFile.println("line " + i);
System.err.println("This is an error 1");
psMyFile.println("after the error");
System.err.println("This is an error 2");
psMyFile.println("finished");
The content of "myFile.txt" afterward are:
line 0
line 1
line 2
line 3
line 4
after the error
finished
an error 2
As you can see, some of the errorStream text was lost. Also, I would expect that the last line will appear before the line before it.
Why does that happen? Is there a way to synchronize the writing, so that nothing will get lost?
TIA!
Dikla
|
|
|
|
|
Is there any java program that can present hierarchical data in a true tree format, as an alternative to using the standard TreeView control.
This is already avaible in C# and the link below would show you where the example is.
I wonder if the java version is avaible anywhere?
www.asp101.com/articles/jayram/treecontrol/default.asp
|
|
|
|
|
hi guys, my programming knowledge is very little. recently, i'm trying to implement a program that will do the following things :
i want to develop a program that will check how much data i'm receiving (just like a network monitoring software) while i'm connected to the internet. if my receiving amount of data is less than 2 KBps then it will play an audio file located on my hard disk. otherwise, it will do nothing. oh one more thing, the program will check the amount of receiving data every hour.
i know my idea will seem weird to all of you but i'm in serious need of this program. so please if anybody can do it for me i'll be grateful to him forever. u can make it using any language. VB,C,C++,Java doesn't matter to me. i want this program as soon as possible.this is my earnest request to all of you.
my email address : r2000.gp@gmail.com
romance
|
|
|
|
|
Hi,
I have an issue that I have to parse a query and separate all the words as well as I have to separate all the phrases from those
can any one suggest for this
|
|
|
|
|
Hello,
Assume I have this class
public class Car {
public Car() {};
}
and this class:
public class Mercedes extends Car {
public Mercedes() { super(); }
}
and this method:
public Car getNewMercedes() {
return new Mercedes();
}
I get this error:
This method must return a result of type Car
How do I fix this
Thanks in advance
|
|
|
|
|
Looks like getNewMercedes() is not within the Block .
There seems to be some thing wrong with the getNewMercedes() return type or block of code.
if you can provide us the Error, we can resolve easily..
The Universe is a Figment of our Imagination.
|
|
|
|
|
where i should add init parameters for a servlet.what should i add in web.xml file. give me sample program and complete steps to execute
|
|
|
|
|
after writing servlet program to connect to sql2000 what are steps i should do.if i have to install jdbc drivers separetely.i am working in win2000.
|
|
|
|
|
Hey guys! Just a quick question...
So I've added a KeyListener to my JPanel for a game I'm making, and everything is working out fine, except for one thing:
When I hold down a key, keyPressed is called once, followed by a delay, followed by several consecutive calls of the keyPressed method. I understand that this has to do with the way key events are processed and that you can adjust this delay within the control panel, but is there any way to remove this delay completely?
I'm thinking what I'm going to end up doing is creating a boolean keyDown variable which is set to true on keyPressed and to false on keyReleased .
Any other ideas?
|
|
|
|
|
Well thanks for all of your wonderful help guys, but I just thought I'd let you know that I went ahead and used my idea with the boolean s.
|
|
|
|
|
i have to do natural language processing project in java
i dont have idea about that project(ie. how to start the project).can any body help me?
thanks in advance.
|
|
|
|
|
this has nothing to do with java, even though it's java your teacher wants you to code that in.
what have you done so far, and where are you stuck ?
|
|
|
|
|
iam trying to do this project like google search using (collection concept list.contains)so i need some guidance to start this project from the scratch. i dont no how to split the english sentence and find out the noun ,verb and all.so wat to do?
but i can do this project like google search.iam asking for real method of doing this project.
thanks for ur reply .
|
|
|
|
|
Can someone provide me with the method. The input to the method are xmin,xmax,ymin,ymax,x0,y0,x1,y1.
I managed to get the coordinates from listener (above) now I need the method to clip the line. I know you can use the
g.setclip or g.cliprect but i wanna know the details of how to implement the cohen in java.
Thank you
|
|
|
|
|
i need your help guyz...
i have a project in java programming...
its hard to understand...
please help me..
Q1) Define a class called Rental that has the following properties
a) Userid of string type
b) Days of rental
c) Rental per day
d) Include appropriate accessors,mutators and constructor(s) as well as a method to change the cars' information.
e) Include a method longParking which will return true if the days of car rental above 6days otherwise return false.
Q2) Define a class called Carpark that has following properties.
a) An array season_rental that can allowed up to maximum 35 car rental at a time.
b) Include a method that will allow new rental information to be included into the system.
c) include a method to search for a car rental information.
d) include a method to increase the renting rate by 12%.
e) include a method to display all rental details that are currently still being rented out.
Q3) Define a main menu program that will allow all the rental information to be manipulated.
i hope you will reply my first post as soon as possible...thx...
Godbless...
|
|
|
|
|
and no need to repost
|
|
|
|
|
some hint for you..
Try analyzing the Blue print for another code which looks similar
Q1)
student Example :
Create a Student record
a) student id ( string )
b)no of students ( integer )
c) Marks
d) Include appropriate accessors,mutators and constructor(s) as well as a method to change the StudentRecord information.
e) Include a method checkStudentPass which will return true if the student score more than 35 and above in all Subjects otherwise return false.
which means I need to create a class StudentRecord
Here is Similar code
Code:
public class StudentRecord {
String studentID ;
int no_Of_Students ;
int marks;
public StudentRecord(){
}
public boolean checkStudentPass(int marks ){
return (marks >=35 )?TRUE:FALSE;
}
The Q3 acts Vital in your Code.. for which you need to access these variables using objects
All the Parameters are Passed from the main program.
since its the main class
you need to add the main Signature
public class StudentMainClass{
public static void main(String []agrs){
}
}
for Example
StudentRecord studentName1 = new StudentRecord();
Try accessing the StudentID like this
studentName1.studentID
Hope you got some idea about Java and your Q1 and Q3.
The Universe is a Figment of our Imagination.
modified on Friday, December 26, 2008 10:12 AM
|
|
|
|
|
thank you so much mr/ms. code_var...
its a big big help for me...
thank you thank you...(n_n)
|
|
|
|
|
i need your help guyz...
i have a project in java programming...
its hard to understand...
please help me..
Q1) Define a class called Rental that has the following properties
a) Userid of string type
b) Days of rental
c) Rental per day
d) Include appropriate accessors,mutators and constructor(s) as well as a method to change the cars' information.
e) Include a method longParking which will return true if the days of car rental above 6days otherwise return false.
Q2) Define a class called Carpark that has following properties.
a) An array season_rental that can allowed up to maximum 35 car rental at a time.
b) Include a method that will allow new rental information to be included into the system.
c) include a method to search for a car rental information.
d) include a method to increase the renting rate by 12%.
e) include a method to display all rental details that are currently still being rented out.
Q3) Define a main menu program that will allow all the rental information to be manipulated.
i hope you will reply my first post as soon as possible...thx...
Godbless...
|
|
|
|
|
we don't do homeworks here.
Read the guidelines, try to do the work yourself first, and ask for specific question only when you're stuck on something.
If you cannot do anything at all, then you're not the one for the job...
|
|
|
|