New conditions for global stability of neural networks with application to linear and quadratic programming problems