General Computer Science for Engineers CISC 106 Lecture 03 James Atlas Computer and Information Sciences 2/17/2010.

Slides:



Advertisements
Similar presentations
By: Tony Andrews.  Linux directory ordering system  Navigating and creating directories ◦ Listing directories and files ◦ Creating directories ◦ Changing.
Advertisements

CSE1222: Unix IntroThe Ohio State University1. Common Directory Commands  lsList directory contents  cd {dir}Change working directory to {dir}  pwdPrint.
Learning Unix/Linux Bioinformatics Orientation 2008 Eric Bishop.
General Computer Science for Engineers CISC 106 Lecture 01 James Atlas Computer and Information Sciences 9/2/2009.
General Computer Science for Engineers CISC 106 Lecture 02 James Atlas Computer and Information Sciences 6/10/2009.
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.
Lecture 01CS311 – Operating Systems 1 1 CS311 – Lecture 01 Outline Course introduction Setting up your system Logging onto the servers at OSU with ssh.
UNIX Command-line Introduction Terence Parr. Navigating  cd  pwd  ls  pushd/pod  cd  pwd  ls  pushd/pod.
Embedded Programming and Robotics Lesson 13 Basic Linux 1.
1 SEEM3460 Tutorial Unix Introduction. 2 Introduction What is Unix? An operation system (OS), similar to Windows, MacOS X Why learn Unix? Greatest Software.
CS 141 Labs are mandatory. Attendance will be taken in each lab. Make account on moodle. Projects will be submitted via moodle.
Using Macs and Unix Nancy Griffeth January 6, 2014 Funding for this workshop was provided by the program “Computational Modeling and Analysis of Complex.
GETTING STARTED USING LINUX UBUNTU FOR A MULTI-USER SYSTEM Team 4 Lab Coordinator Manager Presentation Prep Webmaster Document Prep Faculty Facilitator.
Learning basic Unix command IT 325 operating system.
File Systems Sources and Resources: 1. A Students Guide to UNIX, by Hahn 2. Paula Davidson’s Handout on UNIXHandout on UNIX.
© Crown copyright Met Office An Introduction to Linux PRECIS Workshop, University of Reading, 23rd – 27th April 2012.
Linux Directory Navigation. File & Directory Commands This is a minimal list of Unix commands that you must know for file management: ls (list) mkdir.
Working with Files Chapter 5. Display a Calendar Display a calendar for a specific month – cal Display a calendar for a specific year – cal 2000.
General Computer Science for Engineers CISC 106 Lecture 07 James Atlas Computer and Information Sciences 06/29/2009.
Dedan Githae, BecA-ILRI Hub Introduction to Linux / UNIX OS MARI eBioKit Workshop; Nov , 2014.
PROGRAMMING PROJECT POLICIES AND UNIX INTRO Sal LaMarca CSCI 1302, Fall 2009.
General Computer Science for Engineers CISC 106 Lecture 01 James Atlas Computer and Information Sciences 6/8/2009.
Session 2 Wharton Summer Tech Camp Basic Unix. Agenda Cover basic UNIX commands and useful functions.
UNIX Commands. Why UNIX Commands Are Noninteractive Command may take input from the output of another command (filters). May be scheduled to run at specific.
General Computer Science for Engineers CISC 106 James Atlas Computer and Information Sciences 2/10/2010.
Introduction to UNIX Road Map: 1. UNIX Structure 2. Components of UNIX 3. Process Structure 4. Shell & Utility Programs 5. Using Files & Directories 6.
Introduction to UNIX Geraint Vaughan. What is UNIX? Command-line operating system (not point- and click) Designed for ‘experts’ Lots of different variants.
Chapter 9 Basic File Processing. Displaying File Contents cat, cat w/append tac nl pr more less head tail.
General Computer Science for Engineers CISC 106 Lecture 02 Dr. John Cavazos Computer and Information Sciences 2/13/2009.
1May 16, 2005 Week 2 Lab Agenda Command Line FTP Commands Review More UNIX commands to learn File name expansion - * Introduction of vi.
Intro to UNIX Presented by: Student Ambassadors: Lauren Lewis Martin Sung.
E X C E E D I N G E X P E C T A T I O N S Basic LINUX Linux System Administration Dr. Hoganson Kennesaw State University Operating Systems Directory structure:
File Systems, telnet and ftp Sources and Resources: 1. A Students Guide to UNIX, by Hahn 2. Paula Davidson’s Handout on UNIXHandout on UNIX.
COP3502: Introduction to Computer Science Yashas Shankar Lecture #2.
2 Manual & Filestore Mauro Jaskelioff. Introduction Using the manual The UNIX filestore File permissions.
Intro. To Unix commands For those who’ve never used Unix before Quick tutorial to let you move around your Unix Accounts No discussion of inner workings.
General Computer Science for Engineers CISC 106 Lecture 13 - Midterm Review James Atlas Computer and Information Sciences 10/02/2009.
General Computer Science for Engineers CISC 106 Lecture 15 Dr. John Cavazos Computer and Information Sciences 03/16/2009.
Makefiles1 MAKEFILES Purpose: contain UNIX commands and will run them in a specified sequence. Syntax Definition : { Section-name: {unix command #1} …
Files and Directories in UNIX The first file in UNIX file system is “root” or “/”
Basic Unix Commands & GCC Saurav Karmakar Spring 2007.
Unix Environment Basics CSCI-1302 Lakshmish Ramaswamy.
Linux A practical introduction. 1)Background and Getting Started Linux is an operating system with multiple providers Red Hat/CentOS (our version) Ubuntu.
Linux Stuff Last Update Copyright 2014 Kenneth M. Chipps Ph.D. 1.
 Last lesson, the Windows Operating System was discussed along with the Windows command shell  Unix is a computer operating system, that similarly manages.
General Computer Science for Engineers CISC 106 Lecture 14 James Atlas Computer and Information Sciences 08/10/2009.
The Unix File sytem. Introduction Tree structure …
Basic Unix Commands. Listing files and directories ● ls:command is used to list the files and ● directories in present working directory ● ls command.
EMT 2390L Lecture 3 Dr. Reyes Reference: The Linux Command Line, W.E. Shotts.
Learning basic Unix command It 325 operating system.
Dr. Sajib Datta Jan 16,  The website is up.  Course lectures will be uploaded there ◦ Check regularly for assignments and update.
General Computer Science for Engineers CISC 106 Lecture 02 James Atlas Computer and Information Sciences.
General Computer Science for Engineers CISC 106 Lecture 03 James Atlas Computer and Information Sciences 6/15/2009.
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.
Learning Unix/Linux Based on slides from: Eric Bishop.
General Computer Science for Engineers CISC 106 Lecture 03 James Atlas Computer and Information Sciences 9/9/2009.
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.
Getting started with CentOS Linux
Commands Basic syntax of shell commands UNIX or shell commands have a basic structure command -options target command comes first (such as cd or ls) any.
Andy Wang Object Oriented Programming in C++ COP 3330
Some Linux Commands.
Introduction to UNIX UNIX developed at Bell Labs in 70s
Operating Systems and Using Linux
Operating Systems Lecture 5.
The Unix File System.
Getting started with CentOS Linux
Andy Wang Object Oriented Programming in C++ COP 3330
Tutorial Unix Command & Makefile CIS 5027
Lab 2: Terminal Basics.
Presentation transcript:

General Computer Science for Engineers CISC 106 Lecture 03 James Atlas Computer and Information Sciences 2/17/2010

Operations on Data Types 5.5 single(5.5) int8(5) int8(500) ? int8(‘c’) ? char(98) ? >> x = 5.5 >> whos x

Expressions Data and Operator ◦ ◦ circleArea(5)

Expressions Data and Operator ◦ ◦ circleArea(5) Nested Expressions ◦ circleArea(circleArea(5 + 2) + circleArea(3))

Unix Commands When you log into a UNIX terminal ◦ You are in your home directory. ◦ To see the files in your directory.  ls ◦ To make an new folder/directory.  mkdir exampledir ◦ To change directories.  cd exampledir ◦ To go back one directory.  cd.. ◦ To go back to your home directory.  cd

Handling files cp file1 file2 ◦ copy file1 and call it file2 mv file1 file2 ◦ move or rename file1 to file2 rm file ◦ remove a file rmdir exampledir ◦ remove a directory cat file ◦ display contents of a file less file ◦ display a file a page at a time

Function documentation Contract Purpose Examples Author

Sample function circleArea.m %circleArea(number) -> number % This function computes the area of a circle % given the radius. % % circleArea(3) -> 28 % circleArea(5) -> 78 % circleArea(45) -> 6362 % %Authors: James Atlas %CISC106 Lab Section 45 TA: Scott Ivanka function output = circleArea(radius) output = pi * radius * radius;

Sample function circleArea.m %circleArea(number) -> number % This function computes the area of a circle % given the radius. % % circleArea(3) -> 28 % circleArea(5) -> 78 % circleArea(45) -> 6362 % %Authors: James Atlas %CISC106 Lab Section 45 TA: Scott Ivanka function output = circleArea(radius) output = pi * radius * radius; Contract Purpose

Group Exercise

Write one for function ringArea.m Contract Description Examples

Conditions When you want to make a decision based on data “If traffic light is red, stop”

Conditions When you want to make a decision based on data “If traffic light is red, stop” ◦ Involves some comparison operator between data and a known value ◦ known value = red ◦ data = current state of the traffic light ◦ comparison operator is “equals”

Conditions When you want to make a decision based on data “If traffic light is red, stop” ◦ Involves some comparison operator between data and a known value ◦ known value = red ◦ data = current state of the traffic light ◦ comparison operator is “equals”  “If current state of traffic light equals red, stop”

Traffic Light Example function out = trafficLight(currentColor) if (currentColor == 'R') out = 'stop'; elseif (currentColor == 'Y') out = 'slow'; else out = 'go'; end

Condition operators equals ◦ == not equals ◦ ~= greater than ◦ > ◦ >= less than ◦ < ◦ <=

Simple Input/Output fav = input(‘Enter your favorite number\n’); if (fav >= 0) disp(‘You like positive numbers’); else disp(‘You like negative numbers’); end fprintf(‘Your favorite number is %d’, fav);

Lab01 Practice some unix commands Matlab file test_sumThreeInts.m ◦ an example of a “unit test” Create new functions