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

Today's topics:

* A Record Class Type: Bad Style? - 6 messages, 2 authors
 
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/c123108701741bdf
* struts - opening new sized window - 1 messages, 1 author
 
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/5323c441b16e075b
* JNI: Passing array of objects from C++ to Java - 1 messages, 1 author
 
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/2a12335e0d7f5c30
* Countdown thread resume problem - 1 messages, 1 author
 
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/bf9c85ee37bd60d6
* Unable to have tags within tags?? - 2 messages, 2 authors
 
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/d0b216afc2658f5c
* rotating a bufferedimage - 2 messages, 2 authors
 
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/6e18a900237f6c17
* Why Struts Flow Overview is empty in MyEclipse? - 1 messages, 1 author
 
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/6b97342ebdd1f1db
* Reproducing du/ls in Java - 1 messages, 1 author
 
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/3b6930f360088c78
* Application in sandbox - 3 messages, 2 authors
 
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/821eb31df84b5c4a
* Looking for web host - 1 messages, 1 author
 
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/12978f93dd03b5cd
* Generics and Comparable - 1 messages, 1 author
 
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/443c494fa7514418
* Help, Generate XML with special chinese character (JDOM) failure - 1 
messages, 1 author
 
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/f58f65b3d04f256d
* createImage sometime returns null and sometime returns non-null. - 2 
messages, 2 authors
 
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/0d94053a2c0e7048
* Synchronized block is accessed by other jsps - 1 messages, 1 author
 
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/e19df43edcc6f04f
* Java Driven Left Nav Menu Question - Please Help! - 1 messages, 1 author
 
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/cd719ecb5a5e4fba

==============================================================================
TOPIC: A Record Class Type: Bad Style?
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/c123108701741bdf
==============================================================================

== 1 of 6 ==
Date: Tues, Nov 30 2004 1:22 am
From: "George W. Cherry"  


"Alan Gutierrez" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
>
> /**
> * Counts vowels, consonants, and other characters. This class is
> * immutable. Warning: this class only works with English, and only
> * if you consistantly misspell words like cafe.

: o )  What's that funny mark Frenchmen put above some e's?
(More below). George

> *
> * @author George (Old Ada Programmer)
> * @author Alan Gutierrez
> */
> public class CharacterReport {
>
>    private final int vowels;
>    private final int consonants;
>    private final int others;
>
>    public CharacterReport(String str) {
>        int vowels = 0;
>        int consonants = 0;
>        int others = 0;
>
>        for (int j = 0; j < str.length(); j = j + 1) {
>            char ch = str.charAt(j);
>            if ( Character.isLetter(ch) ) {
>                switch(ch) {
>                    case 'a': case 'e': case 'i': case 'o': case 'u':
>                    case 'A': case 'E': case 'I': case 'O': case 'U':
>                        vowels++;
>                    break; //end cases for vowels
>
>                    default:
>                        consonants++;
>                    //end ch is a letter but not a vowel
>                }
>            }
>            else { //ch is not a letter
>                others++;
>            }
>        }
>
>        this.vowels = vowels;
>        this.consonants = consonants;
>        this.others = others;
>    }
>
>    public int getVowelCount() {
>        return vowels;
>    }
>
>    public int getConsonantCount() {
>        return consonants;
>    }
>
>    public int getOtherCount() {
>        return others;
>    }
> }

>   The above is how I would implement the class. First of,
>    CharacterReport is an proper object. It has a state, and it has
>    logic to create that state, all rolled into one. This replaces
>    the NumberOf / CountTheCharacters duo.
>
>    The resulting object is immutable, thus the final keyword can be
>    applied to the member variables.
>
>    I would not write three methods. Not because of performance, but
>    because logically, I can imagine that if you are counting
>    vowels, you are going to want to count consonants. If this is a
>    report you are generating, generate the report, and expose it's
>    properties.


Yes, that's one nice way to do it, and it puts everything
to do with this little problem into one little class. In fact,
your solution should have some sort of pattern name.

BUT (and I don't want to sound ungrateful) there's something
a little unnatural about it to my procedural (methodic?) sense.
I just want a little method to which I pass an argument and
which returns a result. Passing an argument to a "method"
via a constructor and making the constructor a kind of de facto
method seems--to me--a little bit of a misuse of the idea of
constructors. I think that your solution would surprise a lot of
java users. So, I submit the following as perhaps a more
"natural" solution.
_______________________________________________________
public class CharacterAnalysis {
    public static class CharacterCounts {
        private int vowels;
        private int consonants;
        private int others;
        public int getNumberOfVowels()     { return vowels; }
        public int getNumberOfConsonants() { return consonants; }
        public int getNumberOfOthers()     { return others; }
    }

    public static CharacterCounts getCounts(String str) {
        CharacterCounts count = new CharacterCounts();
        for (int j = 0; j < str.length(); j = j + 1) {
            char ch = str.charAt(j);
            if ( Character.isLetter(ch) ) {
                switch(ch) {
                    case 'a': case 'e': case 'i': case 'o': case 'u':
                    case 'A': case 'E': case 'I': case 'O': case 'U':
                        count.vowels++;
                    break; //end cases for vowels

                    default:
                        count.consonants++;
                    //end ch is a letter but not a vowel
                }//end switch statement
            }
            else { //ch is not a letter
                count.others++;
            }
        }//end for loop
        return count;
    }//end countTheCharacters method

    /* The following method tests getCounts. */
    public static void main(String[] args) {
        StringBuffer buffer = new StringBuffer();
        for (int j = 0; j < args.length; j = j + 1) {
            buffer.append( (j == 0 ? "" : " ") + args[j] );
        }
        String str = buffer.toString();
        CharacterCounts count = getCounts(str);
        System.out.println(str);
        System.out.println( "Number of vowels = "     + 
count.getNumberOfVowels() );
        System.out.println( "Number of consonants = " + 
count.getNumberOfConsonants() );
        System.out.println( "Number of others = "     + 
count.getNumberOfOthers() );
    }//end main()
}//end class
______________________________________________________________________

George 





== 2 of 6 ==
Date: Tues, Nov 30 2004 2:22 am
From: "George W. Cherry"  


"Hal Rosser" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
>
> "George W. Cherry" <[EMAIL PROTECTED]> wrote in
> message news:[EMAIL PROTECTED]
>>
>> "Hal Rosser" <[EMAIL PROTECTED]> wrote in message
>> news:[EMAIL PROTECTED]
>> > You COULD just return an int array - rather than expose your public
>> > variables.
>>
>> That would be execrable: the user would have to
>> use array indexes (0, 1, or 2) instead of suggestive
>> names for the variables. What is this "indecent
>> exposer" fear you have?
>>
>> George
>>
> well then - do it your way - its your app

I didn't intend to appear to diss your suggestion.
Indeed, I think it has merit. My problem with returning
an int array is that the user does not know which values
int[0], int[1], and int[2] refer to. And then I remembered
the following instance method in BigInteger:

public BigInteger[] divideAndRemainder(BigInteger val)

which returns this/val and this%val in the array. The
user can infer the order of the array elements by the
order "divide" followed by "Remainder" in the method
name. In this spirit (or this convention), I have written
the following in accordance with your suggestion.

George

public class CharacterAnalysis2 {
    public static int[] countVowelsConsonantsOthers(String str) {
        int vowels = 0, consonants = 0, others = 0;
        for (int j = 0; j < str.length(); j = j + 1) {
            char ch = str.charAt(j);
            if ( Character.isLetter(ch) ) {
                switch(ch) {
                    case 'a': case 'e': case 'i': case 'o': case 'u':
                    case 'A': case 'E': case 'I': case 'O': case 'U':
                        vowels++;
                    break; //end cases for vowels

                    default:
                        consonants++;
                    //end ch is a letter but not a vowel
                }//end switch statement
            }
            else { //ch is not a letter
                others++;
            }
        }//end for loop
        return new int[]{vowels, consonants, others};
    }//end countVowelsConsonantsOthers method

    /* Use the following method to test countVowelsConsonantsOthers(). */
    public static void main(String[] args) {
        StringBuffer buffer = new StringBuffer();
        for (int j = 0; j < args.length; j = j + 1) {
            buffer.append( (j == 0 ? "" : " ") + args[j] );
        }
        String str = buffer.toString();
        int[] count = countVowelsConsonantsOthers(str);
        System.out.println(str);
        System.out.println( "Number of vowels = "     + count[0] );
        System.out.println( "Number of consonants = " + count[1] );
        System.out.println( "Number of others = "     + count[2] );
    }//end main()
}//end class 





== 3 of 6 ==
Date: Tues, Nov 30 2004 2:34 am
From: "Ann"  

<snip>
> I didn't intend to appear to diss your suggestion.
> Indeed, I think it has merit. My problem with returning
> an int array is that the user does not know which values
> int[0], int[1], and int[2] refer to.

I'm sort of jumping into this discussion in the middle
but it seems to me that if you provide a method and the
user doesn't know what is returned that s/he would have
little incentive to invoke it.





== 4 of 6 ==
Date: Tues, Nov 30 2004 2:36 am
From: "Ann"  

> : o )  What's that funny mark Frenchmen put above some e's?
> (More below). George

It's a sideways umlaut.





== 5 of 6 ==
Date: Tues, Nov 30 2004 2:46 am
From: "George W. Cherry"  


"Ann" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
>> : o )  What's that funny mark Frenchmen put above some e's?
>> (More below). George
>
> It's a sideways umlaut.

Don't be vulgar. 





== 6 of 6 ==
Date: Tues, Nov 30 2004 2:45 am
From: "George W. Cherry"  


"Ann" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> <snip>
>> I didn't intend to appear to diss your suggestion.
>> Indeed, I think it has merit. My problem with returning
>> an int array is that the user does not know which values
>> int[0], int[1], and int[2] refer to.
>
> I'm sort of jumping into this discussion in the middle
> but it seems to me that if you provide a method and the
> user doesn't know what is returned that s/he would have
> little incentive to invoke it.

Indeed. The problem is that the user knows that the
method returns the number of vowels, the number of
consonants, and the number of other characters in
the supplied string, but wouldn't know which element
of the returned array referred to which count.

George 






==============================================================================
TOPIC: struts - opening new sized window
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/5323c441b16e075b
==============================================================================

== 1 of 1 ==
Date: Tues, Nov 30 2004 1:25 am
From: Andrew Thompson  

On 29 Nov 2004 12:33:08 -0800, Raycaster wrote:

> Using Struts, I have a form displayed for a user to edit values. Now
> next to a text area, I have a label which is a link that opens a new
> window that displays a grid of available values for the text box. The
> user clicks on a value and the popup window closes and fills in the
> parent window with the selected value. This all works fine, but I want
> to do is open the popup window with a specific size ( using javascript,
> you specify the width and height ). I am lost at how to do this.

Good.  Don't do it.  

Unless you can also get lots of cash from refactoring it back to 
a single window app. later when the clients realise that half 
their customers who just installed IE SP2, the Google ToolBar, 
another browser with pop-up blockers (read most released within 
last 12 months) etcetera cannot use the application.

-- 
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: JNI: Passing array of objects from C++ to Java
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/2a12335e0d7f5c30
==============================================================================

== 1 of 1 ==
Date: Mon, Nov 29 2004 5:38 pm
From: [EMAIL PROTECTED] (Alex) 

FromC++ to Java using JNI
I need to pass an array of orbitrary number of objetcts
that consists of a string and a float.


All suggestions are really appriciated!
Thnaks




==============================================================================
TOPIC: Countdown thread resume problem
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/bf9c85ee37bd60d6
==============================================================================

== 1 of 1 ==
Date: Tues, Nov 30 2004 1:44 am
From: Andrew Thompson  

On 29 Nov 2004 08:52:55 -0800, [EMAIL PROTECTED] wrote:

>> [1] <http://www.physci.org/codes/sscce.jsp>
> 
> I appreciate your comments, I will try to do so in the future.

As you have apparently read the document, you will probably 
realise that creating an SSCCE alone might solve the problem.

> Can you help me in detecting what needs to be fixed in the code so the
> countdown thread would pause and resume properly?

Sure.  If producing an SSCCE fails to fix the problem your end, 
post it and I'll have a look.

-- 
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: Unable to have tags within tags??
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/d0b216afc2658f5c
==============================================================================

== 1 of 2 ==
Date: Mon, Nov 29 2004 5:46 pm
From: [EMAIL PROTECTED] (Kwasi) 

Chris, Thanks for the response..
Unfortunately, I'm using JSP 1.2 so this is at compile time (The
development tool is giving me problems). I'm not using any exotic
validators with my JSP.
I did have a typo in my snipet, It should read:
<input type="hidden" name="domainName" value="<c:out
value={requestScope.domainNm}>"/>
Is there a way to get around this with JSP 1.2? 
Chris Smith <[EMAIL PROTECTED]> wrote in message news:<[EMAIL PROTECTED]>...
> Kwasi wrote:
> > I am using WSAD 5.1 and am having problems when compiling lines like
> > the following:
> > <input type="hidden" name="domainName" value="<c:out
> > value={requestScope.domainNm}"> where c is defined as the jstl taglib
> 
> What tool is giving you these errors?  Is it the WebSphere application 
> server at runtime, or some development tool such as a page validator?
> 
> If your server implements JSP 2.0, you can simply do away with the 
> obsolete c:out tag, and write this instead:
> 
> <input type="hidden" name="domainName" value="${requestScope.domainNm}">
> 
> 
> I'm assuming that the mismatched quotes and brackets and such in your 
> example was a typo in your newsreader.  Copy and paste can prevent 
> confusion like this in the future.



== 2 of 2 ==
Date: Mon, Nov 29 2004 6:52 pm
From: Chris Smith  

Kwasi <[EMAIL PROTECTED]> wrote:
> Chris, Thanks for the response..
> Unfortunately, I'm using JSP 1.2 so this is at compile time (The
> development tool is giving me problems). I'm not using any exotic
> validators with my JSP.

The question is the same: which development tool is giving you problems?  
"The" development tool isn't very descriptive.  There are literally tens 
of thousands of development tools in the world, and at least hundreds 
that are relevant to what you're doing.

> I did have a typo in my snipet, It should read:
> <input type="hidden" name="domainName" value="<c:out
> value={requestScope.domainNm}>"/>

Well, actually it should read:

  <input type="hidden" name="domainName" value="<c:out
    value="${requestScope.domainNm}"/>"/>

So perhaps that's your problem?

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

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation




==============================================================================
TOPIC: rotating a bufferedimage
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/6e18a900237f6c17
==============================================================================

== 1 of 2 ==
Date: Mon, Nov 29 2004 5:51 pm
From: [EMAIL PROTECTED] (e4_java) 

"John McGrath" <[EMAIL PROTECTED]> wrote in message news:<[EMAIL PROTECTED]>...
> On 11/28/2004 at 7:28:39 PM, e4_java wrote:
> 
> > public class object
> 
> <shudder>
> 
> > the image shows up, but rotate doesn't work
> 
> First, I should point out that you do not call your rotate() method
> anywhere in the code that you posted.

there is other code that does call it

> 
> >     public void rotate(double angleIncrease)
> >     {
> >             angle += angleIncrease;
> > 
> >             Graphics2D g2 = bi.createGraphics();
> >             g2.rotate( Math.toRadians( angleIncrease ) ); 
> >              // this should rotate the image stored in bi
> >     
> >             // ensure angle is between 0 and 360
> >             if(angle > 360) angle-=360;
> >             if(angle < 0) angle+=360;
> >     }
> 
> Calling Graphics.rotate() will not have any effect on the image that the
> Graphics context was created from (assuming that it actually *was* created
> from an image).  What it affects is how subsequent paint operations
> performed using the Graphics context will be interpreted.
> 
> Also note that BufferedImage.createGraphics() creates a new Graphics
> context, so doing a rotate() on one Graphics context will have no effect
> on painting done with a different Graphics object, even if they were
> created from the same BufferedImage.

ok, then how do i get a Graphics2D that will effect the bufferedimage
it was created from or something else i can use to rotate the contents
of the image?



== 2 of 2 ==
Date: Mon, Nov 29 2004 7:07 pm
From: Chris Smith  

e4_java <[EMAIL PROTECTED]> wrote:
> ok, then how do i get a Graphics2D that will effect the bufferedimage
> it was created from or something else i can use to rotate the contents
> of the image?

createGraphics does give you a Graphics object that affects the 
BufferedImage.  The problem is that you didn't actually DO anything.  
Calling rotate() only changes the transformation applied to future 
drawing operations.

What you can do instead is something like this:

    BufferedImage img = getOriginalImage();
    BufferedImage temp = new BufferedImage(
        img.getWidth(), img.getHeight(), img.getType());

    Graphics g2 = (Graphics2D) temp.createGraphics();
    try
    {
        g2.rotate(...);
        g2.drawImage(img);
    }
    finally
    {
        g2.dispose();
    }

Now temp contains a rotated copy of img.  If desired, you are free to 
copy the new BufferedImage contents back over to img, but it may also 
work (and will be cheaper) to simply start using the new object instead.

Note that rotate should be given both an angle and a point around which 
to rotate; otherwise, you rotate about the origin (the upper left 
corner), which is unlikely to be what you want.

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

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation




==============================================================================
TOPIC: Why Struts Flow Overview is empty in MyEclipse?
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/6b97342ebdd1f1db
==============================================================================

== 1 of 1 ==
Date: Mon, Nov 29 2004 5:57 pm
From: [EMAIL PROTECTED] (Riyad) 

Jack,
I'd encourage you to post your question to the MyEclipse support
forums here:
http://www.myeclipseide.com/modules.php?op=modload&name=PNphpBB2&file=index

Also you might want to check out the new documentation covering major
functionalities just incase the answer is there and easily accessible:
http://www.myeclipseide.com/ContentExpress-display-ceid-67.html

Also try right-clicking on your struts-config.xml file and make sure
you are opening it with the "MyEclipse Struts Editor" and not the XML
editor or other editor. Then you should see two tabs at the bottom of
the editor "Source" and "Design".

Best,
Riyad

[EMAIL PROTECTED] (jacksu) wrote in message news:<[EMAIL PROTECTED]>...
> I enabled the struts in myeclipse, created struts module, struts forms
> and action, but I couldn't enable the "Struts Flow Overview" as
> described in 
> "http://www.myeclipseide.com/ContentExpress-display-ceid-55.html";.
> 
> The menu "View" either all disabled or not showing at all.
> 
> Any suggestion on that?
> 
> Thanks.




==============================================================================
TOPIC: Reproducing du/ls in Java
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/3b6930f360088c78
==============================================================================

== 1 of 1 ==
Date: Mon, Nov 29 2004 6:35 pm
From: [EMAIL PROTECTED] (Oreo) 

"Ann" <[EMAIL PROTECTED]> wrote in message news:<[EMAIL PROTECTED]>...
> "Oreo" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > Hi there,
> >
> > I am writing an application that needs to compute the exact size of a
> > file. I need for this function to work in Windows and UNIX.
> >
> > One of my issues is that the length() method provided by the File
> > class does not return the exact size for all files.
> >
> > The essence of my problem is that I cannot properly compute the size
> > of a directory or symbolic links in UNIX properly.
> >
> > File.class() returns 0 for the size of directories regardless of OS.
> > This appears to be correct on Windows (right-click -> properties on an
> > empty directory in Windows). However this seems to be incorrect
> > according to Linux.
> >
> > When compared to the output of ls, the File.length() method will not
> > return the proper length of directories (whether on a FAT or reiserfs
> > file system) or a symbolic link in UNIX. The length of a UNIX
> > directory is not zero, and the size of symbolic link is the length of
> > the filename that it points to.
> >
> > When the windows partition is mounted in Linux, the size of the
> > directories on the windows partition are reported as being 4096 by
> > file system utilities ls and du. This contrasts the value of zero
> > reported by the Microsoft 98 Windows Explorer.
> >
> > Detailed examples of my problem can be found at the following thread:
> > http://forum.java.sun.com/thread.jspa?threadID=574755
> >
> > How can I compute a function that will be able to compute the size of
> > any file under any operating system?
> >
> > I would like to avoid his path:
> >     1. Determine if the class is being run in Windows or UNIX
> >     2. If running in UNIX,
> >            a. If a directory of symbolic link: execute : du -sb [file]
> > | awk '{print $1}'
> >               or ls -al [file ] | awk ' { print  $5 }'
> >            b. Otherwise: File.length()
> >     3. If running Windows, simply class File.length() (?)
> >
> >
> > By taking this route I need to perform an if() statement every time
> > the size of any file is being computed, and also execute an expensive
> > command for some special cases (when the file is a directory of link).
> > The expensive commands will be common, and I would like to avoid
> > having to do that.
> >
> > - Oreo
> 
> What about the "master file table" ?
> 
> And, since there is extra overhead in a directory, do you want
> to assign a fraction of that overhead to your filesize too?

How can I access the master file table? A search did not produce any
results, other than some recovery software.




==============================================================================
TOPIC: Application in sandbox
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/821eb31df84b5c4a
==============================================================================

== 1 of 3 ==
Date: Tues, Nov 30 2004 2:36 am
From: "dar7yl"  

"Tim Tyler" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]
>Steve Sobol <[EMAIL PROTECTED]> wrote or quoted:
>> Tim Tyler wrote:
>> > Jean Lutrin  wrote or quoted:
>> >>As I already said, I belong to this very small (and not very
>> >>vocal) minority that happens to think that Un*x + Java is a
>> >>wonderfull setup for a developer (most Java developer use Windows
>> >>and most Un*x users have a grip with Java not being true
>> >>Open Source Software).
>> > IMO, they have a good point.
>> > The fact that Java is proprietary, commercial software is its
>> > biggest weakness - in my book.
>>
>> You're right. We should all use .NET because it's open source.
>
> I made no mention of .NET.
>
> The competitors of Java under slightly more liberal licenses are
> things like Python and PHP.
>
>> Come on... yes, technically Java *is* a commercial product, however...
>> Proprietary? How can you say it's proprietary when the source code is 
>> sitting
>> on the Web downloadable by anyone?
>
> Simple: because Java is owned by Sun.
>

My problem with Sun "owning" Java is that they do not have the sense of 
responsibility for it that us lowly developers would like to see.

I'm speaking of their lack of enthusiasm for fixing long-standing bugs. 
Some have been open for over 3 years.  (see 
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4521075 )

Other bugs, less important to me and most, but important to some, are exiled 
to obscurity, sometimes to be taken up by a concerted group of open-sourced 
volunteers who fix the problems and release new libraries.  (see 
https://winlaf.dev.java.net/release_0.5.html )  We are appreciative of this 
effort, but wish that we didn't have to clutter up our installations with 
all those superfluous archives.

We all applauded when Java 5 (was that 1.5? 2.0? or what?) came out, but it 
was far too late for us to use on our project.  New projects probably won't 
get started in Java 5 in the near future, because critical inertia has been 
lost.  A year ago, we were chomping on the bit to use the new language 
features.  Now, why bother?

regards,
    Dar7yl






== 2 of 3 ==
Date: Tues, Nov 30 2004 4:30 am
From: "Ivan Gotcha"  

the Trolls are back 





== 3 of 3 ==
Date: Mon, Nov 29 2004 9:34 pm
From: "dar7yl"  

"Ivan Gotcha" wrote  ...
> the Trolls are back

The Gnomes are bitching again.






==============================================================================
TOPIC: Looking for web host
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/12978f93dd03b5cd
==============================================================================

== 1 of 1 ==
Date: Tues, Nov 30 2004 1:14 pm
From: LG  

Ike wrote:
> Anyone know of a decent web hosting company offering Tomcat/Java they could
> recommend? Thanks, Ike
> 
> 
I have been using RimuHosting (www.rimuhosting.com) for a while now and 
they have been excellent.

HTH,

Leo Gaggl
Adelaide, South Australia




==============================================================================
TOPIC: Generics and Comparable
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/443c494fa7514418
==============================================================================

== 1 of 1 ==
Date: Mon, Nov 29 2004 7:31 pm
From: "Bergholt"  

xarax wrote:
> "Bergholt" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > If the Objects are both of type Comparable, they
> > will be compared using compareTo, otherwise it's as defined:
> >
> > int compare(MySet set1, MySet set2)
> > {
> > Object obj1 = this.getValue(set1);
> > Object obj2 = this.getValue(set2);
> >
> > if (obj1 instanceof Comparable && obj2 instanceof Comparable)
> > {
> > Comparable cmp1 = (Comparable)obj1;
> > return cmp1.compareTo(obj2);
>
> Why did you not cast obj2 to a Comparable and
> pass that to compareTo()? You've already tested
> it with instanceof.

The old compareTo takes an Object parameter, so it makes no difference
either way.  The new compareTo takes a parameter of type T, but of
course I can't check instanceof Comparable<Comparable> because the type
doesn't exist at run-time, so there's no way to get the compiler to
realise that the code is completely type safe.

> Also, why is getValue(MySet) returning an Object
> and not something narrower?

Because it can return null, or Double or Integer, or any user-defined
type.  This is used for sorting the rows of a table on an arbitrary
column, and the only superclass I can guarantee each value in each
column will have is Object.

Bergholt.





==============================================================================
TOPIC: Help, Generate XML with special chinese character (JDOM) failure
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/f58f65b3d04f256d
==============================================================================

== 1 of 1 ==
Date: Mon, Nov 29 2004 7:46 pm
From: [EMAIL PROTECTED] (KFC) 

Dear all,

Do you have experience on handling special chinese (Hong Kong)
character with JDOM?
I use JDOM to build the XML file with these chinese character, and
then try to check the well-formedness with JDOM. .. Strange!! it is
invalid.

XML file produced by JDOM 1.0 fails the checking by JDOM.

xml file contains this "&#37670;&#xfffd"

According to http://www.w3.org/TR/REC-xml/#charsets, XML char disallow
undefined UNICODE character.

Do you guys have any idea how to solve the problem?

Thank you very much!

Regards,
KFC




==============================================================================
TOPIC: createImage sometime returns null and sometime returns non-null.
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/0d94053a2c0e7048
==============================================================================

== 1 of 2 ==
Date: Mon, Nov 29 2004 8:05 pm
From: [EMAIL PROTECTED] (vizlab) 

Hi:
    I am debugging an Java standalone application and some servlets in
eclipse3.0.
    I am using tomcat5.5 and jre1.5.0.
    There is a file, called FlowChart.java, which will be used in the
Java standalone application and also used (called) by a servlet.
  

   public class FlowChart extends JComponent implements
Serializable,MouseMotionListener,Printable {
    ...
    Image backDrop=createImage(800,600);
    ...
  }

    When I debug the Java standalone application in eclipse, the
createImage() returns a non-null pointer. But when I debug the
servlets in eclipse, createImage() returns a null pointer.
    
    Why???

    One reason I guess is that eclipse uses its own libraries and
compiler to debug the standalone application, while the servlets are
debugged by using external jre1.5.0. There is some difference between
the jre1.5.0 and the eclipse's coming-with libraries. Is it true?

    I have stucked on this problem for a long time.

    Highly appreciate anyone giving me a way out!
    
Best



== 2 of 2 ==
Date: Tues, Nov 30 2004 4:32 am
From: Andrew Thompson  

On 29 Nov 2004 20:05:24 -0800, vizlab wrote:

>     I am debugging an Java standalone application and some servlets in
> eclipse3.0.

There seems to be some guy on c.l.j.gui. that has the 
*exact* same problem.  He's already got an answer.
<http://groups.google.com/[EMAIL PROTECTED]>
Why don't you tune into that thread instead?

And please refrain from multi-posting in future.
<http://www.physci.org/codes/javafaq.jsp#xpost>

-- 
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: Synchronized block is accessed by other jsps
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/e19df43edcc6f04f
==============================================================================

== 1 of 1 ==
Date: Mon, Nov 29 2004 8:59 pm
From: [EMAIL PROTECTED] (biswa) 

I have the synchronized block in my class file
public class MyClass {

 public synchronized boolean myFunc() {

  //--> Table created
  //--> Table accessed
  //--> Table dropped
 }
}

I am calling this method in the JSP file
This is my code in jsp file. 
<%
MyClass myClass = new MyClass();
//.. some codes here

if(myClass.myFunc())
 //do something
else
 //do something

//-- some codes here.
%>

myClass.myFunc() is accessed by more than one request at same time
although the method is synchronized in the java file. I do not
understand why.

But to test I kept the method in a synchronzied block within Jsp file
and i do not see two requests accessing myFunc() any more.
new code looks like this
<%
MyClass myClass = new MyClass();
//.. some codes here

synchronized(this) {
 if(myClass.myFunc())
  //do something
 else
  //do something
}
//-- some codes here.
%>

Is the 2nd method correct way of synchronizing a method to access in
JSP file?? if so i have to change all my JSP files :((

thanks 
biswa.




==============================================================================
TOPIC: Java Driven Left Nav Menu Question - Please Help!
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/cd719ecb5a5e4fba
==============================================================================

== 1 of 1 ==
Date: Mon, Nov 29 2004 9:45 pm
From:  

Hello Java experts,

This question concerns the attempted implementation of animated navigation 
menus on the left nav of a dynamically populated page/website. The left nav 
menus are simply categories and sub-categories that expand to the right on 
mouse over. A click is required to actually navigate to either the 1st, 2nd, 
or 3rd tier of menu categories.

I have a fundamental question to ask of you learned Java programmers. If 
Java is being used to load animated navigation menus on the left nav column 
how much control over the load delay is there?

In other words, is it normal to have the index page remain completely blank 
for a count of 10-12 seconds while all of the graphics and all of the Java 
menus load in the background and then suddenly pop into view, or is it 
possible to have the page load quickly and conventionally (like a page with 
no Java script) and then allow the Java to load in the background? Basically 
holding back the loading of the Java to allow the balance of the page to 
load prior to the Java script?

Secondarily to this question:
Once the home/index page has loaded and the Java menus are active on the 
left nav, is there a way to avoid having he screen go blank again when you 
click on a link and navigate to another page on the same website. My site 
goes blank for another count of 10-12 seconds (over cable!) while it waits 
to load all the graphics and again loads the same java menu before 
refreshing the screen! Seems like once the Java has loaded it should be held 
in a cache somehow to avoid having to re-load it every time you move to 
another page within the same website???

Is this just the way it is with Java driven nav menus, or is the code 
installed wrong, or does the code just stink and needs to be replaced?

Please advise,
Thank you.... ojitoys1 





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

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

To post to this group, send email to [EMAIL PROTECTED] or
visit http://groups-beta.google.com/group/comp.lang.java.programmer

To unsubscribe from this group, send email to
[EMAIL PROTECTED]

To change the way you get mail from this group, visit:
http://groups-beta.google.com/group/comp.lang.java.programmer/subscribe

To report abuse, send email explaining the problem to [EMAIL PROTECTED]

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

Reply via email to