|
Wow.. now I know why I passed Databases with just a 5.5 - I don't get it at all
|
|
|
|
|
Looks straightforward but rather tedious to read...I'd hate to be the guy testing it correctness
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
impressive... oh, i think, i'm going blind...
(yes|no|maybe)*
|
|
|
|
|
It doesn't look terribly much worse than some of the more complicated queries that we have in our application...
Despite it's name, it's not that easy to write an SQL query in a structured way...
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
I was ordered to work in a project that contains a lot of queries like this, I could not maintain it, and the project failed I'm human .
|
|
|
|
|
Not really, your's should be automatically generated by a query tool. So you don't care about the query text but its graphical representation.
Just have a look at products like Business Object ou DataStage and you will see what I mean
|
|
|
|
|
|
its ok ive done queries like this..the key to these is just split the query up and study it piece by piece. SQL is very power and can perform queries like this within a minute as opposed to doing stuff like this in front end code.
|
|
|
|
|
Yes.
It might work perfectly, but it isn't
(a) easy to read/understand
(b) commented, and is therefore
(c) not easy to maintain/debug.
I would probably rewrite all the sub-queries as either Views (if reused in the database elsewhere)
or as sub-select statements.
'Howard
|
|
|
|
|
Sometimes SQL gets like this. Be nice if they would comment it. If this is in Stored proc they could put comments in the middle of it. Not sure I like seeing dim1,dim2,dim3,dim4. Typically a bad db structure.
Sometimes its the Database that causes stuff to be complicated to query and if you didn't make the schema you have to do your best with it. Don't like to see Expr1 though. Thats sloppy.
|
|
|
|
|
Wow. This is a... (crystall ball) report query (Crystal XI?) for an Italian ERP, right?
"Periodo consuntivo budget"? "Ordini di produzione" ?
Looks like a some kind of analysis of production/orders vs. budget planned.
Sorry for bad Italian... I'm just a Romanian guy that happened to work for an Italian ERP for almost 10 years...
Nuclear launch detected
|
|
|
|
|
MS are not letting you to catch a StackOverFlowException. I wrote a evaluator/interperter using C# 1.1 . The language supports recursion about a year ago I moved to C# 2.0 and only now we found out that a too deep of a recursion throws the application without any notice. It just goes away. A simple factorial like:
fact(n)(if(n == 0,1,n * fact(n-1)))
vaporizes the application at fact(46)
I checked MSDN and it says:
Starting with the .NET Framework version 2.0, a StackOverflowException object cannot be caught by a try-catch block and the corresponding process is terminated by default
http://msdn.microsoft.com/en-us/library/system.stackoverflowexception.aspx
On this page they tell you to stay away from unbound recursions. What kind of recommendation is this? Guys stay away from null pointers!!
Natza Mitzi
|
|
|
|
|
Natza Mitzi wrote: MS are not letting you to catch a StackOverFlowException. I wrote a evaluator/interperter using C# 1.1 . The language supports recursion about a year ago I moved to C# 2.0 and only now we found out that a too deep of a recursion throws the application without any notice. It just goes away. A simple factorial like:
fact(n)(if(n == 0,1,n * fact(n-1)))
vaporizes the application at fact(46)
That's how the CLR works. In fact even a tail recursive language like Scheme will fail on that.
You have 2 options:
1. Increase stack space.
2. Rewrite to use iteration or tail-recursion.
|
|
|
|
|
Natza Mitzi wrote: Guys stay away from null pointers!!
And from people posting on the wrong forum.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
CPallini wrote: people posting on the wrong forum
Geeze, another one
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Yes, another one.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Seems like a rash of 'em lately
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
I think his point might have been a coding horror on the part of Microsoft.
He who asks a question is a fool for five minutes. He who does not ask a question remains a fool forever. [Chineese Proverb]
Jonathan C Dickinson (C# Software Engineer)
|
|
|
|
|
CPallini wrote: And from people posting on the wrong forum.
That throws WrongForumException and UraNoobException, neither of which are derived from StackOverFlowException.
Today's lesson is brought to you by the word "niggardly". Remember kids, don't attribute to racism what can be explained by Scandinavian language roots.
-- Robert Royall
|
|
|
|
|
You either have problems understanding the issue or just happy to jump in with someone that can not understand the issue.
Natza Mitzi
|
|
|
|
|
Natza Mitzi wrote: Starting with the .NET Framework version 2.0, a StackOverflowException object cannot be caught by a try-catch block and the corresponding process is terminated by default
yes, that is unfortunate. On the other hand, recovering from a stack overflow
in a reliable way is probably rather tricky.
Natza Mitzi wrote: A simple factorial like:
fact(n)(if(n == 0,1,n * fact(n-1)))
vaporizes the application at fact(46)
That is crap. How much does one stack frame take, 100 bytes? 1KB?
Now take 46 of those and your stack has run out???
IIRC the default stack size is 1 MB.
I just ran a little test and 10000! runs just fine.
|
|
|
|
|
I can use a recursive factorial with numbers up to and including 170
Any higher overflows the UInt1024 that I used for it - no StackOverFlowException
So what happened there?
Though I agree that the advice is pointless..
|
|
|
|
|
I think that it depends on:
a) The cost of opening a function on the stack changes
b) Whether the recursion is a tail recursion or not
Natza Mitzi
|
|
|
|
|
My answer below:
I reduced the occurrence of the problem by splitting some methods and using a dictionary instead of large switches that cause stack bloats. Now a simple recursive factorial method works with 400 instead of 46, that is almost 900% better
Natza Mitzi
|
|
|
|
|
I reduced the occurrence of the problem by splitting some methods and using a dictionary instead of large switches that cause stack bloats. Now a simple recursive factorial method works with 400 instead of 46, that is almost 900% better
Natza Mitzi
|
|
|
|