Small-scale terrorist attacks are basically unstoppable in a free society. The American Right's fantasy of arming everybody won't stop it, and neither will liberal wishful thinking. When you want a society in which anybody can go out on a Friday night to attend a concert, you take the risk of a gunman shooting the place up.
One way to curb these attacks is to be less of a free society. You'll have to pass through metal detectors and have your bags x-rayed before entering a public building. Your communications and person will be subject to search and surveillance. Borders will be tightened against refugees and smugglers alike. People who look like attackers will be segregated into walled neighborhoods. A bit like Israel, basically.
But nobody wants to attack the problem at the source: a region mentally stuck hundreds of years in the past, with no hope except the illusory paradise offered by religion and perverted by extremists. It will probably take a horrifying expensive invasion and occupation, followed by generations of education and social mobility, to lift the Middle East out of this misery. And this is a cost no one will bear, so we shall continue to fight the symptoms.
My heart aches for Paris, but the truth is that I will not avoid visiting the city of lights for this. I refuse to let terrorists turn our civilization into something less.