Chip Gobs

Greenhorn
+ Follow
since Feb 15, 2001
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Chip Gobs

My work has X Windows applications written in C and Java applications (on the same machines) that are installed throughout the US. When we want to see how everything is working for a customer, we often export their display to our Linux boxes. While exporting the display it is noticeably slower than running locally for the C applications, it is still tolerable. The Java applications are so slow that I rarely make the attempt.

The Java windows that are the worst are those that have a lot of custom graphics. The others are still slow, but not as bad. Is there something I can change to repaint the screen less often and thereby send less data across the network for the display? I would expect that to speed up the
responsiveness. If there is anything else I can do, please let me know.

Thanks,

Chip
19 years ago
Oliver,
Actually there should be an error. Private means that B can't access (use one of A's methods or attributes). If you still think you are
correct, please show us an example of what it means to be private.
Book Worm,
I tried your example and it runs as you say (without error) on my machine.
Maybe the spec says the VM doesn't have to check for access rights at runtime, only at compile time? This is a little surprising to me, but
not that big a deal.
BTW, this has nothing to do with inheritance.
Chip
21 years ago
I can't get the ResultSet.getTimestamp(int, Calendar) method to do what I
expect it to do. I expect the time in the database (which is stored
without any timezone info, but is intended to be in UTC) to be reflected
in the following code fragment. Unfortunately, it seems as if adding the
Calendar argument is doing the same thing as the
ResultSet.getTimestamp(int) method. It is reading the time from the
database and making it my local time instead of UTC. So it ends up 4 or 5
hours off (depending on time of year).
Example:
The time in the database is 2003-08-04 03:00:00 UTC, but it
comes back as 2003-08-04 03:00:00 EDT.

I am using the Informix jdbc driver: com.informix.jdbc.IfxDriver

Am I missing something, or is this a known problem?
I have a workaround, which is to get the Timestamp as a String and parse it
using SimpleDateFormat. I haven't checked the Daylight Saving Time extremes, yet though. I have other workarounds, but I don't want to have to
use them.
See the following code fragment to see what I am talking about.

//-----------------------------------------------------------------------
TimeZone utcTimeZone = TimeZone.getTimeZone("UTC");
Calendar utcCalendar = new GregorianCalendar(utcTimeZone);
// note: column 6 is of type "datetime year to second"
// new way
Timestamp ts1 = rs.getTimestamp(6, utcCalendar);
// old way
//Timestamp ts1 = rs.getTimestamp(6);
SimpleDateFormat utcSdf = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
utcSdf.setTimeZone(utcTimeZone);

System.out.println("time = " + utcSdf.format(ts1.getTime());

//-----------------------------------------------------------------------
Thanks,
Chip
Is there any standard JMS way of configuring my JMS provider? For example, I want to create queues (my book says that QueueSession.createQueue() is not portable), and assign the number of threads available for various aspects of the messaging.
Are there any proposals out there to standardize this sort of thing?
Chip Gobs

My JMenuItems off of my main menu bar sometimes appear BEHIND components in the Frame's contentPane. I've only noticed this happening with a subclass of java.awt.Canvas in which I am displaying an image.
Does anyone have an idea about what property I need to set to keep this from happening?
Thanks,
Chip
23 years ago

How many of you out there have used applets in a serious project? Do you recommend it? What sorts of problems have you encountered as a result of choosing developing an applet over an application? Or vice-versa? (I am involved in a project where the applet vs. application decision needs to be made.)

Thanks,
Chip
23 years ago

I am about to do some work with entity beans and would like to know if most real-world implementations have an entity bean for each row in a database table, or if they map an entity bean to rows in multiple tables.
If the former, then do you use session beans to manage parent- child db relationships?
Thanks,
Chip
What I would like to do is to be able to serialize things and
be able to edit the serialized file by hand and not have to
write custom code for the serialization. That would be ideal.
Right now, when I want to be able to edit the serialized class, I write my own methods for serializing to a nice text file, which
has the distinct disadvantage of taking time away from developing the business aspect of the classes.
Chip
23 years ago

Is anyone out there aware of a utility that will convert a file of serialized java objects to and from a human readable and editable format? If the format were XML, it would be nice, but it is not necessary.

thanks,
Chip
23 years ago
Yes. After I realized that I wanted XML, I looked around some on the web. There appear to be some Java Serialization using XML libraries out in the world. One is called JSX.
What I would really like is if Sun would package something like that as part of the JDK, as XMLObjectOutputStream and XMLObjectInputStream (or something like that).
I would like to be able to use this in commercial code without a whole bunch of disclaimers, etc, so using GNU stuff probably is not going to happen.
Chip
23 years ago

I realized that the human readable format might as well be XML,
in case that rings any bells for anyone.
Chip
23 years ago
A utility that can translate from a file created using
FileOutputStream and ObjectOutputStream into some human readable and editable format would be good enough too.
Of course, it would need to be translated back, too.
Chip
23 years ago
I would like to be able to serialize objects to a human-readable and editable format.
For example the following class
-----------------------------
package com.blah.testing;
public class Test implements java.io.Serializable
{
private String name;
private int countOfSomething;
...
}
-------------------------------

might look like the following when serialized to a file
------------------------------
begin
type=com.blah.testing.Test
begin
type=java.lang.String;
fieldName=name;
fieldValue="John Doe";
end
begin
type=int;
fieldName=countOfSomething;
fieldValue=17;
end
end
------------------------------
Is anyone aware of something like a ObjectInputTextStream or an ObjectOutputTextStream that could read and write objects from and to a nice readable format like the above format?
If not, do you have suggestions on how to write classes to implement the above streams?
Thanks,
Chip

23 years ago