text:
/**
 * index
 *
 * @author: fengwang
 * @date: 2018-08-21 17:01
 * @version: 1.0
 */
$(function () {
    //搜索关键字
    var keyword = '';

    var table = $('#surveyTable').DataTable({
        paging: true,
        lengthChange: false,
        searching: false,
        ordering: false,
        order: [[1, "desc"]],
        info: true,
        autoWidth: false,
        processing: true,
        serverSide: true,
        ajax: {
            url: gContextPath + "/a/questionnaire/survey/directory/list",
            type: "POST",
            data: function (d) {
                d.keyword = keyword;
                d.mode = $('#mode').val();
            }
        },
        columnDefs: [
            {
                render: function (data, type, row) {
                    var html = '' + row.survey.surveyName + '';
                    return html;
                },
                targets: 0
            },
            {
                render: function (data, type, row) {
                    var html = '' + row.answers + '';
                    return html;
                },
                targets: 1
            },
            {
                render: function (data, type, row) {
                    var html = '' + row.createTime + '';
                    return html;
                },
                targets: 2
            },
            {
                render: function (data, type, row) {
                    var html = '' + row.createUser + '';
                    return html;
                },
                targets: 3
            },
            {
                render: function (data, type, row) {
                    var html = '';
                    var status = '';
                    if ('0' == row.survey.surveyState) {
                        status = 'Designing'
                    } else if ('1' == row.survey.surveyState) {
                        status = 'Collecting'
                    } else if ('2' == row.survey.surveyState) {
                        status = 'Finished'
                    }
                    html += status;

                    return html;
                },
                targets: 4
            },
            {
                render: function (data, type, row) {
                    var html = [];
                    html.push('
');
                    html.push('');
                    html.push('');
                    html.push('
');
                    return html.join('');
                },
                targets: 5
            }
        ]
    });

    table.on('draw', function () {
        //绑定事件
        bindEvent();
    });

    //搜索
    function search() {
        keyword = $('.search-keyword').val();
        table.search(keyword).draw();
    }

    //删除
    function del(surveyId) {

    }

    //绑定事件
    function bindEvent() {
        $(".console-table-operate-delete").unbind("click").click(function () {
            var surveyId = $(this).attr("surveyId");
            var surveyName = $(this).attr("surveyName");
            bootbox.confirm({
                title: 'Tips',
                message: "Are you sure to delete " + surveyName + " ?",
                callback: function (result) {
                    if (result) {
                        del(surveyId);
                    }
                }
            });
        });
    }

    $(".survey-add").click(function () {

    });

    $(".table-search").click(function () {
        search();
    });
});


text:
<?php

namespace Coduo\PHPMatcher\Matcher;

use Coduo\PHPMatcher\Parser;
use Coduo\ToString\String;
use Symfony\Component\PropertyAccess\PropertyAccess;
use Symfony\Component\PropertyAccess\PropertyAccessor;

class ArrayMatcher extends Matcher
{
    const UNBOUNDED_PATTERN = '@...@';

    /**
     * @var PropertyMatcher
     */
    private $propertyMatcher;

    /**
     * @var PropertyAccessor
     */
    private $accessor;

    /**
     * @var Parser
     */
    private $parser;

    /**
     * @param ValueMatcher $propertyMatcher
     */
    public function __construct(ValueMatcher $propertyMatcher, Parser $parser)
    {
        $this->propertyMatcher = $propertyMatcher;
        $this->parser = $parser;
    }

    /**
     * {@inheritDoc}
     */
    public function match($value, $pattern)
    {
        if (!is_array($value)) {
            $this->error = sprintf("%s \"%s\" is not a valid array.", gettype($value), new String($value));
            return false;
        }

        if ($this->isArrayPattern($pattern)) {
            return $this->allExpandersMatch($value, $pattern);
        }

        if (false === $this->iterateMatch($value, $pattern)) {
            return false;
        }

        return true;
    }

    /**
     * {@inheritDoc}
     */
    public function canMatch($pattern)
    {
        return is_array($pattern) || $this->isArrayPattern($pattern);
    }

    private function isArrayPattern($pattern)
    {
        if (!is_string($pattern)) {
            return false;
        }

        return $this->parser->hasValidSyntax($pattern) && $this->parser->parse($pattern)->is('array');
    }

    /**
     * @param  array $values
     * @param  array $patterns
     * @param string $parentPath
     * @return bool
     */
    private function iterateMatch(array $values, array $patterns, $parentPath = "")
    {
        $pattern = null;
        foreach ($values as $key => $value) {
            $path = $this->formatAccessPath($key);

            if ($this->shouldSkippValueMatchingFor($pattern)) {
                continue;
            }

            if ($this->valueExist($path, $patterns)) {
                $pattern = $this->getValueByPath($patterns, $path);
            } else {
                $this->setMissingElementInError('pattern', $this->formatFullPath($parentPath, $path));
                return false;
            }

            if ($this->shouldSkippValueMatchingFor($pattern)) {
                continue;
            }

            if ($this->valueMatchPattern($value, $pattern)) {
                continue;
            }

            if (!is_array($value) || !$this->canMatch($pattern)) {
                return false;
            }

            if ($this->isArrayPattern($pattern)) {
                if (!$this->allExpandersMatch($value, $pattern)) {
                    return false;
                }

                continue;
            }

            if (false === $this->iterateMatch($value, $pattern, $this->formatFullPath($parentPath, $path))) {
                return false;
            }
        }

        if (!$this->isPatternValid($patterns, $values, $parentPath)) {
            return false;
        }

        return true;
    }

    /**
     * Check if pattern elements exist in value array
     *
     * @param array $pattern
     * @param array $values
     * @param $parentPath
     * @return bool
     */
    private function isPatternValid(array $pattern, array $values, $parentPath)
    {
        if (is_array($pattern)) {
            $notExistingKeys = array_diff_key($pattern, $values);

            if (count($notExistingKeys) > 0) {
                $keyNames = array_keys($notExistingKeys);
                $path = $this->formatFullPath($parentPath,  $this->formatAccessPath($keyNames[0]));
                $this->setMissingElementInError('value', $path);
                return false;
            }
        }

        return true;
    }

    /**
     * @param $value
     * @param $pattern
     * @return bool
     */
    private function valueMatchPattern($value, $pattern)
    {
        $match = $this->propertyMatcher->canMatch($pattern) &&
            true === $this->propertyMatcher->match($value, $pattern);

        if (!$match) {
            $this->error = $this->propertyMatcher->getError();
        }

        return $match;
    }

    /**
     * @param $path
     * @param $haystack
     * @return bool
     */
    private function valueExist($path, array $haystack)
    {
        return null !== $this->getPropertyAccessor()->getValue($haystack, $path);
    }

    /**
     * @param $array
     * @param $path
     * @return mixed
     */
    private function getValueByPath($array, $path)
    {
        return $this->getPropertyAccessor()->getValue($array, $path);
    }

    /**
     * @return \Symfony\Component\PropertyAccess\PropertyAccessorInterface
     */
    private function getPropertyAccessor()
    {
        if (isset($this->accessor)) {
            return $this->accessor;
        }

        $accessorBuilder = PropertyAccess::createPropertyAccessorBuilder();
        $this->accessor = $accessorBuilder->getPropertyAccessor();

        return $this->accessor;
    }

    /**
     * @param $place
     * @param $path
     */
    private function setMissingElementInError($place, $path)
    {
        $this->error = sprintf('There is no element under path %s in %s.', $path, $place);
    }

    /**
     * @param $key
     * @return string
     */
    private function formatAccessPath($key)
    {
        return sprintf("[%s]", $key);
    }

    /**
     * @param $parentPath
     * @param $path
     * @return string
     */
    private function formatFullPath($parentPath, $path)
    {
        return sprintf("%s%s", $parentPath, $path);
    }

    /**
     * @param $lastPattern
     * @return bool
     */
    private function shouldSkippValueMatchingFor($lastPattern)
    {
        return $lastPattern === self::UNBOUNDED_PATTERN;
    }

    /**
     * @param $value
     * @param $pattern
     * @return bool
     * @throws \Coduo\PHPMatcher\Exception\UnknownExpanderException
     */
    private function allExpandersMatch($value, $pattern)
    {
        $typePattern = $this->parser->parse($pattern);
        if (!$typePattern->matchExpanders($value)) {
            $this->error = $typePattern->getError();
            return false;
        }

        return true;
    }
}

redpajama_set_name: RedPajamaGithub


text:
<?php

final class PhabricatorFileQuery
  extends PhabricatorCursorPagedPolicyAwareQuery {

  private $ids;
  private $phids;
  private $authorPHIDs;
  private $explicitUploads;
  private $transforms;
  private $dateCreatedAfter;
  private $dateCreatedBefore;
  private $contentHashes;
  private $minLength;
  private $maxLength;
  private $names;
  private $isPartial;
  private $needTransforms;

  public function withIDs(array $ids) {
    $this->ids = $ids;
    return $this;
  }

  public function withPHIDs(array $phids) {
    $this->phids = $phids;
    return $this;
  }

  public function withAuthorPHIDs(array $phids) {
    $this->authorPHIDs = $phids;
    return $this;
  }

  public function withDateCreatedBefore($date_created_before) {
    $this->dateCreatedBefore = $date_created_before;
    return $this;
  }

  public function withDateCreatedAfter($date_created_after) {
    $this->dateCreatedAfter = $date_created_after;
    return $this;
  }

  public function withContentHashes(array $content_hashes) {
    $this->contentHashes = $content_hashes;
    return $this;
  }

  /**
   * Select files which are transformations of some other file. For example,
   * you can use this query to find previously generated thumbnails of an image
   * file.
   *
   * As a parameter, provide a list of transformation specifications. Each
   * specification is a dictionary with the keys `originalPHID` and `transform`.
   * The `originalPHID` is the PHID of the original file (the file which was
   * transformed) and the `transform` is the name of the transform to query
   * for. If you pass `true` as the `transform`, all transformations of the
   * file will be selected.
   *
   * For example:
   *
   *   array(
   *     array(
   *       'originalPHID' => 'PHID-FILE-aaaa',
   *       'transform'    => 'sepia',
   *     ),
   *     array(
   *       'originalPHID' => 'PHID-FILE-bbbb',
   *       'transform'    => true,
   *     ),
   *   )
   *
   * This selects the `"sepia"` transformation of the file with PHID
   * `PHID-FILE-aaaa` and all transformations of the file with PHID
   * `PHID-FILE-bbbb`.
   *
   * @param list<dict>  List of transform specifications, described above.
   * @return this
   */
  public function withTransforms(array $specs) {
    foreach ($specs as $spec) {
      if (!is_array($spec) ||
          empty($spec['originalPHID']) ||
          empty($spec['transform'])) {
        throw new Exception(
          pht(
            "Transform specification must be a dictionary with keys ".
            "'%s' and '%s'!",
            'originalPHID',
            'transform'));
      }
    }

    $this->transforms = $specs;
    return $this;
  }

  public function withLengthBetween($min, $max) {
    $this->minLength = $min;
    $this->maxLength = $max;
    return $this;
  }

  public function withNames(array $names) {
    $this->names = $names;
    return $this;
  }

  public function withIsPartial($partial) {
    $this->isPartial = $partial;
    return $this;
  }

  public function showOnlyExplicitUploads($explicit_uploads) {
    $this->explicitUploads = $explicit_uploads;
    return $this;
  }

  public function needTransforms(array $transforms) {
    $this->needTransforms = $transforms;
    return $this;
  }

  public function newResultObject() {
    return new PhabricatorFile();
  }

  protected function loadPage() {
    $files = $this->loadStandardPage(new PhabricatorFile());

    if (!$files) {
      return $files;
    }

    $viewer = $this->getViewer();
    $is_omnipotent = $viewer->isOmnipotent();

    // We need to load attached objects to perform policy checks for files.
    // First, load the edges.

    $edge_type = PhabricatorFileHasObjectEdgeType::EDGECONST;
    $file_phids = mpull($files, 'getPHID');
    $edges = id(new PhabricatorEdgeQuery())
      ->withSourcePHIDs($file_phids)
      ->withEdgeTypes(array($edge_type))
      ->execute();

    $object_phids = array();
    foreach ($files as $file) {
      $phids = array_keys($edges[$file->getPHID()][$edge_type]);
      $file->attachObjectPHIDs($phids);

      if ($file->getIsProfileImage()) {
        // If this is a profile image, don't bother loading related files.
        // It will always be visible, and we can get into trouble if we try
        // to load objects and end up stuck in a cycle. See T8478.
        continue;
      }

      if ($is_omnipotent) {
        // If the viewer is omnipotent, we don't need to load the associated
        // objects either since they can certainly see the object. Skipping
        // this can improve performance and prevent cycles.
        continue;
      }

      foreach ($phids as $phid) {
        $object_phids[$phid] = true;
      }
    }

    // If this file is a transform of another file, load that file too. If you
    // can see the original file, you can see the thumbnail.

    // TODO: It might be nice to put this directly on PhabricatorFile and remove
    // the PhabricatorTransformedFile table, which would be a little simpler.

    $xforms = id(new PhabricatorTransformedFile())->loadAllWhere(
      'transformedPHID IN (%Ls)',
      $file_phids);
    $xform_phids = mpull($xforms, 'getOriginalPHID', 'getTransformedPHID');
    foreach ($xform_phids as $derived_phid => $original_phid) {
      $object_phids[$original_phid] = true;
    }

    $object_phids = array_keys($object_phids);

    // Now, load the objects.

    $objects = array();
    if ($object_phids) {
      // NOTE: We're explicitly turning policy exceptions off, since the rule
      // here is "you can see the file if you can see ANY associated object".
      // Without this explicit flag, we'll incorrectly throw unless you can
      // see ALL associated objects.

      $objects = id(new PhabricatorObjectQuery())
        ->setParentQuery($this)
        ->setViewer($this->getViewer())
        ->withPHIDs($object_phids)
        ->setRaisePolicyExceptions(false)
        ->execute();
      $objects = mpull($objects, null, 'getPHID');
    }

    foreach ($files as $file) {
      $file_objects = array_select_keys($objects, $file->getObjectPHIDs());
      $file->attachObjects($file_objects);
    }

    foreach ($files as $key => $file) {
      $original_phid = idx($xform_phids, $file->getPHID());
      if ($original_phid == PhabricatorPHIDConstants::PHID_VOID) {
        // This is a special case for builtin files, which are handled
        // oddly.
        $original = null;
      } else if ($original_phid) {
        $original = idx($objects, $original_phid);
        if (!$original) {
          // If the viewer can't see the original file, also prevent them from
          // seeing the transformed file.
          $this->didRejectResult($file);
          unset($files[$key]);
          continue;
        }
      } else {
        $original = null;
      }
      $file->attachOriginalFile($original);
    }

    return $files;
  }

  protected function didFilterPage(array $files) {
    $xform_keys = $this->needTransforms;
    if ($xform_keys !== null) {
      $xforms = id(new PhabricatorTransformedFile())->loadAllWhere(
        'originalPHID IN (%Ls) AND transform IN (%Ls)',
        mpull($files, 'getPHID'),
        $xform_keys);

      if ($xforms) {
        $xfiles = id(new PhabricatorFile())->loadAllWhere(
          'phid IN (%Ls)',
          mpull($xforms, 'getTransformedPHID'));
        $xfiles = mpull($xfiles, null, 'getPHID');
      }

      $xform_map = array();
      foreach ($xforms as $xform) {
        $xfile = idx($xfiles, $xform->getTransformedPHID());
        if (!$xfile) {
          continue;
        }
        $original_phid = $xform->getOriginalPHID();
        $xform_key = $xform->getTransform();
        $xform_map[$original_phid][$xform_key] = $xfile;
      }

      $default_xforms = array_fill_keys($xform_keys, null);

      foreach ($files as $file) {
        $file_xforms = idx($xform_map, $file->getPHID(), array());
        $file_xforms += $default_xforms;
        $file->attachTransforms($file_xforms);
      }
    }

    return $files;
  }

  protected function buildJoinClauseParts(AphrontDatabaseConnection $conn) {
    $joins = parent::buildJoinClauseParts($conn);

    if ($this->transforms) {
      $joins[] = qsprintf(
        $conn,
        'JOIN %T t ON t.transformedPHID = f.phid',
        id(new PhabricatorTransformedFile())->getTableName());
    }

    return $joins;
  }

  protected function buildWhereClauseParts(AphrontDatabaseConnection $conn) {
    $where = parent::buildWhereClauseParts($conn);

    if ($this->ids !== null) {
      $where[] = qsprintf(
        $conn,
        'f.id IN (%Ld)',
        $this->ids);
    }

    if ($this->phids !== null) {
      $where[] = qsprintf(
        $conn,
        'f.phid IN (%Ls)',
        $this->phids);
    }

    if ($this->authorPHIDs !== null) {
      $where[] = qsprintf(
        $conn,
        'f.authorPHID IN (%Ls)',
        $this->authorPHIDs);
    }

    if ($this->explicitUploads !== null) {
      $where[] = qsprintf(
        $conn,
        'f.isExplicitUpload = %d',
        (int)$this->explicitUploads);
    }

    if ($this->transforms !== null) {
      $clauses = array();
      foreach ($this->transforms as $transform) {
        if ($transform['transform'] === true) {
          $clauses[] = qsprintf(
            $conn,
            '(t.originalPHID = %s)',
            $transform['originalPHID']);
        } else {
          $clauses[] = qsprintf(
            $conn,
            '(t.originalPHID = %s AND t.transform = %s)',
            $transform['originalPHID'],
            $transform['transform']);
        }
      }
      $where[] = qsprintf($conn, '(%Q)', implode(') OR (', $clauses));
    }

    if ($this->dateCreatedAfter !== null) {
      $where[] = qsprintf(
        $conn,
        'f.dateCreated >= %d',
        $this->dateCreatedAfter);
    }

    if ($this->dateCreatedBefore !== null) {
      $where[] = qsprintf(
        $conn,
        'f.dateCreated <= %d',
        $this->dateCreatedBefore);
    }

    if ($this->contentHashes !== null) {
      $where[] = qsprintf(
        $conn,
        'f.contentHash IN (%Ls)',
        $this->contentHashes);
    }

    if ($this->minLength !== null) {
      $where[] = qsprintf(
        $conn,
        'byteSize >= %d',
        $this->minLength);
    }

    if ($this->maxLength !== null) {
      $where[] = qsprintf(
        $conn,
        'byteSize <= %d',
        $this->maxLength);
    }

    if ($this->names !== null) {
      $where[] = qsprintf(
        $conn,
        'name in (%Ls)',
        $this->names);
    }

    if ($this->isPartial !== null) {
      $where[] = qsprintf(
        $conn,
        'isPartial = %d',
        (int)$this->isPartial);
    }

    return $where;
  }

  protected function getPrimaryTableAlias() {
    return 'f';
  }

  public function getQueryApplicationClass() {
    return 'PhabricatorFilesApplication';
  }

}


text:
namespace AH.ModuleController.UI.ACCMS.Reports.ParameterForms
{
    partial class frmACCMSRReportHospitalColl
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.dtEndDate = new System.Windows.Forms.DateTimePicker();
            this.dtStartDate = new System.Windows.Forms.DateTimePicker();
            this.lvlStartDate = new AtiqsControlLibrary.SmartLabel();
            this.lvlEndDate = new AtiqsControlLibrary.SmartLabel();
            this.smartLabel1 = new AtiqsControlLibrary.SmartLabel();
            this.cboCompany = new AtiqsControlLibrary.SmartComboBox();
            this.groupBox2 = new System.Windows.Forms.GroupBox();
            this.radSumm = new System.Windows.Forms.RadioButton();
            this.radDetails = new System.Windows.Forms.RadioButton();
            this.groupBox3 = new System.Windows.Forms.GroupBox();
            this.radPayable = new System.Windows.Forms.RadioButton();
            this.radColl = new System.Windows.Forms.RadioButton();
            this.pnlMain.SuspendLayout();
            this.pnlTop.SuspendLayout();
            this.groupBox2.SuspendLayout();
            this.groupBox3.SuspendLayout();
            this.SuspendLayout();
            //
            // btnClose
            //
            this.btnClose.Location = new System.Drawing.Point(470, 323);
            //
            // btnPrint
            //
            this.btnPrint.Location = new System.Drawing.Point(356, 323);
            this.btnPrint.Click += new System.EventHandler(this.btnPrint_Click);
            //
            // frmLabel
            //
            this.frmLabel.Location = new System.Drawing.Point(129, 9);
            this.frmLabel.Size = new System.Drawing.Size(359, 32);
            this.frmLabel.Text = "Hospital Collection/Payable";
            //
            // pnlMain
            //
            this.pnlMain.Controls.Add(this.groupBox3);
            this.pnlMain.Controls.Add(this.groupBox2);
            this.pnlMain.Controls.Add(this.dtEndDate);
            this.pnlMain.Controls.Add(this.dtStartDate);
            this.pnlMain.Controls.Add(this.lvlStartDate);
            this.pnlMain.Controls.Add(this.lvlEndDate);
            this.pnlMain.Controls.Add(this.smartLabel1);
            this.pnlMain.Controls.Add(this.cboCompany);
            this.pnlMain.Size = new System.Drawing.Size(731, 264);
            //
            // pnlTop
            //
            this.pnlTop.Size = new System.Drawing.Size(597, 57);
            //
            // dtEndDate
            //
            this.dtEndDate.Font = new System.Drawing.Font("Verdana", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.dtEndDate.Format = System.Windows.Forms.DateTimePickerFormat.Short;
            this.dtEndDate.Location = new System.Drawing.Point(278, 168);
            this.dtEndDate.Name = "dtEndDate";
            this.dtEndDate.Size = new System.Drawing.Size(188, 26);
            this.dtEndDate.TabIndex = 41;
            //
            // dtStartDate
            //
            this.dtStartDate.Font = new System.Drawing.Font("Verdana", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.dtStartDate.Format = System.Windows.Forms.DateTimePickerFormat.Short;
            this.dtStartDate.Location = new System.Drawing.Point(278, 131);
            this.dtStartDate.Name = "dtStartDate";
            this.dtStartDate.Size = new System.Drawing.Size(188, 26);
            this.dtStartDate.TabIndex = 40;
            //
            // lvlStartDate
            //
            this.lvlStartDate.AutoSize = true;
            this.lvlStartDate.BackColor = System.Drawing.Color.Transparent;
            this.lvlStartDate.Font = new System.Drawing.Font("Book Antiqua", 9.75F, System.Drawing.FontStyle.Bold);
            this.lvlStartDate.Location = new System.Drawing.Point(188, 131);
            this.lvlStartDate.Name = "lvlStartDate";
            this.lvlStartDate.Size = new System.Drawing.Size(71, 18);
            this.lvlStartDate.TabIndex = 38;
            this.lvlStartDate.Text = "Start Date:";
            //
            // lvlEndDate
            //
            this.lvlEndDate.AutoSize = true;
            this.lvlEndDate.BackColor = System.Drawing.Color.Transparent;
            this.lvlEndDate.Font = new System.Drawing.Font("Book Antiqua", 9.75F, System.Drawing.FontStyle.Bold);
            this.lvlEndDate.Location = new System.Drawing.Point(192, 175);
            this.lvlEndDate.Name = "lvlEndDate";
            this.lvlEndDate.Size = new System.Drawing.Size(67, 18);
            this.lvlEndDate.TabIndex = 39;
            this.lvlEndDate.Text = "End Date:";
            //
            // smartLabel1
            //
            this.smartLabel1.AutoSize = true;
            this.smartLabel1.BackColor = System.Drawing.Color.Transparent;
            this.smartLabel1.Font = new System.Drawing.Font("Book Antiqua", 9.75F, System.Drawing.FontStyle.Bold);
            this.smartLabel1.Location = new System.Drawing.Point(150, 91);
            this.smartLabel1.Name = "smartLabel1";
            this.smartLabel1.Size = new System.Drawing.Size(109, 18);
            this.smartLabel1.TabIndex = 37;
            this.smartLabel1.Text = "Company Name:";
            //
            // cboCompany
            //
            this.cboCompany.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this.cboCompany.Font = new System.Drawing.Font("Microsoft Sans Serif", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.cboCompany.ForeColor = System.Drawing.Color.Blue;
            this.cboCompany.FormattingEnabled = true;
            this.cboCompany.Location = new System.Drawing.Point(278, 88);
            this.cboCompany.Name = "cboCompany";
            this.cboCompany.Size = new System.Drawing.Size(302, 26);
            this.cboCompany.TabIndex = 36;
            //
            // groupBox2
            //
            this.groupBox2.Controls.Add(this.radSumm);
            this.groupBox2.Controls.Add(this.radDetails);
            this.groupBox2.Location = new System.Drawing.Point(33, 36);
            this.groupBox2.Name = "groupBox2";
            this.groupBox2.Size = new System.Drawing.Size(100, 208);
            this.groupBox2.TabIndex = 42;
            this.groupBox2.TabStop = false;
            this.groupBox2.Text = "Selection";
            //
            // radSumm
            //
            this.radSumm.AutoSize = true;
            this.radSumm.Location = new System.Drawing.Point(9, 64);
            this.radSumm.Name = "radSumm";
            this.radSumm.Size = new System.Drawing.Size(68, 17);
            this.radSumm.TabIndex = 3;
            this.radSumm.Text = "Summary";
            this.radSumm.UseVisualStyleBackColor = true;
            //
            // radDetails
            //
            this.radDetails.AutoSize = true;
            this.radDetails.Checked = true;
            this.radDetails.Location = new System.Drawing.Point(10, 35);
            this.radDetails.Name = "radDetails";
            this.radDetails.Size = new System.Drawing.Size(57, 17);
            this.radDetails.TabIndex = 2;
            this.radDetails.TabStop = true;
            this.radDetails.Text = "Details";
            this.radDetails.UseVisualStyleBackColor = true;
            //
            // groupBox3
            //
            this.groupBox3.Controls.Add(this.radPayable);
            this.groupBox3.Controls.Add(this.radColl);
            this.groupBox3.Font = new System.Drawing.Font("Verdana", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.groupBox3.Location = new System.Drawing.Point(150, 5);
            this.groupBox3.Name = "groupBox3";
            this.groupBox3.Size = new System.Drawing.Size(437, 51);
            this.groupBox3.TabIndex = 4;
            this.groupBox3.TabStop = false;
            this.groupBox3.Text = "Selection";
            //
            // radPayable
            //
            this.radPayable.AutoSize = true;
            this.radPayable.Location = new System.Drawing.Point(245, 20);
            this.radPayable.Name = "radPayable";
            this.radPayable.Size = new System.Drawing.Size(75, 18);
            this.radPayable.TabIndex = 1;
            this.radPayable.Text = "Payable";
            this.radPayable.UseVisualStyleBackColor = true;
            //
            // radColl
            //
            this.radColl.AutoSize = true;
            this.radColl.Checked = true;
            this.radColl.Location = new System.Drawing.Point(91, 20);
            this.radColl.Name = "radColl";
            this.radColl.Size = new System.Drawing.Size(86, 18);
            this.radColl.TabIndex = 0;
            this.radColl.TabStop = true;
            this.radColl.Text = "Collection";
            this.radColl.UseVisualStyleBackColor = true;
            //
            // frmACCMSRReportHospitalColl
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.ClientSize = new System.Drawing.Size(597, 394);
            this.Name = "frmACCMSRReportHospitalColl";
            this.Load += new System.EventHandler(this.frmACCMSRReportHospitalColl_Load);
            this.pnlMain.ResumeLayout(false);
            this.pnlMain.PerformLayout();
            this.pnlTop.ResumeLayout(false);
            this.pnlTop.PerformLayout();
            this.groupBox2.ResumeLayout(false);
            this.groupBox2.PerformLayout();
            this.groupBox3.ResumeLayout(false);
            this.groupBox3.PerformLayout();
            this.ResumeLayout(false);

        }

        #endregion

        private System.Windows.Forms.DateTimePicker dtEndDate;
        private System.Windows.Forms.DateTimePicker dtStartDate;
        private AtiqsControlLibrary.SmartLabel lvlStartDate;
        private AtiqsControlLibrary.SmartLabel lvlEndDate;
        private AtiqsControlLibrary.SmartLabel smartLabel1;
        private AtiqsControlLibrary.SmartComboBox cboCompany;
        private System.Windows.Forms.GroupBox groupBox2;
        private System.Windows.Forms.RadioButton radSumm;
        private System.Windows.Forms.RadioButton radDetails;
        private System.Windows.Forms.GroupBox groupBox3;
        private System.Windows.Forms.RadioButton radPayable;
        private System.Windows.Forms.RadioButton radColl;
    }
}


text:
begin
require "rexml/document"
require "gosu"
rescue LoadError
end
include REXML
include Gosu
module BTL
	module Isometric
		class Tilemap
			attr_reader :blocked
			attr_reader :name
			attr_reader :description
			attr_reader :number_of_layers
			attr_reader :tile
			attr_reader :tileability
			attr_reader :blocks
			attr_reader :layers
			def initialize(window, blocked=true)
				@window = window
				@blocked = blocked
				@name = ""
				@description = ""
				@number_of_layers = nil
				@tile = 	{
						:width 	=> nil,
						:height 	=> nil,
						:r		=> nil,
						:size 		=> nil,
						:nil 		=> "###"
						}
				@blocks = {}
				@layers = {}
			end

			def load_map(filename)
				raise "Map type is not isometric" if BTL::check_map_type(filename) != "Isometric"
				map = Document.new(File.new(filename))
				@name 			= map.elements["map"].elements["meta"].elements["name"].text
				@description 		= map.elements["map"].elements["meta"].elements["description"].text
				@number_of_layers 	= map.elements["map"].elements["meta"].elements["layers"].text.to_i
				@tile[:width] 		= map.elements["map"].elements["meta"].elements["tile"].elements["width"].text.to_i
				@tile[:height] 		= map.elements["map"].elements["meta"].elements["tile"].elements["height"].text.to_i
				@tile[:r] 			= eval(map.elements["map"].elements["meta"].elements["tile"].elements["r"].text)
				@tile[:size] 		= map.elements["map"].elements["meta"].elements["tile"].elements["size"].text.to_i
				@tile[:nil] 			= map.elements["map"].elements["meta"].elements["tile"].elements["nil"].text
				@blocks[:folder] 		= map.elements["map"].elements["meta"].elements["blocks"].attributes["textures_folder"]

				if @blocked == true
					map.elements.each("map/meta/blocks/block") { |block|
						@blocks[block.attributes["identifier"]] = {
							:left 		=> block.elements["left"].text,
							:right 	=> block.elements["right"].text,
							:top 		=> block.elements["top"].text,
							:texture1	=> Image.new(@window, @blocks[:folder]+"/"+block.elements["top"].text, true),
							:texture2	=> Image.new(@window, @blocks[:folder]+"/"+block.elements["right"].text, true),
							:texture3	=> Image.new(@window, @blocks[:folder]+"/"+block.elements["left"].text, true)
						}
					}
				else
					map.elements.each("map/meta/blocks/block") { |block|
						@blocks[block.attributes["identifier"]] = {
							:top 		=> block.elements["top"].text,
							:texture1	=> Image.new(@window, @blocks[:folder]+"/"+block.elements["top"].text, true)
						}
					}
				end

				map.elements.each("map/layers/layer") { |layer|
					@layers[layer.elements["name"].text] = {
						:width 	=> layer.elements["width"].text.to_i,
						:height 	=> layer.elements["height"].text.to_i,
						:zorder 	=> layer.elements["zorder"].text.to_i,
						:order	=> layer.elements["order"].text.to_i,
						:map 	=> layer.elements["map"].text.gsub!(" ","").split("\n"),
						:tiles 	=> nil
					}
				}

				map = nil

				@layers.each { |current_layer, values|
					@layers[current_layer][:tiles] = Array.new(@layers[current_layer][:height]) do |y|
						Array.new(@layers[current_layer][:width]) do |x|
							nil
						end # y
					end # x
				}
				@layers.each { |current_layer, values|
					@layers[current_layer][:height].times do |y|
						@layers[current_layer][:width].times do |x|
							case @layers[current_layer][:map][y][x*@tile[:size], @tile[:size]]

							when @tile[:nil]
								@layers[current_layer][:map][y][x*@tile[:size], @tile[:size]] = nil
							else
								@blocks.each { |identifier, value|
									if @layers[current_layer][:map][y][x*@tile[:size], @tile[:size]] == identifier
										@layers[current_layer][:tiles][y][x*@tile[:size], @tile[:size]] = BTL::Isometric::Tile.new(@window, self, identifier, @layers[current_layer][:order], x, y, @tile[:r], @tile[:width], @tile[:height], @layers[current_layer][:zorder])
									end
								}
							end #case
						end # y
					end # x
				}
			end

			def update(camera_x, camera_y, zoom=1)
				@layers.each { |current_layer, value|
					@layers[current_layer][:height].times do |y|
						@layers[current_layer][:width].times do |x|
							tile = @layers[current_layer][:tiles][y][x]
							if tile
								tile.update(camera_x, camera_y, zoom)
							end
						end
					end
				}
			end

		end
	end
end


text:
#ifndef Ripple_ScrollHandler_h
#define Ripple_ScrollHandler_h

#include <QObject>
#include <QTimer>
#include <QMutex>
#include <QEvent>
#include "QtStageWebView.h"

class ScrollHandler : public QObject {
    Q_OBJECT
    QtStageWebView *m_pWebView;
    QTimer *m_pTimer;
    QMutex *m_pMutex;
    bool m_flag;
public:
    ScrollHandler(QtStageWebView *parent);
    ~ScrollHandler();
public slots:
    void unlock();

protected:
    bool eventFilter(QObject *obj, QEvent *event);
};

#endif


text:
from setuptools import setup
import re

with open('ttmltosrt/__init__.py') as file:
    version = re.search(r"__version__ = '(.*)'", file.read()).group(1)

setup(
    name='ttmltosrt',
    version=version,
    description='Convert Timed Text Markup Language to SRT',
    long_description=open('README.rst').read(),
    license=open('LICENSE').read(),
    author='Robbie Clarken',
    author_email='robbie.clarken@gmail.com',
    url='https://github.com/RobbieClarken/ttmltosrt',
    packages=['ttmltosrt'],
    install_requires=[
        'beautifulsoup4>=4.4.1',
        'click>=6.2',
    ],
    entry_points={
        'console_scripts': ['ttmltosrt=ttmltosrt.ttmltosrt:convert_file']
    },
    classifiers=[
        'Development Status :: 4 - Beta',
        'Topic :: Multimedia',
        'Intended Audience :: Developers',
        'Natural Language :: English',
        'Programming Language :: Python',
        'Programming Language :: Python :: 3',
        'Programming Language :: Python :: 3.5',
        'License :: OSI Approved :: MIT License',
    ],
)


text:
package CXGN::List::FuzzySearch::Plugin::Plants;

use Moose;

use Data::Dumper;
use SGN::Model::Cvterm;
use CXGN::BreedersToolbox::StocksFuzzySearch;

sub name {
    return "plants";
}

sub fuzzysearch {
    my $self = shift;
    my $schema = shift;
    my $list = shift;

    my $max_distance = 0.2;
    my $fuzzy_search = CXGN::BreedersToolbox::StocksFuzzySearch->new({schema => $schema});
    my $fuzzy_search_result = $fuzzy_search->get_matches($list, $max_distance, 'plant');

    my $found = $fuzzy_search_result->{'found'};
    my $fuzzy = $fuzzy_search_result->{'fuzzy'};
    my $absent = $fuzzy_search_result->{'absent'};

    my %return = (
        success => "1",
        absent => $absent,
        fuzzy => $fuzzy,
        found => $found,
    );

    if ($fuzzy_search_result->{'error'}){
        $return{error} = $fuzzy_search_result->{'error'};
    }

    return \%return;
}

1;


text:
using SysCommand.ConsoleApp;

namespace SysCommand.Tests.UnitTests.Common.Commands.T27
{
    public class Command2 : Command
    {
        public Command2()
        {
            this.EnablePositionalArgs = true;
        }

        public string Main(string[] a)
        {
            return $"Main(string[] a)";
        }

        public string Main(int a, int b)
        {
            return $"Main({a}, {b})";
        }
    }
}


text:
'use strict'

var usernameCharacter = require('./username-character')

module.exports = factory

var numberSign = 35 //  '#'
var atSign = 64 //  '@'

// Create a bound regex locator.
function factory(regex) {
  return locator

  // Find the place where a regex begins.
  function locator(value, fromIndex) {
    var result
    var prev

    regex.lastIndex = fromIndex

    result = regex.exec(value)

    if (result) {
      result = regex.lastIndex - result[0].length
      prev = value.charCodeAt(result - 1)

      if (usernameCharacter(prev) || prev === numberSign || prev === atSign) {
        // Find the next possible value.
        return locator(value, regex.lastIndex)
      }

      return result
    }

    return -1
  }
}


text:
define(["app", "utils", "collections/CommentCollection", "text!templates/CommentEdit.html"],

    function(app, utils, CommentCollection, template){

        var CommentEditView = Backbone.View.extend({

            template: Handlebars.compile(template),
            // View constructor
            initialize: function(options) {
                _.bindAll(this);
                this.collection = new CommentCollection();
                this.collection.on('error', this.showError);
            },

            // View Event Handlers
            events: {
                "click #comment-edit-cancel": "removeEdit",
                "click #comment-edit-save": "saveEdit"
            },

            showError: function(err){
                console.log('err',err);
                utils.showAlert('test','test', 'alert-error');
            },

            removeEdit: function(){
                this.model.trigger('comment-edit');
            },

            // Renders the view's template to the UI
            render: function() {
                this.$el.html(this.template({content:this.model.get('content')}));

                // Maintains chainability
                return this;

            },

            saveEdit: function(){
                this.model.set('content', $('.comment-edit').val());
                this.collection.create(this.model);
                this.model.trigger('comment-edit');
            }

        });

        // Returns the View class
        return CommentEditView;

    }

);


text:
<?php

/**
 * Calls signal handlers for pending signals
 *
 * @phpstub
 *
 * @return bool
 */
function pcntl_signal_dispatch()
{
}


text:
function isNumber(n) {
    return !isNaN(parseFloat(n)) && isFinite(n);
}

function findTotalQty() {
    var arr = document.getElementsByClassName("productQty");
    var tot = 0;
    for (var i = 0; arr.length > i; i++) parseInt(arr[i].value) && (tot += parseInt(arr[i].value));
    return tot;
}

function findTotalPrice() {
    var arr = document.getElementsByClassName("productPrice");
    var qty = document.getElementsByClassName("productQty");
    var tot = 0;
    for (var i = 0; arr.length > i; i++) if (parseFloat(arr[i].value)) {
        grand_total = parseInt(qty[i].value) * parseFloat(arr[i].value);
        tot += parseFloat(grand_total);
    }
    return tot;
}

function todayDate() {
    var today = new Date();
    var dd = today.getDate();
    var mm = today.getMonth() + 1;
    var yyyy = today.getFullYear();
    10 > dd && (dd = "0" + dd);
    10 > mm && (mm = "0" + mm);
    today = dd + "/" + mm + "/" + yyyy;
    return today;
}

function validateForm() {
    var name = $('input[name="name"]').val();
    var mobile = $('input[name="mobile"]').val();
    var location = $('input[name="location"]').val();
    var area = $("#selector_area").val();
    var prod = $(".productName").length;
    if ("" == name) {
        alert("Customer name cannot be empty");
        return false;
    }
    if ("" == mobile) {
        alert("Mobile number cannot be empty");
        return false;
    }
    if ("" == location) {
        alert("Location cannot be empty");
        return false;
    }
    if ("" == area) {
        alert("Area cannot be empty");
        return false;
    }
    if (0 == prod) {
        alert("Product cannot be empty");
        return false;
    }
    return true;
}

function validatePosForm() {
    var s_name = $('input[name="sender_name"]').val();
    var s_mobile = $('input[name="sender_mobile"]').val();
    var s_address = $('input[name="sender_address"]').val();
    var s_city = $('input[name="sender_city"]').val();
    var s_poscode = $('input[name="sender_postcode"]').val();
    var s_state = $('input[name="sender_state"]').val();
    var r_name = $('input[name="receiver_name"]').val();
    var r_mobile = $('input[name="receiver_mobile"]').val();
    var r_address = $('input[name="receiver_address"]').val();
    var r_city = $('input[name="receiver_city"]').val();
    var r_poscode = $('input[name="receiver_postcode"]').val();
    var r_state = $('input[name="receiver_state"]').val();
    var prod = $(".productName").length;
    if ("" == s_name) {
        alert("Sender name cannot be empty");
        return false;
    }
    if ("" == r_name) {
        alert("Receiver name cannot be empty");
        return false;
    }
    if ("" == s_mobile) {
        alert("Sender mobile number cannot be empty");
        return false;
    }
    if ("" == r_mobile) {
        alert("Receiver mobile number cannot be empty");
        return false;
    }
    if ("" == s_address) {
        alert("Sender address cannot be empty");
        return false;
    }
    if ("" == r_address) {
        alert("Receiver address cannot be empty");
        return false;
    }
    if ("" == s_city) {
        alert("Sender city cannot be empty");
        return false;
    }
    if ("" == r_city) {
        alert("Receiver city cannot be empty");
        return false;
    }
    if ("" == s_poscode) {
        alert("Sender postcode cannot be empty");
        return false;
    }
    if ("" == r_poscode) {
        alert("Receiver postcode cannot be empty");
        return false;
    }
    if ("" == s_state) {
        alert("Sender state cannot be empty");
        return false;
    }
    if ("" == r_state) {
        alert("Receiver state cannot be empty");
        return false;
    }
    if (0 == prod) {
        alert("Product cannot be empty");
        return false;
    }
    return true;
}

function orderDetailListener(titanium_bridge) {
    Ti.App.addEventListener(titanium_bridge, function(e) {
        if ("app:getPendingList" == titanium_bridge) getStateSelector(e, ""); else if ("app:PosParam" == titanium_bridge) {
            getStateSelector(e, "pos");
            getProductelector(e);
            "app:orderDetailsParam" == titanium_bridge && setTimeout(function() {
                loadDetails(e);
            }, 1500);
        } else {
            getStateSelector(e, "");
            getProductelector(e);
            "app:orderDetailsParam" == titanium_bridge && setTimeout(function() {
                loadDetails(e);
            }, 1500);
        }
    });
}

function getStateSelector(e, seltype) {
    $.getJSON(e.state + e.session, function(data) {
        if ("error" == data.status) {
            getStateSelector(e);
            return false;
        }
        var preferred = data.selected_state;
        localStorage.setItem("stateArea", JSON.stringify(data.area));
        if ("pos" == seltype) {
            var sender = '<select name="sender_state" class="selector" id="sender_state" onChange="loadArea();" style="float:left;width:100%; ">';
            sender += '<option value="">State</option>';
            $.each(data.state, function(key, val) {
                sender += "<option value=" + key + ">" + val + "</option>";
            });
            sender += "</select>";
            var receiver = '<select name="receiver_state" class="selector" id="receiver_state" onChange="loadArea();" style="float:left;width:100%; ">';
            receiver += '<option value="">State</option>';
            $.each(data.state, function(key, val) {
                receiver += "<option value=" + key + ">" + val + "</option>";
            });
            receiver += "</select>";
            $("#sender_country_selector").html(sender);
            $("#receiver_country_selector").html(receiver);
        } else {
            var item = '<select name="area" class="selector" id="selector_area" onChange="loadArea();" style="float:left;width:100%; ">';
            item += '<option value="">State</option>';
            $.each(data.state, function(key, val) {
                var is_selected = "";
                preferred == key && (is_selected = "selected");
                item += "<option value=" + key + " " + is_selected + ">" + val + "</option>";
            });
            item += "</select>";
            $("#country_selector").html(item);
            if (data.area[preferred]) {
                var item2 = '<select name="area2" class="selector" id="selector_area2" onChange="loadArea2();" style="float:left;width:100%; ">';
                item2 += '<option value="">Area</option>';
                $.each(data.area[preferred], function(area_id, area_name) {
                    item2 += "<option value=" + area_id + ">" + area_name + "</option>";
                });
                item2 += "</select>";
                $(".staticBar").css("height", "70px");
                $("#pending_order_list").css("padding-top", "75px");
                $("#area_selector").show();
                $("#area_selector").html(item2);
            }
        }
        return true;
    });
}

function getProductelector(e) {
    $.getJSON(e.product + e.session, function(data) {
        if ("error" == data.status) getProductelector(e); else {
            var item = '<select name="sel_product" class="selector" id="sel_product" style="width:100%;" onChange="onLoadPrice();">';
            item += '<option value="">-- Product--</option>';
            $.each(data, function(key, val) {
                localStorage.setItem("prodName" + val.p_id, val.name);
                localStorage.setItem("prodQty" + val.p_id, val.quantity);
                localStorage.setItem("prodPrice" + val.p_id, val.price);
                item += "<option value=" + val.p_id + ">" + val.name + "</option>";
            });
            item += "</select>";
            $("#product_selector").html(item);
        }
    });
}

function onLoadPrice() {
    var pid = $("#sel_product").val();
    $("#price").val(localStorage.getItem("prodPrice" + pid));
}


text:
function [X,clabel,Y] = simulate_checkerboard_data(nsamples, nchecker, nclasses, prop, scale, do_plot)
% Creates checkerboard data in two dimensions. The space is split into an
% nchecker x nchecker checkerboard. Each checker contains data from one
% single class.
%
% Note that checkers are filled row-by-row, cycling through each of the
% classes. Therefore, ideally the number of checkers is nclasses+1.
%
% Usage:  [X,clabel,Y,M] = simulate_checkerboard_data(nsamples, nchecker, nclasses, prop, scale, do_plot)
%
% Parameters:
% nsamples          - total number of samples (across all classes)
% nchecker          - number of checkers (default 3)
% nclasses          - number of classes (default 2)
% prop              - class proportions (default 'equal'). Otherwise give
%                     class proportions e.g. [0.2, 0.2, 0.6] gives 20% of
%                     the samples to class 1, 20% to class 2, and 60% to
%                     class 3
% scale             - variance of random Gaussian noise added to the x-y-
%                     positions. If 0, data is perfectly arranged on a
%                     line. Set to larger valurs to make the data more
%                     fuzzy
% do_plot           - if 1, plots the data
%
% Returns:
% X         - [nsamples x 2] matrix of data
% clabel    - [nsamples x 1] vector of class labels (1's, 2's, etc)
% Y         - [samples x nclasses] indicator matrix that can be used
%             alongside or instead of clabel. Y(i,j)=1 if the i-th sample
%             belongs to class j, and Y(i,j)=0 otherwise.

% (c) Matthias Treder

if nargin<2 || isempty(nchecker), nchecker = 3; end
if nargin<3 || isempty(nclasses), nclasses = 2; end
if nargin<4 || isempty(prop), prop = 'equal'; end
if nargin<5 || isempty(scale), scale = 0; end
if nargin<6 || isempty(do_plot), do_plot = 1; end

% Check input arguments
if ischar(prop) && strcmp(prop,'equal') && ~(rem(nsamples, nclasses)==0)
    error('Class proportion is set to ''equal'' but number of samples cannot be divided by the number of classes')
end

if ~ischar(prop)
    if sum(prop) ~= 1
        error('prop must sum to 1')
    end
    if numel(prop) ~= nclasses
        error('number of elements in prop must match nclasses')
    end
end

%% Determine frequencies of each class
if ischar(prop) && strcmp(prop,'equal')
    nsamples_per_class = nsamples / nclasses * ones(1, nclasses);
else
    nsamples_per_class = nsamples * prop;
end

if ~all(mod(nsamples_per_class,1)==0)
    error('prop * nsamples must yield integer values')
end

% How many checkers each class occupies
total_checkers = nchecker^2;
checker_classes = repmat(1:3, 1, ceil(total_checkers/nclasses));
checker_classes = checker_classes(1:total_checkers);
checkers_per_class = arrayfun( @(c) sum(checker_classes==c), 1:nclasses);

%% Loop across checkers
X = [];
clabel = [];

x = 0; y = 0;
current_checker_position = 1;

% Count how many samples per class have already be added
nsamples_per_class_added = zeros(1,nclasses);

for rr=1:nchecker       % -- rows
    for cc=1:nchecker     % -- cols
        % Current checker class
        ccc = checker_classes(current_checker_position);

        % how many samples to generate
        if sum(checker_classes(current_checker_position:end)==ccc) == 1
            % this is the last checker of this class, we need to add all
            % missing samples
            nadd = nsamples_per_class(ccc) - nsamples_per_class_added(ccc);
        else
            % if the nr of samples-per-class is
            % not divisible by the number of checkers-per-class, we have to
            % distribute the odd ones

            if mod(sum(checker_classes(1:current_checker_position)),2)==0
                nadd = floor(nsamples_per_class(ccc) / checkers_per_class(ccc));
            else
                nadd = ceil(nsamples_per_class(ccc) / checkers_per_class(ccc));
            end
            nsamples_per_class_added(ccc) = nsamples_per_class_added(ccc) + nadd;
        end

        % create data within this checker
        X = [X; rand(nadd, 2)+repmat([x,y],nadd,1) ];
        clabel = [clabel; ones(nadd,1) * ccc];

        % increase count
        x = x + 1;
        current_checker_position = current_checker_position + 1;
    end
    x = 0;
    y = y + 1;
end

%% Add noise to x-y positions
if scale > 0
    X = X + randn(size(X)) * sqrt(scale);
end

%% Plot data
if do_plot

    plotopt = {'.', 'MarkerSize', 12};

    clf
    for cc=1:nclasses
        plot(X(clabel==cc,1),X(clabel==cc,2), plotopt{:})
        hold all
    end
    xlabel('Feature 1')
    ylabel('Feature 2')

end


text:
Run with:
```bash
node eg/led-rgb.js
```

```javascript
var five = require("johnny-five");

five.Board().on("ready", function() {

  // Initialize the RGB LED
  var led = new five.Led.RGB({
    pins: {
      red: 3,
      green: 5,
      blue: 6
    }
  });

  // RGB LED alternate constructor
  // This will normalize an array of pins in [r, g, b]
  // order to an object (like above) that's shaped like:
  // {
  //   red: r,
  //   green: g,
  //   blue: b
  // }
  //var led = new five.Led.RGB([3,5,6]);

  // Add led to REPL (optional)
  this.repl.inject({
    led: led
  });

  // Turn it on and set the initial color
  led.on();
  led.color("#FF0000");

  led.blink(1000);

});

```

## Breadboard/Illustration

![docs/breadboard/led-rgb.png](breadboard/led-rgb.png)
[docs/breadboard/led-rgb.fzz](breadboard/led-rgb.fzz)

## License
Copyright (c) 2012-2013 Rick Waldron <waldron.rick@gmail.com>
Licensed under the MIT license.
Copyright (c) 2014 The Johnny-Five Contributors
Licensed under the MIT license.


text:
package testing

import (
	"fmt"
	"os"
	"sync"
)

// NTB partially implements testing.TB
// It is used by the shared setup steps to invoke the per-test functions.
type NTB interface {
	Cleanup(func())
	Error(args ...interface{})
	Errorf(format string, args ...interface{})
	Fail()
	FailNow()
	Failed() bool
	Fatal(args ...interface{})
	Fatalf(format string, args ...interface{})
	Helper()
	Log(args ...interface{})
	Logf(format string, args ...interface{})
	Name() string
	Skip(args ...interface{})
	SkipNow()
	Skipf(format string, args ...interface{})
	Skipped() bool
}

// FakeNTB implements NTB with standard print out and exit.
// It is used in `e2e/testcases/main_test.go` when `--share-test-env` is turned on.
type FakeNTB struct {
	mu       sync.RWMutex
	failed   bool
	cleanups []func()
}

// Error is equivalent to Log followed by Fail.
func (t *FakeNTB) Error(args ...interface{}) {
	t.Log(args...)
	t.Fail()
}

// Errorf is equivalent to Logf followed by Fail.
func (t *FakeNTB) Errorf(format string, args ...interface{}) {
	t.Logf(format, args...)
	t.Fail()
}

// Fail marks the function as having failed but continues execution.
func (t *FakeNTB) Fail() {
	t.mu.Lock()
	defer t.mu.Unlock()
	t.failed = true
}

// FailNow marks the function as having failed and stops its execution
// by calling runtime.Goexit (which then runs all deferred calls in the
// current goroutine).
func (t *FakeNTB) FailNow() {
	t.Fail()
	os.Exit(1)
}

// Failed reports whether the function has failed.
func (t *FakeNTB) Failed() bool {
	return t.failed
}

// Fatal is equivalent to Log followed by FailNow.
func (t *FakeNTB) Fatal(args ...interface{}) {
	t.Log(args...)
	t.FailNow()
}

// Fatalf is equivalent to Logf followed by FailNow.
func (t *FakeNTB) Fatalf(format string, args ...interface{}) {
	t.Logf(format, args...)
	t.FailNow()
}

// Name returns an empty string.
func (t *FakeNTB) Name() string {
	return ""
}

// Helper is a no-op function.
func (t *FakeNTB) Helper() {
}

// Cleanup registers a cleanup function to call at the end of the test suite.
func (t *FakeNTB) Cleanup(f func()) {
	t.mu.Lock()
	defer t.mu.Unlock()
	t.cleanups = append(t.cleanups, f)
}

// RunCleanup invokes all registered cleanup functions.
// this should be called at the end of the shared test quite after all tests
// have completed.
func (t *FakeNTB) RunCleanup() {
	defer func() {
		if r := recover(); r != nil {
			t.Logf("Caught panic during FakeNTB.RunCleanup:\n%v", r)
		}
	}()

	t.runCleanup()
}

func (t *FakeNTB) runCleanup() {
	// Make sure that if a cleanup function panics,
	// we still run the remaining cleanup functions.
	defer func() {
		t.mu.Lock()
		recur := len(t.cleanups) > 0
		t.mu.Unlock()
		if recur {
			t.runCleanup()
		}
	}()

	for {
		var cleanup func()
		t.mu.Lock()
		if len(t.cleanups) > 0 {
			last := len(t.cleanups) - 1
			cleanup = t.cleanups[last]
			t.cleanups = t.cleanups[:last]
		}
		t.mu.Unlock()
		if cleanup == nil {
			return
		}
		cleanup()
	}
}

// Skip is a no-op function.
func (t *FakeNTB) Skip(...interface{}) {
}

// SkipNow is a no-op function.
func (t *FakeNTB) SkipNow() {
}

// Skipf is a no-op function.
func (t *FakeNTB) Skipf(string, ...interface{}) {
}

// Skipped is a no-op function.
func (t *FakeNTB) Skipped() bool {
	return false
}

// Log generates the output. It's always at the same stack depth.
func (t *FakeNTB) Log(args ...interface{}) {
	fmt.Println(args...)
}

// Logf formats its arguments according to the format, analogous to Printf, and
// records the text in the error log.
func (t *FakeNTB) Logf(format string, args ...interface{}) {
	fmt.Printf(format, args...)
	fmt.Println()
}


text:
%define ARCH 01

%include "igzip_decode_block_stateless.asm"


text:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<document>
    <annotations>
        <annotation>
            <id>357295</id>
            <start>665</start>
            <end>675</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Lexical Aspectual Class">
                dynamic
            </labels>
            <labels labelSetName="Telicity">
                telic
            </labels>
        </annotation>
        <annotation>
            <id>357307</id>
            <start>2049</start>
            <end>2055</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Telicity">
                atelic
            </labels>
            <labels labelSetName="Lexical Aspectual Class">
                dynamic
            </labels>
        </annotation>
        <annotation>
            <id>357237</id>
            <start>4529</start>
            <end>4535</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Lexical Aspectual Class">
                dynamic
            </labels>
            <labels labelSetName="Telicity">
                atelic
            </labels>
        </annotation>
        <annotation>
            <id>357253</id>
            <start>1637</start>
            <end>1643</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Lexical Aspectual Class">
                dynamic
            </labels>
            <labels labelSetName="Telicity">
                atelic
            </labels>
        </annotation>
        <annotation>
            <id>357230</id>
            <start>3189</start>
            <end>3195</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Telicity">
                atelic
            </labels>
            <labels labelSetName="Lexical Aspectual Class">
                dynamic
            </labels>
        </annotation>
        <annotation>
            <id>357252</id>
            <start>2883</start>
            <end>2888</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Lexical Aspectual Class">
                stative
            </labels>
        </annotation>
        <annotation>
            <id>357263</id>
            <start>5050</start>
            <end>5055</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Lexical Aspectual Class">
                stative
            </labels>
        </annotation>
        <annotation>
            <id>357302</id>
            <start>342</start>
            <end>351</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Telicity">
                telic
            </labels>
            <labels labelSetName="Lexical Aspectual Class">
                dynamic
            </labels>
        </annotation>
        <annotation>
            <id>357239</id>
            <start>2412</start>
            <end>2419</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Telicity">
                atelic
            </labels>
            <labels labelSetName="Lexical Aspectual Class">
                dynamic
            </labels>
        </annotation>
        <annotation>
            <id>357304</id>
            <start>2326</start>
            <end>2333</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Lexical Aspectual Class">
                dynamic
            </labels>
            <labels labelSetName="Telicity">
                atelic
            </labels>
        </annotation>
        <annotation>
            <id>357266</id>
            <start>2285</start>
            <end>2294</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Lexical Aspectual Class">
                stative
            </labels>
        </annotation>
        <annotation>
            <id>357228</id>
            <start>484</start>
            <end>490</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Telicity">
                telic
            </labels>
            <labels labelSetName="Lexical Aspectual Class">
                dynamic
            </labels>
        </annotation>
        <annotation>
            <id>357290</id>
            <start>3707</start>
            <end>3712</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Lexical Aspectual Class">
                dynamic
            </labels>
            <labels labelSetName="Telicity">
                atelic
            </labels>
        </annotation>
        <annotation>
            <id>357258</id>
            <start>4910</start>
            <end>4913</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Lexical Aspectual Class">
                stative
            </labels>
        </annotation>
        <annotation>
            <id>357309</id>
            <start>4400</start>
            <end>4405</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Lexical Aspectual Class">
                dynamic
            </labels>
            <labels labelSetName="Telicity">
                atelic
            </labels>
        </annotation>
        <annotation>
            <id>357291</id>
            <start>4492</start>
            <end>4498</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Lexical Aspectual Class">
                dynamic
            </labels>
            <labels labelSetName="Telicity">
                atelic
            </labels>
        </annotation>
        <annotation>
            <id>357312</id>
            <start>397</start>
            <end>404</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Lexical Aspectual Class">
                stative
            </labels>
        </annotation>
        <annotation>
            <id>357282</id>
            <start>3460</start>
            <end>3466</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Lexical Aspectual Class">
                dynamic
            </labels>
            <labels labelSetName="Telicity">
                atelic
            </labels>
        </annotation>
        <annotation>
            <id>357229</id>
            <start>4627</start>
            <end>4633</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Lexical Aspectual Class">
                dynamic
            </labels>
            <labels labelSetName="Telicity">
                atelic
            </labels>
        </annotation>
        <annotation>
            <id>357256</id>
            <start>1671</start>
            <end>1680</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Telicity">
                telic
            </labels>
            <labels labelSetName="Lexical Aspectual Class">
                dynamic
            </labels>
        </annotation>
        <annotation>
            <id>357269</id>
            <start>4252</start>
            <end>4257</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Lexical Aspectual Class">
                stative
            </labels>
        </annotation>
        <annotation>
            <id>357242</id>
            <start>1751</start>
            <end>1757</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Lexical Aspectual Class">
                stative
            </labels>
        </annotation>
        <annotation>
            <id>357267</id>
            <start>3279</start>
            <end>3289</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Lexical Aspectual Class">
                dynamic
            </labels>
            <labels labelSetName="Telicity">
                atelic
            </labels>
        </annotation>
        <annotation>
            <id>357265</id>
            <start>3356</start>
            <end>3362</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Lexical Aspectual Class">
                dynamic
            </labels>
            <labels labelSetName="Telicity">
                atelic
            </labels>
        </annotation>
        <annotation>
            <id>357270</id>
            <start>1086</start>
            <end>1092</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Lexical Aspectual Class">
                stative
            </labels>
        </annotation>
        <annotation>
            <id>357315</id>
            <start>3909</start>
            <end>3912</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Telicity">
                atelic
            </labels>
            <labels labelSetName="Lexical Aspectual Class">
                dynamic
            </labels>
        </annotation>
        <annotation>
            <id>357292</id>
            <start>5149</start>
            <end>5157</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Lexical Aspectual Class">
                stative
            </labels>
        </annotation>
        <annotation>
            <id>357236</id>
            <start>83</start>
            <end>91</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Lexical Aspectual Class">
                dynamic
            </labels>
            <labels labelSetName="Telicity">
                telic
            </labels>
        </annotation>
        <annotation>
            <id>357248</id>
            <start>3220</start>
            <end>3229</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Lexical Aspectual Class">
                stative
            </labels>
        </annotation>
        <annotation>
            <id>357276</id>
            <start>1210</start>
            <end>1217</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Telicity">
                telic
            </labels>
            <labels labelSetName="Lexical Aspectual Class">
                dynamic
            </labels>
        </annotation>
        <annotation>
            <id>357306</id>
            <start>3329</start>
            <end>3338</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Telicity">
                atelic
            </labels>
            <labels labelSetName="Lexical Aspectual Class">
                dynamic
            </labels>
        </annotation>
        <annotation>
            <id>357272</id>
            <start>860</start>
            <end>864</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Lexical Aspectual Class">
                stative
            </labels>
        </annotation>
        <annotation>
            <id>357257</id>
            <start>2623</start>
            <end>2630</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Telicity">
                telic
            </labels>
            <labels labelSetName="Lexical Aspectual Class">
                dynamic
            </labels>
        </annotation>
        <annotation>
            <id>357255</id>
            <start>2917</start>
            <end>2921</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Telicity">
                atelic
            </labels>
            <labels labelSetName="Lexical Aspectual Class">
                dynamic
            </labels>
        </annotation>
        <annotation>
            <id>357268</id>
            <start>3117</start>
            <end>3123</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Telicity">
                telic
            </labels>
            <labels labelSetName="Lexical Aspectual Class">
                dynamic
            </labels>
        </annotation>
        <annotation>
            <id>357293</id>
            <start>1915</start>
            <end>1918</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Lexical Aspectual Class">
                stative
            </labels>
        </annotation>
        <annotation>
            <id>357235</id>
            <start>4896</start>
            <end>4901</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Telicity">
                atelic
            </labels>
            <labels labelSetName="Lexical Aspectual Class">
                dynamic
            </labels>
        </annotation>
        <annotation>
            <id>357320</id>
            <start>602</start>
            <end>611</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Telicity">
                atelic
            </labels>
            <labels labelSetName="Lexical Aspectual Class">
                dynamic
            </labels>
        </annotation>
        <annotation>
            <id>357232</id>
            <start>1943</start>
            <end>1951</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Telicity">
                atelic
            </labels>
            <labels labelSetName="Lexical Aspectual Class">
                dynamic
            </labels>
        </annotation>
        <annotation>
            <id>357240</id>
            <start>1981</start>
            <end>1987</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Lexical Aspectual Class">
                dynamic
            </labels>
            <labels labelSetName="Telicity">
                atelic
            </labels>
        </annotation>
        <annotation>
            <id>357298</id>
            <start>2369</start>
            <end>2372</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Telicity">
                atelic
            </labels>
            <labels labelSetName="Lexical Aspectual Class">
                dynamic
            </labels>
        </annotation>
        <annotation>
            <id>357308</id>
            <start>4144</start>
            <end>4149</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Lexical Aspectual Class">
                stative
            </labels>
        </annotation>
        <annotation>
            <id>357285</id>
            <start>4433</start>
            <end>4444</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Telicity">
                atelic
            </labels>
            <labels labelSetName="Lexical Aspectual Class">
                dynamic
            </labels>
        </annotation>
        <annotation>
            <id>357310</id>
            <start>1618</start>
            <end>1624</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Telicity">
                atelic
            </labels>
            <labels labelSetName="Lexical Aspectual Class">
                dynamic
            </labels>
        </annotation>
        <annotation>
            <id>357234</id>
            <start>3441</start>
            <end>3449</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Lexical Aspectual Class">
                stative
            </labels>
        </annotation>
        <annotation>
            <id>357247</id>
            <start>2762</start>
            <end>2768</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Lexical Aspectual Class">
                dynamic
            </labels>
            <labels labelSetName="Telicity">
                telic
            </labels>
        </annotation>
        <annotation>
            <id>357259</id>
            <start>4590</start>
            <end>4592</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Lexical Aspectual Class">
                stative
            </labels>
        </annotation>
        <annotation>
            <id>357289</id>
            <start>925</start>
            <end>934</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Telicity">
                atelic
            </labels>
            <labels labelSetName="Lexical Aspectual Class">
                dynamic
            </labels>
        </annotation>
        <annotation>
            <id>357318</id>
            <start>1353</start>
            <end>1361</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Lexical Aspectual Class">
                dynamic
            </labels>
            <labels labelSetName="Telicity">
                telic
            </labels>
        </annotation>
        <annotation>
            <id>357303</id>
            <start>4310</start>
            <end>4316</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Telicity">
                atelic
            </labels>
            <labels labelSetName="Lexical Aspectual Class">
                dynamic
            </labels>
        </annotation>
        <annotation>
            <id>357317</id>
            <start>2501</start>
            <end>2504</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Lexical Aspectual Class">
                dynamic
            </labels>
            <labels labelSetName="Telicity">
                atelic
            </labels>
        </annotation>
        <annotation>
            <id>357280</id>
            <start>819</start>
            <end>823</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Lexical Aspectual Class">
                dynamic
            </labels>
            <labels labelSetName="Telicity">
                telic
            </labels>
        </annotation>
        <annotation>
            <id>357245</id>
            <start>3863</start>
            <end>3867</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Lexical Aspectual Class">
                stative
            </labels>
        </annotation>
        <annotation>
            <id>357274</id>
            <start>4504</start>
            <end>4512</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Telicity">
                atelic
            </labels>
            <labels labelSetName="Lexical Aspectual Class">
                dynamic
            </labels>
        </annotation>
        <annotation>
            <id>357316</id>
            <start>969</start>
            <end>977</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Lexical Aspectual Class">
                dynamic
            </labels>
            <labels labelSetName="Telicity">
                telic
            </labels>
        </annotation>
        <annotation>
            <id>357271</id>
            <start>2204</start>
            <end>2209</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Lexical Aspectual Class">
                dynamic
            </labels>
            <labels labelSetName="Telicity">
                telic
            </labels>
        </annotation>
        <annotation>
            <id>357299</id>
            <start>4724</start>
            <end>4732</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Lexical Aspectual Class">
                dynamic
            </labels>
            <labels labelSetName="Telicity">
                atelic
            </labels>
        </annotation>
        <annotation>
            <id>357301</id>
            <start>2548</start>
            <end>2553</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Telicity">
                atelic
            </labels>
            <labels labelSetName="Lexical Aspectual Class">
                dynamic
            </labels>
        </annotation>
        <annotation>
            <id>357238</id>
            <start>5681</start>
            <end>5685</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Lexical Aspectual Class">
                stative
            </labels>
        </annotation>
        <annotation>
            <id>357261</id>
            <start>2947</start>
            <end>2958</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Lexical Aspectual Class">
                stative
            </labels>
        </annotation>
        <annotation>
            <id>357243</id>
            <start>151</start>
            <end>157</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Lexical Aspectual Class">
                dynamic
            </labels>
            <labels labelSetName="Telicity">
                atelic
            </labels>
        </annotation>
        <annotation>
            <id>357311</id>
            <start>4062</start>
            <end>4073</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Telicity">
                telic
            </labels>
            <labels labelSetName="Lexical Aspectual Class">
                dynamic
            </labels>
        </annotation>
        <annotation>
            <id>357281</id>
            <start>2705</start>
            <end>2708</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Lexical Aspectual Class">
                stative
            </labels>
        </annotation>
        <annotation>
            <id>357287</id>
            <start>4002</start>
            <end>4010</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Lexical Aspectual Class">
                dynamic
            </labels>
            <labels labelSetName="Telicity">
                telic
            </labels>
        </annotation>
        <annotation>
            <id>357249</id>
            <start>101</start>
            <end>109</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Telicity">
                telic
            </labels>
            <labels labelSetName="Lexical Aspectual Class">
                dynamic
            </labels>
        </annotation>
        <annotation>
            <id>357250</id>
            <start>1458</start>
            <end>1463</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Lexical Aspectual Class">
                dynamic
            </labels>
            <labels labelSetName="Telicity">
                telic
            </labels>
        </annotation>
        <annotation>
            <id>357319</id>
            <start>1814</start>
            <end>1817</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Lexical Aspectual Class">
                stative
            </labels>
        </annotation>
        <annotation>
            <id>357264</id>
            <start>5340</start>
            <end>5348</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Lexical Aspectual Class">
                stative
            </labels>
        </annotation>
        <annotation>
            <id>357254</id>
            <start>1159</start>
            <end>1167</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Telicity">
                telic
            </labels>
            <labels labelSetName="Lexical Aspectual Class">
                dynamic
            </labels>
        </annotation>
        <annotation>
            <id>357246</id>
            <start>4123</start>
            <end>4134</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Lexical Aspectual Class">
                dynamic
            </labels>
            <labels labelSetName="Telicity">
                telic
            </labels>
        </annotation>
        <annotation>
            <id>357277</id>
            <start>4666</start>
            <end>4675</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Telicity">
                telic
            </labels>
            <labels labelSetName="Lexical Aspectual Class">
                dynamic
            </labels>
        </annotation>
        <annotation>
            <id>357300</id>
            <start>5078</start>
            <end>5086</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Lexical Aspectual Class">
                stative
            </labels>
        </annotation>
        <annotation>
            <id>357297</id>
            <start>884</start>
            <end>890</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Lexical Aspectual Class">
                stative
            </labels>
        </annotation>
        <annotation>
            <id>357262</id>
            <start>1330</start>
            <end>1338</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Telicity">
                telic
            </labels>
            <labels labelSetName="Lexical Aspectual Class">
                dynamic
            </labels>
        </annotation>
        <annotation>
            <id>357244</id>
            <start>5527</start>
            <end>5531</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Lexical Aspectual Class">
                dynamic
            </labels>
            <labels labelSetName="Telicity">
                atelic
            </labels>
        </annotation>
        <annotation>
            <id>357321</id>
            <start>1080</start>
            <end>1084</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Telicity">
                telic
            </labels>
            <labels labelSetName="Lexical Aspectual Class">
                dynamic
            </labels>
        </annotation>
        <annotation>
            <id>357279</id>
            <start>5777</start>
            <end>5780</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Lexical Aspectual Class">
                stative
            </labels>
        </annotation>
        <annotation>
            <id>357231</id>
            <start>5813</start>
            <end>5819</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Telicity">
                atelic
            </labels>
            <labels labelSetName="Lexical Aspectual Class">
                dynamic
            </labels>
        </annotation>
        <annotation>
            <id>357278</id>
            <start>4103</start>
            <end>4106</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Lexical Aspectual Class">
                stative
            </labels>
        </annotation>
        <annotation>
            <id>357286</id>
            <start>1839</start>
            <end>1844</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Lexical Aspectual Class">
                stative
            </labels>
        </annotation>
        <annotation>
            <id>357284</id>
            <start>0</start>
            <end>7</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Telicity">
                atelic
            </labels>
            <labels labelSetName="Lexical Aspectual Class">
                dynamic
            </labels>
        </annotation>
        <annotation>
            <id>357314</id>
            <start>3533</start>
            <end>3538</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Lexical Aspectual Class">
                dynamic
            </labels>
            <labels labelSetName="Telicity">
                atelic
            </labels>
        </annotation>
        <annotation>
            <id>357233</id>
            <start>3637</start>
            <end>3641</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Telicity">
                atelic
            </labels>
            <labels labelSetName="Lexical Aspectual Class">
                dynamic
            </labels>
        </annotation>
        <annotation>
            <id>357251</id>
            <start>3796</start>
            <end>3803</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Lexical Aspectual Class">
                dynamic
            </labels>
            <labels labelSetName="Telicity">
                atelic
            </labels>
        </annotation>
        <annotation>
            <id>357260</id>
            <start>4287</start>
            <end>4291</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Lexical Aspectual Class">
                dynamic
            </labels>
            <labels labelSetName="Telicity">
                atelic
            </labels>
        </annotation>
        <annotation>
            <id>357241</id>
            <start>5864</start>
            <end>5873</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Lexical Aspectual Class">
                dynamic
            </labels>
            <labels labelSetName="Telicity">
                atelic
            </labels>
        </annotation>
        <annotation>
            <id>357294</id>
            <start>4684</start>
            <end>4687</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Lexical Aspectual Class">
                stative
            </labels>
        </annotation>
        <annotation>
            <id>357296</id>
            <start>5563</start>
            <end>5572</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Lexical Aspectual Class">
                stative
            </labels>
        </annotation>
        <annotation>
            <id>357273</id>
            <start>5199</start>
            <end>5207</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Telicity">
                telic
            </labels>
            <labels labelSetName="Lexical Aspectual Class">
                dynamic
            </labels>
        </annotation>
        <annotation>
            <id>357305</id>
            <start>1567</start>
            <end>1574</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Lexical Aspectual Class">
                dynamic
            </labels>
            <labels labelSetName="Telicity">
                telic
            </labels>
        </annotation>
        <annotation>
            <id>357275</id>
            <start>2985</start>
            <end>2993</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Telicity">
                atelic
            </labels>
            <labels labelSetName="Lexical Aspectual Class">
                dynamic
            </labels>
        </annotation>
        <annotation>
            <id>357283</id>
            <start>695</start>
            <end>705</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Lexical Aspectual Class">
                dynamic
            </labels>
            <labels labelSetName="Telicity">
                telic
            </labels>
        </annotation>
        <annotation>
            <id>357313</id>
            <start>235</start>
            <end>238</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Lexical Aspectual Class">
                stative
            </labels>
        </annotation>
        <annotation>
            <id>357288</id>
            <start>2850</start>
            <end>2857</end>
            <targetType>Situation Entity</targetType>
            <labels labelSetName="Telicity">
                telic
            </labels>
            <labels labelSetName="Lexical Aspectual Class">
                dynamic
            </labels>
        </annotation>
    </annotations>
    <links/>
</document>


text:
<?xml version="1.0" encoding="utf-8"?>
<clip xmlns:android="http://schemas.android.com/apk/res/android"
    android:drawable="@drawable/banner1"
    android:clipOrientation="horizontal"
    android:gravity="start">

</clip>


text:
namespace osrm
{
namespace engine
{
namespace routing_algorithms
{
namespace
{
struct NodeBucket
{
    NodeID middle_node;
    NodeID parent_node;
    unsigned column_index : 31; // a column in the weight/duration matrix
    unsigned from_clique_arc : 1;
    EdgeWeight weight;
    EdgeDuration duration;
    EdgeDistance distance;

    NodeBucket(NodeID middle_node,
               NodeID parent_node,
               bool from_clique_arc,
               unsigned column_index,
               EdgeWeight weight,
               EdgeDuration duration,
               EdgeDistance distance)
        : middle_node(middle_node), parent_node(parent_node), column_index(column_index),
          from_clique_arc(from_clique_arc), weight(weight), duration(duration), distance(distance)
    {
    }

    NodeBucket(NodeID middle_node,
               NodeID parent_node,
               unsigned column_index,
               EdgeWeight weight,
               EdgeDuration duration,
               EdgeDistance distance)
        : middle_node(middle_node), parent_node(parent_node), column_index(column_index),
          from_clique_arc(false), weight(weight), duration(duration), distance(distance)
    {
    }

    // partial order comparison
    bool operator<(const NodeBucket &rhs) const
    {
        return std::tie(middle_node, column_index) < std::tie(rhs.middle_node, rhs.column_index);
    }

    // functor for equal_range
    struct Compare
    {
        bool operator()(const NodeBucket &lhs, const NodeID &rhs) const
        {
            return lhs.middle_node < rhs;
        }

        bool operator()(const NodeID &lhs, const NodeBucket &rhs) const
        {
            return lhs < rhs.middle_node;
        }
    };

    // functor for equal_range
    struct ColumnCompare
    {
        unsigned column_idx;

        ColumnCompare(unsigned column_idx) : column_idx(column_idx){};

        bool operator()(const NodeBucket &lhs, const NodeID &rhs) const // lowerbound
        {
            return std::tie(lhs.middle_node, lhs.column_index) < std::tie(rhs, column_idx);
        }

        bool operator()(const NodeID &lhs, const NodeBucket &rhs) const // upperbound
        {
            return std::tie(lhs, column_idx) < std::tie(rhs.middle_node, rhs.column_index);
        }
    };
};
} // namespace

template <typename Algorithm>
std::pair<std::vector<EdgeDuration>, std::vector<EdgeDistance>>
manyToManySearch(SearchEngineData<Algorithm> &engine_working_data,
                 const DataFacade<Algorithm> &facade,
                 const std::vector<PhantomNodeCandidates> &candidates_list,
                 const std::vector<std::size_t> &source_indices,
                 const std::vector<std::size_t> &target_indices,
                 const bool calculate_distance);

} // namespace routing_algorithms
} // namespace engine
} // namespace osrm

#endif


text:
<?xml version='1.0' encoding='utf-8'?>
<TEI xmlns="http://www.tei-c.org/ns/1.0" xml:id="PrL-0572">
   <teiHeader>
      <fileDesc>
         <titleStmt>
            <title>Private Letter: 1884 August 13: to Grey</title>
            <author>
               <name type="person" key="http://wtap.vuw.ac.nz/eats/entity/9614/">William Colenso</name>
            </author>
         </titleStmt>
         <publicationStmt>

         </publicationStmt>
         <sourceDesc>

Auckland Council Libraries GLNZ C28.8 (Grey New Zealand letters).

         </sourceDesc>
      </fileDesc>
      <profileDesc>
         <correspDesc>

               <correspAction type="received">
                  <name type="person" key="http://wtap.vuw.ac.nz/eats/entity/48318/">Grey</name>
               </correspAction>
            </correspDesc>
         <creation xmlns:tei="http://www.tei-c.org/ns/1.0">
            <date when="1884-08-13">1884 August 13</date>
         </creation>
      </profileDesc>
   </teiHeader>
   <text>
      <front>

1884 August 13: to Grey<note xml:id="ftn3-252" place="foot" n="252"> Auckland Council Libraries GLNZ C28.8 (Grey New Zealand letters).</note>

      </front>

Napier, August 13<hi rend="sup ">th</hi>. 1884

My dear Sir George Grey,

Your kind and valued note of the 6<hi rend="sup ">th</hi>. inst. I duly received, and I thank you for it. As you have truly observed, I had thought that your perusal of this last little book would recall to mind <hi rend="italic">old times </hi>in N.Z.—of which you, in particular, have seen so much!—

Agreeably with your request I send you, with this, your 4 remaining copies, and have also written my name in one (which is marked). I have detained them a while to go by Steamer hence on Saturday, as parcels get knocked about and damp in overland coach transit.—

You kindly enquire the price: 4/. each, as stipulated in advertisement. There are a few copies left, which will be at the same figure to original subscribers, but 5/. to non-subscribers,—to meet the expense of extra printing: as I had only originally intended the little book to consist of 60 pp. There are also a few copies of the former book still on hand at 3/. ea.

Knowing your busy and arduous political situation there at Wellington, I forebear saying anything more.—

     Believe me, Dear Sir G. Grey,

                                     Yours very truly

                                                                     Wm. Colenso.

   </text>
</TEI>