CSC209: Software Tools and Systems Programming
https://q.utoronto.ca/courses/204484
Karen Reid Nathan Wiebe
csc209-2021-01@cs.toronto.edu
Welcome Back!
First exercise: Let’s find out more about you and your fellow classmates
Introductions
In the breakout rooms:
1. Introduce yourself
2. Say one interesting thing about yourself
3. What worries you the most about this course OR what are you most excited about
When you come back from the breakout rooms, type one thing you are worried/excited about in the chat.
•
– –
•
•
Use for personal communication, such as a request for special
Communication
Piazza
Use first for non-personal communication Informative subject lines help
Email: csc209-2021-01@cs.toronto.edu
In-person Office Hours
–
consideration.
Use for questions about course material and help with
–
coursework.
Professionalism and Email
Email is a formal method of communication: Use proper English.
State your question clearly, with enough context. Sign it (Name and utorid are the most useful.)
In person
Major, super-helpful tip on how to ask questions!
•
–
–
–
•
–
• •
–
Inverted/Blended Classroom
Preparation before class (videos & exercises) Hands-on Activities in class
Need to be ready to do some programming during class
•
•
•
Course Information
All important information will be on Quercus Syllabus – deadlines, policies
Lectures & Labs – schedule, notes, worksheets etc. The Quercus site is the official source of announcements.
https://q.utoronto.ca/courses/204484/ Make sure you have the prerequisites!
Texts
• • •
•
•
Assignments
You will use git to manage and submit your assignments. The repositories are set up on MarkUs
Submit your assignment to your repo well before the due date. (Then submit again and again as you improve your solution.)
All code must work on teach.cs to receive full marks.
Code that does not compile on teach.cs will get 0.
See course syllabus for late penalties and remark policies.
•
• •
•
Weekly Lab Exercises
Check the Labs page on Quercus for “location” – Tuesdays 8pm
– Fridays 1pm, 2pm, or 3pm
Starting this week
Submit your work on MarkUs (git) for credit – 1% per lab; best 9 of 10
– No credit for attendance
Due by 6:30pm Friday (no lates accepted)
Complete Software Setup now!
•
Software Installation
Follow the Software Setup instructions on Quercus (With help on Piazza)
Begin learning to use a good code editor (vim, VS
•
Code, emacs, nano, atom, sublime)
Learn to connect remotely to teach.cs and compile,
•
edit, run programs:
Learning to use ssh from the command line will really pay https://www.teach.cs.toronto.edu/using_cdf.html
–
off
–
Plagiarism
• “The work you submit must be your own, done without participation by others. It is an academic offence to hand in anything written by someone else without acknowledgement.”
• You are hurting your friend when you give him or her a copy of your assignment.
• You are hurting your friend when you ask him or her to give you a copy of their assignment.
•
–
•
–
–
What is cheating?
Cheating is
copying parts or all of another student’s assignment
including code from books, web sites, other courses
–
without attribution
getting someone else to do substantial parts of your
–
assignment
giving someone else your solution
Cheating is not
helping to find a bug in a friend’s code (be careful)
helping each other understand man pages or example
–
code
What is this Course About?
Software Tools
Efficiently use the Unix Command Line
Understand the shell
Use Basic Shell Programming Understand and use Make
Systems Programming C
files
processes communication
•
–
– – –
•
–
– – –
Unix Principles
• Do one basic thing well
with some basic variations
• Simple input formats
plain text
don’t require interactive input
stdin to stdout/stderr
• Simple output format
expected to be input to another tool
–
– –
–
–
•
• •
Unix Tools Example
ls, wc, sort, …
standard input/ standard output pipes
Unix is user-friendly;
it’s just choosy about who its friends are.
Basic Tools to Learn
• head, tail
• cd
• mkdir
• ls
• cp
• mv
• rm
• diff
• comm • cut
• cat
• wc
• grep
• who
•
• •
man example
don’t memorize – look it up! it grows on you
Unix manual
•
•
–
– – –
•
Shells
$ gcc -Wall -g -std=gnu99 –o hello hello.c
The $ is a shell prompt.
Shells
accept commands (programs) as input finds the executable
interprets the arguments
starts executing the command
Shells also have some “built-in” commands.
Running a program
$ gcc -Wall -g -std=gnu99 –o hello hello.c
$ hello
load a program into memory and hand it off to the
•
OS to run the program.
• •
Files and Directories
“Everything is a file.”
•
• video
• keyboard • sound
• network
File interface = open, read, write, close
Unix provides a file interface for all Input/Output. regular files
–
– directories – devices
File System Hierarchy
Everything starts in the “root” directory whose name
•
is “/”
• • •
A directory is a file that contains directory entries. A directory entry maps a file name to an inode.
An inode is the data structure that contains information about a file, including which disk blocks contain the file data.
Inodes and Directory Entries
File System Hierarchy
Directories and Links
Permissions
•
–
•
–
– –
File permissions
read, write, execute – pretty much what you think
Directory permissions
read – you can run ls on the directory
write – you can create and delete files in the directory
execute – you can “pass through” the directory when searching subdirectories.
•
–
– –
chmod
•
chmod 755
3 numbers between 0 and 7, the octal value for that
–
category of user
Another approach
chmod u+rwx
chmod go-x
adds or removes permissions for those categories of users
Quiz — what is the command to set the permissions of the
–
file classlist to be world readable but writeable only by the file owner and members of the group.
• • • • •
Globbing
A little like regular expressions but different syntax * matches any number of any character
? matches any one character
[list of characters]
[1-5] or [a-z] or [a-xz]