All Matches
Solution Library
Expert Answer
Textbooks
Search Textbook questions, tutors and Books
Oops, something went wrong!
Change your search query and then try again
Toggle navigation
FREE Trial
S
Books
FREE
Tutors
Study Help
Expert Questions
Accounting
General Management
Mathematics
Finance
Organizational Behaviour
Law
Physics
Operating System
Management Leadership
Sociology
Programming
Marketing
Database
Computer Network
Economics
Textbooks Solutions
Accounting
Managerial Accounting
Management Leadership
Cost Accounting
Statistics
Business Law
Corporate Finance
Finance
Economics
Auditing
Ask a Question
Search
Search
Sign In
Register
study help
computer science
introduction to computing and programming in pytho
Questions and Answers of
Introduction to Computing and Programming in Pytho
Create amovie where an input picture becomes smaller with successive frames. Paste the whole picture into the first frame, then reduce the size by 5% in successive frames.
Create a movie where an input picture becomes more cropped with successive frames. Paste the whole picture into the first frame. In the second frame, copy the whole picture, but make the 5 columns of
Create a function that takes a picture and creates a movie with the picture slowing turning into the negative from left-to-right. Maybe you do the leftmost 10 columns of pixels in the first frame,
One of the most common transitions inmovies is fade to black. Let’s implement that. Take a picture as input and copy that into the first frame of the movie. For the next 5 frames, copy the picture
Find another slide transition in PowerPoint or Keynote or some other presentation software, and implement it as a movie.
Create a new version of the lineDetect function (Program 55 (page 128)) that takes in a threshold and create a movie using lineDetect where the threshold changes depending on the frame number.Data
Write a function that draws a sun on the picture of a beach at different places on the picture in successive frames. The goal is to make it look like the sun is moving across the sky through the day.
Write a function to make a movie with text that starts out large near the bottom of the movie and then moves up toward the top and gets smaller each time it moves up. You can create a font style
Take a movie of some of your friends dancing in front of a green screen and use chromakey to make it look like they are dancing on the beach.
Take a movie of a location and a movie shot in front of a green screen and use chromakey to blend the two movies together.
Build an animation of at least three seconds in duration (30 frames at 10 fps, or 75 frames at 25 fps).You must have at least three things in motion during this sequence. You must use at least one
Create a movie where a person seems to be fading out of the scene. You can base this on the slowFadeout function (Program 177 (page 393)).Data from Program 177 def swapBack (pic1, back, newBg,
Remember the blending of pictures in Chapter 6? Try blending one picture into another as a movie, slowly increasing the percentage of the second (incoming) image while decreasing the percentage of
The example of tracing bright pixels in this chapter used the paint1 folder in the mediasources. There is another example in paint2. Try running that one.
The end-result pixels are pretty dull in the bright pixel tracing example. Use the makeLighter function to brighten up the pixels that you copy across.
Will the bright pixel tracing function only work in darkness? Make your own movie with someone writing with a glow stick or flashlight, in normal brightness. Does the function still work? Do you need
What is machine language? How is it similar or different than bytecodes for the Java Virtual Machine? You will probably have to investigate on the Internet to answer these questions.
Explain the difference between RAM and cache memory.
There are lots of different kinds of sorting algorithms. Investigate some on the Internet. Which ones are considered fast, and under what conditions?
Find animations of different sorting algorithms on the Internet. How would you describe difference between a bubble sort and a quicksort in terms of what you see in the animations?
Write a function to do an insertion sort on a list.
Write a function to do a selection sort on a list.
Write a function to do a bubble sort on a list.
Write a function to do a quicksort on a list.
Convert the following colors to hexadecimal: gray, yellow, pink, orange, and magenta. You can get the red, green, and blue values for each color using print color.
Convert the following decimal numbers to hexadecimal: 113, 64, 129, 72, 3.
Convert the following hexadecimal numbers to decimal: 2A3, 321, 16, 24, F3.
Given a folder with images in it, create an index HTML page with links to each image. Write a function that takes a string which is the path to a directory. You will create a page in the folder named
You have a new computer that seems to connect to the Internet but when you try to go to http://www.cnn.com you get a “Server Not Found” error. You call tech support and they tell you to try to go
If you erase lower two bits in the red value, you can clear space for hiding values 0–4.for p in getPixels(picture): # Clear out the red 2xLSB r = getRed(p) setRed(p,r-(r%4))If you
Use your favorite search engine to figure out what are the differences between SGML, HTML 5, XML, HTML 4.01, and XHTML.
Your father calls you. “My tech support people are saying that the company Web site is down because the database program is broken. What does the database have to do with our company Web site?”
We can be trickier about how we encode text. Imagine that you (the sender) of the message and the receiver have a hidden sentence containing all the characters you might need in a coded message, like
Is it possible to hide a color picture in another color picture? Why or why not?
What is a Denial of Service Attack? Could you write a program to generate one?
How does knowing how to manipulate text help you in gathering and creating information on the Internet?
What is the difference between a client and a server?
What is HyperText? Who invented it?
What are FTP, SMTP, and HTTP? What are they each used for?
Why does it take any time at all for domain names to be accessible across the Internet?
Investigate howyouwould buy a domain name (like “mycooldomainname.org”) and register it so that other users could find it. How long does it take your new domain name to be recognized across the
What is a domain name server? What does it do?
For each of the following, see if you can figure out the representation in terms of bits and bytes.(a) Internet addresses are four numbers, each between 0 and 255. How many bits are in an Internet
Match the letter of the definition next to the appropriate phrase below. (Yes, you will have one unused definition.)(a) A computer that matches names like www.cnn.com to their addresses on the
Create a function that pulls a picture from a URL and creates a thumbnail saved on your local machine.
Create a function that pulls a sound from a URL using urllib and creates a sound clip saved on your local machine.
Create a function that visits a news page (maybe for your college) and pulls out all the headers by Web scraping. Put them all in a text file.
Go to a page with a lot of text in it, like http://www.cnn.com and use your browser’s menus to Save the file as something like myPage.html. Edit the file using JES or even an editor likeWindows
In the media folder available at MediaComputation.org, there is another piece of census data that includes city information, state-city-populations.csv. The first few lines of this file look like
Write a function findSmallestState that figures out which state has the smallest population and returns that.
Write a function findLargestState that figures out which state has the largest population and returns that.
Write a function doGraphics that will take a list as input. The function doGraphics will start by creating a canvas from the 640x480.jpg file in the mediasources folder.You will draw on the canvas
You worked late into the night on an assignment and didn’t realize that you wrote a huge section of your term paper with your fingers on the wrong keys. Where you meant to type: “This is an
Imagine that you have a list of the genders (as single characters) of all the students in your class, in order of their last name. The list will look something like “MFFMMMFFMFMMFFFM” where M is
Extend the form-letter recipe to take an input of a pet’s name and type, and reference the pet in the form letter. "Your pet "+petType+","+petName+" will love our offer!" might generate "Your pet
Write short essay responses to these questions:(a) Give me one example of a task for which you would not write a program and give me another example of a task for which you would write a program.(b)
Are the numbers returned from the random.random() function really random? How are they generated?You will have to look up some information on random numbers on the Internet to answer this question.
Create a function that replaces a passed string in a list of strings with a new string.
Create a function that reverses the items in a list.
Create a secret message by encoding each character of a string into a number using ord. For each character in the message, print the rod of that character.
Modify the changeLittle function to use readLine instead of read.
Modify the change Little function to use read Lines instead of read.
Write a function that can find the zip code for a person from a delimited string for an address. For example, it might read a string that has in it “name:line1: line2: city:state:zipCode” and
Write a function that takes a sentence as input and returns it scrambled (the order of the words mixed up in some way). For example, if it is passed “Does anything rhyme with orange?” it might
Change the function find Population to change the input and the comparison word both to lowercase. Now, it will match even if we executed find Population("CALIFORNIA").
Write a function that takes a passed sentence and an index and returns the sentence with the word at the index uppercased. For example, if the function takes in a sentence “I love the color red”
Write a function to uppercase every other word in a passed sentence. So given “The dog ran a long way,” it would output “The DOG ran A long WAY.”
Write a function that finds and removes the second occurrence of a given string in a passed string.
Write a function that takes a string and prints out the letters in the string in reverse order.
Write a function that prints every other letter in a string.
Create a string variable that contains the sentence “Don’t do that!” in it. Create a string variable that contains double quotes in it. Create a string variable that has a tab in it. Create a
If you call the preceding function by typing newFunction("I", "you", "walrus"), what will the computer print? def newFunction(a, b, c): print a list1 = range (1,5) value = 0 %3D for x in listl: print
Can you write a function that finds the silence between words? What should it return?
Write a function to increase the volume on the passed sound just between the passed start and end index.
Write a function to reverse part of the passed sound just between the passed start and end index.
Write a function mirrorBackToFront that mirrors the second half of a sound onto the first half.
Write a function mirrorFrontToBack that mirrors the first half of a sound onto the second half.
Write a function called reverseSecondHalf that takes a sound as input, then reverses just the second half of the sound and returns the result. For example, if the sound said “MarkBark,” the
There is a Python keyword called global. Learn what it does, then change fun1 from the last section to access and change a variable c in the Command Area. (You can change how you define the variable
What are each of the following:1. MIDI2. MP33. Analog4. Amplitude5. Sampling rate
What is the difference between lossless compression and lossy compression? Which type of sound files use what type of compression?
Rewrite the echo function (Program 111 (page 258)) to generate two echoes back, each delay samples previous.Data from Program 111 def echo (delay,s1): s2 = duplicateSound (s1) for index in range
Write a general blend function that takes the two sounds to blend as input and returns a new sound.
Generalize your general blend function even more. Take in the number of samples to use from the first sound before the blend begins and the number of samples to blend.
How long is a sound compared to the original when it’s been frequency doubled (Program 116 (page 261))? How long is a sound compared to the original when only every fourth sound value is copied
Write a function to input a sound, then create a canvas sound of the same length. Copy samples from the input into the canvas every third position, i.e., copy from index 0 in the input into the
Write a function that will input two sounds. Create a new sound with one half of the first sound, then add the two sounds together for the length of the two sounds, and then add the second half of
Write a function that will blend three sounds together. Start with part of the first sound, then a blend of sound1 and sound2, and then a blend of sound2 and sound3, and end with the rest of sound3.
Blend in some words over some music. Start with the music at 75% and the words at 25% and gradually make the words 75% and the music 25%.
Write a function that inputs a frequency, a maximum amplitude, and length in seconds. Create two sounds, one a square and one a triangle, using the same inputs. Add the sounds together. What do you
Write a function that inputs a frequency, a maximum amplitude, a percentage of blend (e.g., 0.25 to represent 25%), and length in seconds. Create two sounds, one a square and one a triangle, using
Write a function to change the frequency of a sound 10 times—five times lower than the original frequency, and five times higher.
Create a new version of the shift function that creates the target to be as big as the resulting sound should be. So if the factor is less than one it would create a larger sound and if greater than
Does the shift function work with a factor of 0.3? If it doesn’t, can you fix it to copy each source value three times into the target?
Hip-hop DJs spin turntables back and forth so that sections of sound are played forwards and backwards quickly. Try combining backwards play (Program 108 (page 248)) and frequency shifting (Program
Consider changing the if block in the frequency shift recipe (Program 119 (page 264)) to sourceIndex = sourceIndex - getLength(source). What’s the difference from just setting the sourceIndex to 0?
If you use the shifting recipe (Program 119) with a factor of 2.0 or 3.0, you’ll get the sound repeated or even triplicated. Why? Can you fix it? Write shiftDur that takes a number of samples (or
Using the sound tools, figure out the characteristic pattern of different instruments. For example, pianos tend to have a pattern the opposite of what we created—the amplitudes decrease as we get
When musicians work with additive synthesis, they will often wrap envelopes around the sounds, and even around each added sine wave. An envelope changes the amplitude over time—it might start out
Create a function to play your school’s fight song using MIDI.
Showing 100 - 200
of 410
1
2
3
4
5