Log in  ::  Register  ::  Not logged in

 Recent PostsRecent Posts Popular TopicsPopular Topics
 Home Search Members Calendar Who's On

 AND & OR Rate Topic Display Mode Topic Options
Author
 Message
 Posted Tuesday, October 13, 2009 10:40 PM
 SSChasing Mays Group: General Forum Members Last Login: Thursday, December 11, 2014 5:11 AM Points: 654, Visits: 267
 Comments posted to this topic are about the item AND & OR
Post #802511
 Posted Wednesday, October 14, 2009 1:24 AM
 SSC-Addicted Group: General Forum Members Last Login: Friday, July 29, 2016 5:51 AM Points: 472, Visits: 321
 Tricky question especially in the morning Kindest Regards,Damian WideraSQL Server MVP,MCT, MCSE Data Platform, MCSD.NET
Post #802546
 Posted Wednesday, October 14, 2009 2:13 AM
 SSCommitted Group: General Forum Members Last Login: Wednesday, May 27, 2015 3:44 AM Points: 1,865, Visits: 596
 arghh!! I spent a few minutes playing with a spreadsheet to mock up the bitwise AND and OR functions (a happy little diversion) and i missed the data type gotcha!ah well... Life: it twists and turns like a twisty turny thing
Post #802559
 Posted Wednesday, October 14, 2009 2:41 AM
 Ten Centuries Group: General Forum Members Last Login: Saturday, March 5, 2016 7:55 PM Points: 1,354, Visits: 1,300
 I just did the same thing -- missed the bit datatype.120 = 01111000030 = 00011110040 = 00101000120 and 30 = 11000 in binary or 8 + 16 = 2424 or 40 = 11000 or 101000 = 111000 = 8 + 16 + 32 = 56Well, all that work was thrown out the window because of the bit datatype.I'm getting tired of these trick questions. The title of the question says AND & OR and that led me to believe the author is testing our binary skills -- not our visual acuity. We have a list of variables that are all INT except one that's squeezed in the middle. Sheesh.
Post #802568
 Posted Wednesday, October 14, 2009 3:23 AM
 Hall of Fame Group: General Forum Members Last Login: Saturday, June 6, 2015 9:44 PM Points: 3,450, Visits: 4,408
 I am disappointed with the question, too.If I copied the script into SSMS, I would get the right answer. Instead, I took a piece of paper and wrote binary 'ones' and 'zeroes'... and didn't notice the 'bit' trick...
Post #802584
 Posted Wednesday, October 14, 2009 3:24 AM
 Ten Centuries Group: General Forum Members Last Login: Wednesday, November 4, 2015 6:42 AM Points: 1,127, Visits: 605
 I completely agree with this, though I was this time lucky I found the bit this time. But this is not testing for knowledge about the meaning of bitwise comparising, which can be very useful. Ronald HensbergenHelp us, help yourself... Post data so we can read and use it: http://www.sqlservercentral.com/articles/Best+Practices/61537/-------------------------------------------------------------------------2+2=5 for significant large values of 2
Post #802586
 Posted Wednesday, October 14, 2009 3:36 AM
 Ten Centuries Group: General Forum Members Last Login: Friday, November 4, 2016 5:44 AM Points: 1,129, Visits: 761
 Absolutely ridiculous!What is the point of a trick question on a technical forum?Maybe you could argue that as developers we need to pay attention to the smallest detail, but that's a pretty thin argument when we're coming here to challenge our knowledge, not our powers of observation.A question about AND and OR is good, working out the answer is a pleasant diversion, discovering that it wasn't a question about AND or OR at all but rather an exercise in hiding the word 'bit' amongst a list of 'int's and seeing who noticed... really disappointing, to the point of making me angry!I'm sorry - I know people put effort into making up the questions and they could have a legitimate point that I have no right to complain when I don't submit questions of my own, but this is just annoying.
Post #802599
 Posted Wednesday, October 14, 2009 3:57 AM
 Ten Centuries Group: General Forum Members Last Login: Wednesday, November 4, 2015 6:42 AM Points: 1,127, Visits: 605
 hodgy (10/14/2009)arghh!! I spent a few minutes playing with a spreadsheet to mock up the bitwise AND and OR functions (a happy little diversion) and i missed the data type gotcha!ah well...I hope you know about the Excel functions DEC2BIN and BIN2DEC (from Analysis Toolpak)... Ronald HensbergenHelp us, help yourself... Post data so we can read and use it: http://www.sqlservercentral.com/articles/Best+Practices/61537/-------------------------------------------------------------------------2+2=5 for significant large values of 2
Post #802605
 Posted Wednesday, October 14, 2009 4:28 AM
 Ten Centuries Group: General Forum Members Last Login: Thursday, October 27, 2016 3:28 AM Points: 1,249, Visits: 1,150
 vk-kirov (10/14/2009)I am disappointed with the question, too.If I copied the script into SSMS, I would get the right answer. Instead, I took a piece of paper and wrote binary 'ones' and 'zeroes'... and didn't notice the 'bit' trick...Not only a trick question, but one that is possible to get right by getting the reasoning all wrong...If you don't know that AND and OR operate bitwise on integers, you might assume that it works like Excel's AND() function which treats nonzero values as TRUE and zeroes as FALSE. Then it would return 1 as the value, even if all the variables were declared as INT. So you'd get the right answer, but for the wrong reason - and you'd go away "knowing" something about these operators that "ain't so".
Post #802617
 Posted Wednesday, October 14, 2009 4:54 AM
 Mr or Mrs. 500 Group: General Forum Members Last Login: Thursday, May 15, 2014 8:37 PM Points: 589, Visits: 2,437
 I think that was a nice question because it practices the capacity to get the details: sometimes, I make error (well it does not append that often ) and can look for them for a long time, missing the detail ...
Post #802632

 Permissions

 Copyright © 2002-2016 Redgate. All Rights Reserved. Privacy Policy. Terms of Use. Report Abuse.