CSC151.01 2015S, Class 05: Drawings as Values
=============================================

* Continue partners!

_Overview_

* Preliminaries.
    * Admin.
    * Upcoming Work.
    * Extra Credit.
    * Questions.
* Preparation
* Lab
* Reflection

Preliminaries
-------------

### Admin

* Office Hours:
    * Normally: 10:00-11:00 MTWF, 3:15-4:00 M (may change)
    * Currently booked: Tu 10:15-10:30, 10:45-11:00, F 10:00-11:00
    * Reserve a slot at <https://rebelsky.youcanbook.me/>.
    * Also feel free to try to visit during unbooked times or open times
      <http://www.grinnell.edu/~rebelsky/schedule.html>.  Note that I may
      be busy with other things during open times.
* Next Monday, I hope to have virtual machines available for you to use
  on your computers.  (Unless you use *nix, you can'd just download DrRacket
  and GIMP and hope they will interact.)

### Upcoming Work

* [Assignment 2](../assignments/assignment.02.html).
    * Due TONIGHT at 10:30 p.m.  
* Assignment 3 to be distributed tomorrow.
    * Plan: Wednesday/Friday partners will also be your HW partner.
* Lab writeup for lab 4, due Wednesday at 10:30 p.m.: Problem 2, parts def.
  <http://bitly.com/151-2015S-lab04>
* Lab writeup for lab 5, due Thursday at 10:30 p.m., Problem 4:, parts ace.
  <http://bitly.com/151-2015S-lab05>
* Readings for Wednesday:
    [Writing Your Own Procedures] (../readings/procedures-reading.html) and
    [How Scheme Evaluates Expressions (Take 2)](../readings/scheme-eval-2.html)

### Extra Credit Opportunities

#### Academic 

* Friday, 12:10 p.m., JRC 224A (Day PDR), CS Table, To be determined. 

#### Peer Support (Morning Section)

* Swimming, Friday, January 30, 6:30 p.m., Osgood Natatorium
* Swimming, Saturday, January 31, noon, Osgood Natatorium
* Julia's radio show, "The Hot Box".  This week's theme is 
  "Transportation/Leaving".  Wednesday night/Thursday morning 
  1:00-2:00 a.m. 

### Recommended Events (no EC unless mentioned above)

* Women's Basketball, Tuesday, 5pm, New Darby
* Belly Dance Club, to be scheduled
* Salsa Club, Tuesdays at 7pm and Saturdays at 2pm
* Meditation group, Wednesdays at 9:00 and Sundays at 4:00 in CRSSJ
* #OneGrinnell, Wednesday, February 4 at 4:15 p.m.

### Questions

_You briefly mentioned this in one of the readings, but when using these procedures with inexact numbers, Scheme generates a seemingly random, large value. For instance, `(denominator 2.1)` generates `2251799813685248.0`. Why does this 
happen?_

> They aren't random.  They are just strange.  Scheme represents every exact number as a sum of up to about 53 powers of two.  So, 2.1 is 1x2^1 + 0x2^0 + 0x2^-1 + 0x2^-2 + 0x2^-3 + 1x2^-4 + 1x2^-5 + ....  Alternately, you can think of that as 1x2 + 0x1 + 0x1/2 + 0x1/4 + 0x1/8 + 1x1/16 + 1x1/32 + 0x1/64 + 0x1/128 + .... The lcm of those denominators is 2^51, or 2251799813685248.0.

_What should we know about `modulo`_

> In general, you can think of `modulo` as a procedure you use when you
  want to get a "cycle" of values.  The basic cycle is 0 1 2 ... n-1 0 1
  2 ... n-1 0 1 2 ....  But we can add to those values to get different
  cycles, so you can just think of it as "cycle of length n".

_Why is a unit circle diameter 1 rather than radius 1?_

> So that it's similar to the unit square?

> Bad design on Sam's part.

Preparation
-----------

* If you haven't done so already, run `/home/rebelsky/bin/csc151-setup`
* After `#lang racket`, use `(require gigls/unsafe)`.
* In GIMP, start the DBUS server.
* Click "Run" and cross your fingers.

Normal preparation

* Two minutes.  Introduce yourself to your partner.  Discuss reading.
  Identify: Questions and Key points

Key Points

* You can manipulate images in multiple ways: Shift, Resize, Color, Combine,
  and lots of other stuff to go with that.
* You can shift drawings.  Doing so changes the positions of the edges of 
  the shape, which you can see in the textual representation.

Lab
---

The carriage return (enter key) can be your friend

    > (define sample-ellipse 
        (vshift-drawing
         1
         (hshift-drawing
          2
          (vscale-drawing
           3
           (hscale-drawing
            5
            drawing-unit-circle)))))

Reflection
----------

* Remember: Inside-out ordering
