Page 2 of 2
Re: The & operator
Posted: Sun Feb 07, 2010 12:19 pm
by Foz
idle wrote:There are only 10 kinds of people in the world those that understand binary and those that don't!
<facepalm>
GROAN!
</facepalm>
Re: The & operator
Posted: Sun Feb 07, 2010 12:21 pm
by Trond
Since our own programmers could explain what this would be in a mainstream programming language like C++ or something
But the & means that same in PB as in C++, where is the problem?
Its a little more serious then just saying "But the & means that same in PB as in C++, where is the problem?" and assuming that everyone is in agreement with you.
I didn't mean you should say that in court! I meant that that if the above mentioned programmers could explain what this would be in C++ then they can give that same explanation to the court, so where is the problem?
There are only 10 kinds of people in the world those that understand binary and those that don't!
And those who mistake it for ternary.
Re: The & operator
Posted: Sun Feb 07, 2010 4:03 pm
by Baldrick
SFSxOI,
Just a little point that may or may not be worth mentioning. The analogy of 1+1=2 being used by the defnse lawyer to confuse things, I would have answred by saying that "yes, 1+1=2 if you are working in decimal, which is a base 10 number. By base 10, I mean there are a total of 10 digits useable as digits 0 through 9 at which point the numbers shift to the left 1 digit in a rotational basis each time we have used all of the available digits.
In this case we are talking Bitwise AND logic as used within a computer which works in Binary or a base 2 number system.
By base 2, this means 2 useable digits 0 through to 1, at which point the numbers will shift to the left 1 digit each time we have used all the avaiable digits.
So therefore to compare your base 10 example of 1+1=2 as the same in Binary or base 2, the 1+1 in this case would =10, which is because we have used all possible digits in base 2 & need to shift left 1 digit.
In the case of doing a Bitwise AND comparison, we would take for example a decimal number of say 5 which we will allocate as "A" then we will take another number of say 4 which we will allocate as "B". By breaking these 2 numbers into their binary forms, we can then perform a Bitwise AND comparison on them. i.e. decimal 5 in binary is written as 101, while decimal 4 in binary is written as 100. So a Bitwise comparison on the A & B equates to 101 & 100 which will give an answer of 100 in binary. To explain further, if you compare the leftmost digit of A&B, 1&1, your answer will be 1. Then the middle digit of 0&0 will be of course 0, followed by the rightmost digit of 1&0 which also gives you a 0. so the bitwise comparison in this case is 100 or converted back to decimal is 4.
So as you can see, this Bitwise AND comparison is nothing more than just a mathmatical formula slightly more complex than the simple addition of your 1+1=2 analogy.
Re: The & operator
Posted: Sun Feb 07, 2010 4:39 pm
by SFSxOI
Trond wrote:Since our own programmers could explain what this would be in a mainstream programming language like C++ or something
But the & means that same in PB as in C++, where is the problem?
Its a little more serious then just saying "But the & means that same in PB as in C++, where is the problem?" and assuming that everyone is in agreement with you.
I didn't mean you should say that in court! I meant that that if the above mentioned programmers could explain what this would be in C++ then they can give that same explanation to the court, so where is the problem?
There are only 10 kinds of people in the world those that understand binary and those that don't!
And those who mistake it for ternary.
Oh of course, I understood that. I was just pointing out that we can't put other programmers on the stand to explain what it is in C++, and I can't use what other programmers know or think, since its my work and i'm the one that did the forensic work and came up with the method and i'm the "expert" in this case then i'm the one thats stuck with explaining the details of the methods I used in context with how PureBasic does it and PureBasic alone because I used PureBasic to derive the method. Its doesn't matter that a million people could give the explaination that its the same as C++, it doesn't matter that there are a million programmers who could give the explaination, it doesn't matter if its got the most documentation in the world that was ever created for C++ or any other language. The only thing that matters is being able to describe how it works in PureBasic. No one else in the world at this point can give this explaination except me, and i'm not allowed to say "Its the same as....", I have to be able to say "The method I employed does...< this, this, this, this.......etc....> and this is how it does it....... The method calculates <this, this, this......> this way... etc...." Its the way the law works for expert testimony, they can only testify based upon what they know, did, or observed, in context with the methods they employed and the evidence and not what someone else knows. So since I know what this does, I can explain it based upon my terms, however I can't explain it based upon the context of how PureBasic does it even though I understand whats going on and can explain it in my own personal terms. And because I used PureBasic to arrive at this method I have to be able to explain it in terms of how PureBasic does it and not my own personal understanding.
Re: The & operator
Posted: Sun Feb 07, 2010 6:03 pm
by Rescator
Does the court understand what a bit is at all? (hope so) if not you'll have to explain that as well.
I have no idea how to explain that easily myself.
To me a bit is the same as: "true" or "false", either something "is" or "is not", "yes" or "no", and a bitmask or byte etc. is the same just a sequence is/is not's.
Maybe you'll find some wording ideas here:
http://www.gamedev.net/reference/articl ... le1563.asp
http://en.wikipedia.org/wiki/Base_2
Re: The & operator
Posted: Mon Feb 08, 2010 9:12 pm
by SFSxOI
Thanks to everyone that replied, everything helped formulate an answer that was further reduced to a "graphic example" by the DA so a child could understand and it worked. Went back to court this morning, briefly; The defense resumed questioning, but he went with other questions and did not touch on the subject again. Then he used the words "unorthodox methods" and at this the DA objected saying that there were no facts to indicate that any "unorthodox methods" were used, and at this it was the DA's turn at bat now. We went back over each point, i carefully explained what a "bit" was and how it was used to determine a result in the method employed. Then the example was employed using tennis balls, three were green and three were orange. The balls were arranged in two groups, orange and green, then intermixed, for example, that for the question "Are all of these balls in this group green?" (or orange) the answer could only be one thing, either yes or no (true or false). Then the balls were labled 'PartA', 'PartB', and 'PartC', and the example was repeated, then related to the true/false, 1 or 0, question . The jury understood. The guy was convicted, $25,000.00 fine and two years.
Re: The & operator
Posted: Tue Feb 09, 2010 5:57 am
by Rescator
Good to hear, nice work SFSxOI.
I assume that the DA know understands computing a bit better than he used too as well? *laughs*
Kinda amusing that something so trivial partly became a case turner.
A shame there rarely are any programmers or computer engineers as a member of the jury.
Good thing the DA had you though, and the PureBasic community as a facts army heh.
So when will this air on CSI? *kidding*

Re: The & operator
Posted: Tue Feb 09, 2010 8:06 am
by Baldrick
I think it would be pretty safe to assume then that this now convicted guy is somewhat more than a "BIT" unhappy atm......

Re: The & operator
Posted: Sun Feb 21, 2010 12:05 pm
by Ziltch
good job
Re: The & operator
Posted: Sun Feb 21, 2010 12:16 pm
by UserOfPure
I can't believe you didn't say "Yes" when asked if PureBasic was a mainstream programming language.
Re: The & operator
Posted: Mon Feb 22, 2010 6:01 pm
by LuaDev
man, that was a very interesting read
seems to me the defence was just trying to discredit your use of "&" as opposed to the boolean comparison that was actually going on, his programmers must have examined your code and this little thing was there only way out, and after the recess his team would have been advised that you are now well prepared to explain every aspect of your use of this particular operator and did not approach the subject again knowing there little tactic would not work a 2nd time
well done

, nice to hear a cyber crim got his due's