Diashow code not working, full with errors

i couldnt select it, because the "port" option is grey when you open it under tools
i looked it up on the internet but no solution