Daklu Posted August 20, 2011 Report Share Posted August 20, 2011 I recently added this bit of code in my application. As part of my unit testing I was sending a value of "10" to the Pin Number terminal. When the test failed I probed the integer output and was surprised to find the function interpreting the string as binary instead of decimal! It was returning 2, not 10. Took me about 10 minutes to figure out what the real problem is. 2 Quote Link to comment
crelf Posted August 20, 2011 Report Share Posted August 20, 2011 There are 10 types of people in the world... Quote Link to comment
jgcode Posted August 20, 2011 Report Share Posted August 20, 2011 There are 10 types of people in the world... You obviously understand binary? Quote Link to comment
crelf Posted August 20, 2011 Report Share Posted August 20, 2011 What do you mean? I'm talking about the ten degrees on the Kinsey scale - what are you talking about? Quote Link to comment
jgcode Posted August 20, 2011 Report Share Posted August 20, 2011 What do you mean? I'm talking about the ten degrees on the Kinsey scale - what are you talking about? It turns out there is only 8. Therefore, I will change my question to: You obviously understand octet? Quote Link to comment
crelf Posted August 20, 2011 Report Share Posted August 20, 2011 True, except I think he never found a 1 or an eight, right? So I guess it's the sextet that I truly understand. And we have come full circle. Quote Link to comment
jgcode Posted August 20, 2011 Report Share Posted August 20, 2011 And we have come full circle. I hope that is not part of the punchline. Quote Link to comment
ShaunR Posted August 21, 2011 Report Share Posted August 21, 2011 True, except I think he never found a 1 or an eight, right? So I guess it's the sextet that I truly understand. And we have come full circle. Me too Quote Link to comment
Yair Posted August 21, 2011 Report Share Posted August 21, 2011 I had something similar recently, when I wanted to get the first byte from a string: Unfortunately, I couldn't test this myself with the hardware, so I first found it after I remotely deployed it and found out something wasn't working. At first I didn't have debug data, so my initial reaction was to blame the hardware, which had both problematic documentation and a flaky history. Sigh. Quote Link to comment
crelf Posted August 21, 2011 Report Share Posted August 21, 2011 Me too Oh dear - that wasn't quite what I was thinking :-) But seriously, this is a pretty good flick (I like Liam Neeson) http://m.imdb.com/title/tt0362269 I had something similar recently, when I wanted to get the first byte from a string: Ouch :-) That would have been even harder to find had the input consisted of only 2 bytes... Quote Link to comment
Yair Posted August 21, 2011 Report Share Posted August 21, 2011 That would have been even harder to find had the input consisted of only 2 bytes... Uh, it was actually even harder than that, because the string only had 1 byte, so I was sure the device wasn't sending anything back (why I was getting the first byte of a 1-byte string is irrelevant here, although there was an actual reason for this). Well, I guess that's what happens when you're asked to do something quickly. Quote Link to comment
crelf Posted August 21, 2011 Report Share Posted August 21, 2011 Uh, it was actually even harder than that, because the string only had 1 byte... I actually LOLed when I read that Quote Link to comment
Val Brown Posted August 21, 2011 Report Share Posted August 21, 2011 You obviously understand binary? As do you -- so the ten of you get it and it's obvious that you're right handed when you count that many items..... :lol: Quote Link to comment
Cat Posted August 30, 2011 Report Share Posted August 30, 2011 Me too Oh thanks, Shaun. I just opened that on a government computer. Big Brother's going to be banging on my cubby door at any moment. You all will visit me in jail, right? Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.