text:
package com.googlecode.jmapper.config;

import static com.googlecode.jmapper.config.Constants.FileNotFoundException1;
import static com.googlecode.jmapper.config.Constants.FileNotFoundException2;
import static com.googlecode.jmapper.config.Constants.FileNotFoundException3;
import static com.googlecode.jmapper.config.Constants.InvalidNestedMappingException;
import static com.googlecode.jmapper.config.Constants.absentFactoryAndEmptyConstructorException;
import static com.googlecode.jmapper.config.Constants.classNotMappedException1;
import static com.googlecode.jmapper.config.Constants.classNotMappedException2;
import static com.googlecode.jmapper.config.Constants.conversionBodyIllegalCode;
import static com.googlecode.jmapper.config.Constants.conversionBodyIllegalCode2;
import static com.googlecode.jmapper.config.Constants.conversionParameterException;
import static com.googlecode.jmapper.config.Constants.customMethodException;
import static com.googlecode.jmapper.config.Constants.dynamicConversionBodyException;
import static com.googlecode.jmapper.config.Constants.dynamicConversionMethodException;
import static com.googlecode.jmapper.config.Constants.dynamicConversionParameterException;
import static com.googlecode.jmapper.config.Constants.illegalArgumentException1;
import static com.googlecode.jmapper.config.Constants.illegalCode;
import static com.googlecode.jmapper.config.Constants.illegalCodePath;
import static com.googlecode.jmapper.config.Constants.loadingFileException2;
import static com.googlecode.jmapper.config.Constants.malformedBeanException1;
import static com.googlecode.jmapper.config.Constants.malformedBeanException2;
import static com.googlecode.jmapper.config.Constants.malformedBeanException3;
import static com.googlecode.jmapper.config.Constants.mappingErrorException2;
import static com.googlecode.jmapper.config.Constants.mappingErrorException2length;
import static com.googlecode.jmapper.config.Constants.mappingErrorException3;
import static com.googlecode.jmapper.config.Constants.mappingErrorException4;
import static com.googlecode.jmapper.config.Constants.mappingErrorException5;
import static com.googlecode.jmapper.config.Constants.mappingErrorRelationalException2;
import static com.googlecode.jmapper.config.Constants.mappingErrorRelationalException3;
import static com.googlecode.jmapper.config.Constants.nestedBeanNullException;
import static com.googlecode.jmapper.config.Constants.noRelationshipException;
import static com.googlecode.jmapper.config.Constants.nullMappedClassException1;
import static com.googlecode.jmapper.config.Constants.nullPointer;
import static com.googlecode.jmapper.config.Constants.nullPointerContent;
import static com.googlecode.jmapper.config.Constants.nullPointerPath;
import static com.googlecode.jmapper.config.Constants.undefinedMappingException;
import static com.googlecode.jmapper.config.Constants.wrongMethodException1;
import static com.googlecode.jmapper.config.Constants.xmlConversionNameException;
import static com.googlecode.jmapper.config.Constants.xmlConversionParameterException;
import static com.googlecode.jmapper.config.Constants.xmlConversionTypeException;
import static com.googlecode.jmapper.config.Constants.xmlMappingAttributeDoesNotExistException2;
import static com.googlecode.jmapper.config.Constants.xmlMappingAttributeExistException2;
import static com.googlecode.jmapper.config.Constants.xmlMappingClassDoesNotExistException1;
import static com.googlecode.jmapper.config.Constants.xmlMappingClassDoesNotExistException2;
import static com.googlecode.jmapper.config.Constants.xmlMappingClassExistException1;
import static com.googlecode.jmapper.config.Constants.xmlMappingGlobalDoesNotExistException;
import static com.googlecode.jmapper.config.Constants.xmlMappingGlobalExistException;
import static com.googlecode.jmapper.util.GeneralUtility.isNull;

import java.io.FileNotFoundException;
import java.lang.reflect.Field;

import com.googlecode.jmapper.JMapper;
import com.googlecode.jmapper.exceptions.AbsentFactoryAndEmptyConstructorException;
import com.googlecode.jmapper.exceptions.AbsentRelationshipException;
import com.googlecode.jmapper.exceptions.ClassNotMappedException;
import com.googlecode.jmapper.exceptions.ConversionBodyIllegalCodeException;
import com.googlecode.jmapper.exceptions.ConversionParameterException;
import com.googlecode.jmapper.exceptions.DynamicConversionBodyException;
import com.googlecode.jmapper.exceptions.DynamicConversionMethodException;
import com.googlecode.jmapper.exceptions.DynamicConversionParameterException;
import com.googlecode.jmapper.exceptions.IllegalCodeException;
import com.googlecode.jmapper.exceptions.InvalidNestedMappingException;
import com.googlecode.jmapper.exceptions.LoadingFileException;
import com.googlecode.jmapper.exceptions.MalformedBeanException;
import com.googlecode.jmapper.exceptions.MappingErrorException;
import com.googlecode.jmapper.exceptions.MappingException;
import com.googlecode.jmapper.exceptions.MappingNotFoundException;
import com.googlecode.jmapper.exceptions.NestedBeanNullException;
import com.googlecode.jmapper.exceptions.NullMappedClassException;
import com.googlecode.jmapper.exceptions.UndefinedMappingException;
import com.googlecode.jmapper.exceptions.WrongMethodException;
import com.googlecode.jmapper.exceptions.XmlConversionNameException;
import com.googlecode.jmapper.exceptions.XmlConversionParameterException;
import com.googlecode.jmapper.exceptions.XmlConversionTypeException;
import com.googlecode.jmapper.exceptions.XmlMappingAttributeDoesNotExistException;
import com.googlecode.jmapper.exceptions.XmlMappingAttributeExistException;
import com.googlecode.jmapper.exceptions.XmlMappingClassDoesNotExistException;
import com.googlecode.jmapper.exceptions.XmlMappingClassExistException;
import com.googlecode.jmapper.exceptions.XmlMappingGlobalDoesNotExistException;
import com.googlecode.jmapper.exceptions.XmlMappingGlobalExistException;
import com.googlecode.jmapper.generation.beans.Method;
import com.googlecode.jmapper.xml.Attribute;
import com.googlecode.jmapper.xml.XML;
/**
 * This Class exposes all common methods to handle technical errors.
 *
The scope is to centralize the management of exceptions
 * and make the code more readable.

 * The constants used are the keys of the "jmapper.msg.properties" file present in this package.
 *
 * @author Alessandro Vurro
 *
 */
public final class Error {
	/*
	  ####################################
	  #	   Nested mapping exceptions     #
	  ####################################
	*/

	/**
	 * Thrown when the source field is null in a mapping of nested type.
	 * @param currentField current field
	 * @param destinationClass destination class
	 * @param destinationField destination field
	 * @param sourceClass source class
	 * @param sourceField source field
	 */
	public static void nestedBeanNull(String currentField, String destinationClass, String destinationField, String sourceClass, String sourceField, boolean safeNavigationOperator){
		throw new NestedBeanNullException(MSG.INSTANCE.message(nestedBeanNullException,currentField,destinationClass,destinationField,sourceClass,sourceField), safeNavigationOperator);
	}
	/*
	  ####################################
	  #	   MapperGenerator exceptions    #
	  ####################################
	*/

	public static void absentFactoryAndEmptyConstructor(String destinationClassName){
		throw new AbsentFactoryAndEmptyConstructorException(MSG.INSTANCE.message(absentFactoryAndEmptyConstructorException,destinationClassName));
	}
	/**
	 * Thrown when the explicit conversion method defined has a null pointer.

	 * Used in the generated code, in case of dynamic methods defined.
	 * @param e byteCode library exception
	 * @param methodName method name
	 * @param className class name
	 */
	public static void illegalCode(Exception e, String methodName, String className){
		throw new IllegalCodeException(MSG.INSTANCE.message(nullPointer,methodName,className,e.getClass().getSimpleName(),""+e.getMessage()));
	}
	/**
	 * Thrown when the explicit conversion method defined has a null pointer.

	 * Used in the generated code, in case of dynamic methods defined.
	 * @param e byteCode library exception
	 * @param methodName method name
	 * @param className class name
	 * @param path xml path file
	 */
	public static void illegalCode(Exception e, String methodName, String className, String path){
		throw new IllegalCodeException(MSG.INSTANCE.message(nullPointerPath,methodName,className,path,e.getClass().getSimpleName(),""+e.getMessage()));
	}

	/**
	 * Thrown when the explicit conversion method defined has a null pointer.

	 * Used in the generated code, in case of dynamic methods defined.
	 * @param e byteCode library exception
	 * @param methodName method name
	 * @param className class name
	 * @param content xml path file
	 */
	public static void illegalCodeContent(Exception e, String methodName, String className, String content){
		throw new IllegalCodeException(MSG.INSTANCE.message(nullPointerContent,methodName,className,content,e.getClass().getSimpleName(),""+e.getMessage()));
	}
	/**
	 * Thrown when the code contained in the body method is illegal.
	 * @param method method to adjust
	 * @param additionalInformation additional information relative to the byteCode library exception
	 */
	public static void bodyContainsIllegalCode(Method method, Exception additionalInformation){
		Class<?> clazz = method.getClazz();
		if(isNull(clazz)) clazz = JMapper.class;

		String originalName = method.getOriginalName();
		if(isNull(originalName)) originalName = method.getName();

		String message = clazz != JMapper.class ? MSG.INSTANCE.message(conversionBodyIllegalCode,clazz.getSimpleName(),originalName,""+additionalInformation.getMessage())
				                                : MSG.INSTANCE.message(conversionBodyIllegalCode2,""+additionalInformation.getMessage());

		throw new ConversionBodyIllegalCodeException(message);
	}
	/**
	 * Thrown when byteCode library don't find classes.
	 * @param e exception to handle
	 */
	public static void notFoundException(Exception e){
		throw new MappingException(e.getMessage());
	}

	/*
	  ####################################
	  #	  ConversionAnalyzer exceptions  #
	  ####################################
	*/
	/**
	 * Thrown when the parameters number is incorrect.
	 * @param methodName method name
	 * @param className class name
	 */
	public static void wrongParameterNumber(String methodName, String className){
		throw new ConversionParameterException(MSG.INSTANCE.message(conversionParameterException,methodName,className));
	}
	/**
	 * Thrown when the parameters number is incorrect.
	 * @param methodName method name
	 * @param className class name
	 */
	public static void parametersUsageNotAllowed(String methodName, String className){
		throw new DynamicConversionParameterException(MSG.INSTANCE.message(dynamicConversionParameterException,methodName,className));
	}
	/**
	 * Thrown when the method don't respects the convetions beloging to the dynamic conversion implementation.
	 * @param methodName method name
	 * @param className class name
	 */
	public static void incorrectMethodDefinition(String methodName, String className){
		throw new DynamicConversionMethodException(MSG.INSTANCE.message(dynamicConversionMethodException,methodName,className));
	}
	/**
	 * Thrown when the body method don't respects the convetions beloging to the dynamic conversion implementation.
	 * @param methodName method name
	 * @param className class name
	 */
	public static void incorrectBodyDefinition(String methodName,String className){
		throw new DynamicConversionBodyException(MSG.INSTANCE.message(dynamicConversionBodyException,methodName,className));
	}
	/*
	  ####################################
	  #	    XmlConverter exceptions      #
	  ####################################
	*/
	/**
	 * Thrown if class is present in the xml configuration file but doesn't exist.
	 * @param aClass Class analyzed
	 */
	public static void classInexistent(String aClass){
		throw new XmlMappingClassDoesNotExistException(MSG.INSTANCE.message(xmlMappingClassDoesNotExistException2,aClass));
	}
	/*
	  ####################################
	  #	         XML exceptions          #
	  ####################################
	*/

	/**
	 * Thrown when global mapping is absent from XML configuration file.
	 * @param aClass class
	 */
	public static void xmlGlobalExistent(Class<?> aClass) {
		throw new XmlMappingGlobalExistException(MSG.INSTANCE.message(xmlMappingGlobalExistException, aClass.getSimpleName()));
	}

	/**
	 * Thrown when global mapping is absent from XML configuration file.
	 * @param aClass class
	 */
	public static void xmlGlobalInexistent(Class<?> aClass) {
		throw new XmlMappingGlobalDoesNotExistException(MSG.INSTANCE.message(xmlMappingGlobalDoesNotExistException, aClass.getSimpleName()));
	}
	/**
	 * Thrown when class doesn't exist from XML configuration file.
	 * @param className class name
	 */
	public static void xmlMappingClassDoesNotExist(String className){
		throw new XmlMappingClassDoesNotExistException(MSG.INSTANCE.message(xmlMappingClassDoesNotExistException2,className));
	}

	/**Thrown if attributes isn't present in the xml file.
	 * @param attributeName attribute name
	 * @param aClass class analyzed
	 */
	public static void attributeInexistent(String attributeName, Class<?> aClass){
		throw new IllegalArgumentException(MSG.INSTANCE.message(malformedBeanException2,attributeName,aClass.getSimpleName()));
	}
	/**
	 * Thrown when the class has only one attribute.
	 * @param aClass class analyzed
	 */
	public static void xmlWrongMethod(Class<?> aClass){
		throw new WrongMethodException (MSG.INSTANCE.message(wrongMethodException1,aClass.getSimpleName()));
	}
	/**
	 * Thrown if attribute is present in the xml file.
	 * @param path xml path
	 * @param attributeName attribute present
	 * @param aClass attribute's class
	 */
	public static void xmlAttributeInexistent(String path, String attributeName, Class<?> aClass){
		throw new XmlMappingAttributeDoesNotExistException (MSG.INSTANCE.message(xmlMappingAttributeDoesNotExistException2,attributeName,aClass.getSimpleName(),path));
	}
	/**
	 * Thrown if attribute is present in the xml file.
	 * @param path xml path
	 * @param attribute attribute present
	 * @param aClass attribute's class
	 */
	public static void xmlAttributeExistent(String path, Attribute attribute, Class<?> aClass){
		throw new XmlMappingAttributeExistException (MSG.INSTANCE.message(xmlMappingAttributeExistException2,attribute.getName(),aClass.getSimpleName(),path));
	}
	/**
	 * Thrown if class isn't present in xml file.
	 * @param path xml path
	 * @param aClass Class analyzed
	 */
	public static void xmlClassInexistent(String path, Class<?> aClass){
		throw new XmlMappingClassDoesNotExistException (MSG.INSTANCE.message(xmlMappingClassDoesNotExistException1,path,aClass.getSimpleName()));
	}
	/**
	 * Thrown if class is present in xml file.
	  * @param path xml path
	* @param aClass Class analyzed
	 */
	public static void xmlClassExistent(String path, Class<?> aClass){
		throw new XmlMappingClassExistException (MSG.INSTANCE.message(xmlMappingClassExistException1,aClass.getSimpleName(),path));
	}

	/**
	 * Thrown when the conversion name is undefined.
	 * @param xmlPath xml path
	 * @param className class name
	 */
	public static void xmlConversionNameUndefined(String xmlPath, String className) {
		throw new XmlConversionNameException(MSG.INSTANCE.message(xmlConversionNameException,xmlPath,className));
	}
	/**
	 * Thrown if conversion type is wrong.
	 * @param conversionName conversion name
	 * @param xmlPath xml path
	 * @param className class name
	 * @param type type
	 */
	public static void xmlConversionTypeIncorrect(String conversionName,String xmlPath,String className,String type){
		throw new XmlConversionTypeException(MSG.INSTANCE.message(xmlConversionTypeException,conversionName,xmlPath,className,type));
	}
	/**
	 * Thrown if the use of the parameters is incorrect.
	 * @param conversionName conversion name
	 * @param xmlPath xml path
	 * @param className class name
	 */
	public static void improperUseOfTheParameter(String conversionName,String xmlPath,String className){
		throw new XmlConversionParameterException(MSG.INSTANCE.message(xmlConversionParameterException,conversionName,xmlPath,className));
	}
	/*
	  ####################################
	  #	    	  MSG exceptions         #
	  ####################################
	*/
	/**
	 * @throws LoadingFileException Thrown when the file can't be loaded.
	 */
	public static void unableLoadingFile() throws LoadingFileException{
		throw new LoadingFileException(MSG.INSTANCE.message(loadingFileException2,Constants.MSG_FILE));
	}
	/**
	 * @throws FileNotFoundException Thrown when the file isn't found.
	 */
	public static void fileNotFound() throws FileNotFoundException{
		 throw new FileNotFoundException(MSG.INSTANCE.message(FileNotFoundException2,Constants.MSG_FILE));
	}

	/*
	  ####################################
	  #	         XML exceptions          #
	  ####################################
	*/

	/**
	 *
	 * @param path file path
	 * @throws FileNotFoundException Thrown when the file isn't found.
	 */
	public static void fileNotFound(String path) throws FileNotFoundException{
		throw new FileNotFoundException(MSG.INSTANCE.message(FileNotFoundException1,path));
	}

	/*
	  ####################################
	  #	    OperationHandler exceptions  #
	  ####################################
	*/

	 /**
		 * Thrown when the instruction isn't defined.
		 * @param destinationField destination field
		 * @param destinationClass destination class
		 * @param sourceField source field
		 * @param sourceClass source class
		 */
	public static void undefinedMapping(Field destinationField, Class<?> destinationClass, Field sourceField, Class<?> sourceClass){
		throw new UndefinedMappingException(MSG.INSTANCE.message(undefinedMappingException,destinationField.getName(),destinationClass.getSimpleName(),sourceField.getName(),sourceClass.getSimpleName()));
	}

	/**
	 * Thrown when conversions are badly written.
	 * @param destinationField destination field
	 * @param destinationClass destination class
	 * @param sourceField source field
	 * @param sourceClass source class
	 * @param plus added messages of internal exceptions thrown
	 */
	public static void badConversion(Field destinationField, Class<?> destinationClass, Field sourceField, Class<?> sourceClass,String plus){
		throw new UndefinedMappingException(MSG.INSTANCE.message(undefinedMappingException,destinationField.getName(),destinationClass.getSimpleName(),sourceField.getName(),sourceClass.getSimpleName()) + ". More information: "+plus);
	}

	/*
	  ####################################
	  #	    ClassesManager exceptions    #
	  ####################################
	*/
	/**
	 * Thrown when the bean doesn't respect the javabean conventions.
	 * @param methodType method type
	 * @param methodName name of the method doesn't exist
	 * @param clazz class when this method isn't present
	 */
	public static void customMethod(String methodType,String methodName, Class<?> clazz){
		String completeName = clazz.getCanonicalName();
		String packageName = clazz.getPackage().getName();
		String className = completeName.substring(packageName.length()+1);
		throw new MalformedBeanException(MSG.INSTANCE.message(customMethodException, methodType, methodName,className));
	}

	/**
	 * Thrown when the bean doesn't respect the javabean conventions.
	 * @param methodName name of the method doesn't exist
	 * @param fieldName name of the field analyze
	 * @param clazz class when this method isn't present
	 */
	public static void method(String methodName, String fieldName, Class<?> clazz){
		String completeName = clazz.getCanonicalName();
		String packageName = clazz.getPackage().getName();
		String className = completeName.substring(packageName.length()+1);
		throw new MalformedBeanException(MSG.INSTANCE.message(malformedBeanException3, methodName,fieldName,className));
	}

	/*
	  ####################################
	  #	    ConfigReader exceptions	     #
	  ####################################
	*/

	/**
	 * Thrown when there is an error in the configuration.
	 * @param mappedFieldName name of the mapped field
	 * @param mappedClass mapped field's class
	 * @param targetClass target field's class
	 */
	public static void mapping(String mappedFieldName,Class<?> mappedClass, Class<?> targetClass){
		throw new MappingErrorException(MSG.INSTANCE.message(mappingErrorException2,mappedFieldName,mappedClass.getSimpleName(),targetClass.getSimpleName()));
	}
	/**
	 * Thrown when the length of classes and attribute parameter isn't the same.
	 * @param mappedFieldName name of the mapped field
	 * @param mappedClassName name of the mapped field's class
	 */
	public static void mapping(String mappedFieldName, String mappedClassName){
		throw new MappingErrorException(MSG.INSTANCE.message(mappingErrorException2length,mappedFieldName,mappedClassName));
	}
	/**
	 * Thrown when the target class doesn't exist in classes parameter.
	 * @param mappedFieldName name of the mapped field
	 * @param mappedClassName name of the mapped field's class
	 * @param targetClassName name of the target field's class
	 */
	public static void mapping(String mappedFieldName, String mappedClassName, String targetClassName){
		throw new MappingErrorException(MSG.INSTANCE.message(mappingErrorException3,mappedFieldName,mappedClassName,targetClassName));
	}
	/**
	 * Thrown when the target field doesn't exist.
	 * @param mappedFieldName name of the mapped field
	 * @param mappedClassName name of the mapped field's class
	 * @param targetFieldName name of the target field
	 * @param targetClassName name of the target field's class
	 */
	public static void mapping(String mappedFieldName, String mappedClassName, String targetFieldName, String targetClassName){
		throw new MappingErrorException(MSG.INSTANCE.message(mappingErrorException4,mappedFieldName,mappedClassName, targetFieldName,targetClassName));
	}

	/**
	 * Thrown when the target field doesn't exist.
	 * @param targetFieldName name of the target field
	 * @param targetClassName name of the target field's class
	 */
	public static void inexistentField(String targetFieldName, String targetClassName){
		throw new MappingErrorException(MSG.INSTANCE.message(mappingErrorException5, targetFieldName, targetClassName));
	}
	/**
	 * Thrown if the attribute doesn't exist in aClass.
	 * @param aClass class that not contains aField
	 * @param aField the missing field
	 */
	public static void attributeAbsent(Class<?> aClass,Attribute aField){
		throw new XmlMappingAttributeDoesNotExistException(MSG.INSTANCE.message(xmlMappingAttributeDoesNotExistException2,aField.getName(),aClass.getSimpleName(),"API"));
	}

	/*
	  ####################################
	  #	   MapperConstructor exceptions	 #
	  ####################################
	*/
	/**
	 * Thrown when the xml configuration doesn't contains the classes configuration.
	 * @param destination destination class name
	 * @param source source class name
	 * @param xml xml path
	 */
	public static void configNotPresent(Class<?> destination,Class<?> source,XML xml){
		throw new MappingNotFoundException(MSG.INSTANCE.message(Constants.mappingNotFoundException2path,destination.getSimpleName(), source.getSimpleName(),xml.getXmlPath()));
	}
	/**
	 * Thrown when missing the configuration belonging to clazz.
	 * @param clazz class without configuration
	 * @param xml xml path
	 */
	public static void configNotPresent(Class<?> clazz,XML xml){
		throw new MappingNotFoundException(MSG.INSTANCE.message(Constants.mappingNotFoundException1path, clazz.getSimpleName(),xml.getXmlPath()));
	}
	/**
	 * Thrown when the xml configuration doesn't exist.
	 * @param destination destination class name
	 * @param source source class name
	 */
	public static void classesNotConfigured(Class<?> destination,Class<?> source){
		throw new MappingNotFoundException(MSG.INSTANCE.message(Constants.mappingNotFoundException2,destination.getSimpleName(), source.getSimpleName()));
	}
	/**
	 * Thrown when the xml configuration of the clazz doesn't exist.
	 * @param clazz class to check
	 */
	public static void classNotConfigured(Class<?> clazz){
		throw new MappingNotFoundException(MSG.INSTANCE.message(Constants.mappingNotFoundException1, clazz.getSimpleName()));
	}
	/*
	  ####################################
	  #	  RelationalJMapper exceptions	 #
	  ####################################
	*/

	/**
	 * Thrown if the configured class hasn't classes parameter.
	 * @param aClass class's field
	 */
	public static void globalClassesAbsent(Class<?> aClass){
		throw new MappingErrorException(MSG.INSTANCE.message(mappingErrorRelationalException3, aClass.getSimpleName()));
	}
	/**
	 * Thrown if the configured field hasn't classes parameter.
	 * @param fieldName name of the field
	 * @param aClass class's field
	 */
	public static void classesAbsent(String fieldName,Class<?> aClass){
		throw new MappingErrorException(MSG.INSTANCE.message(mappingErrorRelationalException2,fieldName, aClass.getSimpleName()));
	}
	/**
	 * Thrown if the class isn't mapped.
	 * @param aClass class to analyze
	 */
	public static void classNotMapped(Class<?> aClass){
		throw new ClassNotMappedException(MSG.INSTANCE.message(classNotMappedException1,aClass.getSimpleName()));
	}
	/**
	 * Thrown if the sourceClass isn't mapped in configuredClass.
	 * @param sourceClass class absent
	 * @param configuredClass class that not contains sourceClass
	 */
	public static void classNotMapped(Object sourceClass, Class<?> configuredClass){
		String sourceName = sourceClass instanceof Class?((Class<?>)sourceClass).getSimpleName():sourceClass.getClass().getSimpleName();
		throw new ClassNotMappedException(MSG.INSTANCE.message(classNotMappedException2,sourceName, configuredClass.getSimpleName()));
	}

	/*
	  ####################################
	  #		JMapper exceptions			 #
	  ####################################
	*/
	/**
	 * Thrown when there is an error in mapper generated class.
	 * @param destination destination class
	 * @param source source class
	 * @param path xml path configuration
	 * @param e exception captured
	 */
	public static void illegalCode(Class<?> destination, Class<?> source, String path, Throwable e){
		String additionalInformation = e.getMessage().split(",")[1];
		throw new IllegalCodeException(MSG.INSTANCE.message(illegalCodePath,destination.getSimpleName(),source.getSimpleName(),path,additionalInformation));
	}
	/**
	 * Thrown when there is an error in mapper generated class.
	 * @param destination destination class
	 * @param source source class
	 * @param e exception captured
	 */
	public static void illegalCode(Class<?> destination, Class<?> source, Throwable e){
		String additionalInformation = e.getMessage().split(",")[1];
		throw new IllegalCodeException(MSG.INSTANCE.message(illegalCode,destination.getSimpleName(),source.getSimpleName(),additionalInformation));
	}
	/**
	 * Thrown when there isn't correspondence between classes.
	 * @param configuredClass configured class
	 * @param targetClass target class
	 */
	public static void absentRelationship(Class<?> configuredClass, Class<?> targetClass){
		throw new AbsentRelationshipException(MSG.INSTANCE.message(noRelationshipException,configuredClass.getSimpleName(),targetClass.getSimpleName()));
	}
	/**
	 * Thrown if the class is null.
	 * @param className name of the class
	 */
	public static void nullMappedClass(String className){
		throw new NullMappedClassException(MSG.INSTANCE.message(nullMappedClassException1,className));
	}

	/**
	 * Thrown if the class is an interface.
	 * @param className name of the class
	 */
	public static void interfaceClass(String className){
		throw new IllegalArgumentException(MSG.INSTANCE.message(illegalArgumentException1,className));
	}

	/**
	 * Thrown if the class haven't an empty constructor.
	 * @param aClass class to analyze
	 */
	public static void emptyConstructorAbsent(Class<?> aClass){
		throw new MalformedBeanException(MSG.INSTANCE.message(malformedBeanException1,aClass.getSimpleName()));
	}

	/**
	 *
	 * @param path file path
	 * @throws FileNotFoundException Thrown when the xml isn't found.
	 */
	public static void xmlNotFound(String path) throws FileNotFoundException{
		throw new FileNotFoundException(MSG.INSTANCE.message(FileNotFoundException3,path));

	}

	/**
	 * @param configuredClass configured class
	 * @param configuredField configured field
	 * @param targetClass target class
	 * @param targetFieldName invalid nested mapping path
	 * @param moreInfo more information
	 */
	public static void invalidNestedMapping(Class<?> configuredClass, Field configuredField, Class<?> targetClass, String targetFieldName, String moreInfo) {
		throw new InvalidNestedMappingException(MSG.INSTANCE.message(InvalidNestedMappingException, configuredClass.getSimpleName(), configuredField.getName(), targetClass.getSimpleName(), targetFieldName, moreInfo));
	}

}


text:
#ifndef	_SYS_EVENTFD_H
# error "Never use <bits/eventfd.h> directly; include <sys/eventfd.h> instead."
#endif

/* Flags for eventfd.  */
enum
  {
    EFD_SEMAPHORE = 00000001,
#define EFD_SEMAPHORE EFD_SEMAPHORE
    EFD_CLOEXEC = 02000000,
#define EFD_CLOEXEC EFD_CLOEXEC
    EFD_NONBLOCK = 00000200
#define EFD_NONBLOCK EFD_NONBLOCK
  };

redpajama_set_name: RedPajamaGithub


text:
package ch.ntb.inf.deep.comp.hosttest.testClasses.interfaceTest;

public interface Ig3 extends If2 {
	public void img31();
}


text:
@class Room;

@protocol RoomDelegate

- (void) displayChatMessage:(NSString*)message fromUser:(NSString*)userName;
- (void) roomTerminated:(id)room reason:(NSString*)string;

@end


text:
<?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="false"
         backupStaticAttributes="false"
         colors="true"
         convertErrorsToExceptions="true"
         convertNoticesToExceptions="true"
         convertWarningsToExceptions="true"
         processIsolation="false"
         stopOnFailure="true"
         syntaxCheck="true">
    <testsuites>
        <testsuite name="Application Test Suite">
            <directory>./tests/</directory>
        </testsuite>
    </testsuites>
    <filter>
        <whitelist>
            <directory suffix=".php">src/</directory>
        </whitelist>
    </filter>
    <php>
        <env name="APP_ENV" value="testing"/>
        <env name="APP_DEBUG" value="true"/>
        <env name="APP_KEY" value="AckfSECXIvnK5r28GVIWUAxmbBSjTsmF"/>
        <env name="DB_CONNECTION" value="sqlite"/>
        <env name="DB_DATABASE" value=":memory:"/>
        <env name="CACHE_DRIVER" value="array"/>
        <env name="SESSION_DRIVER" value="array"/>
        <env name="QUEUE_DRIVER" value="sync"/>
    </php>
</phpunit>


text:
ACCEPTED

#### According to
International Plant Names Index

#### Published in
J. D. Hooker, Fl. British India 1:266. 1874

#### Original name
null

### Remarks
null


text:
class AddTokenHashesToAuthieSessions < ActiveRecord::Migration
  def change
  end
end


text:
<?php
/**
 * the adapter for our database connection
 *
 * PHP version >=5.3
 *
 * @package Mvc\Db
 * @author  dknx01 <e.witthauer@gmail.com>
 */

namespace Mvc\Db;
use \PDO as PDO;
use \Mvc\Config as Config;

class Adapter extends PDO
{
    /**
     * the generated dsn
     * @var string
     */
    protected $dsn = '';
    /**
     * the database connection parameters
     * @var array
     */
    protected $params = array();

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

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

    /**
     * @var boolean
     */
    private $active;

    /**
     * the constructor
     */
    public function __construct()
    {
        $this->init();
        if ($this->active == true) {
            parent::__construct($this->dsn, $this->user, $this->password);
            $this->proccedParams();
        }
    }
    /**
     * procces all parameters
     */
    protected function proccedParams()
    {
        foreach ($this->params as $key => $value) {
            $stmt =  $stmt = 'SET ' . $this->quote($key) . ' '
                                . $this->quote($value);
            $this->exec($stmt);
        }
    }
    /**
     * prepare a new connection based on the configuration file
     */
    protected function init()
    {
        $configParser = new Config\ParseConfig();
        /**
         * @var \Mvc\Config\Definition\Config
         */
        $config = $configParser->getConfigData();
        $this->active = $config->getDatabaseStatus();
        if ($this->active == true) {
            $this->params = $config->getDatabaseParams();
            if ($config->getDatabaseType() == 'sqlite') {
                $this->dsn = 'sqlite:' . $config->getDatabasePath();
            } else {
                $this->dsn = $config->getDatabaseType()
                    . ':host=' . $config->getDatabaseHost() . ';'
                    . 'dbname=' . $config->getDatabaseName();
                $this->user = $config->getDatabaseUser();
                $this->password = $config->getDatabasePassword();
                $this->params = $config->getDatabaseParams();
            }
        }
    }
}


text:
namespace Sass {

  struct Backtrace;

  struct Error_Invalid {
    enum Type { read, write, syntax, evaluation };

    Type type;
    ParserState pstate;
    std::string message;

    Error_Invalid(Type type, ParserState pstate, std::string message);

  };

  void warn(std::string msg, ParserState pstate);
  void warn(std::string msg, ParserState pstate, Backtrace* bt);

  void deprecated_function(std::string msg, ParserState pstate);
  void deprecated(std::string msg, std::string msg2, ParserState pstate);
  void deprecated_bind(std::string msg, ParserState pstate);
  // void deprecated(std::string msg, ParserState pstate, Backtrace* bt);

  void error(std::string msg, ParserState pstate);
  void error(std::string msg, ParserState pstate, Backtrace* bt);

}

#endif


text:
package connect.ui.activity.set;

import android.app.Activity;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.LinearLayout;

import java.util.List;

import butterknife.Bind;
import butterknife.ButterKnife;
import butterknife.OnClick;
import connect.db.SharedPreferenceUtil;
import connect.ui.activity.R;
import connect.ui.activity.home.HomeActivity;
import connect.ui.activity.login.bean.UserBean;
import connect.ui.base.BaseActivity;
import connect.ui.base.BaseApplication;
import connect.utils.ActivityUtil;
import connect.view.TopToolBar;

/**
 * Closed, open, change the gesture
 */
public class PatternActivity extends BaseActivity {

    @Bind(R.id.toolbar_top)
    TopToolBar toolbarTop;
    @Bind(R.id.patter_password_iv)
    ImageView patterPasswordIv;
    @Bind(R.id.changepatter_ll)
    LinearLayout changepatterLl;
    @Bind(R.id.next_btn)
    Button nextBtn;

    private PatternActivity mActivity;
    private UserBean userBean;
    public static final String LOGIN_STYPE = "login";
    public static final String SET_STYPE = "set";
    private String type;

    public static void startActivity(Activity activity, String type) {
        Bundle bundle = new Bundle();
        bundle.putString("type", type);
        ActivityUtil.next(activity, PatternActivity.class, bundle);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_set_pattern);
        ButterKnife.bind(this);
    }

    @Override
    protected void onStart() {
        super.onStart();
        initView();
    }

    @Override
    public void initView() {
        mActivity = this;
        toolbarTop.setBlackStyle();
        toolbarTop.setTitle(null, R.string.Set_Pattern_Password);
        Bundle bundle = getIntent().getExtras();
        toolbarTop.setLeftImg(R.mipmap.back_white);
        type = bundle.getString("type");

        userBean = SharedPreferenceUtil.getInstance().getUser();
        if (type.equals(LOGIN_STYPE)) {
            nextBtn.setVisibility(View.VISIBLE);
            if(!TextUtils.isEmpty(userBean.getSalt())){
                List<Activity> list = BaseApplication.getInstance().getActivityList();
                for (Activity activity : list) {
                    if (!activity.getClass().getName().equals(PatternActivity.class.getName())){
                        activity.finish();
                    }
                }
                HomeActivity.startActivity(mActivity);
                mActivity.finish();
            }
        }

        if (TextUtils.isEmpty(userBean.getSalt())) {
            patterPasswordIv.setImageResource(R.mipmap.switch_off);
            changepatterLl.setVisibility(View.GONE);
        } else {
            patterPasswordIv.setImageResource(R.mipmap.switch_on);
            changepatterLl.setVisibility(View.VISIBLE);
        }
    }

    @OnClick(R.id.next_btn)
    void goNext(View view) {
        UserBean userBean = SharedPreferenceUtil.getInstance().getUser();
        userBean.setBack(true);
        SharedPreferenceUtil.getInstance().putUser(userBean);

        List<Activity> list = BaseApplication.getInstance().getActivityList();
        for (Activity activity : list) {
            if (!activity.getClass().getName().equals(PatternActivity.class.getName())){
                activity.finish();
            }
        }
        HomeActivity.startActivity(mActivity);
        mActivity.finish();
    }

    @OnClick(R.id.left_img)
    void goback(View view) {
        ActivityUtil.goBack(mActivity);
    }

    @OnClick(R.id.changepatter_ll)
    void goChangePatter(View view) {
        PatterDrawActivity.startActivity(mActivity, PatterDrawActivity.TYPE_CHANGE, userBean.getSalt());
    }

    @OnClick(R.id.patter_password_iv)
    void goDrawPatter(View view) {
        if (TextUtils.isEmpty(userBean.getSalt())) {
            PatterDrawActivity.startActivity(mActivity, PatterDrawActivity.TYPE_NEW, "");
        } else {
            PatterDrawActivity.startActivity(mActivity, PatterDrawActivity.TYPE_CLOSE, userBean.getSalt());
        }
    }

}


text:
PYOCD_FLASHTOOL=${PYOCD_FLASHTOOL:-pyocd-flashtool}
PYOCD_GDBSERVER=${PYOCD_GDBSERVER:-pyocd-gdbserver}
BIN_NAME=${O}/${KERNEL_BIN_NAME}
ELF_NAME=${O}/${KERNEL_ELF_NAME}
GDB_PORT=${GDB_PORT:-3333}

test_config() {
    if ! which ${PYOCD_FLASHTOOL} >/dev/null 2>&1; then
        echo "Error: Unable to locate pyOCD flash tool: ${PYOCD_FLASHTOOL}"
        exit 1
    fi
    if ! which ${PYOCD_GDBSERVER} >/dev/null 2>&1; then
        echo "Error: Unable to locate pyOCD GDB server: ${PYOCD_GDBSERVER}"
        exit 1
    fi
}

test_bin() {
    if [ ! -f "${BIN_NAME}" ]; then
        echo "Error: Unable to locate image binary: ${BIN_NAME}"
        exit 1
    fi
}

do_flash() {
    test_config
    test_bin

    # flash device with specified image
    echo "Flashing Target Device"
    ${PYOCD_FLASHTOOL} -t ${PYOCD_TARGET} ${BIN_NAME}
}

do_debug() {
    do_debugserver 1 &

    # connect to the GDB server
    ${GDB} ${TUI} ${ELF_NAME} \
	-ex "target remote :${GDB_PORT}" \
	-ex 'load' \
	-ex 'monitor reset halt'
}

do_debugserver() {
    test_config

    # Calling with an arg will result in setsid being used, which will prevent
    # Ctrl-C in GDB from killing the server. The server automatically exits
    # when the remote GDB disconnects.
    if [ -n "$1" ]; then
        SETSID=/usr/bin/setsid
    else
        SETSID=
    fi
    echo "pyOCD GDB server running on port ${GDB_PORT}"
    ${SETSID} ${PYOCD_GDBSERVER} -p ${GDB_PORT} -t ${PYOCD_TARGET}
}

CMD="$1"
shift

case "${CMD}" in
  flash)
    do_flash "$@"
    ;;
  debugserver)
    do_debugserver "$@"
    ;;
  debug)
    do_debug "$@"
    ;;
esac


text:
package com.huawei.streaming.cql.semanticanalyzer.parsecontextwalker;

import com.huawei.streaming.cql.semanticanalyzer.parser.context.AtomExpressionContext;
import com.huawei.streaming.cql.semanticanalyzer.parser.context.FieldExpressionContext;
import com.huawei.streaming.cql.semanticanalyzer.parser.context.ParseContext;

/**
 * 判断是否是独立的propertyvalue表达式
 * 1:每次计算的表达式字符串值都相等,直到fieldExpression为止
 * 2、fieldExpression且column不为空
 *
 */
public class PropertyValueExpressionWalker implements ParseContextWalker
{
    private String expString;

    private String columnName;

    /**
     * {@inheritDoc}
     */
    @Override
    public boolean walk(ParseContext parseContext)
    {
        setExpressionStr(parseContext);

        if (!expString.equals(parseContext.toString().trim()))
        {
            return false;
        }

        return walkFieldExpressionContext(parseContext);
    }

    private boolean walkFieldExpressionContext(ParseContext parseContext)
    {
        if (!(parseContext instanceof FieldExpressionContext))
        {
            return false;
        }

        FieldExpressionContext fContext = (FieldExpressionContext)parseContext;

        if (!(fContext.getAtomExpression() instanceof AtomExpressionContext))
        {
            return false;
        }

        AtomExpressionContext atom = (AtomExpressionContext)fContext.getAtomExpression();
        if (atom.getColumnName() == null)
        {
            return false;
        }

        columnName = atom.getColumnName();
        return true;
    }

    private void setExpressionStr(ParseContext parseContext)
    {
        if (expString == null)
        {
            expString = parseContext.toString().trim();
        }
    }

    public String getColumnName()
    {
        return columnName;
    }
}


text:
package org.arquillian.smart.testing.spi;

import java.util.Collection;
import org.arquillian.smart.testing.TestSelection;

public interface TestExecutionPlanner {

    //tag::documentation[]
    Collection<TestSelection> selectTestsFromNames(Iterable<String> testsToRun);

    Collection<TestSelection> selectTestsFromClasses(Iterable<Class<?>> testsToRun);
    //end::documentation[]

    String getName();

}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Stud. Mycol. 50(1): 67 (2004)

#### Original name
Melanospora singaporensis Morinaga, Minoura & Udagawa

### Remarks
null


text:
package org.docksidestage.app.web.wx.appex;

import java.util.stream.Stream;

import javax.annotation.Resource;

import org.docksidestage.app.web.base.FortressBaseAction;
import org.docksidestage.mylasta.action.FortressMessages;
import org.lastaflute.core.exception.LaApplicationMessage;
import org.lastaflute.core.json.JsonManager;
import org.lastaflute.core.message.UserMessage;
import org.lastaflute.core.message.exception.MessagingApplicationException;
import org.lastaflute.web.Execute;
import org.lastaflute.web.login.AllowAnyoneAccess;
import org.lastaflute.web.response.JsonResponse;
import org.lastaflute.web.ruts.process.ActionRuntime;

/**
 * @author jflute
 */
@AllowAnyoneAccess
public class WxAppexMessageJsonAction extends FortressBaseAction {

    @Resource
    private JsonManager jsonManager;

    @Override
    protected Object[] filterApplicationExceptionMessageValues(ActionRuntime runtime, LaApplicationMessage msg) {
        return Stream.of(msg.getValues()).map(vl -> jsonManager.toJson(vl)).toArray();
    }

    // http://localhost:8151/fortress/wx/appex/message/json/
    @Execute
    public JsonResponse<String> index() {
        throw new MessagingApplicationException("none",
                createMessages().addWhiteboxMessageValuesIndexed(GLOBAL, "mystic", "onaman", "angel"));
    }

    // http://localhost:8151/fortress/wx/appex/message/json/direct/
    @Execute
    public JsonResponse<String> direct() {
        FortressMessages messages = createMessages();
        messages.add(GLOBAL, new UserMessage(FortressMessages.WHITEBOX_MESSAGE_VALUES_INDEXED, "mystic", 3));
        throw new MessagingApplicationException("none", messages);
    }

    // http://localhost:8151/fortress/wx/appex/message/json/novalues/
    @Execute
    public JsonResponse<String> novalues() {
        throw new MessagingApplicationException("none", createMessages().addErrorsAppDbAlreadyDeleted(GLOBAL));
    }
}


text:
package org.apache.avro.file;

import java.io.IOException;
import java.io.EOFException;
import java.io.InputStream;
import java.io.File;

import org.apache.avro.io.DecoderFactory;
import org.apache.avro.io.DatumReader;
import static org.apache.avro.file.DataFileConstants.SYNC_SIZE;

/** Random access to files written with {@link DataFileWriter}.
 * @see DataFileWriter
 */
public class DataFileReader<D> extends DataFileStream<D> {
  private SeekableInputStream sin;
  private long blockStart;

  /** Construct a reader for a file. */
  public DataFileReader(File file, DatumReader<D> reader) throws IOException {
    this(new SeekableFileInput(file), reader);
  }

  /** Construct a reader for a file. */
  public DataFileReader(SeekableInput sin, DatumReader<D> reader)
    throws IOException {
    super(reader);
    this.sin = new SeekableInputStream(sin);
    initialize(this.sin);
  }

  /** Move to a specific, known synchronization point, one returned from {@link
   * DataFileWriter#sync()} while writing.  If synchronization points were not
   * saved while writing a file, use {#sync(long)} instead. */
  public void seek(long position) throws IOException {
    sin.seek(position);
    vin = DecoderFactory.defaultFactory().createBinaryDecoder(this.sin, vin);
    blockRemaining = 0;
    blockStart = position;
  }

  /** Move to the next synchronization point after a position. To process a
   * range of file entires, call this with the starting position, then check
   * {@link #pastSync(long)} with the end point before each call to {@link
   * #next()}. */
  public void sync(long position) throws IOException {
    seek(position);
    try {
      int i=0, b;
      InputStream in = vin.inputStream();
      vin.readFixed(syncBuffer);
    do {
      int j = 0;
      for (; j < SYNC_SIZE; j++) {
        if (sync[j] != syncBuffer[(i+j)%SYNC_SIZE])
          break;
      }
      if (j == SYNC_SIZE) {                       // matched a complete sync
        blockStart = position + i + SYNC_SIZE;
        return;
      }
      b = in.read();
      syncBuffer[i++%SYNC_SIZE] = (byte)b;
    } while (b != -1);
    } catch (EOFException e) {
      // fall through
    }
    // if no match or EOF set start to the end position
      blockStart = sin.tell();
    //System.out.println("block start location after EOF: " + blockStart );
      return;
  }

  @Override
  protected void blockFinished() throws IOException {
    blockStart = sin.tell() - vin.inputStream().available();
  }

  /** Return true if past the next synchronization point after a position. */
  public boolean pastSync(long position) throws IOException {
    return ((blockStart >= position+SYNC_SIZE)||(blockStart >= sin.length()));
  }

  private static class SeekableInputStream extends InputStream
  implements SeekableInput {
    private final byte[] oneByte = new byte[1];
    private SeekableInput in;

    SeekableInputStream(SeekableInput in) throws IOException {
        this.in = in;
      }

    @Override
    public void seek(long p) throws IOException {
      if (p < 0)
        throw new IOException("Illegal seek: " + p);
      in.seek(p);
      }

    @Override
    public long tell() throws IOException {
      return in.tell();
    }

    @Override
    public long length() throws IOException {
      return in.length();
    }

    @Override
    public int read(byte[] b) throws IOException {
      return in.read(b, 0, b.length);
      }

    @Override
    public int read(byte[] b, int off, int len) throws IOException {
      return in.read(b, off, len);
    }

    @Override
    public int read() throws IOException {
      int n = read(oneByte, 0, 1);
      if (n == 1) {
        return oneByte[0] & 0xff;
      } else {
        return n;
    }
    };

    @Override
    public long skip(long skip) throws IOException {
      long position = in.tell();
      long length = in.length();
      long remaining = length - position;
      if (remaining > skip) {
        in.seek(skip);
        return in.tell() - position;
      } else {
        in.seek(remaining);
        return in.tell() - position;
    }
  }

    @Override
    public int available() throws IOException {
      long remaining = (in.length() - in.tell());
      return (remaining > Integer.MAX_VALUE) ? Integer.MAX_VALUE
          : (int) remaining;
    }
  }
}


text:
using System.Reflection;

[assembly: AssemblyTitle("Microsoft Azure Key Vault WebKey")]
[assembly: AssemblyDescription("Microsoft Azure Key Vault WebKey Class Library.")]

[assembly: AssemblyVersion("2.0.0.0")]
[assembly: AssemblyFileVersion("2.0.0.0")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Microsoft")]
[assembly: AssemblyProduct("Azure .NET SDK")]
[assembly: AssemblyCopyright("Copyright (c) Microsoft Corporation")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]


text:
FROM rcook/rails-nginx-unicorn
MAINTAINER Richard Cook <rcook@rcook.org>

EXPOSE 80


text:
#include <errno.h>
#include <fcntl.h>
#include <stdlib.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <getopt.h>

#define LOG_TAG "bdAddrLoader"

#include <cutils/log.h>
#include <cutils/properties.h>

#define FILE_PATH_MAX   100
#define BD_ADDR_LEN  6
#define BD_ADDR_STR_LEN 18

#define ARG_TYPE_PATH_FILE  0x11
#define ARG_TYPE_PATH_PROP  0x12

#define ARG_TYPE_DATA_HEX   0x21
#define ARG_TYPE_DATA_ASCII 0x22

typedef struct _ArgEl
{
   const char *szSrc;    // Source Path
   int nPathType;        // Type of Source Path
   int nDataType;        // Type of Data
}ArgEl;

typedef ArgEl InArg;

#define DEFAULT_BDADDR_PROP "persist.service.bdroid.bdaddr"

typedef struct _OutArg
{
   ArgEl dest;
   char  cSeperator;    // a character to be used for sperating like ':' of "XX:XX:XX:XX:XX:XX"
   char  bPrintOut;     // Print out bd addr in standard out or not
}OutArg;

typedef struct _LoadedData
{
    union {
       unsigned char bin[BD_ADDR_LEN];
       char sz[BD_ADDR_STR_LEN];
    }data;
    int nDataType;
}LoadedBDAddr;

typedef enum _res
{
    SUCCESS = 0,
    FAIL
}Res;

int hexa_to_ascii(const unsigned char* hexa, char* ascii, int nHexLen)
{
    int i, j;
    char hex_table[] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
                'A', 'B', 'C', 'D', 'E', 'F'};

    for (i = 0, j = 0; i <nHexLen; i++, j += 2) {
        ascii[j] = hex_table[hexa[i] >> 4];
        ascii[j + 1] = hex_table[hexa[i] & 0x0F];
    }

    ascii[nHexLen*2] = '\0';

    ALOGI("hex_to_ascii() - converted Data (%s)", ascii);

    return SUCCESS;
}

int readBDAddrData(const char* szFilePath, unsigned char* addrData, int nDataLen)
{
    int nFd, nRdCnt;

    nFd = open(szFilePath, O_RDONLY);

    if(nFd < 0){
        ALOGW("There is no Address File in FTM area : %s\n", szFilePath);
        return FAIL;
    }

    nRdCnt = read(nFd, addrData, nDataLen);
    if(nRdCnt != nDataLen){
        ALOGE("Fail to read Address data from FTM area\n");
        close(nFd);
        return FAIL;
    }
    close(nFd);
    return SUCCESS;
}

void formattingBdAddr(char *szBDAddr, const char cSep)
{
    int i=1, j=0;
    int pos=0;
    for(i=1; i<BD_ADDR_LEN; i++){
       pos = strlen(szBDAddr);
       for(j=0; j<(BD_ADDR_LEN*2)-i*2; j++){
          szBDAddr[pos-j] = szBDAddr[pos-j-1];
       }
       szBDAddr[pos-j]=cSep;
    }
}

int readBDAddr(InArg inArg, LoadedBDAddr *loadedBDAddr)
{
    Res res = FAIL;
    unsigned char addrData[BD_ADDR_LEN] = {0,};
    int nDataLen = 0;

    ALOGI("Read From %s by Path type(0x%2x), Data type (0x%2x)", inArg.szSrc, inArg.nPathType, inArg.nDataType);

    if(inArg.nPathType == ARG_TYPE_PATH_FILE){
        switch(inArg.nDataType){
            case ARG_TYPE_DATA_HEX:
                if(!readBDAddrData(inArg.szSrc, loadedBDAddr->data.bin, BD_ADDR_LEN)){
                    loadedBDAddr->nDataType = ARG_TYPE_DATA_HEX;
                    return SUCCESS;
                }
                break;
            case ARG_TYPE_DATA_ASCII:
               if(!readBDAddrData(inArg.szSrc, (unsigned char *)loadedBDAddr->data.sz, BD_ADDR_STR_LEN)){
                    loadedBDAddr->nDataType = ARG_TYPE_DATA_ASCII;
                    return SUCCESS;
                }
                break;
            default:
                return FAIL;
        }
    }else if(inArg.nPathType == ARG_TYPE_PATH_PROP){
        switch(inArg.nDataType){
            case ARG_TYPE_DATA_HEX:
                if(property_get(inArg.szSrc, (char *)loadedBDAddr->data.bin, "")>=0){
                    loadedBDAddr->nDataType = ARG_TYPE_DATA_HEX;
                    return SUCCESS;
                }
                break;
            case ARG_TYPE_DATA_ASCII:
                if(property_get(inArg.szSrc, loadedBDAddr->data.sz, "")>=0){
                    loadedBDAddr->nDataType = ARG_TYPE_DATA_ASCII;
                    return SUCCESS;
                }
                break;
            default:
                return FAIL;
        }
    }else{
        ALOGE("Error invalid argument : (%d)", inArg.nPathType);
    }

    ALOGE("Fail to read BDAddr from %s", inArg.szSrc);
    return FAIL;
}

int writeBDAddr(OutArg outArg, LoadedBDAddr *loadedBDAddr)
{
    char szTmp[BD_ADDR_STR_LEN] = {0,};

    ALOGI("Output Data type(0x%2x), bPrintout(%d), bPath(%s)",
        outArg.dest.nDataType, outArg.bPrintOut, outArg.dest.szSrc);

    ALOGI("Loaded Data type(0x%2x)", loadedBDAddr->nDataType);

    if(outArg.dest.nDataType == ARG_TYPE_DATA_ASCII
        && loadedBDAddr->nDataType == ARG_TYPE_DATA_HEX
    ){
        if(!hexa_to_ascii(loadedBDAddr->data.bin, szTmp, BD_ADDR_LEN)){
            memcpy(loadedBDAddr->data.sz, szTmp, BD_ADDR_STR_LEN);
            loadedBDAddr->nDataType = ARG_TYPE_DATA_ASCII;
        }
        else{
            ALOGE("Fail to convert data");
            return FAIL;
        }
    }

    if(loadedBDAddr->nDataType == ARG_TYPE_DATA_ASCII){
       // check out which addr data is already formated
       if(strchr(loadedBDAddr->data.sz, '.') == NULL
         && strchr(loadedBDAddr->data.sz, ':') == NULL
       ){
           formattingBdAddr(loadedBDAddr->data.sz, outArg.cSeperator);
       }
    }
    // print out szBDAddr
    if(outArg.bPrintOut
        && loadedBDAddr->nDataType == ARG_TYPE_DATA_ASCII
        && strlen(loadedBDAddr->data.sz)==(BD_ADDR_STR_LEN-1)) {
       printf("%s",loadedBDAddr->data.sz);
       if (property_set(DEFAULT_BDADDR_PROP, loadedBDAddr->data.sz) < 0)
           ALOGE("Failed to set address in prop %s", DEFAULT_BDADDR_PROP);
    }
    else{
       ALOGE("Invalid Data is loaded : %s", loadedBDAddr->data.sz);
       return FAIL;
    }
    // TODO :: writing File or Property
    return SUCCESS;
}

int main(int argc, char *argv[])
{
    int nFd, nRdCnt;
    int c;

    InArg inArg;
    OutArg outArg;
    LoadedBDAddr loadedBDAddr;

    //initialize arg
    memset(&inArg, 0, sizeof(InArg));
    memset(&outArg, 0, sizeof(OutArg));
    memset(&loadedBDAddr, 0, sizeof(LoadedBDAddr));

    //load args;
    while((c=getopt(argc, argv, ":f:p:hsx")) != -1){
        switch(c){
            case 'f': // input path
                if(optarg != NULL){
                    ALOGI("option : f=%s", optarg);
                    inArg.szSrc = optarg;
                }else{
                    ALOGW("Invalid Argument(%s) of input path", optarg);
                }
                inArg.nPathType = ARG_TYPE_PATH_FILE;
                break;
            case 'p': // output path
                if(optarg != NULL){
                    ALOGI("option : p=%s", optarg);
                    inArg.szSrc = optarg;
                }else{
                    ALOGW("Invalid Argument(%s) of out Path", optarg);
                }
                inArg.nPathType = ARG_TYPE_PATH_PROP;
                break;
            case 'h': // data type to be read is hex
                ALOGI("option : h");
                inArg.nDataType = ARG_TYPE_DATA_HEX;
                break;
            case 's': // data type to be read is ascii
                ALOGI("option : s");
                inArg.nDataType = ARG_TYPE_DATA_ASCII;
                break;
            case 'x':
                ALOGI("option : x");
                outArg.bPrintOut = 1; //true
                break;
            default:
                ALOGW("Unknown option : %c", c);
                break;
        }
    }

    // setting up Arguments with default value
    outArg.cSeperator = ':';
    outArg.dest.nDataType = ARG_TYPE_DATA_ASCII;

    // load bd addr and print out bd addr in formated ascii
    if(readBDAddr(inArg, &loadedBDAddr)){
        ALOGE("Fail to load data !!");
        return FAIL;
    }

    if(writeBDAddr(outArg, &loadedBDAddr)){
        ALOGE("Fail to write data !!");
        return FAIL;
    }

    return 1;
}


text:
Psyrun
======

.. image:: https://travis-ci.org/jgosmann/psyrun.svg?branch=master
    :target: https://travis-ci.org/jgosmann/psyrun

.. image:: https://coveralls.io/repos/github/jgosmann/psyrun/badge.svg?branch=master
    :target: https://coveralls.io/github/jgosmann/psyrun?branch=master

Psyrun is a Python_ tool to define parameter spaces
and execute an evaluation function for each parameter assignment. In addition
Psyrun makes it easy to use serial farming, i.e. evaluating multiple parameter
assignments in parallel, on a multicore computers and high-performance clusters.

Documentation
-------------

`The documentation can be found here.
<http://psyrun.readthedocs.io/en/latest/>`_

Overview
--------

Define parameter spaces and evaluate them:

.. code-block:: python

    from psyrun import map_pspace, Param

    def objective(a, b, c):
        return a * b + c

    pspace = (Param(a=np.arange(1, 5))
              * Param(b=np.linspace(0, 1, 10))
              * Param(c=[1., 1.5, 10., 10.5]))
    results = map_pspace(objective, pspace)

Or do it in parallel:

.. code-block:: python

    from psyrun import map_pspace_parallel
    results = map_pspace_parallel(objective, pspace)

Define tasks by placing ``task_<name>.py`` files in the `psy-tasks`` directory:

.. code-block:: python

    from psyrun import Param

    pspace = (Param(a=np.arange(1, 5))
              * Param(b=np.linspace(0, 1, 10))
              * Param(c=[1., 1.5, 10., 10.5]))

    def execute(a, b, c):
        return {'result': a * b + c}

and run them by typing ``psy run`` with support for serial farming on high
performance clusters.

Installation
------------

``pip install psyrun``

To be able to use the NPZ store::

    pip install numpy
    pip install 'psyrun[npz]'

To be able to use the HDF5 store::

    pip install numpy
    pip install 'psyrun[h5]'

Requirements
------------

* Python_ >=2.7, >=3.4
* `six <https://pypi.python.org/pypi/six>`_

Optional requirements
^^^^^^^^^^^^^^^^^^^^^

To have `faulthandler <http://faulthandler.readthedocs.io/>`_ activated for
jobs submitted with ``psy run`` in Python 2.7:

* `faulthandler <http://faulthandler.readthedocs.io/>`_

Python 3.4+ already includes the faulthandler module.

To use ``map_pspace_parallel``:

* `joblib <https://pythonhosted.org/joblib/>`_

To use NPZ files as store:

* `NumPy <http://www.numpy.org/>`_

To use HDF5 files as store:

* `NumPy <http://www.numpy.org/>`_
* `pytables <http://www.pytables.org/>`_

To run the unit tests:

* `joblib <https://pythonhosted.org/joblib/>`_
* `NumPy <http://www.numpy.org/>`_
* `pytables <http://www.pytables.org/>`_
* `pytest <http://doc.pytest.org/en/latest/>`_ >= 2.8

To build the documentation:

* `numpydoc <https://pypi.python.org/pypi/numpydoc>`_

.. _Python: https://www.python.org/


text:
namespace ash {
namespace {

constexpr char kUserActionBack[] = "back";
constexpr char kUserActionCancel[] = "cancel";
constexpr char kUserActionStartEnrollment[] = "startEnrollment";
constexpr char kUserActionReloadDefault[] = "reloadDefault";
constexpr char kUserActionRetry[] = "retry";

}  // namespace

// static
std::string GaiaScreen::GetResultString(Result result) {
  switch (result) {
    case Result::BACK:
      return "Back";
    case Result::CANCEL:
      return "Cancel";
    case Result::ENTERPRISE_ENROLL:
      return "EnterpriseEnroll";
    case Result::START_CONSUMER_KIOSK:
      return "StartConsumerKiosk";
  }
}

GaiaScreen::GaiaScreen(base::WeakPtr<TView> view,
                       const ScreenExitCallback& exit_callback)
    : BaseScreen(GaiaView::kScreenId, OobeScreenPriority::DEFAULT),
      view_(std::move(view)),
      exit_callback_(exit_callback) {}

GaiaScreen::~GaiaScreen() {
  backlights_forced_off_observation_.Reset();
}

void GaiaScreen::LoadOnline(const AccountId& account) {
  if (!view_)
    return;
  auto gaia_path = GaiaView::GaiaPath::kDefault;
  if (!account.empty()) {
    auto* user = user_manager::UserManager::Get()->FindUser(account);
    DCHECK(user);
    if (user && (user->IsChild() || features::IsGaiaReauthEndpointEnabled()))
      gaia_path = GaiaView::GaiaPath::kReauth;
  }
  view_->SetGaiaPath(gaia_path);
  view_->LoadGaiaAsync(account);
}

void GaiaScreen::LoadOnlineForChildSignup() {
  if (!view_)
    return;
  view_->SetGaiaPath(GaiaView::GaiaPath::kChildSignup);
  view_->LoadGaiaAsync(EmptyAccountId());
}

void GaiaScreen::LoadOnlineForChildSignin() {
  if (!view_)
    return;
  view_->SetGaiaPath(GaiaView::GaiaPath::kChildSignin);
  view_->LoadGaiaAsync(EmptyAccountId());
}

void GaiaScreen::ShowAllowlistCheckFailedError() {
  if (!view_)
    return;
  view_->ShowAllowlistCheckFailedError();
}

void GaiaScreen::Reset() {
  if (!view_)
    return;
  view_->SetGaiaPath(GaiaView::GaiaPath::kDefault);
  view_->Reset();
}

void GaiaScreen::ReloadGaiaAuthenticator() {
  if (!view_)
    return;
  view_->ReloadGaiaAuthenticator();
}

void GaiaScreen::ShowImpl() {
  if (!view_)
    return;
  if (!backlights_forced_off_observation_.IsObserving()) {
    backlights_forced_off_observation_.Observe(
        Shell::Get()->backlights_forced_off_setter());
  }
  // Landed on the login screen. No longer skipping enrollment for tests.
  context()->skip_to_login_for_tests = false;
  view_->Show();
}

void GaiaScreen::HideImpl() {
  if (!view_)
    return;
  view_->SetGaiaPath(GaiaView::GaiaPath::kDefault);
  view_->Hide();
  backlights_forced_off_observation_.Reset();
}

void GaiaScreen::OnUserAction(const base::Value::List& args) {
  const std::string& action_id = args[0].GetString();
  if (action_id == kUserActionBack) {
    exit_callback_.Run(Result::BACK);
  } else if (action_id == kUserActionCancel) {
    exit_callback_.Run(Result::CANCEL);
  } else if (action_id == kUserActionStartEnrollment) {
    exit_callback_.Run(Result::ENTERPRISE_ENROLL);
  } else if (action_id == kUserActionReloadDefault) {
    Reset();
    LoadOnline(EmptyAccountId());
  } else if (action_id == kUserActionRetry) {
    LoadOnline(EmptyAccountId());
  } else {
    BaseScreen::OnUserAction(args);
  }
}

bool GaiaScreen::HandleAccelerator(LoginAcceleratorAction action) {
  if (action == LoginAcceleratorAction::kStartEnrollment) {
    exit_callback_.Run(Result::ENTERPRISE_ENROLL);
    return true;
  }
  if (action == LoginAcceleratorAction::kEnableConsumerKiosk) {
    exit_callback_.Run(Result::START_CONSUMER_KIOSK);
    return true;
  }
  return false;
}

void GaiaScreen::OnScreenBacklightStateChanged(
    ScreenBacklightState screen_backlight_state) {
  if (screen_backlight_state == ScreenBacklightState::ON)
    return;
  exit_callback_.Run(Result::CANCEL);
}

}  // namespace ash


text:
/**
 * Defines support rules of the SelectDialog control of sap.m library.
 */
sap.ui.define(["jquery.sap.global", "sap/ui/support/library"],
	function(jQuery, SupportLib) {
		"use strict";

		// shortcuts
		var Categories = SupportLib.Categories, // Accessibility, Performance, Memory, ...
			Severity = SupportLib.Severity,	// Hint, Warning, Error
			Audiences = SupportLib.Audiences; // Control, Internal, Application

		//**********************************************************
		// Rule Definitions
		//**********************************************************

		/**
		 *Checks, if a selectDialog does not contain inactive list items
		 */
		var oSelectDialogNonActiveItem = {
			id : "noContainInactiveItemsInSelectDialog",
			audiences: [Audiences.Control],
			categories: [Categories.Usability],
			enabled: true,
			minversion: "1.28",
			title: "SelectDialog: Select Dialog should not contain inactive items",
			description: "All items in a Select Dialog should be interactable/selectable",
			resolution: "Make all items interactable/selectable or remove the inactive ones",
			resolutionurls: [{
				text: "SAP Fiori Design Guidelines: SelectDialog",
				href: "https://experience.sap.com/fiori-design-web/select-dialog/#behavior-and-interaction"
			}],
			check: function (oIssueManager, oCoreFacade, oScope) {
				oScope.getElementsByClassName("sap.m.SelectDialog")
					.forEach(function(oElement) {
						var aListItems = oElement.getItems(),
							sListOfInactiveItems = "";

						aListItems.forEach(function(oListItem){
							if (oListItem.getType() === sap.m.ListType.Inactive) {
								var sListItemId = oListItem.getId(),
									sListItemName = oListItem.getMetadata().getElementName();

								sListOfInactiveItems += sListItemName + " (" + sListItemId + "); ";

							}
						});

						if (sListOfInactiveItems) {
							var sElementId = oElement.getId(),
								sElementName = oElement.getMetadata().getElementName();

							oIssueManager.addIssue({
								severity: Severity.Medium,
								details: "SelectDialog '" + sElementName + "' (" + sElementId + ") contains one or more items of type 'Inactive' : " + sListOfInactiveItems,
								context: {
									id: sElementId
								}
							});
						}
					});
			}
		};

		return [oSelectDialogNonActiveItem];

	}, true);


text:
#include <qmath.h>
#include "Camera.h"
#include "Engine.h"
#include "Graphic.h"

Graphic::Graphic(QQuickItem* parent) : QQuickItem(parent) {
}

void Graphic::getFlattenedRenderParameters(RenderParameters* parameters) {
    Camera* camera = Engine::getInstance()->getCamera();
    QPointF worldPos = camera->mapFromItem(this, QPointF(0.0f, 0.0f));
    // TODO: Consider computing scale as well.
    // Recursivly accumulate parent properties.
    getFlattenedRenderParametersRecursive(camera, this, parameters);
    parameters->worldPosition = worldPos;
    parameters->rotation = qDegreesToRadians(parameters->rotation);
}

void Graphic::getFlattenedRenderParametersRecursive(QQuickItem* root, QQuickItem* item,
        RenderParameters* parameters) {
    // TODO: zDepth is slightly off (QQuick only sorts among siblings).
    parameters->rotation += item->rotation();
    parameters->zDepth += item->z();
    parameters->opacity *= item->opacity();

    QQuickItem* parent = item->parentItem();
    if (item == root || !parent) {
        return;
    }
    getFlattenedRenderParametersRecursive(root, parent, parameters);
}

void Graphic::synchronizeForRendering(RenderList*) {
}


text:
module OpenXml
  module DrawingML
    module Properties
      class ColorXformBlueModulation < PercentageProperty
        namespace :a
        tag :blueMod

      end
    end
  end
end


text:
+++
Talk_date = ""
Talk_start_time = ""
Talk_end_time = ""
Title = "Resilience Engineering: Identifying Dependencies, and Common Mitigation Strategies"
Type = "talk"
Speakers = ["nisan-haramati"]
+++

Resilience engineering is one of those things we all want to do, but never quite find the time to practice. There are always fires to put out and new infrastructure to deploy.

This talk will cover the fundamentals required for applying resilience engineering principles in your day to day work. It will cover how to identify the system dependencies that affect component and system-level service quality, and then go over some of the mitigation strategies that you can employ to prevent and alleviate failures in your own environment, starting from the simplest and cheapest, and then increasing in terms time, cost, and knowledge requirements.

It will cover:

1. Dependency mapping: identifying the pathways through which service level degradation in one component can affect that of another (e.g. backpressure, partial outages, network connections, etc.)
2. Failure isolation: isolating components and eliminating failure cascades where possible.
3. Destructive testing and failure injection in order to learn about the failure mechanisms and behaviours of your system. This can be done in a separate "lab" environment or directly in a production system. The latter is often called Chaos Engineering.
4. End-to-end testing: conformance testing and verification for overall system behaviour and output under varying conditions and sequences of events.
5. System level fuzzing: applying the property-based method of input fuzzing to the system events dimension of the end-to-end tests in order to identify categories of system states that are more sensitive to failure and warrant more attention.


text:
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**network_data** | **str** | NetworkData contains config drive inline cloud-init networkdata. | [optional]
**network_data_base64** | **str** | NetworkDataBase64 contains config drive cloud-init networkdata as a base64 encoded string. | [optional]
**network_data_secret_ref** | [**K8sIoApiCoreV1LocalObjectReference**](K8sIoApiCoreV1LocalObjectReference.md) | NetworkDataSecretRef references a k8s secret that contains config drive networkdata. | [optional]
**secret_ref** | [**K8sIoApiCoreV1LocalObjectReference**](K8sIoApiCoreV1LocalObjectReference.md) | UserDataSecretRef references a k8s secret that contains config drive userdata. | [optional]
**user_data** | **str** | UserData contains config drive inline cloud-init userdata. | [optional]
**user_data_base64** | **str** | UserDataBase64 contains config drive cloud-init userdata as a base64 encoded string. | [optional]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


text:
[![Build Status](http://img.shields.io/travis/kriasoft/react-starter-kit/master.svg?style=flat)](http://travis-ci.org/kriasoft/react-starter-kit)
[![Dependency Status](https://david-dm.org/kriasoft/react-starter-kit.svg?style=flat)](https://david-dm.org/kriasoft/react-starter-kit)
[![devDependency Status](https://david-dm.org/kriasoft/react-starter-kit/dev-status.svg?style=flat)](https://david-dm.org/kriasoft/react-starter-kit#info=devDependencies)
[![Tips](http://img.shields.io/gratipay/koistya.svg?style=flat)](https://gratipay.com/koistya)
[![Gitter](http://img.shields.io/badge/chat-online-brightgreen.svg?style=flat)](https://gitter.im/kriasoft/react-starter-kit)

> This project template is a skeleton for an [isomorphic](http://nerds.airbnb.com/isomorphic-javascript-future-web-apps/)
> web application (SPA) based on Facebook's [React](https://facebook.github.io/react/)
> library and [Flux](http://facebook.github.io/flux/) architecture. You can use
> it to quickly bootstrap your web application projects. It contains only
> client-side components and development tools.

[![Facebook React Starter Kit](https://dl.dropboxusercontent.com/u/16006521/Screens/facebook-react-starter-kit.png)](https://github.com/kriasoft/react-starter-kit)

**Demo**: http://reactjs.kriasoft.com

### Directory Layout

```
.
├── /build/                     # The folder for compiled output
├── /config/                    # Configuration files for Webpack, Jest etc.
├── /docs/                      # Documentation files for the project
├── /node_modules/              # 3rd-party libraries and utilities
├── /src/                       # The source code of the application
│   ├── /actions/               # Action creators that allow to trigger a dispatch to stores
│   ├── /assets/                # Static files which are copied to ./build on compile
│   ├── /constants/             # Enumerations used in action creators and stores
│   ├── /components/            # React components. E.g. Navbar.jsx, Calendar.jsx
│   ├── /images/                # Graphics (.png, .jpg, .svg etc.)
│   ├── /layouts/               # Shared layouts for top-level components
│   ├── /pages/                 # Top-level, URL-bound React components
│   ├── /stores/                # Stores contain the application state and logic
│   ├── /styles/                # CSS style sheets (or LESS, SASS, Stylus)
│   ├── /app.js                 # The application's bootstrap file, entry point
│   └── /AppDispatcher.js       # The central hub that manages all data flow (see Flux)
├── /test/                      # Unit, integration and load tests
│   ├── /e2e/                   # End-to-end tests
│   └── /unit/                  # Unit tests
│── gulpfile.js                 # Configuration file for automated builds
└── package.json                # The list of 3rd party libraries and utilities
```

### Getting Started

This yeoman generator is based on https://github.com/kriasoft/react-starter-kit:

```shell
$ npm install -g generator-flux-webapp
```

```shell
$ mkdir demo-app
$ cd demo-app
$ yo flux-webapp
$ gulp
```

### How to Build
```shell
$ gulp build                    # or, `gulp build --release`
```

By default, it builds in debug mode. If you need to build in release mode, add
`--release` flag.

### How to Run

```shell
$ gulp                          # or, `gulp --release`
```

This will start a lightweight development server with LiveReload and
synchronized browsing across multiple devices and browsers.

### How to Deploy

```shell
$ gulp deploy                   # or, `gulp deploy --production`
```

You can deploy to different destinations by adding a corresponding flag.
For example `--production` or `--staging` etc. See the 'deploy' task in
`gulpfile.js`.


text:
using Newtonsoft.Json.Linq;
using System.Collections.Generic;

namespace BlizzardAPI.Wow.DataResources
{
    public class PetsTypes
    {
        private List<PetType> types = new List<PetType>();
        public List<PetType> Types { get => types; set => types = value; }

        public PetsTypes(string region, string locale)
        {
            var petsTypesData = ApiHelper.GetJsonFromUrl(
               $"https://{region}.api.battle.net/wow/data/pet/types?locale={locale}&apikey={ApiHandler.ApiKey}"
           );

            if (petsTypesData == null)
                return;

            for (var i = 0; i < (petsTypesData["petTypes"] as JArray).Count; i++)
            {
                Types.Add(new PetType
                {
                    Id = petsTypesData["petTypes"][i]["id"],
                    Key = petsTypesData["petTypes"][i]["key"],
                    Name = petsTypesData["petTypes"][i]["name"],
                    TypeAbilityId = petsTypesData["petTypes"][i]["typeAbilityId"],
                    StrongAgainstId = petsTypesData["petTypes"][i]["strongAgainstId"],
                    WeakAgainstId = petsTypesData["petTypes"][i]["weakAgainstId"]
                });
            }
        }
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<!--

-->

<resources>
    <!-- Build condition,keyboard_height_in_dp -->
    <string-array name="keyboard_heights" translatable="false">
    <!-- Preferable keyboard height in absolute scale: 1.285in -->
        <!-- Droid -->
        <item>HARDWARE=sholes,227.0167</item>
        <!-- Nexus One -->
        <item>HARDWARE=mahimahi,217.5932</item>
        <!-- Nexus S -->
        <item>HARDWARE=herring,200.8554</item>
        <!-- Galaxy Nexus -->
        <item>HARDWARE=tuna,202.5869</item>
    <!-- Preferable keyboard height in absolute scale: 48.0mm -->
        <!-- Xoom -->
        <item>HARDWARE=stingray,283.1337</item>
    </string-array>
</resources>