Introduction to CSM: tirgul 1 ############################ 1. Logining into the computer at the Lubin Building: ========================== a. creating a POB account Further information at http://ca.huji.ac.il/services/internet/mail/pob.shtml b. Logining into a work station 2. Internet: ======== a. The Internet \ WWW: 1. Basically, computers participate in a network and may send/receive messages to/from each other. 2. There are several browsers which can be used: netscape or Internet Explorer. 3. The course home-page: www.cs.huji.ac.il/~introcsm 4. Perform Register to the course through the register link (if you fail, try again). The link is at: http://www.cs.huji.ac.il/~introcsm/technical.html When you select it you will be asked for a login and password: login: Your I.D. number with the leading zero and without the control digit ('sifrat bikoret'). password: Your four digit secret number ('pinkas tashlumim'). c. Newsgroup: 1. The newsgroup is a media in which a group of people may have discussions about a certain topic or topics they're interested in. 2. You can read the local.course.introcsm.ta and local.course.introcsm.stud news groups by clicking on the links on Contact page of the course site. 3. The newsgroup enables you to: * read the posts. * post a message. * reply to a post (to newsgroup or to sender). 4. You should post in the introcsm newsgroups only things that may interest ALL of the students that participate in the course (such as questions about the exercises). Any personal stuff should be sent by email. 5. Set the news server to: nntpserver.cs.huji.ac.il In netscape under : Edit |- Preferences |_Mail & Newsgroups | -News group servers Select "Add" and enter nntpserver.cs.huji.ac.il d. Email: 0. You must open an email address on pob. 1. All of you have an email address: yourlogin@pob.huji.ac.il 2. The introcsm email is: introcsm@cs.huji.ac.il Use this email for personal problems (miluim, sickness, etc.). 3. If you are in the university you may use: @cs instead: @cs.huji.ac.il 4. There are many mail-applications, e.g. netscape ie5. 5. By using mail-application you may: * get messages * reply to messages * forward messages * delete messages * save messages in folders. 7. Exercise: send an email to yourselves. 8. Set the mail server to: pob.huji.ac.il In netscape under : Edit |- Preferences |_Mail & Newsgroups | -Mail servers Select "Add" in "incoming mail servers" and enter pob.huji.ac.il (Server type is POP3) In the "Outgoing mail (SMTP) server" enter pob.huji.ac.il and in "Outgoing mail server user name" enter your login (user name) 9. Another option is to read the mail using the following web page: http://webmail.huji.ac.il Each time you will have to choose the mail server (pob) and enter your login and password. 3. The Command Prompt Window: ========= To interact with the computer in a textual manner we must use a command prompt window. You may open a command prompt window by: a. Clicking on the 'Start' Button on your desktop. b. choosing 'Run' option c. in the command line write 'cmd'(win2000) or 'command' (win98) and click on the 'o.k' button or just press Enter. 4. The File System + Editor ======================== a. What is a file: everything we want the computer to remember, eventually, translates into a sequence of 0/1 bits which is called a file. b. We usually don't see the ones and zeros. For example the introcsm home-page is a file and so is any letter, program or document you will ever read or write. c. A file has attributes such as: * name * permissions (who may read/modify the file) * dates (creation modification etc.) * size * owner d. There are many operations we may apply on a file such as: * create * delete * read * modify * rename e. One of the ways to create or modify a file is by using an editor. The editor that you will use is called 'emacs' for windows. (free software that can be installed on your home p.c also. To invoke emacs just click on the icon on the computers desktop 'emacs ' f. Exercise: * using emacs, create and save a file named 'try.txt' that contains the string "hello" and a newline (press enter after the hello). g. The FILE-SYSTEM has a tree structure to help us stay organized. This means for example that: * Each of you have a home-directory named: H:\yourlogin * A directory may contain regular-files (such as 'try.txt' we created earlier) or other directories (that in turn may also contain other file or directories and so on ...). h. The disk space you have for saving your work is on disk 'H:', we also recommend to always save a copy of your work on a floppy disk. 5. Basic Prompt commands (for windows) Note: Most commands work on all windows versions 95,98,2000. some only on windows 2000. ==================== 1. dir: List files and directories. Options: /a: List all files including hidden ones (files starting with a '.'). /p: List all files page after page (used for long list of files) Example: type in your home-directory: 'dir' ; 'dir /s' ; 'dir /a' ; 'dir \temp' ; 'dir *.txt' 3. cd: Change current directory to the given directory. Special-directories: cd : your home directory .. : The parent directory cd ..\temp : The directory temp which lies in your parent directory (the directory above you). When no argument is given, change to your home-directory. 4. pwd (win2000): Print the current working directory. 5. mkdir: Create a new directory with a given name. Example: 'mkdir stam' ; 'dir' ; 'mkdir stam2' ; 'dir' 6. rmdir: Remove a given directory, works only if the directory is empty. Example: 'rmdir stam2' ; 'dir' 7. copy: Copy a given file to a given location. Example: * 'copy try.txt try_copy.txt' and 'dir' * 'cd stam' ; 'copy ../try.txt .' ; 'dir' 8. ren: Rename a given file to a given name. Example: * 'ren try.txt newname.txt' ; 'dir' ; 9. move: move/Rename a given file to a given location/naem Example: *'mv newname.txt ..\*.*' ; 'dir' ; 'dir ..' 10. del: Remove a given file. Example: 'del ../newname.txt' ; 'dir ..' 11.more: Type a given file's content. Example: 'cd ..' ; 'more try.txt' 16.jar: Combines multiple files into a single JAR archive file. You will use this application when you submit your solutions. This is needed since your solutions will use more than one file (with the exception of ex1) but you may submit only one file per exercise. Example: 1- We will create a JAR file named stam_tirgul.jar from the files 'try.txt' and 'try_copy.txt'. 2- We will submit this JAR file through the intro2cs home-page. 3- We will open the JAR file in a different directory (you should do that before submitting to check that everything is o.k.): * jar cfv stam_tirgul.jar try.txt try_copy.txt * submit though home-page using the 'stam_tirgul' link * mkdir check_jar copy stam_tirgul.jar check_jar cd check_jar jar xvf stam_tirgul.jar dir 6. Compiling and Running java programs =================================== a. To compile a java program just write the command 'javac a.java' (a.java is your programs text file) in a command window. This will create a class file from your text file. This can also be done inside some editors( for example editplus, emacs) Example: 'javac Hello.java' creates the file 'Hello.class'. b. To run a java program write the command 'java a' where 'a.class' is the file you previously created.