Review Why do we use protection levels? Why do we use constructors?

Slides:



Advertisements
Similar presentations
Linux commands exercise 1. What do you need, if you try to these at home? You need to download and install Ubuntu Linux from the Internet – DVD is need.
Advertisements

Learning Unix/Linux Bioinformatics Orientation 2008 Eric Bishop.
Introduction to the gedit editor. gedit: the Gnome editor Gnome: Gnome is a freely available (i.e., no cost) desktop environment for the UNIX system The.
Dayu Zhang 9/8/2014 Lab02. Example of Commands pwd --- show your current directory This is home of venus, not your home directory Tilde: means you are.
Introducing the Command Line CMSC 121 Introduction to UNIX Much of the material in these slides was taken from Dan Hood’s CMSC 121 Lecture Notes.
Working Environment - - Linux - -.
1 ENERGY 211 / CME 211 Lecture 2 September 24, 2008.
Dayu Zhang 9/3/2014 Lab01. Lab Instructor: Dayu Zhang Office Hour Mon/Wed 10:40am – 11:10am Room A201 Lab Website
Course Introduction and Getting Started with C 1 USF - COP C for Engineers Summer 2008.
1 SEEM3460 Tutorial Unix Introduction. 2 Introduction What is Unix? An operation system (OS), similar to Windows, MacOS X Why learn Unix? Greatest Software.
A crash course in njit’s Afs
Using Macs and Unix Nancy Griffeth January 6, 2014 Funding for this workshop was provided by the program “Computational Modeling and Analysis of Complex.
The Unix Environment and Compiling. Getting Set Up Your programs will be compiled and tested on the Departmental server ‘linprog’ The linprog servers.
Overview of Linux CS3530 Spring 2014 Dr. José M. Garrido Department of Computer Science.
Unix Primer. Unix Shell The shell is a command programming language that provides an interface to the UNIX operating system. The shell is a “regular”
CSE 390a Editing and Moving Files
Linux environment ● Graphical interface – X-window + window manager ● Text interface – terminal + shell.
Essential Unix at ACEnet Joey Bernard, Computational Research Consultant.
1 SEEM3460 Tutorial Unix Introduction. 2 Introduction Unix-like system is everywhere Linux Android for smartphones Google Chrome OS for Chromebook Web.
AN INTRO TO UNIX/LINUX COMMANDS BY: JIAYANG WANG.
Computing Fundamenatls CMSC 201 Computer Science I Penny Rheingans University of Maryland Baltimore County (with inspiration from previous 201 instructors.
PROGRAMMING PROJECT POLICIES AND UNIX INTRO Sal LaMarca CSCI 1302, Fall 2009.
Just as there are many human languages, there are many computer programming languages that can be used to develop software. Some are named after people,
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 6 System Calls OS System.
Getting started: Basics Outline: I.Connecting to cluster: ssh II.Connecting outside UCF firewall: VPN client III.Introduction to Linux IV.Intoduction to.
Introduction to UNIX Geraint Vaughan. What is UNIX? Command-line operating system (not point- and click) Designed for ‘experts’ Lots of different variants.
CGS 3460 Why we choose UNIX n Powerful lMulti-user operating system lGood programming tools Most heavy-duty database management systems started out on.
Intro to Programming Environment 1. Today You Will Learn how to connect to a machine remotely with “nomachine NX client” Learn how to create a new “source.
CS 245 – Part 1 Using Operating Systems and Networks for Programmers Jiang Guo Dept. of Computer Science California State University Los Angeles.
Object Oriented Programming COP3330 / CGS5409.  Assignment Submission Overview  Compiling with g++  Using Makefiles  Misc. Review.
Unix Servers Used in This Class  Two Unix servers set up in CS department will be used for some programming projects  Machine name: eustis.eecs.ucf.edu.
AN INTRO TO UNIX/LINUX COMMANDS BY: JIAYANG WANG.
Linux A practical introduction. 1)Background and Getting Started Linux is an operating system with multiple providers Red Hat/CentOS (our version) Ubuntu.
 Last lesson, the Windows Operating System was discussed along with the Windows command shell  Unix is a computer operating system, that similarly manages.
Object Oriented Programming COP3330 / CGS5409.  Compiling with g++  Using Makefiles  Debugging.
Linux Tutorial Lesson Two *Getting Help in Linux *Data movement and manipulation *Relative and Absolute path *Processes Note: see chapter 1,2,3 from Linux.
CS 120 Extra: The CS1 Server Tarik Booker CS 120.
Object Oriented Programming COP3330 / CGS5409.  Assignment Submission Overview  Compiling with g++  Using Makefiles  Misc. Review.
Assignprelim.1 Assignment Preliminaries © 2012 B. Wilkinson/Clayton Ferner. Modification date: Jan 16a, 2014.
CMSC 104, Version 9/011 Operating Systems and Using Linux Topics What is an Operating System? Linux Overview Frequently Used Linux Commands Reading None.
Chapter 3: Mastering Editors Chapter 3 Mastering Editors (Emacs)
Chapter 1: Introduction to Computers and Programming
Overview of Linux Fall 2016 Dr. Donghyun Kim
Introduction to Unix for FreeSurfer Users
Precept I : Lab Environment, Unix, Bash, Emacs
ENEE150 Discussion 01 Section 0101 Adam Wang.
UNIX To do work for the class, you will be using the Unix operating system. Once connected to the system, you will be presented with a login screen. Once.
Class Projects and Environment
Tutorial of Unix Command & shell scriptS 5027
CS1010: Intro Workshop.
Web Programming Essentials:
Andy Wang Object Oriented Programming in C++ COP 3330
Computing Fundamenatls CMSC 201 Computer Science I Penny Rheingans University of Maryland Baltimore County (with inspiration from previous 201 instructors.
Compilation and Debugging
Compilation and Debugging
Part 3 – Remote Connection, File Transfer, Remote Environments
Assignment Preliminaries
File Transfer Olivia Irving and Cameron Foss
Intro to UNIX System and Homework 1
Md. Istiaque Shahriar COMP346 Lab1 - How to start? Md. Istiaque Shahriar
Operating Systems and Using Linux
Operating Systems and Using Linux
Web Programming Essentials:
Andy Wang Object Oriented Programming in C++ COP 3330
Class Projects and Environment
Video Notes.
Lab 2: Terminal Basics.
Review of Previous Lesson
SPL – PS1 Introduction to C++.
DIBBs Brown Dog Tutorial Setup
Presentation transcript:

Review Why do we use protection levels? Why do we use constructors? How can we tell if a function is a constructor? What is a default constructor? How do we pass arguments to a constructor?

Unix Environment and Compiling Protection Levels and Constructors

Computer Science Accounts All your programs should compile and run correctly on the departmental programming server linprog.cs.fsu.edu. Actually 4 different computers (linprog1, linprog2, ...) If you do not have an account, the CS Systems Group has instructions for obtaining one here. To access the departmental server (Windows Users) should download an Secure Shell Client (SSH) like this one. Mac and Linux users should have SSH built in. Just open a terminal (Terminal-app on Mac) and type: ssh -X youraccountname@linprog.cs.fsu.edu

Basic Unix Commands ls – list files and directories in current directory cd <directory> - change current directory to <directory> cd .. – change directory to next up in hierarchy cd ~ - change directory to your home directory mkdir <dir> - create sub-directory <dir> in current directory rm <filename> – remove file <filename> rm –R <directory> – remove directory and all its subdirectories cat <filename> - output text of <filename> to screen more <filename>- similar to cat, allows scrolling man <keyword> - displays manual page for various unix and programming concepts

Emacs Emacs is a powerful Unix text editor that you can use to edit your programs on linprog Type ‘emacs <filename>’ to open/create file <filename> for editing X11 is a windowing system that allows linprog to display windows on your local machine. X11 comes with OS X and Linux. Windows users can download here. If X11 is running, you may type ‘&’ at the end of the command to retain terminal access while emacs is running (‘&’ is the background modifier for Unix commands)

Emacs Tips I have posted a file called .emacs in the sample directory, you can copy this to your home folder to turn on line numbering and syntax highlighting in emacs In the windows SSH client, you may want to edit the preferences to send delete when backspace is typed or backspace will not work as intended Commands: You can use ctrl-k to cut multiple lines an ctrl-y to paste them ctrl-x-s is used to save the file (Hold ctrl, type x and release x, type s and release s, then release control) ctrl-x-c quits emacs ctrl-g aborts a command if you find emacs has ‘frozen’ ctrl-s allows you to search the file for a keyword You can find other emacs commands here

Transferring Files To/From In Windows: The SSH client has a built in file transfer utility Connect to linprog, click the File Transfer Utility button on the SSH client, your machines files are on the left, linprog’s file system is on the right, you may drag and drop files back and forth In OS X/Linux: Use the scp/sftp tools To copy files to linprog type ‘scp <localfilepath> linprog.cs.fsu.edu:~/where/you/want/it’ To copy files from linprog type ‘sftp linprog.cs.fsu.edu’ and then ‘get <filename>’

Multiple File Projects Although any program can be written in a single file, we often separate a program into several files: Header File – contain class declaration, ends in .h (circle.h) Implementation File – contains class definition (class member function implementations), ends in .cpp (circle.cpp) Driver File – contains main() and possibly other subroutines used in the program, ends in .cpp (driver.cpp) Many of the programs you submit in this class will have the above format.

Multiple File Projects continued Reasons for using multiple files: Allows changes to the class implementation without affecting the class interface/structure Allows a class to be used in multiple driver programs Increases the opportunities for code reuse Code becomes more modularized. It is infeasible to code a large project in a single file

Compiling Compiling is the process of converting a C++ language file into a language the computer understands (machine language) Compilation takes place in two primary phases: Compile Phase – Responsible for language translation. Linking Phase – Responsible for resolving references across files.

Compile Phase Performs preprocessor directives (#include, #define, etc.) Checks syntax of program (e.g. missing semicolon). Checks if functions/variables declared before use. Doest NOT check if functions that are used are defined. Creates machine code representation of file known as an object file (term not associated with ‘object-oriented’, customarily ends with .o extension). An object file is not executable and may have functions that are used but have no definition (implementation).

Linking Phase Links the object code/file(s) into a single executable program. The linking stage is the time when function calls are matched up with their definitions, and the compiler checks to make sure it has one, and only one, definition for every function that is called. All class member functions must also be defined during this phase. There must be a main() function (executable must know where to start).

Example: Compiling multi-file project See Fraction example again. g++ -c Fraction.cpp performs compile stage on Fraction.cpp and creates object file Fraction.o. g++ -c main.cpp performs compile stage on main.cpp and creates object file main.o. g++ main.o Fraction.o –o main.x links object files, code in main.o which references member functions of the Fraction class are linked to the definitions compiled in Fraction.o. Shortcut: g++ main.cpp Fraction.cpp -o main.x Performs compile and link phase in one step.