Messenger and Non-Coding RNA Design via Expected Partition Function and Continuous Optimization