comp.lang.java.programmer
http://groups-beta.google.com/group/comp.lang.java.programmer
[EMAIL PROTECTED]

Today's topics:

* simple IF question if (newplayer == goalkeeper) {throw error} - 5 messages, 
2 authors
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/f48598d0a1b3fad3
* exception handling problem - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/75dffc1e26b79688
* Classes SSH-SCP for Java - 2 messages, 2 authors
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/b78404f5308632ce
* Homework - Was Re: java programe help - 11 messages, 4 authors
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/8fddd0a49ac12937
* Append one array to another array - 4 messages, 3 authors
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/20154155911aad9d
* How to know if a CD is inserted in the cdrom drive from java ? - 3 messages, 3 
authors
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/b5d0b1b8567b852
* How can i block java web start from downloading jre .. but still launch app - 2 
messages, 2 authors
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/650db0305c405eb3
* When is the paint()-method called? - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/b2671f9dfd0b0f14
* Setting up a filter based on server name - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/801866155eeb6057
  
==========================================================================
TOPIC: simple IF question if (newplayer == goalkeeper) {throw error}
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/f48598d0a1b3fad3
==========================================================================

== 1 of 5 ==
Date:   Fri,   Oct 29 2004 2:25 am
From: "zcraven" <[EMAIL PROTECTED]> 


"Joona I Palaste" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> zcraven <[EMAIL PROTECTED]> scribbled the following
> on comp.lang.java.programmer:
> >> You said yourself that OutfieldPlayer and Goalkeeper are subtypes of
> >> Player, so I think the above should compile. I haven't seen your real
> >> code so I only have your word for this, and can't test it myself.
> >> Please post the exact message given by the compiler, along with the
> >> line it's complaining about.
>
> > this is the code:
> > -----------------------------------------------------------
> > public void setFirst11(Goalkeeper g1, OutfieldPlayer p2, OutfieldPlayer
> > p3, OutfieldPlayer p4, OutfieldPlayer p5, OutfieldPlayer p6,
OutfieldPlayer
> > p7,       OutfieldPlayer p8, OutfieldPlayer p9, OutfieldPlayer p10,
> > OutfieldPlayer p11)
>
> >     {
> >         if (g1 instanceof OutfieldPlayer){
> >             throw new IllegalArgumentException("You cannot put an
outfield
> > player in goal");
> >         }
>
> >         if (p2 instanceof Goalkeeper || p3 instanceof Goalkeeper || p4
> > instanceof Goalkeeper || p5 instanceof Goalkeeper ||
> >             p6 instanceof Goalkeeper || p7 instanceof Goalkeeper || p8
> > instanceof Goalkeeper || p9 instanceof Goalkeeper ||
> >             p10 instanceof Goalkeeper){
> >             throw new IllegalArgumentException("You cannot put a
goalkeeper
> > in an outfield position");
> >         }
> >     }
> > -----------------------------------------------------
>
> > It complains with 'inconvertible types' at this line:
>
> > public void setFirst11(Goalkeeper g1, OutfieldPlayer p2, OutfieldPlayer
> > p3, OutfieldPlayer p4, OutfieldPlayer p5, OutfieldPlayer p6,
OutfieldPlayer
> > p7,       OutfieldPlayer p8, OutfieldPlayer p9, OutfieldPlayer p10,
> > OutfieldPlayer p11)
>
> Ah yes. If you have defined your method parameters like that, then by
> the time your method is even called, you are already guaranteeing to
> the compiler that g1 is of type Goalkeeper and p2 through p11 are of
> type OutfieldPlayer, so the whole if statement in the method becomes
> needless.
> I had thought that all parameters, both g1 and p2 through p11, were of
> type Player. If they are then the code I showed (for this method) should
> compile.
> Could you also show the code for the method that is calling this method?
>
> -- 
> /-- Joona Palaste ([EMAIL PROTECTED]) ------------- Finland --------\
> \-------------------------------------------------------- rules! --------/
> "I am looking for myself. Have you seen me somewhere?"
>    - Anon





== 2 of 5 ==
Date:   Fri,   Oct 29 2004 2:27 am
From: "zcraven" <[EMAIL PROTECTED]> 


"Joona I Palaste" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> zcraven <[EMAIL PROTECTED]> scribbled the following
> on comp.lang.java.programmer:
> >> You said yourself that OutfieldPlayer and Goalkeeper are subtypes of
> >> Player, so I think the above should compile. I haven't seen your real
> >> code so I only have your word for this, and can't test it myself.
> >> Please post the exact message given by the compiler, along with the
> >> line it's complaining about.
>
> > this is the code:
> > -----------------------------------------------------------
> > public void setFirst11(Goalkeeper g1, OutfieldPlayer p2, OutfieldPlayer
> > p3, OutfieldPlayer p4, OutfieldPlayer p5, OutfieldPlayer p6,
OutfieldPlayer
> > p7,       OutfieldPlayer p8, OutfieldPlayer p9, OutfieldPlayer p10,
> > OutfieldPlayer p11)
>
> >     {
> >         if (g1 instanceof OutfieldPlayer){
> >             throw new IllegalArgumentException("You cannot put an
outfield
> > player in goal");
> >         }
>
> >         if (p2 instanceof Goalkeeper || p3 instanceof Goalkeeper || p4
> > instanceof Goalkeeper || p5 instanceof Goalkeeper ||
> >             p6 instanceof Goalkeeper || p7 instanceof Goalkeeper || p8
> > instanceof Goalkeeper || p9 instanceof Goalkeeper ||
> >             p10 instanceof Goalkeeper){
> >             throw new IllegalArgumentException("You cannot put a
goalkeeper
> > in an outfield position");
> >         }
> >     }
> > -----------------------------------------------------
>
> > It complains with 'inconvertible types' at this line:
>
> > public void setFirst11(Goalkeeper g1, OutfieldPlayer p2, OutfieldPlayer
> > p3, OutfieldPlayer p4, OutfieldPlayer p5, OutfieldPlayer p6,
OutfieldPlayer
> > p7,       OutfieldPlayer p8, OutfieldPlayer p9, OutfieldPlayer p10,
> > OutfieldPlayer p11)
>
> Ah yes. If you have defined your method parameters like that, then by
> the time your method is even called, you are already guaranteeing to
> the compiler that g1 is of type Goalkeeper and p2 through p11 are of
> type OutfieldPlayer, so the whole if statement in the method becomes
> needless.
> I had thought that all parameters, both g1 and p2 through p11, were of
> type Player. If they are then the code I showed (for this method) should
> compile.
> Could you also show the code for the method that is calling this method?

public static Club createCLUBManUtd()
    {
        Club c1 = new Club("Man Utd");
        Goalkeeper g1 = new Goalkeeper(c1, "Peter", "Tom", "Schmeichal",
195, 1973, 8, 3);
        Goalkeeper g2 = new Goalkeeper(c1, "Roy", "Phil", "Carroll", 189,
1980, 9, 7);
        OutfieldPlayer p1 = new OutfieldPlayer(c1, "Micheal", "Abbey",
"Silvestre", 179, 1974, 12, 2, "defender");
        OutfieldPlayer p2 = new OutfieldPlayer(c1, "Rio", "John",
"Ferdinand", 185, 1967, 04, 25, "defender");
        OutfieldPlayer p3 = new OutfieldPlayer(c1, "Phil", "Bob", "Neville",
169, 1975, 11, 2, "defender");
        OutfieldPlayer p4 = new OutfieldPlayer(c1, "Gary", "Steve",
"Neville", 166, 1974, 2, 2, "defender");
        OutfieldPlayer p5 = new OutfieldPlayer(c1, "Claude", "Scot",
"Heinz", 159, 1969, 2, 4, "defender");
        OutfieldPlayer p6 = new OutfieldPlayer(c1, "Christaino", "Alex",
"Ronaldo", 178, 1982, 10, 12, "midfielder");
        OutfieldPlayer p7 = new OutfieldPlayer(c1, "Ryan", "Jamie", "Giggs",
195, 1973, 1, 2, "midfielder");
        OutfieldPlayer p8 = new OutfieldPlayer(c1, "Paul", "John",
"Scholes", 179, 1973, 4, 7, "midfielder");
        OutfieldPlayer p9 = new OutfieldPlayer(c1, "Wayne", "OAP", "Rooney",
175, 1975, 3, 7, "striker");
        OutfieldPlayer p10 = new OutfieldPlayer(c1, "Loius", "Sean", "Saha",
177, 1976, 9, 12, "striker");
        OutfieldPlayer p11 = new OutfieldPlayer(c1, "Ruud", "Stan", "Van
Nistelrooy", 180, 1977, 12, 9, "striker");
        OutfieldPlayer p12 = new OutfieldPlayer(c1, "Alan", "Steve",
"Smith", 179, 1980, 10, 10, "striker");
        c1.addPlayer(g1);
        c1.addPlayer(g2);
        c1.addPlayer(p1);
        c1.addPlayer(p2);
        c1.addPlayer(p3);
        c1.addPlayer(p4);
        c1.addPlayer(p5);
        c1.addPlayer(p6);
        c1.addPlayer(p7);
        c1.addPlayer(p8);
        c1.addPlayer(p9);
        c1.addPlayer(p10);
        c1.addPlayer(p11);
        c1.addPlayer(p12);
        c1.setFirst11(g1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11);
        c1.updateClubStats(0,2);
        c1.updateClubStats(0,4);  // creates equal points and goal
difference to arsenal, but a higher goals scored.
        c1.updateClubStats(0,0);

        return c1;
    }

This is a 'test data' method that creates a club.  this is the only method
so far that calls the club.setFirst11 method.

Probably I will change all the values in the setFirst11 method header to
'Player', and then check them for goalkeeper/outfield as you suggested.





== 3 of 5 ==
Date:   Fri,   Oct 29 2004 2:29 am
From: "zcraven" <[EMAIL PROTECTED]> 

i know, but this method is just for picking the team before the match
starts - the program is not that complicated to update the team throughout a
match etc.

zac



"Big Jim" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Most important though, you do realise an outfield player can go in goal
e.g.
> if the keeper gets injured and all the subs have been used.
> A goalkeeper can swap with a player and play out too, as long as they
notify
> the ref of the change.
> The Mexican keeper in the last world cup, Campo I think he was called, was
> also a very good centre forward!
>
> "zcraven" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > if (p2,p3,p4==Goalkeeper)
> >         {
> >             throw new IllegalArgumentException("You cannot put a
> goalkeeper
> > in an   outfield position");
> >         }
> >
> >
> > I want to check that the variables p2 to p11 are of class OutfieldPlayer
> and
> > not Goalkeeper (Both OutfieldPlayer and Goalkeeper are subtypes of
> abstract
> > class Player).  How do I write an if to check that the variables are of
a
> > certain class?
> >
> > Thanks,
> > Zac
> >
> >
>
>





== 4 of 5 ==
Date:   Fri,   Oct 29 2004 2:53 am
From: Joona I Palaste <[EMAIL PROTECTED]> 

zcraven <[EMAIL PROTECTED]> scribbled the following
on comp.lang.java.programmer:
> "Joona I Palaste" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
>> Ah yes. If you have defined your method parameters like that, then by
>> the time your method is even called, you are already guaranteeing to
>> the compiler that g1 is of type Goalkeeper and p2 through p11 are of
>> type OutfieldPlayer, so the whole if statement in the method becomes
>> needless.
>> I had thought that all parameters, both g1 and p2 through p11, were of
>> type Player. If they are then the code I showed (for this method) should
>> compile.
>> Could you also show the code for the method that is calling this method?

> public static Club createCLUBManUtd()
>     {
>         Club c1 = new Club("Man Utd");
>         Goalkeeper g1 = new Goalkeeper(c1, "Peter", "Tom", "Schmeichal",
> 195, 1973, 8, 3);
>         Goalkeeper g2 = new Goalkeeper(c1, "Roy", "Phil", "Carroll", 189,
> 1980, 9, 7);
>         OutfieldPlayer p1 = new OutfieldPlayer(c1, "Micheal", "Abbey",
> "Silvestre", 179, 1974, 12, 2, "defender");
>         OutfieldPlayer p2 = new OutfieldPlayer(c1, "Rio", "John",
> "Ferdinand", 185, 1967, 04, 25, "defender");
>         OutfieldPlayer p3 = new OutfieldPlayer(c1, "Phil", "Bob", "Neville",
> 169, 1975, 11, 2, "defender");
>         OutfieldPlayer p4 = new OutfieldPlayer(c1, "Gary", "Steve",
> "Neville", 166, 1974, 2, 2, "defender");
>         OutfieldPlayer p5 = new OutfieldPlayer(c1, "Claude", "Scot",
> "Heinz", 159, 1969, 2, 4, "defender");
>         OutfieldPlayer p6 = new OutfieldPlayer(c1, "Christaino", "Alex",
> "Ronaldo", 178, 1982, 10, 12, "midfielder");
>         OutfieldPlayer p7 = new OutfieldPlayer(c1, "Ryan", "Jamie", "Giggs",
> 195, 1973, 1, 2, "midfielder");
>         OutfieldPlayer p8 = new OutfieldPlayer(c1, "Paul", "John",
> "Scholes", 179, 1973, 4, 7, "midfielder");
>         OutfieldPlayer p9 = new OutfieldPlayer(c1, "Wayne", "OAP", "Rooney",
> 175, 1975, 3, 7, "striker");
>         OutfieldPlayer p10 = new OutfieldPlayer(c1, "Loius", "Sean", "Saha",
> 177, 1976, 9, 12, "striker");
>         OutfieldPlayer p11 = new OutfieldPlayer(c1, "Ruud", "Stan", "Van
> Nistelrooy", 180, 1977, 12, 9, "striker");
>         OutfieldPlayer p12 = new OutfieldPlayer(c1, "Alan", "Steve",
> "Smith", 179, 1980, 10, 10, "striker");

Declare these variables as type Player, for example:
         Player g1 = new Goalkeeper(c1, "Peter", "Tom", "Schmeichal",
195, 1973, 8, 3);
         Player p1 = new OutfieldPlayer(c1, "Micheal", "Abbey",
"Silvestre", 179, 1974, 12, 2, "defender");

Note that only the variable can be of type Player. The actual objects
still need to be Goalkeepers and OutfieldPlayers.

>         c1.addPlayer(g1);
>         c1.addPlayer(g2);
>         c1.addPlayer(p1);
>         c1.addPlayer(p2);
>         c1.addPlayer(p3);
>         c1.addPlayer(p4);
>         c1.addPlayer(p5);
>         c1.addPlayer(p6);
>         c1.addPlayer(p7);
>         c1.addPlayer(p8);
>         c1.addPlayer(p9);
>         c1.addPlayer(p10);
>         c1.addPlayer(p11);
>         c1.addPlayer(p12);
>         c1.setFirst11(g1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11);

If the variables are of type Player, you can define setFirst11() as
setFirst11(Player g1, Player p2, Player p3, Player p4, Player p5,
Player p6, Player p7, Player p8, Player p9, Player p10, Player p11)
which will make the code I suggested work.

>         c1.updateClubStats(0,2);
>         c1.updateClubStats(0,4);  // creates equal points and goal
> difference to arsenal, but a higher goals scored.
>         c1.updateClubStats(0,0);

>         return c1;
>     }

> This is a 'test data' method that creates a club.  this is the only method
> so far that calls the club.setFirst11 method.

> Probably I will change all the values in the setFirst11 method header to
> 'Player', and then check them for goalkeeper/outfield as you suggested.

Yes, that's exactly right.
That solves this problem, but as has been said before, your code also
has a design problem - you're using individual variables where you could
just as well be using an array. An array would make writing and
debugging your code much faster and easier.

-- 
/-- Joona Palaste ([EMAIL PROTECTED]) ------------- Finland --------\
\-------------------------------------------------------- rules! --------/
"As a boy, I often dreamed of being a baseball, but now we must go forward, not
backward, upward, not forward, and always whirling, whirling towards freedom!"
   - Kang



== 5 of 5 ==
Date:   Fri,   Oct 29 2004 4:55 am
From: "zcraven" <[EMAIL PROTECTED]> 

"Joona I Palaste" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> zcraven <[EMAIL PROTECTED]> scribbled the following
> on comp.lang.java.programmer:
> > "Joona I Palaste" <[EMAIL PROTECTED]> wrote in message
> > news:[EMAIL PROTECTED]
> >> Ah yes. If you have defined your method parameters like that, then by
> >> the time your method is even called, you are already guaranteeing to
> >> the compiler that g1 is of type Goalkeeper and p2 through p11 are of
> >> type OutfieldPlayer, so the whole if statement in the method becomes
> >> needless.
> >> I had thought that all parameters, both g1 and p2 through p11, were of
> >> type Player. If they are then the code I showed (for this method)
should
> >> compile.
> >> Could you also show the code for the method that is calling this
method?
>
> > public static Club createCLUBManUtd()
> >     {
> >         Club c1 = new Club("Man Utd");
> >         Goalkeeper g1 = new Goalkeeper(c1, "Peter", "Tom", "Schmeichal",
> > 195, 1973, 8, 3);
> >         Goalkeeper g2 = new Goalkeeper(c1, "Roy", "Phil", "Carroll",
189,
> > 1980, 9, 7);
> >         OutfieldPlayer p1 = new OutfieldPlayer(c1, "Micheal", "Abbey",
> > "Silvestre", 179, 1974, 12, 2, "defender");
> >         OutfieldPlayer p2 = new OutfieldPlayer(c1, "Rio", "John",
> > "Ferdinand", 185, 1967, 04, 25, "defender");
> >         OutfieldPlayer p3 = new OutfieldPlayer(c1, "Phil", "Bob",
"Neville",
> > 169, 1975, 11, 2, "defender");
> >         OutfieldPlayer p4 = new OutfieldPlayer(c1, "Gary", "Steve",
> > "Neville", 166, 1974, 2, 2, "defender");
> >         OutfieldPlayer p5 = new OutfieldPlayer(c1, "Claude", "Scot",
> > "Heinz", 159, 1969, 2, 4, "defender");
> >         OutfieldPlayer p6 = new OutfieldPlayer(c1, "Christaino", "Alex",
> > "Ronaldo", 178, 1982, 10, 12, "midfielder");
> >         OutfieldPlayer p7 = new OutfieldPlayer(c1, "Ryan", "Jamie",
"Giggs",
> > 195, 1973, 1, 2, "midfielder");
> >         OutfieldPlayer p8 = new OutfieldPlayer(c1, "Paul", "John",
> > "Scholes", 179, 1973, 4, 7, "midfielder");
> >         OutfieldPlayer p9 = new OutfieldPlayer(c1, "Wayne", "OAP",
"Rooney",
> > 175, 1975, 3, 7, "striker");
> >         OutfieldPlayer p10 = new OutfieldPlayer(c1, "Loius", "Sean",
"Saha",
> > 177, 1976, 9, 12, "striker");
> >         OutfieldPlayer p11 = new OutfieldPlayer(c1, "Ruud", "Stan", "Van
> > Nistelrooy", 180, 1977, 12, 9, "striker");
> >         OutfieldPlayer p12 = new OutfieldPlayer(c1, "Alan", "Steve",
> > "Smith", 179, 1980, 10, 10, "striker");
>
> Declare these variables as type Player, for example:
>          Player g1 = new Goalkeeper(c1, "Peter", "Tom", "Schmeichal",
> 195, 1973, 8, 3);
>          Player p1 = new OutfieldPlayer(c1, "Micheal", "Abbey",
> "Silvestre", 179, 1974, 12, 2, "defender");
>
> Note that only the variable can be of type Player. The actual objects
> still need to be Goalkeepers and OutfieldPlayers.
>
> >         c1.addPlayer(g1);
> >         c1.addPlayer(g2);
> >         c1.addPlayer(p1);
> >         c1.addPlayer(p2);
> >         c1.addPlayer(p3);
> >         c1.addPlayer(p4);
> >         c1.addPlayer(p5);
> >         c1.addPlayer(p6);
> >         c1.addPlayer(p7);
> >         c1.addPlayer(p8);
> >         c1.addPlayer(p9);
> >         c1.addPlayer(p10);
> >         c1.addPlayer(p11);
> >         c1.addPlayer(p12);
> >         c1.setFirst11(g1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11);
>
> If the variables are of type Player, you can define setFirst11() as
> setFirst11(Player g1, Player p2, Player p3, Player p4, Player p5,
> Player p6, Player p7, Player p8, Player p9, Player p10, Player p11)
> which will make the code I suggested work.
>
> >         c1.updateClubStats(0,2);
> >         c1.updateClubStats(0,4);  // creates equal points and goal
> > difference to arsenal, but a higher goals scored.
> >         c1.updateClubStats(0,0);
>
> >         return c1;
> >     }
>
> > This is a 'test data' method that creates a club.  this is the only
method
> > so far that calls the club.setFirst11 method.
>
> > Probably I will change all the values in the setFirst11 method header to
> > 'Player', and then check them for goalkeeper/outfield as you suggested.
>
> Yes, that's exactly right.
> That solves this problem, but as has been said before, your code also
> has a design problem - you're using individual variables where you could
> just as well be using an array. An array would make writing and
> debugging your code much faster and easier.
>
> -- 
> /-- Joona Palaste ([EMAIL PROTECTED]) ------------- Finland --------\

i know but i dont really understand how to get the players into that array.
it seems like i will still have to read in a load of players and put them
into an array, which is exactly what the setFirst11 method wants to do
anyway - so I would have the same bad code problem, PLUS an extra method
which doesnt do much.

zac






==========================================================================
TOPIC: exception handling problem
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/75dffc1e26b79688
==========================================================================

== 1 of 1 ==
Date:   Fri,   Oct 29 2004 2:23 am
From: "zcraven" <[EMAIL PROTECTED]> 

thanks everyone - i got it :-)






==========================================================================
TOPIC: Classes SSH-SCP for Java
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/b78404f5308632ce
==========================================================================

== 1 of 2 ==
Date:   Fri,   Oct 29 2004 2:24 am
From: "Xavier" <[EMAIL PROTECTED]> 

Hi,

> Learn how to use this really useful site called "Google".

Oh, yes ! How if I had not thought of it !

> www.google.com

Wouldn't this be ... "google" ?

.....

If I post the question, it's that I have already searched on the web !!

Xavier





== 2 of 2 ==
Date:   Fri,   Oct 29 2004 2:43 am
From: Michael Borgwardt <[EMAIL PROTECTED]> 

Xavier wrote:
> If I post the question, it's that I have already searched on the web !!

If we answer "Try Google" it's that we cannot imagine someone having alread
searched on the web and not having found something. Which means that there
are two possible explanations:

- You are very bad at using search engines, in which case "Learn to use Google"
   is the best solution to the problem.

- The SSH implementations that can so easily be found are not useable to you
   for some reason - in which case you should have TOLD us that reason so that
   we can help you find one that better matches your criteria.




==========================================================================
TOPIC: Homework - Was Re: java programe help
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/8fddd0a49ac12937
==========================================================================

== 1 of 11 ==
Date:   Fri,   Oct 29 2004 2:36 am
From: "Yogo" <n o s p a m> 

"Thomas Weidenfeller" wrote:

> Yogo wrote:
>> I think something should be added for the people in the newsgroup too: 
>> You don't feel the obligation to respond to homework questions only to 
>> point out that you won't / can't help someone because there is no code or 
>> the person hasn't done any research or the person ask that someone makes 
>> his/her homework etc.
>
> What makes you think that we have to silently tolerate all kinds of 
> behavior? Behavior which is often outright unethical. Why do you think we 
> should tolerate that these people insult our intelligence, waste our time 
> and abuse free resources?


Being sometimes a little bit more tolerant wouldn't hurt anyone. We're not 
talking about rapists and murderers here.

I find replies about homework only to tell that you won't help more time 
waisting than the questions about homework themselves.



> If it wouldn't be pointed out to these people that their behavior is 
> unacceptable here, we would soon be drowned in such requests.



Even if you don't reply to their requests? Would they keep and keep and keep 
posting like real spammers while they don't get any answer?



> Oh, and don't you think the regulars also have a right to learn something 
> more about Java instead of just doing free help desk work for lazy 
> students?



You don't have to do help desk for lazy students. You don't have to answer 
their questions.



Yogo





== 2 of 11 ==
Date:   Fri,   Oct 29 2004 3:09 am
From: Alex Hunsley <[EMAIL PROTECTED]> 

Tim Ward wrote:
> "Alex Hunsley" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> 
>>People in this group feel obliged to point out how posters could be
>>better helped, by changing how they post or by posting code examples.
>>The ultimate aim here is to make the newsgroup more useful and make
>>people more 'helpable'. What is wrong with that aim?
> 
> 
> Well, the answer to that question is obvious.
> 
> What's wrong is that it will produce more programmers that are actually any
> good at anything, and thus reduce the price for those of us who are there
> already.
> 
> Far better surely just to post answers to the homework questions so that the
> students never learn anything and never get jobs and never compete with us
> :-)

Good lord, you're right! :/



== 3 of 11 ==
Date:   Fri,   Oct 29 2004 3:09 am
From: Andrew Thompson <[EMAIL PROTECTED]> 

On Fri, 29 Oct 2004 11:36:00 +0200, Yogo wrote:

> I find replies about homework only to tell that you won't help ..

That is not the point.

It is not so much "We won't help", but "We won't help 
till you show some effort.  But why type that for the 
10th time today.  Read the group before you blurt out 
your excited question."

To imply that the people who encourage a high S/N 
"won't help" is just plain wrong.

The issue is perhaps, just how many words, and how politely,
do you need to be to tell a poster that they are acting in 
a way that is not advantageous to the group, themselves, or
the resolution of the problem at hand?

-- 
Andrew Thompson
http://www.PhySci.org/codes/  Web & IT Help
http://www.PhySci.org/  Open-source software suite
http://www.1point1C.org/  Science & Technology
http://www.LensEscapes.com/  Images that escape the mundane



== 4 of 11 ==
Date:   Fri,   Oct 29 2004 3:25 am
From: Alex Hunsley <[EMAIL PROTECTED]> 

Yogo wrote:
> "Thomas Weidenfeller" wrote:
> 
> 
>>Yogo wrote:
>>
>>>I think something should be added for the people in the newsgroup too: 
>>>You don't feel the obligation to respond to homework questions only to 
>>>point out that you won't / can't help someone because there is no code or 
>>>the person hasn't done any research or the person ask that someone makes 
>>>his/her homework etc.
>>
>>What makes you think that we have to silently tolerate all kinds of 
>>behavior? Behavior which is often outright unethical. Why do you think we 
>>should tolerate that these people insult our intelligence, waste our time 
>>and abuse free resources?
> 
> 
> 
> Being sometimes a little bit more tolerant wouldn't hurt anyone. We're not 
> talking about rapists and murderers here.

Yes, and our reaction to posters here is never anything like reaction 
would be to a rapist/murderer. What made you think of rapists and 
murderers? :/ how strange.

I do think that some of the regulars here (and I should maybe include 
myself in this) are a little short-tempered at times. But I'm talking 
more about the exact style of the response, and not the nature of the 
reponse.. I think the nature of regulars responses are fine for the 
majority.

> I find replies about homework only to tell that you won't help more time 
> waisting than the questions about homework themselves.

Then please blame the original poster who wants someone to do their 
homeowrk for them. To you it is appropriate just to ignore 
unethical/lazy requests, but to me (and others here I am sure) they 
merit replies, and what's more, *not* replying would ultimately hurt the 
group. The whole 'time wasting' thread business wouldn't be there at all 
if the homework cheats weren't trying it on (i.e. we wouldn't be replying).

>>If it wouldn't be pointed out to these people that their behavior is 
>>unacceptable here, we would soon be drowned in such requests.
> 
> 
> Even if you don't reply to their requests? Would they keep and keep and keep 
> posting like real spammers while they don't get any answer?

*Yes* -  I'm pretty certain that if someones post is just ignored, 
there's a fair chance they will repost it again some time later (perhaps 
even the same day, week, etc.)

Also, there would be more undesirable posts in general, since new 
readers wouldn't see the (negative) reactions to homework cheats etc. 
and think it was worth a go posting their homework.


>>Oh, and don't you think the regulars also have a right to learn something 
>>more about Java instead of just doing free help desk work for lazy 
>>students?
> 
> You don't have to do help desk for lazy students. You don't have to answer 
> their questions.


Exactly. And making this clear to them (when they're trying it on) is 
important and useful too.

alex






== 5 of 11 ==
Date:   Fri,   Oct 29 2004 4:09 am
From: "Yogo" <n o s p a m> 

"Alex Hunsley" wrote:
> Yogo wrote:
>>
>> Being sometimes a little bit more tolerant wouldn't hurt anyone. We're 
>> not talking about rapists and murderers here.
>
> Yes, and our reaction to posters here is never anything like reaction 
> would be to a rapist/murderer. What made you think of rapists and 
> murderers? :/ how strange.
>

Nothing in particular, feel free to change these words by others of the same 
strength.

> I do think that some of the regulars here (and I should maybe include 
> myself in this) are a little short-tempered at times.

I totally agree with that. But you are a bit gentle by saying "at times", at 
least for some of them.

> But I'm talking more about the exact style of the response, and not the 
> nature of the reponse.. I think the nature of regulars responses are fine 
> for the majority.

Yes, I think that's more the problem.

>
>> I find replies about homework only to tell that you won't help more time 
>> waisting than the questions about homework themselves.
>
> Then please blame the original poster who wants someone to do their 
> homeowrk for them. To you it is appropriate just to ignore unethical/lazy 
> requests, but to me (and others here I am sure) they merit replies, and 
> what's more, *not* replying would ultimately hurt the group. The whole 
> 'time wasting' thread business wouldn't be there at all if the homework 
> cheats weren't trying it on (i.e. we wouldn't be replying).
>

I should blame the original poster because I'm annoyed by YOUR reply? :-)

>>>If it wouldn't be pointed out to these people that their behavior is 
>>>unacceptable here, we would soon be drowned in such requests.
>>
>>
>> Even if you don't reply to their requests? Would they keep and keep and 
>> keep posting like real spammers while they don't get any answer?
>
> *Yes* -  I'm pretty certain that if someones post is just ignored, there's 
> a fair chance they will repost it again some time later (perhaps even the 
> same day, week, etc.)
>

I'm not certain of this. I think after a while they'll just stop posting or 
start asking why they never get answers (and that would a great time to tell 
them why).

> Also, there would be more undesirable posts in general, since new readers 
> wouldn't see the (negative) reactions to homework cheats etc. and think it 
> was worth a go posting their homework.
>

Maybe not if they see that homework cheats are not answered at all. But I 
don't think they read the group before posting anyway.


Yogo





== 6 of 11 ==
Date:   Fri,   Oct 29 2004 4:09 am
From: "Yogo" <n o s p a m> 

"Andrew Thompson" wrote:
>
> The issue is perhaps, just how many words, and how politely,
> do you need to be to tell a poster that they are acting in
> a way that is not advantageous to the group, themselves, or
> the resolution of the problem at hand?
>

What about just posting a link to the faq and asking the poster to read it 
before posting?



Yogo





== 7 of 11 ==
Date:   Fri,   Oct 29 2004 4:34 am
From: Andrew Thompson <[EMAIL PROTECTED]> 

On Fri, 29 Oct 2004 13:09:35 +0200, Yogo wrote:

> "Andrew Thompson" wrote:
>>
>> The issue is perhaps, just how many words, and how politely,
>> do you need to be to tell a poster that they are acting in
>> a way that is not advantageous to the group, themselves, or
>> the resolution of the problem at hand?
..
> What about just posting a link to the faq ..

Where have you *been*?
<http://google.com/groups?as_epq=javafaq&as_ugroup=comp.lang.java.*&as_uauthors=andrew+thompson>

> ..and asking the poster to read it before posting?

Should I also ask them to follow the link?

-- 
Andrew Thompson
http://www.PhySci.org/codes/  Web & IT Help
http://www.PhySci.org/  Open-source software suite
http://www.1point1C.org/  Science & Technology
http://www.LensEscapes.com/  Images that escape the mundane



== 8 of 11 ==
Date:   Fri,   Oct 29 2004 5:05 am
From: "Yogo" <n o s p a m> 

"Andrew Thompson" wrote:
> On Fri, 29 Oct 2004 13:09:35 +0200, Yogo wrote:
>
>> "Andrew Thompson" wrote:
>>>
>>> The issue is perhaps, just how many words, and how politely,
>>> do you need to be to tell a poster that they are acting in
>>> a way that is not advantageous to the group, themselves, or
>>> the resolution of the problem at hand?
> ..
>> What about just posting a link to the faq ..
>
> Where have you *been*?
> <http://google.com/groups?as_epq=javafaq&as_ugroup=comp.lang.java.*&as_uauthors=andrew+thompson>
>
>> ..and asking the poster to read it before posting?
>
> Should I also ask them to follow the link?
>

This wasn't meant to you personally Andrew...

Nevermind...

Yogo





== 9 of 11 ==
Date:   Fri,   Oct 29 2004 3:58 am
From: Sudsy <[EMAIL PROTECTED]> 

Alex Hunsley wrote:
<snip>
> *Yes* -  I'm pretty certain that if someones post is just ignored, 
> there's a fair chance they will repost it again some time later (perhaps 
> even the same day, week, etc.)
> 
> Also, there would be more undesirable posts in general, since new 
> readers wouldn't see the (negative) reactions to homework cheats etc. 
> and think it was worth a go posting their homework.
<snip>

I agree, and think that it's a very important point. You need to "nip it
in the bud" else you'll get the inevitable reposts. Bad enough that some
people think that this is a 24x7 help desk, ask for direct e-mail responses,
expect 1 hour turn-around times, etc.
People need to have realistic expectations. If it takes a well-placed
kick in the patootie to get the point across then so be it. It's not a
matter of being impolite; it's more of a "reality check".
Yogo: you obviously disagree and claim that you get "annoyed" by those
posts which represent attempts on the part of the regulars to maintain
good order. Given the volume of posts running counter to your position,
I believe that it would be fair to say that you're not likely to change
the behaviour of the majority. Get used to it or drop the group. Stop
whinging.

-- 
Java/J2EE/JSP/Struts/Tiles/C/UNIX consulting and remote development.




== 10 of 11 ==
Date:   Fri,   Oct 29 2004 5:18 am
From: "Yogo" <n o s p a m> 


"Sudsy" wrote:
> Yogo: you obviously disagree and claim that you get "annoyed" by those
> posts which represent attempts on the part of the regulars to maintain
> good order. Given the volume of posts running counter to your position,
> I believe that it would be fair to say that you're not likely to change
> the behaviour of the majority. Get used to it or drop the group. Stop
> whinging.
>

I am not whining and I'm free to say what I think and feel about "the 
regulars" and how things are going in this group. If you can't cope with it 
just put me in your killfile.


Yogo





== 11 of 11 ==
Date:   Fri,   Oct 29 2004 6:02 am
From: Andrew Thompson <[EMAIL PROTECTED]> 

On Fri, 29 Oct 2004 14:05:54 +0200, Yogo wrote:

> "Andrew Thompson" wrote:
>> On Fri, 29 Oct 2004 13:09:35 +0200, Yogo wrote:
>>
>>> "Andrew Thompson" wrote:
>>>>
>>>> The issue is perhaps, just how many words, and how politely,
>>>> do you need to be to tell a poster that they are acting in
>>>> a way that is not advantageous to the group, themselves, or
>>>> the resolution of the problem at hand?
>> ..
>>> What about just posting a link to the faq ..

Who are you actually referring to, here? *
..
>>> ..and asking the poster to read it before posting?
>>
>> Should I also ask them to follow the link?
> 
> This wasn't meant to you personally Andrew...

* Who *was* it meant for?  

It might have meant you were referring to yourself, but I see little 
evidence of you posting links, and the one link you did post..
<http://google.com/groups?selm=41792a41%240%24559%24e4fe514c%40news.xs4all.nl>
..said nothing about "and read it".  [  ;-)  ]

If you are not referring to yourself or myself posting
these links to an FAQ, who *are* you referring to?

Do you not think that the people that care should lead 
by example?  

If you are proposing posting a link for commonly asked 
questions, then how about you start doing just that?
It would take some of the load off those people who have
answered them many times before and might get a little terse
on the 518 repetition.

> Nevermind...

(shakes head sadly) But that is why we are in this thread.  
The people that 'nevermind' have plonked it long ago.

-- 
Andrew Thompson
http://www.PhySci.org/codes/  Web & IT Help
http://www.PhySci.org/  Open-source software suite
http://www.1point1C.org/  Science & Technology
http://www.LensEscapes.com/  Images that escape the mundane




==========================================================================
TOPIC: Append one array to another array
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/20154155911aad9d
==========================================================================

== 1 of 4 ==
Date:   Fri,   Oct 29 2004 2:48 am
From: "Tony Morris" <[EMAIL PROTECTED]> 


> Also note you can not call methods on Arrays, although they are Objects
> there is no API for them.

This is untrue.

Here is an example:

class X
{
 public static void main(String[] args)
 {
  int[] i = new int[]{6, 7, 8};

  System.out.println(i.toString());
  System.out.println(i.hashCode());
  System.out.println(i.equals(null));
 }
}





== 2 of 4 ==
Date:   Fri,   Oct 29 2004 4:26 am
From: "VisionSet" <[EMAIL PROTECTED]> 



"Tony Morris" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>
> > Also note you can not call methods on Arrays, although they are Objects
> > there is no API for them.
>
> This is untrue.
>
> Here is an example:
>
> class X
> {
>  public static void main(String[] args)
>  {
>   int[] i = new int[]{6, 7, 8};
>
>   System.out.println(i.toString());
>   System.out.println(i.hashCode());
>   System.out.println(i.equals(null));
>  }
> }

Of course, doh! Everything is an Object and inherits from Object (if it
isn't a primitive).
I suppose I meant it doesn't have its *OWN* public API.

--
Mike W





== 3 of 4 ==
Date:   Fri,   Oct 29 2004 4:31 am
From: Michael Borgwardt <[EMAIL PROTECTED]> 

VisionSet wrote:
>>>Also note you can not call methods on Arrays, although they are Objects
>>>there is no API for them.
>>
>>This is untrue.

[]

> Of course, doh! Everything is an Object and inherits from Object (if it
> isn't a primitive).
> I suppose I meant it doesn't have its *OWN* public API.

Actually, it has. Unlike Object instances, arrays have the public length field
and a public clone() method. See Java Language Specification section 10.7



== 4 of 4 ==
Date:   Fri,   Oct 29 2004 5:55 am
From: "VisionSet" <[EMAIL PROTECTED]> 



"Michael Borgwardt" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]

> > I suppose I meant it doesn't have its *OWN* public API.
>
> Actually, it has. Unlike Object instances, arrays have the public length
field
> and a public clone() method. See Java Language Specification section 10.7

I wonder why they didn't make it a length() method - would feel more
intuitive especially since you stumble across this very early in learning
the language.

How could they have included the Array type in the javadocs?

--
Mike W






==========================================================================
TOPIC: How to know if a CD is inserted in the cdrom drive from java ?
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/b5d0b1b8567b852
==========================================================================

== 1 of 3 ==
Date:   Fri,   Oct 29 2004 2:54 am
From: [EMAIL PROTECTED] (Toni) 

Hi guys,

> check out the JMF - Java Media Framework.  It has stuff for animation,
> graphics, MP3, etc...  there are native libs for windows. i dont know
> if it accesses cdroms directly. let us know...

Well I checked JMF quickly but I could not find anything related to
this topic. I am using those lines to see if a CD is in the drive or
not but nothing more.

String deviceName = "Z:\\"; // Z is the letter of my cd-drive
File deviceFile = new File(deviceName);
if (deviceFile.exists())
   System.out.println("CD is loaded");
else
   System.out.println("CD is NOT loaded");

But this fails if a cd is there and it is empty, so this does not help
much. I need something more precise that can check if cd is empty, cd
has data, or no cd. Anybody has any ideas that enable me to do
something like this.



== 2 of 3 ==
Date:   Fri,   Oct 29 2004 3:21 am
From: Andrew Thompson <[EMAIL PROTECTED]> 

On 29 Oct 2004 02:54:02 -0700, Toni wrote:

> String deviceName = "Z:\\"; // Z is the letter of my cd-drive

Is this for your personal use, or for other users as well?

That is an important point to establish as this is much easier
to achieve  for a single user than ..anybody.

In any case you should probably search for it through the ..
File.listRoots()

> File deviceFile = new File(deviceName);
> if (deviceFile.exists())
{
>    System.out.println("CD is loaded");
    File[] files = deviceFile.list();
    for (int ii=0; ii<files.length; ii++) {
        System.out.println( "File " + ii + ":\t " + files[ii] );
    }
}
> else
>    System.out.println("CD is NOT loaded");
> 
> But this fails if a cd is there and it is empty, ..

Read the Javadocs for File, all of them.
<http://java.sun.com/j2se/1.5.0/docs/api/java/io/File.html>

-- 
Andrew Thompson
http://www.PhySci.org/codes/  Web & IT Help
http://www.PhySci.org/  Open-source software suite
http://www.1point1C.org/  Science & Technology
http://www.LensEscapes.com/  Images that escape the mundane



== 3 of 3 ==
Date:   Fri,   Oct 29 2004 4:05 am
From: "Tony Morris" <[EMAIL PROTECTED]> 

boolean cd = JOptionPane.showConfirmDialog(null, "Is there a CD in there?
Tell the truth now.") == JOptionPane.YES_OPTION;

-- 
Tony Morris
http://xdweb.net/~dibblego/






==========================================================================
TOPIC: How can i block java web start from downloading jre .. but still launch app
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/650db0305c405eb3
==========================================================================

== 1 of 2 ==
Date:   Fri,   Oct 29 2004 3:27 am
From: "Peter Kirk" <peter> 

"Andrew Thompson" <[EMAIL PROTECTED]> skrev i en meddelelse
news:[EMAIL PROTECTED]
> On 28 Oct 2004 04:06:19 -0700, Glenn M wrote:
<cut>
> > i am adament that this application will work with jre 1.4.2 and want
> > to block this download of jre 1.3 but still run the java application
>
> ..despite the best advice from the developer that it requires 1.3?

If a java program runs under 1.3, shouldn't it also run under subsequent
versions of java?




== 2 of 2 ==
Date:   Fri,   Oct 29 2004 3:36 am
From: Andrew Thompson <[EMAIL PROTECTED]> 

On 29 Oct 2004 12:27:23 +0200, Peter Kirk wrote:

> "Andrew Thompson" <[EMAIL PROTECTED]> skrev i en meddelelse

>> On 28 Oct 2004 04:06:19 -0700, Glenn M wrote:
> <cut>
>>> i am adament that this application will work with jre 1.4.2 and want
>>> to block this download of jre 1.3 but still run the java application
>>
>> ..despite the best advice from the developer that it requires 1.3?
> 
> If a java program runs under 1.3, shouldn't it also run under subsequent
> versions of java?

Well, yes.  In a *perfect* world it *should*.  
This is the real world.  

Some versions of 1.4 were decidedly quirky, and broke 
things that worked in 1.3 (I'm hazy on the details).

To specify a 1.3.n version over 1.4 was quite common 
at one stage.

-- 
Andrew Thompson
http://www.PhySci.org/codes/  Web & IT Help
http://www.PhySci.org/  Open-source software suite
http://www.1point1C.org/  Science & Technology
http://www.LensEscapes.com/  Images that escape the mundane




==========================================================================
TOPIC: When is the paint()-method called?
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/b2671f9dfd0b0f14
==========================================================================

== 1 of 1 ==
Date:   Fri,   Oct 29 2004 3:34 am
From: bugbear <[EMAIL PROTECTED]> 

Paul H. van Rossem wrote:
> On 28-10-2004 20:38, Jesper Sahner wrote:
> 
>> Hi!
>>
>> A beginner's question: When is the paint()-method EXACTLY called in
>> the following little example?

Example snipped.

>>
>> Regards,
>> Jesper
> 
> You can find out these things by yourself as follows:

reverse engineering technique snipped.

Attempting to "find out" how a complex system works by
example based reverse engineering is poor development technique.

paint() is called in extremely well documented
circumstances; it's dramatically better to look up this
documentation than reverse engineer. Reverse enghineering
done in a half-arsed way may not reveal all possible circumstances
and permutations. Thorough reverse engineering may reveal
details of the implementation that may be subject to change.

Oh, and finally, there's a dedicated comp.lang.java.gui

     BugBear




==========================================================================
TOPIC: Setting up a filter based on server name
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/801866155eeb6057
==========================================================================

== 1 of 1 ==
Date:   Fri,   Oct 29 2004 5:57 am
From: [EMAIL PROTECTED] (MarkN) 

My situation is unique I guess.  There are several virtual hosts tied
to the same J2EE application (ColdFusionMX running on top of JRun4).


Mike H <[EMAIL PROTECTED]> wrote in message news:<[EMAIL PROTECTED]>...
> I'm assuming you're virtual hosting. Each virtual host has it's own
> and each host has its own web.xml file. It's in the web.xml for the
> particular host where you define the filter url-pattern that is
> relational to the virtual host. Unless I'm missing something.
> 
> 
> On 27 Oct 2004 15:20:51 -0700, [EMAIL PROTECTED] (MarkN) wrote:
> 
> >This question pertains to the Java Servlet specification.
> >
> >Is it possible to specify a <url-pattern> for a filter based on the
> >server name?
> >Trying to specify a url-pattern such as "www.bla.com/*" doesn't work. 
> >Am I missing something here or am I trying to do something that is not
> >supported.
> >
> >
> >Example (that does not work as intended):
> >
> >  <filter>
> >    <filter-name>TF</filter-name>
> >    <filter-class>TestFilter</filter-class>
> >  </filter>
> >                           
> >
> >  <filter-mapping>
> >    <filter-name>TF</filter-name>
> >    <url-pattern>www.bla.com/*</url-pattern>
> >  </filter-mapping>
> >
> >
> >Thanks for your time!



=======================================================================

You received this message because you are subscribed to the
Google Groups "comp.lang.java.programmer".  

comp.lang.java.programmer
[EMAIL PROTECTED]

Change your subscription type & other preferences:
* click http://groups-beta.google.com/group/comp.lang.java.programmer/subscribe

Report abuse:
* send email explaining the problem to [EMAIL PROTECTED]

Unsubscribe:
* click http://groups-beta.google.com/group/comp.lang.java.programmer/subscribe


=======================================================================
Google Groups: http://groups-beta.google.com 

Reply via email to