text:
LOGGER(main);

struct LoginData
{
    enum Type
    {
        AnonymousRegister,
        Register,
        Login
    };

    Type type;
    QString userId;
    QString password;
};

class DeviceRegistrationWatcher : public QObject
{
    Q_OBJECT

public:
    DeviceRegistrationWatcher(LoginController *controller, bool quit)
    : m_controller(controller)
    , m_quit(quit)
    {
        connect(controller, SIGNAL(finished()), this, SLOT(onLoginOrRegistrationFinished()));
        connect(&m_requester, SIGNAL(statusChanged(WebRequester::Status)), this, SLOT(onStatusChanged(WebRequester::Status)));

        m_requester.setRequest(&m_request);
        m_requester.setResponse(&m_response);
    }

private slots:
    void onLoginOrRegistrationFinished()
    {
        // Already registered?
        if (m_controller->registeredDevice())
        {
            if (m_quit)
            {
                qApp->quit();
            }
            return;
        }

        LOG_INFO("Automatically registering device");

        m_requester.setUrl(QString("https://%1").arg(Client::instance()->settings()->config()->supervisorAddress()));
        m_requester.start();
    }

    void onStatusChanged(WebRequester::Status status)
    {
        switch (status)
        {
        case WebRequester::Error:
            LOG_ERROR(QString("Device registration failed, quitting. (%1)").arg(m_requester.errorString()));
            qApp->quit();
            break;

        case WebRequester::Finished:
            LOG_INFO("Device successfully registered");
            if (m_quit)
            {
                qApp->quit();
            }
            break;

        default:
            break;
        }
    }

protected:
    LoginController *m_controller;

    WebRequester m_requester;
    RegisterDeviceRequest m_request;
    RegisterDeviceResponse m_response;
    bool m_quit; // quit after registration
};

class LoginWatcher : public QObject
{
    Q_OBJECT
public:
    LoginWatcher(LoginController *controller)
    : m_controller(controller)
    {
        connect(controller, SIGNAL(statusChanged()), this, SLOT(onStatusChanged()));
    }

private slots:
    void onStatusChanged()
    {
        switch (m_controller->status())
        {
        case LoginController::Error:
            LOG_ERROR("Login/Registration failed, quitting.");
            qApp->quit();
            break;

        case LoginController::Finished:
            LOG_INFO("Login successful");
            deleteLater();
            break;

        default:
            break;
        }
    }

protected:
    LoginController *m_controller;
};

class ConfigWatcher : public QObject
{
    Q_OBJECT
public:
    ConfigWatcher(Client *client, LoginData loginData)
    : m_client(client)
    , m_loginData(loginData)
    {
        connect(m_client->configController(), SIGNAL(finished()), this, SLOT(onStatusChanged()));
    }

private slots:
    void onStatusChanged()
    {
        switch (m_client->configController()->status())
        {
        case ConfigController::Error:
            LOG_ERROR("Getting config failed, quitting.");
            qApp->quit();
            break;

        case ConfigController::Finished:
            LOG_DEBUG("Getting config successful");
            deleteLater();

            if (!m_loginData.password.isEmpty())
            {
                switch (m_loginData.type)
                {
                case LoginData::Register:
                    m_client->loginController()->registration(m_loginData.userId, m_loginData.password);
                    break;

                case LoginData::Login:
                    m_client->loginController()->login(m_loginData.userId, m_loginData.password);
                    break;
                default:
                    break;
                }
            }
            else if (m_loginData.type == LoginData::AnonymousRegister)
            {
                m_client->loginController()->anonymousRegistration();
            }
            else
            {
                if (!m_client->autoLogin())
                {
                    LOG_ERROR("No login data found for autologin");
                    qApp->quit();
                }
            }
            break;

        default:
            break;
        }
    }

protected:
    Client *m_client;
    LoginData m_loginData;
};

int main(int argc, char *argv[])
{
    QCoreApplication::setOrganizationDomain("de.hsaugsburg.informatik");
    QCoreApplication::setOrganizationName("HS-Augsburg");
    QCoreApplication::setApplicationName("mPlaneClient");
    QCoreApplication::setApplicationVersion(Client::version());

    QCoreApplication app(argc, argv);

    Logger::addAppender(new FileLogger);

    QTextStream out(stdout);

    QCommandLineParser parser;
    parser.setApplicationDescription("GLIMPSE console client\r\n\r\n"
                                     "Website: http://www.measure-it.net\r\nCopyright: Revised BSD License");
    parser.addHelpOption();
    parser.addVersionOption();

#ifdef Q_OS_UNIX
    QCommandLineOption userOption("user", "Run as user", "user");
    parser.addOption(userOption);

    //QCommandLineOption groupOption("group", "Run as group", "group");
    //parser.addOption(groupOption);

    QCommandLineOption daemonOption("daemon", "Run as daemon");
    parser.addOption(daemonOption);

    //QCommandLineOption pidFileOption("pidfile", "Set the pidfile", "path");
    //parser.addOption(pidFileOption);

#endif // Q_OS_UNIX

    QCommandLineOption registerAnonymous("register-anonymous", "Register anonymous on server and exit application");
    parser.addOption(registerAnonymous);

    QCommandLineOption registerOption("register", "Register on server and exit application", "mail");
    parser.addOption(registerOption);

    QCommandLineOption loginOption("login", "Login on server and exit application", "mail");
    parser.addOption(loginOption);

    QCommandLineOption passiveOption("passive", "Passive probe which does not receive tasks", "0/1");
    parser.addOption(passiveOption);

    QCommandLineOption trafficBudgetOption("tbm", "Enable traffic budget manager", "0/1");
    parser.addOption(trafficBudgetOption);

    QCommandLineOption trafficOption("traffic", "Traffic limit per month", "MB");
    parser.addOption(trafficOption);

    QCommandLineOption mobileTrafficOption("mobile-traffic", "Mobile traffic limit per month", "MB");
    parser.addOption(mobileTrafficOption);

    QCommandLineOption allowMobileOption("allow-mobile", "Allow mobile measurements", "0/1");
    parser.addOption(allowMobileOption);

    QCommandLineOption deviceNameOption("name", "Name of device", "name");
    parser.addOption(deviceNameOption);

    QCommandLineOption backlogOption("backlog", "Number of days to keep log files", "days");
    parser.addOption(backlogOption);

    parser.process(app);

    if (parser.isSet(registerOption) && parser.isSet(registerAnonymous))
    {
        out << "'--register' and '--register-anonymous' cannot be set on the same time.\n";
        return 1;
    }

    if ((parser.isSet(registerAnonymous) || parser.isSet(registerOption)) && parser.isSet(loginOption))
    {
        out << "'--register(-anonymous)' and '--login' cannot be set on the same time.\n";
        return 1;
    }

    QCommandLineOption *passwordOption = NULL;
    LoginData loginData;
    bool quit = false; // set true if app should exit after login/registration

    if (parser.isSet(registerOption))
    {
        loginData.type = LoginData::Register;
        passwordOption = &registerOption;
        quit = true;

        loginData.userId = parser.value(*passwordOption).toUtf8();
    }

    if (parser.isSet(loginOption))
    {
        loginData.type = LoginData::Login;
        passwordOption = &loginOption;
        quit = true;

        loginData.userId = parser.value(*passwordOption).toUtf8();
    }

    if (parser.isSet(registerAnonymous))
    {
        loginData.type = LoginData::AnonymousRegister;
        quit = true;
    }

    if (passwordOption)
    {
        ConsoleTools tools;

        do
        {
            out << '[' << argv[0] << ']' << " Password: ";
            out.flush();
            loginData.password = tools.readPassword();
        }
        while (loginData.password.isEmpty());
    }

#ifdef Q_OS_UNIX

    if (parser.isSet(userOption))
    {
        QByteArray user = parser.value(userOption).toLatin1();
        passwd *pwd = getpwnam(user.constData());

        if (pwd)
        {
            if (-1 == setuid(pwd->pw_uid))
            {
                out << "Cannot set uid to " << pwd->pw_uid << ": " << strerror(errno) << "\n";
                return 1;
            }
            else
            {
                LOG_DEBUG(QString("User id set to %1 (%2)").arg(pwd->pw_uid).arg(QString::fromLatin1(user)));
            }
        }
        else
        {
            out << "No user named " << QString::fromLatin1(user) << " found\n";
            return 1;
        }
    }

    // NOTE: This should be the last option since this creates a process fork!
    if (parser.isSet(daemonOption))
    {
        pid_t pid = fork();

        if (pid == -1)
        {
            out << "fork() failed: " << strerror(errno) << "\n";
        }
        else if (pid > 0)
        {
            // Fork successful, we're exiting now
            out << "Daemon started with pid " << pid << "\n";
            return 0;
        }
        else
        {
            // Child process
            umask(0);

            pid_t sid = setsid();

            if (sid < 0)
            {
                return 1;
            }

            //chdir("/");

            close(STDIN_FILENO);
            close(STDOUT_FILENO);
            close(STDERR_FILENO);
        }
    }

#endif // Q_OS_UNIX

    // If there may be anything left, we flush it before the client starts
    out.flush();

    // Initialize the client instance
    Client *client = Client::instance();

    LOG_INFO(QString("Glimpse version %1").arg(Client::version()));

    if (parser.isSet(passiveOption))
    {
        int setPassive = parser.value(passiveOption).toInt();
        client->settings()->setPassive((bool) setPassive);
    }

    if (parser.isSet(trafficBudgetOption))
    {
        uint val = parser.value(trafficBudgetOption).toUInt();

        if (val != 0)
        {
            client->settings()->setTrafficBudgetManagerActive(true);

            if (parser.isSet(trafficOption))
            {
                client->settings()->setAllowedTraffic(parser.value(trafficOption).toInt() * 1024 * 1024);
            }

            if (parser.isSet(mobileTrafficOption))
            {
                client->settings()->setAllowedMobileTraffic(parser.value(mobileTrafficOption).toInt() * 1024 * 1024);
            }
        }
        else
        {
            client->settings()->setTrafficBudgetManagerActive(false);
        }
    }
    else
    {
        client->settings()->setTrafficBudgetManagerActive(false);
    }

    if (parser.isSet(allowMobileOption))
    {
        uint val = parser.value(allowMobileOption).toUInt();
        client->settings()->setAllowedMobileTraffic((bool) val);
    }
    else
    {
        client->settings()->setAllowedMobileTraffic(false);
    }

    if (parser.isSet(deviceNameOption))
    {
        client->settings()->setDeviceName(parser.value(deviceNameOption));
    }

    if (parser.isSet(backlogOption))
    {
        client->settings()->setBacklog(parser.value(backlogOption).toUInt());
    }

    if (!client->init())
    {
        LOG_ERROR("Client initialization failed")
        return 1;
    }

    new LoginWatcher(client->loginController());
    new DeviceRegistrationWatcher(client->loginController(), quit);
    new ConfigWatcher(client, loginData);

    int value = app.exec();
    out << "Application shutting down.\n";

    Client::instance()->deleteLater();
    QTimer::singleShot(1, &app, SLOT(quit()));
    app.exec();

    return value;
}

#include "main.moc"


text:
<?php while (have_posts()) : the_post(); ?>
  <?php get_template_part('templates/content', 'home'); ?>
<?php endwhile;

redpajama_set_name: RedPajamaGithub


text:
require "pichuli/version"

module Pichuli
  module Worker
  	# Public
  	# return nil
  	def perform_single(*args)

  	end

  	# Public
  	# return nil
  	def perform_batch(*args)
  		args.each do |arg|
  			perform_single(arg)
  		end
  	end

  	def self.included(base)
  		base.extend(ClassMethods)
  	end
  	module ClassMethods
  		def perform(*args)
  			#enqueue task
  		end
  	end
  end
end


text:
from __future__ import absolute_import, print_function, unicode_literals

from kombu.transport.redis import Channel, Transport
from kombu.utils import cached_property

from .redis_sentinel import CelerySentinelConnectionPool, get_redis_via_sentinel

class SentinelChannel(Channel):
    """
    Redis Channel for interacting with Redis Sentinel

    .. note::
        In order to correctly configure the sentinel,
        this channel expects specific broker transport options to be
        provided via ``BROKER_TRANSPORT_OPTIONS``.
        Here is are sample transport options::

            BROKER_TRANSPORT_OPTIONS = {
                'sentinels': [('192.168.1.1', 26379),
                              ('192.168.1.2', 26379),
                              ('192.168.1.3', 26379)],
                'service_name': 'master',
                'socket_timeout': 0.1,
            }
    """
    from_transport_options = Channel.from_transport_options + (
        'sentinels',
        'service_name',
        'socket_timeout',
    )

    @cached_property
    def sentinel_pool(self):
        """
        Cached property for getting connection pool to redis sentinel.

        In addition to returning connection pool, this property
        changes the ``Transport`` connection details to match the
        connected master so that celery can correctly log to which
        node it is actually connected.

        Returns
        -------
        CelerySentinelConnectionPool
            Connection pool instance connected to redis sentinel
        """
        params = self._connparams()
        params.update({
            'sentinels': self.sentinels,
            'service_name': self.service_name,
            'socket_timeout': self.socket_timeout,
        })
        sentinel = get_redis_via_sentinel(
            redis_class=self.Client,
            connection_pool_class=CelerySentinelConnectionPool,
            **params
        )
        pool = sentinel.connection_pool
        hostname, port = pool.get_master_address()

        # update connection details so that celery correctly logs
        # where it connects
        self.connection.client.hostname = hostname
        self.connection.client.port = port

        return pool

    def _get_pool(self, *args, **kwargs):
        return self.sentinel_pool

class SentinelTransport(Transport):
    """
    Redis transport with support for Redis Sentinel.
    """
    Channel = SentinelChannel


text:
    (mscorlib::GetCallbackFactory(freeFuncPtr).Bind<freeFuncPtr>())
#define BIND_FREE_CB __MSCORLIB_GET_CALLBACK_FACTORY_BIND_FREE

#define __MSCORLIB_GET_CALLBACK_FACTORY_BIND_MEMBER(memFuncPtr, instancePtr) \
    (mscorlib::GetCallbackFactory(memFuncPtr).Bind<memFuncPtr>(instancePtr))
#define BIND_MEM_CB __MSCORLIB_GET_CALLBACK_FACTORY_BIND_MEMBER

namespace mscorlib {

template<typename FuncSignature>
class Callback;

struct NullCallback {};

// 0 parameter version

template<typename R>
class Callback<R ()>
{
public:
    static const int Arity = 0;
    typedef R ReturnType;

    Callback()                    : func(0), obj(0) {}
    Callback(NullCallback)        : func(0), obj(0) {}
    Callback(const Callback& rhs) : func(rhs.func), obj(rhs.obj) {}
    ~Callback() {}

    Callback& operator=(NullCallback)
        { obj = 0; func = 0; return *this; }
    Callback& operator=(const Callback& rhs)
        { obj = rhs.obj; func = rhs.func; return *this; }

    inline R operator()() const
    {
        return (*func)(obj);
    }

private:
    typedef const void* Callback::*SafeBoolType;
public:
    inline operator SafeBoolType() const
        { return func != 0 ? &Callback::obj : 0; }
    inline bool operator!() const
        { return func == 0; }

private:
    typedef R (*FuncType)(const void*);
    Callback(FuncType f, const void* o) : func(f), obj(o) {}

private:
    FuncType func;
    const void* obj;

    template<typename FR>
    friend class FreeCallbackFactory0;
    template<typename FR, class FT>
    friend class MemberCallbackFactory0;
    template<typename FR, class FT>
    friend class ConstMemberCallbackFactory0;
};

template<typename R>
void operator==(const Callback<R ()>&,
                const Callback<R ()>&);
template<typename R>
void operator!=(const Callback<R ()>&,
                const Callback<R ()>&);

template<typename R>
class FreeCallbackFactory0
{
private:
    template<R (*Func)()>
    static R Wrapper(const void*)
    {
        return (*Func)();
    }

public:
    template<R (*Func)()>
    inline static Callback<R ()> Bind()
    {
        return Callback<R ()>
            (&FreeCallbackFactory0::Wrapper<Func>, 0);
    }
};

template<typename R>
inline FreeCallbackFactory0<R>
GetCallbackFactory(R (*)())
{
    return FreeCallbackFactory0<R>();
}

template<typename R, class T>
class MemberCallbackFactory0
{
private:
    template<R (T::*Func)()>
    static R Wrapper(const void* o)
    {
        T* obj = const_cast<T*>(static_cast<const T*>(o));
        return (obj->*Func)();
    }

public:
    template<R (T::*Func)()>
    inline static Callback<R ()> Bind(T* o)
    {
        return Callback<R ()>
            (&MemberCallbackFactory0::Wrapper<Func>,
            static_cast<const void*>(o));
    }
};

template<typename R, class T>
inline MemberCallbackFactory0<R, T>
GetCallbackFactory(R (T::*)())
{
    return MemberCallbackFactory0<R, T>();
}

template<typename R, class T>
class ConstMemberCallbackFactory0
{
private:
    template<R (T::*Func)() const>
    static R Wrapper(const void* o)
    {
        const T* obj = static_cast<const T*>(o);
        return (obj->*Func)();
    }

public:
    template<R (T::*Func)() const>
    inline static Callback<R ()> Bind(const T* o)
    {
        return Callback<R ()>
            (&ConstMemberCallbackFactory0::Wrapper<Func>,
            static_cast<const void*>(o));
    }
};

template<typename R, class T>
inline ConstMemberCallbackFactory0<R, T>
GetCallbackFactory(R (T::*)() const)
{
    return ConstMemberCallbackFactory0<R, T>();
}

// 1 parameter version

template<typename R, typename P1>
class Callback<R (P1)>
{
public:
    static const int Arity = 1;
    typedef R ReturnType;
    typedef P1 Param1Type;

    Callback()                    : func(0), obj(0) {}
    Callback(NullCallback)        : func(0), obj(0) {}
    Callback(const Callback& rhs) : func(rhs.func), obj(rhs.obj) {}
    ~Callback() {}

    Callback& operator=(NullCallback)
        { obj = 0; func = 0; return *this; }
    Callback& operator=(const Callback& rhs)
        { obj = rhs.obj; func = rhs.func; return *this; }

    inline R operator()(P1 a1) const
    {
        return (*func)(obj, a1);
    }

private:
    typedef const void* Callback::*SafeBoolType;
public:
    inline operator SafeBoolType() const
        { return func != 0 ? &Callback::obj : 0; }
    inline bool operator!() const
        { return func == 0; }

private:
    typedef R (*FuncType)(const void*, P1);
    Callback(FuncType f, const void* o) : func(f), obj(o) {}

private:
    FuncType func;
    const void* obj;

    template<typename FR, typename FP1>
    friend class FreeCallbackFactory1;
    template<typename FR, class FT, typename FP1>
    friend class MemberCallbackFactory1;
    template<typename FR, class FT, typename FP1>
    friend class ConstMemberCallbackFactory1;
};

template<typename R, typename P1>
void operator==(const Callback<R (P1)>&,
                const Callback<R (P1)>&);
template<typename R, typename P1>
void operator!=(const Callback<R (P1)>&,
                const Callback<R (P1)>&);

template<typename R, typename P1>
class FreeCallbackFactory1
{
private:
    template<R (*Func)(P1)>
    static R Wrapper(const void*, P1 a1)
    {
        return (*Func)(a1);
    }

public:
    template<R (*Func)(P1)>
    inline static Callback<R (P1)> Bind()
    {
        return Callback<R (P1)>
            (&FreeCallbackFactory1::Wrapper<Func>, 0);
    }
};

template<typename R, typename P1>
inline FreeCallbackFactory1<R, P1>
GetCallbackFactory(R (*)(P1))
{
    return FreeCallbackFactory1<R, P1>();
}

template<typename R, class T, typename P1>
class MemberCallbackFactory1
{
private:
    template<R (T::*Func)(P1)>
    static R Wrapper(const void* o, P1 a1)
    {
        T* obj = const_cast<T*>(static_cast<const T*>(o));
        return (obj->*Func)(a1);
    }

public:
    template<R (T::*Func)(P1)>
    inline static Callback<R (P1)> Bind(T* o)
    {
        return Callback<R (P1)>
            (&MemberCallbackFactory1::Wrapper<Func>,
            static_cast<const void*>(o));
    }
};

template<typename R, class T, typename P1>
inline MemberCallbackFactory1<R, T, P1>
GetCallbackFactory(R (T::*)(P1))
{
    return MemberCallbackFactory1<R, T, P1>();
}

template<typename R, class T, typename P1>
class ConstMemberCallbackFactory1
{
private:
    template<R (T::*Func)(P1) const>
    static R Wrapper(const void* o, P1 a1)
    {
        const T* obj = static_cast<const T*>(o);
        return (obj->*Func)(a1);
    }

public:
    template<R (T::*Func)(P1) const>
    inline static Callback<R (P1)> Bind(const T* o)
    {
        return Callback<R (P1)>
            (&ConstMemberCallbackFactory1::Wrapper<Func>,
            static_cast<const void*>(o));
    }
};

template<typename R, class T, typename P1>
inline ConstMemberCallbackFactory1<R, T, P1>
GetCallbackFactory(R (T::*)(P1) const)
{
    return ConstMemberCallbackFactory1<R, T, P1>();
}

// 2 parameter version

template<typename R, typename P1, typename P2>
class Callback<R (P1, P2)>
{
public:
    static const int Arity = 2;
    typedef R ReturnType;
    typedef P1 Param1Type;
    typedef P2 Param2Type;

    Callback()                    : func(0), obj(0) {}
    Callback(NullCallback)        : func(0), obj(0) {}
    Callback(const Callback& rhs) : func(rhs.func), obj(rhs.obj) {}
    ~Callback() {}

    Callback& operator=(NullCallback)
        { obj = 0; func = 0; return *this; }
    Callback& operator=(const Callback& rhs)
        { obj = rhs.obj; func = rhs.func; return *this; }

    inline R operator()(P1 a1, P2 a2) const
    {
        return (*func)(obj, a1, a2);
    }

private:
    typedef const void* Callback::*SafeBoolType;
public:
    inline operator SafeBoolType() const
        { return func != 0 ? &Callback::obj : 0; }
    inline bool operator!() const
        { return func == 0; }

private:
    typedef R (*FuncType)(const void*, P1, P2);
    Callback(FuncType f, const void* o) : func(f), obj(o) {}

private:
    FuncType func;
    const void* obj;

    template<typename FR, typename FP1, typename FP2>
    friend class FreeCallbackFactory2;
    template<typename FR, class FT, typename FP1, typename FP2>
    friend class MemberCallbackFactory2;
    template<typename FR, class FT, typename FP1, typename FP2>
    friend class ConstMemberCallbackFactory2;
};

template<typename R, typename P1, typename P2>
void operator==(const Callback<R (P1, P2)>&,
                const Callback<R (P1, P2)>&);
template<typename R, typename P1, typename P2>
void operator!=(const Callback<R (P1, P2)>&,
                const Callback<R (P1, P2)>&);

template<typename R, typename P1, typename P2>
class FreeCallbackFactory2
{
private:
    template<R (*Func)(P1, P2)>
    static R Wrapper(const void*, P1 a1, P2 a2)
    {
        return (*Func)(a1, a2);
    }

public:
    template<R (*Func)(P1, P2)>
    inline static Callback<R (P1, P2)> Bind()
    {
        return Callback<R (P1, P2)>
            (&FreeCallbackFactory2::Wrapper<Func>, 0);
    }
};

template<typename R, typename P1, typename P2>
inline FreeCallbackFactory2<R, P1, P2>
GetCallbackFactory(R (*)(P1, P2))
{
    return FreeCallbackFactory2<R, P1, P2>();
}

template<typename R, class T, typename P1, typename P2>
class MemberCallbackFactory2
{
private:
    template<R (T::*Func)(P1, P2)>
    static R Wrapper(const void* o, P1 a1, P2 a2)
    {
        T* obj = const_cast<T*>(static_cast<const T*>(o));
        return (obj->*Func)(a1, a2);
    }

public:
    template<R (T::*Func)(P1, P2)>
    inline static Callback<R (P1, P2)> Bind(T* o)
    {
        return Callback<R (P1, P2)>
            (&MemberCallbackFactory2::Wrapper<Func>,
            static_cast<const void*>(o));
    }
};

template<typename R, class T, typename P1, typename P2>
inline MemberCallbackFactory2<R, T, P1, P2>
GetCallbackFactory(R (T::*)(P1, P2))
{
    return MemberCallbackFactory2<R, T, P1, P2>();
}

template<typename R, class T, typename P1, typename P2>
class ConstMemberCallbackFactory2
{
private:
    template<R (T::*Func)(P1, P2) const>
    static R Wrapper(const void* o, P1 a1, P2 a2)
    {
        const T* obj = static_cast<const T*>(o);
        return (obj->*Func)(a1, a2);
    }

public:
    template<R (T::*Func)(P1, P2) const>
    inline static Callback<R (P1, P2)> Bind(const T* o)
    {
        return Callback<R (P1, P2)>
            (&ConstMemberCallbackFactory2::Wrapper<Func>,
            static_cast<const void*>(o));
    }
};

template<typename R, class T, typename P1, typename P2>
inline ConstMemberCallbackFactory2<R, T, P1, P2>
GetCallbackFactory(R (T::*)(P1, P2) const)
{
    return ConstMemberCallbackFactory2<R, T, P1, P2>();
}

// 3 parameter version

template<typename R, typename P1, typename P2, typename P3>
class Callback<R (P1, P2, P3)>
{
public:
    static const int Arity = 3;
    typedef R ReturnType;
    typedef P1 Param1Type;
    typedef P2 Param2Type;
    typedef P3 Param3Type;

    Callback()                    : func(0), obj(0) {}
    Callback(NullCallback)        : func(0), obj(0) {}
    Callback(const Callback& rhs) : func(rhs.func), obj(rhs.obj) {}
    ~Callback() {}

    Callback& operator=(NullCallback)
        { obj = 0; func = 0; return *this; }
    Callback& operator=(const Callback& rhs)
        { obj = rhs.obj; func = rhs.func; return *this; }

    inline R operator()(P1 a1, P2 a2, P3 a3) const
    {
        return (*func)(obj, a1, a2, a3);
    }

private:
    typedef const void* Callback::*SafeBoolType;
public:
    inline operator SafeBoolType() const
        { return func != 0 ? &Callback::obj : 0; }
    inline bool operator!() const
        { return func == 0; }

private:
    typedef R (*FuncType)(const void*, P1, P2, P3);
    Callback(FuncType f, const void* o) : func(f), obj(o) {}

private:
    FuncType func;
    const void* obj;

    template<typename FR, typename FP1, typename FP2, typename FP3>
    friend class FreeCallbackFactory3;
    template<typename FR, class FT, typename FP1, typename FP2, typename FP3>
    friend class MemberCallbackFactory3;
    template<typename FR, class FT, typename FP1, typename FP2, typename FP3>
    friend class ConstMemberCallbackFactory3;
};

template<typename R, typename P1, typename P2, typename P3>
void operator==(const Callback<R (P1, P2, P3)>&,
                const Callback<R (P1, P2, P3)>&);
template<typename R, typename P1, typename P2, typename P3>
void operator!=(const Callback<R (P1, P2, P3)>&,
                const Callback<R (P1, P2, P3)>&);

template<typename R, typename P1, typename P2, typename P3>
class FreeCallbackFactory3
{
private:
    template<R (*Func)(P1, P2, P3)>
    static R Wrapper(const void*, P1 a1, P2 a2, P3 a3)
    {
        return (*Func)(a1, a2, a3);
    }

public:
    template<R (*Func)(P1, P2, P3)>
    inline static Callback<R (P1, P2, P3)> Bind()
    {
        return Callback<R (P1, P2, P3)>
            (&FreeCallbackFactory3::Wrapper<Func>, 0);
    }
};

template<typename R, typename P1, typename P2, typename P3>
inline FreeCallbackFactory3<R, P1, P2, P3>
GetCallbackFactory(R (*)(P1, P2, P3))
{
    return FreeCallbackFactory3<R, P1, P2, P3>();
}

template<typename R, class T, typename P1, typename P2, typename P3>
class MemberCallbackFactory3
{
private:
    template<R (T::*Func)(P1, P2, P3)>
    static R Wrapper(const void* o, P1 a1, P2 a2, P3 a3)
    {
        T* obj = const_cast<T*>(static_cast<const T*>(o));
        return (obj->*Func)(a1, a2, a3);
    }

public:
    template<R (T::*Func)(P1, P2, P3)>
    inline static Callback<R (P1, P2, P3)> Bind(T* o)
    {
        return Callback<R (P1, P2, P3)>
            (&MemberCallbackFactory3::Wrapper<Func>,
            static_cast<const void*>(o));
    }
};

template<typename R, class T, typename P1, typename P2, typename P3>
inline MemberCallbackFactory3<R, T, P1, P2, P3>
GetCallbackFactory(R (T::*)(P1, P2, P3))
{
    return MemberCallbackFactory3<R, T, P1, P2, P3>();
}

template<typename R, class T, typename P1, typename P2, typename P3>
class ConstMemberCallbackFactory3
{
private:
    template<R (T::*Func)(P1, P2, P3) const>
    static R Wrapper(const void* o, P1 a1, P2 a2, P3 a3)
    {
        const T* obj = static_cast<const T*>(o);
        return (obj->*Func)(a1, a2, a3);
    }

public:
    template<R (T::*Func)(P1, P2, P3) const>
    inline static Callback<R (P1, P2, P3)> Bind(const T* o)
    {
        return Callback<R (P1, P2, P3)>
            (&ConstMemberCallbackFactory3::Wrapper<Func>,
            static_cast<const void*>(o));
    }
};

template<typename R, class T, typename P1, typename P2, typename P3>
inline ConstMemberCallbackFactory3<R, T, P1, P2, P3>
GetCallbackFactory(R (T::*)(P1, P2, P3) const)
{
    return ConstMemberCallbackFactory3<R, T, P1, P2, P3>();
}

// 4 parameter version

template<typename R, typename P1, typename P2, typename P3,
                     typename P4>
class Callback<R (P1, P2, P3, P4)>
{
public:
    static const int Arity = 4;
    typedef R ReturnType;
    typedef P1 Param1Type;
    typedef P2 Param2Type;
    typedef P3 Param3Type;
    typedef P4 Param4Type;

    Callback()                    : func(0), obj(0) {}
    Callback(NullCallback)        : func(0), obj(0) {}
    Callback(const Callback& rhs) : func(rhs.func), obj(rhs.obj) {}
    ~Callback() {}

    Callback& operator=(NullCallback)
        { obj = 0; func = 0; return *this; }
    Callback& operator=(const Callback& rhs)
        { obj = rhs.obj; func = rhs.func; return *this; }

    inline R operator()(P1 a1, P2 a2, P3 a3, P4 a4) const
    {
        return (*func)(obj, a1, a2, a3, a4);
    }

private:
    typedef const void* Callback::*SafeBoolType;
public:
    inline operator SafeBoolType() const
        { return func != 0 ? &Callback::obj : 0; }
    inline bool operator!() const
        { return func == 0; }

private:
    typedef R (*FuncType)(const void*, P1, P2, P3, P4);
    Callback(FuncType f, const void* o) : func(f), obj(o) {}

private:
    FuncType func;
    const void* obj;

    template<typename FR, typename FP1, typename FP2, typename FP3,
                          typename FP4>
    friend class FreeCallbackFactory4;
    template<typename FR, class FT, typename FP1, typename FP2, typename FP3,
                                    typename FP4>
    friend class MemberCallbackFactory4;
    template<typename FR, class FT, typename FP1, typename FP2, typename FP3,
                                    typename FP4>
    friend class ConstMemberCallbackFactory4;
};

template<typename R, typename P1, typename P2, typename P3,
                     typename P4>
void operator==(const Callback<R (P1, P2, P3, P4)>&,
                const Callback<R (P1, P2, P3, P4)>&);
template<typename R, typename P1, typename P2, typename P3,
                     typename P4>
void operator!=(const Callback<R (P1, P2, P3, P4)>&,
                const Callback<R (P1, P2, P3, P4)>&);

template<typename R, typename P1, typename P2, typename P3,
                     typename P4>
class FreeCallbackFactory4
{
private:
    template<R (*Func)(P1, P2, P3, P4)>
    static R Wrapper(const void*, P1 a1, P2 a2, P3 a3, P4 a4)
    {
        return (*Func)(a1, a2, a3, a4);
    }

public:
    template<R (*Func)(P1, P2, P3, P4)>
    inline static Callback<R (P1, P2, P3, P4)> Bind()
    {
        return Callback<R (P1, P2, P3, P4)>
            (&FreeCallbackFactory4::Wrapper<Func>, 0);
    }
};

template<typename R, typename P1, typename P2, typename P3,
                     typename P4>
inline FreeCallbackFactory4<R, P1, P2, P3, P4>
GetCallbackFactory(R (*)(P1, P2, P3, P4))
{
    return FreeCallbackFactory4<R, P1, P2, P3, P4>();
}

template<typename R, class T, typename P1, typename P2, typename P3,
                              typename P4>
class MemberCallbackFactory4
{
private:
    template<R (T::*Func)(P1, P2, P3, P4)>
    static R Wrapper(const void* o, P1 a1, P2 a2, P3 a3, P4 a4)
    {
        T* obj = const_cast<T*>(static_cast<const T*>(o));
        return (obj->*Func)(a1, a2, a3, a4);
    }

public:
    template<R (T::*Func)(P1, P2, P3, P4)>
    inline static Callback<R (P1, P2, P3, P4)> Bind(T* o)
    {
        return Callback<R (P1, P2, P3, P4)>
            (&MemberCallbackFactory4::Wrapper<Func>,
            static_cast<const void*>(o));
    }
};

template<typename R, class T, typename P1, typename P2, typename P3,
                              typename P4>
inline MemberCallbackFactory4<R, T, P1, P2, P3, P4>
GetCallbackFactory(R (T::*)(P1, P2, P3, P4))
{
    return MemberCallbackFactory4<R, T, P1, P2, P3, P4>();
}

template<typename R, class T, typename P1, typename P2, typename P3,
                              typename P4>
class ConstMemberCallbackFactory4
{
private:
    template<R (T::*Func)(P1, P2, P3, P4) const>
    static R Wrapper(const void* o, P1 a1, P2 a2, P3 a3, P4 a4)
    {
        const T* obj = static_cast<const T*>(o);
        return (obj->*Func)(a1, a2, a3, a4);
    }

public:
    template<R (T::*Func)(P1, P2, P3, P4) const>
    inline static Callback<R (P1, P2, P3, P4)> Bind(const T* o)
    {
        return Callback<R (P1, P2, P3, P4)>
            (&ConstMemberCallbackFactory4::Wrapper<Func>,
            static_cast<const void*>(o));
    }
};

template<typename R, class T, typename P1, typename P2, typename P3,
                              typename P4>
inline ConstMemberCallbackFactory4<R, T, P1, P2, P3, P4>
GetCallbackFactory(R (T::*)(P1, P2, P3, P4) const)
{
    return ConstMemberCallbackFactory4<R, T, P1, P2, P3, P4>();
}

// 5 parameter version

template<typename R, typename P1, typename P2, typename P3,
                     typename P4, typename P5>
class Callback<R (P1, P2, P3, P4, P5)>
{
public:
    static const int Arity = 5;
    typedef R ReturnType;
    typedef P1 Param1Type;
    typedef P2 Param2Type;
    typedef P3 Param3Type;
    typedef P4 Param4Type;
    typedef P5 Param5Type;

    Callback()                    : func(0), obj(0) {}
    Callback(NullCallback)        : func(0), obj(0) {}
    Callback(const Callback& rhs) : func(rhs.func), obj(rhs.obj) {}
    ~Callback() {}

    Callback& operator=(NullCallback)
        { obj = 0; func = 0; return *this; }
    Callback& operator=(const Callback& rhs)
        { obj = rhs.obj; func = rhs.func; return *this; }

    inline R operator()(P1 a1, P2 a2, P3 a3, P4 a4, P5 a5) const
    {
        return (*func)(obj, a1, a2, a3, a4, a5);
    }

private:
    typedef const void* Callback::*SafeBoolType;
public:
    inline operator SafeBoolType() const
        { return func != 0 ? &Callback::obj : 0; }
    inline bool operator!() const
        { return func == 0; }

private:
    typedef R (*FuncType)(const void*, P1, P2, P3, P4, P5);
    Callback(FuncType f, const void* o) : func(f), obj(o) {}

private:
    FuncType func;
    const void* obj;

    template<typename FR, typename FP1, typename FP2, typename FP3,
                          typename FP4, typename FP5>
    friend class FreeCallbackFactory5;
    template<typename FR, class FT, typename FP1, typename FP2, typename FP3,
                                    typename FP4, typename FP5>
    friend class MemberCallbackFactory5;
    template<typename FR, class FT, typename FP1, typename FP2, typename FP3,
                                    typename FP4, typename FP5>
    friend class ConstMemberCallbackFactory5;
};

template<typename R, typename P1, typename P2, typename P3,
                     typename P4, typename P5>
void operator==(const Callback<R (P1, P2, P3, P4, P5)>&,
                const Callback<R (P1, P2, P3, P4, P5)>&);
template<typename R, typename P1, typename P2, typename P3,
                     typename P4, typename P5>
void operator!=(const Callback<R (P1, P2, P3, P4, P5)>&,
                const Callback<R (P1, P2, P3, P4, P5)>&);

template<typename R, typename P1, typename P2, typename P3,
                     typename P4, typename P5>
class FreeCallbackFactory5
{
private:
    template<R (*Func)(P1, P2, P3, P4, P5)>
    static R Wrapper(const void*, P1 a1, P2 a2, P3 a3, P4 a4, P5 a5)
    {
        return (*Func)(a1, a2, a3, a4, a5);
    }

public:
    template<R (*Func)(P1, P2, P3, P4, P5)>
    inline static Callback<R (P1, P2, P3, P4, P5)> Bind()
    {
        return Callback<R (P1, P2, P3, P4, P5)>
            (&FreeCallbackFactory5::Wrapper<Func>, 0);
    }
};

template<typename R, typename P1, typename P2, typename P3,
                     typename P4, typename P5>
inline FreeCallbackFactory5<R, P1, P2, P3, P4, P5>
GetCallbackFactory(R (*)(P1, P2, P3, P4, P5))
{
    return FreeCallbackFactory5<R, P1, P2, P3, P4, P5>();
}

template<typename R, class T, typename P1, typename P2, typename P3,
                              typename P4, typename P5>
class MemberCallbackFactory5
{
private:
    template<R (T::*Func)(P1, P2, P3, P4, P5)>
    static R Wrapper(const void* o, P1 a1, P2 a2, P3 a3, P4 a4, P5 a5)
    {
        T* obj = const_cast<T*>(static_cast<const T*>(o));
        return (obj->*Func)(a1, a2, a3, a4, a5);
    }

public:
    template<R (T::*Func)(P1, P2, P3, P4, P5)>
    inline static Callback<R (P1, P2, P3, P4, P5)> Bind(T* o)
    {
        return Callback<R (P1, P2, P3, P4, P5)>
            (&MemberCallbackFactory5::Wrapper<Func>,
            static_cast<const void*>(o));
    }
};

template<typename R, class T, typename P1, typename P2, typename P3,
                              typename P4, typename P5>
inline MemberCallbackFactory5<R, T, P1, P2, P3, P4, P5>
GetCallbackFactory(R (T::*)(P1, P2, P3, P4, P5))
{
    return MemberCallbackFactory5<R, T, P1, P2, P3, P4, P5>();
}

template<typename R, class T, typename P1, typename P2, typename P3,
                              typename P4, typename P5>
class ConstMemberCallbackFactory5
{
private:
    template<R (T::*Func)(P1, P2, P3, P4, P5) const>
    static R Wrapper(const void* o, P1 a1, P2 a2, P3 a3, P4 a4, P5 a5)
    {
        const T* obj = static_cast<const T*>(o);
        return (obj->*Func)(a1, a2, a3, a4, a5);
    }

public:
    template<R (T::*Func)(P1, P2, P3, P4, P5) const>
    inline static Callback<R (P1, P2, P3, P4, P5)> Bind(const T* o)
    {
        return Callback<R (P1, P2, P3, P4, P5)>
            (&ConstMemberCallbackFactory5::Wrapper<Func>,
            static_cast<const void*>(o));
    }
};

template<typename R, class T, typename P1, typename P2, typename P3,
                              typename P4, typename P5>
inline ConstMemberCallbackFactory5<R, T, P1, P2, P3, P4, P5>
GetCallbackFactory(R (T::*)(P1, P2, P3, P4, P5) const)
{
    return ConstMemberCallbackFactory5<R, T, P1, P2, P3, P4, P5>();
}

// 6 parameter version

template<typename R, typename P1, typename P2, typename P3,
                     typename P4, typename P5, typename P6>
class Callback<R (P1, P2, P3, P4, P5, P6)>
{
public:
    static const int Arity = 6;
    typedef R ReturnType;
    typedef P1 Param1Type;
    typedef P2 Param2Type;
    typedef P3 Param3Type;
    typedef P4 Param4Type;
    typedef P5 Param5Type;
    typedef P6 Param6Type;

    Callback()                    : func(0), obj(0) {}
    Callback(NullCallback)        : func(0), obj(0) {}
    Callback(const Callback& rhs) : func(rhs.func), obj(rhs.obj) {}
    ~Callback() {}

    Callback& operator=(NullCallback)
        { obj = 0; func = 0; return *this; }
    Callback& operator=(const Callback& rhs)
        { obj = rhs.obj; func = rhs.func; return *this; }

    inline R operator()(P1 a1, P2 a2, P3 a3, P4 a4, P5 a5, P6 a6) const
    {
        return (*func)(obj, a1, a2, a3, a4, a5, a6);
    }

private:
    typedef const void* Callback::*SafeBoolType;
public:
    inline operator SafeBoolType() const
        { return func != 0 ? &Callback::obj : 0; }
    inline bool operator!() const
        { return func == 0; }

private:
    typedef R (*FuncType)(const void*, P1, P2, P3, P4, P5, P6);
    Callback(FuncType f, const void* o) : func(f), obj(o) {}

private:
    FuncType func;
    const void* obj;

    template<typename FR, typename FP1, typename FP2, typename FP3,
                          typename FP4, typename FP5, typename FP6>
    friend class FreeCallbackFactory6;
    template<typename FR, class FT, typename FP1, typename FP2, typename FP3,
                                    typename FP4, typename FP5, typename FP6>
    friend class MemberCallbackFactory6;
    template<typename FR, class FT, typename FP1, typename FP2, typename FP3,
                                    typename FP4, typename FP5, typename FP6>
    friend class ConstMemberCallbackFactory6;
};

template<typename R, typename P1, typename P2, typename P3,
                     typename P4, typename P5, typename P6>
void operator==(const Callback<R (P1, P2, P3, P4, P5, P6)>&,
                const Callback<R (P1, P2, P3, P4, P5, P6)>&);
template<typename R, typename P1, typename P2, typename P3,
                     typename P4, typename P5, typename P6>
void operator!=(const Callback<R (P1, P2, P3, P4, P5, P6)>&,
                const Callback<R (P1, P2, P3, P4, P5, P6)>&);

template<typename R, typename P1, typename P2, typename P3,
                     typename P4, typename P5, typename P6>
class FreeCallbackFactory6
{
private:
    template<R (*Func)(P1, P2, P3, P4, P5, P6)>
    static R Wrapper(const void*, P1 a1, P2 a2, P3 a3, P4 a4, P5 a5, P6 a6)
    {
        return (*Func)(a1, a2, a3, a4, a5, a6);
    }

public:
    template<R (*Func)(P1, P2, P3, P4, P5, P6)>
    inline static Callback<R (P1, P2, P3, P4, P5, P6)> Bind()
    {
        return Callback<R (P1, P2, P3, P4, P5, P6)>
            (&FreeCallbackFactory6::Wrapper<Func>, 0);
    }
};

template<typename R, typename P1, typename P2, typename P3,
                     typename P4, typename P5, typename P6>
inline FreeCallbackFactory6<R, P1, P2, P3, P4, P5, P6>
GetCallbackFactory(R (*)(P1, P2, P3, P4, P5, P6))
{
    return FreeCallbackFactory6<R, P1, P2, P3, P4, P5, P6>();
}

template<typename R, class T, typename P1, typename P2, typename P3,
                              typename P4, typename P5, typename P6>
class MemberCallbackFactory6
{
private:
    template<R (T::*Func)(P1, P2, P3, P4, P5, P6)>
    static R Wrapper(const void* o, P1 a1, P2 a2, P3 a3, P4 a4, P5 a5, P6 a6)
    {
        T* obj = const_cast<T*>(static_cast<const T*>(o));
        return (obj->*Func)(a1, a2, a3, a4, a5, a6);
    }

public:
    template<R (T::*Func)(P1, P2, P3, P4, P5, P6)>
    inline static Callback<R (P1, P2, P3, P4, P5, P6)> Bind(T* o)
    {
        return Callback<R (P1, P2, P3, P4, P5, P6)>
            (&MemberCallbackFactory6::Wrapper<Func>,
            static_cast<const void*>(o));
    }
};

template<typename R, class T, typename P1, typename P2, typename P3,
                              typename P4, typename P5, typename P6>
inline MemberCallbackFactory6<R, T, P1, P2, P3, P4, P5, P6>
GetCallbackFactory(R (T::*)(P1, P2, P3, P4, P5, P6))
{
    return MemberCallbackFactory6<R, T, P1, P2, P3, P4, P5, P6>();
}

template<typename R, class T, typename P1, typename P2, typename P3,
                              typename P4, typename P5, typename P6>
class ConstMemberCallbackFactory6
{
private:
    template<R (T::*Func)(P1, P2, P3, P4, P5, P6) const>
    static R Wrapper(const void* o, P1 a1, P2 a2, P3 a3, P4 a4, P5 a5, P6 a6)
    {
        const T* obj = static_cast<const T*>(o);
        return (obj->*Func)(a1, a2, a3, a4, a5, a6);
    }

public:
    template<R (T::*Func)(P1, P2, P3, P4, P5, P6) const>
    inline static Callback<R (P1, P2, P3, P4, P5, P6)> Bind(const T* o)
    {
        return Callback<R (P1, P2, P3, P4, P5, P6)>
            (&ConstMemberCallbackFactory6::Wrapper<Func>,
            static_cast<const void*>(o));
    }
};

template<typename R, class T, typename P1, typename P2, typename P3,
                              typename P4, typename P5, typename P6>
inline ConstMemberCallbackFactory6<R, T, P1, P2, P3, P4, P5, P6>
GetCallbackFactory(R (T::*)(P1, P2, P3, P4, P5, P6) const)
{
    return ConstMemberCallbackFactory6<R, T, P1, P2, P3, P4, P5, P6>();
}

}

#endif


text:
/**
 *
 */
package br.com.swconsultoria.efd.contribuicoes.bo.blocoC;

import br.com.swconsultoria.efd.contribuicoes.registros.blocoC.RegistroC820;
import br.com.swconsultoria.efd.contribuicoes.util.Util;

/**
 * @author Yuri Lemes
 *
 */
public class GerarRegistroC820 {

	public static StringBuilder gerar(RegistroC820 registroC820, StringBuilder sb) {

		sb.append("|").append(Util.preencheRegistro(registroC820.getReg()));
		sb.append("|").append(Util.preencheRegistro(registroC820.getCfop()));
		sb.append("|").append(Util.preencheRegistro(registroC820.getVl_item()));
		sb.append("|").append(Util.preencheRegistro(registroC820.getCod_item()));
		sb.append("|").append(Util.preencheRegistro(registroC820.getCst_pis()));
		sb.append("|").append(Util.preencheRegistro(registroC820.getQuant_bc_pis()));
		sb.append("|").append(Util.preencheRegistro(registroC820.getAliq_pis_reais()));
		sb.append("|").append(Util.preencheRegistro(registroC820.getVl_pis()));
		sb.append("|").append(Util.preencheRegistro(registroC820.getCst_cofins()));
		sb.append("|").append(Util.preencheRegistro(registroC820.getQuant_bc_cofins()));
		sb.append("|").append(Util.preencheRegistro(registroC820.getAliq_cofins_reais()));
		sb.append("|").append(Util.preencheRegistro(registroC820.getVl_cofins()));
		sb.append("|").append(Util.preencheRegistro(registroC820.getCod_cta()));
		sb.append("|").append('\n');

		return sb;
	}
}


text:
using System.Threading.Tasks;
using Microsoft.Extensions.CommandLineUtils;

namespace Apollo.CLI.Commands.Meta
{
    public class ChangePasswordCommand : BaseCommand
    {
        public ChangePasswordCommand(CommandLineOptions options) : base(options)
        {
        }

        public override async Task Execute()
        {
            Console.Write("Enter current password: ", false);
            var currentPassword = Console.ReadLineSupressOutput();
            Console.Write("Enter new password: ", false);
            var newPassword = Console.ReadLineSupressOutput();
            Console.Write("Enter new password (verify): ", false);
            var newPasswordVerification = Console.ReadLineSupressOutput();

            var result = await this.Execute("ChangePassword",
                new {currentPassword, newPassword, newPasswordVerification});

            if(result.ResultStatus == 0)
                Console.Green("Successfully changed password");
        }

        public static void Configure(CommandLineApplication command, CommandLineOptions options)
        {
            command.Description = "Change your password";
            command.OnExecute(() =>
            {
                options.Command = new ChangePasswordCommand(options);
                return 0;
            });
        }
    }
}


text:
<?php
namespace CodeOrders\V1\Rest\Orders;

use CodeOrders\src\CodeOrders\V1\Rest\Orders\OrdersRepository;
use CodeOrders\src\CodeOrders\V1\Rest\Orders\OrdersService;
use ZF\ApiProblem\ApiProblem;
use ZF\Rest\AbstractResourceListener;

class OrdersResource extends AbstractResourceListener
{
    /**
     * @var OrdersRepository
     */
    private $repository;
    /**
     * @var OrdersService
     */
    private $service;

    /**
     * OrdersResource constructor.
     */
    public function __construct(OrdersRepository $repository, OrdersService $service)
    {
        $this->repository = $repository;
        $this->service = $service;
    }

    /**
     * Create a resource
     *
     * @param  mixed $data
     * @return ApiProblem|mixed
     */
    public function create($data)
    {
        //return new ApiProblem(405, 'The POST method has not been defined');

        $result = $this->service->insert($data);

        if ($result == 'error') {

            return new ApiProblem(405, 'Error processing order');

        }

        return $result;

    }

    /**
     * Delete a resource
     *
     * @param  mixed $id
     * @return ApiProblem|mixed
     */
    public function delete($id)
    {
        return new ApiProblem(405, 'The DELETE method has not been defined for individual resources');
    }

    /**
     * Delete a collection, or members of a collection
     *
     * @param  mixed $data
     * @return ApiProblem|mixed
     */
    public function deleteList($data)
    {
        return new ApiProblem(405, 'The DELETE method has not been defined for collections');
    }

    /**
     * Fetch a resource
     *
     * @param  mixed $id
     * @return ApiProblem|mixed
     */
    public function fetch($id)
    {
        return new ApiProblem(405, 'The GET method has not been defined for individual resources');
    }

    /**
     * Fetch all or a subset of resources
     *
     * @param  array $params
     * @return ApiProblem|mixed
     */
    public function fetchAll($params = array())
    {
        return new ApiProblem(405, 'The GET method has not been defined for collections');
        /*
                return [
                    'success'=>true
                ];*/

    }

    /**
     * Patch (partial in-place update) a resource
     *
     * @param  mixed $id
     * @param  mixed $data
     * @return ApiProblem|mixed
     */
    public function patch($id, $data)
    {
        return new ApiProblem(405, 'The PATCH method has not been defined for individual resources');
    }

    /**
     * Replace a collection or members of a collection
     *
     * @param  mixed $data
     * @return ApiProblem|mixed
     */
    public function replaceList($data)
    {
        return new ApiProblem(405, 'The PUT method has not been defined for collections');
    }

    /**
     * Update a resource
     *
     * @param  mixed $id
     * @param  mixed $data
     * @return ApiProblem|mixed
     */
    public function update($id, $data)
    {
        return new ApiProblem(405, 'The PUT method has not been defined for individual resources');
    }
}


text:
package br.inpe.cap.evolution;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.util.List;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;

import org.apache.commons.io.FileUtils;
import org.apache.log4j.Logger;
import org.repodriller.RepoDriller;
import org.repodriller.RepositoryMining;
import org.repodriller.Study;
import org.repodriller.filter.range.Commits;
import org.repodriller.persistence.csv.CSVFile;
import org.repodriller.scm.GitRemoteRepository;

import br.inpe.cap.auxiliar.MultipleCSVFile;
import br.inpe.cap.evolution.processor.JoinSummaryCSVPostProcessor;
import br.inpe.cap.evolution.visitor.FilterMavenDependencyVisitor;

public class FilterMavenDependencyVersionEvolutionRemoteStarsStudy implements Study {

	private static final int THREADS_FOR_REPOSITORIES = 10;
	private static final String FOUNTAIN_PATH = "fountain" + File.separator;
	private static final String STUDY_TEMP_PATH = "E:\\metricminer-evolution-stars-NOBARE";

	private static final String STUDY_LOG_PATH = "." + File.separator + "study" + File.separator + "filter_stars_06";
	private static final String EVOLUTION_LOG_PATH = STUDY_LOG_PATH + File.separator + "evolutions";

	private static final String FILE_PREFIX = "dependency_filter-HOME";
	private static final String EVOLUTION_SUMMARY_CSV = STUDY_LOG_PATH + File.separator + FILE_PREFIX + ".csv";

	private static final File GITHUB_URLS_FILE = new File(FOUNTAIN_PATH+"java-stars.urls");
	private static final File GITHUB_DONE_FILE = new File(FOUNTAIN_PATH+"done-github_filter-stars_HOME.txt");
	private static final File EXCEPTION_FILE = new File(FOUNTAIN_PATH+"exceptions-filter-stars_HOME.log");

	private static Logger log;

	public static void main(String[] args) throws Exception {
		System.setProperty("git.maxfiles", "2000");
		System.setProperty("logfilename", FILE_PREFIX + "_filter06");
		log = Logger.getLogger(RepositoryMining.class);

		checkRequiredLogFilesAndDirectories();

		new RepoDriller().start(new FilterMavenDependencyVersionEvolutionRemoteStarsStudy());

		new JoinSummaryCSVPostProcessor().process(EVOLUTION_LOG_PATH, new File(EVOLUTION_LOG_PATH + "_joined.csv"));

		System.out.println("Finish!");
	}

	public void execute() {
		try {

			List<String> gitRepoUrl = getRepositoryExceptDoneUrls();

			ExecutorService execRepos = Executors.newFixedThreadPool(THREADS_FOR_REPOSITORIES);
			for(String url : gitRepoUrl) {
				execRepos.submit(() ->
					doMining(url, STUDY_TEMP_PATH));
			}

			execRepos.shutdown();
			execRepos.awaitTermination(Long.MAX_VALUE, TimeUnit.DAYS);

		} catch (Exception e) {
			try {
				String causeMessage = "";
				if(e.getCause() != null)
					causeMessage = e.getCause().getMessage();
				FileUtils.writeStringToFile(EXCEPTION_FILE, e.getMessage() + ". Cause: " + causeMessage +"\n", true);
				System.gc();
			} catch (IOException e1) {
				e1.printStackTrace();
			}
		}
	}

	private void doMining(String gitUrl, String tempDir) {
		try {
			String gitReposLogSubDir = gitUrl.substring(gitUrl.lastIndexOf("/")+1, gitUrl.length());
			Thread.currentThread().setName("Checkout " + gitReposLogSubDir);
			GitRemoteRepository gitRemoteRepository = GitRemoteRepository
					.hostedOn(gitUrl)
					.inTempDir(tempDir)
					.build();
			new RepositoryMining()
				.in(gitRemoteRepository.info())
				.through(Commits.onlyInHead())
				.process(new FilterMavenDependencyVisitor(EVOLUTION_LOG_PATH, gitReposLogSubDir), new MultipleCSVFile(
						new CSVFile(EVOLUTION_SUMMARY_CSV, true)
						,
						new CSVFile(EVOLUTION_LOG_PATH
								+ File.separator
								+ "filter-stars-'"
								+ gitReposLogSubDir
								+ "'.csv")))
				.mine();
			markDone(gitUrl);
			gitRemoteRepository.deleteTempGitPath();
		} catch (Exception re) {
			log.error(re.getMessage());
		} finally {
			System.gc();
		}
	}

	private List<String> getRepositoryExceptDoneUrls() throws IOException {
		List<String> urls = FileUtils.readLines(GITHUB_URLS_FILE);

		FileReader arquivo = new FileReader(GITHUB_DONE_FILE);
		BufferedReader reader = new BufferedReader(arquivo);

		String linha = reader.readLine();
		while (linha != null) {
			urls.remove(linha);
			linha = reader.readLine();
		}

		reader.close();
		arquivo.close();
		return urls;
	}

	private void markDone(String gitUrl) {
		try {
			FileUtils.writeStringToFile(GITHUB_DONE_FILE, gitUrl + "\n", true);
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

	private static void checkRequiredLogFilesAndDirectories() throws IOException {
		if(!GITHUB_DONE_FILE.exists()) {
			GITHUB_DONE_FILE.createNewFile();
		}

		File studyPathDir = new File(STUDY_LOG_PATH);
		if(!studyPathDir.exists()) {
			studyPathDir.mkdir();
		}

		File evolutionPathDir = new File(EVOLUTION_LOG_PATH);
		if(!evolutionPathDir.exists()) {
			evolutionPathDir.mkdir();
		}
	}

}


text:
Often when using nodejs you might want to quickly see who is using a port and get some basic information about the process.

To get the process PID

To get additional info based on the PID

whatis <process> # Gives you process description
whereis <process> # Gives you source usuall something like /usr/local/bin/<process>


text:
namespace DLaB.Xrm.Entities
{

	[System.Runtime.Serialization.DataContractAttribute()]
	[System.CodeDom.Compiler.GeneratedCodeAttribute("CrmSvcUtil", "9.0.0.9369")]
	public enum ImportLogState
	{

		[System.Runtime.Serialization.EnumMemberAttribute()]
		Active = 0,
	}

	/// <summary>
	/// Failure reason and other detailed information for a record that failed to import.
	/// </summary>
	[System.Runtime.Serialization.DataContractAttribute()]
	[Microsoft.Xrm.Sdk.Client.EntityLogicalNameAttribute("importlog")]
	[System.CodeDom.Compiler.GeneratedCodeAttribute("CrmSvcUtil", "9.0.0.9369")]
	public partial class ImportLog : Microsoft.Xrm.Sdk.Entity, System.ComponentModel.INotifyPropertyChanging, System.ComponentModel.INotifyPropertyChanged
	{

		public static class Fields
		{
			public const string AdditionalInfo = "additionalinfo";
			public const string ColumnValue = "columnvalue";
			public const string CreatedBy = "createdby";
			public const string CreatedOn = "createdon";
			public const string CreatedOnBehalfBy = "createdonbehalfby";
			public const string ErrorDescription = "errordescription";
			public const string ErrorNumber = "errornumber";
			public const string HeaderColumn = "headercolumn";
			public const string ImportDataId = "importdataid";
			public const string ImportFileId = "importfileid";
			public const string ImportLogId = "importlogid";
			public const string Id = "importlogid";
			public const string LineNumber = "linenumber";
			public const string LogPhaseCode = "logphasecode";
			public const string ModifiedBy = "modifiedby";
			public const string ModifiedOn = "modifiedon";
			public const string ModifiedOnBehalfBy = "modifiedonbehalfby";
			public const string OwnerId = "ownerid";
			public const string OwningBusinessUnit = "owningbusinessunit";
			public const string OwningTeam = "owningteam";
			public const string OwningUser = "owninguser";
			public const string SequenceNumber = "sequencenumber";
			public const string StateCode = "statecode";
			public const string StatusCode = "statuscode";
			public const string BusinessUnit_ImportLogs = "BusinessUnit_ImportLogs";
			public const string ImportLog_ImportFile = "ImportLog_ImportFile";
			public const string lk_importlog_createdonbehalfby = "lk_importlog_createdonbehalfby";
			public const string lk_importlog_modifiedonbehalfby = "lk_importlog_modifiedonbehalfby";
			public const string lk_importlogbase_createdby = "lk_importlogbase_createdby";
			public const string lk_importlogbase_modifiedby = "lk_importlogbase_modifiedby";
			public const string SystemUser_ImportLogs = "SystemUser_ImportLogs";
			public const string team_ImportLogs = "team_ImportLogs";
		}

		/// <summary>
		/// Default Constructor.
		/// </summary>
		[System.Diagnostics.DebuggerNonUserCode()]
		public ImportLog() :
				base(EntityLogicalName)
		{
		}

		public const string EntityLogicalName = "importlog";

		public const string PrimaryIdAttribute = "importlogid";

		public const int EntityTypeCode = 4423;

		public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;

		public event System.ComponentModel.PropertyChangingEventHandler PropertyChanging;

		[System.Diagnostics.DebuggerNonUserCode()]
		private void OnPropertyChanged(string propertyName)
		{
			if ((this.PropertyChanged != null))
			{
				this.PropertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName));
			}
		}

		[System.Diagnostics.DebuggerNonUserCode()]
		private void OnPropertyChanging(string propertyName)
		{
			if ((this.PropertyChanging != null))
			{
				this.PropertyChanging(this, new System.ComponentModel.PropertyChangingEventArgs(propertyName));
			}
		}

		/// <summary>
		/// Additional information related to the error.
		/// </summary>
		[Microsoft.Xrm.Sdk.AttributeLogicalNameAttribute("additionalinfo")]
		public string AdditionalInfo
		{
			[System.Diagnostics.DebuggerNonUserCode()]
			get
			{
				return this.GetAttributeValue<string>("additionalinfo");
			}
			[System.Diagnostics.DebuggerNonUserCode()]
			set
			{
				this.OnPropertyChanging("AdditionalInfo");
				this.SetAttributeValue("additionalinfo", value);
				this.OnPropertyChanged("AdditionalInfo");
			}
		}

		/// <summary>
		/// Value in the column.
		/// </summary>
		[Microsoft.Xrm.Sdk.AttributeLogicalNameAttribute("columnvalue")]
		public string ColumnValue
		{
			[System.Diagnostics.DebuggerNonUserCode()]
			get
			{
				return this.GetAttributeValue<string>("columnvalue");
			}
			[System.Diagnostics.DebuggerNonUserCode()]
			set
			{
				this.OnPropertyChanging("ColumnValue");
				this.SetAttributeValue("columnvalue", value);
				this.OnPropertyChanged("ColumnValue");
			}
		}

		/// <summary>
		/// Unique identifier of the user who created the import log.
		/// </summary>
		[Microsoft.Xrm.Sdk.AttributeLogicalNameAttribute("createdby")]
		public Microsoft.Xrm.Sdk.EntityReference CreatedBy
		{
			[System.Diagnostics.DebuggerNonUserCode()]
			get
			{
				return this.GetAttributeValue<Microsoft.Xrm.Sdk.EntityReference>("createdby");
			}
			[System.Diagnostics.DebuggerNonUserCode()]
			set
			{
				this.OnPropertyChanging("CreatedBy");
				this.SetAttributeValue("createdby", value);
				this.OnPropertyChanged("CreatedBy");
			}
		}

		/// <summary>
		/// Date and time when the import log was created.
		/// </summary>
		[Microsoft.Xrm.Sdk.AttributeLogicalNameAttribute("createdon")]
		public System.Nullable<System.DateTime> CreatedOn
		{
			[System.Diagnostics.DebuggerNonUserCode()]
			get
			{
				return this.GetAttributeValue<System.Nullable<System.DateTime>>("createdon");
			}
			[System.Diagnostics.DebuggerNonUserCode()]
			set
			{
				this.OnPropertyChanging("CreatedOn");
				this.SetAttributeValue("createdon", value);
				this.OnPropertyChanged("CreatedOn");
			}
		}

		/// <summary>
		/// Unique identifier of the delegate user who created the importlog.
		/// </summary>
		[Microsoft.Xrm.Sdk.AttributeLogicalNameAttribute("createdonbehalfby")]
		public Microsoft.Xrm.Sdk.EntityReference CreatedOnBehalfBy
		{
			[System.Diagnostics.DebuggerNonUserCode()]
			get
			{
				return this.GetAttributeValue<Microsoft.Xrm.Sdk.EntityReference>("createdonbehalfby");
			}
			[System.Diagnostics.DebuggerNonUserCode()]
			set
			{
				this.OnPropertyChanging("CreatedOnBehalfBy");
				this.SetAttributeValue("createdonbehalfby", value);
				this.OnPropertyChanged("CreatedOnBehalfBy");
			}
		}

		/// <summary>
		/// Description of an error.
		/// </summary>
		[Microsoft.Xrm.Sdk.AttributeLogicalNameAttribute("errordescription")]
		public string ErrorDescription
		{
			[System.Diagnostics.DebuggerNonUserCode()]
			get
			{
				return this.GetAttributeValue<string>("errordescription");
			}
			[System.Diagnostics.DebuggerNonUserCode()]
			set
			{
				this.OnPropertyChanging("ErrorDescription");
				this.SetAttributeValue("errordescription", value);
				this.OnPropertyChanged("ErrorDescription");
			}
		}

		/// <summary>
		/// Error code of an error.
		/// </summary>
		[Microsoft.Xrm.Sdk.AttributeLogicalNameAttribute("errornumber")]
		public System.Nullable<int> ErrorNumber
		{
			[System.Diagnostics.DebuggerNonUserCode()]
			get
			{
				return this.GetAttributeValue<System.Nullable<int>>("errornumber");
			}
			[System.Diagnostics.DebuggerNonUserCode()]
			set
			{
				this.OnPropertyChanging("ErrorNumber");
				this.SetAttributeValue("errornumber", value);
				this.OnPropertyChanged("ErrorNumber");
			}
		}

		/// <summary>
		/// Name of the column heading.
		/// </summary>
		[Microsoft.Xrm.Sdk.AttributeLogicalNameAttribute("headercolumn")]
		public string HeaderColumn
		{
			[System.Diagnostics.DebuggerNonUserCode()]
			get
			{
				return this.GetAttributeValue<string>("headercolumn");
			}
			[System.Diagnostics.DebuggerNonUserCode()]
			set
			{
				this.OnPropertyChanging("HeaderColumn");
				this.SetAttributeValue("headercolumn", value);
				this.OnPropertyChanged("HeaderColumn");
			}
		}

		/// <summary>
		/// Unique identifier of the import data for this import log.
		/// </summary>
		[Microsoft.Xrm.Sdk.AttributeLogicalNameAttribute("importdataid")]
		public Microsoft.Xrm.Sdk.EntityReference ImportDataId
		{
			[System.Diagnostics.DebuggerNonUserCode()]
			get
			{
				return this.GetAttributeValue<Microsoft.Xrm.Sdk.EntityReference>("importdataid");
			}
			[System.Diagnostics.DebuggerNonUserCode()]
			set
			{
				this.OnPropertyChanging("ImportDataId");
				this.SetAttributeValue("importdataid", value);
				this.OnPropertyChanged("ImportDataId");
			}
		}

		/// <summary>
		/// Unique identifier of the import file for this import log.
		/// </summary>
		[Microsoft.Xrm.Sdk.AttributeLogicalNameAttribute("importfileid")]
		public Microsoft.Xrm.Sdk.EntityReference ImportFileId
		{
			[System.Diagnostics.DebuggerNonUserCode()]
			get
			{
				return this.GetAttributeValue<Microsoft.Xrm.Sdk.EntityReference>("importfileid");
			}
			[System.Diagnostics.DebuggerNonUserCode()]
			set
			{
				this.OnPropertyChanging("ImportFileId");
				this.SetAttributeValue("importfileid", value);
				this.OnPropertyChanged("ImportFileId");
			}
		}

		/// <summary>
		/// Unique identifier of the import log.
		/// </summary>
		[Microsoft.Xrm.Sdk.AttributeLogicalNameAttribute("importlogid")]
		public System.Nullable<System.Guid> ImportLogId
		{
			[System.Diagnostics.DebuggerNonUserCode()]
			get
			{
				return this.GetAttributeValue<System.Nullable<System.Guid>>("importlogid");
			}
			[System.Diagnostics.DebuggerNonUserCode()]
			set
			{
				this.OnPropertyChanging("ImportLogId");
				this.SetAttributeValue("importlogid", value);
				if (value.HasValue)
				{
					base.Id = value.Value;
				}
				else
				{
					base.Id = System.Guid.Empty;
				}
				this.OnPropertyChanged("ImportLogId");
			}
		}

		[Microsoft.Xrm.Sdk.AttributeLogicalNameAttribute("importlogid")]
		public override System.Guid Id
		{
			[System.Diagnostics.DebuggerNonUserCode()]
			get
			{
				return base.Id;
			}
			[System.Diagnostics.DebuggerNonUserCode()]
			set
			{
				this.ImportLogId = value;
			}
		}

		/// <summary>
		/// Original line number of the data used in this log.
		/// </summary>
		[Microsoft.Xrm.Sdk.AttributeLogicalNameAttribute("linenumber")]
		public System.Nullable<int> LineNumber
		{
			[System.Diagnostics.DebuggerNonUserCode()]
			get
			{
				return this.GetAttributeValue<System.Nullable<int>>("linenumber");
			}
			[System.Diagnostics.DebuggerNonUserCode()]
			set
			{
				this.OnPropertyChanging("LineNumber");
				this.SetAttributeValue("linenumber", value);
				this.OnPropertyChanged("LineNumber");
			}
		}

		/// <summary>
		/// Phase for which the log is recorded.
		/// </summary>
		[Microsoft.Xrm.Sdk.AttributeLogicalNameAttribute("logphasecode")]
		public Microsoft.Xrm.Sdk.OptionSetValue LogPhaseCode
		{
			[System.Diagnostics.DebuggerNonUserCode()]
			get
			{
				return this.GetAttributeValue<Microsoft.Xrm.Sdk.OptionSetValue>("logphasecode");
			}
			[System.Diagnostics.DebuggerNonUserCode()]
			set
			{
				this.OnPropertyChanging("LogPhaseCode");
				this.SetAttributeValue("logphasecode", value);
				this.OnPropertyChanged("LogPhaseCode");
			}
		}

		/// <summary>
		/// Unique identifier of the user who last modified the import log.
		/// </summary>
		[Microsoft.Xrm.Sdk.AttributeLogicalNameAttribute("modifiedby")]
		public Microsoft.Xrm.Sdk.EntityReference ModifiedBy
		{
			[System.Diagnostics.DebuggerNonUserCode()]
			get
			{
				return this.GetAttributeValue<Microsoft.Xrm.Sdk.EntityReference>("modifiedby");
			}
			[System.Diagnostics.DebuggerNonUserCode()]
			set
			{
				this.OnPropertyChanging("ModifiedBy");
				this.SetAttributeValue("modifiedby", value);
				this.OnPropertyChanged("ModifiedBy");
			}
		}

		/// <summary>
		/// Date and time when the import log was last modified.
		/// </summary>
		[Microsoft.Xrm.Sdk.AttributeLogicalNameAttribute("modifiedon")]
		public System.Nullable<System.DateTime> ModifiedOn
		{
			[System.Diagnostics.DebuggerNonUserCode()]
			get
			{
				return this.GetAttributeValue<System.Nullable<System.DateTime>>("modifiedon");
			}
			[System.Diagnostics.DebuggerNonUserCode()]
			set
			{
				this.OnPropertyChanging("ModifiedOn");
				this.SetAttributeValue("modifiedon", value);
				this.OnPropertyChanged("ModifiedOn");
			}
		}

		/// <summary>
		/// Unique identifier of the delegate user who last modified the importlog.
		/// </summary>
		[Microsoft.Xrm.Sdk.AttributeLogicalNameAttribute("modifiedonbehalfby")]
		public Microsoft.Xrm.Sdk.EntityReference ModifiedOnBehalfBy
		{
			[System.Diagnostics.DebuggerNonUserCode()]
			get
			{
				return this.GetAttributeValue<Microsoft.Xrm.Sdk.EntityReference>("modifiedonbehalfby");
			}
			[System.Diagnostics.DebuggerNonUserCode()]
			set
			{
				this.OnPropertyChanging("ModifiedOnBehalfBy");
				this.SetAttributeValue("modifiedonbehalfby", value);
				this.OnPropertyChanged("ModifiedOnBehalfBy");
			}
		}

		/// <summary>
		/// Unique identifier of the user or team who owns the import log.
		/// </summary>
		[Microsoft.Xrm.Sdk.AttributeLogicalNameAttribute("ownerid")]
		public Microsoft.Xrm.Sdk.EntityReference OwnerId
		{
			[System.Diagnostics.DebuggerNonUserCode()]
			get
			{
				return this.GetAttributeValue<Microsoft.Xrm.Sdk.EntityReference>("ownerid");
			}
			[System.Diagnostics.DebuggerNonUserCode()]
			set
			{
				this.OnPropertyChanging("OwnerId");
				this.SetAttributeValue("ownerid", value);
				this.OnPropertyChanged("OwnerId");
			}
		}

		/// <summary>
		/// Business unit that owns the import log.
		/// </summary>
		[Microsoft.Xrm.Sdk.AttributeLogicalNameAttribute("owningbusinessunit")]
		public Microsoft.Xrm.Sdk.EntityReference OwningBusinessUnit
		{
			[System.Diagnostics.DebuggerNonUserCode()]
			get
			{
				return this.GetAttributeValue<Microsoft.Xrm.Sdk.EntityReference>("owningbusinessunit");
			}
			[System.Diagnostics.DebuggerNonUserCode()]
			set
			{
				this.OnPropertyChanging("OwningBusinessUnit");
				this.SetAttributeValue("owningbusinessunit", value);
				this.OnPropertyChanged("OwningBusinessUnit");
			}
		}

		/// <summary>
		/// Unique identifier of the team who owns the import log.
		/// </summary>
		[Microsoft.Xrm.Sdk.AttributeLogicalNameAttribute("owningteam")]
		public Microsoft.Xrm.Sdk.EntityReference OwningTeam
		{
			[System.Diagnostics.DebuggerNonUserCode()]
			get
			{
				return this.GetAttributeValue<Microsoft.Xrm.Sdk.EntityReference>("owningteam");
			}
			[System.Diagnostics.DebuggerNonUserCode()]
			set
			{
				this.OnPropertyChanging("OwningTeam");
				this.SetAttributeValue("owningteam", value);
				this.OnPropertyChanged("OwningTeam");
			}
		}

		/// <summary>
		/// Unique identifier of the user who owns the import log.
		/// </summary>
		[Microsoft.Xrm.Sdk.AttributeLogicalNameAttribute("owninguser")]
		public Microsoft.Xrm.Sdk.EntityReference OwningUser
		{
			[System.Diagnostics.DebuggerNonUserCode()]
			get
			{
				return this.GetAttributeValue<Microsoft.Xrm.Sdk.EntityReference>("owninguser");
			}
			[System.Diagnostics.DebuggerNonUserCode()]
			set
			{
				this.OnPropertyChanging("OwningUser");
				this.SetAttributeValue("owninguser", value);
				this.OnPropertyChanged("OwningUser");
			}
		}

		/// <summary>
		/// Sequence number of the error in this log.
		/// </summary>
		[Microsoft.Xrm.Sdk.AttributeLogicalNameAttribute("sequencenumber")]
		public System.Nullable<int> SequenceNumber
		{
			[System.Diagnostics.DebuggerNonUserCode()]
			get
			{
				return this.GetAttributeValue<System.Nullable<int>>("sequencenumber");
			}
		}

		/// <summary>
		/// Status of the import log.
		/// </summary>
		[Microsoft.Xrm.Sdk.AttributeLogicalNameAttribute("statecode")]
		public System.Nullable<DLaB.Xrm.Entities.ImportLogState> StateCode
		{
			[System.Diagnostics.DebuggerNonUserCode()]
			get
			{
				Microsoft.Xrm.Sdk.OptionSetValue optionSet = this.GetAttributeValue<Microsoft.Xrm.Sdk.OptionSetValue>("statecode");
				if ((optionSet != null))
				{
					return ((DLaB.Xrm.Entities.ImportLogState)(System.Enum.ToObject(typeof(DLaB.Xrm.Entities.ImportLogState), optionSet.Value)));
				}
				else
				{
					return null;
				}
			}
		}

		/// <summary>
		/// Reason for the status of the import log.
		/// </summary>
		[Microsoft.Xrm.Sdk.AttributeLogicalNameAttribute("statuscode")]
		public Microsoft.Xrm.Sdk.OptionSetValue StatusCode
		{
			[System.Diagnostics.DebuggerNonUserCode()]
			get
			{
				return this.GetAttributeValue<Microsoft.Xrm.Sdk.OptionSetValue>("statuscode");
			}
			[System.Diagnostics.DebuggerNonUserCode()]
			set
			{
				this.OnPropertyChanging("StatusCode");
				this.SetAttributeValue("statuscode", value);
				this.OnPropertyChanged("StatusCode");
			}
		}

		/// <summary>
		/// 1:N ImportLog_AsyncOperations
		/// </summary>
		[Microsoft.Xrm.Sdk.RelationshipSchemaNameAttribute("ImportLog_AsyncOperations")]
		public System.Collections.Generic.IEnumerable<DLaB.Xrm.Entities.AsyncOperation> ImportLog_AsyncOperations
		{
			[System.Diagnostics.DebuggerNonUserCode()]
			get
			{
				return this.GetRelatedEntities<DLaB.Xrm.Entities.AsyncOperation>("ImportLog_AsyncOperations", null);
			}
			[System.Diagnostics.DebuggerNonUserCode()]
			set
			{
				this.OnPropertyChanging("ImportLog_AsyncOperations");
				this.SetRelatedEntities<DLaB.Xrm.Entities.AsyncOperation>("ImportLog_AsyncOperations", null, value);
				this.OnPropertyChanged("ImportLog_AsyncOperations");
			}
		}

		/// <summary>
		/// 1:N ImportLog_BulkDeleteFailures
		/// </summary>
		[Microsoft.Xrm.Sdk.RelationshipSchemaNameAttribute("ImportLog_BulkDeleteFailures")]
		public System.Collections.Generic.IEnumerable<DLaB.Xrm.Entities.BulkDeleteFailure> ImportLog_BulkDeleteFailures
		{
			[System.Diagnostics.DebuggerNonUserCode()]
			get
			{
				return this.GetRelatedEntities<DLaB.Xrm.Entities.BulkDeleteFailure>("ImportLog_BulkDeleteFailures", null);
			}
			[System.Diagnostics.DebuggerNonUserCode()]
			set
			{
				this.OnPropertyChanging("ImportLog_BulkDeleteFailures");
				this.SetRelatedEntities<DLaB.Xrm.Entities.BulkDeleteFailure>("ImportLog_BulkDeleteFailures", null, value);
				this.OnPropertyChanged("ImportLog_BulkDeleteFailures");
			}
		}

		/// <summary>
		/// 1:N userentityinstancedata_importlog
		/// </summary>
		[Microsoft.Xrm.Sdk.RelationshipSchemaNameAttribute("userentityinstancedata_importlog")]
		public System.Collections.Generic.IEnumerable<DLaB.Xrm.Entities.UserEntityInstanceData> userentityinstancedata_importlog
		{
			[System.Diagnostics.DebuggerNonUserCode()]
			get
			{
				return this.GetRelatedEntities<DLaB.Xrm.Entities.UserEntityInstanceData>("userentityinstancedata_importlog", null);
			}
			[System.Diagnostics.DebuggerNonUserCode()]
			set
			{
				this.OnPropertyChanging("userentityinstancedata_importlog");
				this.SetRelatedEntities<DLaB.Xrm.Entities.UserEntityInstanceData>("userentityinstancedata_importlog", null, value);
				this.OnPropertyChanged("userentityinstancedata_importlog");
			}
		}

		/// <summary>
		/// N:1 BusinessUnit_ImportLogs
		/// </summary>
		[Microsoft.Xrm.Sdk.AttributeLogicalNameAttribute("owningbusinessunit")]
		[Microsoft.Xrm.Sdk.RelationshipSchemaNameAttribute("BusinessUnit_ImportLogs")]
		public DLaB.Xrm.Entities.BusinessUnit BusinessUnit_ImportLogs
		{
			[System.Diagnostics.DebuggerNonUserCode()]
			get
			{
				return this.GetRelatedEntity<DLaB.Xrm.Entities.BusinessUnit>("BusinessUnit_ImportLogs", null);
			}
			[System.Diagnostics.DebuggerNonUserCode()]
			set
			{
				this.OnPropertyChanging("BusinessUnit_ImportLogs");
				this.SetRelatedEntity<DLaB.Xrm.Entities.BusinessUnit>("BusinessUnit_ImportLogs", null, value);
				this.OnPropertyChanged("BusinessUnit_ImportLogs");
			}
		}

		/// <summary>
		/// N:1 ImportLog_ImportFile
		/// </summary>
		[Microsoft.Xrm.Sdk.AttributeLogicalNameAttribute("importfileid")]
		[Microsoft.Xrm.Sdk.RelationshipSchemaNameAttribute("ImportLog_ImportFile")]
		public DLaB.Xrm.Entities.ImportFile ImportLog_ImportFile
		{
			[System.Diagnostics.DebuggerNonUserCode()]
			get
			{
				return this.GetRelatedEntity<DLaB.Xrm.Entities.ImportFile>("ImportLog_ImportFile", null);
			}
			[System.Diagnostics.DebuggerNonUserCode()]
			set
			{
				this.OnPropertyChanging("ImportLog_ImportFile");
				this.SetRelatedEntity<DLaB.Xrm.Entities.ImportFile>("ImportLog_ImportFile", null, value);
				this.OnPropertyChanged("ImportLog_ImportFile");
			}
		}

		/// <summary>
		/// N:1 lk_importlog_createdonbehalfby
		/// </summary>
		[Microsoft.Xrm.Sdk.AttributeLogicalNameAttribute("createdonbehalfby")]
		[Microsoft.Xrm.Sdk.RelationshipSchemaNameAttribute("lk_importlog_createdonbehalfby")]
		public DLaB.Xrm.Entities.SystemUser lk_importlog_createdonbehalfby
		{
			[System.Diagnostics.DebuggerNonUserCode()]
			get
			{
				return this.GetRelatedEntity<DLaB.Xrm.Entities.SystemUser>("lk_importlog_createdonbehalfby", null);
			}
			[System.Diagnostics.DebuggerNonUserCode()]
			set
			{
				this.OnPropertyChanging("lk_importlog_createdonbehalfby");
				this.SetRelatedEntity<DLaB.Xrm.Entities.SystemUser>("lk_importlog_createdonbehalfby", null, value);
				this.OnPropertyChanged("lk_importlog_createdonbehalfby");
			}
		}

		/// <summary>
		/// N:1 lk_importlog_modifiedonbehalfby
		/// </summary>
		[Microsoft.Xrm.Sdk.AttributeLogicalNameAttribute("modifiedonbehalfby")]
		[Microsoft.Xrm.Sdk.RelationshipSchemaNameAttribute("lk_importlog_modifiedonbehalfby")]
		public DLaB.Xrm.Entities.SystemUser lk_importlog_modifiedonbehalfby
		{
			[System.Diagnostics.DebuggerNonUserCode()]
			get
			{
				return this.GetRelatedEntity<DLaB.Xrm.Entities.SystemUser>("lk_importlog_modifiedonbehalfby", null);
			}
			[System.Diagnostics.DebuggerNonUserCode()]
			set
			{
				this.OnPropertyChanging("lk_importlog_modifiedonbehalfby");
				this.SetRelatedEntity<DLaB.Xrm.Entities.SystemUser>("lk_importlog_modifiedonbehalfby", null, value);
				this.OnPropertyChanged("lk_importlog_modifiedonbehalfby");
			}
		}

		/// <summary>
		/// N:1 lk_importlogbase_createdby
		/// </summary>
		[Microsoft.Xrm.Sdk.AttributeLogicalNameAttribute("createdby")]
		[Microsoft.Xrm.Sdk.RelationshipSchemaNameAttribute("lk_importlogbase_createdby")]
		public DLaB.Xrm.Entities.SystemUser lk_importlogbase_createdby
		{
			[System.Diagnostics.DebuggerNonUserCode()]
			get
			{
				return this.GetRelatedEntity<DLaB.Xrm.Entities.SystemUser>("lk_importlogbase_createdby", null);
			}
			[System.Diagnostics.DebuggerNonUserCode()]
			set
			{
				this.OnPropertyChanging("lk_importlogbase_createdby");
				this.SetRelatedEntity<DLaB.Xrm.Entities.SystemUser>("lk_importlogbase_createdby", null, value);
				this.OnPropertyChanged("lk_importlogbase_createdby");
			}
		}

		/// <summary>
		/// N:1 lk_importlogbase_modifiedby
		/// </summary>
		[Microsoft.Xrm.Sdk.AttributeLogicalNameAttribute("modifiedby")]
		[Microsoft.Xrm.Sdk.RelationshipSchemaNameAttribute("lk_importlogbase_modifiedby")]
		public DLaB.Xrm.Entities.SystemUser lk_importlogbase_modifiedby
		{
			[System.Diagnostics.DebuggerNonUserCode()]
			get
			{
				return this.GetRelatedEntity<DLaB.Xrm.Entities.SystemUser>("lk_importlogbase_modifiedby", null);
			}
			[System.Diagnostics.DebuggerNonUserCode()]
			set
			{
				this.OnPropertyChanging("lk_importlogbase_modifiedby");
				this.SetRelatedEntity<DLaB.Xrm.Entities.SystemUser>("lk_importlogbase_modifiedby", null, value);
				this.OnPropertyChanged("lk_importlogbase_modifiedby");
			}
		}

		/// <summary>
		/// N:1 SystemUser_ImportLogs
		/// </summary>
		[Microsoft.Xrm.Sdk.AttributeLogicalNameAttribute("owninguser")]
		[Microsoft.Xrm.Sdk.RelationshipSchemaNameAttribute("SystemUser_ImportLogs")]
		public DLaB.Xrm.Entities.SystemUser SystemUser_ImportLogs
		{
			[System.Diagnostics.DebuggerNonUserCode()]
			get
			{
				return this.GetRelatedEntity<DLaB.Xrm.Entities.SystemUser>("SystemUser_ImportLogs", null);
			}
			[System.Diagnostics.DebuggerNonUserCode()]
			set
			{
				this.OnPropertyChanging("SystemUser_ImportLogs");
				this.SetRelatedEntity<DLaB.Xrm.Entities.SystemUser>("SystemUser_ImportLogs", null, value);
				this.OnPropertyChanged("SystemUser_ImportLogs");
			}
		}

		/// <summary>
		/// N:1 team_ImportLogs
		/// </summary>
		[Microsoft.Xrm.Sdk.AttributeLogicalNameAttribute("owningteam")]
		[Microsoft.Xrm.Sdk.RelationshipSchemaNameAttribute("team_ImportLogs")]
		public DLaB.Xrm.Entities.Team team_ImportLogs
		{
			[System.Diagnostics.DebuggerNonUserCode()]
			get
			{
				return this.GetRelatedEntity<DLaB.Xrm.Entities.Team>("team_ImportLogs", null);
			}
			[System.Diagnostics.DebuggerNonUserCode()]
			set
			{
				this.OnPropertyChanging("team_ImportLogs");
				this.SetRelatedEntity<DLaB.Xrm.Entities.Team>("team_ImportLogs", null, value);
				this.OnPropertyChanged("team_ImportLogs");
			}
		}

		/// <summary>
		/// Constructor for populating via LINQ queries given a LINQ anonymous type
		/// <param name="anonymousType">LINQ anonymous type.</param>
		/// </summary>
		[System.Diagnostics.DebuggerNonUserCode()]
		public ImportLog(object anonymousType) :
				this()
		{
            foreach (var p in anonymousType.GetType().GetProperties())
            {
                var value = p.GetValue(anonymousType, null);
                var name = p.Name.ToLower();

                if (name.EndsWith("enum") && value.GetType().BaseType == typeof(System.Enum))
                {
                    value = new Microsoft.Xrm.Sdk.OptionSetValue((int) value);
                    name = name.Remove(name.Length - "enum".Length);
                }

                switch (name)
                {
                    case "id":
                        base.Id = (System.Guid)value;
                        Attributes["importlogid"] = base.Id;
                        break;
                    case "importlogid":
                        var id = (System.Nullable<System.Guid>) value;
                        if(id == null){ continue; }
                        base.Id = id.Value;
                        Attributes[name] = base.Id;
                        break;
                    case "formattedvalues":
                        // Add Support for FormattedValues
                        FormattedValues.AddRange((Microsoft.Xrm.Sdk.FormattedValueCollection)value);
                        break;
                    default:
                        Attributes[name] = value;
                        break;
                }
            }
		}

		[Microsoft.Xrm.Sdk.AttributeLogicalNameAttribute("logphasecode")]
		public virtual ImportLog_LogPhaseCode? LogPhaseCodeEnum
		{
			[System.Diagnostics.DebuggerNonUserCode()]
			get
			{
				return ((ImportLog_LogPhaseCode?)(EntityOptionSetEnum.GetEnum(this, "logphasecode")));
			}
			[System.Diagnostics.DebuggerNonUserCode()]
			set
			{
				LogPhaseCode = value.HasValue ? new Microsoft.Xrm.Sdk.OptionSetValue((int)value) : null;
			}
		}

		[Microsoft.Xrm.Sdk.AttributeLogicalNameAttribute("statuscode")]
		public virtual ImportLog_StatusCode? StatusCodeEnum
		{
			[System.Diagnostics.DebuggerNonUserCode()]
			get
			{
				return ((ImportLog_StatusCode?)(EntityOptionSetEnum.GetEnum(this, "statuscode")));
			}
			[System.Diagnostics.DebuggerNonUserCode()]
			set
			{
				StatusCode = value.HasValue ? new Microsoft.Xrm.Sdk.OptionSetValue((int)value) : null;
			}
		}
	}
}


text:
// The "DictionaryTest" class.
// This class tests two implementations of the Dictionary
// interface by inserting 676 different entries, removing
// half of them, and inserting 156 more entries. It also
// prints the initial dictionaries (i.e., the ones after
// inserting the first 676 entries) and searches for 6
// randomly chosen entries in both dictionaries. Obviously,
// the search result should be the same for both dictionaries.
public class DictionaryTest {
	protected static String[] entries = new String[26 * 26];

	protected static void fill() {
		// Insert 26 * 26 entries
		for (int i = 0; i < 26; i++)
			for (int j = 0; j < 26; j++) {
				StringBuffer s = new StringBuffer();
				s.append((char) ((int) 'A' + i));
				s.append((char) ((int) 'A' + j));
				entries[i * 26 + j] = s.toString();
			}
	} // fill method

	public static void main(String[] args) {
		BSTDictionary<String, SortableString> dict1 = new BSTDictionary<String, SortableString>();
		AVLDictionary<String, SortableString> dict2 = new AVLDictionary<String, SortableString>();

		// Insert lots of entries
		fill();
		for (int i = 0; i < 26 * 26; i++) {
			int e;
			do {
				e = (int) (Math.random() * (26 * 26));
			} while (entries[e] == null);

			dict1.insert(new SortableString(entries[e]), entries[e]);
			dict2.insert(new SortableString(entries[e]), entries[e]);
			entries[e] = null;
		}

		// print the two dictionaries
		dict1.printTree();
		dict2.printTree();
		// print the depth
		System.out.println("The initial BST tree has a maximum depth of "
				+ dict1.depth());
		System.out.println("The initial AVL tree has a maximum depth of "
				+ dict2.depth());

		// Delete half the entries
		fill();
		for (int i = 0; i < 13 * 26; i++) {
			int e;
			do {
				e = (int) (Math.random() * (26 * 26));
			} while (entries[e] == null);

			dict1.delete(new SortableString(entries[e]));
			dict2.delete(new SortableString(entries[e]));
		}

		System.out
				.println("After deletes, the BST tree has a maximum depth of "
						+ dict1.depth());
		System.out
				.println("After deletes, the AVL tree has a maximum depth of "
						+ dict2.depth());

		// Add a quarter the entries
		fill();
		for (int i = 0; i < 6 * 26; i++) {
			int e;
			do {
				e = (int) (Math.random() * (26 * 26));
			} while (entries[e] == null);

			dict1.insert(new SortableString(entries[e]), entries[e]);
			dict2.insert(new SortableString(entries[e]), entries[e]);
		}

		System.out
				.println("After insertions, the BST tree has a maximum depth of "
						+ dict1.depth());
		System.out
				.println("After insertions, the AVL tree has a maximum depth of "
						+ dict2.depth());

		// Search for a few random entries
		fill();
		for (int i = 0; i < 6; i++) {
			int e;
			do {
				e = (int) (Math.random() * (26 * 26));
			} while (entries[e] == null);

			System.out.print("Searching for " + entries[e] + ": ");
			if (dict1.search(new SortableString(entries[e])) == null) {
				System.out.print("Not found in Dict1, ");
			} else {
				System.out.print("Found in Dict1, ");
			}
			if (dict2.search(new SortableString(entries[e])) == null) {
				System.out.println("not found in Dict2.");
			} else {
				System.out.println("found in Dict2.");
			}
		}
	} // main method
} /* DictionaryTest class */


text:
import { mixin } from '../../src/util/'

describe('mixin', () => {
  const parent = Object.create({})
  const son = Object.create(parent)

  parent.a = function () {}
  parent.b = function () {}
  son.c = function () {}
  son.d = function () {}

  it('should mix methods', () => {
    const result = mixin({}, null, son)

    expect(result.c).toBe(son.c)
    expect(result.d).toBe(son.d)
  })

  it('should mix own methods', () => {
    const result = mixin({}, null, son)

    expect(result.hasOwnProperty('c')).toBe(true)
    expect(result.hasOwnProperty('d')).toBe(true)
  })

  it('should not mix inherited methods', () => {
    const result = mixin({}, null, son)

    expect(result.hasOwnProperty('a')).toBe(false)
    expect(result.hasOwnProperty('b')).toBe(false)
  })

  it('should sencond param to be optional', () => {
    const result = mixin({}, son)

    expect(result.c).toBe(son.c)
    expect(result.d).toBe(son.d)
  })

  it('should not throw error without given anything', () => {
    expect(() => {
      mixin()
    }).not.toThrow()
  })

  it('should not throw error without given mixins', () => {
    expect(() => {
      mixin({})
    }).not.toThrow()
  })

  it('should call preMix with opts', () => {
    son.preMix = function () {}
    spyOn(son, 'preMix')

    const opts = {}
    mixin({}, opts, son)

    expect(son.preMix).toHaveBeenCalledWith(opts)
  })

  it('should call postMix with opts', () => {
    son.postMix = function () {}
    spyOn(son, 'postMix')

    const opts = {}
    mixin({}, opts, son)

    expect(son.postMix).toHaveBeenCalledWith(opts)
  })

  it('should not call preMix with dest as context', () => {
    const dest = {}

    son.preMix = function () {
      expect(this).not.toBe(dest)
    }

    mixin(dest, {}, son)
  })

  it('should call postMix with dest as context', () => {
    const dest = {}

    son.postMix = function () {
      expect(this).toBe(dest)
    }

    mixin(dest, {}, son)
  })

  it('should call preMix before postMix', () => {
    const spy = jasmine.createSpy('spy')

    son.preMix = function () {
      spy(son.preMix)
    }

    son.postMix = function () {
      spy(son.postMix)
    }

    mixin({}, {}, son)

    expect(spy.calls.first().args[0]).toBe(son.preMix)
    expect(spy.calls.mostRecent().args[0]).toBe(son.postMix)
  })
})


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<title>compact2 - org.w3c.dom.bootstrap (Java Platform SE 8 )</title>
<meta name="date" content="2014-12-17">
<meta name="keywords" content="org.w3c.dom.bootstrap package">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">

compact2 - org.w3c.dom.bootstrap

Classes

DOMImplementationRegistry


text:
package fr.utbm.vi51.controller;

import java.util.UUID;

import fr.utbm.vi51.event.AllLemmingDig;
import fr.utbm.vi51.event.AllLemmingHalfTurn;
import fr.utbm.vi51.event.ChangeLevel;
import fr.utbm.vi51.event.ChangeLevelAndRebuildModel;
import fr.utbm.vi51.event.KillOneLemming;
import fr.utbm.vi51.event.StartSimulation;
import fr.utbm.vi51.event.StepByStepSimulation;
import fr.utbm.vi51.event.StopSimulation;
import fr.utbm.vi51.event.TerminateSimulation;
import io.sarl.lang.core.Address;
import io.sarl.lang.core.Event;
import io.sarl.lang.core.EventSpace;
import io.sarl.util.Scopes;

/**
 *
 * Allows the GUI to send commands to the Environment
 *
 *
 */
public class Controller {

	private final EventSpace space;
	private final UUID uuid;
	private final Address address;
	private final Address addressReceiver;

	public Controller(EventSpace space, Address adr) {
		this.space = space;
		this.uuid = UUID.randomUUID();
		this.address = new Address(space.getID(), this.uuid);
		this.addressReceiver = adr;
	}

	/**
	 * Starts a new simulation
	 *
	 */
	public void newSimulation() {
		this.emitEvent(new StartSimulation());
	}

	public void stopSimulation() {
		this.emitEvent(new StopSimulation());
	}

	public void changeLevel(String level) {
		this.emitEvent(new ChangeLevelAndRebuildModel(level));
	}

	public void preparationToQuit(){
		this.emitEvent(new TerminateSimulation());
	}

	public void stepByStep() {
		this.emitEvent(new StepByStepSimulation());
//		System.out.println("coup par coup");
	}

	private void emitEvent(Event event) {
		event.setSource(this.address);
		this.space.emit(event, Scopes.addresses(this.addressReceiver));
	}

	public void OrderAllLemmingDig() {
		this.emitEvent(new AllLemmingDig());
	}

	public void OrderAllLemmingHalfTurn() {
		this.emitEvent(new AllLemmingHalfTurn());

	}

	public void OrderKillRandomLemming() {

		this.emitEvent(new KillOneLemming());

	}

}


text:
namespace Orleans.CodeGeneration
{
    using System;
    using System.Reflection;

    /// <summary>
    /// The attribute which informs the code generator that code should be generated an assembly.
    /// </summary>
    [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
    public class KnownAssemblyAttribute : Attribute
    {
        public KnownAssemblyAttribute(Type type)
        {
            this.Assembly = type.GetTypeInfo().Assembly;
        }

        public KnownAssemblyAttribute(string assemblyName)
        {
            this.Assembly = Assembly.Load(new AssemblyName(assemblyName));
        }

        /// <summary>
        /// Gets or sets the assembly to include in code generation.
        /// </summary>
        public Assembly Assembly { get; set; }

        /// <summary>
        /// Gets or sets a value indicating whether or not to assume that all types in the specified assembly are
        /// serializable.
        /// </summary>
        /// <remarks>This is equivalent to specifying <see cref="KnownTypeAttribute"/> for all types.</remarks>
        public bool TreatTypesAsSerializable { get; set; }
    }
}


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.datamigration.models;

import com.azure.core.http.rest.Response;
import com.azure.core.util.Context;
import com.azure.resourcemanager.datamigration.fluent.models.ProjectTaskInner;

/** An immutable client-side representation of ProjectTask. */
public interface ProjectTask {
    /**
     * Gets the id property: Fully qualified resource Id for the resource.
     *
     * @return the id value.
     */
    String id();

    /**
     * Gets the name property: The name of the resource.
     *
     * @return the name value.
     */
    String name();

    /**
     * Gets the type property: The type of the resource.
     *
     * @return the type value.
     */
    String type();

    /**
     * Gets the etag property: HTTP strong entity tag value. This is ignored if submitted.
     *
     * @return the etag value.
     */
    String etag();

    /**
     * Gets the properties property: Custom task properties.
     *
     * @return the properties value.
     */
    ProjectTaskProperties properties();

    /**
     * Gets the inner com.azure.resourcemanager.datamigration.fluent.models.ProjectTaskInner object.
     *
     * @return the inner object.
     */
    ProjectTaskInner innerModel();

    /** The entirety of the ProjectTask definition. */
    interface Definition
        extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate {
    }
    /** The ProjectTask definition stages. */
    interface DefinitionStages {
        /** The first stage of the ProjectTask definition. */
        interface Blank extends WithParentResource {
        }
        /** The stage of the ProjectTask definition allowing to specify parent resource. */
        interface WithParentResource {
            /**
             * Specifies groupName, serviceName, projectName.
             *
             * @param groupName Name of the resource group.
             * @param serviceName Name of the service.
             * @param projectName Name of the project.
             * @return the next definition stage.
             */
            WithCreate withExistingProject(String groupName, String serviceName, String projectName);
        }
        /**
         * The stage of the ProjectTask definition which contains all the minimum required properties for the resource
         * to be created, but also allows for any other optional properties to be specified.
         */
        interface WithCreate extends DefinitionStages.WithEtag, DefinitionStages.WithProperties {
            /**
             * Executes the create request.
             *
             * @return the created resource.
             */
            ProjectTask create();

            /**
             * Executes the create request.
             *
             * @param context The context to associate with this operation.
             * @return the created resource.
             */
            ProjectTask create(Context context);
        }
        /** The stage of the ProjectTask definition allowing to specify etag. */
        interface WithEtag {
            /**
             * Specifies the etag property: HTTP strong entity tag value. This is ignored if submitted..
             *
             * @param etag HTTP strong entity tag value. This is ignored if submitted.
             * @return the next definition stage.
             */
            WithCreate withEtag(String etag);
        }
        /** The stage of the ProjectTask definition allowing to specify properties. */
        interface WithProperties {
            /**
             * Specifies the properties property: Custom task properties.
             *
             * @param properties Custom task properties.
             * @return the next definition stage.
             */
            WithCreate withProperties(ProjectTaskProperties properties);
        }
    }
    /**
     * Begins update for the ProjectTask resource.
     *
     * @return the stage of resource update.
     */
    ProjectTask.Update update();

    /** The template for ProjectTask update. */
    interface Update extends UpdateStages.WithEtag, UpdateStages.WithProperties {
        /**
         * Executes the update request.
         *
         * @return the updated resource.
         */
        ProjectTask apply();

        /**
         * Executes the update request.
         *
         * @param context The context to associate with this operation.
         * @return the updated resource.
         */
        ProjectTask apply(Context context);
    }
    /** The ProjectTask update stages. */
    interface UpdateStages {
        /** The stage of the ProjectTask update allowing to specify etag. */
        interface WithEtag {
            /**
             * Specifies the etag property: HTTP strong entity tag value. This is ignored if submitted..
             *
             * @param etag HTTP strong entity tag value. This is ignored if submitted.
             * @return the next definition stage.
             */
            Update withEtag(String etag);
        }
        /** The stage of the ProjectTask update allowing to specify properties. */
        interface WithProperties {
            /**
             * Specifies the properties property: Custom task properties.
             *
             * @param properties Custom task properties.
             * @return the next definition stage.
             */
            Update withProperties(ProjectTaskProperties properties);
        }
    }
    /**
     * Refreshes the resource to sync with Azure.
     *
     * @return the refreshed resource.
     */
    ProjectTask refresh();

    /**
     * Refreshes the resource to sync with Azure.
     *
     * @param context The context to associate with this operation.
     * @return the refreshed resource.
     */
    ProjectTask refresh(Context context);

    /**
     * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. This method
     * cancels a task if it's currently queued or running.
     *
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return a task resource.
     */
    ProjectTask cancel();

    /**
     * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. This method
     * cancels a task if it's currently queued or running.
     *
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return a task resource.
     */
    Response<ProjectTask> cancelWithResponse(Context context);
}