Polymer:metal nanoparticle devices with electrode-sensitive bipolar resistive switchings and their application as nonvolatile memory devices