I actually live near San Francisco, so I know a little bit more about the situation. Most (read: all but maybe 5-6) of the murders are centered in a relatively poor part of the city called Bayview-Hunter's Point. I've walked around other parts of the city late at night and felt perfectly safe. It's a very... localized problem, so maybe a blanket solution isn't the absolute best answer. I don't know how it works, I'm not a police officer, but maybe in the precint(s) near Bayview-Hunter's Point they can pass out rifles, and keep the rich people and hippies in Pacific Heights and the Haight happy. The mayor recently said that if he doesn't solve the crime problem there, the voters should feel free to recall him.
The DA was only elected because everybody hated the incumbent, not because people actually like her.
The police officer killed was a undercover officer who apparently volunteered to do gang intervention to try to help his community.
The Police Commissioner, like in any big city, is a political appointee. And many San Franciscans don't like guns. The biggest problem in many parts of the city is overzealous homeless people and loud music.