|
SomeGuyThatIsMe wrote: Found this in a sp, not sure why it was done this way
People new to SQL who are use to standard declarative languages don't realize how sets work. They find it difficult to think that way even presuming they know that it exists.
So they create loops.
|
|
|
|
|
I wouldnt have posted, well ok maybe i would have, if this was a new or junior person. If they were still around i would have tried to help them. This was written near the end of their time with the company, maybe that explains it. This person also spent a lot of time trying to prove how much smarter they were than everyone else.
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
SomeGuyThatIsMe wrote: I wouldnt have posted, well ok maybe i would have, if this was a new or junior
person
I said "new to SQL" and not new to programming.
And that is what I meant. Someone new to programming might be more likely to do it correctly because they don't already have expectations of how it 'should' be done. But these days either is likely to due a google search an implement it using the first example they find because neither has the necessary knowledge to filter it out.
|
|
|
|
|
Wow, talk about doing it the hard (and wrong) way. I suspect that this is a symptom of the state of on-the-job training in the programming world. It usually goes like "hey here's a new programmer, do this." But I still don't see how one becomes a programmer without learning the basics of SQL. No one likes code reviews, but it's useful for things like this.
Also, I love how @@FETCH_STATUS is global. I once saw an expensive production system blow-up due to a legacy code time bomb in the form of a SP using a global variable like this.
|
|
|
|
|
@echo off
for /L %%I in (1,1,100) do call :FizzBuzz %%I
goto :EOF
:FizzBuzz
set I=%1
set /a T3=I %% 3
set /a T5=I %% 5
set /a T35=T3 + T5
if not %T35%==0 goto FizzBuzz5
echo FizzBuzz
goto :EOF
:FizzBuzz5
if not %T5%==0 goto FizzBuzz3
echo Buzz
goto :EOF
:FizzBuzz3
if not %T3%==0 goto FizzBuzzEcho
echo Fizz
goto :EOF
:FizzBuzzEcho
echo %I%
goto :EOF Apparently I wrote this back in 2007. I have no memory of doing so, or why I did it .
Software Zen: delete this;
|
|
|
|
|
And that is because you got selected?
Happy Programming
|
|
|
|
|
No. I've been at my current position for 23 years.
Software Zen: delete this;
|
|
|
|
|
Well, that's a pretty decent FizzBuzz implementation.
|
|
|
|
|
Thanks. I was dumpster diving in my archive, looking for something else, and found that .
Software Zen: delete this;
|
|
|
|
|
I kinda like the Term "FizzBuzz"
|
|
|
|
|
|
Not to be confused with http://en.wikipedia.org/wiki/Bucks_Fizz_(band)[^] (oh man, I think I just got "Making Your Mind Up" stuck in my head and I don't think I have heard it since the 80's).
I just thought about this: www.zuberfizz.com[^]. I never tried this stuff, but back in 2006 I went on a road trip which took me through Durango (Colorado) and by request from a colleague of mine, I brought a couple of cases back to San Diego.
Soren Madsen
"When you don't know what you're doing it's best to do it quickly" - Jase #DuckDynasty
|
|
|
|
|
Oh dear, I had to capture the FizzBuzz thing for my sig...
|
|
|
|
|
I guess I need to get out of programming. My brain sees this and then shuts down. I don't want to think and figure it out. My brain is tired.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
I would worry more if you wanted to figure it out.
Can you imagine how frightened I am, given that I wrote this six years ago, and I don't remember why?
Software Zen: delete this;
|
|
|
|
|
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
No, but I can imagine how frightened I would be beng in the same job for 23 years!!!!!!!!!
FBOB That's a long time!
About 8 years is my record.
|
|
|
|
|
I've worked on a lot of different things in that time. For the most part it's been a pretty fun ride.
Software Zen: delete this;
|
|
|
|
|
I love this. Must open a cmd window just for old times sake
|
|
|
|
|
Hi,
Came across an article about ShivaLinga. Is it just a symbol or more. Could it be a power source or compact but highly efficient weapon, which needs to be kept cool. Nuclear decay seems to generate lot of heat and for this reason depleted rods needs to be kept submerged in water for a very long period.
Any thoughts.
Prasad P. Khandekar
Knowledge exists, man only discovers it.
|
|
|
|
|
The following item in the reference caught my attention:
"Shiva Linga speaks to the devotee in the unmistakable language of silence"
I will reply to my own post with the inspirational message that sentence has wrought.
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "As far as we know, our computer has never had an undetected error." - Weisert | "If you are searching for perfection in others, then you seek disappointment. If you are seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
|
Ahhh the sound of one hand clapping.
|
|
|
|
|
I just thought of upvoting this! Not sure what force did this!
|
|
|
|
|