Making the script self-contained in one file.
C++ samples can be run in command-line in *nix system only.