Edwin Keeton

Greenhorn
+ Follow
since Jul 22, 2002
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 Edwin Keeton

One more way to look at it: the server has no idea about anything you do except when you send a request. The server doesn't even know who you are when you send a request unless you send a cookie or rewrite the URL with a session id. There is no connection between you, the client, and the server after the response is sent.
I've used several. My vote goes to IntelliJ. It just feels right, no other way to explain. This is the one you're looking for, whether you realize it yet or not.
Eclipse is my next favorite. I used it until just recently when I could finally afford IDEA. It's not hard to learn but you need a guide to show you the way at first. A lot of features are not intuitive.
JBuilder is great but very pricey. I think the price could possibly be justified on a large project where you can utilize the GUI builder and other built-in "wizards". In other words, I'd be happy to use it if you supply it to me.
I want to like NetBeans. It seems to have just about everything you could want but it has always managed to frustrate me for one reason or another. What really kills the deal for me is that you can't modify the automatically generated code. Maybe the next version will pull everything together.
Finally, it's not an IDE but I still use JEdit quite a bit for all those times when all you really need is just an editor.
My impression is that the Eclipse UI is a bit unintuitive. But it's simple to use (and powerful) once you know how.
Maybe it's just me, but I learn best through example. I need to learn how to do something before I can get too deep into the why. I'm also admittedly lazy, otherwise I wouldn't still be programming after all these years.
Anyway, since I don't work with anybody who already knows how to use Eclipse, I bought the book "Eclipse In Action" from Manning Press and found it to be worth every penny in the time and aggravation it has spared me.
I wasn't previously aware of Mr. Pluta's "Step by Step book, but it seems that it may complement the material in the one I already have, so I might buy this one too. (Assuming I don't get lucky and win it.)
Ed
I'm wondering what this has to do with which IDE you're using?
Sorry, I should have said that the String class overrides hashCode().
The String class overrides equals() to return true if the in parameter is the same sequence of characters as the object.
It's clearly not on the exam, but since I brought it up, here's how you might load a native library from a static initializer block.
I thought I saw it in K&B but now I can't find anywhere in the book that refers to this.
The main use of static blocks, or static initializers, that I've seen is to load native libraries when the Java class is loaded.
I guess if you know that they run only once when the class is loaded, there doesn't seem to be much else to them. But I beg to be enlightened.
I haven't bought them. I think that a lot, maybe most of the value of flash cards is in making them yourself.
It finds the greatest common divisor of the two numbers. You can find an implementation in any algorithm book, or elsewhere on the web.
15 years ago
Addressing your 2nd question, a top-level class can only have default or public access. A private class would clearly be meaningless and is not allowed.
The protected keyword refers to visibility through inheritance rather than by reference. It applies to members rather than classes because you don't inherit a super class but rather the members of a super class. So protected is also not allowable as an access modifier for top-level classes.
If you could have a protected class, it would not be visible outside its package anyway, and would not be distinguishable from default access.
15 years ago
Generally speaking, how difficult is it with JDO to map to an existing relational schema? How does performance compare to a freshly created schema mapped directly through JDO?
First split the double into two parts, the integer part and the fractional part. Then take the fractional part of the number and create a third number which is a power of 10 where the exponent is the length of the fractional part of the original number. The fractional part of the number is is the numerator and the power of ten number is the denominator. Now divide numerator and denominator by their greatest common divisor. Then display all three numbers by concatenating them in sequence with the appropriate separator symbols.
For example,
2.25 = Integer part is 2;
fractional part is 25/100
GCD is 25, so 1/4 is the fractional representation
In code it might look something like this:
String convertToFraction(double d) {
// get the whole number part
long i = (long) Math.ceil(d);
// get the fractional part
double numerator = d - i;
// Convert the fractional part to a String
String frac = new Double(numerator).toString();
// We only want what's to the right of the //decimal point
frac = frac.substring(frac.indexOf('.'));
// Put the String back into a double
numerator = Double.parseDouble(frac);
int power = frac.length();
double denominator = Math.pow(10, power);
// implement findGCD()
int gcd = findGCD(numerator, denominator);
numerator /= gcd;
denominator /= gcd;
return i + "-" + (long) numerator + "/" + (long)denominator;
}
15 years ago
The byte datatype is needed to store integer values within range in the least amount of memory. A JVM might be implemented on processors with smaller than 32-bit registers, and memory resources are not always abundant.
Not many people "have" to use bit-shifting in "normal" coding. It's been a while, but IIRC some compression algorithms use bit-shifting. I'm sure there are other situations too.
15 years ago