Win a copy of Real-World Software Development: A Project-Driven Guide to Fundamentals in Java this week in the Agile and Other Processes forum!

Susan Hoover

Ranch Hand
+ Follow
since Jan 04, 2001
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 Susan Hoover

I didn't mean to start a religious war; I guess I should have known better. It looks as though we will have to agree to disagree on the appropriateness of HTML in email.
A solution that will work is this: Javaranch continues to send HTML to those people who want it, and I continue to choose not to receive it. That way, we both get what we want.
Here is a commentary (not mine) on HTML mail. The author's experience with the signal-to-noise ratio mirrors mine (i.e. far more than 10% increase in size).
From the UBB manual, how to configure UBB email options to choose between HTML and plain text mail. However, it appears that this applies to everyone. Maybe I'll make a feature request to the UBB folks for UBB 7.x for per-member setting of this flag...
[ February 21, 2002: Message edited by: Susan Hoover ]
18 years ago
I despise HTML in email. Most of it is bloated, unnecessary, waste of bandwidth. I have gotten to the point where I delete HTML email unread.
Why is this relevant here? Way back when I first joined, I turned off the "allow moderators to send you email" option because I didn't want the extra mail. Then it happened that I might have won a book giveaway, except the moderators couldn't contact me to let me know.
So I turned the option back on just in case. This was okay for awhile, because the weekly "here's this week's giveaway info" message was text-only.
For the past few weeks, the weekly giveaway message has been arriving in HTML, and thus gets deleted unread.
I'm turning the option back off to avoid wasting both my time and bandwidth on messages I'm not going to read.
I see a couple of solutions:
1) An option to select between HTML or text mail. I've seen this on other sites.
2) Separate options for "moderators can send you mail" and "I want the weekly automated message". "Moderators can send you mail" should mean that human moderators can contact you if they need to. This should be a rare occasion.
18 years ago

Originally posted by Dale DeMott:
What tools can I use to trace a memory leak? Any Suggestions?


OptimizeIt by VMGear will allow you to profile your code as well as examine memory usage. You can set a "high water" mark that shows how many objects of class Foo you have, then run your code, then garbage collect, then see how many objects of class Foo you now have. If you find that the number of Foo objects keeps growing, there is a memory leak somewhere.
Hi, you might want to check out the Java Platform Debugger Architecture at http://java.sun.com/j2se/1.3/docs/guide/jpda/jpda.html -- there might be something there that can help you. It's how debuggers can attach to external processes.
18 years ago

Originally posted by Asuthosh Borikar:
To summarize,
String sString = new String("blahblah");
String tString = new String("blahblah");
will ALWAYS result in two new objects.
But,
String sString = "blahblah";
String tString = "blahblah";
will only result in one new object.


Actually,
String sString = new String("blahblah");
String tString = new String("blahblah");
could potentially result in not TWO but THREE new objects. The first object is the string literal "blahblah" which, as you pointed out, will exist in the pool of literal strings after this call is made. The other two are the new Strings that are explicitly created.
(reference: RHE 2nd ed. p. 257)
Either way, to the original question,
String sString = new String("blahblah");
is very wasteful.
--
Susan

[This message has been edited by Susan Hoover (edited January 30, 2001).]
19 years ago

Originally posted by Val Dra:
You can declare an array with [] ither way but there is something you must know
let's say you have an array declared like this
int arr[], f;
int []arr, f
in first declaration arr is declared as an array of integers but if is not in 2nd declaration arr is declared as array of integers and so is f . So when you have [] after the type the following declarations followed by , will result in an array reference


Wow. Val, I have to admit that I thought you were wrong, and I was going to prove it. However, my code proved that you were correct! The following code compiles (if you strip out the line numbers). Note lines 6 and 12. In the first case, f is an int. In the second case, f is an int[]. Wow.

--
Susan
19 years ago

Originally posted by lakshmi Sailaja:
I need to execute a piece of java code once a week at a specific time. How do I do that ? Can anyone please tell me ?


Do you need to execute the piece of code from within a Java application? Or do you need to execute a Java application from your OS?
If it is the latter (execute from OS), you can use NT's at-scheduler (type "help at" from the NT command prompt). If you are running UNIX, I think you can use either "at" or "cron" (type "man at" or "man cron" for more details). The argument to at or cron would be "java MyClass myarg1 myarg2".
If the problem is the former (execute from within Java app), I guess you could have some sort of thread that woke up at specified intervals, executed some code, then went back to sleep. This isn't guaranteed to be very precise, and I'm not entirely sure that it would work. (I am not a threading expert by any means.)
My recommendation would be to use at or cron, and restructure your classes so that there's a main() in a class that you can run from at or cron.
--
Susan
19 years ago
Ummm, I thought the beauty of it was that the JRE presents the same bytecode API to the application, no matter what platform you are on. You still need to have a JRE specific to your platform. That's why Sun has a download for Solaris, a download for Linux, and a download for Windows.
There's a nice picture of it here.
[This message has been edited by Susan Hoover (edited January 29, 2001).]
19 years ago
Thanks for the tips. But...

Originally posted by RoshanDawrani:
2. GridLayout and GridbagLayout are there. (Robert and Heller book clearly says that it's not there but it is !!)


Do you have the updated RHE (white cover, 2nd ed.)? p. 282 of my copy states as follows:


In the versions of the exam prior to the Java 2 Platform, the objectives related explicitly to the Flow, Grid, and Border layout managers. However, the objectives were modified with the release of the Java 2 Platform edition of the exam, and since then all AWT layout managers are possible candidates for questions.


The GridLayout is covered on p. 296, and GridBagLayout is covered in pp. 311 - 332. The fact that they spent 20 pages on it tells me it's probably important. :-)
Otherwise, your tips are great. I would add one more: probably the best preparation for the exam is actual experience. Write some real code, experiment with various data structures, read about design patterns and other OO topics.
--
Susan
19 years ago
Ah, but if you look at the code for the default java.util.Date constructor...

19 years ago
Maybe it has something to do with quoting a message that has both a QUOTE section and a CODE section in it?
19 years ago
Would a larger search button help any with the massive amounts of duplicated questions? My cynical side says probably not, but maybe there's some combination of colors, size, and placement that will make it more likely to be used.
19 years ago

Originally posted by Carl Trusiak:
How's that?


Fine on the home page. Who generates the

Powered by: Ultimate Bulletin Board (UltimateBB), Version 5.44a
� Infopop Corporation (formerly Madrona Park, Inc.), 1998-2000.

at the bottom of the saloon pages?
[This message has been edited by Susan Hoover (edited January 24, 2001).]
19 years ago
The thing that comes to mind is the package structure. Make sure that Inter and B are in the same package. If you don't specify a "package foo.bar;" line at the top of your files, then Inter and B are in the same package and must be in the same directory, which is the directory you're compiling from.
Since you have provided the output, I'm going to assume that C:\examples\inter is the directory that contains both Inter.java and B.java. There are several ways you can structure this:
1. No package statements.
This means that C:\examples\inter is the root of your package structure, and you have to either compile from C:\examples\inter or use the -sourcepath C:\examples\inter option.
2. package inter;
This means that C:\examples is the root of your package structure, and you have to either compile from C:\examples or use the -sourcepath C:\examples option.
19 years ago

Originally posted by Dale DeMott:
Okay GURUs. What are some good technical interview questions and obviously their answers for Java. They should be pretty general questions. Thanks in advance!


If you are the one who will be questioned, perhaps it's a good idea to take a few mock exams.
19 years ago