Random point in a d-dimensional ball
For the latter, this discussion is a good starting point.  For the former, I guess finding a random point in the ball, rounding it to a grid point, then checking that grid point is in the ball.