[Courses] [Ruby] Lesson 0: Installing, References, and your first homework assignment]

chantal at antenna.nl chantal at antenna.nl
Tue Jan 3 17:18:25 EST 2006


Hi Laurel, sorry for the late reply, here's what I have so far, I started on the
bonus question but it's not finished yet :-)

1. Defining classes: photo gallery. Think about what classes you
would need to define to write a web photo gallery application. For
now, don't think of the actual implementation details of handling
web requests, displaying images, etc. Obviously you'll need to
represent a photo. What attributes does it have? What other
objects do you need?
post what you have done)

attributes of a photo are:

- width
- height
- filename
- subject
- date

2. Defining classes: /proc. (This might not be as interesting for
windows users). On unix, the /proc filesystem is a virtual
filesystem containing information about the running processes
(among other things). It contains a directory for each running
process, which contains information about the process, such as the
command line, the amount of memory it's using, etc). <A0>Define a set
of classes to represent the process data in /proc.

every file in the process directories could be considered a class, although I
don't really know what they all mean.
I will pick a few of them to use in the exercise:

- status, I guess the attributes are everything that is listed in the file
/proc/$processid/status
- cmdline, its attribute is the (current?) init level
- statm,  The status of the memory in use by the process, its attributes:
         Total program size, in kilobytes.
         Size of memory portions, in kilobytes.
         Number of pages that are shared.
         Number of pages that are code.
         Number of pages of data/stack.
         Number of library pages.
         Number of dirty pages.
(I found some info about the proc dir here:
http://www.redhat.com/docs/manuals/enterprise/RHEL-3-Manual/ref-guide/s1-proc-di
rectories.html)

Chantal

----------------------------------------------------------------


More information about the Courses mailing list