From msm452@nyu.edu  Mon Oct 26 16:32:48 2009
Received: from mx.cims.nyu.edu (mx.cims.nyu.edu [128.122.80.107])
	by mail.cims.nyu.edu (8.13.8+Sun/8.13.8) with ESMTP id n9QKWmGd010092
	for <shasha@mail.cims.nyu.edu>; Mon, 26 Oct 2009 16:32:48 -0400 (EDT)
Received: from mx1.nyu.edu (MX1.NYU.EDU [128.122.118.241])
	by mx.cims.nyu.edu (8.13.8+Sun/8.13.8) with ESMTP id n9QKWkRW007818
	for <shasha@courant.nyu.edu>; Mon, 26 Oct 2009 16:32:46 -0400 (EDT)
Received: from mail.nyu.edu (H3.HOME.NYU.EDU [128.122.118.83])
	by mx1.nyu.edu (8.13.8/8.13.8) with ESMTP id n9QKWXJS009776
	for <shasha@courant.nyu.edu>; Mon, 26 Oct 2009 16:32:33 -0400 (EDT)
Received: from [172.26.27.189] by mail.alt.home.nyu.edu (mshttpd); Mon,
 26 Oct 2009 16:32:33 -0400
From: Matthew S Mendelson <msm452@nyu.edu>
To: shasha@courant.nyu.edu
Message-ID: <5c70f6d9307a1f.4ae5cf21@mail.nyu.edu>
Date: Mon, 26 Oct 2009 16:32:33 -0400
X-Mailer: Sun Java(tm) System Messenger Express 6.3-8.03 (built Apr 24
 2009; 64bit)
MIME-Version: 1.0
Content-Language: en
Subject: Matthew Mendelson - Guess Program
X-Accept-Language: en
Priority: normal
Content-Type: multipart/mixed; boundary="--9dad14b2d29696f1e7448"
X-Scanned-By: MIMEDefang 2.58 on 128.122.80.107
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.0 (mx.cims.nyu.edu [128.122.80.107]); Mon, 26 Oct 2009 16:32:47 -0400 (EDT)
Status: O
Content-Length: 1870

This is a multi-part message in MIME format.

----9dad14b2d29696f1e7448
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: 7bit

Here it is!

----9dad14b2d29696f1e7448
Content-Type: application/octet-stream
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename=guess.py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SArIDEKICAgIGVsaWYgbG93ID49IGhpZ2ggb3IgaSA+PSAx
MDoKICAgICAgICBwcmludCAiWW91IGFyZSBjaGVhdGluZyEgUGxheSBmYWlyIG5leHQgdGlt
ZSEiCiAgICAgICAgbG93ID0gMQogICAgICAgIGhpZ2ggPSAxMDAwCiAgICAgICAgbWlkID0g
aW50KGludChsb3cpICsgaW50KGhpZ2gpKS8yCiAgICAgICAgaSA9IDEKICAgIGVsc2U6CiAg
ICAgICAgcHJpbnQgIkkgZG8gbm90IHJlY29nbml6ZSB0aGF0IGFuc3dlci4gUGxlYXNlIHNh
eSBlcXVhbCwgZ3JlYXRlciwgb3IgbGVzcy4iCg==

----9dad14b2d29696f1e7448--

From lsl278@nyu.edu  Mon Oct 26 16:41:11 2009
Received: from mx2.cims.nyu.edu (mx2.cims.nyu.edu [128.122.81.61])
	by mail.cims.nyu.edu (8.13.8+Sun/8.13.8) with ESMTP id n9QKfBlG012201
	for <shasha@mail.cims.nyu.edu>; Mon, 26 Oct 2009 16:41:11 -0400 (EDT)
Received: from mx1.nyu.edu (MX1.NYU.EDU [128.122.118.241])
	by mx2.cims.nyu.edu (8.13.8+Sun/8.13.8) with ESMTP id n9QKfAn8023562
	for <shasha@courant.nyu.edu>; Mon, 26 Oct 2009 16:41:10 -0400 (EDT)
Received: from mail.nyu.edu (H3.HOME.NYU.EDU [128.122.118.83])
	by mx1.nyu.edu (8.13.8/8.13.8) with ESMTP id n9QKdbhe022338
	for <shasha@courant.nyu.edu>; Mon, 26 Oct 2009 16:39:37 -0400 (EDT)
Received: from [216.165.20.37] by mail.alt.home.nyu.edu (mshttpd); Mon,
 26 Oct 2009 16:39:37 -0400
From: Leonid S Lukyanov <lsl278@nyu.edu>
To: shasha@courant.nyu.edu
Message-ID: <5b60b4e4304140.4ae5d0c9@mail.nyu.edu>
Date: Mon, 26 Oct 2009 16:39:37 -0400
X-Mailer: Sun Java(tm) System Messenger Express 6.3-8.03 (built Apr 24
 2009; 64bit)
MIME-Version: 1.0
Content-Language: en
Subject: Homework for today
X-Accept-Language: en
Priority: normal
Content-Type: multipart/mixed; boundary="--bc6bd315d6c0f2bc35cfd"
X-Scanned-By: MIMEDefang 2.58 on 128.122.81.61
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.0 (mx2.cims.nyu.edu [128.122.81.61]); Mon, 26 Oct 2009 16:41:11 -0400 (EDT)
Status: O
Content-Length: 5004

This is a multi-part message in MIME format.

----bc6bd315d6c0f2bc35cfd
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: 7bit

Professor,
I am very sorry that I missed class today. I wasn't feeling too well the whole day, and decided to take a nap before class. Unfortunately, I just woke and as a result missed lecture. I attached the homework due today to this email, the number guess program and the output of it(the files should open in text/wordpad).

                                                                                                                                    Once more I apologize,

                                                                                                                                                       Leonid L.


----bc6bd315d6c0f2bc35cfd
Content-Type: application/octet-stream
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="Number Guess"

IyEvdXNyL2Jpbi9lbnYgcHl0aG9uDQojDQojIG51bWJlciBndWVzcw0KIw0KDQoNCnByaW50
ICJTZWxlY3QgYSBudW1iZXIgZnJvbSAxIHRvIDEwMDAuIFRoaXMgcHJvZ3JhbSB3aWxsIGd1
ZXNzIHRoZSBudW1iZXIuIg0KYW5zd2VyPSAibW9yZSINCnRvcD0xMDAxDQpib3R0b209MQ0K
dHJpZXM9MQ0KDQp3aGlsZSh0b3A+Ym90dG9tKToNCiAgICANCiAgICBhdmVyYWdlPSAodG9w
K2JvdHRvbSkvMg0KICAgIHBocmFzZT0gJ0lzIHRoZSBudW1iZXIgbW9yZSwgbGVzcywgb3Ig
ZXF1YWwgdG8nLGF2ZXJhZ2UsJz8nDQogICAgYW5zd2VyPSByYXdfaW5wdXQocGhyYXNlKQ0K
ICAgIA0KICAgIGlmKGFuc3dlcj09Im1vcmUiKToNCiAgICAgICAgdHJpZXMrPTENCiAgICAg
ICAgYm90dG9tPWF2ZXJhZ2UNCg0KICAgIGVsaWYoYW5zd2VyPT0ibGVzcyIpOg0KICAgICAg
ICB0cmllcys9MQ0KICAgICAgICB0b3A9YXZlcmFnZQ0KICAgICAgICANCiAgICBlbGlmKGFu
c3dlcj09ImVxdWFsIik6DQogICAgICAgIGJvdHRvbT0yDQogICAgICAgIHRvcD0xDQogICAg
ICAgIHByaW50ICJZb3VyIG51bWJlciBpcyAiLGF2ZXJhZ2UsIiBhbmQgaXQgdG9vayB0aGUg
cHJvZ3JhbSAiLHRyaWVzLCIgdHJpZXMgdG8gZ3Vlc3MgaXQiDQoNCg0KDQogICAgDQo=
----bc6bd315d6c0f2bc35cfd
Content-Type: application/octet-stream
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="Run of Number Guess"

UHl0aG9uIDIuNi4zIChyMjYzcmMxOjc1MTg2LCBPY3QgIDIgMjAwOSwgMjA6NDA6MzApIFtN
U0Mgdi4xNTAwIDMyIGJpdCAoSW50ZWwpXSBvbiB3aW4zMg0KVHlwZSAiY29weXJpZ2h0Iiwg
ImNyZWRpdHMiIG9yICJsaWNlbnNlKCkiIGZvciBtb3JlIGluZm9ybWF0aW9uLg0KDQogICAg
KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq
KioqKioqKioqKg0KICAgIFBlcnNvbmFsIGZpcmV3YWxsIHNvZnR3YXJlIG1heSB3YXJuIGFi
b3V0IHRoZSBjb25uZWN0aW9uIElETEUNCiAgICBtYWtlcyB0byBpdHMgc3VicHJvY2VzcyB1
c2luZyB0aGlzIGNvbXB1dGVyJ3MgaW50ZXJuYWwgbG9vcGJhY2sNCiAgICBpbnRlcmZhY2Uu
ICBUaGlzIGNvbm5lY3Rpb24gaXMgbm90IHZpc2libGUgb24gYW55IGV4dGVybmFsDQogICAg
aW50ZXJmYWNlIGFuZCBubyBkYXRhIGlzIHNlbnQgdG8gb3IgcmVjZWl2ZWQgZnJvbSB0aGUg
SW50ZXJuZXQuDQogICAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq
KioqKioqKioqKioqKioqKioqKioqKioqKg0KICAgIA0KSURMRSAyLjYuMyAgICAgIA0KPj4+
ID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09IFJFU1RBUlQgPT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT0NCj4+PiANClNlbGVjdCBhIG51bWJlciBmcm9tIDEgdG8g
MTAwMC4gVGhpcyBwcm9ncmFtIHdpbGwgZ3Vlc3MgdGhlIG51bWJlci4NCignSXMgdGhlIG51
bWJlciBtb3JlLCBsZXNzLCBvciBlcXVhbCB0bycsIDUwMSwgJz8nKW1vcmUNCignSXMgdGhl
IG51bWJlciBtb3JlLCBsZXNzLCBvciBlcXVhbCB0bycsIDc1MSwgJz8nKW1vcmUNCignSXMg
dGhlIG51bWJlciBtb3JlLCBsZXNzLCBvciBlcXVhbCB0bycsIDg3NiwgJz8nKW1vcmUNCign
SXMgdGhlIG51bWJlciBtb3JlLCBsZXNzLCBvciBlcXVhbCB0bycsIDkzOCwgJz8nKW1vcmUN
CignSXMgdGhlIG51bWJlciBtb3JlLCBsZXNzLCBvciBlcXVhbCB0bycsIDk2OSwgJz8nKW1v
cmUNCignSXMgdGhlIG51bWJlciBtb3JlLCBsZXNzLCBvciBlcXVhbCB0bycsIDk4NSwgJz8n
KW1vcmUNCignSXMgdGhlIG51bWJlciBtb3JlLCBsZXNzLCBvciBlcXVhbCB0bycsIDk5Mywg
Jz8nKW1vcmUNCignSXMgdGhlIG51bWJlciBtb3JlLCBsZXNzLCBvciBlcXVhbCB0bycsIDk5
NywgJz8nKWxlc3MNCignSXMgdGhlIG51bWJlciBtb3JlLCBsZXNzLCBvciBlcXVhbCB0bycs
IDk5NSwgJz8nKW1vcmUNCignSXMgdGhlIG51bWJlciBtb3JlLCBsZXNzLCBvciBlcXVhbCB0
bycsIDk5NiwgJz8nKWVxdWFsDQpZb3VyIG51bWJlciBpcyAgOTk2ICBhbmQgaXQgdG9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IGFuZCBpdCB0b29rIHRoZSBwcm9ncmFtICAxMCAg
dHJpZXMgdG8gZ3Vlc3MgaXQNCj4+PiANCg==

----bc6bd315d6c0f2bc35cfd--

From tz348@nyu.edu  Mon Oct 26 16:53:17 2009
Received: from mx.cims.nyu.edu (mx.cims.nyu.edu [128.122.80.107])
	by mail.cims.nyu.edu (8.13.8+Sun/8.13.8) with ESMTP id n9QKrHro015316
	for <shasha@mail.cims.nyu.edu>; Mon, 26 Oct 2009 16:53:17 -0400 (EDT)
Received: from mx1.nyu.edu (MX1.NYU.EDU [128.122.118.241])
	by mx.cims.nyu.edu (8.13.8+Sun/8.13.8) with ESMTP id n9QKrEOd013462
	for <shasha@courant.nyu.edu>; Mon, 26 Oct 2009 16:53:14 -0400 (EDT)
Received: from mail.nyu.edu (H3.HOME.NYU.EDU [128.122.118.83])
	by mx1.nyu.edu (8.13.8/8.13.8) with ESMTP id n9QKr6L3017774
	for <shasha@courant.nyu.edu>; Mon, 26 Oct 2009 16:53:06 -0400 (EDT)
Received: from [172.26.24.173] by mail.alt.home.nyu.edu (mshttpd); Mon,
 26 Oct 2009 16:53:06 -0400
From: Tengchao Zhou <tz348@nyu.edu>
To: Dennis Shasha <shasha@courant.nyu.edu>
Message-ID: <5ec0aa8630255f.4ae5d3f2@mail.nyu.edu>
Date: Mon, 26 Oct 2009 16:53:06 -0400
X-Mailer: Sun Java(tm) System Messenger Express 6.3-8.03 (built Apr 24
 2009; 64bit)
MIME-Version: 1.0
Content-Language: en
Subject: mondified homework
X-Accept-Language: en
Priority: normal
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: 7bit
X-Scanned-By: MIMEDefang 2.58 on 128.122.80.107
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.0 (mx.cims.nyu.edu [128.122.80.107]); Mon, 26 Oct 2009 16:53:17 -0400 (EDT)
Status: O
Content-Length: 791

print "think of a number between 1 and 1000: "

high = 1000
low = 1
mid = low + (high - low)/2

def find_num (low, mid, high):
    if mid == 1000 or mid == 1 or low == high:
        print "you are lying"
    else:
        in_choice = raw_input("Is the number greater, equal to, or less than %s?" %mid)
        if in_choice == "greater":
            low = mid +1
            mid = low + (high - low)/2
            return find_num(low,mid,high)
        elif in_choice == "less":
            high = mid
            mid = low + (high - low)/2
            return find_num(low,mid,high)
        elif in_choice == "equal to":
            print "so your number is %s" %mid
        else:
            print "sorry, please enter again."
            find_num (low, mid, high)

find_num (low, mid, high)

From littledlc143@aim.com  Mon Oct 26 17:01:54 2009
Received: from mx.cims.nyu.edu (mx.cims.nyu.edu [128.122.80.107])
	by mail.cims.nyu.edu (8.13.8+Sun/8.13.8) with ESMTP id n9QL1ran017774
	for <shasha@mail.cims.nyu.edu>; Mon, 26 Oct 2009 17:01:53 -0400 (EDT)
Received: from imr-da02.mx.aol.com (imr-da02.mx.aol.com [205.188.105.144])
	by mx.cims.nyu.edu (8.13.8+Sun/8.13.8) with ESMTP id n9QL1qP0016014
	for <shasha@courant.nyu.edu>; Mon, 26 Oct 2009 17:01:52 -0400 (EDT)
Received: from imo-da03.mx.aol.com (imo-da03.mx.aol.com [205.188.169.201])
	by imr-da02.mx.aol.com (8.14.1/8.14.1) with ESMTP id n9QL1j8h012935
	for <shasha@courant.nyu.edu>; Mon, 26 Oct 2009 17:01:45 -0400
Received: from littledlc143@aim.com
	by imo-da03.mx.aol.com  (mail_out_v42.5.) id j.c60.539dcc1b (56034)
	 for <shasha@courant.nyu.edu>; Mon, 26 Oct 2009 17:01:41 -0400 (EDT)
Received: from 216-165-20-68.DYNAPOOL.NYU.EDU (216-165-20-68.dynapool.nyu.edu [216.165.20.68]) by cia-md08.mx.aol.com (v125.7) with ESMTP id MAILCIAMD088-dae24ae60e3326; Mon, 26 Oct 2009 17:01:41 -0400
Message-Id: <7759DBAD-EDBE-4B8C-93E7-DAC09B44D88C@aim.com>
From: Dana Cohen <littledlc143@aim.com>
To: Dennis Shasha <shasha@courant.nyu.edu>
Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes
Content-Transfer-Encoding: 7bit
Mime-Version: 1.0 (Apple Message framework v936)
Subject: ten questions
Date: Mon, 26 Oct 2009 17:01:39 -0400
X-Mailer: Apple Mail (2.936)
X-AOL-IP: 216.165.20.68
X-Spam-Flag: NO
X-AOL-SENDER: littledlc143@aim.com
X-Scanned-By: MIMEDefang 2.58 on 128.122.80.107
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.0 (mx.cims.nyu.edu [128.122.80.107]); Mon, 26 Oct 2009 17:01:53 -0400 (EDT)
Status: O
Content-Length: 468

Here is my ten questions python:

#!/usr/bin/env python

comp = ""
upper = 1000
lower = 0

while comp != "=":
     guess = (upper + lower)/2
     print "Is your number greater than, equal to, or lower than ",  
guess, " "
     print "(Enter greater, equal, or lower)"
     comp = raw_input()
     if comp == "greater":
         lower = (upper + lower)/2
     if comp == "lower":
         upper = (upper + lower)/2
     if comp == "equal":
         print "Yay! I win!"

From jas1026@nyu.edu  Mon Oct 26 18:23:01 2009
Received: from mx.cims.nyu.edu (mx.cims.nyu.edu [128.122.80.107])
	by mail.cims.nyu.edu (8.13.8+Sun/8.13.8) with ESMTP id n9QMN1O5005464
	for <shasha@mail.cims.nyu.edu>; Mon, 26 Oct 2009 18:23:01 -0400 (EDT)
Received: from mx3.nyu.edu (MX3.NYU.EDU [128.122.118.243])
	by mx.cims.nyu.edu (8.13.8+Sun/8.13.8) with ESMTP id n9QMN0dN007461
	for <shasha@courant.nyu.edu>; Mon, 26 Oct 2009 18:23:00 -0400 (EDT)
Received: from mail.nyu.edu (H3.HOME.NYU.EDU [128.122.118.83])
	by mx3.nyu.edu (8.13.8/8.13.8) with ESMTP id n9QMMtmw018861
	for <shasha@courant.nyu.edu>; Mon, 26 Oct 2009 18:22:55 -0400 (EDT)
Received: from [216.165.34.130] by mail.alt.home.nyu.edu (mshttpd); Mon,
 26 Oct 2009 18:22:55 -0400
From: Joshua A Spiro <jas1026@nyu.edu>
To: Dennis Shasha <shasha@courant.nyu.edu>
Message-ID: <59d0f0b5304995.4ae5e8ff@mail.nyu.edu>
Date: Mon, 26 Oct 2009 18:22:55 -0400
X-Mailer: Sun Java(tm) System Messenger Express 6.3-8.03 (built Apr 24
 2009; 64bit)
MIME-Version: 1.0
Content-Language: en
Subject: Ten Questions program
X-Accept-Language: en
Priority: normal
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: 7bit
X-Scanned-By: MIMEDefang 2.58 on 128.122.80.107
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.0 (mx.cims.nyu.edu [128.122.80.107]); Mon, 26 Oct 2009 18:23:01 -0400 (EDT)
Status: RO
Content-Length: 499

print "If your number is higher, press +."
print "If your number is lower, press -."
print "If your number is equal, press ="
low = 0
high = 1000
guess=0
last=0
while guess!="equal":
    middle=(high+low)/2
    if last!=middle:
        print "Is your number ",middle,"?"
        guess=raw_input("Or is it higher, lower, or equal?")
    if guess=="+":
        low=middle
        last=middle
    elif guess=="-":
        high=middle
        last=middle
    elif guess=="=":
        print "I KNEW IT!"

