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

Today's topics:

* Java 1.5 to be released with nasty JEditorPane/HTML bug - 1 messages, 1 
author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/18cd37410728e7bc
* How to setup a Directory Structure - 2 messages, 2 authors
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/14207bd8aa4d8a79
* EJB: ONE query for multiple rows - 3 messages, 3 authors
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/38eb46fdf71c702c
* Developing Web Services in JAVA using Apache Soap on a tomcat server - 2 messages, 2 
authors
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/521d4ed2e2814bb0
* BufferOverflow exception on SocketChannel.read() - 2 messages, 2 authors
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/2d6f1b5b1f73b757
* reuse HashMap$Entry (or HashMap in total) to avoid millions of allocations - 2 
messages, 2 authors
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/6d3d5d296d63ef30
* opaque - Bedeutung ? - 2 messages, 2 authors
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/34ebf17b0b59b7d8
* solution to the dinning philosopher problem - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/3546a4e2a64af1af
* JVM as service - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/ca2d0e75df3526fa
* Retrieving Stored Procedure Returns - 2 messages, 2 authors
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/1f242177026be66a
* disable JVM type checking - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/c959b168b0177d64
* SDK resource for Fedroa OS? - 2 messages, 2 authors
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/cbd57d346871950
* FTP File Transfer; file contents getting changed ? - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/31644f91c9b89f0d
* gmail anyone? - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/edb0463a590e0ea1
* re. the Enumeration interface. - 2 messages, 2 authors
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/82c0021921f12557
* abstract interfaces - 2 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/3c9900fa9970d77f
* Is there a better parser (writen in java) than Jtidy? - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/730b70675cf88346
  
==========================================================================
TOPIC: Java 1.5 to be released with nasty JEditorPane/HTML bug
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/18cd37410728e7bc
==========================================================================

== 1 of 1 ==
Date:   Fri,   Sep 10 2004 12:09 pm
From: "Larry Barowski" <larrybarATengDOTauburnDOTeduANDthatISall> 

I'm posting here in the hopes of applying some pressure to Sun,
so that they might fix this bug before 1.5 final is released.

The bug is " NPE when relative font sizes used in html "
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5089077

JEditorPane is now incapable of displaying much of the
HTML generated by javadoc. They should at least fix it to
the point where no NPE is thrown, even if the resulting
HTML display is not perfect.

I would suggest voting for this bug, but it is marked as "Closed,
fixed" - in "mustang", which I guess is 1.6.






==========================================================================
TOPIC: How to setup a Directory Structure
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/14207bd8aa4d8a79
==========================================================================

== 1 of 2 ==
Date:   Fri,   Sep 10 2004 12:05 pm
From: [EMAIL PROTECTED] (z24) 

Thanks for the feedback I just wanted to make sure it wasnt possible. 
I know I can probably do it with PHP but I just wanted to see if there
are any other ways of doing this.  My problem is that I have a lot of
files that are constantly changing but I would like to somehow put it
on our intranet site.  Im in no way a Java programmer but I know how
to implement whatever it is I need.  If there are any suggestions on
how to do this please let me know it would be much appreciated.

Thank You



== 2 of 2 ==
Date:   Fri,   Sep 10 2004 12:18 pm
From: Andrew Thompson <[EMAIL PROTECTED]> 

On 10 Sep 2004 12:05:22 -0700, z24 wrote:

> Thanks for the feedback I just wanted to make sure it wasnt possible. 
> I know I can probably do it with PHP but I just wanted to see if there
> are any other ways of doing this.  My problem is that I have a lot of
> files that are constantly changing but I would like to somehow put it
> on our intranet site.  Im in no way a Java programmer but I know how
> to implement whatever it is I need.  If there are any suggestions on
> how to do this please let me know it would be much appreciated.

Do you want to display a directory structure 
for the server's directories, or the local file 
system of the user.

If the local file system, why an applet?

-- 
Andrew Thompson
http://www.PhySci.org/ Open-source software suite
http://www.PhySci.org/codes/ Web & IT Help
http://www.1point1C.org/ Science & Technology




==========================================================================
TOPIC: EJB: ONE query for multiple rows
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/38eb46fdf71c702c
==========================================================================

== 1 of 3 ==
Date:   Fri,   Sep 10 2004 12:17 pm
From: Timo Nentwig <[EMAIL PROTECTED]> 

Sudsy wrote:

> If you're talking about entity EJBs then investigate finder methods.

See subject ("EJB: ..."). Yes, I'm talking about EJBs.

> They can return collections of beans.

Can you offer some more details?



== 2 of 3 ==
Date:   Fri,   Sep 10 2004 12:21 pm
From: Andrew Thompson <[EMAIL PROTECTED]> 

On Fri, 10 Sep 2004 21:17:00 +0200, Timo Nentwig wrote:

> Sudsy wrote:
> 
>> If you're talking about entity EJBs then investigate finder methods.
> 
> See subject ("EJB: ..."). Yes, I'm talking about EJBs.

It's alway wise to repeat each word (or acronym) 
of the subject in the body of your post.

A lot of folks (myself included) mostly 
ignore the 'subject' line.

HTH

-- 
Andrew Thompson
http://www.PhySci.org/ Open-source software suite
http://www.PhySci.org/codes/ Web & IT Help
http://www.1point1C.org/ Science & Technology



== 3 of 3 ==
Date:   Fri,   Sep 10 2004 1:04 pm
From: Sudsy <[EMAIL PROTECTED]> 

Timo Nentwig wrote:
> Sudsy wrote:
> 
> 
>>If you're talking about entity EJBs then investigate finder methods.
> 
> 
> See subject ("EJB: ..."). Yes, I'm talking about EJBs.
> 
> 
>>They can return collections of beans.
> 
> 
> Can you offer some more details?

The topic is complex and implementation depends on whether you're using
BMP or CMP. I just went to the Sun site and entered "+entity +finder
+method" as the query. The third hit is this one:
<http://java.sun.com/developer/onlineTraining/Programming/JDCBook/code5.html>
There's lots of reading to do, but the Sun site should always be one of
your first sources of information. I don't want to waste bandwidth on
this ng explaining what is already well-covered.
Best wishes!





==========================================================================
TOPIC: Developing Web Services in JAVA using Apache Soap on a tomcat server
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/521d4ed2e2814bb0
==========================================================================

== 1 of 2 ==
Date:   Fri,   Sep 10 2004 12:52 pm
From: [EMAIL PROTECTED] (John Cox) 

Trying to work with Apache Soap and java server but not understand
what it means to Compile the Java class and put it somewhere in your
web server's classpath for tomcat server.  Here are the directions
that I am following but keep getting a 404 error when trying to
contact the service through a perl client.

Installing Apache SOAP

Apache SOAP can be used as both a client and provider of SOAP web
services. A server-side installation of Apache SOAP involves placing
some .jar files in your classpath. You will need a separate web server
that supports Servlets and Java Server Pages, such as Apache's Tomcat
(http://jakarta.apache.org/tomcat/).

The Apache SOAP homepage, http://xml.apache.org/soap/index.html, has
links to both source-only and precompiled distributions of the
toolkit. Installing the precompiled binary distribution is as simple
as downloading a Zip archive and extracting it into a directory.

On the client, three .jar files from the distribution (soap.jar,
mail.jar, and activation.jar) must be present in your classpath. Also
present must be any Java API for XML Parsing (JAXP) aware XML parser,
such as Xerces Version 1.4 (http://xml.apache.org/xerces-j/).

Assuming that you installed Apache SOAP .jar files in the C:\book\soap
directory, set your SOAP_LIB environment variable to C:\book\soap\lib.
Adding the .jar files to your classpath then entails:

set CLASSPATH = %CLASSPATH%;%SOAP_LIB%\soap.jar
set CLASSPATH = %CLASSPATH%;%SOAP_LIB%\mail.jar
set CLASSPATH = %CLASSPATH%;%SOAP_LIB%\activation.jar

Or, in the Unix Bourne shell (/bin/sh):

CLASSPATH = $CLASSPATH;$SOAP_LIB/soap.jar
CLASSPATH = $CLASSPATH;$SOAP_LIB/mail.jar
CLASSPATH = $CLASSPATH;$SOAP_LIB/activation.jar

The exact steps for a server installation will depend on which web
application server you are using, but the process is essentially the
same. The first step is to ensure the same three .jar files are
located in your application server's classpath.

If your application server supports the use of web application
archives (WAR files), simply use the soap.war file that ships with
Apache SOAP. Apache Tomcat supports this. The Apache SOAP
documentation includes detailed installation instructions for Tomcat
and a number of other environments.

If you intend to use the Bean Scripting Framework (BSF) to make
script-based web services, you need to ensure that bsf.jar and js.jar
(a BSF JavaScript implementation) are also in the web application
server's classpath.

The vast majority of problems encountered by new Apache SOAP users are
related to incorrect classpaths. If you encounter problems writing web
services with Apache SOAP, be sure to start your debugging by checking
your classpath!
The Hello Server

We're going to do the same things we did in Perl: create the code,
deploy the service, and use the service. Example 3-12 shows the Java
code for the Hello class.

Example 3-12: Hello.java 

package samples;
public class Hello {
   public String sayHello(String name) {
       return "Hello " + name;
   }
}

Compile the Java class and put it somewhere in your web server's
classpath.

 Deployment descriptor for samples.Hello 

<dd:service xmlns:dd="http://xml.apache.org/xml-soap/deployment";
id="urn:Example1">
 <dd:provider type="java"     
              scope="Application"               
              methods="sayHello">
    <dd:java class="samples.Hello" 
             static="false" />
 </dd:provider>  
 <dd:faultListener>
  org.apache.soap.server.DOMFaultListener
 </dd:faultListener>
 <dd:mappings />
</dd:service>


Example 3-16. hw_jclient.pl, the Perl client for the Java Hello World
server

#!/usr/bin/perl -w
# hw_jclient.pl - java Hello client
use SOAP::Lite;
my $name = shift;
print "\n\nCalling the SOAP Server to say hello\n\n";
print "The SOAP Server says: ";
print SOAP::Lite
  -> uri('urn:Example1')
  -> proxy('http://localhost:8080/soap/servlet/rpcrouter James')
  -> sayHello($name)
  -> result . "\n\n";


output I get from running the perl client 

C:\Documents and Settings\Administrator\Desktop>test.pl James

Calling the SOAP Server to say hello

The SOAP Server says: 404 /soap/servlet/rpcrouter%20James at
C:\Documents and Se
ttings\Administrator\Desktop\test.pl line 7



== 2 of 2 ==
Date:   Fri,   Sep 10 2004 9:42 pm
From: "William Brogden" <[EMAIL PROTECTED]> 

On 10 Sep 2004 12:52:37 -0700, John Cox <[EMAIL PROTECTED]> wrote:

> Trying to work with Apache Soap and java server but not understand
> what it means to Compile the Java class and put it somewhere in your
> web server's classpath for tomcat server.  Here are the directions
> that I am following but keep getting a 404 error when trying to
> contact the service through a perl client.
>
> Installing Apache SOAP
>
> Apache SOAP can be used as both a client and provider of SOAP web
> services. A server-side installation of Apache SOAP involves placing
> some .jar files in your classpath. You will need a separate web server
> that supports Servlets and Java Server Pages, such as Apache's Tomcat
> (http://jakarta.apache.org/tomcat/).
>
> The Apache SOAP homepage, http://xml.apache.org/soap/index.html, has
> links to both source-only and precompiled distributions of the
> toolkit. Installing the precompiled binary distribution is as simple
> as downloading a Zip archive and extracting it into a directory.
>
> On the client, three .jar files from the distribution (soap.jar,
> mail.jar, and activation.jar) must be present in your classpath. Also
> present must be any Java API for XML Parsing (JAXP) aware XML parser,
> such as Xerces Version 1.4 (http://xml.apache.org/xerces-j/).
>
> Assuming that you installed Apache SOAP .jar files in the C:\book\soap
> directory, set your SOAP_LIB environment variable to C:\book\soap\lib.
> Adding the .jar files to your classpath then entails:
>
> set CLASSPATH = %CLASSPATH%;%SOAP_LIB%\soap.jar
> set CLASSPATH = %CLASSPATH%;%SOAP_LIB%\mail.jar
> set CLASSPATH = %CLASSPATH%;%SOAP_LIB%\activation.jar

Note that Tomcat does not pay any attention to the System environment
CLASSPATH - see the class loader how-to in the docs installed with Tomcat.

>
> Or, in the Unix Bourne shell (/bin/sh):
>
> CLASSPATH = $CLASSPATH;$SOAP_LIB/soap.jar
> CLASSPATH = $CLASSPATH;$SOAP_LIB/mail.jar
> CLASSPATH = $CLASSPATH;$SOAP_LIB/activation.jar
>
> The exact steps for a server installation will depend on which web
> application server you are using, but the process is essentially the
> same. The first step is to ensure the same three .jar files are
> located in your application server's classpath.
>
> If your application server supports the use of web application
> archives (WAR files), simply use the soap.war file that ships with
> Apache SOAP. Apache Tomcat supports this. The Apache SOAP
> documentation includes detailed installation instructions for Tomcat
> and a number of other environments.
>
> If you intend to use the Bean Scripting Framework (BSF) to make
> script-based web services, you need to ensure that bsf.jar and js.jar
> (a BSF JavaScript implementation) are also in the web application
> server's classpath.
>
> The vast majority of problems encountered by new Apache SOAP users are
> related to incorrect classpaths. If you encounter problems writing web
> services with Apache SOAP, be sure to start your debugging by checking
> your classpath!
> The Hello Server
>
> We're going to do the same things we did in Perl: create the code,
> deploy the service, and use the service. Example 3-12 shows the Java
> code for the Hello class.
>
> Example 3-12: Hello.java
>
> package samples;
> public class Hello {
>    public String sayHello(String name) {
>        return "Hello " + name;
>    }
> }
>
> Compile the Java class and put it somewhere in your web server's
> classpath.
>
>  Deployment descriptor for samples.Hello
>
> <dd:service xmlns:dd="http://xml.apache.org/xml-soap/deployment";
> id="urn:Example1">
>  <dd:provider type="java"
>               scope="Application"
>               methods="sayHello">
>     <dd:java class="samples.Hello"
>              static="false" />
>  </dd:provider>
>  <dd:faultListener>
>   org.apache.soap.server.DOMFaultListener
>  </dd:faultListener>
>  <dd:mappings />
> </dd:service>
>
>
> Example 3-16. hw_jclient.pl, the Perl client for the Java Hello World
> server
>
> #!/usr/bin/perl -w
> # hw_jclient.pl - java Hello client
> use SOAP::Lite;
> my $name = shift;
> print "\n\nCalling the SOAP Server to say hello\n\n";
> print "The SOAP Server says: ";
> print SOAP::Lite
>   -> uri('urn:Example1')
>   -> proxy('http://localhost:8080/soap/servlet/rpcrouter James')
>   -> sayHello($name)
>   -> result . "\n\n";
>
>
> output I get from running the perl client
>
> C:\Documents and Settings\Administrator\Desktop>test.pl James
>
> Calling the SOAP Server to say hello
>
> The SOAP Server says: 404 /soap/servlet/rpcrouter%20James at
> C:\Documents and Se
> ttings\Administrator\Desktop\test.pl line 7

The "/servlet/" usage sounds like it expects the "invoker" servlet
to be running - Tomcat used to come with the "invoker" turned on
but this ceased to be true partway through Tomcat 4 releases.
This is a source of endless confusion - check your default web.xml
and the soap web.xml for mention of "invoker"


-- 
Using Opera's revolutionary e-mail client: http://www.opera.com/m2/




==========================================================================
TOPIC: BufferOverflow exception on SocketChannel.read()
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/2d6f1b5b1f73b757
==========================================================================

== 1 of 2 ==
Date:   Fri,   Sep 10 2004 1:09 pm
From: ATC <[EMAIL PROTECTED]> 

"Vincent Cantin" <[EMAIL PROTECTED]> wrote in
news:[EMAIL PROTECTED]: 

>> Folks,
>>
>> I have a situation that I can't explain and maybe it is due to some
>> lack of understanding of NIO.  I have allocated a non-direct
>> ByteBuffer and passed it as an argument to SocketChannel.read().  The
>> channel is blocking.  I am (intermittantly) getting a
>> java.nio.BufferOverflowException and I don't understand how that is
>> possible.  The partial stacktrace below shows where it occurs.
>>
>> at java.nio.HeapByteBuffer.put(HeapByteBuffer.java:190)
>> at sun.nio.ch.IOUtil.read(IOUtil.java:209)
>> at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:207)
>>
>> I have access to the HeapByteBuffer.java file and can see that the
>> exception appears to be thrown because something in the sun.nio.ch
>> package is copying data from what appears to be an internal
>> ByteBuffer into what I'm assuming is my ByteBuffer.  Since the
>> internal ByteBuffer has more data than my ByteBuffer can hold, the
>> exception gets thrown.
>>
>> I don't have access to the sun.nio.ch source files, so I can't look
>> at them to see what is happening.
>>
>> What I don't understand is why this is possible.  I thought that if I
>> passed a ByteBuffer to SocketChannel.read(), it would only read as
>> much data into the ByteBuffer as the ByteBuffer could hold.  Why is
>> this exception thrown?  Is my understanding incorrect?
>>
>> Thanks to anyone who can help me make sense of this.
>>
>> ATC
> 
> I don't know exactly what is the problem, but ..
> Do you remember to set the reading position of the buffer to the
> beginning each time you read something ?
> 
> 

Thanks for responding!

I'm checking on that now, but my point is that I don't think this is 
necessary.  Since the read call is only suppossed to read as much data 
into the buffer as it has room for, if the buffer has no room, the read 
call should just return 0.  Am I mistaken here?  The documentation is a 
little terse in this area, so my assumption may be incorrect.

ATC



== 2 of 2 ==
Date:   Sat,   Sep 11 2004 1:12 am
From: Steve Horsley <[EMAIL PROTECTED]> 

ATC wrote:

> 
> I'm checking on that now, but my point is that I don't think this is 
> necessary.  Since the read call is only suppossed to read as much data 
> into the buffer as it has room for, if the buffer has no room, the read 
> call should just return 0.  Am I mistaken here?  The documentation is a 
> little terse in this area, so my assumption may be incorrect.
> 

I have occasionally seen situations (not related to this thread) where
asking to read/write 0 bytes ended up trying to read/write a very large
number instead. It may be worth coding to not call read() if there's no
space left, or catch the exception and then print how much space you
_thought_ you had, just to see if it's the 0-bytes-space case that's
causing the problem.

Steve




==========================================================================
TOPIC: reuse HashMap$Entry (or HashMap in total) to avoid millions of allocations
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/6d3d5d296d63ef30
==========================================================================

== 1 of 2 ==
Date:   Fri,   Sep 10 2004 1:32 pm
From: [EMAIL PROTECTED] (Vince Darley) 

An application we've built makes very extensive use of
java.util.HashMaps to store the results of 10s of thousands of
calculations it does.  Each of those calculations involves reading
from/writing to a HashMap, eventually filling it with, say,
10000-100000 entries.  Once complete, the information is copied out
into a fixed matrix, and we can safely discard the HashMap (and all
its entries of course).

Now, the problem with this is that the code spends 40%+ of its time
allocating new HashMap$Entry objects (according the profiling we've
done), and manages to allocate some 33 million of them (>1 Gb of
memory in total), although certainly no more than 1/2 million are
active at any one time (say 10-20Mb, according to the profiler).

So, my question is: are there any suggestions for how we can
restructure this code or its use of HashMap to avoid such a mad
allocation/deallocation frenzy.  It would all, presumably, run more
quickly if we could avoid this problem.

Any ideas?

Vince.



== 2 of 2 ==
Date:   Fri,   Sep 10 2004 1:48 pm
From: Chris Smith <[EMAIL PROTECTED]> 

Vince Darley wrote:
> Now, the problem with this is that the code spends 40%+ of its time
> allocating new HashMap$Entry objects (according the profiling we've
> done), and manages to allocate some 33 million of them (>1 Gb of
> memory in total), although certainly no more than 1/2 million are
> active at any one time (say 10-20Mb, according to the profiler).
> 
> So, my question is: are there any suggestions for how we can
> restructure this code or its use of HashMap to avoid such a mad
> allocation/deallocation frenzy.  It would all, presumably, run more
> quickly if we could avoid this problem.

No, you can't reuse HashMap$Entry objects.  You could use a different 
implementation of Map, which you write yourself, that uses some kind of 
pooling internally.  The question is then whether you can make your own 
object management for pooling faster than the JVM's memory management.  
I personally doubt you could do too awfully much better.

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

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation




==========================================================================
TOPIC: opaque - Bedeutung ?
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/34ebf17b0b59b7d8
==========================================================================

== 1 of 2 ==
Date:   Fri,   Sep 10 2004 1:44 pm
From: Thomas Schodt <[EMAIL PROTECTED]> 

Rene wrote:

> "Martin Meier" <[EMAIL PROTECTED]> wrote:
> 
>>Hallo,
>>
>>kann mir jemand verraten was genau "opaque" meint ?
>>Man kann zum Beispiel unter einem Frame die Methode setOpaque() nutzen.
>>Werde aus dieser Komponente nicht richtig schlau.
> 
> Durchlässigkeit. Also ob Du durchsiehst (transparenz) oder nicht. Ausserdem
> solltest Du in comp.lang.* grundsätzlich englisch schreiben...
> 
> [OP asked what opaque is]


altavista babelfish can be quite amusing.


<altavista babelfish on OP>
me someone can do betrayed which exactly "opaque" means? One can use the 
method for example under a Frame setOpaque(). Do not become correctly 
smart from this component.
</gibberish>

<paraphrase>
Can someone tell me what is the meaning of "opaque" exactly?
Usage example Frame.setOpaque().
I can't quite figure out this one.
</paraphrase>


<altavista babelfish on answer>
Permeability. Thus whether you examine (transparency) or not. In 
addition you should write in comp.lang. * in principle English...
</gibberish>

<paraphrase>
Transparency. Whether or not you can see through [something]. And please 
use english in comp.lang.* ...
</paraphrase>


Does not actually answer the question...

Opaque is non-transparent.


I think I'll leave the awt/swing details to someone else.



== 2 of 2 ==
Date:   Fri,   Sep 10 2004 2:11 pm
From: Eric Sosman <[EMAIL PROTECTED]> 

Thomas Schodt wrote:
> Rene wrote:
> 
>> "Martin Meier" <[EMAIL PROTECTED]> wrote:
>>
>>> Hallo,
>>>
>>> kann mir jemand verraten was genau "opaque" meint ?
>>> Man kann zum Beispiel unter einem Frame die Methode setOpaque() nutzen.
>>> Werde aus dieser Komponente nicht richtig schlau.
>>
>>
>> Durchlässigkeit. Also ob Du durchsiehst (transparenz) oder nicht. 
>> Ausserdem
>> solltest Du in comp.lang.* grundsätzlich englisch schreiben...
>>
>> [OP asked what opaque is]
> 
> 
> 
> altavista babelfish can be quite amusing.

     I once handed it the opening line of "Die Allmacht"
by J.L. Pyrker: "Groß ist Jehova, der Herr!"  It gave
me back "Jehova, the gentleman is large!"

-- 
[EMAIL PROTECTED]





==========================================================================
TOPIC: solution to the dinning philosopher problem
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/3546a4e2a64af1af
==========================================================================

== 1 of 1 ==
Date:   Fri,   Sep 10 2004 2:37 pm
From: Grant Wagner <[EMAIL PROTECTED]> 

Yan Zhou wrote:

> Hi there,
>
> I have code a program that solves the dinning philosopher problem. But there
> is still room to improve.
>
> My solution is to acquire both forks at any given time. If a philosopher
> first gets the left fork, and then tries to get the right fork, that may
> risk starvation.
>
> The current solution locks on the list object (which contains all fork
> objects). Thus, only one philosopher can acquire two forks at any given
> time, and multiple philosophers can eat at the same time. Once a philosopher
> acquires the forks, they are removed from the list; and philosopher returns
> the forks to the list after he finished eating.
>
> I would like to enhance the program so that multiple philosophers can get
> the forks at the same time. And I still want to ensure that a philosopher
> always get two forks at once. This is more difficult because I can no longer
> lock on the list object which contains forks since multiple phiolosophers
> must be allowed to remove/add forks to the list. I do not have an elegant
> solution for this.
>
> Any suggestion?
> Yan

Feed the philosopher to a real scientist and you've solved two problems:

1) you've gotten rid of the useless philosopher
2) you've fed a starving scientist you can actually accomplish something

--
Grant Wagner <[EMAIL PROTECTED]>





==========================================================================
TOPIC: JVM as service
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/ca2d0e75df3526fa
==========================================================================

== 1 of 1 ==
Date:   Fri,   Sep 10 2004 2:43 pm
From: Grant Wagner <[EMAIL PROTECTED]> 

Jonathan Neve wrote:

> Hi all!
>
> Has anyone ever tried to make the JVM into a OS service, so that
> instead of having to load it for each and every Java application, it
> could be loaded once by the OS at startup. Then, if you want to launch
> a Java application, all you would have to do would be to call the JVM
> service, and tell it which class to load, in exactly the same way as
> it is now. The only difference would be that the JVM wouldn't have to
> be loaded every time, which would considerably reduce both startup
> time and memory consumption.
>
> Has anyone done this? Any ideas?

Some useful(?) resources:

<url:
http://java.sun.com/j2se/jcp/AppIsolationAPI/oopsla00-czajkowski-final.pdf
/>
<url: http://research.sun.com/projects/barcelona/papers/usenix03.pdf />
<url:
http://wwws.sun.com/software/sunone/innercircle/newsletter/0404cto.html />

I think Sun has been working on "sharing" a virtual machine for a long
time, but haven't come up with a satisfactory solution.

--
Grant Wagner <[EMAIL PROTECTED]>





==========================================================================
TOPIC: Retrieving Stored Procedure Returns
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/1f242177026be66a
==========================================================================

== 1 of 2 ==
Date:   Fri,   Sep 10 2004 2:53 pm
From: "Xeth  Waxman" <[EMAIL PROTECTED]> 

I don't know if this is healpful or not, but here's the trace from SQL
Profiler after executing the query and going through the
cs.moreResults() loop:

declare @P1 int
set @P1=69248
declare @P2 int
set @P2=973
declare @P3 int
set @P3=1
exec spGetNextBatch N'GCC', 8, 802, N'X_TEST', N'Process Customer
Returns', N'2004-10-09', @P1 output, @P2 output, @P3 output
select @P1, @P2, @P3




== 2 of 2 ==
Date:   Fri,   Sep 10 2004 6:04 pm
From: Sudsy <[EMAIL PROTECTED]> 

Xeth Waxman wrote:
>>should this be:
>>cs = con.prepareCall("{? = call spGetNextBatch(?,?,?,?,?,?,?,?,?)}");
> 
> 
> Thanks again for the help.  It didn't work - I modified the code to the
> following:
> 
> cs = con.prepareCall("{? = call spGetNextBatch(?,?,?,?,?,?,?,?,?)}");
> cs.registerOutParameter(1, Types.INTEGER);
> cs.registerOutParameter(8, Types.INTEGER);
> cs.registerOutParameter(9, Types.INTEGER);
> cs.registerOutParameter(10, Types.INTEGER);
> cs.setString(2, "GCC");
> cs.setInt(3, 8);
> cs.setInt(4, 802);
> cs.setString(5, userName);
> cs.setString(6, batchComment);
> cs.setString(7, todayString);
> 
> //everything's set - execute

Insead of this:

> cs.execute();
> while (cs.getMoreResults() == true && cs.getUpdateCount()!= -1) {
> //processing stuff
> System.out.println("foo");
> }
> 
> //get our values out
> int batchKey = cs.getInt(8);
> int nextBatchNo = cs.getInt(9);
> int retVal = cs.getInt(10);

Try this:

ResultSet rs = cs.ExecuteQuery();
int batchKey = -1;
int nextBatchNo = -1;
int retVal = -1;
if( rs.next() ) {
     // why don't you get the OUT field 1?
     batchKey = cs.getInt( 8 );
     nextBatchNo = cs.getInt( 9 );
     retVal = cs.getInt( 10 );
}

> 
> Still all three values are uninitied (0).
> 

I just played with this and it works just fine for me.





==========================================================================
TOPIC: disable JVM type checking
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/c959b168b0177d64
==========================================================================

== 1 of 1 ==
Date:   Fri,   Sep 10 2004 2:41 pm
From: Yu David Liu <[EMAIL PROTECTED]> 

Is there a way to disable JVM type checker without hacking into its 
source code?

I'm writing a compiler, and the translation target language is Java. The 
source language of the compiler has its own type system; we don't need 
an extra layer of type checking. To make things worse, we need to get 
around Java's nominal subtyping to make our structural subtyping system 
work. Any ideas?

Thanks,

Yu David Liu
Department of Computer Science
The Johns Hopkins University





==========================================================================
TOPIC: SDK resource for Fedroa OS?
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/cbd57d346871950
==========================================================================

== 1 of 2 ==
Date:   Fri,   Sep 10 2004 4:48 pm
From: [EMAIL PROTECTED] (Ashish Khasgiwala) 

Can some one please point me to some good J2SE SDK, JVM resource for Fedora OS..

Thanks in advance.
Regards.
Ashish Khasgiwala
ashish_kh @ yahoo dot com



== 2 of 2 ==
Date:   Fri,   Sep 10 2004 11:26 pm
From: Babu Kalakrishnan <[EMAIL PROTECTED]> 

Ashish Khasgiwala wrote:
 >
> Can some one please point me to some good J2SE SDK, JVM resource for Fedora OS..
> 
Any problems with the stuff available from Sun ?

By the way, I would be a little wary of the RPMs of GCJ compiled binaries 
(mostly stuff form the jakarta libraries) that come with Fedora core 2. I found 
some weird incompatibilities with some binaries that I tried installing - 
(tomcat / ant).

BK




==========================================================================
TOPIC: FTP File Transfer; file contents getting changed ?
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/31644f91c9b89f0d
==========================================================================

== 1 of 1 ==
Date:   Fri,   Sep 10 2004 6:27 pm
From: "Steve Cassidy" <[EMAIL PROTECTED]> 

"Chris Uppal" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]

> The write(), now, /is/ "INCREDIBLY wasteful", since there doesn't seem to 
> be a
> buffered writer in use, but I assume that's just an oversight.
>

Streaming out raw binary data with a Writer is fundamentally misguided. 
Writers are for writing character streams. If you want raw bytes, you need 
to use an OutputStream class.

>From the Writer JavaDoc:
"public void write(int c) throws IOException
Write a single character. The character to be written is contained in the 16 
low-order bits
of the given integer value; the 16 high-order bits are ignored."

In other words, any int that happens to have any of the high order bits set 
will get munged.

Regards,
Steven







==========================================================================
TOPIC: gmail anyone?
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/edb0463a590e0ea1
==========================================================================

== 1 of 1 ==
Date:   Fri,   Sep 10 2004 10:27 pm
From: "hilz" <[EMAIL PROTECTED]> 

hi all...
i've got coupla gmail invitations to give away.
if interested, email me at  hs underscore 74 at hotmail dot com
cheers
hilz

P.S. Please don't change the subject when you reply, so i can find your
email!






==========================================================================
TOPIC: re. the Enumeration interface.
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/82c0021921f12557
==========================================================================

== 1 of 2 ==
Date:   Fri,   Sep 10 2004 11:54 pm
From: "Steve R. Burrus" <[EMAIL PROTECTED]> 

Is the Enumeration interface archaic/deprecated by now??? If so, just 
what are the proper methods that should be used now for whatever 
replaced it some time ago???!!! I am trying to use Enumeration in a 
particular servlet right now, but get compiler errors when it's 
referenced in the servlet.



== 2 of 2 ==
Date:   Sat,   Sep 11 2004 12:06 am
From: Paul Lutus <[EMAIL PROTECTED]> 

Steve R. Burrus wrote:

> Is the Enumeration interface archaic/deprecated by now???

Define "by now". It is not deprecated as of Java 1.4.2.

> If so, just 
> what are the proper methods that should be used now for whatever
> replaced it some time ago???!!!

That depends. What are you trying to do?

> I am trying to use Enumeration in a 
> particular servlet right now, but get compiler errors when it's
> referenced in the servlet.

Oh, so you got the dreaded "compiler error" error? No? Then what specific
compiler error did you actually get, from what source code?

-- 
Paul Lutus
http://www.arachnoid.com





==========================================================================
TOPIC: abstract interfaces
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/3c9900fa9970d77f
==========================================================================

== 1 of 2 ==
Date:   Sat,   Sep 11 2004 12:17 am
From: "Mike Schilling" <[EMAIL PROTECTED]> 


"Razvan" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> Hi !
>
>
>
>
>
>
>        In a Java test I noticed code like:
>
> abstract interface IDummy
> {
>      // ......
> }
>
>        This should trigger a compiler error. Interfaces are abstract
> by definition. It is pointless to define an abstract one. Am I right
> or not ?

It is pointless, but it's allowed.  Likewise, interface methods can be 
declared abstract and public, even though these keywords are also redundant. 
I suspect one can also say:

    class A
    {
        static interface I { }
    }

even though the interface obviously has no enclosing member.. 





== 2 of 2 ==
Date:   Sat,   Sep 11 2004 12:18 am
From: "Mike Schilling" <[EMAIL PROTECTED]> 


"Daniel Bonniot" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
>
> Note that "abstract interfaces" is a concept in itself (although it's not 
> present in Java): http://c2.com/cgi/wiki?AbstractInterface
>
Thanks for the reference.  That's something I often want to do.






==========================================================================
TOPIC: Is there a better parser (writen in java) than Jtidy?
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/730b70675cf88346
==========================================================================

== 1 of 1 ==
Date:   Sat,   Sep 11 2004 1:13 am
From: [EMAIL PROTECTED] (mike) 

regard:

     i use Jtidy to translate HTML file into XHTML file,but Jtidy cannot
     do good with complicated HTML files.

     Is there a better parser to translate HTML files into XHTML files?

thank you



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

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 



------------------------ Yahoo! Groups Sponsor --------------------~--> 
$9.95 domain names from Yahoo!. Register anything.
http://us.click.yahoo.com/J8kdrA/y20IAA/yQLSAA/BCfwlB/TM
--------------------------------------------------------------------~-> 

<a href=http://English-12948197573.SpamPoison.com>Fight Spam! Click Here!</a> 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/kumpulan/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 

Reply via email to