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

Looking for the book? They have it at the Engineer's Bookstore at 748 Marietta St NW. Here is there website: http://www.engrbookstore.com/ - Monica

Hotspots: Slides and CodeTA CornerComments?AnnouncementsFAQStatic Webspace
View this PageEdit this Page (locked)Uploads to this PageHistory of this PageHomeRecent ChangesSearchHelp Guide

Fall 2004 Take Home Exam 1 Questions Page

Be sure to ask questions here ONLY! ABOUT

DO NOT POST ANY CODE HERE!


What time is the exam due tomorrow? Thanks.
-spw
Monday, Oct. 4, 2004 @ 7 PM EST Angela Liang

We don't have to literally use the "return" function, right? As long as it works, and we show the resultant picture at the end, using show(picture), we don't need to include return(picture), right?

I am not sure I understand why we do not need a canvas, how should we make the picture?
If you notice, the picture that you are to download and manipulate is not just the image. It includes a lot of white space surrounding the image. Kelly Lyons
I'm ready to turn it in, but do I need to turn in my resultant image, or just the program I wrote??? thanks

You only need to turn in your program. Kelly Lyons

How picky is the grading? Will our resultant file be checked pixel by pixel or as long as our resultant file looks similar be okay?

We do not grade pixel by pixel, we grade your code. If you write the code to do what we have asked you to do, then you will get a good grade. If your code does other things, but the result happens to look similar, you will not get a good grade. But, it will be really hard to make your file look the same without doing it correctly. Just follow the instructions on how to change the picture, and you should be ok. Kelly Lyons

why is can't i use the range (0,to something)? It gives me an out of bounds error statement...how do i get the pictures to match up correctly?

    Think about what range(0, to something) generates and think about what kind of input pixel-related things in JES are expecting. -Blake O'Hare

after i saved the picture, i can't get it to show, I think JES doesn't read it. Not sure if you can give any hints as to how?
When you save it, can you find it on your hard drive? Is it a jpg file? Are you using the right variable name when trying to show it? Does your function return the picture? If so, are you saving the returned picture, and what are you calling it? These are some thoughts that might help you solve your problem. Kelly Lyons

Um, I may be blind but is there a due date posted on the Take Home Exam 1 page?

The due date is stated in the syllabus and lecture slides page. It is due on Monday at 7 PM. Kelly Lyons

One question. Must the file be saved baseimage.jpg, or does baseimage.jpeg also work? Basically, I can't get my computer to save it as jpg, only jpeg, so my code will only take jpeg.

that should be fine. Lauren Walker

are there any slides available on mirroring diagonally?
I'm not sure if there are any slides on it, but try making your inner for loop dependant on the other variable, for example: for y in range(1,x) Try something like this in JES and see what it does. This should help you figure out how to mirror diagonally. Kelly Lyons

What do you mean by you should not open a canvas picture?? Aren't we supposed to copy the original picture onto a canvas, and from there do the manipulation??
If you notice, the picture you download includes not only the image, but a lot of white space surrounding it. This is the whole canvas that you will need. Kelly Lyons

When you say to write the honor statement in the comment area - do you mean the "note to the TA" section on the turn-in page?

Yep, please remember to type it in though everyone, because we really will not grade your take home without it!! Summer McWilliams

Why won't the mirror function work the way it's suppose to for this assignment if you just take out the " /2 "? I keep getting the outofbounds error message.
I believe this falls under what we cannot discuss. There are however some ideas on how to solve out of bounds errors on the HW2 questions page. You might want to look there for help. Kelly Lyons


what do u mean by Negating the upper left 1/4 of the image AND the lower right 1/4 of the image ? the original image or the 4 images combined
The image that results after the mirroring Kelly Lyons


when i save the picture from the website, my computer won't let me save it as a jpg file, the only option i have is a bmp image. is there anyway i can change that?

nevermind, i figured it out...blonde moment.


you must negate the top left picture of the woman and the bottom right picture of the woman. Look at the resultant picture given if your have any more questions or if this wasn't very clear. Lauren Walker

The white line between the two left pictures and the black line between the two right pictures: Are the important? My picture do not overlap but they do not have those slight spaces.

We're not going to hung up over how much of a gap there is. Mark Guzdial


ok- i'm an idiot- this is a general question- should this function take FOREVER to run? i think i did everything right but it just sits there with the litlte bar moving back an forth and never does anything.... so... is it just taking long or have i done something wrong?
It should take no longer than your HW2 function did. Kelly Lyons



When i mirror the image from left to right it leaves a space just below the top right image and to the rigth side of it..it looks like it migth be that way in the resultant image posted on teh take home exam page, but i can't tell...if that's not how it actually looks, why is that happening?
Why don't you download the resultant image, and open it in your picture tools, and compare the pixels in it to the pixels in your resultant image. Kelly Lyons

what does it mean when i try to run the program but it say something like media.Picture instance at 19903052?
If you have a function that returns something and you don't save it when you run the function, it prints it to the command area. Kelly Lyons

Ok, so if I closed the gap and evened up the picture its ok? I still can't get rid of the blank outer pixels. Haven't figured that one out yet.

i am not able to negate the pic on the upper left and the one at the bottom right, when i write my programs it negate the whole thing ( all 4 pictures). Any suggestions?

How did you negate (or make other changes to) specific pictures in you collage? Summer McWilliams

well, i started by copying the 3 other pictures, then i mirror vertically, then horizontally. Because i did not use any canvas, my filename is just baseimage. So when i wanted to negate the pictures, i used negate(filename)but i made sure that my ranges were correct( to negate only the upper left and bottom right); but it does not seem to work because it negate the whole thing. Maybe i need to define the specific parts of the image i want to manipulate since they are individual pictures?
Why don't you try it and see. Remember that once you enter a new function, any contraints you set outside of the function may be ignored. Kelly Lyons



Is it OK that my program takes a couple of minutes to generate the product? It works, it just takes a little time to process.

A few minutes of time is allowable. If it takes more than 10 minutes, then it would be less OK. Kelly Lyons

It really depends on the speed of your computer – if you have an older computer, then it may take longer. The TAs have access to zippy, newer computers. On the other hand, if it's REALLY slow (like Kelly says, 10 minutes), then you may have a bug in your program. Mark Guzdial


Is it okay if my resultant image does not have the very small gap between the upper left and lower left images as shown?

The directions say, NOTE THAT YOU WILL NOT NEED A SEPARATE CANVAS FOR THIS!. DO NOT OPEN A CANVAS PICTURE! So, can u open a separate picture if it's not a canvas?

Dear U. "open a separate picture if it's not a canvas?" I'm not sure what that means. I'll try saying it a different way: You will make only one picture in your function for take home exam 1– the one you download from the Take-Home Exams-Fall 2004 page. That's it. Period. (Hint: You make two pictures, it's probably wrong.) (Second hint: Don't even consider making three pictures.) Mark Guzdial

What does the error message "Thread Death" mean?


Yes, what does "Thread Death" mean because i am receiving the same error message. How do i debug because my program is taking forever to load?

What is a decent length of time that this program should take to run? My works but it takes close to 35 minutes!! yikes

More than 10 minutes is probably going to be too long. 35 min def. too long. But, if your code works then that's all that matters. Amanda Bennett

Ok, when i run the function i created to mirror the image from Top to bottom AND right to left it works, but when i insert the getMediaPath part, it doesn't work at all, i don't get it!! i mean, before i run the program, i setMediaPath to where i need it to be and everything, but it just won't return the picture! it seems like the only way that it'll work is with pickAFile()!

How do we determine where a bug in our program is when JES continues to run and run? My program takes over the 10 min limit and I can't figure out where the bug is.

Trace through your program with a peice of paper. Walk through it and make sure it does what it's supposed to do. If that doesn't work, you can put some print lines in your code to see when your code works and what part it gets stuck on. Amanda Bennett

I'm having this same problem with my program taking forever to load. When running each program separately, I'm noticing my program has problems with the negative function. When I set up the selected range for the program to execute, it takes about 15 minutes to do each part of the picture. Any advice on how I can speed this up? Thanks!

I too am having the same problem with my program taking forever to load. It will mirror both hor and vert and negate the entire picture in less than a minute, but when i insert the ranges of the upper and lower 1/4's into my negative function jes always ends up timing out. this seems efficient, why isn't it working quickly?

Ok, I don't want to sound like a broken record by saying what the last few people have said, so I'll ask a more general question. Can someone please explain how range should work, since it seems like many of us assume that we have the range set up correctly, but are still getting an entire picture to show in the negative?
aaahh! i'm having a problem setting up the range function! i have the function mirroring but how do i specify it so that only the top left and bottom right will go negative???
What is the function supposed to be called? Does it matter?
negColor=makeColor(255-r,255-g,255-b), I keep getting an error here. Any suggestions?
What all do we need to turn in? just our code? or the resultant image too?
I have also gotten the "Thread Death" message and I do not find a definition for it in the JES Help section or in the course book. I don't know if this is related, but my program is not finishing after an hour of processing...and i don't see any errors when i go line by line- i checked in the book for the negation and mirroring functions.

I'm having trouble getting the bottom right to negate. If I divide height and width by -2 shouldn't it be opposite from doing the top left by using 2?
do we have to do anything with setting the media path or like having the program know what picture to use?

help! my final picture is taking FOREVER to load! i can't even see if its turned out right. is there any way to fix this or should i just turn in my code (in theory i think it should work). Is there a way to fix this problem?
Thread death is what you get when you click the Stop button. I supposed that it could also happen if you have something take up all of memory.

Folks, I can't help you with your individual programs, but I can offer a mini-lecture here that might help – call it a foreshadowing of a future lecture, on why things take forever to run.

Take a look at page 317 in the book. Indentation MATTERS. If you indent things and get it wrong (e.g., keep indenting and never out-denting), then your FOR loops are running inside of one another and the code DOES take forever to run – or it might run out of memory. The lesson of page 317 is that FOR loops multiply the amount of time it takes to do something.

Now, take a look at the program at the bottom of page 88. What if the show(source) were indented to line up with the count=count+1? Then we'd show the picture once for each time that we copied a pixel color...18,340 times! That's a lot of show's! What if you get your indentation wrong in your collage code? Then maybe you negate a picture once for EACH pixel copy. That sounds like a lot of extra negating to me. Betcha it would take a lot of time, too! Mark Guzdial


What are we supposed to call the function??
I'm assuming that we do NOT need to submit our "baseimage.jpg" since the TA's will have it, correct?

The function should be called exam1 and saved as exam1.py. We will have the image so you do not have to worry about turning it in with your program. Lauren Walker
can i get some hints or guidance on how to mirror the lower right 1/4? i cang et a small fraction of the pic to show, but not the rest.

gte797z
my function is not working with the baseimage. It works with barbara. I don't think it is getting saved right..I save it as .jpg, but it will not open in JES( just in other programs...) any suggestions? gtg380r

When I load my function my picture does not show up. In the command area it has the following message:

Picture, filename D:\\vampgirl.jpg height 768 width 414


It says that the picture has been loaded but I see no picture...Can you help me with this?

Ok, when i run the function i created to mirror the image from Top to bottom AND right to left it works, but when i insert the getMediaPath part, it doesn't work at all, i don't get it!! i mean, before i run the program, i setMediaPath to where i need it to be and everything, but it just won't return the picture! it seems like the only way that it'll work is with pickAFile()! THIS IS FROM SATURDAY!
And also, i can make the image either all normal or all negative, but when i put a range on it to make the picture negative on the right places, it doesn't work, how am i supposed to do this!?

When you make changes in a range, does it make a change to the original picture before you mirror it, or does it make changes to whatever is already altered?

Link to this Page