Powering Arduino

Hi, I have Arduino UNO R3 and MEGA 2560 R3. Usually I supply power to the board using a usb port of my laptop computer when I program the board. If I want my system to be autonomous, I have to use a battery source to supply power to the board. Will I damage the Arduino board if I connect the board to the usb port of my computer and also to the battery source at the same time?

Am I right that after I have downloaded the program to the board, I can remove the power source from the board completely. When I connect the power source to the board and turn on the board again, the program will still be there and the board will execute the program?

No.

johnwasser:
No.

No to which question?

I won't damage the Arduino board if I connect the board to the usb port of my computer and also to the battery source at the same time

or

If I disconnect and then reconnect the power source to the board and turn on the board again, the program will still be there and the board will execute the program?

Sorry. "No." to the first question.

Yes, to the second. Your sketch is saved in FLASH and will start at the beginning when you power up or reset the board.

Thank you