Heating Cooling Flows with Weak Shock Waves