DESCRIPTION

Students:  Please keep in mind the OMSI rules.  Save your files often,
make sure OMSI fills your entire screen at all times, etc.  Remember
that clicking CopyQtoA will copy the entire question box to the answer
box.

In questions involving code which will PARTIALLY be given to you in the
question specs, you may need add new lines.  There may not be
information given as to where the lines should be inserted.

MAKE SURE TO RUN THE CODE IN PROBLEMS THAT INVOLVE CODE!

QUESTION 

(20 pts) Fill in the blank:  To see what path our will be used from our
machine at UCD when we access cnn.com, we can use the
_________________________ command.

QUESTION 

(20 pts) What at the names of the two sockets in the server code on
p.72?

QUESTION -ext .py -run 'python omsi_answer3.py

(30 pts) Here you will write a function, filterMap(f,g,x), that combines
the actions of filter() and map(), in one pass of the data

def filterMap(f,g,x):

u = [5,-12,13,-8]
print filterMap(lambda x: x > 0,lambda x: 2*x,u)  # [10, 26]

QUESTION -ext .py -run 'python omsi_answer4.py

(30 pts) Here you will write a function, uniq(x), that inputs a
character string x and outputs a string consisting of the distinct
characters in x.  Fill in addIfNew().

def addIfNew(x,y):

def uniq(w):
   return reduce(addIfNew,w)

x = 'abcabdec'  
print uniq(x)