This file contains hidden or 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 Links(dict): | |
""" An extended dictionary class | |
that handles tuple keys nicely, | |
by ordering the tuple calls """ | |
def __init__(self,info=None,**kwargs): | |
super(Links,self).__init__() | |
if info: | |
if hasattr(info,'iteritems'): | |
for key,value in info.iteritems(): |
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta name="viewport" content="initial-scale=0.5, user-scalable=no" /> | |
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/> | |
<title>Planet Locations</title> | |
<link href="http://code.google.com/apis/maps/documentation/javascript/examples/default.css" rel="stylesheet" type="text/css" /> | |
<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=false"></script> | |
<script type="text/javascript"> | |
function initialize() [ |
This file contains hidden or 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
from itertools import chain | |
def factors2(n): | |
result = [] | |
# test 2 and all of the odd numbers | |
# xrange instead of range avoids constructing the list | |
for i in chain([2],xrange(3,n+1,2)): | |
s = 0 | |
while n%i == 0: #a good place for mod | |
n /= i |
This file contains hidden or 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 alternative way to do the moebius transformation, | |
using scipy.ndimage.geometric_transform, | |
that interpolates the points for a smoother transformation """ | |
from pylab import * | |
from numpy import * | |
zp=[157+148j, 78+149j, 54+143j]; # (zs) the complex point zp[i] | |
wa=[147+143j, 78+140j, 54+143j]; # (ws) will be in wa[i] |
NewerOlder