Lab 1
Setup your computer and your brain

Out September 1, due by start of lab, September 7

Overview

In this lab, you'll prepare your laptop for use with future labs. Think of it as stretching exercises and a warmup for your computer. You'll also stretch and warm up your brain to think about some of the ideas we'll be covering in class this term. Since we've only had one lecture so far, this will be quite a stretch.

For the written part of this lab, you should feel free to talk with your classmates initially, but you should do all writing on your own. The majority of the lab time will be spent discussing your responses, so you must complete the written portion of the assignment before lab. Late assignments will be marked as incomplete.

Concepts

Contents

Pre-Lab

This week's pre-lab consists entirely of a writing assignment. You should think about the question for some time before you start to write. Feel free to discuss it with other students, but make sure that all writing is your own.

Warm-up

All of the questions for this assignment are related to the example of a restaurant we gave in class.

Describe the instructions for a busboy in the restaurant. The busboy is the person (or people) who clean the tables and get them ready for the next customer.

Active kitchen equipment

In lecture, we sketched out a "recipe" for building peanut butter and jelly sandwiches. You were pretty specific about several items, including jars of peanut butter, jars of jelly, loafs and slices of bread, knives, and precisely what to do with them all.

Despite the specificity of the instructions, you noticed some generalizations that we could make about the procedure. Spreading peanut butter on a slice of bread is pretty much the same as spreading jelly on a slice of bread, except for a few details.

How would you generalize the concept of "spreading?" What aspects of the spreading action vary from one act of spreading to another? What aspects remain the same?

In class, your friendly neighborhood alien played the role of the "instruction follower." Each of your instructions told the instruction follower to perform some action with some object. This is how English works, and kitchen utensils are notoriously inert when it comes to following directions. But what if we were suddenly transported to some Disney-esque world where everything sprouted eyes and a personality, and could carry out instructions.

In Disney-ville, the chef could sit back, relax, and tell the peanut butter, knives, and bread what to do.

For spreading, who should the chef command? Should the knife be told to spread the peanut butter on a slice of bread? Should the peanut butter be told to spread itself on the bread using the knife? Should a slice of bread know how to spread something on itself? Does it make sense to have more than one of these be possible?

The instruction follower interacted with several different objects during the demonstration, including knives, slices of bread, and jars of peanut butter and jelly. We've already seen that some things, like the peanut butter and jelly, are similar in terms of how they are used.

With respect to the actions performed on them in the construction of a PB&J sandwich, what quality makes peanut butter and jelly the same? How about individual slices of bread? Is there a quality that makes them the same as each other? How is peanut butter different from jelly? How is one slice of bread different from another?

For each question, write one or two well-reasoned paragraphs describing your thoughts. There are no "right" or "wrong" answers here -- we're looking for good reasoning and ideas, to help you during the discussion portion of the lab.

In addition to your answers, please include the names of the classmates you talked with, and how long it took you to do the problem set.

Because we'll be talking about these questions during lab, you must turn in your written answers to the questions before lab on Wednesday, September 7. You can submit them to sd-psets@lists.olin.edu or if you prefer traditional paper, you can hand them in during lab.

Laboratory

This week's computer-based lab is pretty simple. You'll be setting up your computer for writing, compiling, and running Java programs. While there's not much to this lab, you should get used to reading the entire lab description before you show up, and have a plan for executing the lab once you arrive. You should not actually do any of the computer work until you get into lab.

Integrated Development Environment

Technically, all you need to write and run Java code on your computer is a text editor and the javac and java programs. In fact, this works great for small Java programs. As things get bigger, however, it's nice to have some kind of environment that lets you organize your files, build a project with a single mouse click, highlight your errors for you, help you step through code to debug it, and generally serve as your assistant. Such programs are called Integrated Development Environments (IDEs) and they are generally infuriating until you figure out all their little twists and turns. On the other hand, for large projects, and once you get to know them, they're indispensable.

If you already have an IDE that you're comfortable with, and it compiles and runs Java code, go ahead and use it for this class. If you don't, or if you'd like to follow along with the class and get assistance with the IDE, you should download and install NetBeans.

Downloading and installing NetBeans

  1. Download the latest and greatest of Java, bundled with NetBeans at: http://java.sun.com/j2se/1.5.0/download-netbeans.html.
  2. Install the software. On Windows, this is a double-click. On Linux, see the installation notes for some helpful hints.

That's mostly it. In class, you'll get the URL of a file you can download and unpack that contains a sample project you can compile and run with NetBeans.

If you decide not to go with NetBeans, you should download Java 5.0 (or 1.5, which is the same thing depending on the phase of the moon) to make sure your Java runtime and compiler is up-to-date. Then download the test project and make sure you can get it running in your chosen environment.

Make sure you get checked off as soon as you get the code running. Once everyone is set up, we'll start the discussion.

Post-Lab

There isn't anything required for you to turn in for post-lab this time, because you've already turned in the written assignment at the beginning of lab. For all future labs, you'd be writing up what you did in lab and combining it with the pre-lab exercises. For today, please let us know if you encountered any problems getting NetBeans or Java installed. I'd also like to know what you thought of the discussion.