Skip to content

Instantly share code, notes, and snippets.

View emberian's full-sized avatar

emberian

View GitHub Profile
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
{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):
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
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)
>>>>> def tetra(x, y):
c = x ** x
print c
>>> tetra(3, 3)
27
>>> tetra(2, 5)
4
>>> tetra(2, 3)
4
/* 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;
}
/***************************************************************************/
/* 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;
@emberian
emberian / foo.py
Created July 6, 2012 18:55
Example stub for martianman
class Hero:
pass
class Monster:
pass
@emberian
emberian / room.py
Created July 6, 2012 21:08
Example Room container for martianman
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)
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