CS 403: Programming Languages Lecture 15 Fall 2003 Department of Computer Science University of Alabama Joel Jones.

Slides:



Advertisements
Similar presentations
LINUX System : Lecture 3 (English-Only Lecture) Bong-Soo Sohn Assistant Professor School of Computer Science and Engineering Chung-Ang University Acknowledgement.
Advertisements

Chin-Chih Chang CS 497C – Introduction to UNIX Lecture 28: - Filters Using Regular Expressions – grep and sed Chin-Chih Chang
CS Lecture 03 Outline Sed and awk from previous lecture Writing simple bash script Assignment 1 discussion 1CS 311 Operating SystemsLecture 03.
CS 497C – Introduction to UNIX Lecture 31: - Filters Using Regular Expressions – grep and sed Chin-Chih Chang
Linux+ Guide to Linux Certification, Second Edition
CPSC 441: FTP & SMTP1 Application Layer: FTP & Instructor: Carey Williamson Office: ICT Class.
Guide To UNIX Using Linux Third Edition
Chapter 30 Electronic Mail Representation & Transfer
Introduction 1 Lecture 7 Application Layer (FTP, ) slides are modified from J. Kurose & K. Ross University of Nevada – Reno Computer Science & Engineering.
Printing. printf: formatted printing So far we have just been copying stuff from standard-in, files, pipes, etc to the screen or another file. Say I have.
Lecturer : Ms.Trần Thị Ngọc Hoa Chapter 8 File Transfer Protocol – Simple Mail Transfer Protocol.
Introduction 1-1 Chapter 2 FTP & Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012 IC322 Fall.
CS190/295 Programming in Python for Life Sciences: Lecture 1 Instructor: Xiaohui Xie University of California, Irvine.
Regular Expressions Week 07 TCNJ Web 2 Jean Chu. Regular Expressions Regular Expressions are a powerful way to validate and format text strings that may.
Mail Services.
IT 424 Networks2 IT 424 Networks2 Ack.: Slides are adapted from the slides of the book: “Computer Networking” – J. Kurose, K. Ross Chapter 2: Application.
Computer Networking From LANs to WANs: Hardware, Software, and Security Chapter 12 Electronic Mail.
Overview of the grep Command Alex Dukhovny CS 265 Spring 2011.
System Programming Regular Expressions Regular Expressions
FTP (File Transfer Protocol) & Telnet
Simple Mail Transfer Protocol (SMTP)
Week 7 Working with the BASH Shell. Objectives  Redirect the input and output of a command  Identify and manipulate common shell environment variables.
Chapter Four UNIX File Processing. 2 Lesson A Extracting Information from Files.
The UNIX Shell. The Shell Program that constantly runs at terminal after a user has logged in. Prompts the user and waits for user input. Interprets command.
CS 403: Programming Languages Lecture 21 Fall 2003 Department of Computer Science University of Alabama Joel Jones.
CS 403: Programming Languages Fall 2004 Department of Computer Science University of Alabama Joel Jones.
Shell Script Programming. 2 Using UNIX Shell Scripts Unlike high-level language programs, shell scripts do not have to be converted into machine language.
Linux+ Guide to Linux Certification, Third Edition
Module 6 – Redirections, Pipes and Power Tools.. STDin 0 STDout 1 STDerr 2 Redirections.
Agenda Regular Expressions (Appendix A in Text) –Definition / Purpose –Commands that Use Regular Expressions –Using Regular Expressions –Using the Replacement.
1 SMTP - Simple Mail Transfer Protocol –RFC 821 POP - Post Office Protocol –RFC 1939 Also: –RFC 822 Standard for the Format of ARPA Internet Text.
I/O Redirection and Regular Expressions February 9 th, 2004 Class Meeting 4.
Introduction to Unix – CS 21 Lecture 12. Lecture Overview A few more bash programming tricks The here document Trapping signals in bash cut and tr sed.
20-753: Fundamentals of Web Programming 1 Lecture 10: Server-Side Scripting II Fundamentals of Web Programming Lecture 10: Server-Side Scripting II.
I/O Redirection & Regular Expressions CS 2204 Class meeting 4 *Notes by Doug Bowman and other members of the CS faculty at Virginia Tech. Copyright
Regular Expressions CS 2204 Class meeting 6 Created by Doug Bowman, 2001 Modified by Mir Farooq Ali, 2002.
Lesson 3-Touring Utilities and System Features. Overview Employing fundamental utilities. Linux terminal sessions. Managing input and output. Using special.
CSCI 330 UNIX and Network Programming Unit IV Shell, Part 2.
Awk- An Advanced Filter by Prof. Shylaja S S Head of the Dept. Dept. of Information Science & Engineering, P.E.S Institute of Technology, Bangalore
Agenda Positional Parameters / Continued... Command Substitution Bourne Shell / Bash Shell / Korn Shell Mathematical Expressions Bourne Shell / Bash Shell.
Internet Applications (Cont’d) Basic Internet Applications – World Wide Web (WWW) Browser Architecture Static Documents Dynamic Documents Active Documents.
SMTP - Simple Mail Transfer Protocol RFC 821
Chapter 16: Distributed Applications Business Data Communications, 4e.
CS 614: Theory and Construction of Compilers Lecture 5 Fall 2003 Department of Computer Science University of Alabama Joel Jones.
CS440 Computer Networks 1 Neil Tang 12/01/2008.
Introduction to Programming the WWW I CMSC Winter 2004 Lecture 13.
Linux+ Guide to Linux Certification, Second Edition
-Joseph Beberman *Some slides are inspired by a PowerPoint presentation used by professor Seikyung Jung, which was derived from Charlie Wiseman.
Introduction to Programming the WWW I CMSC Winter 2003 Lecture 17.
CS 403: Programming Languages Lecture 20 Fall 2003 Department of Computer Science University of Alabama Joel Jones.
26.1 Electronic Mail Sending/Receiving Mail Addresses User Agent MIME Mail Transfer Agent Mail Access Protocols.
Linux Administration Working with the BASH Shell.
@Yuan Xue A special acknowledge goes to J.F Kurose and K.W. Ross Some of the slides used in this lecture are adapted from their.
Spring 2006 CPE : Application Layer_ 1 Special Topics in Computer Engineering Application layer: Some of these Slides are Based on Slides.
PROGRAMMING THE BASH SHELL PART III by İlker Korkmaz and Kaya Oğuz
SMTP - Simple Mail Transfer Protocol POP - Post Office Protocol
CS 330 Class 7 Comments on Exam Programming plan for today:
Looking for Patterns - Finding them with Regular Expressions
SMTP: simple mail transfer protocol
Networking CS 3470, Section 1 Sarah Diesburg
CS 403: Programming Languages
CS190/295 Programming in Python for Life Sciences: Lecture 1
IPC144 Introduction to Programming Using C Week 1 – Lesson 2
CS- 492 : Distributed system & Parallel Processing
Chapter 2: Application layer
Networking CS 3470, Section 1 Sarah Diesburg
Chapter Four UNIX File Processing.
Chin-Chih Chang CS 497C – Introduction to UNIX Lecture 28: - Filters Using Regular Expressions – grep and sed Chin-Chih Chang
William Stallings Data and Computer Communications
Chapter 2 Application Layer
Presentation transcript:

CS 403: Programming Languages Lecture 15 Fall 2003 Department of Computer Science University of Alabama Joel Jones

Lecture 15©2003 Joel Jones2 Overview Announcements Homework Minilanguages Preliminaries—data formats Taxonomy of Minilanguages Case Studies

Lecture 15©2003 Joel Jones3

Lecture 15©2003 Joel Jones4 Minilanguage Definition—little language specialized for a particular application domain A good notation has a subtlety and suggestiveness which at times makes it almost seem like a live teacher. —Bertrand Russell The World of Mathematics (1956) Pair Up: Why use a minilanguage ? Hint: Error rates are largely independent of the language used.

Lecture 15©2003 Joel Jones5 Data Formats Programs store and retrieve data from files and/or transmit data to another program, via a network or some other mechanism. But, what should the format be? Binary–fast, but inflexible Textual–flexible, but slow(?)

Lecture 15©2003 Joel Jones6 But what distinguishes text from binary? Pair Up: List differences between a text format and a binary format

Lecture 15©2003 Joel Jones7 On the importance of being textual Flexible, but what does that mean? Not brittle, allows for future changes in the format/contents Pair Up: What happens if larger numbers are needed in a binary format? In a text format? We’ll examine the issue of speed later

Lecture 15©2003 Joel Jones8 Styles (metaformats) of structuring textual data Delimiter separated value Example, Unix passwd file: games:*:12:100:games:/usr/games: gopher:*:13:30:gopher:/usr/lib/gopher-data: ftp:*:14:50:FTP User:/home/ftp: esr:0SmFuPnH5JlNs:23:23:Eric S. Raymond:/home/esr: nobody:*:99:99:Nobody:/: Colons are allowed inside fields by using escape mechanism: \: Much better than quoting mechanism used by various CSV files from Microsoft–quotes within quotes

Lecture 15©2003 Joel Jones9 Textual works for protocols also SMTP: Simple Mail Transfer Protocol Used to send mail C: C: HELO snark.thyrsus.com sending host identifies self S: 250 OK Hello snark, glad to meet you receiver acknowledges C: MAIL FROM: identify sending user S: Sender ok receiver acknowledges C: RCPT TO: identify target user S: 250 root... Recipient ok receiver acknowledges C: DATA S: 354 Enter mail, end with "." on a line by itself C: Scratch called. He wants to share C: a room with us at Balticon. C:.end of multiline send S: 250 WAA01865 Message accepted for delivery C: QUIT sender signs off S: 221 cpmy.com closing connection receiver disconnects C:

Lecture 15©2003 Joel Jones10 Taxonomy of minilanguages /etc/passwd Yacc make XSLT awk Postscript Data FormatsMinilanguagesInterpreters Less to more general declarative to imperative Flat to structured SNGregexpsbc JavaScript sh Perl Python Java Increasing Loopiness

Lecture 15©2003 Joel Jones11 Case Studies Performed live on stage! The following demo will be captured using script, a Unix command that captures input and output Using a shell as glue Pipes and filters Wrappers vs. programs

Lecture 15©2003 Joel Jones12 Case Studies: Regular Expressions. Matches any single character * Matches zero or more copies of the preceding expression [] Character class which matches any character within the brackets. If it starts with a circumflex ‘^’ negates test. A dash indicates a range ^ Matches the beginning of a line $ Matches the end of a line \ escapes metacharacters e.g. “\n” is a newline character, “\*” is a literal asterisk + Matches one or more occurrences ? Matches zero or one occurences

Lecture 15©2003 Joel Jones13 Regular Expression (Continued) | Matches either the regular expression before or after “…” Interprets everything inside quotes literally () Groups a series of regular expression together into a new regular expression