comp10001 foundations of computing introduction to computing · 2017. 3. 5. · comp10001...

25
COMP10001 Foundations of Computing Week 1, Lecture 2 (2/3/2017) COMP10001 Foundations of Computing Introduction to Computing Semester 1, 2017 Tim Baldwin & Egemen Tanin version: 1055, date: March 1, 2017 © 2017 The University of Melbourne

Upload: others

Post on 16-Oct-2020

5 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: COMP10001 Foundations of Computing Introduction to Computing · 2017. 3. 5. · COMP10001 Foundations of Computing Week 1, Lecture 2 (2/3/2017) Secret to Subject Success • Balanced

COMP10001 Foundations of Computing Week 1, Lecture 2 (2/3/2017)

COMP10001 Foundations of Computing

Introduction to Computing

Semester 1, 2017Tim Baldwin & Egemen Tanin

— version: 1055, date: March 1, 2017 —

© 2017 The University of Melbourne

Page 2: COMP10001 Foundations of Computing Introduction to Computing · 2017. 3. 5. · COMP10001 Foundations of Computing Week 1, Lecture 2 (2/3/2017) Secret to Subject Success • Balanced

COMP10001 Foundations of Computing Week 1, Lecture 2 (2/3/2017)

Lecture Agenda

• Tips from Uncle Tim

• What did last year’s students think? (SES)

• Will you fail this subject?

• What is a computer, and how do we talk to it?

• Python

• Grok

Page 3: COMP10001 Foundations of Computing Introduction to Computing · 2017. 3. 5. · COMP10001 Foundations of Computing Week 1, Lecture 2 (2/3/2017) Secret to Subject Success • Balanced

COMP10001 Foundations of Computing Week 1, Lecture 2 (2/3/2017)

Secret to Subject Success

• Balanced workload of 10–13 hours per week,e.g.:

• Workshop (2 hours attendance + 2 hoursfollow-up)

• Lectures (3 hours attendance + 3 hoursreview)

• Study (2 hours review/reading/study group)• Form an informal study group and copiously

share ideas, and non-embargoed code

• Attend, listen, ask, and share, but above all do,do, do!

Page 4: COMP10001 Foundations of Computing Introduction to Computing · 2017. 3. 5. · COMP10001 Foundations of Computing Week 1, Lecture 2 (2/3/2017) Secret to Subject Success • Balanced

COMP10001 Foundations of Computing Week 1, Lecture 2 (2/3/2017)

Tim’s Secret Checklist of Things toPoint out I

• Paired lectures will have the same content;attend the one you are enrolled in

• Guest lectures will be examinable

• Log in to Grok Learning using your unimelbcredentials (@student.unimelb.edu.auaccount name, and unimelb password)

Page 5: COMP10001 Foundations of Computing Introduction to Computing · 2017. 3. 5. · COMP10001 Foundations of Computing Week 1, Lecture 2 (2/3/2017) Secret to Subject Success • Balanced

COMP10001 Foundations of Computing Week 1, Lecture 2 (2/3/2017)

Tim’s Secret Checklist of Things toPoint out II

• All “tutesheets” from workshops will be madeavailable (complete with a solution) at the end ofFriday of each week, on completion of allworkshops; later in the semester, we will releasepart of some of the tutesheets ahead of theworkshops, to allow people to try some of themore complex questions ahead of time

Page 6: COMP10001 Foundations of Computing Introduction to Computing · 2017. 3. 5. · COMP10001 Foundations of Computing Week 1, Lecture 2 (2/3/2017) Secret to Subject Success • Balanced

COMP10001 Foundations of Computing Week 1, Lecture 2 (2/3/2017)

Tim’s Secret Checklist of Things toPoint out III

• Within Grok Learning, you will be able to accessthe COMP10001 materials, and also seematerials for other user-pays courses offered byGrok Learning. Note that you do not need topay for any of the COMP10001 materials, andthere is no need to pay for access to any of theother Grok Learning courses.

Page 7: COMP10001 Foundations of Computing Introduction to Computing · 2017. 3. 5. · COMP10001 Foundations of Computing Week 1, Lecture 2 (2/3/2017) Secret to Subject Success • Balanced

COMP10001 Foundations of Computing Week 1, Lecture 2 (2/3/2017)

Tips from Uncle Tim and Egemen I

• All lecture slides will be made available on theLMS ahead of time (but may be tweaked slightlyleading up to/after the lecture; watch the versionnumbers)

• Lectures and workshops start 5 mins later andend 5 mins earlier than advertised

• All lectures will be recorded (audio and screenscrape) ... but try to come along to askquestions and get the full lecture experience

• Expect things to move faster and marks to beharder to get than in high school

Page 8: COMP10001 Foundations of Computing Introduction to Computing · 2017. 3. 5. · COMP10001 Foundations of Computing Week 1, Lecture 2 (2/3/2017) Secret to Subject Success • Balanced

COMP10001 Foundations of Computing Week 1, Lecture 2 (2/3/2017)

Tips from Uncle Tim and Egemen II

• When learning programming, constant “practice”is the key to success

Page 9: COMP10001 Foundations of Computing Introduction to Computing · 2017. 3. 5. · COMP10001 Foundations of Computing Week 1, Lecture 2 (2/3/2017) Secret to Subject Success • Balanced

COMP10001 Foundations of Computing Week 1, Lecture 2 (2/3/2017)

Tips from Uncle Tim and Egemen III

• Never share any examinable code with yourfellow students (not on the forums, not via email,not via shared machines, ...)

• If you need help, avail yourself of the varioussources of assistance; don’t expect us to comechasing you

Page 10: COMP10001 Foundations of Computing Introduction to Computing · 2017. 3. 5. · COMP10001 Foundations of Computing Week 1, Lecture 2 (2/3/2017) Secret to Subject Success • Balanced

COMP10001 Foundations of Computing Week 1, Lecture 2 (2/3/2017)

We Need You!

• We need 2–3 volunteers to act as “studentrepresentatives” for the subject, with thefollowing responsibilities:

• keep finger on pulse of student body• (possibly) act as go-between between students and

teaching staff• attend a Staff–Student Liaison Committee meeting

later in the semester to report on issues with thesubject, and run a feedback session immediatelybeforehand to poll the student body

Page 11: COMP10001 Foundations of Computing Introduction to Computing · 2017. 3. 5. · COMP10001 Foundations of Computing Week 1, Lecture 2 (2/3/2017) Secret to Subject Success • Balanced

COMP10001 Foundations of Computing Week 1, Lecture 2 (2/3/2017)

SES – Student Experience Survey

• At the end of each semester in each subject youwill be asked to fill out an SES survey.

• Summary of last year’s feedback:• Awesome subject. The lecturers are awesome. Tutors

are awesome. etc• Grok is even awesomer• Project 2 was a bit messy• What’s with the guest lectures?• Room for improvement with feedback to students• This subject is very challenging and rewarding OR

too hard

Page 12: COMP10001 Foundations of Computing Introduction to Computing · 2017. 3. 5. · COMP10001 Foundations of Computing Week 1, Lecture 2 (2/3/2017) Secret to Subject Success • Balanced

COMP10001 Foundations of Computing Week 1, Lecture 2 (2/3/2017)

Academic Honesty I

• In accordance with the University’s AcademicHonesty and Plagiarism Policy (which you shouldfamiliarize yourself with!):

https://academichonesty.unimelb.edu.au/

All examinable work (Grok worksheet answersand all project work) that you submit forCOMP10001 must be your own

Page 13: COMP10001 Foundations of Computing Introduction to Computing · 2017. 3. 5. · COMP10001 Foundations of Computing Week 1, Lecture 2 (2/3/2017) Secret to Subject Success • Balanced

COMP10001 Foundations of Computing Week 1, Lecture 2 (2/3/2017)

Academic Honesty II

• The only possible exception to this forCOMP10001 is where you have been providedwith “skeleton” code as part of a project, inwhich case you should clearly attribute the codein comments, e.g.:#########################################################

# The following block of code was taken from the skeleton

# code provided by Tim Baldwin

...

# End of provided skeleton code

#########################################################

Page 14: COMP10001 Foundations of Computing Introduction to Computing · 2017. 3. 5. · COMP10001 Foundations of Computing Week 1, Lecture 2 (2/3/2017) Secret to Subject Success • Balanced

COMP10001 Foundations of Computing Week 1, Lecture 2 (2/3/2017)

Academic Honesty III

• Common causes of breaches in the past havebeen:

• friends asking to look over your code to “get hints”for their own project

• flatmates accessing your code via a shared desktopcomputer with saved login details

• study groups where the facilitator has oversteppedthe line and provided sample code to help peoplealong

• students posting coding online for feedback fromothers

• students posting questions to programming forums tosource answers directly

Page 15: COMP10001 Foundations of Computing Introduction to Computing · 2017. 3. 5. · COMP10001 Foundations of Computing Week 1, Lecture 2 (2/3/2017) Secret to Subject Success • Balanced

COMP10001 Foundations of Computing Week 1, Lecture 2 (2/3/2017)

Academic Honesty IV

• Common attempts to escape undetected are:• changing the comments but not the code• changing variable names• rearranging blocks of code (sometimes breaking the

logic in the process!)

• It is all too easy to automatically pick up on allof these, and many, many more, approachesusing software plagiarism detection software ...and we do check

Page 16: COMP10001 Foundations of Computing Introduction to Computing · 2017. 3. 5. · COMP10001 Foundations of Computing Week 1, Lecture 2 (2/3/2017) Secret to Subject Success • Balanced

COMP10001 Foundations of Computing Week 1, Lecture 2 (2/3/2017)

Sobering Statistics

• In 2016, 5 students received a 0 for one or moreprojects on the basis of plagiarism breaches

• Attempts at plagiarism get caught, and lead toun-fun academic honesty hearings

• Don’t fall into any traps, and don’t let yourfriends make a mistake

• Never share any examinable code with yourfellow students (not on the forums, not via email,not via shared machines, ...)

Page 17: COMP10001 Foundations of Computing Introduction to Computing · 2017. 3. 5. · COMP10001 Foundations of Computing Week 1, Lecture 2 (2/3/2017) Secret to Subject Success • Balanced

COMP10001 Foundations of Computing Week 1, Lecture 2 (2/3/2017)

So What is Appropriate?

• You are encouraged to share/collaborate directlyon code for any non-examinable items (notablythe tutesheet questions and the practice project)... and you will learn a lot from reading the codeof others (including the sample solutions in theworksheets)

• You are very welcome to discuss with fellowclassmates your approach to worksheet questionsand the projects, in conceptual terms, or in termsof key data types or programming constructsused (just not with the aid of raw code)

Page 18: COMP10001 Foundations of Computing Introduction to Computing · 2017. 3. 5. · COMP10001 Foundations of Computing Week 1, Lecture 2 (2/3/2017) Secret to Subject Success • Balanced

COMP10001 Foundations of Computing Week 1, Lecture 2 (2/3/2017)

What is a Computer?

• A big grid/matrix of cells (memory locations)

• Can add, multiply and compare cells really fast(instructions)

• Can run a “program” (list of instructions =machine code)

• At the most basic level, computers use binary(one or zero)

• E.g. to turn top left pixel on the screen red ...

10010010 00000001 11111111000000000000000000000000

10001010 00000001 11010010010100101001010100001001

Page 19: COMP10001 Foundations of Computing Introduction to Computing · 2017. 3. 5. · COMP10001 Foundations of Computing Week 1, Lecture 2 (2/3/2017) Secret to Subject Success • Balanced

COMP10001 Foundations of Computing Week 1, Lecture 2 (2/3/2017)

Obviously not human friendly

• Easier (assembly language)

LDC r1 0xFF000000

STO r1 #D2529509

• Even better (Python-like)

screen[0, 0] = (255, 0, 0, 0)

• Best?

Siri, make the pixel at the top left of

the screen red!

Page 20: COMP10001 Foundations of Computing Introduction to Computing · 2017. 3. 5. · COMP10001 Foundations of Computing Week 1, Lecture 2 (2/3/2017) Secret to Subject Success • Balanced

COMP10001 Foundations of Computing Week 1, Lecture 2 (2/3/2017)

There are Lots of ProgrammingLanguages

• http://en.wikipedia.org/wiki/List_of_

programming_languages

• We will use Python 3.5

• You just write it like a text file, and the Python“interpreter” turns it into machine code for you

Page 21: COMP10001 Foundations of Computing Introduction to Computing · 2017. 3. 5. · COMP10001 Foundations of Computing Week 1, Lecture 2 (2/3/2017) Secret to Subject Success • Balanced

COMP10001 Foundations of Computing Week 1, Lecture 2 (2/3/2017)

A Message from the Python Creator

“Actually, my initial goalfor Python was to serve asa second language for peo-ple who were C or C++programmers, but who hadwork where writing a C pro-gram was just not effec-tive.” — Guido van Rossum(the Benevolent Dictatorfor Life)

Page 22: COMP10001 Foundations of Computing Introduction to Computing · 2017. 3. 5. · COMP10001 Foundations of Computing Week 1, Lecture 2 (2/3/2017) Secret to Subject Success • Balanced

COMP10001 Foundations of Computing Week 1, Lecture 2 (2/3/2017)

And Another Thing ...

The relative proportion of profanities per line in codewritten in different languages:

Source(s):

http://ilovecharts.tumblr.com/post/3463898034/amount-of-profanity-in-git-commit-messages-per

Page 23: COMP10001 Foundations of Computing Introduction to Computing · 2017. 3. 5. · COMP10001 Foundations of Computing Week 1, Lecture 2 (2/3/2017) Secret to Subject Success • Balanced

COMP10001 Foundations of Computing Week 1, Lecture 2 (2/3/2017)

Grok Learning

• Grok Learning is the web-based programmingenvironment we will be using for the duration ofthis subject:

• https://groklearning.com/course/

unimelb-foundations-2017-s1/

• All you need to access the system is a browser,an internet connection and your unimelb account

• Different modes of working in Grok:• code, run, mark• terminal

Page 24: COMP10001 Foundations of Computing Introduction to Computing · 2017. 3. 5. · COMP10001 Foundations of Computing Week 1, Lecture 2 (2/3/2017) Secret to Subject Success • Balanced

COMP10001 Foundations of Computing Week 1, Lecture 2 (2/3/2017)

Lecture Summary

• Computers speak binary, but we don’t

• High level programming languages make lifeeasier

• We will use Python inside Grok

Page 25: COMP10001 Foundations of Computing Introduction to Computing · 2017. 3. 5. · COMP10001 Foundations of Computing Week 1, Lecture 2 (2/3/2017) Secret to Subject Success • Balanced

COMP10001 Foundations of Computing Week 1, Lecture 2 (2/3/2017)

A Reminder about Workshops

• Just to make sure you got the message:

ONLY go to a workshop this week if it is onFRIDAY; other workshops start from NEXT

WEEK