CS1102: Adding Error Checking to Macros
|
|
|
- Stanley Sullivan
- 10 years ago
- Views:
Transcription
1 CS1102: Adding Error Checking to Macros Kathi Fisler, WPI October 6, Typos in State Machines The point of creating macros for state machines is to hide language details from the programmer. Ideally, a programmer shouldn t need to know anything more than the macro input syntax in order to write down usable state machines. Recall our macro for converting the clean state machine syntax into the structure-based language: (define-syntax monitor1 (syntax-rules (-> :) [(monitor1 initname (curr-state : (label -> next-state) ) )])) This macro is designed to work with the following interpreter for testing state machine monitors against sequences of inputs: ;; interp-monitor : monitor list[symbol] symbol ;; run monitor on samples, returning okay or error (define (interp-monitor a-monitor samples) (run-monitor (monitor-init-state a-monitor) samples (monitor-states a-monitor))) ;; run-monitor : symbol list[symbol] list[states] symbol ;; run monitor on samples from current state, returning okay or error (define (run-monitor curr-state samples all-states) (cond [(empty? samples) okay] [(cons? samples) (let ([next-state (find-next-state curr-state (first samples) all-states)]) (cond [(boolean? next-state) error] [else (run-monitor next-state (rest samples) all-states)]))])) ;; find-next-state : symbol symbol list[state] symbol or false ;; finds name of next-state in transition from given state (first arg) on given input/guard (second arg) (define (find-next-state curr-state label states) (let ([state (first (filter (lambda (st) (symbol=? curr-state (state-name st))) states))]) (let ([trans (filter (lambda (tr) (symbol=? label (trans-guard tr))) (state-transitions state))]) 1
2 (cond [(empty? trans) false] [else (trans-next-state (first trans))])))) Imagine that a programmer uses the macro as shown below, but makes a typo in the first transition to is-green (left out one of the e s in green). What happens when the programmer tries to test the state machine? (define buggy-tl-monitor (monitor1 is-red (is-red : (green -> is-gren) (red -> is-red)) (is-green : (yellow -> is-yellow) (green -> is-green)) (is-yellow : (red -> is-red)))) > (interp-monitor buggy-tl-monitor (list red green yellow green)) first: expects argument of type <non-empty list>; given () This error comes from the find-next-state function, specifically the call to first used to get a value for the state variable. Knowing how the macro and interpreter work, this error makes sense: the first sample ( red) pulled out nextstate is-gren, which got passed as the current state to find-next-state. Makes sense to us, but a programmer shouldn t have to understand how our language works in order to use it (that defeats the point of creating a language!). We ve provided a cute syntax for state machines, but we haven t provided the support tools that programmers should expect from a useful language. This general problem where the details underlying an implementation sneak out and become visible (and a headache) for a programmer has been called abstraction leakage. The lectures page has a link to a very nice piece on leaky abstractions by software developer Joel Spolsky. 1. How can we plug the leak in our state-machine language? 2 Catching Typos in Next States The cause of the error in this case is easy to explain: the programmer used a next-state name that was not the name of any state in the same state machine. Given that the macro pattern has access to all of the names used for the states and the next-states, we should be able to add some code to the macro that will check whether all the next-state names have been used as state names. Let s start by adding some code to the macro that will collect lists of all the state names that got defined and all of the next-state names that got used: (define-syntax monitor2 (syntax-rules (-> :) [(monitor2 initname (curr-state : (label -> next-state) (let ([defined-state-names (list curr-state ] [used-next-names (list next-state... ])???) ) ))])) 1 I highly recommend his software development blog 2
3 We need to use two sets of ellipses after used-next-states because the next-state names are within two sets of ellipses in the input pattern (one for the transitions and another for the states). Now that we have these two lists, we just need to write code that checks whether every element of the next-state list is in the list of states; if we find a next-state that is not in the list, produce an error message. (define-syntax monitor2 (syntax-rules (-> :) [(monitor2 initname (curr-state : (label -> next-state) (let ([defined-state-names (list curr-state ] [used-next-names (append (list next-state ]) (map (lambda (next-name) (cond [(member next-name defined-state-names) true] [else (error (format Used undefined next-state name a next-name))])) used-next-names)) ) ))])) If we use this macro to create the buggy state machine, we will get an error message before we even get to run the interpreter: Used undefined next-state name is-gren 3 Catching Typos in Labels Now that we see how to catch typos in next states, it is worth asking whether there are any other kinds of errors that we could check for in the macro. What about the labels on transitions? That is another place where a programmer might make a typo. Can we check for typos on labels the same way we did for next states? Label typo checking is a little harder in our current macro. When we checked for typos in the next states, we had names to compare them to: the names used to define the states. Nowhere do we have a list of valid labels to check against. If we want to support typo checking on labels, we will need to add the names of valid labels to the macro. Let s add that to the source syntax with a keyword track-labels: (define TL-monitor3 (monitor3 is-red (tracks-labels red yellow green) (is-red : (green -> is-green) (red -> is-red)) (is-green : (yellow -> is-yellow) (green -> is-green)) (is-yellow : (red -> is-red)))) First, let s edit the input pattern to expect the new tracks-labels statement. We need to add tracks-labels to the list of keywords, and we need to add the pattern for it to the input pattern. (define-syntax monitor3 (syntax-rules (-> : tracks-labels) [(monitor3 initname (tracks-labels label1 3
4 (curr-state : (label -> next-state) (let ([defined-state-names (list curr-state ] [used-next-names (append (list next-state ]) (map (lambda (next-name) (cond [(member next-name defined-state-names) true] [else (error (format Used undefined next-state name a next-name))])) used-next-names)) ) ))])) Now, what do we want to do with the labels that we are tracking? We want to do something similar to what we did with the next-states, checking that each label that got used on a transition was given as a label in the tracks-labels statement. (define-syntax monitor3 (syntax-rules (-> : tracks-labels) [(monitor3 initname (tracks-labels label1 (curr-state : (label -> next-state) (let ([defined-state-names (list curr-state ] [used-next-names (append (list next-state ]) (map (lambda (next-name) (cond [(member next-name defined-state-names) true] [else (error (format Used undefined next-state name a next-name))])) used-next-names)) ;; check that all used label names are valid (let ([defined-labels (list label1 ] [used-labels (append (list label ]) (map (lambda (used-label) (cond [(member used-label defined-labels) true] [else (error (format Used undefined label name a used-label))])) used-labels)) (list (make-state curr-state (list (make-trans label next-state) ) ))])) With this macro, typos in the label names will also be reported to the user before they try to test the state machine with the interpreter. 4
5 4 A Little Cleanup The macro now has two uses of very similar code for checking for typos in the next states and labels. If this were a standalone program, we would create helper functions to merge the common code into one function. Macro output isn t much different from a standalone program, so let s do the same here. The resulting macro looks like: (define-syntax monitor4 (syntax-rules (-> : tracks-labels) [(monitor4 initname (tracks-labels label1 (curr-state : (label -> next-state) (local [(define (confirm-names-in-list check-names in-list error-string) (map (lambda (name) (cond [(member name in-list) true] [else (error (format error-string name))])) check-names))] (let ([defined-state-names (list curr-state ] [used-next-names (append (list next-state ]) (confirm-names-in-list used-next-names defined-state-names Used undefined next-state name a )) ;; check that all used label names are valid (let ([defined-labels (list label1 ] [used-labels (append (list label ]) (confirm-names-in-list used-labels defined-labels Used undefined label name a )) ) )))])) Notice that we used local to define a function that takes the two lists to check and the error string to generate, then called that helper function to perform the checks. This is no different than what we would have done when creating helper functions outside of the context of macros. 5 Summary This lecture has tried to bring across two important points: When we define a language, we run the risk of abstraction leakage. This occurs when implementation details of the language are accidentally exposed to the programmer who is using the language. Abstraction leakage almost always arises when a program contains errors (logical errors, typos, etc). The leakage problem points to another caveat in software design: designers are generally good at deciding how to handle correct inputs, but don t always think enough about how to gracefully handle incorrect inputs. Macros are really programs that produce other programs. You can put arbitrarily complex code into the output part of the macro. The programmer never needs to know about this code. It just runs behind the scenes when the programmer uses the macro. This shows that macros are really much more than handy tools for replacing one piece of code with another. 5
6 As a result of this lecture, I expect that you could Identify some kinds of mistakes that programmers might make in using a macro, and Implement simple kinds of error checking at the level that we did here. 6
How To Program In Scheme (Prolog)
The current topic: Scheme! Introduction! Object-oriented programming: Python Functional programming: Scheme! Introduction Next up: Numeric operators, REPL, quotes, functions, conditionals Types and values
Python Lists and Loops
WEEK THREE Python Lists and Loops You ve made it to Week 3, well done! Most programs need to keep track of a list (or collection) of things (e.g. names) at one time or another, and this week we ll show
Version Control with. Ben Morgan
Version Control with Ben Morgan Developer Workflow Log what we did: Add foo support Edit Sources Add Files Compile and Test Logbook ======= 1. Initial version Logbook ======= 1. Initial version 2. Remove
CS 141: Introduction to (Java) Programming: Exam 1 Jenny Orr Willamette University Fall 2013
Oct 4, 2013, p 1 Name: CS 141: Introduction to (Java) Programming: Exam 1 Jenny Orr Willamette University Fall 2013 1. (max 18) 4. (max 16) 2. (max 12) 5. (max 12) 3. (max 24) 6. (max 18) Total: (max 100)
First Java Programs. V. Paúl Pauca. CSC 111D Fall, 2015. Department of Computer Science Wake Forest University. Introduction to Computer Science
First Java Programs V. Paúl Pauca Department of Computer Science Wake Forest University CSC 111D Fall, 2015 Hello World revisited / 8/23/15 The f i r s t o b l i g a t o r y Java program @author Paul Pauca
Introduction to Python
WEEK ONE Introduction to Python Python is such a simple language to learn that we can throw away the manual and start with an example. Traditionally, the first program to write in any programming language
C++ INTERVIEW QUESTIONS
C++ INTERVIEW QUESTIONS http://www.tutorialspoint.com/cplusplus/cpp_interview_questions.htm Copyright tutorialspoint.com Dear readers, these C++ Interview Questions have been designed specially to get
Decision Logic: if, if else, switch, Boolean conditions and variables
CS 1044 roject 3 Fall 2009 Decision Logic: if, if else, switch, Boolean conditions and variables This programming assignment uses many of the ideas presented in sections 3 through 5 of the Dale/Weems text
Intellect Platform - The Workflow Engine Basic HelpDesk Troubleticket System - A102
Intellect Platform - The Workflow Engine Basic HelpDesk Troubleticket System - A102 Interneer, Inc. Updated on 2/22/2012 Created by Erika Keresztyen Fahey 2 Workflow - A102 - Basic HelpDesk Ticketing System
Quosal Form Designer Training Documentation
Chapter 4 Advanced Form Design Concepts There is a huge amount of customization that can be done with the Report Designer, and basic quote forms only scratch the surface. Learning how to use the advanced
Moving from CS 61A Scheme to CS 61B Java
Moving from CS 61A Scheme to CS 61B Java Introduction Java is an object-oriented language. This document describes some of the differences between object-oriented programming in Scheme (which we hope you
Language Factories and Modular Interpreters
Language Factories and Modular Interpreters Tony Clark June 16, 2010 or language pattern. This approach is motivated by the aim of creating libraries of language module definitions so that new languages
Programming Project 1: Lexical Analyzer (Scanner)
CS 331 Compilers Fall 2015 Programming Project 1: Lexical Analyzer (Scanner) Prof. Szajda Due Tuesday, September 15, 11:59:59 pm 1 Overview of the Programming Project Programming projects I IV will direct
Parcelhub - Linnworks Custom Courier Integration Script
Parcelhub - Linnworks Custom Courier Integration Script What is it? When an order is processed using Linnworks, Linnworks has the ability to book a shipment and print shipping labels for that order. Linnworks
Computer Science 1 CSci 1100 Lecture 3 Python Functions
Reading Computer Science 1 CSci 1100 Lecture 3 Python Functions Most of this is covered late Chapter 2 in Practical Programming and Chapter 3 of Think Python. Chapter 6 of Think Python goes into more detail,
Resco Mobile CRM Woodford (Rules Guide) Document version 6.2.0.0
Resco Mobile CRM Woodford (Rules Guide) Document version 6.2.0.0 Resco.net 1 Form Rules... 2 2 Steps... 2 2.1 Function Step... 2 2.1.1 Selecting Variable, Use of the Property Selector... 3 2.1.2 Function
MATLAB @ Work. MATLAB Source Control Using Git
MATLAB @ Work MATLAB Source Control Using Git Richard Johnson Using source control is a key practice for professional programmers. If you have ever broken a program with a lot of editing changes, you can
Programming in Access VBA
PART I Programming in Access VBA In this part, you will learn all about how Visual Basic for Applications (VBA) works for Access 2010. A number of new VBA features have been incorporated into the 2010
NewsletterAdmin 2.4 Setup Manual
NewsletterAdmin 2.4 Setup Manual Updated: 7/22/2011 Contact: [email protected] Contents Overview... 2 What's New in NewsletterAdmin 2.4... 2 Before You Begin... 2 Testing and Production...
Dialog planning in VoiceXML
Dialog planning in VoiceXML Csapó Tamás Gábor 4 January 2011 2. VoiceXML Programming Guide VoiceXML is an XML format programming language, describing the interactions between human
Visual Logic Instructions and Assignments
Visual Logic Instructions and Assignments Visual Logic can be installed from the CD that accompanies our textbook. It is a nifty tool for creating program flowcharts, but that is only half of the story.
Chapter 12 Programming Concepts and Languages
Chapter 12 Programming Concepts and Languages Chapter 12 Programming Concepts and Languages Paradigm Publishing, Inc. 12-1 Presentation Overview Programming Concepts Problem-Solving Techniques The Evolution
Managing Data Issues Identified During Programming
Paper CS04 Managing Data Issues Identified During Programming Shafi Chowdhury, Shafi Consultancy Limited, London, U.K. Aminul Islam, Shafi Consultancy Bangladesh, Sylhet, Bangladesh ABSTRACT Managing data
The Rules 1. One level of indentation per method 2. Don t use the ELSE keyword 3. Wrap all primitives and Strings
Object Calisthenics 9 steps to better software design today, by Jeff Bay http://www.xpteam.com/jeff/writings/objectcalisthenics.rtf http://www.pragprog.com/titles/twa/thoughtworks-anthology We ve all seen
Party Time! Computer Science I. Signature Examples PAIR OBJ. The Signature of a Procedure. Building a Set. Testing for Membership in a Set
Computer Science I Professor Tom Ellman Lecture 21 Party Time! Whom shall you invite? We will write the Party Planner program. It will select SETS of guests. By reasoning with RELATIONS. Before we party,
Small Business SEO Marketing an introduction
Small Business SEO Marketing an introduction Optimax May 2012 www.optimaxads.com 1 CONTENTS Introduction 3 On Page Optimisation 3 How Google views your Web Site 5 How to check your web page code for SEO
Introduction to formal semantics -
Introduction to formal semantics - Introduction to formal semantics 1 / 25 structure Motivation - Philosophy paradox antinomy division in object und Meta language Semiotics syntax semantics Pragmatics
Lecture 2 Notes: Flow of Control
6.096 Introduction to C++ January, 2011 Massachusetts Institute of Technology John Marrero Lecture 2 Notes: Flow of Control 1 Motivation Normally, a program executes statements from first to last. The
Lifebushido/Best Agent Business
Lifebushido/Best Agent Business Key Assistant Training Call Database Management Overview Steve Kantor: Good morning, this is Steve Kantor with Lifebushido and Best Agent Business and this is a training
Management Information System Prof. B. Mahanty Department of Industrial Engineering & Management Indian Institute of Technology, Kharagpur
(Refer Slide Time: 00:54) Management Information System Prof. B. Mahanty Department of Industrial Engineering & Management Indian Institute of Technology, Kharagpur Lecture - 18 Data Flow Diagrams - III
Copyright (c) 2015 Christopher Small and The Art of Lawyering. All rights reserved.
Copyright (c) 2015 Christopher Small and The Art of Lawyering. All rights reserved. 1 In this special report, I ll be sharing with you the ten biggest mistakes that lawyers make when marketing their law
Lecture 10: CPA Encryption, MACs, Hash Functions. 2 Recap of last lecture - PRGs for one time pads
CS 7880 Graduate Cryptography October 15, 2015 Lecture 10: CPA Encryption, MACs, Hash Functions Lecturer: Daniel Wichs Scribe: Matthew Dippel 1 Topic Covered Chosen plaintext attack model of security MACs
Excel & Visual Basic for Applications (VBA)
Excel & Visual Basic for Applications (VBA) The VBA Programming Environment Recording Macros Working with the Visual Basic Editor (VBE) 1 Why get involved with this programming business? If you can't program,
Topics. Introduction. Java History CS 146. Introduction to Programming and Algorithms Module 1. Module Objectives
Introduction to Programming and Algorithms Module 1 CS 146 Sam Houston State University Dr. Tim McGuire Module Objectives To understand: the necessity of programming, differences between hardware and software,
qwertyuiopasdfghjklzxcvbnmqwerty uiopasdfghjklzxcvbnmqwertyuiopasd fghjklzxcvbnmqwertyuiopasdfghjklzx cvbnmqwertyuiopasdfghjklzxcvbnmq
qwertyuiopasdfghjklzxcvbnmqwerty uiopasdfghjklzxcvbnmqwertyuiopasd fghjklzxcvbnmqwertyuiopasdfghjklzx cvbnmqwertyuiopasdfghjklzxcvbnmq Introduction to Programming using Java wertyuiopasdfghjklzxcvbnmqwertyui
VISUAL GUIDE to. RX Scripting. for Roulette Xtreme - System Designer 2.0
VISUAL GUIDE to RX Scripting for Roulette Xtreme - System Designer 2.0 UX Software - 2009 TABLE OF CONTENTS INTRODUCTION... ii What is this book about?... iii How to use this book... iii Time to start...
Introduction to SQL for Data Scientists
Introduction to SQL for Data Scientists Ben O. Smith College of Business Administration University of Nebraska at Omaha Learning Objectives By the end of this document you will learn: 1. How to perform
C4DI Arduino tutorial 4 Things beginning with the letter i
C4DI Arduino tutorial 4 Things beginning with the letter i If you haven t completed the first three tutorials, it might be wise to do that before attempting this one. This tutorial assumes you are using
Writing Functions in Scheme. Writing Functions in Scheme. Checking My Answer: Empty List. Checking My Answer: Empty List
Writing Functions in Scheme Writing Functions in Scheme Suppose we want a function ct which takes a list of symbols and returns the number of symbols in the list (ct (a b c)) 3 (ct ()) 0 (ct (x y z w t))
Paper 70-27 An Introduction to SAS PROC SQL Timothy J Harrington, Venturi Partners Consulting, Waukegan, Illinois
Paper 70-27 An Introduction to SAS PROC SQL Timothy J Harrington, Venturi Partners Consulting, Waukegan, Illinois Abstract This paper introduces SAS users with at least a basic understanding of SAS data
Kaldeera Workflow Designer 2010 User's Guide
Kaldeera Workflow Designer 2010 User's Guide Version 1.0 Generated May 18, 2011 Index 1 Chapter 1: Using Kaldeera Workflow Designer 2010... 3 1.1 Getting Started with Kaldeera... 3 1.2 Importing and exporting
Introduction to Programming System Design. CSCI 455x (4 Units)
Introduction to Programming System Design CSCI 455x (4 Units) Description This course covers programming in Java and C++. Topics include review of basic programming concepts such as control structures,
Appendix... B. The Object Constraint
UML 2.0 in a Nutshell Appendix B. The Object Constraint Pub Date: June 2005 Language The Object Constraint Language 2.0 (OCL) is an addition to the UML 2.0 specification that provides you with a way to
PROG0101 Fundamentals of Programming PROG0101 FUNDAMENTALS OF PROGRAMMING. Chapter 3 Algorithms
PROG0101 FUNDAMENTALS OF PROGRAMMING Chapter 3 1 Introduction to A sequence of instructions. A procedure or formula for solving a problem. It was created mathematician, Mohammed ibn-musa al-khwarizmi.
Semester Review. CSC 301, Fall 2015
Semester Review CSC 301, Fall 2015 Programming Language Classes There are many different programming language classes, but four classes or paradigms stand out:! Imperative Languages! assignment and iteration!
How to Manage Your Email List Effectively
How to Manage Your Email List Effectively A short guide by MailWheel 1 Discover What s Inside After you ve acquired enough email addresses and created your opt-in and opt-out forms, you are probably wondering:
STRUCTURE AND FLOWS. By Hagan Rivers, Two Rivers Consulting FREE CHAPTER
UIE REPORTS FUNDAMENTALS SERIES T H E D E S I G N E R S G U I D E T O WEB APPLICATIONS PART I: STRUCTURE AND FLOWS By Hagan Rivers, Two Rivers Consulting FREE CHAPTER User Interface Engineering User Interface
CHAPTER 19 Programming Lists of Data
CHAPTER 19 Programming Lists of Data As you ve already seen, apps handle events and make decisions; such processing is fundamental to computing. But, the other fundamental part of an app is its data the
Translating to Java. Translation. Input. Many Level Translations. read, get, input, ask, request. Requirements Design Algorithm Java Machine Language
Translation Translating to Java Introduction to Computer Programming The job of a programmer is to translate a problem description into a computer language. You need to be able to convert a problem description
SEARCH ENGINE OPTIMISATION
S E A R C H E N G I N E O P T I M I S AT I O N - PA G E 2 SEARCH ENGINE OPTIMISATION Search Engine Optimisation (SEO) is absolutely essential for small to medium sized business owners who are serious about
Real World Example: Using SharePoint Out-ofthe-Box Tools to Create a Goals Tracking System. Jennifer Mason
Real World Example: Using SharePoint Out-ofthe-Box Tools to Create a Goals Tracking System Jennifer Mason SharePoint911 Established in 2004 by SharePoint MVP Shane Young Full service SharePoint Consulting
Writing a Logical Decoding Plug-In. Christophe Pettus PostgreSQL Experts, Inc. FOSDEM 2015
Writing a Logical Decoding Plug-In. Christophe Pettus PostgreSQL Experts, Inc. FOSDEM 2015 Hello! We re going to talk about logical decoding in PostgreSQL. Christophe Pettus, pleased to meet you. PostgreSQL
Finding XSS in Real World
Finding XSS in Real World by Alexander Korznikov [email protected] 1 April 2015 Hi there, in this tutorial, I will try to explain how to find XSS in real world, using some interesting techniques. All
UNDERSTANDING YOUR ONLINE FOOTPRINTS: HOW TO PROTECT YOUR PERSONAL INFORMATION ON THE INTERNET
UNDERSTANDING YOUR ONLINE FOOTPRINTS: HOW TO PROTECT YOUR PERSONAL INFORMATION ON THE INTERNET SPEAKING NOTES FOR GRADES 4 TO 6 PRESENTATION SLIDE (1) Title Slide SLIDE (2) Key Points It can be really
Colorize Three Ways with Paint Shop Pro s Professional Strength Tools
Colorize Three Ways with Paint Shop Pro s Professional Strength Tools By JP Kabala In Paint Shop Pro, and most other graphics software, colorize means to convert an image or selection to a uniform hue
13 File Output and Input
SCIENTIFIC PROGRAMMING -1 13 File Output and Input 13.1 Introduction To make programs really useful we have to be able to input and output data in large machinereadable amounts, in particular we have to
Access Queries (Office 2003)
Access Queries (Office 2003) Technical Support Services Office of Information Technology, West Virginia University OIT Help Desk 293-4444 x 1 oit.wvu.edu/support/training/classmat/db/ Instructor: Kathy
Writing Control Structures
Writing Control Structures Copyright 2006, Oracle. All rights reserved. Oracle Database 10g: PL/SQL Fundamentals 5-1 Objectives After completing this lesson, you should be able to do the following: Identify
Reputation Marketing
Reputation Marketing Reputation Marketing Welcome to our training, We will show you step-by-step how to dominate your market online. We re the nation s leading experts in local online marketing. The proprietary
Software Engineering. Top-Down Design. Bottom-Up Design. Software Process. Top-Down vs. Bottom-Up 13/02/2012
CS/ENGRD 2110 Object-Oriented Programming and Data Structures Spring 2012 Thorsten Joachims Lecture 7: Software Design Software Engineering The art by which we start with a problem statement and gradually
Before you can use the Duke Ambient environment to start working on your projects or
Using Ambient by Duke Curious 2004 preparing the environment Before you can use the Duke Ambient environment to start working on your projects or labs, you need to make sure that all configuration settings
Visual Basic Programming. An Introduction
Visual Basic Programming An Introduction Why Visual Basic? Programming for the Windows User Interface is extremely complicated. Other Graphical User Interfaces (GUI) are no better. Visual Basic provides
Chapter 3. Input and output. 3.1 The System class
Chapter 3 Input and output The programs we ve looked at so far just display messages, which doesn t involve a lot of real computation. This chapter will show you how to read input from the keyboard, use
6.1. Example: A Tip Calculator 6-1
Chapter 6. Transition to Java Not all programming languages are created equal. Each is designed by its creator to achieve a particular purpose, which can range from highly focused languages designed for
The Snake Game Java Case Study
The Snake Game Java Case Study John Latham January 27, 2014 Contents 1 Introduction 2 2 Learning outcomes 2 3 Description of the game 2 4 The classes of the program 4 5 The laboratory exercise and optional
CS 106 Introduction to Computer Science I
CS 106 Introduction to Computer Science I 01 / 21 / 2014 Instructor: Michael Eckmann Today s Topics Introduction Homework assignment Review the syllabus Review the policies on academic dishonesty and improper
Errors That Can Occur When You re Running a Report From Tigerpaw s SQL-based System (Version 9 and Above) Modified 10/2/2008
Errors That Can Occur When You re Running a Report From Tigerpaw s SQL-based System (Version 9 and Above) Modified 10/2/2008 1 Introduction The following is an explanation of some errors you might encounter
Managing Your Emails Lists: Bounces, Holds, Unsubscribes
This document covers what you need to know keep your email list healthy with low rates of bounced emails and unsubscribes. You should be able to use this documentation to assist you in understanding mailing
CS101 Lecture 24: Thinking in Python: Input and Output Variables and Arithmetic. Aaron Stevens 28 March 2011. Overview/Questions
CS101 Lecture 24: Thinking in Python: Input and Output Variables and Arithmetic Aaron Stevens 28 March 2011 1 Overview/Questions Review: Programmability Why learn programming? What is a programming language?
Testing Rails. by Josh Steiner. thoughtbot
Testing Rails by Josh Steiner thoughtbot Testing Rails Josh Steiner April 10, 2015 Contents thoughtbot Books iii Contact us................................ iii Introduction 1 Why test?.................................
NLP Lab Session Week 3 Bigram Frequencies and Mutual Information Scores in NLTK September 16, 2015
NLP Lab Session Week 3 Bigram Frequencies and Mutual Information Scores in NLTK September 16, 2015 Starting a Python and an NLTK Session Open a Python 2.7 IDLE (Python GUI) window or a Python interpreter
Beyond the Mouse A Short Course on Programming
1 / 22 Beyond the Mouse A Short Course on Programming 2. Fundamental Programming Principles I: Variables and Data Types Ronni Grapenthin Geophysical Institute, University of Alaska Fairbanks September
The ROI of Test Automation
The ROI of Test Automation by Michael Kelly www.michaeldkelly.com Introduction With the exception of my first project team out of college, in every project team since, I ve had to explain either what automated
Magit-Popup User Manual
Magit-Popup User Manual for version 2.5 Jonas Bernoulli Copyright (C) 2015-2016 Jonas Bernoulli You can redistribute this document and/or modify it under the terms of the GNU General
Appendix: Tutorial Introduction to MATLAB
Resampling Stats in MATLAB 1 This document is an excerpt from Resampling Stats in MATLAB Daniel T. Kaplan Copyright (c) 1999 by Daniel T. Kaplan, All Rights Reserved This document differs from the published
Programming Exercises
s CMPS 5P (Professor Theresa Migler-VonDollen ): Assignment #8 Problem 6 Problem 1 Programming Exercises Modify the recursive Fibonacci program given in the chapter so that it prints tracing information.
Python Loops and String Manipulation
WEEK TWO Python Loops and String Manipulation Last week, we showed you some basic Python programming and gave you some intriguing problems to solve. But it is hard to do anything really exciting until
We will learn the Python programming language. Why? Because it is easy to learn and many people write programs in Python so we can share.
LING115 Lecture Note Session #4 Python (1) 1. Introduction As we have seen in previous sessions, we can use Linux shell commands to do simple text processing. We now know, for example, how to count words.
Second Degree Price Discrimination - Examples 1
Second Degree Discrimination - Examples 1 Second Degree Discrimination and Tying Tying is when firms link the sale of two individual products. One classic example of tying is printers and ink refills.
Scanner. tokens scanner parser IR. source code. errors
Scanner source code tokens scanner parser IR errors maps characters into tokens the basic unit of syntax x = x + y; becomes = + ; character string value for a token is a lexeme
Python Programming: An Introduction To Computer Science
Python Programming: An Introduction To Computer Science Chapter 8 Booleans and Control Structures Python Programming, 2/e 1 Objectives æ To understand the concept of Boolean expressions and the bool data
Using Microsoft Office to Manage Projects
(or, Why You Don t Need MS Project) Using Microsoft Office to Manage Projects will explain how to use two applications in the Microsoft Office suite to document your project plan and assign and track tasks.
Central England People First s friendly guide to downloading
Central England People First s friendly guide to downloading What is Skype? Skype is a computer programme that turns your computer into a telephone. This means that you can speak to other people using
03 - Lexical Analysis
03 - Lexical Analysis First, let s see a simplified overview of the compilation process: source code file (sequence of char) Step 2: parsing (syntax analysis) arse Tree Step 1: scanning (lexical analysis)
Preparing your data for analysis using SAS. Landon Sego 24 April 2003 Department of Statistics UW-Madison
Preparing your data for analysis using SAS Landon Sego 24 April 2003 Department of Statistics UW-Madison Assumptions That you have used SAS at least a few times. It doesn t matter whether you run SAS in
Install Java Development Kit (JDK) 1.8 http://www.oracle.com/technetwork/java/javase/downloads/index.html
CS 259: Data Structures with Java Hello World with the IntelliJ IDE Instructor: Joel Castellanos e-mail: joel.unm.edu Web: http://cs.unm.edu/~joel/ Office: Farris Engineering Center 319 8/19/2015 Install
Chapter 4 State Machines
Chapter 4 State Machines 6.01 Spring 2011 April 25, 2011 117 Chapter 4 State Machines State machines are a method of modeling systems whose output depends on the entire history of their inputs, and not
Welcome to the topic on approval procedures in SAP Business One.
Welcome to the topic on approval procedures in SAP Business One. 1 After completing this topic, you will be able describe the business process flow when an approval procedure is used, and set up a new
Intro to Mail Merge. Contents: David Diskin for the University of the Pacific Center for Professional and Continuing Education. Word Mail Merge Wizard
Intro to Mail Merge David Diskin for the University of the Pacific Center for Professional and Continuing Education Contents: Word Mail Merge Wizard Mail Merge Possibilities Labels Form Letters Directory
Introduction to Python
Caltech/LEAD Summer 2012 Computer Science Lecture 2: July 10, 2012 Introduction to Python The Python shell Outline Python as a calculator Arithmetic expressions Operator precedence Variables and assignment
VISUAL ALGEBRA FOR COLLEGE STUDENTS. Laurie J. Burton Western Oregon University
VISUAL ALGEBRA FOR COLLEGE STUDENTS Laurie J. Burton Western Oregon University VISUAL ALGEBRA FOR COLLEGE STUDENTS TABLE OF CONTENTS Welcome and Introduction 1 Chapter 1: INTEGERS AND INTEGER OPERATIONS
