Creative Commons Attribution Non-Commercial Share Alike License

Slides:



Advertisements
Similar presentations
Creative Commons Attribution Non-Commercial Share Alike License sa/3.0/
Advertisements

Lecture From Chapter 6 & /8/10 1 Method of Classes.
Intro-Sound-part21 Introduction to Processing Digital Sounds part 2 Barb Ericson Georgia Institute of Technology Oct 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/
Creative Commons Attribution Non-Commercial Share Alike License sa/3.0/
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.
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/
Creative Commons Attribution Non-Commercial Share Alike License sa/3.0/
Creative Commons Attribution Non-Commercial Share Alike License sa/3.0/
CSC1401 Classes - 2. Learning Goals Computing concepts Adding a method To show the pictures in the slide show Creating accessors and modifiers That protect.
Creative Commons Attribution Non-Commercial Share Alike License sa/3.0/
CPSC1301 Computer Science 1 Chapter 4 Manipulating Pictures, Arrays, and Loops part 5.
Creative Commons Attribution Non-Commercial Share Alike License sa/3.0/
Creative Commons Attribution Non-Commercial Share Alike License sa/3.0/
Searching CSE 103 Lecture 20 Wednesday, October 16, 2002 prepared by Doug Hogan.
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/
Intro-Sound-Mod10-part31 Introduction to Processing Digital Sounds part 3 while loop, tracing, for loop, parameters Barb Ericson Georgia Institute of Technology.
Creative Commons Attribution Non-Commercial Share Alike License sa/3.0/
Comp1004: Loops and Arrays I Whiles, For and Arrays[]
On dynamic memory and classes ● We previously had only discussed dynamic memory in regards to structs and dynamic arrays. ● However, they can be used (to.
The Shape of Distributions of Data
Andrew(amwallis) Classes!
Classes and Objects.
Linked Lists in Action Chapter 5 introduces the often-used data public classure of linked lists. This presentation shows how to implement the most common.
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
EECs 183 Discussion 10 Hannah Westra.
Classes and Objects in Java
COSC 220 Computer Science II
Methods The real power of an object-oriented programming language takes place when you start to manipulate objects. A method defines an action that allows.
Manipulating Pictures, Arrays, and Loops part 2
Manipulating Pictures, Arrays, and Loops part 2
CS 177 Week 15 Recitation Slides
Manipulating Pictures, Arrays, and Loops
Introduction to Processing Digital Sounds part 2
Manipulating Pictures, Arrays, and Loops part 5
Arrays And Functions.
CSE 8A Lecture 6 Reading for next class:
Arrays in Java What, why and how Copyright Curt Hill.
Advanced Java Programming
Processing Sound Ranges part 1
How Objects Behave Chapter 4.
Functions Pass By Value Pass by Reference
Other displays Saving Arrays Using fors to process
Introduction to Processing Digital Sounds part 3
Classes and Objects in Java
Creative Commons Attribution Non-Commercial Share Alike License
Manipulating Pictures, Arrays, and Loops
CLASSES, AND OBJECTS A FIRST LOOK
Overview of Java 6-Apr-19.
Method of Classes Chapter 7, page 155 Lecture /4/6.
February , 2009 CSE 113 B.
Creative Commons Attribution Non-Commercial Share Alike License
Manipulating Pictures, Arrays, and Loops
Review of Previous Lesson
Agenda Warmup Lesson 2.2 (parameters, etc)
Classes and Objects in Java
CS 5010 Program Design Paradigms "Bootcamp" Lesson 12.1
Review for Midterm 3.
James Wei Professor Peck 9/20/2013
Lecture 20 – Practice Exercises 4
Lecture 20 – Practice Exercises 4
Presentation transcript:

Creative Commons Attribution Non-Commercial Share Alike License Original Developer: Beth Simon, 2009 bsimon@cs.ucsd.edu

CSE8A Lecture 24 Exam: Wed 3-6pm Read next class: read 367-380 What’s happening the rest of the term Finish Chapter 10 (Sound) Chapter 11 (Creating your own classes) Arrays – not just for Sounds and Pictures anymore… Week 9 (Tgiving) Beth in Europe, Leo Lectures Monday No class, No lab Wed PSA8 due Tues 11:59 (individual – Sound collage) Week 10 PSA9 due WED 11:59pm (pair – Make a class) Lecture all week, Exam Wed of finals week 3-6pm Yes, there’s a quiz Friday Week 10 Exam: Wed 3-6pm Individual and Group

Ahhh! There’s no way I am going to pass this class! CSE8A Winter 2010

Video of “how class goes”: I would be willing to be in “large” scenes in the video (not identified personally) Yes No I have a concern

A half-page description When asked: What does this code do? Or What is the purpose of this code? The answer should be… A high-level explanation in English that your grandmother might understand A half-page description Something like, it loops over all the pixels and sets the blue component to 0 and the red to 255 and the green to 0 A line-by-line reading of the code that makes the graders eyes glaze over

By the end of today’s class you should be able to… LG45: Be able to explain in plain English what code modifying Sounds does. LG46: Trace indexing patterns in code to perform Sound manipulations (e.g., reversing a sound, create echos). LG47: Identify scenarios where object transformations lead to objects of different “sizes”. LG48: Create a Sound of a specific “length” or duration using new LG48: Read, trace, and write methods which creates and returns new objects (rather than modifying calling objects). LG49: Identify issues with overwriting arrays when trying to “modify in place”. LG50: Describe how a Java class is made up of instance variables or fields, constructors, and methods and brainstorm a given class design. LG51: Identify common errors made by novices in defining their own classes. LG53: Identify common structure of “getter” and “setter” methods.

Concept Summary When you want to create a “new” object Call a “constrcutor” with new. Look in the file of that class to find out what constructors are available What parameters you can send Don’t forget to return the object you created with a return statement! When working with 2 (multiple) arrays Sometimes you will want 2 iterators (to index into them) moving independently If you are indexing “in synchrony” then use one iterator – it communicates to those reading your code!

Options to raisePitch Create new Sound Modify existing Sound V1) Of same length as original with “silence” at end V2) Of exact length needed for higher pitched sound Modify existing Sound V3) Will be of same length with “silence” at end

V3: Modify existing sound: <<<INSERT METHOD HEADER HERE>>> SoundSample[] noiseAr= XXXX; int newPlace = 0; for(int i = 0; i < noiseAr.length; i+=2) { <<SOME CODE HERE>> } public void raisePitch() this.getSamples(); public void raisePitch(Sound noise) noise.getSamples(); public Sound raisePitch() this.getSamples(); public Sound raisePitch(Sound noise) noise.getSamples();

V3: Modify existing sound: Trace the execution of this code (may be buggy!) newPlace is not updated Even then it doesn’t zero out last half. SoundSample[] noiseAr= XXXX; int newPlace = 0; for(int i = 0; i < noiseAr.length; i+=2) { noiseAr[newPlace] = noiseAr[i]; }

Modify existing sound: BUT Put sound in last half of array! SoundSample[] noiseAr= this.getSamples(); int newPlace = <<XXXXX>>; for(int i = 0; i < noiseAr.length; i+=2) { <<XXXXX>> } 0; noiseAr[newPlace++] = noiseAr[i]; noiseAr.length/2; noiseAr[newPlace++] = noiseAr[i]; 0; noiseAr[newPlace+=2] = noiseAr[i]; E What’s the problem? Overwriting data we need Could make copy first, but we can be smarter noiseAr.length/2; noiseAr[newPlace+=2] = noiseAr[i];

Concept Summary Modifying the original sound has difficulties And especially if size will change Might not be best solution if result is DIFFERENT than original (different size, shape, etc.) Loops don’t always have to go “up” (left to right) through the array Think about the modifications you are making, be sure to “use” any data before you overwrite it. If you can’t make that work out – make a temporary “copy” of the data before you modify it.