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

Today's topics:

* Compiler trick - 4 messages, 4 authors
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/a2992422eec9fe49
* store whole InputStream in a String - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/d510835287103e9
* Successor to Java? - 3 messages, 3 authors
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/9151fedffecef56b
* Hibernate, Tomcat, Ant Question - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/dfb68d876939af03
* button.click() not working ,ie HTTPUNIT - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/3da640d4c95ceb04
* What is Embedded Java? - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/bacf063e98ecf899
* Thread synchronization - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/172837b7b0667fd1
* WYSIWYG content management system; how to put together and make it work - 2 
messages, 2 authors
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/20484e6dbad0db77
* java splash window - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/a18982f4ea35d6ef
* gmail anyone? - 2 messages, 2 authors
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/edb0463a590e0ea1
* EJB: ONE query for multiple rows - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/38eb46fdf71c702c
* tools.jar workaround on Mac OS X? - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/fe6e515f0f644db3
* Java Student Needs Help - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/48d209fbe843b0be
* byte representation of a class - 2 messages, 2 authors
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/754ced8b07b9a2d3
* How to use JTree with very large data? - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/145516a872afaa18
* java equivalent of perl module Locale::SubCountry? - 2 messages, 2 authors
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/b803837211c1c4ca
* RMI client behind a firewall, server behind a firewall too - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/898ce13af69b8972
* Easy-to-understand Servlet container? - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/5a6c2be39085acf6
* Who is the best WebSphere Studio or Oracle JDeveloper?? - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/747e9a4c137251d2
* VisualAge IDE scroll problem - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/7d862f878fe2f6af
* Print problem - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/899328c468644690
* Can I get TCPMon free without a bunch of other included software? - 1 messages, 1 
author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/b8b8e67ddb9bcd5e
  
==========================================================================
TOPIC: Compiler trick
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/a2992422eec9fe49
==========================================================================

== 1 of 4 ==
Date:   Mon,   Sep 13 2004 11:21 am
From: "Chris Uppal" <[EMAIL PROTECTED]> 

Razvan wrote:

>           Yes, indeed that was my point. My innitial prediction was
> that the second code would also compile and print the same result, but
> it did not. The Java compiler should be more consistent: it should
> detect both cases ('if else' and 'if if') or it should complain on
> both. I saw this code on a Java test; for such questions your only
> solution is to remember how the compiler behaves. I don't like things
> that you just have to remember.

I agree.  Whenever any design has arbitrary elements then you "just have to
remember them", and that is /not/ good.

But in this case, the Java designers had to make a somewhat arbitrary
decision -- they had to decide what the Java compiler would and would not be
/guaranteed/ to figure out.  They also took the sensible (IMO) decision that
anything that it wasn't /required/ to be able to work out it /must/ reject.
Since they had to make an arbitrary decision, they choose to keep the rules
simple.   The rules are still arbitrary, but I think that you'll agree that if
you "just had to remember" anything, then it's better if that thing is simple
than if it is complicated.

So the rules for Java are simple, but that means that the compiler can't -- 
isn't allowed to be -- as clever as you sometimes would want.  The advantage is
that, once you have learned the rules, you /know/ what the compiler will do in
every case -- you don't have to experiment to find out (or even worse, "just
remember")what this /particular/ compiler will do in this /particular/ case.

In this example, the "odd" result is because the Java compiler sees the
code as two unconnected conditionals, both of which are of the form
    if (...)
        ...code...
(i.e. with no "else").  The Rules state that a variable is only initialised if
it is assigned on /both/ forks of a condition (in both the "if" and the
"else"), otherwise the compiler is forced to reject the code.  Since the
compiler isn't allowed to see your two conditionals as a rather strange way of
writing a single if-then-else (it isn't allowed to "realise" that the two
conditions are opposites) it has to report an error.

I urge you to read the Java language specification.  Not because I think it's
something that you /ought/ to do (though it is if you want to be a top class
Java programmer, IMO), but because I think it is something you would probably
find interesting and valuable.  Judging by your posts here, you are interested
in what's "really" going on and want to know more than just the superficial
details.  If that's the case, then sooner or later you are going to have to
start reading /real/ specifications, like the JLS, because otherwise your
curiosity will /never/ be satisfied.  (BTW, don't expect to be able to take it
all in at one read -- I doubt if anyone could do that -- but you can get to
know what's in it, and read (and re-read) bits of it as and when they are
relevant to you.)

    -- chris





== 2 of 4 ==
Date:   Mon,   Sep 13 2004 12:07 pm
From: "dar7yl" <[EMAIL PROTECTED]> 


"Chris Uppal" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> Otherwise it becomes hard to understand why the compiler doesn't deduce 
> the
> legallity of constructions like:
>
>    Objet o = ...;
>    if (o instanceof Dog) { o.bark(); }
>

The corrected code is:

<code>
    Object o = ...;
    if (o instanceof Dog)
    {
        ( (Dog) o ).bark();
    }
</code>

The rational is that the base Object o does not contain the method 'bark', 
so you have to cast it into the required class 'Dog'.

Also, note that the cast of 'o' into 'Dog' is valid at this point, because 
it is protected by the 'instanceof'  condition enclosing it's use.  If you 
didn't have the if statement, and tried to cast any object, chances it would 
fail with a conversion error exception, assuming a random object 'o'.

regards,
    Dar7yl        ([EMAIL PROTECTED])







== 3 of 4 ==
Date:   Mon,   Sep 13 2004 12:09 pm
From: "P.Hill" <[EMAIL PROTECTED]> 

dar7yl wrote:

>     Object o = ...;
>     if (o instanceof Dog)
>     {
>         ( (Dog) o ).bark();
>     }

Casting is another place where the compiler
is not going to help you, even if what is going
on to you is obvious.

-Paul




== 4 of 4 ==
Date:   Mon,   Sep 13 2004 12:17 pm
From: Jim Janney <[EMAIL PROTECTED]> 

Joona I Palaste <[EMAIL PROTECTED]> writes:

> Razvan <[EMAIL PROTECTED]> scribbled the following:
> >> Andrew Thompson wrote:
> >> > /** Your second CDummy class did not compile. */
> >> 
> >> I think Razvan's point is that it doesn't compile.
> 
> >           Yes, indeed that was my point. My innitial prediction was
> > that the second code would also compile and print the same result, but
> > it did not. The Java compiler should be more consistent: it should
> > detect both cases ('if else' and 'if if') or it should complain on
> > both. I saw this code on a Java test; for such questions your only
> > solution is to remember how the compiler behaves. I don't like things
> > that you just have to remember.
> 
> I disagree. The rules for "if else" are far easier, more deterministic,
> and allow for less loopholes than your artificially constructed "if if"
> scenario. When you have an "if else" construct, it is a fact that
> *always* *exactly one* of the "if" and "else" branches shall be
> followed.
> However, in your "if if" case, you have to separate "if" statements,
> which happen to coincide by having exactly opposite criteria. A human
> will be able to look at both at the same time, understand that the
> value of an int variable is *always* *either* more than 10 *or* less
> than or equal to 10 (paraphrasing your original code), but
> automatically deducing this from a set of program statements requires
> quite an advanced algorithm, when done by an automaton that can only
> ever do what it is told to do, with no intuition or bright ideas of
> its own. Here's a rough outline of what it would have to do:
> - Note the first "if" statement and store both operands of its
> criterion to memory for late comparison,
> - Note the execution branch of the "if" statement as a currently open
> execution path,
> - Note that there is no code between the two "if" statements that might
> diverge program flow away from the second "if" statement,
> - Note the second "if" statement and store both operands of its
> criterion to memory,
> - Note the execution branch of the "if" statement as a currently open
> execution path,
> - Compare the operands of both "if" statements, seeing that the first
> operand is the same variable, the second operand is the same constant,
> and the operators are directly opposite,
> - Deduce that the criteria of the two "if" statements are directly
> opposite,
> - Use this information to close both open execution paths,
> And only then proceed as it would have done *straight away* in the
> "if else" case.
> What if the variable in the second "if" statement was not i, but j, and
> j was assigned a value from i? What if that assignment was done not in
> the normal execution path, but an "if" statement whose criterion just
> happened to be always true? What if there was a reassignment to j later,
> but in a "for" loop that iterates exactly 0 times? What if j was first
> decremented by two, then incremented by one, then again incremented by
> one?
> Go on, *you* try to write a formal, deterministic algorithm to take
> care of all this. I suppose there are highly-paid research groups in a
> couple of universities working on it. If you produce successful reports,
> you could write an article about it in a computing magazine.
> The issue gets even more interesting when the criteria for the "if"
> statements come from methods in different objects. Sooner or later the
> Java compiler will essentially have to run the program in order to find
> out if it can compile it.
> But for the "if else" case, there is only one simple rule: In every
> "if else", no matter where it appears or what its criterion or
> background state are, *exactly one* of its branches will *always*
> execute. Not both, not neither, *exactly one*. All the compiler has to
> do is to spot an "if" with an "else" and instantly arrive at this
> conclusion.

In the general case, deciding whether or not a variable will have been
initialized at a certain point in a program's execution is equivalent
to solving the halting problem: in other words, it's known to be
computationally undecidable.  For more information, google on Rice's
theorem.  However, there are useful special cases for which the
question *is* decidable, and Java takes advantage of some of those.
As has been said elsewhere in this thread, we want to able to write
code that will compile on every implementation of Java, so compilers
are not allowed to go beyond the rules specified in the language
definition.

I'm not sure that having the compiler check for this is useful in
practice, but once that decision has been made this is a practical way
to implement it.

-- 
Jim Janney




==========================================================================
TOPIC: store whole InputStream in a String
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/d510835287103e9
==========================================================================

== 1 of 1 ==
Date:   Mon,   Sep 13 2004 11:24 am
From: Chris Smith <[EMAIL PROTECTED]> 

Paul Lutus wrote:
> Yes, I agree. My point was that one could create new entry points through a
> liberal scattering of labels, as in my example.

I don't see what you're saying at all.  You certainly cannot create new 
entry points to a block of code.  A block of code can only be entered at 
the beginning, and its statements will be run sequentially until it 
finishes (whether due to break, continue, return, throw, or simply 
reaching the end of the statements in the block).

So out of curiosity, how do you feel about multiple returns in a method?  
How about exceptions?  These two are probably are responsible for far 
more multiple exit points from a block of code than break or continue.

> Yes, it cannot be written in Java, because one cannot have forward
> references to a label in Java.

That isn't the issue.  It's equally not possible to do:

    someLabel:
    {
        ...
    }

    break someLabel;

even though that's not a forward reference.  The point is not the 
lexical structure, but that break and continue are statements for 
exiting a block, and they can only be used from within the block they 
are exiting.  Yes, your explanation makes them sound more like goto, to 
your advantage, but it's also not accurate, and doesn't explain the 
behavior and set of legal situations where these statements can be used.

> My sole point was that this ability to scatter labels about, if exercised by
> a student or someone in a hurry, would quickly devolve into a jumble of
> difficult-to-interpret code.

Here's where we will differ.  The random strewing about of any control 
structure will result in difficult to interpret code.  If you can 
demonstrate that people using break/continue to solve real problems are 
likely to write difficult code, that would be a different matter.  
However, labeling an if statement doesn't qualify as a realistic thing 
for anyone to do, unless someone is trying to write nonsense code.

If you want to see nonsense code that's hard to follow but uses only 
single exit points from a block of code, here you go:

    int a = 1, b;
    for (b = 40; a < 17; b += a)
    {
        while (b % a != 3)
        {
            if (b & 0xA == 2) b--;
            else a++;
        }
    }

To teach people to write readable code, you teach them to think about 
what their code is doing, and choose ways of expressing it that make 
sense.  Absolute technical rules, like "one entry, one exit", only make 
code more readable when they match the logic that the programmer is 
writing.  If the problem domain expresses something with multiple exits, 
then I'd encourage a programmer to use a control structure with multiple 
exits -- even if that means starting with "while (true)".

> > Writing code without break or continue often results in more levels of
> > nesting, more -- and more visible -- loop and conditional structures,
> > and the introduction of more local variables to hold temporary flags
> > that are only there to get the control flow right.  These are not
> > benefits to be aimed for; they increase the complexity of code.
> 
> I think structured programming purists would argue that it may take longer
> to design an algorithm without break/continue, but the resulting code will
> be more comprehensible, not less.

You're ignoring what I said.  I didn't say that the algorithm without 
break/continue would take longer to "design" (to the extent that a 
choice between control structures within a method can be called design), 
but that the resulting code will be more complex.  Introducing temporary 
local variables and extra levels of nesting just to avoid a break 
statement is not taking the hard road to doing it right; it's spending 
more effort to come up with an inferior result.

I'm mostly ignoring the rhetoric about use of break/continue not really 
being structured programming.  However, for the sake of those who may 
assume Paul's terminology is authoritative, I'll point out that it's 
not.  When discussing structured programming with others, it would be 
helpful to point out if you mean something unusual, like excluding the 
use of break and continue statements, instead of the usual structured 
programming practices of top-down design, etc.

> One often sees college coursework in
> which the use of break/continue is simply forbidden,

I've never seen this.  Have you seen this?

> > Why would Sun 
> > go out of their way to design and implement a new extension to a
> > language feature, when they've only included it as a concession to non-
> > structured programmers?
> 
> Why indeed? [...]

That's not an answer.  Clearly, if Sun's engineers thought break and 
continue are useless statements that are to be discouraged, they could 
have at least not elaborated on them with new innovative features.  
Sorry, but you can't claim the language designers at Sun as part of a 
movement to abolish these control structures.

> Also there is the issue of how they are used. They can easily be misused, as
> in my example, so one could argue instead that the circumstances of their
> use, not their presence in the language, is the real issue.

I would argue that misuse is the issue, except that I don't see frequent 
examples of their misuse.  Being able to write confusing nonsense code 
is not proof that the constructs in your code are misused, either easily 
or frequently.  You've given something like a random combination of 
English words that obeys all the rules of grammar.  Writing real code -- 
or English -- requires both intelligence, and having something to say.  
THEN the question of whether the code says it well can be debated.

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

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation




==========================================================================
TOPIC: Successor to Java?
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/9151fedffecef56b
==========================================================================

== 1 of 3 ==
Date:   Mon,   Sep 13 2004 11:27 am
From: "George W. Cherry" <[EMAIL PROTECTED]> 

Is the successor to Java on anyone's horizon?
Prentice-Hall published four of my books which
featured languages (now defunct) which I loved
and embraced--Pascal and Ada. While three
of those books sold very well in the early '80's,
they are now out of print and recently the MIT
engineering library "warehoused" two of them,
because they had not been checked out for a
decade.

I'm writing a new book, currently using Java.

http://sdm.book.home.comcast.net

By the time I finish it (2009?), will Java be an
anachronism like Pascal and Ada?

George





== 2 of 3 ==
Date:   Mon,   Sep 13 2004 11:52 am
From: "William Brogden" <[EMAIL PROTECTED]> 

On Mon, 13 Sep 2004 18:27:42 GMT, George W. Cherry  
<[EMAIL PROTECTED]> wrote:

> Is the successor to Java on anyone's horizon?
> Prentice-Hall published four of my books which
> featured languages (now defunct) which I loved
> and embraced--Pascal and Ada. While three
> of those books sold very well in the early '80's,
> they are now out of print and recently the MIT
> engineering library "warehoused" two of them,
> because they had not been checked out for a
> decade.
>
> I'm writing a new book, currently using Java.
>
> http://sdm.book.home.comcast.net
>
> By the time I finish it (2009?), will Java be an
> anachronism like Pascal and Ada?
>
> George
>

Given the volume of existing Java code at work in
the world, it is more likely to become a living
fossil like COBOL. No longer cool, but essential to
many enterprises.



== 3 of 3 ==
Date:   Mon,   Sep 13 2004 12:24 pm
From: Daniel Bonniot <[EMAIL PROTECTED]> 


> Is the successor to Java on anyone's horizon?

One interesting point about Java is that it brought features from the world of 
academic research into mainstream. Initially that was mainly garbage 
collection, and now with Java 5 genericity. Of course this process is very 
slow (something like 8 years between the first proposals for genericity in 
Java and their introduction in the language). One also needs to take into 
account that mainstream languages tend to be built incrementally from the 
previous champion (C++ after C, Java after C++). Given these two factors, 
Pizza (http://pizzacompiler.sourceforge.net/) or Nice (http://nice.sf.net) 
might give you an idea what the next Java could look like.

The advent of common runtime (the JRE and the CLR) is favorable to 
collaboration between different languages, so it well be that no single 
language will become dominant, but the market will be more evenly divided 
between several interoperable languages with different strengthes and target 
audiences (static or dynamic typing, different paradigms, ...).

Daniel




==========================================================================
TOPIC: Hibernate, Tomcat, Ant Question
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/dfb68d876939af03
==========================================================================

== 1 of 1 ==
Date:   Mon,   Sep 13 2004 11:27 am
From: Bryce <[EMAIL PROTECTED]> 

On Mon, 13 Sep 2004 11:25:34 -0400, "IchBin" <[EMAIL PROTECTED]>
wrote:

> Hi All,
>
>I just downloaded hibernate-3.0alpha. I ran the build. After entering 
>issuing ant, for the build, I recieved the following message:
>
>C:\Program Files\hibernate-3.0alpha>ant
>Buildfile: build.xml
>BUILD FAILED
>C:\Program Files\hibernate-3.0alpha\build.xml:110: taskdef A class needed by 
>class org.apache.tools.ant.taskdefs.optional.junit.JUnitTask cannot be 
>found: junit/framework/Test
>Total time: 5 seconds
>
>I do not know where this ant package is? Does anybody know whick jar I can 
>find it in?
>
>I have apache-ant-1.6.2, Tomcat 5.5 running and trying to install the 
>hibernate-3.0alpha version.
>
>I have looked at some of the ant jars but can't seem to find it.

The package is JUnit. Google for it, and download. Put the JUnit class
in Ant's lib directory.

--
now with more cowbell




==========================================================================
TOPIC: button.click() not working ,ie HTTPUNIT
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/3da640d4c95ceb04
==========================================================================

== 1 of 1 ==
Date:   Mon,   Sep 13 2004 11:38 am
From: [EMAIL PROTECTED] (bhimi) 

Hi,
I am bhimi... I am facing problems with "httpunit", I would like to
know how to click the "continue" button in Compose Text Message page
of www.mail.yahoo.com. with my destination mobile phone number and
text message as setting parameters....(I could set these parameters
but could not click the "Continue" button).

My user id is "batman2004_2004"
pass- word is "testing"

1. I am logging into mail.yahoo.com with a java testcase using this
Httpunit .
2.Next i am entering into the "compose text message page",by clicking
"compose text msg" button which lies next to INBOX, COMPOSE buttons
with my java program...
3.Next i could enter mobile phone number and text message,but the
problem is IT IS NOT CLICKING THE "CONTINUE" BUTTON through my java
program...

please let me know ...

Thanks in advance,

Regards,
Bhimi...
My code snippet is as follows....
   
    
   WebResponse wr = wc.getResponse( "http://mail.yahoo.com";);
  
   
   //get the login form
  
   WebForm form = wr.getFormWithName("login_form");
     
  form.setParameter(".done", "http://mail.yahoo.com";);
   form.setParameter("login", "batman2004_2004");
   form.setParameter("passwd", "testing");
   form.submit();
   WebResponse wr1 = wc.getResponse( "http://mail.yahoo.com";);
   
        
  
   WebResponse wr2 = wc.getResponse(ymCompose);
   // this is compose SMS page...
     
  
   WebForm form2 = wr2.getFormWithName("Compose");
      
   form2.setParameter("To","00497953453520");
   form2.setParameter("Body", "hi, how r u.");
   
  Button buttons = form4.getButtonWithID("sendtop");
  buttons.click();
                      
  WebResponse wr4 = wc.getCurrentPage();

I COULD NOT SUCCEED... LATER TRIED THESE STEPS ALSO


WebForm form2 = wr2.getFormWithName("Compose");
      
   form2.setParameter("To","+4979534535203");
   form2.setParameter("Body", "hi, how r u.");

  SubmitButton submitbutton = form4.getSubmitButton("sendtop");
  submitbutton.click(); 
  
  or also in this way
  
 SubmitButton submitbutton = form4.getSubmitButton("sendtop");
 form4.submit(submitbutton);
  WebResponse wr4 = wc.getCurrentPage();


PLEASE HELP ME ..............

thanks & regards,
bhimi.




==========================================================================
TOPIC: What is Embedded Java?
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/bacf063e98ecf899
==========================================================================

== 1 of 1 ==
Date:   Mon,   Sep 13 2004 11:42 am
From: Jim Cochrane <[EMAIL PROTECTED]> 

In article <[EMAIL PROTECTED]>, Ralph  White wrote:
> Some notes:
> 
> - wireless and embedded is not the same. Some embedded systems are
> wireless but many are not. "Embedded Java" refers to Java running on
> embedded systems, whether these systems are wireless or not.

(And I would think that some wireless systems are not [or will not be in
the future] embedded.)

-- 
Jim Cochrane; [EMAIL PROTECTED]
[When responding by email, include the term non-spam in the subject line to
get through my spam filter.]




==========================================================================
TOPIC: Thread synchronization
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/172837b7b0667fd1
==========================================================================

== 1 of 1 ==
Date:   Mon,   Sep 13 2004 11:49 am
From: Lasse Reichstein Nielsen <[EMAIL PROTECTED]> 

"Chris Uppal" <[EMAIL PROTECTED]> writes:

[Collections.synchronizedList()]
>
> Ugh, yes!
>
> I'm inclined to think that that wrapper should be deprecated.  It doesn't
> protect the semantics of the data /in/ the collection, only of the data
> structures used internally /by/ the collection.  

Well, that sounds like something you *would* like to preserve.

> And since protecting the meaning (which can only be done from
> outside) will naturally protect the implementation too, there seems
> to be little need for the wrapper.  

Sometimes a list is just a list :)
/L
-- 
Lasse Reichstein Nielsen  -  [EMAIL PROTECTED]
 DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
  'Faith without judgement merely degrades the spirit divine.'




==========================================================================
TOPIC: WYSIWYG content management system; how to put together and make it work
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/20484e6dbad0db77
==========================================================================

== 1 of 2 ==
Date:   Mon,   Sep 13 2004 11:57 am
From: [EMAIL PROTECTED] (anoniem) 

If anyone in this newsgroup has any knowledge of how to make a content
management system/ application for the web, please respond. I am
trying to put together a content management system that has a WYSIWYG
(What You See Is What You Get) interface. It must have high quality
standards like HTML editing applications. (frontpage and ...)

If java is not the first programming language to consider using for
this kind of projects, then what programming language is? Are there
any open-source content management system (CMS) programs around?

Steven Chang

<<<<<<<<<>>>>>>>>>>

Programming is exploring the world of applications and operating
systems around the globe using internet to travel faster then sound.



== 2 of 2 ==
Date:   Mon,   Sep 13 2004 12:19 pm
From: Andrew Thompson <[EMAIL PROTECTED]> 

On 13 Sep 2004 11:57:56 -0700, anoniem wrote:

> If anyone in this newsgroup has any knowledge of how to make a content
> management system/ application for the web, please respond. I am
> trying to put together a content management system that has a WYSIWYG
> (What You See Is What You Get) interface. 

You will fail.  The internet is not 
a WYSIWYG presentation medium.

Browser makers are beginning to realize
that users want text of any friggin' size 
that suits their screen, it's resolution,
the state of their eyes at that moment...
The days of 'I want 10 px verdana for 
the menu text' are coming to a close, 
or rather, it will be the user who is 
making that decision.

Once browser manufacturers give that ability
to the end user, the 'pixel perfect' sites
that you think are WYSIWYG, fall apart.  
Some fall apart and are still useable, 
if ugly, while most become unuseable.

>..It must have high quality
> standards like HTML editing applications. (frontpage and ...)

Frontpage destroys HMTL.  You have a steep
learning curve ahead if you think it produces 
HTML of a 'high quality standard'.

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




==========================================================================
TOPIC: java splash window
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/a18982f4ea35d6ef
==========================================================================

== 1 of 1 ==
Date:   Mon,   Sep 13 2004 11:56 am
From: Andrew Thompson <[EMAIL PROTECTED]> 

On Wed, 01 Sep 2004 00:01:25 +0100, Roy Ratcliffe wrote:

> gino wrote:
>> can anybody show me how to show a splash window before my program formally
>> starts for 10 seconds. The splash window should show only color image/logo,
>> without any window frame, title bar, etc.

OK.. I have got sick of picking at 
other people's code for SplashScreens, 
..so although I still do not have time 
to post my variant at my site, it's time 
I put it into the 'fray'.   ;-)

[ F'Ups set to c.l.j.gui. ]

<sscce>
import java.awt.*;
import java.awt.image.ImageObserver;
import java.io.File;
import java.io.IOException;
import java.net.URL;
import java.lang.SecurityException;

/** SplashFrame is a simple Java 1.1+ Applet/Application compatible
SplashScreen that displays an image (described by URL) for
the specified time.  The code was adapted from Roy Ratcliffe's
"SplashScreen.java 1.1 03-Jan-04"

To compile this for 1.1 compatibility, use..
javac -target 1.1 -source 1.3 *.java

Known issues.

Tested in both The 1.1.4 (MS)VM and the NN 1.1.5 (Symantec) VM.
Both display the 'warning applet window' as expected, but NN clears,
but fails to close the window at the end.

Modern browsers paint the warning message over the lower part of the
image.  Seems to work reliably from applications running under
Windows/Java 1.5.

@author Andrew Thompson
@author Roy Ratcliffe
@version 2004-08-19 */
public class SplashFrame extends Frame
  implements ImageObserver, Runnable {

  /** Time in milliseconds to display the splash frame. */
  int displayTime;

  /** The time first displayed on screen. */
  long firstDisplayed;

  /** Local reference ot the image. */
  Image image;

  /** This remains 'false' in pre 1.5 JVM's, and the
  paint() method calls toFront() to ensure it is visible. */
  boolean alwaysOnTop = false;

  /** Set false when we want the thread to
  end and the splash frame to finalize. */
  boolean display = true;

  /** The SplashFrame accepts the URL of an image (png, gif, jpg)
  and the number of milliseconds to display it.  */
  public SplashFrame(URL url, int displayTime) throws IOException {
    this.displayTime = displayTime;
    try {
      // test the image file exists..
      url.openConnection().getInputStream();
    } catch (IOException e) {
      e.printStackTrace();
      return;
    }
    image = Toolkit.getDefaultToolkit().getImage(url);
    try {
      setUndecorated(true); // defined in 1.4
      setAlwaysOnTop(true); // defined in 1.5
      // we are running 1.5+
      alwaysOnTop = true;
    } catch (SecurityException se) {
      // Applets will not allow 'AlwaysOnTop' in an unsigned applet..

      // this catches the SecurityAccessException thrown
      // by the call to setAlwaysOnTop.  Since the MSVM does
      // not recognise SecurityAccessException (post 1.1?)
      // we catch the SecurityException.  No problem.
    } catch (java.lang.NoSuchMethodError e) {
      setTitle("Splash Screen");
    }

    setLayout(new BorderLayout());
    /* firstDisplayed will be re-initialized at the end of the
    splash() method, but set it here to ensure the entire process
    does not abort during the first calls to paint() */
    firstDisplayed = System.currentTimeMillis();

    // Create and start the thread..
    Thread t = new Thread(this);
    t.start();

    // Call the splash method to complete the display..
    splash();
  }

  /** ensures the frame is correctly sized by calling the
  images getWidth method, and setting preferred size.. */
  public void run() {
    while (display) {
      try {
        image.getWidth(this);
        setSize(getPreferredSize());
        // if pre 1.5, bring to front..
        if (!alwaysOnTop) {
          toFront();
        }
        if (System.currentTimeMillis()-
          firstDisplayed > displayTime) {
          finish();
        }
        Thread.sleep(90);
    }
      catch (InterruptedException ie) { ie.printStackTrace(); }
    }
  }

  /** Closes the frame and disposes of the resources. */
  public void finish() {
    //end the thread
    display = false;

    // make the frame invisible
    setVisible(false);

    // dispose of the frame
    dispose();
  }

  public boolean imageUpdate(Image img, int infoflags,
    int x, int y, int width, int height) {

    // Return false if infoflags indicate that the image is
    // completely loaded; true otherwise.
    boolean allbits = infoflags == ImageObserver.ALLBITS;
    if (allbits) splash();
    return !allbits;
  }

  /** The all important splash method. */
  private synchronized void splash() {

    ImageCanvas canvas = new ImageCanvas(image);

    canvas.setSize(image.getWidth(null), image.getHeight(null));
    add(canvas, BorderLayout.CENTER);
    pack();

    Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
    Dimension frameSize = getSize();
    setLocation((screenSize.width - frameSize.width) >> 1, // /2
          (screenSize.height - frameSize.height) >> 1); // /2
    setVisible(true);

    // this is set above, but refreshed here
    firstDisplayed = System.currentTimeMillis();
  }
}

/** Why use a Canvas?  It allows packing.  This way, AWT's
normal packing mechanism handles the sizing and layout.
@author Andrew Thompson
@author Roy Ratcliffe
@version 2004-08-19 */
class ImageCanvas extends Canvas {

  Image image;

  ImageCanvas(Image image) {
    this.image = image;
  }

  public void paint(Graphics g) {
    g.drawImage(image, 0, 0, this);
  }
}
</sscce>

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




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

== 1 of 2 ==
Date:   Mon,   Sep 13 2004 12:00 pm
From: Grant Wagner <[EMAIL PROTECTED]> 

hilz wrote:

> hi all...
> i've got coupla gmail invitations to give away.
> if interested, email me at  hs underscore 74 at hotmail dot com
> cheers
> hilz
>
> P.S. Please don't change the subject when you reply, so i can find your
> email!

So all I have to do is E-mail [EMAIL PROTECTED] and I can get a Gmail
invite? Awesome.




== 2 of 2 ==
Date:   Mon,   Sep 13 2004 12:27 pm
From: "hilz" <[EMAIL PROTECTED]> 

very funny
really


"Grant Wagner" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> hilz wrote:
>
> > hi all...
> > i've got coupla gmail invitations to give away.
> > if interested, email me at  hs underscore 74 at hotmail dot com
> > cheers
> > hilz
> >
> > P.S. Please don't change the subject when you reply, so i can find your
> > email!
>
> So all I have to do is E-mail [EMAIL PROTECTED] and I can get a Gmail
> invite? Awesome.
>






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

== 1 of 1 ==
Date:   Mon,   Sep 13 2004 12:06 pm
From: Timo Nentwig <[EMAIL PROTECTED]> 

Ok, more precisely this time. I don't develop EJBs, I'm just wondering what
the EJB developer are telling me: the finder methods only get the IDs of
the rows, the row itself is actually fetch on first access. I.e. my finder
method may return the IDs of 1000 rows and then will fetch (SELECT) each
single one of them when I access them (i.e. iterator over the collection).

I can't believe that EJB is that silly...




==========================================================================
TOPIC: tools.jar workaround on Mac OS X?
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/fe6e515f0f644db3
==========================================================================

== 1 of 1 ==
Date:   Mon,   Sep 13 2004 12:10 pm
From: Scott Ellsworth <[EMAIL PROTECTED]> 

In article <[EMAIL PROTECTED]>,
 [EMAIL PROTECTED] (Erik Hentell) wrote:

> I just got my first Powerbook a couple weeks back, and wanted to play
> around with the some alternative languages for the Java VM.  I tried
> to use Kawa, Netrexx, and a couple other languages, but I discovered
> that tools.jar doesn't exist in Mac OS X.  Instead everything is in
> classes.jar, and it seems to be messing up the process of actually
> compiling these languages to bytecodes.

Look carefully for error messages.  Such error messages might indicate 
how they were looking, and thus what you need to do to make them happy.

One possibility: try creating an empty jar named tools.jar in JAVA_HOME.  
Programs searching for tools.jar often also demand JAVA_HOME be set 
despite it usually being superfluous.

If the alternate language authors are actually demanding that the 
classes in question exist in tools.jar, rather than just doing a 
getResource to find them, they likely need to be smacked.  I seem to 
recall that there are a few edge cases where this makes sense, but 
usually, allowing the system bootclasspath to do its thing is adequate.

> Is there a workaround for something like this?  I realize the obvious
> answer is to just use the standard Java language, but I'm also
> wondering if this has an effect on other Java projects that people
> might want to use on OS X (Jboss, Eclipse, etc)

Has not been a problem for me with Eclipse, IDEA, the built in Tomcat 
(whose startup.sh I looked at to get the one from Apache working).

Scott




==========================================================================
TOPIC: Java Student Needs Help
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/48d209fbe843b0be
==========================================================================

== 1 of 1 ==
Date:   Mon,   Sep 13 2004 12:13 pm
From: Scott Ellsworth <[EMAIL PROTECTED]> 

In article <[EMAIL PROTECTED]>,
 Jim Cochrane <[EMAIL PROTECTED]> wrote:

> In article <[EMAIL PROTECTED]>, beyonder74 
> wrote:
> > I have to write a program that lets the user input three numbers
> > between 1 and 10, the system generates three numbers between 1 and 10.
> 
> If you're serious about needing help, you'll get much better results with
> a better subject line, one that gives a short summary of your problem,
> or a topic your problem falls under.  "Java Student Needs Help" is so
> vague, most people will just ignore your post.


Hey, at least he posted some source, and said it was for a class.  This 
is so far beyond what most new posters here do that I am staggered.

I do agree with Alex - post the output your program produces, and the 
output you expected.  Very often, an answer will leap right out at you 
once you have done that.

You are calling returnFirst, returnSecond, and returnThird in the 'a' 
instance of the RandomMaxNum class.  I do not see the source for that 
class, and so no returnFirst, returnSecond, or returnThird methods.

If your question was "what is the syntax for a method returning the 
value of num1", a possible answer might be:

   public int returnFirst(){
      return num1;
   }

Scott




==========================================================================
TOPIC: byte representation of a class
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/754ced8b07b9a2d3
==========================================================================

== 1 of 2 ==
Date:   Mon,   Sep 13 2004 12:14 pm
From: [EMAIL PROTECTED] (Benjamin von Eicken) 

Hi

How can I get a byte representation of
a java class?
I do not want to use the class file.
Is it possible to get access to the
byte code?
ObjectOutputStream does it somehow,
but I do not want to use serializable
objects only and I do not want a
stream.
So I want to store an instance of an
object but not in a stream and not
necessary serializable.
Is it possible?
And if, how?

regards

Benjamin von Eicken



== 2 of 2 ==
Date:   Mon,   Sep 13 2004 12:21 pm
From: "Ann" <[EMAIL PROTECTED]> 


"Benjamin von Eicken" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi
>
> How can I get a byte representation of
> a java class?
> I do not want to use the class file.
> Is it possible to get access to the
> byte code?
> ObjectOutputStream does it somehow,
> but I do not want to use serializable
> objects only and I do not want a
> stream.
> So I want to store an instance of an
> object but not in a stream and not
> necessary serializable.
> Is it possible?
> And if, how?
>
> regards
>
> Benjamin von Eicken

What format do you want then?






==========================================================================
TOPIC: How to use JTree with very large data?
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/145516a872afaa18
==========================================================================

== 1 of 1 ==
Date:   Mon,   Sep 13 2004 12:25 pm
From: "ak" <[EMAIL PROTECTED]> 

> I have the following problem: I have this large amount of data, stored
> internally in some custom data structures (hierarchical ones, given
> the nature of the data - I am using some custom, tree-like structurs
> for this).
> I have to show the different relations within this data using several
> JTrees - one per "viewpoint". (The good news is that I only have to
> show one type of view at a time.)

TreeModel is just an interface.
Make your custom data structure implement TreeModel.

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






==========================================================================
TOPIC: java equivalent of perl module Locale::SubCountry?
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/b803837211c1c4ca
==========================================================================

== 1 of 2 ==
Date:   Mon,   Sep 13 2004 12:24 pm
From: vturner <[EMAIL PROTECTED]> 

Paul Lutus wrote:
> 
> So use the Perl database, dump its contents and create a Java version with
> the same information.
> 
>> 
>> I think what I might end up doing is just calling, from a Java program, a
>> perl script that invokes the perl module (using Runtime.exec() ) and just
>> pass back the info either via file or InputStream.
> 
> There really is no need for something like this. You may be able to read
> the Perl files directly and glean the required information, and create a
> Java class to handle this issue.
> 
You know, that's not a bad idea.  I don't know why I didn't think of that. 
Just lazy, I guess.  I looked at the perl module and it has XML entries
like:

<country>
  <name>AUSTRALIA</name>
  <code>AU</code>
  <subcountry>
    <name>New South Wales</name>
    <code>NSW</code>
    <category>state</category>
    <FIPS>02</FIPS>
  </subcountry>
  <subcountry>
    <name>Queensland</name>
    <code>QLD</code>
    <category>state</category>
    <FIPS>04</FIPS>
  </subcountry>
...
</country>

Seems kind of like a waste to do it and not share it though.  Is there a
place like CPAN for Java where you can share code?





== 2 of 2 ==
Date:   Mon,   Sep 13 2004 12:56 pm
From: Laie Techie <[EMAIL PROTECTED]> 

On Mon, 13 Sep 2004 19:24:41 +0000, vturner wrote:

> Seems kind of like a waste to do it and not share it though.  Is there a
> place like CPAN for Java where you can share code?

http://www.java.net is probably the closest thing.

La'ie Techie







==========================================================================
TOPIC: RMI client behind a firewall, server behind a firewall too
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/898ce13af69b8972
==========================================================================

== 1 of 1 ==
Date:   Mon,   Sep 13 2004 12:50 pm
From: [EMAIL PROTECTED] (Robert Dodier) 

Hello,

Browsing the web & newsgroups, it looks like this problem doesn't
have any kind of easy solution, but let's see if someone knows different.

I want to have a RMI client behind a firewall and a RMI server
behind another firewall. I don't have any control over the firewalls.
I know port 80 will be open for http traffic, but that's it.
The web server on either side isn't the same as the machine running
the RMI client or server. 

I want the client to be able to call methods on server objects
and also to enable callbacks from the server to the client.

What can be done in this case? I've read the RMI docs at Sun,
browsed through a few dozen webpages & news messages, and the
situation looks pretty dark, actually. Maybe someone has cause
for optimism here. Thanks for any information. 

Robert Dodier




==========================================================================
TOPIC: Easy-to-understand Servlet container?
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/5a6c2be39085acf6
==========================================================================

== 1 of 1 ==
Date:   Mon,   Sep 13 2004 12:56 pm
From: [EMAIL PROTECTED] (Jeff Robertson) 

Does anyone know which open source Servlet Containers are written with
the goal of making it easy for a novice Java programmer to read and
understand them?

To me, what this would mean is:

1) Keep the total number of classes and interfaces as small as
possible.

2) Favor simplicity over flexibility. Don't succumb to the "make
everything a factory" temptation.

3) Few (if any) dependencies on external libraries; not even other
open-source projects. Use the standard JDK classes for everything
possible.

4) Well-commented.

It goes without saying that in spite of the above, it needs to
correctly implement whatever version of the servlet API it claims to
implement. I might be willing to accept one that doesn't support JSP
as long as it gets the main Servlet API correct.

With the exception of the one about comments, these are not
neccessarily the same design goals as a servlet container for
real-world use. In fact they seem to be the exact opposite of the way
Tomcat, in particular, is designed.

Thanks in advance for your suggestions.

I would like to use such a thing as part of a course I going to
teaching. If nothing like this can be found, I may very well try to
organize a project to write it. But I would obviously prefer to have
something that already exists!




==========================================================================
TOPIC: Who is the best WebSphere Studio or Oracle JDeveloper??
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/747e9a4c137251d2
==========================================================================

== 1 of 1 ==
Date:   Mon,   Sep 13 2004 12:56 pm
From: "REM" <[EMAIL PROTECTED]> 

Can anybody tell me which IDE tools, Web Sphere, JDeveloper or etc, is the
best for the enterprise applications.

I know that JDEveloper have good IDE for map database object but I am
interesting for web presentation, which has the best framework part for web
component, JSP, servlet and etc. I know that in WebSphereStudio can put
plug-in for Struts framework, but it's look very difficult for develop and
support.

--
thanks,

ilica

_________

"If A is a success in life, then A equals x plus y plus z. Work is x; y is
play; and z is keeping your mouth shut."





---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.515 / Virus Database: 313 - Release Date: 1.9.2003






==========================================================================
TOPIC: VisualAge IDE scroll problem
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/7d862f878fe2f6af
==========================================================================

== 1 of 1 ==
Date:   Mon,   Sep 13 2004 1:02 pm
From: [EMAIL PROTECTED] ([EMAIL PROTECTED]) 

The problem is VA 4.0 uses java 1.2.2 (I think), scrolling with the
mouse is only supported on java 1.3 and above




==========================================================================
TOPIC: Print problem
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/899328c468644690
==========================================================================

== 1 of 1 ==
Date:   Mon,   Sep 13 2004 1:01 pm
From: "Ralph Curtis" <[EMAIL PROTECTED]> 

I'm trying to print some columnar character data. I use monospace font in
which all characters are the same width. I try to get the character width
and from there calculate the number of characters per line. Simple stuff but
it doesn't work reliably. The problem is that I am not always getting the
correct rendering widths for the monospaced fonts depending on the font size
I use.

I use:

double charWidth = printingFont.getStringBounds("w",
g2d.getFontRenderContext()).getWidth();

to get the rendered character widths. But the value returned is wrong.

font size 10 -> width 6.0  (pretty good for a page with 1 inch margins - 468
imageable width)
font size  9 -> width 5.0  (should be closer to 5.4)
font size 8  -> width 5.0  (should be close to 4.8)

I have tried getting the width of a full line of n chars but it just ends up
being (n * the width) shown above.

What am I doing wrong?
How do I get the true rendered character widths?

Any hints or pointers in the right direction are appreciated.

Ralph






==========================================================================
TOPIC: Can I get TCPMon free without a bunch of other included software?
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/b8b8e67ddb9bcd5e
==========================================================================

== 1 of 1 ==
Date:   Mon,   Sep 13 2004 1:06 pm
From: [EMAIL PROTECTED] 

Hey all, I used to have IBM Web services installed and it came with a
useful application called TCPMon.

I did some googl'ing and is seems that an organization called Axis is
the one responsible for the application.

I was wondering if it would be possible to download the application
(with the GUI) free of charge without getting all the other web
services stuff.  If so, can someone direct me to the URL?
Thanks,
Novice




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

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

comp.lang.java.programmer
[EMAIL PROTECTED]

Change your subscription type & other preferences:
* click http://groups-beta.google.com/group/comp.lang.java.programmer/subscribe

Report abuse:
* send email explaining the problem to [EMAIL PROTECTED]

Unsubscribe:
* click http://groups-beta.google.com/group/comp.lang.java.programmer/subscribe


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



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

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

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

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

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



Reply via email to