text:
<?php
/**
 * Garp_Model_Behavior_Sluggable
 * Generates a unique slug for a record
 *
 * @author       Harmen Janssen, David Spreekmeester | grrr.nl
 * @version      1.5
 * @package      Garp_Model_Behavior
 */
class Garp_Model_Behavior_Sluggable extends Garp_Model_Behavior_Abstract {
	/**
	 * Version separator (e.g. <base><version-separator><int>)
	 * @var String
	 */
	const VERSION_SEPARATOR = '-';

	/**#@+
 	 * Exceptions
 	 * @var String
 	 */
	const EXCEPTION_LENGTH_MISMATCH = '"baseField" and "slugField" need to have the same length when using multiple slugFields.';
	const EXCEPTION_MISSING_CONFIG = '"%s" is a required config key';
    /**#@-*/

	/**
	 * Configuration
	 * @var Array
	 */
	protected $_config;

	/**
	 * Make sure the config array is at least filled with some default values to work with.
	 * 'baseField' can be a string or an array. If it's a string, it's the database column on which the slug should be based.
	 * If it's an array:
	 * - if $config['slugField'] is empty or a single value:
	 * 	 A list of database columns that should be combined to base the slug on.
	 * - if $config['slugField'] is an array of more than one item:
	 * 	 A list of database columns to base the slugs on, corresponding in length
	 * 	 Note that slugs based on multiple fields are not possible in this configuration.
	 * @param Array $config Configuration values
	 * @return Void
	 */
	protected function _setup($config) {
		if (!array_key_exists('baseField', $config)) {
			throw new Garp_Model_Behavior_Exception(sprintf(self::EXCEPTION_MISSING_CONFIG, 'baseField'));
		}
		$this->_normalizeBaseFieldConfiguration($config);
		$config['slugField'] = array_key_exists('slugField', $config) ? (array)$config['slugField'] : array('slug');

		$baseFieldCount = count($config['baseField']);
		$slugFieldCount = count($config['slugField']);

		// make sure array lengths match
		if ($slugFieldCount > 1 && $baseFieldCount !== $slugFieldCount) {
			throw new Garp_Model_Behavior_Exception(self::EXCEPTION_LENGTH_MISMATCH);
		}
		$this->_config = $config;
	}

	/**
	 * Before insert callback. Manipulate the new data here.
	 * @param Array $options The new data is in $args[1]
	 * @return Void
	 */
	public function beforeInsert(array &$args) {
		$model =  $args[0];
		$data  = &$args[1];

		$countBaseFields = count($this->_config['baseField']);
		$countSlugFields = count($this->_config['slugField']);

		// Scenario 1: one or more slugfields composed of a single basefield
		$method = '_addSlugFromSingle';
		if ($countBaseFields > 1 && $countSlugFields <= 1) {
			// Scenario 2: a single slug composed of multiple base fields
			$method = '_addSlugFromMultiple';
		}

		$referenceData = $data;

		// If the baseFields are not found in $data, and the model is multilingual,
		// we might be able to collect the baseField(s) from its primary language counterpart
		$hasLangColumn = !empty($data[Garp_Model_Behavior_Translatable::LANG_COLUMN]);
		$keys = array_keys($data);
		$baseColumns = $this->_baseFieldConfigToColumns($this->_config['baseField']);
		$intersect = array_intersect($baseColumns, $keys);

		if (count($intersect) != count($this->_config['baseField']) && $model->isMultilingual() && $hasLangColumn) {
			$this->_modifyReferenceDataForMultilingualModels($referenceData, $model);
		}

		$this->{$method}($model, $data, $referenceData);
	}

	/**
 	 * For multilingual models: combine the referenceData with fresh data
 	 * from its counterpart in the primary language.
 	 * @param Array $referenceData
 	 * @param Garp_Model_Db $model
 	 * @return Void
 	 */
	protected function _modifyReferenceDataForMultilingualModels(array &$referenceData, Garp_Model_Db $model) {
		// Try to fetch the baseFields from the localised model
		$i18nModelFactory = new Garp_I18n_ModelFactory($referenceData[Garp_Model_Behavior_Translatable::LANG_COLUMN]);
		$unilingualModel = $model->getUnilingualModel();
		$localizedModel = $i18nModelFactory->getModel($unilingualModel);
		$localizedModel->unregisterObserver('Translatable');
		$localizedModel->unregisterObserver('Draftable');
		$referenceMap = $model->getReference(get_class($unilingualModel));

		// Construct a query that fetches the base fields from the parent model
		$baseFields = $this->_config['baseField'];
		$baseFields = $this->_baseFieldConfigToColumns($baseFields);
		$select = $localizedModel->select()
			->from($localizedModel->getName(), $baseFields)
		;
		foreach ($referenceMap['columns'] as $i => $col) {
			if (!isset($referenceMap['refColumns'][$i])) {
				throw new Exception('ReferenceMap is invalid: columns does not match up with refColumns.');
			}
			$refCol = $referenceMap['refColumns'][$i];
			// If the required foreign key is not in $referenceData, we won't be able to solve the problem
			if (!isset($referenceData[$col])) {
				return null;
			}
			$select->where("$refCol = ?", $referenceData[$col]);
		}
		$localizedRecord = $localizedModel->fetchRow($select)->toArray();
		$referenceData = array_merge($localizedRecord, $referenceData);
	}

	/**
 	 * Convert baseField configuration to a list of columns.
 	 * @param Array $baseFields
 	 * @return Array
 	 */
	protected function _baseFieldConfigToColumns(array $baseFields) {
		$out = array();
		foreach ($baseFields as $baseField) {
			$out[] = $baseField['column'];
		}
		return $out;
	}

	/**
 	 * Add single slug from multiple sources
 	 * @param Garp_Model_Db $model
 	 * @param Array $data Data that will be inserted: should receive the slug
 	 * @param Array $referenceData Data to base the slug on
 	 * @return Void
 	 */
	protected function _addSlugFromMultiple(Garp_Model_Db $model, array &$targetData, array $referenceData) {
		$baseFields = $this->_config['baseField'];
		$slugField  = $this->_config['slugField'][0];
		$baseData = array();
		if (!empty($targetData[$slugField])) {
			return;
		}
		foreach ((array)$baseFields as $baseColumn) {
			$baseData[] = $this->_getBaseString($baseColumn, $referenceData);
		}
		$baseData = implode(' ', $baseData);
		$targetData[$slugField] = $this->generateUniqueSlug($baseData, $model, $slugField);
	}

	/**
 	 * Add slug(s) from single source
 	 * @param Garp_Model_Db $model
 	 * @param Array $data Data that will be inserted: should receive the slug
 	 * @param Array $referenceData Data to base the slug on
 	 * @return Void
 	 */
	protected function _addSlugFromSingle(Garp_Model_Db $model, array &$targetData, array $referenceData) {
		$baseFields = $this->_config['baseField'];
		$slugFields = $this->_config['slugField'];
		foreach ($baseFields as $i => $baseField) {
			$baseData = $this->_getBaseString($baseField, $referenceData);
			$slugField = $slugFields[$i];
			if (!empty($targetData[$slugField])) {
				continue;
			}
			$targetData[$slugField] = $this->generateUniqueSlug($baseData, $model, $slugField);
		}
	}

	/**
 	 * Construct base string on which the slug will be based.
 	 * @param Array $baseFields Basefield configuration (per field)
 	 * @param Array $data Submitted data
 	 * @return String
 	 */
	protected function _getBaseString($baseField, $data) {
		$type = $baseField['type'];
		$method = '_getBaseStringFrom' . ucfirst($type);
		return $this->{$method}($data, $baseField);
	}

	/**
 	 * Get base string from text column.
 	 * @param Array $data
 	 * @param Array $baseField Base field config
 	 * @return String
 	 */
	protected function _getBaseStringFromText(array $data, array $baseField) {
		$col = $baseField['column'];
		if (!array_key_exists($col, $data)) {
			return '';
		}
		return $data[$col];
	}

	/**
 	 * Get base string from date column.
 	 * @param Array $data
 	 * @param Array $baseField Base field config
 	 * @return String
 	 */
	protected function _getBaseStringFromDate(array $data, array $baseField) {
		$col = $baseField['column'];
		$format = $baseField['format'] ?: 'd-m-Y';
		if (!array_key_exists($col, $data)) {
			return '';
		}
		return date($format, strtotime($data[$col]));
	}

	/**
	 * Generate a slug from a base string
	 * @param String $base String to base the slug on.
	 * @return String $slug The generated slug
	 */
	public function generateSlug($base) {
		return strtolower(Garp_Util_String::toDashed($base));
	}

	/**
	* Generate a slug from a base string that is unique in the database
	* @param String $base
	* @param Model $model Model object of this record
	* @param String $slugField Name of the slug column in the database
	* @return String $slug The generated unique slug
	*/
	public function generateUniqueSlug($base, $model, $slugField) {
		$slug = $this->generateSlug($base);
		$select = $model->getAdapter()->select()
			->from($model->getName(), 'COUNT(*)')
		;
		$this->_setWhereClause($select, $slugField, $slug, $model);
		$n = 1;
		while ($this->_rowsExist($select)) {
			$this->_incrementSlug($slug, ++$n, $base);
			$this->_setWhereClause($select, $slugField, $slug, $model);
		}
		return $slug;
	}

	/**
 	 * Set WHERE clause that checks for slug existence.
 	 * @param Zend_Db_Select $select
 	 * @param String $slugField
 	 * @param String $slug
 	 * @param Garp_Model_Db $model
 	 * @return Void
 	 */
	protected function _setWhereClause(Zend_Db_Select &$select, $slugField, $slug, Garp_Model_Db $model) {
		$slugField = $model->getAdapter()->quoteIdentifier($slugField);
		$select->reset(Zend_Db_Select::WHERE)
			->where($slugField . ' = ?', $slug);
	}

	/**
	 * Check if rows exist for a given select query
	 * @param Zend_Db_Select $select
	 * @return Boolean
	 */
	protected function _rowsExist(Zend_Db_Select $select) {
		$result = $select->query()->fetchAll();
		return !!$result[0]['COUNT(*)'];
	}

	/**
	 * Increment the version number in a slug
	 * @param String $slug
	 * @param Int $n Version number
	 * @param String $original_input The original base string
	 * @return Void Edits slug reference
	 */
	protected function _incrementSlug(&$slug, $n, $original_input) {
		$original_slug = $this->generateSlug($original_input);
		$slug = $original_slug . static::VERSION_SEPARATOR . $n;
		return;
	}

	/**
 	 * Normalize baseField configuration
 	 * @param Array $config
 	 * @return Void
 	 */
	protected function _normalizeBaseFieldConfiguration(&$config) {
		$bf_config = (array)$config['baseField'];
		$nbf_config = array();
		$defaults = array(
			'type' => 'text',
			'format' => null
		);
		foreach ($bf_config as $bf) {
			$bf = is_string($bf) ? array('column' => $bf) : $bf;
			$bf = array_merge($defaults, $bf);
			$nbf_config[] = $bf;
		}
		$config['baseField'] = $nbf_config;
	}
}


text:
package com.amazonaws.services.elasticbeanstalk.model;

import java.io.Serializable;

import com.amazonaws.AmazonWebServiceRequest;

/**
 * Container for the parameters to the {@link com.amazonaws.services.elasticbeanstalk.AWSElasticBeanstalk#describeEnvironmentResources(DescribeEnvironmentResourcesRequest) DescribeEnvironmentResources operation}.
 *

 * Returns AWS resources for this environment.
 *

 *
 * @see com.amazonaws.services.elasticbeanstalk.AWSElasticBeanstalk#describeEnvironmentResources(DescribeEnvironmentResourcesRequest)
 */
public class DescribeEnvironmentResourcesRequest extends AmazonWebServiceRequest implements Serializable, Cloneable {

    /**
     * The ID of the environment to retrieve AWS resource usage data.

     * Condition: You must specify either this or an EnvironmentName, or
     * both. If you do not specify either, AWS Elastic Beanstalk returns
     * MissingRequiredParameter error.
     */
    private String environmentId;

    /**
     * The name of the environment to retrieve AWS resource usage data.

     * Condition: You must specify either this or an EnvironmentId, or both.
     * If you do not specify either, AWS Elastic Beanstalk returns
     * MissingRequiredParameter error.
     *

     * Constraints:

     * Length: 4 - 23

     */
    private String environmentName;

    /**
     * Default constructor for a new DescribeEnvironmentResourcesRequest object.  Callers should use the
     * setter or fluent setter (with...) methods to initialize this object after creating it.
     */
    public DescribeEnvironmentResourcesRequest() {}

    /**
     * The ID of the environment to retrieve AWS resource usage data.

     * Condition: You must specify either this or an EnvironmentName, or
     * both. If you do not specify either, AWS Elastic Beanstalk returns
     * MissingRequiredParameter error.
     *
     * @return The ID of the environment to retrieve AWS resource usage data.

     *         Condition: You must specify either this or an EnvironmentName, or
     *         both. If you do not specify either, AWS Elastic Beanstalk returns
     *         MissingRequiredParameter error.
     */
    public String getEnvironmentId() {
        return environmentId;
    }

    /**
     * The ID of the environment to retrieve AWS resource usage data.

     * Condition: You must specify either this or an EnvironmentName, or
     * both. If you do not specify either, AWS Elastic Beanstalk returns
     * MissingRequiredParameter error.
     *
     * @param environmentId The ID of the environment to retrieve AWS resource usage data.

     *         Condition: You must specify either this or an EnvironmentName, or
     *         both. If you do not specify either, AWS Elastic Beanstalk returns
     *         MissingRequiredParameter error.
     */
    public void setEnvironmentId(String environmentId) {
        this.environmentId = environmentId;
    }

    /**
     * The ID of the environment to retrieve AWS resource usage data.

     * Condition: You must specify either this or an EnvironmentName, or
     * both. If you do not specify either, AWS Elastic Beanstalk returns
     * MissingRequiredParameter error.
     *

     * Returns a reference to this object so that method calls can be chained together.
     *
     * @param environmentId The ID of the environment to retrieve AWS resource usage data.

     *         Condition: You must specify either this or an EnvironmentName, or
     *         both. If you do not specify either, AWS Elastic Beanstalk returns
     *         MissingRequiredParameter error.
     *
     * @return A reference to this updated object so that method calls can be chained
     *         together.
     */
    public DescribeEnvironmentResourcesRequest withEnvironmentId(String environmentId) {
        this.environmentId = environmentId;
        return this;
    }

    /**
     * The name of the environment to retrieve AWS resource usage data.

     * Condition: You must specify either this or an EnvironmentId, or both.
     * If you do not specify either, AWS Elastic Beanstalk returns
     * MissingRequiredParameter error.
     *

     * Constraints:

     * Length: 4 - 23

     *
     * @return The name of the environment to retrieve AWS resource usage data.

     *         Condition: You must specify either this or an EnvironmentId, or both.
     *         If you do not specify either, AWS Elastic Beanstalk returns
     *         MissingRequiredParameter error.
     */
    public String getEnvironmentName() {
        return environmentName;
    }

    /**
     * The name of the environment to retrieve AWS resource usage data.

     * Condition: You must specify either this or an EnvironmentId, or both.
     * If you do not specify either, AWS Elastic Beanstalk returns
     * MissingRequiredParameter error.
     *

     * Constraints:

     * Length: 4 - 23

     *
     * @param environmentName The name of the environment to retrieve AWS resource usage data.

     *         Condition: You must specify either this or an EnvironmentId, or both.
     *         If you do not specify either, AWS Elastic Beanstalk returns
     *         MissingRequiredParameter error.
     */
    public void setEnvironmentName(String environmentName) {
        this.environmentName = environmentName;
    }

    /**
     * The name of the environment to retrieve AWS resource usage data.

     * Condition: You must specify either this or an EnvironmentId, or both.
     * If you do not specify either, AWS Elastic Beanstalk returns
     * MissingRequiredParameter error.
     *

     * Returns a reference to this object so that method calls can be chained together.
     *

     * Constraints:

     * Length: 4 - 23

     *
     * @param environmentName The name of the environment to retrieve AWS resource usage data.

     *         Condition: You must specify either this or an EnvironmentId, or both.
     *         If you do not specify either, AWS Elastic Beanstalk returns
     *         MissingRequiredParameter error.
     *
     * @return A reference to this updated object so that method calls can be chained
     *         together.
     */
    public DescribeEnvironmentResourcesRequest withEnvironmentName(String environmentName) {
        this.environmentName = environmentName;
        return this;
    }

    /**
     * Returns a string representation of this object; useful for testing and
     * debugging.
     *
     * @return A string representation of this object.
     *
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getEnvironmentId() != null) sb.append("EnvironmentId: " + getEnvironmentId() + ",");
        if (getEnvironmentName() != null) sb.append("EnvironmentName: " + getEnvironmentName() );
        sb.append("}");
        return sb.toString();
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;

        hashCode = prime * hashCode + ((getEnvironmentId() == null) ? 0 : getEnvironmentId().hashCode());
        hashCode = prime * hashCode + ((getEnvironmentName() == null) ? 0 : getEnvironmentName().hashCode());
        return hashCode;
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj) return true;
        if (obj == null) return false;

        if (obj instanceof DescribeEnvironmentResourcesRequest == false) return false;
        DescribeEnvironmentResourcesRequest other = (DescribeEnvironmentResourcesRequest)obj;

        if (other.getEnvironmentId() == null ^ this.getEnvironmentId() == null) return false;
        if (other.getEnvironmentId() != null && other.getEnvironmentId().equals(this.getEnvironmentId()) == false) return false;
        if (other.getEnvironmentName() == null ^ this.getEnvironmentName() == null) return false;
        if (other.getEnvironmentName() != null && other.getEnvironmentName().equals(this.getEnvironmentName()) == false) return false;
        return true;
    }

    @Override
    public DescribeEnvironmentResourcesRequest clone() {

            return (DescribeEnvironmentResourcesRequest) super.clone();
    }

}

redpajama_set_name: RedPajamaGithub


text:
/**
 * Module dependencies
 */
var fs = require('fs');
var path = require('path');
var resolve = require('resolve');
var sass = require('node-sass');

function flatten(file, modules, out) {
  var src = fs.readFileSync(file, 'utf8');
  var base = path.dirname(file);

  src.split(/\n/).forEach(function (line) {
    var self = this;

    if (line.trim().indexOf('@import') === 0) {
      var name = line.replace('@import', '').replace(/["';]/g, '').trim();
      var url = name.indexOf('url(');

      if (url !== -1) {
        out.push(line);
        return;
      }

      if (name[0] !== '.') {
        var pkg_name = name.split('/', 1)[0];

        // lookup the entry css file
        var filepath = resolve.sync(name, {
          basedir: base,
          extensions: ['.css', '.scss'],
          packageFilter: function (pkg) {
            pkg_name = pkg.name;
            return pkg;
          }
        });

        if (modules.indexOf(name) !== -1) {
          return;
        }

        modules.push(name);

        return flatten(filepath, modules, out);

      } else {
        var filepath = path.join(base, name);

        if (modules.indexOf(name) !== -1) {
          return;
        }

        modules.push(name);

        if (fs.statSync(filepath).isFile()) {
          return flatten(filepath, modules, out);
        }
      }

    } else {
      out.push(line);
    }
  });
}

module.exports = function(file, outFile) {
  var start = process.hrtime();
  var out = [];
  flatten(file, [], out);
  sass.render({
    data: out.join('')
  }, function (err, result) {
    if (err) {
      console.log('Error status: ' + err.status);
      console.log('Error line: ' + err.line);
      console.log('Error message: ' + err.message);
      return err.status;
    }
    var file = fs.createWriteStream(outFile);
    file.write(result.css);
    file.end();
    start = process.hrtime(start);
    console.log('Done - %d ms', (start[1]/1000000).toFixed(2));
    return 0;
  });
};


text:
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

namespace TitaniumAS.Opc.Client.Interop.Common
{
    [Guid("00000100-0000-0000-C000-000000000046")]
    [InterfaceType(1)]
    [ComImport]
    internal interface IEnumUnknown
    {
        [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
        void RemoteNext([In] int celt,
            [MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.IUnknown), In, Out] object[] rgelt,
            out int pceltFetched);

        [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
        void Skip([In] int celt);

        [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
        void Reset();

        [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
        void Clone([MarshalAs(UnmanagedType.Interface)] out IEnumUnknown ppenum);
    }
}


text:
namespace Google.Cloud.Notebooks.V1.Snippets
{
    // [START notebooks_v1_generated_ManagedNotebookService_GetRuntime_sync_flattened]
    using Google.Cloud.Notebooks.V1;

    public sealed partial class GeneratedManagedNotebookServiceClientSnippets
    {
        /// <summary>Snippet for GetRuntime</summary>
        /// <remarks>
        /// This snippet has been automatically generated and should be regarded as a code template only.
        /// It will require modifications to work:
        /// - It may require correct/in-range values for request initialization.
        /// - It may require specifying regional endpoints when creating the service client as shown in
        ///   https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint.
        /// </remarks>
        public void GetRuntime()
        {
            // Create client
            ManagedNotebookServiceClient managedNotebookServiceClient = ManagedNotebookServiceClient.Create();
            // Initialize request argument(s)
            string name = "projects/[PROJECT]/locations/[LOCATION]/runtimes/[RUNTIME]";
            // Make the request
            Runtime response = managedNotebookServiceClient.GetRuntime(name);
        }
    }
    // [END notebooks_v1_generated_ManagedNotebookService_GetRuntime_sync_flattened]
}


text:
package com.juanocampo.test.appstoretest.ui.adapters;

/**
 * Created by juanocampo on 1/30/17.
 */

public interface ViewType {
    int getViewType();

}


text:
package org.springframework.security.acls;

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

import org.junit.Test;
import org.springframework.security.acls.domain.AclFormattingUtils;
import org.springframework.security.acls.model.Permission;

/**
 * Tests for {@link AclFormattingUtils}.
 *
 * @author Andrei Stefan
 */
public class AclFormattingUtilsTests {

	// ~ Methods
	// ========================================================================================================
	@Test
	public final void testDemergePatternsParametersConstraints() throws Exception {
		try {
			AclFormattingUtils.demergePatterns(null, "SOME STRING");
			fail("It should have thrown IllegalArgumentException");
		}
		catch (IllegalArgumentException expected) {
		}

		try {
			AclFormattingUtils.demergePatterns("SOME STRING", null);
			fail("It should have thrown IllegalArgumentException");
		}
		catch (IllegalArgumentException expected) {
		}

		try {
			AclFormattingUtils.demergePatterns("SOME STRING", "LONGER SOME STRING");
			fail("It should have thrown IllegalArgumentException");
		}
		catch (IllegalArgumentException expected) {
		}

		try {
			AclFormattingUtils.demergePatterns("SOME STRING", "SAME LENGTH");
		}
		catch (IllegalArgumentException notExpected) {
			fail("It shouldn't have thrown IllegalArgumentException");
		}
	}

	@Test
	public final void testDemergePatterns() throws Exception {
		String original = "...........................A...R";
		String removeBits = "...............................R";
		assertThat(AclFormattingUtils.demergePatterns(original, removeBits)).isEqualTo(
				"...........................A....");

		assertThat(AclFormattingUtils.demergePatterns("ABCDEF", "......")).isEqualTo(
				"ABCDEF");
		assertThat(AclFormattingUtils.demergePatterns("ABCDEF", "GHIJKL")).isEqualTo(
				"......");
	}

	@Test
	public final void testMergePatternsParametersConstraints() throws Exception {
		try {
			AclFormattingUtils.mergePatterns(null, "SOME STRING");
			fail("It should have thrown IllegalArgumentException");
		}
		catch (IllegalArgumentException expected) {
		}

		try {
			AclFormattingUtils.mergePatterns("SOME STRING", null);
			fail("It should have thrown IllegalArgumentException");
		}
		catch (IllegalArgumentException expected) {
		}

		try {
			AclFormattingUtils.mergePatterns("SOME STRING", "LONGER SOME STRING");
			fail("It should have thrown IllegalArgumentException");
		}
		catch (IllegalArgumentException expected) {
		}

		try {
			AclFormattingUtils.mergePatterns("SOME STRING", "SAME LENGTH");
		}
		catch (IllegalArgumentException notExpected) {
		}
	}

	@Test
	public final void testMergePatterns() throws Exception {
		String original = "...............................R";
		String extraBits = "...........................A....";
		assertThat(AclFormattingUtils.mergePatterns(original, extraBits)).isEqualTo(
				"...........................A...R");

		assertThat(AclFormattingUtils.mergePatterns("ABCDEF", "......")).isEqualTo(
				"ABCDEF");
		assertThat(AclFormattingUtils.mergePatterns("ABCDEF", "GHIJKL")).isEqualTo(
				"GHIJKL");
	}

	@Test
	public final void testBinaryPrints() throws Exception {
		assertThat(AclFormattingUtils.printBinary(15)).isEqualTo(
				"............................****");

		try {
			AclFormattingUtils.printBinary(15, Permission.RESERVED_ON);
			fail("It should have thrown IllegalArgumentException");
		}
		catch (IllegalArgumentException notExpected) {
		}

		try {
			AclFormattingUtils.printBinary(15, Permission.RESERVED_OFF);
			fail("It should have thrown IllegalArgumentException");
		}
		catch (IllegalArgumentException notExpected) {
		}

		assertThat(AclFormattingUtils.printBinary(15, 'x')).isEqualTo(
				"............................xxxx");
	}

	@Test
	public void testPrintBinaryNegative() {
		assertThat(AclFormattingUtils.printBinary(0x80000000)).isEqualTo(
				"*...............................");
	}

	@Test
	public void testPrintBinaryMinusOne() {
		assertThat(AclFormattingUtils.printBinary(0xffffffff)).isEqualTo(
				"********************************");
	}
}


text:
#include "VLCMediaPlayer.h"

//
// autor : supersc
// inspired from : jnakanojp's ofxVLCVideoPlayer
//

#pragma region Shader for BGR to RGB

#define STRINGIFY(A) #A
string shaderstr = STRINGIFY(
		uniform sampler2DRect iChannel0;
		void main()
		{
			vec2 uv = gl_TexCoord[0].st;
			vec4 color = texture2DRect(iChannel0, uv);
			gl_FragColor = vec4(color.b, color.g, color.r, 1.0);
		}
	);
#pragma endregion

#pragma region MyRegion
VLCMediaPlayer::VLCMediaPlayer()
{
}

VLCMediaPlayer::~VLCMediaPlayer()
{
	if (frontImage != nullptr)
	{
		delete frontImage;
	}
	libvlc_media_parse(media);
}

// utils
std::string replace_all(
	__in const std::string &message,
	__in const std::string &pattern,
	__in const std::string &replace
	) {

	std::string result = message;
	std::string::size_type pos = 0;
	std::string::size_type offset = 0;

	while ((pos = result.find(pattern, offset)) != std::string::npos)
	{
		result.replace(result.begin() + pos, result.begin() + pos + pattern.size(), replace);
		offset = pos + replace.size();
	}

	return result;
}

#pragma endregion

void VLCMediaPlayer::setup(string path)
{
	isReady = false;

	//https://wiki.videolan.org/VLC_command-line_help
	//vlc options
	char const *vlc_argv[] = {
		"--no-osd",
		//"--avcodec-threads=1024" // if you want for high performance.
	};

	libvlc = libvlc_new(sizeof(vlc_argv) / sizeof(*vlc_argv), vlc_argv);
	if (!libvlc)
	{
		cout << libvlc_errmsg() << endl;
		return;
	}

	/*
	if (ofFile(path).exists() == false)
	{
		cout << "Error : not exists video" << endl;
		return;
	}
	*/

	std::filesystem::path p(path);
	media = libvlc_media_new_path(libvlc, replace_all(p.string(), "/", "\\").c_str()); // Change to C style path string (for windows).
	mediaPlayer = libvlc_media_player_new_from_media(media);

	libvlc_media_parse(media);
	videoWidth = libvlc_video_get_width(mediaPlayer);
	videoHeight = libvlc_video_get_height(mediaPlayer);
	video_length_ms = libvlc_media_get_duration(media);
	cout << "Video: (" << videoWidth << ", " << videoHeight << ")" << endl;
	cout << "Video:length " << video_length_ms << "(ms)" << endl;

	libvlc_video_set_callbacks(mediaPlayer, lockStatic, unlockStatic, displayStatic , this);

	//You can change to Surface formats.
	libvlc_video_set_format(mediaPlayer, "RV24", videoWidth, videoHeight, videoWidth * 3);

	frontImage = new ofImage();
	frontImage->allocate(videoWidth, videoHeight, ofImageType::OF_IMAGE_COLOR);

	if (frontImage->isAllocated() == false || frontImage->getWidth() < 1 || frontImage->getHeight() < 1)
	{
		cout << "Error : can't initialize ofimage" << endl;
		return;
	}

	cout << "vlcmedia : ready to play" << endl;
	libvlc_media_release(media);

	shader_BGRtoRGB.setupShaderFromSource(GL_FRAGMENT_SHADER, shaderstr);
	shader_BGRtoRGB.linkProgram();

	isReady = true;
}

void VLCMediaPlayer::draw()
{
	if (isReady && libvlc_media_player_is_playing(mediaPlayer) == true)
	{
		frontImage->update();
	}
	shader_BGRtoRGB.begin();
	frontImage->draw(0, 0);
	shader_BGRtoRGB.end();
}

void VLCMediaPlayer::play(bool isLooping)
{
	if (isLooping == true)
	{
		libvlc_media_add_option(media, "input-repeat=-1");
	}
	else
	{
		libvlc_media_add_option(media, "input-repeat=0");
	}

	libvlc_media_player_play(mediaPlayer);
}

void VLCMediaPlayer::pause()
{
	libvlc_media_player_pause(mediaPlayer);
}

int VLCMediaPlayer::getFps()
{
	return fps_vlc.getFps();
}

#pragma region MyRegion

void *VLCMediaPlayer::lockStatic(void * data, void ** p_pixels)
{
	return ((VLCMediaPlayer*)data)->lock(p_pixels);
}

void VLCMediaPlayer::unlockStatic(void * data, void * id, void * const * p_pixels)
{
}

void VLCMediaPlayer::displayStatic(void * data, void * id)
{
}

void * VLCMediaPlayer::lock(void ** p_pixels)
{
	fps_vlc.newFrame();
	*p_pixels = frontImage->getPixels();
	return NULL;
}

void VLCMediaPlayer::unlock(void * id, void * const * p_pixels)
{
}

void VLCMediaPlayer::display(void * id)
{
}

#pragma endregion;


text:
class StringVar
{friend ostream& operator<<(ostream&, const StringVar&);
	//Precondition: if outs is a file output stream, thenouts
	//has allready been connected to a file.
public:

	void input_line(istream& ins);
	//Precondition: If ins is a file input stream, tehn ins has already been connected to a file.
	//action: the next text in the input stream ins , up to '\n', is copied to the calling
	//object. iIf there is not sufficient room, then only as much as will fit is copied.

	StringVar(int size);
	//Initializes the obnject so it can accept string values up to size oin laength.
	//sets the value of the object equal to the empty string.

	StringVar();
	//Initializes the object so it can accept string values of length 100 or less.
	//sets the value of the object equal to the empty string.

	StringVar(const char *a);
	//Precondition: the array contains characters terminated with '\0'
	//Initializeds the object so its value is athe string stored in a and
	//so that it can later be set to string values up to strlen(a) in length

	StringVar(const StringVar& stirng_object);
	//Copy constructor.

	~StringVar();
	//Returns all gthe dynamic memory used by the object to the heap.

	int length() const;
	//Returns the length of the current string value.

	const char * c_str()const;
	//returns value;
private:
	char* value;//Pointer to the dynamic array that holds the string value.
	int max_length; // delcared max length of any string value.
};

#endif


text:
/* $NetBSD: cp.c,v 1.58 2012/01/04 15:58:37 christos Exp $ */

/*
 * Copyright (c) 1988, 1993, 1994
 *	The Regents of the University of California.  All rights reserved.
 *
 * This code is derived from software contributed to Berkeley by
 * David Hitz of Auspex Systems Inc.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 * 3. Neither the name of the University nor the names of its contributors
 *    may be used to endorse or promote products derived from this software
 *    without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 */

#include <sys/cdefs.h>
#ifndef lint
__COPYRIGHT(
"@(#) Copyright (c) 1988, 1993, 1994\
 The Regents of the University of California.  All rights reserved.");
#endif /* not lint */

#ifndef lint
#if 0
static char sccsid[] = "@(#)cp.c	8.5 (Berkeley) 4/29/95";
#else
__RCSID("$NetBSD: cp.c,v 1.58 2012/01/04 15:58:37 christos Exp $");
#endif
#endif /* not lint */

/*
 * Cp copies source files to target files.
 *
 * The global PATH_T structure "to" always contains the path to the
 * current target file.  Since fts(3) does not change directories,
 * this path can be either absolute or dot-relative.
 *
 * The basic algorithm is to initialize "to" and use fts(3) to traverse
 * the file hierarchy rooted in the argument list.  A trivial case is the
 * case of 'cp file1 file2'.  The more interesting case is the case of
 * 'cp file1 file2 ... fileN dir' where the hierarchy is traversed and the
 * path (relative to the root of the traversal) is appended to dir (stored
 * in "to") to form the final target path.
 */

#include <sys/param.h>
#include <sys/stat.h>

#include <assert.h>
#include <err.h>
#include <errno.h>
#include <fts.h>
#include <locale.h>
#include <signal.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>

#include "extern.h"

#define	STRIP_TRAILING_SLASH(p) {					\
        while ((p).p_end > (p).p_path + 1 && (p).p_end[-1] == '/')	\
                *--(p).p_end = '\0';					\
}

static char empty[] = "";
PATH_T to = { .p_end = to.p_path, .target_end = empty  };

uid_t myuid;
int Hflag, Lflag, Rflag, Pflag, fflag, iflag, lflag, pflag, rflag, vflag, Nflag;
mode_t myumask;
sig_atomic_t pinfo;

enum op { FILE_TO_FILE, FILE_TO_DIR, DIR_TO_DNE };

static int copy(char *[], enum op, int);

static void
progress(int sig __unused)
{

	pinfo++;
}

int
main(int argc, char *argv[])
{
	struct stat to_stat, tmp_stat;
	enum op type;
	int ch, fts_options, r, have_trailing_slash;
	char *target, **src;

	setprogname(argv[0]);
	(void)setlocale(LC_ALL, "");

	Hflag = Lflag = Pflag = Rflag = 0;
	while ((ch = getopt(argc, argv, "HLNPRfailprv")) != -1)
		switch (ch) {
		case 'H':
			Hflag = 1;
			Lflag = Pflag = 0;
			break;
		case 'L':
			Lflag = 1;
			Hflag = Pflag = 0;
			break;
		case 'N':
			Nflag = 1;
			break;
		case 'P':
			Pflag = 1;
			Hflag = Lflag = 0;
			break;
		case 'R':
			Rflag = 1;
			break;
		case 'a':
			Pflag = 1;
			pflag = 1;
			Rflag = 1;
			Hflag = Lflag = 0;
			break;
		case 'f':
			fflag = 1;
			iflag = 0;
			break;
		case 'i':
			iflag = isatty(fileno(stdin));
			fflag = 0;
			break;
		case 'l':
			lflag = 1;
			break;
		case 'p':
			pflag = 1;
			break;
		case 'r':
			rflag = 1;
			break;
		case 'v':
			vflag = 1;
			break;
		case '?':
		default:
			usage();
			/* NOTREACHED */
		}
	argc -= optind;
	argv += optind;

	if (argc < 2)
		usage();

	fts_options = FTS_NOCHDIR | FTS_PHYSICAL;
	if (rflag) {
		if (Rflag) {
			errx(EXIT_FAILURE,
		    "the -R and -r options may not be specified together.");
			/* NOTREACHED */
		}
		if (Hflag || Lflag || Pflag) {
			errx(EXIT_FAILURE,
	"the -H, -L, and -P options may not be specified with the -r option.");
			/* NOTREACHED */
		}
		fts_options &= ~FTS_PHYSICAL;
		fts_options |= FTS_LOGICAL;
	}

	if (Rflag) {
		if (Hflag)
			fts_options |= FTS_COMFOLLOW;
		if (Lflag) {
			fts_options &= ~FTS_PHYSICAL;
			fts_options |= FTS_LOGICAL;
		}
	} else if (!Pflag) {
		fts_options &= ~FTS_PHYSICAL;
		fts_options |= FTS_LOGICAL | FTS_COMFOLLOW;
	}

	myuid = getuid();

	/* Copy the umask for explicit mode setting. */
	myumask = umask(0);
	(void)umask(myumask);

	/* Save the target base in "to". */
	target = argv[--argc];
	if (strlcpy(to.p_path, target, sizeof(to.p_path)) >= sizeof(to.p_path))
		errx(EXIT_FAILURE, "%s: name too long", target);
	to.p_end = to.p_path + strlen(to.p_path);
	have_trailing_slash = (to.p_end[-1] == '/');
	if (have_trailing_slash)
		STRIP_TRAILING_SLASH(to);
	to.target_end = to.p_end;

	/* Set end of argument list for fts(3). */
	argv[argc] = NULL;

	(void)signal(SIGINFO, progress);

	/*
	 * Cp has two distinct cases:
	 *
	 * cp [-R] source target
	 * cp [-R] source1 ... sourceN directory
	 *
	 * In both cases, source can be either a file or a directory.
	 *
	 * In (1), the target becomes a copy of the source. That is, if the
	 * source is a file, the target will be a file, and likewise for
	 * directories.
	 *
	 * In (2), the real target is not directory, but "directory/source".
	 */
	if (Pflag)
		r = lstat(to.p_path, &to_stat);
	else
		r = stat(to.p_path, &to_stat);
	if (r == -1 && errno != ENOENT) {
		err(EXIT_FAILURE, "%s", to.p_path);
		/* NOTREACHED */
	}
	if (r == -1 || !S_ISDIR(to_stat.st_mode)) {
		/*
		 * Case (1).  Target is not a directory.
		 */
		if (argc > 1)
			usage();
		/*
		 * Need to detect the case:
		 *	cp -R dir foo
		 * Where dir is a directory and foo does not exist, where
		 * we want pathname concatenations turned on but not for
		 * the initial mkdir().
		 */
		if (r == -1) {
			if (rflag || (Rflag && (Lflag || Hflag)))
				r = stat(*argv, &tmp_stat);
			else
				r = lstat(*argv, &tmp_stat);
			if (r == -1) {
				err(EXIT_FAILURE, "%s", *argv);
				/* NOTREACHED */
			}

			if (S_ISDIR(tmp_stat.st_mode) && (Rflag || rflag))
				type = DIR_TO_DNE;
			else
				type = FILE_TO_FILE;
		} else
			type = FILE_TO_FILE;

		if (have_trailing_slash && type == FILE_TO_FILE) {
			if (r == -1)
				errx(1, "directory %s does not exist",
				     to.p_path);
			else
				errx(1, "%s is not a directory", to.p_path);
		}
	} else {
		/*
		 * Case (2).  Target is a directory.
		 */
		type = FILE_TO_DIR;
	}

	/*
	 * make "cp -rp src/ dst" behave like "cp -rp src dst" not
	 * like "cp -rp src/. dst"
	 */
	for (src = argv; *src; src++) {
		size_t len = strlen(*src);
		while (len-- > 1 && (*src)[len] == '/')
			(*src)[len] = '\0';
	}

	exit(copy(argv, type, fts_options));
	/* NOTREACHED */
}

static int dnestack[MAXPATHLEN]; /* unlikely we'll have more nested dirs */
static ssize_t dnesp;
static void
pushdne(int dne)
{

	dnestack[dnesp++] = dne;
	assert(dnesp < MAXPATHLEN);
}

static int
popdne(void)
{
	int rv;

	rv = dnestack[--dnesp];
	assert(dnesp >= 0);
	return rv;
}

static int
copy(char *argv[], enum op type, int fts_options)
{
	struct stat to_stat;
	FTS *ftsp;
	FTSENT *curr;
	int base, dne, sval;
	int this_failed, any_failed;
	size_t nlen;
	char *p, *target_mid;

	base = 0;	/* XXX gcc -Wuninitialized (see comment below) */

	if ((ftsp = fts_open(argv, fts_options, NULL)) == NULL)
		err(EXIT_FAILURE, "%s", argv[0]);
		/* NOTREACHED */
	for (any_failed = 0; (curr = fts_read(ftsp)) != NULL;) {
		this_failed = 0;
		switch (curr->fts_info) {
		case FTS_NS:
		case FTS_DNR:
		case FTS_ERR:
			warnx("%s: %s", curr->fts_path,
					strerror(curr->fts_errno));
			this_failed = any_failed = 1;
			continue;
		case FTS_DC:			/* Warn, continue. */
			warnx("%s: directory causes a cycle", curr->fts_path);
			this_failed = any_failed = 1;
			continue;
		}

		/*
		 * If we are in case (2) or (3) above, we need to append the
                 * source name to the target name.
                 */
		if (type != FILE_TO_FILE) {
			if ((curr->fts_namelen +
			    to.target_end - to.p_path + 1) > MAXPATHLEN) {
				warnx("%s/%s: name too long (not copied)",
						to.p_path, curr->fts_name);
				this_failed = any_failed = 1;
				continue;
			}

			/*
			 * Need to remember the roots of traversals to create
			 * correct pathnames.  If there's a directory being
			 * copied to a non-existent directory, e.g.
			 *	cp -R a/dir noexist
			 * the resulting path name should be noexist/foo, not
			 * noexist/dir/foo (where foo is a file in dir), which
			 * is the case where the target exists.
			 *
			 * Also, check for "..".  This is for correct path
			 * concatentation for paths ending in "..", e.g.
			 *	cp -R .. /tmp
			 * Paths ending in ".." are changed to ".".  This is
			 * tricky, but seems the easiest way to fix the problem.
			 *
			 * XXX
			 * Since the first level MUST be FTS_ROOTLEVEL, base
			 * is always initialized.
			 */
			if (curr->fts_level == FTS_ROOTLEVEL) {
				if (type != DIR_TO_DNE) {
					p = strrchr(curr->fts_path, '/');
					base = (p == NULL) ? 0 :
					    (int)(p - curr->fts_path + 1);

					if (!strcmp(&curr->fts_path[base],
					    ".."))
						base += 1;
				} else
					base = curr->fts_pathlen;
			}

			p = &curr->fts_path[base];
			nlen = curr->fts_pathlen - base;
			target_mid = to.target_end;
			if (*p != '/' && target_mid[-1] != '/')
				*target_mid++ = '/';
			*target_mid = 0;

			if (target_mid - to.p_path + nlen >= PATH_MAX) {
				warnx("%s%s: name too long (not copied)",
				    to.p_path, p);
				this_failed = any_failed = 1;
				continue;
			}
			(void)strncat(target_mid, p, nlen);
			to.p_end = target_mid + nlen;
			*to.p_end = 0;
			STRIP_TRAILING_SLASH(to);
		}

		sval = Pflag ? lstat(to.p_path, &to_stat) : stat(to.p_path, &to_stat);
		/* Not an error but need to remember it happened */
		if (sval == -1)
			dne = 1;
		else {
			if (to_stat.st_dev == curr->fts_statp->st_dev &&
			    to_stat.st_ino == curr->fts_statp->st_ino) {
				warnx("%s and %s are identical (not copied).",
				    to.p_path, curr->fts_path);
				this_failed = any_failed = 1;
				if (S_ISDIR(curr->fts_statp->st_mode))
					(void)fts_set(ftsp, curr, FTS_SKIP);
				continue;
			}
			if (!S_ISDIR(curr->fts_statp->st_mode) &&
			    S_ISDIR(to_stat.st_mode)) {
		warnx("cannot overwrite directory %s with non-directory %s",
				    to.p_path, curr->fts_path);
				this_failed = any_failed = 1;
				continue;
			}
			dne = 0;
		}

		switch (curr->fts_statp->st_mode & S_IFMT) {
		case S_IFLNK:
			/* Catch special case of a non dangling symlink */
			if((fts_options & FTS_LOGICAL) ||
			   ((fts_options & FTS_COMFOLLOW) && curr->fts_level == 0)) {
				if (copy_file(curr, dne))
					this_failed = any_failed = 1;
			} else {
				if (copy_link(curr, !dne))
					this_failed = any_failed = 1;
			}
			break;
		case S_IFDIR:
			if (!Rflag && !rflag) {
				if (curr->fts_info == FTS_D)
					warnx("%s is a directory (not copied).",
					    curr->fts_path);
				(void)fts_set(ftsp, curr, FTS_SKIP);
				this_failed = any_failed = 1;
				break;
			}

                        /*
                         * Directories get noticed twice:
                         *  In the first pass, create it if needed.
                         *  In the second pass, after the children have been copied, set the permissions.
                         */
			if (curr->fts_info == FTS_D) /* First pass */
			{
				/*
				 * If the directory doesn't exist, create the new
				 * one with the from file mode plus owner RWX bits,
				 * modified by the umask.  Trade-off between being
				 * able to write the directory (if from directory is
				 * 555) and not causing a permissions race.  If the
				 * umask blocks owner writes, we fail..
				 */
				pushdne(dne);
				if (dne) {
					if (mkdir(to.p_path,
					    curr->fts_statp->st_mode | S_IRWXU) < 0)
						err(EXIT_FAILURE, "%s",
						    to.p_path);
						/* NOTREACHED */
				} else if (!S_ISDIR(to_stat.st_mode)) {
					errno = ENOTDIR;
					err(EXIT_FAILURE, "%s",
						to.p_path);
					/* NOTREACHED */
				}
			}
			else if (curr->fts_info == FTS_DP) /* Second pass */
			{
	                        /*
				 * If not -p and directory didn't exist, set it to be
				 * the same as the from directory, umodified by the
                        	 * umask; arguably wrong, but it's been that way
                        	 * forever.
				 */
				if (pflag && setfile(curr->fts_statp, 0))
					this_failed = any_failed = 1;
				else if ((dne = popdne()))
					(void)chmod(to.p_path,
					    curr->fts_statp->st_mode);
			}
			else
			{
				warnx("directory %s encountered when not expected.",
				    curr->fts_path);
				this_failed = any_failed = 1;
				break;
			}

			break;
		case S_IFBLK:
		case S_IFCHR:
			if (Rflag) {
				if (copy_special(curr->fts_statp, !dne))
					this_failed = any_failed = 1;
			} else
				if (copy_file(curr, dne))
					this_failed = any_failed = 1;
			break;
		case S_IFIFO:
			if (Rflag) {
				if (copy_fifo(curr->fts_statp, !dne))
					this_failed = any_failed = 1;
			} else
				if (copy_file(curr, dne))
					this_failed = any_failed = 1;
			break;
		default:
			if (copy_file(curr, dne))
				this_failed = any_failed = 1;
			break;
		}
		if (vflag && !this_failed)
			(void)printf("%s -> %s\n", curr->fts_path, to.p_path);
	}
	if (errno) {
		err(EXIT_FAILURE, "fts_read");
		/* NOTREACHED */
	}
	(void)fts_close(ftsp);
	return (any_failed);
}


text:
Pokemon-Showdown-Roleplaying-Bot
====================

A chat bot for [Pokémon Showdown][1]. This bot has a number of commands, some helpful and some less so, as well as the capability to mod. It only reacts to basic offences such as flooding/caps/stretching.

  [1]: http://www.pokemonshowdown.com/

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

[Click here][4] for an in-depth installation guide, courtesy of Rival Nick. Otherwise, basic instructions follow.

Pokémon Showdown Bot requires [node.js][2] to run.
This bot has not been tested on every `node.js` version possible, but has the same version requirements as [Pokémon Showdown][3]: either v0.6.3 through v0.8.22, or v0.10.2 and up.
Install `node.js` if you don't have it yet, try the last stable version.

Next up is cloning this bot. This can be done in two ways: cloning it via `git` or downloading as ZIP.
Downloading it as ZIP is the easy and lazy way, but is a lot less handy to update than cloning this repository.

To install dependencies, run:

    npm install

Copy `config-example.js` to `config.js` and edit the needed variables.
To change the commands that the bot responds to, edit `commands.js`.

Now, to start the bot, use:

    node mainrp.js

Some information will be shown, and will automatically join the room(s) you specified if no error occurs.

  [2]: http://nodejs.org/
  [3]: https://github.com/Zarel/Pokemon-Showdown
  [4]: https://github.com/RivalNick/PS-Bot/wiki/How-To-set-up-Bot

If any of your commands rely on information normally sent to the Pokémon Showdown Client (e.g. functions that execute based on PM that aren't directly related to normal commands), you will need to make changes to the message method in parser.js under the appropriate case.

Development
-----------

Everyone is more than welcome to contribute to the bot.
However, please refrain from adding more example commands.

Credits:
 - Morfent (Development)
 - TalkTakesTime (Development)
 - Quinella (Development)

License
-------

Pokémon Showdown Bot is distributed under the terms of the [MIT License][5].

  [5]: https://github.com/Quinella/Pokemon-Showdown-Bot/blob/master/LICENSE


text:
const PlotCard = require('../../plotcard.js');

class HereToServe extends PlotCard {
    setupCardAbilities() {
        this.whenRevealed({
            handler: () => {
                this.game.promptForDeckSearch(this.controller, {
                    activePromptTitle: 'Select a card',
                    cardCondition: card => card.hasTrait('Maester') && card.getPrintedCost() <= 3 && this.controller.canPutIntoPlay(card),
                    onSelect: (player, card) => this.cardSelected(player, card),
                    onCancel: player => this.doneSelecting(player),
                    source: this
                });
            }
        });
    }

    cardSelected(player, card) {
        this.game.addMessage('{0} uses {1} to search their deck and put {2} into play',
            player, this, card);
        player.putIntoPlay(card);
    }

    doneSelecting(player) {
        this.game.addMessage('{0} uses {1} to search their deck, but does not put any card into play',
            player, this);
    }
}

HereToServe.code = '02020';

module.exports = HereToServe;


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

    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
    <title>Statistics of nsubj:outer in UD_Ancient_Hebrew-PTNK</title>
    <link rel="root" href=""/>
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">
    <link rel="stylesheet" type="text/css" href="../../css/jquery-ui-redmond.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/style.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/style-vis.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/hint.css"/>

          home

          edit page
          issue tracker

          <gcse:search></gcse:search>

        This page pertains to UD version 2.

            It appears that you have Javascript disabled.
            Please consider enabling Javascript for this page to see the visualizations.

Treebank Statistics: UD_Ancient_Hebrew-PTNK: Relations: nsubj:outer

This relation is a language-specific subtype of <tt>nsubj</tt>.

7 nodes (0%) are attached to their parents as nsubj:outer.

7 instances of nsubj:outer (100%) are right-to-left (child precedes parent).
Average distance between parent and child is 2.14285714285714.

The following 1 pairs of parts of speech are connected with nsubj:outer: <tt>VERB</tt>-<tt>PRON</tt> (7; 100% instances).

# visual-style 9	bgColor:blue
# visual-style 9	fgColor:white
# visual-style 11	bgColor:blue
# visual-style 11	fgColor:white
# visual-style 11 9 nsubj:outer	color:blue
1	ו	ו	CCONJ	conj	_	8	cc	_	Ref=GEN_2.13
2	שׁם	שׁם	NOUN	subs	Gender=Masc|Number=Sing	8	nsubj	_	Ref=GEN_2.13
3	־	־	PUNCT	punct	_	5	punct	_	Ref=GEN_2.13|SpaceAfter=No
4	ה	ה	DET	art	PronType=Art	5	det	_	Ref=GEN_2.13
5	נהר	נהר	NOUN	subs	Gender=Masc|Number=Sing	2	compound:smixut	_	Ref=GEN_2.13
6	ה	ה	DET	art	PronType=Art	7	det	_	Ref=GEN_2.13
7	שׁני	שׁני	NUM	adjv	Gender=Masc|Number=Sing|NumType=Ord	5	nummod	_	Ref=GEN_2.13
8	גִּיחֹ֑ון	גיחון	PROPN	nmpr	Number=Sing	0	root	_	Ref=GEN_2.13
9	ה֣וּא	הוא	PRON	prps	Gender=Masc|Number=Sing|Person=3|PronType=Prs	11	nsubj:outer	_	Ref=GEN_2.13
10	ה	ה	SCONJ	art	_	11	mark	_	Ref=GEN_2.13
11	סבב	סבב	VERB	verb	Gender=Masc|HebBinyan=PAAL|Number=Sing|VerbForm=Part	8	parataxis	_	Ref=GEN_2.13
12	אֵ֖ת	את	ADP	prep	_	13	case	_	Ref=GEN_2.13
13	כָּל	כל	NOUN	subs	Gender=Masc|Number=Sing	11	obj	_	Ref=GEN_2.13|SpaceAfter=No
14	־	־	PUNCT	punct	_	15	punct	_	Ref=GEN_2.13|SpaceAfter=No
15	אֶ֥רֶץ	ארץ	NOUN	subs	Gender=Fem|Number=Sing	13	compound:smixut	_	Ref=GEN_2.13
16	כּֽוּשׁ	כושׁ	PROPN	nmpr	Number=Sing	15	compound:smixut	_	Ref=GEN_2.13|SpaceAfter=No
17	׃	׃	PUNCT	punct	_	8	punct	_	Ref=GEN_2.13

© 2014–2021
            Universal Dependencies contributors.
            Site powered by Annodoc and brat
.


text:
package org.hawkular.client.android.util;

import android.annotation.TargetApi;
import android.webkit.CookieManager;

/**
 * Cookie utilities.
 *
 * The main goal at this point is clearing cookies the right way on all supported OS versions.
 */
public final class Cookies {
    private Cookies() {
    }

    public static void clear() {
        if (Android.isLollipopOrLater()) {
            clearAfterLollipop();
        } else {
            clearBeforeLollipop();
        }
    }

    @TargetApi(Android.Versions.TARGET)
    private static void clearAfterLollipop() {
        CookieManager.getInstance().removeAllCookies(null);
    }

    @SuppressWarnings("deprecation")
    private static void clearBeforeLollipop() {
        CookieManager.getInstance().removeAllCookie();
    }
}


text:
package client

const (
	NodeStatusType                   = "nodeStatus"
	NodeStatusFieldAllocatable       = "allocatable"
	NodeStatusFieldCapacity          = "capacity"
	NodeStatusFieldConditions        = "conditions"
	NodeStatusFieldExternalIPAddress = "externalIpAddress"
	NodeStatusFieldHostname          = "hostname"
	NodeStatusFieldIPAddress         = "ipAddress"
	NodeStatusFieldInfo              = "info"
	NodeStatusFieldLimits            = "limits"
	NodeStatusFieldNodeAnnotations   = "nodeAnnotations"
	NodeStatusFieldNodeConfig        = "rkeNode"
	NodeStatusFieldNodeLabels        = "nodeLabels"
	NodeStatusFieldNodeName          = "nodeName"
	NodeStatusFieldNodeTaints        = "nodeTaints"
	NodeStatusFieldRequested         = "requested"
	NodeStatusFieldVolumesAttached   = "volumesAttached"
	NodeStatusFieldVolumesInUse      = "volumesInUse"
)

type NodeStatus struct {
	Allocatable       map[string]string         `json:"allocatable,omitempty" yaml:"allocatable,omitempty"`
	Capacity          map[string]string         `json:"capacity,omitempty" yaml:"capacity,omitempty"`
	Conditions        []NodeCondition           `json:"conditions,omitempty" yaml:"conditions,omitempty"`
	ExternalIPAddress string                    `json:"externalIpAddress,omitempty" yaml:"externalIpAddress,omitempty"`
	Hostname          string                    `json:"hostname,omitempty" yaml:"hostname,omitempty"`
	IPAddress         string                    `json:"ipAddress,omitempty" yaml:"ipAddress,omitempty"`
	Info              *NodeInfo                 `json:"info,omitempty" yaml:"info,omitempty"`
	Limits            map[string]string         `json:"limits,omitempty" yaml:"limits,omitempty"`
	NodeAnnotations   map[string]string         `json:"nodeAnnotations,omitempty" yaml:"nodeAnnotations,omitempty"`
	NodeConfig        *RKEConfigNode            `json:"rkeNode,omitempty" yaml:"rkeNode,omitempty"`
	NodeLabels        map[string]string         `json:"nodeLabels,omitempty" yaml:"nodeLabels,omitempty"`
	NodeName          string                    `json:"nodeName,omitempty" yaml:"nodeName,omitempty"`
	NodeTaints        []Taint                   `json:"nodeTaints,omitempty" yaml:"nodeTaints,omitempty"`
	Requested         map[string]string         `json:"requested,omitempty" yaml:"requested,omitempty"`
	VolumesAttached   map[string]AttachedVolume `json:"volumesAttached,omitempty" yaml:"volumesAttached,omitempty"`
	VolumesInUse      []string                  `json:"volumesInUse,omitempty" yaml:"volumesInUse,omitempty"`
}


text:
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**finalizers** | [**list[V1FinalizerName]**](V1FinalizerName.md) | Finalizers is an opaque list of values that must be empty to permanently remove object from storage. More info: http://releases.k8s.io/release-1.2/docs/design/namespaces.md#finalizers | [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:
// Copyright 2022 Google LLC
//
// 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.

#include "config.h"

#include "pcie_bifurcation.hpp"

#include "commands.hpp"
#include "errors.hpp"
#include "handler.hpp"

#include <fmt/format.h>

#include <ipmid/api-types.hpp>
#include <span>
#include <vector>

namespace google
{
namespace ipmi
{

namespace
{
#ifndef MAX_IPMI_BUFFER
#define MAX_IPMI_BUFFER 64
#endif
} // namespace

struct PcieBifurcationRequest
{
    uint8_t pcieIndex;
} __attribute__((packed));

Resp pcieBifurcation(std::span<const uint8_t> data, HandlerInterface* handler)
{
    if (data.size() < sizeof(struct PcieBifurcationRequest))
    {
        fmt::print(stderr, "Invalid command length: {}\n",
                   static_cast<uint32_t>(data.size()));
        return ::ipmi::responseReqDataLenInvalid();
    }

    auto bifurcation = handler->pcieBifurcation(/*index=*/data[0]);

    int length = sizeof(struct PcieBifurcationReply) + bifurcation.size();

    if (length > MAX_IPMI_BUFFER)
    {
        std::fprintf(stderr, "Response would overflow response buffer\n");
        return ::ipmi::responseInvalidCommand();
    }

    std::vector<std::uint8_t> reply;
    reply.reserve(bifurcation.size() + sizeof(struct PcieBifurcationReply));
    reply.emplace_back(bifurcation.size()); /* bifurcationLength */
    reply.insert(reply.end(), bifurcation.begin(),
                 bifurcation.end()); /* bifurcation */

    return ::ipmi::responseSuccess(SysOEMCommands::SysPCIeSlotBifurcation,
                                   reply);
}
} // namespace ipmi
} // namespace google


text:
package me.money.type.logn;

import java.util.Arrays;

public class MyBinarySearch {
	public static void main(String[] args) {
		int arr[] = new int[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
		int index = search(arr, 0, arr.length, 8);
		System.out.println(index);

		Arrays.binarySearch(arr, 1);
	}

	public static int search(int[] searcharry, int start, int end, int value) {
		int mid = (start + end) / 2;
		if (start > end) {
			return -1;
		}
		int midvalue = searcharry[mid];

		if (value == midvalue) {
			return mid;
		} else if (value > midvalue) {
			return search(searcharry, mid + 1, end, value);
		} else if (value < midvalue) {
			return search(searcharry, start, mid - 1, value);
		}

		return -1;
	}
}


text:
title: "Проверка заданий тестами"
permalink: /docs/pytest/
excerpt: "pytest"
---

Начиная с раздела "Функции" (09_functions) для проверки заданий используются автоматические тесты.
Они помогают проверить все ли соответствует поставленной задаче, а также дают обратный отклик
по тому, что не соответствует задаче.
Как правило, после первого периода адаптации к тестам, становится проще делать задания с тестами.

Помимо перечисленных выше положительных моментов, в тестах также можно посмотреть какой итоговый
результат нужен: прояснить структуру данных и мелочи, которые могут влиять на результат.

Для запуска тестов используется pytest - фреймворк для написания тестов.

> [Запись лекции по использованию pytest для проверки заданий](https://youtu.be/TI6-vFFV9lk)

## Короткая шпаргалка по pytest

[Шпаргалка по pytest для курса](https://pyneng.github.io/docs/pytest-cheatsheet/)

## Основы pytest

[Основы pytest рассматриваются на отдельной странице](https://pyneng.github.io/docs/pytest-basics/)

## Особенности использования pytest для проверки заданий

На курсе pytest используется, в первую очередь, для самопроверки заданий.
Однако, эта проверка не является опциональной - задание считается сделанным,
когда оно соблюдает все указанные пункты и проходит тесты.
Со своей стороны, я тоже сначала проверяю задания автоматическими тестами,
а затем уже смотрю код, пишу комментарии, если нужно и показываю вариант решения.

Поначалу тесты требуют усилий, но через пару разделов, они будут помогать в решении заданий.

> Очень важный момент: тесты, которые написаны для заданий курса, не являются
> эталоном или best practice написания тестов. Тесты написаны с максимальным
> упором на понятность и многие вещи принято делать по-другому.

При решении заданий, особенно, когда есть сомнения по поводу итогового формата данных,
которые должны быть получены, лучше посмтреть в тест.
Например, если задание task_9_1.py, то соответствующий тест будет в файле
test_task_9_1.py.

Пример теста test_task_9_1.py:

```python
import pytest
import task_9_1
import sys
sys.path.append('..')

from common_functions import check_function_exists, check_function_params

# Проверяет создана ли функция generate_access_config в задании task_9_1
def test_function_created():
    check_function_exists(task_9_1, 'generate_access_config')

# Проверяет параметры функции
def test_function_params():
    check_function_params(function=task_9_1.generate_access_config,
                          param_count=2, param_names=['intf_vlan_mapping', 'access_template'])

def test_function_return_value():
    access_vlans_mapping = {
        'FastEthernet0/12': 10,
        'FastEthernet0/14': 11,
        'FastEthernet0/16': 17
    }
    template_access_mode = [
        'switchport mode access', 'switchport access vlan',
        'switchport nonegotiate', 'spanning-tree portfast',
        'spanning-tree bpduguard enable'
    ]
    correct_return_value = ['interface FastEthernet0/12',
                            'switchport mode access',
                            'switchport access vlan 10',
                            'switchport nonegotiate',
                            'spanning-tree portfast',
                            'spanning-tree bpduguard enable',
                            'interface FastEthernet0/14',
                            'switchport mode access',
                            'switchport access vlan 11',
                            'switchport nonegotiate',
                            'spanning-tree portfast',
                            'spanning-tree bpduguard enable',
                            'interface FastEthernet0/16',
                            'switchport mode access',
                            'switchport access vlan 17',
                            'switchport nonegotiate',
                            'spanning-tree portfast',
                            'spanning-tree bpduguard enable']

    return_value = task_9_1.generate_access_config(access_vlans_mapping, template_access_mode)
    assert return_value != None, "Функция ничего не возвращает"
    assert type(return_value) == list, "Функция должна возвращать список"
    assert return_value == correct_return_value, "Функция возвращает неправильное значение"
```

Обратите внимание на переменную correct_return_value - в этой переменной содержится итоговый
список, который должна возвращать функция generate_access_config.
Поэтому, если, к примеру, по мере выполнения задания, возник вопрос надо ли добавлять пробелы
перед командами или перевод строки в конце, можно посмотреть в тесте, что именно требуется в
результате. А также сверить свой вывод, с выводом в переменной correct_return_value.

### Как запускать тесты для проверки заданий

Самое главное, это откуда надо запускать тесты: все тесты надо запускать из
каталога с заданиями раздела. Например, в разделе 09_functions, такая структура каталога с заданиями:

```
[~/repos/pyneng-7/pyneng-online-may-aug-2019/exercises/09_functions]
vagrant: [master|✔]
$ tree
.

├── config_r1.txt
├── config_sw1.txt
├── config_sw2.txt
├── conftest.py
├── task_9_1a.py
├── task_9_1.py
├── task_9_2a.py
├── task_9_2.py
├── task_9_3a.py
├── task_9_3.py
├── task_9_4.py
├── test_task_9_1a.py
├── test_task_9_1.py
├── test_task_9_2a.py
├── test_task_9_2.py
├── test_task_9_3a.py
├── test_task_9_3.py
└── test_task_9_4.py
```

Запускать тесты, в этом случае, надо из каталога 09_functions:

```
[~/repos/pyneng-7/pyneng-online-may-aug-2019/exercises/09_functions]
vagrant: [master|✔]
$ pytest test_task_9_1.py
========================= test session starts ==========================
platform linux -- Python 3.7.3, pytest-4.6.2, py-1.5.2, pluggy-0.12.0
rootdir: /home/vagrant/repos/pyneng-7/pyneng-online-may-aug-2019/exercises/09_functions
collected 3 items

test_task_9_1.py ...                                       [100%]
...
```

### conftest.py

Кроме каталога test, к тестами относится и файл conftest.py - это специальный файл,
в котором можно писать функции (а точнее фикстуры) общие для раных тестов.
Например, в этот файл вынесены функции, которые подключаются по SSH/Telnet к оборудованию.

### pytest.ini

Это конфигурационный файл pytest.

### Полезные команды

Запуск одного теста:

```
$ pytest test_task_9_1.py
```

Запуск одного теста с более подробным выводом информации (показывает diff между данными в тесте и тем, что получено из функции):

```
$ pytest test_task_9_1.py -vv
```

Запуск всех тестов одного раздела:

```
[~/repos/pyneng-7/pyneng-online-may-aug-2019/exercises/09_functions]
vagrant: [master|✔]
$ pytest
============================ test session starts =============================
platform linux -- Python 3.6.3, pytest-4.6.2, py-1.5.2, pluggy-0.12.0
rootdir: /home/vagrant/repos/pyneng-7/pyneng-online-may-aug-2019/exercises/09_functions
collected 21 items

test_task_9_1.py ..F                                             [ 14%]
test_task_9_1a.py FFF                                            [ 28%]
test_task_9_2.py FFF                                             [ 42%]
test_task_9_2a.py FFF                                            [ 57%]
test_task_9_3.py FFF                                             [ 71%]
test_task_9_3a.py FFF                                            [ 85%]
test_task_9_4.py FFF                                             [100%]

...
```

Запуск всех тестов одного раздела с отображением сообщений об ошибках в одну строку:

```
$ pytest --tb=line
```


text:
include $(THEOS)/makefiles/common.mk

BUNDLE_NAME = ProxySwitcher
ADDITIONAL_OBJCFLAGS = -fobjc-arc
ProxySwitcher_FILES = MBRootListController.m
ProxySwitcher_INSTALL_PATH = /Library/PreferenceBundles
ProxySwitcher_FRAMEWORKS = UIKit
ProxySwitcher_PRIVATE_FRAMEWORKS = Preferences

include $(THEOS_MAKE_PATH)/bundle.mk

internal-stage::
	$(ECHO_NOTHING)mkdir -p $(THEOS_STAGING_DIR)/Library/PreferenceLoader/Preferences$(ECHO_END)
	$(ECHO_NOTHING)cp entry.plist $(THEOS_STAGING_DIR)/Library/PreferenceLoader/Preferences/ProxySwitcher.plist$(ECHO_END)


text:
package com.pgssoft.prestige.model.exceptions;

/**
 * Created by tzielinski on 2014-11-14.
 */

/**
 * Exception thrown while doing an illegal move on the game state.
 */
public class InvalidMoveException extends RuntimeException {

    public InvalidMoveException(String s) {
        super(s);
    }
}


text:
/**
 * usePseudoElements
 * 伪元素选择器只保留一个冒号,兼容低级浏览器。
 */
var utils = require('../utils');

function usePseudoElements(cssRule) {
  if (cssRule.selector.match(utils.regAllPseudo)) {
    cssRule.selector = cssRule.selector.replace(/::/g, ':');
  }
}

module.exports = usePseudoElements;


text:
(function () {

  $('form').vulcanval({
    disableHTML5Validation: true,
    fields: [{
      name: 'email',
      required: true,
      validators: {
        isEmail: true,
        isLength: { min: 4, max: 32 }
      }
    }, {
      name: 'pass',
      required: true,
      validators: {
        isAlphanumeric: true,
        isLength: { min: 4, max: 32 }
      }
    }]
  });

  // The display elements are where we show error messages and in this example,
  // for each field they are configured as HTML attributes.

})();


text:
   SELECT USER FROM HU.ECCO;
-- RERUN if USER value does not match preceding AUTHORIZATION comment
   ROLLBACK WORK;

-- date_time print

-- TEST:7526 GRANT USAGE on character set, WITH GRANT OPTION!

   CREATE DOMAIN CD CHAR(3) CHARACTER SET CTS1.CS;
-- PASS:7526 If domain created successfully?

   COMMIT WORK;

   SELECT COUNT (*)
     FROM INFORMATION_SCHEMA.DOMAINS
     WHERE DOMAIN_NAME = 'CD' AND DOMAIN_SCHEMA = 'CTS4';
-- PASS:7526 If COUNT = 1?

   COMMIT WORK;

   CREATE TABLE TC
     ( TCC CD);
-- PASS:7526 If table created successfully?

   COMMIT WORK;

   INSERT INTO TC VALUES (_CTS1.CS 'ghi');
-- PASS:7526 If 1 row inserted successfully?

   SELECT COUNT (*) FROM TC;
-- PASS:7526 If COUNT = 1?

   COMMIT WORK;

   DROP TABLE TC CASCADE;
-- PASS:7526 If table dropped successfully?

   COMMIT WORK;

   DROP DOMAIN CD CASCADE;
-- PASS:7526 If domain dropped successfully?

   COMMIT WORK;

-- END TEST >>> 7526 <<< END TEST
-- *********************************************
-- *************************************************////END-OF-MODULE


text:
import factories from "../api"

export default (opts) => {
  const { greenhouseLoaderWithoutAuthenticationFactory } = factories(opts)
  const greenhouseLoader = greenhouseLoaderWithoutAuthenticationFactory

  return {
    jobsLoader: greenhouseLoader("jobs?content=true"),
    jobLoader: greenhouseLoader((id) => `jobs/${id}`),
    departmentsLoader: greenhouseLoader("departments"),
  }
}


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

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>ExtensionSchemeImpl (Media Authoring with Java API)</title>
<meta name="date" content="2016-02-05">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Media Authoring with Java API (MAJ)

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

tv.amwa.maj.meta.impl

Class ExtensionSchemeImpl

java.lang.Object

tv.amwa.maj.meta.impl.ExtensionSchemeImpl

All Implemented Interfaces:

Serializable, Cloneable, MetadataObject, WeakReferenceTarget, ExtensionScheme

@MediaClass(uuid1=218169601,
            uuid2=550,
            uuid3=0,
            uuid4={6,14,43,52,2,6,1,1},
            definedName="ExtensionScheme",
            symbol="ExtensionScheme",
            description="Groups together a collection of meta definitions for an extension to a file and provides a globally unique identifier for the collection.",
            namespace="http://www.smpte-ra.org/schemas/2001-2/2007/aaf",
            prefix="aaf")
public class ExtensionSchemeImpl
extends Object
implements ExtensionScheme, Cloneable, Serializable, MetadataObject, WeakReferenceTarget

See Also:

Serialized Form

Constructor Summary

Constructors

Constructor and Description

ExtensionSchemeImpl()

Method Summary

All Methods Instance Methods Concrete Methods

Modifier and Type
Method and Description

void
addMetaDefinition(MetaDefinition metaDefinition)

Add a meta definition to the set of definitions that form this extension
 scheme.

void
clearMetaDefinitions()

Clear all the meta definitions from this extensions scheme, omitting this optional property.

ExtensionScheme
clone()

Create a cloned copy of this extension scheme.

boolean
containsMetaDefinition(AUID metaDefinitionID)

Determines whether the given identifier is for a meta definition that is present
 within those that make up this extension scheme.

boolean
containsMetaDefinition(MetaDefinition metaDefinition)

Determines whether the given meta definition is present within those that make up this
 extension scheme.

boolean
containsMetaDefinition(String metaDefinitionName)

Determines whether the given name is for a meta definition that is present
 within those that make up this extension scheme.

int
countMetaDefinitions()

Count the number of meta definitions in this extensions scheme.

boolean
deepEquals(Object o)

boolean
equals(Object o)

AUID
getAUID()

Returns the unique identifier of the target of the reference.

String
getExtensionDescription()

Returns the description of the extension scheme.

Set<MetaDefinition>
getMetaDefinitions()

Returns the set of meta definitions that form the extensions scheme.

String
getPreferredPrefix()

Returns the preferred namespace tag when SMPTE Reg-XML encoding is used.

AUID
getSchemeID()

Returns the globally unique identification of the extension scheme.

String
getSchemeURI()

Returns the namespace URI for the extension scheme.

String
getWeakTargetReference()

Provides a name that can be used to make a weak object reference to an
 instance of the implementing class.

int
hashCode()

MetaDefinition
lookupMetaDefinition(AUID metaDefinitionID)

Lookup a meta definition within this extension scheme by its identifier.

MetaDefinition
lookupMetaDefinition(String metaDefinitionName)

Lookup a meta definition within this extension scheme by its name.

AUID
lookupMetaDefinitionIdentifier(String metaDefinitionName)

Lookup the identifier of a meta definition in this extension scheme from
 its name.

boolean
removeMetaDefinition(AUID metaDefinitionID)

Remove the identified meta definition from those that make up this
 extension scheme.

boolean
removeMetaDefinition(MetaDefinition metaDefinition)

Remove the given meta definition from those that make up this
 extension scheme.

void
setExtensionDescription(String extensionDescription)

Sets the description of the extension scheme.

void
setPreferredPrefix(String preferredPrefix)

Sets the preferred namespace tag when SMPTE Reg-XML encoding is used.

void
setSchemeID(AUID schemeID)

Sets the globally unique identification of the extensions scheme.

void
setSchemeURI(String schemeURI)

Sets the namespace URI for the extension scheme.

String
toString()

Methods inherited from class java.lang.Object

getClass, notify, notifyAll, wait, wait, wait

Constructor Detail

ExtensionSchemeImpl

public ExtensionSchemeImpl()

Method Detail

getSchemeID

@MediaProperty(uuid1=100729095,
               uuid2=6912,
               uuid3=0,
               uuid4={6,14,43,52,1,1,1,13},
               definedName="SchemeID",
               aliases="ExtensionSchemeID",
               typeName="AUID",
               optional=false,
               uniqueIdentifier=true,
               pid=36,
               symbol="SchemeID",
               description="Globally unique identification of the extension scheme.")
public AUID getSchemeID()

Description copied from interface: ExtensionScheme

Returns the globally unique identification of the extension scheme.

Specified by:

getSchemeID in interface ExtensionScheme

Returns:

Globally unique identification of the extensions scheme.

See Also:

ExtensionScheme.getSchemeURI(),
ApplicationPluginObject.getApplicationScheme(),
Preface.getApplicationSchemes(),
Preface.getDescriptiveSchemes()

setSchemeID

@MediaPropertySetter(value="SchemeID")
public void setSchemeID(AUID schemeID)
                                                        throws NullPointerException

Description copied from interface: ExtensionScheme

Sets the globally unique identification of the extensions scheme. An extension
 scheme may be used as part of an application metadata plugin or
 descriptive framework.

Specified by:

setSchemeID in interface ExtensionScheme

Parameters:

schemeID - Globally unique identification of the extensions scheme.

Throws:

NullPointerException - Cannot set the scheme identifier using a null
 value.

See Also:

ExtensionScheme.setSchemeURI(String),
tv.amwa.maj.model.ApplicationPluginObject#setApplicationScheme(AUID),
Preface.getApplicationSchemes(),
Preface.getDescriptiveSchemes()

getAUID

public AUID getAUID()

Description copied from interface: WeakReferenceTarget

Returns the unique identifier of the target of the reference.

Specified by:

getAUID in interface WeakReferenceTarget

Returns:

Unique identifier of the target of the reference.

getSchemeURI

@MediaProperty(uuid1=100729095,
               uuid2=7168,
               uuid3=0,
               uuid4={6,14,43,52,1,1,1,13},
               definedName="SchemeURI",
               aliases={"ExtensionSchemeURI","SymbolSpaceURI","ExtensionSymbolSpaceURI"},
               typeName="UTF16String",
               optional=false,
               uniqueIdentifier=false,
               pid=37,
               symbol="SchemeURI",
               description="Namespace URI for the extension scheme.")
public String getSchemeURI()

Description copied from interface: ExtensionScheme

Returns the namespace URI for the extension scheme.

Specified by:

getSchemeURI in interface ExtensionScheme

Returns:

Namespace URI for the extension scheme.

See Also:

ExtensionScheme.getSchemeID(),
MetaDefinition.getNamespace(),
MediaClass.namespace(),
MediaProperty.namespace()

setSchemeURI

@MediaPropertySetter(value="SchemeURI")
public void setSchemeURI(String schemeURI)
                                                          throws NullPointerException

Description copied from interface: ExtensionScheme

Sets the namespace URI for the extension scheme.

Specified by:

setSchemeURI in interface ExtensionScheme

Parameters:

schemeURI - Namespace URI for the extension scheme.

Throws:

NullPointerException - Cannot set the scheme identifier using a null
 value.

See Also:

ExtensionScheme.setSchemeID(AUID),
MetaDefinition.setNamespace(String),
MediaClass.namespace(),
MediaProperty.namespace()

getPreferredPrefix

@MediaProperty(uuid1=100729095,
               uuid2=7424,
               uuid3=0,
               uuid4={6,14,43,52,1,1,1,13},
               definedName="PreferredPrefix",
               typeName="UTF16String",
               optional=true,
               uniqueIdentifier=false,
               pid=38,
               symbol="PreferredPrefix",
               description="Preferred namespace tag when SMPTE Reg-XML encoding is used.")
public String getPreferredPrefix()
                                                                                throws PropertyNotPresentException

Description copied from interface: ExtensionScheme

Returns the preferred namespace tag when SMPTE Reg-XML encoding is used. This is an
 optional property.

Specified by:

getPreferredPrefix in interface ExtensionScheme

Returns:

Preferred namespace tag when SMPTE Reg-XML encoding is used.

Throws:

PropertyNotPresentException - The optional preferred prefix property is
 not present for this extension scheme.

See Also:

ExtensionScheme.getSchemeURI(),
MetaDefinition.getPrefix(),
MediaClass.prefix(),
MediaProperty.prefix()

setPreferredPrefix

@MediaPropertySetter(value="PreferredPrefix")
public void setPreferredPrefix(String preferredPrefix)

Description copied from interface: ExtensionScheme

Sets the preferred namespace tag when SMPTE Reg-XML encoding is used. Set this optional
 property to null to omit it.

Specified by:

setPreferredPrefix in interface ExtensionScheme

Parameters:

preferredPrefix - Preferred namespace tag when SMPTE Reg-XML encoding is used.

See Also:

ExtensionScheme.setSchemeURI(String),
MediaClass.prefix(),
MediaProperty.prefix()

getExtensionDescription

@MediaProperty(uuid1=100729095,
               uuid2=7680,
               uuid3=0,
               uuid4={6,14,43,52,1,1,1,13},
               definedName="ExtensionDescription",
               aliases="Description",
               typeName="UTF16String",
               optional=true,
               uniqueIdentifier=false,
               pid=39,
               symbol="ExtensionDescription",
               description="Description of the extension scheme.")
public String getExtensionDescription()
                                                                                throws PropertyNotPresentException

Description copied from interface: ExtensionScheme

Returns the description of the extension scheme. This is an optional property.

Specified by:

getExtensionDescription in interface ExtensionScheme

Returns:

Description of the extension scheme.

Throws:

PropertyNotPresentException - The optional description property of the extension scheme is
 not present.

setExtensionDescription

@MediaPropertySetter(value="ExtensionDescription")
public void setExtensionDescription(String extensionDescription)

Description copied from interface: ExtensionScheme

Sets the description of the extension scheme. Set this optional property to null
 to omit it.

Specified by:

setExtensionDescription in interface ExtensionScheme

Parameters:

extensionDescription - Description of the extension scheme.

getMetaDefinitions

@MediaProperty(uuid1=100729095,
               uuid2=7936,
               uuid3=0,
               uuid4={6,14,43,52,1,1,1,13},
               definedName="MetaDefinitions",
               typeName="MetaDefinitionStrongReferenceSet",
               optional=true,
               uniqueIdentifier=false,
               pid=40,
               symbol="MetaDefinitions",
               description="Set of meta definitions that form the extensions scheme. The meta definitions are the class definitions, property definitions and type definitions} that define extensions classes and properties for use in descriptive frameworks, descriptive objects, application plugin objects and application referenced objects.")
public Set<MetaDefinition> getMetaDefinitions()
                                                                                throws PropertyNotPresentException

Description copied from interface: ExtensionScheme

Returns the set of meta definitions that form the extensions scheme.
 The meta definitions are the class definitions,
 property definitions and type definitions
 that define extensions classes and properties for use in:

descriptive frameworks;

descriptive objects;

application plugin objects;

application referenced objects.

This is an optional property, although omitting it and defining an empty scheme would not make
 much sense.

Specified by:

getMetaDefinitions in interface ExtensionScheme

Returns:

Set of meta definitions that form the extensions scheme.

Throws:

PropertyNotPresentException - The optional meta definitions property is not present for this
 extension scheme.

addMetaDefinition

@MediaSetAdd(value="MetaDefinitions")
public void addMetaDefinition(MetaDefinition metaDefinition)
                                                             throws NullPointerException

Description copied from interface: ExtensionScheme

Add a meta definition to the set of definitions that form this extension
 scheme.

Specified by:

addMetaDefinition in interface ExtensionScheme

Parameters:

metaDefinition - Meta definition to add to the scheme.

Throws:

NullPointerException - Cannot use a null value to add to the set of meta
 definitions.

See Also:

ExtensionScheme.getMetaDefinitions()

clearMetaDefinitions

@MediaPropertyClear(value="MetaDefinitions")
public void clearMetaDefinitions()

Description copied from interface: ExtensionScheme

Clear all the meta definitions from this extensions scheme, omitting this optional property.

Specified by:

clearMetaDefinitions in interface ExtensionScheme

See Also:

ExtensionScheme.getMetaDefinitions()

containsMetaDefinition

@MediaPropertyContains(value="MetaDefinitions")
public boolean containsMetaDefinition(MetaDefinition metaDefinition)
                                                                               throws NullPointerException

Description copied from interface: ExtensionScheme

Determines whether the given meta definition is present within those that make up this
 extension scheme.

Specified by:

containsMetaDefinition in interface ExtensionScheme

Parameters:

metaDefinition - Meta definition to check for.

Returns:

Is the meta definition defined by this extension scheme?

Throws:

NullPointerException - Cannot use a null value to check for a meta definition.

See Also:

ExtensionScheme.containsMetaDefinition(AUID),
ExtensionScheme.containsMetaDefinition(String),
ExtensionScheme.getMetaDefinitions()

containsMetaDefinition

public boolean containsMetaDefinition(AUID metaDefinitionID)
                               throws NullPointerException

Description copied from interface: ExtensionScheme

Determines whether the given identifier is for a meta definition that is present
 within those that make up this extension scheme.

Specified by:

containsMetaDefinition in interface ExtensionScheme

Returns:

Is the identified meta definition defined by this extension scheme?

Throws:

NullPointerException - Cannot use a null value to check for a meta definition.

See Also:

ExtensionScheme.containsMetaDefinition(MetaDefinition),
ExtensionScheme.containsMetaDefinition(String),
ExtensionScheme.getMetaDefinitions()

containsMetaDefinition

public boolean containsMetaDefinition(String metaDefinitionName)
                               throws NullPointerException

Description copied from interface: ExtensionScheme

Determines whether the given name is for a meta definition that is present
 within those that make up this extension scheme.

Specified by:

containsMetaDefinition in interface ExtensionScheme

Returns:

Is the named meta definition defined by this extension scheme?

Throws:

NullPointerException - Cannot use a null value to check for a meta definition.

See Also:

ExtensionScheme.containsMetaDefinition(MetaDefinition),
ExtensionScheme.containsMetaDefinition(AUID),
ExtensionScheme.getMetaDefinitions()

lookupMetaDefinition

public MetaDefinition lookupMetaDefinition(AUID metaDefinitionID)
                                    throws NullPointerException

Description copied from interface: ExtensionScheme

Lookup a meta definition within this extension scheme by its identifier.

Specified by:

lookupMetaDefinition in interface ExtensionScheme

Parameters:

metaDefinitionID - Identifier of the meta definition to find in the extension scheme.

Returns:

Meta definition with the given identifier, or null if no matching meta definition could be
 found.

Throws:

NullPointerException - Cannot look for a meta definition using a null value.

See Also:

ExtensionScheme.lookupMetaDefinition(String),
ExtensionScheme.lookupMetaDefinitionIdentifier(String),
ExtensionScheme.getMetaDefinitions()

lookupMetaDefinition

public MetaDefinition lookupMetaDefinition(String metaDefinitionName)
                                    throws NullPointerException

Description copied from interface: ExtensionScheme

Lookup a meta definition within this extension scheme by its name.

Specified by:

lookupMetaDefinition in interface ExtensionScheme

Parameters:

metaDefinitionName - Name of the meta definition to find in the extension scheme.

Returns:

Meta definition with the given name, or null if no matching meta definition could be
 found.

Throws:

NullPointerException - Cannot look for a meta definition using a null value.

See Also:

ExtensionScheme.lookupMetaDefinition(AUID),
ExtensionScheme.lookupMetaDefinitionIdentifier(String),
ExtensionScheme.getMetaDefinitions()

lookupMetaDefinitionIdentifier

public AUID lookupMetaDefinitionIdentifier(String metaDefinitionName)
                                    throws NullPointerException

Description copied from interface: ExtensionScheme

Lookup the identifier of a meta definition in this extension scheme from
 its name.

Specified by:

lookupMetaDefinitionIdentifier in interface ExtensionScheme

Parameters:

metaDefinitionName - Name of the meta definition to find in the extension scheme.

Returns:

Identifier of the named meta definition.

Throws:

NullPointerException - Cannot look for a meta definition using a null value.

See Also:

ExtensionScheme.lookupMetaDefinition(AUID),
ExtensionScheme.lookupMetaDefinition(String),
ExtensionScheme.getMetaDefinitions()

countMetaDefinitions

@MediaPropertyCount(value="MetaDefinitions")
public int countMetaDefinitions()

Description copied from interface: ExtensionScheme

Count the number of meta definitions in this extensions scheme.

Specified by:

countMetaDefinitions in interface ExtensionScheme

Returns:

Number of meta definitions in this extensions scheme.

See Also:

ExtensionScheme.getMetaDefinitions()

removeMetaDefinition

@MediaPropertyRemove(value="MetaDefinitions")
public boolean removeMetaDefinition(MetaDefinition metaDefinition)
                                                                           throws NullPointerException

Description copied from interface: ExtensionScheme

Remove the given meta definition from those that make up this
 extension scheme.

Specified by:

removeMetaDefinition in interface ExtensionScheme

Parameters:

metaDefinition - Meta definition to remove.

Returns:

Was the meta definition successfully removed from the set? Returns false if
 the meta definition was not part of this extension scheme.

Throws:

NullPointerException - Cannot remove a meta definition using a null value.

See Also:

ExtensionScheme.removeMetaDefinition(AUID),
ExtensionScheme.getMetaDefinitions()

removeMetaDefinition

public boolean removeMetaDefinition(AUID metaDefinitionID)
                             throws NullPointerException

Description copied from interface: ExtensionScheme

Remove the identified meta definition from those that make up this
 extension scheme.

Specified by:

removeMetaDefinition in interface ExtensionScheme

Returns:

Was the meta definition successfully removed from the set? Returns false if
 the meta definition was not part of this extension scheme.

Throws:

NullPointerException - Cannot remove a meta definition using a null value.

See Also:

ExtensionScheme.removeMetaDefinition(MetaDefinition),
ExtensionScheme.getMetaDefinitions()

getWeakTargetReference

public String getWeakTargetReference()

Description copied from interface: WeakReferenceTarget

Provides a name that can be used to make a weak object reference to an
 instance of the implementing class.

Specified by:

getWeakTargetReference in interface WeakReferenceTarget

Returns:

A name to use to make weak reference to this object.

hashCode

public int hashCode()

Overrides:

hashCode in class Object

toString

public String toString()

Overrides:

toString in class Object

equals

public boolean equals(Object o)

Overrides:

equals in class Object

deepEquals

public boolean deepEquals(Object o)

clone

public ExtensionScheme clone()

Description copied from interface: ExtensionScheme

Create a cloned copy of this extension scheme.

Specified by:

clone in interface ExtensionScheme

Overrides:

clone in class Object

Returns:

Cloned copy of this extension scheme.

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Media Authoring with Java API (MAJ)

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

(c)2007-2016 Richard Cartwright, all rights reserved. Licensed 						under Apache 2 license and subject to the AMWA IPR policy.


text:
package com.todo.pic.presentation.view;

import android.content.Context;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.picomponent.R;

/**
 * Created by liwei5 on 2017/9/8.
 */

public class HomeTabManager implements View.OnClickListener{

    private Context mContext;
    private View rootView;
    private TabOnClickListener mTabOnClickListener;
    public HomeTabManager(Context context, View rootView, TabOnClickListener listener){
        this.mContext = context;
        this.rootView = rootView;
        this.mTabOnClickListener = listener;
        initView();
    }
    private View mShelfRl,mStoreRl,mFreeRl,mSpaceRl;
    private ImageView mShelfIv,mStoreIv,mFreeIv,mSpaceIv;
    private TextView mShelfTv,mStoreTv,mFreeTv,mSpaceTv;
    private TextView mShelfPointTv,mStorePointTv,mFreePointTv,mSpacePointTv;
    private void initView(){
        mShelfRl = rootView.findViewById(R.id.home_shelf_rl);
        mShelfRl.setOnClickListener(this);
        mStoreRl = rootView.findViewById(R.id.home_store_rl);
        mStoreRl.setOnClickListener(this);
        mFreeRl = rootView.findViewById(R.id.home_free_rl);
        mFreeRl.setOnClickListener(this);
        mSpaceRl = rootView.findViewById(R.id.home_space_rl);
        mSpaceRl.setOnClickListener(this);
        //iv
//        mShelfIv = rootView.findViewById(R.id.hom)
        //tv

        //point
        mSpacePointTv = (TextView) rootView.findViewById(R.id.space_point_tv);
        mSpacePointTv.setVisibility(View.GONE);
    }

    @Override
    public void onClick(final View view) {
        int id = view.getId();
        if (id == R.id.home_shelf_rl){
            switchPosition(0);
            onTabClick(view ,0);
        } else if (id == R.id.home_store_rl){
            switchPosition(1);
            onTabClick(view ,1);
        } else if (id == R.id.home_free_rl){
            switchPosition(2);
            onTabClick(view ,2);
        } else if (id == R.id.home_space_rl){
            switchPosition(3);
            onTabClick(view ,3);
        }

    }
    private void onTabClick(View v, int position){
        if (mTabOnClickListener!=null)
            mTabOnClickListener.onClick(v,position);
    }
    private void switchPosition(int positon){
        if (positon>3)
            return;
        mShelfRl.setSelected(false);
        mStoreRl.setSelected(false);
        mFreeRl.setSelected(false);
        mSpaceRl.setSelected(false);
        switch (positon){
            case 0:
                mShelfRl.setSelected(true);
                break;
            case 1:
                mStoreRl.setSelected(true);

                break;
            case 2:
                mFreeRl.setSelected(true);

                break;
            case 3:
                mSpaceRl.setSelected(true);

                break;
        }
    }
    public void setCurrentItem(int position){
        switchPosition(position);
    }
    public void setCurrentPointVisible(boolean shouldVisible){
        if (mSpacePointTv!=null){
            if (shouldVisible){
                mSpacePointTv.setVisibility(View.VISIBLE);
            } else {
                mSpacePointTv.setVisibility(View.GONE);
            }
        }
    }
    public interface TabOnClickListener{
        void onClick(View v, int position);
    }
}


text:
from barbicanclient import client as barbicanclient
from barbicanclient.common import auth as barbicanauth
from oslo.config import cfg

from solum.openstack.common import importutils

class BarbicanClient(object):
    """Barbican client wrapper so we can encapsulate logic in one place."""

    def __init__(self, insecure=False):
        self.insecure = insecure
        self._admin_client = None

    @property
    def admin_client(self):
        if not self._admin_client:
            # Create connection to API
            self._admin_client = self._barbican_admin_init()
        return self._admin_client

    def _barbican_admin_init(self):
        # Import auth_token to have keystone_authtoken settings setup.
        importutils.import_module('keystoneclient.middleware.auth_token')
        keystone = barbicanauth.KeystoneAuthV2(
            auth_url=cfg.CONF.keystone_authtoken.auth_uri,
            username=cfg.CONF.keystone_authtoken.admin_user,
            password=cfg.CONF.keystone_authtoken.admin_password,
            tenant_name=cfg.CONF.keystone_authtoken.admin_tenant_name)
        return barbicanclient.Client(auth_plugin=keystone,
                                     insecure=self.insecure)


text:
pyConsole
=========

Random fun console scripts in Python


text:
Reapp 0.8 doesn't require any change in your app structure. It does change how builds
work though. First, asset copying order is different.

Now, when you run `reapp build ios`:

```
./assets/shared/* => ./build/ios
./assets/ios/* => ./build/ios
./assets/ios/index.html => (Webpack inserts CSS/JS references) => ./build/ios/index.html
```

This lets you keep, for example, a cordova config.xml inside your `./assets/shared` and
have it copied to your build dir automatically.

The second change is where it build to. Before, no matter the platform `reapp build` or
`reapp build [platform]` all build to the same directory `./assets/public`. This was
poor design. Now, we build to the subdirectory of your app, so:

```
reapp build => ./build/web
reapp build ios => ./build/ios
```

This enables parallel builds! So if you want to build your ios and web apps at the same
time you can. We need to test it but the change in structure enables this, in practice.

## 0.7

#### In general, if you haven't customized your app much, it may be better to create a new reapp folder and copy in your changes

For CLI 0.7 we've added iOS builds and layouts. If you want to read on multiple builds,check out  [multiple build files](https://github.com/reapp/reapp#custom-builds).

#### new assets folder
Your assets folder structure has changed for the better. The new structure:

```
/assets
  /ios
  /web
  /shared
  ...
```

`reapp build` now can take a platform, like so: `reapp build [platform]`.

When your run `reapp build` it defaults the platform to `web`. Running a build will
copy your assets to `./build/public` in a specific order. By example:

`reapp build`
  - Copies index.html from assets/**web**
  - Copies assets/shared to build/public
  - Copies assets/**web** to build/public

`reapp build ios`
  - Copies index.html from assets/**ios**
  - Copies assets/shared to build/public
  - Copies assets/**ios** to build/public

**The only big change you need is to move your layout.html to assets/web/index.html. But we've
made some improvements to the layouts, so we recommend creating a new reapp project and
copying over the /assets folder.**