Change Contents of the Bubble
Welcome to CS1315. Click on the python to add comments.

This page removed for FERPA compliance
View this PageEdit this Page (locked)Uploads to this PageHistory of this PageHomeRecent ChangesSearchHelp Guide

Midterm Exam 2 Review Fall 2005: WhooooOOOooo


what does abs in "abs(50-frame)mean?
Absolute value of 50 minus whatever the frame value is. -Student1680

how do you abridge the directory path to pass in a directory parameter into the function: tickertape(directory, string). In other words, how do you pass in a parameter without the directory path?
I'm not sure what you mean by this. -Student1680

100 frames are created. Correct? I thought range was always short one..."up to but not including" I guess that is because the frames start at 00.

And abs means absolute value correct?
Yes and yes. -Student1680

since we can not use JES on the exam, is there a quick method to find an answer like this on the exam we take...like select a few frames at the beginning, do the math and look for the pattern, then try the middle and end to see the pattern?
That's how I would recommend doing this. Plug in 0. Plug in 50. Plug in 100. Connect the dots. -Student1680

does len stand for length?
Yes. -Student1680

Is there a table or index that we can look up all of these short definitions such as "abs" and "len", so we do not have to ask you?
These should be in the book. On the test, we won't ask you anything that was never shown in class like abs. And if we did, we'd explain it in the problem instructions. -Student1680

what does the line "if len(num) == 1" do? I am having a hard time understanding how the frame names are created.
"If the frame number is just one digit..." -Student1680

Also, what is happening in the writePictureTo function with the , directory + '//frame' + num + '.jpg'?
You are concatenating all the strings to form a full path and filename. -Student1680

does x = frame 4.8? I calculated that using 480 as the width.
also does y = the absolute value of 50 - (x/4.8)? If so, how do I determine what this function is doing and how this canvas is going to look?
My suggestion is to disregard the actual width and height values and merely think of them in terms of width and height. For example, on frame 50, the x value is 50 * width / 100. If you plug in 640 for width you get some number that doesn't tell you much. But if you leave it in terms of width you can simplify that to width / 2. This means that 50 frames into the movie the tickertape is exactly half way across the picture horizontally. Same reasoning should be applied to the y coordinate. -Student1680

how can one tell in which direction the tickertape is moving, or any object, are there certain numbers that we look at to see the direction of the moving object?
In addition to my above explaination, if you're adding the frame number to a coordinate it's moving away from that axis. If you're subtracting the frame number, it's moving towards it. But be careful, as absolute value tends to switch directions at some point. -Student1680

the names of the frames look like:
the name of the directory + //frame + the number of the frame + .jpg
how does a directory look like? what is a directory and how does it differ from a string? is a directory like a folder of different files?
A directory is a folder path and it looks different for different computers (PC C:\blah\blah\blah\ vs. Mac /Users/me/blah/blah/blah/. If we ask you what the filename looks like, you can assume we're excluding the directory name. -Student1680

how do we know what the tickertape is doing?
See various above statements. -Student1680

is "frame" a number, is it some numerical value, what does it mean by frame38?
Frame is a number that goes from 0 to 99. I'm not sure what you mean by frame38. -Student1680

i put the tickertape in jes, but i do not know what to put in for "string" in my command area. I know for the directory, I have to put something like, r"C:\Documents and Settings\lala\My Documents\Music\hw3" right?
The string is whatever you want the ticker tape to say. -REMOVED O'Hare

what is len used for? what lenght is this applied to?
REMOVEDngth of the string. REMOVEDw many characters are in it. In this case, how many digits the number is. -Student1680

so from reading the above statements, i have to plug frame values like frame number 0,50, or 100 to find my x and y values, but u said to not to plug in the actual values of the height and width so that we can see the relationship.
so for example, if we have frame #0, x=0 and y=height/2
frame #50, x=width/2 and y=0
frame #100, x=width and y= height/2
: what does this tell us about the direction of the tickertape? how do we look at the relationship of these values, by x-yplane?
You know that the top left corner of the image is 0,0. So plot the (x,y) for when frame = 0. Then plot the (x,y) for 50, then 100 (close enough to 99). Draw a box and plot the dots. If x=width / 2 and y = 0, then that would be located at the midpoint of the top of the box. -Student1680

so, the tickertape will start at (0,half the height) it'll travel diagonally upright to (half the width,0) and then it'll travel back down diagonally downright. so the tickertape will make a triangle shape. I figured this out by first actually putting in values for height and width for random frame numbers, and compared them with values where i didn't put the actual height and width.
Bingo. -Student1680

So does the frame name look something like this for frame 1:
C:\\Documents and Settings\\Marcy\\Desktop\\Cool Beans\\marcy.jpg//frame01.jpg ????????
Yes, but on the test, simply frame01.jpg will suffice. -Student1680

just wondering, whats the difference between the "what's the tickertape doing" question and the "which way does the text move" question?

That's a very good question. I have no idea. Just ignore one. -Student1680

so basically the tickertape will be an absolute value graph type movement!

oh, nevermind... the person up top already solved it....

Hey, i heard that there is a midterm review sometime tonight, when and where is it?

The review session will be Monday from 7 to 10 PM in Room 16 in the College of Computing. -Student1206



Link to this Page