Segregated interactions in urban and online spaces