text:
package com.microsoft.azure.management.resources.fluentcore.dag;

import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;

/**
 * Type representing a directed graph data structure.
 *

 * Each node in a graph is represented by {@link Node}
 *
 * @param <DataT> the type of the data stored in the graph's nodes
 * @param <NodeT> the type of the nodes in the graph
 */
public class Graph<DataT, NodeT extends Node<DataT, NodeT>> {
    /**
     * the underlying graph.
     */
    protected Map<String, NodeT> graph;
    /**
     * to track the already visited node while performing DFS.
     */
    private Set<String> visited;
    /**
     * to generate node entry and exit time while performing DFS.
     */
    private Integer time;
    /**
     * to track the entry time to each node while performing DFS.
     */
    private Map<String, Integer> entryTime;
    /**
     * to track the exit time from each node while performing DFS.
     */
    private Map<String, Integer> exitTime;
    /**
     * to track the immediate parent node of each node while performing DFS.
     */
    private Map<String, String> parent;
    /**
     * to track already processed node while performing DFS.
     */
    private Set<String> processed;

    /**
     * Creates a directed graph.
     */
    public Graph() {
        this.graph = new HashMap<>();
        this.visited = new HashSet<>();
        this.time = 0;
        this.entryTime = new HashMap<>();
        this.exitTime = new HashMap<>();
        this.parent = new HashMap<>();
        this.processed = new HashSet<>();
    }

    /**
     * Adds a node to this graph.
     *
     * @param node the node
     */
    public void addNode(NodeT node) {
        node.setOwner(this);
        graph.put(node.key(), node);
    }

    /**
     * @return all nodes in the graph.
     */
    public Collection<NodeT> getNodes() {
        return graph.values();
    }

    /**
     * Perform DFS visit in this graph.
     *

     * The directed graph will be traversed in DFS order and the visitor will be notified as
     * search explores each node and edge.
     *
     * @param visitor the graph visitor
     */
    public void visit(Visitor visitor) {
        for (Map.Entry<String, NodeT> item : graph.entrySet()) {
            if (!visited.contains(item.getKey())) {
                this.dfs(visitor, item.getValue());
            }
        }
        visited.clear();
        time = 0;
        entryTime.clear();
        exitTime.clear();
        parent.clear();
        processed.clear();
    }

    private void dfs(Visitor visitor, Node<DataT, NodeT> node) {
        visitor.visitNode(node);

        String fromKey = node.key();
        visited.add(fromKey);
        time++;
        entryTime.put(fromKey, time);
        for (String toKey : node.children()) {
            if (!visited.contains(toKey)) {
                parent.put(toKey, fromKey);
                visitor.visitEdge(fromKey, toKey, edgeType(fromKey, toKey));
                this.dfs(visitor, this.graph.get(toKey));
            } else {
                visitor.visitEdge(fromKey, toKey, edgeType(fromKey, toKey));
            }
        }
        time++;
        exitTime.put(fromKey, time);
        processed.add(fromKey);
    }

    private EdgeType edgeType(String fromKey, String toKey) {
        if (parent.containsKey(toKey) && parent.get(toKey).equals(fromKey)) {
            return EdgeType.TREE;
        }

        if (visited.contains(toKey) && !processed.contains(toKey)) {
            return EdgeType.BACK;
        }

        if (processed.contains(toKey) && entryTime.containsKey(toKey) && entryTime.containsKey(fromKey)) {
            if (entryTime.get(toKey) > entryTime.get(fromKey)) {
                return EdgeType.FORWARD;
            }

            if (entryTime.get(toKey) < entryTime.get(fromKey)) {
                return EdgeType.CROSS;
            }
        }

        throw new IllegalStateException("Internal Error: Unable to locate the edge type {" + fromKey + ", " + toKey + "}");
    }

    protected String findPath(String start, String end) {
        if (start.equals(end)) {
            return start;
        } else {
            return findPath(start, parent.get(end)) + " -> " + end;
        }
    }

    /**
     * The edge types in a graph.
     */
    enum EdgeType {
        /**
         * An edge (u, v) is a tree edge if v is visited the first time.
         */
        TREE,
        /**
         * An edge (u, v) is a forward edge if v is descendant of u.
         */
        FORWARD,
        /**
         * An edge (u, v) is a back edge if v is ancestor of u.
         */
        BACK,
        /**
         * An edge (u, v) is a cross edge if v is neither ancestor or descendant of u.
         */
        CROSS
    }

    /**
     * Represents a visitor to be implemented by the consumer who want to visit the
     * graph's nodes in DFS order by calling visit method.
     *
     * @param  the type of the node
     */
    interface Visitor {
        /**
         * visit a node.
         *
         * @param node the node to visited
         */
        void visitNode(U node);

        /**
         * visit an edge.
         *
         * @param fromKey key of the from node
         * @param toKey key of the to node
         * @param edgeType the edge type
         */
        void visitEdge(String fromKey, String toKey, EdgeType edgeType);
    }
}


text:
<?php

declare(strict_types = 1);

namespace backend\Core;

use GuzzleHttp\Client;

class Requester extends Client {
	/**
	 * Requester constructor.
	 *
	 * @param array $config
	 */
	public function __construct(array $config = []) {
		$config['base_uri'] = 'http://helpdesk.nemo.travel/';

		parent::__construct($config);
	}

	/**
	 * @param string $method
	 * @param string $uri
	 * @param array $options
	 *
	 * @return array
	 */
	public function request($method, $uri = '', array $options = []) {
		$options['headers'] = [
			'X-Redmine-API-Key' => '4feb780f9bddc9e5f637ca5b8a7e497357dfd2d7'
		];

		$response = parent::request($method, $uri, $options);

		return json_decode($response->getBody()->getContents(), true);
	}
}

redpajama_set_name: RedPajamaGithub


text:
package cmd

import (
	"fmt"
	"syscall"
)

var textPadding = 4

func RightJustifyText(text string) string {

	_, cols, c_row, _ := size()

	col := cols - (len(text) + textPadding)

	handle, _ := syscall.GetStdHandle(syscall.STD_OUTPUT_HANDLE)

	err := setConsoleCursorPosition(handle, coord{x: int16(c_row), y: int16(col)})

	if err != nil {
		fmt.Println(err)
	}

	return text
}

func size() (rows, cols, c_row, c_col int) {
	handle, _ := syscall.GetStdHandle(syscall.STD_OUTPUT_HANDLE)

	info, err := getConsoleScreenBufferInfo(handle)

	if err != nil {
		fmt.Println(err)
	}

	size := coord(info.size)
	cursorPos := coord(info.cursorPos)

	cols = int(size.x)
	rows = int(size.y)
	c_col = int(cursorPos.x)
	c_row = int(cursorPos.y)

	return
}


text:
package org.apache.geronimo.j2ee.jaxbmodel.operations;

import org.apache.geronimo.j2ee.application.ExtModuleType;
import org.apache.geronimo.j2ee.application.ModuleType;
import org.apache.geronimo.j2ee.application.PathType;
import org.apache.geronimo.j2ee.connector.AdminobjectInstanceType;
import org.apache.geronimo.j2ee.connector.AdminobjectType;
import org.apache.geronimo.j2ee.connector.ConfigPropertySettingType;
import org.apache.geronimo.j2ee.deployment.ArtifactType;
import org.apache.geronimo.j2ee.deployment.AttributeType;
import org.apache.geronimo.j2ee.deployment.ClassFilterType;
import org.apache.geronimo.j2ee.deployment.DependenciesType;
import org.apache.geronimo.j2ee.deployment.DependencyType;
import org.apache.geronimo.j2ee.deployment.EnvironmentType;
import org.apache.geronimo.j2ee.deployment.GbeanType;
import org.apache.geronimo.j2ee.deployment.ReferenceType;
import org.apache.geronimo.j2ee.deployment.javabean.PropertyType;
import org.apache.geronimo.j2ee.naming.EjbLocalRefType;
import org.apache.geronimo.j2ee.naming.EjbRefType;
import org.apache.geronimo.j2ee.naming.GbeanRefType;
import org.apache.geronimo.j2ee.naming.MessageDestinationType;
import org.apache.geronimo.j2ee.naming.PatternType;
import org.apache.geronimo.j2ee.naming.PortCompletionType;
import org.apache.geronimo.j2ee.naming.PortType;
import org.apache.geronimo.j2ee.naming.ResourceEnvRefType;
import org.apache.geronimo.j2ee.naming.ResourceRefType;
import org.apache.geronimo.j2ee.naming.ServiceCompletionType;
import org.apache.geronimo.j2ee.naming.ServiceRefType;
import org.apache.geronimo.j2ee.openejb_jar.EjbRelationType;
import org.apache.geronimo.j2ee.openejb_jar.EjbRelationshipRoleType;
import org.apache.geronimo.j2ee.openejb_jar.RelationshipsType;
import org.apache.geronimo.j2ee.security.DescriptionType;
import org.apache.geronimo.j2ee.security.DistinguishedNameType;
import org.apache.geronimo.j2ee.security.LoginDomainPrincipalType;
import org.apache.geronimo.j2ee.security.PrincipalType;
import org.apache.geronimo.j2ee.security.RealmPrincipalType;
import org.apache.geronimo.j2ee.security.RoleMappingsType;
import org.apache.geronimo.j2ee.security.RoleType;
import org.apache.geronimo.j2ee.security.SecurityType;
import org.apache.geronimo.jaxbmodel.common.operations.JAXBObjectFactory;

/**
 * @version $Rev$ $Date$
 */
public class JAXBObjectFactoryImpl implements JAXBObjectFactory {

    private static JAXBObjectFactoryImpl instance = new JAXBObjectFactoryImpl();

    private JAXBObjectFactoryImpl() {

    }

    public static JAXBObjectFactoryImpl getInstance() {
        return instance;
    }

    public Object create(Class type) {
        if ( type.equals( ResourceRefType.class ) ) {
            return (new org.apache.geronimo.j2ee.naming.ObjectFactory()).createResourceRefType();
        } else if ( type.equals( ResourceEnvRefType.class ) ) {
            return (new org.apache.geronimo.j2ee.naming.ObjectFactory()).createResourceEnvRefType();
        } else if ( type.equals( EjbRefType.class ) ) {
            return (new org.apache.geronimo.j2ee.naming.ObjectFactory()).createEjbRefType();
        } else if ( type.equals( GbeanRefType.class ) ) {
            return (new org.apache.geronimo.j2ee.naming.ObjectFactory()).createGbeanRefType();
        } else if ( type.equals( MessageDestinationType.class ) ) {
            return (new org.apache.geronimo.j2ee.naming.ObjectFactory()).createMessageDestinationType();
        } else if ( type.equals( PatternType.class ) ) {
            return (new org.apache.geronimo.j2ee.naming.ObjectFactory()).createPatternType();
        } else if ( type.equals( PortType.class ) ) {
            return (new org.apache.geronimo.j2ee.naming.ObjectFactory()).createPortType();
        } else if ( type.equals( PortCompletionType.class ) ) {
            return (new org.apache.geronimo.j2ee.naming.ObjectFactory()).createPortCompletionType();
        } else if ( type.equals( PropertyType.class ) ) {
            return (new org.apache.geronimo.j2ee.deployment.javabean.ObjectFactory()).createPropertyType();
        } else if ( type.equals( ServiceCompletionType.class ) ) {
            return (new org.apache.geronimo.j2ee.naming.ObjectFactory()).createServiceCompletionType();
        } else if ( type.equals( ServiceRefType.class ) ) {
            return (new org.apache.geronimo.j2ee.naming.ObjectFactory()).createServiceRefType();
        } else if ( type.equals( EjbLocalRefType.class ) ) {
            return (new org.apache.geronimo.j2ee.naming.ObjectFactory()).createEjbLocalRefType();
        } else if ( type.equals( SecurityType.class ) ) {
            return (new org.apache.geronimo.j2ee.security.ObjectFactory()).createSecurityType();
        } else if ( type.equals( RoleMappingsType.class ) ) {
            return (new org.apache.geronimo.j2ee.security.ObjectFactory()).createRoleMappingsType();
        } else if ( type.equals( DescriptionType.class ) ) {
            return (new org.apache.geronimo.j2ee.security.ObjectFactory()).createDescriptionType();
        } else if ( type.equals( RoleType.class ) ) {
            return (new org.apache.geronimo.j2ee.security.ObjectFactory()).createRoleType();
        } else if ( type.equals( DistinguishedNameType.class ) ) {
            return (new org.apache.geronimo.j2ee.security.ObjectFactory()).createDistinguishedNameType();
        } else if ( type.equals( PrincipalType.class ) ) {
            return (new org.apache.geronimo.j2ee.security.ObjectFactory()).createPrincipalType();
        } else if ( type.equals( LoginDomainPrincipalType.class ) ) {
            return (new org.apache.geronimo.j2ee.security.ObjectFactory()).createLoginDomainPrincipalType();
        } else if ( type.equals( RealmPrincipalType.class ) ) {
            return (new org.apache.geronimo.j2ee.security.ObjectFactory()).createRealmPrincipalType();
        } else if ( type.equals( GbeanType.class ) ) {
            return (new org.apache.geronimo.j2ee.deployment.ObjectFactory()).createGbeanType();
        } else if ( type.equals( ArtifactType.class ) ) {
            return (new org.apache.geronimo.j2ee.deployment.ObjectFactory()).createArtifactType();
        } else if ( type.equals( ClassFilterType.class ) ) {
            return (new org.apache.geronimo.j2ee.deployment.ObjectFactory()).createClassFilterType();
        } else if ( type.equals( DependenciesType.class ) ) {
            return (new org.apache.geronimo.j2ee.deployment.ObjectFactory()).createDependenciesType();
        } else if ( type.equals( DependencyType.class ) ) {
            return (new org.apache.geronimo.j2ee.deployment.ObjectFactory()).createDependencyType();
        } else if ( type.equals( EnvironmentType.class ) ) {
            return (new org.apache.geronimo.j2ee.deployment.ObjectFactory()).createEnvironmentType();
        } else if ( type.equals( org.apache.geronimo.j2ee.deployment.PatternType.class ) ) {
            return (new org.apache.geronimo.j2ee.deployment.ObjectFactory()).createPatternType();
        } else if ( type.equals( AttributeType.class ) ) {
            return (new org.apache.geronimo.j2ee.deployment.ObjectFactory()).createAttributeType();
        } else if ( type.equals( ReferenceType.class ) ) {
            return (new org.apache.geronimo.j2ee.deployment.ObjectFactory()).createReferenceType();
        } else if ( type.equals( ExtModuleType.class ) ) {
            return (new org.apache.geronimo.j2ee.application.ObjectFactory()).createExtModuleType();
        } else if ( type.equals( ModuleType.class ) ) {
            return (new org.apache.geronimo.j2ee.application.ObjectFactory()).createModuleType();
        } else if ( type.equals( PathType.class ) ) {
            return (new org.apache.geronimo.j2ee.application.ObjectFactory()).createPathType();
        } else if ( type.equals( EjbRelationType.class ) ) {
            return (new org.apache.geronimo.j2ee.openejb_jar.ObjectFactory()).createEjbRelationType();
        } else if ( type.equals( EjbRelationshipRoleType.class ) ) {
            return (new org.apache.geronimo.j2ee.openejb_jar.ObjectFactory()).createEjbRelationshipRoleType();
        } else if ( type.equals( EjbRelationshipRoleType.RelationshipRoleSource.class ) ) {
            return (new org.apache.geronimo.j2ee.openejb_jar.ObjectFactory()).createEjbRelationshipRoleTypeRelationshipRoleSource();
        } else if ( type.equals( EjbRelationshipRoleType.CmrField.class ) ) {
            return (new org.apache.geronimo.j2ee.openejb_jar.ObjectFactory()).createEjbRelationshipRoleTypeCmrField();
        } else if ( type.equals( EjbRelationshipRoleType.RoleMapping.CmrFieldMapping.class ) ) {
            return (new org.apache.geronimo.j2ee.openejb_jar.ObjectFactory()).createEjbRelationshipRoleTypeRoleMappingCmrFieldMapping();
        } else if ( type.equals( EjbRelationshipRoleType.RoleMapping.class ) ) {
            return (new org.apache.geronimo.j2ee.openejb_jar.ObjectFactory()).createEjbRelationshipRoleTypeRoleMapping();
        } else if ( type.equals( RelationshipsType.class ) ) {
            return (new org.apache.geronimo.j2ee.openejb_jar.ObjectFactory()).createRelationshipsType();
        } else if ( type.equals( AdminobjectType.class ) ) {
            return (new org.apache.geronimo.j2ee.connector.ObjectFactory()).createAdminobjectType();
        } else if ( type.equals( AdminobjectInstanceType.class ) ) {
            return (new org.apache.geronimo.j2ee.connector.ObjectFactory()).createAdminobjectInstanceType();
        } else if ( type.equals( ConfigPropertySettingType.class ) ) {
            return (new org.apache.geronimo.j2ee.connector.ObjectFactory()).createConfigPropertySettingType();
        }

        return null;
    }

}


text:
package org.apache.flink.table.api.stream.sql.validation

import org.apache.flink.api.scala._
import org.apache.flink.table.api.ValidationException
import org.apache.flink.table.api.scala._
import org.apache.flink.table.utils.{StreamTableTestUtil, TableTestBase}
import org.junit.Test

class MatchRecognizeValidationTest extends TableTestBase {

  private val streamUtil: StreamTableTestUtil = streamTestUtil()
  streamUtil.addTable[(Int, String, Long)]("MyTable", 'a, 'b, 'c.rowtime, 'proctime.proctime)

  /** Function 'MATCH_ROWTIME()' can only be used in MATCH_RECOGNIZE **/
  @Test(expected = classOf[ValidationException])
  def testMatchRowtimeInSelect() = {
    val sql = "SELECT MATCH_ROWTIME() FROM MyTable"
    streamUtil.verifySql(sql, "n/a")
  }

  /** Function 'MATCH_PROCTIME()' can only be used in MATCH_RECOGNIZE **/
  @Test(expected = classOf[ValidationException])
  def testMatchProctimeInSelect() = {
    val sql = "SELECT MATCH_PROCTIME() FROM MyTable"
    streamUtil.verifySql(sql, "n/a")
  }
}


text:
<?php

namespace Iodev\Whois\Modules\Asn;

trait AsnInfoDeprecated
{
    /**
     * @deprecated will be removed in v4.2
     * @return string
     */
    public function getAsn()
    {
        return $this->asn;
    }

    /**
     * @deprecated will be removed in v4.2
     * @return AsnRouteInfo[]
     */
    public function getRoutes()
    {
        return $this->routes;
    }
}


text:
package com.planet_ink.coffee_mud.Races;
import com.planet_ink.coffee_mud.core.interfaces.*;
import com.planet_ink.coffee_mud.core.*;
import com.planet_ink.coffee_mud.core.collections.*;
import com.planet_ink.coffee_mud.Abilities.interfaces.*;
import com.planet_ink.coffee_mud.Areas.interfaces.*;
import com.planet_ink.coffee_mud.Behaviors.interfaces.*;
import com.planet_ink.coffee_mud.CharClasses.interfaces.*;
import com.planet_ink.coffee_mud.Commands.interfaces.*;
import com.planet_ink.coffee_mud.Common.interfaces.*;
import com.planet_ink.coffee_mud.Exits.interfaces.*;
import com.planet_ink.coffee_mud.Items.interfaces.*;
import com.planet_ink.coffee_mud.Libraries.interfaces.*;
import com.planet_ink.coffee_mud.Locales.interfaces.*;
import com.planet_ink.coffee_mud.MOBS.interfaces.*;
import com.planet_ink.coffee_mud.Races.interfaces.*;

import java.util.*;

public class Cricket extends StdRace
{
	@Override
	public String ID()
	{
		return "Cricket";
	}

	private final static String localizedStaticName = CMLib.lang().L("Cricket");

	@Override
	public String name()
	{
		return localizedStaticName;
	}

	@Override
	public int shortestMale()
	{
		return 1;
	}

	@Override
	public int shortestFemale()
	{
		return 1;
	}

	@Override
	public int heightVariance()
	{
		return 0;
	}

	@Override
	public int lightestWeight()
	{
		return 1;
	}

	@Override
	public int weightVariance()
	{
		return 0;
	}

	@Override
	public long forbiddenWornBits()
	{
		return ~(Wearable.WORN_TORSO | Wearable.WORN_EYES);
	}

	private final static String localizedStaticRacialCat = CMLib.lang().L("Insect");

	@Override
	public String racialCategory()
	{
		return localizedStaticRacialCat;
	}

	//  							  an ey ea he ne ar ha to le fo no gi mo wa ta wi
	private static final int[] parts={2 ,2 ,0 ,1 ,1 ,0 ,0 ,1 ,2 ,2 ,0 ,0 ,1 ,0 ,0 ,0 };

	@Override
	public int[] bodyMask()
	{
		return parts;
	}

	private final int[]	agingChart	= { 0, 0, 0, 1, 1, 1, 1, 2, 2 };

	@Override
	public int[] getAgingChart()
	{
		return agingChart;
	}

	private static Vector<RawMaterial>	resources	= new Vector<RawMaterial>();

	@Override
	public int availabilityCode()
	{
		return Area.THEME_ALLTHEMES | Area.THEME_SKILLONLYMASK;
	}

	private final String[]	racialAbilityNames			= { "Thief_Distract" };
	private final int[]		racialAbilityLevels			= { 3 };
	private final int[]		racialAbilityProficiencies	= { 100 };
	private final boolean[]	racialAbilityQuals			= { false };
	private final String[]	racialAbilityParms			= { "" };

	@Override
	protected String[] racialAbilityNames()
	{
		return racialAbilityNames;
	}

	@Override
	protected int[] racialAbilityLevels()
	{
		return racialAbilityLevels;
	}

	@Override
	protected int[] racialAbilityProficiencies()
	{
		return racialAbilityProficiencies;
	}

	@Override
	protected boolean[] racialAbilityQuals()
	{
		return racialAbilityQuals;
	}

	@Override
	public String[] racialAbilityParms()
	{
		return racialAbilityParms;
	}

	@Override
	public void affectPhyStats(final Physical affected, final PhyStats affectableStats)
	{
		super.affectPhyStats(affected,affectableStats);
		affectableStats.setDisposition(affectableStats.disposition()|PhyStats.IS_SNEAKING);
		affectableStats.setDisposition(affectableStats.disposition()|PhyStats.IS_GOLEM);
	}

	@Override
	public void affectCharStats(final MOB affectedMOB, final CharStats affectableStats)
	{
		super.affectCharStats(affectedMOB, affectableStats);
		affectableStats.setRacialStat(CharStats.STAT_STRENGTH,3);
		affectableStats.setRacialStat(CharStats.STAT_DEXTERITY,3);
		affectableStats.setRacialStat(CharStats.STAT_INTELLIGENCE,1);
	}

	@Override
	public void unaffectCharStats(final MOB affectedMOB, final CharStats affectableStats)
	{
		super.unaffectCharStats(affectedMOB, affectableStats);
		affectableStats.setStat(CharStats.STAT_STRENGTH,affectedMOB.baseCharStats().getStat(CharStats.STAT_STRENGTH));
		affectableStats.setStat(CharStats.STAT_MAX_STRENGTH_ADJ,affectedMOB.baseCharStats().getStat(CharStats.STAT_MAX_STRENGTH_ADJ));
		affectableStats.setStat(CharStats.STAT_DEXTERITY,affectedMOB.baseCharStats().getStat(CharStats.STAT_DEXTERITY));
		affectableStats.setStat(CharStats.STAT_MAX_DEXTERITY_ADJ,affectedMOB.baseCharStats().getStat(CharStats.STAT_MAX_DEXTERITY_ADJ));
		affectableStats.setStat(CharStats.STAT_INTELLIGENCE,affectedMOB.baseCharStats().getStat(CharStats.STAT_INTELLIGENCE));
		affectableStats.setStat(CharStats.STAT_MAX_INTELLIGENCE_ADJ,affectedMOB.baseCharStats().getStat(CharStats.STAT_MAX_INTELLIGENCE_ADJ));
	}

	@Override
	public String arriveStr()
	{
		return "hops in";
	}

	@Override
	public String leaveStr()
	{
		return "hops";
	}

	@Override
	public Weapon myNaturalWeapon()
	{
		if(naturalWeapon==null)
		{
			naturalWeapon=CMClass.getWeapon("StdWeapon");
			naturalWeapon.setName(L("a nasty maw"));
			naturalWeapon.setMaterial(RawMaterial.RESOURCE_BONE);
			naturalWeapon.setUsesRemaining(1000);
			naturalWeapon.setWeaponDamageType(Weapon.TYPE_NATURAL);
		}
		return naturalWeapon;
	}

	@Override
	public List<RawMaterial> myResources()
	{
		synchronized(resources)
		{
			if(resources.size()==0)
			{
				resources.addElement(makeResource
				(L("a pair of @x1 legs",name().toLowerCase()),RawMaterial.RESOURCE_BONE));
			}
		}
		return resources;
	}

	@Override
	public String makeMobName(final char gender, final int age)
	{
		switch(age)
		{
			case Race.AGE_INFANT:
			case Race.AGE_TODDLER:
			case Race.AGE_CHILD:
				return "baby "+name().toLowerCase();
			default :
				return super.makeMobName('N', age);
		}
	}
}


text:
module JqueryTransit
  module Rails
    VERSION = "0.9.9"
  end
end


text:
copyright:

  years: 2015, 2016

lastupdated: "2016-03-15"

---

{:new_window: target="_blank"}
{:shortdesc: .shortdesc}
{:codeblock: .codeblock}
{:screen: .screen}
{:pre: .pre}

# Utilizzo dei pacchetti di build della community

Se non riesci a trovare uno starter nel Catalogo {{site.data.keyword.Bluemix}} che ti fornisca il runtime desiderato, puoi portare tu un pacchetto di build esterno in {{site.data.keyword.Bluemix_notm}}. Puoi specificare un pacchetto di build personalizzato compatibile con Cloud Foundry quando distribuisci la tua applicazione utilizzando il comando cf push.
{:shortdesc}

I pacchetti di build esterni sono forniti dalla community di Cloud Foundry
e puoi usarli come tuoi pacchetti di build. Prima di
distribuire la tua applicazione a {{site.data.keyword.Bluemix_notm}},
assicurati di installare l'interfaccia riga di comando cf.

**Nota:** i pacchetti di build esterni non sono forniti da IBM; pertanto, potresti dover contattare la community Cloud Foundry per assistenza.

## Pacchetti di build della community integrati

In {{site.data.keyword.Bluemix_notm}},
puoi utilizzare i pacchetti di build integrati forniti dalla community di
Cloud Foundry. Per visualizzare i pacchetti di build integrati della community, esegui il comando cf buildpacks:

```
cf buildpacks
Getting buildpacks...

buildpack      position   enabled   locked   filename
...
java_buildpack     7      true      false    buildpack_java_v2.0.2.zip
ruby_buildpack     8      true      false    buildpack_ruby_v46-245-g2fc4ad8.zip
nodejs_buildpack   9      true      false    buildpack_nodejs_v8-177-g2b0a5cf.zip
```
{:screen}

Per lo stesso runtime o framework, i pacchetti di build creati da IBM hanno la precedenza su quelli della community. Se vuoi usare il pacchetto di build della community per sovrascrivere quello creato da IBM, devi specificare il pacchetto di build utilizzando l'opzione -b con il comando cf push.

Ad esempio, puoi usare il pacchetto di build della community per le applicazioni Web Java™:

cf push app_name -b java_buildpack -p app_path

Puoi anche usare il pacchetto di build della community per le applicazioni Node.js:

cf push app_name -b nodejs_buildpack -p app_path

Per un runtime o un framework non supportato da pacchetti di build creati da IBM ma supportato da pacchetti di build della community integrati, non devi necessariamente utilizzare l'opzione -b con il comando cf push.

Ad esempio, per le applicazioni Ruby, non ci sono pacchetti di build creati da IBM. Puoi usare il pacchetto di build della community integrato immettendo il
seguente comando:

cf push app_name -p app_path

## Pacchetti di build esterni

Puoi utilizzare pacchetti di build esterni o personalizzati in {{site.data.keyword.Bluemix_notm}}. Devi specificare l'URL del pacchetto di build con l'opzione -b e specificare lo stack con l'opzione `-s` nel comando **cf push**. Ad esempio, per utilizzare un pacchetto di build della community esterno per i file statici, esegui questo comando

```
cf push app_name -p app_path -b https://github.com/cloudfoundry-incubator/staticfile-buildpack.git -s cflinuxfs2
```
{:pre}

Come altro
esempio, se non desideri utilizzare il pacchetto di build della community integrato
per le applicazioni Ruby, puoi utilizzare un pacchetto di build esterno immettendo il seguente
comando:

```
cf push app_name -p app_path -b https://github.com/cloudfoundry/heroku-buildpack-ruby -s cflinuxfs2
```
{:pre}

Puoi anche utilizzare un pacchetto di build personalizzato per la tua applicazione. Ad esempio, per utilizzare un pacchetto di build PHP open source fornito dalla community di Cloud Foundry, quando distribuisci la tua applicazione PHP a Bluemix, immetti il seguente comando per specificare l'URL del repository Git del pacchetto di build:

```
cf push app_name -p app_path -b https://github.com/dmikusa-pivotal/cf-php-build-pack -s cflinuxfs2
```
{:pre}

## Specifica della versione del pacchetto di build Java

Utilizza il comando cf set-env. Ad esempio, immetti il seguente comando per impostare la versione Java su 1.7.0:

cf set-env app_name JBP_CONFIG_OPEN_JDK_JRE '{jre: { version: 1.7.0_+ }}'

Quindi, per rendere effettive
le modifiche, prepara di nuovo la tua applicazione:

cf restage app_name

Utilizza il file manifest.yml. Puoi aggiungere la
variabile di ambiente e il valore che vuoi specificare direttamente
nel file. Per informazioni dettagliate, vedi Variabili di ambiente.


text:
from front import front, direct_front
from xlog import getLogger
xlog = getLogger("gae_proxy")

def set_proxy(args):
    front.set_proxy(args)
    direct_front.set_proxy(args)

def is_workable():
    if front.http_dispatcher.is_idle():
        return True

    num = len(front.connect_manager.new_conn_pool.pool) +\
          len(front.connect_manager.gae_conn_pool.pool) + \
          front.http_dispatcher.h1_num + \
          front.http_dispatcher.h2_num

    if num > 0:
        return True
    else:
        return False

def set_bind_ip(args):
    xlog.info("set_bind_ip:%s", args)

    front.config.listen_ip = args["ip"]
    front.config.save()


text:
#ifndef NFI_PLAYER_REDIS_MODULE_H
#define NFI_PLAYER_REDIS_MODULE_H

#include "NFIModule.h"

class NFIPlayerRedisModule
    : public NFIModule
{

public:
	virtual bool ExistRoleName(const std::string& strRoleName) = 0;
	virtual bool CreateRole(const std::string& strAccount, const std::string& strRoleName, const NFGUID& id, const int nHomeSceneID) = 0;
	virtual bool GetRoleInfo(const std::string& strAccount, std::string& strRoleName, NFGUID& id) = 0;

	virtual bool SavePlayerTile(const int nSceneID, const NFGUID& self, const std::string& strTileData) = 0;

	virtual bool LoadPlayerTile(const int nSceneID, const NFGUID& self, std::string& strTileData) = 0;
	virtual bool LoadPlayerTileRandom(const int nSceneID, NFGUID& xPlayer, std::string& strTileData) = 0;
	virtual bool LoadPlayerTileRandomCache(const NFGUID& xPlayer, std::string& strTileData) = 0;

	virtual NFINT64 GetPropertyInt(const NFGUID& self, const std::string& strPropertyName) = 0;
	virtual int GetPropertyInt32(const NFGUID& self, const std::string& strPropertyName) = 0;
	virtual double GetPropertyFloat(const NFGUID& self, const std::string& strPropertyName) = 0;
	virtual std::string GetPropertyString(const NFGUID& self, const std::string& strPropertyName) = 0;
	virtual NFGUID GetPropertyObject(const NFGUID& self, const std::string& strPropertyName) = 0;
	virtual NFVector2 GetPropertyVector2(const NFGUID& self, const std::string& strPropertyName) = 0;
	virtual NFVector3 GetPropertyVector3(const NFGUID& self, const std::string& strPropertyName) = 0;
};

#endif


text:
Tarif <?php echo $button ?>

        <form action="<?php echo $action; ?>" method="post">

                KENDARAAN <?php echo form_error('kendaraan_id') ?>
                <?php
                echo dropdown('kendaraan_id', 'kendaraan', 'kendaraan_platnomor', 'kendaraan_id', 12);
                ?>

                TARIF PERHARI <?php echo form_error('tarif_perhari') ?>
                <input type="text" class="form-control" name="tarif_perhari" id="tarif_perhari" placeholder="TARIF PERHARI" value="<?php echo $tarif_perhari; ?>" />

                TARIF OVERTIME <?php echo form_error('tarif_overtime') ?>
                <input type="text" class="form-control" name="tarif_overtime" id="tarif_overtime" placeholder="TARIF OVERTIME" value="<?php echo $tarif_overtime; ?>" />

	    <input type="hidden" name="tarif_id" value="<?php echo $tarif_id; ?>" />
	    <button type="submit" class="btn btn-primary"><?php echo $button ?></button>
	    <a href="<?php echo site_url('tarif') ?>" class="btn btn-default">Cancel</button>
	</form>


text:
from six import python_2_unicode_compatible
from .base import Ref, CustomField, QuickbooksManagedObject, \
    LinkedTxnMixin, QuickbooksTransactionEntity, LinkedTxn, Address, EmailAddress
from .tax import TxnTaxDetail
from .detailline import DetailLine
from ..mixins import DeleteMixin

@python_2_unicode_compatible
class RefundReceipt(DeleteMixin, QuickbooksManagedObject, QuickbooksTransactionEntity, LinkedTxnMixin):
    """
    QBO definition: RefundReceipt represents a refund to the customer for a product or service that was given.
    """
    class_dict = {
        "DepartmentRef": Ref,
        "CurrencyRef": Ref,
        "TxnTaxDetail": TxnTaxDetail,
        "DepositToAccountRef": Ref,
        "CustomerRef": Ref,
        "BillAddr":  Address,
        "ShipAddr":  Address,
        "ClassRef": Ref,
        "BillEmail": EmailAddress,
        "PaymentMethodRef": Ref,
    }

    list_dict = {
        "CustomField": CustomField,
        "Line": DetailLine,
        "LinkedTxn": LinkedTxn
    }

    detail_dict = {

    }

    qbo_object_name = "RefundReceipt"

    def __init__(self):
        super(RefundReceipt, self).__init__()
        self.DocNumber = ""
        self.TotalAmt = 0
        self.ApplyTaxAfterDiscount = False
        self.PrintStatus = ""
        self.Balance = 0
        self.PaymentRefNum = ""
        self.TxnDate = ""
        self.ExchangeRate = 1
        self.PrivateNote = ""
        self.CustomerMemo = ""
        self.PaymentRefNum = ""
        self.PaymentType = ""
        self.CheckPayment = ""
        self.CreditCardPayment = ""
        self.TxnSource = None
        self.GlobalTaxCalculation = "TaxExcluded"

        self.DepartmentRef = None
        self.CurrencyRef = None
        self.TxnTaxDetail = None
        self.DepositToAccountRef = None
        self.CustomerRef = None
        self.BillAddr = None
        self.ShipAddr = None
        self.ClassRef = None
        self.BillEmail = None
        self.PaymentMethodRef = None

        self.CustomField = []
        self.Line = []
        self.LinkedTxn = []

    def __str__(self):
        return str(self.TotalAmt)


text:
<!doctype html>

<html>

  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>px-validation Demo</title>
    <!-- Requires Webcomponents.js polyfill is provided by the page for browsers that don't support html imports -->
    <script src="../webcomponentsjs/webcomponents-lite.min.js"></script>
    <!-- Import custom element. Note: see comment about relative paths to dependencies in the *.html file referenced below -->
    <link rel="import" href="px-validation.html" />
  </head>

  <body>
    <px-validation>
      <px-validator validation-method="isNumber" import="px-example-validator.html"></px-validator>
      <px-validator multi-step-validation='["isNumber", "isRed", "isBlue"]' import="px-example-validator.html"></px-validator>
    </px-validation>
  </body>

</html>


text:
"""
.. _tut_viz_raw:

Visualize Raw data
==================

"""
import os.path as op

import mne

data_path = op.join(mne.datasets.sample.data_path(), 'MEG', 'sample')
raw = mne.io.read_raw_fif(op.join(data_path, 'sample_audvis_raw.fif'))
events = mne.read_events(op.join(data_path, 'sample_audvis_raw-eve.fif'))

###############################################################################
# The visualization module (:mod:`mne.viz`) contains all the plotting functions
# that work in combination with MNE data structures. Usually the easiest way to
# use them is to call a method of the data container. All of the plotting
# method names start with ``plot``. If you're using Ipython console, you can
# just write ``raw.plot`` and ask the interpreter for suggestions with a
# ``tab`` key.
#
# To visually inspect your raw data, you can use the python equivalent of
# ``mne_browse_raw``.
raw.plot(block=True, events=events)

###############################################################################
# The channels are color coded by channel type. Generally MEG channels are
# colored in different shades of blue, whereas EEG channels are black. The
# channels are also sorted by channel type by default. If you want to use a
# custom order for the channels, you can use ``order`` parameter of
# :func:`raw.plot`. The scrollbar on right side of the browser window also
# tells us that two of the channels are marked as ``bad``. Bad channels are
# color coded gray. By clicking the lines or channel names on the left, you can
# mark or unmark a bad channel interactively. You can use +/- keys to adjust
# the scale (also = works for magnifying the data). Note that the initial
# scaling factors can be set with parameter ``scalings``. With
# ``pageup/pagedown`` and ``home/end`` keys you can adjust the amount of data
# viewed at once. To see all the interactive features, hit ``?`` or click
# ``help`` in the lower left corner of the browser window.
#
# We read the events from a file and passed it as a parameter when calling the
# method. The events are plotted as vertical lines so you can see how they
# align with the raw data.
#
# We can check where the channels reside with ``plot_sensors``. Notice that
# this method (along with many other MNE plotting functions) is callable using
# any MNE data container where the channel information is available.
raw.plot_sensors(kind='3d', ch_type='mag')

###############################################################################
# Now let's add some ssp projectors to the raw data. Here we read them from a
# file and plot them.
projs = mne.read_proj(op.join(data_path, 'sample_audvis_eog-proj.fif'))
raw.add_proj(projs)
raw.plot_projs_topomap()

###############################################################################
# The first three projectors that we see are the SSP vectors from empty room
# measurements to compensate for the noise. The fourth one is the average EEG
# reference. These are already applied to the data and can no longer be
# removed. The next six are the EOG projections that we added. Every data
# channel type has two projection vectors each. Let's try the raw browser
# again.
raw.plot()

###############################################################################
# Now click the `proj` button at the lower right corner of the browser
# window. A selection dialog should appear, where you can toggle the projectors
# on and off. Notice that the first four are already applied to the data and
# toggling them does not change the data. However the newly added projectors
# modify the data to get rid of the EOG artifacts. Note that toggling the
# projectors here doesn't actually modify the data. This is purely for visually
# inspecting the effect. See :func:`mne.io.Raw.del_proj` to actually remove the
# projectors.
#
# Raw container also lets us easily plot the power spectra over the raw data.
# See the API documentation for more info.
raw.plot_psd()

###############################################################################
# Plotting channel wise power spectra is just as easy. The layout is inferred
# from the data by default when plotting topo plots. This works for most data,
# but it is also possible to define the layouts by hand. Here we select a
# layout with only magnetometer channels and plot it. Then we plot the channel
# wise spectra of first 30 seconds of the data.
layout = mne.channels.read_layout('Vectorview-mag')
layout.plot()
raw.plot_psd_topo(tmax=30., fmin=5., fmax=60., n_fft=1024, layout=layout)


text:
(function (angular) {
    "use strict";

    angular.module('Data', [])
        .service('DataService', DataService);

    DataService.$inject = ['$http', 'API', 'currUser', '$q'];

    function DataService ($http, api, currUser, $q) {
        function service (path) {
            this.url = api + path;
            this.get = getData;
            this.create = createData;
            this.update = updateData;
            this.delete = deleteData;

            var getAuth = function () {
                var token = currUser.getToken();

                if (token) {
                    return {
                        headers: {
                            'Authorization': 'JWT ' + token
                        }
                    };
                }

                return {};
            };

            function getData() {
                var config = getAuth();

                return $http.get(this.url, config);
            }

            function createData(data) {
                var config = getAuth();

                return $http.post(this.url, data, config);
            }

            function updateData(data) {
                var config = getAuth();

                return $http.put(this.url, data, config);
            }

            function deleteData(id) {
                var config = getAuth(),
                    url = id ? this.url + '/' + id : this.url;

                return $http.delete(url, config);
            }
        }

        return service;
    }

})(angular);


text:
package com.kerence.rctamap;

import android.content.Context;
import android.graphics.Color;
import android.os.Build;
import android.util.DisplayMetrics;
import android.view.WindowManager;

import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.ReadableArray;
import com.facebook.react.uimanager.annotations.ReactProp;
import com.facebook.react.uimanager.ThemedReactContext;
import com.facebook.react.uimanager.ViewGroupManager;

public class AMapPolylineManager extends ViewGroupManager<AMapPolyline> {
    private final DisplayMetrics metrics;

    public AMapPolylineManager(ReactApplicationContext reactContext) {
        super();
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
            metrics = new DisplayMetrics();
            ((WindowManager) reactContext.getSystemService(Context.WINDOW_SERVICE))
                    .getDefaultDisplay()
                    .getRealMetrics(metrics);
        } else {
            metrics = reactContext.getResources().getDisplayMetrics();
        }
    }

    @Override
    public String getName() {
        return "AMapPolyline";
    }

    @Override
    public AMapPolyline createViewInstance(ThemedReactContext context) {
        return new AMapPolyline(context);
    }

    @ReactProp(name = "coordinates")
    public void setCoordinate(AMapPolyline view, ReadableArray coordinates) {
        view.setCoordinates(coordinates);
    }

    @ReactProp(name = "strokeWidth", defaultFloat = 1f)
    public void setStrokeWidth(AMapPolyline view, float widthInPoints) {
        float widthInScreenPx = metrics.density * widthInPoints; // done for parity with iOS
        view.setWidth(widthInScreenPx);
    }

    @ReactProp(name = "strokeColor", defaultInt = Color.RED, customType = "Color")
    public void setStrokeColor(AMapPolyline view, int color) {
        view.setColor(color);
    }

    @ReactProp(name = "geodesic", defaultBoolean = false)
    public void setGeodesic(AMapPolyline view, boolean geodesic) {
        view.setGeodesic(geodesic);
    }

    @ReactProp(name = "zIndex", defaultFloat = 1.0f)
    public void setZIndex(AMapPolyline view, float zIndex) {
        view.setZIndex(zIndex);
    }
}


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

package app.metatron.discovery.domain.user;

import app.metatron.discovery.AbstractRestIntegrationTest;
import app.metatron.discovery.core.oauth.OAuthRequest;
import app.metatron.discovery.core.oauth.OAuthTestExecutionListener;
import com.facebook.presto.jdbc.internal.guava.collect.Lists;
import com.facebook.presto.jdbc.internal.guava.collect.Maps;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.jayway.restassured.RestAssured;
import com.jayway.restassured.http.ContentType;
import com.jayway.restassured.response.Response;
import org.apache.http.HttpStatus;
import org.junit.Before;
import org.junit.Test;
import org.springframework.test.context.TestExecutionListeners;
import org.springframework.test.context.jdbc.Sql;

import java.io.File;
import java.util.List;
import java.util.Map;

import static com.jayway.restassured.RestAssured.given;
import static com.jayway.restassured.path.json.JsonPath.from;
import static org.hamcrest.Matchers.empty;
import static org.hamcrest.Matchers.equalTo;

/**
 *
 */
@TestExecutionListeners(value = OAuthTestExecutionListener.class, mergeMode = TestExecutionListeners.MergeMode.MERGE_WITH_DEFAULTS)
public class UserRestIntegrationTest extends AbstractRestIntegrationTest {

  // 개인이 확인 할 수 있는 이메일 주소 기재
  // test_user_list.sql 내 USER_EMAIL 란에도 수정 필요
  String testEmail = "kyungtaak@gmail.com";

  @Before
  public void setUp() {
    RestAssured.port = serverPort;
  }

  /**
   * 사용자 목록 조회 테스트
   */
  @Test
  @OAuthRequest(username = "admin", value = {"PERM_SYSTEM_MANAGE_USER"})
  @Sql("/sql/test_user_list.sql")
  public void getUserList() {

    // @formatter:off
    given()
      .auth().oauth2(oauth_token)
      .contentType(ContentType.JSON)
      .param("projection", "forListView")
//      .param("level", "SYSTEM_ADMIN")
//      .param("status","requested,rejected")
//      .param("active",true)
//      .param("nameContains","user")
//      .param("searchDateBy", "created")
//      .param("from", "2017-09-10T00:00:00.0Z")
//      .param("to", "2017-09-15T00:00:00.0Z")
      .param("sort", "fullName,desc")
      .log().all()
    .when()
      .get("/api/users")
    .then()
//      .statusCode(HttpStatus.SC_OK)
      .log().all();
    // @formatter:on
  }

  /**
   * 사용자 상세 조회
   */
  @Test
//  @OAuthRequest(username = "admin", value = {"PERM_SYSTEM_MANAGE_USER"})
  @OAuthRequest(username = "polaris", value = {"SYSTEM_USER"})
  @Sql("/sql/test_group_list.sql")
  public void getDetailUser() {

    // @formatter:off
    given()
      .auth().oauth2(oauth_token)
      .contentType(ContentType.JSON)
      .param("projection", "forDetailView")
    .when()
      .get("/api/users/{username}", "polaris")
    .then()
      .statusCode(HttpStatus.SC_OK)
      .log().all();
    // @formatter:on
  }

  @Test
//  @OAuthRequest(username = "polaris", value = {"SYSTEM_USER"})
  public void duplicatedValue() {

    String username = "polaris1";

    // @formatter:off
    given()
//      .auth().oauth2(oauth_token)
      .contentType(ContentType.JSON)
      .accept(ContentType.JSON)
    .when()
      .get("/api/users/username/{value}/duplicated", username)
    .then()
      .statusCode(HttpStatus.SC_OK)
      .body("duplicated", equalTo(false))
      .log().all();
    // @formatter:on

    String email = "polaris@metatron.com";

    // @formatter:off
    given()
      .contentType(ContentType.JSON)
      .accept(ContentType.JSON)
    .when()
      .get("/api/users/email/{value}/duplicated", email)
    .then()
      .statusCode(HttpStatus.SC_OK)
      .body("duplicated", equalTo(true))
      .log().all();
    // @formatter:on
  }

  @Test
  @OAuthRequest(username = "polaris", value = {"SYSTEM_USER"})
  @Sql("/sql/test_mail_user.sql")
  public void resetPassword() throws InterruptedException {

    Map<String, Object> reqMap = Maps.newHashMap();
    reqMap.put("email" , testEmail);

    // @formatter:off
    given()
      .auth().oauth2(oauth_token)
      .contentType(ContentType.JSON)
      .body(reqMap)
      .log().all()
    .when()
      .post("/api/users/password/reset")
    .then()
      .statusCode(HttpStatus.SC_NO_CONTENT)
      .log().all();
    // @formatter:on

    Thread.sleep(5000);
  }

  /**
   * 사용자 암호가일치하는 체크
   */
  @Test
  @OAuthRequest(username = "polaris", value = {"SYSTEM_USER"})
  public void checkUserPassword() {

    String username ="polaris";

    Map<String, Object> reqMap = Maps.newHashMap();
    reqMap.put("password" , "polaris1");

    // @formatter:off
    given()
      .auth().oauth2(oauth_token)
      .contentType(ContentType.JSON)
      .body(reqMap)
    .when()
      .post("/api/users/{username}/check/password", username)
    .then()
      .statusCode(HttpStatus.SC_OK)
      .body("matched", equalTo(false))
      .log().all();
    // @formatter:on
  }

  /**
   * 이미지 등록, 사용자 등록/수정, Thumbnail 가져오는 절차
   */
  @Test
  @OAuthRequest(username = "polaris", value = {"PERM_SYSTEM_MANAGE_USER"})
  public void createAndPatchUserAndImage() {

    /**
     * Upload image.
     */
    String username = "polaris";
    String domain = "user";
    File file = new File("./src/test/resources/images/cr7.jpg");

    // @formatter:off
    Response res =
    given()
      .accept(ContentType.JSON)
      .multiPart("file", file)
      .formParam("itemId", username)
      .formParam("domain", domain)
    .when()
      .post("/api/images/upload");

    res.then()
      .statusCode(HttpStatus.SC_CREATED)
    .log().all();
    // @formatter:on

    String imgUrl = from(res.asString()).get("imageUrl");

    /**
     * 이미지 수정
     */
    Map<String, String> updateParam = Maps.newHashMap();
    updateParam.put("imageUrl", imgUrl);

    // @formatter:off
    given()
      .auth().oauth2(oauth_token)
      .contentType(ContentType.JSON)
      .body(updateParam)
    .when()
      .patch("/api/users/{username}", username)
    .then()
      .statusCode(HttpStatus.SC_OK)
      .log().all();
    // @formatter:on

    /**
     * 이미지 Thumbnail 로드
     */
    // @formatter:off
    Response imageResult =
    given()
      .accept("image/*")
      .param("url", imgUrl + "/thumbnail")
    .when()
      .get("/api/images/load/url");

    imageResult.then()
      .statusCode(HttpStatus.SC_OK)
    .log().all();
    // @formatter:on
  }

  /**
   * 관리자 사용자 등록/수정 절차
   */
  @Test
  @OAuthRequest(username = "admin", value = {"PERM_SYSTEM_MANAGE_USER"})
  @Sql(value = "/sql/test_group_list.sql")
  public void createAndUpdateUserManually() {

    // 가입 신청
    //
    String username = "test";
    List<String> groupNames = Lists.newArrayList("group-admin-01", "group-super-01");

    Map<String, Object> reqMap = Maps.newHashMap();
    reqMap.put("username" , username);
    reqMap.put("password", "test");
    reqMap.put("email", testEmail);
    reqMap.put("groupNames", groupNames);
    reqMap.put("passMailer", true);

    // @formatter:off
    Response createdUserRes =
    given()
      .auth().oauth2(oauth_token)
      .contentType(ContentType.JSON)
      .body(reqMap)
    .when()
      .post("/api/users/manual");
    createdUserRes.then()
      .statusCode(HttpStatus.SC_CREATED)
      .log().all();
    // @formatter:on

    // 가입 수정
    Map<String, Object> reqUpdateMap = Maps.newHashMap();
    reqUpdateMap.put("password", "test2");
    reqUpdateMap.put("email", "test2@test1.test1");
    reqUpdateMap.put("groupNames", Lists.newArrayList("group-super-01", "group-user-01"));

    // @formatter:off
    given()
      .auth().oauth2(oauth_token)
      .contentType(ContentType.JSON)
      .accept(ContentType.JSON)
      .body(reqUpdateMap)
    .when()
      .put("/api/users/{username}/manual", username)
    .then()
      .statusCode(HttpStatus.SC_OK)
      .log().all();
    // @formatter:on

    // @formatter:off
    given()
      .auth().oauth2(oauth_token)
      .contentType(ContentType.JSON)
      .param("projection", "forDetailView")
    .when()
      .get("/api/users/{username}", username)
    .then()
//      .statusCode(HttpStatus.SC_OK)
      .log().all();
    // @formatter:on

  }

  /**
   * 관리자 사용자 등록시 RoleSet 지정
   */
  @Test
  @OAuthRequest(username = "admin", value = {"PERM_SYSTEM_MANAGE_USER"})
  @Sql(value = {"/sql/test_roleset.sql", "/sql/test_organization.sql"})
  public void createUserWithRoleSetAndOrgManually() {

    // 가입 신청
    //
    String username = "test";
    String targetOrgCode = "ORG01";

    Map<String, Object> reqMap = Maps.newHashMap();
    reqMap.put("username", username);
    reqMap.put("password", "test");
    reqMap.put("email", testEmail);
    //reqMap.put("groupNames", Lists.newArrayList("SYSTEM_ADMIN", "SYSTEM_USER"));
    //reqMap.put("roleSetName", "TEST_ROLE_SET");
    reqMap.put("orgCodes", Lists.newArrayList(targetOrgCode));

    // @formatter:off
    Response createdUserRes =
    given()
      .auth().oauth2(oauth_token)
      .contentType(ContentType.JSON)
      .body(reqMap)
      .log().all()
    .when()
      .post("/api/users/manual");
    createdUserRes.then()
      .log().all()
      .statusCode(HttpStatus.SC_CREATED);
    // @formatter:on

    // @formatter:off
    given()
      .auth().oauth2(oauth_token)
      .accept(ContentType.JSON)
      .contentType(ContentType.JSON)
    .when()
      .get("/api/organizations/{id}/members", targetOrgCode)
    .then()
      .log().all()
      .statusCode(HttpStatus.SC_OK);
    // @formatter:on

    // @formatter:off
    given()
      .auth().oauth2(oauth_token)
      .contentType(ContentType.JSON)
      .param("projection", "forDetailView")
    .when()
      .get("/api/users/{username}", username)
    .then()
      .log().all()
      .statusCode(HttpStatus.SC_OK);
    // @formatter:on
  }

  /**
   * 가입신청 및 승인 절차 테스트
   */
  @Test
  @OAuthRequest(username = "admin", value = {"PERM_SYSTEM_MANAGE_USER"})
  public void createUserAndApprovedOrRejected() {

    // 가입 신청
    //
    String username = "testuser";
    User user = new User(username, "testuser");
    user.setFullName("TEST");
    user.setEmail(testEmail);

    // @formatter:off
    given()
      .contentType(ContentType.JSON)
      .body(user)
    .when()
      .post("/api/users/signup")
    .then()
      .statusCode(HttpStatus.SC_CREATED)
      .log().all();
    // @formatter:on

    // 반려 or 승인 처리
    //

    Map<String, Object> req = Maps.newHashMap();
    req.put("message", "test message");

    // @formatter:off
    given()
      .auth().oauth2(oauth_token)
      .contentType(ContentType.JSON)
      .accept(ContentType.JSON)
      .body(req)
    .when()
      .post("/api/users/{username}/approved", username)
    .then()
//      .statusCode(HttpStatus.SC_OK)
    .log().all();
    // @formatter:on

    // 사용자 정보 확인
    //
    // @formatter:off
    given()
      .auth().oauth2(oauth_token)
      .contentType(ContentType.JSON)
      .param("projection", "forDetailView")
    .when()
      .get("/api/users/{username}", username)
    .then()
      .statusCode(HttpStatus.SC_OK)
      .log().all();
    // @formatter:on

  }

  /**
   * 사용자 상태 변경 테스트
   */
  @Test
  @OAuthRequest(username = "admin", value = {"PERM_SYSTEM_MANAGE_USER"})
  public void changeUserStatus() {

    // 비활성 처리
    //
    // @formatter:off
    given()
      .auth().oauth2(oauth_token)
      .accept(ContentType.JSON)
    .when()
      .post("/api/users/{username}/status/{status}", "polaris", "locked")
    .then()
      .statusCode(HttpStatus.SC_NO_CONTENT)
    .log().all();
    // @formatter:on

    // 사용자 정보 확인
    //
    // @formatter:off
    given()
      .auth().oauth2(oauth_token)
      .contentType(ContentType.JSON)
      .param("projection", "forDetailView")
    .when()
      .get("/api/users/{username}", "polaris")
    .then()
      .statusCode(HttpStatus.SC_OK)
      .body("status", equalTo("LOCKED"))
      .log().all();
    // @formatter:on

  }

  @Test
  @OAuthRequest(username = "polaris", value = {"SYSTEM_USER", "PERM_SYSTEM_WRITE_DATASOURCE"})
  public void searchUserByKeyword() throws JsonProcessingException {

    // @formatter:off
    given()
      .auth().oauth2(oauth_token)
      .accept(ContentType.JSON)
      .contentType(ContentType.JSON)
      .param("q", "a*")
    .when()
      .get("/api/users/search/keyword")
    .then()
      .log().all();
    // @formatter:on
  }

  @Test
  @OAuthRequest(username = "polaris", value = {"SYSTEM_USER", "PERM_SYSTEM_WRITE_DATASOURCE"})
  public void searchUserByQuery() throws JsonProcessingException {

    // @formatter:off
    given()
      .auth().oauth2(oauth_token)
      .accept(ContentType.JSON)
      .contentType(ContentType.JSON)
//      .param("sort", "name,desc")
      .param("q", "+((id:pol* OR name:pol*) AND status:ACTIVATED AND modifiedTime.ymd:[2017-01-02 TO 2017-04-30])")
      .param("sort", "modifiedTime,desc")
      .param("projection", "forListView")
    .when()
      .get("/api/users/search/query")
    .then()
      .log().all();
    // @formatter:on
  }

  @Test
  @OAuthRequest(username = "polaris", value = {"SYSTEM_USER", "PERM_SYSTEM_WRITE_DATASOURCE"})
  public void searchRoleByKeyword() throws JsonProcessingException {

    // @formatter:off
    given()
      .auth().oauth2(oauth_token)
      .accept(ContentType.JSON)
      .contentType(ContentType.JSON)
      .param("q", "*a*")
    .when()
      .get("/api/roles/search/keyword")
    .then()
      .log().all();
    // @formatter:on
  }

  @Test
  @OAuthRequest(username = "admin", value = {"PERM_SYSTEM_MANAGE_USER"})
  @Sql({"/sql/test_organization.sql", "/sql/test_user_delete.sql"})
  public void should_delete_org_member_when_remove_user() {

    String username = "user01";
    String orgCode = "ORG01";

    /*
      Delete the user
     */

    // @formatter:off
    given()
        .auth().oauth2(oauth_token)
        .accept(ContentType.JSON)
        .contentType(ContentType.JSON)
        .log().all()
    .when()
        .delete("/api/users/{username}", username)
    .then()
        .log().all()
        .statusCode(HttpStatus.SC_NO_CONTENT);
    // @formatter:on

    /*
      Confirm deleted the user
     */

    // @formatter:off
    given()
      .auth().oauth2(oauth_token)
      .contentType(ContentType.JSON)
    .when()
      .get("/api/users/{username}", username)
    .then()
      .statusCode(HttpStatus.SC_NOT_FOUND);
    // @formatter:on

    /*
      Confirm deleted the organization member
     */

    // @formatter:off
    given()
      .auth().oauth2(oauth_token)
      .contentType(ContentType.JSON)
    .when()
      .get("/api/organizations/{code}/members", orgCode)
    .then()
      .log().all()
      .statusCode(HttpStatus.SC_OK)
      .body("content", empty());
    // @formatter:on
  }

}


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

<title>LinuxEphemeralPortRangeDetector</title>
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

org.openqa.selenium.net

Class LinuxEphemeralPortRangeDetector

java.lang.Object

org.openqa.selenium.net.LinuxEphemeralPortRangeDetector

All Implemented Interfaces:

EphemeralPortRangeDetector

public class LinuxEphemeralPortRangeDetector
extends java.lang.Object
implements EphemeralPortRangeDetector

Method Summary

Methods

Modifier and Type
Method and Description

int
getHighestEphemeralPort()

Returns the last port that could be searched for free ports

static LinuxEphemeralPortRangeDetector
getInstance()

int
getLowestEphemeralPort()

Returns the first port in the ephemeral range

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Method Detail

getInstance

public static LinuxEphemeralPortRangeDetector getInstance()

getLowestEphemeralPort

public int getLowestEphemeralPort()

Description copied from interface: EphemeralPortRangeDetector

Returns the first port in the ephemeral range

Specified by:

getLowestEphemeralPort in interface EphemeralPortRangeDetector

Returns:

The first ephemeral port

getHighestEphemeralPort

public int getHighestEphemeralPort()

Description copied from interface: EphemeralPortRangeDetector

Returns the last port that could be searched for free ports

Specified by:

getHighestEphemeralPort in interface EphemeralPortRangeDetector

Returns:

The first port that may be free

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method


text:
/*
This file is part of WebNES.

WebNES is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

WebNES is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with WebNES.  If not, see <http://www.gnu.org/licenses/>.
*/

this.Gui = this.Gui || {};
var animateFunction;

(function(){
	"use strict";

	var App = function() {
		var that = this;

		this._cart = null;
		this._romLoaded = false;
		this._mainboard = null;
		this._renderSurface = null;
		this._fpsMeter = null;
		this._spriteDisplay = null;
		this._paletteDisplay = null;
		this._logWindow = null;
		this._cpuInstructionsWindow = null;
		this._input = null;
		this._encodingTypeToSet = '';
		this._newRomWaiting = false;
		this._newRomLoaded = { name: '', binaryString: null };
		this._eventBus = new Nes.EventBus();

		this._frameTimeTarget = 0;
		this._lastFrameTime = 0;
		this._gameSpeed = 100; // 100% normal speed

		this._isPaused = 0;
		this._pauseNextFrame = false;
		this._pauseOnFrame = -1;

		this._options = {};

		window.onerror = function(e) { that._showError( e ); };
	};

	App.prototype.connect = function( name, cb ) {

		this._eventBus.connect( name, cb );
	};

	App.prototype.setColourEncodingType = function( encodingType ) {

		this._encodingTypeToSet = encodingType;
	};

	App.prototype._loadRomCallback = function( name, binaryString ) {

		this._newRomWaiting = true;
		this._newRomLoaded = { name: name, binaryString: binaryString };
	};

	App.prototype.start = function( options ) {

		this._options = options || {};
		this._options.triggerFrameRenderedEvent = this._options.triggerFrameRenderedEvent === undefined ? false : this._options.triggerFrameRenderedEvent;
		this._options.createGuiComponents = this._options.createGuiComponents === undefined ? true : this._options.createGuiComponents;

		var that = this;

		if ( this._options.createGuiComponents ) {
			window.addEventListener( 'contextmenu', function ( event ) { event.preventDefault(); }, false );

			this._fpsMeter = new FPSMeter( null, { top: '10%', left: '80%' } );
			this._fpsMeter.hide();
			Gui.hookDragDropEvents( function( name, binaryString ) { that._loadRomCallback( name, binaryString ); } );

			this._canvasParent = new Gui.CanvasParent();
			this._renderSurface = null;
			if ( WebGl.webGlSupported() ) {
				console.log( "Using WebGL for rendering..." );
				this._renderSurface = new Gui.WebGlRenderSurface( this._canvasParent );
				$('#postProcessingDiv').css( 'display', 'block' ); // Show shader drop list
			} else {
				console.log( "WebGL not supported. Using canvas for rendering..." );
				this._renderSurface = new Gui.CanvasRenderSurface( this._canvasParent );
			}
		} else {
			this._renderSurface = new Test.TestRenderSurface();
		}

		this._mainboard = new Nes.mainboard( this._renderSurface );
		this._mainboard.connect( 'reset', function() { that._onReset(); } );

		if ( this._options.createGuiComponents ) {
			this._ggDialog = new Gui.GameGenieDialog( this );
			this._controlBar = new Gui.ControlBar( this );
			this._controlBar.connect( 'romLoaded', function( name, binaryString ) { that._loadRomCallback( name, binaryString ); } );
			this._input = new Gui.Input( this._mainboard );
			this._keyboardRemapDialog = new Gui.KeyboardRemapper( this );
		}

		this._saveStateManager = new Gui.SaveStateManager( this, this._options.createGuiComponents );

		// var sde = $( ".spriteDisplay" );
		// if ( sde.length > 0 ) {
			// this._spriteDisplay = new Gui.SpriteDisplayWindow( this._mainboard, sde[0] );
		// }
		// var pde = $( ".paletteDisplay" );
		// if ( pde.length > 0 ) {
			// this._paletteDisplay = new Gui.PaletteDisplayWindow( this._mainboard, pde[0] );
		// }
		// var cpu = $( ".cpuInstructions" );
		// if ( cpu.length > 0 ) {
			// this._cpuInstructionsWindow = new Nes.CpuInstructionsWindow( this._mainboard, cpu[0] );
		// }
		// var log = $( ".logWindow" );
		// if ( log.length > 0  ) {
			// this._logWindow = new Nes.LogWindow( this._mainboard, log[0] );
		// }

		window.setFastTimeout( animateFunction );
		if ( this._options.loadUrl ) {
			this.loadRomFromUrl( this._options.loadUrl );
		}
		this._animate();
	};

	App.prototype.pause = function( isPaused ) {

		var changed = false;

		if ( isPaused ) {
			changed = this._isPaused === 0;
			this._isPaused = 1;
		} else {
			changed = this._isPaused === 1;
			this._isPaused = 0;
		}

		if ( changed ) {
			this._eventBus.invoke( 'isPausedChange', this.isPaused() );
		}
	};

	App.prototype.isPaused = function() {
		return this._isPaused > 0;
	};

	App.prototype._onReset = function() {

		this._calculateFrameTimeTarget();
	};

	App.prototype._calculateFrameTimeTarget = function() {
		if ( this._gameSpeed > 0 ) {
			var base = ( 100000 / this._gameSpeed ); // 100000 = 1000 * 100 ( 1000 milliseconds, multiplied by 100 as gameSpeed is a %)
			this._frameTimeTarget = ( base / COLOUR_ENCODING_REFRESHRATE );
		}
	};

	App.prototype.reset = function() {

		this._mainboard.reset();
	};

	App.prototype.playOneFrame = function() {
		this.pause( false );
		this._pauseNextFrame = true;
	};

	App.prototype.playUntilFrame = function( frameNum ) {
		this.pause( false );
		this._pauseOnFrame = frameNum;
	};

	App.prototype.enableSound = function( enable ) {
		this._mainboard.enableSound( enable );
	};

	App.prototype.soundEnabled = function() {
		return this._mainboard.apu.soundEnabled();
	};

	App.prototype.soundSupported = function() {
		return this._mainboard.apu.soundSupported();
	};

	App.prototype.setVolume = function( val ) {
		this._mainboard.setVolume( val );
	};

	App.prototype.setGameSpeed = function( gameSpeed ) {

		this._gameSpeed = gameSpeed;
		this._calculateFrameTimeTarget();
	};

	App.prototype.setTraceOption = function( traceType, checked ) {

		this._mainboard.setTraceOption( traceType, checked );
	};

	App.prototype._readyToRender = function() {
		if ( this._gameSpeed <= 0 ) {
			return true;
		}
		var now = performance ? performance.now() : Date.now(); // Date.now() in unsupported browsers
		var diff = now - this._lastFrameTime;
		if ( diff >= this._frameTimeTarget ) {
			this._lastFrameTime = now;
			return true;
		} else {
			return false;
		}
	};

	App.prototype.showFpsMeter = function( show ) {
		if ( show ) {
			this._fpsMeter.show();
		} else {
			this._fpsMeter.hide();
		}
	};

	App.prototype.startTrace = function() {

		this._eventBus.invoke( 'traceRunning', true );
		// if ( traceType === 'cpuInstructions' ) {
		this._mainboard.cpu.enableTrace( true );
		// }
		Nes.Trace.start();
	};

	App.prototype.stopTrace = function() {

		Nes.Trace.stop();
		this._mainboard.cpu.enableTrace( false );
		this._eventBus.invoke( 'traceRunning', false );
	};

	App.prototype.screenshot = function() {

		this._renderSurface.screenshotToFile();
	};

	App.prototype._animate = function() {

		var that = this;

		if ( this._newRomWaiting ) {
			this._doRomLoad( this._newRomLoaded.name, this._newRomLoaded.binaryString );
			this._newRomWaiting = false;
		}

		if ( this._romLoaded ) {
			this._romLoaded = false;
			this._mainboard.loadCartridge( this._cart );
			this._eventBus.invoke( 'cartLoaded', this._cart );
		}

		if ( this._encodingTypeToSet.length > 0 ) {
			setColourEncodingType( this._encodingTypeToSet );
			this._encodingTypeToSet = '';
		}

		if ( this._isPaused <= 0 ) {
			if ( this._readyToRender() ) {

				if ( this._input ) {
					this._input.poll();
				}

				var bgColour = this._mainboard.renderBuffer.pickColour( this._mainboard.ppu.getBackgroundPaletteIndex() );
				this._renderSurface.clearBuffers( bgColour );
				this._mainboard.renderBuffer.clearBuffer();

				this._mainboard.doFrame();
				this._renderSurface.render( this._mainboard );

				if ( this._options.triggerFrameRenderedEvent ) {
					this._eventBus.invoke( 'frameRendered', this._renderSurface, this._mainboard.ppu.frameCounter );
				}

				if ( this._fpsMeter ) {
					this._fpsMeter.tick();
				}
			}

			if ( this._pauseNextFrame ) {
				this._pauseNextFrame = false;
				this.pause( true );
			}

			if ( this._pauseOnFrame >= 0 && this._pauseOnFrame === this._mainboard.ppu.frameCounter ) {
				this._pauseOnFrame = -1;
				this.pause( true );
			}

			this._saveStateManager.onFrame();

			// Note: Use setImmediate polyfill instead of homemade message implementation, as it doesn't work on firefox
			setImmediate( animateFunction );
			//window.invokeFastTimeout();
		} else {
			setTimeout( animateFunction, 300 );
		}
	};

	App.prototype._doRomLoad = function( name, binaryString ) {
		var that = this;
		this._cart = new Nes.cartridge( this._mainboard );
		this._cart.loadRom( name, binaryString, function( err ) {
			if ( !err ) {
				that._romLoaded = true;
			} else {
				that._showError( err );
			}
		} );
	};

	App.prototype.loadRomFromUrl = function( url ) {

		var that = this;
		Nes.loadRomFromUrl( url, function( err, name, binary ) {
			if ( !err ) {
				that._loadRomCallback( name, binary );
			} else {
				that._showError( err );
			}
		} );
	};

	App.prototype._showError = function( err ) {

		console.log( err );
		var errorType = typeof err;
		var msg = '';
		if ( errorType === 'string' ) {
			msg = err;
		} else if ( errorType === 'object' ) {
			if ( err.message ) {
				msg = err.message;
			} else {
				msg = err.toString();
			}
		} else {
			msg = err.toString();
		}
		this._eventBus.invoke( 'romLoadFailure', msg );
	};

	App.prototype.gameGenieCode = function( code ) {

		Nes.processGameGenieCode( this._mainboard, code, true );
	};

	App.prototype.loadShaderFromUrl = function( url ) {

		if ( this._renderSurface.loadShaderFromUrl ) {
			this._renderSurface.loadShaderFromUrl( url );
		}
	};

	Gui.App = new App();

}());

animateFunction = function() {
	Gui.App._animate();
};


text:
/*
 * snprintf.h
 *   header file for snprintf.c
 *
 * $Id: snprintf.h,v 1.23 2011/02/13 14:19:33 simple Exp $
 */
/*
 * Copyright (C) 2000 - 2011 Eggheads Development Team
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 */

#ifndef _EGG_COMPAT_SNPRINTF_H_
#define _EGG_COMPAT_SNPRINTF_H_

#include "src/main.h"
#include <stdio.h>

/* Check for broken snprintf versions */
#ifdef BROKEN_SNPRINTF
#  ifdef HAVE_VSNPRINTF
#    undef HAVE_VSNPRINTF
#  endif
#  ifdef HAVE_SNPRINTF
#    undef HAVE_SNPRINTF
#  endif
#endif

/* Use the system libraries version of vsnprintf() if available. Otherwise
 * use our own.
 */
#ifndef HAVE_VSNPRINTF
int egg_vsnprintf(char *str, size_t count, const char *fmt, va_list ap);
#else
#  define egg_vsnprintf vsnprintf
#endif

/* Use the system libraries version of snprintf() if available. Otherwise
 * use our own.
 */
#ifndef HAVE_SNPRINTF
#  ifdef __STDC__
int egg_snprintf(char *str, size_t count, const char *fmt, ...);
#  else
int egg_snprintf();
#  endif
#else
#  define egg_snprintf snprintf
#endif

#endif /* !_EGG_COMPAT_SNPRINTF_H_ */


text:
<?php

/**
 * @namespace
 */
namespace Zend\GData\Spreadsheets;

use Zend\GData\Spreadsheets;

/**
 * Concrete class for working with Cell entries.
 *
 * @uses       \Zend\GData\Entry
 * @uses       \Zend\GData\Spreadsheets
 * @uses       \Zend\GData\Spreadsheets\Extension\Cell
 * @category   Zend
 * @package    Zend_Gdata
 * @subpackage Spreadsheets
 * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
 * @license    http://framework.zend.com/license/new-bsd     New BSD License
 */
class CellEntry extends \Zend\GData\Entry
{

    protected $_entryClassName = 'Zend\GData\Spreadsheets\CellEntry';
    protected $_cell;

    /**
     * Constructs a new Zend_Gdata_Spreadsheets_CellEntry object.
     * @param string $uri (optional)
     * @param DOMElement $element (optional) The DOMElement on which to base this object.
     */
    public function __construct($element = null)
    {
        $this->registerAllNamespaces(Spreadsheets::$namespaces);
        parent::__construct($element);
    }

    public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null)
    {
        $element = parent::getDOM($doc, $majorVersion, $minorVersion);
        if ($this->_cell != null) {
            $element->appendChild($this->_cell->getDOM($element->ownerDocument));
        }
        return $element;
    }

    protected function takeChildFromDOM($child)
    {
        $absoluteNodeName = $child->namespaceURI . ':' . $child->localName;
        switch ($absoluteNodeName) {
        case $this->lookupNamespace('gs') . ':' . 'cell';
            $cell = new Extension\Cell();
            $cell->transferFromDOM($child);
            $this->_cell = $cell;
            break;
        default:
            parent::takeChildFromDOM($child);
            break;
        }
    }

    /**
     * Gets the Cell element of this Cell Entry.
     * @return \Zend\GData\Spreadsheets\Extension\Cell
     */
    public function getCell()
    {
        return $this->_cell;
    }

    /**
     * Sets the Cell element of this Cell Entry.
     * @param $cell \Zend\GData\Spreadsheets\Extension\Cell $cell
     */
    public function setCell($cell)
    {
        $this->_cell = $cell;
        return $this;
    }

}


text:
package ca.barelabs.bareconnection;

import java.io.IOException;
import java.io.InputStream;
import java.lang.reflect.Type;
import java.net.HttpURLConnection;
import java.util.ArrayList;
import java.util.List;
import java.util.zip.GZIPInputStream;

public class RestResponse {

    private final HttpURLConnection mConnection;
    private final ObjectParser mParser;
    private final int mStatusCode;
    private final String mIncomingCharset;
    private InputStream mContent;

    RestResponse(HttpURLConnection connection, ObjectParser parser, String incomingCharset) throws IOException {
        mConnection = connection;
        mParser = parser;
        mStatusCode = connection.getResponseCode();
        mIncomingCharset = parseIncomingCharset(connection, incomingCharset);
    }

    public HttpURLConnection getConnection() {
        return mConnection;
    }

    public ObjectParser getParser() {
        return mParser;
    }

    public int getStatusCode() {
        return mStatusCode;
    }

    public String getIncomingCharset() {
        return mIncomingCharset;
    }

    public List<String> getCookies() {
        List<String> cookies = new ArrayList<String>();
        List<String> incomingCookies = mConnection.getHeaderFields().get(RestConnection.HEADER_SET_COOKIE);
        for (String cookie : incomingCookies) {
            cookies.add(cookie.split(";", 2)[0]);
        }
        return cookies;
    }

    public InputStream getEncodedContent() throws IOException {
        ensureValidStatusCode();
        if (mContent == null) {
            mContent = mConnection.getInputStream();
        }
        return mContent;
    }

    public InputStream getContent() throws IOException {
        ensureValidStatusCode();
        if (mContent == null) {
            mContent = decodeStream(mConnection.getInputStream());
        }
        return mContent;
    }

    public String parse() throws IOException {
        ensureValidStatusCode();
        try {
            return IOUtils.toString(getContent(), mIncomingCharset);
        } finally {
            disconnect();
        }
    }

    public <T> T parseAs(Type type) throws IOException {
        ensureValidStatusCode();
        try {
            if (mParser == null) {
                throw new IllegalStateException("Missing ObjectParser. See RestConnection.setParser() or include Gson dependency to default to GsonParser.");
            }
            return mParser.parseAndClose(getContent(), mIncomingCharset, type);
        } finally {
            disconnect();
        }
    }

    public void disconnect() {
        try {
            IOUtils.closeQuietly(getContent());
        } catch (IOException e) { /* Ignore exception, attempting to disconnect. */ }
        mConnection.disconnect();
    }

    private InputStream decodeStream(InputStream in) throws IOException {
        String encoding = mConnection.getContentEncoding();
        boolean gzipped = encoding != null && encoding.equalsIgnoreCase(RestConnection.ENCODING_GZIP);
        return gzipped ? new GZIPInputStream(in) : in;
    }

    private String parseIncomingCharset(HttpURLConnection connection, String definedIncomingCharset) {
        String contentType = connection.getHeaderField(RestConnection.HEADER_CONTENT_TYPE);
        if (contentType != null) {
            for (String param : contentType.replace(" ", "").split(";")) {
                if (param.startsWith(RestConnection.KEY_CHARSET + "=")) {
                    return param.split("=", 2)[1];
                }
            }
        }
        return definedIncomingCharset;
    }

    private void ensureValidStatusCode() throws IOException {
        if (mStatusCode / 100 != 2) {
            String responseError = IOUtils.toString(decodeStream(mConnection.getErrorStream()), mIncomingCharset);
            throw new RestException(mStatusCode, responseError);
        }
    }
}


text:
<resources>
    <string name="app_name">UsingMPAndroidChartLib</string>
</resources>


text:
package jp.gauzau.MikuMikuDroidmod;

import java.io.Serializable;

public class FaceIndex implements Serializable {
	private static final long serialVersionUID = -6822607769731832013L;
	public int frame_no;
	public float weight;

}


text:
#include "msvcrt.h"
#include "mtdll.h"
#include "wine/debug.h"

WINE_DEFAULT_DEBUG_CHANNEL(msvcrt);

/* MT */
#define LOCK_HEAP   _mlock( _HEAP_LOCK )
#define UNLOCK_HEAP _munlock( _HEAP_LOCK )

/* _aligned */
#define SAVED_PTR(x) ((void *)((DWORD_PTR)((char *)x - sizeof(void *)) & \
                               ~(sizeof(void *) - 1)))
#define ALIGN_PTR(ptr, alignment, offset) ((void *) \
    ((((DWORD_PTR)((char *)ptr + alignment + sizeof(void *) + offset)) & \
      ~(alignment - 1)) - offset))

typedef int (CDECL *MSVCRT_new_handler_func)(MSVCRT_size_t size);

static MSVCRT_new_handler_func MSVCRT_new_handler;
static int MSVCRT_new_mode;

/* FIXME - According to documentation it should be 8*1024, at runtime it returns 16 */
static unsigned int MSVCRT_amblksiz = 16;
/* FIXME - According to documentation it should be 480 bytes, at runtime default is 0 */
static MSVCRT_size_t MSVCRT_sbh_threshold = 0;

/*********************************************************************
 *		??2@YAPAXI@Z (MSVCRT.@)
 */
void* CDECL MSVCRT_operator_new(MSVCRT_size_t size)
{
  void *retval;
  int freed;

  do
  {
    retval = HeapAlloc(GetProcessHeap(), 0, size);
    if(retval)
    {
      TRACE("(%ld) returning %p\n", size, retval);
      return retval;
    }

    LOCK_HEAP;
    if(MSVCRT_new_handler)
      freed = (*MSVCRT_new_handler)(size);
    else
      freed = 0;
    UNLOCK_HEAP;
  } while(freed);

  TRACE("(%ld) out of memory\n", size);
  return NULL;
}

/*********************************************************************
 *		??2@YAPAXIHPBDH@Z (MSVCRT.@)
 */
void* CDECL MSVCRT_operator_new_dbg(MSVCRT_size_t size, int type, const char *file, int line)
{
    return MSVCRT_operator_new( size );
}

/*********************************************************************
 *		??3@YAXPAX@Z (MSVCRT.@)
 */
void CDECL MSVCRT_operator_delete(void *mem)
{
  TRACE("(%p)\n", mem);
  HeapFree(GetProcessHeap(), 0, mem);
}

/*********************************************************************
 *		?_query_new_handler@@YAP6AHI@ZXZ (MSVCRT.@)
 */
MSVCRT_new_handler_func CDECL MSVCRT__query_new_handler(void)
{
  return MSVCRT_new_handler;
}

/*********************************************************************
 *		?_query_new_mode@@YAHXZ (MSVCRT.@)
 */
int CDECL MSVCRT__query_new_mode(void)
{
  return MSVCRT_new_mode;
}

/*********************************************************************
 *		?_set_new_handler@@YAP6AHI@ZP6AHI@Z@Z (MSVCRT.@)
 */
MSVCRT_new_handler_func CDECL MSVCRT__set_new_handler(MSVCRT_new_handler_func func)
{
  MSVCRT_new_handler_func old_handler;
  LOCK_HEAP;
  old_handler = MSVCRT_new_handler;
  MSVCRT_new_handler = func;
  UNLOCK_HEAP;
  return old_handler;
}

/*********************************************************************
 *		?set_new_handler@@YAP6AXXZP6AXXZ@Z (MSVCRT.@)
 */
MSVCRT_new_handler_func CDECL MSVCRT_set_new_handler(void *func)
{
  TRACE("(%p)\n",func);
  MSVCRT__set_new_handler(NULL);
  return NULL;
}

/*********************************************************************
 *		?_set_new_mode@@YAHH@Z (MSVCRT.@)
 */
int CDECL MSVCRT__set_new_mode(int mode)
{
  int old_mode;
  LOCK_HEAP;
  old_mode = MSVCRT_new_mode;
  MSVCRT_new_mode = mode;
  UNLOCK_HEAP;
  return old_mode;
}

/*********************************************************************
 *		_callnewh (MSVCRT.@)
 */
int CDECL _callnewh(MSVCRT_size_t size)
{
  if(MSVCRT_new_handler)
    (*MSVCRT_new_handler)(size);
  return 0;
}

/*********************************************************************
 *		_expand (MSVCRT.@)
 */
void* CDECL _expand(void* mem, MSVCRT_size_t size)
{
  return HeapReAlloc(GetProcessHeap(), HEAP_REALLOC_IN_PLACE_ONLY, mem, size);
}

/*********************************************************************
 *		_heapchk (MSVCRT.@)
 */
int CDECL _heapchk(void)
{
  if (!HeapValidate( GetProcessHeap(), 0, NULL))
  {
    msvcrt_set_errno(GetLastError());
    return MSVCRT__HEAPBADNODE;
  }
  return MSVCRT__HEAPOK;
}

/*********************************************************************
 *		_heapmin (MSVCRT.@)
 */
int CDECL _heapmin(void)
{
  if (!HeapCompact( GetProcessHeap(), 0 ))
  {
    if (GetLastError() != ERROR_CALL_NOT_IMPLEMENTED)
      msvcrt_set_errno(GetLastError());
    return -1;
  }
  return 0;
}

/*********************************************************************
 *		_heapwalk (MSVCRT.@)
 */
int CDECL _heapwalk(struct MSVCRT__heapinfo* next)
{
  PROCESS_HEAP_ENTRY phe;

  LOCK_HEAP;
  phe.lpData = next->_pentry;
  phe.cbData = next->_size;
  phe.wFlags = next->_useflag == MSVCRT__USEDENTRY ? PROCESS_HEAP_ENTRY_BUSY : 0;

  if (phe.lpData && phe.wFlags & PROCESS_HEAP_ENTRY_BUSY &&
      !HeapValidate( GetProcessHeap(), 0, phe.lpData ))
  {
    UNLOCK_HEAP;
    msvcrt_set_errno(GetLastError());
    return MSVCRT__HEAPBADNODE;
  }

  do
  {
    if (!HeapWalk( GetProcessHeap(), &phe ))
    {
      UNLOCK_HEAP;
      if (GetLastError() == ERROR_NO_MORE_ITEMS)
         return MSVCRT__HEAPEND;
      msvcrt_set_errno(GetLastError());
      if (!phe.lpData)
        return MSVCRT__HEAPBADBEGIN;
      return MSVCRT__HEAPBADNODE;
    }
  } while (phe.wFlags & (PROCESS_HEAP_REGION|PROCESS_HEAP_UNCOMMITTED_RANGE));

  UNLOCK_HEAP;
  next->_pentry = phe.lpData;
  next->_size = phe.cbData;
  next->_useflag = phe.wFlags & PROCESS_HEAP_ENTRY_BUSY ? MSVCRT__USEDENTRY : MSVCRT__FREEENTRY;
  return MSVCRT__HEAPOK;
}

/*********************************************************************
 *		_heapset (MSVCRT.@)
 */
int CDECL _heapset(unsigned int value)
{
  int retval;
  struct MSVCRT__heapinfo heap;

  memset( &heap, 0, sizeof(heap) );
  LOCK_HEAP;
  while ((retval = _heapwalk(&heap)) == MSVCRT__HEAPOK)
  {
    if (heap._useflag == MSVCRT__FREEENTRY)
      memset(heap._pentry, value, heap._size);
  }
  UNLOCK_HEAP;
  return retval == MSVCRT__HEAPEND? MSVCRT__HEAPOK : retval;
}

/*********************************************************************
 *		_heapadd (MSVCRT.@)
 */
int CDECL _heapadd(void* mem, MSVCRT_size_t size)
{
  TRACE("(%p,%ld) unsupported in Win32\n", mem,size);
  *MSVCRT__errno() = MSVCRT_ENOSYS;
  return -1;
}

/*********************************************************************
 *		_heapadd (MSVCRT.@)
 */
MSVCRT_intptr_t CDECL _get_heap_handle(void)
{
    return (MSVCRT_intptr_t)GetProcessHeap();
}

/*********************************************************************
 *		_msize (MSVCRT.@)
 */
MSVCRT_size_t CDECL _msize(void* mem)
{
  MSVCRT_size_t size = HeapSize(GetProcessHeap(),0,mem);
  if (size == ~(MSVCRT_size_t)0)
  {
    WARN(":Probably called with non wine-allocated memory, ret = -1\n");
    /* At least the Win32 crtdll/msvcrt also return -1 in this case */
  }
  return size;
}

/*********************************************************************
 *		calloc (MSVCRT.@)
 */
void* CDECL MSVCRT_calloc(MSVCRT_size_t size, MSVCRT_size_t count)
{
  return HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, size * count );
}

/*********************************************************************
 *		free (MSVCRT.@)
 */
void CDECL MSVCRT_free(void* ptr)
{
  HeapFree(GetProcessHeap(),0,ptr);
}

/*********************************************************************
 *                  malloc (MSVCRT.@)
 */
void* CDECL MSVCRT_malloc(MSVCRT_size_t size)
{
  void *ret = HeapAlloc(GetProcessHeap(),0,size);
  if (!ret)
      *MSVCRT__errno() = MSVCRT_ENOMEM;
  return ret;
}

/*********************************************************************
 *		realloc (MSVCRT.@)
 */
void* CDECL MSVCRT_realloc(void* ptr, MSVCRT_size_t size)
{
  if (!ptr) return MSVCRT_malloc(size);
  if (size) return HeapReAlloc(GetProcessHeap(), 0, ptr, size);
  MSVCRT_free(ptr);
  return NULL;
}

/*********************************************************************
 *		__p__amblksiz (MSVCRT.@)
 */
unsigned int* CDECL __p__amblksiz(void)
{
  return &MSVCRT_amblksiz;
}

/*********************************************************************
 *		_get_sbh_threshold (MSVCRT.@)
 */
MSVCRT_size_t CDECL _get_sbh_threshold(void)
{
  return MSVCRT_sbh_threshold;
}

/*********************************************************************
 *		_set_sbh_threshold (MSVCRT.@)
 */
int CDECL _set_sbh_threshold(MSVCRT_size_t threshold)
{
  if(threshold > 1016)
     return 0;
  else
     MSVCRT_sbh_threshold = threshold;
  return 1;
}

/*********************************************************************
 *		_aligned_free (MSVCRT.@)
 */
void CDECL _aligned_free(void *memblock)
{
    TRACE("(%p)\n", memblock);

    if (memblock)
    {
        void **saved = SAVED_PTR(memblock);
        MSVCRT_free(*saved);
    }
}

/*********************************************************************
 *		_aligned_offset_malloc (MSVCRT.@)
 */
void * CDECL _aligned_offset_malloc(MSVCRT_size_t size, MSVCRT_size_t alignment, MSVCRT_size_t offset)
{
    void *memblock, *temp, **saved;
    TRACE("(%lu, %lu, %lu)\n", size, alignment, offset);

    /* alignment must be a power of 2 */
    if ((alignment & (alignment - 1)) != 0)
    {
        *MSVCRT__errno() = MSVCRT_EINVAL;
        return NULL;
    }

    /* offset must be less than size */
    if (offset && offset >= size)
    {
        *MSVCRT__errno() = MSVCRT_EINVAL;
        return NULL;
    }

    /* don't align to less than void pointer size */
    if (alignment < sizeof(void *))
        alignment = sizeof(void *);

    /* allocate enough space for void pointer and alignment */
    temp = MSVCRT_malloc(size + alignment + sizeof(void *));

    if (!temp)
        return NULL;

    /* adjust pointer for proper alignment and offset */
    memblock = ALIGN_PTR(temp, alignment, offset);

    /* Save the real allocation address below returned address */
    /* so it can be found later to free. */
    saved = SAVED_PTR(memblock);
    *saved = temp;

    return memblock;
}

/*********************************************************************
 *		_aligned_malloc (MSVCRT.@)
 */
void * CDECL _aligned_malloc(MSVCRT_size_t size, MSVCRT_size_t alignment)
{
    TRACE("(%lu, %lu)\n", size, alignment);
    return _aligned_offset_malloc(size, alignment, 0);
}

/*********************************************************************
 *		_aligned_offset_realloc (MSVCRT.@)
 */
void * CDECL _aligned_offset_realloc(void *memblock, MSVCRT_size_t size,
                                     MSVCRT_size_t alignment, MSVCRT_size_t offset)
{
    void * temp, **saved;
    MSVCRT_size_t old_padding, new_padding, old_size;
    TRACE("(%p, %lu, %lu, %lu)\n", memblock, size, alignment, offset);

    if (!memblock)
        return _aligned_offset_malloc(size, alignment, offset);

    /* alignment must be a power of 2 */
    if ((alignment & (alignment - 1)) != 0)
    {
        *MSVCRT__errno() = MSVCRT_EINVAL;
        return NULL;
    }

    /* offset must be less than size */
    if (offset >= size)
    {
        *MSVCRT__errno() = MSVCRT_EINVAL;
        return NULL;
    }

    if (size == 0)
    {
        _aligned_free(memblock);
        return NULL;
    }

    /* don't align to less than void pointer size */
    if (alignment < sizeof(void *))
        alignment = sizeof(void *);

    /* make sure alignment and offset didn't change */
    saved = SAVED_PTR(memblock);
    if (memblock != ALIGN_PTR(*saved, alignment, offset))
    {
        *MSVCRT__errno() = MSVCRT_EINVAL;
        return NULL;
    }

    old_padding = (char *)memblock - (char *)*saved;

    /* Get previous size of block */
    old_size = _msize(*saved);
    if (old_size == -1)
    {
        /* It seems this function was called with an invalid pointer. Bail out. */
        return NULL;
    }

    /* Adjust old_size to get amount of actual data in old block. */
    if (old_size < old_padding)
    {
        /* Shouldn't happen. Something's weird, so bail out. */
        return NULL;
    }
    old_size -= old_padding;

    temp = MSVCRT_realloc(*saved, size + alignment + sizeof(void *));

    if (!temp)
        return NULL;

    /* adjust pointer for proper alignment and offset */
    memblock = ALIGN_PTR(temp, alignment, offset);

    /* Save the real allocation address below returned address */
    /* so it can be found later to free. */
    saved = SAVED_PTR(memblock);

    new_padding = (char *)memblock - (char *)temp;

/*
   Memory layout of old block is as follows:
   +-------+---------------------+-+--------------------------+-----------+
   |  ...  | "old_padding" bytes | | ... "old_size" bytes ... |    ...    |
   +-------+---------------------+-+--------------------------+-----------+
           ^                     ^ ^
           |                     | |
        *saved               saved memblock

   Memory layout of new block is as follows:
   +-------+-----------------------------+-+----------------------+-------+
   |  ...  |    "new_padding" bytes      | | ... "size" bytes ... |  ...  |
   +-------+-----------------------------+-+----------------------+-------+
           ^                             ^ ^
           |                             | |
          temp                       saved memblock

   However, in the new block, actual data is still written as follows
   (because it was copied by MSVCRT_realloc):
   +-------+---------------------+--------------------------------+-------+
   |  ...  | "old_padding" bytes |   ... "old_size" bytes ...     |  ...  |
   +-------+---------------------+--------------------------------+-------+
           ^                             ^ ^
           |                             | |
          temp                       saved memblock

   Therefore, min(old_size,size) bytes of actual data have to be moved
   from the offset they were at in the old block (temp + old_padding),
   to the offset they have to be in the new block (temp + new_padding == memblock).
*/
    if (new_padding != old_padding)
        memmove((char *)memblock, (char *)temp + old_padding, (old_size < size) ? old_size : size);

    *saved = temp;

    return memblock;
}

/*********************************************************************
 *		_aligned_realloc (MSVCRT.@)
 */
void * CDECL _aligned_realloc(void *memblock, MSVCRT_size_t size, MSVCRT_size_t alignment)
{
    TRACE("(%p, %lu, %lu)\n", memblock, size, alignment);
    return _aligned_offset_realloc(memblock, size, alignment, 0);
}

/*********************************************************************
 *		memmove_s (MSVCRT.@)
 */
int CDECL memmove_s(void *dest, MSVCRT_size_t numberOfElements, const void *src, MSVCRT_size_t count)
{
    TRACE("(%p %lu %p %lu)\n", dest, numberOfElements, src, count);

    if(!count)
        return 0;

    if (!MSVCRT_CHECK_PMT(dest != NULL)) return MSVCRT_EINVAL;
    if (!MSVCRT_CHECK_PMT(src != NULL)) return MSVCRT_EINVAL;
    if (!MSVCRT_CHECK_PMT_ERR( count <= numberOfElements, MSVCRT_ERANGE )) return MSVCRT_ERANGE;

    memmove(dest, src, count);
    return 0;
}

/*********************************************************************
 *		memcpy_s (MSVCRT.@)
 */
int CDECL memcpy_s(void *dest, MSVCRT_size_t numberOfElements, const void *src, MSVCRT_size_t count)
{
    TRACE("(%p %lu %p %lu)\n", dest, numberOfElements, src, count);

    if(!count)
        return 0;

    if (!MSVCRT_CHECK_PMT(dest != NULL)) return MSVCRT_EINVAL;
    if (!MSVCRT_CHECK_PMT(src != NULL))
    {
        memset(dest, 0, numberOfElements);
        return MSVCRT_EINVAL;
    }
    if (!MSVCRT_CHECK_PMT_ERR( count <= numberOfElements, MSVCRT_ERANGE ))
    {
        memset(dest, 0, numberOfElements);
        return MSVCRT_ERANGE;
    }

    memcpy(dest, src, count);
    return 0;
}

/*********************************************************************
 *		strncpy_s (MSVCRT.@)
 */
int CDECL strncpy_s(char *dest, MSVCRT_size_t numberOfElements,
        const char *src, MSVCRT_size_t count)
{
    MSVCRT_size_t i, end;

    TRACE("(%p %lu %s %lu)\n", dest, numberOfElements, debugstr_a(src), count);

    if(!count) {
        if(dest && numberOfElements)
            *dest = 0;
        return 0;
    }

    if (!MSVCRT_CHECK_PMT(dest != NULL)) return MSVCRT_EINVAL;
    if (!MSVCRT_CHECK_PMT(src != NULL)) return MSVCRT_EINVAL;
    if (!MSVCRT_CHECK_PMT(numberOfElements != 0)) return MSVCRT_EINVAL;

    if(count!=MSVCRT__TRUNCATE && count<numberOfElements)
        end = count;
    else
        end = numberOfElements-1;

    for(i=0; i<end && src[i]; i++)
        dest[i] = src[i];

    if(!src[i] || end==count || count==MSVCRT__TRUNCATE) {
        dest[i] = '\0';
        return 0;
    }

    MSVCRT_INVALID_PMT("dest[numberOfElements] is too small", MSVCRT_EINVAL);
    dest[0] = '\0';
    return MSVCRT_EINVAL;
}


text:
package io.github.benas.randombeans;

import org.junit.Before;
import org.junit.Test;

import java.util.Collection;
import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.DelayQueue;
import java.util.concurrent.SynchronousQueue;

import static org.assertj.core.api.Assertions.assertThat;

public class ObjectFactoryTest {

    private static final int INITIAL_CAPACITY = 10;

    private ObjectFactory objectFactory;

    @Before
    public void setUp() {
        objectFactory = new ObjectFactory();
    }

    @Test
    public void concreteClassesShouldBeCreatedAsExpected() {
        String string = objectFactory.createInstance(String.class);

        assertThat(string).isNotNull();
    }

    @Test(expected = InstantiationError.class)
    public void whenNoConcreteTypeIsFound_thenShouldThrowAnInstantiationError() {
        objectFactory.setScanClasspathForConcreteTypes(true);
        objectFactory.createInstance(AbstractFoo.class);
    }

    @Test
    public void createEmptyCollectionForArrayBlockingQueue() {
        Collection<?> collection = objectFactory.createEmptyCollectionForType(ArrayBlockingQueue.class, INITIAL_CAPACITY);

        assertThat(collection).isInstanceOf(ArrayBlockingQueue.class).isEmpty();
        assertThat(((ArrayBlockingQueue<?>) collection).remainingCapacity()).isEqualTo(INITIAL_CAPACITY);
    }

    @Test(expected = UnsupportedOperationException.class)
    public void synchronousQueueShouldBeRejected() {
        objectFactory.createEmptyCollectionForType(SynchronousQueue.class, INITIAL_CAPACITY);
    }

    @Test(expected = UnsupportedOperationException.class)
    public void delayQueueShouldBeRejected() {
        objectFactory.createEmptyCollectionForType(DelayQueue.class, INITIAL_CAPACITY);
    }

    private abstract class AbstractFoo {

    }
}


text:
Partial Class controls_header
    Inherits System.Web.UI.UserControl

End Class


text:
class adminService {
    constructor($http, toastService) {
        this.$http = $http;
        this.toastService = toastService;
    }
    getViews() {
        return this.$http({
            method: 'GET',
            url: '/api/views'
        })
            .then((response) => {
                return response.data;
            })
            .catch((error) => {
                this.toastService.error(error.data);
            });
    }
}

export default adminService;