|
To bad you can't tell them...
"I took it out behind the barn and shot it. Now I'm writing a brand spanking-new database."
|
|
|
|
|
TheDailyWTF taught me that a "Date" table as such is not uncommon in business applications.
Since it's expensive to calculate holidays, business days, etc. they are calculated upfront and put into a date table that aids queries such as "next business day after" (maybe through a trigger when adding a previously unknown date, or through a script generating all dates up to 2015).
|
|
|
|
|
Yikes!
Although I can see a specific reason for adding a calendar of company holidays, what you've found out scares me silly! Afterall, I might encounter more of this shite in the years to come!
"It was the day before today.... I remember it like it was yesterday."
-Moleman
|
|
|
|
|
Actually, I found the most interesting exercise in reading TDWTF is reading the comments until someone comes up with a perfectly possible situation where the horrid solution is the one/usual/only/common way to go.
martin_hughes wrote: Afterall, I might encounter more of this shite in the years to come!
Love waht you can't change
|
|
|
|
|
martin_hughes wrote: Yikes!
Exactly what I thought after reading the post by peterchen. People must think it is better to have a lookup table rather than computing the dates...
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
|
|
|
|
|
Oh, well that's alright then. But the keys should be GUIDs and there should be additional columns to indicate whether it's a government or religious holiday (and if religious, then which) and all sorts of things like that... Sounds like my NumberAttribute class (or whatever the name is).
|
|
|
|
|
A Date table is daft. An Exclusive set is easier to manage than Inclusive set. Better off having a table with all the holidays in it, and manage the weekend checks in code.
But i don't know the caveats. I'm sure dumping every single date from now till the end of time into a table is not an efficient way of doing it.
-------------------------------
Carrier Bags - 21st Century Tumbleweed.
|
|
|
|
|
Hell I just rewrote a function I found that was calculating a Spot Date (2 Working days forwrd from the Deal date in FX trading).
It worked on an Exclusive set as you say, but instead of getting all of the holidays for the specific currencies (of which there is always 2 and always known in advance) and working with that. It looped adding a day until it did not get a count > 0 from an SQL statement like this and it is a weekday.
Select count(CurrencyId) from Holiday Where holidayDate = '2007/01/01'
where it changed the date forward.
To work out one spot date over the christmas period it would open, query close anything up to 4 or 5 times per confirmation. Crazy I tell ya.
You will be pleased to note that it no longer does this
|
|
|
|
|
Some Sort Of Myan Calendar?
|
|
|
|
|
"When normalization goes wrong. Horribly"
With that title, I expected to see an old "Far Side" cartoon!
The example is pretty funny either way.
|
|
|
|
|
A selected set of programmers always exist who are always inclined to enrage us. A friend of mine, who is working in Bangalore in a small company wanted a third party review of a bit of code. I helped him out during the previous weekend.
A very interesting observation. A developer had accessed a particular DB item from Cache. When we asked him what happens if the Cache gets NULL, he was telling the following points:
1) The cache never gets NULL.
2) When the cache item *misses out*, we have to restart the IIS or Windows so that on next attempt, cache would be replenished.
A simple automatic NULL check, cache replenish and DB call was at all required. I don't know what caused him to spin this story. I guesses are:
1) He was trying to 'cover' his blunder.
2) He was sincerely ignorant over the Web fundamentals.
3) He was of the opinion that We, the Web server administrators and program managers are just dumb cabbages who have nothing to do but just have thier asses glued to the chairs near the server monitor 365x24x7.
Any other speculations?
|
|
|
|
|
Nah, all you have to do is recycle the application worker process more frequently than the cache expiry time
Assuming ASP.NET of course.
|
|
|
|
|
And have a whole football park full of servers to keep the website running...
I bet Bill has some cash lying around somewhere.
WM.
What about weapons of mass-construction?
"What? Its an Apple MacBook Pro. They are sexy!" - Paul Watson
My blog
|
|
|
|
|
Vasudevan Deepak Kumar wrote: dumb cabbages who have nothing to do but just have thier asses glued to the chairs
Said idiot needs to look in a mirror.
--
You have to explain to them [VB coders] what you mean by "typed". their first response is likely to be something like, "Of course my code is typed. Do you think i magically project it onto the screen with the power of my mind?" --- John Simmons / outlaw programmer
|
|
|
|
|
dan neely wrote: Said idiot needs to look in a mirror.
|
|
|
|
|
The guy who thinks that "Web server administrators and program managers are just dumb cabbages who have nothing to do but just have thier asses glued to the chairs near the server monitor 365x24x7." is a dumb cabbage...
--
You have to explain to them [VB coders] what you mean by "typed". their first response is likely to be something like, "Of course my code is typed. Do you think i magically project it onto the screen with the power of my mind?" --- John Simmons / outlaw programmer
|
|
|
|
|
Unfortunately, in this part of the world (Chennai, India) people have that base opinion. I admit and fully support you in branding them as dumb cabbages or also as smart-ass***es.
They fail to understand that our work is more critical in providing a more resilent image to the customer. A website is a 24x7 office for an enterprise. Even a little downtime costs the enterprise badly.
But how do you make the swine to understand the greatness of pearl. It is a futile exercise right?
|
|
|
|
|
Vasudevan Deepak Kumar wrote: But how do you make the swine to understand the greatness of pearl. It is a futile exercise right?
Probably. I'd recoment the usage of large blunt objects. It won't be any more effective than other approaches, but will at least give you higher job statisfaction.
--
You have to explain to them [VB coders] what you mean by "typed". their first response is likely to be something like, "Of course my code is typed. Do you think i magically project it onto the screen with the power of my mind?" --- John Simmons / outlaw programmer
|
|
|
|
|
Vasudevan Deepak Kumar wrote: But how do you make the swine to understand the greatness of pearl. It is a futile exercise right?
Sometimes people just need to make mistakes that cost them money/time/injury before they understand the issue. Or use the following: Now that they have the pearl, take it away from them.
Phil
|
|
|
|
|
Vasudevan Deepak Kumar wrote: He was of the opinion that Web server administrators are dumb cabbages who have nothing to do but just have thier asses glued to the chairs near the server monitor 365x24x7.
Don't you mean 24x365 ?????
365 days X 24 hours instead of 365 days x 24 hours x 7 days
Greets! Joel
|
|
|
|
|
They are glued to their chairs for periods of seven years at a time -- after which they are allowed to visit the soda machine for one hour.
|
|
|
|
|
Even worst for them jejejejeje ... I wonder how often can they go to the restroom
Greets! Joel
|
|
|
|
|
jcdevnet wrote: how often can they go to the restr
That's terrible right? You need so much of room fresheners to keep off the odour!
|
|
|
|
|
That's what it says in the contract, but they do get free soda and diapers
I'm largely language agnostic
After a while they all bug me
|
|
|
|
|
Still, I'm not signing for that job
WM.
What about weapons of mass-construction?
"What? Its an Apple MacBook Pro. They are sexy!" - Paul Watson
My blog
|
|
|
|