Arduino only runs sketch maybe 1 in 10 times

My Arduino 101 was working flawlessly. Then after a while, working on a relatively large sketch, it started requiring a master reset pretty often when downloading the script. Then requiring it every time, even for very small and simple sketches. And now, after the reset, it says success: sketch will execute in about 5 seconds. But then it just doesn't work. This is most of the time now. Every once in a while it will actually work.

Has something gone bad in the Arduino? Can I do something to fix it?

You could try a different power supply.

Right now its just getting power from the usb connection to the computer.

I tried to do the loopback test and basically it is just continually connecting and disconnecting from the computer.

The port menu on IDE is grayed out and unclickable.

OK, I think I solved it. I have had a gps receiver plugged into the board, sending data into a softwareserial port. I think maybe that data was screwing things up. When I unplug the jumper from the pin assigned for softwareserial, then download the sketch, then plug the pin back in, everything works fine.