SYNCHRONIZING problem

A

adrian.bartholomew

ok i cant take it anymore. i need help!


let me describe my java solution as best i could pertaining to my
problem.
it is a card game. u know, server app as the brain and fancy gui for
the applet clients that u surf via "cardgame.com" for eg.
now....
the server side of things basically consists of a "ConnectionListener"
that listens for clients wanting to play (connect to the table). each
time it detects someone trying to connect, it spins of a
"PlayListener" thread who's main purpose is to listen to that client's
"plays".
so lets say we have 4 people playing the game, we have 1
ConnectionListener and 4 PlayListeners.
thats 5 threads.
all the methods of play reside in the main program CardGameServer.
dealCards(), playCard(), shuffleAnimation(), cutPack() etc.
now i like animation. a lot. u know, like a card shuffle animation or
the cards coming off the table 1 by 1 after a round of play.
this, i achieved by having the CardGameServer implement Runnable. in
the run() method there are many if(flag) clauses that,
if( flag==true), a particular animation is run. for eg.


if (cutAnim){
cutAnim();
}
if (shuffleAnim){
shuffleAnim();
}
if (gameStage==3 &&
getPlayer(fourMax(sg.dealer.playerNum-1)).robot!=null){
cut();
}
if (gameStage==8 && // 8 means: 1st card played and round has not
yet ended.
getPlayer(fourMax(sg.rd.currTurn)).robot==null && //not a robot
getPlayer(fourMax(sg.rd.currTurn)).hand.size()==1 && //1 card
left
sg.rd.currPlay<5 // 4th card not yet played
){
doPlay(getPlayer(fourMax(sg.rd.currTurn)).hand.elementAt(0)); //
only card left
} //if only 1 card remains in the hand, play it automatically


so when i want an animation performed, i simply switch one of these
flags to true.
when it enters, say, cutAnim(), the 1st line of code in cutAnim()
switches the flag back to false so theres no possibility of falsely re-
entering the animation.
the run routine is in an endless while(true) loop, forever searching
for "true" flags or robot plays.
if there is a better way of performing these animations without using
up valuable thread processing time, pleeeease let me know. i cant
imagine a 100 instances of the gameserver all continuously looping.

anyway, onward.

i have also created AI robots that u can assign to the table instead
of waiting indefinitely for human players to log in.
when its their turn to play, the endless run loop simply checks to see
if the player whose "currTurn" it is, is not human
(getPlayer(......currTurn).robot!=null and a host of other checks like
gameStage etc. once these meet the criteria, it goes into the AI code
to find the best play and does it.
the difference is, the AI's play is instigated from the thread
commanding the run() method of the CardGameServer class.
whereas the human's play is instigated from the playListener Class
which calls methods residing in the CardGameServer class.

the problem for me arises when i try to put a lock on the animation.
if i dont, sometimes it gets corrupted and the animation goes awry. in
the past (b4 i learned about the synchronized keyword), i suspend
either the playListener thread or the server thread, afterward
resuming. it worked fine except under a particular circumstance, if
the human did the shuffling and a robot cut the pack, the human would
hang when trying to make a play (maybe deadlock?).
added to the fact that these keywords are now defunct, i opted for a
cleaner design using synchronized.
ive tried adding wait() and notifyAll() but nothing works. either the
human hangs ot the robot hangs.
i need the animations to complete without any interference from a
human command coming in.
but i also need the damn thing to work. from start to finish no matter
what ratio of humans to robots are on the table

help.
 
J

Joshua Cranmer

ok i cant take it anymore. i need help!


let me describe my java solution as best i could pertaining to my
problem.
it is a card game. u know, server app as the brain and fancy gui for
the applet clients that u surf via "cardgame.com" for eg.
now....
the server side of things basically consists of a "ConnectionListener"
that listens for clients wanting to play (connect to the table). each
time it detects someone trying to connect, it spins of a
"PlayListener" thread who's main purpose is to listen to that client's
"plays".
so lets say we have 4 people playing the game, we have 1
ConnectionListener and 4 PlayListeners.
thats 5 threads.
all the methods of play reside in the main program CardGameServer.
dealCards(), playCard(), shuffleAnimation(), cutPack() etc.
now i like animation. a lot. u know, like a card shuffle animation or
the cards coming off the table 1 by 1 after a round of play.
this, i achieved by having the CardGameServer implement Runnable. in
the run() method there are many if(flag) clauses that,
if( flag==true), a particular animation is run. for eg.

Wouldn't it be better to handle animation in the client applet?
[scissor happy]

so when i want an animation performed, i simply switch one of these
flags to true.
when it enters, say, cutAnim(), the 1st line of code in cutAnim()
switches the flag back to false so theres no possibility of falsely re-
entering the animation.
the run routine is in an endless while(true) loop, forever searching
for "true" flags or robot plays.
if there is a better way of performing these animations without using
up valuable thread processing time, pleeeease let me know. i cant
imagine a 100 instances of the gameserver all continuously looping.

anyway, onward.

i have also created AI robots that u can assign to the table instead
of waiting indefinitely for human players to log in.
when its their turn to play, the endless run loop simply checks to see
if the player whose "currTurn" it is, is not human
(getPlayer(......currTurn).robot!=null and a host of other checks like
gameStage etc. once these meet the criteria, it goes into the AI code
to find the best play and does it.
the difference is, the AI's play is instigated from the thread
commanding the run() method of the CardGameServer class.
whereas the human's play is instigated from the playListener Class
which calls methods residing in the CardGameServer class.

the problem for me arises when i try to put a lock on the animation.
if i dont, sometimes it gets corrupted and the animation goes awry. in
the past (b4 i learned about the synchronized keyword), i suspend
either the playListener thread or the server thread, afterward
resuming. it worked fine except under a particular circumstance, if
the human did the shuffling and a robot cut the pack, the human would
hang when trying to make a play (maybe deadlock?).
added to the fact that these keywords are now defunct, i opted for a
cleaner design using synchronized.
ive tried adding wait() and notifyAll() but nothing works. either the
human hangs ot the robot hangs.
i need the animations to complete without any interference from a
human command coming in.
but i also need the damn thing to work. from start to finish no matter
what ratio of humans to robots are on the table

help.

I can't take it anymore, either. Usenet is not a text message
repository, nor is it a chat room. Therefore, take pains to write proper
English. Also, please try not to speak in slang (i.e., do not put "u
know" every few sentences).

It sounds as if your basic problem is that you're handling animation on
the server side. If so, then simple message passing between
client/server while forcing the client to handle the animation is much
simpler. This design would also ease the robot problem by allowing you
to spawn the custom "robot" client through Process, etc.
 
A

adrian.bartholomew

ok i cant take it anymore. i need help!
let me describe my java solution as best i could pertaining to my
problem.
it is a card game. u know, server app as the brain and fancy gui for
the applet clients that u surf via "cardgame.com" for eg.
now....
the server side of things basically consists of a "ConnectionListener"
that listens for clients wanting to play (connect to the table). each
time it detects someone trying to connect, it spins of a
"PlayListener" thread who's main purpose is to listen to that client's
"plays".
so lets say we have 4 people playing the game, we have 1
ConnectionListener and 4 PlayListeners.
thats 5 threads.
all the methods of play reside in the main program CardGameServer.
dealCards(), playCard(), shuffleAnimation(), cutPack() etc.
now i like animation. a lot. u know, like a card shuffle animation or
the cards coming off the table 1 by 1 after a round of play.
this, i achieved by having the CardGameServer implement Runnable. in
the run() method there are many if(flag) clauses that,
if( flag==true), a particular animation is run. for eg.

Wouldn't it be better to handle animation in the client applet?




[scissor happy]
so when i want an animation performed, i simply switch one of these
flags to true.
when it enters, say, cutAnim(), the 1st line of code in cutAnim()
switches the flag back to false so theres no possibility of falsely re-
entering the animation.
the run routine is in an endless while(true) loop, forever searching
for "true" flags or robot plays.
if there is a better way of performing these animations without using
up valuable thread processing time, pleeeease let me know. i cant
imagine a 100 instances of the gameserver all continuously looping.
anyway, onward.
i have also created AI robots that u can assign to the table instead
of waiting indefinitely for human players to log in.
when its their turn to play, the endless run loop simply checks to see
if the player whose "currTurn" it is, is not human
(getPlayer(......currTurn).robot!=null and a host of other checks like
gameStage etc. once these meet the criteria, it goes into the AI code
to find the best play and does it.
the difference is, the AI's play is instigated from the thread
commanding the run() method of the CardGameServer class.
whereas the human's play is instigated from the playListener Class
which calls methods residing in the CardGameServer class.
the problem for me arises when i try to put a lock on the animation.
if i dont, sometimes it gets corrupted and the animation goes awry. in
the past (b4 i learned about the synchronized keyword), i suspend
either the playListener thread or the server thread, afterward
resuming. it worked fine except under a particular circumstance, if
the human did the shuffling and a robot cut the pack, the human would
hang when trying to make a play (maybe deadlock?).
added to the fact that these keywords are now defunct, i opted for a
cleaner design using synchronized.
ive tried adding wait() and notifyAll() but nothing works. either the
human hangs ot the robot hangs.
i need the animations to complete without any interference from a
human command coming in.
but i also need the damn thing to work. from start to finish no matter
what ratio of humans to robots are on the table

I can't take it anymore, either. Usenet is not a text message
repository, nor is it a chat room. Therefore, take pains to write proper
English. Also, please try not to speak in slang (i.e., do not put "u
know" every few sentences).

It sounds as if your basic problem is that you're handling animation on
the server side. If so, then simple message passing between
client/server while forcing the client to handle the animation is much
simpler. This design would also ease the robot problem by allowing you
to spawn the custom "robot" client through Process, etc.

1st off. ur prima donna attitude sucks. this is still the internet. a
forum
that was designed WITH shorthand in mind. trust me, u will be hard
pressed
to compete proper english grammer with me.

that said, i am not familiar with the customs
here and ur "welcome" came across very rude hence my reply.
i would however like to keep to the project at hand.
ur suggestion is well taken and i am impressed with ur speed in
understanding my project.
i do want my server to also be gui based. which is how it is now,
where u can see
all 4 hands of the players and the animations run just like the
clients do. of course, just
a simple server with a brain and message passing would be simpler but
i 1st wrote
the program as the server then i copied it and whittled it down to a
client version where
most of the "brains" of the game were taken out and left for the
server to do.
this left me with a server that had an impressive gui, so y waste it?
it also helps in the debugging and programming of the AI's as i can
see all the hands
without having to open 4 clients.

but where the animation i concerned, is there a different way to do it
on the server side?
also, what did u mean by 'spawn the custom "robot" client through
Process'?
 
D

Daniel Pitts

Wouldn't it be better to handle animation in the client applet?
[scissor happy]
so when i want an animation performed, i simply switch one of these
flags to true.
when it enters, say, cutAnim(), the 1st line of code in cutAnim()
switches the flag back to false so theres no possibility of falsely re-
entering the animation.
the run routine is in an endless while(true) loop, forever searching
for "true" flags or robot plays.
if there is a better way of performing these animations without using
up valuable thread processing time, pleeeease let me know. i cant
imagine a 100 instances of the gameserver all continuously looping.
anyway, onward.
i have also created AI robots that u can assign to the table instead
of waiting indefinitely for human players to log in.
when its their turn to play, the endless run loop simply checks to see
if the player whose "currTurn" it is, is not human
(getPlayer(......currTurn).robot!=null and a host of other checks like
gameStage etc. once these meet the criteria, it goes into the AI code
to find the best play and does it.
the difference is, the AI's play is instigated from the thread
commanding the run() method of the CardGameServer class.
whereas the human's play is instigated from the playListener Class
which calls methods residing in the CardGameServer class.
the problem for me arises when i try to put a lock on the animation.
if i dont, sometimes it gets corrupted and the animation goes awry. in
the past (b4 i learned about the synchronized keyword), i suspend
either the playListener thread or the server thread, afterward
resuming. it worked fine except under a particular circumstance, if
the human did the shuffling and a robot cut the pack, the human would
hang when trying to make a play (maybe deadlock?).
added to the fact that these keywords are now defunct, i opted for a
cleaner design using synchronized.
ive tried adding wait() and notifyAll() but nothing works. either the
human hangs ot the robot hangs.
i need the animations to complete without any interference from a
human command coming in.
but i also need the damn thing to work. from start to finish no matter
what ratio of humans to robots are on the table
help.
I can't take it anymore, either. Usenet is not a text message
repository, nor is it a chat room. Therefore, take pains to write proper
English. Also, please try not to speak in slang (i.e., do not put "u
know" every few sentences).
It sounds as if your basic problem is that you're handling animation on
the server side. If so, then simple message passing between
client/server while forcing the client to handle the animation is much
simpler. This design would also ease the robot problem by allowing you
to spawn the custom "robot" client through Process, etc.

1st off. ur prima donna attitude sucks. this is still the internet. a
forum
that was designed WITH shorthand in mind. trust me, u will be hard
pressed
to compete proper english grammer with me.
First off, this is Usenet, part of the Internet which was design by an
English speaking military. Even if that wasn't the case,
comp.lang.java.programmer is an English newsgroup, and it is expected
that one uses coherent English when asking questions and writing
replies.
that said, i am not familiar with the customs
here and ur "welcome" came across very rude hence my reply.
He has informed you of the customs "here", and yet you still ignore
them.
i would however like to keep to the project at hand.

Okay, I have a suggestion then... I notice all over your code you have
lines like:
if (gameStage==8 && // 8 means: 1st card played and round has not yet
ended.

Okay, its great that you have commented what 8 means. It would be
even better if you refactored a little bit:

Step one: add a constant.
public static final int GAME_STAGE_MIDDLE_OF_ROUND = 8;
and use that instead:
if (gameStage == GAME_STAGE_MIDDLE_OF_ROUND &&


Step two: Introduce a self-documenting method:

public boolean isMiddleOfRound() {
return gameStage == GAME_STAGE_MIDDLE_OF_ROUND;
}

and replace your if again...
if (isMiddleOfRound() &&

Wow, look how much more legible that is! And no wasted time with
comments that may grow out of date.

Step three: Consider refactoring further to a finite-state-machine,
where gameStage is no longer an int, but instead a GameState object
which does different things depending on which state the Game is in.

I'm sorry if I was a little condescending in my post. You're response
was inappropriate to Joshua's. Most of the regular posters here will
ask that you use more formal English. Also, Joshua *did* give you
some useful suggestions.

Oh, and my suggestions about your code style aren't meant to be
demeaning at all, I too used to code like that, but I've learned after
17 years of programming that code should be as self-documenting as
possible.

Also, I have a few suggested books for you to read that will improve
your project significantly:
1. Java Concurrency In Practice (by Brian Goetz) <http://
www.javaconcurrencyinpractice.com/>
2. Refactoring (by Martin Fowler) and/or Refactoring To Patterns (by
Joshua Kerievsky)

The first book will help you understand how to handle multi-threaded
applications, and either of the two other books will help you design
clean and understandable programs.

I truly hope this helps,
Daniel.
 
A

adrian.bartholomew

(e-mail address removed) wrote:
ok i cant take it anymore. i need help!
let me describe my java solution as best i could pertaining to my
problem.
it is a card game. u know, server app as the brain and fancy gui for
the applet clients that u surf via "cardgame.com" for eg.
now....
the server side of things basically consists of a "ConnectionListener"
that listens for clients wanting to play (connect to the table). each
time it detects someone trying to connect, it spins of a
"PlayListener" thread who's main purpose is to listen to that client's
"plays".
so lets say we have 4 people playing the game, we have 1
ConnectionListener and 4 PlayListeners.
thats 5 threads.
all the methods of play reside in the main program CardGameServer.
dealCards(), playCard(), shuffleAnimation(), cutPack() etc.
now i like animation. a lot. u know, like a card shuffle animation or
the cards coming off the table 1 by 1 after a round of play.
this, i achieved by having the CardGameServer implement Runnable. in
the run() method there are many if(flag) clauses that,
if( flag==true), a particular animation is run. for eg.
Wouldn't it be better to handle animation in the client applet?
[scissor happy]
so when i want an animation performed, i simply switch one of these
flags to true.
when it enters, say, cutAnim(), the 1st line of code in cutAnim()
switches the flag back to false so theres no possibility of falsely re-
entering the animation.
the run routine is in an endless while(true) loop, forever searching
for "true" flags or robot plays.
if there is a better way of performing these animations without using
up valuable thread processing time, pleeeease let me know. i cant
imagine a 100 instances of the gameserver all continuously looping.
anyway, onward.
i have also created AI robots that u can assign to the table instead
of waiting indefinitely for human players to log in.
when its their turn to play, the endless run loop simply checks to see
if the player whose "currTurn" it is, is not human
(getPlayer(......currTurn).robot!=null and a host of other checks like
gameStage etc. once these meet the criteria, it goes into the AI code
to find the best play and does it.
the difference is, the AI's play is instigated from the thread
commanding the run() method of the CardGameServer class.
whereas the human's play is instigated from the playListener Class
which calls methods residing in the CardGameServer class.
the problem for me arises when i try to put a lock on the animation.
if i dont, sometimes it gets corrupted and the animation goes awry. in
the past (b4 i learned about the synchronized keyword), i suspend
either the playListener thread or the server thread, afterward
resuming. it worked fine except under a particular circumstance, if
the human did the shuffling and a robot cut the pack, the human would
hang when trying to make a play (maybe deadlock?).
added to the fact that these keywords are now defunct, i opted for a
cleaner design using synchronized.
ive tried adding wait() and notifyAll() but nothing works. either the
human hangs ot the robot hangs.
i need the animations to complete without any interference from a
human command coming in.
but i also need the damn thing to work. from start to finish no matter
what ratio of humans to robots are on the table
help.
I can't take it anymore, either. Usenet is not a text message
repository, nor is it a chat room. Therefore, take pains to write proper
English. Also, please try not to speak in slang (i.e., do not put "u
know" every few sentences).
It sounds as if your basic problem is that you're handling animation on
the server side. If so, then simple message passing between
client/server while forcing the client to handle the animation is much
simpler. This design would also ease the robot problem by allowing you
to spawn the custom "robot" client through Process, etc.
1st off. ur prima donna attitude sucks. this is still the internet. a
forum
that was designed WITH shorthand in mind. trust me, u will be hard
pressed
to compete proper english grammer with me.

First off, this is Usenet, part of the Internet which was design by an
English speaking military. Even if that wasn't the case,
comp.lang.java.programmer is an English newsgroup, and it is expected
that one uses coherent English when asking questions and writing
replies.


that said, i am not familiar with the customs
here and ur "welcome" came across very rude hence my reply.

He has informed you of the customs "here", and yet you still ignore
them.
i would however like to keep to the project at hand.

Okay, I have a suggestion then... I notice all over your code you have
lines like:
if (gameStage==8 && // 8 means: 1st card played and round has not yet
ended.

Okay, its great that you have commented what 8 means. It would be
even better if you refactored a little bit:

Step one: add a constant.
public static final int GAME_STAGE_MIDDLE_OF_ROUND = 8;
and use that instead:
if (gameStage == GAME_STAGE_MIDDLE_OF_ROUND &&

Step two: Introduce a self-documenting method:

public boolean isMiddleOfRound() {
return gameStage == GAME_STAGE_MIDDLE_OF_ROUND;

}

and replace your if again...
if (isMiddleOfRound() &&

Wow, look how much more legible that is! And no wasted time with
comments that may grow out of date.

Step three: Consider refactoring further to a finite-state-machine,
where gameStage is no longer an int, but instead a GameState object
which does different things depending on which state the Game is in.

I'm sorry if I was a little condescending in my post. You're response
was inappropriate to Joshua's. Most of the regular posters here will
ask that you use more formal English. Also, Joshua *did* give you
some useful suggestions.

Oh, and my suggestions about your code style aren't meant to be
demeaning at all, I too used to code like that, but I've learned after
17 years of programming that code should be as self-documenting as
possible.

Also, I have a few suggested books for you to read that will improve
your project significantly:
1. Java Concurrency In Practice (by Brian Goetz) <http://www.javaconcurrencyinpractice.com/>
2. Refactoring (by Martin Fowler) and/or Refactoring To Patterns (by
Joshua Kerievsky)

The first book will help you understand how to handle multi-threaded
applications, and either of the two other books will help you design
clean and understandable programs.

I truly hope this helps,
Daniel.

i will checkout the book.
thanks for the good idea about refactoring. i will heed ur advice.
thats so brilliant im pissed for not thinking about it myself.
i dont know about the finite game stage thing though.
a lot of the code depends on inequalties like if(gameStage>3 &&
gameStage<9){}.
i like the numerical idea cause sometimes a RANGE of proof is
necessary not just one particular state.
with ur idea though, i can use both.

now i dont mean to dismiss but this part actually works. what DOES NOT
work is the atomizing of the animations.
i am almost willing to offer u the job of debugging the animation
problem and bring this project to a professional state of completion.
would that be of interest to u?
im sure someone with ur many yrs of experience can do this in a couple
days.
let me know.
 
D

Daniel Pitts

On Mar 15, 3:57 pm, (e-mail address removed) wrote:
(e-mail address removed) wrote:
ok i cant take it anymore. i need help!
let me describe my java solution as best i could pertaining to my
problem.
it is a card game. u know, server app as the brain and fancy gui for
the applet clients that u surf via "cardgame.com" for eg.
now....
the server side of things basically consists of a "ConnectionListener"
that listens for clients wanting to play (connect to the table). each
time it detects someone trying to connect, it spins of a
"PlayListener" thread who's main purpose is to listen to that client's
"plays".
so lets say we have 4 people playing the game, we have 1
ConnectionListener and 4 PlayListeners.
thats 5 threads.
all the methods of play reside in the main program CardGameServer.
dealCards(), playCard(), shuffleAnimation(), cutPack() etc.
now i like animation. a lot. u know, like a card shuffle animation or
the cards coming off the table 1 by 1 after a round of play.
this, i achieved by having the CardGameServer implement Runnable. in
the run() method there are many if(flag) clauses that,
if( flag==true), a particular animation is run. for eg.
Wouldn't it be better to handle animation in the client applet?
[scissor happy]
so when i want an animation performed, i simply switch one of these
flags to true.
when it enters, say, cutAnim(), the 1st line of code in cutAnim()
switches the flag back to false so theres no possibility of falsely re-
entering the animation.
the run routine is in an endless while(true) loop, forever searching
for "true" flags or robot plays.
if there is a better way of performing these animations without using
up valuable thread processing time, pleeeease let me know. i cant
imagine a 100 instances of the gameserver all continuously looping.
anyway, onward.
i have also created AI robots that u can assign to the table instead
of waiting indefinitely for human players to log in.
when its their turn to play, the endless run loop simply checks to see
if the player whose "currTurn" it is, is not human
(getPlayer(......currTurn).robot!=null and a host of other checks like
gameStage etc. once these meet the criteria, it goes into the AI code
to find the best play and does it.
the difference is, the AI's play is instigated from the thread
commanding the run() method of the CardGameServer class.
whereas the human's play is instigated from the playListener Class
which calls methods residing in the CardGameServer class.
the problem for me arises when i try to put a lock on the animation.
if i dont, sometimes it gets corrupted and the animation goes awry. in
the past (b4 i learned about the synchronized keyword), i suspend
either the playListener thread or the server thread, afterward
resuming. it worked fine except under a particular circumstance, if
the human did the shuffling and a robot cut the pack, the human would
hang when trying to make a play (maybe deadlock?).
added to the fact that these keywords are now defunct, i opted for a
cleaner design using synchronized.
ive tried adding wait() and notifyAll() but nothing works. either the
human hangs ot the robot hangs.
i need the animations to complete without any interference from a
human command coming in.
but i also need the damn thing to work. from start to finish no matter
what ratio of humans to robots are on the table
help.
I can't take it anymore, either. Usenet is not a text message
repository, nor is it a chat room. Therefore, take pains to write proper
English. Also, please try not to speak in slang (i.e., do not put "u
know" every few sentences).
It sounds as if your basic problem is that you're handling animation on
the server side. If so, then simple message passing between
client/server while forcing the client to handle the animation is much
simpler. This design would also ease the robot problem by allowing you
to spawn the custom "robot" client through Process, etc.
1st off. ur prima donna attitude sucks. this is still the internet. a
forum
that was designed WITH shorthand in mind. trust me, u will be hard
pressed
to compete proper english grammer with me.
First off, this is Usenet, part of the Internet which was design by an
English speaking military. Even if that wasn't the case,
comp.lang.java.programmer is an English newsgroup, and it is expected
that one uses coherent English when asking questions and writing
replies.
He has informed you of the customs "here", and yet you still ignore
them.
Okay, I have a suggestion then... I notice all over your code you have
lines like:
if (gameStage==8 && // 8 means: 1st card played and round has not yet
ended.
Okay, its great that you have commented what 8 means. It would be
even better if you refactored a little bit:
Step one: add a constant.
public static final int GAME_STAGE_MIDDLE_OF_ROUND = 8;
and use that instead:
if (gameStage == GAME_STAGE_MIDDLE_OF_ROUND &&
Step two: Introduce a self-documenting method:
public boolean isMiddleOfRound() {
return gameStage == GAME_STAGE_MIDDLE_OF_ROUND;

and replace your if again...
if (isMiddleOfRound() &&
Wow, look how much more legible that is! And no wasted time with
comments that may grow out of date.
Step three: Consider refactoring further to a finite-state-machine,
where gameStage is no longer an int, but instead a GameState object
which does different things depending on which state the Game is in.
I'm sorry if I was a little condescending in my post. You're response
was inappropriate to Joshua's. Most of the regular posters here will
ask that you use more formal English. Also, Joshua *did* give you
some useful suggestions.
Oh, and my suggestions about your code style aren't meant to be
demeaning at all, I too used to code like that, but I've learned after
17 years of programming that code should be as self-documenting as
possible.
Also, I have a few suggested books for you to read that will improve
your project significantly:
1. Java Concurrency In Practice (by Brian Goetz) <http://www.javaconcurrencyinpractice.com/>
2. Refactoring (by Martin Fowler) and/or Refactoring To Patterns (by
Joshua Kerievsky)
The first book will help you understand how to handle multi-threaded
applications, and either of the two other books will help you design
clean and understandable programs.
I truly hope this helps,
Daniel.

i will checkout the book.
thanks for the good idea about refactoring. i will heed ur advice.
thats so brilliant im pissed for not thinking about it myself.
i dont know about the finite game stage thing though.
a lot of the code depends on inequalties like if(gameStage>3 &&
gameStage<9){}.
i like the numerical idea cause sometimes a RANGE of proof is
necessary not just one particular state.
with ur idea though, i can use both.

now i dont mean to dismiss but this part actually works. what DOES NOT
work is the atomizing of the animations.
i am almost willing to offer u the job of debugging the animation
problem and bring this project to a professional state of completion.
would that be of interest to u?
im sure someone with ur many yrs of experience can do this in a couple
days.
let me know.

I have a real job, just in case you thought I was looking for
something to do :)
I might be able to spare some time to help you get it into shape, but
it wouldn't be a priority for me.

BTW, if you can partition your gameState ranges in the right ways...
Assuming gameState 3 through 8 is something like "ActiveRound" (it
must mean SOMETHING to you)

interface GameState {
void doState();
}

abstract class ActiveRoundState extends GameState {
public void doState() {
doActiveRoundThings();
doMoreThings();
}

private doActiveRoundThings() {
// whatever goes here.
}
// Override to do more specific things.
protected abstract void doMoreThings();
}

class MiddleOfGameState extends ActiveRoudnState {
protected void doMoreThings() {
// something else goes here
}
}

----
Hopefully this makes sense. The concept is that almost any
conditional can be made into polymorphisms instead. Sometimes it
doesn't make sense, but it often does if you have a State (such as
GameState) :)

If you REALLY want me to take a look at your code, post it somewhere
that I can download it. If I have time, I'll see what I can do.

Hope this helps, and good luck.
Daniel.
 
A

adrian.bartholomew

That's the pot calling the kettle black, only Joshua was no kettle.

Grow up.

-- Lew

Lew.....chill baby.
ur the reason the word "nerd" exists.
u have NOTHING else to do? lol
 
A

adrian.bartholomew

On Mar 15, 6:26 pm, "Daniel Pitts" <[email protected]>
wrote:
On Mar 15, 3:57 pm, (e-mail address removed) wrote:
(e-mail address removed) wrote:
ok i cant take it anymore. i need help!
let me describe my java solution as best i could pertaining to my
problem.
it is a card game. u know, server app as the brain and fancy gui for
the applet clients that u surf via "cardgame.com" for eg.
now....
the server side of things basically consists of a "ConnectionListener"
that listens for clients wanting to play (connect to the table). each
time it detects someone trying to connect, it spins of a
"PlayListener" thread who's main purpose is to listen to that client's
"plays".
so lets say we have 4 people playing the game, we have 1
ConnectionListener and 4 PlayListeners.
thats 5 threads.
all the methods of play reside in the main program CardGameServer.
dealCards(), playCard(), shuffleAnimation(), cutPack() etc.
now i like animation. a lot. u know, like a card shuffle animation or
the cards coming off the table 1 by 1 after a round of play.
this, i achieved by having the CardGameServer implement Runnable. in
the run() method there are many if(flag) clauses that,
if( flag==true), a particular animation is run. for eg.
Wouldn't it be better to handle animation in the client applet?
[scissor happy]
so when i want an animation performed, i simply switch one of these
flags to true.
when it enters, say, cutAnim(), the 1st line of code in cutAnim()
switches the flag back to false so theres no possibility of falsely re-
entering the animation.
the run routine is in an endless while(true) loop, forever searching
for "true" flags or robot plays.
if there is a better way of performing these animations without using
up valuable thread processing time, pleeeease let me know. i cant
imagine a 100 instances of the gameserver all continuously looping.
anyway, onward.
i have also created AI robots that u can assign to the table instead
of waiting indefinitely for human players to log in.
when its their turn to play, the endless run loop simply checks to see
if the player whose "currTurn" it is, is not human
(getPlayer(......currTurn).robot!=null and a host of other checks like
gameStage etc. once these meet the criteria, it goes into the AI code
to find the best play and does it.
the difference is, the AI's play is instigated from the thread
commanding the run() method of the CardGameServer class.
whereas the human's play is instigated from the playListener Class
which calls methods residing in the CardGameServer class.
the problem for me arises when i try to put a lock on the animation.
if i dont, sometimes it gets corrupted and the animation goes awry. in
the past (b4 i learned about the synchronized keyword), i suspend
either the playListener thread or the server thread, afterward
resuming. it worked fine except under a particular circumstance, if
the human did the shuffling and a robot cut the pack, the human would
hang when trying to make a play (maybe deadlock?).
added to the fact that these keywords are now defunct, i opted for a
cleaner design using synchronized.
ive tried adding wait() and notifyAll() but nothing works. either the
human hangs ot the robot hangs.
i need the animations to complete without any interference from a
human command coming in.
but i also need the damn thing to work. from start to finish no matter
what ratio of humans to robots are on the table
help.
I can't take it anymore, either. Usenet is not a text message
repository, nor is it a chat room. Therefore, take pains to write proper
English. Also, please try not to speak in slang (i.e., do not put "u
know" every few sentences).
It sounds as if your basic problem is that you're handling animation on
the server side. If so, then simple message passing between
client/server while forcing the client to handle the animation is much
simpler. This design would also ease the robot problem by allowing you
to spawn the custom "robot" client through Process, etc.
1st off. ur prima donna attitude sucks. this is still the internet. a
forum
that was designed WITH shorthand in mind. trust me, u will be hard
pressed
to compete proper english grammer with me.
First off, this is Usenet, part of the Internet which was design by an
English speaking military. Even if that wasn't the case,
comp.lang.java.programmer is an English newsgroup, and it is expected
that one uses coherent English when asking questions and writing
replies.
that said, i am not familiar with the customs
here and ur "welcome" came across very rude hence my reply.
He has informed you of the customs "here", and yet you still ignore
them.
i would however like to keep to the project at hand.
Okay, I have a suggestion then... I notice all over your code you have
lines like:
if (gameStage==8 && // 8 means: 1st card played and round has not yet
ended.
Okay, its great that you have commented what 8 means. It would be
even better if you refactored a little bit:
Step one: add a constant.
public static final int GAME_STAGE_MIDDLE_OF_ROUND = 8;
and use that instead:
if (gameStage == GAME_STAGE_MIDDLE_OF_ROUND &&
Step two: Introduce a self-documenting method:
public boolean isMiddleOfRound() {
return gameStage == GAME_STAGE_MIDDLE_OF_ROUND;
}
and replace your if again...
if (isMiddleOfRound() &&
Wow, look how much more legible that is! And no wasted time with
comments that may grow out of date.
Step three: Consider refactoring further to a finite-state-machine,
where gameStage is no longer an int, but instead a GameState object
which does different things depending on which state the Game is in.
I'm sorry if I was a little condescending in my post. You're response
was inappropriate to Joshua's. Most of the regular posters here will
ask that you use more formal English. Also, Joshua *did* give you
some useful suggestions.
Oh, and my suggestions about your code style aren't meant to be
demeaning at all, I too used to code like that, but I've learned after
17 years of programming that code should be as self-documenting as
possible.
Also, I have a few suggested books for you to read that will improve
your project significantly:
1. Java Concurrency In Practice (by Brian Goetz) <http://www.javaconcurrencyinpractice.com/>
2. Refactoring (by Martin Fowler) and/or Refactoring To Patterns (by
Joshua Kerievsky)
The first book will help you understand how to handle multi-threaded
applications, and either of the two other books will help you design
clean and understandable programs.
I truly hope this helps,
Daniel.
i will checkout the book.
thanks for the good idea about refactoring. i will heed ur advice.
thats so brilliant im pissed for not thinking about it myself.
i dont know about the finite game stage thing though.
a lot of the code depends on inequalties like if(gameStage>3 &&
gameStage<9){}.
i like the numerical idea cause sometimes a RANGE of proof is
necessary not just one particular state.
with ur idea though, i can use both.
now i dont mean to dismiss but this part actually works. what DOES NOT
work is the atomizing of the animations.
i am almost willing to offer u the job of debugging the animation
problem and bring this project to a professional state of completion.
would that be of interest to u?
im sure someone with ur many yrs of experience can do this in a couple
days.
let me know.

I have a real job, just in case you thought I was looking for
something to do :)
I might be able to spare some time to help you get it into shape, but
it wouldn't be a priority for me.

BTW, if you can partition your gameState ranges in the right ways...
Assuming gameState 3 through 8 is something like "ActiveRound" (it
must mean SOMETHING to you)

interface GameState {
void doState();

}

abstract class ActiveRoundState extends GameState {
public void doState() {
doActiveRoundThings();
doMoreThings();
}

private doActiveRoundThings() {
// whatever goes here.
}
// Override to do more specific things.
protected abstract void doMoreThings();

}

class MiddleOfGameState extends ActiveRoudnState {
protected void doMoreThings() {
// something else goes here
}

}

----
Hopefully this makes sense. The concept is that almost any
conditional can be made into polymorphisms instead. Sometimes it
doesn't make sense, but it often does if you have a State (such as
GameState) :)

If you REALLY want me to take a look at your code, post it somewhere
that I can download it. If I have time, I'll see what I can do.

Hope this helps, and good luck.
Daniel.

yes ur design would make the code more everything. readable,
expandable, etc.
i wanna do it!
but thats not so much my problem as is the animation screwing up the
continuity. deadlocks abound.
i just had an idea, would it work if, instead of having an endless
loop look for a flag switched to true temporarily to then execute an
animation method, i have the animation activated from a temporarily
instantiated thread that vanishes after the animation is done?
 
D

Daniel Pitts

On Mar 15, 9:00 pm, "Daniel Pitts" <[email protected]>
wrote:
[snip a lot of old stuff]
I have a real job, just in case you thought I was looking for
something to do :)
I might be able to spare some time to help you get it into shape, but
it wouldn't be a priority for me.
BTW, if you can partition your gameState ranges in the right ways...
Assuming gameState 3 through 8 is something like "ActiveRound" (it
must mean SOMETHING to you)
interface GameState {
void doState();

abstract class ActiveRoundState extends GameState {
public void doState() {
doActiveRoundThings();
doMoreThings();
}
private doActiveRoundThings() {
// whatever goes here.
}
// Override to do more specific things.
protected abstract void doMoreThings();

class MiddleOfGameState extends ActiveRoudnState {
protected void doMoreThings() {
// something else goes here
}

----
Hopefully this makes sense. The concept is that almost any
conditional can be made into polymorphisms instead. Sometimes it
doesn't make sense, but it often does if you have a State (such as
GameState) :)
If you REALLY want me to take a look at your code, post it somewhere
that I can download it. If I have time, I'll see what I can do.
Hope this helps, and good luck.
Daniel.

yes ur design would make the code more everything. readable,
expandable, etc.
i wanna do it!
but thats not so much my problem as is the animation screwing up the
continuity. deadlocks abound.
i just had an idea, would it work if, instead of having an endless
loop look for a flag switched to true temporarily to then execute an
animation method, i have the animation activated from a temporarily
instantiated thread that vanishes after the animation is done?

That is one approach... It might be even better to use animated GIF
images instead, and let Java handle the animation for you.
Alternatively, you could use a javax.swing.Timer <http://java.sun.com/
j2se/1.5.0/docs/api/javax/swing/Timer.html> to manage the animation.
You would call timer.start() to enable the animation, and when the
animation was finished, have the ActionListener call timer.stop()

Swing is designed around the Single Thread pattern. Swing objects
should only be accessed by one thread. While it is possible to move
data to that thread in a safe manor, the more you can avoid that, the
cleaner your program becomes. The only time you should do anything on
a different thread is when you have a potentially long operation to
perform. Other wise you should stick to the event driven model and
have all your work on the EDT.

What this means is that you should NEVER block the EDT with
*anything*. For example, you should avoid synchronize(){}, wait(),
network connections, or anything else that could block execution.

Java Concurrency in Practice goes over this model in detail.
 
A

adrian.bartholomew

On Mar 15, 6:25 pm, (e-mail address removed) wrote:
On Mar 15, 6:26 pm, "Daniel Pitts" <[email protected]>
wrote:
On Mar 15, 3:57 pm, (e-mail address removed) wrote:
(e-mail address removed) wrote:
ok i cant take it anymore. i need help!
let me describe my java solution as best i could pertaining to my
problem.
it is a card game. u know, server app as the brain and fancy gui for
the applet clients that u surf via "cardgame.com" for eg.
now....
the server side of things basically consists of a "ConnectionListener"
that listens for clients wanting to play (connect to the table). each
time it detects someone trying to connect, it spins of a
"PlayListener" thread who's main purpose is to listen to that client's
"plays".
so lets say we have 4 people playing the game, we have 1
ConnectionListener and 4 PlayListeners.
thats 5 threads.
all the methods of play reside in the main program CardGameServer.
dealCards(), playCard(), shuffleAnimation(), cutPack() etc.
now i like animation. a lot. u know, like a card shuffle animation or
the cards coming off the table 1 by 1 after a round of play.
this, i achieved by having the CardGameServer implement Runnable. in
the run() method there are many if(flag) clauses that,
if( flag==true), a particular animation is run. for eg.
Wouldn't it be better to handle animation in the client applet?
[scissor happy]
so when i want an animation performed, i simply switch one of these
flags to true.
when it enters, say, cutAnim(), the 1st line of code in cutAnim()
switches the flag back to false so theres no possibility of falsely re-
entering the animation.
the run routine is in an endless while(true) loop, forever searching
for "true" flags or robot plays.
if there is a better way of performing these animations without using
up valuable thread processing time, pleeeease let me know. i cant
imagine a 100 instances of the gameserver all continuously looping.
anyway, onward.
i have also created AI robots that u can assign to the table instead
of waiting indefinitely for human players to log in.
when its their turn to play, the endless run loop simply checks to see
if the player whose "currTurn" it is, is not human
(getPlayer(......currTurn).robot!=null and a host of other checks like
gameStage etc. once these meet the criteria, it goes into the AI code
to find the best play and does it.
the difference is, the AI's play is instigated from the thread
commanding the run() method of the CardGameServer class.
whereas the human's play is instigated from the playListener Class
which calls methods residing in the CardGameServer class.
the problem for me arises when i try to put a lock on the animation.
if i dont, sometimes it gets corrupted and the animation goes awry. in
the past (b4 i learned about the synchronized keyword), i suspend
either the playListener thread or the server thread, afterward
resuming. it worked fine except under a particular circumstance, if
the human did the shuffling and a robot cut the pack, the human would
hang when trying to make a play (maybe deadlock?).
added to the fact that these keywords are now defunct, i opted for a
cleaner design using synchronized.
ive tried adding wait() and notifyAll() but nothing works. either the
human hangs ot the robot hangs.
i need the animations to complete without any interference from a
human command coming in.
but i also need the damn thing to work. from start to finish no matter
what ratio of humans to robots are on the table
help.
I can't take it anymore, either. Usenet is not a text message
repository, nor is it a chat room. Therefore, take pains to write proper
English. Also, please try not to speak in slang (i.e., do not put "u
know" every few sentences).
It sounds as if your basic problem is that you're handling animation on
the server side. If so, then simple message passing between
client/server while forcing the client to handle the animation is much
simpler. This design would also ease the robot problem by allowing you
to spawn the custom "robot" client through Process, etc.
1st off. ur prima donna attitude sucks. this is still the internet. a
forum
that was designed WITH shorthand in mind. trust me, u will be hard
pressed
to compete proper english grammer with me.
First off, this is Usenet, part of the Internet which was design by an
English speaking military. Even if that wasn't the case,
comp.lang.java.programmer is an English newsgroup, and it is expected
that one uses coherent English when asking questions and writing
replies.
that said, i am not familiar with the customs
here and ur "welcome" came across very rude hence my reply.
He has informed you of the customs "here", and yet you still ignore
them.
i would however like to keep to the project at hand.
Okay, I have a suggestion then... I notice all over your code you have
lines like:
if (gameStage==8 && // 8 means: 1st card played and round has not yet
ended.
Okay, its great that you have commented what 8 means. It would be
even better if you refactored a little bit:
Step one: add a constant.
public static final int GAME_STAGE_MIDDLE_OF_ROUND = 8;
and use that instead:
if (gameStage == GAME_STAGE_MIDDLE_OF_ROUND &&
Step two: Introduce a self-documenting method:
public boolean isMiddleOfRound() {
return gameStage == GAME_STAGE_MIDDLE_OF_ROUND;
}
and replace your if again...
if (isMiddleOfRound() &&
Wow, look how much more legible that is! And no wasted time with
comments that may grow out of date.
Step three: Consider refactoring further to a finite-state-machine,
where gameStage is no longer an int, but instead a GameState object
which does different things depending on which state the Game is in.
I'm sorry if I was a little condescending in my post. You're response
was inappropriate to Joshua's. Most of the regular posters here will
ask that you use more formal English. Also, Joshua *did* give you
some useful suggestions.
Oh, and my suggestions about your code style aren't meant to be
demeaning at all, I too used to code like that, but I've learned after
17 years of programming that code should be as self-documenting as
possible.
Also, I have a few suggested books for you to read that will improve
your project significantly:
1. Java Concurrency In Practice (by Brian Goetz) <http://www.javaconcurrencyinpractice.com/>
2. Refactoring (by Martin Fowler) and/or Refactoring To Patterns (by
Joshua Kerievsky)
The first book will help you understand how to handle multi-threaded
applications, and either of the two other books will help you design
clean and understandable programs.
I truly hope this helps,
Daniel.
i will checkout the book.
thanks for the good idea about refactoring. i will heed ur advice.
thats so brilliant im pissed for not thinking about it myself.
i dont know about the finite game stage thing though.
a lot of the code depends on inequalties like if(gameStage>3 &&
gameStage<9){}.
i like the numerical idea cause sometimes a RANGE of proof is
necessary not just one particular state.
with ur idea though, i can use both.
now i dont mean to dismiss but this part actually works. what DOES NOT
work is the atomizing of the animations.
i am almost willing to offer u the job of debugging the animation
problem and bring this project to a professional state of completion.
would that be of interest to u?
im sure someone with ur many yrs of experience can do this in a couple
days.
let me know.
I have a real job, just in case you thought I was looking for
something to do :)
I might be able to spare some time to help you get it into shape, but
it wouldn't be a priority for me.
BTW, if you can partition your gameState ranges in the right ways...
Assuming gameState 3 through 8 is something like "ActiveRound" (it
must mean SOMETHING to you)
interface GameState {
void doState();

abstract class ActiveRoundState extends GameState {
public void doState() {
doActiveRoundThings();
doMoreThings();
}
private doActiveRoundThings() {
// whatever goes here.
}
// Override to do more specific things.
protected abstract void doMoreThings();

class MiddleOfGameState extends ActiveRoudnState {
protected void doMoreThings() {
// something else goes here
}

----
Hopefully this makes sense. The concept is that almost any
conditional can be made into polymorphisms instead. Sometimes it
doesn't make sense, but it often does if you have a State (such as
GameState) :)
If you REALLY want me to take a look at your code, post it somewhere
that I can download it. If I have time, I'll see what I can do.
Hope this helps, and good luck.
Daniel.

yes ur design would make the code more everything. readable,
expandable, etc.
i wanna do it!
but thats not so much my problem as is the animation screwing up the
continuity. deadlocks abound.
i just had an idea, would it work if, instead of having an endless
loop look for a flag switched to true temporarily to then execute an
animation method, i have the animation activated from a temporarily
instantiated thread that vanishes after the animation is done?

hey...email me: adrian...at...bartholomusic...d.ooo.t...coooooommmmm
and ill send u the code for u to take a look at. thanks so very much
daniel.
 
J

Joshua Cranmer

1st off. ur prima donna attitude sucks. this is still the internet. a
forum
that was designed WITH shorthand in mind. trust me, u will be hard
pressed
to compete proper english grammer with me.
"To compete proper English grammar with me"? That doesn't bode too well.
that said, i am not familiar with the customs
here and ur "welcome" came across very rude hence my reply.
i would however like to keep to the project at hand.
ur suggestion is well taken and i am impressed with ur speed in
understanding my project.
i do want my server to also be gui based. which is how it is now,
where u can see
This is something you should have mentioned in the problem statement,
then. If someone doesn't know what's going on, he or she can only
assume, and assumptions have this nasty habit of being wrong.
all 4 hands of the players and the animations run just like the
clients do. of course, just
a simple server with a brain and message passing would be simpler but
i 1st wrote
the program as the server then i copied it and whittled it down to a
client version where
most of the "brains" of the game were taken out and left for the
server to do.
this left me with a server that had an impressive gui, so y waste it?
it also helps in the debugging and programming of the AI's as i can
see all the hands
without having to open 4 clients.

but where the animation i concerned, is there a different way to do it
on the server side?
also, what did u mean by 'spawn the custom "robot" client through
Process'?
I meant that your client might be better spawned off in a separate
process, a la C's fork() command.
 
A

adrian.bartholomew

"To compete proper English grammar with me"? That doesn't bode too well.


This is something you should have mentioned in the problem statement,
then. If someone doesn't know what's going on, he or she can only
assume, and assumptions have this nasty habit of being wrong.





I meant that your client might be better spawned off in a separate
process, a la C's fork() command.

sorry monsieur.
"..to compete in the 'proper english grammer arena' with moi..."
is that ok with his highness?

my client IS spawned off ala my original "problem" post. my problem is
not the Client.
 
A

adrian.bartholomew

That is one approach... It might be even better to use animated GIF
images instead, and let Java handle the animation for you.
Alternatively, you could use a javax.swing.Timer <http://java.sun.com/
j2se/1.5.0/docs/api/javax/swing/Timer.html> to manage the animation.
You would call timer.start() to enable the animation, and when the
animation was finished, have the ActionListener call timer.stop()

Swing is designed around the Single Thread pattern. Swing objects
should only be accessed by one thread. While it is possible to move
data to that thread in a safe manor, the more you can avoid that, the
cleaner your program becomes. The only time you should do anything on
a different thread is when you have a potentially long operation to
perform. Other wise you should stick to the event driven model and
have all your work on the EDT.

What this means is that you should NEVER block the EDT with
*anything*. For example, you should avoid synchronize(){}, wait(),
network connections, or anything else that could block execution.

Java Concurrency in Practice goes over this model in detail.

i purchased it last night. thanks for the heads up.
i also already did the inner class thread thing for the animations.
its KINDA workin. i still need a way to order the spun off animations
so they act when they supposed to.
 
L

Lew

... is that ok with his highness?

Calm down. We all get our egos poked here - I certainly have earned my share
of pokes. Just relax and let the natural topic resurface.

Joshua's remark was a way of saying that your challenge to a grammar
competition carried within its ungrammatical expression a prediction ("does
not bode well") that you would not fare well in the contest. He even quietly
corrected two of your spelling errors. I doubt very much that any harm was
intended. You did open the door by issuing an ungrammatical challenge to a
grammar contest.

That said, you've been getting what seems to be some very useful help with
your technical difficulties. Let's not drive away the beneficent spirits by
being too quick to offense. One way to attract more assistance is to take the
respectful care to communicate clearly and politely.

-- Lew
 
P

Patricia Shanahan

1st off. ur prima donna attitude sucks. this is still the internet. a
forum
that was designed WITH shorthand in mind. trust me, u will be hard
pressed
to compete proper english grammer with me.
....

I don't usually get involved in the grammar fights - I just don't
respond to postings that seem to me to be unnecessarily unreadable.

However, this quote contains two factual statements that I don't agree with:

1. This forum is comp.lang.java.programmer, a USENET newsgroup. When I
started using USENET it was based on UUCP. The Internet is just a
convenient means of communicating with a server and for servers to
exchange articles, not essential to a distributed newsgroup system.

2. Can you supply some evidence for the proposition that the Internet
was "designed WITH shorthand in mind."? The Internet protocols seem
to me to be completely neutral about grammar and spelling in the text
content of packets.

I've only noticed a high level of use of your style of shorthand in
the last few years. From both the timing and its nature, I assumed it
was related to the spread of text messaging using devices with crippled
text input, such as cell phones.

Patricia
 
A

adrian.bartholomew

(e-mail address removed) wrote:

...> 1st off. ur prima donna attitude sucks. this is still the internet. a

...

I don't usually get involved in the grammar fights - I just don't
respond to postings that seem to me to be unnecessarily unreadable.

However, this quote contains two factual statements that I don't agree with:

1. This forum is comp.lang.java.programmer, a USENET newsgroup. When I
started using USENET it was based on UUCP. The Internet is just a
convenient means of communicating with a server and for servers to
exchange articles, not essential to a distributed newsgroup system.

2. Can you supply some evidence for the proposition that the Internet
was "designed WITH shorthand in mind."? The Internet protocols seem
to me to be completely neutral about grammar and spelling in the text
content of packets.

I've only noticed a high level of use of your style of shorthand in
the last few years. From both the timing and its nature, I assumed it
was related to the spread of text messaging using devices with crippled
text input, such as cell phones.

Patricia

interesting twist.
i grew up within a family of school principals (mother and
grandfather) and english majors being corrected at every turn.
sometimes punished, so serious an offense in my home it was.
yes i agree with the late slackness or laziness in text communication
online. but understand where i am coming from.
when we get our heads "out of our asses" (really, it is the perfect
slang in this situation in my opinion) we would realize that the
COMMUNICATION is the foremost priority.
it is extremely funny to me, coming from a british background in
education, to be corrected by an american, whose constant bastardizing
of the english language sets off many heated debates around the world.
americans have changed spelling and pronunciations (note...not
pronounciations...as is so the american way) that really should not be
changed. for eg. the coveted "our" suffix (the plural of which is
"suffices" and not "suffixes") that make the language beautiful has
been changed to "or" in many words and conveniently left as is in
some. the "r" in "hour, for e.g., was never meant to be pronounced,
hence the spelling. listen to any well bred person in any english
speaking country other than america.
i CAN spell and am impeccable with my grammar when i need to be. and
this is not that place. what seemed funny to my previous critiques
(which brings to mind the bastardized "check" as opposed to "cheque",
a whole "nuther" word), was still me not caring about the
correctedness of my typing text online. i was not trying to be
grammatically correct. that was the whole point. they just didnt get
it. i dont care.

wise men walk all the way around a tree to end up right back at the
beginning, much the wiser. Miles Davis once said, learn all u can
about ur instrument. everything there is to know about it. then forget
everything u learnt.
at that point, u need to prove no more. feel.
who cares about if i use shorthand. they can all FEEL what im saying.
this...is true understanding.
not the forum for this topic, i apologize.

thanks for listening Patricia.
 
A

Andrew Thompson

On Mar 17, 8:59 pm, (e-mail address removed) wrote:
...
who cares about if i use shorthand. they can all FEEL what im saying.

will be gr8 when all ths ppl go away and u
get to talk to all ppl just like u

A.
 
P

Patricia Shanahan

interesting twist.

So why didn't you bother to reply to either of my specific points on the
history and nature of newsgroups?

....
it is extremely funny to me, coming from a british background in
education, to be corrected by an american, whose constant bastardizing
of the english language sets off many heated debates around the world.
americans have changed spelling and pronunciations (note...not
pronounciations...as is so the american way) that really should not be
changed. for eg. the coveted "our" suffix (the plural of which is
"suffices" and not "suffixes") that make the language beautiful has
been changed to "or" in many words and conveniently left as is in
some. the "r" in "hour, for e.g., was never meant to be pronounced,
hence the spelling. listen to any well bred person in any english
speaking country other than america.

I am English, but live in California. The fact that you seem to think
I'm American is a nice demonstration of the quality of my American
dialect writing.

I use American spelling in contexts where American is the more
conventional dialect. That includes newsgroups where the majority of
readers are likely to be more familiar with American, business writing
within US-based corporations, academic papers submitted to American
publications, and e-mail to my American friends.

I switch my spell checker over to English spellings when I'm writing to
my mother. She can read American, but is more familiar with English. The
point is that, because my objective is to communicate, I try to make my
writing as readable as possible for my audience.
i CAN spell and am impeccable with my grammar when i need to be. and
this is not that place. what seemed funny to my previous critiques
(which brings to mind the bastardized "check" as opposed to "cheque",
a whole "nuther" word), was still me not caring about the
correctedness of my typing text online. i was not trying to be
grammatically correct. that was the whole point. they just didnt get
it. i dont care.

I know you don't care.
wise men walk all the way around a tree to end up right back at the
beginning, much the wiser. Miles Davis once said, learn all u can
about ur instrument. everything there is to know about it. then forget
everything u learnt.
at that point, u need to prove no more. feel.
who cares about if i use shorthand. they can all FEEL what im saying.
this...is true understanding.

No, I feel the meaning when I look at conventional English or American
writing. To read what you call "shorthand" I have to slow down and sound
out individual letters and words, just the way I did when I was learning
to read. Even then, there is often some guesswork involved.
not the forum for this topic, i apologize.

thanks for listening Patricia.

So how about responding to what I wrote?[

Patricia
 
L

Lew

when we get our heads "out of our asses" (really, it is the perfect
slang in this situation in my opinion) we would realize that the
COMMUNICATION is the foremost priority.

And yet, ironically, when people suggest a way to improve your communication
you cuss at us. Nice way to win friends and influence people, Dale Carnegie.

-- Lew
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,954
Messages
2,570,116
Members
46,704
Latest member
BernadineF

Latest Threads

Top