Comp 2673, Spring 2003
Homework 2
Two topics: Unix and fractal image compression
You may work with one other person on this assignment
Due Monday, April 14, 2003
Unix questions:
- List some consequences of working on a multi-user system (at least 3).
- Compare using a graphical user interface with using a command line
interface by listing some pro-GUI/pro-command line pairs (at least 3).
- Say you create a file on the Sun machines called .format. When you
enter the command
ls
, your new file doesn't show up! What is
going on? How do you see a listing of this file?
- Say you receive email from a Sun user complaining that you are running
a process that is hogging the machine. Explain the exact process you would
go through in response (include the exact commands you would type)
- Say you log onto a machine, run
top
and see that you own
the top process. You didn't even realize it was running and want to kill it.
What do you do?
- True or False: If the Sun lab is very cold and the AC is running full
blast, you should turn it off to save power.
- True or False: If the door to the Sun lab is propped open, you should
close it.
PIFS and fractal image compression/decompression questions:
- Say that our image is 512x1024 pixels, and the range rectangles are
16x16 pixels. How many range rectangles are there? How many domain rectangles
must be compared for each range rectangle? Show your calculations and explain.
- Say we're doing fractal image compressio/decompression using the method
discussed in class. Say that the variables
double s, o;
are set to the appropriate values to represent contrast and brightness
constants. Say that the variable
unsigned char domainimage[8][8];
contains the appropriate scaled-down portion of the original image. Write
the 3-5 lines of code that use s and o to adjust the contrast and brightness of
domainimage.
- Our method of saving the PIFS information is very inefficient. Since
we are saving the numbers as text, it takes several bytes to store a one-byte
integer. If we write to a file in binary, we can save an unsigned char as
one byte, an int as 4 bytes, and a double as 4 bytes. If we did this, then
how many bytes would our compressed file be if our image had 20 by 16 range
regions, and each of which was 8x8 pixels? Show your work, and explain.