|
This is a introductory course to computers and general programming useful for linguists (and non-engineers). Topics include Linux and the Terminal (Shell usage and programming), Python and web technologies such as HTML, CSS, Javascript and Apache2. A term project is required. Textbook No textbook is required. All reading material will be made available online Software
All software used in this class will be freely available.
|
Instructor: Sandiway Fong sandiway@arizona.edu
Office: Douglass 311 (send email for an appointment or
take a chance and drop by before/after class)
| Location | Education, Rm 308 |
| Time | Tuesdays/Thursdays 2 - 3:15PM |
| Date | Lecture Notes | Number of Slides |
Panopto | Topic | |
|---|---|---|---|---|---|
| Powerpoint | |||||
| 8/26 | lecture1.pdf | lecture1.pptx | 25 | Viewer | Administrivia (Syllabus) and Introduction:
Natural Language processing tools: Syntactic parsers, Google n-grams, and the Natural Language Toolkit (NLTK). The fundamental nature of computation: the Turing Machine, Busy Beavers example. |
| 8/28 | lecture2.pdf | lecture2.pptx | 24 | Viewer |
Binary and hexadecimal. Computer vs. Human Brain. Machine
Language. Parallelism and supercomputers. Integers and 2's
complement arithmetic. Binary Coded Decimal (BCD). Floating point
numbers.
Homework 1 |
| Date | Lecture Notes | Number of Slides |
Panopto | Topic | |
|---|---|---|---|---|---|
| Powerpoint | |||||
| 9/2 | lecture3.pdf | lecture3.pptx | 26 | Viewer | Homework 1 review. Character representation: ASCII and
Unicode. HTML5 and Unicode.
pokemon.html / pokemon2.html / pokemon3.html |
| 9/4 | lecture4.pdf | lecture4.pptx | 13 | Viewer |
Homework 2. Installing Ubuntu as a guest operating system on your
Windows 11 machine.
Recommend installing Microsoft's Windows Sub-system for Linux 2 (WSL2). (Older: VirtualBox (vbox) for Intel/AMD x86 machines only.) Navigating around the hierarchical file system: pwd, cd, ~, .., . Text editor: nano. sudo prefix, rm Checking the Ubuntu version, Tk graphics with Python, and Pip (package manager). Terminal log: terminal4.txt (commands typed in today's lecture) |
| 9/9 | lecture5.pdf | lecture5.pptx | 19 | Viewer |
Terminal commands. The Bash shell.
Control-D, what it means. Control-G, ringing the bell. The bc calculator. Shell variables. Shell commands. Directories and files. Shell arithmetic using expr and ((...)). PS1 prompt customization. .bashrc editing using nano. A first shell program using for-do-done. Terminal log: terminal5.txt |
| 9/11 | lecture6.pdf | lecture6.pptx | 23 | Viewer |
The cat command. chmod for permissions.
Bash shell programming. test. Asking for Shell input using read -p. if-then-else/elif-fi. [macOS note: zsh doesn't like -p. Type bash at the zsh command line to enter the Bash shell.] Homework 3: Bash shell exercises. Useful word commands: wc, tr, sort, and uniq. Note: Windows files can be accessed/copied to Ubuntu from /mnt/c File: text.txt Terminal log: terminal6.txt |
| 9/16 | lecture7.pdf | lecture7.pptx | 23 | Viewer | Homework 3 review.
The spirit of Unix: piping commands together to do powerful things! Useful: tail. awk. termgraph: ASCII graphics. A note on file permissions: chmod binary pattern for rwx. Terminal log: terminal7.txt |
| 9/18 | lecture8.pdf | lecture8.pptx | 24 | Panopto crashed, no video |
The calculator bc revisited: scale, obase, arbitrary
precision pi and e.
Bash command substitution: two ways. Positional parameters $n. If-test: [...] and [[...]]]. Homework 4: writing a Bash shell script. File: test.sh / test2.sh / test3.sh Terminal log: terminal8.txt |
| 9/23 | lecture9.pdf | lecture9.pptx | 19 | Viewer |
Talk tomorrow @ 4pm on linguistic theory.
Homework 4 Review. Bash shell: suffix and prefix deletion, string maninpulation, loops, positional parameters and globbing. Example programs: line30.sh cmd.sh rmext.sh Terminal log: terminal9.txt |
| 9/25 | lecture10.pdf | lecture10.pptx | 28 | Viewer |
Final lecture on Bash shell programming.
Example exercises: (1) file deletion, (2) double-spacing, (3) non-blank lines only, and (4) using find and sed. Example programs: rm.sh doublespace.sh doublespace2.sh nonblank.sh Terminal log: terminal10.txt |
| 9/30 | lecture11.pdf | lecture11.pptx | 33 | Viewer |
Upcoming talk on Generative Linguistics and Generative AI. Oct 10th.
The frontend: an introduction to html5. Html, css and javascript. What is hypertext? Client-side vs. server-side. HTML tags. URL format. IMG. Embedded images using base64. Text element tags. Preformatted blocks. Turning on debugging in the browser: Safari, Google Chrome and Firefox. Ungraded Homework Exercise. Sample file: mypage.html Terminal log: terminal11.txt |
| Date | Lecture Notes | Number of Slides |
Panopto | Topic | |
|---|---|---|---|---|---|
| Powerpoint | |||||
| 10/2 | lecture12.pdf | lecture12.pptx | 19 | Viewer | More html tags.
X11 colors. History of X11. UTF-8 and the meta tag. Introduction to CSS: inline style. Tabs. Homework 5 Example html file used in class: mypage2.html |
| 10/7 | lecture13.pdf | lecture13.pptx | 25 | Viewer |
Javascript. Console in browser.
document.write(string), document.getElementById(ID).innerHTML, console.log(string). Tic-tac-toe example. Javascript variables, and numbers (64-bit floats). Random number generation using Math.random(). File: sample.html File: sample2.html File: sample3.html |
| 10/9 | lecture14.pdf | lecture14.pptx | 26 | Viewer |
Javascript strings, operators, if-else, switch-case, for/while
loops.
Tic Tac Toe example contd. File: sample3.html File: sample4.html File: sample5.html File: sample6.html File: sample7.html Homework 6: making the game playable, step-by-step! Note: extended due date! |
| 10/14 | lecture15.pdf | lecture15.pptx | 24 | Viewer |
A note on Homework 6: setTimeout() and the event loop.
Some Term Project Ideas: using the grid and others. Forms and Javascript: File: inputtext.html File: inputcheckbox.html File: select.html File: radio.html Example: BMI Gauge animated display (using Javascript) File: bmi-gauge.html File: gaugeSVG.js Slides updated: 4:15pm |
| 10/16 | lecture16.pdf | lecture16.pptx | 19 | Viewer |
Homework help: 2nd half of lecture.
Example: BMI Gauge animated display (using Javascript) revisited. File: bmi-gauge.html File: gaugeSVG.js Example:random number generator File: justgage.js File: counter.html |
| 10/21 | lecture17.pdf | lecture17.pptx | 26 | Viewer | Homework 6 Review.
Extra: "Smart" 3D Tic Tac Toe. Installing and configuring the Apache2 webserver on macOS and Ubuntu: start/stop service, DocumentRoot, and UserDir. IP lookup. IPv6 and IPv4. Geolocation.
File: sample-index.html Terminal log: terminal17.txt Slides updated: 3:25pm |
| 10/23 | lecture18.pdf | lecture18.pptx | 26 | Viewer |
Installing and configuring the Apache2 webserver on
macOS and Ubuntu platforms contd.
Homework 7 |
| 10/28 | lecture19.pdf | lecture19.pptx | 24 | Viewer |
Homework 7 review
cgi-bin (Common Gateway Interface) setup on macOS and Ubuntu. An Example using HTML/Javascript: diskspace.cgi. Command: df -g.
Use of awk to extract information from df.
File: test.cgi (Download linked file as...) File: diskspace.cgi (Download linked file as...) File: canvasjs.min.js (Javascript widget)
Terminal log: terminal19.txt Slides updated: 4pm |
| 10/30 | lecture20.pdf | lecture20.pptx | 29 | Viewer |
Running a cgi-bin program from inside your home directory.
Worked example: CMU pronouncing dictionary run in Perl. File: cmudict.cgi (Download linked file as...) |
| Date | Lecture Notes | Number of Slides |
Panopto | Topic | |
|---|---|---|---|---|---|
| Powerpoint | |||||
| 11/4 | lecture21.pdf | lecture21.pptx | 36 | Viewer |
Announcement: class schedule for the remainder of the semester
Why Python? Examples of what you can do with Python + nltk Python numbers. Homework 9: install Python 3. NEW! for Windows 11, Python Install Manager. Terminal log: terminal21.txt |
| 11/6 | lecture22.pdf | lecture22.pptx | 26 | Viewer |
Homework 10: Install nltk and nltk data.
More on Python: range() and use in calculating compound interest. Type coercion: converting numbers and strings. Function def. yield and return. Formatted output, e.g. print('format string'.format()). Strings and lists: indexability and mutability. Command line arguments: sys.arg list. File: futval.py File: futval2.py File: futval3.py Terminal log: terminal22.txt |
| 11/11 | Viewer | Veterans Day - no classes | |||
| 11/13 | lecture23.pdf | lecture23.pptx | 20 | Viewer |
Python and text. Exercises. for-loop and list
comprehension. Functions sum() and mean().
nltk.corpus.gutenberg.words(). nltk.FreqDist() and .plot(). set() Files: open(), .read(), .readline(), .readlines(). Terminal log: terminal23.txt |
| 11/18 | lecture24.pdf | lecture24.pptx | 22 | Viewer |
.word_tokenize(), .pos_tag().
Penn Treebank POS tagset. treebank.parsed_sents(), .draw(). .chunk.ne_chunk() .concordance(), .similar(), .common_contexts() Homework 11. Terminal log: terminal24.txt |
| 11/20 | lecture25.pdf | lecture25.pptx | 28 | Viewer |
def lex_diversity(), eval().
Importing your own corpus: an example using Project Gutenberg. text.findall(r"... pattern ...") String methods: word.startswith(string), word.endswith(string), word.istitle(). Terminal log: terminal25.txt |
| 11/25 | lecture26.pdf | lecture26.pptx | 19 | Viewer |
Solving an encoding mystery: Latin-1 vs. UFT8.
Sentence tokenization: nltk.sent_tokenize(string). Literary Style: Stream of consciousness and nltk. Mrs. Dalloway vs. Brown Fiction. matplotlib bar charting.
|
| 11/27 | Viewer | Thanksgiving - no classes | |||
| Date | Lecture Notes | Number of Slides |
Panopto | Topic | |
|---|---|---|---|---|---|
| Powerpoint | |||||
| 12/2 | Viewer | Term Project | |||
| 12/4 | Viewer | Term Project | |||
| 12/9 | Viewer | Term Project | |||