33

Week Six Agenda Announcements Link of the week Midterm exam examples Review week four lab assignment This week’s expected outcomes Next lab assignment

Embed Size (px)

Citation preview

Page 1: Week Six Agenda Announcements Link of the week Midterm exam examples Review week four lab assignment This week’s expected outcomes Next lab assignment
Page 2: Week Six Agenda Announcements Link of the week Midterm exam examples Review week four lab assignment This week’s expected outcomes Next lab assignment

Week Six Agenda• Announcements• Link of the week• Midterm exam examples• Review week four lab assignment• This week’s expected outcomes• Next lab assignment• Review midterm exam• Break-out problems• Upcoming deadlines• Lab assistance, questions and answers

Page 3: Week Six Agenda Announcements Link of the week Midterm exam examples Review week four lab assignment This week’s expected outcomes Next lab assignment

Link of the week http://www.cert.org/homeusers/HomeComputerSecurity/

This Wed site provides useful information on how to secure your home computer, things you ought to know, and what should be done to secure a home computer.

http://www.istl.org/02-fall/internet.html

Science and Technology Resources on the Internet

Computer Security

This article is written by Jane F. KinKus, who is a Mathematical Sciences Librarian.

Page 4: Week Six Agenda Announcements Link of the week Midterm exam examples Review week four lab assignment This week’s expected outcomes Next lab assignment

Link of the week

• Define: Trusted System is on that is replied upon to a specific extent to enforce a specific security policy.

• Define: Trusted Computing means that a computer will consistently behave in specific ways, and those behaviors will be enforced by hardware and software.

• Where are trusted systems utilized? Homeland security, law enforcement, and social control

Page 5: Week Six Agenda Announcements Link of the week Midterm exam examples Review week four lab assignment This week’s expected outcomes Next lab assignment

Midterm exam examples

Page 6: Week Six Agenda Announcements Link of the week Midterm exam examples Review week four lab assignment This week’s expected outcomes Next lab assignment

Midterm exam examples

Page 7: Week Six Agenda Announcements Link of the week Midterm exam examples Review week four lab assignment This week’s expected outcomes Next lab assignment

Midterm exam examples

Page 8: Week Six Agenda Announcements Link of the week Midterm exam examples Review week four lab assignment This week’s expected outcomes Next lab assignment

Review week five lab assignmentkill command

Used to send a signal to another process.

PID

An integer used by the UNIX kernel to uniquely identify a process. PIDs are returned by the fork system call and can be passed to wait() or kill() to perform actions on the given process.

test_build.sh

This script is used to execute the make command which in turn calls the makefile.

test_build.sh -> make -> makefile

Page 9: Week Six Agenda Announcements Link of the week Midterm exam examples Review week four lab assignment This week’s expected outcomes Next lab assignment

Review week five lab assignment

SourceFile

SourceFile

SourceFile

SourceFile

SourceFile

Object File

Object File

ObjectFile

Object File

ObjectFile

LinkerRuntimeLibrary

ExecutableProgram

Source/Object/Executable Drawing

Page 10: Week Six Agenda Announcements Link of the week Midterm exam examples Review week four lab assignment This week’s expected outcomes Next lab assignment

Review week five lab assignment

Define make command: The make utility is a software engineering tool for

managing and maintaining computer programs. Make provides most help when the program consists of many component files. As the number of files in the program increases so to does the compile time, complexity of compilation command and the likelihood of human error when entering command lines, i.e. typos and missing file names.

Page 11: Week Six Agenda Announcements Link of the week Midterm exam examples Review week four lab assignment This week’s expected outcomes Next lab assignment

Review week five lab assignment

Define the makefile: Make goes through the makefile (descriptor) file first

starting with the target it is going to create. Make looks at each of the target’s dependencies to see if they are listed as targets. It follows the chain of dependencies until it reaches the end of the chain and then begins backing out executing the commands found in each target's rule. Actually every file in the chain may not need to be compiled. Make looks at the time stamp for each file in the chain and compiles from the point that is required to bring every file in the chain up to date. If any file is missing it is updated if possible.

Page 12: Week Six Agenda Announcements Link of the week Midterm exam examples Review week four lab assignment This week’s expected outcomes Next lab assignment

Review week five lab assignment

Makefile Components• Comments within a makefile (#)• makefile continuation lines (\)• Rule tells make both when and how to make a file• Dependency Line is a line with a colon (:) test_build.sh contains the make command which

calls the makefile. The test_build.sh script is located in the /tmp directory.

• Demonstrate makefile script under ~dandrear/temp (cs.franklin.edu)

Page 13: Week Six Agenda Announcements Link of the week Midterm exam examples Review week four lab assignment This week’s expected outcomes Next lab assignment

Review week five lab assignment

Key Points About makefile • Makefile recompiles all source files for an

entire project.• Makefile recompiles only those files that

have different time stamps.• Bottom up control flow.• Rules are shell commands.

Page 14: Week Six Agenda Announcements Link of the week Midterm exam examples Review week four lab assignment This week’s expected outcomes Next lab assignment

Review week five lab assignment

Other software products that perform similar bundling operations

- ANT developed by Apache Jakarta- ANT2 supplied from the Free Software Foundation which is part of Red Hat.

What is a dependency between source files?main.cpp employee.cpp address.cpp

Page 15: Week Six Agenda Announcements Link of the week Midterm exam examples Review week four lab assignment This week’s expected outcomes Next lab assignment

Review week five lab assignment

What are the two parts of a dependency rule? 1) What files a file is dependent on

2) Rule that tells how to recompile the fileExample

Target : Dependencies (prerequisites)<tab> Rule

The rules in a makefile are executed based on dependency, and not sequential order. Scripts execute in sequential order.

What are the differences between a makefile and a shell script?

Page 16: Week Six Agenda Announcements Link of the week Midterm exam examples Review week four lab assignment This week’s expected outcomes Next lab assignment

Review week five lab assignment

Makefile Example• The file names used in this example have been

abbreviated for simplicity. • C++ compilations end in .cpp suffix.• The .c suffix extension causes the C compiler to be

invoked.• The .o suffix represents a object file.• The .h suffix represents a header file.• The g++ is a compiler, and not a preprocessor. G++

builds object code from your C++ program source.• The –c option, compiles source to object code.• The –o option, compiles object code.

Page 17: Week Six Agenda Announcements Link of the week Midterm exam examples Review week four lab assignment This week’s expected outcomes Next lab assignment

Review week five lab assignment# The executable file for this project is prog. prog : a.o b.o c.o g++ -o a.o b.o c.oa.o : prog.h a.c g++ –c prog.h a.cb.o : prog.h b.c g++ –c prog.h b.c# The c.c source file is compiled and the object file is c.o.c.o : c.c

g++ –c c.c# The c.c is dependent on c.y to be present.c.c : c.y# The rules below are shell commands.

g++ -c c.ymv y_table.c c.y

Page 18: Week Six Agenda Announcements Link of the week Midterm exam examples Review week four lab assignment This week’s expected outcomes Next lab assignment

Review week five lab assignment

Page 19: Week Six Agenda Announcements Link of the week Midterm exam examples Review week four lab assignment This week’s expected outcomes Next lab assignment

Review week five lab assignmentmyProgram

main.o employee.o address.o

employee.cppemployee.h main.cpp address.haddress.cpp

Page 20: Week Six Agenda Announcements Link of the week Midterm exam examples Review week four lab assignment This week’s expected outcomes Next lab assignment

Review week five lab assignment

Key Points About Perl• Dynamic typing.• Dynamic allocation of memory for arrays

and hash tables.• Both procedural and object oriented

programming capabilities.• Rich third party software and use of

modules.

Page 21: Week Six Agenda Announcements Link of the week Midterm exam examples Review week four lab assignment This week’s expected outcomes Next lab assignment

Review week five lab assignment

Regular Expressions

Regular expression (a.k.a. regex or regexp)

Is a pattern that describes a certain amount of text. A basic regular expression could be the single character, e.g.: a

Jane is a women.

It will match the first occurrence in the string. If succeeding matches are desired, the regex engine must be instructed to do so.

Page 22: Week Six Agenda Announcements Link of the week Midterm exam examples Review week four lab assignment This week’s expected outcomes Next lab assignment

Review week five lab assignmentRegular Expression Special Characters * Open square bracket [ * Backslash \

* Caret ^* Dollar sign $* Dot .Pipe symbol |Question mark ?Asterisk ** Plus sign +Opening and closing round brackets ( )

Page 23: Week Six Agenda Announcements Link of the week Midterm exam examples Review week four lab assignment This week’s expected outcomes Next lab assignment

Review week five lab assignmentawk Script

# Author: Bob D'Andrea

# Script name: awksrc

# Command line awk -f awksrc test.txt

# Command line: awk -f awksrc

/^$/ { print "This is a blank line." }

/[0-9]+/ { print "That is an integer." }

/[A-Za-z]+/ { print "This is a string." }

Page 24: Week Six Agenda Announcements Link of the week Midterm exam examples Review week four lab assignment This week’s expected outcomes Next lab assignment

Review week five lab assignment• Hash Table

Perl Hash table is an unordered set of scalars, accessed by some string value that is associated with each scalar.The key components are key and value.%colormap=(

“12” => “gray”,“19” => “black”,“30” => “red”,);

%colormap = (“12”, “gray”, “19”, “black”, “30”, “red”);

%members = (John => "father", Paul => "son", Marie => "daughter");

Page 25: Week Six Agenda Announcements Link of the week Midterm exam examples Review week four lab assignment This week’s expected outcomes Next lab assignment

Review week five lab assignment

Define Comma – arrow

The comma-arrow (=>) operator is used to initialize the %members hash variable in the previous slide lines of code. The left side of the comma-arrow operator is expected to be a simple string and therefore it is not necessary to be quoted.

Page 26: Week Six Agenda Announcements Link of the week Midterm exam examples Review week four lab assignment This week’s expected outcomes Next lab assignment

Review week five lab assignment

BLACK RED GRAY

YELLOW BLUE WHITE

GREEN AMBER GOLD PINK

11 12 13

21 22 23

31 343332

Hash Table

Page 27: Week Six Agenda Announcements Link of the week Midterm exam examples Review week four lab assignment This week’s expected outcomes Next lab assignment

Week six expected outcomesUpon successful completion of this module, the

student will be able to:• Create makefile scripts for software programs. • Use pattern rules in make files. • Create an effective PowerPoint presentation. • Create make files with multiple targets. • Install software packages on a server.

Page 28: Week Six Agenda Announcements Link of the week Midterm exam examples Review week four lab assignment This week’s expected outcomes Next lab assignment

Next lab assignmentUNIX Installation

Installing software under UNIX is not always straightforward and easy. System administrators must be familiar with the layout of the file system. During a software installation, the possibility exists that the system could panic and/or have a hard disk failure.

Page 29: Week Six Agenda Announcements Link of the week Midterm exam examples Review week four lab assignment This week’s expected outcomes Next lab assignment

Next lab assignment

Installation Software Package MethodsPackage manager

- What are the tasks of a package manager? - The version of UNIX dictates which package

manager will be used.- Many Linux versions utilize the Debian

Package Manager. Manual

- The utilization of makefiles or shell scripts to automate the install as much as

possible. - On occasion, the installation of software is done by sending the source code to the site.

- What steps are required to install a new software version?

- How is a “configure” script utilized?

Page 30: Week Six Agenda Announcements Link of the week Midterm exam examples Review week four lab assignment This week’s expected outcomes Next lab assignment

Next Lab Assignment

shell

Kernel

Hardware

Assembler

Firmware

Page 31: Week Six Agenda Announcements Link of the week Midterm exam examples Review week four lab assignment This week’s expected outcomes Next lab assignment

Break-out problems1. touch command

2. dot command

3. dot dot command

4. What function does the makefile provide a project?

5. What are the two parts of a dependency rule?

6. What language is used for writing makefile rules?

7. What two methods are used for installing software packages?

8. What is a regular expression

9. American National Standard Institute (ANSI)

10. What is the flow of control for a makefile?

Page 32: Week Six Agenda Announcements Link of the week Midterm exam examples Review week four lab assignment This week’s expected outcomes Next lab assignment

Upcoming deadlines• Lab Assignment 6-2, Makefile Exercise is due

February 21, 2010.• Lab Assignment 6-1, Programming

Assignment I is due February 28, 2010.• Lab Assignment 7-1, midterm exam will be

administered from February 15 – 20.• Lab Assignment 8-1, Installation Exercise is

due March 7, 2010.• Midterm outline is posted on the Bulletin

Board.• Module 4 is for weeks 6,7, and 8.

Page 33: Week Six Agenda Announcements Link of the week Midterm exam examples Review week four lab assignment This week’s expected outcomes Next lab assignment

Questions and answers

• Questions• Comments• Concerns

• Are there questions regarding the mid-term outline?

• After class I will help students with their scripts.