Dropping Out

September 13, 2011

Read the following articles: Who Needs College? The Triumph of Young Web Founders and Thiel Awards 24 Under-20 Fellowships.

  • Make up a metaphor for the decision to drop out of college to pursue a business idea.
  • Would you accept Thiel’s offer of $100k?
  • Is college worthwhile, even though we hear many success stories of dropouts? Explain.

Post your answers in the School Loop discussion.

Lab 4: Jukebox

September 13, 2011

In this lab, you’ll create a Jukebox (and JukeboxTestDrive) class that holds information about songs. Read more »

Quiz Friday

September 13, 2011

Date: Friday, September 16.

Covers: HFJ Chapters 1-2. Labs 1-3. Lectures 1-4.

Topics: all previous concepts, arrays, methods and return types, Math.random().

Beyond MouseX

September 13, 2011

File > Examples > Basics > Input > MousePress

This example demonstrates that the mousePressed variable is automatically set for you, much like the mouseX and mouseY variables that we already know of. However unlike mouseX and mouseY which are numeric values, mousePressed is a boolean value. This means it is equal to either true or false, and can be used directly to control code within an if statement.

Pick up from Mr. Chun’s pickup folder: LineDragger (or download LineDragger.pde).

Play around with this sketch by clicking and dragging and moving the mouse. Be sure you notice the behavior of both the red and blue lines when you keep the mouse still. Then read the code and respond to the following in an email to Mr. Chun:

  1. Describe the behavior of the red line and the blue line in terms of mouse gestures (press, release, move, and drag).
  2. Why do the colors fade when you keep the mouse still?
  3. Why do the colors return to brightness when you move the mouse again?
  4. When we move the mouse, normally there’s a blue line. But we don’t see a blue line at all when we’re dragging. How come?
  5. Find the line in mousePressed() that says nowDragging = true; and comment it out. Then click and drag out a line while holding the mouse button down for an extended amount of time. Describe and explain the behavior you see, being sure to mention what this tells us about mouseMoved().

Hint: Experiment! By changing the code, you can confirm any ideas you have about how it works. We put the science in computer science!