A little stupid question: when we build up a portfolio, how can we impose the restriction that the weights lie within [0,1] (which means short stocks is not allowed), and the summation of the weights is equal to 1? How do we write the code? Any reference are highly appreciated. Thanks, jessie