Exemple #1
0
    def __init__(self, dir, port, base_dn, admin_rdn, admin_pw):
        """
            Initialize the instance.

            Arguments:
            dir         Path to the root of the filesystem hierarchy to create
                        the instance under.
            port        TCP port on localhost to bind the server to.
            base_dn     Base DN.
            admin_rdn   Administrator DN, relative to BASE_DN.
            admin_pw    Administrator password.
        """
        DS.__init__(self, dir, port, base_dn, admin_rdn, admin_pw)
        self.run_dir = self.dir + "/var/run/ldap"
        self.pid_path = self.run_dir + "/slapd.pid"
        self.conf_dir = self.dir + "/etc/ldap"
        self.conf_slapd_d_dir = self.conf_dir + "/slapd.d"
        self.data_dir = self.dir + "/var/lib/ldap"
Exemple #2
0
    def __init__(self, dir, port, base_dn, admin_rdn, admin_pw):
        """
            Initialize the instance.

            Arguments:
            dir         Path to the root of the filesystem hierarchy to create
                        the instance under.
            port        TCP port on localhost to bind the server to.
            base_dn     Base DN.
            admin_rdn   Administrator DN, relative to BASE_DN.
            admin_pw    Administrator password.
        """
        DS.__init__(self, dir, port, base_dn, admin_rdn, admin_pw)
        self.run_dir            = self.dir + "/var/run/ldap"
        self.pid_path           = self.run_dir + "/slapd.pid"
        self.conf_dir           = self.dir + "/etc/ldap"
        self.conf_slapd_d_dir   = self.conf_dir + "/slapd.d"
        self.data_dir           = self.dir + "/var/lib/ldap"
from ds import DS
from matplotlib.pyplot import plot, show, xlabel

q = DS(h=None, x=0.1)

r = 2.5
while r < 4:
    q.h = lambda x: r * x * (1 - x)
    t = q.trajectory(1000)[950:]
    plot([r] * len(t), t, 'k.', ms=0.4)
    r = r + 0.005

xlabel(r'$r$', fontsize=16)
show()


Exemple #4
0
# Filename: testds.py
# Author: John Stachurski
# Date: December 2008
# Corresponds to: Listing 4.3

from ds import DS         # Import from listing 4.2

def quadmap(x):
    return 4 * x * (1 - x)

q = DS(h=quadmap, x=0.1)  # Create an instance q of DS   
T1 = q.trajectory(100)    # T1 holds trajectory from 0.1

q.x = 0.2                 # Reset current state to 0.2
T2 = q.trajectory(100)    # T2 holds trajectory from 0.2

# Filename: testds.py
# Author: John Stachurski
# Date: December 2008
# Corresponds to: Listing 4.3

from ds import DS  # Import from listing 4.2


def quadmap(x):
    return 4 * x * (1 - x)


q = DS(h=quadmap, x=0.1)  # Create an instance q of DS
T1 = q.trajectory(100)  # T1 holds trajectory from 0.1

q.x = 0.2  # Reset current state to 0.2
T2 = q.trajectory(100)  # T2 holds trajectory from 0.2