Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


There's a Lot to Learn From Even Simple Puzzles


There's a Lot to Learn From Even Simple Puzzles

Author
Message
Phil Factor
Phil Factor
Right there with Babe
Right there with Babe (743 reputation)Right there with Babe (743 reputation)Right there with Babe (743 reputation)Right there with Babe (743 reputation)Right there with Babe (743 reputation)Right there with Babe (743 reputation)Right there with Babe (743 reputation)Right there with Babe (743 reputation)

Group: General Forum Members
Points: 743 Visits: 2937
Comments posted to this topic are about the item There's a Lot to Learn From Even Simple Puzzles


Best wishes,

Phil Factor
Simple Talk
Jeff Moden
Jeff Moden
SSC-Forever
SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)

Group: General Forum Members
Points: 45072 Visits: 39908
Congratulations Barry! Now, I've gotta go see what the hell you did! :-P

--Jeff Moden

RBAR is pronounced ree-bar and is a Modenism for Row-By-Agonizing-Row.
First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column.
Although they tell us that they want it real bad, our primary goal is to ensure that we dont actually give it to them that way.
Although change is inevitable, change for the better is not.
Just because you can do something in PowerShell, doesnt mean you should. Wink

Helpful Links:
How to post code problems
How to post performance problems
Forum FAQs
Jeff Moden
Jeff Moden
SSC-Forever
SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)

Group: General Forum Members
Points: 45072 Visits: 39908
Phil and Joe, thanks for having that contest. There was a huge amount of participation, debate, and code comparison! I know you guys had to spend a heck of a lot of time wading through all of that and it's much appreciated!

Well done to all who took part, as well. Some really great concepts bubbled to the surface.

--Jeff Moden

RBAR is pronounced ree-bar and is a Modenism for Row-By-Agonizing-Row.
First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column.
Although they tell us that they want it real bad, our primary goal is to ensure that we dont actually give it to them that way.
Although change is inevitable, change for the better is not.
Just because you can do something in PowerShell, doesnt mean you should. Wink

Helpful Links:
How to post code problems
How to post performance problems
Forum FAQs
RBarryYoung
RBarryYoung
SSCrazy Eights
SSCrazy Eights (9.4K reputation)SSCrazy Eights (9.4K reputation)SSCrazy Eights (9.4K reputation)SSCrazy Eights (9.4K reputation)SSCrazy Eights (9.4K reputation)SSCrazy Eights (9.4K reputation)SSCrazy Eights (9.4K reputation)SSCrazy Eights (9.4K reputation)

Group: General Forum Members
Points: 9438 Visits: 9517
w00t Woo-hoo! Finally, my name in lights!

Thanks, Phil and Joe. You too Jeff. :-)

Fast though it was, my submission was far from elegant or simple. Despite our head-knocking and despite even the loop in it, I would say that Mike Ross's last submission impressed me the most for simplicity and elegance.

-- RBarryYoung, (302)375-0451 blog: MovingSQL.com, Twitter: @RBarryYoung
Proactive Performance Solutions, Inc.
"Performance is our middle name."
Phil Factor
Phil Factor
Right there with Babe
Right there with Babe (743 reputation)Right there with Babe (743 reputation)Right there with Babe (743 reputation)Right there with Babe (743 reputation)Right there with Babe (743 reputation)Right there with Babe (743 reputation)Right there with Babe (743 reputation)Right there with Babe (743 reputation)

Group: General Forum Members
Points: 743 Visits: 2937
It was a tricky competition to judge for several reasons. Firstly, the entries were of such a high standard. Then they evolved, forked and cross-pollinated. It was also interesting to see the mutual help going on. It was like watching a horse-race where the front-running horses harnessed themselves together and crossed the finish line together. Actually, there were horses everywhere since some people seemed to end up with three or more submissions.

Joe was very taken by the way that everyone had taken the trouble to read up on the theory of calculating primes and brought that knowledge to the task.

We certainly agonised about whether the use of the number table should have been taken into account in the timings. however, we felt that because Joe had hinted that we wanted contestants to use that, we felt we should take a broader view of the general presentation, portability, documentation of the code etc, as well as sheer performance, so it never became the key issue.

Well done to all the contestants; even the solution that I killed after it had taken 17 hours to calculate primes below 1000. It was fun to judge.


Best wishes,

Phil Factor
Simple Talk
Steve Jones
Steve Jones
SSC-Dedicated
SSC-Dedicated (36K reputation)SSC-Dedicated (36K reputation)SSC-Dedicated (36K reputation)SSC-Dedicated (36K reputation)SSC-Dedicated (36K reputation)SSC-Dedicated (36K reputation)SSC-Dedicated (36K reputation)SSC-Dedicated (36K reputation)

Group: Administrators
Points: 36111 Visits: 18742
I, too, was amazed by the response to this. My initial thoughts were that the 10 people that enjoy math and SQL would jump in and most would ignore it, but there is some great work in the comments there. When Phil pointed this out to me last week that there were 20+ pages of comments, I was stunned.

I think there is definitely something to learn, especially the thought process as people collaborated with each other to improve solutions.

Great Job!

Follow me on Twitter: @way0utwest
Forum Etiquette: How to post data/code on a forum to get the best help
My Blog: www.voiceofthedba.com
SwePeso
SwePeso
SSCrazy
SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)

Group: General Forum Members
Points: 2469 Visits: 3431
Congratulations Barry!
It's a good thing they accepted your late submission :-)


N 56°04'39.16"
E 12°55'05.25"
Phil Factor
Phil Factor
Right there with Babe
Right there with Babe (743 reputation)Right there with Babe (743 reputation)Right there with Babe (743 reputation)Right there with Babe (743 reputation)Right there with Babe (743 reputation)Right there with Babe (743 reputation)Right there with Babe (743 reputation)Right there with Babe (743 reputation)

Group: General Forum Members
Points: 743 Visits: 2937
I loved your routine, Peso. It was great to follow the forum postings, and see the way that you quietly submitted it but it seemed to take a while for the other contestants to see how radically it performed!


Best wishes,

Phil Factor
Simple Talk
RBarryYoung
RBarryYoung
SSCrazy Eights
SSCrazy Eights (9.4K reputation)SSCrazy Eights (9.4K reputation)SSCrazy Eights (9.4K reputation)SSCrazy Eights (9.4K reputation)SSCrazy Eights (9.4K reputation)SSCrazy Eights (9.4K reputation)SSCrazy Eights (9.4K reputation)SSCrazy Eights (9.4K reputation)

Group: General Forum Members
Points: 9438 Visits: 9517
Peso (8/11/2009)
Congratulations Barry!
It's a good thing they accepted your late submission :-)

True, and thanks again to you Peter for pointing out the bugs in my original solution so that I had a chance to fix them! :-)

-- RBarryYoung, (302)375-0451 blog: MovingSQL.com, Twitter: @RBarryYoung
Proactive Performance Solutions, Inc.
"Performance is our middle name."
SwePeso
SwePeso
SSCrazy
SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)

Group: General Forum Members
Points: 2469 Visits: 3431
Thank you!
You did the hard work. I did nothing but finding some "edge" conditions for you to fix.


N 56°04'39.16"
E 12°55'05.25"
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search