17
CompSci 101 Introduction to Computer Science January 13, 2015 Prof. Rodger compsci 101 spring 2015 1

CompSci 101 Introduction to Computer Science January 13, 2015 Prof. Rodger compsci 101 spring 20151

Embed Size (px)

Citation preview

Page 1: CompSci 101 Introduction to Computer Science January 13, 2015 Prof. Rodger compsci 101 spring 20151

CompSci 101Introduction to Computer Science

January 13, 2015

Prof. Rodger

compsci 101 spring 2015 1

Page 2: CompSci 101 Introduction to Computer Science January 13, 2015 Prof. Rodger compsci 101 spring 20151

Announcements• Reading for next time on calendar page

– RQ 2 due Thursday 10am

• Assignment 1 is out today, due in 1 week• Labs

– Try to install everything before going to lab– Practice downloading and running program– Programming in Scratch

• Today: Problem solving, Scratch, Python

compsci 101 spring 2015 2

Page 3: CompSci 101 Introduction to Computer Science January 13, 2015 Prof. Rodger compsci 101 spring 20151

Visitor today

Prof. Ron Parr

Chair, Computer Science Department

compsci 101 spring 2015 3

Page 4: CompSci 101 Introduction to Computer Science January 13, 2015 Prof. Rodger compsci 101 spring 20151

How does one get help?• Consulting hours

– Sunday-Thursday 7-11pm– (see Help tab)

• Office hours (prof, TAs)• Piazza

– Ask questions– Do not post your code and ask what is wrong!– Post error message and line of code for error

message– If added class late, may need to add yourself

4

Page 5: CompSci 101 Introduction to Computer Science January 13, 2015 Prof. Rodger compsci 101 spring 20151

Your work in the class

• Lectures/Labs – work in groups• Assignments/APTs – individual work

– Get help from Prof., TAs, UTAs– Discuss with others in class the general idea,

but you must write your own code– Acknowledge anyone you got help from or

consulted with – put in README file

• DO NOT search for answers on the web or post your code on the web 5

Page 6: CompSci 101 Introduction to Computer Science January 13, 2015 Prof. Rodger compsci 101 spring 20151

Our Programming Environment• Install 5 items

• Why Java? – not using• Eclipse – platform for

development• Python – programming language• Pydev – Python IDE for Eclipse• Ambient – turnin/snarf files

to/from Dukecompsci 101 spring 2015 6

Page 7: CompSci 101 Introduction to Computer Science January 13, 2015 Prof. Rodger compsci 101 spring 20151

Last Time - Python codehello.py

compsci 101 spring 2015 7

Page 8: CompSci 101 Introduction to Computer Science January 13, 2015 Prof. Rodger compsci 101 spring 20151

Last time - Python codeCount 4-letter words in a file.

8

Questions?

Page 9: CompSci 101 Introduction to Computer Science January 13, 2015 Prof. Rodger compsci 101 spring 20151

Design a data file for testing bit.ly/101S15-0113-01

9

How many words?Which words?

Page 10: CompSci 101 Introduction to Computer Science January 13, 2015 Prof. Rodger compsci 101 spring 20151

Should you understand all that code?

• Not yet, this is a beginner class. • You will be writing code that is much

simpler to start.• Should understand it by the first exam

compsci 101 spring 2015 10

Page 11: CompSci 101 Introduction to Computer Science January 13, 2015 Prof. Rodger compsci 101 spring 20151

Melinda French Gates• Duke Alum, CS/Econ major• Duke Commencement 2013

11

Page 12: CompSci 101 Introduction to Computer Science January 13, 2015 Prof. Rodger compsci 101 spring 20151

Word Clouds

• Number of occurrences/emphasis indicated by size of word

• Site to make a word cloud: – wordle.net

• U.S. Presidential Speeches: – http://chir.ag/projects/preztags/

compsci 101 spring 2015 12

Page 13: CompSci 101 Introduction to Computer Science January 13, 2015 Prof. Rodger compsci 101 spring 20151

Classwork: Word Cloudhttp://bit.ly/101S15-0113-02

• Given a file of words• Discuss how to make a word cloud

– How do you organize the words?– What information do you need to calculate?– What do you need to calculate to display words?

compsci 101 spring 2015 13

Page 14: CompSci 101 Introduction to Computer Science January 13, 2015 Prof. Rodger compsci 101 spring 20151

Computer Science and Medicine

Prof. Bruce Donald Grad Student: Pablo Gainzcompsci 101 spring 2015 14

Page 15: CompSci 101 Introduction to Computer Science January 13, 2015 Prof. Rodger compsci 101 spring 20151

Concepts you'll learn in Compsci 101

• Programming– Practice, skill, art, science, engineering, creativity

• Problem-solving– How to solve problems using programming and a

computer• Impact of computer science

– Scale and automation: powerful forces• Foundation for future work

– In many areas, not limited to compsci@duke

compsci 101 spring 2015 15

Page 16: CompSci 101 Introduction to Computer Science January 13, 2015 Prof. Rodger compsci 101 spring 20151

Programming Examples

• Scratch example in class (also in lab)

• Hour of code: http://code.org – Designed for kids, useful to millions

• Assignment 1 - Light-bot

• Python!compsci 101 spring 2015 16

Page 17: CompSci 101 Introduction to Computer Science January 13, 2015 Prof. Rodger compsci 101 spring 20151

Scratchscratch.mit.edu

• Demo – build Scratch program

compsci 101 spring 2015 17