Assignments
- for Tues Sep 9
- Read Neal Stephenson's article
In the Beginning was the Command Line
- Read at least chapter 1 in the text.
- Visit the monastry
and browse around.
- If your existing expertise allows, try to follow the
instructions in chapter 1 to enter and
run "Hello World" program. I'll talk in class
about how to do this in several ways: on our campus server (akbar),
on a lab PC or Mac, or on your own computer. There
are some links at the bottom of this page to Perl and some
editors which may help.
(Don't worry if this doesn't come together yet; it will.)
- Send me
(mahoney@marlboro.edu))
an email that says
- that you're in this class,
- how successful you were with "Hello World",
- what kind of computers you've used (windows, mac, linux, ...)
- what sorts of things can you already do on a computer.
- for Tues Sep 16
- Finish reading chapters 2 and 3 in the text.
- Type in (or find online) the mathq program described in chapter 3.
Run it. Add some print statements to see what it's doing.
- Modify that program, either as you see fit or following
the exercises at the end of chapter 3. Comment what you've done.
Send me the result, including a sample of what it looks like
when it runs.
- Start in on chapter 4 in the text; I'll be talking about that
next Tuesday.
- for Tues Sep 23
- Read chapters 4 (data types) and 5 (control structures).
- Do exercises 1 and 2 at the end of chapter 5, on pg 97.
- Finish one of the two programs I started, either
(This assignment was difficulty for many folks; feel free to work on
it through this week and give me what progress you have.
Remember to include comments for what parts do or don't work.
Getting pieces to work is better than nothing - the point is
to better with practice, eh?)
- for Tues Sep 30
- Read chapters 6 (input) and 7 (subroutines). We won't be doing
as much as Johnson does with regular expressions at this point.
- Do exercise 1 in section 6.6, pg 120. That is, write a program
that reads in a file like
mahoney:27
fred:30
mahoney:22
and generates a report like
User: mahoney
Total: 49
User: fred
Total: 30
A sample input file is at perl/input_for_sep30.txt.
- If you're inspired to look more at loops and conditionals,
write a program that sorts a list of numbers. (There are many
algorithms to do this. I'm not looking for a PhD thesis, just
a nested loop that pulls out the smallest values one by one
and builds up an ordered list.)
- for Tues Oct 7
- Read chapter 7.
- Go back over anything you've done this semester,
and re-write it using subroutine calls. (Due Thurs)
- Do exercises 1 and 2 on page 140. (Due Thurs)
- TAKE HOME TEST out Fri,
due Tues 8:30am.
- for Tues Oct 14
- Read chapter 8, on references. Skip 8.3
(function pointers and closures); it's more technical than
we want right now.
- Do exercise 1 on page 159.
- Start one of the following programming projects, due on
Thurs Oct 23 (Mon/Tues 20/21 are Hendricks Days).
(That's two weeks away.)
The final version will be graded.
You should include documentation, tests,
and sample input and output. I'll expect a
progress report next Tues on the 14th. (Please don't leave this until
the last minute; it's going to take some time.)
- Tues Oct 21 - Hendrick's days
- for Tues Oct 27
- Start reading chapters 10 and 11 on regular expressions.
- Optional: try some of the exercises.
- for Tues Nov 4
- Finish reading chapters 10 and 11.
- Browse the regular expressions tutorial, quick start, and reference
pages in the perl manual at perldoc.com
- Do at least two of the exercises from the end of chapters 10 and 11.
- for Tues Nov 11
- Read chapter 14, on modules, if you havn't already.
- Pick another project, and jump in.
It'll be due before thanksgiving.
If the tic-tac-toe felt unfinished but kind of interesting,
you could pick another game and try that. We'll be starting to
talk about web programming, so you could try something along those lines.
Feel free to use any of the CPAN modules - with thos in hand, for
example, you could write a web spider. Talk to me for other ideas.
I want to have presentations in the week before Thanksgiving, so start
early.
- Download, install, and try out at least one CPAN module of your choice.
If nothing jumps out at you, try LWP::Simple. If you can't get
it to work on your machine, talk to me for help, and/or get an
account from me to run some interesting modules on cs.marlboro.edu
- for Tues Nov 18
- The textbook chapter on Objects (18) isn't great, but
browse through that for a start.
- Please read through the online documentaion
perlboot, perltoot, and perhaps
perlobj, perltooc, and perlbot. You can find this
at
perldoc.com
among other places.
- Write a short object oriented application that has objects ParkingLot,
Vehicle, Car, and Truck. At a minimum these classes should each have
(a) some internal data, and (b) some methods to edit and display
that data. Both Car and Truck should inherit some methods from
Vehicle. ParkingLot should be a place to put Vehicles, some of
which are Cars and some of which are Trucks. Write methods that
allow you to add a Vehicle to the lot, and that get each vehicle
to describe itself. Vehicles should have (a) license plates,
and (b) should identify themselves as cars or trucks.
If you aren't getting anywhere with this, I'll define a more specific
API; for now, see if you can set something up along these lines
using an object oriented framework.
- Work on your projects.
- for Tues Nov 25
- Work on your projects, due by Wed Nov 26.
- Please be ready to show something in class.
(If you send me some email ahead of time, I'll make your
code visible online.)
- for Tues Dec 9
- Read about HTML and CGI from the following two tutorials:
- Create a CGI script on your cs.marlboro.edu account.
How this works will be discussed in class.
- ** FINAL EXAM ** due Mon Dec 15
- online copy is here
- I'll hand it out on the last class, Tues Dec 9.
- Use any books, online static sources, or a perl compiler,
but not other people. If you have questions, ask me.
|
Syllabus
Expect this to change as we go along.
Sep 9, 11 chap 1-3 basic tools, background info, programming style
16, 18 4,5 data types, control loops
23, 25 6,7 i/o, functions
30, 2 8,9 references, documentation, examples * test 1
Oct 7, 9 14 using modules
14, 16 10,11 regular expressions * 1st project
22 15 debugging
23, 30 12 lists and hash techniques * 2nd project
Nov 4, 6 17 classic algorithms
11, 13 web programming * final proposal
18, 20 18,19 object
24
Dec 2, 3 13 more i/o, more examples
9 * final project
|