![]() ![]() |
| |||||||||
| Hotspots: Slides and Code TA Corner Comments? Announcements FAQ Static Webspace | ||||||||||
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
| Emily, do you have a smaller picture to work with? This problem is not new with JES 3.0, but I think that people are using higher resolution images than last year as digital cameras get better. Try a low resolution image, such as one that you can grab from a web page. I'm sorry if you can't work with one of your own pictures and upload it to the gallery, but it's important to get your program working. The TAs will test it with an image that works. Colin Potts |
| Oh dear. We did expect a few minor problems, but not this. Generally, if JES crashes without warning, it has run out of memory – e.g. by trying to manipulate an image that is too large. Had you run the program using the same image as input the day before? Even though it should not choke on a picture this size, it would be good to know if anything at all was different this morning from yesterday. Presumably you restarted JES and the same thing happened again? We'll see what we can work out. Colin Potts |
| I did ask Mark Guzdial about this. Apparently, the crashing is a known bug in Jython, not JES, and is not new to JES 3.0. Jython crashes without warning when it runs out of memory. Since JES is a Jython program, it crashes too. There is nothing that we can do about that. (There is a new version of Jython that does not have this bug, but that is in Alpha release, and is dangerously flakey for a 400-person class.) I suspect that the problem is being reported more frequently this semester than previously, because people are gradually using bigger, higer res pictures than before, and JES 3.0 may require more resident memory than version 2. You may not need to be processing a big picture at the time that Jython crashes. If there is a memory leak in Jython or the JVM, any use of memory over the past day or so may build up and not be reallocated, causing these unpredictable crashes. This is unfortunate, but we are going to have to live with this for now. As a last resort, rebooting your machine restarts the Java Virtual Machine. That really shouldn't have to be necessary, and it seems from your posting that you didn't do that overnight. You may be right about there being a cache (in the JVM probably) that got cleared out, but I don't know. Colin Potts |
| Yet another update: There is a quick fix for this. We think it should only be happening on Windows machines, not Linux or Macintoshes. For Windows, you can download a new jes.bat file and put it in your JES directory. (See downloads page.) The upgrade gives JES lots of extra memory. It might still crash with VERY large pictures, but not like it has been the past few days. Colin Potts |
Before: After: Colin Potts |
| Is red value a variable you're using in your code? One hint, all variables used should be one word. Amanda Bennett |
| Try right clicking and going to "save as..." Chris Higgins |
| I assume that you saved the batch file in the same directory as JES (in other words that you overwrote the old one.) In that case, to run JES, don't double click on the .bat file icon; double click on the JES python icon just like before. Colin Potts |
| The homework assignment asks you to write a program that changes the picture but it should not show the picture. So if you have done the homework correctly, you will not see any difference in the picture unless you show it in the command area after you have run your function. The function itself shouldn't be doing the showing. Colin Potts |
| A GUESS: You are probably trying to call your posterizeMe function with a file name as its input rather than a picture. Remember to call makePicture to make a picture. A file name is just that: a string of letters. It isn't a picture. HINT: When you get an error message like this, look at the name of the function that is generating it and the line number in your code. It probably contains a call to one of the JES functions such as getPixels. If my guess is right, you are probably trying to get all the pixels out of a file name, and JES can't do that because a file name doesn't contain pixels. Even if I guessed wrong, you should still look at the line that is wrong. Colin Potts |
| Where are you putting the command writePictureTo()? My guess would be that you aren't putting the commend in the right place. Look in the book for several very nice examples of where to put and how to use the function. If after that you are still stumped, come see a TA Toni Walden |
| Do not use writePictureTo in your program. However, you need to save your image so that you can upload it to the gallery. Do that in the command area. My suggestion is to make a copy of the image file you are using first (e.g. by copying it to another folder or by duplicating it): Then, if you type something like the following commands in the command area (your file names and picture names will vary): myPictureFileName = pickAFile() , theActualPicture=makePicture(myPictureFileName) and then posterizeMe(theActualPicture). You can subsequently say writePictureTo(theActualPicture, myPictureFileName). This will overwrite your fle with the changed version (which is why you have to make a copy first!) You can then upload that. Colin Potts |
| Are you repainting the picture? If you are perhaps, you should see a TA at his/her office hours.Toni Walden |
| Do NOT use webwork to turn in your homework! We are using Sakai now, so please use that to turn your assignment in :)! Toni Walden |
| (1) Don't. (2) If you do, and (confession) I did this myself initially, dig in your email to find the message. You should save messages like this to a folder rather than delete them. (3) If you changed your password to something personally meaningful and then forgot what that was, and (confession) that's what I did, and really can't remember, send a message to Brittany to get a new password. She can't do that herself, but we will forward requests to CETL. (4) In the meantime, send your homework by email to your TA and explain why. Colin Potts |
| You can complete the extra credit later since you don't need to use Sakai anymore. Just make sure to post the picture before the deadline on the coweb - Bobby Mathew |
| By "the actual address of the pic" I think you mean the path to the file containing the picture. A file name is not a picture. You need to make a picture and pass that to posterizeMe Colin Potts |
| I'm not sure what you are doing, here. Follow the instructions I posted above in answer to a very similar question about making a backup copy and then overwriting the file that you made the picture from. Colin Potts |