To my linguistics homepage

LING 408/508
Programming for Linguists
Fall 2015

This is a introductory course to computers and programming for linguists.


No textbook is required. All reading material will be made available online.


Students will be expected to install virtualized Ubuntu (Linux) on their computers for programming use.

Instructor: Sandiway Fong
Office: Douglass 311


Location Shantz 338 (Lecture)
Time Mondays/Wednesdays 3:15-4:30 pm


See lecture1 slides.

Lecture Notes

Available in Adobe PDF formats.


Date Lecture Notes Number
of Slides
Panopto Topic
PDF Powerpoint
8/24 lecture1.pdf lecture1.pptx 21 Viewer Administrivia and Introduction. Computers and storage. The representation of numbers.
Updated: 10pm 8/24, 10:30pm 8/25
8/26 lecture2.pdf lecture2.pptx 33 Viewer Introduction contd. The representation of numbers and characters. Homework 1.
Updated: 6:30pm 8/26 added slides for homework 1 hints
hw1help.xlsx (Excel spreadsheet)
8/31 lecture3.pdf lecture3.pptx 33 Viewer Review of Homework 1. Introduction to VirtualBox and Ubuntu.
Homework 2: Install Ubuntu on your computer.


Date Lecture Notes Number
of Slides
Panopto Topic
PDF Powerpoint
9/2 lecture4.pdf lecture4.pptx 20 Viewer The Bash shell. Homework 3: BMI shell script calculator.
9/7Labor Day: No lecture.
9/9 lecture5.pdf lecture5.pptx 14 Viewer Homework 3 review. More Bash shell: for loop, while loop, positional parameters, expansion (arithmetic, globbing, brace), string manipulation
Updated: 6:15pm 9/9
9/14 lecture6.pdf lecture6.pptx 9 Viewer Homework 4 exercises. Bash shell: rm, awk.
File: surnames.txt
9/16 lecture7.pdf lecture7.pptx 4 Ungraded homework exercises.
9/21No lecture.
9/23 lecture8.pdf lecture8.pptx 25 Viewer Homework 4 review. awk. Problem with awk and UTF-8. Ungraded homework exercise review: using read and I/O redirection. HERE documents. Expect.
9/28 lecture9.pdf lecture9.pptx 24 Viewer VirtualBox copy/paste. More with expect. An introduction to HTML.
9/30 lecture10.pdf lecture10.pptx 15 Viewer Experimenting with HTML styles.


Date Lecture Notes Number
of Slides
Panopto Topic
PDF Powerpoint
10/5 lecture11.pdf lecture11.pptx 21 No Panopto Introduction to Javascript. The Document Object Model (DOM).
10/7 lecture12.pdf lecture12.pptx 14 Viewer Writing a Javascript program. Homework 5.
boxes.html (control/right-click to download)
10/12No lecture.
10/14 lecture13.pdf lecture13.pptx 28 Viewer Homework 5 Review. HTML forms and Javascript. BMI calculator in Javascript. Using a SVG graphical library: gauge.js. Data validation.
10/19 lecture14.pdf lecture14.pptx 14 Viewer bmi-gauge.html
Javascript regular expressions.
Slides corrected: 4:40pm 10/19
10/21 lecture15.pdf lecture15.pptx 16 Viewer Homework 6. Regular expression search and replace in Javascript.
10/26 lecture16.pdf lecture16.pptx 41 Viewer Homework 6 review. Building a webserver on OS X and Ubuntu. Static webpage delivery. Homework 7.
10/28 lecture17.pdf lecture17.pptx 23 No Viewer Building a webserve on OS X and Ubuntu contd. Executing cgi-bin programs on an external webserver. Homework 8.
Slides corrected: Nov 2.


Date Lecture Notes Number
of Slides
Panopto Topic
PDF Powerpoint
11/2 lecture18.pdf lecture18.pptx 12 Viewer Sending form data to the webserver. GET and POST methods. Another Example: add names to a file stored on the webserver. Homework 9.
11/4 Viewer Lecture canceled.
11/9 lecture19.pdf lecture19.pptx 9 Viewer Term project. Python. NLTK. Pythonbook Chapters 1 and 2.
11/11Veterans Day: No lecture.
11/16 lecture20.pdf lecture20.pptx 9 Viewer Python contd. Chapters 2, 3 (Numbers) and 4 (Strings). Quickie Homework 10.
11/18 lecture21.pdf lecture21.pptx 12 Viewer Python contd. Chapter 4. Strings and files. Unicode and string types. UTF-8 encoding.
Updated: 11/18 8:30pm
11/23 lecture22.pdf lecture22.pptx 14 Viewer Python contd. Chapter 5. A simple object-oriented graphics library. Object inheritance. The underlying Tcl/Tk toolkit.
Slides updated: 4:45pm 11/23
11/25 lecture23.pdf lecture23.pptx 25 No Panopto available. Python contd. Chapters 5, 6 and 7.
11/30 lecture24.pdf lecture24.pptx 24 Viewer Chapters 8 and 9. Loops, booleans and coercion, and Monte Carlo simulations.


Date Lecture Notes Number
of Slides
Panopto Topic
PDF Powerpoint
12/2 lecture25.pdf lecture25.pptx 21 Viewer Monte Carlo simulation and fairness. Chapter 10: Classes and object-oriented design. MSDie. Projectile. Projectile and graphics. sys.argv, sys.exit()
12/7 lecture26.pdf lecture26.pptx 38 Viewer Homework 12: install NLTK. Chapter 11: lists. lambda abstraction. higher-order functions: map and reduce.
12/9 lecture27.pdf lecture27.pptx 20 Viewer Higher order functions: map, reduce and filter. Dictionaries. Word frequency program. Tokenization. Regular expressions using method re.sub().
Slides updated: 4:30pm 12/9

To my linguistics homepage
Last modified: Wed Dec 9 20:39:44 MST 2015