SAN FRANCISCO — The heroin needles, the pile of excrement between parked cars, the yellow soup oozing out of a large plastic bag by the curb and the stained, faux Persian carpet dumped on the corner.

It’s a scene of detritus that might bring to mind any variety of developing-world squalor. But this is San Francisco, the capital of the nation’s technology industry, where a single span of Hyde Street hosts an open-air narcotics market by day and at night is occupied by the unsheltered and drug-addled slumped on the sidewalk.

There are many other streets like it, but by one measure it’s the dirtiest block in the city.

Just a 15-minute walk away are the offices of Twitter and Uber, two companies that along with other nameplate technology giants have helped push the median price of a home in San Francisco well beyond $1 million.

This dichotomy of street crime and world-changing technology, of luxury condominiums and grinding, persistent homelessness, and the dehumanizing effects for those forced to live on the streets provoke outrage among the city’s residents. For many who live here it’s difficult to reconcile San Francisco’s liberal politics with the misery that surrounds them.