1 / 32

Intro to Programming Environment

Intro to Programming Environment. Today You Will. Learn how to connect to a machine remotely with “nomachine NX client” Learn how to create a new “source file” with an editor (gedit) Learn how to edit a perl program Learn how to execute a program You will learn some basic Linux commands.

ianna
Download Presentation

Intro to Programming Environment

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Intro to Programming Environment

  2. Today You Will • Learn how to connect to a machine remotely with “nomachine NX client” • Learn how to create a new “source file” with an editor (gedit) • Learn how to edit a perl program • Learn how to execute a program • You will learn some basic Linux commands

  3. Background • Our development platform of choice is Linux (specifically Open Suse) http://en.opensuse.org (if you are curious) • Our interpretor of choice is perl http://www.perl.org/(if you are curious) • Why do we have to use Linux when XP/MacOSX/Vista/Sun is the best OS and Bill Gates/Steven Jobs/Scott MacNealy is the smartest/richest person in the world?

  4. Linux • Reasons for using Linux: • Open source means we have access to every line of code • Open source means we have control over the OS • Cost • Uniform platform (that way when you write your program on Linux and you get it to work, the TA can run it on Linux and it will also work) • The college of engineering is currently supporting this platform

  5. For subsequent connections, you only need to use the “NX Client for Windows” The FIRST time you connect, you will use the “NX Connection Wizard”

  6. Check this box if you want a Shortcut created on your desktop

  7. Click to close annoying “Useful Tips”

  8. Click here to Open menu

  9. Click on Applications then Utilities Scroll down: HINT – if you don’t get the scroll bar – you can just use the “arrow down” on the keyboard. Click on “Utilities”

  10. Select “Editor”

  11. Select “Text Editor gedit”

  12. Now we have a screen in which we can type in a program

  13. Type in one of the world’s simplest programs

  14. File -> Save AS…

  15. Type in file name – hello.c The “dot-c” is a convention to specify that this is actually a “C” source file Enter file name: Note – the procedure for saving files in discussion will be slightly more complicated – the TA’s will cover that in discussion

  16. Does your program “look” any different now?

  17. Now select “Applications” --> “System”  “Terminal”  “Terminal Program Konsole”

  18. Your screen will look something like this.

  19. ls – command lists all files/directories Note the “hello.pl” file Also – you are likely to have different files in your account (my directory is a mess and should probably be “cleaned up.”)

  20. perl hello.pl -- this executes your source code

  21. Unix and Linux basics: • ls – list files and directories • perl – invoke the interpreter • gedit – start our editor from the command line • mkdir dir1 – make a directory with the name “dir1” (aka called folders by Windows and Mac users) • cd dir1 – navigate down one directory level to “dir1” • cd .. – move up one level in a directory structure • rm hello.pl – this will permanently remove the file “hello.pl” CAUTION – once you do this – there is NO getting your file back (you can also rm a directory once it is empty of files) • There is also a way to rm multiple directories/files – but maybe we’ll show that at a later time

  22. Navigating a File System • Students tend to be more comfortable navigating a file system with Windows because of the graphical representation • Ex.) My Computer  (C:) Local Disk  Documents and Settings , etc…. • However, the concept is the same with Linux • cd My Computer/Local Disk/Documents and Settings • You can navigate “down” (or up) multiple levels with “cd”

  23. Your CSS account and “home” • All CSS accounts have a “home” directory • cd – without any parameters always takes you to your “home” directory • pwd – print working directory Note that if you perform ‘pwd’ before you ‘cd’, you will see a “strange’ home directory – this has to do with how the drives are shared across the network. These are in fact the same directory. After you ‘cd’ – you will always see /usr/eng/tbraun $ cd $ pwd /usr/eng/tbraun $ pwd /nfs/server00/local/vol00/t/b/tbraun

  24. Making a directory, and traversing mkdir EPS2 cd EPS2 mkdir hw1 cd hw1 gedit hw1.pl (save and quit) cd cd EPS2/hw1 cd ..

  25. ENDING your session After you click the little red button below – after a few seconds, this entire window will close. To end your connection – click this little red button

  26. Connecting from off-campus • You may download and install the “NX client” from virtually any machine including PC, Macs, and Linux http://www.nomachine.com/download.php Select “NX Client for Windows” if you are using Windows, etc.

  27. Other ways of doing things • You should play around with the desktop. • You will find there are multiple ways to navigate (try My Computer -> My Home Folder)

More Related