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 PageUploads to this PageHistory of this PageHomeRecent ChangesSearchHelp Guide

Spring 2008 Homework 1 Questions

Questions about Homework 1?


I've run my program, and it seems to work just fine. However, when I open the saved picture, the colors aren't the same as what pops up in JES. I'm opening the picture in Mac Preview. Is there anything I can do to fix this?
See a TA. Is your program saving the original or one that is modified, but not the same? Thanks! Brittany Duncan

I'll ask about it during recitation, but for reference, it is the modified one only with too much blue.
It sounds to me like you are posterizing REMOVED than once. If you posterize an already posterized picture, the colors will be really weird, and I think that given the posterization rules in this homework, everything will come out blue. (I haven't checked this, but I have unerring intuition :) ) REMOVED this by deliberately running your function twice and then repainting your picture. If it looks like what you are seeing in Preview, then you know that that is what you did accidentally. Colin Potts
shakefist You and your unerring intuition! Student5493

What is the password for the lock when you're uploading a picture?
It's located in the FAQ. Student5493

How do we turn in our homework??
Use TSquare for your Python. (We will use this for all labs and homeworks in future.) For extra credit you can upload a posterized picture to the Coweb. Don't submit your picture on TSquare. Colin Potts

Does our program have to automatically show the picture
No. In fact, it must not show the picture. Colin Potts
Clarification.... let's just say that you should not do this, not that you must not. You won't be penalized if you have submitted it this way. It's generally regarded as bad practice to have a function do unrelated things, and transforming the picture followed by displaying it are not very closely related operations. You can do the show yourself separately in the command area to test your posterizeMe function, or you can write a separate function, like the test() function in the examples that I demonstrated in class and posted to the Coweb today. That function would make the picture, show it first, posterize it, repaint it afterward and maybe even write the posterized picture into a new file. That may sound like a lot of unrelated operations, but test() is really doing only one thing: testing or demonstrating the posterizeMe function. Colin Potts

When will we be able to post our HW on tsquare?
Real soon now. (Sorry for delay.) You can upload your extra-credit picture to the CoWeb right now. Colin Potts

It says to put the collaboration statement at the top of our file, should we just put the "#" at the beginning of each line like the questions at the end?
Yes. Otherwise your code will not run, but throw an error. Anything commented out with a '#' symbol will be ignored when JES runs the code. Student5493

I finish my code and change my picture, and then when i go to save the new picture with writePictureTo, it says there is an error because that file can not be opened. Can you clarify how to save the new picture?
Make sure you are including a directory path, not just the new file name. If you are, try a different directory. JES behaves strangely sometimes when it comes to writing files. If you find yourself unable, visit a TAs office hours Tuesday to see if they can figure it out (as while TAs will generally not help when it comes to extra credit, if the problem lies with JES in this area, it's best to find out now, and figure out a workaround, since writing files is very important later on). Student5493
If you are having problems with writePictureTo getting an invalid file name, you could try this:
(1) make a duplicate of your picture file using Windows or the Mac Finder;
(2) Do this in the JES command area:
>>>pic = makePicture(pickAFile()) # Pick the ORIGINAL picture file
>>>posterizeMe(pic)
>>>show(pic) # Wow. It's posterized
>>>dupFile = pickAFile() # Pick the DUPLICATE that you don't mind overwriting, NOT the original
>>>writePictureTo(pic, dupFile) # Should overwrite the duplicate leaving your original untouched.

If the error message is that your folder/directory is read-only, you have a Windows issue. See a TA. Colin Potts

When I tried to upload my picture to the extra credit page it added it as a link instead. Is this ok?
I changed the mentions I saw of files, to images. There is one, sgammon3's, which he/she did not save correctly (the extension is missing), and I will not be touching that one, as to make it work, I would need to fix that extension, and I'm not sure how the extra credit will change because of it. Student5493

I ran my program on the cat picture cropped out from the ta's example from the extra credit page (taexample.jpg), mine looks similar to the example posterized pic, except the example looks a lot crisper (that is to say the colors are obviously wonky in the same way, but the TA's posterized pic has clearer details.) Was the example pic compressed to put on the webpage, or is my program messed up?
JES probably compressed it REMOVED lossily (it's a word now) than I did. I didn't use writePictureTo(), because I like to be different, and I wanted to make sure it stood out nicely. (Really, I just enjoy being difficult. Don't worry about it if your image isn't as crisp, so long as the color wonkiness is the same). Student5493

i can run the code on a picture and it posterizes it, but i can't figure out how to save it. what do i need to do?
JES Functions->Pictures->writePictureTo() will insert the writePictureTo() function, and also pop up the little helper window on how to use the function. That's all (and possibly REMOVED than) I'm supposed to help, since this -is- extra credit. But that will give you an example that may aid you. Student5493

I have attached my final version to T-Square, but when I tried opening the attachment, to see if it would work, it gave me an error message, which says it can not find "jes.bat." The same thing happens when I try to open the file directly from the file folder. However, when I open JES first and then open the file through JES it opens just fine. Is this a problem? Will my TA not be able to see the assignment?
That's fine. Double clicking a .py file won't open it in JES; you have to run JES first and open the program using the file menu. Colin Potts

Is the picture supposed to look like the 2007 gallery? Because all those look green and mine does not.
I missed your question because you posted it at the top of the page originally. You may have answered this yourself by now by comparing your image with the others that have been posted this semester. Colin Potts

what is the lock password to upload the extra credit?
Please read the answers to previous questions before asking your own. Thanks! Brittany Duncan



Link to this Page