COS 333: Advanced Programming Techniques



Similar documents
Syllabus INFO-GB Design and Development of Web and Mobile Applications (Especially for Start Ups)

Lecture 18 Regular Expressions

Offerte del 13 giugno 2014

Syllabus INFO-UB Design and Development of Web and Mobile Applications (Especially for Start Ups)

Mobile Applications Developer. MAIN PURPOSE OF JOB To lead the design, development and maintenance of Android, iphone and ipad applications.

What is a programming language?

Computer Science. 232 Computer Science. Degrees and Certificates Awarded. A.S. Degree Requirements. Program Student Outcomes. Department Offices

Human Resources Department.

DTWMS Required Software Engineers. 1. Senior Java Programmer (3 Positions) Responsibilities:

6 CURRENT JOB OPENINGS:

Software Development Interactief Centrum voor gerichte Training en Studie Edisonweg 14c, 1821 BN Alkmaar T:

Lecture 4. Regular Expressions grep and sed intro

GUI and Web Programming

Computer Science. Computer Science 207. Degrees and Certificates Awarded. A.S. Computer Science Degree Requirements. Program Student Outcomes

Chapter 13 Computer Programs and Programming Languages. Discovering Computers Your Interactive Guide to the Digital World

DIABLO VALLEY COLLEGE CATALOG

Computer Science. Computer Science 213. Faculty and Offices. Degrees and Certificates Awarded. AS Computer Science Degree Requirements

Web Application Development and Frameworks

Whitepapers at Amikelive.com

Java with Eclipse: Setup & Getting Started

Education. Relevant Courses

Application Development for Mobile and Ubiquitous Computing

design coding monitoring deployment Java Web Framework for the Efficient Development of Enterprise Web Applications

Class and Office Hours. Course Requirements. Concepts to Learn. CMPUT 499: Introduction

Java/J2EE or Web Developer. Formal Education. Technical knowledge. Spoken Languages

IBM Digital Experience. Using Modern Web Development Tools and Technology with IBM Digital Experience

Google Web Toolkit. Introduction to GWT Development. Ilkka Rinne & Sampo Savolainen / Spatineo Oy

Preface. Motivation for this Book

The Ultimate Tech Glossary for Recruiters & HR Managers

COMPUTER SCIENCE (AS) Associate Degree, Certificate of Achievement & Department Certificate Programs

BRIAN RUSSEL DAVIS. New Media Programming, Design & Concept Development. Summary

SENIOR WEB DEVELOPER

CSE 307: Principles of Programming Languages

BEST WEB PROGRAMMING LANGUAGES TO LEARN ON YOUR OWN TIME

Programming Languages & Tools

Gabriel Iuga. London, United Kingdom Tel: ; Website:

CS 51 Intro to CS. Art Lee. September 2, 2014

Learning Web App Development

Web Application Frameworks. Robert M. Dondero, Ph.D. Princeton University

Web Frameworks. web development done right. Course of Web Technologies A.A. 2010/2011 Valerio Maggio, PhD Student Prof.

A Plan for the Continued Development of the DNS Statistics Collector

AngularJS, Javascript, Prototype-based OO concept, RESTful Design Pattern, GWT, HTML5, Database.

Inputsoft Business Software & Consulting. Learn more at

Pentesting Web Frameworks (preview of next year's SEC642 update)

Chapter 1. Dr. Chris Irwin Davis Phone: (972) Office: ECSS CS-4337 Organization of Programming Languages

10CS73:Web Programming

COMPUTER SCIENCE (AS) Associate Degree, Certificate of Achievement & Department Certificate Programs

Web 2.0 Technology Overview. Lecture 8 GSL Peru 2014

Web Applications: Overview and Architecture

COURSE TITLE COURSE DESCRIPTION

COURSE SYLLABUS EDG 6931: Designing Integrated Media Environments 2 Educational Technology Program University of Florida

IGW+ Certificate. I d e a l G r o u p i n W e b. International professional web design,

Slides from INF3331 lectures - web programming in Python

Programming Languages

Eclipse Web Tools Platform. Naci Dai (Eteration), WTP JST Lead

Kristopher Johnson. Web Site:

Programming. Languages & Frameworks. Hans- Pe(er Halvorsen, M.Sc. h(p://home.hit.no/~hansha/?page=sodware_development

Rapid Application Development. and Application Generation Tools. Walter Knesel

ANDROID APPLICATION DEVELOPER RESUME

APP DEVELOPMENT ON THE CLOUD MADE EASY WITH PAAS

Computer Science Course Descriptions Page 1

IBM Script Portlet for WebSphere Portal Release 1.1

Architecture and Mode of Operation

Mahesh Babu Bokkisam. Software Expertise

Luca Caucchioli Information Technology Consultant

How To Build A Web App

1/20/2016 INTRODUCTION

What is a stack? Do I need to know?

Web Cloud Architecture

PRINCIPAL JAVA ARCHITECT JOB ID: WD001087

ActiveX AJAX ASP. AudioMP3

LDAPCON Sébastien Bahloul

CSE 373: Data Structure & Algorithms Lecture 25: Programming Languages. Nicki Dell Spring 2014

A review and analysis of technologies for developing web applications

ICAPRG409A Develop mobile applications

Information Technology Services

Building Robust Applications l Optimizing Performance l Transforming Business

YouTrack MPS case study

Cisco Networking Academy Program Curriculum Scope & Sequence. Fundamentals of UNIX version 2.0 (July, 2002)

Accelerating Rails with

Management Information Systems 260 Web Programming Fall 2006 (CRN: 42459)

Course Descriptions COMPUTER INFORMATION SYSTEMS 1

How To Write A Web Server In Javascript

AUTOMATED CONFERENCE CD-ROM BUILDER AN OPEN SOURCE APPROACH Stefan Karastanev

Modern Web Development From Angle Brackets to Web Sockets

Offerte del 10 maggio 2013

CIM Courses for Creating Web Pages

Bachelors of Computer Application Programming Principle & Algorithm (BCA-S102T)

INFSCI 1017 Implementation of Information Systems

Transcription:

COS 333: Advanced Programming Techniques How to find me bwk@cs, www.cs.princeton.edu/~bwk 311 CS Building 609-258-2089 (but email is always better) TA's: Stephen Beard, Chris Monsanto, Srinivas Narayana, Taewook Oh, Yida Wang, Gordon Stewart Today course overview project info administrative stuff regular expressions and grep Check out the course web page (CS, not Blackboard!) notes, readings and assignments posted (only) there monitor the web page every day Assignment 0 is posted initial project information is posted Do the survey if you haven't already

Themes languages and tools mainstream: C, C++, Java, C#, (Objective-C?),... scripting: AWK, (Perl?), Python, (PHP?), Javascript,... programmable tools, application-specific languages frameworks, toolkits, development environments, interface builders databases (MySQL, SQLite, ) networks and plumbing source code control (SVN, Git),... programming design, prototyping, reuse, components, interfaces, patterns debugging, testing, performance, mechanization portability, standards, style tricks of the trade reality tradeoffs, compromises, engineering history and culture of programming etc.

Topics Standalone app Web client: HTML, CSS Javascript Flash, Toolkits: jquery, Dojo, YUI, GUI tools: Swing, TkInter, Wire format: XML, JSON, REST, SOAP, Business logic: Java, Python, PHP, Ruby, Objective-C, Perl, C++, Frameworks: GWT, Django, Zend, Rails, Cocoa, Dev Environ: shell++, Eclipse, Xcode, Plumbing: TCP/IP, authentication, Server: own machine, CS, OIT, EC2, Heroku, Appengine, own domain, Database: MySQL, SQLite, Postgres, NoSQL, Repository: SVN Git, Mercurial, Bazaar,

Very Tentative Outline Feb 6 Feb 13 Feb 20 Feb 27 Mar 5 Mar 12 Mar 19 regular expressions, grep; shell, AWK Python; project databases; networking Javascript, Ajax, CGI frameworks, development environments graphical user interfaces (spring break) Mar 26 C++, Standard Template Library Apr 2 Java, collections Apr 9 components: COM,.NET, C# Apr 16 XML, JSON, REST Apr 23? Apr 30? May 8-11 demo days: project presentations May 15 Dean s date: project submission

Some Mechanics prerequisites C, Unix (COS 217); Java (COS 126, 226) 6 programming assignments in first half posted on course web page Tuesday, due Sunday evening 12 days later deadlines matter project in second half (starts earlier!) groups of 3-5; start identifying potential teammates start thinking about possibilities right now deadlines matter monitor the web page readings for most weeks notes generally posted ahead of time newsgroup for discussion, finding partners,... class attendance and participation <=> no midterm or final sporadic unannounced short quizzes are possible

Regular expressions and grep regular expressions notation mechanization pervasive in Unix tools in all scripting languages, often as part of the syntax in general-purpose languages, as libraries basic implementation is remarkably simple efficient implementation requires good theory and good practice grep is the prototypical tool people used to write programs for searching (or did it by hand) tools became important tools are not as much in fashion today

Grep regular expressions c any character matches itself, except for metacharacters. [ ] ^ $ * \ r 1 r 2 matches r 1 followed by r 2. matches any single character [...] matches one of the characters in set... shorthand like a-z or 0-9 includes any character in the range [^...] matches one of the characters not in set ^ [^0-9] matches non-digit matches beginning of line when ^ begins pattern no special meaning elsewhere in pattern $ matches end of line when $ ends pattern no special meaning elsewhere in pattern * any regular expression followed by * matches 0 or more \c matches c unless c is ( ) or digit \(...\) tagged regular expression that matches... the matched strings are available as \1, \2, etc.

Examples of matching thing thing anywhere in string ^thing thing at beginning of string thing$ thing at end of string ^thing$ string that contains only thing ^ matches any string, even empty ^$ empty string. non-empty, i.e., at least 1 char thing.$ thing plus any char at end of string thing\.$ thing. at end of string \\thing\\ \thing\ anywhere in string [tt]hing thing or Thing anywhere in string thing[0-9] thing followed by one digit thing[^0-9] thing followed by a non-digit thing[0-9][^0-9] thing followed by digit, then non-digit thing1.*thing2 thing1 then any text then thing2 ^thing1.*thing2$ thing1 at beginning and thing2 at end

egrep: fancier regular expressions r+ one or more occurrences of r r? zero or one occurrences of r r 1 r 2 r 1 or r 2 (r) r (grouping) grammar: r: c. ^ $ [ccc] [^ccc] r* r+ r? r 1 r 2 r 1 r 2 (r) precedence: * +? higher than concatenation, which is higher than ([0-9]+\.?[0-9]* \.[0-9]+)([Ee][-+]?[0-9]+)?

The grep family grep egrep fancier regular expressions, trades compile time and space for run time fgrep parallel search for many fixed strings agrep "approximate" grep: search with errors permitted relatives that use similar regular expressions ed original Unix editor sed stream editor vi, emacs, sam,... editors lex lexical analyzer generator awk, perl, python, all scripting languages Java, C#... libraries in mainstream languages simpler variants filename "wild cards" in Unix and other shells "LIKE" operator in SQL, Visual Basic, etc.

Basic grep algorithm while (get a line) if match(regexpr, line) print line (perhaps) compile regexpr into an internal representation suitable for efficient matching match() slides the regexpr along the input line, looking for a match at each point regexpr line

Match anywhere on a line look for match at each position of text in turn /* match: search for regexp anywhere in text */ int match(char *regexp, char *text) { if (regexp[0] == '^') return matchhere(regexp+1, text); do { /* must look even if string is empty */ if (matchhere(regexp, text)) return 1; } while (*text++!= '\0'); return 0; }

Match starting at current position /* matchhere: search for regexp at beginning of text */ int matchhere(char *regexp, char *text) { if (regexp[0] == '\0') return 1; if (regexp[1] == '*') return matchstar(regexp[0], regexp+2, text); if (regexp[0] == '$' && regexp[1] == '\0') return *text == '\0'; if (*text!='\0' && (regexp[0]=='.' regexp[0]==*text)) return matchhere(regexp+1, text+1); return 0; } follow the easy case first: no metacharacters note that this is recursive maximum depth: one level for each regexpr character that matches

Simple grep algorithm best for short simple patterns e.g., grep printf *.[ch]! most use is like this reflects use in text editor for a small machine limitations tries the pattern at each possible starting point e.g., look for aaaaab in aaaa.aaaab potentially O(mn) for pattern of length m complicated patterns (.*.*.*) require backup potentially exponential can't do some things, like alternation (OR) this leads to extensions and new algorithms egrep complicated patterns, alternation fgrep lots of simple patterns in parallel boyer-moore long simple patterns agrep approximate matches

Important ideas from regexprs & grep tools: let the machine do the work good packaging matters notation: makes it easy to say what to do may organize or define implementation hacking can make a program faster, sometimes, usually at the price of more complexity a better algorithm can make a program go a lot faster don't worry about performance if it doesn't matter (and it often doesn't) when it does, use the right algorithm use the compiler's optimization code tune, as a last resort