Re: Experiences with JBuilder?

1998-05-21 Thread Paul Reavis

Ugo Cei wrote:

> Brad Pepers wrote:
> > 3. Is Java on Linux (or Windows 95 for that matter) at the point where
> >I can expect to develop end-user commercial software and have the
> >stability and ease of use I need?
>
> Can't comment on this, I've yet to begin deploying and testing.

We currently develop a commercial package entirely in java under linux,
deploying on NT and Win95 for the most part (with one deployment to an Alpha
running Digital Unix). Works great; stability is good, "ease of use" is of
course entirely subjective but I find Linux easier to develop under than
Win32. I don't use an IDE, so consider that in your evaluation.

We've been doing the java thing for almost two years now, and 1.0 shipped
more than a year ago (I'm coding 2.1 as I write). Only 8 customers so far,
but at $50-$80K apiece not a bad living. :-)

So yeah, there are issues, but it works for us and I'm loving it. Cheers to
the porting team.

--

Paul Reavis  [EMAIL PROTECTED]
Design Lead
Partner Software, Inc.http://www.partnersoft.com






Re: Delete all class files

1998-09-15 Thread Paul Reavis

Keith T. Garner wrote:
> 
> On Mon, Sep 14, 1998 at 07:17:17, David Warnock said:
> > I thought I should be able to connect "find . -name *.class" to "rm"
> > somehow using redirection or pipes but cannot get it to work.
> 
> You were very close to one possible solution :)
> 
> find . -name *.class | xargs rm
> 

All of which is more complicated than my favorite method, which is to
specify a separate .class file directory with the "-d" option (javac or
jikes); then it's just 

rm -r classes\*

-- 

Paul Reavis  [EMAIL PROTECTED]
Design Lead
Partner Software, Inc.http://www.partnersoft.com



Debian JDK page

1998-05-27 Thread Paul Reavis

Well, I got dragged around on errands all night last night, so didn't
get this
done before the JDK FAQ was published, but it's up now-

Still very rough; needs lots of input from you good people out there.
Focus is on getting various versions of the JDK running on various
versions of Debian.

As listed in the FAQ, it lives at
http://www.mindspring.com/~tumu/java/Debian-JDK.html.

Enjoy.

--

Paul Reavis  [EMAIL PROTECTED]
Design Lead
Partner Software, Inc.http://www.partnersoft.com






Re: Swing under Linux

1998-05-20 Thread Paul Reavis

Aaron Walker wrote:

> Does anyone know if the JFC (Swing) is available under Linux?

Just download it from javasoft (I grab the tar.Z version) and use
it. Works great. Swing is 100% java, so no porting required.

--

Paul Reavis  [EMAIL PROTECTED]
Design Lead
Partner Software, Inc.http://www.partnersoft.com






Re: Installing Java JDK 1.1.5 on Debian?

1998-05-28 Thread Paul Reavis

Marcus Johnson wrote:

> Now if I'm understanding this correctly (and please set me straight if I'm
> wrong), this is telling me that the system I'm trying to set the JDK 1.1.5
> up on is actually Rex (Debian 1.1) and that the Linux kernal is v. 2.0.0
> (and is that #19 mean its 2.0.019 or that I'm the 19th user on-line or
> what?)

Sounds reasonable, but I've wasn't using Debian back then...

> So, given the fact I'm not in a position to compel the admin to upgrade to
> Debian 1.3 or 2.0 (but can and will lobby for it), in the meantime where
> does this leave me when I want to install the JDK 1.1.5 in my own shell
> account area? Which libraries and other configuration dealie-mic-bobbers
> which I need to get the admin to set in order to make this work?

Short answer: I don't know. But I can steer you clear of some of the bigger
boulders...

> * I did ftp the Bryne jdk1.1.5-v5-glibc.tar files, untarred them and tried
> to set them up.

Whoops - you need the libc5 version, for sure. Debian 2.0 (hamm) is the first with
real glibc support.

If that works, then all you need to do is have the unpacked jdk/bin directory in
your path somewhere, and maybe set JAVA_HOME to the unpacked root directory. Check
the FAQ (currently at
 http://www.place.org/~stevemw/java/FAQ/FAQ-java-linux.html
) for general issues.

I would also try the 1.1.3 version, since that is the only one I have gotten to work
under Debian 1.3 (bo).

If you manage to get this running on Rex, send me the details, so I can add it to my
Debian-JDK howto (http://www.mindspring.com/~tumu/java/Debian-JDK.html).


--

Paul Reavis  [EMAIL PROTECTED]
Design Lead
Partner Software, Inc.http://www.partnersoft.com






Re: Survey, what tool do you use?

1998-06-19 Thread Paul Reavis

Peter Schuller wrote:
> 
> >   What development tool do you use to help on daily coding?
> > IDE, simple class browser, or just an editor.
> 
> I use XEmacs for all my coding - it's great. The only thing I want now is
> something that'll save me from managing makefile (I'm working on such an app
> myself). Alternatively, I might, and that's a big MIGHT, get a commercial IDE,
> if there is one that runs on Linux, and that I find worth paying for.

Try out my JarMakefileGenerator utility; it's in the pack of reuseables
at http://tumu.home.mindspring.com/java/jcon/. It's still in the stage
of "real useful to me, might need to be generalized to be useful to you"
but it does automate compilation of large source trees with lots of
packages, and controls dependencies between packages too. I've been
using it every day here at work (I hack Java full-time :-) for months
now and find it a big time-saver for complex builds (my tree is 315
.java files strong at the moment).

Anyway, it's LGPLed so if it's close to what you need you can make it
fit (and send me the diffs if you like).

-- 

Paul Reavis  [EMAIL PROTECTED]
Design Lead
Partner Software, Inc.http://www.partnersoft.com




Re: Environment variables

1998-07-22 Thread Paul Reavis

Nathan Meyers wrote:
> 
> A little bit of shell or perl (or name-your-favorite-command-interpreter)
> programming could give you a script that would construct a Java
> command-line containing all of the environment variables as "-D..."
> options. I've attached a perl script that'll send a Java command line to
> stdout; with a little modification, it could execute the line instead.

Now _that's_ handy. I've got some wrappers of my own, so this will just
add- we could start competing to see whose final Java invocations were
the longest, what with all the -classpaths and -Ds and all :-)

Thanks to you and everyone else who responded-

-- 

Paul Reavis  [EMAIL PROTECTED]
Design Lead
Partner Software, Inc.http://www.partnersoft.com



Re: makemake?

1998-08-11 Thread Paul Reavis

Michael D. James wrote:
> 
> A while ago someone asked whether there is a makefile generator for
> Java and I forgot the answer.  Now I need to do it.  (This is why we
> need a working archive.)  Any tips?  The company in question prefers
> not to manually update the Makefiles every time a compilation unit is
> added.

Checkout the JarMakefileGenerator in the Atlanta Java Consortium
reuseables library at http://tumu.home.mindspring.com/java/jcon/

-- 

Paul Reavis  [EMAIL PROTECTED]
Design Lead
Partner Software, Inc.http://www.partnersoft.com



Re: jikes bug

1998-08-13 Thread Paul Reavis

Albrecht Kleine wrote:
> 
> FYI: jikes 0.36 (announced here on this list some weeks ago)
>  cannot compile next t.java file:
> 
> --
> import java.awt.*;
> import java.awt.event.*;
> class t
> {
> public t()
> {
>   int e = 0;
>   Button b = new Button();
>   b.addActionListener(new ActionListener()
>{
> public void actionPerformed(ActionEvent e)
>  {
>System.out.println("actionPerformed:"+e);
>  }
>   });
>   System.out.println("constructor:"+e);
> }
> }
> ---
> 
> Note: neither javac nor guavac1.0 (GNU) have any problems
> to compile this.
> 
> Any comments ?

This is what I got:

-
slackguy$ jikes breaksjikes.java 

Found 1 semantic error compiling "breaksjikes.java":

11. public void actionPerformed(ActionEvent e) 
^
*** Error: Duplicate declaration of local variable e


It doesn't like the variable overriding the one in the containing
class. Jikes is a lot pickier than javac; whether this is a better
interpretation of the language spec I'll leave to the language lawyers.
Jikes' interpretation definitely would stop a whole class of
hard-to-diagnose bugs, but would be a bit limiting as well. 

I have witnessed a more disturbing problem with jikes that I haven't
been able to duplicate with a small piece of code. I have some GUIs with
multiple function buttons - kind of like the various drawing buttons in
an art application. Each are valid under certain circumstances and with
certain things selected, therefore there is a fair amount of
disabling/enabling involved, and a good bit of event passing. If I
compile with javac, it works fine; with jikes things get disabled and
are never enabled. My guesses so far:

1) Jikes has different default initialization behavior
2) Jikes generates different bytecodes, which aggravates a race
condition

I hope to hunt it down soon; I really like jikes' speed and
functionality, and don't mind its anal retentiveness. But in the
meantime I'm cranking out bells and whistles...

-- 

Paul Reavis  [EMAIL PROTECTED]
Design Lead
Partner Software, Inc.http://www.partnersoft.com



Re: Delete all class files

1998-09-15 Thread Paul Reavis

David Warnock wrote:
> 
> Paul Reavis wrote:
> 
> > All of which is more complicated than my favorite method, which is to
> > specify a separate .class file directory with the "-d" option (javac or
> > jikes); then it's just
> >
> > rm -r classes\*
> 
> Ok, this is neat. Do I get a complete duplicate of my source directories
> for the classes ie classes/uk/co/sundayta ... ?

Yes, automagically created by javac/jikes/etc. And when you're through
compiling, you just

cd classes
jar c0f ../lib/myjar.jar *

and you have just the classes in jarfile format for distribution.

If you put the source directory tree first in your classpath, i.e.,
CLASSPATH=~/java/source:~/java/classes:/usr/local/jdk/lib/classes.zip

then javac/jikes will automagically prefer newer source files to class
files (it may do this anyway, whatever) and can find the source to
compile when it needs it.

-- 

Paul Reavis  [EMAIL PROTECTED]
Design Lead
Partner Software, Inc.http://www.partnersoft.com



Re: Delete all class files

1998-09-16 Thread Paul Reavis

Armen Yampolsky wrote:
> 
> I have a problem with this approach and using make, (probably because
> I'm not using make correctly), in that if I use the -d option and use a
> separate .class directory tree, make doesn't recognize the up-to-date
> files there and recompiles everything anyway. I can never get the
> "Nothing to be done for `CLASSES'" message when my Makefile looks like

Looks like your targets (the %.class) don't end up pointing at the ones
in the right tree. I think (I'm not a make wizard, so may be wrong) that
would involve some games with the path-mangling functions.

Because of these and other issues, I wrote a simple program,
JarMakefileGenerator, that takes a make-like format and builds a
Makefile that compiles your code into jarfiles. It's GPLed and at
http://www.worldofbeverage.net/java/jcon/

-- 

Paul Reavis  [EMAIL PROTECTED]
Design Lead
Partner Software, Inc.http://www.partnersoft.com



Re: Installing Java JDK 1.1.5 on Debian?

1998-05-29 Thread Paul Reavis

Steve Byrne wrote:

> JDK 1.1.5 and 1.1.6 libc are built on a Debian 1.3.1 system -- no problems.  My
> libc is 5.4.33, and libdl.so is libdl.so.1 => libdl.so.1.8.12.

? Then why won't it work on mine?

[research, research, test, grind, scratch head...]

AHA! A clue!

I started running java with all the lights on, maximum verbosity, and weird things 
happened
like "can't find sun.tools.javac.Main". Lots of crashing and such. Unzipped and 
rezipped the
classes.zip. Different classes can't be found. More head scratching. Then I checked my
classpath. Whoa! Lots of jars. Killed some - and now it works.

I suspect that somewhere between 1.1.3 and 1.1.5v7 some code (possible the javasoft
stuff) for loading things from jars got changed, and now it doesn't scale up to the
ridiculous proportions that I use. I built a tool for automagically building jars 
using a
makefile-like syntax (it translates to a real makefile, actually). It enforces 
dependencies,
so creates little subjars, then when done combines them into larger jars. I still 
hadn't
removed the subjars, so there was some duplication and a big classpath with about 22 
items,
including the packaged classes.zip, a source tree (.java files only), and a 
destination tree
(.class files only).

Anyway, under 1.1.3 it worked, under 1.1.5v7 it barfed.

I found that the limit, at least on my machine, for trivial jars in a classpath is 254 
- you
get "too many open files" errors after that. Interesting, but probably not relevant.

I'm still looking into depth issues, and trying to find a test example without 
foisting all
my code off on you. But I thought perhaps sbb or others could peek at the source and 
see if
all this rings a bell...

Thanks for help-

--

Paul Reavis  [EMAIL PROTECTED]
Design Lead
Partner Software, Inc.http://www.partnersoft.com






Re: dependencies and javac?

1998-06-08 Thread Paul Reavis

Stephen Wynne wrote:

> In message <[EMAIL PROTECTED]>, Bernd Kreimeier writes:
>
> Is there any way to use GNU make for "depend" purposes with JDK?
>
> Warren Pfeffer has a Java 1.1 dependency graph generator that says it
> can help with this sort of thing at
> http://pluto.njcc.com/~slinky/land_of_science.html. It also requires
> JGL (http://www.objectspace.com) and JavaCC
> (http://www.suntest.com/JavaCC/), but having those around will be a
> real plus anyway.
>
> I haven't tried this, but it sure sounds useful. I'd be interested in
> hearing if it works well for your project.

I hate to pre-advertise, but I'll be putting up an LGPLed class library this
week that includes a build system that uses Makefiles. It adds a lot more
structure to the Java compilation process.

I'll announce it on this list when it's up.

It also uses JGL, but I parse with ANTLR :-)


--

Paul Reavis  [EMAIL PROTECTED]
Design Lead
Partner Software, Inc.http://www.partnersoft.com






Font problems with v4b

1998-09-17 Thread Paul Reavis

I've been running Together/J, and have a couple of problems.

One is I keep getting things like:

Warning: 
Name: textfield
Class: XmTextField
Character '.' not supported in font.  Discarded.

Warning: 
Name: textfield
Class: XmTextField
Character 't' not supported in font.  Discarded.

Warning: 
Name: textfield
Class: XmTextField
Character 'p' not supported in font.  Discarded.

Warning: 
Name: textfield
Class: XmTextField
Character 'r' not supported in font.  Discarded.

It's AWT based.

Also, occasionally it hangs on startup, especially after running a few
times. So I did a `find /` just to purge the disk cache, and, voila! it
works. Interesting.

-- 

Paul Reavis  [EMAIL PROTECTED]
Design Lead
Partner Software, Inc.http://www.partnersoft.com



Re: Font problems with v4b

1998-09-17 Thread Paul Reavis

Vincent Trussart wrote:
> 
> Paul Reavis wrote:
> 
> > I've been running Together/J, and have a couple of problems.
> >
> > One is I keep getting things like:
> >
> > Warning:
> > Name: textfield
> > Class: XmTextField
> > Character '.' not supported in font.  Discarded.
> >
> 
> Try preloading /lib/libBrokenLocale.so when launching Together/J
> 
> Edit the Together.sh script and change the line #12 so that it begins with
> 
> LD_PRELOAD=/lib/libBrokenLocale.so.1

Works great. Thanks!
 
> By the way,  I added  -ms15m -noasyncgc after $JAVA; now the vm has more
> "headroom"
> and it's a bit smoother...  

Also a good suggestion.

> If they could only switch to swing... those
> motif widgets are awful...

Peter Coad came to Atlanta JUG last night and gave an interesting
present on colored UML and then showed off tj. He said the swing version
was coming soon; they don't like awt either. I'm very impressed with the
architecture of tj, and the way they have stayed as decoupled as
possible from your favorite editor/version control/etc.; this and the
"no junk in your code" philosophy really sets them apart from e.g. Rose
(which is totally in bed with Microsoft at this point). It still has
some problems and limitations, but I'd rather bet on a good beginning
architecture with few features that can grow than a feature-packed piece
of crap. 

That and it generates HTML doc; I saw that and was sold.
 
> > Also, occasionally it hangs on startup, especially after running a few
> > times. So I did a `find /` just to purge the disk cache, and, voila! it
> > works. Interesting.
> >
> 
> Maybe you could run "sync" instead...

Does that clear the read cache or just flush the write cache? It seems
odd to me, that any non-hardware-banging program, especially Java, would
be affected by the cache at all.

-- 

Paul Reavis  [EMAIL PROTECTED]
Design Lead
Partner Software, Inc.http://www.partnersoft.com



Re: getResourceAsStream on Class-Files

1998-09-28 Thread Paul Reavis

Juergen Kreileder wrote:
> 
> >>>>> Bernd Wengenroth writes:
> 
> > Hello, I want to load class-files with the
> > ClassLoader.getResourceAsStream( String )-methode.
> 
> > i.e. xxx.getResourceAsStream( "package/myClass.class" );
> 
> > It's works fine on files without a ".class"-postfix.  But files with
> > this prefix are not opened (the methode reports null).  If i copy
> > the same file to the same directory, but without the postfix, the
> > stream is returned as expected.
> 
> > Any hints ?
> 
> That's a security feature, you can't get classes with getResource.

And you should be able to get around it with a custom classloader (which
isn't as hard to implement as you might think).

-- 

Paul Reavis  [EMAIL PROTECTED]
Design Lead
Partner Software, Inc.http://www.partnersoft.com



Re: getResourceAsStream on Class-Files

1998-09-28 Thread Paul Reavis

Bernd Wengenroth wrote:
> 
> Paul Reavis wrote:
> >
> > And you should be able to get around it with a custom classloader (which
> > isn't as hard to implement as you might think).
> 
> *smile*, that exactly what i want.
> I want to speed up the start of plugin-applications with an own
> class-loader.
> I start with a very small preloader, that can display some more custom
> "loading..."-Messages while the main part of the application is loaded
> from a huge jar-file.
> But i don't want to load ALL classes at startup.
> Some classes should be loaded on demand from a server.
> I think i must do this with a direct file-access ;)

I think JavaWorld had a short article on custom class loaders, written
by our local guru Jack Harich. If you can find it, I recommend it; it's
a bit old though-

-- 

Paul Reavis  [EMAIL PROTECTED]
Design Lead
Partner Software, Inc.http://www.partnersoft.com



Socket exceptions under 1.1.6v4

1998-09-28 Thread Paul Reavis

My Voyager-based networking works under v2 but breaks under v4 with
a

java.net.SocketException: Socket option unsupported

I'm just trying to connect with the Voyager server at a specified port;
it never even makes the connection. Localhost or LAN doesn't seem to
make a difference.

I'll dig more when I get a chance if no one has any ideas on what the
change might have been.

-- 

Paul Reavis  [EMAIL PROTECTED]
Design Lead
Partner Software, Inc.http://www.partnersoft.com



Re: fast multiple object creation ... can it be done!

1998-09-29 Thread Paul Reavis

Steve Byrne wrote:
> 
> Vincent Trussart writes:
>  > One way to handle this problem would be to create an Object pool.
>  > There was an article on javaworld (www.javaworld.com) a few months
>  > back.  Basically, instead of creating new objects you request them from the
>  > pool.  When they are not needed anymore, you put them back in the pool.  This
>  >
>  > way the GC won't collect them.
>  > The pool must be able to "clean up" objects and so on...
> 
> Right.  I've known projects that have done this and won big.  Creating objects
> is somewhat expensive because it's a synchronous operation, and synchronized
> operations are slow in the 1.1 VM (1.2 uses a completely different and clever
> trick to get the overhead of synchronization down into the noise).

Another design pattern is the Flyweight (from the GOF "Design Patterns"
book on just about everyone's bookshelf these days) for large numbers of
objects; the example given is modeling individual character glyphs in a
word processor implementation. 

Both of these ideas really are avoiding the whole instantiation thing
entirely, which may not be what you were looking for - but in any OO
system, especially one with garbage collection, you have to consider the
overhead that each object has above and beyond the memory size of its
state. If you were to build a ton of objects, use them and drop them,
you'd be stressing the GC for sure.

Hotspot and 1.2 promise to help with the both ends of the problem -
we'll how that turns out.

-- 

Paul Reavis  [EMAIL PROTECTED]
Design Lead
Partner Software, Inc.http://www.partnersoft.com



Experiences with jdk and lesstif?

1998-09-29 Thread Paul Reavis

I was just wondering what experiences people are having using the jdk
with dynamic lesstif. I recall there were problems awhile back, but
haven't heard much recently. I use Swing exclusively now, which should
put less stress on it. I'm just tired of the huge stomp java puts in my
memory, some of which I assume is static Motif.

-- 

Paul Reavis  [EMAIL PROTECTED]
Design Lead
Partner Software, Inc.http://www.partnersoft.com



Re: Experiences with jdk and lesstif?

1998-09-29 Thread Paul Reavis

Juergen Kreileder wrote:
> 
> >>>>> Paul Reavis writes:
> 
> Paul> I was just wondering what experiences people are having
> Paul> using the jdk with dynamic lesstif. I recall there were
> Paul> problems awhile back, but haven't heard much recently. I use
> Paul> Swing exclusively now, which should put less stress on
> Paul> it. I'm just tired of the huge stomp java puts in my memory,
> Paul> some of which I assume is static Motif.
> 
> One of the major problems with lesstif and JDK is changing the font
> for widgets. Unfortunately I haven't been able to make a small C
> example for this problem yet.

Would this apply to swing widgets, or just the native awt controls?

> I think you wont save much memory with lesstif unless you have
> several lesstif applications running at the same time.

That's the issue, actually. Especially during testing it's not unusual
for me to have a half-dozen Java apps open on one machine (distributed
system). Plus, I'm beginning to use some pure-java tools like
Together/J, so it'd be nice to have a shared library.

-- 

Paul Reavis  [EMAIL PROTECTED]
Design Lead
Partner Software, Inc.http://www.partnersoft.com



Re: fast multiple object creation ... can it be done!

1998-09-29 Thread Paul Reavis

Steve Byrne wrote:
> 
> Uncle George writes:
>  > interesting, considering that 1.2 isn't out yet. U got a mole in the sun
>  > organization?
> 
> I used to work there until December of 97.  I kept ensuring that 1.2 compiling
> cleanly with gcc, so the port to Linux wouldn't be too bad.  Being on the
> inside, you get presentations from time to time about things related to the VM,
> and one of them talked about some of the improvements in 1.2.  I think, though,
> the new synchronization mechanism is public knowledge, but I'm not certain.

I've heard about it from various quarters; it's in the big bag of
HotSpot/1.2 improvements, and there are several white papers and
articles scattered around about those. Uncle George, you might dig
around on developer.javasoft.com and javaworld if you want more info. Or
just keysearch on +java +hotspot and see what crawls up.

-- 

Paul Reavis  [EMAIL PROTECTED]
Design Lead
Partner Software, Inc.http://www.partnersoft.com



Re: How do I implement a synchronous drawImage()

1998-10-12 Thread Paul Reavis

Brian Pedersen wrote:
> 
> On Sun, 11 Oct 1998, Thomas Okken wrote:
> 
> > Hi all,
> >
> > For Reasons too Complicated to Explain, I would like to implement
> > a set of methods similar to Graphics.drawImage(), only without the
> > ImageObserver argument. These methods should block until the image
> > is completely drawn, i.e. I would like to implement a synchronous
> > variant of drawImage().
> 
> I believe that ImageObserver == null will make the operation synchronous.

I'm not so sure. I use a java.awt.MediaTracker. A snippet:

- - - - - - - - - - - - - - - - - - - - - >8- - - - - - - 
// forceload image
if (forceload) {
MediaTracker trackie = new MediaTracker(this);
trackie.addImage(image, 0);
try {
trackie.waitForID(0);
}
catch(InterruptedException oopsie) {}
}
- - - - - - - - - - - - - - - - - - - - - >8- - - - - - - 

-- 

Paul Reavis  [EMAIL PROTECTED]
Design Lead
Partner Software, Inc.http://www.partnersoft.com



Atlanta Java Consortium Reuseables

1998-06-08 Thread Paul Reavis

Well, the set of consortium reuseables I've been working on are
under LGPL now, so are free for
y'all to use in your own projects, be they personal or commercial.
I've posted them to my web site at
http://www.mindspring.com/~tumu/java/jcon/

This is the first public release, so may not be as generally useful
as it can be. Feel free to contribute ideas and/or code to make
it better.

I'm only posting this to the Atlanta JUG and this list; y'all will
be guinea pigs for wider distribution :-)

Actually, this is of interest to linux-java sorts because
a) it's LGPL and we all love free software
b) it includes that Makefile generation thingie I was
babbling about.

As far as what else it does... well, I need to work on better four-color

glossies. There are several things.

-> A generator for GNU makefiles, that enforces package dependencies
and builds jarfiles based on a make-like format.
-> A tool for changing package names in a source tree (even if
the packages are external references)
-> A tool for building APIs more easily with javadoc.
-> A configurable parser for command line arguments and options,
with a very straightforward standard format and built-in help. The
format is GNU-like, in that it includes short ("-h") and long
("--help") versions of all flags.
-> A human readable, ASCII serialization format based on JavaBeans
introspection. This is the most valuable thing I have ever written.
-> A handy Log gadget that emits Log events.
-> Some data-handling utilities, including the "12-pound hammer"
of coersion routines, a wrapper for Beans that allows the
simple querying, setting and getting of properties without all those

try/catch blocks, and a mechanism for configurable bean-like objects

-> A simple structured storage framework-in-progress

There's probably more. I use most of these things every day in my
commercial coding; I have found them very useful and the process
of cleaning them up for public inspection has made them even more
so. I suspect that process will only continue.

Enjoy.

--

Paul Reavis  [EMAIL PROTECTED]
Design Lead
Partner Software, Inc.http://www.partnersoft.com






Image scaling

1998-10-19 Thread Paul Reavis

Noticed something funny today - well, it would be funny, except I've
already wasted several hours on it.

Once upon a time, I was able to arbitrarily scale my Images when I
painted them with Graphics.drawImage(image, x, y, width, height,
observer). Now I'm finding that isn't so. 

The little snippet below illustrates this. It takes three arguments: an
image file name, a width and a height. Image not incuded, I'm afraid. I
recommend the following:

$ javac ImageScaling.java
$ file someimage.gif 
someimage.gif: GIF image data, version 89a, 400 x 400,
$ java ImageScaling someimage.gif 400 400

i.e., compile and try it with the normal image size arguments to prove
it works normally. Then try shrinking it:

$ java ImageScaling someimage.gif 200 200 
$ java ImageScaling someimage.gif 100 100
$ java ImageScaling someimage.gif 50 50
$ java ImageScaling someimage.gif 25 25

This should all work; at least it did for me.

Now try blowing it up:

$ java ImageScaling someimage.gif 800 800 
$ java ImageScaling someimage.gif 1600 1600 

For some reason, this doesn't work in general - the image isn't drawn at
all. I've had no success even just doubling both width and height.
Smaller images do seem to take longer to blow up, but I can't get
800x800 out of a 100x100 image.

I've ran back to 1.1.6, but my 1.1.5 and earlier were all libc5 and
don't work any more. This runs the same on all 1.1.6 as far as I can
tell.

So am I insane, or is this some new bug? The feature that depends on
this was working in our last version of our product; I just rewrote it
for swing and was reimplementing the feature under swing when I ran into
this all of a sudden. At first I thought it was Swing-related, but as
you can see I was able to demonstrate it using only AWT components.

- - - - - - - - - - - - - ->8 - - - - - - - - - - - - - - - - - 
import java.awt.Canvas;
import java.awt.Graphics;
import java.awt.Image;
import java.awt.Frame;

public class ImageScaling extends Canvas {
private Image image;
private int width, height;

public static void main(String[] argv) {
String imagename = argv[0];
int width = (new Integer(argv[1])).intValue();
int height = (new Integer(argv[2])).intValue();

ImageScaling scaler = new ImageScaling(imagename, width, height);
Frame framed = new Frame("Image Scaling example");
framed.add(scaler, "Center");
framed.setSize(640, 480);
framed.show();
}

public ImageScaling(String imagename, int width, int height) {
image = getToolkit().getImage(imagename);
this.width = width;
this.height = height;
}

public void paint(Graphics g) {
g.drawImage(image, 0, 0, width, height, this);
}

}

- - - - - - - - - - - - - ->8 - - - - - - - - - - - - - - - - - 
-- 

Paul Reavis  [EMAIL PROTECTED]
Design Lead
Partner Software, Inc.http://www.partnersoft.com



Re: Image scaling

1998-10-20 Thread Paul Reavis

Steffen Tacke wrote:
> 
> Well, some weeks ago i wrote a short report to this list, describing almost
> the same problem that you described. I designed a class, that dynamically
> scales an image to the actual frame size.
> Under Solaris and Windows this is absolutly no problem, even when i scale
> it very big.
> Under Linux (actual libc, jdk1.1.6v5 for libc) i can only resize the frame
> to a certain size (about 900x600). If i want to scale it bigger suddenly
> the image won't be repainted and scaled any more 

Thanks for the confirmation; at least I can ship it to my testers since
we deploy on Win95 :-(

I've submitted my post to Jitterbug; it's bug #233
-- 

Paul Reavis  [EMAIL PROTECTED]
Design Lead
Partner Software, Inc.http://www.partnersoft.com



Re: Is there a decent file explorer for Linux?

1998-10-26 Thread Paul Reavis

jim watson wrote:
> 
 I think the java-linux list is for technical issues about the port, but
Chi-Ming Yang has raised a question which relates to philosophies of 
java and linux.  Can there be a java window manager (Jwm) which will
live on any platform and bypass the window managers?
> "Write once run anywhere" imples there will always be lots of something else to run 
>in. Can someone advise a more appropriate place to read about this? I have looked at

There is the additional interest of things written in Java that aren't
necessarily intended to run just anywhere. For example, since Gnome is
corba-based, you could write Gnome apps in Java, or perhaps have a
cross-platform app that's Gnome-enabled when running with Gnome.
Eventually issues like these will outgrow the java-linux mailing list.

-- 

Paul Reavis  [EMAIL PROTECTED]
Design Lead
Partner Software, Inc.http://www.partnersoft.com



Re: Image scaling

1998-10-27 Thread Paul Reavis

Uncle George wrote:
> 
> i suppose this has something with the prob that i was having with drawImage of
> demo/molecule viewer.  At initialization time, a shared seg is created between the
> client & X server to communicate the images u wanna draw - BUT it is a fixed size,
> which is based upon ur first image. Guessing, from my experience, when the images
> grow larger, more space is needed, but just not reallocated between client & X
> server. Client says new size, server says No Way this image can fit in this shared
> space. X refuses to paint, and java ignores the error. User see's a blank screen :(

Kevin Hendricks (mailto:[EMAIL PROTECTED]) tells me they've fixed
my bug in the 1.1.7 source; the description he gave sounds much like
yours. 

Incidentally, for the rest of the list - response on that was
phenomenal. Kevin had checked my example code and responded within 30
minutes of my filing the bug report in Jitterbug, and there was a
solution in less than two days. Kudos galore; if Kevin or any other
porting members are ever in Athens GA I've got a beverage for ya.

-- 

Paul Reavis  [EMAIL PROTECTED]
Design Lead
Partner Software, Inc.http://www.partnersoft.com



Re: Low level disk access

1998-11-11 Thread Paul Reavis

Paul Reavis wrote:
> 
> Urban Widmark wrote:
> >
> >  ... but that would perhaps not be
> > low enough for you so how about:
> >   int fd = open("/dev/hda", O_RDONLY);
> >
> > and then:
> >   lseek()
> >   read()
> 
> Oh ho! That's the best idea so far! Why don't we just skip all this JNI
> nonsense and just open /dev/hda up as a java.io.RandomAccessFile?
> 
> I've just _got_ to try this... though probably on a ramdisk first :-)

Or a floppy... check out these apples:

- - - - - - - - - - - - - - - - - - - - - - - - - >8 - - - - - - - - - 
import java.io.*;

public class DirectAccess {

public static void main(String[] argv) {
try {
RandomAccessFile filet = new RandomAccessFile("/dev/fd0",
"rw");   
filet.writeChars("Look ma, no filesystem!\n");
filet.close();
}
   catch (IOException oopsie) {
oopsie.printStackTrace(System.err);
System.exit(1);
}

   }

}
- - - - - - - - - - - - - - - - - - - - - - - - - >8 - - - - - - - - - 

slackguy:/home/paul# java DirectAccess 
slackguy:/home/paul# dd if=/dev/fd0 bs=1 count=50
Look ma, no filesystem!
50+0 records in
50+0 records out

Though platform-specific, this would likely work on most unix platforms
(with different /dev/???, of course) and could be used with fixed-size
files even on less noble platforms - you could make a partition, build a
single file in it that takes up all space, and don't let it shrink and
you shouldn't have fragmentation problems.

And now we're all set to build java-based swap partitions, highly
tweaked data storage and retrieval, etc. It's not to be scoffed at - I
used RandomAccessFile and a simple binary-search mechanism on sorted
data to deliver a GIS-like map item search mechanism below 1 ms. search
time. Totally blew away the databases etc. I was trying at the time, and
is faster than the general search routines AutoCAD and ESRI provide.

-- 

Paul Reavis  [EMAIL PROTECTED]
Design Lead
Partner Software, Inc.http://www.partnersoft.com



Re: Low level disk access

1998-11-11 Thread Paul Reavis

Urban Widmark wrote:
> 
>  ... but that would perhaps not be
> low enough for you so how about:
>   int fd = open("/dev/hda", O_RDONLY);
> 
> and then:
>   lseek()
>   read()

Oh ho! That's the best idea so far! Why don't we just skip all this JNI
nonsense and just open /dev/hda up as a java.io.RandomAccessFile? 

I've just _got_ to try this... though probably on a ramdisk first :-)

Gee I love linux...

-- 

Paul Reavis  [EMAIL PROTECTED]
Design Lead
Partner Software, Inc.http://www.partnersoft.com



NPE using Swing

1998-05-15 Thread Paul Reavis

I've been stuck at 1.1.3 for awhile; these 1.1.5s haven't been working
for me at work. (At work, we use Debian 1.3.1 (libc5); at home I use
Debian 2.0b (glibc); home everything is fine).

Anyway, with 1.1.5v7, I get:

Exception occurred during event dispatching:
java.lang.NullPointerException:
at sun.awt.motif.X11Graphics.drawImage(X11Graphics.java:275)
at
com.sun.java.swing.SwingGraphics.drawImage(SwingGraphics.java:271)
at com.PartnerSoft.gui.ImageCanvas.paint(ImageCanvas.java:57)
at
com.sun.java.swing.JComponent.paintChildren(JComponent.java:382)
at com.sun.java.swing.JComponent.paint(JComponent.java:537)
at
com.sun.java.swing.JComponent.paintChildren(JComponent.java:382)
at com.sun.java.swing.JComponent.paint(JComponent.java:537)
at com.sun.java.swing.JLayeredPane.paint(JLayeredPane.java:555)
at
com.sun.java.swing.JComponent.paintChildren(JComponent.java:382)
at com.sun.java.swing.JComponent.paint(JComponent.java:522)
at java.awt.Container.paint(Container.java:702)
at java.awt.Component.dispatchEventImpl(Component.java:1723)
at java.awt.Container.dispatchEventImpl(Container.java:939)
at java.awt.Window.dispatchEventImpl(Window.java:443)
at java.awt.Component.dispatchEvent(Component.java:1704)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:63)

I'm currently trying to track down a small case I can send y'all that
causes this; it's happening in the map browsing portion of our app. A
visual clue: some of the controls (a JButton, and a JTextField) aren't
drawn at all.

Just thought you might be able to sort it out from the dump; dunno.
Here's the output of ldconfig -v in case that helps:


ldconfig: version 1.9.5
/usr/local/lib:
/usr/lib/libc5-compat:
/lib/libc5-compat:
/usr/X11R6/lib:
libIm.so.0 => libIm.so.0.11
libXpm.so.4 => libXpm.so.4.7
libMagick.so.3.8 => libMagick.so.3.8.2
libXtst.so.6 => libXtst.so.6.1
libXt.so.6 => libXt.so.6.0
libXmu.so.6 => libXmu.so.6.0
libXi.so.6 => libXi.so.6.0
libXext.so.6 => libXext.so.6.3
libXaw.so.6 => libXaw.so.6.1
libXIE.so.6 => libXIE.so.6.0
libX11.so.6 => libX11.so.6.1
libPEX5.so.6 => libPEX5.so.6.0
libICE.so.6 => libICE.so.6.3
libXp.so.6 => libXp.so.6.2
libSM.so.6 => libSM.so.6.0
/usr/lib:
libtcl7.4.so.1 => libtcl7.4.so.1
libdf.so.4.0 => libdf.so.4.0.2
libvgagl.so.1 => libvgagl.so.1.2.10
libvga.so.1 => libvga.so.1.2.10
libtiff.so.3 => libtiff.so.3.4.035
libpaper.so.1 => libpaper.so.1.0.2
libtcl7.6.so.1 => libtcl7.6.so.1
libtk4.2.so.1 => libtk4.2.so.1
libslang.so.0.99.34 => libslang.so.0.99.38
libz.so.1 => libz.so.1.0.4
libcompface.so.1 => libcompface.so.1.0.0
libtk4.1.so.1 => libtk4.1.so.1
libjpeg.so.6a => libjpeg.so.6a.0.0
libpng.so.1 => libpng.so.1.0.89c
libextcli_Xt.so.1.0 => libextcli_Xt.so.1.0
libextcli_Xm.so.1.0 => libextcli_Xm.so.1.0
libextcli_Xlib.so.1.0 => libextcli_Xlib.so.1.0
libtcl7.5.so.1 => libtcl7.5.so.1
libstdc++.so.27 => libstdc++.so.27.2.1
libg++.so.27 => libg++.so.27.2.1
libopcodes.so.2.7.0.9 => libopcodes.so.2.7.0.9
libbfd.so.2.7.0.9 => libbfd.so.2.7.0.9
libmh.so.3.2 => libmh.so.3.2
libgdbm.so.1 => libgdbm.so.1.7.3
libdb.so.1 => libdb.so.1.85.4
libhistory.so.2 => libhistory.so.2.1
libpanel.so.3.0 => libpanel.so.3.0
libmenu.so.3.0 => libmenu.so.3.0
libform.so.3.0 => libform.so.3.0
libgnumalloc.so.5 => libgnumalloc.so.5.4.33
/lib:
ld-linux.so.1 => ld-linux.so.1.9.5
libproc.so.1.12 => libproc.so.1.12
libuuid.so.1 => libuuid.so.1.1
libe2p.so.2 => libe2p.so.2.3
libext2fs.so.2 => libext2fs.so.2.3
libss.so.2 => libss.so.2.0
libcom_err.so.2 => libcom_err.so.2.0
libreadline.so.2 => libreadline.so.2.1
libncurses.so.3.0 => libncurses.so.3.0
libm.so.5 => libm.so.5.0.9
libc.so.5 => libc.so.5.4.44
libdl.so.1 => libdl.so.1.9.5
ld-linux.so.1.8.12 => ld-linux.so.1.8.12

--

Paul Reavis  [EMAIL PROTECTED]
Design Lead
Partner Software, Inc.http://www.partnersoft.com






Re: java.awt.Printjob

1998-07-02 Thread Paul Reavis

Reinhard Simon wrote:
> 
> I want to print a Canvas with a picture (gif) directly from a frame.
> So I use a Printjob, but it does not work on both of my linux-systems.
> After the frame Print Dialog, I get a frame "Print Error" with
> the message : Could not execute pring command (L_java.lang.String...)
> If I write the output to a file and pipe it into lpr it works, but it
> is no solution.

I can't help you much with java-linux printing, but some general
java-printing advice: don't beat it too hard, since it's pretty broken.

We dumped direct printing from our product since under Win32 JDK (our
usual deployment platform) it tended to crash the application completely
about 1/2 the time. In general, it was a real pain to code too...

Now, we take snapshots, dump them as PNG images (better JDK native
support through zlib than gif), spit out some HTML that references them,
and launch Netscape. This has worked really well. It sounds roundabout,
but has given us more flexibility in the long run - the HTML template is
stored in configuration files and can be different for each of our
customers.

Fixing printing is high on the list at Sun's bug parade; I suspect 1.2
will address this. But under 1.1 it is one of the, shall we say, less
mature bits of the java core API.

-- 

Paul Reavis  [EMAIL PROTECTED]
Design Lead
Partner Software, Inc.http://www.partnersoft.com



Re: java.awt.Printjob

1998-07-02 Thread Paul Reavis

Gary Mart (GAM22) admin0 wrote:
> 
> On Thu, 2 Jul 1998, Paul Reavis wrote:
> 
> > Reinhard Simon wrote:
> > >
> > > I want to print a Canvas with a picture (gif) directly from a frame.
> <--snip
> >
> > Now, we take snapshots, dump them as PNG images (better JDK native
> > support through zlib than gif), spit out some HTML that references them,
> <--snip-->
>
> Cold you spare a few more details on how you are producing PNG images?
> PNG image export is high on Sun's bug list and I have tried the 3rd
> party Gif encoders but they were VERY SLOW (I though my program had
> crashed).

GIF encoding is VERY SLOW; we wrote our own and it was pretty stinky.
(My coworker, Brad Gray, actually did all this; I don't like to get my
hands dirty with bits these days :-)).

The problem seems to be that GIF encoding hits Java where it's slowest.
Without native support it's hard to get it very fast. Not to mention the
illegalities :-)

So we dumped it and switched to PNG, since Netscape 4.05 supported it
(we just bundle Netscape with our product now that it's free; this keeps
us from worrying about formatting for different weird browsers).

PNG is much better suited to awt-style images; the color model is very
similar (4 byte RGBA is one option), you don't have to reduce the colors
to 256 (yuck!), etc. But the real bonus is that it uses zlib
compression, which is provided (presumably with native implementation)
in java.util.zip or whatever. Compressing those babies is very very fast
(as in ~5 mins for GIF, ~5 seconds for PNG compression) and we are real
happy with Brad's encoder.

I think there are some free PNG compressors out there for Java; if not
writing your own is not too hard (assuming some experience with binary
formats). The hardest part of these things is the compression, and all
that's handled for you - you basically just have to name the chunks
right, put things in the right order and feed the compression method.

Our encoder isn't on my pile of things to clean up and LGPL, I'm afraid,
so I can't give it to you :-< But really, finding one or even writing
one shouldn't be too hard. One thing that made it easy for us (and
therefore not as suitable for public release) is that we only
implemented what we absolutely had to - no special features or anything,
just a quick image dump.

-- 

Paul Reavis  [EMAIL PROTECTED]
Design Lead
Partner Software, Inc.http://www.partnersoft.com



Debian Java howto

1998-05-20 Thread Paul Reavis

I'd like to volunteer to start and maintain some documentation on
installing and running the java JDK port under Debian. Primary focus
would be on latest releases (i.e. those that haven't become debian
packages yet), library issues etc. We do all our java development under
Debian linux here, and I'd really like for there to be a little more
info about installation issues.

Any contributions would be greatly appreciated.

--

Paul Reavis  [EMAIL PROTECTED]
Design Lead
Partner Software, Inc.http://www.partnersoft.com






Re: Debian Java howto

1998-05-20 Thread Paul Reavis

Alexander Davydenko wrote:

> Paul Reavis wrote:
>
> > I'd like to volunteer to start and maintain some documentation on
> > installing and running the java JDK port under Debian.
>
> May it be prefere to maintain a .deb package?

There is already a maintainer, I believe, but release issues and time
make it hard to keep the .deb up with the absolute most current
JDK release.

For example, apparently the 1.1.5v7 release requires a version of glibc
that is in the debian "unstable" distribution set; this would prevent
people only running stable (bo) or frozen (hamm) from using it easily.
1.1.1 comes with hamm, but I want the latest and greatest, so I need to
figure out all these library issues.

--

Paul Reavis  [EMAIL PROTECTED]
Design Lead
Partner Software, Inc.http://www.partnersoft.com






Re: Linux/Java/KDE

1998-07-21 Thread Paul Reavis

J.S. Willans wrote:
> 
> Are there any plans to port java so that it uses the KDE toolkit
> (http://www.kde.org)?

The JCL project (http://www.oryxsoft.com/projects/jcl/) is working on an
open-source replacement for the java.* (including awt) stuff that is
based on I believe GTK. KDE uses Qt as its visual toolkit; there are
some licensing issues with that. 

Porting to either from the original Motif stuff is a significant effort.



My evaluation of IBM's Jikes compiler

1998-07-22 Thread Paul Reavis

Today I evaluated IBM's Jikes compiler. It is a replacement
for javac written from scratch in C++. It currently
lives at http://www.alphaWorks.ibm.com/. They just released
a Linux version, and since I develop entirely in Linux, I
thought I'd give it a whirl. Currently it is free for
any use, but considered alpha (or beta or whatever). They
may charge in the future, apparently. Source code was not
available :-(

The compiler is apparently a strict implementation to the 
JVM specification and Java Language Specification. The 
release notes are pretty adamant about that. Kudos for that.

I use a custom build system that compiles and jars the
source while enforcing explicit dependency instructions
between packages. It typically compiles one or more packages
at once, then collects them into a single jar, then
does the same for some more sets of packages. Once it has
compiled a few, depending on the ruleset, it may collect
some subjars to make larger ones. This is all just so
you know that the jar tool gets called a fair amount -
jikes and javac aren't the only things being run.

To test, I compiled two code bases twice for each tool.
The only change I made to the build scripts was replacing
"/usr/local/jdk/bin/javac" with "/usr/local/bin/jikes +E"
(+E gives emacs-friendly error messages). 

Useability-wise, jikes is very nice. It has options for different
output formats; the +E allows emacs and such to parse the output so
you can click to go to the correct line of source in the correct file.
It seems to give better error messages than javac. 

Note that I know the error message format - this is because I got
several I had never seen before. Jikes is pickier. I had to append
"L" to a few long literals. I had to remove the "$" from some
identifiers in a 3rd-party tool (these are disallowed in 1.1, but
were valid under 1.0 - javac accepts them; jikes will too with a
switch that allows 1.0 code). It also didn't like
one instance where I used an import like "this.that.*" - it 
wasn't able to find the .java files to compile; putting in
class-specific import statements fixed that. After I got it
to compile in jikes without error, I did the timing runs;
none of the changes broke javac compilation.

Also, my build
system enforces dependencies by limiting the classpath to
those jars that a given package is supposed to depend on - jikes
complained in instances where javac didn't. This was where
a class wasn't directly referenced (i.e., no variables were
declared of that type, casts made, etc.) but was accessed
in some fashion, or was part of a method signature that the 
code called, even though it wasn't used (e.g. null was passed
rather than a variable of the type).

Some of these things might be peculiar to my build system;
your mileage may vary. I'm not really annoyed by it - in
each case, Jikes seems to be correct, just less lenient
than javac. Since my code is the only area of my life I'm
anal-retentive about, this is OK by me.

Jikes is supposed to do incremental compiling, but this is
apparently disabled at present. The design for it is
very nice, and well-suited for use by other tools.

The main thing I was impressed by was its speed. Below are
the timing runs. Keep in mind that I'm not using a JIT,
and since javac is AFAIK 100% java, it's having to run
interpreted. Also keep in mind that a fair amount of
"jarring" going on - this should skew the results back into
javac's favor, since it is only directly competing
for a portion of the total run time.

Atlanta Java Consortium reuseables (172 classes)

Javac run 1:
real2m16.450s
user1m40.940s
sys 0m8.920s

Javac run 2:
real2m2.959s
user1m40.360s
sys 0m7.700s

Jikes run 1:
real0m32.548s
user0m16.870s
sys 0m5.110s

Jikes run 2:
real0m38.575s
user0m17.080s
sys 0m5.250s

Partner Software stable (631 classes)

Javac run 1:
real5m1.667s
user3m58.320s
sys 0m12.580s

Javac run 2:
real4m34.586s
user3m56.400s
sys 0m11.330s

Jikes run 1:
real1m16.133s
user0m40.160s
sys 0m7.230s

Jikes run 2:
real1m7.439s
user0m40.590s
sys 0m7.720s

As far as I can tell in this short a time, the code is working
correctly. 
I ran the reuseables test suite without error, and have done
some basic testing of our product software. I'll probably
use jikes full-time for awhile and see how it does as
far as correctness, but initial indications are very good.

Note the long list of addressees, including the Jikes authors; you might
want to reduce this in any replies. Thanks.

-- 

Paul Reavis  [EMAIL PROTECTED]
Design Lead
Partner Software, Inc.http://www.partnersoft.com



Environment variables

1998-07-22 Thread Paul Reavis

So I tried to access an environment variable for the first time today;
no soap. Since System.getenv() is deprecated, I used
System.getProperty(). I couldn't get it to fetch my variable with what I
thought was the correct way:

bash$ export foo=bar
bash$ java myapp

However I can get it with:

bash$ java -Dfoo=bar myapp

What am I doing wrong here?

-- 

Paul Reavis  [EMAIL PROTECTED]
Design Lead
Partner Software, Inc.http://www.partnersoft.com



Re: Environment variables

1998-07-22 Thread Paul Reavis

Vincent Trussart wrote:
> 
> System properties != environment variables...

Blurgle... oh well, I guess environment variables are too nonportable
or something. Well, time to put in a real syntax for command-line
switches for the thing- -DBLAH=GRALP is not something I want to type all
the time.

-- 

Paul Reavis  [EMAIL PROTECTED]
Design Lead
Partner Software, Inc.http://www.partnersoft.com



Slow image draws

1998-07-24 Thread Paul Reavis

I'm converting my app to Swing. Part of it involves display of large,
tiled images, and I'm seeing enormous performance differences between
Linux and win32 while doing it, more than I would reasonably attribute
to the win32 JIT (especially since I believe, correct me if I'm wrong,
that gif decoding is a native function of the JDK).

Under win32, things run very quickly and smoothly. Under Linux the
images load much more slowly. I'm trying to profile it and see if
anything is getting in the way of the load/paint cycle. So I spit out
bread crumbs every time the paint() command is called. Sometimes it
seems to just pause entirely - the breadcrumbs stop, then restart when I
move my mouse. I do have some things attached as MouseMotionListeners.
Perhaps there's some strange thread dynamics going on?

All this is under 1.1.6v2 glibc on Debian 2.0.

Any ideas? Getting an smaller example together would be some work, but
might be worth it if I can track down the root cause.

-- 

Paul Reavis  [EMAIL PROTECTED]
Design Lead
Partner Software, Inc.http://www.partnersoft.com



Re: Slow image draws

1998-07-24 Thread Paul Reavis

Paul Reavis wrote:
> 
> Sometimes it
> seems to just pause entirely - the breadcrumbs stop, then restart when I
> move my mouse. I do have some things attached as MouseMotionListeners.
> Perhaps there's some strange thread dynamics going on?

Update: I disabled all MouseListeners and MouseMotionListeners on the
display panel; AFAIK no mouse events are being intercepted by my app. It
still pauses occasionally, and moving the mouse starts it up again.

Sigh.

-- 

Paul Reavis  [EMAIL PROTECTED]
Design Lead
Partner Software, Inc.http://www.partnersoft.com



Re: Slow image draws

1998-07-24 Thread Paul Reavis

Vincent Trussart wrote:
> 
> Paul Reavis wrote:
> 
> Sometimes it
> > seems to just pause entirely - the breadcrumbs stop, then restart when I
> > move my mouse. I do have some things attached as MouseMotionListeners.
> > Perhaps there's some strange thread dynamics going on?
> >
> 
> This behavior can be reproduced when running the caffeine mark 3.0
> (www.webfayre.com, I think)
> 
> In the "Graphics" test, it will pause a little from time to time. A way to
> make it resume its test is to move the mouse a little.
> 
> I'm using jdk1.1.6v2 libc5 on x86-glibc (the glibc version won't handle
> all latin1 characters for me..)

This sounds like the same problem to me. I gave it a try - for some
reason "Run All Tests" gives a score of zero for images, but "Run All
Tests Locally" does not. Howcum? 

Thanks for finding another example; I was struggling with writing
something to show it off-

-- 

Paul Reavis  [EMAIL PROTECTED]
Design Lead
Partner Software, Inc.http://www.partnersoft.com



Re: Slow image draws

1998-07-24 Thread Paul Reavis

Dmitry Malykhanov wrote:
> 
> Hmm, I'm not expert in swing. Actually I'm just playing with swing-0.7
> (very old distribution, right?). Mostly running examples and trying to
> modify them. But today I download swing-1.0.3 and found following feature.
> Image output speed during image loading (in SwingSet example, ScrollePane
> component) is *extremely* slow even when I using TYA JIT compiler. After
> image had decoded everything works fine with usual speed. So, I'm a bit
> confused with this "feature" too.

I crufted up an example; I tested it under Swing 1.0.2 (didn't even know
1.0.3 was out...) 

http://www.partnersoft.com/~reavis/java/SlowImageLoadExample.zip

The results are interesting. Here's the readme:

This here is an example of my problem with Swing image loading under the
linux-jdk.
It seems to manifest at its worst when drawing lots of images, so I
provided
one image and a little perl scriptie that makes about 30 hard links to
it; this
hopefully fools the java runtime into thinking they are separate image
files.

Compile the two files - AWTImageLoad.java and SwingImageLoad.java.
Notice that
the only difference between them is that the AWT one uses a Canvas for 
the drawing and the Swing one uses a JPanel. I also turned off
double-buffering
on the swing one (this doesn't seem to affect the bug, but presumeably
makes
things more egalitarian). 

Run them. I'm assuming you have the compiled classes in your classpath
somewhere:

java AWTImageLoad *.gif
java SwingImageLoad *.gif

Don't touch the mouse during the runs. Watch the repaint counter - 
the AWT one finishes in less than 100 repaints on my machine, and
never hangs. The Swing one takes several _thousand_ repaints, and
hangs frequently - once at about 340; once at around 760; etc. Moving
the mouse or hitting a key starts it painting again. 
Regardless, it takes forever to complete.

So the big question is: is this a Swing bug, or a Java-Linux bug? I
don't
see this behavior under Win32, which is why I'm pestering java-linux.

-- 

Paul Reavis  [EMAIL PROTECTED]
Design Lead
Partner Software, Inc.http://www.partnersoft.com



Re: [Q] JDK's on CD ROM

1998-08-03 Thread Paul Reavis

[EMAIL PROTECTED] wrote:
> 
> Just a quickie: Can you get the latest blackdown JDK on any of the CD ROM  Linux  
>distribution?

I know that Debian 2.0 includes one (1.1.5v5) in their non-free section
(non-free since no source code). Debian unstable (2.1) has more recent
ones as well; you can pull them down manually and install them or run an
"unstable" 2.1 system (oh, gee, it seems to have a bug or two :-)

I generally like to have the most recent jdk ports, so for the Debian
2.0 machines at work I just pull down the glibc jdk from the blackdown
mirrors, unpack into /usr/local/jdk*, and go. My home system is 2.1,
which works fine but isn't for beginners.

-- 

Paul Reavis  [EMAIL PROTECTED]
Design Lead
Partner Software, Inc.http://www.partnersoft.com



java-linux article

1998-08-03 Thread Paul Reavis

Those interested might take a look at my article on java under linux
at:

http://www.wandering-man.com/Java/August/Java-Linux/javalinux.html

It's a bit spare in spots, since it's essentially an expansion of
a presentation I made to the Atlanta Java Users Group (where I did
a fair amount of extemporaneous hand-waving and live demo using my
home system). Focus is on Linux, for those familiar with Java. The
meeting
went well; out of an audience of 30+ I've already (3 weeks) gotten three
emails from
folks who have already installed a version of linux and one from
someone who says they will soon.

Any feedback is much appreciated; I haven't decided the final fate of
this thing but I need to rewrite it from the other angle to present
Java for Linux enthusiasts.

-- 

Paul Reavis  [EMAIL PROTECTED]
Design Lead
Partner Software, Inc.http://www.partnersoft.com



World of Beverage back up

1998-08-07 Thread Paul Reavis

Well, at long last my website, domain and personal email addresses are
back online. To be specific:

[EMAIL PROTECTED]
=> That's me

http://tumu.home.mindspring.com
=> The main URL until I make enough $$ for full domain aliasing

http://tumu.home.mindspring.com/ajug/index.html
=> Atlanta Java Users Group presentations of mine

http://tumu.home.mindspring.com/java/jcon/index.html
=> Atlanta Java Consortium page and reuseables library

http://tumu.home.mindspring.com/java/Debian-JDK.html
=> Using the JDK under Debian GNU/Linux

Some things have gotten a bit musty in the interim; I'll be updating
and sweeping out cobwebs this weekend, while adding new, even sillier
graphics.

Sorry for the inconvenience (or for this annoying message if you didn't
care). As for the cause of the mess, let's just say that accountant time
and Internet time run at totally different speeds.

-- 

Paul Reavis  [EMAIL PROTECTED]
Design Lead
Partner Software, Inc.http://www.partnersoft.com