 |

|
When posting your question please:- Choose the correct forum for your message. Posting a VB.NET question in the C++ forum will end in tears.
- Be specific! Don't ask "can someone send me the code to create an application that does 'X'. Pinpoint exactly what it is you need help with.
- Keep the subject line brief, but descriptive. eg "File Serialization problem"
- Keep the question as brief as possible. If you have to include code, include the smallest snippet of code you can.
- Be careful when including code that you haven't made a typo. Typing mistakes can become the focal point instead of the actual question you asked.
- Do not remove or empty a message if others have replied. Keep the thread intact and available for others to search and read. If your problem was answered then edit your message and add "[Solved]" to the subject line of the original post, and cast an approval vote to the one or several answers that really helped you.
- If you are posting source code with your question, place it inside <pre></pre> tags. We advise you also check the "Encode HTML tags when pasting" checkbox before pasting anything inside the PRE block, and make sure "Ignore HTML tags in this message" check box is unchecked.
- Be courteous and DON'T SHOUT. Everyone here helps because they enjoy helping others, not because it's their job.
- Please do not post links to your question in one forum from another, unrelated forum (such as the lounge). It will be deleted.
- Do not be abusive, offensive, inappropriate or harass anyone on the boards. Doing so will get you kicked off and banned. Play nice.
- If you have a school or university assignment, assume that your teacher or lecturer is also reading these forums.
- No advertising or soliciting.
- We reserve the right to move your posts to a more appropriate forum or to delete anything deemed inappropriate or illegal.
When answering a question please:
- Read the question carefully
- Understand that English isn't everyone's first language so be lenient of bad spelling and grammar
- If a question is poorly phrased then either ask for clarification, ignore it, or mark it down. Insults are not welcome
- If the question is inappropriate then click the 'vote to remove message' button
Insults, slap-downs and sarcasm aren't welcome. Let's work to help developers, not make them feel stupid.
cheers,
Chris Maunder
The Code Project Co-fou
|
|
|
|

|
hi ,how are you
I have Question ,how to create timetable schedule using Genetic Algorithm for all university
I try with it but it not work with me can any one help me on it?
|
|
|
|

|
hi,I'd like to bring you some useful stuffs,but I really don't know what the concrete problem you are puzzled.So any codes to show me or tell me the concrete topic you are trying to figure out .
|
|
|
|

|
I don't know how to start with JAVA to create random timetable without any conflict in Classes
How to start with it using Genetic Algorithm
|
|
|
|

|
You need to use Google to find references for this subject. There are many problems to be resolved in creating automatic schedules such as this, and the question is too broad for a technical forum.
Use the best guess
|
|
|
|
|
|
|

|
I want to create a server socket(TCP) in which I want that server shouldn't be closed if
client is closed.
What I'm doing: I'm able to connect to client but when client is closed then server is throwing exception : Connection Reset and crashes
How can I do it?
|
|
|
|

|
Trap the exception and dispose of it.
Use the best guess
|
|
|
|

|
I'm getting this exception:
Exception in thread "main" java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(SocketInputStream.java:189)
at java.net.SocketInputStream.read(SocketInputStream.java:121)
at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:283)
at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:325)
at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:177)
at java.io.InputStreamReader.read(InputStreamReader.java:184)
at java.io.BufferedReader.fill(BufferedReader.java:154)
at java.io.BufferedReader.readLine(BufferedReader.java:317)
at java.io.BufferedReader.readLine(BufferedReader.java:382)
at combined.Combined.dostuff(Combined.java:64)
at combined.Combined.main(Combined.java:30)
But not getting the way to dispose it.
|
|
|
|

|
Well, you need to catch it first.
Use the best guess
|
|
|
|

|
Indian Coder1989 wrote: I want to create a server socket(TCP) in which I want that server shouldn't be
closed if client is closed.
As stated that of course is illogical. Once the client terminates, regardless of how it happened, the server side connection can no longer be used.
|
|
|
|

|
OfCourse the server will be disconnected and connection will be closed but program shouldn't be crashed.
Isn't it possible that next time when client will again connected there will not be a need to start the server again(means server shouldn't be crashed)?
|
|
|
|

|
I already told you twice what to do: catch the exception and dispose it, so the server continues to listen in an idle state. How do you think the rest of the internet works?
Use the best guess
|
|
|
|

|
I think you should make a loop in your server code.
Just like the test code below.
import java.io.PrintWriter;
import java.net.ServerSocket;
import java.net.Socket;
public class Test {
public static void main(String[] args) throws Exception {
ServerSocket server = new ServerSocket(888);
while(true) {
Socket s = server.accept();
Processer p = new Processer(s);
Thread t = new Thread(p);
t.start();
}
}
}
class Processer implements Runnable {
private Socket socket;
public Processer(Socket s) {
this.socket = s;
}
@Override
public void run() {
try {
PrintWriter out=new PrintWriter(socket.getOutputStream(),true);
out.println("HTTP/1.0 200 OK");
out.println("Content-Type:text/html;charset=utf-8");
out.println();
out.println("<h1> web service test sucess!</h1>");
out.close();
} catch(Exception ex) {
ex.printStackTrace();
} finally {
try {
socket.close();
} catch (Exception e) {
e.printStackTrace();
}
}
}
}
To test the result,using http://127.0.0.1:888 in yor brower
Try it !
|
|
|
|

|
Thanks!
This is the thing, I was looking for.
Let me try this in my project.
|
|
|
|

|
Hello,
I have installed tomcat 6 with eclipse but now i want to install tomcat 7 with eclipse . But I keep getting the error
The Apache Tomcat installation at this directory is version 6. A tomcat 7 installation is expected.
Any idea how should i go about it.
Pritha
|
|
|
|

|
Hello Pritha,
You may find this tutorial useful in solving your issue. Also check whether CATALINA_HOME or TOMCAT_HOME environment variables are set and are pointing to wrong directory.
Regards,
Prasad P. Khandekar
Knowledge exists, man only discovers it.
|
|
|
|

|
Hi, I have to made Windows Media Player. Can anybody suggest me how can I work on it!! Thanx in advance May
|
|
|
|
|

|
Hi Guys,
just wanted to know how I can build lexical and syntacitc analysis using Jlex in eclipse for generating texts !!!
any one can help me please I am stuck ??!!
Thanks in advance
|
|
|
|

|
HopePerson wrote: I am stuck With what? You need to give specific details of your problem if you want some useful suggestions.
Use the best guess
|
|
|
|

|
I'm showing or selecting images from a list.
My code for listselectionlistener is:
listener = new ListSelectionListener() {
@Override
public void valueChanged(ListSelectionEvent e) {
index = imageList.getSelectedIndex();
imageList.setSelectedIndex(index);
o = imageList.getSelectedValue();
if (o instanceof BufferedImage) {
imageView.setIcon(new ImageIcon((BufferedImage)o));
}
}
};
imageList.addListSelectionListener(listener);
to get next item in JList (imageList) I'm coding like this:
public void nextimage()
{
index ++;
imageList.addListSelectionListener(listener);
imageList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
imageList.setSelectedIndex(index); -----here is error: Null Pointer Exception
}
I initialize index as int index=0;
Program in starting returning right value but after 4 or 5 images it's not working.
How can I change the Item in this list?
Please suggest your opinions.
|
|
|
|

|
You need to check if the JList does contain so much values.
You're not coding safe. You need to take more care.
You can never expect a value to be there as you need it - always check if the value is valid before you use it!
|
|
|
|
 |