Steven Bruton

Greenhorn
+ Follow
since Mar 07, 2011
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
1
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Steven Bruton

You compiled it successfully then, your problem is running it.

Try this;
Navigating back to this directory: "C:\Users\Sonny\Documents\Head1stJava\test\classes\com\headfirst",
From that directory try this command "java game/GameLauncher".
11 years ago
You have 6 compile errors in your code, that is why it will not compile.

Just some spelling errors;
The boolean p3isRIght should be p3isRight,
You made a call to guesse() 3 times but the method name is guess().
11 years ago
Its obvious he did not write this code, its clearly some sort of debugging exercise for homework. If he had enough knowledge to write this code he could not possibly have a problem debugging these simple errors (eclipse suggests fixes for most of them).

Look at the error on line 6...
Line 6: " [code=javascript]public static void main(String[] args) throws IOException{"
11 years ago
In the client

1. When "end" is input it is not written to the socket, your if statement breaks out of your while loops before doing so.
2. Even if the "end" string is sent to the server the client is still left expecting a return string through the input stream of the socket.
3. You havent closed the socket.

Similar problems in the server code.

There is no need for seperate threads to read and write to the socket, you should start again and use a single thread for that purpose. You can use most of the code you have and just close your streams and sockets when your finished with them.





11 years ago
Firstly, you do not need to specify the classpath for compiling.

To run try the following;

Enter full class path of jar
java -cp C:\folder\folder\connector.jar;. ClassName

If there is any white space in the path surround with quotes
java -cp "C:\folder\folder with spaces\connector.jar";. ClassName

Try entering the full path of both the jar and the class file (once again you may need quotes if white spaces in path)
java -cp C:\folder\folder\connector.jar;C:\folder\folder\src ClassName
You did not specify what DBMS you are using but if it is MySQL (I'm not too sure about others) you'll need to format the string like so;

"C:\\\\Desktop\\\\<folder name>"

The compiler will read this as "C:\\Desktop\\<folder name>" so this will be the string used in the update/insert
During insert/update this will be read as "C\Desktop\<folder name"
12 years ago

Maneesh Godbole wrote:Welcome to the Ranch.
One small question. Why the scale of 1-7? Usually its customary to provide a scale of 1-10. From the user's perspective, it is easier to mentally compute/convert the scale to percentage that way.



Agree / Disagree surveys use an odd number (1-5 usually but in this case 1-7), the participant cannot agree nor disagree if it used a scale of 1-10 or any even scale.

Anyway I did not fill in the survey because I only used netbeans a few times and I'd be quite bi-assed towards eclipse. If you want my opinion on why I don't use netbeans, its simply because I don't like the UI and I really like the eclipse one.
Add a document listener to the text field to capture the input and to filter the list you could create a method like so;



13 years ago
13 years ago
Cheers for the input guys, much appreciated.
13 years ago
I'm writing a client / server application which depends on socket connections to communicate.

What I'd like to know is should I keep the same socket connection open and continually reuse it until the client closes the connection or should I be closing the connection after a task is complete and create a new socket connection to service the next task.
13 years ago