text:
<?php
class Kwf_Mail extends Zend_Mail
{
    protected $_attachImages = false;
    protected $_domain = null;

    public function __construct($mustNotBeSet = null)
    {
        if ($mustNotBeSet) {
            throw new Kwf_Exception("Kwf_Mail got replaced with Kwf_Mail_Template");
        }
        parent::__construct('utf-8');
    }

    public function getMailContent($type = Kwf_Model_Mail_Row::MAIL_CONTENT_AUTO)
    {
        if ($type == Kwf_Model_Mail_Row::MAIL_CONTENT_AUTO) {
            $ret = $this->getBodyHtml(true);
            if (!$ret) $ret = $this->getBodyText(true);
            return $ret;
        } else if ($type == Kwf_Model_Mail_Row::MAIL_CONTENT_HTML) {
            return $this->getBodyHtml(true);
        } else if ($type == Kwf_Model_Mail_Row::MAIL_CONTENT_TEXT) {
            return $this->getBodyText(true);
        }
        return null;
    }

    public function addCc($email, $name='')
    {
        if (Kwf_Registry::get('config')->debug->sendAllMailsTo) {
            if ($name) {
                $this->addHeader('X-Real-Cc', $name ." <".$email.">");
            } else {
                $this->addHeader('X-Real-Cc', $email);
            }
        } else {
            parent::addCc($email, $name);
        }
        return $this;
    }

    public function addBcc($email)
    {
        if (Kwf_Registry::get('config')->debug->sendAllMailsTo) {
            $this->addHeader('X-Real-Bcc', $email);
        } else {
            parent::addBcc($email);
        }
        return $this;
    }

    public function addTo($email, $name='')
    {
        $this->_ownTo[] = trim("$name <$email>");
        if (Kwf_Registry::get('config')->debug->sendAllMailsTo) {
            if ($name) {
                $this->addHeader('X-Real-Recipient', $name ." <".$email.">");
            } else {
                $this->addHeader('X-Real-Recipient', $email);
            }
        } else {
            parent::addTo($email, $name);
        }
        return $this;
    }

    public function setAttachImages($attachImages)
    {
        $this->_attachImages = $attachImages;
        return $this;
    }

    public function setDomain($domain)
    {
        $this->_domain = $domain;
        return $this;
    }

    public function getDomain()
    {
        if (!$this->_domain) {
            $this->_domain = Kwf_Config::getValue('server.domain');
        }
        return $this->_domain;
    }

    public function setBodyHtml($html, $charset = null, $encoding = Zend_Mime::ENCODING_QUOTEDPRINTABLE)
    {
        while (preg_match('/(img src|background)=\"\/(.*?)\"/i', $html, $matches)) {
            $path = '/' . $matches[2];
            if ($this->_attachImages) {
                if (substr($path, 0, 6) == '/media') {
                    $parts = explode('/', substr($path, 1));
                    $class = $parts[1];
                    $id = $parts[2];
                    $type = $parts[3];
                    $checksum = $parts[4];
                    $filename = $parts[6];
                    if ($checksum != Kwf_Media::getChecksum($class, $id, $type, $filename)) {
                        throw new Kwf_Exception_AccessDenied('Access to file not allowed.');
                    }
                    $output = Kwf_Media::getOutputWithoutCheckingIsValid($class, $id, $type);
                } else {
                    try {
                        $f = new Kwf_Assets_Loader();
                        $output = $f->getFileContents(substr($path, 8));
                    } catch (Kwf_Exception_NotFound $e) {
                        throw new Kwf_Exception('Asset not found: ' . $path);
                    }
                }
                if (isset($output['contents'])) {
                    $contents = $output['contents'];
                } else if (isset($output['file'])) {
                    $contents = file_get_contents($output['file']);
                } else {
                    throw new Kwf_Exception("didn't get image contents");
                }
                $image = new Zend_Mime_Part($contents);
                $image->type = $output['mimeType'];
                $image->disposition = Zend_Mime::DISPOSITION_INLINE;
                $image->encoding = Zend_Mime::ENCODING_BASE64;
                $filename = rawurldecode(substr(strrchr($path, '/'), 1));
                $filename = preg_replace('/([^a-z0-9\-\.]+)/i', '_', $filename);
                $image->filename = $filename;
                $image->id = md5($path);
                $this->setType(Zend_Mime::MULTIPART_RELATED);
                $this->addAttachment($image);
                $replace = "cid:{$image->id}";
            } else {
                $replace = "http://" . $this->getDomain() . $path;
            }
            $html = str_replace($matches[0], "{$matches[1]}=\"$replace\"", $html);
        }
        parent::setBodyHtml($html, $charset, $encoding);
    }

    public function setFrom($email, $name='')
    {
        if (empty($email)) {
            throw new Kwf_Exception("Email address '$email' cannot be set as from part in a mail. Empty or invalid address.");
        }
        parent::setFrom($email, $name);
        return $this;
    }

    public function send($transport = null)
    {
        $mailSendAll = Kwf_Registry::get('config')->debug->sendAllMailsTo;
        if ($mailSendAll) {
            parent::addTo($mailSendAll);
        }

        $mailSendAllBcc = Kwf_Registry::get('config')->debug->sendAllMailsBcc;
        if ($mailSendAllBcc) {
            parent::addBcc($mailSendAllBcc);
        }

        if ($this->getFrom() == null) {
            $sender = $this->getSenderFromConfig();
            $this->setFrom($sender['address'], $sender['name']);
        }

        if (!$transport) {
            if (Kwf_Config::getValue('email.smtp.host')) {
                $transport = new Zend_Mail_Transport_Smtp(
                    Kwf_Config::getValue('email.smtp.host'),
                    array(
                        'auth' => Kwf_Config::getValue('email.smtp.auth'),
                        'username' => Kwf_Config::getValue('email.smtp.username'),
                        'password' => Kwf_Config::getValue('email.smtp.password'),
                        'ssl' => Kwf_Config::getValue('email.smtp.ssl'),
                        'port' => Kwf_Config::getValue('email.smtp.port'),
                    )
                );
            } else {
                if ($this->getReturnPath()) {
                    $transport = new Zend_Mail_Transport_Sendmail('-f ' . $this->getReturnPath());
                } else {
                    // default transport
                }
            }
        }

        return parent::send($transport);
    }

    public static function getSenderFromConfig()
    {
        if (isset($_SERVER['HTTP_HOST'])) {
            $host = $_SERVER['HTTP_HOST'];
        } else {
            $host = Kwf_Registry::get('config')->server->domain;
        }
        $hostNonWww = preg_replace('#^www\\.#', '', $host);
        return array(
            'address' => str_replace('%host%', $hostNonWww, Kwf_Registry::get('config')->email->from->address),
            'name' => str_replace('%host%', $hostNonWww, Kwf_Registry::get('config')->email->from->name)
        );
    }
}


text:
//
//  W A R N I N G
//  -------------
//
// This file is not part of the Qt API.  It exists purely as an
// implementation detail.  This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.

#ifndef Patternist_XsdElement_H
#define Patternist_XsdElement_H

#include <private/qschemacomponent_p.h>
#include <private/qschematype_p.h>
#include <private/qxsdalternative_p.h>
#include <private/qxsdidentityconstraint_p.h>
#include <private/qxsdcomplextype_p.h>

#include <QtCore/QList>
#include <QtCore/QSet>

QT_BEGIN_NAMESPACE

namespace QPatternist
{
    /**
     * @short Represents a XSD element object.
     *
     * This class represents the element object of a XML schema as described
     * here.
     *
     * It contains information from either a top-level element declaration (as child of a schema object)
     * or a local element declaration (as descendant of an complexType object).
     *
     * @see XML Schema API reference
     * @ingroup Patternist_schema
     * @author Tobias Koenig <tobias.koenig@nokia.com>
     */
    class XsdElement : public XsdTerm
    {
        public:
            typedef QExplicitlySharedDataPointer<XsdElement> Ptr;
            typedef QList<XsdElement::Ptr> List;

            /**
             * Describes the constraint type of the element.
             */
            enum ConstraintType
            {
                NoneConstraint,     ///< The value of the element has no constraints.
                DefaultConstraint,  ///< The element has a default value set.
                FixedConstraint     ///< The element has a fixed value set.
            };

            /**
             * Describes the scope of an element.
             *
             * @see Scope Definition
             */
            class Scope : public QSharedData
            {
                public:
                    typedef QExplicitlySharedDataPointer<Scope> Ptr;

                    /**
                     * Describes the scope of an attribute.
                     */
                    enum Variety
                    {
                        Global,    ///< The element is defined globally as child of the schema object.
                        Local      ///< The element is defined locally as child of a complex type or model group definition.
                    };

                    /**
                     * Sets the @p variety of the element scope.
                     */
                    void setVariety(Variety variety);

                    /**
                     * Returns the variety of the element scope.
                     */
                    Variety variety() const;

                    /**
                     * Sets the @p parent complex type or model group definition of the element scope.
                     */
                    void setParent(const NamedSchemaComponent::Ptr &parent);

                    /**
                     * Returns the parent complex type or model group definition of the element scope.
                     */
                    NamedSchemaComponent::Ptr parent() const;

                private:
                    Variety                   m_variety;
                    NamedSchemaComponent::Ptr m_parent;
            };

            /**
             * Describes a type table of an element.
             *
             * @see Type Table Definition
             */
            class TypeTable : public QSharedData
            {
                public:
                    typedef QExplicitlySharedDataPointer<TypeTable> Ptr;

                    /**
                     * Adds an @p alternative to the type table.
                     */
                    void addAlternative(const XsdAlternative::Ptr &alternative);

                    /**
                     * Returns the alternatives of the type table.
                     */
                    XsdAlternative::List alternatives() const;

                    /**
                     * Sets the default @p type definition.
                     */
                    void setDefaultTypeDefinition(const XsdAlternative::Ptr &type);

                    /**
                     * Returns the default type definition.
                     */
                    XsdAlternative::Ptr defaultTypeDefinition() const;

                private:
                    XsdAlternative::List m_alternatives;
                    XsdAlternative::Ptr  m_defaultTypeDefinition;
            };

            /**
             * Describes the value constraint of an element.
             *
             * @see Value Constraint Definition
             */
            class ValueConstraint : public QSharedData
            {
                public:
                    typedef QExplicitlySharedDataPointer<ValueConstraint> Ptr;

                    /**
                     * Describes the value constraint of an element.
                     */
                    enum Variety
                    {
                        Default,  ///< The element has a default value set.
                        Fixed     ///< The element has a fixed value set.
                    };

                    /**
                     * Sets the @p variety of the element value constraint.
                     */
                    void setVariety(Variety variety);

                    /**
                     * Returns the variety of the element value constraint.
                     */
                    Variety variety() const;

                    /**
                     * Sets the @p value of the constraint.
                     */
                    void setValue(const QString &value);

                    /**
                     * Returns the value of the constraint.
                     */
                    QString value() const;

                    /**
                     * Sets the lexical @p form of the constraint.
                     */
                    void setLexicalForm(const QString &form);

                    /**
                     * Returns the lexical form of the constraint.
                     */
                    QString lexicalForm() const;

                private:
                    Variety m_variety;
                    QString m_value;
                    QString m_lexicalForm;
            };

            /**
             * Creates a new element object.
             */
            XsdElement();

            /**
             * Always returns @c true, used to avoid dynamic casts.
             */
            virtual bool isElement() const;

            /**
             * Sets the @p type of the element.
             *
             * @see Type Definition
             */
            void setType(const SchemaType::Ptr &type);

            /**
             * Returns the type of the element.
             */
            SchemaType::Ptr type() const;

            /**
             * Sets the @p scope of the element.
             *
             * @see Scope Definition
             */
            void setScope(const Scope::Ptr &scope);

            /**
             * Returns the scope of the element.
             */
            Scope::Ptr scope() const;

            /**
             * Sets the value @p constraint of the element.
             *
             * @see Value Constraint Definition
             */
            void setValueConstraint(const ValueConstraint::Ptr &constraint);

            /**
             * Returns the value constraint of the element.
             */
            ValueConstraint::Ptr valueConstraint() const;

            /**
             * Sets the type table of the element.
             *
             * @see Type Table Definition
             */
            void setTypeTable(const TypeTable::Ptr &table);

            /**
             * Returns the type table of the element.
             */
            TypeTable::Ptr typeTable() const;

            /**
             * Sets whether the element is @p abstract.
             *
             * @see Abstract Definition
             */
            void setIsAbstract(bool abstract);

            /**
             * Returns whether the element is abstract.
             */
            bool isAbstract() const;

            /**
             * Sets whether the element is @p nillable.
             *
             * @see Nillable Definition
             */
            void setIsNillable(bool nillable);

            /**
             * Returns whether the element is nillable.
             */
            bool isNillable() const;

            /**
             * Sets the disallowed @p substitutions of the element.
             *
             * Only ExtensionConstraint, RestrictionConstraint and SubstitutionConstraint are allowed.
             *
             * @see Disallowed Substitutions Definition
             */
            void setDisallowedSubstitutions(const BlockingConstraints &substitutions);

            /**
             * Returns the disallowed substitutions of the element.
             */
            BlockingConstraints disallowedSubstitutions() const;

            /**
             * Sets the substitution group @p exclusions of the element.
             *
             * Only SchemaType::ExtensionConstraint and SchemaType::RestrictionConstraint are allowed.
             *
             * @see Substitution Group Exclusions Definition
             */
            void setSubstitutionGroupExclusions(const SchemaType::DerivationConstraints &exclusions);

            /**
             * Returns the substitution group exclusions of the element.
             */
            SchemaType::DerivationConstraints substitutionGroupExclusions() const;

            /**
             * Sets the identity @p constraints of the element.
             *
             * @see Identity Constraint Definition
             */
            void setIdentityConstraints(const XsdIdentityConstraint::List &constraints);

            /**
             * Adds a new identity @p constraint to the element.
             */
            void addIdentityConstraint(const XsdIdentityConstraint::Ptr &constraint);

            /**
             * Returns a list of all identity constraints of the element.
             */
            XsdIdentityConstraint::List identityConstraints() const;

            /**
             * Sets the substitution group @p affiliations of the element.
             *
             * @see Substitution Group Affiliations
             */
            void setSubstitutionGroupAffiliations(const XsdElement::List &affiliations);

            /**
             * Returns the substitution group affiliations of the element.
             */
            XsdElement::List substitutionGroupAffiliations() const;

            /**
             * Adds a substitution group to the element.
             */
            void addSubstitutionGroup(const XsdElement::Ptr &elements);

            /**
             * Returns the substitution groups of the element.
             */
            XsdElement::List substitutionGroups() const;

        private:
            SchemaType::Ptr                   m_type;
            Scope::Ptr                        m_scope;
            ValueConstraint::Ptr              m_valueConstraint;
            TypeTable::Ptr                    m_typeTable;
            bool                              m_isAbstract;
            bool                              m_isNillable;
            BlockingConstraints               m_disallowedSubstitutions;
            SchemaType::DerivationConstraints m_substitutionGroupExclusions;
            XsdIdentityConstraint::List       m_identityConstraints;
            XsdElement::List                  m_substitutionGroupAffiliations;
            QSet<XsdElement::Ptr>             m_substitutionGroups;
    };
}

QT_END_NAMESPACE

#endif

redpajama_set_name: RedPajamaGithub


text:
<?php

namespace Doctrine\ORM\Query\AST;

/**
 * Description of GroupByClause
 *
 * @license http://www.opensource.org/licenses/lgpl-license.php LGPL
 * @link    www.doctrine-project.org
 * @since   2.0
 * @version $Revision: 3938 $
 * @author  Guilherme Blanco <guilhermeblanco@hotmail.com>
 * @author  Jonathan Wage <jonwage@gmail.com>
 * @author  Roman Borschel <roman@code-factory.org>
 */
class GroupByClause extends Node
{
    public $groupByItems = array();

    public function __construct(array $groupByItems)
    {
        $this->groupByItems = $groupByItems;
    }

    public function dispatch($sqlWalker)
    {
        return $sqlWalker->walkGroupByClause($this);
    }
}


text:
/**
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.apache.tapestry5.internal.jpa;

import java.lang.reflect.Method;

import javax.annotation.PreDestroy;
import javax.enterprise.context.spi.Contextual;
import javax.enterprise.context.spi.CreationalContext;
import javax.enterprise.inject.spi.AnnotatedType;
import javax.enterprise.inject.spi.InjectionTarget;

import org.apache.tapestry5.commons.ObjectLocator;
import org.apache.tapestry5.ioc.annotations.Inject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class TapestryCDIBeanManagerForJPAEntityListeners extends NoopBeanManager
{
    private static final Logger logger = LoggerFactory
            .getLogger(TapestryCDIBeanManagerForJPAEntityListeners.class);

    @Inject
    private ObjectLocator objectLocator;

    @Override
    public <T> AnnotatedType<T> createAnnotatedType(final Class<T> type)
    {
        return new NoopAnnotatedType<T>()
        {
            @Override
            public Class<T> getJavaClass()
            {
                return type;
            }
        };
    }

    @Override
    public <T> InjectionTarget<T> createInjectionTarget(final AnnotatedType<T> type)
    {
        return new NoopInjectionTarget<T>()
        {
            @Override
            public T produce(CreationalContext<T> ctx)
            {
                return objectLocator.autobuild(type.getJavaClass());
            }

            @Override
            public void preDestroy(T instance)
            {
                try
                {
                    for (Method method : type.getJavaClass().getMethods())
                    {
                        if (method.getAnnotation(PreDestroy.class) != null)
                        {
                            method.invoke(instance);
                        }
                    }
                }
                catch (Exception e)
                {
                    logger.error(
                            "Error invoking @PreDestroy callback on instance of class "
                                    + type.getJavaClass(), e);
                }
            }
        };
    }

    @Override
    public <T> CreationalContext<T> createCreationalContext(Contextual<T> contextual)
    {
        return new NoopCreationalContext<T>();
    }
}


text:
//----------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation.
// All rights reserved.
//
// This code is licensed under the MIT License.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files(the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions :
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
//------------------------------------------------------------------------------

using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Runtime.Serialization.Json;
using System.Text;
using Microsoft.Identity.Core;

namespace Microsoft.IdentityModel.Clients.ActiveDirectory.Internal.Helpers
{
    /// <summary>
    /// The encoding helper.
    /// </summary>
    internal static class EncodingHelper
    {
        private const int MaxUrlEncodingSize = 2000;

        /// <summary>
        /// URL encode the given string.
        /// </summary>
        /// <param name="message">String to URL encode</param>
        /// <returns>URL encoded string</returns>
        /// <remarks>This method encodes the space ' ' character as "+" rather than "%20".</remarks>
        public static string UrlEncode(string message)
        {
            if (string.IsNullOrEmpty(message))
            {
                return message;
            }

            if (message.Length < MaxUrlEncodingSize)
            {
                // This optimization is done for most common scenarios where the message length will not exceed MaxUrlEncodingSize
                message = Uri.EscapeDataString(message);
                message = message.Replace("%20", "+");
            }
            else
            {
                StringBuilder sb = new StringBuilder();
                int loops = message.Length / MaxUrlEncodingSize;

                for (int i = 0; i <= loops; i++)
                {
                    if (i < loops)
                    {
                        sb.Append(Uri.EscapeDataString(message.Substring(MaxUrlEncodingSize * i, MaxUrlEncodingSize)));
                    }
                    else
                    {
                        sb.Append(Uri.EscapeDataString(message.Substring(MaxUrlEncodingSize * i)));
                    }
                }

                message = sb.ToString();
                message = message.Replace("%20", "+");
            }

            return message;
        }

        /// <summary>
        /// Decode the given URL encoded string.
        /// </summary>
        /// <param name="message">URL encoded string to decode</param>
        /// <returns>Decoded string</returns>
        /// <remarks>This method decodes "+" (as well as "%20") into the space character ' '.</remarks>
        public static string UrlDecode(string message)
        {
            if (string.IsNullOrEmpty(message))
            {
                return message;
            }

            message = message.Replace("+", "%20");
            message = Uri.UnescapeDataString(message);

            return message;
        }

        public static void AddKeyValueString(StringBuilder messageBuilder, string key, string value)
        {
            AddKeyValueString(messageBuilder, key, value.ToCharArray());
        }

        /// <summary>
        /// Parse a delimited string of key-value pairs in to a dictionary.
        /// </summary>
        /// <param name="input">Delimited string of key-value pairs</param>
        /// <param name="delimiter">Character used as a delimiter between key-value pairs</param>
        /// <param name="urlDecode">True to perform URL decoding of both the keys and values</param>
        /// <param name="lowercaseKeys">True to make all resulting keys lower-case</param>
        /// <param name="requestContext">call state to pass correlation id and logger instance</param>
        /// <returns>Dictionary of string key-value pairs</returns>
        public static Dictionary<string, string> ParseKeyValueList(string input, char delimiter, bool urlDecode, bool lowercaseKeys,
            RequestContext requestContext)
        {
            return ParseKeyValueList(input, delimiter, urlDecode, lowercaseKeys, requestContext, strict: false);
        }

        /// <summary>
        /// Parse a delimited string of key-value pairs in to a dictionary.
        /// </summary>
        /// <param name="input">Delimited string of key-value pairs</param>
        /// <param name="delimiter">Character used as a delimiter between key-value pairs</param>
        /// <param name="urlDecode">True to perform URL decoding of both the keys and values</param>
        /// <param name="lowercaseKeys">True to make all resulting keys lower-case</param>
        /// <param name="requestContext">call state to pass correlation id and logger instance</param>
        /// <exception cref="ArgumentException">Thrown if a malformed key-value pair is present in <paramref name="input"/></exception>
        /// <returns>Dictionary of string key-value pairs</returns>
        public static Dictionary<string, string> ParseKeyValueListStrict(string input, char delimiter, bool urlDecode, bool lowercaseKeys,
            RequestContext requestContext)
        {
            return ParseKeyValueList(input, delimiter, urlDecode, lowercaseKeys, requestContext, strict: true);
        }

        /// <summary>
        /// Parse a delimited string of key-value pairs in to a dictionary.
        /// </summary>
        /// <param name="input">Delimited string of key-value pairs</param>
        /// <param name="delimiter">Character used as a delimiter between key-value pairs</param>
        /// <param name="urlDecode">True to perform URL decoding of both the keys and values</param>
        /// <param name="lowercaseKeys">True to make all resulting keys lower-case</param>
        /// <param name="requestContext">call state to pass correlation id and logger instance</param>
        /// <param name="strict">Throw <see cref="ArgumentException"/> when the input string contains a malformed key-value pair</param>
        /// <exception cref="ArgumentException">Thrown if <paramref name="strict"/> is true and a malformed key-value pair is present in <paramref name="input"/></exception>
        /// <returns>Dictionary of string key-value pairs</returns>
        private static Dictionary<string, string> ParseKeyValueList(string input, char delimiter, bool urlDecode, bool lowercaseKeys,
            RequestContext requestContext, bool strict)
        {
            var response = new Dictionary<string, string>();

            List<string> queryPairs = SplitWithQuotes(input, delimiter);

            foreach (string queryPair in queryPairs)
            {
                List<string> pair = SplitWithQuotes(queryPair, '=');

                if (pair.Count == 2 && !string.IsNullOrWhiteSpace(pair[0]) && !string.IsNullOrWhiteSpace(pair[1]))
                {
                    string key = pair[0];
                    string value = pair[1];

                    // Url decoding is needed for parsing OAuth response, but not for parsing WWW-Authenticate header in 401 challenge
                    if (urlDecode)
                    {
                        key = UrlDecode(key);
                        value = UrlDecode(value);
                    }

                    if (lowercaseKeys)
                    {
                        key = key.Trim().ToLowerInvariant();
                    }

                    value = value.Trim().Trim(new[] { '\"' }).Trim();

                    if (response.ContainsKey(key) && requestContext != null)
                    {
                        requestContext.Logger.Warning(string.Format(CultureInfo.CurrentCulture,
                            "Key/value pair list contains redundant key '{0}'.", key));
                    }

                    response[key] = value;
                }
                else if(strict && pair.Count > 2)
                {
                    throw new ArgumentException(nameof(input));
                }
            }

            return response;
        }

        /// <summary>
        /// Parse a delimited string of key-value pairs in to a dictionary.
        /// </summary>
        /// <param name="input">Delimited string of key-value pairs</param>
        /// <param name="delimiter">Character used as a delimiter between key-value pairs</param>
        /// <param name="urlDecode">True to perform URL decoding of both the keys and values</param>
        /// <param name="requestContext">call state to pass correlation id and logger instance</param>
        /// <remarks>Keys are forced to lower-cased</remarks>
        /// <returns>Dictionary of string key-value pairs</returns>
        public static Dictionary<string, string> ParseKeyValueList(string input, char delimiter, bool urlDecode, RequestContext requestContext)
        {
            return ParseKeyValueList(input, delimiter, urlDecode, true, requestContext, strict: false);
        }

        /// <summary>
        /// Create a <see cref="Stream"/> from the given string.
        /// </summary>
        /// <param name="s">String to create a <see cref="Stream"/> from</param>
        /// <returns><see cref="Stream"/> from a string</returns>
        public static Stream GenerateStreamFromString(string s)
        {
            MemoryStream stream = new MemoryStream();
            StreamWriter writer = new StreamWriter(stream);
            writer.Write(s);
            writer.Flush();
            stream.Position = 0;
            return stream;
        }

        /// <summary>
        /// Deserialize the given JSON string in to the specified type <typeparamref name="T"/>
        /// </summary>
        /// <typeparam name="T">Type to deserialize the JSON as</typeparam>
        /// <param name="response">JSON string</param>
        /// <returns>Deserialized type <typeparamref name="T"/></returns>
        public static T DeserializeResponse<T>(string response)
        {
            DataContractJsonSerializer serializer = new DataContractJsonSerializer(typeof(T));

            if (response == null)
            {
                return default(T);
            }

            using (Stream stream = GenerateStreamFromString(response))
            {
                return ((T)serializer.ReadObject(stream));
            }
        }

        /// <summary>
        /// Base64 encode the given string.
        /// </summary>
        /// <param name="input">String to base64 encode</param>
        /// <returns>Base64 encoded string</returns>
        internal static string Base64Encode(string input)
        {
            string encodedString = String.Empty;
            if (!String.IsNullOrEmpty(input))
            {
                encodedString = Convert.ToBase64String(Encoding.UTF8.GetBytes(input));
            }

            return encodedString;
        }

        /// <summary>
        /// Decode the given base64 encoded string.
        /// </summary>
        /// <param name="encodedString">Base64 encoded string</param>
        /// <returns>Decoded string</returns>
        internal static string Base64Decode(string encodedString)
        {
            string output = null;
            if (!String.IsNullOrEmpty(encodedString))
            {
                byte[] outputBytes = Convert.FromBase64String(encodedString);
                output = Encoding.UTF8.GetString(outputBytes, 0, outputBytes.Length);
            }

            return output;
        }

        internal static char[] UrlEncode(char[] message)
        {
            if (message == null)
            {
                return null;
            }

            var encodedMessage = new char[message.Length * 2];
            int length = 0;
            var singleChar = new char[1];
            foreach (char ch in message)
            {
                singleChar[0] = ch;
                var str = new string(singleChar);
                string encodedStr = UrlEncode(str);
                char[] encodedSingleChar = encodedStr.ToCharArray();
                if (length + encodedSingleChar.Length > encodedMessage.Length)
                {
                    Array.Resize(ref encodedMessage, encodedMessage.Length + message.Length * 2);
                }

                encodedSingleChar.CopyTo(encodedMessage, length);
                length += encodedSingleChar.Length;
            }

            Array.Resize(ref encodedMessage, length);
            return encodedMessage;
        }

        /// <summary>
        /// Split a string into individual elements by the specified delimiter, where
        /// a delimiter enclosed within double-quotes '"' is considered to be part of the same
        /// single element.
        /// </summary>
        /// <param name="input">Delimited string</param>
        /// <param name="delimiter">Element delimiter</param>
        /// <returns>List of elements</returns>
        internal static List<string> SplitWithQuotes(string input, char delimiter)
        {
            List<string> items = new List<string>();

            if (string.IsNullOrWhiteSpace(input))
            {
                return items;
            }

            int startIndex = 0;
            bool insideString = false;
            string item;
            for (int i = 0; i < input.Length; i++)
            {
                if (input[i] == delimiter && !insideString)
                {
                    item = input.Substring(startIndex, i - startIndex);
                    if (!string.IsNullOrWhiteSpace(item.Trim()))
                    {
                        items.Add(item);
                    }

                    startIndex = i + 1;
                }
                else if (input[i] == '"')
                {
                    insideString = !insideString;
                }
            }

            item = input.Substring(startIndex);
            if (!string.IsNullOrWhiteSpace(item.Trim()))
            {
                items.Add(item);
            }

            return items;
        }

        internal static void AddKeyValueString(StringBuilder messageBuilder, string key, char[] value)
        {
            string delimiter = (messageBuilder.Length == 0) ? string.Empty : "&";
            messageBuilder.AppendFormat(CultureInfo.CurrentCulture, "{0}{1}=", delimiter, key);
            messageBuilder.Append(value);
        }

        internal static string GetString(byte[] bytes)
        {
            char[] chars = new char[bytes.Length / sizeof(char)];
            System.Buffer.BlockCopy(bytes, 0, chars, 0, bytes.Length);
            return new string(chars);
        }
    }
}


text:
ACCEPTED

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Bull. Misc. Inform. Kew 1934:444. 1934

#### Original name
Andropogon pertusus var. decipiens

### Remarks
null


text:
<!DOCTYPE html>
<!--
Copyright 2011 Software Freedom Conservancy. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<title>screenshot_test.html</title>
<script src="../test/test_bootstrap.js"></script>
<script>
  goog.require('webdriver.Builder');
  goog.require('webdriver.testing.asserts');
  goog.require('webdriver.testing.jsunit');
</script>
<iframe src="ajaxy_page.html" width="100%" height="300px"></iframe>
<script>
  function testTakingScreenshots() {
    var driver = new webdriver.Builder().build();
    driver.switchTo().frame(0);

    var typer = driver.findElement(By.name('typer'));
    typer.sendKeys('bob');
    assertThat(typer.getAttribute('value'), equals('bob'));

    driver.findElement(By.id('red')).click();

    var screenshot1 = G_testRunner.takeScreenshot(driver, 'before-update');

    driver.findElement(By.name('submit')).click();
    driver.manage().timeouts().setScriptTimeout(15 * 1000);
    driver.executeAsyncScript(
        'window.registerListener(arguments[arguments.length - 1]);'),

    G_testRunner.takeScreenshot(driver, 'post-update').
        then(function(screenshot2) {
          screenshot1.then(function(screenshot1) {
            assertNotEquals('The two screenshots should differ!',
                screenshot1, screenshot2);
          });
        });
  }
</script>


text:
<?php

/**
 * @see https://developers.podio.com/doc/tasks
 */
class PodioTask extends PodioObject
{
    public function __construct($podio, $attributes = array())
    {
        parent::__construct($podio);
        $this->property('task_id', 'integer', array('id' => true));
        $this->property('status', 'string');
        $this->property('group', 'string');
        $this->property('text', 'string');
        $this->property('description', 'string');
        $this->property('private', 'boolean');
        $this->property('due_on', 'datetime');
        $this->property('due_date', 'string');
        $this->property('due_time', 'string');
        $this->property('space_id', 'integer');
        $this->property('link', 'string');
        $this->property('created_on', 'datetime');
        $this->property('completed_on', 'datetime');
        $this->property('external_id', 'string');

        $this->has_one('ref', 'Reference');
        $this->has_one('created_by', 'ByLine');
        $this->has_one('completed_by', 'ByLine');
        $this->has_one('created_via', 'Via');
        $this->has_one('deleted_via', 'Via');
        $this->has_one('completed_via', 'Via');
        $this->has_one('responsible', 'User', array('json_value' => 'user_id'));
        $this->has_one('reminder', 'Reminder');
        $this->has_one('recurrence', 'Recurrence');
        $this->has_many('labels', 'TaskLabel', array('json_value' => 'label_id', 'json_target' => 'label_ids'));
        $this->has_many('files', 'File', array('json_value' => 'file_id', 'json_target' => 'file_ids'));
        $this->has_many('comments', 'Comment');

        $this->init($attributes);
    }

    /**
     * Creates or updates a task
     */
    public function save()
    {
        if ($this->id) {
            return self::update($this->id, $this);
        } else {
            $new = self::create($this);
            $this->task_id = $new->task_id;
            return $this;
        }
    }

    /**
     * Complete a task
     */
    public function completed()
    {
        return self::complete($this->id);
    }

    /**
     * Incomplete a task
     */
    public function incompleted()
    {
        return self::incomplete($this->id);
    }

    /**
     * Delete a task
     */
    public function destroy()
    {
        return self::delete($this->id);
    }

    /**
     * @see https://developers.podio.com/doc/tasks/create-task-22419
     */
    public function create($attributes = array(), $options = array())
    {
        $url = $this->podio->url_with_options("/task/", $options);
        return $this->member($this->podio->post($url, $attributes));
    }

    /**
     * @see https://developers.podio.com/doc/tasks/create-task-with-reference-22420
     */
    public function create_for($ref_type, $ref_id, $attributes = array(), $options = array())
    {
        $url = $this->podio->url_with_options("/task/{$ref_type}/{$ref_id}/", $options);
        return $this->member($this->podio->post($url, $attributes));
    }

    /**
     * @see https://developers.podio.com/doc/tasks/get-task-22413
     */
    public function get($task_id)
    {
        return $this->member($this->podio->get("/task/{$task_id}"));
    }

    /**
     * @see https://developers.podio.com/doc/tasks/get-tasks-77949
     */
    public function get_all($attributes = array())
    {
        return $this->listing($this->podio->get("/task/", $attributes));
    }

    /**
     * @see https://developers.podio.com/doc/tasks/delete-task-77179
     */
    public function delete($task_id)
    {
        return $this->podio->delete("/task/{$task_id}");
    }

    /**
     * @see https://developers.podio.com/doc/tasks/remove-task-reference-6146114
     */
    public function delete_ref($task_id)
    {
        return $this->podio->delete("/task/{$task_id}/ref");
    }

    /**
     * @see https://developers.podio.com/doc/tasks/update-task-10583674
     */
    public function update($task_id, $attributes = array(), $options = array())
    {
        $url = $this->podio->url_with_options("/task/{$task_id}", $options);
        return $this->member($this->podio->put($url, $attributes));
    }

    /**
     * @see https://developers.podio.com/doc/tasks/assign-task-22412
     */
    public function assign($task_id, $attributes = array())
    {
        return $this->podio->post("/task/{$task_id}/assign", $attributes);
    }

    /**
     * @see https://developers.podio.com/doc/tasks/complete-task-22432
     */
    public function complete($task_id)
    {
        return $this->podio->post("/task/{$task_id}/complete");
    }

    /**
     * @see https://developers.podio.com/doc/tasks/incomplete-task-22433
     */
    public function incomplete($task_id)
    {
        return $this->podio->post("/task/{$task_id}/incomplete");
    }

    /**
     * @see https://developers.podio.com/doc/tasks/rank-task-81015
     */
    public function rank($task_id, $attributes = array())
    {
        return $this->podio->post("/task/{$task_id}/rank", $attributes);
    }

    /**
     * @see https://developers.podio.com/doc/calendar/get-task-calendar-as-ical-10195650
     */
    public function ical($task_id)
    {
        return $this->podio->get("/calendar/task/{$task_id}/ics/")->body;
    }

    /**
     * @see https://developers.podio.com/doc/tasks/get-task-summary-1612017
     */
    public function get_summary($attributes = array())
    {
        $result = $this->podio->get("/task/summary", $attributes)->json_body();
        $result['overdue']['tasks'] = $this->listing($result['overdue']['tasks']);
        $result['today']['tasks'] = $this->listing($result['today']['tasks']);
        $result['other']['tasks'] = $this->listing($result['other']['tasks']);
        return $result;
    }

    /**
     * @see https://developers.podio.com/doc/tasks/get-task-summary-for-personal-1657217
     */
    public function get_summary_personal($attributes = array())
    {
        $result = $this->podio->get("/task/personal/summary", $attributes)->json_body();
        $result['overdue']['tasks'] = $this->listing($result['overdue']['tasks']);
        $result['today']['tasks'] = $this->listing($result['today']['tasks']);
        $result['other']['tasks'] = $this->listing($result['other']['tasks']);
        return $result;
    }

    /**
     * @see https://developers.podio.com/doc/tasks/get-task-summary-for-organization-1612063
     */
    public function get_summary_for_org($org_id, $attributes = array())
    {
        $result = $this->podio->get("/task/org/{$org_id}/summary", $attributes)->json_body();
        $result['overdue']['tasks'] = $this->listing($result['overdue']['tasks']);
        $result['today']['tasks'] = $this->listing($result['today']['tasks']);
        $result['other']['tasks'] = $this->listing($result['other']['tasks']);
        return $result;
    }

    /**
     * @see https://developers.podio.com/doc/tasks/get-task-summary-for-space-1612130
     */
    public function get_summary_for_space($space_id, $attributes = array())
    {
        $result = $this->podio->get("/task/space/{$space_id}/summary", $attributes)->json_body();
        $result['overdue']['tasks'] = $this->listing($result['overdue']['tasks']);
        $result['today']['tasks'] = $this->listing($result['today']['tasks']);
        $result['other']['tasks'] = $this->listing($result['other']['tasks']);
        return $result;
    }

    /**
     * @see https://developers.podio.com/doc/tasks/get-task-summary-for-reference-1657980
     */
    public function get_summary_for($ref_type, $ref_id, $attributes = array())
    {
        $result = $this->podio->get("/task/{$ref_type}/{$ref_id}/summary", $attributes)->json_body();
        $result['overdue']['tasks'] = $this->listing($result['overdue']['tasks']);
        $result['today']['tasks'] = $this->listing($result['today']['tasks']);
        $result['other']['tasks'] = $this->listing($result['other']['tasks']);
        return $result;
    }

}


text:
from django import forms
from django.conf import settings
from django.forms import ValidationError

import happyforms
from jinja2.filters import do_filesizeformat
from django.utils.translation import ugettext as _, ugettext_lazy as _lazy

from mkt.api.forms import SluggableModelChoiceField
from mkt.comm.models import CommunicationThread
from mkt.constants import comm
from mkt.extensions.models import Extension
from mkt.webapps.models import Webapp

class AppSlugForm(happyforms.Form):
    app = SluggableModelChoiceField(queryset=Webapp.with_deleted.all(),
                                    sluggable_to_field_name='app_slug')

class ExtensionSlugForm(happyforms.Form):
    extension = SluggableModelChoiceField(queryset=Extension.objects.all(),
                                          sluggable_to_field_name='slug')

class CreateCommNoteForm(happyforms.Form):
    body = forms.CharField(
        error_messages={'required': _lazy('Note body is empty.')})
    note_type = forms.TypedChoiceField(
        empty_value=comm.NO_ACTION,
        coerce=int, choices=[(x, x) for x in comm.API_NOTE_TYPE_ALLOWED],
        error_messages={'invalid_choice': _lazy(u'Invalid note type.')})

class CreateCommThreadForm(CreateCommNoteForm):
    app = SluggableModelChoiceField(queryset=Webapp.with_deleted.all(),
                                    sluggable_to_field_name='app_slug')
    version = forms.CharField()

    def clean_version(self):
        version_num = self.cleaned_data['version']
        versions = self.cleaned_data['app'].versions.filter(
            version=version_num).order_by('-created')
        if versions.exists():
            return versions[0]
        raise forms.ValidationError(
            _('Version %s does not exist' % version_num))

class CommAttachmentForm(happyforms.Form):
    attachment = forms.FileField(label=_lazy(u'Attachment:'))
    description = forms.CharField(required=False, label=_lazy(u'Description:'))

    max_upload_size = settings.MAX_REVIEW_ATTACHMENT_UPLOAD_SIZE

    def clean(self, *args, **kwargs):
        data = super(CommAttachmentForm, self).clean(*args, **kwargs)
        attachment = data.get('attachment')
        max_size = self.max_upload_size
        if attachment and attachment.size > max_size:
            # L10n: error raised when review attachment is too large.
            exc = _('Attachment exceeds maximum size of %s.' %
                    do_filesizeformat(self.max_upload_size))
            raise ValidationError(exc)
        return data

CommAttachmentFormSet = forms.formsets.formset_factory(CommAttachmentForm)

class UnCCForm(happyforms.Form):
    pk = SluggableModelChoiceField(
        queryset=CommunicationThread.objects.all(),
        sluggable_to_field_name='id')


text:
<?php

namespace common\models;

use Yii;

/**
 * This is the model class for table "SqlTrace_SqlNumber".
 *
 * @property string $sqltext_md5
 * @property integer $Amount
 * @property string $sqltext
 * @property string $Id
 * @property string $databasetype
 * @property string $update_time
 */
class SqlTraceSqlNumber extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'SqlTrace_SqlNumber';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['Amount'], 'integer'],
            [['update_time'], 'safe'],
            [['sqltext_md5'], 'string', 'max' => 64],
            [['sqltext'], 'string', 'max' => 5000],
            [['databasetype'], 'string', 'max' => 20]
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'sqltext_md5' => 'Sqltext Md5',
            'Amount' => '次数',
            'sqltext' => 'sql语句',
            'Id' => 'ID',
            'databasetype' => '数据库',
            'update_time' => '统计时间',
        ];
    }
}


text:
package com.tenable.io.api.plugins.models;

import com.fasterxml.jackson.annotation.JsonProperty;

public class PluginOutputInfo {
    private PluginDescription pluginDescription;

    /**
     * Gets plugin description.
     *
     * @return the plugin description
     */
    @JsonProperty( "plugindescription" )
    public PluginDescription getPluginDescription() {
        return pluginDescription;
    }

    /**
     * Sets plugin description.
     *
     * @param pluginDescription the plugin description
     */
    @JsonProperty( "plugindescription" )
    public void setPluginDescription( PluginDescription pluginDescription ) {
        this.pluginDescription = pluginDescription;
    }
}


text:
package com.kazigk.wail.routes;

import com.kazigk.wail.WAILRoute;
import org.jtwig.JtwigModel;
import org.jtwig.JtwigTemplate;

public class IndexRoute extends WAILRoute {
    private JtwigTemplate template = JtwigTemplate.classpathTemplate("templates/index.twig");

    @Override
    public Object handle() {
        return template.render(new JtwigModel().with("session", session));
    }
}


text:
// This software is part of the Autofac IoC container
// Copyright © 2013 Autofac Contributors
// http://autofac.org
//
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
// files (the "Software"), to deal in the Software without
// restriction, including without limitation the rights to use,
// copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following
// conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.

using System;
using System.Collections.Generic;
using System.Reflection;
using Autofac.Core;
using Autofac.Core.Registration;

namespace Autofac
{
    /// <summary>
    /// Extension methods for registering <see cref="Autofac.Core.IModule"/> instances with a container.
    /// </summary>
    public static class ModuleRegistrationExtensions
    {
        /// <summary>
        /// Registers modules found in an assembly.
        /// </summary>
        /// <param name="builder">The builder to register the modules with.</param>
        /// <param name="assemblies">The assemblies from which to register modules.</param>
        /// <exception cref="System.ArgumentNullException">
        /// Thrown if <paramref name="builder"/> is <see langword="null"/>.
        /// </exception>
        /// <returns>
        /// The <see cref="Autofac.Core.Registration.IModuleRegistrar"/> to allow
        /// additional chained module registrations.
        /// </returns>
        public static IModuleRegistrar RegisterAssemblyModules(this ContainerBuilder builder, params Assembly[] assemblies)
        {
            if (builder == null)
            {
                throw new ArgumentNullException("builder");
            }

            var registrar = new ModuleRegistrar(builder);
            return registrar.RegisterAssemblyModules<IModule>(assemblies);
        }

        /// <summary>
        /// Registers modules found in an assembly.
        /// </summary>
        /// <param name="registrar">The module registrar that will make the registrations into the container.</param>
        /// <param name="assemblies">The assemblies from which to register modules.</param>
        /// <exception cref="System.ArgumentNullException">
        /// Thrown if <paramref name="registrar"/> is <see langword="null"/>.
        /// </exception>
        /// <returns>
        /// The <see cref="Autofac.Core.Registration.IModuleRegistrar"/> to allow
        /// additional chained module registrations.
        /// </returns>
        public static IModuleRegistrar RegisterAssemblyModules(this IModuleRegistrar registrar, params Assembly[] assemblies)
        {
            if (registrar == null)
            {
                throw new ArgumentNullException("registrar");
            }

            return registrar.RegisterAssemblyModules<IModule>(assemblies);
        }

        /// <summary>
        /// Registers modules found in an assembly.
        /// </summary>
        /// <param name="builder">The builder to register the modules with.</param>
        /// <param name="assemblies">The assemblies from which to register modules.</param>
        /// <typeparam name="TModule">The type of the module to add.</typeparam>
        /// <exception cref="System.ArgumentNullException">
        /// Thrown if <paramref name="builder"/> is <see langword="null"/>.
        /// </exception>
        /// <returns>
        /// The <see cref="Autofac.Core.Registration.IModuleRegistrar"/> to allow
        /// additional chained module registrations.
        /// </returns>
        public static IModuleRegistrar RegisterAssemblyModules<TModule>(this ContainerBuilder builder, params Assembly[] assemblies)
            where TModule : IModule
        {
            if (builder == null)
            {
                throw new ArgumentNullException("builder");
            }

            var registrar = new ModuleRegistrar(builder);
            return registrar.RegisterAssemblyModules(typeof(TModule), assemblies);
        }

        /// <summary>
        /// Registers modules found in an assembly.
        /// </summary>
        /// <param name="registrar">The module registrar that will make the registrations into the container.</param>
        /// <param name="assemblies">The assemblies from which to register modules.</param>
        /// <typeparam name="TModule">The type of the module to add.</typeparam>
        /// <exception cref="System.ArgumentNullException">
        /// Thrown if <paramref name="registrar"/> is <see langword="null"/>.
        /// </exception>
        /// <returns>
        /// The <see cref="Autofac.Core.Registration.IModuleRegistrar"/> to allow
        /// additional chained module registrations.
        /// </returns>
        public static IModuleRegistrar RegisterAssemblyModules<TModule>(this IModuleRegistrar registrar, params Assembly[] assemblies)
            where TModule : IModule
        {
            if (registrar == null)
            {
                throw new ArgumentNullException("registrar");
            }

            return registrar.RegisterAssemblyModules(typeof(TModule), assemblies);
        }

        /// <summary>
        /// Registers modules found in an assembly.
        /// </summary>
        /// <param name="builder">The builder to register the modules with.</param>
        /// <param name="moduleType">The <see cref="Type"/> of the module to add.</param>
        /// <param name="assemblies">The assemblies from which to register modules.</param>
        /// <exception cref="System.ArgumentNullException">
        /// Thrown if <paramref name="builder"/> or <paramref name="moduleType"/> is <see langword="null"/>.
        /// </exception>
        /// <returns>
        /// The <see cref="Autofac.Core.Registration.IModuleRegistrar"/> to allow
        /// additional chained module registrations.
        /// </returns>
        public static IModuleRegistrar RegisterAssemblyModules(this ContainerBuilder builder, Type moduleType, params Assembly[] assemblies)
        {
            if (builder == null)
            {
                throw new ArgumentNullException("builder");
            }

            if (moduleType == null)
            {
                throw new ArgumentNullException("moduleType");
            }

            var registrar = new ModuleRegistrar(builder);
            return registrar.RegisterAssemblyModules(moduleType, assemblies);
        }

        /// <summary>
        /// Registers modules found in an assembly.
        /// </summary>
        /// <param name="registrar">The module registrar that will make the registrations into the container.</param>
        /// <param name="moduleType">The <see cref="Type"/> of the module to add.</param>
        /// <param name="assemblies">The assemblies from which to register modules.</param>
        /// <exception cref="System.ArgumentNullException">
        /// Thrown if <paramref name="registrar"/> or <paramref name="moduleType"/> is <see langword="null"/>.
        /// </exception>
        /// <returns>
        /// The <see cref="Autofac.Core.Registration.IModuleRegistrar"/> to allow
        /// additional chained module registrations.
        /// </returns>
        public static IModuleRegistrar RegisterAssemblyModules(this IModuleRegistrar registrar, Type moduleType, params Assembly[] assemblies)
        {
            if (registrar == null)
            {
                throw new ArgumentNullException("registrar");
            }

            if (moduleType == null)
            {
                throw new ArgumentNullException("moduleType");
            }

            var moduleFinder = new ContainerBuilder();

            moduleFinder.RegisterAssemblyTypes(assemblies)
                .Where(moduleType.IsAssignableFrom)
                .As<IModule>();

            using (var moduleContainer = moduleFinder.Build())
            {
                foreach (var module in moduleContainer.Resolve<IEnumerable<IModule>>())
                {
                    registrar.RegisterModule(module);
                }
            }

            return registrar;
        }

        /// <summary>
        /// Add a module to the container.
        /// </summary>
        /// <param name="builder">The builder to register the module with.</param>
        /// <typeparam name="TModule">The module to add.</typeparam>
        /// <exception cref="System.ArgumentNullException">
        /// Thrown if <paramref name="builder"/> is <see langword="null"/>.
        /// </exception>
        /// <returns>
        /// The <see cref="Autofac.Core.Registration.IModuleRegistrar"/> to allow
        /// additional chained module registrations.
        /// </returns>
        public static IModuleRegistrar RegisterModule<TModule>(this ContainerBuilder builder)
            where TModule : IModule, new()
        {
            if (builder == null)
            {
                throw new ArgumentNullException("builder");
            }

            var registrar = new ModuleRegistrar(builder);
            return registrar.RegisterModule<TModule>();
        }

        /// <summary>
        /// Add a module to the container.
        /// </summary>
        /// <param name="registrar">The module registrar that will make the registration into the container.</param>
        /// <typeparam name="TModule">The module to add.</typeparam>
        /// <exception cref="System.ArgumentNullException">
        /// Thrown if <paramref name="registrar"/> is <see langword="null"/>.
        /// </exception>
        /// <returns>
        /// The <see cref="Autofac.Core.Registration.IModuleRegistrar"/> to allow
        /// additional chained module registrations.
        /// </returns>
        public static IModuleRegistrar RegisterModule<TModule>(this IModuleRegistrar registrar)
            where TModule : IModule, new()
        {
            if (registrar == null)
            {
                throw new ArgumentNullException("registrar");
            }

            return registrar.RegisterModule(new TModule());
        }

        /// <summary>
        /// Add a module to the container.
        /// </summary>
        /// <param name="builder">The builder to register the module with.</param>
        /// <param name="module">The module to add.</param>
        /// <exception cref="System.ArgumentNullException">
        /// Thrown if <paramref name="builder"/> or <paramref name="module"/> is <see langword="null"/>.
        /// </exception>
        /// <returns>
        /// The <see cref="Autofac.Core.Registration.IModuleRegistrar"/> to allow
        /// additional chained module registrations.
        /// </returns>
        public static IModuleRegistrar RegisterModule(this ContainerBuilder builder, IModule module)
        {
            if (builder == null)
            {
                throw new ArgumentNullException("builder");
            }

            if (module == null)
            {
                throw new ArgumentNullException("module");
            }

            var registrar = new ModuleRegistrar(builder);
            return registrar.RegisterModule(module);
        }
    }
}


text:
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.

#pragma once

struct FAIDataProviderValue;

class FAIDataProviderValueDetails : public IPropertyTypeCustomization
{
public:
	/** Makes a new instance of this detail layout class for a specific detail view requesting it */
	static TSharedRef<IPropertyTypeCustomization> MakeInstance();

	/** IPropertyTypeCustomization interface */
	virtual void CustomizeHeader(TSharedRef<class IPropertyHandle> StructPropertyHandle, class FDetailWidgetRow& HeaderRow, IPropertyTypeCustomizationUtils& StructCustomizationUtils) override;
	virtual void CustomizeChildren(TSharedRef<class IPropertyHandle> StructPropertyHandle, class IDetailChildrenBuilder& StructBuilder, IPropertyTypeCustomizationUtils& StructCustomizationUtils) override;

private:

	TSharedPtr<IPropertyHandle> DataBindingProperty;
	TSharedPtr<IPropertyHandle> DataFieldProperty;
	TSharedPtr<IPropertyHandle> DefaultValueProperty;
	FAIDataProviderValue* DataPtr;

	TArray<FName> MatchingProperties;

	void OnBindingChanged();
	TSharedRef<SWidget> OnGetDataFieldContent();
	void OnDataFieldNameChange(int32 Index);
	FText GetDataFieldDesc() const;
	FText GetValueDesc() const;
	EVisibility GetBindingDescVisibility() const;
	EVisibility GetDataFieldVisibility() const;
	EVisibility GetDefaultValueVisibility() const;
};


text:
package ru.job4j.loop;

import org.junit.Test;

import static org.hamcrest.core.Is.is;
import static org.junit.Assert.assertThat;
/**
* Test.
*
* @author Filatov Evgeniy (not-found@inbox.ru)
* @version 1
* @since 19.06.2017
*/

public class PaintTest {
	/**
	* Test: piramid height = 2.
	*/
	@Test
	public void paintPiramidOfTwoStages() {
		Paint paintExemplar = new Paint();
		String testedPainting = paintExemplar.piramid(2);
		final String line = System.getProperty("line.separator");
		String expectedPainting = String.format(" ^ %s^^^%s", line, line);
		assertThat(testedPainting, is(expectedPainting));
	}
	/**
	* Test: piramid height = 3.
	*/
	@Test
	public void paintPiramidOfThreeStages() {
		Paint paintExemplar = new Paint();
		String testedPainting = paintExemplar.piramid(3);
		final String line = System.getProperty("line.separator");
		String expectedPainting = String.format("  ^  %s ^^^ %s^^^^^%s", line, line, line);
		assertThat(testedPainting, is(expectedPainting));
	}
}


text:
/*
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
 * in compliance with the License. You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under the License
 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
 * or implied. See the License for the specific language governing permissions and limitations under
 * the License.
 */
/*
 * This code was generated by https://github.com/googleapis/google-api-java-client-services/
 * Modify at your own risk.
 */

package com.google.api.services.contentwarehouse.v1.model;

/**
 * Model definition for AbuseiamAbuseType.
 *
 *
 This is the Java data model class that specifies how to parse/serialize into the JSON that is
 * transmitted over HTTP when working with the contentwarehouse API. For a detailed explanation see:
 * https://developers.google.com/api-client-library/java/google-http-java-client/json
 *

 *
 * @author Google, Inc.
 */
@SuppressWarnings("javadoc")
public final class AbuseiamAbuseType extends com.google.api.client.json.GenericJson {

  /**
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String id;

  /**
   * Optional client specific subtype of abuse that is too specific to belong in the above
   * enumeration. For example, some client may want to differentiate nudity from graphic sex, but
   * both are PORNOGRAPHY.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String subtype;

  /**
   * @return value or {@code null} for none
   */
  public java.lang.String getId() {
    return id;
  }

  /**
   * @param id id or {@code null} for none
   */
  public AbuseiamAbuseType setId(java.lang.String id) {
    this.id = id;
    return this;
  }

  /**
   * Optional client specific subtype of abuse that is too specific to belong in the above
   * enumeration. For example, some client may want to differentiate nudity from graphic sex, but
   * both are PORNOGRAPHY.
   * @return value or {@code null} for none
   */
  public java.lang.String getSubtype() {
    return subtype;
  }

  /**
   * Optional client specific subtype of abuse that is too specific to belong in the above
   * enumeration. For example, some client may want to differentiate nudity from graphic sex, but
   * both are PORNOGRAPHY.
   * @param subtype subtype or {@code null} for none
   */
  public AbuseiamAbuseType setSubtype(java.lang.String subtype) {
    this.subtype = subtype;
    return this;
  }

  @Override
  public AbuseiamAbuseType set(String fieldName, Object value) {
    return (AbuseiamAbuseType) super.set(fieldName, value);
  }

  @Override
  public AbuseiamAbuseType clone() {
    return (AbuseiamAbuseType) super.clone();
  }

}


text:
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE package SYSTEM "http://pear.php.net/dtd/package-1.0">
<package version="1.0" packagerversion="1.4.6">
 <name>Crypt_RSA</name>
 <summary>Provides RSA-like key generation, encryption/decryption, signing and signature checking</summary>
 <description>This package allows you to use two-key strong cryptography like RSA with arbitrary key length.
It uses one of the following extensions for math calculations:
 - PECL big_int extension ( http://pecl.php.net/packages/big_int ) version greater than or equal to 1.0.3
 - PHP GMP extension ( http://php.net/gmp )
 - PHP BCMath extension ( http://php.net/manual/en/ref.bc.php ) for both PHP4 and PHP5
 </description>
 <maintainers>
  <maintainer>
   <user>valyala</user>
   <name>Alexander Valyalkin</name>
   <email>valyala@gmail.com</email>
   <role>lead</role>
  </maintainer>
  </maintainers>
 <release>
  <version>1.2.0b</version>
  <date>2006-02-26</date>
  <license>PHP</license>
  <state>beta</state>
  <notes>* added toPEMString() function in Crypt_RSA_KeyPair class. It allows to store keypair in .pem file as RSA private key
* added isEqual() function in Crypt_RSA_KeyPair class. It returns true if two keypairs are equal
* added mod() and isPrime() functions to math wrappers interface
* fixed bug in getPrime() function of GMP and BCMath math wrappers, which hangs up key generating process
* added optional $random_generator parameter to Crypt_RSA_KeyPair constructor and factory() method
* added benchmark in tests/bench.php, which clearly shows performance of different math wrappers (GMP, BigInt, BCMath). In short: GMP is 5 times faster than BigInt, BCMath is 50 times slower than BigInt.
  </notes>
  <deps>
   <dep type="ext" rel="has" optional="yes">bcmath</dep>
   <dep type="ext" rel="has" optional="yes">gmp</dep>
   <dep type="pkg" rel="ge" version="1.0.3" optional="yes">big_int</dep>
  </deps>
  <provides type="class" name="Crypt_RSA" />
  <provides type="function" name="Crypt_RSA::factory" />
  <provides type="function" name="Crypt_RSA::setParams" />
  <provides type="function" name="Crypt_RSA::encrypt" />
  <provides type="function" name="Crypt_RSA::encryptBinary" />
  <provides type="function" name="Crypt_RSA::decrypt" />
  <provides type="function" name="Crypt_RSA::decryptBinary" />
  <provides type="function" name="Crypt_RSA::createSign" />
  <provides type="function" name="Crypt_RSA::validateSign" />
  <provides type="function" name="Crypt_RSA::isError" />
  <provides type="function" name="Crypt_RSA::getErrorList" />
  <provides type="function" name="Crypt_RSA::getLastError" />
  <provides type="function" name="Crypt_RSA::pushError" />
  <provides type="function" name="Crypt_RSA::getErrorHandler" />
  <provides type="function" name="Crypt_RSA::setErrorHandler" />
  <provides type="class" name="Crypt_RSA_Key" />
  <provides type="function" name="Crypt_RSA_Key::factory" />
  <provides type="function" name="Crypt_RSA_Key::getKeyLength" />
  <provides type="function" name="Crypt_RSA_Key::getModulus" />
  <provides type="function" name="Crypt_RSA_Key::getExponent" />
  <provides type="function" name="Crypt_RSA_Key::getKeyType" />
  <provides type="function" name="Crypt_RSA_Key::toString" />
  <provides type="function" name="Crypt_RSA_Key::fromString" />
  <provides type="function" name="Crypt_RSA_Key::isValid" />
  <provides type="function" name="Crypt_RSA_Key::isError" />
  <provides type="function" name="Crypt_RSA_Key::getErrorList" />
  <provides type="function" name="Crypt_RSA_Key::getLastError" />
  <provides type="function" name="Crypt_RSA_Key::pushError" />
  <provides type="function" name="Crypt_RSA_Key::getErrorHandler" />
  <provides type="function" name="Crypt_RSA_Key::setErrorHandler" />
  <provides type="class" name="Crypt_RSA_KeyPair" />
  <provides type="function" name="Crypt_RSA_KeyPair::factory" />
  <provides type="function" name="Crypt_RSA_KeyPair::generate" />
  <provides type="function" name="Crypt_RSA_KeyPair::getPublicKey" />
  <provides type="function" name="Crypt_RSA_KeyPair::getPrivateKey" />
  <provides type="function" name="Crypt_RSA_KeyPair::setRandomGenerator" />
  <provides type="function" name="Crypt_RSA_KeyPair::getKeyLength" />
  <provides type="function" name="Crypt_RSA_KeyPair::fromPEMString" />
  <provides type="function" name="Crypt_RSA_KeyPair::toPEMString" />
  <provides type="function" name="Crypt_RSA_KeyPair::isEqual" />
  <provides type="function" name="Crypt_RSA_KeyPair::isError" />
  <provides type="function" name="Crypt_RSA_KeyPair::getErrorList" />
  <provides type="function" name="Crypt_RSA_KeyPair::getLastError" />
  <provides type="function" name="Crypt_RSA_KeyPair::pushError" />
  <provides type="function" name="Crypt_RSA_KeyPair::getErrorHandler" />
  <provides type="function" name="Crypt_RSA_KeyPair::setErrorHandler" />
  <provides type="class" name="Crypt_RSA_ErrorHandler" />
  <provides type="function" name="Crypt_RSA_ErrorHandler::isError" />
  <provides type="function" name="Crypt_RSA_ErrorHandler::getErrorList" />
  <provides type="function" name="Crypt_RSA_ErrorHandler::getLastError" />
  <provides type="function" name="Crypt_RSA_ErrorHandler::pushError" />
  <provides type="function" name="Crypt_RSA_ErrorHandler::getErrorHandler" />
  <provides type="function" name="Crypt_RSA_ErrorHandler::setErrorHandler" />
  <provides type="class" name="Crypt_RSA_MathLoader" />
  <provides type="function" name="Crypt_RSA_MathLoader::loadWrapper" />
  <provides type="class" name="Crypt_RSA_Math_BigInt" />
  <provides type="function" name="Crypt_RSA_Math_BigInt::bin2int" />
  <provides type="function" name="Crypt_RSA_Math_BigInt::int2bin" />
  <provides type="function" name="Crypt_RSA_Math_BigInt::powmod" />
  <provides type="function" name="Crypt_RSA_Math_BigInt::mul" />
  <provides type="function" name="Crypt_RSA_Math_BigInt::mod" />
  <provides type="function" name="Crypt_RSA_Math_BigInt::cmpAbs" />
  <provides type="function" name="Crypt_RSA_Math_BigInt::isPrime" />
  <provides type="function" name="Crypt_RSA_Math_BigInt::getPrime" />
  <provides type="function" name="Crypt_RSA_Math_BigInt::dec" />
  <provides type="function" name="Crypt_RSA_Math_BigInt::isOne" />
  <provides type="function" name="Crypt_RSA_Math_BigInt::GCD" />
  <provides type="function" name="Crypt_RSA_Math_BigInt::invmod" />
  <provides type="function" name="Crypt_RSA_Math_BigInt::bitLen" />
  <provides type="function" name="Crypt_RSA_Math_BigInt::bitOr" />
  <provides type="function" name="Crypt_RSA_Math_BigInt::subint" />
  <provides type="function" name="Crypt_RSA_Math_BigInt::getWrapperName" />
  <provides type="class" name="Crypt_RSA_Math_BCMath" />
  <provides type="function" name="Crypt_RSA_Math_BCMath::bin2int" />
  <provides type="function" name="Crypt_RSA_Math_BCMath::int2bin" />
  <provides type="function" name="Crypt_RSA_Math_BCMath::powmod" />
  <provides type="function" name="Crypt_RSA_Math_BCMath::mul" />
  <provides type="function" name="Crypt_RSA_Math_BCMath::mod" />
  <provides type="function" name="Crypt_RSA_Math_BCMath::cmpAbs" />
  <provides type="function" name="Crypt_RSA_Math_BCMath::isPrime" />
  <provides type="function" name="Crypt_RSA_Math_BCMath::getPrime" />
  <provides type="function" name="Crypt_RSA_Math_BCMath::dec" />
  <provides type="function" name="Crypt_RSA_Math_BCMath::isOne" />
  <provides type="function" name="Crypt_RSA_Math_BCMath::GCD" />
  <provides type="function" name="Crypt_RSA_Math_BCMath::invmod" />
  <provides type="function" name="Crypt_RSA_Math_BCMath::bitLen" />
  <provides type="function" name="Crypt_RSA_Math_BCMath::bitOr" />
  <provides type="function" name="Crypt_RSA_Math_BCMath::subint" />
  <provides type="function" name="Crypt_RSA_Math_BCMath::getWrapperName" />
  <provides type="class" name="Crypt_RSA_Math_GMP" />
  <provides type="function" name="Crypt_RSA_Math_GMP::bin2int" />
  <provides type="function" name="Crypt_RSA_Math_GMP::int2bin" />
  <provides type="function" name="Crypt_RSA_Math_GMP::powmod" />
  <provides type="function" name="Crypt_RSA_Math_GMP::mul" />
  <provides type="function" name="Crypt_RSA_Math_GMP::mod" />
  <provides type="function" name="Crypt_RSA_Math_GMP::cmpAbs" />
  <provides type="function" name="Crypt_RSA_Math_GMP::isPrime" />
  <provides type="function" name="Crypt_RSA_Math_GMP::getPrime" />
  <provides type="function" name="Crypt_RSA_Math_GMP::dec" />
  <provides type="function" name="Crypt_RSA_Math_GMP::isOne" />
  <provides type="function" name="Crypt_RSA_Math_GMP::GCD" />
  <provides type="function" name="Crypt_RSA_Math_GMP::invmod" />
  <provides type="function" name="Crypt_RSA_Math_GMP::bitLen" />
  <provides type="function" name="Crypt_RSA_Math_GMP::bitOr" />
  <provides type="function" name="Crypt_RSA_Math_GMP::subint" />
  <provides type="function" name="Crypt_RSA_Math_GMP::getWrapperName" />
  <filelist>
   <file role="php" baseinstalldir="Crypt" md5sum="6a9c4ac22b2bc7dfb8272a9f675e1c4a" name="RSA.php"/>
   <file role="php" baseinstalldir="Crypt" md5sum="f1ac2bf277a5de66735e06e164940073" name="RSA/ErrorHandler.php"/>
   <file role="php" baseinstalldir="Crypt" md5sum="5a0d2996e49700fa88236a73a79bd2c0" name="RSA/Key.php"/>
   <file role="php" baseinstalldir="Crypt" md5sum="047a4cd0081b0dc67ede1c03261f0c54" name="RSA/KeyPair.php"/>
   <file role="php" baseinstalldir="Crypt" md5sum="4b9e9f3c34bcaeec0c322b099b726b02" name="RSA/MathLoader.php"/>
   <file role="php" baseinstalldir="Crypt" md5sum="78eb088a0e4424c2aa2829ebe4ede5c0" name="RSA/Math/BCMath.php"/>
   <file role="php" baseinstalldir="Crypt" md5sum="0e998825b30b34878c4ca87423ee4e87" name="RSA/Math/BigInt.php"/>
   <file role="php" baseinstalldir="Crypt" md5sum="7ab0d5da8962f3bf4cc471f2d9879111" name="RSA/Math/GMP.php"/>
   <file role="doc" baseinstalldir="Crypt" md5sum="8e699cdffe3e4e3d1341e2f1dc81d29d" name="CREDITS"/>
   <file role="doc" baseinstalldir="Crypt" md5sum="f4c7bb36cd36382f0cf5fd4594f73fee" name="LICENSE"/>
   <file role="doc" baseinstalldir="Crypt" md5sum="ca9d024c219dba927b4aee2dc1fb5737" name="docs/Crypt_RSA.txt"/>
   <file role="doc" baseinstalldir="Crypt" md5sum="b93c59f9eb0f92a4c7ff235423f299d8" name="docs/math_wrappers.txt"/>
   <file role="doc" baseinstalldir="Crypt" md5sum="73f96fcd914179a3500c71d96d77489a" name="examples/web_interface.php"/>
   <file role="test" baseinstalldir="Crypt" md5sum="269bb4ce3ddc98efa5cc02c5fa36d71d" name="tests/bench.php"/>
   <file role="test" baseinstalldir="Crypt" md5sum="ced4107d21a124ccfdc20f49e91e5c39" name="tests/test1.php"/>
   <file role="test" baseinstalldir="Crypt" md5sum="4e5cea66200222ba82d7869cf4356caa" name="tests/test2.php"/>
  </filelist>
 </release>
</package>


text:
#include "FreeRTOSConfig.h"
#include "portasm.h"

/* These wrappers are only used when interrupt method 2 is being used.  See
FreeRTOSConfig.h for an explanation. */
#if configINTERRUPT_EXAMPLE_METHOD == 2

.CODE

/* Wrapper for the Rx UART interrupt. */
_vUARTRx_Wrapper

	portSAVE_CONTEXT
	call #_vRxISR
	portRESTORE_CONTEXT

/*-----------------------------------------------------------*/

/* Wrapper for the Tx UART interrupt. */
_vUARTTx_Wrapper

	portSAVE_CONTEXT
	call #_vTxISR
	portRESTORE_CONTEXT

/*-----------------------------------------------------------*/

	/* Place the UART ISRs in the correct vectors. */

	.VECTORS

	.KEEP

	ORG		UART1RX_VECTOR
	DW		_vUARTRx_Wrapper

	ORG		UART1TX_VECTOR
	DW		_vUARTTx_Wrapper

#endif /* configINTERRUPT_EXAMPLE_METHOD */

	END


text:
<?php

/**
 *      [Discuz!] (C)2001-2099 Comsenz Inc.
 *      This is NOT a freeware, use is subject to license terms
 *
 *      $Id: switch.php 33950 2013-09-05 02:17:27Z nemohou $
 */

if(!defined('IN_DISCUZ')) {
	exit('Access Denied');
}

$appIdentifier = 'search';
$pluginid = intval($_GET['pluginid']);

require_once libfile('class/cloudregister');

if($operation == 'enable') {

	new Cloud_Register($appIdentifier, $pluginid, 'appOpenFormView');

} elseif($operation == 'disable') {

	new Cloud_Register($appIdentifier, $pluginid, 'appCloseReasonsView');

}


text:
package com.oracle.st.pm.json.movieTicketing.test;

import com.oracle.st.pm.json.movieTicketing.data.ExternalInterfaces;
import com.oracle.st.pm.json.movieTicketing.utilitiy.DBConnection;

public class generateScreenings {
    public generateScreenings() {
        super();
    }

    public static void main(String[] args) {
        try {
            ExternalInterfaces.generateScreenings(DBConnection.getOracleDatabase());
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

}