text:
/*
 * $Id: DatatypeValidator.hpp 176169 2004-10-28 20:21:06Z peiyongz $
 */

#if !defined(DATATYPEVALIDATOR_HPP)
#define DATATYPEVALIDATOR_HPP

#include <xercesc/util/PlatformUtils.hpp>
#include <xercesc/util/RefHashTableOf.hpp>
#include <xercesc/util/KVStringPair.hpp>
#include <xercesc/util/XMLUniDefs.hpp>
#include <xercesc/util/regx/RegularExpression.hpp>
#include <xercesc/validators/schema/SchemaSymbols.hpp>
#include <xercesc/internal/XSerializable.hpp>
#include <xercesc/framework/psvi/XSSimpleTypeDefinition.hpp>
#include <xercesc/framework/ValidationContext.hpp>

XERCES_CPP_NAMESPACE_BEGIN

class MemoryManager;

/**
  * DataTypeValidator defines the interface that data type validators must
  * obey. These validators can be supplied by the application writer and may
  * be useful as standalone code as well as plugins to the validator
  * architecture.
  *
  * Notice:
  * The datatype validator will own the facets hashtable passed to it during
  * construction, which means that the datatype validator will be responsible
  * for the deletion. The facets hashtable will be created during parsing and
  * passed to the appropriate datatype validator which in turn will delete it
  * upon its destruction.
  *
  */

class VALIDATORS_EXPORT DatatypeValidator : public XSerializable, public XMemory
{
public:
    // -----------------------------------------------------------------------
    // Constant data
    // -----------------------------------------------------------------------
	//facets
	enum {
        FACET_LENGTH         = 1,
        FACET_MINLENGTH      = 1<<1,
        FACET_MAXLENGTH      = 1<<2,
        FACET_PATTERN        = 1<<3,
        FACET_ENUMERATION    = 1<<4,
        FACET_MAXINCLUSIVE   = 1<<5,
        FACET_MAXEXCLUSIVE   = 1<<6,
        FACET_MININCLUSIVE   = 1<<7,
        FACET_MINEXCLUSIVE   = 1<<8,
        FACET_TOTALDIGITS    = 1<<9,
        FACET_FRACTIONDIGITS = 1<<10,
        FACET_ENCODING       = 1<<11,
        FACET_DURATION       = 1<<12,
        FACET_PERIOD         = 1<<13,
        FACET_WHITESPACE     = 1<<14
    };

    //2.4.2.6 whiteSpace - Datatypes
	enum {
        PRESERVE = 0,
        REPLACE  = 1,
        COLLAPSE = 2
    };

    enum ValidatorType {
        String,
        AnyURI,
        QName,
        Name,
        NCName,
        Boolean,
        Float,
        Double,
        Decimal,
        HexBinary,
        Base64Binary,
        Duration,
        DateTime,
        Date,
        Time,
        MonthDay,
        YearMonth,
        Year,
        Month,
        Day,
        ID,
        IDREF,
        ENTITY,
        NOTATION,
        List,
        Union,
        AnySimpleType,
        UnKnown
    };

    // -----------------------------------------------------------------------
    //  Public Destructor
    // -----------------------------------------------------------------------
	/** @name Destructor. */
    //@{

    virtual ~DatatypeValidator();

	//@}

    // -----------------------------------------------------------------------
    // Getter methods
    // -----------------------------------------------------------------------
    /** @name Getter Functions */
    //@{

    /**
      * Returns the final values of the simpleType
      */
    int getFinalSet() const;

    /**
      * Returns the datatype facet if any is set.
      */
	RefHashTableOf<KVStringPair>* getFacets() const;

    /**
      * Returns default value (collapse) for whiteSpace facet.
      * This function is overwritten in StringDatatypeValidator.
      */
    short getWSFacet () const;

    /**
      * Returns the base datatype validator if set.
      */
    DatatypeValidator* getBaseValidator() const;

    /**
      * Returns the 'class' type of datatype validator
      */
    ValidatorType getType() const;

    /**
      * Returns whether the type is atomic or not
      *
      * To be redefined in List/Union validators
      */
    virtual bool isAtomic() const;

    /**
      * Returns the datatype enumeration if any is set.
	  * Derived class shall provide their own copy.
      */
	virtual const RefArrayVectorOf<XMLCh>* getEnumString() const = 0;

    /**
     * returns true if this type is anonymous
     **/
    bool getAnonymous() const;

    /**
     * sets this type to be anonymous
     **/
    void setAnonymous();

    /**
     *  Fundamental Facet: ordered
     */
    XSSimpleTypeDefinition::ORDERING getOrdered() const;

    /**
     * Fundamental Facet: cardinality.
     */
    bool getFinite() const;

    /**
     * Fundamental Facet: bounded.
     */
    bool getBounded() const;

    /**
     * Fundamental Facet: numeric.
     */
    bool getNumeric() const;

    /**
     *    Canonical Representation
     *
     *    Derivative datatype may overwrite this method once
     *    it has its own canonical representation other than
     *    the default one.
     *
     * @param rawData:    data in raw string
     * @param memMgr:     memory manager
     * @param toValiate:  to validate the raw string or not
     *
     * @return: canonical representation of the data
     *
     * Note:
     *
     *    1. the return value is kept in memory allocated
     *       by the memory manager passed in or by dv's
     *       if no memory manager is provided.
     *
     *    2. client application is responsible for the
     *       proper deallcation of the memory allocated
     *       for the returned value.
     *
     *    3. In the case where the rawData is not valid
     *       with regards to the fundamental datatype,
     *       a null string is returned.
     *
     */
    virtual const XMLCh* getCanonicalRepresentation
                        (
                          const XMLCh*         const rawData
                        ,       MemoryManager* const memMgr = 0
                        ,       bool                 toValidate = false
                        ) const;

    //@}

    // -----------------------------------------------------------------------
    // Validation methods
    // -----------------------------------------------------------------------
    /** @name Validation Function */
    //@{

     /**
	   * Checks that the "content" string is valid datatype.
       * If invalid, a Datatype validation exception is thrown.
	   *
	   * @param  content   A string containing the content to be validated
	   *
	   */
	virtual void validate
                 (
                  const XMLCh*             const content
                ,       ValidationContext* const context = 0
                ,       MemoryManager*     const manager = XMLPlatformUtils::fgMemoryManager
                  ) = 0;

    /**
      * Checks whether a given type can be used as a substitute
      *
      * @param  toCheck    A datatype validator of the type to be used as a
      *                    substitute
      *
      * To be redefined in UnionDatatypeValidator
      */

    virtual bool isSubstitutableBy(const DatatypeValidator* const toCheck);

	 //@}

    // -----------------------------------------------------------------------
    // Compare methods
    // -----------------------------------------------------------------------
    /** @name Compare Function */
    //@{

    /**
      * Compares content in the Domain value vs. lexical value.
      *
      * e.g. If type is a float then 1.0 may be equivalent to 1 even though
      * both are lexically different.
      *
      * @param  value1    string to compare
      *
      * @param  value2    string to compare
      *
      * We will provide a default behavior that should be redefined at the
      * children level, if necessary (i.e. boolean case).
      */
    virtual int compare(const XMLCh* const value1, const XMLCh* const value2
        ,       MemoryManager*     const manager = XMLPlatformUtils::fgMemoryManager
        );

    //@}

    /**
      * Returns an instance of the base datatype validator class
	  * Used by the DatatypeValidatorFactory.
      */
	virtual DatatypeValidator* newInstance
    (
        RefHashTableOf<KVStringPair>* const facets
        , RefArrayVectorOf<XMLCh>* const enums
        , const int finalSet
        , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
    ) = 0;

    /**
     * Returns the uri,name of the type this validator is for
     */
    const XMLCh* getTypeName() const;

    /**
     * sets the uri,name that this  validator is for - typeName is uri,name string.
     * due to the internals of xerces this will set the uri to be the schema uri if
     * there is no comma in typeName
     */
    void setTypeName(const XMLCh* const typeName);

    /**
     * sets the uri,name that this  validator is for
     */
    void setTypeName(const XMLCh* const name, const XMLCh* const uri);

    /**
     * Returns the uri of the type this validator is for
     */
    const XMLCh* getTypeUri() const;

    /**
     * Returns the name of the type this validator is for
     */
    const XMLCh* getTypeLocalName() const;

    /**
     * Returns the plugged-in memory manager
     */
    MemoryManager* getMemoryManager() const;

    /***
     * Support for Serialization/De-serialization
     ***/
    DECL_XSERIALIZABLE(DatatypeValidator)

    /***
      *
      *  Serialzie DatatypeValidator derivative
      *
      *  Param
      *     serEng: serialize engine
      *     dv:     DatatypeValidator derivative
      *
      *  Return:
      *
      ***/
	static void storeDV(XSerializeEngine&        serEng
                      , DatatypeValidator* const dv);

    /***
      *
      *  Create a DatatypeValidator derivative from the binary
      *  stream.
      *
      *  Param
      *     serEng: serialize engine
      *
      *  Return:
      *     DatatypeValidator derivative
      *
      ***/
	static DatatypeValidator* loadDV(XSerializeEngine& serEng);

protected:
    // -----------------------------------------------------------------------
    //  Protected Constructors
    // -----------------------------------------------------------------------
    /** @name Constructors */
    //@{

    /**
      *
      * @param  baseValidator  The base datatype validator for derived
      *                        validators. Null if native validator.
      *
      * @param  facets         A hashtable of datatype facets (except enum).
      *
      * @param  finalSet       'final' value of the simpleType
      */

	DatatypeValidator(DatatypeValidator* const baseValidator,
                      RefHashTableOf<KVStringPair>* const facets,
                      const int finalSet,
                      const ValidatorType type,
                      MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);

    //@}

	friend class DatatypeValidatorFactory;
    friend class XSObjectFactory;

    /**
      * facetDefined
	  */
	int   getFacetsDefined() const;
    void  setFacetsDefined(int);

    /**
      * fixed
	  */
	int   getFixed() const;
    void  setFixed(int);

    /**
      * fPattern
	  */
    const XMLCh* getPattern() const;
	void         setPattern(const XMLCh* );

    /**
      * fRegex
	  */
	RegularExpression* getRegex() const;
	void               setRegex(RegularExpression* const);

    /**
      * set fType
      */
    void setType(ValidatorType);

    /**
      * set fWhiteSpace
      */
    void setWhiteSpace(short);

    /**
      * get WSString
      */
    const XMLCh*   getWSstring(const short WSType) const;

    /**
     *  Fundamental Facet: ordered
     */
    void setOrdered(XSSimpleTypeDefinition::ORDERING ordered);

    /**
     * Fundamental Facet: cardinality.
     */
    void setFinite(bool finite);

    /**
     * Fundamental Facet: bounded.
     */
    void setBounded(bool bounded);

    /**
     * Fundamental Facet: numeric.
     */
    void setNumeric(bool numeric);

private:
    // -----------------------------------------------------------------------
    //  CleanUp methods
    // -----------------------------------------------------------------------
    void cleanUp();

    // -----------------------------------------------------------------------
    //  Unimplemented constructors and operators
    // -----------------------------------------------------------------------
    DatatypeValidator(const DatatypeValidator&);
    DatatypeValidator& operator=(const DatatypeValidator&);

    // -----------------------------------------------------------------------
    //  Private data members
    //
    //  fFinalSet
    //      stores "final" values of simpleTypes
    //
    //  fBaseValidator
    //      This is a pointer to a base datatype validator. If value is null,
	//      it means we have a native datatype validator not a derived one.
	//
    //  fFacets
    //      This is a hashtable of dataype facets.
    //
    //  fType
    //      Stores the class type of datatype validator
    //
    //  fFacetsDefined
    //      Stores the constaiting facets flag
    //
    //  fPattern
    //      the pointer to the String of the pattern. The actual data is
    //      in the Facets.
    //
    //  fRegex
    //      pointer to the RegularExpress object
    //
    //
    //  fFixed
    //      if {fixed} is true, then types for which this type is the
    //      {base type definition} cannot specify a value for a specific
    //      facet.
    //
    //  fTypeName
    //      the uri,name of the type this validator will validate
    //
    //  fTypeLocalName
    //      the name of the type this validator will validate
    //
    //  fTypeUri
    //      the uri of the type this validator will validate
    //  fAnonymous
    //      true if this type is anonynous
    //
    // -----------------------------------------------------------------------
    bool                                fAnonymous;
    bool                                fFinite;
    bool                                fBounded;
    bool                                fNumeric;

    short                               fWhiteSpace;
    int                                 fFinalSet;
    int                                 fFacetsDefined;
    int                                 fFixed;

    ValidatorType                       fType;
    XSSimpleTypeDefinition::ORDERING    fOrdered;

	DatatypeValidator*                  fBaseValidator;
	RefHashTableOf<KVStringPair>*       fFacets;
    XMLCh*                              fPattern;
    RegularExpression*                  fRegex;
    XMLCh*                              fTypeName;
    const XMLCh*                        fTypeLocalName;
    const XMLCh*                        fTypeUri;

protected:
    // -----------------------------------------------------------------------
    //  Protected data members
    //
    //  fMemoryManager
    //      Pluggable memory manager for dynamic allocation/deallocation.
    // -----------------------------------------------------------------------
    MemoryManager*                      fMemoryManager;

};

// ---------------------------------------------------------------------------
//  DatatypeValidator: Getters
// ---------------------------------------------------------------------------
inline int DatatypeValidator::getFinalSet() const {

    return fFinalSet;
}

inline RefHashTableOf<KVStringPair>* DatatypeValidator::getFacets() const {

    return fFacets;
}

inline DatatypeValidator* DatatypeValidator::getBaseValidator() const {

	return fBaseValidator;
}

inline short DatatypeValidator::getWSFacet() const {

    return fWhiteSpace;
}

inline DatatypeValidator::ValidatorType DatatypeValidator::getType() const
{
    return fType;
}

inline int DatatypeValidator::getFacetsDefined() const
{
    return fFacetsDefined;
}

inline int DatatypeValidator::getFixed() const
{
    return fFixed;
}

inline const XMLCh* DatatypeValidator::getPattern() const
{
    return fPattern;
}

inline RegularExpression* DatatypeValidator::getRegex() const
{
    return fRegex;
}

inline const XMLCh* DatatypeValidator::getTypeName() const
{
    return fTypeName;
}

inline bool DatatypeValidator::getAnonymous() const
{
    return fAnonymous;
}

inline const XMLCh* DatatypeValidator::getTypeLocalName() const
{
    return fTypeLocalName;
}

inline const XMLCh* DatatypeValidator::getTypeUri() const
{
    return fTypeUri;
}

inline MemoryManager* DatatypeValidator::getMemoryManager() const
{
    return fMemoryManager;
}

inline XSSimpleTypeDefinition::ORDERING DatatypeValidator::getOrdered() const
{
    return fOrdered;
}

inline bool DatatypeValidator::getFinite() const
{
    return fFinite;
}

inline bool DatatypeValidator::getBounded() const
{
    return fBounded;
}

inline bool DatatypeValidator::getNumeric() const
{
    return fNumeric;
}

// ---------------------------------------------------------------------------
//  DatatypeValidator: Setters
// ---------------------------------------------------------------------------
inline void DatatypeValidator::setType(ValidatorType theType)
{
    fType = theType;
}

inline void DatatypeValidator::setWhiteSpace(short newValue)
{
    fWhiteSpace = newValue;
}

inline void DatatypeValidator::setFacetsDefined(int facets)
{
    fFacetsDefined |= facets;
}

inline void DatatypeValidator::setFixed(int fixed)
{
    fFixed |= fixed;
}

inline void DatatypeValidator::setPattern(const XMLCh* pattern)
{
    if (fPattern)
        fMemoryManager->deallocate(fPattern);//delete [] fPattern;
    fPattern = XMLString::replicate(pattern, fMemoryManager);
}

inline void DatatypeValidator::setRegex(RegularExpression* const regex)
{
    fRegex = regex;
}

inline bool DatatypeValidator::isAtomic() const {

    return true;
}

inline void DatatypeValidator::setAnonymous() {
    fAnonymous = true;
}

inline void DatatypeValidator::setOrdered(XSSimpleTypeDefinition::ORDERING ordered)
{
    fOrdered = ordered;
}

inline void DatatypeValidator::setFinite(bool finite)
{
    fFinite = finite;
}

inline void DatatypeValidator::setBounded(bool bounded)
{
    fBounded = bounded;
}

inline void DatatypeValidator::setNumeric(bool numeric)
{
    fNumeric = numeric;
}

// ---------------------------------------------------------------------------
//  DatatypeValidators: Compare methods
// ---------------------------------------------------------------------------
inline int DatatypeValidator::compare(const XMLCh* const lValue,
                                      const XMLCh* const rValue
                                      , MemoryManager*     const)
{
    return XMLString::compareString(lValue, rValue);
}

// ---------------------------------------------------------------------------
//  DatatypeValidators: Validation methods
// ---------------------------------------------------------------------------
inline bool
DatatypeValidator::isSubstitutableBy(const DatatypeValidator* const toCheck)
{
    const DatatypeValidator* dv = toCheck;

	while (dv != 0) {

        if (dv == this) {
            return true;
        }

        dv = dv->getBaseValidator();
    }

    return false;
}

XERCES_CPP_NAMESPACE_END

#endif

/**
  * End of file DatatypeValidator.hpp
  */


text:
package ru.job4j.servlets.servlethtml;

import ru.job4j.servlets.crud.User;
import ru.job4j.servlets.crud.UserStore;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;

/** Class MenuServlet.
 * @author Arseniy Kulkiov
 * @since 20.03.2017
 * @version 1
 */
public class MenuServlet extends HttpServlet {
    /**
     * Class field.
     */
    public static final UserStore USER_STORE = UserStore.getInstance();
    /**
     * Class field.
     */
    private List<String> users = new CopyOnWriteArrayList<>();

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException {
        List<User> list = USER_STORE.allUsers();
        resp.setContentType("text/html");
        PrintWriter writer = null;
        StringBuilder sb = new StringBuilder("
");
        try {
            writer = new PrintWriter(resp.getOutputStream());
            sb.append("
"
                    + "Name:	"
                    + "Login:	"
                    + "Email:	"
                    + "Date creation:	"
                    + "
");
            for (User user : list) {
                String name = user.getName();
                String login = user.getLogin();
                String email = user.getEmail();
                String date = user.getCreateDate();
                sb.append("
"
                        + "" + name + "	"
                        + "" + login + "	"
                        + "" + email + "	"
                        + "" + date + "	"
                        + ""
                            + "<form action='" + req.getContextPath() + "/edit' method='get'>"
                                + "<input type='hidden' name='name' value='" + name + "'>"
                                + "<input type='hidden' name='login' value='" + login + "'>"
                                + "<input type='hidden' name='email' value='" + email + "'>"
                                + "<input type='submit' value='Edit User...'>"
                        + "</form>"
                        + "	"
                        + ""
                            + "<form action='" + req.getContextPath() + "/delete' method='post'>"
                                + "<input type='hidden' name='name' value='" + name + "'>"
                                + "<input type='hidden' name='login' value='" + login + "'>"
                                + "<input type='hidden' name='email' value='" + email + "'>"
                                + "<input type='submit' value='Delete User'>"
                            + "</form>"
                        + "	"
                        + "
");
            }
            sb.append("
");
        } catch (IOException e) {
            e.printStackTrace();
        }

        writer.append("<!DOCTYPE html>"
                + ""
                + ""
                + "    <meta charset=\"UTF-8\">"
                + "    <title></title>"
                + ""
                + ""
                + "
"
                + ""
                + sb.toString()
                + "
"
                + "<form action='" + req.getContextPath() + "/add' method='get'>"
                + "<input type='submit' value='Add new User...'>"
                + "</form>"
                + ""
                + "");
        writer.flush();
    }

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        resp.setContentType("text/html");
        this.users.add(req.getParameter("login"));
        doGet(req, resp);
    }
}

redpajama_set_name: RedPajamaGithub


text:
package io.netty.handler.codec.http;

/**
 * The default {@link HttpRequest} implementation.
 */
public class DefaultHttpRequest extends DefaultHttpMessage implements HttpRequest {
    private static final int HASH_CODE_PRIME = 31;
    private HttpMethod method;
    private String uri;

    /**
     * Creates a new instance.
     *
     * @param httpVersion the HTTP version of the request
     * @param method      the HTTP getMethod of the request
     * @param uri         the URI or path of the request
     */
    public DefaultHttpRequest(HttpVersion httpVersion, HttpMethod method, String uri) {
        this(httpVersion, method, uri, true);
    }

    /**
     * Creates a new instance.
     *
     * @param httpVersion       the HTTP version of the request
     * @param method            the HTTP getMethod of the request
     * @param uri               the URI or path of the request
     * @param validateHeaders   validate the header names and values when adding them to the {@link HttpHeaders}
     */
    public DefaultHttpRequest(HttpVersion httpVersion, HttpMethod method, String uri, boolean validateHeaders) {
        super(httpVersion, validateHeaders, false);
        if (method == null) {
            throw new NullPointerException("method");
        }
        if (uri == null) {
            throw new NullPointerException("uri");
        }
        this.method = method;
        this.uri = uri;
    }

    @Override
    @Deprecated
    public HttpMethod getMethod() {
        return method();
    }

    @Override
    public HttpMethod method() {
        return method;
    }

    @Override
    @Deprecated
    public String getUri() {
        return uri();
    }

    @Override
    public String uri() {
        return uri;
    }

    @Override
    public HttpRequest setMethod(HttpMethod method) {
        if (method == null) {
            throw new NullPointerException("method");
        }
        this.method = method;
        return this;
    }

    @Override
    public HttpRequest setUri(String uri) {
        if (uri == null) {
            throw new NullPointerException("uri");
        }
        this.uri = uri;
        return this;
    }

    @Override
    public HttpRequest setProtocolVersion(HttpVersion version) {
        super.setProtocolVersion(version);
        return this;
    }

    @Override
    public int hashCode() {
        int result = 1;
        result = HASH_CODE_PRIME * result + method.hashCode();
        result = HASH_CODE_PRIME * result + uri.hashCode();
        result = HASH_CODE_PRIME * result + super.hashCode();
        return result;
    }

    @Override
    public boolean equals(Object o) {
        if (!(o instanceof DefaultHttpRequest)) {
            return false;
        }

        DefaultHttpRequest other = (DefaultHttpRequest) o;

        return method().equals(other.method()) &&
               uri().equalsIgnoreCase(other.uri()) &&
               super.equals(o);
    }

    @Override
    public String toString() {
        return HttpMessageUtil.appendRequest(new StringBuilder(256), this).toString();
    }
}


text:
list = new Athena.Entities.ComponentsList();

CHECK_EQUAL(0, list.nbComponents);

component = new Athena.Entities.Transforms("Component", list);

CHECK_EQUAL(1, list.nbComponents);

CHECK(list.getComponent(0) !== undefined);

component2 = list.getComponent(0);

CHECK_EQUAL('Component', component2.name);
CHECK(component2.position !== undefined);


text:
01. Write a SQL query to find the names and salaries of the employees that take the minimal salary in the company.
SELECT FirstName, LastName, Salary
FROM Employees
WHERE Salary=(SELECT MIN(Salary) FROM Employees)

02. Write a SQL query to find the names and salaries of the employees that have a salary that is up to 10% higher than the minimal salary for the company.
SELECT FirstName, LastName, Salary
FROM Employees
WHERE Salary<(SELECT MIN(Salary)*1.1 FROM Employees)

03. Write a SQL query to find the full name, salary and department of the employees that take the minimal salary in their department.
SELECT FirstName+ ' '+ LastName AS [Full Name], Salary, d.Name AS [Dep. Name]
FROM Employees e, Departments d
WHERE Salary=(SELECT MIN(Salary)FROM Employees s WHERE s.DepartmentID=d.DepartmentID)
ORDER BY Salary DESC

04. Write a SQL query to find the average salary in the department #1.
SELECT AVG(Salary) AS [Average Salary]
FROM Employees
WHERE DepartmentID=1

05. Write a SQL query to find the average salary in the "Sales" department.
SELECT AVG(Salary) AS [Average Salary]
FROM Employees e, Departments d
WHERE  e.DepartmentID=d.DepartmentID AND Name='Sales'

06. Write a SQL query to find the number of employees in the "Sales" department.
SELECT COUNT(e.LastName) AS [Count of 'Sales' Department Employees]
FROM Employees e, Departments d
WHERE  e.DepartmentID=d.DepartmentID AND d.Name='Sales'

07. Write a SQL query to find the number of all employees that have manager.
SELECT COUNT(e.LastName) AS [Number of employees with manager]
FROM Employees e
WHERE  e.ManagerID IS NOT NULL

08. Write a SQL query to find the number of all employees that have no manager.
SELECT COUNT(e.LastName) AS [Number of employees with manager]
FROM Employees e
WHERE  e.ManagerID IS NULL

09. Write a SQL query to find all departments and the average salary for each of them.
SELECT AVG(e.Salary) AS [AverageSalary], d.Name AS [Name of department]
FROM Employees e, Departments d
WHERE  e.DepartmentID=d.DepartmentID
GROUP BY  d.Name

10. Write a SQL query to find the count of all employees in each department and for each town.
SELECT COUNT(e.LastName) AS [Number of employees], d.Name AS [Name of department], t.Name AS [Town]
FROM Employees e, Departments d, Towns t, Addresses a
WHERE  e.DepartmentID=d.DepartmentID
AND e.AddressID=a.AddressID
AND a.TownID=t.TownID
GROUP BY   t.Name, d.Name

11.Write a SQL query to find all managers that have exactly 5 employees. Display their first name and last name.
SELECT e.FirstName + ' ' + e.LastName AS [Names of manager with 5 employees]
FROM Employees e, Employees m
WHERE e.ManagerID = m.EmployeeID OR m.ManagerID IS NULL
GROUP BY e.EmployeeID, e.FirstName, e.LastName
HAVING COUNT(*)=5

12. Write a SQL query to find all employees along with their managers. For employees that do not have manager display the value "(no manager)".
SELECT e.FirstName + ' ' + e.LastName AS [Name of Employee],ISNULL(m.FirstName+' '+m.LastName,('no manager')) AS [Manager]
FROM Employees e
LEFT OUTER JOIN Employees m
ON e.ManagerID=m.EmployeeID

13.Write a SQL query to find the names of all employees whose last name is exactly 5 characters long. Use the built-in LEN(str) function.
SELECT e.FirstName + ' ' + e.LastName AS [Name of Employee]
FROM Employees e
WHERE LEN(e.LastName)=5;

14.Write a SQL query to display the current date and time in the following format "day.month.year hour:minutes:seconds:milliseconds".
SELECT CONVERT(VARCHAR(50),GETDATE(),104)+' '+CONVERT(VARCHAR(50),GETDATE(),114) AS[Date and time]

15. Write a SQL statement to create a table Users. Users should have username, password, full name and last login time.
CREATE TABLE Users(
Username VARCHAR(50) ,
Pass VARCHAR(50),
FirstName VARCHAR(50),
LastName VARCHAR(50),
LastLogin datetime
CONSTRAINT PK_Users PRIMARY KEY(Username),
CONSTRAINT Pass CHECK (LEN(Pass)>=5)
)
GO

16. Write a SQL statement to create a view that displays the users from the Users table that have been in the system today.
CREATE VIEW AllUsersFromToday AS
	SELECT *
	FROM Users u
	WHERE u.LastLogin = GETDATE()

17. Write a SQL statement to create a table Groups. Groups should have unique name (use unique constraint).
USE TelerikAcademy;
CREATE TABLE Groups(
Name NVARCHAR(50) NOT NULL UNIQUE ,
CONSTRAINT  PK_Groups PRIMARY KEY(Name)
)
GO

18. Write a SQL statement to add a column GroupID to the table Users.
ALTER TABLE Users
ADD GroupId INT FOREIGN KEY REFERENCES Groups(name)

19 Write SQL statements to insert several records in the Users and Groups tables.
INSERT INTO Groups
VALUES
(2),
(3)
GO
INSERT INTO Users
values
('zaio2','11111','Zaio','Baio1',GetDate(),1),
('zaio3','11111','Zaio','Baio2',GetDate(),2),
('zaio4','11111','Zaio','Baio3',GetDate(),3)
GO

20. Write SQL statements to update some of the records in the Users and Groups tables.
UPDATE Users SET
UserName='updated'
WHERE Username='zaio2'

21. Write SQL statements to delete some of the records from the Users and Groups tables.
DELETE  Users
WHERE LastName='Baio3'
GO

22. Write SQL statements to insert in the Users table the names of all employees from the Employees table.
INSERT INTO  Users
(FirstName,LastName,Username,Pass,LastLogin)
SELECT e.FirstName,e.LastName,LOWER(LEFT(e.FirstName,1))+LOWER(LEFT(e.LastName,1))+LEFT(e.EmployeeID,4),e.EmployeeID+'12345',NULL
FROM Employees e

23. Write a SQL statement that changes the password to NULL for all users that have not been in the system since
UPDATE  Users
SET Pass=NULL
WHERE DATEDIFF(day, LastLogin, '2016-3-10 00:00:00') > 0

24. Write a SQL statement that deletes all users without passwords (NULL password).
DELETE Users
WHERE Pass IS  NULL

25. Write a SQL query to display the average employee salary by department and job title.
SELECT AVG(e.Salary), e.JobTitle , d.Name  FROM Employees e, Departments d
WHERE d.DepartmentID=e.DepartmentID
GROUP BY e.JobTitle, d.Name

26. Write a SQL query to display the minimal employee salary by department and job title along with the name of some of the employees that take it.
SELECT MIN(e.Salary) as 'Min Salary', e.JobTitle , d.Name as 'Department name',
e.FirstName + ' '+ e.LastName as 'Full Name'  FROM Employees e, Departments d
WHERE d.DepartmentID=e.DepartmentID
GROUP BY e.JobTitle, d.Name, e.FirstName + ' ' + e.LastName

27. Write a SQL query to display the town where maximal number of employees work.
SELECT TOP  1 COUNT(a.TownID) as [EmployeeCount] FROM Addresses a
JOIN Employees e
ON e.AddressID=a.AddressID
JOIN Towns t
ON t.TownID=a.TownID
GROUP BY t.TownID
ORDER BY EmployeeCount DESC

28. Write a SQL query to display the number of managers from each town.
SELECT  COUNT(a.TownID) as [EmployeeCount], t.Name FROM Addresses a
JOIN Employees e
ON e.AddressID=a.AddressID
JOIN Towns t
ON t.TownID=a.TownID
WHERE e.ManagerID IS  NOT NULL
GROUP BY t.Name
ORDER BY EmployeeCount DESC

29. Write a SQL to create table WorkHours to store work reports for each employee (employee id, date, task, hours, comments).
--WorkHours--
DROP TABLE dbo.WorkHours
CREATE TABLE WorkHours(
Id INT PRIMARY KEY IDENTITY(1,1),
EmployeeId INT NOT NULL,
DateOfReport DATETIME,
Task NVARCHAR(50),
HoursOfWork INT,
Comments NVARCHAR(500),
CONSTRAINT FK_WorkHours_Employees FOREIGN KEY (EmployeeId) REFERENCES Employees(EmployeeID)
)

--Add some records--
DECLARE @counter int
SET @counter=0

WHILE @counter<30
BEGIN
INSERT INTO WorkHours(EmployeeId,DateOfReport,Task,HoursOfWork,Comments)
VALUES (@counter,GETDATE(),'task'+CONVERT(VARCHAR(5), @counter),8,'comment'+CONVERT(VARCHAR(5), @counter))
SET @counter=@counter +1
END
DROP TABLE WorkHoursLog
GO

--WorkLogs--
CREATE TABLE WorkHoursLog(
Id int PRIMARY KEY IDENTITY(1,1),
WorkHoursId int,
EmployeeId INT FOREIGN KEY REFERENCES Employees(EmployeeId),
DateOfReport DATETIME,
Task NVARCHAR(50),
HoursOfWork INT,
Comments NVARCHAR(500),
[Action] varchar(10) NOT NULL
)

-- triggers --

--INSERT--
DROP TRIGGER trg_WorkHours_Insert
GO
CREATE TRIGGER trg_WorkHours_Insert ON WorkHours
FOR INSERT
AS
INSERT INTO WorkHoursLog(WorkHoursId, EmployeeId, DateOfReport, Task, HoursOfWork, Comments, [Action])
    SELECT Id, EmployeeID, DateOfReport, Task, HoursOfWork, Comments, 'Insert'
    FROM inserted
PRINT 'FOR INSERT trigger fired.'
GO

--DELTETE--
DROP TRIGGER trg_WorkHours_Delete
GO
CREATE TRIGGER trg_WorkHours_Delete ON WorkHours
FOR DELETE
AS
INSERT INTO WorkHoursLog(WorkHoursId,EmployeeId, DateOfReport, Task, HoursOfWork, Comments, [Action])
    SELECT Id, EmployeeId, DateOfReport, Task, HoursOfWork, Comments, 'Delete'
    FROM deleted
PRINT 'FOR DELETE trigger fired.'
GO

--UPDATE--
DROP TRIGGER trg_WorkHours_Update
GO
CREATE TRIGGER trg_WorkHours_Update ON WorkHours
FOR UPDATE
AS
INSERT INTO WorkHoursLog(WorkHoursId,EmployeeId, DateOfReport, Task, HoursOfWork, Comments, [Action])
    SELECT Id, EmployeeId, DateOfReport, Task, HoursOfWork, Comments, 'UPDATE'
    FROM inserted
PRINT 'FOR UPDATE trigger fired.'
GO

--Trigers tests--

--DELETE--
DELETE FROM  WorkHours
WHERE EmployeeId=25

--INSERT--
DECLARE @counter INT
SET @counter=31

INSERT INTO WorkHours(EmployeeId,DateOfReport,Task,HoursOfWork,Comments)
VALUES (@counter,GETDATE(),'task'+CONVERT(VARCHAR(5), @counter),8,'comment'+CONVERT(VARCHAR(5), @counter))

--UPDATE--
UPDATE WorkHours
SET HoursOfWork=9
WHERE HoursOfWork=8

30. Start a database transaction, delete all employees from the 'Sales' department along with all dependent records from the pother tables.
BEGIN TRAN

ALTER TABLE Departments
	DROP CONSTRAINT FK_Departments_Employees
GO

DELETE e FROM  Employees e, Departments d
	WHERE e.DepartmentID=d.DepartmentID
	AND d.Name='Sales'

ROLLBACK TRAN

31. Start a database transaction and drop the table EmployeesProjects.
BEGIN TRAN

DROP TABLE EmployeesProjects

ROLLBACK TRAN

32. Find how to use temporary tables in SQL Server.
BEGIN TRAN

SELECT *  INTO  #Temp_EmployeesProjects
FROM EmployeesProjects

DROP TABLE EmployeesProjects

SELECT * INTO EmployeesPRojects
FROM #Temp_EmployeesProjects

ROLLBACK TRAN


text:
parte: 1
capitulo: Capítulo 3
capituloSlug: capitulo-3
pagina: Exercício 1

title: Exercício 1

page-layout: exercise
---

Executa os exercícios seguindo as orientações:

 1º - em pizzicato.

 2º - com o arco a começar no talão.

 3º - com o arco a começar na ponta.


text:
var crypto = require('crypto');
var bcrypt = require('bcrypt');

//获取随机字符串,用来测试user
function getRandomString(len) {
  if (!len) len = 16; //默认长度为16

  return crypto.randomBytes(Math.ceil(len / 2)).toString('hex');
}

var should = require('should');
var app = require('../../app');  //入口文件
var mongoose = require('mongoose');
var User = require('../../app/models/user');
var User = mongoose.model('User');

var user;

// test 测试用例
describe('<Unit Test', function() {
  describe('Model User:', function() {
	//测试用例开始前
	before(function(done) {
	  user = {
		name: getRandomString(),//长度16的字符串
		password: 'password'
	  };

	  done();
	});
	//测试前确认用户getRandomString是不存在的
	describe('Before Method save', function() {
	  //it代表一个测试用例,done调用多次会出问题
	  it('should begin without test user', function(done) {
		User.find({name: user.name}, function(err, users) {
		  users.should.have.length(0);

		  done();
		});
	  });
	});

	describe('User save', function() {
	  it('should save without problems', function(done) {
		var _user = new User(user);

		_user.save(function(err) {
		  should.not.exist(err);
		  _user.remove(function(err) {
			should.not.exist(err);
			done();
		  });
		});
	  });
	  //确认生成的密码没有问题
	  it('should password be hashed correctly', function(done) {
		var password = user.password;
		var _user = new User(user);

		_user.save(function(err) {
		  should.not.exist(err);
		  _user.password.should.not.have.length(0);
		  //对密码进行比对
		  bcrypt.compare(password, _user.password, function(err, isMatch) {
			should.not.exist(err);
			isMatch.should.equal(true);

			_user.remove(function(err) {
			  should.not.exist(err);
			  done();
			});
		  });
		});
	  });

	  it('should have default role 0', function(done) {
		var _user = new User(user);

		_user.save(function(err) {
		  _user.role.should.equal(0);

		  _user.remove(function(err) {
			done();
		  });
		});
	  });

	  it('should fail to save an existing user', function(done) {
		var _user1 = new User(user);

		_user1.save(function(err) {
		  should.not.exist(err);

		  var _user2 = new User(user);

		  _user2.save(function(err) {
			should.exist(err);

			_user1.remove(function(err) {
			  if (!err) {
				_user2.remove(function(err) {
				  done();
				});
			  }
			});
		  });
		});
	  });
	});

	after(function(done) {
	  // clear user info
	  done();
	});
  });
});


text:
package model.solvers.mutation;

import java.util.Set;
import java.util.TreeSet;

import model.population.Individual;
import model.population.genes.Gene;

public abstract class CombinatoricsMutation extends MutationAlgorithm {

	@Override
	boolean isValid(Individual ind) {
		return ind.isPermutation();
	}

}


text:
layout: post
date: '2016-03-12'
title: "Long Bari Jay 916 Chiffon Bridesmaid Dress"
category: Long
tags: [Long]
---
### Long Bari Jay 916 Chiffon Bridesmaid Dress
Just **$234.99**
###

Buy it: [https://www.eudances.com/en/long/1934-bari-jay-916-long-chiffon-bridesmaid-dress.html](https://www.eudances.com/en/long/1934-bari-jay-916-long-chiffon-bridesmaid-dress.html)


text:
package org.apache.hadoop.hdfs.server.namenode;

import java.io.IOException;

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hdfs.protocol.FSConstants.SafeModeAction;
import org.apache.hadoop.hdfs.DFSConfigKeys;
import org.apache.hadoop.hdfs.DistributedFileSystem;
import org.apache.hadoop.hdfs.HdfsConfiguration;
import org.apache.hadoop.hdfs.MiniDFSCluster;

import org.junit.Test;
import static org.junit.Assert.*;

/**
 * Tests to verify safe mode correctness.
 */
public class TestSafeMode {

  /**
   * Verify that the NameNode stays in safemode when dfs.safemode.datanode.min
   * is set to a number greater than the number of live datanodes.
   */
  @Test
  public void testDatanodeThreshold() throws IOException {
    MiniDFSCluster cluster = null;
    DistributedFileSystem fs = null;
    try {
      Configuration conf = new HdfsConfiguration();
      conf.setInt(DFSConfigKeys.DFS_NAMENODE_SAFEMODE_EXTENSION_KEY, 0);
      conf.setInt(DFSConfigKeys.DFS_NAMENODE_SAFEMODE_MIN_DATANODES_KEY, 1);

      // bring up a cluster with no datanodes
      cluster = new MiniDFSCluster.Builder(conf).numDataNodes(0).format(true).build();
      cluster.waitActive();
      fs = (DistributedFileSystem)cluster.getFileSystem();

      assertTrue("No datanode started, but we require one - safemode expected",
                 fs.setSafeMode(SafeModeAction.SAFEMODE_GET));

      String tipMsg = cluster.getNamesystem().getSafeModeTip();
      assertTrue("Safemode tip message looks right",
                 tipMsg.contains("The number of live datanodes 0 needs an additional " +
                                 "2 live datanodes to reach the minimum number 1. " +
                                 "Safe mode will be turned off automatically."));

      // Start a datanode
      cluster.startDataNodes(conf, 1, true, null, null);

      // Wait long enough for safemode check to refire
      try {
        Thread.sleep(1000);
      } catch (InterruptedException ignored) {}

      // We now should be out of safe mode.
      assertFalse(
        "Out of safe mode after starting datanode.",
        fs.setSafeMode(SafeModeAction.SAFEMODE_GET));
    } finally {
      if (fs != null) fs.close();
      if (cluster != null) cluster.shutdown();
    }
  }
}


text:
title: 'App Recommendation: Editorially'
tags:
- Long
- Apps
- Writing
- Workflow
---

[Editorially](https://editorially.com/) looks to be a great web app for collaborating on documents on the web. It uses markdown for formatting and include some very nice change control features, as well as the ability to host discussions on particular parts of the document.
While I don't have a need at the moment I'll definitely have it in the forefront of my mind when I the need arises.
It's currently free and in beta, go check it out.


text:
package org.zaproxy.zap.extension.globalexcludeurl;

import java.util.Objects;
import org.zaproxy.zap.utils.Enableable;

class GlobalExcludeURLParamToken extends Enableable {

    private String regex;
    private String description;

    public GlobalExcludeURLParamToken() {
        this("", "", false);
    }

    public GlobalExcludeURLParamToken(String regex) {
        this(regex, "", false);
    }

    public GlobalExcludeURLParamToken(String regex, boolean enabled) {
        this(regex, "", enabled);
    }

    public GlobalExcludeURLParamToken(String regex, String description, boolean enabled) {
        super(enabled);

        this.regex = regex;
        this.description = description;
    }

    public GlobalExcludeURLParamToken(GlobalExcludeURLParamToken token) {
        this(token.regex, token.description, token.isEnabled());
    }

    public String getRegex() {
        return regex;
    }

    public void setRegex(String regex) {
        this.regex = regex;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    @Override
    public int hashCode() {
        return Objects.hash(isEnabled(), regex, description);
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (!super.equals(obj)) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        GlobalExcludeURLParamToken other = (GlobalExcludeURLParamToken) obj;
        if (!Objects.equals(regex, other.regex)) {
            return false;
        }
        if (!Objects.equals(description, other.description)) {
            return false;
        }
        return true;
    }
}


text:
using System;
using System.Linq;
using FinancialPlanner.Data.Entity;
using FinancialPlanner.Infrastructure.Domain.ItemDetail.ViewModels;

namespace FinancialPlanner.Infrastructure.Domain.ItemDetail.Initial.Repository
{
    /// =====================================================================
    /// <summary>
    ///     Initial Amount Repository Interface
    /// </summary>
    /// =====================================================================
    public interface IInitialAmountRepository : IDisposable
    {
        /// ---------------------------------------------------------------------
        /// <summary>
        ///     Return the List of Initial Amounts which will always be just one
        /// </summary>
        /// <param name="userName">userName</param>
        /// <returns>IQueryable(InitialAmount)</returns>
        /// ---------------------------------------------------------------------
        IQueryable<InitialAmount> GetInitialAmounts(string userName);

        /// ---------------------------------------------------------------------
        /// <summary>
        ///     Get Initial Amount View
        /// </summary>
        /// <param name="id">int?</param>
        /// <param name="userName">string</param>
        /// <returns>DetailItemView</returns>
        /// ---------------------------------------------------------------------
        InitialAmountView GetInitialAmountView(int? id, string userName);

        /// ---------------------------------------------------------------------
        /// <summary>
        ///     Save Credit View
        /// </summary>
        /// <param name="initialAmountView">InitialAmountView</param>
        /// <returns>bool</returns>
        /// ---------------------------------------------------------------------
        bool Save(InitialAmountView initialAmountView);

        /// ---------------------------------------------------------------------
        /// <summary>
        ///     Add New Credit
        /// </summary>
        /// <param name="initialAmountView">InitialAmountView</param>
        /// <returns>bool</returns>
        /// ---------------------------------------------------------------------
        bool Add(InitialAmountView initialAmountView);

        /// ---------------------------------------------------------------------
        /// <summary>
        ///     Delete Initial Amount
        /// </summary>
        /// <param name="id">int?</param>
        /// <param name="userName">string</param>
        /// <returns>bool</returns>
        /// ---------------------------------------------------------------------
        bool Delete(int? id, string userName);
    }
}


text:
namespace ui {
class LayerAnimator;
}  // namespace ui

namespace views::test {

// Test API to provide internal access to a SquareInkDropRipple.
class SquareInkDropRippleTestApi : public InkDropRippleTestApi {
 public:
  // Make the private typedefs accessible.
  using InkDropTransforms = SquareInkDropRipple::InkDropTransforms;
  using PaintedShape = SquareInkDropRipple::PaintedShape;

  explicit SquareInkDropRippleTestApi(SquareInkDropRipple* ink_drop_ripple);

  SquareInkDropRippleTestApi(const SquareInkDropRippleTestApi&) = delete;
  SquareInkDropRippleTestApi& operator=(const SquareInkDropRippleTestApi&) =
      delete;

  ~SquareInkDropRippleTestApi() override;

  // Wrapper functions to the wrapped InkDropRipple:
  void CalculateCircleTransforms(const gfx::Size& size,
                                 InkDropTransforms* transforms_out) const;
  void CalculateRectTransforms(const gfx::Size& size,
                               float corner_radius,
                               InkDropTransforms* transforms_out) const;

  // InkDropRippleTestApi:
  float GetCurrentOpacity() const override;

 protected:
  // InkDropRippleTestApi:
  std::vector<ui::LayerAnimator*> GetLayerAnimators() override;

 private:
  SquareInkDropRipple* ink_drop_ripple() {
    return static_cast<const SquareInkDropRippleTestApi*>(this)
        ->ink_drop_ripple();
  }

  SquareInkDropRipple* ink_drop_ripple() const {
    return static_cast<SquareInkDropRipple*>(
        InkDropRippleTestApi::ink_drop_ripple());
  }
};

}  // namespace views::test

#endif  // UI_VIEWS_ANIMATION_TEST_SQUARE_INK_DROP_RIPPLE_TEST_API_H_


text:
<!DOCTYPE html>

    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes"/>
    <title th:text=" ${{'Show teapot ' + teapot.name}}"></title>

    <link href="http://cdn.jsdelivr.net/webjars/bootstrap/3.3.5/css/bootstrap.min.css"
          th:href="@{/webjars/bootstrap/3.3.5/css/bootstrap.min.css}" rel="stylesheet" media="screen"/>

Id

Name

Brand

Volume

        Return to the list

    <form class="btn-group btn-group-lg"
        role="group"
        method="POST"
        th:action="@{/{id}(id=${teapot.id})}">

            Edit

        <input type="hidden" name="_method" value="delete"></input>
        <button class="btn btn-danger"
             type="submit">

             Delete
         </button>
    </form>


text:
<?php
namespace Dcms\Mapper;

use Dcms\Model\PageInterface;

interface PageMapperInterface
{
    /**
     * @param int $id
     * @return PageInterface
     * @throws \InvalidArgumentException
     */
    public function find($id);

    /**
     * @param string $slug
     * @return PageInterface
     * @throws \InvalidArgumentException
     */
    public function findBySlug($slug);

    /**
     * @return array|PageInterface[]
     */
    public function findAll();

    /**
      * @param PageInterface $pageObject
      *
      * @param PageInterface $pageObject
      * @return PageInterface
      * @throws \Exception
      */
     public function save($pageObject);

     /**
      * @param PageInterface $pageObject
      *
      * @return bool
      * @throws \Exception
      */
     public function delete($pageObject);
}


text:
<!DOCTYPE html>

<title>Ahant-Mobile</title>

<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style"
	content="black-translucent">
<meta name="viewport" content="width = device-width,initial-scale = 1.0">
<meta name="mobile-web-app-capable" content="yes">
<link rel="stylesheet" type="text/css" href="../libs/css/mobile.css">

		Application Distribution Portal

					Talking Tom

					BofA2

					BofA3

					BofA4

					BofA5

					BofA6

					BofA7

					BofA8

					version
1.0

					version
1.2

					version
1.3

					version
1.4

				Application Name: Android App
 Version: 1.0

 Release Date: 05/04/2014
 Release Note: Application release notes.

				  Notify me for
					future releases of this application.

				env1-build env2-build env3-build
				env4-build
				env4-build
				env4-build
				env4-build
				env4-build
				env4-build
				env4-build
				env4-build
				env42-build

		 ©   Ahant Mobile. All rights reserved.


text:
<?php
declare(strict_types=1);

namespace ManaPHP\Cli\Command;

interface ManagerInterface
{
    public function getCommands(): array;
}


text:
<?php

namespace Org\Schema\Thing\Intangible\Reservation;

/**
 * Class EventReservation
 * A reservation for an event like a concert, sporting event, or lecture.
 * Note: This type is for information about actual reservations,
 * e.g. in confirmation emails or HTML pages with individual confirmations of reservations.
 * For offers of tickets, use Offer.
 * @author      AppBels <app.bels@gmail.com>
 * @name        EventReservation
 * @namespace   Org\Schema\Thing\Intangible\Reservation
 * @package     Org\Schema
 * @see         https://schema.org/EventReservation
 * Date         30/03/2017
 */
class EventReservation extends \Org\Schema\Thing\Intangible\Reservation
{

	/**
	 * EventReservation constructor.
	 * @access  public
	 * @see     \Org\Schema\Thing\Intangible\Reservation::__construct()
	 */
	public function __construct ()
	{
		parent::__construct();
	}

	/**
	 * EventReservation toString.
	 * @access  public
	 * @see     \Org\Schema\Thing\Intangible\Reservation::__toString()
	 *
	 * @return  string
	 */
	public function __toString ()
	{
		return parent::__toString();
	}

	/**
	 * EventReservation destructor.
	 * @access  public
	 * @see     \Org\Schema\Thing\Intangible\Reservation::__destruct()
	 */
	public function __destruct ()
	{
		parent::__destruct();
	}

}

?>


text:
using namespace clang;
using namespace sema;

DelayedDiagnostic DelayedDiagnostic::makeDeprecation(SourceLocation Loc,
                                    const NamedDecl *D,
                                    const ObjCInterfaceDecl *UnknownObjCClass,
                                    StringRef Msg) {
  DelayedDiagnostic DD;
  DD.Kind = Deprecation;
  DD.Triggered = false;
  DD.Loc = Loc;
  DD.DeprecationData.Decl = D;
  DD.DeprecationData.UnknownObjCClass = UnknownObjCClass;
  char *MessageData = 0;
  if (Msg.size()) {
    MessageData = new char [Msg.size()];
    memcpy(MessageData, Msg.data(), Msg.size());
  }

  DD.DeprecationData.Message = MessageData;
  DD.DeprecationData.MessageLen = Msg.size();
  return DD;
}

void DelayedDiagnostic::Destroy() {
  switch (Kind) {
  case Access:
    getAccessData().~AccessedEntity();
    break;

  case Deprecation:
    delete [] DeprecationData.Message;
    break;

  case ForbiddenType:
    break;
  }
}


text:
/* ************************************************************************
#asset(dev/icon/16x16/plain/carabiner.png)
#asset(dev/icon/16x16/plain/carabiner.png)
#asset(dev/icon/16x16/plain/about.png)
#asset(dev/icon/64x64/shadow/data_scroll.png)
#asset(dev/icon/16x16/plain/delete2.png)
#asset(dev/icon/16x16/plain/control_panel2.png)
************************************************************************ */
qx.Class.define("dev.screens.LayoutDesigner", {
	extend: dev.ObjectEdit,

	include: [
		dev.screens.layout.Button,
		dev.screens.layout.Column,
		dev.screens.layout.DoubleCheck2,
		dev.screens.layout.DoubleCheck,
		dev.screens.layout.DoubleField,
		dev.screens.layout.FieldArea,
		dev.screens.layout.GroupBox,
		dev.screens.layout.HorizontalBoxLayout,
		dev.screens.layout.HorizontalSplitPane,
		dev.screens.layout.HtmlEmbed,
		dev.screens.layout.IFrame,
		dev.screens.layout.Label,
		dev.screens.layout.List1Value,
		dev.screens.layout.List2Value,
		dev.screens.layout.List,
		dev.screens.layout.LongLabel,
		dev.screens.layout.QuadCheck,
		dev.screens.layout.RadioGroup2,
		dev.screens.layout.RadioGroup3,
		dev.screens.layout.RadioGroup4,
		dev.screens.layout.RadioGroup5,
		dev.screens.layout.SingleCheck,
		dev.screens.layout.Spacer,
		dev.screens.layout.SpanField,
		dev.screens.layout.StandardTable,
		dev.screens.layout.TextArea,
		dev.screens.layout.CKTextArea,
		dev.screens.layout.Tree,
		dev.screens.layout.TreeVirtual,
		dev.screens.layout.VerticalBoxLayout,
		dev.screens.layout.VerticalSplitPane
	],

	construct : function ( object_id ) {
		this.dynamicLayouts = [];
		this.dynamicLayouts.push({name: "LayoutDesigner.GeneralPage.xml", doc:null});
		this.dynamicLayouts.push({name: "LayoutDesigner.DesignPage.xml", doc:null});
		this.dynamicLayouts.push({name: "LayoutDesigner.TestSettingsPage.xml", doc:null});
		this.dynamicLayouts.push({name: "LayoutDesigner.Button.xml", doc:null});
		this.dynamicLayouts.push({name: "LayoutDesigner.Column.xml", doc:null});
		this.dynamicLayouts.push({name: "LayoutDesigner.DoubleCheck2.xml", doc:null});
		this.dynamicLayouts.push({name: "LayoutDesigner.DoubleCheck.xml", doc:null});
		this.dynamicLayouts.push({name: "LayoutDesigner.DoubleField.xml", doc:null});
		this.dynamicLayouts.push({name: "LayoutDesigner.FieldArea.xml", doc:null});
		this.dynamicLayouts.push({name: "LayoutDesigner.GroupBox.xml", doc:null});
		this.dynamicLayouts.push({name: "LayoutDesigner.HorizontalBoxLayout.xml", doc:null});
		this.dynamicLayouts.push({name: "LayoutDesigner.HorizontalSplitPane.xml", doc:null});
		this.dynamicLayouts.push({name: "LayoutDesigner.HtmlEmbed.xml", doc:null});
		this.dynamicLayouts.push({name: "LayoutDesigner.IFrame.xml", doc:null});
		this.dynamicLayouts.push({name: "LayoutDesigner.Label.xml", doc:null});
		this.dynamicLayouts.push({name: "LayoutDesigner.List1Value.xml", doc:null});
		this.dynamicLayouts.push({name: "LayoutDesigner.List2Value.xml", doc:null});
		this.dynamicLayouts.push({name: "LayoutDesigner.List.xml", doc:null});
		this.dynamicLayouts.push({name: "LayoutDesigner.LongLabel.xml", doc:null});
		this.dynamicLayouts.push({name: "LayoutDesigner.QuadCheck.xml", doc:null});
		this.dynamicLayouts.push({name: "LayoutDesigner.RadioGroup2.xml", doc:null});
		this.dynamicLayouts.push({name: "LayoutDesigner.RadioGroup3.xml", doc:null});
		this.dynamicLayouts.push({name: "LayoutDesigner.RadioGroup4.xml", doc:null});
		this.dynamicLayouts.push({name: "LayoutDesigner.RadioGroup5.xml", doc:null});
		this.dynamicLayouts.push({name: "LayoutDesigner.SingleCheck.xml", doc:null});
		this.dynamicLayouts.push({name: "LayoutDesigner.Spacer.xml", doc:null});
		this.dynamicLayouts.push({name: "LayoutDesigner.SpanField.xml", doc:null});
		this.dynamicLayouts.push({name: "LayoutDesigner.StandardTable.xml", doc:null});
		this.dynamicLayouts.push({name: "LayoutDesigner.TextArea.xml", doc:null});
		this.dynamicLayouts.push({name: "LayoutDesigner.CKTextArea.xml", doc:null});
		this.dynamicLayouts.push({name: "LayoutDesigner.TreeVirtual.xml", doc:null});
		this.dynamicLayouts.push({name: "LayoutDesigner.Tree.xml", doc:null});
		this.dynamicLayouts.push({name: "LayoutDesigner.VerticalBoxLayout.xml", doc:null});
		this.dynamicLayouts.push({name: "LayoutDesigner.VerticalSplitPane.xml", doc:null});

		this.base(arguments, object_id);
	},

	members : {
		layoutElementNames : [
			"Button",
			"Column",
			"DoubleCheck2",
			"DoubleCheck",
			"DoubleField",
			"FieldArea",
			"GroupBox",
			"HorizontalBoxLayout",
			"HorizontalSplitPane",
			"HtmlEmbed",
			"IFrame",
			"Label",
			"List1Value",
			"List2Value",
			"List",
			"LongLabel",
			"QuadCheck",
			"RadioGroup2",
			"RadioGroup3",
			"RadioGroup4",
			"RadioGroup5",
			"SingleCheck",
			"Spacer",
			"SpanField",
			"StandardTable",
			"TextArea",
			"CKTextArea",
			"TreeVirtual",
			"Tree",
			"VerticalBoxLayout",
			"VerticalSplitPane"
		],

		/** This is where the subclasses will tell us which API functions to use,
		  * which callbacks to use, which names to use, etc.
		  */
		setupNamesAndFunctions : function() {
			this.selectApiCall = dev.Api.GetIAFileDetails;
		},

		/** our specific help url
		  */
		getHelpUrl: function() {
			return "/devdoc/html/namespaces.html";
		},

		/** This function is responsible for initializing our toolbar.  We extend
		  * the parent class functionality by adding our own icons and actions.
		  */
		initializeToolbar : function( tb ) {
			// If you don't want the standard toolbar save/refresh actions, don't call this
			this.base(arguments, tb); // Call the parent class first

			// Then add any other actions that you would like here:
			var part = new qx.ui.toolbar.Part;

			this.addMenuButton = new qx.ui.toolbar.MenuButton("Add", "dev/icon/16x16/plain/carabiner.png",
				this.getAddMenu() );
			this.addMenuButton.setToolTipText("Add a new layout element.");
			part.add( this.addMenuButton );
			this.addMenuButton.setEnabled(false); // create it disabled.

			dev.Statics.addToToolbarWithShortcut( part, "dev/icon/16x16/plain/carabiner.png",
				this.tr("Generate Test Settings"), this.genTestSettings, this, this, "Control-G",
				this.tr("Generate Test Settings") );

			tb.add(part);

			// remember to return the toolbar we've enhanced:
			return tb;
		},

		getAddMenu: function() {
			if(this.addMenu){
				return this.addMenu; // we've already created it once.
			}

			this.addMenu = new qx.ui.menu.Menu();
			for(var i = 0, l = this.layoutElementNames.length; i < l; i++){
				this.addMenu.add( this.createAddMenuItem( this.layoutElementNames[ i ] ) );
			}

			return this.addMenu;
		},

		createAddMenuItem: function( xmlNodeName ) {
			var addButton = new qx.ui.menu.Button(xmlNodeName, "dev/icon/16x16/plain/about.png");
			addButton.xmlNodeName = xmlNodeName;
			addButton.editorThis = this;
			addButton.addListener("execute", function(e){
				var currentTreeNode = null;
				var selection = this.editorThis.layoutTree.getSelection();
				if(selection.length === 0){
					currentTreeNode = this.editorThis.layoutTree.getRoot();
				} else {
					currentTreeNode = selection[0];
				}
				var currentXmlNode = currentTreeNode.xmlNode;

				// Create the new XML Node
				var newXmlNode = null;
				if(this.editorThis[ "createXmlNodeFor" + this.xmlNodeName ]){
					newXmlNode = this.editorThis[ "createXmlNodeFor" + this.xmlNodeName ]( currentXmlNode );
				} else {
					newXmlNode = currentXmlNode.ownerDocument.createElement( this.xmlNodeName );
				}
				currentXmlNode.appendChild( newXmlNode );

				// Create the new tree node for the new xml node:
				var treeNode = new qx.ui.tree.TreeFolder( newXmlNode.nodeName );
				currentTreeNode.add( treeNode );

				// Tie them together
				treeNode.xmlNode = newXmlNode;
				treeNode.setOpen( true );
				this.editorThis.createRMCMenuForNode( newXmlNode, treeNode );

				// Create any children in the tree that are required
				this.editorThis.createTreeChildren( newXmlNode, treeNode );

				// Indicate that something has changed
				this.editorThis.fieldModified();

				// Re-render the layout to reflect the updates
				this.editorThis.renderDynamicLayout();
			});
			return addButton;
		},

		/** This is where subclasses will implement their form layout.
		  */
		doFormLayout : function() {
			this.tabview = new qx.ui.tabview.TabView;
			this.add(this.tabview, { flex: 10 });

			this.createMainTab(dev.Statics.addEditorSubTab(this.tabview, "General", true));
			this.createDesignTab(dev.Statics.addEditorSubTab(this.tabview, "Design", false));
			this.createTestSettingsTab(dev.Statics.addEditorSubTab(this.tabview, "Sample Test Settings", false));

		},

		/** This is the main page with the overall object summary and the first
		  * set of form fields
		  */
		createMainTab: function(tab_page)
		{
			var live = this.createOverviewLayout( tab_page, "Layout Designer",
				"dev/icon/64x64/shadow/data_scroll.png",
				this.m_object_id === 0 ? "NEW1" : this.m_object_id.getFileName() );

			this.addStatusHeading("General");
			this.addStatusHint("Use this editor to define the visual layout that your form should have.");

			dev.layout.LayoutEngine.renderLayout( this,
				this.getDynamicLayout("LayoutDesigner.GeneralPage.xml"),
				live );

			// Find the list of all data objects that we have and use that to populate
			// the drop-down on the form:

		},

		/** This is the design page.
		  */
		createDesignTab: function(tab_page)
		{
			dev.layout.LayoutEngine.renderLayout( this,
				this.getDynamicLayout("LayoutDesigner.DesignPage.xml"),
				tab_page );

			// Some fine tuning to the layout objects there:
			this.treePane.set({minWidth: 200, decorator: "main"});
			this.renderingPane.set({decorator: "main"});
			this.settingsPane.set({decorator: "main"});

			// Setup the tree and tree root
			this.layoutTree.setRootOpenClose(true);
			this.layoutTree.addListener("changeSelection", this.handleTreeSelection, this);
			this.layoutTree.setContextMenu( this.createTreeRMC() );

		},

		/** This is the test settings page.
		  */
		createTestSettingsTab: function(tab_page)
		{
			dev.layout.LayoutEngine.renderLayout( this,
				this.getDynamicLayout("LayoutDesigner.TestSettingsPage.xml"),
				tab_page );

			this.TestSettingsField.setCursor("text");
			this.TestSettingsField.setFont( new qx.bom.Font(14, ["monospace"]) );

		},

		createTreeRMC: function()
		{
			this.treeRMC = new qx.ui.menu.Menu();
			this.addStandardContextMenuItems( this.treeRMC );

			return this.treeRMC;
		},

		addStandardContextMenuItems : function( rmcMenu )
		{
			dev.Statics.addToRMCMenu(rmcMenu, "Delete Node",
				"dev/icon/16x16/plain/delete2.png", this.deleteTreeSelection, this );
		},

		deleteTreeSelection: function()
		{
			var currentTreeNode = null;
			var selection = this.layoutTree.getSelection();
			if(selection.length === 0){
				dev.Statics.doAlert("Nothing selected to delete");
				return;
			}

			currentTreeNode = selection[0];
			var currentXmlNode = currentTreeNode.xmlNode;

			// Remove the node from the tree
			currentTreeNode.getParent().remove( currentTreeNode );

			// Remove the node from the XML:
			currentXmlNode.parentNode.removeChild( currentXmlNode );

			// Reset the tree selection:
			this.layoutTree.resetSelection();

			// Clear the details editing section:
			this.clearSettingsPane();

			// Indicate that something has changed
			this.fieldModified();

			// Re-render the layout to reflect the updates
			this.renderDynamicLayout();
		},

		handleTreeSelection: function( e )
		{
			var data = e.getData();
			if(data.length === 0){
				return; // Nothing selected
			}

			var currentTreeNode = data[0];
			var currentXmlNode = currentTreeNode.xmlNode;
			var editDetailsFunction = "editDetailsFor" + currentXmlNode.nodeName;
			if( this[editDetailsFunction] ){
				this[editDetailsFunction]( currentTreeNode, currentXmlNode );
			} else {
				this.error("Missing edit details function: " + editDetailsFunction );
			}

			// Update the Add menu to display valid choices for the current selection:
			var addChildren = this.addMenu.getChildren();
			// Get the list of valid children of the current node:
			var validChildrenFunction = "validChildrenFor" + currentXmlNode.nodeName;
			if(this[validChildrenFunction] ){
				var validChildren = this[ validChildrenFunction ]();

				// Walk all of the add menu items:
				for(var i = 0, l = addChildren.length; i < l; i++){
					var addChild = addChildren[i];
					var found = false;
					for(var j = 0, k = validChildren.length; j < k; j++){
						if(validChildren[j] === addChild.getLabel()){
							addChild.setVisibility( "visible" );
							found = true;
						}
					}
					if(found === false){
						addChild.setVisibility( "excluded" );
					}
				}
			}

			// Enable the add button once something is selected:
			this.addMenuButton.setEnabled(true);

		},

		clearSettingsPane: function( )
		{
			// Set up an empty object to hold all of the variables generated by the
			// layout engine.  This way they won't conflict with our own object
			// variables.  Note - this object needs to be a qooxdoo object because
			// the layout engine expects to be able to use it for logging any errors
			// that it encounters.
			this.settingsVariableContainer = new qx.core.Object;

			// Remove all existing layout children in the render pane:
			if(this.settingsPane.getChildren().length !== 0){
				this.settingsPane.remove(this.settingsPane.getChildren()[0] );
			}

		},

		reRenderSettingsPane: function( layoutName )
		{
			this.clearSettingsPane();

			// Re-render the layout based on teh current xml document:
			dev.layout.LayoutEngine.renderLayout(this.settingsVariableContainer,
				this.getDynamicLayout( layoutName), this.settingsPane );
		},

		pushXmlToFields: function(xmlNode, attrList)
		{
			for(var i = 0, l = attrList.length; i < l; i++){
				var attrName = attrList[i];
				var attrValue = xmlNode.getAttribute( attrName );
				var fieldName = attrName + "Field";
				var formField = this.settingsVariableContainer[ fieldName ];
				if(formField === null || formField === undefined){
					this.debug("Unknown formField '" + formField + "'");
					continue; // skip this one
				}
				// Tie the xmlNode and attribute name to the form field so that
				// we can retrieve it later in call-backs.
				formField.xmlNode = xmlNode;
				formField.xmlNodeAttrName = attrName;
				formField.editorThis = this;
				if(formField instanceof qx.ui.form.CheckBox){
					formField.setValue( attrValue === "true" ? true : false );
					formField.addListener( "changeValue", function(e) {
						this.xmlNode.setAttribute( this.xmlNodeAttrName, this.getValue() ? "true" : "false" );
						this.editorThis.renderDynamicLayout();
						this.editorThis.fieldModified(e);
					});
				} else if(formField instanceof qx.ui.groupbox.CheckGroupBox){
					formField.setValue( attrValue === "true" ? true : false );
					formField.addListener( "changeValue", function(e) {
						this.xmlNode.setAttribute( this.xmlNodeAttrName, this.getValue() ? "true" : "false" );
						this.editorThis.renderDynamicLayout();
						this.editorThis.fieldModified(e);
					});
				} else if(formField instanceof qx.ui.form.SelectBox){
					dev.Statics.setDropDownByValue( formField, attrValue );
					formField.addListener("changeSelection", function(e){
						this.xmlNode.setAttribute( this.xmlNodeAttrName, this.getSelection()[0].getModel() );
						this.editorThis.renderDynamicLayout();
						this.editorThis.fieldModified(e);
					});
					if(attrValue === null || attrValue === undefined || attrValue.length === 0){
						dev.Statics.selectDropDownIndex( formField, 0 );
						xmlNode.setAttribute( attrName, formField.getSelection()[0].getModel() );
					}
				} else {
					// All others - treat like a text box:
					// formField.setLiveUpdate(true); // re-rendering the whole form on each update is slow.
					formField.setValue( attrValue );
					formField.addListener("changeValue", function(e){
						this.xmlNode.setAttribute( this.xmlNodeAttrName, this.getValue() );
						this.editorThis.renderDynamicLayout();
						this.editorThis.fieldModified(e);
					});
				}
			}
		},

		/** This allows our subclasses to do something in the scenario where the
		  * edit view is opened up for a brand new object.
		  */
		initializeNewObject : function () {
			/* ******************************************************* */
			/* Do Any initialization here to this.dataObject           */
			/* ******************************************************* */
			this.isNewObject = true;
			this.dataObject = new dev.sqldo.IAFile();
			this.dataObject.setFileName("NewLayoutFile.MainPage.xml");
			this.dataObject.setParentFolder("../../../qd/dev/source/layouts/" );
			this.dataObject.setFileContents(
				"<VerticalBoxLayout spacing=\"0\" flex=\"1\">" +
				"<GroupBox legend=\"Sample GroupBox\" flex=\"1\">" +
				"</GroupBox>" +
				"</VerticalBoxLayout>"
			);

			// After you've initialized this.dataObject then:
			this.loadDataIntoForm();

		},

		/** This method is called by the "get" API function and should be prepared to read
		  * our data object from the XML sent back to us by the server.
		  */
		getObjectDetails : function (response)
		{
			var objectList = dev.sqldo.IAFile.readElementChildren(response);
			if(objectList.length === 0){
				return; // Nothing to do.
			}
			this.dataObject = objectList[0];
			this.isNewObject = false;
			this.loadDataIntoForm();
		},

		createRMCMenuForNode: function(xmlNode, treeNode)
		{
			var createMenuName = "rmcMenuFor" + xmlNode.nodeName;
			if(this[createMenuName]){
				var nodeContextMenu = this[createMenuName]();
				if(nodeContextMenu){
					treeNode.setContextMenu( nodeContextMenu );
				}
			}
		},

		/** This handles loading our GUI form fields based on the information contained
		  * in our data object.
		  */
		loadDataIntoForm : function ()
		{
			/* ******************************************************* */
			/* For simple form fields this will handle automatically   */
			/* loading all fields that are registered in this object   */
			/* directly from our data object.                          */
			/* ******************************************************* */
			dev.Statics.loadAllFields(this, this.dataObject);

			this.dataXml = dev.Statics.xmlStringToDoc( this.dataObject.getFileContents() );
			this.xmlRoot = this.dataXml.documentElement;
			this.treeRoot = new qx.ui.tree.TreeFolder( this.xmlRoot.nodeName );
			this.treeRoot.setOpen(true);
			this.treeRoot.xmlNode = this.xmlRoot;
			this.layoutTree.setRoot( this.treeRoot );
			this.layoutTree.setHideRoot( false );
			this.createRMCMenuForNode( this.xmlRoot, this.treeRoot );
			this.createTreeChildren( this.xmlRoot, this.treeRoot );

			/* ******************************************************* */
			/* Any other type of data that needs to be loaded into the */
			/* form should be handled here.                            */
			/* ******************************************************* */

			// Once data is loaded, reset our dirty flag
			this.resetDirty();

			// Do the initial rendering
			this.renderDynamicLayout();

			this.clearSettingsPane();
		},

		renderDynamicLayout: function()
		{
			// Set up an empty object to hold all of the variables generated by the
			// layout engine.  This way they won't conflict with our own object
			// variables.  Note - this object needs to be a qooxdoo object because
			// the layout engine expects to be able to use it for logging any errors
			// that it encounters.
			this.renderVariableContainer = new qx.core.Object;

			// Remove all existing layout children in the render pane:
			if(this.renderingPane.getChildren().length !== 0){
				this.renderingPane.remove(this.renderingPane.getChildren()[0] );
			}

			// Re-render the layout based on the current xml document:
			dev.layout.LayoutEngine.renderLayout(this.renderVariableContainer, this.dataXml, this.renderingPane );
		},

		createTreeChildren: function(parentXml, parentTreeFolder)
		{
			for(var i = 0, l = parentXml.childNodes.length; i < l; i++){
				var xmlNode = parentXml.childNodes[i];
				if(xmlNode.nodeType !== 1){
					continue; // only process Element nodes
				}
				var treeNode = new qx.ui.tree.TreeFolder( xmlNode.nodeName );
				treeNode.xmlNode = xmlNode;
				treeNode.setOpen( true );
				parentTreeFolder.add( treeNode );
				this.createRMCMenuForNode( xmlNode, treeNode );

				// Handle all children of this node as well:
				this.createTreeChildren( xmlNode, treeNode );
			}
		},

		/** This will walk our tree and create a series of test settings that can be used
		 *  in an automated test of this form.
		 */
		genTestSettings : function() {
			var testSettings =
				"<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n" +
				"<HelixUITest>\n" +
				"\n"
			;
			var settingsPrefix = this.dataObject.getFileName().split('.')[0];

			// Walk our xml tree to pick up all of the settings we can find.
			var settingsArray = [];
			this.loadSettingsArray( this.xmlRoot, settingsArray );

			// Now take all of those settings and represent them in a way that makes it easy
			// for the developer to pick them up and copy them into their automated tests.

			// Give them the list of page objects first:
			testSettings +=
				"\t<!-- Settings Values for the Editor elements the user can manipulate on this form -->\n"
			;
			for(var i = 0, l = settingsArray.length; i < l; i++){
				var setting = settingsArray[ i ];
				testSettings +=
					"\t<Setting name=\"" + settingsPrefix + "." + setting.varName + ".EditFieldID\" " +
					"value=\"" + setting.htmlid + "\"/>\n" +
					"\t<Setting name=\"" + settingsPrefix + "." + setting.varName + ".DisplayFieldID\" " +
					"value=\"" + setting.htmlid + "\"/>\n" +
					"\n"
				;
			}

			// Now give them a list of placeholders for the data values
			testSettings +=
				"\t<!-- Input Data Values for the Editor elements the user can manipulate on this form -->\n"
			;
			for(var i = 0, l = settingsArray.length; i < l; i++){
				var setting = settingsArray[ i ];
				testSettings +=
					"\t<Setting name=\"" + settingsPrefix + "." + setting.varName + ".DataValue\" " +
					"value=\"Input Data Value Goes Here\"/>\n"
				;
			}

			// Now give them a list of fields as they would be laid out in a test:
			testSettings +=
				"\n" +
				"\t<!-- Sample set of fields as represented by this layout design -->\n" +
				"\t<Tab name=\"Tab Name Goes Here\">\n"
			;
			for(var i = 0, l = settingsArray.length; i < l; i++){
				var setting = settingsArray[ i ];
				testSettings +=
					"\t\t<Field name=\"" + setting.varName + "\" \n" +
					"\t\t\tvalue=\"${" + settingsPrefix + "." + setting.varName + ".DataValue}\" \n" +
					"\t\t\teditId=\"${" + settingsPrefix + "." + setting.varName + ".EditFieldID}\" \n" +
					"\t\t\tdisplayId=\"${" + settingsPrefix + "." + setting.varName + ".DisplayFieldID}\" \n" +
					"\t\t\ttype=\"" + setting.htmlid.split('.')[3] + "\" " +
					"/>\n"
				;
			}
			testSettings +=
				"\t</Tab>\n" +
				"\n"
			;

			testSettings +=
				"</HelixUITest>\n"

			this.TestSettingsField.setValue( testSettings );

		},

		loadSettingsArray : function( xmlNode, settingsArray) {
			// First load all of our own settings:
			var testSettingsFunction = "testSettingsFor" + xmlNode.nodeName;
			if( this[testSettingsFunction] ){
				this[testSettingsFunction]( xmlNode, settingsArray);
			} else {
				this.warn("Missing test settings function: " + testSettingsFunction);
			}

			// Now loop through our children
			for(var i = 0, l = xmlNode.childNodes.length; i < l; i++){
				if(xmlNode.childNodes[i].nodeType !== 1){
					continue; // only process Element nodes
				}
				this.loadSettingsArray( xmlNode.childNodes[i], settingsArray );
			}

		},

		/** This handles pulling data from GUI form fields and loading their values
		  * back into our data object.
		  */
		pullDataFromForm : function ()
		{
			/* ******************************************************* */
			/* For simple form fields this will handle automatically   */
			/* pulling all fields that are registered in this object   */
			/* directly from our form and saving them to the dataObject*/
			/* ******************************************************* */
			dev.Statics.pullAllFields(this, this.dataObject);

			this.dataObject.setFileContents( dev.Statics.xmlDocToString( this.dataXml ) );

			/* ******************************************************* */
			/* Any other type of data that needs to be loaded into the */
			/* form should be handled here.                            */
			/* ******************************************************* */

		},

		/** This handles verifying all of our form fields prior to saving the
		  * record back to the server.
		  */
		verifyFields : function()
		{
			// Use the built-in verification to do as much work for us as possible:
			if( dev.Statics.verifyAllFields(this) === -1) return -1;

			// Then do any special verification required here:

			// If everything is ok, return 0
			return 0;
		},

		/** This handles the calls required to save our dataObject back to the
		  * server.
		  */
		doSaveToServer : function ( )
		{
			if(this.verifyFields() === -1){
				return; // Don't save an invalid object
			}
			this.pullDataFromForm();
			if(this.isNewObject === true){
				dev.Api.SaveIAFile( this.dataObject, function(response){
					// pick up any new information here.
					this.getObjectDetails( response );
					this.resetDirty();

					// Updates our tab name, and the overview name
					this.resetTabName( this.dataObject.getFileName() );

					// Remember to add the new guy to the tree:
					/*
					qx.core.Init.getApplication().addNewTreeItem( "Parent Tree Node",
						this.dataObject.getTName(), this.dataObject,
						"dev/icon/16x16/plain/control_panel2.png" );
					*/

				}, this);
			} else {
				dev.Api.SaveIAFile( this.dataObject, function(response){
					// pick up any new information here.
					this.getObjectDetails( response );
					this.resetDirty();

					// Updates our tab name, and the overview name
					this.resetTabName( this.dataObject.getFileName() );

				}, this);
			}

		}

	},

	/* **********************************************************************
	DESTRUCTOR
	********************************************************************** */
	destruct : function() {
		this._disposeObjects(
			"tabview",
			"dataObject",
			"m_object_id"
		);
		dev.Statics.destroyExtraObjects( this );
	}

});


text:
class AltGame
  object_peers :bullet_coordinator
end


text:
<?php

namespace ASF\UserBundle\Form\Type;

use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Form\AbstractType;

use ASF\UserBundle\Utils\Manager\UserManager;

/**
 * Profile Form Type
 *
 * @author Nicolas Claverie <info@artscore-studio.fr>
 *
 */
class ProfileType extends AbstractType
{
	/**
	 * @var UserManager
	 */
	protected $userManager;

	/**
	 * @param UserManager $user_manager
	 */
	public function __construct($user_manager)
	{
		$this->userManager = $user_manager;
	}

	/**
	 * (non-PHPdoc)
	 * @see \FOS\UserBundle\Form\Type\ProfileType::buildForm()
	 */
	public function buildForm(FormBuilderInterface $builder, array $options)
	{
		$builder->remove('email')->remove('current_password');
	}

	/**
	* (non-PHPdoc)
	* @see \FOS\UserBundle\Form\Type\ProfileType::getName()
	*/
	public function getName()
	{
		return $this->userManager->getProfileFormTypeServiceName();
	}

	/**
	 * (non-PHPdoc)
	 * @see \Symfony\Component\Form\AbstractType::getParent()
	 */
	public function getParent()
	{
		return 'fos_user_profile';
	}
}


text:
package com.esri.core.geometry;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.HashMap;

public final class Wkid {
	static ArrayList<Double> readTolerances(String resourceName) {
		try {
			ArrayList<Double> tolerances = new ArrayList<Double>();
			InputStream input = Wkid.class.getResourceAsStream(resourceName);
			BufferedReader reader = new BufferedReader(new InputStreamReader(
					input));
			while (true) {
				String s = reader.readLine();
				if (s == null)
					break;
				int sep = s.indexOf('\t', 0);
				String id_s = s.substring(0, sep);
				int tol_index = Integer.parseInt(id_s);
				if (tol_index != tolerances.size())
					throw new IllegalArgumentException("Wkid.readTolerances");
				String tol_val = s.substring(sep + 1, s.length());
				tolerances.add(Double.parseDouble(tol_val));
			}

			return tolerances;
		} catch (IOException ex) {

		}
		return null;
	}

	static HashMap<Integer, Integer> readToleranceMap(String resourceName) {
		try {
			HashMap<Integer, Integer> hashMap = new HashMap<Integer, Integer>(
					600);
			InputStream input = Wkid.class.getResourceAsStream(resourceName);
			BufferedReader reader = new BufferedReader(new InputStreamReader(
					input));
			while (true) {
				String s = reader.readLine();
				if (s == null)
					break;
				int sep = s.indexOf('\t', 0);
				String id_s = s.substring(0, sep);
				int wkid = Integer.parseInt(id_s);
				String id_t = s.substring(sep + 1, s.length());
				int tol = Integer.parseInt(id_t);
				hashMap.put(wkid, tol);
			}
			return hashMap;
		} catch (IOException ex) {
		}
		return null;

	}

	static ArrayList<Double> m_gcs_tolerances = readTolerances("gcs_tolerances.txt");
	static ArrayList<Double> m_pcs_tolerances = readTolerances("pcs_tolerances.txt");
	static HashMap<Integer, Integer> m_gcsToTol = readToleranceMap("gcs_id_to_tolerance.txt");
	static HashMap<Integer, Integer> m_pcsToTol = readToleranceMap("pcs_id_to_tolerance.txt");
	static HashMap<Integer, Integer> m_wkid_to_new;
	static HashMap<Integer, Integer> m_wkid_to_old;
	static {
		try {
			m_wkid_to_new = new HashMap<Integer, Integer>(100);
			m_wkid_to_old = new HashMap<Integer, Integer>(100);
			{
				InputStream input = Wkid.class
						.getResourceAsStream("new_to_old_wkid.txt");
				BufferedReader reader = new BufferedReader(
						new InputStreamReader(input));
				while (true) {
					String s = reader.readLine();
					if (s == null)
						break;
					s = s.trim();
					if (s.length() == 0)
						continue;
					int sep = s.indexOf('\t', 0);
					String id_s = s.substring(0, sep);
					int wkid_new = Integer.parseInt(id_s);
					String id_t = s.substring(sep + 1, s.length());
					int wkid_old = Integer.parseInt(id_t);
					m_wkid_to_new.put(wkid_old, wkid_new);
					m_wkid_to_old.put(wkid_new, wkid_old);
				}
			}
			{
				InputStream input = Wkid.class
						.getResourceAsStream("intermediate_to_old_wkid.txt");
				BufferedReader reader = new BufferedReader(
						new InputStreamReader(input));
				while (true) {
					String s = reader.readLine();
					if (s == null)
						break;
					s = s.trim();
					if (s.length() == 0)
						continue;
					int sep = s.indexOf('\t', 0);
					String id_s = s.substring(0, sep);
					int wkid = Integer.parseInt(id_s);
					String id_t = s.substring(sep + 1, s.length());
					int wkid_old = Integer.parseInt(id_t);
					m_wkid_to_old.put(wkid, wkid_old);
					m_wkid_to_new.put(wkid, m_wkid_to_new.get(wkid_old));
				}
			}

		} catch (IOException ex) {

		}
	}

	public static double find_tolerance_from_wkid(int wkid) {
		double tol = find_tolerance_from_wkid_helper(wkid);
		if (tol == 1e38) {
			int old = wkid_to_old(wkid);
			if (old != wkid)
				tol = find_tolerance_from_wkid_helper(wkid);
			if (tol == 1e38)
				return 1e-10;
		}

		return tol;
	}

	private static double find_tolerance_from_wkid_helper(int wkid) {
		if (m_gcsToTol.containsKey(wkid)) {
			return m_gcs_tolerances.get(m_gcsToTol.get(wkid));
		}

		if (m_pcsToTol.containsKey(wkid)) {
			return m_pcs_tolerances.get(m_pcsToTol.get(wkid));
		}

		return 1e38;
	}

	public static int wkid_to_new(int wkid) {
		if (m_wkid_to_new.containsKey(wkid)) {
			return m_wkid_to_new.get(wkid);
		}
		return wkid;
	}

	public static int wkid_to_old(int wkid) {
		if (m_wkid_to_old.containsKey(wkid)) {
			return m_wkid_to_old.get(wkid);
		}
		return wkid;
	}
}


text:
import { transformers } from "redux-api";
import { GITHUB_REPOS_API } from "../../utils/Apis";

const headers = {
  Accept: "application/json"
};

export default {
  githubRepos: {
    url: GITHUB_REPOS_API,
    options: {
      headers,
      JWT: false,
    },
    transformer: transformers.array
  },
};


text:
<?php

namespace justso\justtexts;

use justso\justapi\RequestHelper;

interface PageInterface
{
    public function __construct($id = null, $value = null, RequestHelper $request = null);
    public function getJSON();
    public function getId();
    public function appendConfig(array &$config);
}


text:
package com.datastax.driver.core;

import com.datastax.driver.core.exceptions.NoHostAvailableException;
import com.datastax.driver.core.policies.ConstantReconnectionPolicy;
import com.datastax.driver.core.policies.ExponentialReconnectionPolicy;
import com.datastax.driver.core.policies.ReconnectionPolicy;
import org.testng.annotations.Test;

import static org.testng.Assert.assertTrue;
import static org.testng.Assert.fail;

public class ReconnectionPolicyTest extends AbstractPoliciesTest {

    /*
     * Test the ExponentialReconnectionPolicy.
     */
    @Test(groups = "long")
    public void exponentialReconnectionPolicyTest() throws Throwable {
        Cluster.Builder builder = Cluster.builder().withReconnectionPolicy(new ExponentialReconnectionPolicy(2 * 1000, 5 * 60 * 1000));

        // Ensure that ExponentialReconnectionPolicy is what we should be testing
        if (!(builder.getConfiguration().getPolicies().getReconnectionPolicy() instanceof ExponentialReconnectionPolicy)) {
            fail("Set policy does not match retrieved policy.");
        }

        // Test basic getters
        ExponentialReconnectionPolicy reconnectionPolicy = (ExponentialReconnectionPolicy) builder.getConfiguration().getPolicies().getReconnectionPolicy();
        assertTrue(reconnectionPolicy.getBaseDelayMs() == 2 * 1000);
        assertTrue(reconnectionPolicy.getMaxDelayMs() == 5 * 60 * 1000);

        // Test erroneous instantiations
        try {
            new ExponentialReconnectionPolicy(-1, 1);
            fail();
        } catch (IllegalArgumentException e) {
        }

        try {
            new ExponentialReconnectionPolicy(1, -1);
            fail();
        } catch (IllegalArgumentException e) {
        }

        try {
            new ExponentialReconnectionPolicy(-1, -1);
            fail();
        } catch (IllegalArgumentException e) {
        }

        try {
            new ExponentialReconnectionPolicy(2, 1);
            fail();
        } catch (IllegalArgumentException e) {
        }

        // Test nextDelays()
        ReconnectionPolicy.ReconnectionSchedule schedule = new ExponentialReconnectionPolicy(2 * 1000, 5 * 60 * 1000).newSchedule();
        assertTrue(schedule.nextDelayMs() == 2000);
        assertTrue(schedule.nextDelayMs() == 4000);
        assertTrue(schedule.nextDelayMs() == 8000);
        assertTrue(schedule.nextDelayMs() == 16000);
        assertTrue(schedule.nextDelayMs() == 32000);
        for (int i = 0; i < 64; ++i)
            schedule.nextDelayMs();
        assertTrue(schedule.nextDelayMs() == reconnectionPolicy.getMaxDelayMs());

        // Run integration test
        long restartTime = 2 + 4 + 8 + 2;   // 16: 3 full cycles + 2 seconds
        long retryTime = 30;                // 4th cycle start time
        long breakTime = 62;                // time until next reconnection attempt

        // TODO: Try to sort out variance
        //reconnectionPolicyTest(builder, restartTime, retryTime, breakTime);
    }

    /*
     * Test the ConstantReconnectionPolicy.
     */
    @Test(groups = "long")
    public void constantReconnectionPolicyTest() throws Throwable {
        Cluster.Builder builder = Cluster.builder().withReconnectionPolicy(new ConstantReconnectionPolicy(10 * 1000));

        // Ensure that ConstantReconnectionPolicy is what we should be testing
        if (!(builder.getConfiguration().getPolicies().getReconnectionPolicy() instanceof ConstantReconnectionPolicy)) {
            fail("Set policy does not match retrieved policy.");
        }

        // Test basic getters
        ConstantReconnectionPolicy reconnectionPolicy = (ConstantReconnectionPolicy) builder.getConfiguration().getPolicies().getReconnectionPolicy();
        assertTrue(reconnectionPolicy.getConstantDelayMs() == 10 * 1000);

        // Test erroneous instantiations
        try {
            new ConstantReconnectionPolicy(-1);
            fail();
        } catch (IllegalArgumentException e) {
        }

        // Test nextDelays()
        ReconnectionPolicy.ReconnectionSchedule schedule = new ConstantReconnectionPolicy(10 * 1000).newSchedule();
        assertTrue(schedule.nextDelayMs() == 10000);
        assertTrue(schedule.nextDelayMs() == 10000);
        assertTrue(schedule.nextDelayMs() == 10000);
        assertTrue(schedule.nextDelayMs() == 10000);
        assertTrue(schedule.nextDelayMs() == 10000);

        // Run integration test
        long restartTime = 32;      // matches the above test
        long retryTime = 40;        // 2nd cycle start time
        long breakTime = 10;        // time until next reconnection attempt

        // TODO: Try to sort out variance
        //reconnectionPolicyTest(builder, restartTime, retryTime, breakTime);
    }

    public void reconnectionPolicyTest(Cluster.Builder builder, long restartTime, long retryTime, long breakTime) throws Throwable {
        CCMBridge.CCMCluster c = CCMBridge.buildCluster(1, builder);

        try {
            createSchema(c.session, 1);
            init(c, 12);
            query(c, 12);

            // Ensure a basic test works
            assertQueried(CCMBridge.IP_PREFIX + '1', 12);
            resetCoordinators();
            c.cassandraCluster.forceStop(1);

            // Start timing and ensure that the node is down
            long startTime = 0;
            try {
                startTime = System.nanoTime() / 1000000000;
                query(c, 12);
                fail("Test race condition where node has not shut off quickly enough.");
            } catch (NoHostAvailableException e) {
            }

            long thisTime;
            boolean restarted = false;
            while (true) {
                thisTime = System.nanoTime() / 1000000000;

                // Restart node at restartTime
                if (!restarted && thisTime - startTime > restartTime) {
                    c.cassandraCluster.start(1);
                    restarted = true;
                }

                // Continue testing queries each second
                try {
                    query(c, 12);
                    assertQueried(CCMBridge.IP_PREFIX + '1', 12);
                    resetCoordinators();

                    // Ensure the time when the query completes successfully is what was expected
                    assertTrue(retryTime - 2 < thisTime - startTime && thisTime - startTime < retryTime + 2, String.format("Waited %s seconds instead an expected %s seconds wait", thisTime - startTime, retryTime));
                } catch (NoHostAvailableException e) {
                    Thread.sleep(1000);
                    continue;
                }

                Thread.sleep(breakTime);

                // The the same query once more, just to be sure
                query(c, 12);
                assertQueried(CCMBridge.IP_PREFIX + '1', 12);
                resetCoordinators();

                // Ensure the reconnection times reset
                c.cassandraCluster.forceStop(1);

                // Start timing and ensure that the node is down
                startTime = 0;
                try {
                    startTime = System.nanoTime() / 1000000000;
                    query(c, 12);
                    fail("Test race condition where node has not shut off quickly enough.");
                } catch (NoHostAvailableException e) {
                }

                restarted = false;
                while (true) {
                    thisTime = System.nanoTime() / 1000000000;

                    // Restart node at restartTime
                    if (!restarted && thisTime - startTime > restartTime) {
                        c.cassandraCluster.start(1);
                        restarted = true;
                    }

                    // Continue testing queries each second
                    try {
                        query(c, 12);
                        assertQueried(CCMBridge.IP_PREFIX + '1', 12);
                        resetCoordinators();

                        // Ensure the time when the query completes successfully is what was expected
                        assertTrue(retryTime - 2 < thisTime - startTime && thisTime - startTime < retryTime + 2, String.format("Waited %s seconds instead an expected %s seconds wait", thisTime - startTime, retryTime));
                    } catch (NoHostAvailableException e) {
                        Thread.sleep(1000);
                        continue;
                    }
                    break;
                }
                break;
            }

        } catch (Throwable e) {
            c.errorOut();
            throw e;
        } finally {
            resetCoordinators();
            c.discard();
        }
    }
}


text:
const insertDummy = (svg, $window) => {
  // insert dummy animate element for firefox implementation
  const dummy = $window.document.getElementById('ss-dummy-animate');
  if (dummy == null) {
    const animate = $window.document.createElementNS('http://www.w3.org/2000/svg', 'animate');
    animate.setAttribute('id', 'ss-dummy-animate');
    svg.appendChild(animate);
  }
};

export default insertDummy;


text:
/* eslint-disable no-param-reassign */
import { EXT_ID } from 'const';

const chromeRuntime = (type, url, params) =>
  new Promise((resolve, reject) => {
    chrome.runtime.sendMessage(EXT_ID(), { type, url, params }, (response) => {
      if (!response) {
        reject();
        return;
      }

      if (response.success) {
        resolve(response.resp);
      } else {
        reject(response.resp);
      }
    });
  });

chrome.runtime.sendMessage(EXT_ID(), {
  type: 'CONFIG',
  configObj: {
    baseURL: 'https://api.gotinder.com/',
    timeout: 30000,
  },
});

chrome.runtime.sendMessage(EXT_ID(), {
  type: 'ATTACH_HEADERS',
  host: '*://api.gotinder.com/*',
  callback: `(details) => {
    details.requestHeaders.forEach((header) => {
      if (header.name === 'User-Agent') {
        header.value = 'Tinder/6.3.1 (iPhone; iOS 10.0.2; Scale/2.00)';
      }
      if (header.name === 'Origin') {
        header.value = '';
      }
    });
    return { requestHeaders: details.requestHeaders };
  }`,
});

export const get = (url, params) => chromeRuntime('GET', url, params);

export const post = (url, params) => chromeRuntime('POST', url, params);

export const del = (url, params) => chromeRuntime('DELETE', url, params);

export default {
  get,
  post,
  del,
};


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Beih. Nova Hedwigia 111: 167 (1996)

#### Original name
Trogia crinipelliformis Corner

### Remarks
null