49 Pages

ch05

Course: CS 177, Fall 2010
School: Purdue
Rating:
 
 
 
 
 

Word Count: 2509

Document Preview

5: Chapter Advanced Picture Techniques 1 Chapter Objectives 2 Color replacement You remember the increaseRed recipe: def increaseRed(picture): for p in getPixels(picture): value=getRed(p) setRed(p,value*1.2) And the function to calculate the distance between two colors: Suppose we wrote the function distance(color1,color2) to calculate the distance above 3 Color replacement (cont.) Now, we want to make...

Register Now

Unformatted Document Excerpt

Coursehero >> Indiana >> Purdue >> CS 177

Course Hero has millions of student submitted documents similar to the one
below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.

Course Hero has millions of student submitted documents similar to the one below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.
5: Chapter Advanced Picture Techniques 1 Chapter Objectives 2 Color replacement You remember the increaseRed recipe: def increaseRed(picture): for p in getPixels(picture): value=getRed(p) setRed(p,value*1.2) And the function to calculate the distance between two colors: Suppose we wrote the function distance(color1,color2) to calculate the distance above 3 Color replacement (cont.) Now, we want to make Barbs hair more red So, we need first to single out where barbs hair is in the image, that is the range of pixels we want to modify We can determine that by using the explore tool Then we need to define a reference color, and For each pixel of Barbs image falling in the range above: If the color of the pixel is close to our reference color, then we increase the red component of this pixel 4 Replacing colors in a range Get the range using MediaTools def turnRedInRange(): brown = makeColor(57,16,8) file=/Users/guzdial/mediasources/barbara.jpg" picture=makePicture(file) for x in range(70,168): for y in range(56,190): px=getPixel(picture,x,y) color = getColor(px) if distance(color,brown)<50.0: redness=getRed(px)*1.5 setRed(px,redness) show(picture) return(picture) 5 Walking this code Lets write our function. It does not need input; it creates the color brown; it makes a picture from the file containing the image of Barb def turnRedInRange(): brown = makeColor(57,16,8) file=/Users/guzdial/mediasources/barbara.jpg" picture=makePicture(file) for x in range(70,168): for y in range(56,190): px=getPixel(picture,x,y) color = getColor(px) if distance(color,brown)<50.0: redness=getRed(px)*1.5 setRed(px,redness) show(picture) return(picture) 6 The nested loop We used MediaTools to find the rectangle where most of the hair is that we want to change def turnRedInRange(): brown = makeColor(57,16,8) file=/Users/guzdial/mediasources/barbara.jpg picture=makePicture(file) for x in range(70,168): for y in range(56,190): px=getPixel(picture,x,y) color = getColor(px) if distance(color,brown)<50.0: redness=getRed(px)*1.5 setRed(px,redness) show(picture) return(picture) 7 Were looking for a close-match on hair color, and increasing the redness def turnRedInRange(): brown = makeColor(57,16,8) file=/Users/guzdial/mediasources/barbara.jpg picture=makePicture(file) for x in range(70,168): for y in range(56,190): px=getPixel(picture,x,y) color = getColor(px) if distance(color,brown)<50.0: redness=getRed(px)*1.5 setRed(px,redness) show(picture) return(picture) After having modified the picture, our function returns the modified picture (see the return statement) 8 Working on Katies Hair def turnRed(): brown = makeColor(42,25,15) file="C:/ip-book/mediasources/katieFancy.jpg" picture=makePicture(file) for px in getPixels(picture): color = getColor(px) if distance(color,brown)<50.0: redness=int(getRed(px)*2) blueness=getBlue(px) greenness=getGreen(px) setColor(px,makeColor(redness,blueness,greenness)) show(picture) return(picture) This version doubles all close reds. Notice the couch. 10 Working on Katies hair, in a range def turnRedInRange(): brown = makeColor(42,25,15) file="C:/ip-book/mediasources/katieFancy.jpg" picture=makePicture(file) for x in range(63,125): for y in range(6,76): px=getPixel(picture,x,y) color = getColor(px) if distance(color,brown)<50.0: redness=int(getRed(px)*2) blueness=getBlue(px) greenness=getGreen(px) setColor(px,makeColor(redness,blueness,greenness)) show(picture) return(picture) Left is one we did with all close browns. Right is same, but only in rect around head. 11 Removing Red Eye When the flash of the camera catches the eye just right (especially with light colored eyes), we get bounce back from the back of the retina. This results in red eye We can replace the red with a color of our choosing. First, we figure out where the eyes are (x,y) using MediaTools 12 Removing Red Eye def removeRedEye(pic,startX,startY,endX,endY,replacementcolor): red = makeColor(255,0,0) for x in range(startX,endX): Why use a for y in range(startY,endY): range? Because currentPixel = getPixel(pic,x,y) we dont want to if (distance(red,getColor(currentPixel)) < 165): replace her red setColor(currentPixel,replacementcolor) dress! What were doing here: Within the rectangle of pixels (startX,startY) to (endX, endY) Find pixels close to red, then replace them with a new color 13 Fixing it: Changing red to black removeRedEye(jenny, 109, 91, 202, 107, makeColor(0,0,0)) Jennys eyes are actually not blackcould fix that Eye are also not monocolor A better function would handle gradations of red and replace with gradations of the right eye color 14 Posterizing: Reducing range of colors 16 Posterizing: How we do it We look for a range of colors, then map them to a single color. If red is between 63 and 128, set it to 95 If green is less than 64, set it to 31 ... It requires a lot of if statements, but its really pretty simple. The end result is that a bunch of different colors, get set to a few colors. 17 Posterizing function def posterize(picture): #loop through the pixels for p in getPixels(picture): #get the RGB values red = getRed(p) green = getGreen(p) blue = getBlue(p) #check and set red values if(red < 64): setRed(p, 31) if(red > 63 and red < 128): setRed(p, 95) if(red > 127 and red < 192): setRed(p, 159) if(red > 191 and red < 256): setRed(p, 223) #check and set green values if(green < 64): setGreen(p, 31) if(green > 63 and green < 128): setGreen(p, 95) if(green > 127 and green < 192): setGreen(p, 159) if(green > 191 and green < 256): setGreen(p, 223) #check and set blue values if(blue < 64): setBlue(p, 31) if(blue > 63 and blue < 128): setBlue(p, 95) if(blue > 127 and blue < 192): setBlue(p, 159) if(blue > 191 and blue < 256): setBlue(p, 223) 18 Posterizing to b/w levels def grayPosterize(pic): for p in getPixels(pic): r = getRed(p) g = getGreen(p) b = getBlue(p) luminance = (r+g+b)/3 if luminance < 64: setColor(p,black) if luminance >= 64: setColor(p,white) We check luminance on each pixel. If its low enough, its black, and Otherwise, its white 20 Generating sepia-toned prints Pictures that are sepia-toned have a yellowish tint to them that we associate with older pictures. Its not directly a matter of simply increasing the yellow in the picture, because its not a one-to-one correspondence. Instead, colors in different ranges get mapped to other colors. We can create such a mapping using IF 21 Example of sepia-toned prints 22 Heres how we do it def sepiaTint(picture): #Convert image to greyscale greyScaleNew(picture) #loop through picture to tint pixels for p in getPixels(picture): red = getRed(p) blue = getBlue(p) #tint shadows if (red < 63): red = red*1.1 blue = blue*0.9 #tint midtones if (red > 62 and red < 192): red = red*1.15 blue = blue*0.85 #tint highlights if (red > 191): red = red*1.08 if (red > 255): red = 255 blue = blue*0.93 #set the new color values setBlue(p, blue) setRed(p, red) 23 Whats going on here? First, were calling greyScaleNew. Its perfectly okay to have one function calling another. We then manipulate the red (increasing) and the blue (decreasing) channels to bring out more yellows and oranges. Why are we doing the comparisons on the red? Why not? After greyscale conversion, all channels are the same! Why these values? Trial-and-error: Twiddling the values until it looks the way that you want. 24 Blurring When we scale up pictures (make them bigger), we get sharp lines and boxes: pixelation. Can reduce that by purposefully blurring the image. One simple algorithm: Take the pixels left, right, bottom, and top of yours. Average the colors. 25 Blurring code def blur(filename): source=makePicture(filename) We make two copies target=makePicture(filename) of the picture. for x in range(0, getWidth(source)-1): We read pixel colors for y in range(0, getHeight(source)-1): top = getPixel(source,x,y-1) from one, and set left = getPixel(source,x-1,y) them in the other. bottom = getPixel(source,x,y+1) right = getPixel(source,x+1,y) center = getPixel(target,x,y) newRed=(getRed(top)+ getRed(left)+ getRed(center))/5 newGreen=(getGreen(top)+ getGreen(left)+getGreen(bottom)+getGreen(right)+getGreen(center))/5 newBlue=(getBlue(top)+ getRed(bottom)+getRed(right)+ getBlue(left)+ getBlue(bottom)+getBlue(right)+ getBlue(center))/5 setColor(center, makeColor(newRed, newGreen, newBlue)) return target 26 Blurring code def blur(filename): source=makePicture(filename) There is a problem target=makePicture(filename) with the previous for x in range(1, getWidth(source)-2): version that has been for y in range(1, getHeight(source)-2): top = getPixel(source,x,y-1) fixed. Do you see it? left = getPixel(source,x-1,y) bottom = getPixel(source,x,y+1) right = getPixel(source,x+1,y) center = getPixel(target,x,y) newRed=(getRed(top)+ getRed(left)+ getRed(bottom)+getRed(right)+ getRed(center))/5 newGreen=(getGreen(top)+ getGreen(left)+getGreen(bottom)+getGreen(right)+getGreen(center))/5 newBlue=(getBlue(top)+ getBlue(left)+ getBlue(bottom)+getBlue(right)+ getBlue(center))/5 setColor(center, makeColor(newRed, newGreen, newBlue)) return target 27 Blending pictures How do we get part of one picture and part of another to blur together, so that we see some of each? Its about making one a bit transparent. We do it as a weighted sum If its 50-50, we take 50% of red of picture1s pixels + 50% of red of picture2s pixels, and so on for green and blue, across all overlapping pixels. 30 Example blended picture Blended here 31 Blending code (1 of 3) def blendPictures(): barb = makePicture(getMediaPath("barbara.jpg")) katie = makePicture(getMediaPath("Katie-smaller.jpg")) canvas = makePicture(getMediaPath("640x480.jpg")) #Copy first 150 columns of Barb sourceX=0 Straightforward copy of for targetX in range(0,150): 150 columns of Barbs sourceY=0 picture for targetY in range(0,getHeight(barb)): color = getColor(getPixel(barb,sourceX,sourceY)) setColor(getPixel(canvas,targetX,targetY),color) sourceY = sourceY + 1 sourceX = sourceX + 1 32 Blending code (2 of 3) #Now, grab the rest of Barb and part of Katie # at 50% Barb and 50% Katie overlap = getWidth(barb)-150 sourceX=0 for targetX in range(150,getWidth(barb)): sourceY=0 for targetY in range(0,getHeight(katie)): bPixel = getPixel(barb,sourceX+150,sourceY) kPixel = getPixel(katie,sourceX,sourceY) newRed= 0.50*getRed(bPixel)+0.50*getRed(kPixel) newGreen=0.50*getGreen(bPixel)+0.50*getGreen(kPixel) newBlue = 0.50*getBlue(bPixel)+0.50*getBlue(kPixel) color = makeColor(newRed,newGreen,newBlue) setColor(getPixel(canvas,targetX,targetY),color) sourceY = sourceY + 1 sourceX = sourceX + 1 Heres the trick. For each pixel, grab 50% of each red, green and blue 33 Blending code (3 of 3) # Last columns of Katie sourceX=overlap for targetX in range(150+overlap,150+getWidth(katie)): sourceY=0 for targetY in range(0,getHeight(katie)): color = getColor(getPixel(katie,sourceX,sourceY)) setColor(getPixel(canvas,targetX,targetY),color) sourceY = sourceY + 1 sourceX = sourceX + 1 show(canvas) return canvas 34 Background subtraction Lets say that you have a picture of someone, and a picture of some place (background) without the someone there, could you subtract out the background and leave the picture of the person? Maybe even change the background? Lets take that as our problem! 35 Person (Katie) and Background Lets put Katie on the moon! 36 Where do we start? What we most need to do is to figure out whether the pixel in the Person shot is the same as the pixel in the Background shot. Will they be the EXACT same color? Probably not. So, well need some way of figuring out if two colors are close 37 Using distance So we know that we want to ask: if distance(personColor,bgColor) > someValue And what do we then? We want to grab the color from another background (a new background) at the same point. 39 Chromakey Have a background of a known color Some color that wont be on the person you want to mask out Pure green or pure blue is most often used I used my sons blue bedsheet This is how the weather people seem to be in front of a map theyre actually in front of a blue sheet. 50 Example results 53 Drawing on images Sometimes you want to draw on pictures, to add something to the pictures. Lines Text Circles and boxes. We can do that pixel by pixel, setting black and white pixels 61 def lineExample(): img = makePicture(pickAFile()) verticalLines(img) horizontalLines(img) show(img) return img Drawing lines on Carolina def horizontalLines(src): for x in range(0,getHeight(src),5): for y in range(0,getWidth(src)): setColor(getPixel(src,y,x),black) def verticalLines(src): for x in range(0,getWidth(src),5): for y in range(0,getHeight(src)): setColor(getPixel(src,x,y),black) We can use the color name black 62 its pre-defined for us. Yes, some colors are already defined Colors defined for you already: black, white, blue, red, green, gray, lightGray, darkGray, yellow, orange, pink, magenta, and cyan 63 Thats tedious Thats slow and tedious to set every pixel you want to make lines and text, etc. What you really want to do is to think in terms of your desired effect 64 New functions addText(pict,x,y,string) puts the string starting at position (x,y) in the picture addLine(picture,x1,y1,x2,y2) draws a line from position (x1,y1) to (x2,y2) addRect(pict,x1,y1,w,h) draws a black rectangle (unfilled) with the upper left hand corner of (x1,y1) and a width of w and height of h addRectFilled(pict,x1,y1,w,h,color) draws a rectangle filled with the color of your choice with the upper left hand corner of (x1,y1) and a width of w and height of h 65 The mysterious red box on the beach def addABox(): beach = makePicture(getMediaPath("beach-smaller.jpg")) addRectFilled(beach,150,150,50,50,red) show(beach) return beach 66 Example picture def littlepicture(): canvas=makePicture(getMediaPath("640x480.jpg")) addText(canvas,10,50,"This is not a picture") addLine(canvas,10,20,300,50) addRectFilled(canvas,0,200,300,500,yellow) addRect(canvas,10,210,290,490) return canvas 67 Lets think about something Look at that previous page: Which has a fewer number of bytes? The program that drew the picture The pixels in the picture itself. Its a no-brainer The program is less than 100 characters (100 bytes) The picture is stored on disk at about 15,000 bytes 68 Vector-based vs. Bitmap Graphical representations Vector-based graphical representations are basically executable programs that generate the picture on demand. Postscript, Flash, and AutoCAD use vector-based representations Bitmap graphical representations (like JPEG, BMP, GIF) store individual pixels or representations of those pixels. JPEG and GIF are actually compressed representations 69 Vector-based representations can be smaller Vector-based representations can be much smaller than bit-mapped representations Smaller means faster transmission (Flash and Postscript) 70 But vector-based has more value than that Imagine that youre editing a picture with lines on it. If you edit a bitmap image and extend a line, its just more bits. Theres no way to really realize that youve extended or shrunk the line. If you edit a vector-based image, its possible to just change the specification Change the numbers saying where the line is Then it really is the same line Thats important when the picture drives the creation of the product, like in automatic fabric cutting machines 71 How are images compressed? Sometimes lossless using techniques like run length encoding (RLE) Instead of this: BBYYYYYYYYYBB We could say 9 Ys like this: BB9YBB Lossy compression (like JPEG and GIF) loses detail, some of which is invisible to the eye. 72 Another Programmed Graphic def coolpic(): canvas=makePicture(getMediaPath("640x480.jpg")) for index in range(25,1,-1): color = makeColor(index*10,index*5,index) addRectFilled(canvas,0,0,index*10,index*10,color) show(canvas) return canvas 76 And another def coolpic2(): canvas=makePicture(getMediaPath("640x480.jpg")) for index in range(25,1,-1): addRect(canvas,index,index,index*3,index*4) addRect(canvas,100+index*4,100+index*3,index*8,index*10) show(canvas) return canvas 77
Find millions of documents on Course Hero - Study Guides, Lecture Notes, Reference Materials, Practice Exams and more. Course Hero has millions of course specific materials providing students with the best way to expand their education.

Below is a small sample set of documents:

Purdue - CS - 177
Chapter 6: Modifying Sounds Using Loops1Chapter Objectives2How sound works:Acoustics, the physics of sound Sounds are waves of airpressure Sound comes in cycles The frequency of a wave isthe number of cycles persecond (cps), or HertzComplex so
Purdue - CS - 177
Chapter 8: Making Sounds by Combining Pieces1Chapter Objectives2Making more complex sounds We know that natural sounds are often thecombination of multiple sounds. Adding waves in physics or math is hard. In computer science, its easy! Simply add
Purdue - CS - 177
Chapter 8: Making Sounds by Combining Pieces12We know that natural sounds are often the combinationof multiple sounds.Adding waves in physics or math is hard.In computer science, its easy! Simply add the samplesat the same index in the two waves:r
Purdue - CS - 177
Chapter 9:Building Bigger Programs1Chapter Objectives2How to Design Larger Programs Building something larger requires good softwareengineering. Top-down: Start from requirements, then identify the piecesto write, then write the pieces.Bottom-up
Purdue - CS - 177
Chapter 9:Building Bigger Programs12How to Design LargerProgramsBuilding something larger requires good software engineering. Top-down: Start from requirements, then identify the pieces towrite, then write the pieces. Bottom-up: Start building pi
Purdue - CS - 177
Chapter 10:Creating and Modifying Text1Chapter Objectives2Text Text is the universal medium We can convert any other media to a text representation. We can convert between media formats using text. Text is simple. Like sound, text is usually pro
Purdue - CS - 177
Chapter 10:Creating and Modifying Text12TextText is the universal medium We can convert any other media to a text representation. We can convert between media formats using text. Text is simple.Like sound, text is usually processed in an arraya l
Purdue - CS - 177
Chapter 11:Advanced Text Techniques: Web and Information12Networks: Two or morecomputers communicatingNetworks are formed when distinct computerscommunicate via some mechanism.Rarely does the communication take the place of 0/1voltages over a wir
Purdue - CS - 177
Chapter 12:Making Text for the Web12HyperText Markup Language(HTML)HTML is a kind of SGML (Standardized General MarkupLanguage) SGML was invented by IBM and others as a way of defining parts of a document.HTML is a simpler form of SGML, but with
Purdue - CS - 177
Chapter 13:Creating and Modifying Movies12Movies, animations, and videooh my!Were going to refer generically to captured (recorded)motion as movies.This includes motion entirely generated by graphicaldrawings, which are normally called animations
Purdue - CS - 177
Chapter 14:Topics in Computer Science: Speed12Big speed differencesMany of the techniques weve learned take no time at allin other applicationsSelect a figure in Word.Its automatically inverted as fast as you can wipe.Color changes in Photoshop h
Purdue - CS - 177
Chapter 15:Topics in Computer Science: Functional Programming12Functions: Whats the point?Why do we have functions?More specifically, why have more than one?And if you have more than one, which ones should youhave?Once I have functions, what can
Purdue - CS - 177
Chapter 16:Topics in Computer Science: Object-OrientedProgramming12History of Objects: Where theycame fromStart of the Story: Late 60's and Early 70'sWindows are made of glass, mice are undesirable rodentsGood programming = Procedural Abstraction
Purdue - CS - 177
CS 177 Fall 2010 Exam I-There are 25 single choice questions. Each one is worth 4 points. The total score for theexam is 100.Answer the questions on the bubble sheet given.Fill in the Instructor, Course, Signature, Test, and Date blanks in the bubble
Purdue - CS - 177
CS 177 Fall 2010 Exam II-There are 25 single choice questions. Each one is worth 4 points. The total score for theexam is 100.Answer the questions on the bubble sheet given.Fill in the Instructor, Course, Signature, Test, and Date blanks in the bubbl
Purdue - CS - 177
CS 177 Fall 2010 Final Exam-There are 50 single choice questions. Each one is worth 4 points. The total score for theexam is 200 points.Answer the questions on the bubble sheet given.Fill in the Instructor, Course, Signature, Test, and Date blanks in
Purdue - CS - 177
Learning Styles and StrategiesLearningWhat is measured is PREFERENCE, notPREFERENCEcompetenceBetter understanding of how you prefer tolearn means a higher quotient for successUnderstanding your preference and that ofothers may help in communicatio
Purdue - CS - 177
Project 1: Sound Editordue Sunday, October 31st, 11:59 pmThis is an individual project.For this project you will develop a simple sound editing program. Background Course Material Setup Project Specification Submitting Your Project Grading Criter
Purdue - CS - 177
PROJECT 2: ADVANCED ADVENTURE GAMEdue Sunday, November 21st, 11:59 pmThis is an individual project.BACKGROUNDIn this project you will modify the Adventure Game by adding new features andfunctions. You will use your knowledge of hierarchal decompositi
Purdue - CS - 177
Project 3: Mastering HTMLThis is a team project to be done in groups of at most 3 studentsProject Due Friday, December 10th, 11:59 pmTA: Mohammad Kazi (mkazi@cs.purdue.edu)Background and Course MaterialSetupProject SpecificationFinal Project Turnin
Purdue - CS - 177
CS 177 Programming withMultimedia ObjectsRecitationCourse Policy On Course WebsiteHow Computer WorksWhat Computers Understand? Computers can only understandEncoding of numbers. So what is the meaning ofEncoding? Figure 3 (pag. 8) of the textboo
Purdue - CS - 177
CS 177 Week 2 Recitation SlidesVariables, Files and Functions1AnnouncementsGet your I-Clickers to class next time.2ANY QUESTIONS?3Table of contentVariablesFilesFunctionsWhat is a function? Why to use a function? How to write a function in JE
Purdue - CS - 177
CS 177 Week 3 Recitation SlidesPictures, Pixels, Colorsandfor Loop1Announcements2ANY QUESTIONS?3Reminder: Why digitize media?Real media is analogue (continuous).To digitize it, we break it into parts and encode them intonumbers.By encoding th
Purdue - CS - 177
CS 177 Week 4 Recitation Slidesfor Loopif statementandrange1AnnouncementsEXAM 1Wednesday 09/296:30p - 7:30pEE 1292ANY QUESTIONS?3Lets remember for Loopdef decreaseRed(picture):for p in getPixels(picture):value = getRed(p)setRed(p,value*0
Purdue - CS - 177
CS 177 Week 5 Recitation SlidesMirroring and copying images,Using for Loop, if statement, and range1AnnouncementsEXAM 1Wednesday 09/296:30p - 7:30pEE 1292ANY QUESTIONS?3Horizontal mirror recipe4mirroring means intuitively &quot;flipping around&quot; a
Purdue - CS - 177
CS 177 Week 6 Recitation SlidesScalingDrawing on imagesVector-based Vs. Bitmap graphical representation1AnnouncementsnEXAM 1Wednesday 09/296:30p - 7:30pEE 1292ScalingnScaling a picture (smaller or larger) has to do withsampling the source p
Purdue - CS - 177
CS 177 Week 7 Recitation SlidesModifying Sounds using Loops+Discussion of some Exam Questions1ANY QUESTIONS?2Q3. Consider the following function definition:def sum(a, b):c=a+breturn cprint Hello WorldWhat is the output when you execute sum(4,5
Purdue - CS - 177
CS 177 Week 8 Recitation SlidesJES Sound functionsandModifying SoundsIncreasing/Decreasing VolumeMaximizing (Normalizing)SplicingReversingMirroring1ANY QUESTIONS?2Lets remember SoundWe store sounds as array of integer values Each value is st
Purdue - CS - 177
CS 177 Week 9 Recitation SlidesSound Combination, SamplingandBuilding Bigger Programs1ANY QUESTIONS?2Media File Path is Important&gt; setMediaPath() #must be called before getMediaPath&gt; c4=makeSound(getMediaPath(&quot;bassoon-c4.wav&quot;)&gt; e4=makeSound(getM
Purdue - CS - 177
CS 177 Week 9 Recitation SlidesCreating and Modifying Text1ANY QUESTIONS?2Text and StringLike sound, text is usually processed in an arraya longline of charactersStrings are defined with quote marks:Single quotes my string Double quotes my strin
Purdue - CS - 177
CS 177 Week 11 Recitation SlidesWriting out programs, Reading from the Internetand Using Modules1ANY QUESTIONS?2Writing a program to writeprogramsFirst, a function that will automatically change the textstring that the program littlepicture draws
Purdue - CS - 177
CS 177 Week 12 Recitation SlidesAdvanced Text Techniques and Making Text for theWeb + (some examII questions)1Q21. Suppose you have the following string:str = &quot;Purdue University&quot;Which of the following statements will produce the same result ofstr.f
Purdue - CS - 177
CS 177 Week 13 Recitation SlidesHTML and Relational Database1ANY QUESTIONS?2What is HTML?Language which specifies the format of the text on theworld wide web.a.k.a. Hyper Text Markup Language.Was originally created with the intent of identifying
Purdue - CS - 177
CS 177 Week 15 Recitation SlidesSpeedBig-O notationSorting and SearchingandFunctions with Recursion1ANY QUESTIONS?2More than one way to solve aproblemTheres always more than one way to solve a problem.3You can walk to one place around the blo
Purdue - CS - 177
CS 177 Week 16 Recitation SlidesObject Oriented Programming1ANY QUESTIONS?2Procedural Abstractions3Define tasks to be performedBreak tasks into smaller and smaller pieces Until you reach an implementable sizeDefine the data to be manipulatedDes
Purdue - CS - 177
Q1. What is the name of the function that will display the names of variables in yourprogram?A)showVars()B)showNames()C)showFiles()D)showObjects()Key: AQ2. The following function will result in a JES error. Why?A)B)C)D)In line 1 the : is m
Purdue - CS - 177
The Concept of Team WorkStarting with Lab 9 you will be doing lab exercises in groups of two or three students. You willalso do projects in groups. The content of this document applies to labs and to projects. Youshould elect one student as the group l
Purdue - CS - 177
Teaming: Reflection Paper GuidelinesPart of a successful teaming experience is the ability to critically reflect on that experience andarticulate it well to others. College-level writing that has been spell-checked and proof read isexpected. This paper
Purdue - CS - 177
If you want to turnin your project from your home you can follow the followingsteps:1. Download the SSH Secure Shell Client 3.2.9. You can google it or find atftp:/ftp.tm.informatik.uni-frankfurt.de/pub/prog/SSHSecureShellClient3.2.9.exeThis program i
University of Sydney - MATH - 1011
Periodic Functions[1.2 of the Notes, Chapter 1 ofStewart is also useful]There are many examples in natureof events repeating themselves overand over again. Nature is periodic!Example 1If you plot the length of day againsttime the graph repeats its
Purdue - HIS - 306
NewFinalExam1.ComparethedifferencesbetweentheEastandWestintermsofinfluencandlandscapearchitecture.StudentResponse:EgyptianlandscapeswemadefertilebytheoverfgardenswereformalandmadelandscapebecausnonaturallandscapestoirrigationsystemswereinEgypti
Purdue - HIS - 306
History of Horticulture: Lecture 1Lecture 1Dating the Past: Geologic,Archeologic, Biologic, and HumanArcheologic,CultureDating the Past (years ago)Dating the Past (years ago)1History of Horticulture: Lecture 1Dating the Past (years ago)The Emer
Purdue - HIS - 306
History of Horticulture: Lecture 2Lecture 2Early Humans and the Prehistoric Record:HumanPlant InteractionDating the PastHuman Fossils &amp; ToolsHominid fossils and tools date to 1.8 million yearsago.There is some evidence of tools in Europe as early
Purdue - HIS - 306
History of Horticulture: Lecture 3Lecture 3Neolithic Revolution and theDiscovery of AgricultureDating the PastThe Great Technological Discoveriesof Pre-historyThe discovery of toolsThe discovery and control of fireThe invention of agricultureThe
Purdue - HIS - 306
History of Horticulture: Lecture 4Lecture 4Geography of Plant DomesticationAlphonse de Candolle (18061893)Charles Darwin (18091882)1858 Origin of SpeciesNicholas Ivanovitch Vavilov (18871943)Alphonse de Candolle (18061893)Alphonse De Candolle as a
Purdue - HIS - 306
History of Horticulture: Lecture 5Lecture 5Centers of Origin of Crop PlantsThe eight Vavilovian Centers of Origin for crop plantsOLD WORLDI. Chinese Center: The largest independent centerwhich includes the mountainous regions of centraland western
Purdue - HIS - 306
NewFinalExam1.ComparethedifferencesbetweentheEastandWestintermsofinfluencandlandscapearchitecture.StudentResponse:EgyptianlandscapeswemadefertilebytheoverfgardenswereformalandmadelandscapebecausnonaturallandscapestoirrigationsystemswereinEgypti
Purdue - HIS - 306
Title:exam1Started:Submitted:Timespent:Totalscore:February21,20088:26AMFebruary21,20088:58AM00:31:4799/100=99% Totalscoreadjustedby0.0Maximumpossiblescore:1001.ToxicsubstancestendtobeeliminatedinStudentResponseValueCorrectAnswer1 cultiva
Purdue - HIS - 306
JumptoNavigationFrameTitle:Started:Submitted:Timespent:Totalscore:exam2March5,200810:31AMMarch5,200811:08AM00:36:5298/100=98% Totalscoreadjustedby0.0Maximumpossiblescore:1001.ComparecontributionsofDioscoridesandTheophrastestohorticulturalkS
Purdue - HIS - 306
Title:Quiz1Started:January15,20088:29PMSubmitted:January15,20088:43PMTimespent:00:13:56Totalscore:10/10=100% Totalscoreadjustedby0.0 Maximumpossiblescore:101.GiveapproximatedatefortheBronzeAgeStudentResponse1. 4,000yearsagoValueCorrectAnswe
Purdue - HIS - 306
Extra Credit AssignmentTwo famous garden scenes of Shakespeare are found in Richard II and The Winter's Tale.Choose one and delineate and discuss the horticultural knowledge revealed in these excerpts.Your submission should be at least one page in leng
Purdue - HIS - 306
ARTGiuseppeArcimboldoMichelangeloCaravaggioGeorgDionysusEhretGeorgiaOKeefeVincentvanGoghLeonardodaVinciBartolomeoMayanYumKaax,Yucatan,Chultunes.AztecsTenochtitlan,Milpas,Chinampas,MexicoCity.IncasMacchuPichu,Potatoculture,.Cuzco.GreeceRhizotomoi,Hippoc
Purdue - HIS - 306
EXAM #1Question Type #1Cultivated Food Plants Toxic Substances tend to be eliminated in Seed dormancy is lost in Self pollination tends to increase in Fruit and organ size is greater in Life span for crops grown for vegetative organs is increased i
Purdue - HIS - 306
Yourlocation:AssessmentsViewAllSubmissionsViewAttemptViewAttempt1of1Title:exam1Started:Submitted:Timespent:Totalscore:January28,20098:28AMJanuary28,20098:47AM00:18:2190/100=90% Totalscoreadjustedby0.0 Maximumpossiblescore:1001.Toxicsubstance
Purdue - HIS - 306
Yourlocation:AssessmentsViewAllSubmissionsViewAttemptViewAttempt1of1Title:exam2Started: February2,20098:20AMSubmitted: February2,20098:53AMTime00:32:52spent:Total97/100=97% Totalscoreadjustedby0.0 Maximumpossiblescore:100score:1.Comparecontri
Purdue - HORT - 306
Old World Crops: Wheat, rice, Date. Apple, citrus/ New World Crops: Peanut, cacao, maize, squash, tomato Ikebana, Bonsai, and Sakai:ikebana is a Japanese flower arrangement that is based on the symbolic use of flowers. Bonsai is specimen grown on miniatu
Purdue - HORT - 306
View Attempt 1 of 1Title:Started:Submitted:Time spent:New Final ExamDecember 8, 2010 3:02 PMDecember 8, 2010 4:15 PM01:12:34Total score:170/200 = 85% Total score adjusted by 0.0Maximum possible score: 2001.Define the following design termsSy
Purdue - HORT - 306
Title:NewFinalExamStarted:Submitted:Timespent:Totalscore:February11,20098:29AMFebruary11,20099:52AM01:23:25154/200=77% Totalscoreadjustedby0.0 Maximumpossiblescore:2001.Defendthefollowingstatementandgiveexamples.&lt;br&gt;Thegreatestcontributiontoho
Purdue - HORT - 306
ViewAttempt1of1Title:Quiz3Started:Submitted:Timespent:Totalscore:January15,200911:31PMJanuary15,200911:40PM00:08:5310/10=100% Totalscoreadjustedby0.0 Maximumpossiblescore:101.WhatisevidenceforplantintroductionintoEgypt?(2points)StudentRespon
Purdue - HORT - 306
Yourlocation:AssessmentsViewAllSubmissionsViewAttemptViewAttempt1of1Title:exam1Started:Submitted:Timespent:Totalscore:January28,20098:28AMJanuary28,20098:47AM00:18:2190/100=90% Totalscoreadjustedby0.0 Maximumpossiblescore:1001.Toxicsubstance
Purdue - HORT - 306
Title:Quiz1Started:January15,20088:29PMSubmitted:January15,20088:43PMTimespent:00:13:56Totalscore:10/10=100% Totalscoreadjustedby0.0 Maximumpossiblescore:101.GiveapproximatedatefortheBronzeAgeStudentResponse1. 4,000yearsagoValueCorrectAnswe