This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import maildb | |
import email | |
import time | |
import datetime | |
def genarate(STARTDATE, RECIPIENTS, DAYCOUNT, MESSAGE): | |
last_date = STARTDATE | |
mail = email.message_from_string(MESSAGE) | |
msg_lib = [] | |
i = 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{11:47} kb1pkl@sherman[~]$ python | |
Python 2.7.3 (default, Jun 15 2012, 18:14:05) | |
[GCC 4.7.0] on linux2 | |
Type "help", "copyright", "credits" or "license" for more information. | |
>>> class Foo(object): | |
... def write(self, msg): | |
... pass | |
... | |
>>> sys.stdout = Foo() | |
Traceback (most recent call last): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ommit eadfec1f10a5e7ccd9ee3e4298ea5faa88101faf | |
Merge: b0f1cda f2742a0 092fab7 | |
Author: Corey Richardson <[email protected]> | |
Date: Sun Jun 24 12:49:29 2012 -0400 | |
WIP on color-filter: b0f1cda Break out common code into a core runner, make hooks use that. | |
commit f2742a0abffa8c444b94825a9bb29d1cd32ad9bb | |
Author: Corey Richardson <[email protected]> | |
Date: Sun Jun 24 12:49:29 2012 -0400 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Part(object): | |
inside = False | |
class Object(list): | |
def __init__(self): | |
self[0] = Part() | |
self[1] = Part() | |
def object_inside(o): | |
return all(part.inside == True for part in o) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>>>> def tetra(x, y): | |
c = x ** x | |
print c | |
>>> tetra(3, 3) | |
27 | |
>>> tetra(2, 5) | |
4 | |
>>> tetra(2, 3) | |
4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Fudge unix isatty and fileno for RISCOS */ | |
#include "unixstuff.h" | |
#include <math.h> | |
#include <time.h> | |
#include "oslib/osfile.h" | |
int fileno(FILE *f) | |
{ return (int)f; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/***************************************************************************/ | |
/* An ultimate power routine. Given two IEEE double machine numbers y,x */ | |
/* it computes the correctly rounded (to nearest) value of X^y. */ | |
/***************************************************************************/ | |
double | |
SECTION | |
__ieee754_pow(double x, double y) { | |
double z,a,aa,error, t,a1,a2,y1,y2; | |
#if 0 | |
double gor=1.0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Hero: | |
pass | |
class Monster: | |
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Room(object): | |
def __init__(self): | |
self._container = set() | |
def __contains__(self, item): | |
return self._container.__contains__(item) | |
def add(self, item): | |
self._container.add(item) | |
item.room.remove(item) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
crichardson@crichardson-lat:~$ python | |
Python 2.7.2+ (default, Oct 4 2011, 20:03:08) | |
[GCC 4.6.1] on linux2 | |
Type "help", "copyright", "credits" or "license" for more information. | |
>>> sum = 0 | |
>>> for i in range(10): | |
... sum += i | |
... | |
>>> print sum | |
45 |