I am wondering what this line of code mean?
b = (gen_rand_uniform()>0.5)?1:0;
The gren_rand_uniform() is a function to generate
What you are seeing here is a ternary expression. http://en.wikipedia.org/wiki/Ternary_operation
This is (as others here has pointed out) a conditional construct, but one that is specific to expressions, meaning that a value is returned.
This construct exist in most languages (but not in eg. VB.Net) and has the form of
condition ? valueiftrue: valueiffalse
An example of this in action is:
var foo = true;
var bar = foo ? 'foo is true' : 'foo is false';
// bar = 'foo is true'
Also note that the condition can be any expression (like in your case gen_rand_uniform() > 0.5) and can infact contain a nested ternary expression, all it has to do is evaluate as a non-false value.