text:
package uk.co.listpoint.context;

import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlSchemaType;
import javax.xml.bind.annotation.XmlType;
import javax.xml.datatype.XMLGregorianCalendar;

/**
 *
Java class for Context6Structure complex type.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *
 *

 * <complexType name="Context6Structure">
 *   <complexContent>
 *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *       <sequence>
 *         <element name="Environment" type="{http://www.w3.org/2001/XMLSchema}string"/>
 *         <element name="PersistentURLRoot" type="{http://www.listpoint.co.uk/schemas/v6}URL6Type" minOccurs="0"/>
 *         <element name="PersistentURL" type="{http://www.listpoint.co.uk/schemas/v6}URL6Type" minOccurs="0"/>
 *         <element name="ContextName" type="{http://www.listpoint.co.uk/schemas/v6}FullName6Structure"/>
 *         <element name="ContextType" type="{http://www.listpoint.co.uk/schemas/v6}Context6Type"/>
 *         <element name="AdminStatus" type="{http://www.listpoint.co.uk/schemas/v6}AdminStatus6Type" minOccurs="0"/>
 *         <element name="RegistrationStatus" type="{http://www.listpoint.co.uk/schemas/v6}RegistrationStatus6Type" minOccurs="0"/>
 *         <element name="Description" type="{http://www.listpoint.co.uk/schemas/v6}LongString6Type" minOccurs="0"/>
 *         <element name="UsageGuidelines" type="{http://www.listpoint.co.uk/schemas/v6}LongString6Type" minOccurs="0"/>
 *         <element name="LastChangeDate" type="{http://www.w3.org/2001/XMLSchema}date" minOccurs="0"/>
 *         <element name="LastUserName" type="{http://www.listpoint.co.uk/schemas/v6}UserName6Type" minOccurs="0"/>
 *         <element name="PublicationDate" type="{http://www.w3.org/2001/XMLSchema}date" minOccurs="0"/>
 *         <element name="PublicationPolicy" type="{http://www.listpoint.co.uk/schemas/v6}PublicationPolicy6Type" minOccurs="0"/>
 *         <element name="ChangeReason" type="{http://www.listpoint.co.uk/schemas/v6}ChangeReason6Type" minOccurs="0"/>
 *         <element name="DocumentationURL" type="{http://www.listpoint.co.uk/schemas/v6}URL6Type" minOccurs="0"/>
 *         <element name="OwnerTeam" type="{http://www.listpoint.co.uk/schemas/v6}TeamName6Type"/>
 *         <element name="StewardTeam" type="{http://www.listpoint.co.uk/schemas/v6}TeamName6Type"/>
 *         <element name="RelatedContext" type="{http://www.listpoint.co.uk/schemas/v6}ContextRelationship6Structure" maxOccurs="unbounded" minOccurs="0"/>
 *         <element name="LiveStartDate" type="{http://www.w3.org/2001/XMLSchema}date" minOccurs="0"/>
 *         <element name="LiveEndDate" type="{http://www.w3.org/2001/XMLSchema}date" minOccurs="0"/>
 *         <element name="NameSpacePrefix" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
 *         <element name="NameSpace" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
 *         <element name="WebSiteURL" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
 *         <element name="ImageURL" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
 *         <element name="EnumeratedDataType" type="{http://www.listpoint.co.uk/schemas/v6}EnumeratedDataType6Structure" maxOccurs="unbounded" minOccurs="0"/>
 *       </sequence>
 *     </restriction>
 *   </complexContent>
 * </complexType>
 *

 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "Context6Structure", namespace = "http://www.listpoint.co.uk/schemas/v6", propOrder = {
    "environment",
    "persistentURLRoot",
    "persistentURL",
    "contextName",
    "contextType",
    "adminStatus",
    "registrationStatus",
    "description",
    "usageGuidelines",
    "lastChangeDate",
    "lastUserName",
    "publicationDate",
    "publicationPolicy",
    "changeReason",
    "documentationURL",
    "ownerTeam",
    "stewardTeam",
    "relatedContext",
    "liveStartDate",
    "liveEndDate",
    "nameSpacePrefix",
    "nameSpace",
    "webSiteURL",
    "imageURL",
    "enumeratedDataType"
})
public class Context6Structure {

    @XmlElement(name = "Environment", required = true)
    protected String environment;
    @XmlElement(name = "PersistentURLRoot")
    protected String persistentURLRoot;
    @XmlElement(name = "PersistentURL")
    protected String persistentURL;
    @XmlElement(name = "ContextName", required = true)
    protected FullName6Structure contextName;
    @XmlElement(name = "ContextType", required = true)
    protected Context6Type contextType;
    @XmlElement(name = "AdminStatus")
    protected String adminStatus;
    @XmlElement(name = "RegistrationStatus")
    protected String registrationStatus;
    @XmlElement(name = "Description")
    protected String description;
    @XmlElement(name = "UsageGuidelines")
    protected String usageGuidelines;
    @XmlElement(name = "LastChangeDate")
    @XmlSchemaType(name = "date")
    protected XMLGregorianCalendar lastChangeDate;
    @XmlElement(name = "LastUserName")
    protected String lastUserName;
    @XmlElement(name = "PublicationDate")
    @XmlSchemaType(name = "date")
    protected XMLGregorianCalendar publicationDate;
    @XmlElement(name = "PublicationPolicy")
    protected String publicationPolicy;
    @XmlElement(name = "ChangeReason")
    protected String changeReason;
    @XmlElement(name = "DocumentationURL")
    protected String documentationURL;
    @XmlElement(name = "OwnerTeam", required = true)
    protected String ownerTeam;
    @XmlElement(name = "StewardTeam", required = true)
    protected String stewardTeam;
    @XmlElement(name = "RelatedContext")
    protected List<ContextRelationship6Structure> relatedContext;
    @XmlElement(name = "LiveStartDate")
    @XmlSchemaType(name = "date")
    protected XMLGregorianCalendar liveStartDate;
    @XmlElement(name = "LiveEndDate")
    @XmlSchemaType(name = "date")
    protected XMLGregorianCalendar liveEndDate;
    @XmlElement(name = "NameSpacePrefix")
    protected String nameSpacePrefix;
    @XmlElement(name = "NameSpace")
    protected String nameSpace;
    @XmlElement(name = "WebSiteURL")
    protected String webSiteURL;
    @XmlElement(name = "ImageURL")
    protected String imageURL;
    @XmlElement(name = "EnumeratedDataType")
    protected List<EnumeratedDataType6Structure> enumeratedDataType;

    /**
     * Gets the value of the environment property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getEnvironment() {
        return environment;
    }

    /**
     * Sets the value of the environment property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setEnvironment(String value) {
        this.environment = value;
    }

    /**
     * Gets the value of the persistentURLRoot property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getPersistentURLRoot() {
        return persistentURLRoot;
    }

    /**
     * Sets the value of the persistentURLRoot property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setPersistentURLRoot(String value) {
        this.persistentURLRoot = value;
    }

    /**
     * Gets the value of the persistentURL property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getPersistentURL() {
        return persistentURL;
    }

    /**
     * Sets the value of the persistentURL property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setPersistentURL(String value) {
        this.persistentURL = value;
    }

    /**
     * Gets the value of the contextName property.
     *
     * @return
     *     possible object is
     *     {@link FullName6Structure }
     *
     */
    public FullName6Structure getContextName() {
        return contextName;
    }

    /**
     * Sets the value of the contextName property.
     *
     * @param value
     *     allowed object is
     *     {@link FullName6Structure }
     *
     */
    public void setContextName(FullName6Structure value) {
        this.contextName = value;
    }

    /**
     * Gets the value of the contextType property.
     *
     * @return
     *     possible object is
     *     {@link Context6Type }
     *
     */
    public Context6Type getContextType() {
        return contextType;
    }

    /**
     * Sets the value of the contextType property.
     *
     * @param value
     *     allowed object is
     *     {@link Context6Type }
     *
     */
    public void setContextType(Context6Type value) {
        this.contextType = value;
    }

    /**
     * Gets the value of the adminStatus property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getAdminStatus() {
        return adminStatus;
    }

    /**
     * Sets the value of the adminStatus property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setAdminStatus(String value) {
        this.adminStatus = value;
    }

    /**
     * Gets the value of the registrationStatus property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getRegistrationStatus() {
        return registrationStatus;
    }

    /**
     * Sets the value of the registrationStatus property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setRegistrationStatus(String value) {
        this.registrationStatus = value;
    }

    /**
     * Gets the value of the description property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getDescription() {
        return description;
    }

    /**
     * Sets the value of the description property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setDescription(String value) {
        this.description = value;
    }

    /**
     * Gets the value of the usageGuidelines property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getUsageGuidelines() {
        return usageGuidelines;
    }

    /**
     * Sets the value of the usageGuidelines property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setUsageGuidelines(String value) {
        this.usageGuidelines = value;
    }

    /**
     * Gets the value of the lastChangeDate property.
     *
     * @return
     *     possible object is
     *     {@link XMLGregorianCalendar }
     *
     */
    public XMLGregorianCalendar getLastChangeDate() {
        return lastChangeDate;
    }

    /**
     * Sets the value of the lastChangeDate property.
     *
     * @param value
     *     allowed object is
     *     {@link XMLGregorianCalendar }
     *
     */
    public void setLastChangeDate(XMLGregorianCalendar value) {
        this.lastChangeDate = value;
    }

    /**
     * Gets the value of the lastUserName property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getLastUserName() {
        return lastUserName;
    }

    /**
     * Sets the value of the lastUserName property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setLastUserName(String value) {
        this.lastUserName = value;
    }

    /**
     * Gets the value of the publicationDate property.
     *
     * @return
     *     possible object is
     *     {@link XMLGregorianCalendar }
     *
     */
    public XMLGregorianCalendar getPublicationDate() {
        return publicationDate;
    }

    /**
     * Sets the value of the publicationDate property.
     *
     * @param value
     *     allowed object is
     *     {@link XMLGregorianCalendar }
     *
     */
    public void setPublicationDate(XMLGregorianCalendar value) {
        this.publicationDate = value;
    }

    /**
     * Gets the value of the publicationPolicy property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getPublicationPolicy() {
        return publicationPolicy;
    }

    /**
     * Sets the value of the publicationPolicy property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setPublicationPolicy(String value) {
        this.publicationPolicy = value;
    }

    /**
     * Gets the value of the changeReason property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getChangeReason() {
        return changeReason;
    }

    /**
     * Sets the value of the changeReason property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setChangeReason(String value) {
        this.changeReason = value;
    }

    /**
     * Gets the value of the documentationURL property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getDocumentationURL() {
        return documentationURL;
    }

    /**
     * Sets the value of the documentationURL property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setDocumentationURL(String value) {
        this.documentationURL = value;
    }

    /**
     * Gets the value of the ownerTeam property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getOwnerTeam() {
        return ownerTeam;
    }

    /**
     * Sets the value of the ownerTeam property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setOwnerTeam(String value) {
        this.ownerTeam = value;
    }

    /**
     * Gets the value of the stewardTeam property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getStewardTeam() {
        return stewardTeam;
    }

    /**
     * Sets the value of the stewardTeam property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setStewardTeam(String value) {
        this.stewardTeam = value;
    }

    /**
     * Gets the value of the relatedContext property.
     *
     *

     * This accessor method returns a reference to the live list,
     * not a snapshot. Therefore any modification you make to the
     * returned list will be present inside the JAXB object.
     * This is why there is not a set method for the relatedContext property.
     *
     *

     * For example, to add a new item, do as follows:
     *

     *    getRelatedContext().add(newItem);
     *

     *
     *
     *

     * Objects of the following type(s) are allowed in the list
     * {@link ContextRelationship6Structure }
     *
     *
     */
    public List<ContextRelationship6Structure> getRelatedContext() {
        if (relatedContext == null) {
            relatedContext = new ArrayList<ContextRelationship6Structure>();
        }
        return this.relatedContext;
    }

    /**
     * Gets the value of the liveStartDate property.
     *
     * @return
     *     possible object is
     *     {@link XMLGregorianCalendar }
     *
     */
    public XMLGregorianCalendar getLiveStartDate() {
        return liveStartDate;
    }

    /**
     * Sets the value of the liveStartDate property.
     *
     * @param value
     *     allowed object is
     *     {@link XMLGregorianCalendar }
     *
     */
    public void setLiveStartDate(XMLGregorianCalendar value) {
        this.liveStartDate = value;
    }

    /**
     * Gets the value of the liveEndDate property.
     *
     * @return
     *     possible object is
     *     {@link XMLGregorianCalendar }
     *
     */
    public XMLGregorianCalendar getLiveEndDate() {
        return liveEndDate;
    }

    /**
     * Sets the value of the liveEndDate property.
     *
     * @param value
     *     allowed object is
     *     {@link XMLGregorianCalendar }
     *
     */
    public void setLiveEndDate(XMLGregorianCalendar value) {
        this.liveEndDate = value;
    }

    /**
     * Gets the value of the nameSpacePrefix property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getNameSpacePrefix() {
        return nameSpacePrefix;
    }

    /**
     * Sets the value of the nameSpacePrefix property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setNameSpacePrefix(String value) {
        this.nameSpacePrefix = value;
    }

    /**
     * Gets the value of the nameSpace property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getNameSpace() {
        return nameSpace;
    }

    /**
     * Sets the value of the nameSpace property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setNameSpace(String value) {
        this.nameSpace = value;
    }

    /**
     * Gets the value of the webSiteURL property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getWebSiteURL() {
        return webSiteURL;
    }

    /**
     * Sets the value of the webSiteURL property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setWebSiteURL(String value) {
        this.webSiteURL = value;
    }

    /**
     * Gets the value of the imageURL property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getImageURL() {
        return imageURL;
    }

    /**
     * Sets the value of the imageURL property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setImageURL(String value) {
        this.imageURL = value;
    }

    /**
     * Gets the value of the enumeratedDataType property.
     *
     *

     * This accessor method returns a reference to the live list,
     * not a snapshot. Therefore any modification you make to the
     * returned list will be present inside the JAXB object.
     * This is why there is not a set method for the enumeratedDataType property.
     *
     *

     * For example, to add a new item, do as follows:
     *

     *    getEnumeratedDataType().add(newItem);
     *

     *
     *
     *

     * Objects of the following type(s) are allowed in the list
     * {@link EnumeratedDataType6Structure }
     *
     *
     */
    public List<EnumeratedDataType6Structure> getEnumeratedDataType() {
        if (enumeratedDataType == null) {
            enumeratedDataType = new ArrayList<EnumeratedDataType6Structure>();
        }
        return this.enumeratedDataType;
    }

}


text:
<?php

namespace App\Command;

use Silex\Application;
use Symfony\Component\Console\Command\Command;

abstract class ContainerAwareCommand extends Command
{

    /** @var Application */
    protected $app;

    public function __construct(Application $app, $name = null)
    {
        parent::__construct($name);
        $this->app = $app;
    }
}

redpajama_set_name: RedPajamaGithub


text:
using System;
using System.IO;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Threading;
using System.Configuration;
using System.Collections.Generic;
using System.Windows.Automation;
using System.Text.RegularExpressions;
using System.Runtime.InteropServices.ComTypes;
using System.Text;
using Microsoft.Win32;
using OpenQA.Selenium;
using OpenQA.Selenium.Support;
using OpenQA.Selenium.IE;

namespace WOPIautomation
{
    [TestClass]
    public class TestBase
    {
        #region Variables
        protected static int waittime_window;
        protected static int waittime_item;
        public static string testingfolderPath;
        public static string testName;
        public static bool isWOPI;
        public static string testResultPath;
        public static string captureName;

        public TestContext TestContext { get; set; }
        #endregion

        [AssemblyInitialize()]
        public static void AssemblyInit(TestContext context)
        {
            MessageParser.StartFiddler();
        }

        [AssemblyCleanup()]
        public static void AssemblyCleanup()
        {
            MessageParser.CloseFiddler();
        }

        [TestInitialize()]
        public void Initialize()
        {
            MessageParser.ClearSessions();

            GetTestCatgoryInformation();
            if (!isWOPI)
            {
                GetTestingFolder();
                FormatConvert.StartFiddlerExe();
            }
            else
            {
                GetTestingFolder();
                StartTrace();
            }
			Browser.Initialize();
        }

        /// <summary>
        /// Test clean up
        /// </summary>
        [TestCleanup]
        public void CleanUp()
        {
            Browser.Goto(Browser.BaseAddress);
            Browser.Close();
        }

        /// <summary>
        /// Start capture remote trace on WOPI server
        /// </summary>
        public void StartTrace()
        {
            string startScriptPath = ConfigurationManager.AppSettings["StartScriptPath"];
            string FullPath = Path.GetFullPath(startScriptPath);
            Utility.ExecuteScript(FullPath);

        }

        /// <summary>
        /// Stop capture remote trace on WOPI server
        /// </summary>
        public void StopTrace()
        {
            string stopScriptPath = ConfigurationManager.AppSettings["StopScriptPath"];
            string FullPath = Path.GetFullPath(stopScriptPath);
            Utility.ExecuteScript(FullPath, false);
        }

        /// <summary>
        /// Get test method CachedMode information
        /// </summary>
        public void GetTestCatgoryInformation()
        {
            // Initialize the test output folder path
            testingfolderPath = TestContext.TestDeploymentDir;
            testName = TestContext.TestName;

            Type classType = Type.GetType(TestContext.FullyQualifiedTestClassName);
            MethodBase method = classType.GetMethod(TestContext.TestName);
            object[] CustomAttributes = method.GetCustomAttributes(typeof(TestCategoryAttribute), true);
            if (CustomAttributes.Length > 0)
            {
                TestCategoryAttribute attr = (TestCategoryAttribute)CustomAttributes[0];
                if (attr != null && attr.TestCategories.Count > 0)
                {
                    if (attr.TestCategories[0] == "WOPI")
                    {
                        isWOPI = true;
                    }
                    else
                    {
                        isWOPI = false;
                    }
                }
            }
        }

        /// <summary>
        /// Get test folder information
        /// </summary>
        public static void GetTestingFolder()
        {
            testResultPath = string.Empty;

            if (!Directory.Exists(testingfolderPath))
            {
                testingfolderPath = Regex.Replace(testingfolderPath, @"\s+", "");
            }
            testResultPath =  testingfolderPath + Path.DirectorySeparatorChar + testName;
            Directory.CreateDirectory(testResultPath);
            captureName = testResultPath + Path.DirectorySeparatorChar + testName + ".saz";
        }
    }
}


text:
subdir = src/test/examples
top_builddir = ../../..
include $(top_builddir)/src/Makefile.global

override CPPFLAGS := -I$(libpq_srcdir) $(CPPFLAGS)
override LDLIBS := $(libpq_pgport) $(LDLIBS)

PROGS = testlibpq testlibpq2 testlibpq3 testlibpq4 testlo

all: $(PROGS)

clean:
	rm -f $(PROGS)


text:
<?php

namespace Ups\Entity;

use DOMDocument;
use DOMElement;
use Ups\NodeInterface;

/**
 * Class PackageServiceOptions
 * @package Ups\Entity
 */
class PackageServiceOptions implements NodeInterface
{
    /**
     * @var COD
     */
    private $cod;

    /**
     * @var InsuredValue
     */
    private $insuredValue;

    /**
     * @var string
     */
    private $earliestDeliveryTime;

    /**
     * @var HazMat[]
     */
    private $hazMat = [];

    /**
     * @var HazMatPackageInformation
     */
    private $hazMatPackageInformation;

    /**
     * @var string
     */
    private $holdForPickup;

    /**
     * @param null $parameters
     */
    public function __construct($parameters = null)
    {
        if (null !== $parameters) {
            if (isset($parameters->COD)) {
                $this->setCOD(new COD($parameters->COD));
            }
            if (isset($parameters->InsuredValue)) {
                $this->setInsuredValue(new InsuredValue($parameters->InsuredValue));
            }
            if (isset($parameters->EarliestDeliveryTime)) {
                $this->setEarliestDeliveryTime($parameters->EarliestDeliveryTime);
            }
            if (isset($parameters->HoldForPickup)) {
                $this->setHoldForPickup($parameters->HoldForPickup);
            }
        }
    }

    /**
     * @param null|DOMDocument $document
     *
     * @TODO: this seem to be awfully incomplete
     *
     * @return DOMElement
     */
    public function toNode(DOMDocument $document = null)
    {
        if (null === $document) {
            $document = new DOMDocument();
        }

        $node = $document->createElement('PackageServiceOptions');

        if ($this->getInsuredValue()) {
            $node->appendChild($this->getInsuredValue()->toNode($document));
        }
        foreach ($this->getHazMat() as $hazmat) {
            $node->appendChild($hazmat->toNode($document));
        }
        if ($this->getHazMatPackageInformation() !== null) {
            $node->appendChild($this->getHazMatPackageInformation()->toNode($document));
        }

        return $node;
    }

    /**
     * @return InsuredValue|null
     */
    public function getInsuredValue()
    {
        return $this->insuredValue;
    }

    /**
     * @param $var
     */
    public function setInsuredValue($var)
    {
        $this->insuredValue = $var;
    }

    /**
     * @return COD|null
     */
    public function getCOD()
    {
        return $this->cod;
    }

    /**
     * @param $var
     */
    public function setCOD($var)
    {
        $this->cod = $var;
    }

    /**
     * @return string|null
     */
    public function getEarliestDeliveryTime()
    {
        return $this->earliestDeliveryTime;
    }

    /**
     * @param $var
     */
    public function setEarliestDeliveryTime($var)
    {
        $this->earliestDeliveryTime = $var;
    }

    /**
     * @return HazMat[]
     */
    public function getHazMat()
    {
        return $this->hazMat;
    }

    /**
     * @param HazMat[] $hazMat
     */
    public function setHazMat(array $hazMat)
    {
        $this->hazMat = $hazMat;
    }

    /**
     * @param HazMat $hazmat
     */
    public function addHazMat(HazMat $hazmat)
    {
        $this->hazMat[] = $hazmat;
    }

    /**
     * @return string|null
     */
    public function getHoldForPickup()
    {
        return $this->holdForPickup;
    }

    /**
     * @param $var
     */
    public function setHoldForPickup($var)
    {
        $this->holdForPickup = $var;
    }

    /**
     * @return HazMatPackageInformation
     */
    public function getHazMatPackageInformation()
    {
        return $this->hazMatPackageInformation;
    }

    /**
     * @param HazMatPackageInformation $hazMatPackageInformation
     */
    public function setHazMatPackageInformation($hazMatPackageInformation)
    {
        $this->hazMatPackageInformation = $hazMatPackageInformation;
    }
}


text:
package org.jets3t.service.utils;

import java.text.DecimalFormat;
import java.text.ParseException;

import javax.swing.text.NumberFormatter;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

/**
 * Formats numeric byte values into human-readable strings.
 *
 * @author James Murty
 */
public class ByteFormatter {
    private static final Log log = LogFactory.getLog(ByteFormatter.class);

    private String gigabyteSuffix = null;
    private String megabyteSuffix = null;
    private String kilobyteSuffix = null;
    private String byteSuffix = null;
    private NumberFormatter nf = null;

    /**
     * Constructs a formatter that will use default text to represent byte amounts.
     * Default values used:
     *

     *
Gigabyte suffix: " GB"

     *
Megabyte suffix: " MB"

     *
Kilobyte suffix: " KB"

     *
Byte suffix: " B"

     *
Precision: 2 decimal places

     *

     *
     */
    public ByteFormatter() {
        this(" GB", " MB", " KB", " B", 2);
    }

    /**
     * Constructs a formatter that will use the given values when formatting byte values.
     *
     * @param gigabyteSuffix
     * string to display at the end of gigabyte values.
     * @param megabyteSuffix
     * string to display at the end of megabyte values.
     * @param kilobyteSuffix
     * string to display at the end of kilobyte values.
     * @param byteSuffix
     * string to display at the end of byte values.
     * @param decimalPlaces
     * the number of decimal places to use when converting byte amounts into kilo, mega or giga
     * byte values.
     */
    public ByteFormatter(String gigabyteSuffix, String megabyteSuffix, String kilobyteSuffix,
        String byteSuffix, int decimalPlaces)
    {
        this.gigabyteSuffix = gigabyteSuffix;
        this.megabyteSuffix = megabyteSuffix;
        this.kilobyteSuffix = kilobyteSuffix;
        this.byteSuffix = byteSuffix;

        StringBuilder numberFormatString = new StringBuilder();
        numberFormatString.append("0").append((decimalPlaces > 0? "." : ""));
        for (int i = 0; i < decimalPlaces; i++) {
            numberFormatString.append("0");
        }
        nf = new NumberFormatter(new DecimalFormat(numberFormatString.toString()));
    }

    /**
     * Converts a byte size into a human-readable string, such as "1.43 MB" or "27 KB".
     * The values used are based on powers of 1024, ie 1 KB = 1024 bytes, not 1000 bytes.
     *
     * @param byteSize
     * the byte size of some item
     * @return
     * a human-readable description of the byte size
     */
    public String formatByteSize(long byteSize) {
        String result = null;
        try {
            if (byteSize > Math.pow(1024,3)) {
                // Report gigabytes
                result = nf.valueToString(new Double(byteSize / Math.pow(1024,3))) + gigabyteSuffix;
            } else if (byteSize > Math.pow(1024,2)) {
                // Report megabytes
                result = nf.valueToString(new Double(byteSize / Math.pow(1024,2))) + megabyteSuffix;
            } else if (byteSize > 1024) {
                // Report kilobytes
                result = nf.valueToString(new Double(byteSize / Math.pow(1024,1))) + kilobyteSuffix;
            } else if (byteSize >= 0) {
                // Report bytes
                result = byteSize + byteSuffix;
            }
        } catch (ParseException e) {
            if (log.isErrorEnabled()) {
                log.error("Unable to format byte size " + byteSize, e);
            }
            return byteSize + byteSuffix;
        }
        return result;
    }

}


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>JapKatsuyou.JpConj: jpconj/UiHelper/language.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>

<link href="search/search.css" rel="stylesheet" type="text/css"/>

<link href="doxygen.css" rel="stylesheet" type="text/css" />

JapKatsuyou.JpConj
    2.0.0

Japanese verbs conjugation: main program

Main Page

Namespaces

Classes

Files

          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)"
               onblur="searchBox.OnSearchFieldFocus(false)"
               onkeyup="searchBox.OnSearchFieldChange(event)"/>

File List

File Members

jpconj

UiHelper

Classes |
Typedefs

language.h File Reference

#include <QApplication>

#include <QDebug>

#include <QDir>

#include <QFile>

#include <QHash>

#include <QMainWindow>

#include <QPair>

#include <QSettings>

#include <QString>

#include <QTranslator>

Go to the source code of this file.

Classes

class  	Language

Typedefs

typedef QPair< QTranslator *, QTranslator * > 	PairTrans

Typedef Documentation

          typedef QPair<QTranslator*, QTranslator*> PairTrans

<address class="footer">
Generated by

 1.8.11
</address>


text:
ACCEPTED

#### According to
Interim Register of Marine and Nonmarine Genera

#### Published in
Biol. Centralbl. , 16, 553.

#### Original name
null

### Remarks
null


text:
package jarvis

//Licensed under the Apache License, Version 2.0 (the "License");
//you may not use this file except in compliance with the License.
//You may obtain a copy of the License at
//
//http://www.apache.org/licenses/LICENSE-2.0
//
//Unless required by applicable law or agreed to in writing, software
//distributed under the License is distributed on an "AS IS" BASIS,
//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//See the License for the specific language governing permissions and
//limitations under the License.
//
// Code generated by Alibaba Cloud SDK Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.

import (
	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
)

// CreateUidWhiteListGroup invokes the jarvis.CreateUidWhiteListGroup API synchronously
// api document: https://help.aliyun.com/api/jarvis/createuidwhitelistgroup.html
func (client *Client) CreateUidWhiteListGroup(request *CreateUidWhiteListGroupRequest) (response *CreateUidWhiteListGroupResponse, err error) {
	response = CreateCreateUidWhiteListGroupResponse()
	err = client.DoAction(request, response)
	return
}

// CreateUidWhiteListGroupWithChan invokes the jarvis.CreateUidWhiteListGroup API asynchronously
// api document: https://help.aliyun.com/api/jarvis/createuidwhitelistgroup.html
// asynchronous document: https://help.aliyun.com/document_detail/66220.html
func (client *Client) CreateUidWhiteListGroupWithChan(request *CreateUidWhiteListGroupRequest) (<-chan *CreateUidWhiteListGroupResponse, <-chan error) {
	responseChan := make(chan *CreateUidWhiteListGroupResponse, 1)
	errChan := make(chan error, 1)
	err := client.AddAsyncTask(func() {
		defer close(responseChan)
		defer close(errChan)
		response, err := client.CreateUidWhiteListGroup(request)
		if err != nil {
			errChan <- err
		} else {
			responseChan <- response
		}
	})
	if err != nil {
		errChan <- err
		close(responseChan)
		close(errChan)
	}
	return responseChan, errChan
}

// CreateUidWhiteListGroupWithCallback invokes the jarvis.CreateUidWhiteListGroup API asynchronously
// api document: https://help.aliyun.com/api/jarvis/createuidwhitelistgroup.html
// asynchronous document: https://help.aliyun.com/document_detail/66220.html
func (client *Client) CreateUidWhiteListGroupWithCallback(request *CreateUidWhiteListGroupRequest, callback func(response *CreateUidWhiteListGroupResponse, err error)) <-chan int {
	result := make(chan int, 1)
	err := client.AddAsyncTask(func() {
		var response *CreateUidWhiteListGroupResponse
		var err error
		defer close(result)
		response, err = client.CreateUidWhiteListGroup(request)
		callback(response, err)
		result <- 1
	})
	if err != nil {
		defer close(result)
		callback(nil, err)
		result <- 0
	}
	return result
}

// CreateUidWhiteListGroupRequest is the request struct for api CreateUidWhiteListGroup
type CreateUidWhiteListGroupRequest struct {
	*requests.RpcRequest
	Note            string           `position:"Query" name:"Note"`
	ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"`
	SourceIp        string           `position:"Query" name:"SourceIp"`
	DstPort         requests.Integer `position:"Query" name:"DstPort"`
	InstanceIdList  string           `position:"Query" name:"InstanceIdList"`
	LiveTime        requests.Integer `position:"Query" name:"LiveTime"`
	ProductName     string           `position:"Query" name:"ProductName"`
	WhiteListType   requests.Integer `position:"Query" name:"WhiteListType"`
	Lang            string           `position:"Query" name:"Lang"`
	SrcUid          string           `position:"Query" name:"SrcUid"`
	SourceCode      string           `position:"Query" name:"SourceCode"`
}

// CreateUidWhiteListGroupResponse is the response struct for api CreateUidWhiteListGroup
type CreateUidWhiteListGroupResponse struct {
	*responses.BaseResponse
	RequestId string `json:"RequestId" xml:"RequestId"`
	Module    string `json:"Module" xml:"Module"`
}

// CreateCreateUidWhiteListGroupRequest creates a request to invoke CreateUidWhiteListGroup API
func CreateCreateUidWhiteListGroupRequest() (request *CreateUidWhiteListGroupRequest) {
	request = &CreateUidWhiteListGroupRequest{
		RpcRequest: &requests.RpcRequest{},
	}
	request.InitWithApiInfo("jarvis", "2018-02-06", "CreateUidWhiteListGroup", "jarvis", "openAPI")
	return
}

// CreateCreateUidWhiteListGroupResponse creates a response to parse from CreateUidWhiteListGroup response
func CreateCreateUidWhiteListGroupResponse() (response *CreateUidWhiteListGroupResponse) {
	response = &CreateUidWhiteListGroupResponse{
		BaseResponse: &responses.BaseResponse{},
	}
	return
}


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

<TITLE>
unzipped.src.groovy
</TITLE>

<META NAME="keywords" CONTENT="unzipped/src/groovy package">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">

unzipped.src.groovy

Classes

ClassDiagram
DotBuilder


text:
package net.spals.appbuilder.annotations.service;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * Marks a Guice Module to be auto-bound
 * in a set within an application.
 *
 * Guice Modules will be bound during the bootstrap
 * phase of an application, which allows them to
 * dynamically bind services at boot time.
 *
 * @author tkral
 */
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
public @interface AutoBindModule {  }


text:
<?php

// CoachellaUserBundle:Pages:testTemplate43.html.twig
return array (
);


text:
def Setup(Settings,DefaultModel):
    # shuffle_effective.py

    Settings["experiment_name"] = "Test_Shuffling_3 models vs 3 models_5556x_mark_res_299x299_shuffleNowInMod6"
    Settings["graph_histories"] = ['together', [0,3], [1,4], [2,5],[0,1,2],[3,4,5]]

    n=0
    Settings["models"][n]["dataset_name"] = "5556x_mark_res_299x299" # "1200x_markable_299x299", "5556x_mark_res_299x299", "5556x_markable_640x640"
    Settings["models"][n]["pixels"] = 299
    Settings["models"][n]["model_type"] = 'notShuffled_img_osm_mix'
    Settings["models"][n]["unique_id"] = 'mix'
    Settings["models"][n]["top_repeat_FC_block"] = 2
    Settings["models"][n]["epochs"] = 300
    Settings["models"][n]["shuffle_dataset"] = False

    Settings["models"].append(DefaultModel.copy())
    n=1
    Settings["models"][n]["dataset_pointer"] = 0 # 0 - reuse the first dataset
    Settings["models"][n]["model_type"] = 'osm_only'
    Settings["models"][n]["unique_id"] = 'notShuffled_osm_only'
    Settings["models"][n]["top_repeat_FC_block"] = 2
    Settings["models"][n]["epochs"] = 300
    Settings["models"][n]["shuffle_dataset"] = False

    Settings["models"].append(DefaultModel.copy())
    n=2
    Settings["models"][n]["dataset_pointer"] = 0 # 0 - reuse the first dataset
    Settings["models"][n]["model_type"] = 'simple_cnn_with_top'
    Settings["models"][n]["unique_id"] = 'notShuffled_img_only'
    Settings["models"][n]["top_repeat_FC_block"] = 2
    Settings["models"][n]["epochs"] = 300
    Settings["models"][n]["shuffle_dataset"] = False

    Settings["models"].append(DefaultModel.copy())
    n=3
    Settings["models"][n]["dataset_pointer"] = -1 # 0 - reuse the first dataset

    Settings["models"][n]["dataset_name"] = "5556x_mark_res_299x299" # "1200x_markable_299x299", "5556x_mark_res_299x299", "5556x_markable_640x640"
    Settings["models"][n]["pixels"] = 299
    Settings["models"][n]["model_type"] = 'img_osm_mix'
    Settings["models"][n]["unique_id"] = 'Shuffled_img_osm_mix'
    Settings["models"][n]["top_repeat_FC_block"] = 2
    Settings["models"][n]["epochs"] = 300
    Settings["models"][n]["shuffle_dataset"] = True

    Settings["models"].append(DefaultModel.copy())
    n=4
    Settings["models"][n]["dataset_pointer"] = 1
    Settings["models"][n]["model_type"] = 'osm_only'
    Settings["models"][n]["unique_id"] = 'Shuffled_osm_only'
    Settings["models"][n]["top_repeat_FC_block"] = 2
    Settings["models"][n]["epochs"] = 300
    Settings["models"][n]["shuffle_dataset"] = True

    Settings["models"].append(DefaultModel.copy())
    n=5
    Settings["models"][n]["dataset_pointer"] = 1
    Settings["models"][n]["model_type"] = 'simple_cnn_with_top'
    Settings["models"][n]["unique_id"] = 'Shuffled_img_only'
    Settings["models"][n]["top_repeat_FC_block"] = 2
    Settings["models"][n]["epochs"] = 300
    Settings["models"][n]["shuffle_dataset"] = True

    return Settings


text:
var table = L.DomUtil.get('table');
var container = L.DomUtil.get('maps');
var result = L.DomUtil.get('result');

var map, rect;

function showBounds () {
	if (!(map && result)) {
		return;
	}
	var b = rect.getBounds()
	result.innerHTML = '
 Bounds for this layer:
' +
		'\n\n[' +
		'[' + b.getSouth() + ', ' + b.getWest() + '], ' +
		'[' + b.getNorth() + ', ' + b.getEast() + ']' +
		']

' +
		'zoomlevel: ' + map.getZoom();
}

function addLayer (provider) {
	var layer = L.tileLayer.provider(provider);

	var url = layer._url.replace('{variant}', layer.options.variant);
	var options = L.extend({}, layer.options, layer._options);

	// we're only interested in layers with bounds here.
	if (!options.bounds) {
		return;
	}
	var bounds = L.latLngBounds(options.bounds);

	var row = L.DomUtil.create('tr', '', table);
	L.DomUtil.create('td', '', row).innerHTML = provider;

	L.DomEvent.on(row, 'click', function () {
		if (map && map.remove) {
			map.remove();
		}
		for (var i = 0; i < table.children.length; i++) {
			L.DomUtil.removeClass(table.children[i], 'active');
		}
		L.DomUtil.addClass(row, 'active');

		container.innerHTML = '';
		L.DomUtil.create('h2', '', container).innerHTML = provider;

		map = L.map(L.DomUtil.create('div', 'map', container)).setView([52, 4], 6);
		// map.addLayer(L.tileLayer.provider('Acetate.basemap'))
		map.addLayer(layer);

		rect = L.rectangle(options.bounds, {
			fill: false,
			weight: 2,
			opacity: 1
		}).addTo(map);

		rect.editing.enable();
		map.on('click zoomend', showBounds);
		showBounds();

		map.fitBounds(options.bounds);
	});
}
L.DomEvent.on(L.DomUtil.get('dump-bounds'), 'click', showBounds);

L.tileLayer.provider.eachLayer(addLayer);


text:
package example.danielsierraf.pruebarappi.api.classes;

import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by danielsierraf on 6/11/16.
 */
public class Feed {
    @SerializedName("author")
    @Expose
    private Author author;
    @SerializedName("entry")
    @Expose
    private List<AppDetail> entry = new ArrayList<AppDetail>();
    @SerializedName("updated")
    @Expose
    private Updated updated;
    @SerializedName("rights")
    @Expose
    private Rights rights;
    @SerializedName("title")
    @Expose
    private Title title;
    @SerializedName("icon")
    @Expose
    private Icon icon;
    @SerializedName("link")
    @Expose
    private List<Link> link = new ArrayList<Link>();
    @SerializedName("id")
    @Expose
    private Id_ id;

    public Author getAuthor() {
        return author;
    }

    public void setAuthor(Author author) {
        this.author = author;
    }

    public List<AppDetail> getEntry() {
        return entry;
    }

    public void setEntry(List<AppDetail> entry) {
        this.entry = entry;
    }

    public Updated getUpdated() {
        return updated;
    }

    public void setUpdated(Updated updated) {
        this.updated = updated;
    }

    public Rights getRights() {
        return rights;
    }

    public void setRights(Rights rights) {
        this.rights = rights;
    }

    public Title getTitle() {
        return title;
    }

    public void setTitle(Title title) {
        this.title = title;
    }

    public Icon getIcon() {
        return icon;
    }

    public void setIcon(Icon icon) {
        this.icon = icon;
    }

    public List<Link> getLink() {
        return link;
    }

    public void setLink(List<Link> link) {
        this.link = link;
    }

    public Id_ getId() {
        return id;
    }

    public void setId(Id_ id) {
        this.id = id;
    }
}


text:
package com.newweather.app.fragment;

import android.app.ProgressDialog;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v4.view.GravityCompat;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;

import com.newweather.app.MainActivity;
import com.newweather.app.R;
import com.newweather.app.WeatherActivity;
import com.newweather.app.entity.City;
import com.newweather.app.entity.County;
import com.newweather.app.entity.Province;
import com.newweather.app.utils.Constant;
import com.newweather.app.utils.HttpUtil;
import com.newweather.app.utils.JsonUtil;

import org.litepal.crud.DataSupport;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

import okhttp3.Call;
import okhttp3.Callback;
import okhttp3.Response;

/**
 * Created by Mr.Qing on 2017/10/28.
 */

public class ChooseAreaFragment extends Fragment {
    public static final int LEVEL_PROVINCE = 0;
    public static final int LEVEL_CITY = 1;
    public static final int LEVEL_COUNTY = 2;

    private ProgressDialog progressDialog;
    private TextView titleText;
    private ListView listView;
    private Button backBt;

    private ArrayAdapter<String> adapter;
    private List<String> dataList = new ArrayList<String>();
    /**
     * 省列表
     */
    private List<Province> provinceList;
    /**
     * 市列表
     */
    private List<City> cityList;
    /**
     * 县列表
     */
    private List<County> countyList;
    /**
     * 选中的省份
     */
    private Province selectedProvince;
    /**
     * 选中的城市
     */
    private City selectedCity;
    /**
     * 当前选中的级别
     */
    private int currentLevel;

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {

        View view=inflater.inflate(R.layout.choose_area,container,false);
        titleText = (TextView) view.findViewById(R.id.title_text);
        backBt = (Button) view.findViewById(R.id.bt_back);
        listView =(ListView) view.findViewById(R.id.list_view);
        adapter = new ArrayAdapter<String>(getActivity(), android.R.layout.simple_list_item_1, dataList);
        listView.setAdapter(adapter);
        adapter.notifyDataSetChanged();
        Log.d("选择了该城市","");
        return view;

    }

    @Override
    public void onActivityCreated(Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);

        listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
            @Override
            public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
                if (currentLevel == LEVEL_PROVINCE) {

                    selectedProvince = provinceList.get(i);
                    queryCities();
                } else if (currentLevel == LEVEL_CITY) {
                    selectedCity = cityList.get(i);
                    queryCounties();
                }else if(currentLevel == LEVEL_COUNTY){
                    String weatherId = countyList.get(i).getWeatherId();
                    if(getActivity() instanceof MainActivity) {
                        Intent intent = new Intent(getActivity(), WeatherActivity.class);
                        intent.putExtra("weather_id", weatherId);
                        Log.d("选择了该城市111111",weatherId+"dddd");
                        startActivity(intent);
                        getActivity().finish();
                    }else if(getActivity() instanceof  WeatherActivity){
                        WeatherActivity activity = (WeatherActivity) getActivity();
                        activity.mDrawerLayout.closeDrawers();
                        activity.mSwipeRefreshLayout.setRefreshing(true);
                        activity.requestWeather(weatherId);
                        Log.d("选择了该城市",weatherId+"dddd");

                    }
                }
            }
        });
        backBt.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                if (currentLevel == LEVEL_COUNTY) {
                    queryCities();
                } else if (currentLevel == LEVEL_CITY) {
                    queryProvinces();
                }

            }
        });

        queryProvinces();
    }
    /**
     * 查询全国所有的省,优先从数据库查询,如果没有查询到再去服务器上查询。
     */
    private void queryProvinces() {

        titleText.setText("帆顺天气");
        backBt.setVisibility(View.GONE);
        provinceList = DataSupport.findAll(Province.class);

        if (provinceList.size() > 0) {
            dataList.clear();
            for (Province province : provinceList) {
                dataList.add(province.getProvinceName());

            }
            adapter.notifyDataSetChanged();
            listView.setSelection(0);
            currentLevel = LEVEL_PROVINCE;
        } else {
            String url = Constant.CHINA;
            queryFromServer(url, "province");

        }
    }

    /**
     * 查询选中省内所有的市,优先从数据库查询,如果没有查询到再去服务器上查询。
     */
    private void queryCities() {
       titleText.setText(selectedProvince.getProvinceName());
        backBt.setVisibility(View.VISIBLE);
        cityList =DataSupport.where("provinceid = ?",String.valueOf(selectedProvince.getId())).find(City.class);
        if (cityList.size() > 0) {
            dataList.clear();
            for (City city : cityList) {
                dataList.add(city.getCityName());
            }
            adapter.notifyDataSetChanged();
            listView.setSelection(0);

            currentLevel = LEVEL_CITY;
        } else {
            int provinceCode =selectedProvince.getProvinceCode();
            String url = Constant.CHINA+"/"+provinceCode;
            Log.d("地址",url);
            queryFromServer(url, "city");

        }
    }

    /**
     * 查询选中市内所有的县,优先从数据库查询,如果没有查询到再去服务器上查询。
     */
    private void queryCounties() {
        titleText.setText(selectedCity.getCityName());
        backBt.setVisibility(View.VISIBLE);
        countyList = DataSupport.where("cityid = ?",String.valueOf(selectedCity.getId())).find(County.class);
        if (countyList.size() > 0) {
            dataList.clear();
            for (County county : countyList) {
                dataList.add(county.getCountyName());
            }
            adapter.notifyDataSetChanged();
            listView.setSelection(0);
            currentLevel = LEVEL_COUNTY;
        } else {
            int provinceCode = selectedProvince.getProvinceCode();
            int cityCode = selectedCity.getCityCode();
            String url = Constant.CHINA+"/"+provinceCode+"/"+cityCode;
            queryFromServer(url, "county");
        }
    }

    /**
     * 根据传入的代号和类型从服务器上查询省市县数据
     */
    private void queryFromServer( String url, final String type) {
        showProgressDialog();
        HttpUtil.sendOkHttpRequest(url, new Callback() {

            @Override
            public void onFailure(Call call, IOException e) {
                getActivity().runOnUiThread(new Runnable() {
                    @Override
                    public void run() {
                        closeProgressDialog();
                        Toast.makeText(getActivity(),"服务器连接失败",Toast.LENGTH_SHORT).show();

                    }
                });
            }

            @Override
            public void onResponse(Call call, Response response) throws IOException {

                String responseText = response.body().string();
                Log.d("数据",responseText);
                boolean result = false;
                if ("province".equals(type)) {

                    result = JsonUtil.handleProvinceResponse(responseText);
                } else if ("city".equals(type)) {
                    result = JsonUtil.handleCityResponse(responseText, selectedProvince.getId());
                } else if ("county".equals(type)) {
                    Log.d("数据",result+"");
                    result = JsonUtil.handleCountyResponse(responseText, selectedCity.getId());

                }

                if (result) {

                    // 通过runOnUiThread()方法回到主线程处理逻辑
                  getActivity().runOnUiThread(new Runnable() {
                        @Override
                        public void run() {

                            closeProgressDialog();
                            if ("province".equals(type)) {
                                queryProvinces();
                            } else if ("city".equals(type)) {
                                queryCities();
                            } else if ("county".equals(type)) {
                                queryCounties();
                            }
                        }
                        });
                }

            }
                    });

            }

            /**
             * 显示进度对话框
             */
            private void showProgressDialog() {
                if (progressDialog == null) {
                    progressDialog = new ProgressDialog(getActivity());
                    progressDialog.setMessage("正在加载...");
                    progressDialog.setCanceledOnTouchOutside(false);
                }
                progressDialog.show();
            }
            /**
             * 关闭进度对话框
             */
            private void closeProgressDialog() {
                if (progressDialog != null) {
                    progressDialog.dismiss();
                }
            }

}


text:
N, X = map(int, input().split())
[print(sum(marks) / len(marks)) for marks in zip(*[list(map(float, input().split())) for _ in range(X)])]


text:
/*
 * Now we'll get to know how low-level DB data storage works. For this we'll create a simple record class and use it to store a person's
 * data in a DB table.
 * We use such low-level storage if we want to store something in the DB what we don't want to use as part of content items. This includes
 * data that e.g. our module uses internally and we don't really want to expose to the outside world.
 * Make sure to read the corresponding documentation (http://docs.orchardproject.net/Documentation/Understanding-data-access) first!
 */

using System;
using Orchard.Data.Conventions;

namespace OrchardHUN.TrainingDemo.Models
{
    /*
     * This is a record class: it's directly mapped to a DB table.
     * Be aware that all public properties should be virtual: this is needed by NHibernate, the underlying ORM library.
     * Every property declared here except Name is special in some way: you can use others (like other integer values) without further thought.
     */
    public class PersonRecord
    {
        // An integer id is needed.
        public virtual int Id { get; set; }

        public virtual string Name { get; set; }

        // We can store enums as well
        public virtual Sex Sex { get; set; }

        // Best practice for DateTimes is that they should always be nullable (note the question mark).
        // Most of the time the best is to store dates in UTC.
        public virtual DateTime? BirthDateUtc { get; set; }

        // This attribute tells that the string can has infinite lenght. If we wouldn't use it the string could be truncated.
        [StringLengthMax]
        public virtual string Biography { get; set; }

        // If you want to set defaults for when some of the record's properties are not filled upon creation, set them from the ctor.
        public PersonRecord()
        {
            Biography = "This person has not written a biography yet.";
        }
    }

    public enum Sex
    {
        Male,
        Female
    }
}

// NEXT STATION: Migrations


text:
package org.apache.phoenix.util;

import java.sql.SQLException;

import org.apache.hadoop.hbase.Cell;
import org.apache.hadoop.hbase.CellUtil;
import org.apache.hadoop.hbase.HConstants;
import org.apache.hadoop.hbase.client.HTableInterface;
import org.apache.phoenix.coprocessor.MetaDataProtocol.MetaDataMutationResult;
import org.apache.phoenix.exception.SQLExceptionCode;
import org.apache.phoenix.exception.SQLExceptionInfo;
import org.apache.phoenix.execute.MutationState;
import org.apache.phoenix.jdbc.PhoenixConnection;
import org.apache.phoenix.schema.PTable;
import org.apache.phoenix.transaction.PhoenixTransactionContext;
import org.apache.phoenix.transaction.PhoenixTransactionalTable;
import org.apache.phoenix.transaction.TephraTransactionTable;
import org.apache.phoenix.transaction.TransactionFactory;

public class TransactionUtil {
    private TransactionUtil() {
    }

    public static boolean isDelete(Cell cell) {
        return (CellUtil.matchingValue(cell, HConstants.EMPTY_BYTE_ARRAY));
    }

    public static long convertToNanoseconds(long serverTimeStamp) {
        return serverTimeStamp * TransactionFactory.getTransactionFactory().getTransactionContext().getMaxTransactionsPerSecond();
    }

    public static long convertToMilliseconds(long serverTimeStamp) {
        return serverTimeStamp / TransactionFactory.getTransactionFactory().getTransactionContext().getMaxTransactionsPerSecond();
    }

    public static PhoenixTransactionalTable getPhoenixTransactionTable(PhoenixTransactionContext phoenixTransactionContext, HTableInterface htable, PTable pTable) {
        return new TephraTransactionTable(phoenixTransactionContext, htable, pTable);
    }

    // we resolve transactional tables at the txn read pointer
	public static long getResolvedTimestamp(PhoenixConnection connection, boolean isTransactional, long defaultResolvedTimestamp) {
		MutationState mutationState = connection.getMutationState();
		Long scn = connection.getSCN();
	    return scn != null ?  scn : (isTransactional && mutationState.isTransactionStarted()) ? convertToMilliseconds(mutationState.getInitialWritePointer()) : defaultResolvedTimestamp;
	}

	public static long getResolvedTime(PhoenixConnection connection, MetaDataMutationResult result) {
		PTable table = result.getTable();
		boolean isTransactional = table!=null && table.isTransactional();
		return getResolvedTimestamp(connection, isTransactional, result.getMutationTime());
	}

	public static long getResolvedTimestamp(PhoenixConnection connection, MetaDataMutationResult result) {
		PTable table = result.getTable();
		MutationState mutationState = connection.getMutationState();
		boolean txInProgress = table != null && table.isTransactional() && mutationState.isTransactionStarted();
		return  txInProgress ? convertToMilliseconds(mutationState.getInitialWritePointer()) : result.getMutationTime();
	}

	public static Long getTableTimestamp(PhoenixConnection connection, boolean transactional) throws SQLException {
		Long timestamp = null;
		if (!transactional) {
			return timestamp;
		}
		MutationState mutationState = connection.getMutationState();
		if (!mutationState.isTransactionStarted()) {
			mutationState.startTransaction();
		}
		timestamp = convertToMilliseconds(mutationState.getInitialWritePointer());
		return timestamp;
	}
}


text:
using System;
using System.Globalization;
using System.Windows.Data;

namespace KodiRemote.Wp81.Converters
{
    public class SecondsToStringConverter : IValueConverter
    {
        public virtual object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (!(value is int)) return "00:00";

            int lenght = (int)value;

            int hour = 0;
            int minutes = lenght / 60;
            int seconds = lenght % 60;

            if (minutes > 60)
            {
                hour = minutes / 60;
                minutes = minutes % 60;
            }

            return hour > 0
                       ? string.Format("{0}:{1:00}:{2:00}", hour, minutes, seconds)
                       : string.Format("{0:00}:{1:00}", minutes, seconds);
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }

    public class MilliSecondsToStringConverter : SecondsToStringConverter
    {
        public override object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (!(value is int)) return "00:00";

            int lenght = (int) value / 1000;
            return base.Convert(lenght, targetType, parameter, culture);
        }
    }
}


text:
@interface CTRequestNavigationViewController : UINavigationController

@end


text:
static NSString * const GEOCODE_URL = @"https://maps.googleapis.com/maps/api/geocode/json";

@interface APGeocodeClient ()

@end

@implementation APGeocodeClient

+ (void) convertAddress:(NSString*)addr ofType:(ADDRESS_TYPE)type inDelegate:(id<APNetworkAPI>)delegate{
    addr = [addr stringByReplacingOccurrencesOfString:@" " withString:@"+"];

    NSMutableDictionary *params = [[NSMutableDictionary alloc] init];

    [params setObject:addr forKey:@"address"];
    [params setObject:GOOGLE_API_KEY forKey:@"key"];

    AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];

    manager.responseSerializer = [AFJSONResponseSerializer serializer];
    manager.requestSerializer = [AFHTTPRequestSerializer serializer];

    [manager GET:GEOCODE_URL parameters:params success:^(AFHTTPRequestOperation *operation, id responseObject) {
        // Process Response Object
        NSDictionary *response = (NSDictionary *)responseObject;
//        NSLog(@"Geocode response: %@",response);
        if ([response[@"status"] isEqualToString:@"OK"]) {
            NSArray* results = (NSArray*) response[@"results"];
            NSDictionary *contents = [results objectAtIndex:0];

            CGFloat lat = [contents[@"geometry"][@"location"][@"lat"] floatValue];
            CGFloat lng = [contents[@"geometry"][@"location"][@"lng"] floatValue];

            CLLocationCoordinate2D coord;
            coord.latitude = lat;
            coord.longitude = lng;

            NSArray* addressComponents = contents[@"address_components"];
            NSString *country;

            for (NSDictionary *component in addressComponents) {
                //find type of component
                NSArray *types = component[@"types"];
                if ([types containsObject:@"country"]) {
                    country = component[@"short_name"];
                    if (![country isEqualToString:@"IT"]) {
                        NSMutableDictionary* details = [NSMutableDictionary dictionary];
                        [details setValue:@"Impossibile cercare distributori fuori dal territorio Italiano"
                                   forKey:NSLocalizedDescriptionKey];
                        NSError *error = [NSError errorWithDomain:@"saveoil" code:1001 userInfo:details];
                        [delegate convertedAddressType:type to:coord error:error];
                        return;
                    }
                }
            }

            [delegate convertedAddressType:type to:coord error:nil];

        }

    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        CLLocationCoordinate2D coord;
        [delegate convertedAddressType:type to:coord error:error];

    }];

}
+ (void) convertCoordinate:(CLLocationCoordinate2D)coord ofType:(ADDRESS_TYPE)type inDelegate:(id<APNetworkAPI>)delegate{
    NSString *latlng = [NSString stringWithFormat:@"%f,%f",coord.latitude,coord.longitude];

    NSMutableDictionary *params = [[NSMutableDictionary alloc] init];

    [params setObject:latlng forKey:@"latlng"];
    [params setObject:GOOGLE_API_KEY forKey:@"key"];
    AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];

    manager.responseSerializer = [AFJSONResponseSerializer serializer];
    manager.requestSerializer = [AFHTTPRequestSerializer serializer];

    [manager GET:GEOCODE_URL parameters:params success:^(AFHTTPRequestOperation *operation, id responseObject) {
        // Process Response Object
        NSDictionary *response = (NSDictionary *)responseObject;
        if ([response[@"status"] isEqualToString:@"OK"]) {

            NSArray* results = (NSArray*) response[@"results"];
            NSDictionary *contents = [results objectAtIndex:0];
            [delegate convertedCoordinateType:type to:contents[@"formatted_address"] error:nil];

        }

    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        [delegate convertedCoordinateType:type to:nil error:error];

    }];
}

+ (void) convertCoordinate:(CLLocationCoordinate2D)coord found:(void (^)(NSString*, NSString *))found{
    NSString *latlng = [NSString stringWithFormat:@"%f,%f",coord.latitude,coord.longitude];

    NSMutableDictionary *params = [[NSMutableDictionary alloc] init];

    [params setObject:latlng forKey:@"latlng"];
    [params setObject:GOOGLE_API_KEY forKey:@"key"];
    AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];

    manager.responseSerializer = [AFJSONResponseSerializer serializer];
    manager.requestSerializer = [AFHTTPRequestSerializer serializer];

    [manager GET:GEOCODE_URL parameters:params success:^(AFHTTPRequestOperation *operation, id responseObject) {
        // Process Response Object
        NSDictionary *response = (NSDictionary *)responseObject;
        if ([response[@"status"] isEqualToString:@"OK"]) {
            NSString *street = @"";
            NSString *streetNumber = @"";
            NSString *cap = @"";
            NSString *city = @"";

            NSString *streetAndNumber;
            NSString *CAPAndCity;
            BOOL hasroute = NO;

            NSArray* results = (NSArray*) response[@"results"];
            NSDictionary *contents = [results objectAtIndex:0];
//            ALog("Geocode result %@",contents);

            NSArray* addressComponents = contents[@"address_components"];

            for (NSDictionary *component in addressComponents) {
                //find type of component
                NSArray *types = component[@"types"];
                if ([types containsObject:@"street_number"]) {
                    streetNumber = component[@"long_name"];
                } else if ([types containsObject:@"route"]){
                    street = component[@"long_name"];
                    hasroute = YES;
                } else if (!hasroute && [types containsObject:@"locality"]){
                    street = component[@"long_name"];
                } else if ([types containsObject:@"postal_code"]){
                    cap = component[@"long_name"];
                } else if([types containsObject:@"administrative_area_level_2"]){
                    city = component[@"long_name"];
                }
            }

            streetAndNumber = [NSString stringWithFormat:@"%@ %@", street, streetNumber];
            if ([cap length] > 0) {
                CAPAndCity = [NSString stringWithFormat:@"%@ %@",cap ,city];
            } else{
                CAPAndCity = city;
            }
            //call the block
            found(streetAndNumber, CAPAndCity);

        }

    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        // Handle Error

    }];
}

@end


text:
<!DOCTYPE html>

	<meta charset="utf-8">
	<title><?php echo $title;?></title>
	<meta name="description" content="Bootstrap Metro Dashboard">
	<meta name="author" content="Dennis Ji">
	<meta name="keyword" content="Metro, Metro UI, Dashboard, Bootstrap, Admin, Template, Theme, Responsive, Fluid, Retina">

	<meta name="viewport" content="width=device-width, initial-scale=1">

	<?php $this->load->view("commons/bm/styling");?>

				Metro

					<?php $this->load->view("commons/bm/hiddenphonedropdown");?>
					<?php $this->load->view("commons/bm/notificationdropdown");?>
					<?php $this->load->view("commons/bm/messagedropdown");?>
					<?php $this->load->view("commons/bm/settings");?>
					<?php $this->load->view("commons/bm/profile");?>

		<?php $this->load->view("commons/bm/sidemenu");?>

			<?php echo $breadcrumb[1];?>

<?php echo $breadcrumb[2];?>

Edit <?php echo $title;?>

						<form class="form-horizontal" action="/<?php echo $parent;?>/save" method="post">
						  <fieldset>

								Nama

								  <input class="input-xlarge focused" id="name" name="name" type="text" value="">

								Perusahaan

								  <?php echo form_dropdown("company_id",$companies,0,"id=company");?>

							  Keterangan

								<input type="text" class="span6 typeahead" id="description" name="description"/>

							  <button type="submit" id="btnsave" class="btn btn-primary">Save changes</button>
							  <button type="reset" class="btn">Cancel</button>

						  </fieldset>
						</form>

			<button type="button" class="close" data-dismiss="modal">×</button>

Settings

Here settings can be configured...

			Close
			Save changes

	<?php $this->load->view("commons/bm/footer");?>
	<?php $this->load->view("commons/bm/js");?>


text:
.oo-ui-icon-bell {
	background-image: /* @embed */ url(themes/mediawiki/images/icons/bell.svg);
}
.oo-ui-icon-bell-invert {
	background-image: /* @embed */ url(themes/mediawiki/images/icons/bell-invert.svg);
}
.oo-ui-icon-bellOn {
	background-image: /* @embed */ url(themes/mediawiki/images/icons/bellOn-ltr.svg);
}
.oo-ui-icon-bellOn-invert {
	background-image: /* @embed */ url(themes/mediawiki/images/icons/bellOn-ltr-invert.svg);
}
.oo-ui-icon-eye {
	background-image: /* @embed */ url(themes/mediawiki/images/icons/eye.svg);
}
.oo-ui-icon-eye-invert {
	background-image: /* @embed */ url(themes/mediawiki/images/icons/eye-invert.svg);
}
.oo-ui-icon-eyeClosed {
	background-image: /* @embed */ url(themes/mediawiki/images/icons/eyeClosed.svg);
}
.oo-ui-icon-eyeClosed-invert {
	background-image: /* @embed */ url(themes/mediawiki/images/icons/eyeClosed-invert.svg);
}
.oo-ui-icon-message {
	background-image: /* @embed */ url(themes/mediawiki/images/icons/message-ltr.svg);
}
.oo-ui-icon-message-invert {
	background-image: /* @embed */ url(themes/mediawiki/images/icons/message-ltr-invert.svg);
}
.oo-ui-icon-signature {
	background-image: /* @embed */ url(themes/mediawiki/images/icons/signature-ltr.svg);
}
.oo-ui-icon-signature-invert {
	background-image: /* @embed */ url(themes/mediawiki/images/icons/signature-ltr-invert.svg);
}
.oo-ui-icon-speechBubble {
	background-image: /* @embed */ url(themes/mediawiki/images/icons/speechBubble-ltr.svg);
}
.oo-ui-icon-speechBubble-invert {
	background-image: /* @embed */ url(themes/mediawiki/images/icons/speechBubble-ltr-invert.svg);
}
.oo-ui-icon-speechBubbleAdd {
	background-image: /* @embed */ url(themes/mediawiki/images/icons/speechBubbleAdd-ltr.svg);
}
.oo-ui-icon-speechBubbleAdd-invert {
	background-image: /* @embed */ url(themes/mediawiki/images/icons/speechBubbleAdd-ltr-invert.svg);
}
.oo-ui-icon-speechBubbles {
	background-image: /* @embed */ url(themes/mediawiki/images/icons/speechBubbles-ltr.svg);
}
.oo-ui-icon-speechBubbles-invert {
	background-image: /* @embed */ url(themes/mediawiki/images/icons/speechBubbles-ltr-invert.svg);
}


text:
package org.apache.hadoop.hbase.replication;

import java.util.Arrays;
import org.apache.hadoop.hbase.client.replication.ReplicationPeerConfigUtil;
import org.apache.yetus.audience.InterfaceAudience;

import org.apache.hbase.thirdparty.com.google.protobuf.InvalidProtocolBufferException;

import org.apache.hadoop.hbase.shaded.protobuf.ProtobufUtil;
import org.apache.hadoop.hbase.shaded.protobuf.generated.ReplicationProtos;

/**
 * Used by synchronous replication. Indicate the state of the current cluster in a synchronous
 * replication peer. The state may be one of {@link SyncReplicationState#ACTIVE},
 * {@link SyncReplicationState#DOWNGRADE_ACTIVE} or {@link SyncReplicationState#STANDBY}.
 * <p>
 * For asynchronous replication, the state is {@link SyncReplicationState#NONE}.
 */
@InterfaceAudience.Public
public enum SyncReplicationState {
  NONE(0),
  ACTIVE(1),
  DOWNGRADE_ACTIVE(2),
  STANDBY(3);

  private final byte value;

  private SyncReplicationState(int value) {
    this.value = (byte) value;
  }

  public static SyncReplicationState valueOf(int value) {
    switch (value) {
      case 0:
        return NONE;
      case 1:
        return ACTIVE;
      case 2:
        return DOWNGRADE_ACTIVE;
      case 3:
        return STANDBY;
      default:
        throw new IllegalArgumentException("Unknown synchronous replication state " + value);
    }
  }

  public int value() {
    return value & 0xFF;
  }

  public static byte[] toByteArray(SyncReplicationState state) {
    return ProtobufUtil
      .prependPBMagic(ReplicationPeerConfigUtil.toSyncReplicationState(state).toByteArray());
  }

  public static SyncReplicationState parseFrom(byte[] bytes) throws InvalidProtocolBufferException {
    return ReplicationPeerConfigUtil.toSyncReplicationState(ReplicationProtos.SyncReplicationState
      .parseFrom(Arrays.copyOfRange(bytes, ProtobufUtil.lengthOfPBMagic(), bytes.length)));
  }
}


text:
package org.keycloak.testsuite.util;

import org.keycloak.common.util.BouncyIntegration;
import org.keycloak.crypto.KeyStatus;
import org.keycloak.crypto.KeyUse;
import org.keycloak.representations.idm.KeysMetadataRepresentation;

import java.security.KeyFactory;
import java.security.NoSuchAlgorithmException;
import java.security.PrivateKey;
import java.security.PublicKey;
import java.security.spec.InvalidKeySpecException;
import java.security.spec.PKCS8EncodedKeySpec;
import java.security.spec.X509EncodedKeySpec;
import java.util.Base64;

/**
 * @author mhajas
 */
public class KeyUtils {
    static {
        BouncyIntegration.init();
    }

    public static PublicKey publicKeyFromString(String key) {
        try {
            KeyFactory kf = KeyFactory.getInstance("RSA");
            byte[] encoded = Base64.getDecoder().decode(key);
            return kf.generatePublic(new X509EncodedKeySpec(encoded));
        } catch (NoSuchAlgorithmException | InvalidKeySpecException e) {
            throw new RuntimeException(e);
        }
    }

    public static PrivateKey privateKeyFromString(String key) {
        try {
            KeyFactory kf = KeyFactory.getInstance("RSA");
            byte[] encoded = Base64.getDecoder().decode(key);
            return kf.generatePrivate(new PKCS8EncodedKeySpec(encoded));
        } catch (NoSuchAlgorithmException | InvalidKeySpecException e) {
            throw new RuntimeException(e);
        }
    }

    public static KeysMetadataRepresentation.KeyMetadataRepresentation getActiveSigningKey(KeysMetadataRepresentation keys, String algorithm) {
        for (KeysMetadataRepresentation.KeyMetadataRepresentation k : keys.getKeys()) {
            if (k.getAlgorithm().equals(algorithm) && KeyStatus.valueOf(k.getStatus()).isActive() && KeyUse.SIG.equals(k.getUse())) {
                return k;
            }
        }
        throw new RuntimeException("Active key not found");
    }

    public static KeysMetadataRepresentation.KeyMetadataRepresentation getActiveEncKey(KeysMetadataRepresentation keys, String algorithm) {
        for (KeysMetadataRepresentation.KeyMetadataRepresentation k : keys.getKeys()) {
            if (k.getAlgorithm().equals(algorithm) && KeyStatus.valueOf(k.getStatus()).isActive() && KeyUse.ENC.equals(k.getUse())) {
                return k;
            }
        }
        throw new RuntimeException("Active key not found");
    }

}


text:
/*jslint vars: true, plusplus: true, devel: true, nomen: true, indent: 4, maxerr: 50 */
/*global define */

/**
 * Provides these events:
 *
 *   - agentConnected (agent):
 *       when information about functions and call sites has been received
 */

define(function (require, exports, module) {
    var ChromeAgent = require("./Agent-chrome");
    var NodeAgent   = require("./Agent-node");

    var $exports = $(exports);

    var _connectedAgents = [];

    function _addAgent(agent) {
        var i = _connectedAgents.indexOf(agent);
        if (i === -1) {
            _connectedAgents.push(agent);
        }
        $exports.triggerHandler("agentConnected", agent);
    }

    function _removeAgent(agent) {
        var i = _connectedAgents.indexOf(agent);
        if (i !== -1) {
            _connectedAgents.splice(i, 1);
        }
    }

    function init() {
        $(NodeAgent).on("connect", function () { _addAgent(NodeAgent) });
        $(NodeAgent).on("disconnect", function () { _removeAgent(NodeAgent) });

        $(ChromeAgent).on("connect", function () { _addAgent(ChromeAgent) });
        $(ChromeAgent).on("disconnect", function () { _removeAgent(ChromeAgent) });
    }

    function agents() {
        return _connectedAgents.slice();
    }

    function resetTrace() {
        agents().forEach(function (agent) {
            agent.resetTrace();
        });
    }

    exports.init = init;
    exports.agents = agents;
    exports.resetTrace = resetTrace;
});


text:
package aws

import (
	awsutil "github.com/giantswarm/aws-operator/client/aws"
)

type AWSEntity struct {
	Clients awsutil.Clients
}


text:
#include "gear_config.h"
#include <libtest/test.hpp>

using namespace libtest;

#include <cassert>
#include <cstring>
#include <libgearman/gearman.h>
#include <tests/unique.h>

#include <tests/start_worker.h>

#include "libgearman/client.hpp"
#include "libgearman/worker.hpp"
using namespace org::gearmand;

#include "tests/libgearman-1.0/client_test.h"
#include "tests/workers/v1/unique.h"
#include "tests/workers/v2/sleep_return_random.h"
#include "tests/workers/v2/echo_or_react.h"

#ifndef __INTEL_COMPILER
#pragma GCC diagnostic ignored "-Wold-style-cast"
#endif

#define WORKER_UNIQUE_FUNCTION_NAME "unique_test"

test_return_t unique_SETUP(void *object)
{
  client_test_st *test= (client_test_st *)object;

  test->set_worker_name(WORKER_UNIQUE_FUNCTION_NAME);

  gearman_function_t unique_worker_arg= gearman_function_create_v1(unique_worker);
  test->push(test_worker_start(libtest::default_port(), NULL,
                               test->worker_name(),
                               unique_worker_arg, NULL, GEARMAN_WORKER_GRAB_UNIQ));

  return TEST_SUCCESS;
}

test_return_t coalescence_TEST(void *object)
{
  gearman_client_st *client_one= (gearman_client_st *)object;
  test_true(client_one);

  libgearman::Client client_two(client_one);

  const char* unique_handle= "local_handle";

  gearman_function_t sleep_return_random_worker_FN= gearman_function_create(sleep_return_random_worker);
  std::auto_ptr<worker_handle_st> handle(test_worker_start(libtest::default_port(),
                                                           NULL,
                                                           __func__,
                                                           sleep_return_random_worker_FN,
                                                           NULL,
                                                           gearman_worker_options_t(),
                                                           0)); // timeout

  // First task
  gearman_return_t ret;
  gearman_task_st *first_task= gearman_client_add_task(client_one,
                                                       NULL, // preallocated task
                                                       NULL, // context
                                                       __func__, // function
                                                       unique_handle, // unique
                                                       NULL, 0, // workload
                                                       &ret);
  ASSERT_EQ(GEARMAN_SUCCESS, ret);
  test_truth(first_task);
  test_true(gearman_task_unique(first_task));
  ASSERT_EQ(strlen(unique_handle), strlen(gearman_task_unique(first_task)));

  // Second task
  gearman_task_st *second_task= gearman_client_add_task(&client_two,
                                                        NULL, // preallocated task
                                                        NULL, // context
                                                        __func__, // function
                                                        unique_handle, // unique
                                                        NULL, 0, // workload
                                                        &ret);
  ASSERT_EQ(GEARMAN_SUCCESS, ret);
  test_truth(second_task);
  test_true(gearman_task_unique(second_task));
  ASSERT_EQ(strlen(unique_handle), strlen(gearman_task_unique(second_task)));

  test_strcmp(gearman_task_unique(first_task), gearman_task_unique(second_task));

  do {
    ret= gearman_client_run_tasks(client_one);
    gearman_client_run_tasks(&client_two);
  } while (gearman_continue(ret));

  do {
    ret= gearman_client_run_tasks(&client_two);
  } while (gearman_continue(ret));

  gearman_result_st* first_result= gearman_task_result(first_task);
  gearman_result_st* second_result= gearman_task_result(second_task);

  ASSERT_EQ(GEARMAN_SUCCESS, gearman_task_return(first_task));
  ASSERT_EQ(GEARMAN_SUCCESS, gearman_task_return(second_task));

  ASSERT_EQ(gearman_result_value(first_result), gearman_result_value(second_result));

  gearman_task_free(first_task);
  gearman_task_free(second_task);

  return TEST_SUCCESS;
}

test_return_t coalescence_by_data_hash_TEST(void *object)
{
  gearman_client_st *client_one= (gearman_client_st *)object;
  test_true(client_one);

  libgearman::Client client_two(client_one);

  const char* unique_handle= "#";

  gearman_function_t sleep_return_random_worker_FN= gearman_function_create(sleep_return_random_worker);
  std::auto_ptr<worker_handle_st> handle(test_worker_start(libtest::default_port(),
                                                           NULL,
                                                           __func__,
                                                           sleep_return_random_worker_FN,
                                                           NULL,
                                                           gearman_worker_options_t(),
                                                           0)); // timeout

  // First task
  gearman_return_t ret;
  gearman_task_st *first_task= gearman_client_add_task(client_one,
                                                       NULL, // preallocated task
                                                       NULL, // context
                                                       __func__, // function
                                                       unique_handle, // unique
                                                       test_literal_param(__func__), // workload
                                                       &ret);
  ASSERT_EQ(GEARMAN_SUCCESS, ret);
  test_truth(first_task);
  test_true(gearman_task_unique(first_task));
  ASSERT_EQ(strlen("2285535048"), strlen(gearman_task_unique(first_task)));

  // Second task
  gearman_task_st *second_task= gearman_client_add_task(&client_two,
                                                        NULL, // preallocated task
                                                        NULL, // context
                                                        __func__, // function
                                                        unique_handle, // unique
                                                        test_literal_param(__func__), // workload
                                                        &ret);
  ASSERT_EQ(GEARMAN_SUCCESS, ret);
  test_truth(second_task);
  test_true(gearman_task_unique(second_task));
  ASSERT_EQ(strlen("2285535048"), strlen(gearman_task_unique(second_task)));

  test_strcmp(gearman_task_unique(first_task), gearman_task_unique(second_task));
  test_strcmp("2285535048", gearman_task_unique(second_task));

  do {
    ret= gearman_client_run_tasks(client_one);
    gearman_client_run_tasks(&client_two);
  } while (gearman_continue(ret));

  do {
    ret= gearman_client_run_tasks(&client_two);
  } while (gearman_continue(ret));

  gearman_result_st* first_result= gearman_task_result(first_task);
  gearman_result_st* second_result= gearman_task_result(second_task);

  ASSERT_EQ(GEARMAN_SUCCESS, gearman_task_return(first_task));
  ASSERT_EQ(GEARMAN_SUCCESS, gearman_task_return(second_task));

  ASSERT_EQ(gearman_result_value(first_result), gearman_result_value(second_result));

  gearman_task_free(first_task);
  gearman_task_free(second_task);

  return TEST_SUCCESS;
}

test_return_t coalescence_by_data_TEST(void *object)
{
  gearman_client_st *client_one= (gearman_client_st *)object;
  test_true(client_one);

  libgearman::Client client_two(client_one);

  const char* unique_handle= "-";

  gearman_function_t sleep_return_random_worker_FN= gearman_function_create(sleep_return_random_worker);
  std::auto_ptr<worker_handle_st> handle(test_worker_start(libtest::default_port(),
                                                           NULL,
                                                           __func__,
                                                           sleep_return_random_worker_FN,
                                                           NULL,
                                                           gearman_worker_options_t(),
                                                           0)); // timeout

  // First task
  gearman_return_t ret;
  gearman_task_st *first_task= gearman_client_add_task(client_one,
                                                       NULL, // preallocated task
                                                       NULL, // context
                                                       __func__, // function
                                                       unique_handle, // unique
                                                       NULL, 0, // workload
                                                       &ret);
  ASSERT_EQ(GEARMAN_SUCCESS, ret);
  test_truth(first_task);
  test_true(gearman_task_unique(first_task));
  ASSERT_EQ(strlen(unique_handle), strlen(gearman_task_unique(first_task)));

  // Second task
  gearman_task_st *second_task= gearman_client_add_task(&client_two,
                                                        NULL, // preallocated task
                                                        NULL, // context
                                                        __func__, // function
                                                        unique_handle, // unique
                                                        NULL, 0, // workload
                                                        &ret);
  ASSERT_EQ(GEARMAN_SUCCESS, ret);
  test_truth(second_task);
  test_true(gearman_task_unique(second_task));
  ASSERT_EQ(strlen(unique_handle), strlen(gearman_task_unique(second_task)));

  test_strcmp(gearman_task_unique(first_task), gearman_task_unique(second_task));

  do {
    ret= gearman_client_run_tasks(client_one);
    gearman_client_run_tasks(&client_two);
  } while (gearman_continue(ret));

  do {
    ret= gearman_client_run_tasks(&client_two);
  } while (gearman_continue(ret));

  gearman_result_st* first_result= gearman_task_result(first_task);
  gearman_result_st* second_result= gearman_task_result(second_task);

  ASSERT_EQ(GEARMAN_SUCCESS, gearman_task_return(first_task));
  ASSERT_EQ(GEARMAN_SUCCESS, gearman_task_return(second_task));

  ASSERT_EQ(gearman_result_value(first_result), gearman_result_value(second_result));

  gearman_task_free(first_task);
  gearman_task_free(second_task);

  return TEST_SUCCESS;
}

test_return_t coalescence_by_data_FAIL_TEST(void *object)
{
  gearman_client_st *client_one= (gearman_client_st *)object;
  test_true(client_one);

  libgearman::Client client_two(client_one);

  const char* unique_handle= "-";

  gearman_function_t sleep_return_random_worker_FN= gearman_function_create(sleep_return_random_worker);
  std::auto_ptr<worker_handle_st> handle(test_worker_start(libtest::default_port(),
                                                           NULL,
                                                           __func__,
                                                           sleep_return_random_worker_FN,
                                                           NULL,
                                                           gearman_worker_options_t(),
                                                           0)); // timeout

  // First task
  gearman_return_t ret;
  gearman_task_st *first_task= gearman_client_add_task(client_one,
                                                       NULL, // preallocated task
                                                       NULL, // context
                                                       __func__, // function
                                                       unique_handle, // unique
                                                       NULL, 0, // workload
                                                       &ret);
  ASSERT_EQ(GEARMAN_SUCCESS, ret);
  test_truth(first_task);
  test_true(gearman_task_unique(first_task));
  ASSERT_EQ(strlen(unique_handle), strlen(gearman_task_unique(first_task)));

  // Second task
  gearman_task_st *second_task= gearman_client_add_task(&client_two,
                                                        NULL, // preallocated task
                                                        NULL, // context
                                                        __func__, // function
                                                        unique_handle, // unique
                                                        test_literal_param("mine"), // workload
                                                        &ret);
  ASSERT_EQ(GEARMAN_SUCCESS, ret);
  test_truth(second_task);
  test_true(gearman_task_unique(second_task));
  ASSERT_EQ(strlen(unique_handle), strlen(gearman_task_unique(second_task)));

  test_strcmp(gearman_task_unique(first_task), gearman_task_unique(second_task));

  do {
    ret= gearman_client_run_tasks(client_one);
    gearman_client_run_tasks(&client_two);
  } while (gearman_continue(ret));

  do {
    ret= gearman_client_run_tasks(&client_two);
  } while (gearman_continue(ret));

  gearman_result_st* first_result= gearman_task_result(first_task);
  gearman_result_st* second_result= gearman_task_result(second_task);

  ASSERT_EQ(GEARMAN_SUCCESS, gearman_task_return(first_task));
  ASSERT_EQ(GEARMAN_SUCCESS, gearman_task_return(second_task));

  ASSERT_EQ(gearman_result_value(first_result), gearman_result_value(second_result));

  gearman_task_free(first_task);
  gearman_task_free(second_task);

  return TEST_SUCCESS;
}

test_return_t unique_compare_test(void *object)
{
  gearman_return_t rc;
  gearman_client_st *client= (gearman_client_st *)object;
  const char *worker_function= (const char *)gearman_client_context(client);
  size_t job_length;

  gearman_string_t unique= { test_literal_param("my little unique") };

  void *job_result= gearman_client_do(client,
                                      worker_function, // function
                                      gearman_c_str(unique),  // unique
                                      gearman_string_param(unique), //workload
                                      &job_length, // result size
                                      &rc);

  ASSERT_EQ(rc, GEARMAN_SUCCESS);
  ASSERT_EQ(gearman_size(unique), job_length);
  test_memcmp(gearman_c_str(unique), job_result, job_length);

  free(job_result);

  return TEST_SUCCESS;
}

test_return_t gearman_client_unique_status_TEST(void *object)
{
  gearman_client_st *original_client= (gearman_client_st *)object;

  libgearman::Client status_client(original_client);

  libgearman::Client client_one(original_client);
  libgearman::Client client_two(original_client);
  libgearman::Client client_three(original_client);

  const char* unique_handle= "local_handle4";

  gearman_return_t ret;
  // First task
  gearman_task_st *first_task= gearman_client_add_task_background(&client_one,
                                                                  NULL, // preallocated task
                                                                  NULL, // context
                                                                  __func__, // function
                                                                  unique_handle, // unique
                                                                  test_literal_param("first_task"), // workload
                                                                  &ret);
  test_true(first_task);

  gearman_task_st *second_task= gearman_client_add_task_background(&client_two,
                                                                   NULL, // preallocated task
                                                                   NULL, // context
                                                                   __func__, // function
                                                                   unique_handle, // unique
                                                                   test_literal_param("second_task"), // workload
                                                                   &ret);
  test_true(second_task);

  gearman_task_st *third_task= gearman_client_add_task_background(&client_three,
                                                                  NULL, // preallocated task
                                                                  NULL, // context
                                                                  __func__, // function
                                                                  unique_handle, // unique
                                                                  test_literal_param("third_task"), // workload
                                                                  &ret);
  test_true(third_task);

  {
    ASSERT_EQ(gearman_client_run_tasks(&client_one), GEARMAN_SUCCESS);
    ASSERT_EQ(gearman_client_run_tasks(&client_two), GEARMAN_SUCCESS);
    ASSERT_EQ(gearman_client_run_tasks(&client_three), GEARMAN_SUCCESS);
  }

  ASSERT_EQ(gearman_client_job_status(&status_client,
                                         gearman_task_job_handle(third_task), // job handle
                                         NULL, // is_known
                                         NULL, // is_running
                                         NULL, // numerator
                                         NULL // denominator
                                         ), GEARMAN_JOB_EXISTS);

  {
    libgearman::Client unique_client(original_client);
    gearman_status_t status= gearman_client_unique_status(&unique_client,
                                                          unique_handle, strlen(unique_handle));
    ASSERT_EQ(GEARMAN_SUCCESS, gearman_status_return(status));
  }

  {
    gearman_status_t status= gearman_client_unique_status(&client_one,
                                                          unique_handle, strlen(unique_handle));
    ASSERT_EQ(GEARMAN_SUCCESS, gearman_status_return(status));
    ASSERT_EQ(true, gearman_status_is_known(status));
    ASSERT_EQ(false, gearman_status_is_running(status));
    test_zero(gearman_status_numerator(status));
    test_zero(gearman_status_denominator(status));
  }

  gearman_function_t func= gearman_function_create_v2(echo_or_react_worker_v2);
  std::auto_ptr<worker_handle_st> handle(test_worker_start(libtest::default_port(), NULL,
                                                           __func__,
                                                           func, NULL, gearman_worker_options_t()));

  {
    ASSERT_EQ(gearman_client_run_tasks(&client_one), GEARMAN_SUCCESS);
    ASSERT_EQ(gearman_client_run_tasks(&client_two), GEARMAN_SUCCESS);
    ASSERT_EQ(gearman_client_run_tasks(&client_three), GEARMAN_SUCCESS);
  }

  gearman_task_free(first_task);
  gearman_task_free(second_task);
  gearman_task_free(third_task);

  return TEST_SUCCESS;
}

test_return_t gearman_client_unique_status_NOT_FOUND_TEST(void *object)
{
  gearman_client_st *original_client= (gearman_client_st *)object;

  libgearman::Client status_client(original_client);
  const char* unique_handle= YATL_UNIQUE;

  gearman_function_t func= gearman_function_create_v2(echo_or_react_worker_v2);
  std::auto_ptr<worker_handle_st> handle(test_worker_start(libtest::default_port(), NULL,
                                                           __func__,
                                                           func, NULL, gearman_worker_options_t()));

  {
    gearman_status_t status= gearman_client_unique_status(&status_client,
                                                          unique_handle, strlen(unique_handle));
    ASSERT_EQ(GEARMAN_SUCCESS, gearman_status_return(status));
    ASSERT_EQ(false, gearman_status_is_known(status));
    ASSERT_EQ(false, gearman_status_is_running(status));
    test_zero(gearman_status_numerator(status));
    test_zero(gearman_status_denominator(status));
  }

  return TEST_SUCCESS;
}