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

Today's topics:

* Character encoding between Win and *nix - 2 messages, 2 authors
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/d00907704bee1888
* sorting an ArrayList by int - 4 messages, 2 authors
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/127ea15b32732f1
* Type cast problem. - 3 messages, 3 authors
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/ab573cfd22a3a789
* How to create a JAR file - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/ea455ce0dfc0c521
* Arabic Text Rendering - 3 messages, 2 authors
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/b8eaff63afb0e5f7
* How to starthandshake with client browser?? - 3 messages, 2 authors
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/2d41b9d8f6879f8b
* A Jtidy question - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/101dc3467b393897
* How use java.util.logging.config.class? - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/3f086cadd5f41a7
* Logging configuration file w/ web start - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/647b28fc11be9145
* Enums in inner classes - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/7ecb6f0754c4b0df
* Classes SSH-SCP for Java - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/b78404f5308632ce
* unused methods and class - 2 messages, 2 authors
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/18983b9b8d7bad9c
* Interface design question - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/9a07ca46c4217868
* draw UML for java application - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/85657acd2418278b
* local search - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/fe99afb3cb58e3a0
* Unable to establish a socket connection - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/3db1070c05ec0b49
* Challenge: Triangles puzzle - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/5e013ca5d7daa5f0
* Floats become decimals when read from a resultset. - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/8e54b4c8e235131b
* Ant Deploy Task Help Needed!!!!! - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/c0e92f8078749598
  
==========================================================================
TOPIC: Character encoding between Win and *nix
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/d00907704bee1888
==========================================================================

== 1 of 2 ==
Date:   Wed,   Oct 27 2004 3:12 am
From: [EMAIL PROTECTED] 

Hi John,

Taking all of your considerations into account, I guess I'd be better
off using a HttpURLConnection, like somebody proposed earlier. The
problem is however, that in fact I'm supporting one other protocol as
well. I might however be able to catch off that possibility before
instantiating the HttpURLConnection, since the differentiation between
both protocols is based on the first byte. I've been struggling however
on how and where to instantiate the HttpURLConnection. Do you think I
should rewrite the framework?

I'm inserting some code snippets, trying to make things more clear...

// Server class

ServerSocket ss = new ServerSocket(port);
while (true)
{
Socket s = ss.accept();
Worker w = null;
...
synchronized(semaphore)
{
w = new Worker();
w.setSocket(s);
}
}



// Worker class

private Socket s;
private InputStream is;
private OutputStream os;


Worker()
{
s = null;
}

synchronized void setSocket(Socket s)
{
this.s = s;
notify();
}

public synchronized void run()
{
while (true)
{
if (s == null)
{
try
{
wait();
}
catch (InterruptedException e)
{
continue;
}
}
try
{
execute();
}
catch (Throwable e)
{
e.printStackTrace();
}
...
}
}

void execute()
throws Throwable
{
s.setSoTimeout(Server.timeout * 1000);
s.setTcpNoDelay(true);
is = new BufferedInputStream(s.getInputStream());
os = s.getOutputStream();

try
{
PushbackInputStream pis = new PushbackInputStream(is);
int pduType = pis.read();
pis.unread((byte)pduType);
if(pduType == 0x1) handleOtherProtocol()...

...
}
finally
{
try
{
is.close();
os.close();
}
finally
{
                s.close();
            }
        }
    }




== 2 of 2 ==
Date:   Wed,   Oct 27 2004 7:59 am
From: "John C. Bollinger" <[EMAIL PROTECTED]> 

[EMAIL PROTECTED] wrote:

> Hi John,
> 
> Taking all of your considerations into account, I guess I'd be better
> off using a HttpURLConnection, like somebody proposed earlier. The
> problem is however, that in fact I'm supporting one other protocol as
> well. I might however be able to catch off that possibility before
> instantiating the HttpURLConnection, since the differentiation between
> both protocols is based on the first byte. I've been struggling however
> on how and where to instantiate the HttpURLConnection. Do you think I
> should rewrite the framework?

The _server_ cannot use an HttpURLConnection.  The client would use one 
to *send* an HTTP request; if you need to receive and process HTTP 
requests then you need something else.  Have you considered writing your 
application as a web application using servlets?  The servlet 
architecture is designed for the kind of thing you are trying to do, at 
least on the HTTP side.  It might well be possible to get it to handle 
your other protocol as well, as the base Servlet class is not 
protocol-specific.  A big advantage of servlets is that the low-level 
details are handled for you, which relieves you of a major coding and 
maintenance burden.  I have never looked into the details of teaching 
Tomcat about protocols other than HTTP, but I think you'd still be ahead 
even if you had to put an adapter in front of an HTTP-only servlet to 
translate your other protocol(s) into HTTP.


John Bollinger
[EMAIL PROTECTED]





==========================================================================
TOPIC: sorting an ArrayList by int
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/127ea15b32732f1
==========================================================================

== 1 of 4 ==
Date:   Wed,   Oct 27 2004 4:20 am
From: "zcraven" <[EMAIL PROTECTED]> 

OK I did that and it works.  Next I made a 'top scorer' method which is
basically the same as the league, but instead of comparing clubs by points
scored, it compares players by goals scored. Why doesn't it work?

import java.util.*;

public class ScorersComparator implements Comparator
{
        public int compare(Object o1, Object o2)
    {
        Player p1 = (Player) o1;
        Player p2 = (Player) o2;
        int retval;
        int goals1 = p1.getGoalTally();
        int goals2 = p2.getGoalTally();
        return goals2 - goals1;
    }
}

when I call the method, the arraylist is empty so I get an error.





== 2 of 4 ==
Date:   Wed,   Oct 27 2004 4:56 am
From: "zcraven" <[EMAIL PROTECTED]> 


"zcraven" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> OK I did that and it works.  Next I made a 'top scorer' method which is
> basically the same as the league, but instead of comparing clubs by points
> scored, it compares players by goals scored. Why doesn't it work?
>
> import java.util.*;
>
> public class ScorersComparator implements Comparator
> {
>         public int compare(Object o1, Object o2)
>     {
>         Player p1 = (Player) o1;
>         Player p2 = (Player) o2;
>         int retval;
>         int goals1 = p1.getGoalTally();
>         int goals2 = p2.getGoalTally();
>         return goals2 - goals1;
>     }
> }
>
> when I call the method, the arraylist is empty so I get an error.
>
>

this is what i have so far (goldenboot means topscorer):

import java.util.*;
import java.lang.*;

public class League
{
// ########### FIELDS #########
public ArrayList league;
public ArrayList goldenboot;
private String leagueName;

// ########## CONSTRUCTORS ########
public League(String league_name)
{
league = new ArrayList();
goldenboot = new ArrayList();
leagueName = league_name;
}

// ########## METHODS ##########
public void sortScorers()
{
Collections.sort(goldenboot, new ScorersComparator());
}

public Player getTopScorer()
{
sortScorers();
return ((Player)goldenboot.get(0));
}

Where do i put the method to search all players and make a new collection of
scorers? At the moment the user is given a player name, and asked to type in
an INT for how many goals they scored. once this is done for the whole team
the players goal tallys are updated. so at that point I could add all
scorers to the leagues goldenboot collection. Or, I could have a method
'getScorers' that searchs all clubs for players that have scored and makes
the goldenboot collection from these.

which is better, and how would the code look?





== 3 of 4 ==
Date:   Wed,   Oct 27 2004 5:45 am
From: "zcraven" <[EMAIL PROTECTED]> 

"zcraven" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>
> "zcraven" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > OK I did that and it works.  Next I made a 'top scorer' method which is
> > basically the same as the league, but instead of comparing clubs by
points
> > scored, it compares players by goals scored. Why doesn't it work?
> >
> > import java.util.*;
> >
> > public class ScorersComparator implements Comparator
> > {
> >         public int compare(Object o1, Object o2)
> >     {
> >         Player p1 = (Player) o1;
> >         Player p2 = (Player) o2;
> >         int retval;
> >         int goals1 = p1.getGoalTally();
> >         int goals2 = p2.getGoalTally();
> >         return goals2 - goals1;
> >     }
> > }
> >
> > when I call the method, the arraylist is empty so I get an error.
> >
> >
>
> this is what i have so far (goldenboot means topscorer):
>
> import java.util.*;
> import java.lang.*;
>
> public class League
> {
> // ########### FIELDS #########
> public ArrayList league;
> public ArrayList goldenboot;
> private String leagueName;
>
> // ########## CONSTRUCTORS ########
> public League(String league_name)
> {
> league = new ArrayList();
> goldenboot = new ArrayList();
> leagueName = league_name;
> }
>
> // ########## METHODS ##########
> public void sortScorers()
> {
> Collections.sort(goldenboot, new ScorersComparator());
> }
>
> public Player getTopScorer()
> {
> sortScorers();
> return ((Player)goldenboot.get(0));
> }
>
> Where do i put the method to search all players and make a new collection
of
> scorers? At the moment the user is given a player name, and asked to type
in
> an INT for how many goals they scored. once this is done for the whole
team
> the players goal tallys are updated. so at that point I could add all
> scorers to the leagues goldenboot collection. Or, I could have a method
> 'getScorers' that searchs all clubs for players that have scored and makes
> the goldenboot collection from these.
>
> which is better, and how would the code look?
>
>

this is how i did it and it seems to work ok - any comments?

public void updateGoldenboot()
    {
        for (int i=0; i<league.size(); i++)
        {
            Club club = (Club)league.get(i);
            System.out.println("");
            System.out.println("Searching " + club.getClubName());
            ArrayList squad = club.getClubSquad();
            for (int j=0; j<squad.size(); j++)
            {
                Player player = (Player)squad.get(j);
                if (player.getGoalTally() > 0)
                {
                    goldenboot.add(player);
                    System.out.println(player.getPlayerName() + " (goaltally
is " + player.getGoalTally() + ") added to goldenboot collection");
                }
            }
        }
    }





== 4 of 4 ==
Date:   Wed,   Oct 27 2004 6:03 am
From: [EMAIL PROTECTED] (Bent C Dalager) 

In article <[EMAIL PROTECTED]>,
Eric Sosman  <[EMAIL PROTECTED]> wrote:
>    Now, I'll concede that the O.P. posed his problem in
>connection with the scores in a sports league, and it's
>probably the case that there are significantly fewer than
>ten thousand teams in his league.  If there are ten teams,
>say, an N lg N sort will need only about thirty-three
>comparisons, and questions of efficiency scarcely arise.
>But one of the biggest promises of the object-oriented
>Weltanschauung is code reuse, is it not?  Whether the
>promise will be (or even can be) kept is a topic for
>another day, but it surely will *not* be kept if people
>are taught to write code that relies on "N is small" and
>can't be extended to "N is moderate," much less "large."

This would be the difference between writing a general-purpose
algorithm for use in, say, a wide-spread collections API and writing a
custom algorithm for one specific use that you have complete knowledge
about.

In the case at hand, you could probably get away with using bubble
sort and creating a dozen temporary objects in the compare method. And
if that would make this particular piece of code significantly less
error-prone, more readable or more maintainable, then that is what you
should do.

If you are writing a general-purpose comparator for integers that is
likely to see wide-spread use in a variety of applications over which
you have no control, then this changes. In this case, the importance
of highly optimized performance overshadows the other needs and you
should choose the most effecient implementation possible even if that
does turn out to consist of an unreadable mess of obscure operators.

Cheers
        Bent D
-- 
Bent Dalager - [EMAIL PROTECTED] - http://www.pvv.org/~bcd
                                    powered by emacs




==========================================================================
TOPIC: Type cast problem.
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/ab573cfd22a3a789
==========================================================================

== 1 of 3 ==
Date:   Wed,   Oct 27 2004 4:19 am
From: [EMAIL PROTECTED] (wybrand) 

Hai fellow programmers. 

Can you please give me an answer to the following??

See next code-fragment:

class a {

        public static void main( String [] arg ) {
                short a;    
                int b;  

                // Implicit cast.
                a = 65;

                // Explicit cast which compiles.
                a = (int)65; 

                // Explicit cast which does not compile.
                b = (long)65;  
        }       
}

The first statement compiles because of implicit typecasting and there
is no loss of information (65 < 2^(16-1)-1).
The third one does not compile because we do an explicit typecast and
a long is 64 bytes and an integer is 32.
Why does the second statement compile?? A integer doesn't fit in a
short, just like a long does not fit in a integer (third statement).
It looks like if a implicit typecast takes place just like the fist
statement.

Thanks in advance.

Greetings,

Wybrand.



== 2 of 3 ==
Date:   Wed,   Oct 27 2004 4:32 am
From: Joona I Palaste <[EMAIL PROTECTED]> 

wybrand <[EMAIL PROTECTED]> scribbled the following:
> Hai fellow programmers. 

> Can you please give me an answer to the following??

What's wrong with the answers already given on this newsgroup?

-- 
/-- Joona Palaste ([EMAIL PROTECTED]) ------------- Finland --------\
\-------------------------------------------------------- rules! --------/
"When a man talks dirty to a woman, that's sexual harassment. When a woman talks
dirty to a man, that's 14.99 per minute + local telephone charges!"
   - Ruben Stiller



== 3 of 3 ==
Date:   Wed,   Oct 27 2004 7:37 am
From: Chris Smith <[EMAIL PROTECTED]> 

[EMAIL PROTECTED] says...
>                 short a;    
>                 int b;  
> 
>                 // Implicit cast.
>                 a = 65;
> 
>                 // Explicit cast which compiles.
>                 a = (int)65; 
> 
>                 // Explicit cast which does not compile.
>                 b = (long)65;  

> The first statement compiles because of implicit typecasting and there
> is no loss of information (65 < 2^(16-1)-1).
> The third one does not compile because we do an explicit typecast and
> a long is 64 bytes and an integer is 32.
> Why does the second statement compile?? A integer doesn't fit in a
> short, just like a long does not fit in a integer (third statement).
> It looks like if a implicit typecast takes place just like the fist
> statement.

The second statement is identical to the first, since the literal '65' 
is already an int.  The same rules for assignment conversion apply, and 
so it's no less likely to compile that the first statement.  These 
assignment conversion rules don't apply to 'long' variables, so the 
third statement fails to compile.  This is in JLS section 5.2, which you 
are free to read.

-- 
www.designacourse.com
The Easiest Way To Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation




==========================================================================
TOPIC: How to create a JAR file
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/ea455ce0dfc0c521
==========================================================================

== 1 of 1 ==
Date:   Wed,   Oct 27 2004 5:07 am
From: Andrew Thompson <[EMAIL PROTECTED]> 

On 27 Oct 2004 00:53:03 -0700, Samar Hossam wrote:

>> When you popped up again on this group, I decided to give
>> you the advice not to multi-post, 
> 
> It is very nice of you to give me an advice but you just lack the way
> you say it.

What?
"How many groups do you intend to multi-post this 
question to Samar?  Please don't multi-post.
<http://www.physci.org/codes/javafaq.jsp#xpost>"

Which part did I swear at you, or yell at you?
Where did I tell you to do, or not do, anything?

Which bit offended you, and how?

>>which is something I do to ensure the groups do not become infested
> by >yelling idiots that have an over-developed sense of their own
> importance.
> 
> Again, this is very impolite of you.

Impolite is in the eye of the beholder, and you had 
already expressed your impoliteness in a number of ways.

a) not lurking before posting
b) not reading the FAQ
c) multi-posting
d) marking your message as urgent
e) arguing with people offering advice

>> Good luck with that problem..

> Thank you so much... I have already solved it.

Good to see that 'I am an island' spirit, you are sure going 
to need it while carrying that huge chip on your shoulders.

-- 
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: Arabic Text Rendering
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/b8eaff63afb0e5f7
==========================================================================

== 1 of 3 ==
Date:   Wed,   Oct 27 2004 5:25 am
From: Andrew Thompson <[EMAIL PROTECTED]> 

On Wed, 27 Oct 2004 05:18:53 -0400, Mickey Segal wrote:

> http://www.physci.org/launcher.jsp?class=/codes/eg/JArabicInUnicode fails 
> for me on Java 1.5.0 on Windows XP, reporting the following:
> 
> java.lang.ClassFormatError: Truncated class file

I just tried it using IE 6.0026 and..
Java(TM) Plug-in: version 1.5.0
Using JRE version 1.5.0-beta Java HotSpot(TM) Client VM

It seems to work fine here.  

Are you using beta or the RC release?
<http://www.physci.org/pc/property.jsp?prop=java.version>

-- 
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



== 2 of 3 ==
Date:   Wed,   Oct 27 2004 5:55 am
From: "Mickey Segal" <[EMAIL PROTECTED]> 

"Andrew Thompson" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> Are you using beta or the RC release?
> <http://www.physci.org/pc/property.jsp?prop=java.version>

I'm using 1.5.0, not the preliminary versions.  Do I need an additional 
download for the Swing part? 





== 3 of 3 ==
Date:   Wed,   Oct 27 2004 6:15 am
From: Andrew Thompson <[EMAIL PROTECTED]> 

On Wed, 27 Oct 2004 08:55:57 -0400, Mickey Segal wrote:

> "Andrew Thompson" <[EMAIL PROTECTED]> wrote in message 
> news:[EMAIL PROTECTED]
>> Are you using beta or the RC release?
>> <http://www.physci.org/pc/property.jsp?prop=java.version>
> 
> I'm using 1.5.0, not the preliminary versions.  Do I need an additional 
> download for the Swing part?

(scratches head) No, it is all standard Java API Swing classes.
The code is directly below the launcher.

You can get the unformatted source here.
<http://www.physci.org/codes/display.jsp?fmt=raw&fl=/codes/eg/JArabicInUnicode.java>

It should work in Java 1.2+. theoretically, ..checks in 
the on-line compiler, no, the call to JFrame.EXIT_ON_CLOSE
on line 69 makes it 1.3+.

I would like to here from other beta and RC users of 1.5.

-- 
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: How to starthandshake with client browser??
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/2d41b9d8f6879f8b
==========================================================================

== 1 of 3 ==
Date:   Wed,   Oct 27 2004 5:37 am
From: Alex Hunsley <[EMAIL PROTECTED]> 

Jakekeke wrote:
> I am using JSSE to write a TCP socket program.
> The task i need to do is reveice a CONNECT response from a browser, ie
> HTTPS.
> And then my program need to communicate with the destinated server.
> My program can named as Proxy Server,however, it is a simply proxy
> server what it should do is: communicate between browser and server,
> and log down all the data transfer, including the request and response
> header.
> 
> So, would anyone can tell me how to solve the problem i mention above?

Yes; try writing some java code to solve the problem. That's how you 
solve it.

> You may provide some program statement for me to follow, or
> describe what the 3 bodies, client/proxy/server should do in each
> timeslot.

timeslot?

> Thank you.
> p.s. It is very urgent

Writing 'urgent' doesn't buy you any favours round here.




== 2 of 3 ==
Date:   Wed,   Oct 27 2004 6:40 am
From: Bruno Grieder <[EMAIL PROTECTED]> 

May I also suggest that:

-you never post to multiple newsgroup
-show that at least you tried to do something before sending your post

What you are trying  to do (assuming you are) is what I call "a man in 
the middle". I have written one: it is very simple in Java with HTTP, 
much, much more complicated with HTTPS and close to a nightmare when 
there is a proxy.

First read the API documentations SSLSocketFactory, SSLSocket, 
SSLServerSocket, SSLServerSocketFactory, SSLContext, X509TrustManager, 
KeyManagerFactory, and Google around these ones - there is plenty of 
code out there to show basic use of them.

Once you have code to show, come back to this forum.

Bruno

Alex Hunsley wrote:
> Jakekeke wrote:
> 
>> I am using JSSE to write a TCP socket program.
>> The task i need to do is reveice a CONNECT response from a browser, ie
>> HTTPS.
>> And then my program need to communicate with the destinated server.
>> My program can named as Proxy Server,however, it is a simply proxy
>> server what it should do is: communicate between browser and server,
>> and log down all the data transfer, including the request and response
>> header.
>>
>> So, would anyone can tell me how to solve the problem i mention above?
> 
> 
> Yes; try writing some java code to solve the problem. That's how you 
> solve it.
> 
>> You may provide some program statement for me to follow, or
>> describe what the 3 bodies, client/proxy/server should do in each
>> timeslot.
> 
> 
> timeslot?
> 
>> Thank you.
>> p.s. It is very urgent
> 
> 
> Writing 'urgent' doesn't buy you any favours round here.
> 



== 3 of 3 ==
Date:   Wed,   Oct 27 2004 6:51 am
From: Alex Hunsley <[EMAIL PROTECTED]> 

Bruno Grieder wrote:
> May I also suggest that:
> 
> -you never post to multiple newsgroup
> -show that at least you tried to do something before sending your post
> 
> What you are trying  to do (assuming you are) is what I call "a man in 
> the middle". I have written one: it is very simple in Java with HTTP, 
> much, much more complicated with HTTPS and close to a nightmare when 
> there is a proxy.
> 
> First read the API documentations SSLSocketFactory, SSLSocket, 
> SSLServerSocket, SSLServerSocketFactory, SSLContext, X509TrustManager, 
> KeyManagerFactory, and Google around these ones - there is plenty of 
> code out there to show basic use of them.
> 
> Once you have code to show, come back to this forum.
> 
> Bruno
> 

Hi Bruno
can you do me a favour and bottom post? Top-posting makes threads hard 
to follow...

thanks!
alex




==========================================================================
TOPIC: A Jtidy question
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/101dc3467b393897
==========================================================================

== 1 of 1 ==
Date:   Wed,   Oct 27 2004 5:51 am
From: [EMAIL PROTECTED] (mike) 

regards:

I use Jtidy (api) to translate a HTML file into a "XHTML file".
But The "XHTML file" cannot be identified by nokia 6600.
Do I miss something important?
Or this is Jtidy's weakness or bug.
Can someone excellent to tell me the reason.
followings is part of my Jtidy codes.


             ---------------------------------------------------------
             First I import the Jtidy api.
             Second I setup the Jtidy parameter,you know.
             ---------------------------------------------------------
             import org.w3c.tidy.Tidy;
             
                Tidy tidy = new Tidy();
                tidy.setCharEncoding(4);
                // tidy.setXmlTags(false);
                System.out.println("tidy test");
                long tidylength;
               //at input not XML
               //tidy.setQuiet(true);
               //  tidy.setShowWarnings(true);  
               //  tidy.setXmlOut(false);
               tidy.setXHTML(true);
               FileInputStream pw2 = new FileInputStream("page.txt");
               FileOutputStream pw3 = new FileOutputStream("page2.txt");
               tidy.parse(pw2,pw3);        
               pw2.close();
               pw3.close();
               
               ----------------------------------------------------------
               page.txt is HTML document input
               page2.txt is XHTML document output
               My nokia 6600 cannot identify page2.txt.




==========================================================================
TOPIC: How use java.util.logging.config.class?
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/3f086cadd5f41a7
==========================================================================

== 1 of 1 ==
Date:   Wed,   Oct 27 2004 6:26 am
From: Tobias Besch <[EMAIL PROTECTED]> 

Oscar kind <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]:
> IMHO, you've taken a wrong turn at the end: get the configuration file
> from your .jar file and initialize logging with that.
> 
> [...]
> 
> Combine this with System#getResourceAsStream(String) and
> LogManager#readConfiguration(InputStream) to feed the configuration file
> into LogManager.

Thanks, a lot.
This is the solution I was looking for.

Cheers,
    Tobias




==========================================================================
TOPIC: Logging configuration file w/ web start
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/647b28fc11be9145
==========================================================================

== 1 of 1 ==
Date:   Wed,   Oct 27 2004 6:31 am
From: Tobias Besch <[EMAIL PROTECTED]> 

Thank you.

This answer didn't clear my mind.

But the answer you gave to
<http://groups.google.com/groups?selm=2u6g0lF2672r9U1%40uni-berlin.de>
helped me a lot and solved my problem.

Thanks!




==========================================================================
TOPIC: Enums in inner classes
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/7ecb6f0754c4b0df
==========================================================================

== 1 of 1 ==
Date:   Wed,   Oct 27 2004 6:40 am
From: G Winstanley <[EMAIL PROTECTED]> 

On Wed, 27 Oct 2004 05:20:36 GMT, the cup of Alan Moore
<[EMAIL PROTECTED]> overfloweth with the following:

> "G Winstanley" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > Jus a quick one...now I've finally got hold of v1.5 I'm trying to use an
> > enum in a private final inner class, but I get the following message from
> > the compiler in NetBeans 4.0b2:
> >
> > init:
> > deps-jar:
> > Compiling 1 source file to P:\NetBeans Projects\ProjectX\build\classes
> > P:\NetBeans Projects\ProjectX\src\Foo.java:7: modifier  not allowed here
> > private enum Status{ONE, TWO, THREE, FOUR}
> > 1 error
> > BUILD FAILED (total time: 0 seconds)
> >
> >
> > The class is defined as:
> >
> > public class Foo
> > {
> >   private final class Bar
> >   {
> >     private enum Status {ONE, TWO, THREE, FOUR}
> >     // ...etc...
> >   }
> > }
> >
> >
> > Any ideas which modifier it's got a problem with? I've tried removing the
> > private modifier and that has no effect. It seems that it's just not happy
> > having an enum within an inner class, but I can't find reference to this in
> > the enum documentation that comes with JDK1.5.
> 
> I think the modifier it's complaining about is "static"--enums are
> implicitly static, and you can't declare a static class inside a
> non-static inner class.

Ah ha! Of course, I should have realized that. Thanks for pointing out the
obvious. Of course it now compiles.

Thanks again.
Stan




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

== 1 of 1 ==
Date:   Wed,   Oct 27 2004 6:43 am
From: "Xavier" <[EMAIL PROTECTED]> 

Hello,

I am searching for classes to use SCP (server use SSH2) in my Java
application.
Any idea ? Any link ?

Thanks

Xavier






==========================================================================
TOPIC: unused methods and class
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/18983b9b8d7bad9c
==========================================================================

== 1 of 2 ==
Date:   Wed,   Oct 27 2004 7:01 am
From: Fx <[EMAIL PROTECTED]> 

Hi all,

I suppose that question has been already posted before but I don't find a tool that 
answered my need.

I would like to clean my code by looking for unused methods -in particular in 
interfaces- and unused classes even they are public.

Do you know if some tools (free or commercial) are able to do this job ?


Thank in advance

Franck



== 2 of 2 ==
Date:   Wed,   Oct 27 2004 7:06 am
From: Andrew Thompson <[EMAIL PROTECTED]> 

On 27 Oct 2004 14:01:06 GMT, Fx wrote:

> I suppose that question has been already posted ..

Funny you should say that, say my answer on the other group.

-- 
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: Interface design question
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/9a07ca46c4217868
==========================================================================

== 1 of 1 ==
Date:   Wed,   Oct 27 2004 7:20 am
From: "John C. Bollinger" <[EMAIL PROTECTED]> 

Martha Goys wrote:
> I'm debating on one of the following approaches:
> 
> A)
> SomeClassA getOutput(SomeClassB input)
> 
> or
> 
> B)
> void setInput(SomeClassB input)
> SomeClassA getOutput()
> 
> The plus I see with approach A is its simplicity, and that the flow is 
> very obvious.
> 
> The pluses I see with approach B is the use of bean syntax, which is 
> very useful in reflection, etc.
> 
> I suppose what's throwing me is that since this is currently just an 
> interface, it's hard to see if there's really much difference in the two 
> approaches above.

In addition to the points raised by the other responses, I'll point out 
that option (A) is thread-safe with respect to implementations of the 
interface [with a few caveats], whereas option (B) definitely requires 
external synchronization to be thread-safe.  In general, local variables 
are a big win over instance variables (or worse, static variables) when 
it comes to thread-safety.


John Bollinger
[EMAIL PROTECTED]




==========================================================================
TOPIC: draw UML for java application
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/85657acd2418278b
==========================================================================

== 1 of 1 ==
Date:   Wed,   Oct 27 2004 7:08 am
From: Thomas Weidenfeller <[EMAIL PROTECTED]> 

Alex Hunsley wrote:
> It does look like a dodgy situation for him to be in! 

Yes, it looks like this.

> That, and the 
> mention of "a small supermarket application" (amongst other things) 
> makes me think this is actually homework. Well, I *hope* it's homework, 
> and this isn't a real situation here where they're getting someone to do 
> UML who doesn't seem to be up on the whole thing...

Well, I was assuming it was real work. That's why I called it "bad", and 
wished him all the luck he could get.

/Thomas




==========================================================================
TOPIC: local search
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/fe99afb3cb58e3a0
==========================================================================

== 1 of 1 ==
Date:   Wed,   Oct 27 2004 7:25 am
From: Chris Smith <[EMAIL PROTECTED]> 

In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] says...
> does anyone know any good reference or examples for generic local serach 
> algorithms under java. yes, gooogle, wasn't very helpful.

Jakarta Lucene.

-- 
www.designacourse.com
The Easiest Way To Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation




==========================================================================
TOPIC: Unable to establish a socket connection
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/3db1070c05ec0b49
==========================================================================

== 1 of 1 ==
Date:   Wed,   Oct 27 2004 7:35 am
From: [EMAIL PROTECTED] (S J Rulison) 

Steve Horsley <[EMAIL PROTECTED]> wrote in message news:<[EMAIL PROTECTED]>...
> S J Rulison wrote:
> > Steve Horsley <[EMAIL PROTECTED]> wrote in message news:<[EMAIL PROTECTED]>...
> > 
> >>S J Rulison wrote:
> >>
> >>>Actually, I didn't get any exceptions.  And I guess I should have
> >>>mentioned that in my original post. 
> >>
> >>In that case you are connecting succesfully. There are only two
> >>possible outcomes to calling new Socket(), and that is either
> >>a connected socket, or an exception thrown.
> >>
> >>Maybe you are catching and ignoring the exception?
> >>
> >>Steve
> > 
> > 
> > Dear Mr. Horsley:
> > You were correct in your reply to my post when you stated that I might
> > be catching and ignoring the exception.  Upon further review of my
> > code, I noticed that I had the e.printstackTrace(System.err) commented
> > out.  I have printed out the exceptions that were thrown below.   It
> > appears that I need to go threw the java security manager and grant
> > permission to the applet to open a socket connection to the server
> > application but I'm not exactly sure how that's done.  Do you know of
> > any examples I can look at to see what code needs to be added to the
> > applet and the application?   The closest I came to finding an example
> > was a snippet of code for granting permissions: 
> > grant{java.security.AllPermissions;}.  I wasn't able to figure out
> > where this fits into the scheme of things.
> > 
> > 
> > I would really appreciate any help you could give me on this.
> >  
> > Thanks.
> > 
> > 
> > EXCEPTIONS:
> > java.security.AccessControlException: access denied
> > (java.net.SocketPermission 10.44.250 resolve)
> >     at java.security.AccessControlContext.checkPermission(Unknown Source)
> >     at java.security.AccessController.checkPermission(Unknown Source)
> >     at java.lang.SecurityManager.checkPermission(Unknown Source)
> >     at java.lang.SecurityManager.checkConnect(Unknown Source)
> >     at java.net.InetAddress.getAllByName0(Unknown Source)
> >     at java.net.InetAddress.getAllByName0(Unknown Source)
> >     at java.net.InetAddress.getAllByName(Unknown Source)
> >     at java.net.InetAddress.getByName(Unknown Source)
> >     at java.net.InetSocketAddress.<init>(Unknown Source)
> >     at java.net.Socket.<init>(Unknown Source)
> >     at PTABLookup.createSocket(PTABLookup.java:110)
> >     at PTABLookup.init(PTABLookup.java:87)
> >     at sun.applet.AppletPanel.run(Unknown Source)
> >     at java.lang.Thread.run(Unknown Source)
> 
> Now you've caught me out. I've never messed around with security managers, 
> so I can't help you. But now you know what the problem is, maybe someone else
> can chip in. Or maybe you can google for something like "applet socket 
> securityexception". This has been discussed many times before.
> 
> Steve


Okay I will do that.  Thanks again for yur help.

Steve R.




==========================================================================
TOPIC: Challenge: Triangles puzzle
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/5e013ca5d7daa5f0
==========================================================================

== 1 of 1 ==
Date:   Wed,   Oct 27 2004 7:53 am
From: [EMAIL PROTECTED] (Mark McConnell) 

Gareth McCaughan <[EMAIL PROTECTED]> wrote in message news:<[EMAIL PROTECTED]>...
> I've put a little plot of the results at
>     http://homepage.ntlworld.com/g.mccaughan/software/tri-times.ps
>     http://homepage.ntlworld.com/g.mccaughan/software/tri-times.pdf
> [snip]
> All the numbers depicted should be taken with a grain of salt;
> in particular, I haven't made a very serious attempt to correct
> for the fact that some people will have reported non-blank non-comment
> line counts and others will have included everything. (Where the
> distinction was made, I chose the non-blank non-comment figure,
> or the nearest thing thereto.) Likewise, those who gave times
> may have meant different things by them.

Also, people chose different definitions of the problem--of what it
means to input points and lines.




==========================================================================
TOPIC: Floats become decimals when read from a resultset.
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/8e54b4c8e235131b
==========================================================================

== 1 of 1 ==
Date:   Wed,   Oct 27 2004 7:09 am
From: Sudsy <[EMAIL PROTECTED]> 

Koen wrote:
<snip>
> import framework.bean.DataAccess;
<snip>
>               ds = AppEnvUbclaims.getInstance().getDataAccess();
>               cs = ds.executeStoredProc("SPJ_DAMA_GETANALYSIS");

A couple of clarifications are necessary here. First off, I'm not
familiar with the framework.bean.DataAccess package. Secondly, if
you're actually executing a stored procedure then you're comparing
apples and oranges. Why don't you try calling the stored procedure
on server 1 (the DB/2 host)? It could be as simple as the wrong
return type from the stored procedure...





==========================================================================
TOPIC: Ant Deploy Task Help Needed!!!!!
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/c0e92f8078749598
==========================================================================

== 1 of 1 ==
Date:   Wed,   Oct 27 2004 8:11 am
From: [EMAIL PROTECTED] (Chris Pieper) 

Ok, I was hoping to use ANT to aid in my team's deployment's to our
development server.

Currently the system is designed as follows:

Each Developer maintains a local checked out (from CVS) copy of a
project. Each developer is tasked with making various changes, of
which there is little chance for the need of mutliple editors on any
given java file.

Then we have our development server which maintains the current
working versions of all the java class files. Each developer after
making his edits, copies the new class file to the server so that the
dev server maintains an accurate collection of the system given
changes by developer.

Basically here are the rules I would like to apply to get a fileset in
which I can use to copy to the dev server.

1> Compare last modified time for java file in local developer "src"
folder to last modified time of corresponding .class file on remote
server "classes" dir.

2> Then I would like to take those java src files with a more current
modified time and copy their corresponding class file from the local
"build" dir to the remote server "classes" dir.


ANy help would be greatly appreciated.

Thanks
Chris
[EMAIL PROTECTED]



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

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