1 February 2021

Stuff Ewe Knead 2 No

About This Site This site is written in PHP, a server-side programming language that dynamically generates web pages that Apache serves up to the world. All of my pages have a navigation are on the left. This contains links to any files or directories in the same directory as th page you are viewing.

Use the Parent Directory link to go up one directory. The Current Classes page contains information relevant to all of my classes. On the left, you will see a link for your class (4240). If you click on it you have access to the course calendars, which show class proceedings, and the specs page that announces all assignments, quizzes, and lab practicals.

Where is the syllabus? It comes in two parts. Part I is the Current Classes Page. This tells you about the grading scale and general class policy, which are the same for all of my classes.

The second part is the Specs Page which gives specifications for all assignments. It tells you the point value of assignments (this is echoed in Canvas) and lists due dates.

Canvas I use canvas for four purposes.

The various items listed under Startup will help you get your lappy ready for this class. Give priority to getting a text editor (you may use one of several choices) and getting Python installed. I highly recommend seeing the Corey Schaeffer video linked under Python; it will take you through the process step-by-step. Java will make its debut shortly, so get Java15 installed.

Time to Code!!

Here is our first warump exercise.


def locate(x, quarry):
    """prec: x is a list, quarry is an object
postc:  returns True iff quarry is present in x."""
    for item in x:
        if item == quarry:
            return True
    return False

Computational Resources There are two resources avaiable to your computer, memory and time. The unit of computational effort is the byte-second.

If x has n elements, the use of resources is at most proportional to n. This being so, we say this is a O(n) algorithm.

We next posed this question.


def is_in_order(x):  #x is a list. Return True iff x is an ascending order.
    y = x[0]
    for i in x:
        if i < y:
            return False
        y = i
    return True
x = [1,4,2] 
print(is_in_order(x))
x = [1,2,3,4]
print(is_in_order(x))

What's the O of this? Again, it's O(n). Use the preceding function


def bozo(x):
    #shuffle x, see if it's in order.
    #if it is you are done. Otherwise, repeat.