- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
The article doesn't say 20 years of Java experience. It says a 20-year veteran with great Java experience. See the difference?
Admin
Technically, round-before-compare would satisfy this - the set of all values that round to a given value would comprise an equivalence class. There would be some "really close" values that round in different directions, of course, but ideally you shouldn't actually be working with such values, but rather only working with values that are close to the center of their equivalence class (i.e. close to the value they round to)
Admin
My Java is broken then. Both "twenty-five".compareTo("hundred") and "zweiundvierzig".compareTo("un million") return a value greater than zero...
Admin
The "first", "second", "first", etc comments will destroy this site, as they have destroyed many others. Please stop if you like this site.
Admin
Admin
Admin
You're not allowing for the time to find the IE icon on his desktop, click it, type in "www.eclipse.org", find the download button, etc.
Like so many IT people, you've completed neglected the human interaction part of the task!
Admin
Because Java truncates instead of rounds, I'm pretty sure that this requirement isn't violated. I'm too lazy to actually figure it out though.
Admin
Article: "added a 'twenty-year veteran' with 'great Java experience' to my team"
Admin
Admin
Admin
If someone is being brought in as a contractor to perform a specific function and is being paid a (probably) considerable sum of money for their work no one else being paid by that same employer should have to teach them anything. They aren't there to get an education, they are there to perform a specific duty for a specific amount of money.
If he wants to learn Java, he should practice on his own or take a continuing education course and stop wasting other peoples' time and money.
Admin
Yep, to me that was the real WTF in the whole story. Brooks' Law: "Adding manpower to a late software project makes it later." (Fred Brooks, "The Mythical Man-Month", 1975.)
Too bad that Zarar and the Powers That Be that he reports to 1) had never heard of Brooks' law, or 2) felt compelled to prove the truth of it. (Well, I guess he succeeded on the second point at least.)
Admin
I respectfully suggest you stop smoking crack...
So first off, a float consists of mathematical concept AND A SET O BITS.
The bits are NEVER imprecise. They always have a precise value. Further more, if you compare two floats in the suggested environment, barring a sun flare altering bits in ram/registers/buffers they will react the same as two ints.
As for the consultant's work. His second deliverable would be fine (if over complicated) except that it adds in a buffer overflow exception issue.
Admin
The terrors of floating point apply to all languages, and he should have known that his code was dicey. And using ints without the two decimal places in the first place was inexcusable.
Admin
Admin
Admin
x = 1.0/3.0; if (x==1.0/3.0) ...
where 1.0/3.0 is an 80 bit number, while x is a 64 bit number. Not equal!
Anyway, given that this is Java, could you explain the phrase "Sun flare" please?
Admin
You realize this part is entirely your fault. Set realistic expectations. If the deadlines are impossible, speak up. If they got you a contractor and he sucks, speak up.
It amazes me when developers are given projects and timelines they know are impossible, and rather than correct managers and set realistic expectations they simply work longer hours.
Now, I'm certainly familiar with putting in the time, weekends, late nights, whatever. But that should be the exception rather than the norm.
Admin
Wait, would this work? if x = y then ... else ...
Admin
Admin
Then, you could have ordered an extra 2Gb of RAM and waited two weeks for it to be installed. After that, Eclipse would start working.
Admin
Not sure why when I hear "20 Years experience" and "Java" in the same sentence, alarm bells are ringing.....
Those 20 Cobol years were probably invaluable, though...
Admin
Ah, The Mythical Man-Month!!
Admin
Horse milk is commonly drank by Mongolians. Any placental mammal has teats big enough to milk. Don't try this on a platypus, since they only have glands, not nipples.
Better yet, don't make analogy arguments unless you know what you're talking about.
Admin
sure, but if two close values are equal (lets say a & b), and two other close values are considered equal (this time b & c), the gap betweeen a & c may be greater than the gap between a & b, and a & c may not be equal.
In other words, what you said in your last paragraph seems to contradict the earlier part of your post....
Or have I forgotten to put my thinking cap on??
Admin
True, but the article never said Java experience, just experience.
Theoretically, you know programming concepts well, you should be able to pick up most languages reasonably easily...That of course is a wonderful theory. Not sure how well someone who has used Ada (for example) for 20 years would go about picking up Lisp (for another example), though....
waiting.....
Admin
OOPS!!!
Admin
I think the point is that to maintain transitivity, you should round first...
Otherwise while there appears to be more accuracy, a result relationships a->b, b->c, b->c (specifically one that considers a close enough to b to be equal, and b close enough to c to be equal, but not a to c) may show inconsistent behaviour.
Rounding to the accuracy you want first, ensures that transitivity will still hold, because one of a, b, or c would be rounded to a different number, so we might have a=b, b<c, a<c etc....
Rereading this, it doesn't make much sense, but I know hwat I mean (and that be the important bit)
Admin
I think it depends whether the truncation is before the calculation, or on the actual result. If it's the result that gets truncated, this requirement is (I boldly think) violated...
Admin
Isn't this easier than discussing rounding and bitwise representation of floats for hours?
public int compareTo (Object obj) { return Float.compare(getVarianceAmount(), ((OfferedActivity)obj).getVarianceAmount())); }
Let Java do it! (and let it take care of some corner cases as well) Granted this method (and the original one) assumes that obj is actually an instance of OfferedActivity, so some parameter checking would be in order.
Admin
In such cases I always have a look at commons-lang: return org.apache.commons.lang.math.NumberUtils.compare(f1, f2)
it's just a matter of taste, I guess
Admin
Remind me to never let you estimate any of my projects.
Admin
Again I ask, why are you sending a decimal to an int comparer? A method designed for dealing with non-decimal numbers.
Admin
Admin
I think people mostly ignored you the first time because no one knew what you were talking about.
What do you mean by "int comparer"? This method is comparing two objects of type Activity by comparing the values returned by the objects' getVarianceAmount methods. It is stated in the article that getVarianceAmount() returns a float, not an int.
Are you confused by the int return type on the compareTo() method? In Java, Comparable.compareTo() returns an int that is less than zero, zero, or greater than zero depending on whether the argument is less than, equal to, or greater than the object on which it is called. The fact that the method's return type is int has nothing to do with how the comparison is to be made.
Admin
Speaking of comparison, ran across this snippet this morning
Admin
My guess is that new consultant of 20 years learnt his stuff at the: cue joke
The Brillant School of Java Dean: Paula Bean
(I thank you..)
Admin
Whoa, now, that might be a bit insulting to all the true wankers on this site. After all, they may be wankers, but you can't seriously think that's as bad as being a "first/frist/fist/whatever" in the grand scheme of things!
Admin
Admin
95th!
Admin
Output is:
(That's 7 + 2^-50.)
Admin
Sad thing is, I've been on a "6 month" project where we hired our third group of contractors 'to catch up' just before we entered year three of the project...
It seems, some people just don't want to learn.
Admin
You're still coming in the office?! WTF?
Admin
yes,when you think how not to compare to,but it is compare to it.