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

Today's topics:

* comp.lang.java.{help,programmer} - what they're for (mini-FAQ 2004-10-08) - 
1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/eb59b6c6bdd3895b
* how to cast a primitive type 'long' to byte[8] - 2 messages, 2 authors
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/3b17527882b80175
* Whiner Alert ! - 2 messages, 2 authors
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/5b0f39eca4dd2fc5
* How can I "force" an upcast? Convert subclass into superclass? - 1 messages, 
1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/ad4bc9f7ae03de71
* UnsupportedEncodingException - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/f05a57f2fc1fbd14
* converting unicode to UTF-8 - 3 messages, 3 authors
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/a237715716e67cc1
* Session tracking - url rewriting - servlet - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/87ff06928577daa5
* loading a class whose bytecode comes in a byte[] - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/4e991c30dd027000
* JBoss to go closed source - 3 messages, 3 authors
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/d0238b5ab38d4d44
* Microsoft to make Visual Studio Open Source - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/76bb971914b255fe
* Graphs and identifying adjacent nodes - 2 messages, 2 authors
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/bed75947f1fe79c
* Using com.sun.tools.javac.Main() for compiling - 2 messages, 2 authors
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/894f2738d346f374
* limitations of Java VM under Windows/Linux? - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/cc3538556e5ad6cd
* Error while getting Result Set Data from SQL 2000 - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/5796c291f001ce28
* Viewing Excel files using JSP - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/f16dea8279a55f05
* operators - 2 messages, 2 authors
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/79153676aedd1545
* How to write an efficient maximum function? - 2 messages, 2 authors
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/f759ff7cc130859e
* How do you cast to array? - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/884dee2def4bbb47
* Thread-question - 2 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/5766e179910e25fa
* Is it possible to set a block of code as non-JIT area? - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/efa6df384a75654c
* Workflow (FlowControl) Engine - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/7fac576192e8432
* External packages - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/bae8c29cb5e57bba
  
==========================================================================
TOPIC: comp.lang.java.{help,programmer} - what they're for (mini-FAQ 2004-10-08)
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/eb59b6c6bdd3895b
==========================================================================

== 1 of 1 ==
Date:   Sat,   Nov 20 2004 2:25 am
From: [EMAIL PROTECTED] (David Alex Lamb) 

Last-Modified: Fri Oct  8 11:38:42 2004 by David Alex Lamb
Archive-name: computer-lang/java/help/minifaq
Posting-Frequency: every 4 days

Before posting read Jon Skeet's "How to get answers on the comp.lang.java.*
newsgroups" at http://www.pobox.com/~skeet/java/newsgroups.html

Java FAQs and advice:
- Java FAQ (Andrew Thompson)  http://www.physci.org/codes/javafaq.jsp
  including his list of other FAQs http://www.physci.org/codes/javafaq.jsp#faq
- Java/Javascript/Powerbuilder HOWTO (Real Gagnon)
  http://www.rgagnon.com/howto.html
- Java Glossary (Roedy Green)  http://www.mindprod.com/jgloss.html
- jGuru jFAQs (John Zukowski)    http://www.jguru.com/jguru/faq/
- Focus on Java (John Zukowski)   http://java.about.com/
- Java Q&A (David Reilly)  http://www.davidreilly.com/jcb/faq/
- Java GUI FAQ (Thomas Weidenfeller) http://www.physci.org/guifaq.jsp

comp.lang.java.help     Set-up problems, catch-all first aid.
    According to its charter, this unmoderated group is for immediate help
    on any Java problem, especially when the source of the difficulty is
    hard to pin down in terms of topics treated on other groups.
        This is the appropriate group for end-users, programmers and
    administrators who are having difficulty installing a system capable of
    running Java applets or programs.  It is also the right group for
    people trying to check their understanding of something in the
    language, or to troubleshoot something simple.

comp.lang.java.programmer  Programming in the Java language.
    An unmoderated group for discussion of Java as a programming language.
    Specific example topics may include:
      o types, classes, interfaces, and other language concepts
      o the syntax and grammar of Java
      o threaded programming in Java - sychronisation, monitors, etc.
      o possible language extensions (as opposed to API extensions).
    The original charter said that discussion explicitly should not include
    API features that are not built into the Java language and gave examples
    like networking and the AWT.  These days AWT belongs in clj.gui, and
    networking (and many other APIs) are often discussed in clj.programmer.

Do not post binary classfiles or long source listings on any of these
groups. Instead, the post should reference a WWW or FTP site (short source
snippets to demonstrate a particular point or problem are fine).  For some
problems you might consider posting a SSCCE (Short, Self Contained, Correct
(Compilable), Example); see http://www.physci.org/codes/sscce.jsp

Don't post on topics that have their own groups, such as:
 comp.lang.java.3d        The Java 3D API
 comp.lang.java.advocacy  Arguments about X versus Y, for various Java X and Y
 comp.lang.java.beans     JavaBeans and similar component frameworks
 comp.lang.java.corba     Common Object Request Broker Architecture and Java
 comp.lang.java.databases Using databases from Java
 comp.lang.java.gui       Java graphical user interface design and construction
 comp.lang.java.machine   Java virtual machines, like JVM and KVM
 comp.lang.java.security  Using Java securely
 comp.lang.java.softwaretools Tools for developing/maintaining Java programs
Don't cross-post between these groups and c.l.j.programmer or .help -- it just
wastes the time of people reading the general groups.

Don't post about JavaScript; it's a different language.  See
comp.lang.javascript instead.
-- 
"Yo' ideas need to be thinked befo' they are say'd" - Ian Lamb, age 3.5
http://www.cs.queensu.ca/~dalamb/   qucis->cs to reply (it's a long story...)




==========================================================================
TOPIC: how to cast a primitive type 'long' to byte[8]
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/3b17527882b80175
==========================================================================

== 1 of 2 ==
Date:   Sat,   Nov 20 2004 2:33 am
From: "Andrei Kouznetsov" <[EMAIL PROTECTED]> 

> import java.io.*;
>
> public class X
> {
>  public static void main(String[] args) throws IOException
>  {
>   long l = 314159265L;
>
>   ByteArrayOutputStream baos = new ByteArrayOutputStream(8);
>   DataOutputStream dos = new DataOutputStream(baos);
>   dos.writeLong(l);
>   byte[] bytes = baos.toByteArray();
>
>   for(byte b : bytes)
>   {
>    System.out.println(b);
>   }

using uio (http://uio.dev.java.net) you can direct write and read any
primitive data type.

-- 
Andrei Kouznetsov
http://uio.dev.java.net Unified I/O for Java
http://reader.imagero.com Java image reader
http://jgui.imagero.com Java GUI components and utilities





== 2 of 2 ==
Date:   Sat,   Nov 20 2004 3:46 am
From: "Boudewijn Dijkstra" <[EMAIL PROTECTED]> 

"stingar" <[EMAIL PROTECTED]> schreef in bericht 
news:[EMAIL PROTECTED]
> help me!

  byte[] ba = new byte[8];

big-endian:

  ba[7] = (byte)  j;
  ba[6] = (byte) (j >>= 8);
  ba[5] = (byte) (j >>= 8);
  ba[4] = (byte) (j >>= 8);
  ba[3] = (byte) (j >>= 8);
  ba[2] = (byte) (j >>= 8);
  ba[1] = (byte) (j >>= 8);
  ba[0] = (byte) (j >>  8);

little-endian:

  ba[0] = (byte)  j;
  ba[1] = (byte) (j >>= 8);
  ba[2] = (byte) (j >>= 8);
  ba[3] = (byte) (j >>= 8);
  ba[4] = (byte) (j >>= 8);
  ba[5] = (byte) (j >>= 8);
  ba[6] = (byte) (j >>= 8);
  ba[7] = (byte) (j >>  8);






==========================================================================
TOPIC: Whiner Alert !
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/5b0f39eca4dd2fc5
==========================================================================

== 1 of 2 ==
Date:   Sat,   Nov 20 2004 2:39 am
From: John Doe <[EMAIL PROTECTED]> 

Nym shifting cross posting anonymous remailer troll.

Postmaster <[EMAIL PROTECTED]> wrote:

>Path: 
>newsdbm05.news.prodigy.com!newsdst01.news.prodigy.com!newsmst01a.news.prodigy.com!prodigy.com!news.glorb.com!newsgate.cistron.nl!news.cambrium.nl!ecngs!feeder.ecngs.de!38.119.100.83.MISMATCH!news-out1.nntp.be!propagator2-sterling!propagator3-cogent!in.nntp.be!news.dizum.com!sewer-output!mail2news-x5!mail2news-x4!mail2news-x3!mail2news-x2!mail2news
>Date: 15 Nov 2004 15:04:25 -0000
>Message-ID: <[EMAIL PROTECTED]>
>From: Postmaster <[EMAIL PROTECTED]>
>Subject: Re: Whiner Alert !
>Newsgroups: 
>alt.test,alt.drugs.pot,comp.lang.java.programmer,comp.os.linux.advocacy,comp.sys.ibm.pc.games.action
>References: <[EMAIL PROTECTED]> <[EMAIL PROTECTED]> <[EMAIL PROTECTED]> 
><[EMAIL PROTECTED]> <[EMAIL PROTECTED]> <[EMAIL PROTECTED]> <[EMAIL 
>PROTECTED]> <[EMAIL PROTECTED]>
>Comments: This message probably did not originate at the above address.        
>It was automatically remailed by one or more anonymous remailers.        
>Please use [EMAIL PROTECTED] to report abuse
>X-Remailer-Contact: Anonymous Mailer <[EMAIL PROTECTED]>
>X-Spam-Processed: dingoremailer.com, Mon, 15 Nov 2004 09:04:29 -0600 (not 
>processed: message from valid local sender)
>X-Return-Path: [EMAIL PROTECTED]
>X-MDaemon-Deliver-To: [EMAIL PROTECTED]
>Mail-To-News-Contact: [EMAIL PROTECTED]
>Organization: [EMAIL PROTECTED]
>Xref: newsmst01a.news.prodigy.com alt.test:2786706 alt.drugs.pot:636539 
>comp.lang.java.programmer:679289 comp.os.linux.advocacy:1108746 
>comp.sys.ibm.pc.games.action:705433
>
>In article <[EMAIL PROTECTED]>
>John Doe <[EMAIL PROTECTED]> wrote:
>>
>> Nym shifting cross posting anonymous remailer troll.
>>
>>
>
>Whiner.
>
>
>
>
>




== 2 of 2 ==
Date:   Sat,   Nov 20 2004 4:24 am
From: "ColoNel polyPs" <Extermination of the christian jew cop government is 
inevitable. Resistance @ futile> 


"John Doe" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Nym shifting cross posting anonymous remailer troll.
>
> Postmaster <[EMAIL PROTECTED]> wrote:
>
> >Path:
newsdbm05.news.prodigy.com!newsdst01.news.prodigy.com!newsmst01a.news.pr
odigy.com!prodigy.com!news.glorb.com!newsgate.cistron.nl!news.cambrium.n
l!ecngs!feeder.ecngs.de!38.119.100.83.MISMATCH!news-out1.nntp.be!propaga
tor2-sterling!propagator3-cogent!in.nntp.be!news.dizum.com!sewer-output!
mail2news-x5!mail2news-x4!mail2news-x3!mail2news-x2!mail2news

I'm still trying to get this goddamned microchip out of my back that
Richard Nixon, George Bush and George Bush stuck there when they
kidnapped, drugged and interogated me in 1982.









==========================================================================
TOPIC: How can I "force" an upcast? Convert subclass into superclass?
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/ad4bc9f7ae03de71
==========================================================================

== 1 of 1 ==
Date:   Sat,   Nov 20 2004 3:40 am
From: chairam <[EMAIL PROTECTED]> 

>public class CastTest {
>
>     class ClassA {}
>     class ClassB extends ClassA {}
>
>     CastTest() {
>         ClassA a = new ClassA();
>         ClassB b = new ClassB();
>         ClassA c = (ClassA) b;
>         System.out.println(a.getClass());
>         System.out.println(b.getClass());
>         System.out.println(c.getClass());
>     }
>
>     public static void main(String[] args) {
>         new CastTest();
>     }
>}
>
>If you execute the obove, you'll get the following:
>
>class test.CastTest$ClassA
>class test.CastTest$ClassB
>class test.CastTest$ClassB
>
>Why is the class of c still ClassB and _not_ ClassA? I casted it!
>[cut]

actually you don't cast b
you have only 2 objects in memory:
one referred by a and one referred by b and c

so it's obvious that:   System.out.println(c.getClass());
print:                  class test.CastTest$ClassB
because you wrote something like:
        System.out.println(new ClassB());

Bye
Chairam




==========================================================================
TOPIC: UnsupportedEncodingException
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/f05a57f2fc1fbd14
==========================================================================

== 1 of 1 ==
Date:   Sat,   Nov 20 2004 3:49 am
From: "Boudewijn Dijkstra" <[EMAIL PROTECTED]> 

"Andrew Thompson" <[EMAIL PROTECTED]> schreef in bericht 
news:[EMAIL PROTECTED]
> On Fri, 19 Nov 2004 22:38:44 GMT, Bill Lattery via JavaKB.com wrote:
>
> // as Ann mentioned, this statement will not compile..
> // please copy/paste code.
>
>> String mac = "1.2.3.4"
>
> String mac = "1.2.3.4";
> try {
>
>> byte[] bv = mac.getBytes("UTF-16");
>
> } catch(UnsupportedEncodingException uee) {
>  uee.printStackTrace();
> }

I think it would be better to
  throw new InternalError("missing required encoding: UTF-16");
in the catch block. 






==========================================================================
TOPIC: converting unicode to UTF-8
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/a237715716e67cc1
==========================================================================

== 1 of 3 ==
Date:   Sat,   Nov 20 2004 3:50 am
From: "Boudewijn Dijkstra" <[EMAIL PROTECTED]> 

"peter10" <[EMAIL PROTECTED]> schreef in bericht 
news:[EMAIL PROTECTED]
> Hi everybody,
>
> I would like to convert unicode text (coming from a swing JTextPane -
> I think that is unicode by default!?) to UTF-8.

The U in UTF stands for 'Unicode', so you want to convert Unicode to Unicode. 





== 2 of 3 ==
Date:   Sat,   Nov 20 2004 4:59 am
From: "Chris Uppal" <[EMAIL PROTECTED]> 

peter10 wrote:

> ByteArrayOutputStream out = new ByteArrayOutputStream();
> DataOutputStream dataOut = new DataOutputStream(out);
> dataOut.writeUTF(text_input);

The first problem here is that writeUTF8() does /NOT/ write UTF-8.  It's an
incredibly, unbelievably, stupidly, misleadingly-named method.  What it does is
write a two-byte character count (as Steve has already mentioned) followed by
some bytes that represent the string in a format that is (conceptually) related
to, but completely incompatible with, UTF-8.

UTF-8 is a a way of taking a stream/string of Unicode characters (and Java
Strings can be viewed as such, although the correspondence is not as close as
it looks), and representing them as bytes in a binary stream or similar.  In
Java that conversion is ultimately provided by a "charset", specifically the
one named "UTF-8".  Probably the easiest way for you to use that would be
either to ask your String for its
    aString.getBytes("UTF-8");
or to use an OutputStreamWriter constructed with a 'charsetname' of "UTF-8".

    -- chris





== 3 of 3 ==
Date:   Sat,   Nov 20 2004 6:43 am
From: Chris Smith <[EMAIL PROTECTED]> 

Steve Horsley <[EMAIL PROTECTED]> wrote:
> Look closely at the docs for writeUTF and you will find that it 
> also writes a 2-byte binary length indicator at the front. I guess
> this is the problem. I suggest that you use an OutputStreamWriter
> instead, like this:
> 
> ByteArrayOutputStream baos = new ByteArrayOutputStream();
> OutputStreamWriter out = new OutputStreamWriter(baos);
> out.write(text_input);

Since UTF-8 was explicitly requested, that should be:

ByteArrayOutputStream baos = new ByteArrayOutputStream();
OutputStreamWriter out = new OutputStreamWriter(baos, "UTF-8");
out.write(text_input);

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

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation




==========================================================================
TOPIC: Session tracking - url rewriting - servlet
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/87ff06928577daa5
==========================================================================

== 1 of 1 ==
Date:   Sat,   Nov 20 2004 3:54 am
From: [EMAIL PROTECTED] (gonas) 

I'm new to session tracking and i have problem with the following
code.

I have a servet which connects to another servlet, rewriting the URL

servlet 1 (/servlet/serv) has code 

        if(sess == null) 
        {
            sess = generateSessionID();
//the function generates ID perfectly
            out.println("new sess ID - "+sess);
        }
        else 
        {
            out.println("old sess ID - "+sess);
        }
        
        out.println("<FORM ACTION =\"/servlet/servl/"+sess+"\" METHOD
= POST>");
        out.println("<INPUT TYPE = SUBMIT VALUE =\"CLICK\">");
        out.println("</FORM>");

servlet 2(/servlet/servl) has code 

        if(sess == null) 
        {
            out.println("<a href=\"/servlet/serv\">go back</a>");
        }
        else 
        {
            out.println("servl sess ID - "+sess);
        }

when i execute the servlet i get the following errors

HTTP Status 404 - /servlet/servl/c837cd%3A1005202e54d%3A-8000

--------------------------------------------------------------------------------

type Status report

message /servlet/servl/c837cd%3A1005202e54d%3A-8000

description The requested resource
(/servlet/servl/c837cd%3A1005202e54d%3A-8000) is not available.


--------------------------------------------------------------------------------

Help me out please




==========================================================================
TOPIC: loading a class whose bytecode comes in a byte[]
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/4e991c30dd027000
==========================================================================

== 1 of 1 ==
Date:   Sat,   Nov 20 2004 3:49 am
From: Luca Rosellini <[EMAIL PROTECTED]> 

John C. Bollinger ha scritto:

> The problem here is in your readExternal method.  The strategy you have 
> adopted cannot work.  You successfully load the class, yes, but classes 
> are scoped to the ClassLoader that loads them.  When your 
> ObjectInputStream tries to tries to deserialize the Externalizable, it 
> asks its own ClassLoader for the object's class.  That ClassLoader does 
> not know the class (even though it has a descendant that does), and none 
> of its ancestors does either, thus you get a ClassNotFoundException.
> 
> To make a scheme like this work, you would need to insert a more 
> flexible custom ClassLoader somewhere much deeper in the application's 
> ClassLoader tree, perhaps [for the sake of convenience] as the 
> ClassLoader for everything except an "application launcher" class.  You 
> would obviously not be able to use a one-off ClassLoader for such a 
> purpose.

Is this really possible to achieve?
I mean, I could write my own classloader, but it would still need to 
delegate to {system|extension|bootstrap}classloader the loading of core 
classes. Since ObjectInput is a core class, it's classLoader doesn't 
know how to find the class even though my own global app classloader does.

Unfortunately RMI are not usable for this kind of application.

Best
Luca




==========================================================================
TOPIC: JBoss to go closed source
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/d0238b5ab38d4d44
==========================================================================

== 1 of 3 ==
Date:   Sat,   Nov 20 2004 4:25 am
From: [EMAIL PROTECTED] (Cindi Jenkins) 

Read about it at http://blogs.ittoolbox.com/eai/leadership



== 2 of 3 ==
Date:   Sat,   Nov 20 2004 5:25 am
From: Babu Kalakrishnan <[EMAIL PROTECTED]> 

Cindi Jenkins wrote:
> Read about it at http://blogs.ittoolbox.com/eai/leadership

The repeated posts referring to the same blog in this group smells very
much like a deliberate attempt to spread FUD - especially since the blog
mentions this as an "Imagine what would happen if" scenario.

Also I see this point very specifically addressed in :

http://www.jboss.org/faq/license

I have no connection whatsoever with JBoss inc. (not even as an
end-user) and neither am I a big fan of the GPL - this is just an
observation.

BK



== 3 of 3 ==
Date:   Sat,   Nov 20 2004 6:51 am
From: "Chris Uppal" <[EMAIL PROTECTED]> 

Babu Kalakrishnan wrote:

> The repeated posts referring to the same blog in this group smells very
> much like a deliberate attempt to spread FUD

I have been getting -- rightly or wrongly -- the same impression.

    -- chris






==========================================================================
TOPIC: Microsoft to make Visual Studio Open Source
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/76bb971914b255fe
==========================================================================

== 1 of 1 ==
Date:   Sat,   Nov 20 2004 4:26 am
From: [EMAIL PROTECTED] (Cindi Jenkins) 

Visual Studio news at http://blogs.ittoolbox.com/eai/leadership




==========================================================================
TOPIC: Graphs and identifying adjacent nodes
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/bed75947f1fe79c
==========================================================================

== 1 of 2 ==
Date:   Sat,   Nov 20 2004 4:32 am
From: [EMAIL PROTECTED] (vee dub) 

> 
> Measuring the number of edges of distance is more difficult than merely 
> finding adjacent nodes.  That is, a distance of one edge is much easier 
> to identify than a longer distance.  Given your data structures, finding 
> adjacent nodes should be done with a simple loop through your array of 
> edges.  There is no better way.

Thanks for your input, what condition should I be testing for when I
do this loop to check if another node is adjacent or not.
Thanks



== 2 of 2 ==
Date:   Sat,   Nov 20 2004 6:33 am
From: Chris Smith <[EMAIL PROTECTED]> 

vee dub <[EMAIL PROTECTED]> wrote:
> Thanks for your input, what condition should I be testing for when I
> do this loop to check if another node is adjacent or not.

Thomas pretty much gave you exact source code in his response.

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

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation




==========================================================================
TOPIC: Using com.sun.tools.javac.Main() for compiling
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/894f2738d346f374
==========================================================================

== 1 of 2 ==
Date:   Sat,   Nov 20 2004 4:36 am
From: ExGuardianReader <[EMAIL PROTECTED]> 

hiwa wrote:
> "Fahd Shariff" <[EMAIL PROTECTED]> wrote in message news:<[EMAIL 
> PROTECTED]>...
> 
>>You could create a Temporary file which you can delete later on.
>>
>>Or you can look at javac's source code and see if there is any other
>>method that might do what you are looking for...
> 
> 
> Using temporary file is good because no hack is needed. We can't
> access javac's input stream by a standard way.

I've looked at the source code, and there seems to be no other access to 
the compiler other than through a file.

This seems very poor design with InputStreams available. We should to be 
able to provide an InputStream of Java source code to a compiler method 
to generate new bytecode.

Generating skeleton server classes would be much neater if you could do 
this.




== 2 of 2 ==
Date:   Sat,   Nov 20 2004 6:09 am
From: [EMAIL PROTECTED] (Jesper Sahner) 

How do you access the source code? You only have the byte-code as far as I know.

Regards,
Jesper




==========================================================================
TOPIC: limitations of Java VM under Windows/Linux?
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/cc3538556e5ad6cd
==========================================================================

== 1 of 1 ==
Date:   Sat,   Nov 20 2004 5:10 am
From: Angus Parvis <[EMAIL PROTECTED]> 

Hi,

I'm currently writing a paper about the limitations of the Java VM under 
  Windows and Linux.

I thought to write about the following: Sockets (size, number of packets 
that can be processed at once), COM-communication, behavior of GUI, 
character representation (encondings used), class java.lang.System, 
garbage collection.

What do you think about these topics? Are they worth to be discussed? 
What about other topics - do you have any experience with limitations of 
the Java VM?

Thanks for your help,

Angus




==========================================================================
TOPIC: Error while getting Result Set Data from SQL 2000
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/5796c291f001ce28
==========================================================================

== 1 of 1 ==
Date:   Sat,   Nov 20 2004 5:16 am
From: "Murray" <[EMAIL PROTECTED]> 


"biswa" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
>I had problem with order of result set only for MS-ACCESS. It works
> fine with MS-SQL,mySQL. I have not tested with Oracle though. Anyhow,
> i guess it is best way to read the resultset only once. But sometimes
> I use
> if(rs.getString(iRowID) != null && rs.getString(iRowID+1) != null) {
> //do something..
> //it works with SQL7, but not with SQL 2000.
> }
> In that case, i have to use more than one variable and assign it
> everytime.
> because sometimes my result set returns more than 10,000 records or
> so.
> Well, i guess that is the price i have to pay.
>
> Thanks

No problem with Oracle or DB2. I've never encountered the problem, even with 
SQL 2000? Although we were using the jTDS driver I think, not Microsoft's 






==========================================================================
TOPIC: Viewing Excel files using JSP
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/f16dea8279a55f05
==========================================================================

== 1 of 1 ==
Date:   Sat,   Nov 20 2004 5:21 am
From: "shakah" <[EMAIL PROTECTED]> 

You probably have to add Excel to Tomcat's MIME types in order for it
to send the correct response header.

I think you just have to add the following to the webapp's web.xml (as
a child of the web-app tag):

<mime-mapping>
<extension>xls</extension>
<mime-type>application/msexcel</mime-type>
</mime-mapping>





==========================================================================
TOPIC: operators
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/79153676aedd1545
==========================================================================

== 1 of 2 ==
Date:   Sat,   Nov 20 2004 6:11 am
From: "<- Chameleon ->" <[EMAIL PROTECTED]> 

I have a class Digit and I want to implement operators + - * / with 2 
Digits, a Digit and an Integer, a Digit and an int, a Digit and a Double 
etc.

Is this possible?



== 2 of 2 ==
Date:   Sat,   Nov 20 2004 6:31 am
From: Chris Smith <[EMAIL PROTECTED]> 

<- Chameleon -> <[EMAIL PROTECTED]> wrote:
> I have a class Digit and I want to implement operators + - * / with 2 
> Digits, a Digit and an Integer, a Digit and an int, a Digit and a Double 
> etc.
> 
> Is this possible?

Nope, there is no user-defined operator overloading in Java.

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

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation




==========================================================================
TOPIC: How to write an efficient maximum function?
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/f759ff7cc130859e
==========================================================================

== 1 of 2 ==
Date:   Sat,   Nov 20 2004 6:42 am
From: "Chris Uppal" <[EMAIL PROTECTED]> 

Ahmed Moustafa wrote:

> It's an implementation of Smith-Waterman for biological sequence
> alignment, the difference between inlining the comparisons and calling a
> method is very noticeable when aligning large sequences (order of 10K).

Right; "jaligner", I presume.  So it's O(M*N) in sequence length...  Makes
sense
now, thanks.

    -- chris






== 2 of 2 ==
Date:   Sat,   Nov 20 2004 6:53 am
From: Ahmed Moustafa <[EMAIL PROTECTED]> 

>>It's an implementation of Smith-Waterman for biological sequence
>>alignment, the difference between inlining the comparisons and calling a
>>method is very noticeable when aligning large sequences (order of 10K).
> 
> 
> Right; "jaligner", I presume.  So it's O(M*N) in sequence length...  Makes
> sense
> now, thanks.

Yes, that's right :)




==========================================================================
TOPIC: How do you cast to array?
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/884dee2def4bbb47
==========================================================================

== 1 of 1 ==
Date:   Sat,   Nov 20 2004 6:41 am
From: "Chris Uppal" <[EMAIL PROTECTED]> 

NOBODY wrote:

> But whatever words I use, if avoiding 'new' give me a magnitude of
> throughput increase, I won't forget the trick soon.

You would be insane to do so.  Never forget a trick that worked; but I would
warn against learning too much from such occasions.

There's a phrase from a book by R A Lafferty that I treasure:
    "we must be careful not to learn too much from our mistakes"


> Can you imagine the upcoming nightmare with 1.5 autoboxing?!
> This is the worst feature of 1.5. It is a serious mistake from a language
> perspective.

I agree that there is considerable scope for unwitting abuse.  I'm not sure I'd
call it the /worst/ feature, though -- for instance it could be seem as no more
than a symptom of the underlying weakness in generics that they can't handle
primitive types.


> Juniors are gonna start using autoboxing like they know nothing better.

<grin> It all helps to keep the job market for seniors alive...


> Damn it, we will have to develop another language again...
> ;)

<nods sadly>

[...insert obligatory reference to Smalltalk here...]

    -- chris







==========================================================================
TOPIC: Thread-question
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/5766e179910e25fa
==========================================================================

== 1 of 2 ==
Date:   Sat,   Nov 20 2004 6:40 am
From: "Chris Uppal" <[EMAIL PROTECTED]> 

John C. Bollinger wrote:

> > Actually, I'd prefer to have beFinalizable() and beNotFinalizable() as
> > (probably protected) methods of Object, and for "finalisability" to be
> > off for all objects, by default, regardless of whether they defined a
> > finalize() method.  I.e. it should be the programmer's responsibility
> > to manipulate finalisability as necessary, not left up to an
> > ill-defined system "optimisation".
>
> I think I have to disagree with you on this one, Chris.  The programmer
> can already control this dimension to a limited extent by deciding
> whether or not to override Object.finalize().  To be sure, that's a
> per-class decision, not a per-object one, but I think that's where the
> decision belongs.

It's probably "agree to differ" time then ;-)   At a guess you a reasoning at
least partly by analogy with ordinary GC, where /not/ leaving memory
allocation/deallocation under the control of the programmer has too many
advantages to list ?

My position is that finalization itself is a fairly "heavy-weight" operation,
and as such is less well-suited to automation.  Mainly because there's more to
loose when (or if) the system doesn't handle it as well as I/we could if we
were doing it by hand.  (There's a definite parallel there with closing file
handles, which are too heavyweight to be suitable for handling completely
automatically -- by finalisation, for instance ;-)

The other reason I favour the more explicit approach is that I work with it
often and find it "feels" better (as I've mentioned before, I do more work in
Smalltalk than Java, and that's how the implementation I use works).  There is
an efficiency gain, of course, to being able to turn finalisation on only as
and when needed (during any specific object's total lifetime), and I don't
think that should be ignored.  But the other side of the coin is that I find
that code with explicit control of finalisation is actually /clearer/ than the
equivalent would be in Java.   That's because the normal pattern (virtually
universal) is that you do a (using Java syntax)
    this.beFinalizable();
at the time when you acquire a resource that must be released (such as an open
OS file handle  -- this is internal to the object that wraps that handle, of
course); and you do a
    this.beNotFinalizable();
at the time when you relinquish that resource.  I find that those methods act
as flags that show very clearly how the object does its resource management.
You might say that they form the skeleton of the design, and once you can see
that clearly, then it's easier to see where the flesh fits around it.

I find it particularly helpful in cases where the object is normally cleaned up
explicitly, but may also be handled by finalisation as a fall-back for when
explicit clean-up would overcomplicate the design.  In such cases it can be
difficult to get a handle on where the responsibility lies  -- which methods
you /may/ call, which ones you /must/ call, which ones you must /not/ call more
than once...   In such cases I start by looking for
beFinalizable()/beNotFinalizable() and the whole thing then normally becomes
crystal clear.


> Do you have a concrete-ish example of how your version of finalization
> management would be an improvement over what Java already offers?

Two somewhat indirect examples, and coming from slightly different directions.
I don't know how convicing you'll find them, but at least they are both real
examples, taken from the Smalltalk system I work with:

Database connections, and other similarly heavy-weight database-related objects
(prepared statements, etc) are best cleaned up explicitly (IMO).  They also may
be complicated enough (internally) for the concerns that Gordon mentioned
(keeping object networks alive, etc) to be an issue in practise.  However it
would also be unthinkable (for various reasons) not to make open DB connections
clean up by finalisation, where necessary.  Notice also that DB code can (in
some cases) place considerable strain on the finaliser thread since the code
may not be interactive (so no handy pauses to work in while the user thinks).
The end result of that is that you want to be able to turn off "finalisability"
in the clean-up code, or else you have to write extra code to ensure that the
cleaned-up but still finalisable object puts as little strain on the system as
possible.

The other example is about managing Windows GDI handles.  In this case the
resource to be managed is quite lightweight, and there's no great problem with
relying mostly on finalisation to clean-up (which simplifies the system very
considerably, or at least allows significantly greater flexibility for a given
degree of complexity).  What /is/ a problem is understanding how the handles
are managed, especially since some are "owned", and must be cleaned up, and
some are "shared" and must /not/ be cleaned up, but the two are otherwise
interchangeable.  In this case I think the biggest benefit of explicit control
of finalisation is just that: it /is/ explicit.  It makes it easier to
understand how that part of the system fits together.

    -- chris





== 2 of 2 ==
Date:   Sat,   Nov 20 2004 6:21 am
From: "Chris Uppal" <[EMAIL PROTECTED]> 

Carl Howells wrote:

> Cleanup of non-memory resources can be done with a PhantomReference and
> ReferenceQueue combination, with much simpler semantics than those of
> finalization.  After all, there's no chance of object resurrection with
> that system, meaning that the cleanup *will* only be done once.
>
> It is slightly more difficult to implement than just overriding a
> finalize method, admittedly...  But I think it's also conceptually more
> elegant.

Fair enough, though I don't share that opinion.

To me it seems like essentially the same thing (introspection on objects'
lifetimes) packaged more indirectly (and somewhat more confusingly).  I'll
admit, though, that that may be more an artefact of Sun's /specific/ design
(and poor documentation), than inherent in the idea of reference queues itself.
Maybe I'll warm to 'em yet...

    -- chris






==========================================================================
TOPIC: Is it possible to set a block of code as non-JIT area?
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/efa6df384a75654c
==========================================================================

== 1 of 1 ==
Date:   Sat,   Nov 20 2004 4:42 am
From: "Chris Uppal" <[EMAIL PROTECTED]> 

Samuel Penn wrote:

> > > It's not an inherently silly thing to want, but I don't know of any
> > > JVM implementation that provides it -- probably because there's
> > > little need for it in general.
>
> Standard Sun JVM does this. We had a problem in 1.3 with hotspot
> causing an infinite loop in one class, and Sun recommended disabling
> hotspot on that class.

 Ah!   That's the first I'd heard of that.  Thank you for the pointer.

Googling for "hotspot_compiler" turns up more information.

    -- chris






==========================================================================
TOPIC: Workflow (FlowControl) Engine
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/7fac576192e8432
==========================================================================

== 1 of 1 ==
Date:   Sat,   Nov 20 2004 7:00 am
From: "Heiner Kücker" <[EMAIL PROTECTED]> 

Hi all

Sorry, my englisch is not good.

I have written an JSP-FlowControl-Framework called
'Control and Command'.

My Framework enabled to write an JSP application
easy like an modal DOS application like BASIC or
CLIPPER.

Online demo is available on
http://www.control-and-command.de

The bottom of the demo pages shows the scripting source code
with an arrow on the current source code line.

This is an JSP Custom Tag for debug.

An single step debug mode is available.

The CnC-Language contents procedures and functions
with parameters (per value or per reference)
and control structurs
if/else if/else condition,
while loop
and do loop.

Sorry, Documentation is completely written in german language.

My Framework contents an DomainParser (parser for an
Domain Specific Language), an Compiler and a
Flow Processing Unit.

It works with JSP Custom Tags.

It´s completely free.

I´m pleased over an positive feedback or
success story by using my framework.

Heiner Kuecker
http://www.heiner-kuecker.de






==========================================================================
TOPIC: External packages
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/bae8c29cb5e57bba
==========================================================================

== 1 of 1 ==
Date:   Sat,   Nov 20 2004 7:14 am
From: "I.L.B." <[EMAIL PROTECTED]> 

I just get rid of this by including all the classes by importing
"com.whatever.*" ...

But then I get a lot of errors because it does not recognize user defined
variables and functions that are supposed to be defined in that new imported
pagkages, giving me errors like :

" cannot resolve symbol: ... "

Any ideas?

Thanks
"Tony Morris" <[EMAIL PROTECTED]> escribió en el mensaje
news:[EMAIL PROTECTED]
>
> "I.L.B." <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > Hi ,
> >
> > I got several source code Java files to compile... They import both
> standard
> > java class libraries as "java.awt... etc" but also another private ones
> > (included as external class files). When I try to compile with javac, it
> > gives a lot of error because it cannot import the "special" class
> libraries.
> >
> > I got those class libraries as class files in a folder, but I don't know
> how
> > to "install" them into my java in order that they're recognized when it
> > comes to compile java files into class files.
> >
> > Thanks !!
> >
> >
>
> Put the base directory of the classes on the classpath at compile-time
using
> the -classpath switch.
>
> Also,
> http://java.sun.com/docs/books/tutorial/java/interpack/packages.html
>
> -- 
> Tony Morris
> http://xdweb.net/~dibblego/
>
>





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

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