Beispiel #1
0
import robin, stl
import os.path
robin.loadLibrary(__name__, os.path.join(robin.here(__file__), 
                                         "libmemprof.so"))
Beispiel #2
0
import robin, stl
import os.path
robin.loadLibrary(__name__, os.path.join(robin.here(__file__), 
                                         "libinheritance.so"))

Beispiel #3
0
import robin, stl
import os.path
robin.loadLibrary(__name__, os.path.join(os.path.dirname(__file__), "libautocollect.so"))
Beispiel #4
0
import robin
import os
robin.loadLibrary("easy", os.path.join(os.path.dirname(__file__), "./libeasy.so"))

BYTE.__to__ = lambda x: ord(x.as())
Beispiel #5
0
import robin, stl
robin.loadLibrary(__name__, "./libprotocols.so")
Times.__getitem__ = "mul"
Times.__setitem__ = "triangle"
Times.__delitem__ = "omit"
Beispiel #6
0
import robin, stl
import os.path
robin.loadLibrary(__name__, os.path.join(robin.here(__file__),
                                         "liblanguage.so"))
Beispiel #7
0
import robin, os

if os.path.islink(__file__): __file__ = os.readlink(__file__)
here = os.path.dirname(__file__)
machine = os.getenv("MACHINE")
soext = 'so'
lib = os.path.join(here, "lib/%s/numpy_robin.%s")
robin.loadLibrary(__name__, lib % (machine, soext))

engage()
Beispiel #8
0
from __future__ import generators
import robin, os.path
import __builtin__

if os.path.islink(__file__): __file__ = os.readlink(__file__)
here = os.path.dirname(__file__)
machine = os.getenv("MACHINE")
libtemplate = "%(sopre)s%%s%(platspec)s-%(ver)s%(pyspec)s%(soext)s"
lib = libtemplate % robin.__dict__ % "robin_stl"
robin.loadLibrary(__name__, robin.locate(__file__, lib))

ostringstream = std.ostringstream
istringstream = std.istringstream
ifstream = std.ifstream
ofstream = std.ofstream
string = std.string
string.__to__ = str

truetype = { double: float, long: int, ulong: int, uint: int, \
       char: str, uchar: str, schar: str,
       longlong: long, ulonglong: long}

def _sum_tuples(tuplelst):
  sumlst = [0 for i in tuplelst[0]]
  for curtuple in tuplelst:
    for i in range(len(curtuple)):
      sumlst[i] = sumlst[i] + curtuple[i]
  return tuple(sumlst)

def _make_vector_functor(vectype, volatile = False):
  def make_any_vector(lst, vectype = vectype):
Beispiel #9
0
import robin, stl

robin.loadLibrary(__name__, "./libscribble.so")
Beispiel #10
0
import robin, stl
import os.path

robin.loadLibrary(__name__, os.path.join(robin.here(__file__),
                                         "libmemprof.so"))
Beispiel #11
0
import robin, stl
import os.path
robin.loadLibrary(__name__,
                  os.path.join(robin.here(__file__), "libinheritance.so"))
Beispiel #12
0
import robin, stl
import os.path
robin.loadLibrary(__name__, os.path.join(robin.here(__file__), 
                                         "libtemplates.so"))
Beispiel #13
0
import robin, stl
import os.path
robin.loadLibrary(__name__,
                  os.path.join(robin.here(__file__), "libtemplates.so"))
Beispiel #14
0
import robin, stl
import os

robin.loadLibrary(__name__, os.path.join(os.path.dirname(__file__), "./libscribble.so"))

s = Scribble()
import thread
thread.start_new(s.run, ())


def nice_sine(i):
    import math
    return int(math.sin(i/20.) * 50 + 120)

def mkpoint(x, y):
    p = Point[int]()
    p.x = x
    p.y = y
    return p

Point[int].__repr__ = lambda p: "%i,%i" % (p.x,p.y)
Point[int].__from__[()] = lambda (x,y): mkpoint(x,y)

class Trace(IPointContainer):
    def __init__(self):
        self.points = []
    def clear(self):
        self.points = []
    def add(self, i):
        self.points.append((i.x, i.y))