Chetan Graham

Greenhorn
+ Follow
since Dec 01, 2007
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Chetan Graham

Text deleted. Do not want to waste others time with my confused code.
Thankyou.
Chetanji
[ April 10, 2008: Message edited by: Chetan Graham ]
15 years ago
To All,
I am still working night and day on this applet.
I have finally received news from the big boss that this applet's problem in loading is not the twenty versions of java and different OS's on all the different workstations like he originally brought up.

He now agrees with my first statement to him that this applet is so poorly written and upon loading goes into an endless loops.

It is the whole applet that needs to be rewritten and this is what I am now understanding. The six draw tools with the saving and retrieving the xml files to the database has to be completely redone.

Every time I polish one of the draw tools to perform better or fix a bug in a tool, more cracks appear in the plaster wall of the platform.

The concept of rewrite the fundamental platform or just polish the poor code is not new by any means.

I realize this is quite the undertaking and pray I am up to it.

Here is one error I receive on loading the applet on my workstation many times. If I just click inside the applet window it begins working and the error message is a thing of the past. It comes and goes. There is no xml file to load, no network to deal with, just this hard drive, eclipse, java and physical mem called on.






[ April 04, 2008: Message edited by: Chetan Graham ]
15 years ago

Originally posted by Ernest Friedman-Hill:
"The DataBase with the XML files has to be accessed".

There's an important place to look. Database transactions can be slow, whether you're really talking to a remote database directly from an applet, or if there's a middle tier on the server that's talking to the database, and then the applet is talking to that middle tier.

The stuff you say about "all the different kinds of Java" and that this somehow causes a lot of hunting around for versions of classes doesn't make any sense, nor is it anything you need to worry about.

In any case, blindly making small changes isn't going to help, nor is changing from Swing to AWT. The only thing that will help is study and measurement. If you need to speed things up, then you need to find out where the time goes.



Thanks for you replies. I'm still trying to get access to the server on one system to test. I will focus on the Study and Measurement.
I wonder if Thread tracking is an obvious choice in measurement. Perhaps I need to introduce another thread for getting over the init period or loading period.
16 years ago

Originally posted by Ulf Dittmer:
The imports you list above are all part of the JRE - they don't need to be downloaded, and thus won't prolong the download/startup time. Are you using 3rd party libraries that do need to be downloaded? Or other resources like images or data files?



I realized that this applet is written using Swing and AWT. It has been brought to my attention that this causes many problems and that in general since Swing sits on top of AWT that there should be a clear separation of coding while using Swing.

Also AWT is thread safe and Swing is not so one must be careful to use the event handler properly.
I am finding this program has had many different minded programmers write different parts and there is a certain confusion.
I am looking seriously at rewriting the whole thing properly. Yet this seems almost more than my ability can handle.
Changing the AWT to Swing may be a simpler or less time consuming way.
Simply adding another thread during the "init" to help the GUI come up faster may help.
So much to consider and yet I feel I am not ready to make a major change as yet. So I am plodding along making small improvements to the tools and fixing bugs.
16 years ago

Originally posted by Ulf Dittmer:
The imports you list above are all part of the JRE - they don't need to be downloaded, and thus won't prolong the download/startup time. Are you using 3rd party libraries that do need to be downloaded? Or other resources like images or data files?



Please remember that of the close to 5000 different workstations and machines it is not possible to have the same versions of Java or the VM on the client side.

The image is part of the 300KB. The DataBase with the XML files has to be accessed. These are small files, like the basic patient information to label the annotation.

Thanks for your help.
[ March 09, 2008: Message edited by: Chetan Graham ]
16 years ago
Here are most of the imports...


The applet file size is approximately 302KB this does not include the java class files that need to be downloaded as well.

I would think this is big enough to slow somewhat but certainly not the 5 minute wait.

Thanks,
Chetan
16 years ago

Originally posted by Ernest Friedman-Hill:
The first thing I'd do is track down the total size of the applet download. If it's a huge amount of code, perhaps there's a way to cut it back.


It is not huge but it is enough to cause some time loss, perhaps. I will get the exact size. And it has already been cleaned up some, with other code add ons too, like adding color choices to the palette.


If it's not the download, then find out what's going on while that progress bar is ticking along. What work is being done? Perhaps there's a way to do it faster.



This will take time to get access to the server. I am in that process now as we are very busy with other affairs and my small project is important but not to get in the way of other more pertinent projects.
Bear with me, I will get back with the next update. Chetan signing out and thanks!


[ March 08, 2008: Message edited by: Chetan Graham ]
16 years ago
Thanks Gregg for your reply,

1)The idea of PHP/javascript/HTML is not web based but on the server(s) hosting close to 5000 pc's and medical related machines within the hospital complex.

2)It is slow for every station we have looked at, which is a very small percentage of the total # involved.

3) The applet starts, simply from the click on the patients form holding the Image the doctor wants to Annotate. At this point the "ProgressBarDialog.java file loads and the progress bar just sits, ..... and sits,.......and sits.......

You get the idea. When it finally loads all is well, and the XML is saved properly.
However, if the doctor has an interruption and he minimizes the applet he/she may forget it is in use later and if they click on the patient's form again here we go again with the nightmare loading for 5 minutes or longer.

Hence, the doctors don't use it. Doctors have to take classes to learn how to use the Hospital software before they can even practice in the hospital.
So when a piece of software takes too long to load it is not used.

I'm sure anybody writing code professionally experiences the same thing.
This project got pitched to me because it has cost a lot of time already and the quality programmers have more productive things to do.
I enjoy trouble shooting systems, and this has all the earmarks of an involved, deep joyride into frustration and final completion.
16 years ago
Thanks to All!

This client side java applet starts by the doctor clicking on an anatomy image (70-80k)within the patients file that is in the large Hospital software that can handle upwards of 5000 doctors and nurses and xray machines, etc at any time.
The ImageAnnotation software simply allows the doctor to edit the simple anatomy image with the patients problem, by using lines, arrows, text, circle, rectangle and polygon. It saves the Annotated Image in XML, with dicom standards in place. No more than 5000 lines of code.
I can tell you this, there are no doubt many different versions of java between all the different pc's in use on the Hospital's software. So when the applet begins loading it no doubt trying to find all the correct classes, etc.

Is client side applets within a large software project a bad idea?
Would javascript with PHP and XML with HTML be the way to go. I know it will be much faster right off.
But is this Client side java applets simply a mistake?

We have one other applet a microphone recorder for the doctor and it loads quickly, never a problem. It is a small program too.

Thanks.
16 years ago
Thank you
Ernest Friedman-Hill
and Campbell Ritchie
for your help and replys.

I very much appreciate both of your open willingness to help someone obviously new to a language so rich and diverse as Java; a true 'programmers' language.

Probobly the main reason I am using Downey's book over so many others is how much I relate to his style of writing and simple manner of dispatching the information. I rarely feel overwhelmed. And he seems to build one lesson on another so all you have to do if stumped is look harder at what was written in the last lesson as an example.

However, I am moving into a SOFIA, Hibernate, Beans, MySQL, JSP framework where the company is developing large user base programs that can affect thousands of users simultaneously, spread over different locations and this indeed can be a bit overwhelming when I look at my simple lessons compared to the code these amazing Java Coders have beautifully crafted in my office.

I guess it all takes time. Thanks again.
Chetanji
16 years ago

By the way, why have you made all the methods static? A much more Java-like way to write this class would have many the methods be instance methods and operate directly on the object itself:

code:



[Chetan writes:]
I am a beginner with OOP and Java and am just following the examples in the above mentioned document written by a University Professor. He said in the beginning he will bring things along slowly and by the end of the document you will have a decent awareness of quality Java coding.
I am only just beginning the Object making part of it now. I am not even half way through the lessons.
I much appreciate your help and will adopt your lesson.
Thank you
Chetanji
16 years ago
Please change the code to this. This does nothing but retain the 'int'.
I am searching for the way to make this method turn the rational to a Double.

16 years ago
To All,
I just wanted to add that I have tried adding a fourth 'double constructor' that uses numerator and denominator instead of the int objects 'num' and 'denom'.
I found that it just made things more complicated.
I know there is a simple way to do this. I am just bouncing off the wall that is barring my way forward.
Any help is much appreciated. I am excited about moving on to the more serious OOP programming. I know it's one step at a time though.
Chetanji
16 years ago
www.greenteapress.com/thinkapjava/thinkapjava.pdf

This free, excellent book on learning Java from the ground up is well worth your time.
The author writes,"The fourth edition is tailored to help students prepare for the Computer Science AP Exam,"
Book Title "Think Like A Computer Scientist in Java"
By Allen B. Downey

Why spend money when there is an overwhelming resource of free University and Professional level books out there not to mention the Sun site as well.
Check it out. I've got more Java books for free than I need right now on the computer.

Hope this helps
Blessings,Chetan
16 years ago
Hello to All,

I am working the programming book "Think Like a Computer Scientist in Java" and am on page 138 with this problem.
I like the Author's manner of teaching as well as his idea that the title is a joke of sorts. (Agreed this latter could spark blog wars about the current state of "Computer Scientists coming out of schools.")

The lesson:
"Write a method called toDouble that converts the rational number to a double
(floating-point number) and returns the result. This method is a pure function; it does not modify the object. As always, test the new method."

There are other minor errors in the other methods that are getting slowly 'debugged.'
This is my work on this set of examples with a roadblock on the method toDouble. By the way I use Eclipse Europa on Linux.
Blessings,
Chetanji


16 years ago