Creative Commons Attribution Non-Commercial Share Alike License sa/3.0/http://creativecommons.org/licenses/by-nc-

Slides:



Advertisements
Similar presentations
How can I use this in my class? Java for MS in IT students. Wrap GUI around doing some cool picture manipulations, to engage the students. After AP exam,
Advertisements

ManipulatingPictures-Mod6-part21 Manipulating Pictures, Arrays, and Loops part 2 Barb Ericson Georgia Institute of Technology.
Creative Commons Attribution Non-Commercial Share Alike License sa/3.0/
Peer Instruction for the First Time: Experiences of a First Time User in Computer Science Beth Simon Computer Science and Engineering University of California,
Workshop on Peer Instruction: Making Good Clicker Questions Beth Simon Computer Science and Engineering University of California, San Diego Credits: Sara.
CS 106 Introduction to Computer Science I 03 / 17 / 2008 Instructor: Michael Eckmann.
Intro-Sound-part21 Introduction to Processing Digital Sounds part 2 Barb Ericson Georgia Institute of Technology Oct 2009.
CSE 8A Lecture 8 Reading for next class: None Prepare for In-term exam 2 PSA4: Collage and Picture Flip, DON’T WAIT (it’s longer than the previous PSAs)
Creative Commons Attribution Non-Commercial Share Alike License sa/3.0/
NestedLoops-part11 Nested Loops – part 1 Barb Ericson Georgia Institute of Technology Nov 2009.
Creative Commons Attribution Non-Commercial Share Alike License sa/3.0/
Creative Commons Attribution Non-Commercial Share Alike License sa/3.0/
Creative Commons Attribution Non-Commercial Share Alike License sa/3.0/
Creative Commons Attribution Non-Commercial Share Alike License sa/3.0/
CS 106 Introduction to Computer Science I 03 / 19 / 2007 Instructor: Michael Eckmann.
CSE8A Lecture3 TODO: –Finish PSA1 individually (no partner!) and turn it in with the bundlePSA1 command GET AN INTERVIEW for PSA1 from a tutor See tutor.
Introduction to Programming in MATLAB Intro. MATLAB Peer Instruction Lecture Slides by Dr. Cynthia Lee, UCSD is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike.
ManipulatingPictures-part11 Manipulating Pictures, Arrays, and Loops part 1 Barb Ericson Georgia Institute of Technology Nov 2009.
Georgia Institute of Technology Movies part 5 Barb Ericson Georgia Institute of Technology April 2006.
Creative Commons Attribution Non-Commercial Share Alike License sa/3.0/
Creative Commons Attribution Non-Commercial Share Alike License sa/3.0/
Creative Commons Attribution Non-Commercial Share Alike License sa/3.0/
Georgia Institute of Technology Processing Sound Ranges Barb Ericson Georgia Institute of Technology July 2005.
Science Notebook Assembly Instructions. Table of Contents Left Side PagesRight Side Pages Pg. # Do this setup for the first 2 pages of your notebook.
Creative Commons Attribution Non-Commercial Share Alike License sa/3.0/
Georgia Institute of Technology Manipulating Pictures, Arrays, and Loops Barb Ericson Georgia Institute of Technology August 2005.
TOPIC 6 MODIFYING PICTURES USING LOOPS 1 Notes adapted from Introduction to Computing and Programming with Java: A Multimedia Approach by M. Guzdial and.
Creative Commons Attribution Non-Commercial Share Alike License sa/3.0/
Creative Commons Attribution Non-Commercial Share Alike License sa/3.0/
1 ball, 2 ball, red ball, blue ball By Melissa Dalis Professor Susan Rodger Duke University June 2011.
CS161 Topic #16 1 Today in CS161 Lecture #16 Prepare for the Final Reviewing all Topics this term Variables If Statements Loops (do while, while, for)
Creative Commons Attribution Non-Commercial Share Alike License sa/3.0/
CS 106 Introduction to Computer Science I 10 / 29 / 2007 Instructor: Michael Eckmann.
CPSC1301 Computer Science 1 Chapter 8 Introduction to Processing Digital Sounds part 3.
CPSC1301 Computer Science 1 Chapter 4 Manipulating Pictures, Arrays, and Loops part 5.
A getting to know you activity
Georgia Institute of Technology What is new in Java 5.0 (1.5)? Barb Ericson Georgia Institute of Technology June 2006.
Creative Commons Attribution Non-Commercial Share Alike License sa/3.0/
CS 106 Introduction to Computer Science I 03 / 22 / 2010 Instructor: Michael Eckmann.
Copyright © Curt Hill Further Picture Manipulation Considering position.
Searching CSE 103 Lecture 20 Wednesday, October 16, 2002 prepared by Doug Hogan.
CSE 8A Lecture 13 Reading for next class: Chapter 9 Today’s topics: –Sounds! Finish PSA 6: Chromakey! DUE TUESDAY Interm exam 3 next Thursday.
CSE 8A Lecture 14 Reading for next class: None (INTERM EXAM #3) Today’s topics: –More Sounds! PSA 6 due tonight PSA 7 (sounds) due next Monday (11/19)
Creative Commons Attribution Non-Commercial Share Alike License sa/3.0/
CSE8A Lecture 5 TODO: –FINISH PSA2 WITH YOUR PARTNER! Read next class: Section 5.1. PLAY WITH CODE! –Get stuck, then figure out how to get unstuck – it’s.
Science Notebook Assembly Instructions. Table of Contents Left Side PagesRight Side Pages Pg. # Do this setup for the first 2 pages of your notebook.
ManipulatingPictures-part31 Manipulating Pictures, Arrays, and Loops part 3 Barb Ericson Georgia Institute of Technology Nov 2009.
04-ManipulatingPictures-part21 Manipulating Pictures, Arrays, and Loops part 2 Barb Ericson Georgia Institute of Technology June 2008.
Creative Commons Attribution Non-Commercial Share Alike License sa/3.0/
Digital Image: Rendering of a continuously varying scene with a finite array of picture elements, where each one has a discrete intensity or color 39.
1 Good Questions Spark discussion Motivate a topic Address a common misconception Help students “speak” in the language of your discipline Foster reflection.
Manipulating Pictures, Arrays, and Loops part 2
Manipulating Pictures, Arrays, and Loops part 2
CSE 8A Lecture 17 Reading for next class: None (interm exam 4)
Creative Commons Attribution Non-Commercial Share Alike License
Licensing information
Manipulating Pictures, Arrays, and Loops part 2
One-Dimensional Array Introduction Lesson xx
Introduction to Processing Digital Sounds part 2
Two-Dimensional Arrays and Nested Loops – part 2
CSE 8A Lecture 6 Reading for next class:
Barb Ericson Georgia Institute of Technology June 2006
Other displays Saving Arrays Using fors to process
Creative Commons Attribution Non-Commercial Share Alike License
Manipulating Pictures, Arrays, and Loops
Creative Commons Attribution Non-Commercial Share Alike License
Creative Commons Attribution Non-Commercial Share Alike License
Final Exam Review CSE113.
Introduction to Programming in MATLAB
Manipulating Pictures, Arrays, and Loops
Presentation transcript:

Creative Commons Attribution Non-Commercial Share Alike License sa/3.0/ sa/3.0/ Original Developer: Beth Simon, 2009

CSE8A Lecture 20 Read next class: read pg Freshman seminar: –Peer Instruction: Exploring a Revolution in College Science Teaching –Find out more about the theory behind clicker use –Analyze data from this and previous classes! CSE 8A Art Show! Sat Nov 14 10:30-12 noon –Submit either your collage or chromakey (one per pair) –Art show open to all UCSD students –JSOE High School Outreach Day -- >110 high schoolers (and their parents) –We want MORE, GREAT people in CSE at UCSD!

Midterm: Avg 83% min 55% on individual final Answers posted on line tomorrow Midterms available for pickup Thurs/Fri in lab hours and in class

By the end of today’s class you should be able to… LG41: Read, trace, and write code to change the volume of a Sound object (using for each, while and for loops) LG42: Compare and contrast the difference between changing the Color of Pixels in a Picture to changing the volume of SoundSamples in a Sound.

How would we fill in this SampleSound[]

The Sample Rate that the Sound class ASSUMES is 22KHz: How long is a SampleSound[] in a Sound object of 1 second? A.22 elements B.11,000 elements C.22,000 elements D.44,000 elements E.We can’t tell from the data provided

Write code which makes the following changes Here’s a Sound String fileName = FileChooser.pickAFile(); Sound noise = new Sound(fileName); SoundSample[] noiseArray = noise.getSamples(); >> for (SoundSample sample: noiseArray) { int foo = sample.getValue(); sample.setValue(foo/2); } for (int i = noiseArray.length/2; i < noiseArray.length) { SoundSample sample = noiseArray[i]; int foo = sample.getValue(); sample.setValue(foo/2); } int i = 0; while (i < noiseArray.length) { SoundSample sample = noiseArray[i]; int foo = sample.getValue(); sample.setValue(foo/2); }

What does that code do? But before we do that…

So modified from the midterm: A.This code modifies the middle half (from the top and bottom) of the picture B.This code modifies the middle half (from the left and right) of the picture C.This code loops over the pixels in the Pixel array starting at length/4 and up to 2*length/4 and gets the red, blue and green values adds them up and divides by 3 and sets that pixel to the calculated value 0: Pixel[] pixelArray = this.getPixels(); 1: int mystery; 2: for(int i = pixelArray.length/4; i < 3*pixelArray.length/4; i++) 3: { 4: mystery = (pixelArray[i].getBlue() + pixelArray[i].getGreen() + pixelArray[i].getRed() ) / 3; 5: Color thing = new Color(mystery, mystery, mystery); 6: pixelArray[i].setColor(thing); 7: } 8:

Questions of the form: What does this code do should have what kind of answer? A.A short sentence your grandmother can understand B.A short sentence that describes the loop structure used C.A short sentence that describes both the loop structure used and the method calls executed inside the loop D.A paragraph at least 50 words long that the causes the graders’ eyes to glaze over

REVIEW: Looking at this code… Here’s a Sound String fileName = FileChooser.pickAFile(); Sound noise = new Sound(fileName); SoundSample[] noiseArray = noise.getSamples(); >> for (SoundSample sample: noiseArray) { int foo = sample.getValue(); sample.setValue(foo/2); } for (int i = noiseArray.length/2; i < noiseArray.length) { SoundSample sample = noiseArray[i]; int foo = sample.getValue(); sample.setValue(foo/2); } int i = 0; while (i < noiseArray.length) { SoundSample sample = noiseArray[i]; int foo = sample.getValue(); sample.setValue(foo/2); }

What does that code do A.Makes a lower pitched sound during first half of play B.Makes a quieter sound during first half of play C.Makes a lower pitched sound during second half of play D.Makes a quieter sound during second half of play E.For each SoundSample element if the array it gets the Value and stores that in an int and then sets the Value with something that is half that