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

Today's topics:

* Developing MIDlet for PDAs and cell phones - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/5d0109d66581670e
* Stupid null pointer exception - 2 messages, 2 authors
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/aeeebd0bb6f11be3
* Method invocation conversion - 2 messages, 2 authors
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/a84caa7322a6162d
* Code compiled with JDK1.2. Will it be compilable with JDK1.4?? - 3 messages, 3 
authors
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/eb71120d3dc9286e
* AppletViewer and access to the local filesystem - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/aae0f7f6692849ef
* applet's call comportement - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/cc1d4563dc67060c
* Problem in Creating and reading a JPEG image through BufferedImage class - 2 
messages, 2 authors
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/1cab4e8aa70b1d92
* Looking for a tutor to help me with Java - 3 messages, 3 authors
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/2e1fffe0df28274c
* How to find the JRE version used by the processes? - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/6c633c6de6952c5b
* A question to parse HTML files - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/f5792f3bd809986a
* Timeout for InputStream - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/2b007c3bdd51a445
* If you wanna be my lover... - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/5b0f39eca4dd2fc5
* stack implementation - 6 messages, 3 authors
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/5c909f1ce5b4696a
* How to know if a CD is inserted in the cdrom drive from java ? - 2 messages, 2 
authors
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/b5d0b1b8567b852
* JWS cache common resources? - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/ef65ca0751c1c10a
* JDB and assertions - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/37a9dac79b5a77ce
* XML Pretty Printer - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/9d992999aba0854d
* JBuilder / BlueJ question - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/bfea91ed00a06b2c
  
==========================================================================
TOPIC: Developing MIDlet for PDAs and cell phones
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/5d0109d66581670e
==========================================================================

== 1 of 1 ==
Date:   Mon,   Nov 1 2004 7:16 pm
From: "Darryl L. Pierce" <[EMAIL PROTECTED]> 

Rhino wrote:

>> There's no MIDP 3 expert group. Such matters as the color of
>> UI widgets is just not important enough to warrant a new specification
>> and would really just bload the API without providing any real benefit.
>>
> I agree that colour alone is probably not a sufficient justification to
> develop a major new version of the API. However, I imagine other more
> important expansions of the capabilities of the MIDPs will come along
> before very long. Or is it more likely that these enhancements will be
> added to the Personal Basis for specific groups of devices? I'm still not
> clear on exactly how these different profiles fit together and how each
> evolves to meet new requirements.

Personal Basis is a minimal set of the Personal Profile for headless devices
and minimal display devices. But, again, there's no MIDP 3 TMK. The EG just
released MIDP 2 last year and to start on a third specification now would
make for an unsteady market and do more harm than good to Java adoption.

-- 
/**
 * @author Darryl L. Pierce <[EMAIL PROTECTED]>
 * @see    The Infobahn Offramp <http://mcpierce.multiply.com>
 * @quote  "Lobby, lobby, lobby, lobby, lobby, lobby..." - Adrian Monk
 */




==========================================================================
TOPIC: Stupid null pointer exception
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/aeeebd0bb6f11be3
==========================================================================

== 1 of 2 ==
Date:   Mon,   Nov 1 2004 7:25 pm
From: "Virgil Green" <[EMAIL PROTECTED]> 


"Ann" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>
> > use. All you did was add one line of snide comment.
>
> I know.

Which, of course, makes the netiquette violation even more egregious.

 - Virgil





== 2 of 2 ==
Date:   Mon,   Nov 1 2004 9:12 pm
From: "Ann" <[EMAIL PROTECTED]> 


"Virgil Green" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>
> "Ann" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> >
> > > use. All you did was add one line of snide comment.
> >
> > I know.
>
> Which, of course, makes the netiquette violation even more egregious.
>
>  - Virgil
>

I know.






==========================================================================
TOPIC: Method invocation conversion
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/a84caa7322a6162d
==========================================================================

== 1 of 2 ==
Date:   Mon,   Nov 1 2004 7:51 pm
From: "Mark Bottomley" <[EMAIL PROTECTED]> 

"Daniel Sjöblom" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> The VM spec says in chapter 4.8.2, Structural constraints:
>
> The arguments to each method invocation must be method invocation
> compatible (§2.6.8) with the method descriptor (§4.3.3).
>
> And 2.6.8 reads:
>
> Method invocation conversion is applied to each argument value in a
> method or constructor invocation: the type of the argument expression
> must be converted to the type of the corresponding parameter. Method
> invocation contexts allow the use of an identity conversion (§2.6.1), a
> widening primitive conversion (§2.6.2), or a widening reference
> conversion (§2.6.4). Method invocation conversions specifically do not
> include the implicit narrowing of integer constants that is part of
> assignment conversion (§2.6.7).
>
> While the above is obviously enforced in the java language, I find it to
> be imprecise when it comes to java bytecode, specifically when it comes
> to the 'inferior' types, ie. byte, short, char and boolean. Sun's JVM
> (versions 1.5.0 rc, 1.4.2) for example does *not* require casts from
> e.g. int to byte when calling a method taking a byte as argument, and I
> find it to be sensible to allow it as well (in bytecode that is).
>
> So is 2.6.8 to be interpreted simply as 'The VM will not perform any
> implicit narrowing conversions on method invocation, (a byte is a short
> is an int)' or is the Sun VM non-compliant?
> -- 
> Daniel Sjöblom
> Remove _NOSPAM to reply by mail

Daniel:

    Internal to the VM, there are really no such things as bytes, shorts,
booleans and chars. The only bytecodes that recognize them are the
conversion bytecodes e.g. i2s, b2i etc.that (in the integer case) take
a 32 stack entry and either sign or zero extend it or truncate it. The
result is still stored in a 32-bit stack entry. e.g. i2b assumes to pop an
integer from the stack, truncate it to a byte and then sign extend it back
to an integer and push it on the stack. The only other places that
bytes, shorts, booleans and chars are recognized are the array load/store
bytecodes that sign/zero extend the data upon reading the array or
truncate the data on writing to the array. This is why there is no implicit
narrowing in the VM method invocations - they are all 32-bits already
if they are on the stack as they must be for a method invocation. Even
bipush and sipush take their 8/16 parameters and sign extend them to
32-bits before they a re pushed on the stack. ldc only recognizes integers,
floats and string constants as possible parameters.
 The verifier of the VM will only check that the
value to be stored by a b/c/s/iastore is an integer, the array index is
an integer, and that the array type is a byte/char/short/integer array.

    The result is that all things internal to the VM are 32 (or 64) bits
and it does not track bytes, chars, shorts, or booleans as separate
types, but as integers. There are no 8 or 16 bit wide registers or
stacks in the virtual machine architecture.

    The conversions mentioned above are identity (obvious - do
nothing), widening primitive (the argument is called a byte/short/
boolean/char will be treated as an integer - neither integers nor
floats would be automatically widened to longs or doubles),
widening reference (no action - accepts subclasses in the hierarchy
as the requested class). The difference with assignments comes
from supporting the Java semantics, if Byte b; Integer a; Integer c;
and b = a + c; (Java may require an explicit cast b = (Byte)(a + c);)
then the bytecodes would be:

iload (local variable containing a)
iload (local variable containing c)
iadd
i2b
istore (local variable containing b)

this guarantees that the range of the addition result is trimmed to be
in the -128..127 range of a valid byte. The bytecodes that generated
the parameter for the the method call would compile to something
that guaranteed the value was in a range for the appropriate integer
subtype before it got to the method call

Mark....





== 2 of 2 ==
Date:   Tues,   Nov 2 2004 12:59 am
From: "Chris Uppal" <[EMAIL PROTECTED]> 

Daniel Sjöblom wrote:

> The VM spec says in chapter 4.8.2, Structural constraints:

The way I read chapter 2 is as a non-normative description of the Java
/language/, provided FIY, and essentially irrelevant to the JVM spec.
Actually, the first paragraph of that chapter says roughly the same thing.

It's not clear what that chapter is supposed to accomplish (except confusion)
since it can certainly be expected that anyone reading the JVM spec is as
familiar as they need to be with Java-the-language concepts.   It would be much
better, IMO, if all references to the Java language were expunged from the JVM
spec, or at least if ch2 were removed and references to it changed into
(explicitly non-normative) refs to the JLS.

    -- chris







==========================================================================
TOPIC: Code compiled with JDK1.2. Will it be compilable with JDK1.4??
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/eb71120d3dc9286e
==========================================================================

== 1 of 3 ==
Date:   Mon,   Nov 1 2004 8:16 pm
From: "Alex Molochnikov" <[EMAIL PROTECTED]> 

You are probably right, as far as the compile part is concerned. Whether
your application wil run without any further debugging is a big question.
When we ported STEP FORWARD from Java 1.3 to Java 1.4, lots of client-side
stuff had to be changed.

Why don't you just try compiling it under 1.4 and see what happens?

Alex Molochnikov
Gestalt Corporation
www.gestalt.com

"qazmlp" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> This is related to porting our Application to Java 1.4.
> Currently, we have our application code written and compiled with
> JDK1.2.
> Now, we are planning to re-compile the complete code with JDK1.4 and
> also use the JRE1.4 to run the application.
>
> I assume the same code should get compiled successfully with JDK1.4 as
> there are no Java1.2 interfaces changed/removed in Java1.4. Am I
> right? Could you confirm it?
>
> Thanks!





== 2 of 3 ==
Date:   Mon,   Nov 1 2004 8:17 pm
From: Andrew Thompson <[EMAIL PROTECTED]> 

On 1 Nov 2004 18:43:42 -0800, qazmlp wrote:

> Sub: Code compiled with JDK1.2. Will it be compilable with JDK1.4??

Yes.  The only issue is deprecated methods, which should only
throw warnings when compiled.

OTOH, you should not need to 'recompile' a 1.2 project to run 
on 1.3, 1.4, or 1.5.  It should run as-is.

HTH

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



== 3 of 3 ==
Date:   Tues,   Nov 2 2004 1:08 am
From: Michael Borgwardt <[EMAIL PROTECTED]> 

qazmlp wrote:
> I assume the same code should get compiled successfully with JDK1.4 as
> there are no Java1.2 interfaces changed/removed in Java1.4. Am I
> right?

You could run into problems if somewhere you use "assert" as an identifier
(e.g. method name), since that has become a keyword in 1.4. There is a
compiler option to ignore it, but if it's in a public interface that other
people write code against, you force them to do the same thing, which
automatically means that the assertions feature connected to the keyword
cannot be used. Changing the identifier is probably the better option.

JUnit ran into exactly this dilemma.





==========================================================================
TOPIC: AppletViewer and access to the local filesystem
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/aae0f7f6692849ef
==========================================================================

== 1 of 1 ==
Date:   Mon,   Nov 1 2004 8:35 pm
From: Andrew Thompson <[EMAIL PROTECTED]> 

On Mon, 01 Nov 2004 19:07:30 +0000, G Winstanley wrote:

> I've been trying to get appletviewer to have read access to images on the
> local filesystem 

Why?

>..to make applet testing easier, 

OK, but what do you intend doing for deployment?

This is a very relevant and important question since
any applet worth worrying about gets deployed to the net
and you must have another strategy for that circumstance.

In that case, it might make sense to go directly to the
strategy you intend to use on deployment.

>... but I'm coming across
> problems. The most obvious route to take seemed to be creating a user policy
> file (.java.policy) with the appropriate entry, but this seems to have
> failed. I've tried the following:

Are you reading or writing to the files?

If you are just reading, you can put the fiel ine the classpath
and appletviewer will read it without further hassles.
<http://java.sun.com/sfaq/#read>

HTH

-- 
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: applet's call comportement
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/cc1d4563dc67060c
==========================================================================

== 1 of 1 ==
Date:   Mon,   Nov 1 2004 8:49 pm
From: Andrew Thompson <[EMAIL PROTECTED]> 

On Sat, 30 Oct 2004 17:46:12 +0200, Emmanuel Freund wrote:

> Well, the AWT toolkit's environnement don't match the things i want to
> render. 

What 'things' are you referring to?  Fonts (faces and sizes)
spacig or padding, borders etc. can all be controlled for 
Swing components by setting a suitable Look and Feel.

>..But i aggree it would be simpler in this way.
> I'm just wondering, when an applet call the JFrame class for example, there
> has to be somewhere the path where the applet could find this class, so if
> we change the path toward my own class, the applet will call my own class
> instead, no?

No.  Java will always check the core API for classes before 
it looks in other places.  It is easy to replace classes outside
the core classes in the way you describe, but not the core classes 
themselves.

Note also that (AFAIU), changing the classloader will not help
here, since custom classloaders first cede to the parent classloader>
If the parent classloader finds the class, the custom loader 
simply passes that class back to the caller.

-- 
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: Problem in Creating and reading a JPEG image through BufferedImage class
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/1cab4e8aa70b1d92
==========================================================================

== 1 of 2 ==
Date:   Mon,   Nov 1 2004 8:59 pm
From: [EMAIL PROTECTED] (Amar More) 

Hi all,

I am working on am image porcessing project, in which I am using JPEG
files.In this project I am taking one JPEG file as an input and
getting the pixels from it by using BufferedImage class in Java. 
After processing those pixels I am creating another image with the
same BufferedImage class and saving with another name.
     After that I am displaying the pixels of the newly created image
and the array contents from which I have created the same image.  But
they are not matching.  So please help me in setting the parameters of
BufferedImage class of Java.



== 2 of 2 ==
Date:   Tues,   Nov 2 2004 1:20 am
From: Thomas Weidenfeller <[EMAIL PROTECTED]> 

Amar More wrote:
> Hi all,

Your problem is not so important that it requires cross-posting to three 
groups. F'up set.

>      After that I am displaying the pixels of the newly created image
> and the array contents from which I have created the same image.  But
> they are not matching.

JPEG is a lossy compression technology (well, at least that part of the 
standard everyone uses). So a compressed/decompressed image will almost 
never match the original image data.

> So please help me in setting the parameters of
> BufferedImage class of Java.

This has nothing to do with BufferedImage. Change the external image format.

/Thomas




==========================================================================
TOPIC: Looking for a tutor to help me with Java
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/2e1fffe0df28274c
==========================================================================

== 1 of 3 ==
Date:   Mon,   Nov 1 2004 9:41 pm
From: [EMAIL PROTECTED] (Tara Bratberg) 

If anyone is interested in tutoring a beginner in Java, I would really
appreciate it. I'm new to programming and am having some trouble
grasping the big picture when trying to create a program. I can do the
small steps fine, but when there are specifications for a program, I
have trouble laying it all out.



== 2 of 3 ==
Date:   Mon,   Nov 1 2004 9:52 pm
From: Andrew Thompson <[EMAIL PROTECTED]> 

On 1 Nov 2004 21:41:28 -0800, Tara Bratberg wrote:

> If anyone is interested in tutoring a beginner in Java, 

A better group for beginners (in general) is described here..
<http://www.physci.org/codes/javafaq.jsp#cljh>

> ..I would really
> appreciate it. 

You will get lots of help (free) from well worded questions
to c.l.j.help, but I also offer tutoring services.
<http://www.athompson.info/andrew/svc/index.jsp?svc=java>

HTH

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



== 3 of 3 ==
Date:   Tues,   Nov 2 2004 12:02 am
From: anal_aviator <[EMAIL PROTECTED]> 

On Tue, 2 Nov 2004 13:41:28 +0800, Tara Bratberg wrote
(in article <[EMAIL PROTECTED]>):

> If anyone is interested in tutoring a beginner in Java, I would really
> appreciate it. I'm new to programming and am having some trouble
> grasping the big picture when trying to create a program. I can do the
> small steps fine, but when there are specifications for a program, I
> have trouble laying it all out.

post  us a picture & we will think about it.





==========================================================================
TOPIC: How to find the JRE version used by the processes?
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/6c633c6de6952c5b
==========================================================================

== 1 of 1 ==
Date:   Mon,   Nov 1 2004 10:16 pm
From: [EMAIL PROTECTED] (qazmlp) 

My application which is running on a Solaris machine, constitutes of
lot of Java processes. I know that some of that processes run within
Java 1.2 environment and other processes run within JRE1.4.

Is there a way to find out what processes use JRE1.2/JRE1.4 (without
changing the code)?




==========================================================================
TOPIC: A question to parse HTML files
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/f5792f3bd809986a
==========================================================================

== 1 of 1 ==
Date:   Mon,   Nov 1 2004 11:11 pm
From: [EMAIL PROTECTED] (mike) 

thanks for your reply.
regards:

HTML document->Jtidy api->XHTML document
since XHTML document is an application of XML.

So I can use java xml api or any other xml parser
or other xml tool to parse the XHTML document.

Am I right?

Or there is something wrong with my idea.

thank you
best wishes




==========================================================================
TOPIC: Timeout for InputStream
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/2b007c3bdd51a445
==========================================================================

== 1 of 1 ==
Date:   Mon,   Nov 1 2004 11:33 pm
From: "Manish Hatwalne" <[EMAIL PROTECTED]> 

Is it possible somehow to get an input stream from an HttpURLConnection
object to timeout on a read() operation?
How can I do it?

TIA,
- Manish






==========================================================================
TOPIC: If you wanna be my lover...
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/5b0f39eca4dd2fc5
==========================================================================

== 1 of 1 ==
Date:   Mon,   Nov 1 2004 11:41 pm
From: "Vince" <[EMAIL PROTECTED]> 

"Bateau" wrote

> Vegans don't do all they can to avoid causing animal suffering because
> it is inconvenient to their lifestyle.

And again in English... 






==========================================================================
TOPIC: stack implementation
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/5c909f1ce5b4696a
==========================================================================

== 1 of 6 ==
Date:   Mon,   Nov 1 2004 11:50 pm
From: Tor Iver Wilhelmsen <[EMAIL PROTECTED]> 

"George W. Cherry" <[EMAIL PROTECTED]> writes:

> Why did you implement this with LinkedList rather
> than ArrayList?

Because LinkedList is more efficient when you only manipulate the
start and end of the list, and are not interested in accessing
elements by their index. Basically, with an ArrayList you have an
underlying array that will grow and have its elements shifted about
whenever you do a pop().



== 2 of 6 ==
Date:   Tues,   Nov 2 2004 1:02 am
From: Michael Borgwardt <[EMAIL PROTECTED]> 

Tor Iver Wilhelmsen wrote:

>>Why did you implement this with LinkedList rather
>>than ArrayList?
> 
> 
> Because LinkedList is more efficient when you only manipulate the
> start and end of the list, and are not interested in accessing
> elements by their index.

Not entirely true.

> Basically, with an ArrayList you have an
> underlying array that will grow and have its elements shifted about
> whenever you do a pop().

Um... no? Not if used properly, i.e.

public void put(Object o)
{
     list.add(o);
}

public Object pop()
{
     return list.remove(list.size()-1);
}

The only problem is that some (very few) put operations will take
much longer than the others (when the underlying array grows) and
that the array will never shrink.

But except for that, an ArrayList should usually be faster and more
space efficient than a LinkedList if you're only appending at and
removing from the end, like you do with a stack.



== 3 of 6 ==
Date:   Tues,   Nov 2 2004 1:11 am
From: "Stefan Schulz" <[EMAIL PROTECTED]> 

On Tue, 02 Nov 2004 10:02:57 +0100, Michael Borgwardt  
<[EMAIL PROTECTED]> wrote:

> public void put(Object o)
> {
>      list.add(o);
> }
>
> public Object pop()
> {
>      return list.remove(list.size()-1);
> }
>
> The only problem is that some (very few) put operations will take
> much longer than the others (when the underlying array grows) and
> that the array will never shrink.
>
> But except for that, an ArrayList should usually be faster and more
> space efficient than a LinkedList if you're only appending at and
> removing from the end, like you do with a stack.

Alternatively, if you want to use a LinkedList, you should inverse
item order (push and pop from the beginning). Same semantics, but
it saves iterating through the List with each call.


-- 

Whom the gods wish to destroy they first call promising.



== 4 of 6 ==
Date:   Tues,   Nov 2 2004 1:17 am
From: Michael Borgwardt <[EMAIL PROTECTED]> 

Stefan Schulz wrote:
> Alternatively, if you want to use a LinkedList, you should inverse
> item order (push and pop from the beginning). Same semantics, but
> it saves iterating through the List with each call.

Fortunately, Java's LinkedList keeps a pointer to the list end, so
you *don't* need to iterate through the list, i.e. it makes no
difference.



== 5 of 6 ==
Date:   Tues,   Nov 2 2004 1:26 am
From: "Stefan Schulz" <[EMAIL PROTECTED]> 

On Tue, 02 Nov 2004 10:17:51 +0100, Michael Borgwardt  
<[EMAIL PROTECTED]> wrote:

> Stefan Schulz wrote:
>> Alternatively, if you want to use a LinkedList, you should inverse
>> item order (push and pop from the beginning). Same semantics, but
>> it saves iterating through the List with each call.
>
> Fortunately, Java's LinkedList keeps a pointer to the list end, so
> you *don't* need to iterate through the list, i.e. it makes no
> difference.

Oh, didn't know that. Handy. (But an implementation detail ;) )

-- 

Whom the gods wish to destroy they first call promising.



== 6 of 6 ==
Date:   Tues,   Nov 2 2004 1:35 am
From: Michael Borgwardt <[EMAIL PROTECTED]> 

Stefan Schulz wrote:
>> Fortunately, Java's LinkedList keeps a pointer to the list end, so
>> you *don't* need to iterate through the list, i.e. it makes no
>> difference.
> 
> 
> Oh, didn't know that. Handy. (But an implementation detail ;) )

Actually, it's implied in the API docs too:

"All of the operations perform as could be expected for a doubly-linked
list. Operations that index into the list will traverse the list from the
begining or the end, whichever is closer to the specified index."




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

== 1 of 2 ==
Date:   Tues,   Nov 2 2004 12:21 am
From: [EMAIL PROTECTED] (Toni) 

Well Thank you guys for your help although none of the solutions
worked. I know where the cd drive is I just want to know if there is a
cd inside and if it has data written on it from java.
No problem with the short replies i will do this next time.tony's
answer is just ironic that is why I replied this way.



== 2 of 2 ==
Date:   Tues,   Nov 2 2004 12:38 am
From: Andrew Thompson <[EMAIL PROTECTED]> 

On 2 Nov 2004 00:21:23 -0800, Toni wrote:

> Well Thank you guys for your help although none of the solutions
> worked. 

The solution I arrived was a combination of things, no
single answer provides the magic pill you are after.

To recap.

Present the user with a list of the roots at first start-up
and ask which is the drive they will use as a CD.

Store that information in a file in 'user.home' for subsequent use. 
Then check the specified drive for files, if none are 
found, or there is an exception, the answer is 'no'.

But then, this is not generally a forum on which people are
'spoon fed' information as I just did.  Perhaps another group*
is better till you get the hang of things.  * Described here..
<http://www.physci.org/codes/javafaq.jsp#cljh>

HTH

-- 
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: JWS cache common resources?
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/ef65ca0751c1c10a
==========================================================================

== 1 of 1 ==
Date:   Tues,   Nov 2 2004 12:29 am
From: Andrew Thompson <[EMAIL PROTECTED]> 

Does JWS cache jar's from common URL's, even if they
use different 'main' classes?

According to this entry in the JWS FAQ..
<http://java.sun.com/products/javawebstart/faq.html#43>
"If two JNLP files uses the same URL, then the resource 
will only be downloaded once and shared"

So far so good, but then I tried that with the 
PhySci software suite.  The jar is here..
<http://www.physci.org/PhySci.jar>

This jar is referenced by two .jnlp files, one for the version 
that launches the 'toolbar' with access to most functionality,
<http://www.physci.org/codes/display.jsp?fl=/jnlp/PhySci.jnlp>
the other to a single application opened by that toolbar, the PToE,
<http://www.physci.org/codes/display.jsp?fl=/jnlp/PToE.jnlp>
Note that the 'codebase' (line 5) and jar element (line 22) 
are each identical, resolving to the above linked PhySci.jar.

Yet, despite all this, it seems the jar is downloaded twice,
at least as far as my 'watch the bytes trickle in from the 
internet' meter indicates.

Could I get others to confirm this behaviour?  
The links to the JNLP files are..
<http://www.physci.org/jnlp/PhySci.jnlp> and..
<http://www.physci.org/jnlp/PToE.jnlp>

If you can confirm the jar is downloaded twice, (or know why,)
can you explain where my understanding is wrong?  By the quote
from the JWS FAQ, I understand there should only be a single 
download of the PhySci.jar.

..errr other information.  The PhySci.jar itself is 
around 520Kb.  I'm running Java 1.5 under Win/IE (I 
don't see how either the OS or UA is relevant, but..)

-- 
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: JDB and assertions
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/37a9dac79b5a77ce
==========================================================================

== 1 of 1 ==
Date:   Tues,   Nov 2 2004 12:34 am
From: [EMAIL PROTECTED] (Gerhard Esterhuizen) 

It can't get assertions enabled when running my program under JDB, using 
Sun J2SE JDK 1.5.0 under Windows 2000. The following program reproduces the
issue:

public class tassert {
    public static void main(String[] args) {
        assert false;
    }
}

Running it without the debugger, using the following command-line,
causes the assert to fire:

   java -ea -classpath build tassert

However, running it from the debugger, using the following command-line,
lets the program run to completion without triggering the assert:

  jdb -J-ea -classpath build tassert


Is this a problem or is it expected behaviour ?

How do I get asserts to fire in the debugger ?

What am I missing ?

Regards,

   Gerhard




==========================================================================
TOPIC: XML Pretty Printer
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/9d992999aba0854d
==========================================================================

== 1 of 1 ==
Date:   Tues,   Nov 2 2004 1:20 am
From: jacob <[EMAIL PROTECTED]> 

I need a small simple class for formatting
XML for logging purposes. Something like:

String xml = XmlFormatter.prettyPrint (String xml);

I don't intend to throw an XML parser at this
problem.





==========================================================================
TOPIC: JBuilder / BlueJ question
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/bfea91ed00a06b2c
==========================================================================

== 1 of 1 ==
Date:   Tues,   Nov 2 2004 1:37 am
From: "zcraven" <[EMAIL PROTECTED]> 

Thanks - I did that, but now it seems to only show 'stub' files instead of
all the code.

Also, when I click 'run project' nothing happens.

Zac

"Bill Joy" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> My guess is that you are just opening these files at random without
defining
> a project.
>
> Assuming you only have the free Foundation version, start out doing File |
> New Project.  Go to Project | Project Properties | Paths and on the Source
> tab add the root of your source tree, mark it as Default using the
> radiobutton, then OK.
>
> You should then be able to see your source in the Project pane.  Do
Project
> | Make for a compilation.
>
>
>
> "zcraven" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > When I open my java files (made in BlueJ) in JBuilder, it gives loads of
> > errors:
> >
> > 'cant resolve symbol [myclass] in class [other_myclass]?
> >
> > Basically it doesnt like any of the classes that I defined myself.  How
> > can
> > I stop this from happening?  I know the code is fine cos I can run it
fine
> > from BlueJ or command prompt.
> >
> >
>
>





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

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