Good luck in CS II or wherever next semester finds you. I'd love to hear from you as you continue your studies at the university.
And please do stop by to pick up your final exam. Those things take up a lot of space in my file drawer!
]]>We looked at an images page generator and then extended it to post real thumbnails produced by our own Picture class.
Then I closed the circle on the course by demonstrating a very simple steganography program, implemented using a Picture class augmented with hide() and recover() methods. This code is far from bulletproof (hide() can create an RGB value out of the range 0..255, and recover() tries to read from pixels that do not hide text), but it shows the idea well -- and serves as a great place for you to jump off on your own programming fun!
I closed with a short presentation of some key Big Ideas from the course this semester. Media computation is a useful end in its own right, but we also saw many of the most important ideas from CS, including representation, algorithm, and layers of abstraction.
Here are the slides I used today, along with a script of some of my Dr. Java interactions.
Our next time together is the final exam, at 3:00 PM next Thursday, December 14. It will cover material from both midterms and a bit of Chapter 13 that didn't make it onto Exam 2. Same format, somewhat longer (but nowhere near twice as long, though you'll have twice as much time).
Homework 8, is due Saturday afternoon. Though I'll be out of town most of tomorrow and all day Saturday, I will be within e-mail reach, so feel free to send your q$a.uestions Electronic submission only, no print-out required.
]]>I planned to show you a web page generator for an images thumbnails page, but I managed to delete it before getting to class. Then I couldn't find it. That's how the day went... Of course, upon returning to my office, I found it: ImagePageGenerator.java. Take a look at it before next class. Run it, using the path to your mediasources directory, and see the web page it generates right into your mediasources directory. Here is the index.html that the program generated for my mediasources directory.
The ending of the day was perfect: In what was either the stupidest move of my teaching career or a sign of great boldness and confidence -- and trust in you -- I closed this session with stduent evaluations. I doubt you'll encounter many other professors who will return an exam with an average grade of 43% and do student evals the same day!
Here are the slides I used today when discussing the exam questions. Study those questions and solutions!
For next time, read Section 13.3 and study the images-page generator class. And don't forget Homework 8, which is due Saturday afternoon. Yes, Saturday afternoon -- electronic submission only, no print-out required.
]]>If you have ideas of other features that you would like to add, just ask!!
Additionally, you may also modify the existing methods of the generator to rearrange the page, change its presentation, etc. (Such changes won't count toward your assigned quota of two unless they are substantial and I approve them as such in advance.)
This assignment is worth 20 points.
Extra Credit Opportunities
Add more than two new features... (2 points)
Any other ideas?
Deliverables
By the 4:00 PM on Saturday, December 9, submit a zip file of a directory that contains these files:
For this assignment, you do not need to submit a printout. We will grade from the electronic submission alone.
]]>You can download all the material from class -- sample web pages, the Java programs, and the quotes file we used -- in this .zip file.
For next time, read Chapter 13 and study the PageGenerator class. And don't forget Homework 7, which is due tomorrow afternoon. You can bring the print-out to 305 ITT, the department office, any time. If I'm in, you can bring it on back; otherwise, the secretary will put it in my mailbox.
]]>In class on Thursday, we will begin our discussion of generating web pages to complement our image and sound files. Be sure to read the first half of Chapter 13 to prepare.
Don't forget that Homework 7 is due on Friday afternoon. We will have one more assignment this semester, running from this Friday to the last day of classes.
]]>The method should create a blank 640x480 picture on which to drwa.
There are at least three kinds of commands:
The line command draws a straight line. For example, "line 10 20 300 400" draws a line from (10, 20) to (300, 400).
The circle command draws, yes, a circle. For example, "circle 100 200 50" draws a circle whose center point is (100, 200) and whose radius is 50.
This assignment is worth 20 points.
You can use this main method for your class:
public static void main( String[] args ) { GraphicsInterpreter artist = new GraphicsInterpreter(); String filename = FileChooser.getMediaPath( "commands.txt" ); Picture p = artist.interpret( filename ); p.show(); }
Extra Credit Opportunities
Make it so that we can initialize a GraphicsInterpreter with a particular picture. If the object is created with a picture, then it draws on the given picture. If not, it uses a blank canvas. (1 point)
Create a commands.txt file that produces a picture that does something useful. For example, I could imagine a sequence of commands that create a poster to advertise a meeting. (1 point)
Deliverables
By the 4:00 PM on Friday, December 1, submit a zip file of a directory that contains these files:
For this assignment, you need to submit only one printout -- GraphicsInterpreter.java.
]]>Here are the slides (PDF) I used and a sanitized script of some of our Dr. Java interactions. We produced several classes: Student, StudentReader, and ProspectReader.
For a little bonus, I offered a program that reads not text, but an image, and not from a file, but from a URL! I don't expect you to be able to write this kind of code, especially the method that reads and writes the image. But you should be able to see some familiar structure in the code. If you want to have fun with web sites of your own choice, then do! Here is my FoxTrotDownloader.
For next time, prepare for the exam. It will focus on material since the last exam through Chapter 12 of the textbook.
Homework 7 will be posted in a matter of minutes!
]]>We expanded on our Die class example from last time to create a PowerBallEntry class. Why write a lot of code in a main() when we can create an object with that behavior? In Computer Science II, you will learn that there are great reasons to put all of your behavior in objects! For now, we see just one: it is a lot easier to reuse the behavior when we can create an object that does it.
From there, we ran one last test, to demonstrate just how hard it is to pick a winner in Powerball... Run EasyWinner -- but don't be in a hurry; it will probably take a while.
Finally, we began to explore splitting strings using a Student class. We left an open question: emailDomain() works for "@cs.uni.edu" but not "@gmail.com". Your job: fix it!
Here are the slides (PDF) I used and a script of some of our Dr. Java interactions.
For next time, start reading Chapter 13 of the textbook. Our second midterm exam will be Tuesday, November 28 -- a week from our next session, and the class day after Thanksgiving. Homework 7 will be posted next session.
]]>We then revisited a method for DiffSound that writes the object to a file. It exposed many of the elements of writing files in Java -- which we will soon do much of, when generating web pages!
Here are the slides (PDF) I used and a script of some of our Dr. Java interactions. In addition to the Die and DiffSound classes, we also produced a simple program to mirror a String.
For next time, finish reading Chapter 12 of the textbook.
Note 1. Our second midterm exam will be Tuesday, November 28 -- the first class day after Thnaksgiving.
Note 2. Your next homework assignment is due next time.
]]>