Dr. Zhijun Wang, Professor of Computer Science
♦   Welcome to CIS 331 — Programming Languages   ♦
Weeks Topics | Resources | Suggested Readings | Special Days | Important Dates HAs | Projects | Exams
#1
8/28-9/1
  • Introduction and syllabus. Course website. Class policies and guidelines.
  • Natural and programming languages. Concepts of syntax and semantics.
  • History of programming languages. Language generations. Slides.
  • Introduction to interpreters and compilers.
  • Applications, evaluations, categories, and environments of programming languages.
  • Readings - Any general programming language resource.

Monday, 8/28. Add/Drop and Late Registration via RAIL or at Ikenberry Hall.

Friday, 9/1. Last Day to Add/Drop or Late Register via RAIL or at Ikenberry Hall.

Assignment 1

#2
9/4-9/8
  • Download and install the latest Python 3 release. Add Python to PATH on Windows.
  • Install Geany for small projects. Write, compile, and execute the first .py program.
  • Optional - PyCharm for more complex projects.
  • Comments. Built-in functions. Indentations.
  • Variables, variable names, and objects. Dynamic typing. Funciton "type".
  • Readings - Matthes Chapters 1, 2 & Appendices A - C.

Monday, 9/4. Labor Day — Holiday.

Friday, 9/8. Last Day for Instructor-Approved Late Adds via RAIL.

#3
9/11-9/15
  • Strings and string functions - "lower, upper, title, lstrip, rstrip, and strip".
  • Common sequence object operations - length, indexing, and slicing.
  • Integers and floats. Common arithmetic operations.
  • Floor division //. Exponentiation **. Multiplication of integer and string.
  • Assignments and multiple assignments.
  • Retrieving user inputs as strings using "input" function.
  • List data structure. Length, indexing, and slicing of lists.
  • List update([]), insertion (append & insert), and deletion (remove & pop functions, del statements).
  • List reverse and sort (permanent). Sorted function (display).
  • Examples - String functions. Basic types. List basics.
  • Readings - Matthes Chapters 2 & 3.
Assignment 2

#4
9/18-9/22
  • Exercises on list basics. Get familiar with Python lists.
  • Using loops on lists. Use "range" function with lists. List statistics.
  • List comprehensions. List copies and aliases. Tuples.
  • Boolean type. Boolean expressions.
  • Selection structures - if. if/else. if/elif/else.
  • Examples and exercise solutions - More on lists. Using selection structures on lists.
  • Readings - Matthes Chapters 4 & 5.

Exam 1 to be combined with exam 2.

#5
9/25-9/29
  • Using selection structures on lists.
  • Dictionaries - Search, insertion, update, and deletion.
  • Using loops to process key-value pairs, keys, and values.
  • Nesting of lists and dictionaries. Data applications of nesting.
  • While loops. Three ways to quit a while loop.
  • Using while loops with lists and dictionaries.
  • "input" function review. Exercises.
  • Examples and exercise solutions - Dictionaries. While loops.
  • Readings - Matthes Chapters 5 - 7.
Assignment 3

#6
10/2-10/6
  • Function definition. Parameters and arguments.
  • Positional and keyword argument passing.
  • Parameters with default values. Optional parameters using empty default values.
  • Dynamic return type. Example - returning a dictionary.
  • Passing lists by reference (recommended especially for large lists) and by value (copy).
  • Arbitrary number of positional parameters (tuple used) or keyword parameters (dictionary used).
  • Storing functions in modules and importing modules/functions.
  • Examples and exercise solutions - Function basics. Function examples. Module example. Import syntax.
  • Readings - Matthes Chapters 8.
#7
10/9-10/13

Mid-term Exam Week.

Friday, 10/13. Last Day to Apply for May 2018 Graduation (Registrar’s Office).

Exam 1 & 2 on Wednesday. Covers weeks #1-6.

Programs and answers.
#8
10/16-10/20

Thursday & Friday, 10/19 & 10/20. Fall Break (or Make-up Days for Inclement Weather).

Assignment 4

#9
10/23-10/27
  • Object-oriented programming exercises - Abstract classes, static members, and multiple inheritance.
  • File open mode - read, write, and append.
  • File read using file handles - read, readline, and readlines.
  • File write using file handles - write and writelines.
  • Examples and answers - OOP exercise answers. Python files.
  • Readings - Matthes Chapters 9 & 10.

Wednesday, 10/25. First Day of Academic Advisement for Continuing Students for Spring 2018.

Friday, 10/27. Last Day to Withdraw from a Full Semester Class — See Advisor by Noon.

#10
10/30-11/3
#11
11/6-11/10

Monday, 11/6. First Day of Spring 2018 RAIL Registration for Continuing Students.

Wednesday, 11/8. Last Day of Academic Advisement for Continuing Students for Spring 2018.

Exam 3 - To be combined with the final exam.


Assignment 5
#12
11/13-11/17
#13
11/20-11/24

Thanksgiving Recess.

#14
11/27-12/1
  • API calls. An example → https://api.github.com/search/repositories?q=language:python&sorts=stars
  • Installing "requests" module → pip install --user requests
  • Processing and visualization JSON data from API calls. Example.

  • Setting up a web applicaton project on Windows with Django.
    1. Create a virtual environment in a new folder → python -m venv ll_env
    2. Activate the virtual environment → ll_env\Scripts\activate
    3. Install a web framework - Django → pip install Django
    4. Create a project → django-admin.py startproject learning_log .
    5. Create a database → python manage.py migrate
    6. Start Django server → python manage.py runserver
    7. Open a new command window, activate the virtual environment, and create an app infrastructure → python manage.py startapp learning_logs
    8. Add 'learning_logs' to 'INSTALLED_APPS' in settings.py.
  • Defining and activating models.
    1. Add data models (classes) to models.py.
    2. Create database tables for models → python manage.py makemigrations learning_logs
    3. Migrate the database → python manage.py migrate
  • Dijango admin site (/admin/) and shell.
    1. Create superuser → python manage.py createsuperuser
    2. Register models with the admin site in admin.py.
    3. Test and debug using the Django shell → python manage.py shell
  • Readings - Matthes Chapters 17 & 18.
Assignment 6
#15
12/4-12/8
Please note the new release Django 2.0 on 12/2/2017 deleted certain modules used in some Python files. If Django is installed after this date, you have to modify programs according to Django 2.0.
  • The learning log home page without "users" - index.html
    1. Define/map URL patterns - add project and learning logs app URL patterns to 'urls.py' files.
    2. Write the view.
    3. Write the template.
    4. Directory structure for templates → app_folder\templates\namespace\template_html_files
  • In the virtual environment, create the app "users" → python manage.py startapp users
  • Add 'users' to 'INSTALLED_APPS' in settings.py.
  • Update data models to include "users" - models.py.
  • Define forms.py in the "learning_logs" app.
  • The learning log additional pages -
    1. Define/map URL patterns - add project, learning logs, and users apps patterns to 'urls.py' files.
    2. Write/updating learning logs, and users views that retrieve/process data and render pages.
    3. Write/update learning logs, and users templates for web pages. Styles can be added later.
  • Readings - Matthes Chapters 18 & 19.

Friday, 12/8. Last Day of Classes. Last Day for Complete Withdrawal from Semester.

#16
12/11-12/15

Final Exam Week.

Final Exam -
12 – 2 pm,
12/11, Monday.