Download as pdf or txt
Download as pdf or txt
You are on page 1of 18

MONDAY

TUESDAY

WEDNESDAY THURSDAY

FRIDAY

INFT1004 Visual Programming


Lecture 1 Introduction to Visual Programming (Guzdial & Ericson chapter 1, 2)

8:00 - 9:00 9:00 - 10:00 10:00 - 11:00 11:00 - 12:00 12:00 - 1:00 1:00 - 2:00 2:00 - 3:00 3:00 - 4:00 4:00 - 5:00 5:00 - 6:00 6:00 - 7:00
3

INFT1004 Tut4 INFT1004 Lab 1


ICT3.44 ICT3.44

INFT1004 Tut 5
ICT3.44

David

Consultation
ICT3.20

INFT1004 Tut 2
ICT3.37

INFT1004 Tut 5
ICT3.44

Ilung

INFT1004 Lecture
GP 201

INFT1004 Tut 3
ICT3.44

INFT1004 Tut 6
ICT3.44

Ilung

INFT1004 - SEMESTER 1 - 2012


Week 1 Week 2 Week 3 Week 4 Recess Week 5 Week 6 Week 7 Week 8 Week 9 Week 10 Week 11 Week 12 Week 13 Mar 4 Mar 11 Mar 18 Mar 25 Apr 1 - Apr 7 Apr 8 Apr 15 Apr 22 Apr 29 May 6 May 13 May 20 May 27 Jun 3 Introduction Programs, Arrays and Iteration Working with x and y coordinates Selection

LECTURE TOPICS

My Contact Details
Course coordinator / Lecturer / Tutor
Keith Nesbitt

Mid Semester Recess Period More Picture Techniques Sound and Arrays More Sound and Arrays Program Design and Strings Lists, Files and Modules Web, Representations, Steganography Turtles and Other Classes Revision and Look Ahead No formal classes - MUST be available normal & supplementary period
Assignment due 3:00 Tuesday May 21 Practical Test 2 in Lab class Practical Test 1 in Lab class

keith.nesbitt@newcastle.edu.au ICT3.20 www.knesbitt.com Perception and cognition Visualisation / Sonification Computer games Virtual reality Algorithms and Patterns Creativity
5

Research Interests

Mid Year Examination Period

Lecture Topics and Lab topics are the same for each week

Tutor
Ilung Pranata ilung.pranata@newcastle.edu.au ICT3.17

Tutor
David Cornforth david.cornforth@newcastle.edu.au

Research Interests

Information Security Trust Privacy Cloud computing Digital environments


6

Research Interests

Data Mining Neural Networks Evolutionary Computation Health informatics Complex Systems Multi agent system
7

Your Contact Details


The University has given you a studentmail address. Use it. If the Uni wants to contact you, it does so via this address. Technically, Uni staff are not permitted to reply to email apparently from a student, but from some other address.

Your Contact Details


The University has given you a studentmail address. Use it. If the Uni wants to contact you, it does so via this address. Technically, Uni staff are not permitted to reply to If you dont wantfrom to a student, but from some email apparently use the studentmail other address. system regularly, set your account to forward to your preferred address . . .
8 9

Your Contact Details


The University has given you a studentmail address. Use it. If the Uni wants to contact you, it does so via this address. . . . and remember Technically, Uni staff are not permitted to reply to to logfrom in and delete email apparently from a student, but some mail now and then, other address. so that your mailbox doesnt fill up and reject any further incoming messages.
10

Assessment
Practical test
(in lab class week 5) worth 15% practice test in week before
Practical test 1 15%

11

Assessment
Practical test
(in lab class week 5) worth 15% practice test in week before
Practical test 1 15%

Assessment
Practical test
(in lab class week 5) worth 15% practice test in week before
Practical test 1 15% Assignment 20% Practical test 2 15%

Programming assignment
Practical test 2 15%

(due by start of week 11 lecture) worth 20% students may work in pairs for this assignment

Practical test 2
(in lab class week 9) worth 15%

Practical test 2
(in lab class week 9) worth 15%

12

13

Assessment
Practical test
(in lab class week 5) worth 15% practice test in week before
Practical test 1 15% Assignment 20% Practical test 2 15%

Assessment
Practical test 1 15% Assignment 20% Practical test 2 15%

Programming assignment
(due by start of week 11 lecture) worth 20% students may work in pairs for this assignment

Students must attain 50% overall to pass the course

Practical test 2
(in lab class week 9) worth 15%

Final Exam 50%

Final Exam 50%

Final exam
worth 50% make sure you ve available for the whole of the exam period (normal and supplementary)

14

15

Text Book
Introduction to Computing and Programming with Python (3rd edn) Mark Guzdial & Barbara Ericson (Pearson, 2013)

Text Book
Every Week Read and understand the explanations. Complete the examples and activities. Be sure you have a comfortable command of the language features

Offers explanatory text and worked examples.

16

17

Myth Busters #1
I don't need a Textbook

Myth Busters #2
I am a Teacher

The lectures will sometimes use completely different examples, to offer you alternative explanations of the topic. Therefore you should both attend the lectures and read and work through the book.
18

No - I am a Lecturer If you look in a mirror you will see the teacher. The textbook is very handy to help this process.
19

Myth Busters #3
Email works well

Myth Busters #3
Email works well

20

21

Myth Busters #3
Email works well

Blackboard
Note - lectures and tutorial information is here. It contains weekly lab notes and exercises (even for week 1) - It contains lecture slides

This is not an online course although many materials will be available on Blackboard. It is assumed that you are attending lectures and labs. You should see me during these times.

You will submit assignments through blackboard (Cover sheets will be submitted as hard copy). It contains an electronic copy of the course outline

22

23

Blackboard

Course outline
Note the bits about handing in work late. Note the bits about what to do if your work is affected by illness or other acceptable adverse circumstances. (You will follow the same process for all assessment items) The lecture topics in the course outline are indicative only and may vary so you should check the course Blackboard website weekly for course updates, bulletins, and additional resources
24 25

Rest of course outline


Note what it says about plagiarism, which the Uni takes very seriously. Note the different dates for withdrawing from the course, and think about what they might mean to you.

INFT1004 Visual Programming


This course will teach you to comprehend a programming problem and design a solution algorithm code the solution algorithm in a specific programming language (Python) test and document your program solutions according to suitable standards.
Analyse the problem
26

Design the solution


27

INFT1004 Visual Programming


This course will teach you to comprehend a programming problem and design a solution algorithm code the solution algorithm in a specific programming language (Python) test and document your program solutions according to suitable standards.
Analyse the problem Design the solution Implement the code
28

INFT1004 Visual Programming


This course will teach you to comprehend a programming problem and design a solution algorithm code the solution algorithm in a specific programming language (Python) test and document your program solutions according to suitable standards.
Analyse the problem Design the solution Implement and document the code Test the code solves the problem and meets standards
29

INFT1004 Visual Programming


This course will teach you to comprehend a programming problem and design a solution algorithm The first of these is generally the hardest; some people find it all but impossible. Lets give it a try right now!
Analyse the problem Design the solution Implement and document the code Test the code solves the problem and meets standards
30

Problem solving
Making a piece of toast What are the steps involved? (sequence) Are there decisions to make? (selection) What if you work in a breakfast bar and need to make 10 pieces of toast?

(iteration)
31

How to Surf ?

programming is something that you need to practice!!


32

1. Paddle really fast when a wave is coming. 2. Stand up when you have caught the wave. 3. Turn a bit, get tubed, do some air etc. 4. If the wave closes out then jump off!

33

How to Surf ?
Who feels like they can surf now? Well programming is just like this I can tell you how to do it and it might even seem pretty easy (its not) - YOU NEED TO PRACTICE!
34 35

programming is something that you need to practice!!

Programming
Programming is deciding on a set of instructions that will get the program to do the required job, then writing those instructions in the form required by the computer (recipe). It often also involves a debugging process intended to eliminate problems in the program (which can sometimes be a frustrating and lengthy experience). You cannot learn to program by reading and watching; it takes incredible amounts of practice. Programming courses almost always take more time per week than any other courses.
36

Programming
Programming is deciding on a set of instructions that will get the program to do the required job, then writing those instructions in the form required by the computer. It often also involves a debugging process intended to eliminate problems in the program (which can sometimes be a frustrating and lengthy experience). You cannot learn to program by reading and Implement Test the code Analyse the Design the watching; it takes incredible amounts of the practice. and document solves problem problem solution the code and meets standards Programming courses almost always take more time per week than any other courses.
37

Programming
Programming is deciding on a set of instructions that will get the program to do the required job, then writing those instructions in the form required by the computer. It often also involves a debugging process intended to eliminate problems in the program (which can sometimes be a frustrating and lengthy experience). You cannot learn to program by reading and watching; it takes incredible amounts of practice. Programming courses almost always take more time per week than any other courses.
38

Programming
Programming is deciding on a set of instructions that will get the program to do the required job, then writing those instructions in the form required by the computer. It often also involves a debugging process intended to eliminate problems in the program (which can sometimes be a frustrating and lengthy experience). You cannot learn to program by reading and watching; it takes incredible amounts of practice. Programming courses almost always take more time per week than any other courses.
39

Traditional or object-oriented
Traditional programming a program is a long sequence of instructions, often involving choice and repetition.
PROGRAM Triangle_Area IMPLICIT NONE TYPE triangle REAL :: a, b, c END TYPE triangle TYPE(triangle) :: t PRINT*, 'Welcome, please enter the& & lengths of the 3 sides.' READ*, t%a, t%b, t%c PRINT*,'Triangle''s area: ',Area(t) CONTAINS FUNCTION Area(tri) IMPLICIT NONE REAL :: Area ! function type TYPE(triangle), INTENT( IN ) :: tri REAL :: theta, height theta = ACOS( (tri%a**2 + tri%b**2 - tri%c**2) / (2.0*tri %a*tri%b) ) height = tri%a*SIN(theta); Area = 0.5*tri%b*height END FUNCTION Area END PROGRAM Triangle_Area

Traditional or object-oriented
Traditional programming a program is a long sequence of instructions, often involving choice and repetition.
PROGRAM Triangle_Area IMPLICIT NONE TYPE triangle REAL :: a, b, c END TYPE triangle TYPE(triangle) :: t PRINT*, 'Welcome, please enter the& & lengths of the 3 sides.' READ*, t%a, t%b, t%c PRINT*,'Triangle''s area: ',Area(t) CONTAINS FUNCTION Area(tri) IMPLICIT NONE REAL :: Area ! function type TYPE(triangle), INTENT( IN ) :: tri REAL :: theta, height theta = ACOS( (tri%a**2 + tri%b**2 - tri%c**2) / (2.0*tri %a*tri%b) ) height = tri%a*SIN(theta); Area = 0.5*tri%b*height END FUNCTION Area END PROGRAM Triangle_Area

Object-oriented programming consists of lots of objects (things), each of which can have its own little sequences of instructions.
Picture width height Picture width height Picture width height

Object-oriented programming consists of lots of objects (things), each of which can have its own little sequences of instructions.
Picture width height Picture width height Picture width height

40

41

10

Python is object-oriented
Object-oriented programming consists of lots of objects (things), each of which can have its own little sequences of instructions. Python is object-oriented (well be dealing with objects right from the start)
42

Names are important


Many of the objects well deal with have names. Names are really important, because when we tell the program, say, to display a picture, we need to tell it which picture to display. If weve given that picture a name, this is easy. Soon well give it a try . . .

43

Names are important


If weve given that picture a name, this is easy. Soon well give it a try . . .

Python, Jython, JES


There are many, many programming languages

pLecturer

Some are easy to learn; others are widely used professionally; others are for very specific purposes . .
44 45

11

Python, Jython, JES


Were going to use Python, a language that is easier than some to learn, and is used fairly widely, especially with web applications The version were using is called Jython It is Python written in another language called Java (Python is typically written in C another language)

Python, Jython, JES


Were using it in an environment called JES (Jython Environment for Students)

which includes lots of features for programming with pictures and sounds

46

47

Downloads
You can download JES (ver 4.3) and related bits and pieces from the Media Computation site at Georgia Tech, where the textbooks authors work http://code.google.com/p/mediacomp-jes/ Its all pretty easy to install (Windows or Mac) More detail is given on the notes for week 1
command area program area

JES

48

mac version

49

12

The JES panes


The top pane of JES is called the program area; thats where well write programs The bottom pane is called the command area; thats where we can type individual commands for JES to execute immediately

The JES panes


For this week, all the typing we do in JES will be in the command area We can also configure JES (Window Layout menu) to show a help area or a watcher area (which well explain later)

program area

program area

command area
50

command area

This is also called the interactions area


51

JES and Objects


In JES, type file1=pickAFile() and press Enter Choose a picture file, eg beach.jpg, from the mediasources folder that goes with the textbook You now have an object called file1, and that object is a file
(ie an object of type file)
52

JES and Objects


Type pic1=makePicture(file1) and press Enter You now have another object called pic1, and that object is a picture

53

13

JES and Objects


Note you will have to type show(pic1) to see the picture Everything in a programming environment has a type: file and picture are just two examples of types (classes) Different types (classes) can have different things done with them

= doesnt mean equals


The = symbol is one of the trickiest concepts in programming x = y does not mean x is equal to y It means take the value of y (whatever that is) and assign it to the thing called x

y x
54

x=y
55

= doesnt mean equals


This is called an assignment statement Its an instruction, not a statement of fact Once this one has been done, the variable called x will have the same value as y The assignment statement takes the value of whats on its right and assigns it to the variable on its left y x 4 y x 4 4
56

Print has nothing to do with printers


Python has a print command In the lower pane, the command area, type print(file1) and then type print(pic1) Print doesnt send things to the printer; it displays them on the screen

x=y

57

14

Print has nothing to do with printers


With objects, it doesnt display the object itself; it displays information about the object With simpler things, like numbers, it displays them directly try... print(13) print(-8.275) print("My name")

Jython can do maths


Here are some things to try and to work at understanding: print(513 * 25) simon = 513 * 25 print(simon) keith = "That is my name" print(keith) print(2 + 5 * 8) quotient = 13 / 2 print(quotient) print(13.0/2)

58

59

Weve just met some more types


integer a whole number float a number with a decimal point (even if the decimal point is followed by zeros) string a sequence of characters enclosed in quotation marks

Weve just met some more types


Weve also reinforced that different types can have different things done with them Division of two integers always gives an integer result Division of two numbers when at least one is a float gives a float result Dont forget this, or youll be puzzled now and then

60

61

15

Exploring pictures
You probably still have file1 and pic1; if not, go back and get them again (see the slide called JES and objects) explore(file1) JES knows that this is a file, and cant be explored explore(pic1) See how the explore tool lets you check out each individual pixel of a picture

62

getPixel
pix = getPixel(myPic, 7, 7)
0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7

65

16

Playing with Pixels


We can name individual pixels in the picture pixel1 = getPixel(pic1, 32, 32) pixel2 = getPixel(pic1, 33, 33) setColor(pixel1, yellow) setColor(pixel2, yellow) explore(pic1)

Playing with Pixels


We can name individual pixels in the picture pixel1 = getPixel(pic1, 32, 32) pixel2 = getPixel(pic1, 33, 33) setColor(pixel1, yellow) setColor(pixel2, yellow) explore(pic1)
Notice that when you explore the picture again, you get another window; explore doesnt have a refresh option Notice that you can repeat a command by using the up-arrow key to get to it
66

You can also edit it before repeating it

67

Exploring Sounds
file2 = pickAFile() This time pick a .wav file try ThreeWords.wav sound2 = makeSound(file2) print(sound2) explore(sound2) print(getSampleValueAt(sound2,14193)) setSampleValueAt(sound2,14193,0) explore(sound2)

Exploring Sounds
file2 = pickAFile() This time pick a .wav file try ThreeWords.wav sound2 = makeSound(file2) print(sound2) explore(sound2) print(getSampleValueAt(sound2,14193)) setSampleValueAt(sound2,14193,0) explore(sound2)
This is just a taste of things; well explain it more later
68

Next week well write our first programs

69

17

Weekly Notes
Every week, in addition to the lecture slides and occasional demo programs, there will be a set of notes. These will explain whats to be done in the lab class, and give you any additional information we think you might require. Youll need to do a lot of your programming at home. The textbook tells you how to get hold of the software well be using, but theres a simplified set of instructions in this weeks notes.
70

What to do before next week


Get JES installed on your computer

Read through chapters 1 & 2 of Guzdial & Ericson: Read my notes, (on blackboard), which correct or comment on things the textbook says

Dont just read the examples from Guzdial & Ericson; do them Have a go at the problems at the end of each chapter
71

Thats the end of the lecture . . .


This week there are no tutorials (labs)

Myth Busters #4
Uni is just a place to party

You are strongly advised to bring a USB drive to the labs, so that you can transfer your programming work between the lab, other computers at uni, and home

It's good to have fun. But you need to work hard. I would advise you work hard first and play after the work is done (its hard to catch up get ahead) Dates on the Calendar are much closer together than they seem.

72

73

18

You might also like