This is horrible, and we as a society need to somehow make this kind of thing not happen. I have no idea what that means in practice, though. It seems everything that has been tried so far has only escalated the hatred and strengthened the extremists. Also, at a time like this it is important not to forget that the last major terrorist attack in Europe was instigated by a fundamentalist christian norwegian. https://e…
However horrible it may sound, I think our best course of action is to accept that these things do happen occasionally. That doesn't mean we shouldn't fight them, and that doesn't mean we shouldn't do our best to prevent them, but it does mean that we must accept that we'll never get to 100%.
If we can move forward with the idea that we'll do our best to reduce these attacks as much as possible, rather than with the idea that we'll eliminate them, I think the result will be much better.
As for what to do, I think the combination of smart intelligence (as opposed to NSA-style dragnets) and emergency response (to minimize the effects of attacks after they happen) are the way to go.
Edit: whee, downvotes. If you think I'm wrong, or even just right but insensitive, would you mind explaining yourself instead of (or, heck, in addition to) downvoting? I honestly don't see anything wrong with my comment.