|
I recently answered a query on a LinkedIn discussion. It was simple enough about how/why/when to override hashCode and equals in Java.
I gave a simple answer - if you override either you should override both and that if the equality of objects is based on the state, then you should consider overriding them even if you don't intend to use the methods.
Well roger me senseless with a walnut branch! There really are some fuped people out there. I have read that ALL classes MUST reimplement the methods, if you don't care then just use a random number for the hash code, you can override one and not the other and even that it doesn't really matter.
I must stop doing this, it hurts my brain.
[adendum]
Latest answer was about you can only build meaningful hash codes from String values within the object. FFS.
|
|
|
|
|
On the bright side this frustrating experience gives you an excuse to 'drown your sorrows'.
|
|
|
|
|
Excuse? Why would I need one of those?
|
|
|
|
|
You don't have to offer the wife a reason when you slip on your hat and overcoat and head out towards the pub?
Perhaps you've an arrangement like I have where I go to the pub to pick up the wife.
|
|
|
|
|
Tonight we're out at a reception at a posh London hotel. All I have to do is turn up suitably dressed and it's freebies all the way until the 8th 'stop it, you're embarrassing me' and then she'll drag me home.
|
|
|
|
|
How is taking advantage of free booze an embarrassment to the wife?
Is she not a frugal person?
|
|
|
|
|
excuse, isn't that called today is a day that ends in y?
Did you ever see history portrayed as an old man with a wise brow and pulseless heart, waging all things in the balance of reason?
Is not rather the genius of history like an eternal, imploring maiden, full of fire, with a burning heart and flaming soul, humanly warm and humanly beautiful?
--Zachris Topelius
Training a telescope on one’s own belly button will only reveal lint. You like that? You go right on staring at it. I prefer looking at galaxies.
-- Sarah Hoyt
|
|
|
|
|
That's pretty bad.
On another hand (one of mine, not yours), I had to wrap a class from Microsoft (.net) yesterday because it doesn't overload those and it is sealed .
I think this week is the week of struggling with needlessly sealed classes.
|
|
|
|
|
Yup, seen that a few times as well.
|
|
|
|
|
PIEBALDconsult wrote: I think this week is the week of struggling with needlessly sealed classes.
I'm looking forward to someone forking .NET and removing the sealed keyword on a bunch of classes.
Marc
|
|
|
|
|
And adding virtual to pretty much everything that doesn't have it.
Personally, I'd be tempted to add a Dispose method to Object as well.
|
|
|
|
|
Wow. That's scary, and sadly continues to confirm my belief in the stupidity of most programmers.
Marc
|
|
|
|
|
I am dealing with a project where all the data model and dsl classes override both. I think I can find a way to blame you for this.
No object is so beautiful that, under certain conditions, it will not look ugly. - Oscar Wilde
|
|
|
|
|
That'll be from the "Must Do Because I Can Do" school of programming.
|
|
|
|
|
While I was swimming around exploring the depths of that stack I came across some reading that suggested at some point this might be required for AutoMapper, so it's probably a bit more than that. Hell, I thought I was an AutoMapper junkie until now.
No object is so beautiful that, under certain conditions, it will not look ugly. - Oscar Wilde
|
|
|
|
|
Sure beats the "I don't think I'll ever need to do it, so I won't let anyone else do it either" school.
|
|
|
|
|
That was the three things, in that order, the people of Portsmouth are most scared of according to a not so recent survey. Quite strange really as two of those groups would run away if confronted (ay you see what I did there Rage) I had actually heard about this poll before, but an article I re-read yesterday which was written when we got promoted to the PL (seems an age ago now) reminded me of it.
I'm not sure if the article will interest anyone outside of Pompey, or who doesn't know the City but it's here anyway[^]. I found it a great read, especially as I know or know of most of the people mentioned and also know that the general descriptions of the people of Portsmouth are so true. Seems like it has always been that way too.
'The necessity of living in the midst of the diabolical citizens of Portsmouth is a real and unavoidable calamity. It is a doubt to me if there is such another collection of demons upon the whole earth.' - General James Wolfe, 1758
|
|
|
|
|
P0mpey3 wrote: Paedophilles, Drunks and the French
I thought that was a description of the residents?
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
That would be:
Paedophilles, Drunks and the Romanians
|
|
|
|
|
... and you're not Romanian or a Paedo, so you must be?
|
|
|
|
|
Running away?
Alberto Brandolini: The amount of energy necessary to refute bullshit is an order of magnitude bigger than to produce it.
|
|
|
|
|
Say all you want about pedophiles, at least they drive slow in school zones...
Anything that is unrelated to elephants is irrelephant Anonymous ----- The problem with quotes on the internet is that you can never tell if they're genuine Winston Churchill, 1944 ----- I'd just like a chance to prove that money can't make me happy. Me, all the time
|
|
|
|
|
|
My doctor's surgery is computerised - this is all good.
And for a couple of years now, I can order Herself's medication repeat prescriptions online: I log in, tick what she needs, send the request, and then collect the medication from the pharmacy one or two days later.
This is complicated, as the NHS rules in Wales will only allow 28 days of medication, and you can only re-order in the last 7 days of the 28 since the last issue. Not a problem, I just sort it out (and "juggle" reorder dates to get it to "one-order-per-four-weeks".
It works: no paper, no fuel to drive paper to surgery, no phone, no people involved.
Except they changed systems 4 months ago, and the first two months it just lost all requests. Last month, it was fine, so on Sunday I submitted a new request. And this morning it's still sitting there on the computer as status: "Requested". Not "Approved", or "Rejected", but "Requested" - which means it hasn't been dealt with. OK, drive down to surgery and sort it out.
Now, you and I probably figure it goes like this:
1) User submits request to central internet system
2) System sends request to surgery for processing
3) Surgery system checks request and validates that it's all on the "approved" list for the user, and that he ordered in the appropriate period.
4) System passes request to doctor, who scans, ticks and moves on.
5) System produces physical prescription, which is passed to pharmacy. (Legal requirement: must be paper copy)
No. Found out today that step 3 is human: An employee prints out the request, gets the user computer file up and manually checks it, then types in the prescription request for the doctor to look at, check against the computer, sign and put in the "out" basket...
And "The girl that does that is off this week"
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
Try the Dept of Work & Pensions! Had a battle down there yesterday as I received a text message 'To Attend At 13:40' and go there (I have noticed something the Security Guards are all over weight/obese 40+, how good would they be if a 17 year old goes Jeremy Kyle???) End up sitting for around 3/4 of an hour...It strikes me that Civil Servants are a strange breed they have one speed (in my experience slower than an arthritic tortoise!). Only to be told I should look for work in the computing area, possibly PC World!!
|
|
|
|