December 07, 2006 4:53 PM

Session 28

Today we wrapped up the course.

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.


Posted by Eugene Wallingford | Permalink | Categories: Sessions

December 05, 2006 2:42 PM

Session 27

Today was a day of review. We listened to some wonderfully doctored voices from Homework 5. Then we looked at Exam 2. The scores were much lower than I expected, which means that I almost certainly misjudged what we had prepared you to do well. Don't worry too much about those low scores -- I will take the results from Exam 2 into account when I assign grades at the end of the semester. Finally, we closed our review by looking at Homework 7, especially some very cool images produced by you all with your graphics interpreters. My discussion of the solutions focused on how we can use helper methods to make our interpreter more flexible. If the code for drawing circles and squares is implemented in separate methods, then we can call them as a part of other helper methods. The result can be some rather interesting commands that are implemented in terms of simpler commands!

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.


Posted by Eugene Wallingford | Permalink | Categories: Sessions

November 30, 2006 2:10 PM

Session 26

Today we turned our string and file skills to a practical media computation task: the generation of a web page. The pages we create are "dynamic" in the sense that they rely on content that changes: the comic strip on a web page out on the web, and a randomly-selected quote from a file of quotes.

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.


Posted by Eugene Wallingford | Permalink | Categories: Sessions

November 28, 2006 1:01 PM

Session 25

The main event today was our second exam. We spent the first few minutes learning how to create a double-clickable application (with a custom icon, no less!) for a Java program. We used our FoxTrotDownloader from last session as our demonstration program. You can follow along with the discussion on this tutorial page.

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.


Posted by Eugene Wallingford | Permalink | Categories: Sessions

November 21, 2006 2:39 PM

Session 24 -- Files and Objects

Being the last day before our second midterm, and the last day before a well-deserved break from classes, we mostly wrapped up some details today. We explored reading text files, and saw that the process bears a similarity to writing text files. We fiddled a bit more with strings and e-mail addresses, too.

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!


Posted by Eugene Wallingford | Permalink | Categories: Sessions

November 16, 2006 2:10 PM

Session 23

Today, students laughed at me for being old. But I don't feel too bad. I am just glad that you all know how to make .zip files!

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.


Posted by Eugene Wallingford | Permalink | Categories: Sessions

November 14, 2006 4:18 PM

Session 22

Today, we extended our Die class to produce a sequence of unique values. Along the way, I hope we learned a bit about designing a method to perform a task with several layers of complexity.

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.


Posted by Eugene Wallingford | Permalink | Categories: Sessions

November 09, 2006 2:58 PM

Session 21

Today, we learned some new Java (Random) and wrote another class (Die). Along the way, discussed class features and class design. By the time we reached our final version of Die, we had created a useful and flexible kind of object and a main() method that exercises it. We learned why and how to write a main() method.

We then moved on to the idea of a file. Along the way, we looked at the idea of javadoc and generated javadoc for our DiffSound and Sound files -- check out the result. Take a look at the javadoc for the Random class at the Java 1.4.2 javadoc site; you can find Random by scrolling down to java.util and finding it on that page, or click on All Classes link at the top of the page and scroll down to Random. The javadoc we generated for DiffSound and Sound looks just the same as Sun's!

Next time, we will look at files in more detail and start to generate text files for use on the web. We may even see Elvis Presley and George Carlin again!

Here are the slides (PDF) I used and a script of some of our Dr. Java interactions, including some material we didn't quite reach today. We'll use them next time. In addition to the Die class, we also just began to look at a new DiffSound class that knows how to write itself to a file.

For next time, finish reading Chapter 12 of the textbook.

Note 1. Recall that we pushed our first exam back one week, which means that we will want to pushd our second exam back a week, too. Exam 2 was originally scheduled for next Tuesday, November 14. We will not have the exam then; it will not happen until (at least) Tuesday, November 21.

Note 2. Your next homework assignment will be posted within a few minutes. Really!


Posted by Eugene Wallingford | Permalink | Categories: Sessions

November 07, 2006 2:33 PM

Session 20

Today, we spent a little more time discussing encoding and compression. We developed code that demonstrates how pixels are often represented, using a single int to encode three integer values in the range [0..255]. Then we implemented a decompress() method for our DiffSound objects and found that our compression is lossy but results in spoken sounds that can be understood.

Here are the slides (PDF) I used and a script of some of our Dr. Java interactions, and the files we produced:

  • a Pixel class that knows how to encode and decode itself,
  • a DiffSound class that now knows how to decompress itself, replete with javadoc comments, and
  • a version of Sound that compresses sounds more faithfully.

You can check out the javadoc generated automatically from the comments in Sound and DiffSound. We'll look at that briefly at the top of our next session.

For next time, begin reading Chapter 12 of the textbook. And watch for your next homework assignment -- I plan to post it no later than tomorrow morning bright and early!


Posted by Eugene Wallingford | Permalink | Categories: Sessions

November 02, 2006 3:10 PM

Session 19

Today, we returned manipulated sounds, but we did not play them. Instead, we did processed sounds as big arrays of sample values. We focused on how to store a bosy of data in less space, which is known as compression. We wrote our own algorithm for compressing sounds and then created a new kind of object to represent our encoding: DiffSound.

Here are the slides (PDF) I used and a script of some of our Dr. Java interactions, and the files we produced:

Read Chapter 10 of the textbook for our next session. I should have your next homework assignment ready by then.


Posted by Eugene Wallingford | Permalink | Categories: Sessions

October 31, 2006 2:14 PM

Session 18

Welcome back! Oh, wait, I am the one who returned. It's good to see you all again.

Today, we returned to playing with sounds, especially the additive behavior of sounds waves. Adding sound samples arbitrarily doesn't do much for us, but using variations on the theme leads to interesting effects, like blending, chording, and echoes.

Here are the slides (PDF) I used and a script of some of our Dr. Java interactions, and the Sound.java file that we produced.

I didn't tell you much about my week at OOPSLA, today, but we will have an opportunity to discuss some of my activities next week, when we step back from images and sounds to talk about our programs at a higher level.

As is now our pattern, please take a pair of headphones with you to the lab tomorrow, if you have them.

Finish reading Chapter 10 of the textbook for our next session. Your next homework assignment won't come out until then.


Posted by Eugene Wallingford | Permalink | Categories: Sessions

October 19, 2006 2:28 PM

Session 17

Today, we played a lot with sound, including generating some mathematical curves and listening to them as sounds and answering some open questions from past sessions. Here are the slides (PDF) I used and a script of some of our Dr. Java interactions, and the Sound.java file that we produced. You can also have the recordings of my own voice via this zip file.

Recall that we do not have class next week, as I will be on the road at OOPSLA, the best conference around on programming and programs. (Check out who's in charge of the tutorials track...)

You can use the open class time to study, program, or catch up on lab exercises. TA Mike Volz will hold lab hours during our regular class time, 12:30 PM-1:45 PM on Tuesday and Thursday, in 339 Wright. He can answer questions and generally help you catch up or move forward. His lab schedule for the week will be:

  • Monday, 6:30-8:30
  • Tuesday, 12:30-1:45
  • Wednesday, 2:00-3:30
  • Thursday, 12:30-1:45 and 6:30-8:30

You will have lab as usual -- don't forget to take a pair of headphones with you if you have them.

Read Chapter 10 for our next session, October 31. And solve Homework 5 -- it is due on Halloween as well!

I'll be in e-mail contact next seek, so drop me a line. I'll try to enjoy rainy Portland, Oregon!


Posted by Eugene Wallingford | Permalink | Categories: Sessions

October 17, 2006 4:17 PM

Session 16

Today, we discussed a solution to Homework 4 and then moved on to more sound manipulation, including "posterizing" (with sound, known as "clipping"), making a sound clip, and increasing/decreasing a sound's volume in a linearly increasing/decreasing way.

Here are the slides (PDF) I used and a script of some of our Dr. Java interactions, and the Sound.java file that we produced. You can also have the recordings of my own voice via this zip file. Now, if you ever feel the need to hear my soothing voice, you can -- speaking through Dr. Java or your own mp3 player!

Read the rest of Chapter 9 for our next session. And don't forget to take a pair of headphones with you to the lab tomorrow.


Posted by Eugene Wallingford | Permalink | Categories: Sessions

October 12, 2006 2:10 PM

Session 15

Today, we discussed some basic operations on sounds, and learned that our -- well, at least my -- intuitions about how sound works are not so good. We reminded ourselves of something we learned last time, intellectually at least: that human perception of sound is about ratios, not absolute values. Experimentation will help all of us develop better instincts.

Here are the slides (PDF) I used and a script of some of our Dr. Java interactions, and the Sound.java file that we produced.

Read the first half of Chapter 9 or so for our next session. Again, notice how much of the Java we use for sound processing resembles the Java we wrote to process images.

And keep working on Homework 4, which is due next Tuesday, 8 AM.


Posted by Eugene Wallingford | Permalink | Categories: Sessions

October 10, 2006 3:56 PM

Session 14

Today, we finished off our main discussion of images with a quick look at "chromakey", or the use of background subtraction to replace the background of a picture. Then we moved onto our next unit -- sound -- and considered both same basics of representation and some Java. Oh, and we discussed the results of the first exam a bit.

Here are the slides (PDF) I used and a script of some of our Dr. Java interactions. We used three different Java files today, a Picture class with code snippets from the exam, a Picture.java file for chromakeying on blue, and a Sound.java for learning some basic sound manipulations -- and two bonus methods by yours truly.

Read deeply into Chapter 8 for next session. Notice how much of the Java we use resembles what we wrote for manipulating images! Be sure to play with the code as your way to understand the encoding of sound samples.

And keep working on Homework 4, which is due a week from today. It should be fun -- and even has opportunities for extra credit!


Posted by Eugene Wallingford | Permalink | Categories: Sessions

October 05, 2006 2:27 PM

Session 13

Today, we played a bit with loops and their control elements. Our coolest product was a method to draw blank Sudoku grids. At this point, the method uses hard-coded values. A great exercise for your home study is to parameterize the method so that it can create grids of any size!

Here are the slides (PDF) I used and a script of some of our Dr. Java interactions. We produced a version of Picture.java that creates this sort of blank grid. (I also showed you a quick-and-dirty program to turn numbers of seconds into strings. Use at your own risk!)

Begin reading Chapter 8 for next week. We may spend a few minutes looking at Chapter 6 chromakey technique, but we are ready to move on to processing sound!

Homework 4 is available now and will be due a week from Tuesday. It is worth a few more points -- and will take a bit longer than our previous assignments. So don't use the later deadline as an excuse to delay your start...


Posted by Eugene Wallingford | Permalink | Categories: Sessions

October 03, 2006 2:11 PM

Session 12

The main event today was our first exam, but we did spend a few minutes talking about Homework 3 and a lesson a few of you learned about just how long a seemingly simple method can take. As usual, I have these materials for you from class: the slides (PDF) I used and a script of some Dr. Java interactions, and a version of Picture.java that we used in our exercise.

In the lab tomorrow, you will work with some of the fun graphics material from Chapter 7. In class on Thursday, we will talk about one remaining idea from Chapter 6 -- greenscreening -- and wrap up a bit of graphics. Next week, we will move on to processing sound!

With Homework 3 due today and Exam 1 today as well, I'll give you a short break from programming. Homework 4 will probably come out on Thursday.


Posted by Eugene Wallingford | Permalink | Categories: Sessions

September 28, 2006 2:24 PM

Session 11

Here are all the materials we used today in class, available for you to use as you study:

For next time, study for our firsty exam. It will cover all the material we've seen in class and in the textbook through Chapter 6.

Don't forget Homework 3, which is due at 8 AM on Tuesday! Start sooner, rather than later, and ask questions as you run into them...


Posted by Eugene Wallingford | Permalink | Categories: Sessions

September 26, 2006 2:12 PM

Session 10

Here are all the materials we used today in class, available for you to use as you study:

If you'd like to read more about edge detection and computer vision, check out this web page that describes some neat little applications.

For next time, read the rest of Chapter 6.

Oh, and keep an eye out for Homework 3, which will appear on-line by day's end and be due at 8 AM on Tuesday.


Posted by Eugene Wallingford | Permalink | Categories: Sessions

September 21, 2006 2:18 PM

Session 9

Here are all the materials we used today in class, available for you to use as you study:

For next time, read the first half of Chapter 6.

Oh, and work on Homework 2, which is due at 8 AM on Tuesday!


Posted by Eugene Wallingford | Permalink | Categories: Sessions

September 19, 2006 3:22 PM

Session 8

Here are all the materials we used today in class, available for you to use as you study:

For next time, be sure that you have read all of Chapter 5. If you have any questions, be ready to ask.

And watch for Homework 2, which I'll post soon and make due at 8 AM next Tuesday.


Posted by Eugene Wallingford | Permalink | Categories: Sessions

September 12, 2006 3:21 PM

Session 7

The notes for Session 07 are now available. As always, work through them carefully, paying special attention to the Java we wrote involving arrays and loops.

I have also posted a second chance for Homework 1, giving you until 8:00 AM to submit or re-submit any files for the assignment. Take advantage of this chance to overcome any problems you had with the submission system, or any problems you had with your solutions. You are free to ask me, Prof. Schafer, or the TAs for help.

Remember: We do not have class on Thursday. Instead, there is an optional help session with Prof. Schafer (usual time, usual place) where you can ask any questions you have at this point in the course, but especially those related to solving Homework 1. This might involve the Java itself, or the mechanics of using Dr. Java or the submission system.

I will see you again in class next Tuesday (unless you stop by to see me during office hours...).


Posted by Eugene Wallingford | Permalink | Categories: Sessions

September 07, 2006 3:37 PM

Session 6

I do not have a separate HTML file for today's session, but I do have all the materials we used today in class available for you to use as you study:

For next time, read the first half of so Chapter 5.

And, of course, do Homework 1, which is due 8 AM on Tuesday. If you have any questions, including about the submission system, please let me know as soon as possible! (Monday night is probably too late for me to be of much help...)


Posted by Eugene Wallingford | Permalink | Categories: Sessions

September 05, 2006 4:23 PM

Session 5

The notes for Session 05 are now available. As always, work through them carefully, paying special attention to the new Java we have learned for arrays and loops.

I have also posted Homework 1, which is due one week from today at 8:00 AM. (That deadline is for the on-line submission; the hardcopy is due at class time the same day.)

This is your first chance to "fly solo", though as I said last time you won't really be flying solo. You have me, your classmates (via the mailing list), Prof. Schafer, and the lab assistants to help you. Be sure to use these resources early and often!

For next time, be sure to finish Chapter 4 in Guzdial & Ericson. Come to class prepared to ask any questions you have about the chapter.


Posted by Eugene Wallingford | Permalink | Categories: Sessions

August 31, 2006 2:51 PM

Session 4

The notes for Session 4 are now available. Work through them, especially the code. Dr. Java can help you learn a lot, and the experience you gain will prepare you for writing your own code in the coming weeks.

With Labor Day weekend upon us, I will not assign an program for you to write just yet. Next session, I will assign Homework 1, which will be your first chance to "fly solo". Of course, you won't really be flying solo, as you'll have me, your classmates (via the mailing list), Prof. Schafer, and the lab assistants to help you. Be sure to use these resources as you need them!

For next time, read Chapter 4 in Guzdial & Ericson.


Posted by Eugene Wallingford | Permalink | Categories: Sessions

August 29, 2006 3:49 PM

Session 3

Kurt Vonnegut, Jr.

How many of you have computers at home? Most of you do. If you do, you should definitely install the software on the CD that came with your book. All of the programs and code that you will need this semester are on that CD. So are detailed instructions for installing and setting up everything. If you need any help or have suggestions for overcoming problems, send them to the class mailing list, 810-061-04-fall@uni.edu.

Today we began to learn a little Java, in terms of its primitive data, the ways that you can create compound expressions, and the ways that we can abstract detail away from data in terms of a variable. The big ideas we saw were names and trade-offs (among different representations).

Here are the slides I showed in class, and here is a script of some of the Dr. Java interactions we considered. The interactions with Picture require that you have this Picture class from Session 2.

As an interlude during the lecture, we re-considered the survey (PDF) you filled out last session. Here is a tabulation of your answers to the quantitative questions and to the qualitative questions. Some of my favorite answers were...

  • What are your expectations for faculty at UNI -- how do you expect us to be similar to or different from your best (or worst) teachers in HS?

    "I expect UNI faculty to reduce my HS instructors to jabbering idiots."

  • Name up to three famous Computer Scientists...

    Eugene Wallingford -- It's too early to suck up this hard.

  • Write the year in which you think each of the following items first appeared.

    abacus: 1971
    four-function calculator: 1989
    telegraph network: 1994
    commercial radio: 1970
    commercial TV: 1979

    ... The world is a much older place than some of us realize!

  • Name a favorite ... book.

    Cat's Cradle -- That's my favorite book, too!

  • Name a favorite ... musician.

    Jimmy Buffett

  • What question did I leave off this survey that you would most like to read answers to, from all the other CS I students?

    What would you do if you knew that you would not fail?
    If you could write a program for anything, what would you write?

    I would like to hear the answer to these questions, too. Another question I thought to ask: What is the first program that you wrote out of passion?

I even gave some of my answers. Other than what I have revealed here, you'll have to go from memory...

For the lab tomorrow, be sure that you have read through Section 3.4 in the textbook.


Posted by Eugene Wallingford | Permalink | Categories: Sessions

August 25, 2006 4:54 PM

First Week's Session Notes

I like to post the notes I use in class for you to read and review. For some of my older courses, I have created quite complete and elaborate lecture notes. But this course is new, so my lecture notes will usually be less complete. Still, I will post what I have, including PDFs of slides, code, pictures, and any other notes I can write up for you.

I've just uploaded notes for Session 1 and Session 2. They are incomplete -- in particular, I don't yet have all of the steganographry talk ready to post -- but I hope they help you as you review the course.

Let me know if you find any typos or other errors. I'll fix them as we find them...


Posted by Eugene Wallingford | Permalink | Categories: Sessions