Announcements

  • This site is still in draft form!

  • Most announcements will be in EdStem

  • Please be sure to fill out the survey

  • Bring your laptop to class (and power if you need it)

Course Info

Welcome to CS91R. Despite modern computers being largely driven by graphical interfaces, text-based user-interfaces---programs that get their input via human-readable text and provide their output via human-readable text---are incredibly powerful and pervasive. With the rise of large language models, the notion of commanding computers with natural language seems groundbreaking; however, computer scientists have long employed structured text that lives somewhere between general-purpose programming languages (e.g., C++ or Python) and natural languages (e.g., English or Chinese). This course will empower students to design, implement, and critique text-driven computer programs. Topics like the command-line (e.g., shells, redirection, pipes), scripting, scraping, text parsing & understanding, information retrieval, prompt engineering, searching with regular expressions, semi-structured data formats (e.g. HTML, XML, JSON), and other data formats will be covered. Students will learn how to prototype text-heavy applications with real-world data.

Meeting Times

Table 1. Meeting Times
Class/Lab Day Time Room Instructor

Class

Mon, Wed

9:00am - 10:15am

Singer 34/35

Keith and Rich

Lab A

Thu

1:05pm - 2:35pm

Science Center 256

Keith

Lab B

Thu

1:05pm - 2:35pm

Science Center 240

Rich

Lab C

Thu

2:45pm - 4:15pm

Science Center 240

Rich

Office Hours

Table 2. Office Hours
Name Office Hours Location

Rich Wicentowski

M 1:15pm-2:45pm; W 2:30pm-4:00pm

SCI 251

Keith O’Hara

M 10:30-11:30am; W 1:15-2:15pm

SCI 205C

Textbooks

See the Schedule for each week’s reading assignment.

Here are a few other useful online resources:

Course Goals

By the end of the course, we hope that you will have developed the following skills:

  • Understand the utility of text-based user interfaces.

  • Design and critique text-intensive programs.

  • Master the command-line making use of common UNIX utilities, pipes and redirection.

  • Use scripting languages like bash, python, and awk to automate computational tasks.

  • Search and process text using tools such as parsers and regular expressions.

  • Store and process data in semi-structured data formats (e.g., HTML, XML, JSON).

  • Implement common text processing and information retrieval algorithms.

  • Effectively navigate, critique and design Application Program Interfaces (APIs).

Schedule

WEEK DAY ANNOUNCEMENTS TOPIC & READING LABS
1

Jan 22

 

Course Introduction

  • Barrett Appendix & Ch. 1
  • CLAB: Text-based interfaces
  • CLAB: Combining Commands

Lab 0

2

Jan 27

 

UNIX|REGEX

  • Barrett ch. 2-4 (pg 19-73)
  • Barrett ch. 5 (pg 74-94)
  • Jurafsky Ch. 2.1
  • CLAB: CLI/History
  • CLAB: Cruising Filesystem
  • CLAB: Regex

Lab 1

Jan 29

 
3

Feb 03

 

Counting & Shells

  • Jurafsky Ch. 2.2-2.5
  • Shotts Ch. 19
  • Barrett ch. 6 & 7
  • Shotts Ch. 6 & 7
  • CLAB: REGEX REDUX
  • CLAB: redirection; substitutions

Lab 2

Feb 05

QUIZ 1

4

Feb 10

 

Unigrams, Bigrams, and Codes

  • Huffman Codes
  • Shotts ch. 12
  • Jurafsky Ch. 3
  • Barret ch. 8
  • 4-4.2 "Text as Data" from Language and Computers, Glass et al.
  • CLAB: ed/vi/nano
  • CLAB: morse code; cryptograms

Lab 3

Feb 12

 
5

Feb 17

Guest lecture: Joe Wicentowski

Sentences & XML

Lab 4

Feb 19

QUIZ 2

6

Feb 24

 

Text-based User Interfaces

no lab

Feb 26

 
7

Mar 03

 

TUI part 2

  • Shotts Ch. 13
  • CLAB: build a better prompt
  • CKLAB: ncurses

Lab 5

Mar 05

QUIZ 3

 

Mar 10

Spring Break

Mar 12

8

Mar 17

 

Scraping

  • Barrett 10
  • CLAB: wget/curl
  • CLAB: python/jq

Lab 6

Mar 19

 
9

Mar 24

 

Scripting

  • Shots Ch. 24-29
  • Shots Ch. 30
  • CLAB: bash scripting; watch/screen/tmux/tail
  • CLAB: better error & log messages

Lab 7

Mar 26

QUIZ 4

10

Mar 31

 

Visualization

  • CLAB: matplotlib/seaborn/csv/sheets
  • CLAB: vega/json

Lab 8

Apr 02

 
11

Apr 07

 

Word Vectors

  • Jurafsky Ch. 6
  • 4.4 of "Text as Data" from Language and Computers by Glass et al.
  • clustering and visualizing vectors
  • CLAB: n-grams
  • CLAB: LLM

Lab 9

Apr 09

QUIZ 5

12

Apr 14

 

Norvig

Lab 10

Apr 16

 
13

Apr 21

 

Interactive Fiction

  • "Twisty Little Passage", Nick Montfort
  • CLAB: twine
  • CLAB: inform

Lab 11

Apr 23

QUIZ 6

14

Apr 28

 

Generation

  • CLAB: nanogpt
  • CLAB: ai_dungeon

Lab 12

Apr 30

 
 

May 17

Final meeting somewhere around here

Grading

Weight Component

25%

Quizzes

25%

In-class exercises; discussion; attendance

50%

Labs and final project

In-class assignment policy

(WORK IN PROGRESS)

Each day, you will complete an in-class assignment, a "clab" (short for in class-lab). You will work in a group of 4 people, 5 if necessary, on a clab assignment. You are expected to work on the clab during class time, sharing your screen on the in-class projectors while you work. The expectation is that you and your group will finish the clab assignment in class.

Each student will have their own clab repository. (There will be no group repositories for clabs.) In order to effectively learn the material, each student in the group should complete the clab while working together with your groupmates.

If a student does not have a laptop that day, they may add their name to the submission of another student in the group. This should not be a regular occurrence but is an acceptable way to complete the clab.

Clabs will be graded out of 3 points:

Points Completion rate

3

Completed

2

Mostly complete

1

Partially complete

0

Missing or mostly incomplete

Lab Policy

This course features regular lab assignments that account for the largest component of your course grade. Lab attendance is required by all students. Additionally, the cs labs are open 24 hours a day, 7 days a week for you to use for CS91R lab assignments.

Lab assignments will typically be assigned during the lab sections and will generally be due by midnight 1 week later. You are strongly encouraged to start early!

Even if you do not fully complete a lab assignment, you should submit what you have done to receive partial credit.

Accessing the CS labs after hours

You can use your ID to gain access to the computer labs at nights and on the weekends. Just wave your ID over the OneCard reader next to the lab doors. When the green light goes on, just push on the door handle to get in (the door knob will not turn). If you have issues with the door locks, send an email to local-staff@cs.swarthmore.edu. If the building is locked, you can use your ID to enter the door between Martin and Cornell library. For this class, your ID will give you access to the labs in rooms SCI 238, 240, 256, and the Clothier basement.

Absence / Assignment Extension Policy

You are expected to attend every class.

To help with cases of minor illnesses, athletic conflicts, or other short-term time limitations, we will drop your lowest quiz and your two lowest in-class assignments (clabs). If you miss a class, you are still responsible for the material and should arrange to get notes from another student in the class. If you miss an in-class assignment, you are strongly encouraged to complete it on your own.

All students start the course with two "late lab days" to be used at your discretion, with no questions asked. To use your extra time, you must email your professors after you have completed the lab and pushed to your repository. You do not need to inform anyone ahead of time. When you use late time, you should still expect to work on the newly-released lab during the following lab section meeting. The professors will always prioritize answering questions related to the current lab assignment.

Your late days will be counted at the granularity of full days and will be tracked on a per-student (NOT per-partnership) basis. That is, if you turn in a lab five minutes after the deadline, it counts as using one day. For partnered labs, using a late day counts towards the late days for each partner. In the rare cases in which only one partner has unused late days, that partner’s late days may be used, barring a consistent pattern of abuse.

If you feel that you need an extension on an assignment or that you are unable to attend class for two or more meetings due to a medical condition (e.g., extended illness, concussion, hospitalization) or other emergency, you must contact the dean’s office and your instructors. Faculty will coordinate with the deans to determine and provide the appropriate accommodations. Note that for illnesses, the College’s medical excuse policy, states that you must be seen and diagnosed by the Worth Health Center if you would like them to contact your class dean with corroborating medical information.

Academic Accommodations

If you believe you need accommodations for a disability or a chronic medical condition, please contact Student Disability Services via email at studentdisabilityservices@swarthmore.edu to arrange an appointment to discuss your needs. As appropriate, the Office will issue students with documented disabilities or medical conditions a formal Accommodations Letter. Since accommodations require early planning and are not retroactive, please contact Student Disability Services as soon as possible.

For details about the accommodations process, visit the Student Disability Services website.

You are also welcome to contact any of the course staff privately to discuss your academic needs. However, all disability-related accommodations must be arranged, in advance, through Student Disability Services.

To receive an accommodation for a course activity you must have an official Accommodations Letter and you need to meet with the course professor to work out the details of your accommodation at least two weeks prior to any activity requiring accommodations.

Academic Integrity

(WORK IN PROGRESS)

Academic honesty is required in all your work. You will be expected to demonstrate your “theory of the program” (Peter Naur), either verbally or in written form: explain how your program solves the problem, justify your design decisions, or suggest ways your program might be modified to solve a related, but slightly different problem.

Under no circumstances may you hand in work done with or by someone else under your own name. Discussing ideas and approaches to problems with others on a general level is encouraged, but you should never share your solutions with anyone else nor allow others to share solutions with you. You may not examine solutions belonging to someone else, nor may you let anyone else look at or make a copy of your solutions. This includes, but is not limited to, obtaining solutions from students who previously took the course or solutions that can be found online. You may not share information about your solution in such a manner that a student could reconstruct your solution in a meaningful way (such as by dictation, providing a detailed outline, or discussing specific aspects of the solution). You may not share your solutions even after the due date of the assignment.

In your solutions, you are permitted to include material which was distributed in class, material which is found in any assignment textbook, and material developed by or with an assigned partner.

Use of, or consultation with, outside resources including stackoverflow, reddit, google, and generative AI (e.g., chatGPT or GitHub CoPilot) is permitted for targeted technical assistance. In these cases, you should always include detailed comments indicating which parts of the assignment you received help with and what your sources were. In these cases, be ready to demonstrate your "theory of the program." Use of outside resources should not shortcut the learning objectives of an assignment. You must have a complete understanding of any work you submit.

When working on quizzes, or similar assessments, you are not permitted to communicate with anyone about the quiz during the entire examination period (even if you have already submitted your work). You are not permitted to use any resources to complete the quiz other than those explicitly permitted by course policy. (For instance, you may not look at the course website during the quiz unless explicitly permitted by the instructor when the quiz is distributed.)

Failure to abide by these rules constitutes academic dishonesty and will lead to a hearing of the College Judiciary Committee. According to the Faculty Handbook:

"Because plagiarism is considered to be so serious a transgression, it is the opinion of the faculty that for the first offense, failure in the course and, as appropriate, suspension for a semester or deprivation of the degree in that year is suitable; for a second offense, the penalty should normally be expulsion."

This policy applies to all course work, including but not limited to code, written solutions (e.g. proofs, analyses, reports, etc.), quizzes, and so on. This is not meant to be an enumeration of all possible violations; students are responsible for seeking clarification if there is any doubt about the level of permissible communication.

The general ethos of this policy is that actions which shortcut the learning process are forbidden while actions which promote learning are encouraged. Studying lecture materials together, for example, provides an additional avenue for learning and is encouraged. Using a classmate’s solution, however, is prohibited because it avoids the learning process entirely. If you have any questions about what is or is not permissible, please contact your instructor.

Quiz Integrity

Students must strictly adhere to the following policy, which applies to all quizzes taken in a Computer Science course at Swarthmore:

Quiz takers must place all non-essential items at the front of the room (or other designated area). Unless otherwise permitted, students may not have any electronic devices or course materials in their possession during the entirety of the quiz. This includes cell phones, tablets, laptops, smart watches, course notes, articles and books, among others. These items should be placed at the front of the room near the proctor. If you need to leave the room during the quiz, you must obtain permission from an instructor first. Any non-permitted discussion or aide in regards to quiz material will result in immediate forfeiture of the quiz and a report to the College Judiciary Committee. Please discuss any concerns or accommodations with your instructor prior to starting the quiz.

Links that are related to the course may be posted here. If you have suggestions for links, let us know.