Programmable Nanophotonic Devices Achieved