text:
(function(){
  'use strict';
  /**
  * componentModule Module
  *
  * Description
  */

  angular.module('itDebugTemplates', []);

  angular.module('itDebugPanel', ['itDebugTemplates'])

    .factory('RecursionHelper', ['$compile', function($compile){
      return {
        /**
         * Manually compiles the element, fixing the recursion loop.
         * @param element
         * @param [link] A post-link function, or an object with function(s) registered via pre and post properties.
         * @returns An object containing the linking functions.
         */
        compile: function(element, link){
          // Normalize the link parameter
          if(angular.isFunction(link)){
            link = { post: link };
          }

          // Break the recursion loop by removing the contents
          var contents = element.contents().remove();
          var compiledContents;
          return {
            pre: (link && link.pre) ? link.pre : null,
            /**
             * Compiles and re-adds the contents
             */
            post: function(scope, element){
              // Compile the contents
              if(!compiledContents){
                compiledContents = $compile(contents);
              }
              // Re-add the compiled contents to the element
              compiledContents(scope, function(clone){
                element.append(clone);
              });

              // Call the post-linking function, if any
              if(link && link.post){
                link.post.apply(null, arguments);
              }
            }
          };
        }
      };
    }])

    .directive('code', ['$sce', function($sce){
      return {
        restrict:'A',
        priority:10000,
        link: function(scope,iElem,attrs){

          console.log(iElem[0].innerHTML);
          var replaced = iElem[0].innerHTML.trim();
          replaced = replaced.replace(/&/g, '&')
          replaced = replaced.replace(/</g,'<');
          replaced = replaced.replace(/>/g,'>');
          replaced = replaced.replace(/\s/g,'
  ')
          replaced = replaced.replace(/></g,'>
<');
          iElem.replaceWith(replaced);
          // scope.display = $sce.trustAsHtml(replaced);
        }
      }
    }])

    .directive('debugPanel', ['$document', '$filter', function($document, $filter){
      return {
        restrict:'E',
        scope: { watchModel: '=', panelVisible: '=?' },
        templateUrl:'component/templates/debugPanel.tpl.html',
        link:function(scope, iElem){
          scope.$watch('watchModel', function(newVal){
            scope.filteredOptions = $filter('objectFilter')(newVal, scope.filterText);
          }, true);
          var targetOptions;

          scope.$watch(function(){return targetOptions}, function(newVal){
            if(!newVal)
              return;
            scope.filteredOptions = $filter('objectFilter')(newVal, scope.filterText);
          })

          scope.$watch('filterText', function(){
            if(targetOptions)
              scope.filteredOptions = $filter('objectFilter')(targetOptions, scope.filterText);
            else
              scope.filteredOptions = $filter('objectFilter')(scope.watchModel, scope.filterText);
          });

          scope.targetElement = function(){
            var angHovElem;
            var initalBackgroundColor;
            $document.bind('mousemove', function handler(event){
              function mouseOutHandler(){
                hoveredElem.style.backgroundColor = initalBackgroundColor;
                angHovElem.unbind('mouseout', mouseOutHandler);
                angHovElem.unbind('click', clickHandler);
                angHovElem = null;
              }
              function clickHandler(){
                hoveredElem.style.backgroundColor = initalBackgroundColor;
                angHovElem.unbind('mouseout', mouseOutHandler);
                angHovElem.unbind('click', clickHandler);
                $document.unbind('mousemove', handler);
                targetOptions = angHovElem.scope();
                scope.$apply();
                angHovElem = null;
              }
              var hoveredElem = document.elementFromPoint(event.clientX,event.clientY);
              if(iElem[0].contains(hoveredElem))
                hoveredElem = null;
              if(!angHovElem && hoveredElem)
              {
                initalBackgroundColor = hoveredElem.style.backgroundColor;
                hoveredElem.style.backgroundColor = 'blue';

                angHovElem = angular.element(hoveredElem);

                angHovElem.bind('mouseout', mouseOutHandler);
                angHovElem.bind('click', clickHandler);
              }

            })
          }

          $document.bind('keydown', function(event){
            if(event.keyCode == 68 && event.shiftKey && event.altKey){
              scope.panelVisible = !scope.panelVisible;
              scope.$apply();
            }

          });
        }
      };
    }])
    .filter('objectFilter', function () {

      function getType(thingToCheck){
        if(angular.isFunction(thingToCheck))
          return 'Function'
        if(angular.isArray(thingToCheck))
          return 'Array';
        if(angular.isObject(thingToCheck))
          return 'Object';
        if(angular.isNumber(thingToCheck))
          return 'Number';
        if(typeof thingToCheck === 'boolean')
          return 'Boolean';
        return 'Default';
      };

      function TreeNode(obj,isActive,key,parent){
        this.isActive = isActive;
        this.children = [];
        this.obj = obj;
        this.key = key;
        this.value = obj[key];
        this.parent = parent;
        this.type = getType(this.value);
      }

      TreeNode.prototype.addChild = function(childNode){
        this.children.push(childNode);
      };

      TreeNode.prototype.matches = function(searchText){
        return (this.key&&this.key.indexOf&&this.key.indexOf(searchText)!=-1)||(this.value&&this.value.indexOf&&this.value.indexOf(searchText)!=-1)||(this.value==searchText);
      };

      function buildTree(obj,parent, isActive){
        angular.forEach(obj, function(value,key){
          if(key&&key.indexOf&&(key.indexOf("$")!=-1 || key === "this"))
            return;
          var newNode = new TreeNode(obj,isActive,key,parent);
          parent.addChild(newNode);
          if(angular.isObject(value)){
            buildTree(value,newNode, isActive);
          }
        })
      }

      function markParentsActive(node){
        var nodesParent = node.parent;
        while(nodesParent){
          nodesParent.isActive = true;
          nodesParent = nodesParent.parent;
        }
      }
      function markChildrenActive(node){
        angular.forEach(node.children, function(childNode, index){
          childNode.isActive = true;
          markChildrenActive(childNode);
        })
      }

      function findTextInTree(treeNode, searchText){
        angular.forEach(treeNode.children, function(node,index){
          if(node.matches(searchText)){
            markParentsActive(node);
            markChildrenActive(node);
            node.isActive = true;
          }
          else
          {
            findTextInTree(node,searchText);
          }
        });
      }

      return function (input, searchText) {
        if(!input)
          return;
        var rootNode = new TreeNode(input);

        if(!searchText||searchText == ''){
          buildTree(input, rootNode, true);
        }
        else{
          buildTree(input,rootNode, false)
          findTextInTree(rootNode,searchText);
        }

        return rootNode;
      };
    })

    .directive('optionsForm', ['RecursionHelper', function(RecursionHelper){

      return {
        restrict:'E',
        scope: {
          treeNode:'='
        },
        templateUrl:'component/templates/optionsForm.tpl.html',
        compile: function(element){
          return RecursionHelper.compile(element, function(scope){
            scope.arrayVisible=true;
            scope.isObject = function(thingToCheck){
              return angular.isObject(thingToCheck);
            };
          });
        }
      };
    }])
    // From the docs
    .directive('myDraggable', ['$document', function($document) {
      return function(scope, element) {
        var startX = 0, startY = 0, x = 0, y = 0;

        element.on('mousedown', function(event) {
          // Prevent default dragging of selected content
          event.preventDefault();
          startX = event.pageX - x;
          startY = event.pageY - y;
          $document.on('mousemove', mousemove);
          $document.on('mouseup', mouseup);
        });

        function mousemove(event) {
          y = event.pageY - startY;
          x = event.pageX - startX;
          element.css({
            top: y + 'px',
            left:  x + 'px'
          });
        }

        function mouseup() {
          $document.off('mousemove', mousemove);
          $document.off('mouseup', mouseup);
        }
      };
    }]).directive('blockMouseDown', function(){
      return {
        restrict:'A',
        link:function(scope, iElem){
          iElem.on('mousedown', function(event){
            event.stopImmediatePropagation();
          });
        }
      };
    });

})();;angular.module('itDebugTemplates', ['component/templates/debugPanel.tpl.html', 'component/templates/optionsForm.tpl.html']);

angular.module("component/templates/debugPanel.tpl.html", []).run(["$templateCache", function($templateCache) {
  $templateCache.put("component/templates/debugPanel.tpl.html",
    "
\n" +
    "
\n" +
    "
\n" +
    "      \n" +
    "        \n" +
    "      \n" +
    "
Debug Panel
\n" +
    "
\n" +
    "        <button ng-click=\"targetElement()\" class=\"btn btn-primary\">\n" +
    "          \n" +
    "          Inspect\n" +
    "        </button>\n" +
    "
After clicking click
 the target element
\n" +
    "
\n" +
    "

\n" +
    "      \n" +
    "
\n" +
    "        <input placeholder=\"Filter\" type=\"text\" block-mouse-down ng-model=\"filterText\" >\n" +
    "        \n" +
    "
\n" +
    "
\n" +
    "

\n" +
    "    <options-form tree-node=\"filteredOptions\">\n" +
    "    </options-form>\n" +
    "
\n" +
    "
");
}]);

angular.module("component/templates/optionsForm.tpl.html", []).run(["$templateCache", function($templateCache) {
  $templateCache.put("component/templates/optionsForm.tpl.html",
    "
\n" +
    "

\n" +
    "
0&&node.isActive\" class=\"well well-sm\">\n" +
    "
{{node.type}}: {{node.key}}
\n" +
    "    <options-form ng-show=\"visible\" tree-node=\"node\">\n" +
    "    </options-form>\n" +
    "
\n" +
    "
\n" +
    "
\n" +
    "
\n" +
    "
\n" +
    "        {{node.key}}:\n" +
    "
\n" +
    "
\n" +
    "        <input class=\"form-control\" ng-switch-when=\"Boolean\" block-mouse-down type=\"checkbox\" ng-model=\"node.obj[node.key]\">\n" +
    "        <input class=\"form-control\" ng-switch-when=\"Number\" block-mouse-down type=\"number\" ng-model=\"node.obj[node.key]\">\n" +
    "        \n" +
    "          Function\n" +
    "        \n" +
    "        <input class=\"form-control\" ng-switch-default block-mouse-down type=\"text\" ng-model=\"node.obj[node.key]\">\n" +
    "
\n" +
    "
\n" +
    "
\n" +
    "
");
}]);


text:
DIRECTORIES += src/fastpath

C_SOURCES += src/fastpath/fastpath.c

redpajama_set_name: RedPajamaGithub


text:
	{{#each lists.events}}
		{{#each this}}

{{event-date}}

{{event-name}}

{{event-description}}
			Event URL

		{{/each}}
	{{/each}}


text:
var httpClient = require('./httpclient')
var utils = require('./utils')
var SMSGHError = require('./error')

/**
 * TopUp description
 * @param {String} apiKey api key provided by SMSGH
 */
function TopUp (apiKey) {
  if (!(this instanceof TopUp)) return new TopUp(apiKey)

  if (!apiKey || typeof apiKey !== 'string') {
    throw new SMSGHError('TopUp expects an api key as a string')
  }

  this.apiKey = apiKey
}

/**
 * topItUp description
 * @param  {Object} opts The options object
 *   Example:
 *       {
 *           phone: '2332000000000',
 *           network: 'tigo',
 *           lineType: 0,
 *           amount: 5,
 *           method: 'GET'
 *       }
 *       phone: The phone number for which a top-up is being made. Must be of the form '233xxxxxxxxx'.
 *       network: The Mobile network
 *       lineType: Whether or not the service is prepaid or postpaid
 *       amount: The amount of credit to top up in Ghana cedis. Must be a positive integer (1, 2, 3, …)
 *       method: The type of method to use whether 'POST' or 'GET' default: 'GET'
 * @param {Function} callback The function that is called with an error if any and the response after
 * the api call has been made
 */
TopUp.prototype.topItUp = function (opts, callback) {
  if (!opts || typeof opts !== 'object') {
    callback(new SMSGHError('`topItUp` expects an options param and must be an object'), null)
  }
  opts.network = opts.network.toLowerCase()
  opts.method = (opts.method !== undefined ? opts.method : 'GET').toLowerCase()
  callback = callback || function () {}

  var validNetwork = false
  for (var i = 0, l = TopUp.NETWORKS.length; i < l; i++) {
    if (TopUp.NETWORKS[i] === opts.network) {
      validNetwork = true
      break
    }
  }

  if (!validNetwork) {
    callback(new SMSGHError('Available network types are: `mtn`, `vodafone`, `expresso`, `airtel`, `tigo` or `glo`'), null)
  }

  var formattedString = utils.serialize({
    'phone': opts.phone,
    'line-type': opts.lineType,
    'network': opts.network,
    'amount': opts.amount,
    'api-key': this.apiKey
  }, false, true)

  if (opts.method === 'get') {
    httpClient.get({
      url: TopUp.BASE_URL + '?' + formattedString
    }, callback)
  } else {
    httpClient.post({
      url: TopUp.BASE_URL,
      headers: {
        'Content-Type': 'application/x-www-form-urlencoded'
      },
      data: formattedString
    }, callback)
  }
}

TopUp.BASE_URL = 'https://api.smsgh.com/credit/topup'

TopUp.NETWORKS = ['mtn', 'vodafone', 'expresso', 'airtel', 'tigo', 'glo']

module.exports = TopUp


text:
class UserDecorator < Draper::Decorator
  delegate_all

  def role
    role = 'employee'
    role = 'bookkeeper' if object.has_role? :bookkeeper
    role = 'boss'       if is_boss?
    role = 'admin'      if object.has_role? :admin
    role
  end

private

  def is_boss?
    if object.department
      object == object.department.boss
    else
      false
    end
  end
end


text:
<!DOCTYPE html>
<html>
 <!--
Copyright 2014 The Closure Library Authors. All Rights Reserved.

Use of this source code is governed by the Apache License, Version 2.0.
See the COPYING file for details.
-->
 <!--
-->
 <head>
  <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  <meta charset="UTF-8" />
  <title>
   Closure Unit Tests - goog.ui.Toolbar
  </title>
  <script src="../base.js">
  </script>
  <script>
   goog.require('goog.ui.ToolbarTest');
  </script>
 </head>
 <body>
  <div id="toolbar-wrapper">
  </div>
 </body>
</html>


text:
#include "stdafx.h"

#include "connection.h"
#include "transaction.h"

#pragma region Construction / Destruction
NuoDb::NuoDbTransaction::NuoDbTransaction(NuoDbConnection^ connection, System::Data::IsolationLevel isolationLevel) :
	m_connection(nullptr),
	m_isolationLevel(isolationLevel)
{
	if (nullptr == connection)
		throw gcnew ArgumentNullException("connection");
}
#pragma endregion

#pragma region DbTransaction Overrides
#pragma region Properties
System::Data::Common::DbConnection^ NuoDb::NuoDbTransaction::DbConnection::get()
{
	return m_connection;
}
#pragma endregion

#pragma region Methods
void NuoDb::NuoDbTransaction::Commit()
{
	m_connection->CommitTransaction();
}

void NuoDb::NuoDbTransaction::Rollback()
{
	m_connection->RollbackTransaction();
}
#pragma endregion
#pragma endregion


text:
package am.widget.zxingscanview;

import android.animation.ValueAnimator;
import android.annotation.SuppressLint;
import android.annotation.TargetApi;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Rect;
import android.graphics.drawable.Animatable;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewParent;
import android.view.animation.CycleInterpolator;
import android.view.animation.Interpolator;

import com.google.zxing.Result;
import com.google.zxing.ResultPoint;
import com.google.zxing.client.android.compat.Compat;

import java.util.ListIterator;
import java.util.concurrent.CopyOnWriteArrayList;

/**
 * 前景视图
 * Created by Alex on 2016/11/30.
 */

public class ZxingForegroundView extends View {

    public static final int MODE_OPEN = 0;
    public static final int MODE_ERROR = 1;
    private static final long DEFAULT_FRAME_DELAY = 10;//丢失超过30帧就会报警
    private final OnScanListener scanListener = new OnScanListener();
    private final OnStateListener stateListener = new OnStateListener();
    private final Paint mPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
    private final Rect mCoverRect = new Rect();
    private final ValueAnimator mLoadingAnimator = ValueAnimator.ofFloat(0f, 1f);// 载入动画
    private final CopyOnWriteArrayList<ResultPointItem> mResultPoints = new CopyOnWriteArrayList<>();
    private final Interpolator mInterpolator = new CycleInterpolator(1);
    private Drawable mOpenDrawable;
    private Drawable mErrorDrawable;
    private ZxingScanView mScanView;
    private int mScanViewId;
    private int mode;
    private int mCoverColor;
    private Drawable mScanRectDrawable;
    private Drawable mScanFlagDrawable;
    private float mOffset = 0;
    private boolean mShowResultPoints;
    private long mResultPointsAnimatorDuration;
    private int mMaxResultPointsNumber;
    private int mResultPointsColor;
    private float mResultPointsSize;

    public ZxingForegroundView(Context context) {
        super(context);
        initView(null);
    }

    public ZxingForegroundView(Context context, AttributeSet attrs) {
        super(context, attrs);
        initView(attrs);
    }

    public ZxingForegroundView(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        initView(attrs);
    }

    @TargetApi(21)
    public ZxingForegroundView(Context context, AttributeSet attrs, int defStyleAttr,
                               int defStyleRes) {
        super(context, attrs, defStyleAttr, defStyleRes);
        initView(attrs);
    }

    private void initView(AttributeSet attrs) {
        Drawable open;
        Drawable error;
        int scanId = 0;
        int mode = MODE_OPEN;
        int coverColor = 0x80000000;
        Drawable scanRect;
        Drawable scanFlag;
        int duration = 2000;
        int repeatMode = 1;
        boolean showResultPoints;
        int resultPointsAnimatorDuration = 500;
        int maxNumber = 10;
        int resultPointsColor = 0xc0ffbd21;
        float resultPointsSize = 6;
        TypedArray custom = getContext().obtainStyledAttributes(attrs,
                R.styleable.ZxingForegroundView);
        open = custom.getDrawable(R.styleable.ZxingForegroundView_zfvOpenDrawable);
        error = custom.getDrawable(R.styleable.ZxingForegroundView_zfvErrorDrawable);
        scanId = custom.getResourceId(R.styleable.ZxingForegroundView_zfvZxingScanView, scanId);
        mode = custom.getInt(R.styleable.ZxingForegroundView_zfvMode, mode);
        coverColor = custom.getColor(R.styleable.ZxingForegroundView_zfvCoverColor, coverColor);
        scanRect = custom.getDrawable(R.styleable.ZxingForegroundView_zfvScanRectDrawable);
        scanFlag = custom.getDrawable(R.styleable.ZxingForegroundView_zfvScanFlagDrawable);
        duration = custom.getInteger(R.styleable.ZxingForegroundView_zfvFlagAnimatorDuration,
                duration);
        repeatMode = custom.getInt(R.styleable.ZxingForegroundView_zfvFlagAnimatorRepeatMode,
                repeatMode);
        showResultPoints = custom.getBoolean(R.styleable.ZxingForegroundView_zfvShowResultPoints,
                false);
        resultPointsAnimatorDuration = custom.getInteger(
                R.styleable.ZxingForegroundView_zfvResultPointsAnimatorDuration,
                resultPointsAnimatorDuration);
        maxNumber = custom.getInteger(R.styleable.ZxingForegroundView_zfvMaxResultPointsNumber,
                maxNumber);
        resultPointsColor = custom.getColor(R.styleable.ZxingForegroundView_zfvResultPointsColor,
                resultPointsColor);
        resultPointsSize = custom.getDimension(R.styleable.ZxingForegroundView_zfvResultPointsSize,
                resultPointsSize);
        custom.recycle();
        mScanViewId = scanId;
        setOpenDrawable(open);
        setErrorDrawable(error);
        setMode(mode);
        setCoverColor(coverColor);
        setScanRectDrawable(scanRect);
        setScanFlagDrawable(scanFlag);
        setFlagAnimatorDuration(duration);
        if (repeatMode == 1) {
            setFlagAnimatorRepeatMode(ValueAnimator.RESTART);
        } else {
            setFlagAnimatorRepeatMode(ValueAnimator.REVERSE);
        }
        setShowResultPoints(showResultPoints);
        setResultPointsAnimatorDuration(resultPointsAnimatorDuration);
        setMaxResultPointsNumber(maxNumber);
        setResultPointsColor(resultPointsColor);
        setResultPointsSize(resultPointsSize);
        mLoadingAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
            @Override
            public void onAnimationUpdate(ValueAnimator animator) {
                mOffset = (float) animator.getAnimatedValue();
                if (mShowResultPoints)
                    editResultPoints();
                if (mScanFlagDrawable != null)
                    invalidate();
            }
        });
        mLoadingAnimator.setRepeatCount(ValueAnimator.INFINITE);
    }

    @Override
    protected void onAttachedToWindow() {
        super.onAttachedToWindow();
        bindScanView();
        start();
    }

    private void bindScanView() {
        if (mScanViewId == 0)
            return;
        ViewParent parent = getParent();
        if (parent instanceof View) {
            View vParent = (View) parent;
            View child = vParent.findViewById(mScanViewId);
            if (child instanceof ZxingScanView) {
                bindScanView((ZxingScanView) child);
            }
        }
    }

    @Override
    protected void onDetachedFromWindow() {
        super.onDetachedFromWindow();
        end();
    }

    @Override
    protected void onDraw(Canvas canvas) {
        super.onDraw(canvas);
        drawState(canvas);
    }

    private void drawState(Canvas canvas) {
        if (mScanView == null)
            return;
        if (isInEditMode() || mScanView.isOpen()) {
            drawScan(canvas);
            return;
        }
        if (mScanView.getErrorCode() == ZxingScanView.ERROR_CODE_NULL) {
            drawOpen(canvas);
        } else {
            switch (mode) {
                default:
                case MODE_OPEN:
                    drawOpen(canvas);
                    break;
                case MODE_ERROR:
                    drawError(canvas);
                    break;
            }
        }
    }

    private void drawOpen(Canvas canvas) {
        if (mOpenDrawable == null)
            return;
        final int width = mOpenDrawable.getIntrinsicWidth();
        final int height = mOpenDrawable.getIntrinsicHeight();
        mOpenDrawable.setBounds(0, 0, width, height);
        final float xMove = (getWidth() - width) * 0.5f;
        final float yMove = (getHeight() - height) * 0.5f;
        canvas.save();
        canvas.translate(xMove, yMove);
        mOpenDrawable.draw(canvas);
        canvas.restore();
    }

    private void drawError(Canvas canvas) {
        if (mErrorDrawable == null)
            return;
        final int width = mErrorDrawable.getIntrinsicWidth();
        final int height = mErrorDrawable.getIntrinsicHeight();
        mErrorDrawable.setBounds(0, 0, width, height);
        final float xMove = (getWidth() - width) * 0.5f;
        final float yMove = (getHeight() - height) * 0.5f;
        canvas.save();
        canvas.translate(xMove, yMove);
        mErrorDrawable.draw(canvas);
        canvas.restore();
    }

    private void drawScan(Canvas canvas) {
        final int scanWidth = mScanView.getScanWidth() > 0 ?
                (mScanView.getScanWidth() > getWidth() ? getWidth() : mScanView.getScanWidth())
                : getWidth();
        final int scanHeight = mScanView.getScanHeight() > 0 ?
                (mScanView.getScanHeight() > getHeight() ? getHeight() : mScanView.getScanHeight())
                : getHeight();
        final int coverX = (getWidth() - scanWidth) / 2;
        final int coverY = (getHeight() - scanHeight) / 2;
        mPaint.setColor(mCoverColor);
        if (coverX > 0 && coverY > 0) {
            mCoverRect.set(0, 0, getWidth(), coverY);
            canvas.drawRect(mCoverRect, mPaint);
            mCoverRect.set(0, getHeight() - coverY, getWidth(), getHeight());
            canvas.drawRect(mCoverRect, mPaint);
            mCoverRect.set(0, coverY, coverX, getHeight() - coverY);
            canvas.drawRect(mCoverRect, mPaint);
            mCoverRect.set(getWidth() - coverX, coverY, getWidth(), getHeight() - coverY);
            canvas.drawRect(mCoverRect, mPaint);
        } else if (coverX > 0) {
            mCoverRect.set(0, 0, coverX, getHeight());
            canvas.drawRect(mCoverRect, mPaint);
            mCoverRect.set(getWidth() - coverX, 0, getWidth(), getHeight());
            canvas.drawRect(mCoverRect, mPaint);
        } else if (coverY > 0) {
            mCoverRect.set(0, 0, getWidth(), coverY);
            canvas.drawRect(mCoverRect, mPaint);
            mCoverRect.set(0, getHeight() - coverY, getWidth(), getHeight());
            canvas.drawRect(mCoverRect, mPaint);
        }
        if (mScanRectDrawable != null) {
            mScanRectDrawable.setBounds(0, 0, scanWidth, scanHeight);
            canvas.save();
            canvas.translate(coverX, coverY);
            mScanRectDrawable.draw(canvas);
            canvas.restore();
        }
        drawScanPoint(canvas, scanWidth, scanHeight);
        drawScanFlag(canvas, mScanFlagDrawable, scanWidth, scanHeight, mOffset);
    }

    private void drawScanPoint(Canvas canvas, int scanWidth, int scanHeight) {
        if (!mShowResultPoints)
            return;
        final float scaleX = scanWidth / (float) getWidth();
        final float scaleY = scanHeight / (float) getHeight();
        final int coverX = (getWidth() - scanWidth) / 2;
        final int coverY = (getHeight() - scanHeight) / 2;
        ListIterator iterator = mResultPoints.listIterator();
        //noinspection WhileLoopReplaceableByForEach
        while (iterator.hasNext()) {
            ResultPointItem point = (ResultPointItem) iterator.next();
            final float offset = mInterpolator.getInterpolation(1 - point.getValue());
            mPaint.setColor(getColor(mResultPointsColor, offset));
            // TODO 扫描基准点问题导致XY不对
            canvas.drawCircle(coverX + (int) (point.point.getX() * scaleX),
                    coverY + (int) (point.point.getY() * scaleY),
                    mResultPointsSize * offset, mPaint);
        }
    }

    private int getColor(int color, float offset) {
        int red = Color.red(color);
        int green = Color.green(color);
        int blue = Color.blue(color);
        int alpha = (int) Math.ceil(255 * offset);
        return Color.argb(alpha, red, green, blue);
    }

    private void editResultPoints() {
        ListIterator<ResultPointItem> iterator = mResultPoints.listIterator();
        //noinspection WhileLoopReplaceableByForEach
        while (iterator.hasNext()) {
            ResultPointItem point = iterator.next();
            if (!point.cutDuration(DEFAULT_FRAME_DELAY))
                mResultPoints.remove(point);
        }
    }

    /**
     * 绘制扫描标志
     *
     * @param canvas     画布
     * @param drawable   扫描图
     * @param scanWidth  扫描区域宽
     * @param scanHeight 扫描区域高
     * @param offset     动画偏移值
     */
    protected void drawScanFlag(Canvas canvas, Drawable drawable, int scanWidth, int scanHeight, float offset) {
        final int coverX = (getWidth() - scanWidth) / 2;
        final int coverY = (getHeight() - scanHeight) / 2;
        if (drawable != null) {
            drawable.setBounds(0, 0, scanWidth, drawable.getIntrinsicHeight());
            canvas.save();
            canvas.translate(coverX, coverY);
            canvas.translate(0, (scanHeight - drawable.getIntrinsicHeight()) * offset);
            drawable.draw(canvas);
            canvas.restore();
        }
    }

    @SuppressLint("ClickableViewAccessibility")
    @Override
    public boolean onTouchEvent(MotionEvent ev) {
        switch (ev.getAction()) {
            case MotionEvent.ACTION_DOWN:
                final float x = ev.getX();
                final float y = ev.getY();
                if (mOpenDrawable != null) {
                    final int width = mOpenDrawable.getIntrinsicWidth();
                    final int height = mOpenDrawable.getIntrinsicHeight();
                    final float offsetX = (getWidth() - width) * 0.5f;
                    final float offsetY = (getHeight() - height) * 0.5f;
                    final float dX = x - offsetX;
                    final float dY = y - offsetY;
                    if (dX >= 0 && dX <= width && dY >= 0 && dY <= height)
                        Compat.setHotspot(mOpenDrawable, ev.getX(), ev.getY());
                }
                if (mErrorDrawable != null) {
                    final int width = mErrorDrawable.getIntrinsicWidth();
                    final int height = mErrorDrawable.getIntrinsicHeight();
                    final float offsetX = (getWidth() - width) * 0.5f;
                    final float offsetY = (getHeight() - height) * 0.5f;
                    final float dX = x - offsetX;
                    final float dY = y - offsetY;
                    if (dX >= 0 && dX <= width && dY >= 0 && dY <= height)
                        Compat.setHotspot(mErrorDrawable, ev.getX(), ev.getY());
                }
                break;
        }
        return super.onTouchEvent(ev);
    }

    @Override
    protected void drawableStateChanged() {
        if (mOpenDrawable != null && mOpenDrawable.isStateful()) {
            mOpenDrawable.setState(getDrawableState());
        }
        if (mErrorDrawable != null && mErrorDrawable.isStateful()) {
            mErrorDrawable.setState(getDrawableState());
        }
        super.drawableStateChanged();
    }

    @Override
    protected boolean verifyDrawable(@SuppressWarnings("NullableProblems") Drawable who) {
        if (mOpenDrawable == null && mErrorDrawable == null)
            return super.verifyDrawable(who);
        return who == mOpenDrawable || who == mErrorDrawable || super.verifyDrawable(who);
    }

    /**
     * 设置开启图片
     *
     * @param drawable 开启图片
     */
    public void setOpenDrawable(Drawable drawable) {
        if (mOpenDrawable == drawable)
            return;
        if (mOpenDrawable != null) {
            if (mOpenDrawable instanceof Animatable)
                ((Animatable) mOpenDrawable).stop();
            mOpenDrawable.setCallback(null);
        }
        mOpenDrawable = drawable;
        if (mOpenDrawable != null) {
            mOpenDrawable.setCallback(this);
            if (mOpenDrawable instanceof Animatable) {
                Animatable animatable = (Animatable) mOpenDrawable;
                if (!animatable.isRunning())
                    animatable.start();
            }
        }
        invalidate();
    }

    /**
     * 设置错误图片
     *
     * @param drawable 错误图片
     */
    public void setErrorDrawable(Drawable drawable) {
        if (mErrorDrawable == drawable)
            return;
        if (mErrorDrawable != null) {
            if (mErrorDrawable instanceof Animatable)
                ((Animatable) mErrorDrawable).stop();
            mErrorDrawable.setCallback(null);
        }
        mErrorDrawable = drawable;
        if (mErrorDrawable != null) {
            mErrorDrawable.setCallback(this);
            if (mErrorDrawable instanceof Animatable) {
                Animatable animatable = (Animatable) mErrorDrawable;
                if (!animatable.isRunning())
                    animatable.start();
            }
        }
        invalidate();
    }

    /**
     * 绑定扫描视图
     *
     * @param view 扫描视图
     */
    public void bindScanView(ZxingScanView view) {
        if (mScanView == view)
            return;
        if (mScanView != null) {
            mScanView.removeOnScanListener(scanListener);
            mScanView.removeOnStateListener(stateListener);
        }
        mScanView = view;
        if (mScanView != null) {
            mScanView.addOnScanListener(scanListener);
            mScanView.addOnStateListener(stateListener);
        }
        invalidate();
    }

    /**
     * 设置模式
     *
     * @param mode 模式,可用参数:{@link ZxingForegroundView#MODE_OPEN}、
     *             {@link ZxingForegroundView#MODE_ERROR}
     */
    public void setMode(int mode) {
        if (mode != MODE_OPEN && mode != MODE_ERROR)
            return;
        this.mode = mode;
        invalidate();
    }

    /**
     * 设置覆盖颜色
     *
     * @param color 颜色
     */
    public void setCoverColor(int color) {
        if (mCoverColor == color)
            return;
        mCoverColor = color;
        invalidate();
    }

    /**
     * 设置扫描区域背景图
     *
     * @param drawable 背景图
     */
    public void setScanRectDrawable(Drawable drawable) {
        if (mScanRectDrawable == drawable)
            return;
        mScanRectDrawable = drawable;
        invalidate();
    }

    /**
     * 设置扫描标志图
     *
     * @param drawable 图
     */
    public void setScanFlagDrawable(Drawable drawable) {
        if (mScanFlagDrawable == drawable)
            return;
        mScanFlagDrawable = drawable;
        invalidate();
    }

    /**
     * 开始动画
     */
    public void start() {
        mLoadingAnimator.start();
    }

    /**
     * 结束动画
     */
    public void end() {
        mLoadingAnimator.end();
    }

    /**
     * 设置标志动画时长
     *
     * @param duration 时长
     */
    public void setFlagAnimatorDuration(long duration) {
        mLoadingAnimator.setDuration(duration);
    }

    /**
     * 设置标志动画循环模式
     *
     * @param mode 循环模式,可用参数:{@link ValueAnimator#RESTART}、
     *             {@link ValueAnimator#REVERSE}
     */
    public void setFlagAnimatorRepeatMode(int mode) {
        mLoadingAnimator.setRepeatMode(mode);
    }

    /**
     * 设置是否显示结果点
     *
     * @param show 是否显示
     */
    public void setShowResultPoints(boolean show) {
        if (mShowResultPoints == show)
            return;
        mShowResultPoints = show;
        invalidate();
    }

    /**
     * 设置结果点动画时长
     *
     * @param duration 时长
     */
    public void setResultPointsAnimatorDuration(long duration) {
        mResultPointsAnimatorDuration = duration;
    }

    /**
     * 设置最大结果点数目
     *
     * @param max 最大数目
     */
    public void setMaxResultPointsNumber(int max) {
        mMaxResultPointsNumber = max;
    }

    /**
     * 设置结果点的颜色
     *
     * @param color 颜色
     */
    public void setResultPointsColor(int color) {
        mResultPointsColor = color;
    }

    /**
     * 设置结果点的大小
     *
     * @param size 大小
     */
    public void setResultPointsSize(float size) {
        mResultPointsSize = size;
    }

    private class OnScanListener implements ZxingScanView.OnScanListener {
        @Override
        public void onError(ZxingScanView scanView) {
            invalidate();
        }

        @Override
        public void onResult(ZxingScanView scanView, Result result, Bitmap barcode,
                             float scaleFactor) {
            // do nothing
        }
    }

    private class OnStateListener implements ZxingScanView.OnStateListener {
        @Override
        public void onPrepareOpen(ZxingScanView scanView) {
            invalidate();
        }

        @Override
        public void onOpened(ZxingScanView scanView) {
            invalidate();
        }

        @Override
        public void foundPossibleResultPoint(ZxingScanView scanView, ResultPoint point) {
            if (!mShowResultPoints)
                return;
            if (mResultPoints.size() < mMaxResultPointsNumber)
                mResultPoints.add(new ResultPointItem(point, mResultPointsAnimatorDuration));
        }

        @Override
        public void onPrepareClose(ZxingScanView scanView) {
            invalidate();
        }

        @Override
        public void onClosed(ZxingScanView scanView) {
            invalidate();
        }
    }

    private class ResultPointItem {
        ResultPoint point;
        long duration;

        ResultPointItem(ResultPoint point, long duration) {
            this.point = point;
            this.duration = duration;
        }

        boolean cutDuration(@SuppressWarnings("SameParameterValue") long value) {
            duration -= value;
            return duration >= 0;
        }

        float getValue() {
            return duration / (float) mResultPointsAnimatorDuration;
        }
    }
}


text:
#pragma once

#include <thrust/detail/config.h>

// #include the device system's execution_policy header
#define __THRUST_DEVICE_SYSTEM_TAG_HEADER <__THRUST_DEVICE_SYSTEM_ROOT/detail/execution_policy.h>
#include __THRUST_DEVICE_SYSTEM_TAG_HEADER
#undef __THRUST_DEVICE_SYSTEM_TAG_HEADER

namespace thrust
{

typedef thrust::system::__THRUST_DEVICE_SYSTEM_NAMESPACE::tag device_system_tag;

} // end thrust


text:
namespace media {
namespace cast {

static const uint32 kMaxSequenceNumber = 65536;

ReceiverStats::ReceiverStats(base::TickClock* clock)
    : clock_(clock),
      min_sequence_number_(0),
      max_sequence_number_(0),
      total_number_packets_(0),
      sequence_number_cycles_(0),
      interval_min_sequence_number_(0),
      interval_number_packets_(0),
      interval_wrap_count_(0) {}

ReceiverStats::~ReceiverStats() {}

void ReceiverStats::GetStatistics(uint8* fraction_lost,
                                  uint32* cumulative_lost,
                                  uint32* extended_high_sequence_number,
                                  uint32* jitter) {
  // Compute losses.
  if (interval_number_packets_ == 0) {
    *fraction_lost = 0;
  } else {
    int diff = 0;
    if (interval_wrap_count_ == 0) {
      diff = max_sequence_number_ - interval_min_sequence_number_ + 1;
    } else {
      diff = kMaxSequenceNumber * (interval_wrap_count_ - 1) +
             (max_sequence_number_ - interval_min_sequence_number_ +
              kMaxSequenceNumber + 1);
    }

    if (diff < 1) {
      *fraction_lost = 0;
    } else {
      float tmp_ratio =
          (1 - static_cast<float>(interval_number_packets_) / abs(diff));
      *fraction_lost = static_cast<uint8>(256 * tmp_ratio);
    }
  }

  int expected_packets_num = max_sequence_number_ - min_sequence_number_ + 1;
  if (total_number_packets_ == 0) {
    *cumulative_lost = 0;
  } else if (sequence_number_cycles_ == 0) {
    *cumulative_lost = expected_packets_num - total_number_packets_;
  } else {
    *cumulative_lost =
        kMaxSequenceNumber * (sequence_number_cycles_ - 1) +
        (expected_packets_num - total_number_packets_ + kMaxSequenceNumber);
  }

  // Extended high sequence number consists of the highest seq number and the
  // number of cycles (wrap).
  *extended_high_sequence_number =
      (sequence_number_cycles_ << 16) + max_sequence_number_;

  *jitter = static_cast<uint32>(std::abs(jitter_.InMillisecondsRoundedUp()));

  // Reset interval values.
  interval_min_sequence_number_ = 0;
  interval_number_packets_ = 0;
  interval_wrap_count_ = 0;
}

void ReceiverStats::UpdateStatistics(const RtpCastHeader& header) {
  const uint16 new_seq_num = header.sequence_number;

  if (interval_number_packets_ == 0) {
    // First packet in the interval.
    interval_min_sequence_number_ = new_seq_num;
  }
  if (total_number_packets_ == 0) {
    // First incoming packet.
    min_sequence_number_ = new_seq_num;
    max_sequence_number_ = new_seq_num;
  }

  if (IsNewerSequenceNumber(new_seq_num, max_sequence_number_)) {
    // Check wrap.
    if (new_seq_num < max_sequence_number_) {
      ++sequence_number_cycles_;
      ++interval_wrap_count_;
    }
    max_sequence_number_ = new_seq_num;
  }

  // Compute Jitter.
  base::TimeTicks now = clock_->NowTicks();
  base::TimeDelta delta_new_timestamp =
      base::TimeDelta::FromMilliseconds(header.rtp_timestamp);
  if (total_number_packets_ > 0) {
    // Update jitter.
    base::TimeDelta delta =
        (now - last_received_packet_time_) -
        ((delta_new_timestamp - last_received_timestamp_) / 90);
    jitter_ += (delta - jitter_) / 16;
  }
  last_received_timestamp_ = delta_new_timestamp;
  last_received_packet_time_ = now;

  // Increment counters.
  ++total_number_packets_;
  ++interval_number_packets_;
}

}  // namespace cast
}  // namespace media


text:
package com.oukingtim.service;

import com.baomidou.mybatisplus.service.IService;
import com.oukingtim.domain.TbDictClass;

/**
 * Created by oukingtim
 */
public interface TbDictClassService extends IService<TbDictClass> {

}


text:
<?php

/**
 * InvalidArgument Exception
 *
 * @category    Drake
 * @package     Drake_Filter
 * @subpackage  File
 * @copyright   Copyright (c) 2008-2010 Rob Zienert (http://robzienert.com)
 * @license     http://www.opensource.org/licenses/bsd-license.php New BSD License
 */
class Drake_Filter_File_InvalidArgumentException extends InvalidArgumentException
    implements Drake_Filter_File_Exception
{
}


text:
classdef prtOutlierRemovalFn < prtOutlierRemoval
    % prtOutlierRemovalBooleanObservations  Removesa range of data values from a prtDataSet
    %

% Copyright (c) 2013 New Folder Consulting
%
% Permission is hereby granted, free of charge, to any person obtaining a
% copy of this software and associated documentation files (the
% "Software"), to deal in the Software without restriction, including
% without limitation the rights to use, copy, modify, merge, publish,
% distribute, sublicense, and/or sell copies of the Software, and to permit
% persons to whom the Software is furnished to do so, subject to the
% following conditions:
%
% The above copyright notice and this permission notice shall be included
% in all copies or substantial portions of the Software.
%
% THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
% OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
% MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
% NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
% DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
% OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
% USE OR OTHER DEALINGS IN THE SOFTWARE.

    properties (SetAccess=private)
        % Required by prtAction
        name = 'Boolean Observation-wise Outlier Removal';  % NonFinite Data Outlier Removal
        nameAbbreviation = 'RangeDataRemove'   % NonFiniteDataRemove
    end

    properties
        removeFn = @(x) min(x,[],2) > -.4 & max(x,[],2) < .4;
    end

    methods

        % Allow for string, value pairs
        function Obj = prtOutlierRemovalBooleanObservations(varargin)

            %Need to check this with the string - setting the string in
            %prtOutlierRemoval should change this value...
            Obj.isCrossValidateValid = true;

            Obj = prtUtilAssignStringValuePairs(Obj,varargin{:});
        end
    end

    methods (Access = protected, Hidden = true)

        function Obj = trainAction(Obj,~)
            %Nothing to do
        end

        function outlierIndices = calculateOutlierIndices(self,DataSet) %#ok<MANU> This is OK - don't make it static.
            outlierVec = self.observationRangeFn(DataSet.getX);
            outlierIndices = repmat(outlierVec,1,DataSet.nFeatures);
        end

    end

end


text:
namespace WTF {

const char* kChars = "12345";
const LChar* kChars8 = reinterpret_cast<const LChar*>(kChars);
const UChar* kChars16 = reinterpret_cast<const UChar*>(u"12345");

TEST(StringViewTest, ConstructionStringImpl8) {
  RefPtr<StringImpl> impl8Bit = StringImpl::create(kChars8, 5);

  // StringView(StringImpl*);
  ASSERT_TRUE(StringView(impl8Bit.get()).is8Bit());
  EXPECT_FALSE(StringView(impl8Bit.get()).isNull());
  EXPECT_EQ(impl8Bit->characters8(), StringView(impl8Bit.get()).characters8());
  EXPECT_EQ(impl8Bit->length(), StringView(impl8Bit.get()).length());
  EXPECT_STREQ(kChars, StringView(impl8Bit.get()).toString().utf8().data());

  // StringView(StringImpl*, unsigned offset);
  ASSERT_TRUE(StringView(impl8Bit.get(), 2).is8Bit());
  EXPECT_FALSE(StringView(impl8Bit.get(), 2).isNull());
  EXPECT_EQ(impl8Bit->characters8() + 2,
            StringView(impl8Bit.get(), 2).characters8());
  EXPECT_EQ(3u, StringView(impl8Bit.get(), 2).length());
  EXPECT_EQ(StringView("345"), StringView(impl8Bit.get(), 2));
  EXPECT_STREQ("345", StringView(impl8Bit.get(), 2).toString().utf8().data());

  // StringView(StringImpl*, unsigned offset, unsigned length);
  ASSERT_TRUE(StringView(impl8Bit.get(), 2, 1).is8Bit());
  EXPECT_FALSE(StringView(impl8Bit.get(), 2, 1).isNull());
  EXPECT_EQ(impl8Bit->characters8() + 2,
            StringView(impl8Bit.get(), 2, 1).characters8());
  EXPECT_EQ(1u, StringView(impl8Bit.get(), 2, 1).length());
  EXPECT_EQ(StringView("3"), StringView(impl8Bit.get(), 2, 1));
  EXPECT_STREQ("3", StringView(impl8Bit.get(), 2, 1).toString().utf8().data());
}

TEST(StringViewTest, ConstructionStringImpl16) {
  RefPtr<StringImpl> impl16Bit = StringImpl::create(kChars16, 5);

  // StringView(StringImpl*);
  ASSERT_FALSE(StringView(impl16Bit.get()).is8Bit());
  EXPECT_FALSE(StringView(impl16Bit.get()).isNull());
  EXPECT_EQ(impl16Bit->characters16(),
            StringView(impl16Bit.get()).characters16());
  EXPECT_EQ(impl16Bit->length(), StringView(impl16Bit.get()).length());
  EXPECT_STREQ(kChars, StringView(impl16Bit.get()).toString().utf8().data());

  // StringView(StringImpl*, unsigned offset);
  ASSERT_FALSE(StringView(impl16Bit.get(), 2).is8Bit());
  EXPECT_FALSE(StringView(impl16Bit.get(), 2).isNull());
  EXPECT_EQ(impl16Bit->characters16() + 2,
            StringView(impl16Bit.get(), 2).characters16());
  EXPECT_EQ(3u, StringView(impl16Bit.get(), 2).length());
  EXPECT_EQ(StringView("345"), StringView(impl16Bit.get(), 2));
  EXPECT_STREQ("345", StringView(impl16Bit.get(), 2).toString().utf8().data());

  // StringView(StringImpl*, unsigned offset, unsigned length);
  ASSERT_FALSE(StringView(impl16Bit.get(), 2, 1).is8Bit());
  EXPECT_FALSE(StringView(impl16Bit.get(), 2, 1).isNull());
  EXPECT_EQ(impl16Bit->characters16() + 2,
            StringView(impl16Bit.get(), 2, 1).characters16());
  EXPECT_EQ(1u, StringView(impl16Bit.get(), 2, 1).length());
  EXPECT_EQ(StringView("3"), StringView(impl16Bit.get(), 2, 1));
  EXPECT_STREQ("3", StringView(impl16Bit.get(), 2, 1).toString().utf8().data());
}

TEST(StringViewTest, ConstructionStringImplRef8) {
  RefPtr<StringImpl> impl8Bit = StringImpl::create(kChars8, 5);

  // StringView(StringImpl&);
  ASSERT_TRUE(StringView(*impl8Bit).is8Bit());
  EXPECT_FALSE(StringView(*impl8Bit).isNull());
  EXPECT_EQ(impl8Bit->characters8(), StringView(*impl8Bit).characters8());
  EXPECT_EQ(impl8Bit->length(), StringView(*impl8Bit).length());
  EXPECT_STREQ(kChars, StringView(*impl8Bit).toString().utf8().data());

  // StringView(StringImpl&, unsigned offset);
  ASSERT_TRUE(StringView(*impl8Bit, 2).is8Bit());
  EXPECT_FALSE(StringView(*impl8Bit, 2).isNull());
  EXPECT_EQ(impl8Bit->characters8() + 2,
            StringView(*impl8Bit, 2).characters8());
  EXPECT_EQ(3u, StringView(*impl8Bit, 2).length());
  EXPECT_EQ(StringView("345"), StringView(*impl8Bit, 2));
  EXPECT_STREQ("345", StringView(*impl8Bit, 2).toString().utf8().data());

  // StringView(StringImpl&, unsigned offset, unsigned length);
  ASSERT_TRUE(StringView(*impl8Bit, 2, 1).is8Bit());
  EXPECT_FALSE(StringView(*impl8Bit, 2, 1).isNull());
  EXPECT_EQ(impl8Bit->characters8() + 2,
            StringView(*impl8Bit, 2, 1).characters8());
  EXPECT_EQ(1u, StringView(*impl8Bit, 2, 1).length());
  EXPECT_EQ(StringView("3"), StringView(*impl8Bit, 2, 1));
  EXPECT_STREQ("3", StringView(*impl8Bit, 2, 1).toString().utf8().data());
}

TEST(StringViewTest, ConstructionStringImplRef16) {
  RefPtr<StringImpl> impl16Bit = StringImpl::create(kChars16, 5);

  // StringView(StringImpl&);
  ASSERT_FALSE(StringView(*impl16Bit).is8Bit());
  EXPECT_FALSE(StringView(*impl16Bit).isNull());
  EXPECT_EQ(impl16Bit->characters16(), StringView(*impl16Bit).characters16());
  EXPECT_EQ(impl16Bit->length(), StringView(*impl16Bit).length());
  EXPECT_STREQ(kChars, StringView(*impl16Bit).toString().utf8().data());

  // StringView(StringImpl&, unsigned offset);
  ASSERT_FALSE(StringView(*impl16Bit, 2).is8Bit());
  EXPECT_FALSE(StringView(*impl16Bit, 2).isNull());
  EXPECT_EQ(impl16Bit->characters16() + 2,
            StringView(*impl16Bit, 2).characters16());
  EXPECT_EQ(3u, StringView(*impl16Bit, 2).length());
  EXPECT_EQ(StringView("345"), StringView(*impl16Bit, 2));
  EXPECT_STREQ("345", StringView(*impl16Bit, 2).toString().utf8().data());

  // StringView(StringImpl&, unsigned offset, unsigned length);
  ASSERT_FALSE(StringView(*impl16Bit, 2, 1).is8Bit());
  EXPECT_FALSE(StringView(*impl16Bit, 2, 1).isNull());
  EXPECT_EQ(impl16Bit->characters16() + 2,
            StringView(*impl16Bit, 2, 1).characters16());
  EXPECT_EQ(1u, StringView(*impl16Bit, 2, 1).length());
  EXPECT_EQ(StringView("3"), StringView(*impl16Bit, 2, 1));
  EXPECT_STREQ("3", StringView(*impl16Bit, 2, 1).toString().utf8().data());
}

TEST(StringViewTest, ConstructionString8) {
  String string8Bit = String(StringImpl::create(kChars8, 5));

  // StringView(const String&);
  ASSERT_TRUE(StringView(string8Bit).is8Bit());
  EXPECT_FALSE(StringView(string8Bit).isNull());
  EXPECT_EQ(string8Bit.characters8(), StringView(string8Bit).characters8());
  EXPECT_EQ(string8Bit.length(), StringView(string8Bit).length());
  EXPECT_STREQ(kChars, StringView(string8Bit).toString().utf8().data());

  // StringView(const String&, unsigned offset);
  ASSERT_TRUE(StringView(string8Bit, 2).is8Bit());
  EXPECT_FALSE(StringView(string8Bit, 2).isNull());
  EXPECT_EQ(string8Bit.characters8() + 2,
            StringView(string8Bit, 2).characters8());
  EXPECT_EQ(3u, StringView(string8Bit, 2).length());
  EXPECT_EQ(StringView("345"), StringView(string8Bit, 2));
  EXPECT_STREQ("345", StringView(string8Bit, 2).toString().utf8().data());

  // StringView(const String&, unsigned offset, unsigned length);
  ASSERT_TRUE(StringView(string8Bit, 2, 1).is8Bit());
  EXPECT_FALSE(StringView(string8Bit, 2, 1).isNull());
  EXPECT_EQ(string8Bit.characters8() + 2,
            StringView(string8Bit, 2, 1).characters8());
  EXPECT_EQ(1u, StringView(string8Bit, 2, 1).length());
  EXPECT_EQ(StringView("3"), StringView(string8Bit, 2, 1));
  EXPECT_STREQ("3", StringView(string8Bit, 2, 1).toString().utf8().data());
}

TEST(StringViewTest, ConstructionString16) {
  String string16Bit = String(StringImpl::create(kChars16, 5));

  // StringView(const String&);
  ASSERT_FALSE(StringView(string16Bit).is8Bit());
  EXPECT_FALSE(StringView(string16Bit).isNull());
  EXPECT_EQ(string16Bit.characters16(), StringView(string16Bit).characters16());
  EXPECT_EQ(string16Bit.length(), StringView(string16Bit).length());
  EXPECT_STREQ(kChars, StringView(string16Bit).toString().utf8().data());

  // StringView(const String&, unsigned offset);
  ASSERT_FALSE(StringView(string16Bit, 2).is8Bit());
  EXPECT_FALSE(StringView(string16Bit, 2).isNull());
  EXPECT_EQ(string16Bit.characters16() + 2,
            StringView(string16Bit, 2).characters16());
  EXPECT_EQ(3u, StringView(string16Bit, 2).length());
  EXPECT_EQ(StringView("345"), StringView(string16Bit, 2));
  EXPECT_STREQ("345", StringView(string16Bit, 2).toString().utf8().data());

  // StringView(const String&, unsigned offset, unsigned length);
  ASSERT_FALSE(StringView(string16Bit, 2, 1).is8Bit());
  EXPECT_FALSE(StringView(string16Bit, 2, 1).isNull());
  EXPECT_EQ(string16Bit.characters16() + 2,
            StringView(string16Bit, 2, 1).characters16());
  EXPECT_EQ(1u, StringView(string16Bit, 2, 1).length());
  EXPECT_EQ(StringView("3"), StringView(string16Bit, 2, 1));
  EXPECT_STREQ("3", StringView(string16Bit, 2, 1).toString().utf8().data());
}

TEST(StringViewTest, ConstructionAtomicString8) {
  AtomicString atom8Bit = AtomicString(StringImpl::create(kChars8, 5));

  // StringView(const AtomicString&);
  ASSERT_TRUE(StringView(atom8Bit).is8Bit());
  EXPECT_FALSE(StringView(atom8Bit).isNull());
  EXPECT_EQ(atom8Bit.characters8(), StringView(atom8Bit).characters8());
  EXPECT_EQ(atom8Bit.length(), StringView(atom8Bit).length());
  EXPECT_STREQ(kChars, StringView(atom8Bit).toString().utf8().data());

  // StringView(const AtomicString&, unsigned offset);
  ASSERT_TRUE(StringView(atom8Bit, 2).is8Bit());
  EXPECT_FALSE(StringView(atom8Bit, 2).isNull());
  EXPECT_EQ(atom8Bit.characters8() + 2, StringView(atom8Bit, 2).characters8());
  EXPECT_EQ(3u, StringView(atom8Bit, 2).length());
  EXPECT_EQ(StringView("345"), StringView(atom8Bit, 2));
  EXPECT_STREQ("345", StringView(atom8Bit, 2).toString().utf8().data());

  // StringView(const AtomicString&, unsigned offset, unsigned length);
  ASSERT_TRUE(StringView(atom8Bit, 2, 1).is8Bit());
  EXPECT_FALSE(StringView(atom8Bit, 2, 1).isNull());
  EXPECT_EQ(atom8Bit.characters8() + 2,
            StringView(atom8Bit, 2, 1).characters8());
  EXPECT_EQ(1u, StringView(atom8Bit, 2, 1).length());
  EXPECT_EQ(StringView("3"), StringView(atom8Bit, 2, 1));
  EXPECT_STREQ("3", StringView(atom8Bit, 2, 1).toString().utf8().data());
}

TEST(StringViewTest, ConstructionAtomicString16) {
  AtomicString atom16Bit = AtomicString(StringImpl::create(kChars16, 5));

  // StringView(const AtomicString&);
  ASSERT_FALSE(StringView(atom16Bit).is8Bit());
  EXPECT_FALSE(StringView(atom16Bit).isNull());
  EXPECT_EQ(atom16Bit.characters16(), StringView(atom16Bit).characters16());
  EXPECT_EQ(atom16Bit.length(), StringView(atom16Bit).length());
  EXPECT_STREQ(kChars, StringView(atom16Bit).toString().utf8().data());

  // StringView(const AtomicString&, unsigned offset);
  ASSERT_FALSE(StringView(atom16Bit, 2).is8Bit());
  EXPECT_FALSE(StringView(atom16Bit, 2).isNull());
  EXPECT_EQ(atom16Bit.characters16() + 2,
            StringView(atom16Bit, 2).characters16());
  EXPECT_EQ(3u, StringView(atom16Bit, 2).length());
  EXPECT_EQ(StringView("345"), StringView(atom16Bit, 2));
  EXPECT_STREQ("345", StringView(atom16Bit, 2).toString().utf8().data());

  // StringView(const AtomicString&, unsigned offset, unsigned length);
  ASSERT_FALSE(StringView(atom16Bit, 2, 1).is8Bit());
  EXPECT_FALSE(StringView(atom16Bit, 2, 1).isNull());
  EXPECT_EQ(atom16Bit.characters16() + 2,
            StringView(atom16Bit, 2, 1).characters16());
  EXPECT_EQ(1u, StringView(atom16Bit, 2, 1).length());
  EXPECT_EQ(StringView("3"), StringView(atom16Bit, 2, 1));
  EXPECT_STREQ("3", StringView(atom16Bit, 2, 1).toString().utf8().data());
}

TEST(StringViewTest, ConstructionStringView8) {
  StringView view8Bit = StringView(kChars8, 5);

  // StringView(StringView&);
  ASSERT_TRUE(StringView(view8Bit).is8Bit());
  EXPECT_FALSE(StringView(view8Bit).isNull());
  EXPECT_EQ(view8Bit.characters8(), StringView(view8Bit).characters8());
  EXPECT_EQ(view8Bit.length(), StringView(view8Bit).length());
  EXPECT_STREQ(kChars, StringView(view8Bit).toString().utf8().data());

  // StringView(const StringView&, unsigned offset);
  ASSERT_TRUE(StringView(view8Bit, 2).is8Bit());
  EXPECT_FALSE(StringView(view8Bit, 2).isNull());
  EXPECT_EQ(view8Bit.characters8() + 2, StringView(view8Bit, 2).characters8());
  EXPECT_EQ(3u, StringView(view8Bit, 2).length());
  EXPECT_EQ(StringView("345"), StringView(view8Bit, 2));
  EXPECT_STREQ("345", StringView(view8Bit, 2).toString().utf8().data());

  // StringView(const StringView&, unsigned offset, unsigned length);
  ASSERT_TRUE(StringView(view8Bit, 2, 1).is8Bit());
  EXPECT_FALSE(StringView(view8Bit, 2, 1).isNull());
  EXPECT_EQ(view8Bit.characters8() + 2,
            StringView(view8Bit, 2, 1).characters8());
  EXPECT_EQ(1u, StringView(view8Bit, 2, 1).length());
  EXPECT_EQ(StringView("3"), StringView(view8Bit, 2, 1));
  EXPECT_STREQ("3", StringView(view8Bit, 2, 1).toString().utf8().data());
}

TEST(StringViewTest, ConstructionStringView16) {
  StringView view16Bit = StringView(kChars16, 5);

  // StringView(StringView&);
  ASSERT_FALSE(StringView(view16Bit).is8Bit());
  EXPECT_FALSE(StringView(view16Bit).isNull());
  EXPECT_EQ(view16Bit.characters16(), StringView(view16Bit).characters16());
  EXPECT_EQ(view16Bit.length(), StringView(view16Bit).length());
  EXPECT_EQ(kChars, StringView(view16Bit).toString());

  // StringView(const StringView&, unsigned offset);
  ASSERT_FALSE(StringView(view16Bit, 2).is8Bit());
  EXPECT_FALSE(StringView(view16Bit, 2).isNull());
  EXPECT_EQ(view16Bit.characters16() + 2,
            StringView(view16Bit, 2).characters16());
  EXPECT_EQ(3u, StringView(view16Bit, 2).length());
  EXPECT_EQ(StringView("345"), StringView(view16Bit, 2));
  EXPECT_STREQ("345", StringView(view16Bit, 2).toString().utf8().data());

  // StringView(const StringView&, unsigned offset, unsigned length);
  ASSERT_FALSE(StringView(view16Bit, 2, 1).is8Bit());
  EXPECT_FALSE(StringView(view16Bit, 2, 1).isNull());
  EXPECT_EQ(view16Bit.characters16() + 2,
            StringView(view16Bit, 2, 1).characters16());
  EXPECT_EQ(1u, StringView(view16Bit, 2, 1).length());
  EXPECT_EQ(StringView("3"), StringView(view16Bit, 2, 1));
  EXPECT_STREQ("3", StringView(view16Bit, 2, 1).toString().utf8().data());
}

TEST(StringViewTest, ConstructionLiteral8) {
  // StringView(const LChar* chars);
  ASSERT_TRUE(StringView(kChars8).is8Bit());
  EXPECT_FALSE(StringView(kChars8).isNull());
  EXPECT_EQ(kChars8, StringView(kChars8).characters8());
  EXPECT_EQ(5u, StringView(kChars8).length());
  EXPECT_STREQ(kChars, StringView(kChars8).toString().utf8().data());

  // StringView(const char* chars);
  ASSERT_TRUE(StringView(kChars).is8Bit());
  EXPECT_FALSE(StringView(kChars).isNull());
  EXPECT_EQ(kChars8, StringView(kChars).characters8());
  EXPECT_EQ(5u, StringView(kChars).length());
  EXPECT_STREQ(kChars, StringView(kChars).toString().utf8().data());

  // StringView(const LChar* chars, unsigned length);
  ASSERT_TRUE(StringView(kChars8, 2).is8Bit());
  EXPECT_FALSE(StringView(kChars8, 2).isNull());
  EXPECT_EQ(2u, StringView(kChars8, 2).length());
  EXPECT_EQ(StringView("12"), StringView(kChars8, 2));
  EXPECT_STREQ("12", StringView(kChars8, 2).toString().utf8().data());

  // StringView(const char* chars, unsigned length);
  ASSERT_TRUE(StringView(kChars, 2).is8Bit());
  EXPECT_FALSE(StringView(kChars, 2).isNull());
  EXPECT_EQ(2u, StringView(kChars, 2).length());
  EXPECT_EQ(StringView("12"), StringView(kChars, 2));
  EXPECT_STREQ("12", StringView(kChars, 2).toString().utf8().data());
}

TEST(StringViewTest, ConstructionLiteral16) {
  // StringView(const UChar* chars);
  ASSERT_FALSE(StringView(kChars16).is8Bit());
  EXPECT_FALSE(StringView(kChars16).isNull());
  EXPECT_EQ(kChars16, StringView(kChars16).characters16());
  EXPECT_EQ(5u, StringView(kChars16).length());
  EXPECT_EQ(String(kChars16), StringView(kChars16).toString().utf8().data());

  // StringView(const UChar* chars, unsigned length);
  ASSERT_FALSE(StringView(kChars16, 2).is8Bit());
  EXPECT_FALSE(StringView(kChars16, 2).isNull());
  EXPECT_EQ(kChars16, StringView(kChars16, 2).characters16());
  EXPECT_EQ(StringView("12"), StringView(kChars16, 2));
  EXPECT_EQ(StringView(reinterpret_cast<const UChar*>(u"12")),
            StringView(kChars16, 2));
  EXPECT_EQ(2u, StringView(kChars16, 2).length());
  EXPECT_EQ(String("12"), StringView(kChars16, 2).toString());
}

TEST(StringViewTest, IsEmpty) {
  EXPECT_FALSE(StringView(kChars).isEmpty());
  EXPECT_TRUE(StringView(kChars, 0).isEmpty());
  EXPECT_FALSE(StringView(String(kChars)).isEmpty());
  EXPECT_TRUE(StringView(String(kChars), 5).isEmpty());
  EXPECT_TRUE(StringView(String(kChars), 4, 0).isEmpty());
  EXPECT_TRUE(StringView().isEmpty());
  EXPECT_TRUE(StringView("").isEmpty());
  EXPECT_TRUE(StringView(reinterpret_cast<const UChar*>(u"")).isEmpty());
  EXPECT_FALSE(StringView(kChars16).isEmpty());
}

TEST(StringViewTest, ToString) {
  EXPECT_EQ(emptyString().impl(), StringView("").toString().impl());
  EXPECT_EQ(nullAtom.impl(), StringView().toString().impl());
  // NOTE: All the construction tests also check toString().
}

TEST(StringViewTest, ToAtomicString) {
  EXPECT_EQ(nullAtom.impl(), StringView().toAtomicString());
  EXPECT_EQ(emptyAtom.impl(), StringView("").toAtomicString());
  EXPECT_EQ(AtomicString("12"), StringView(kChars8, 2).toAtomicString());
  // AtomicString will convert to 8bit if possible when creating the string.
  EXPECT_EQ(AtomicString("12").impl(),
            StringView(kChars16, 2).toAtomicString().impl());
}

TEST(StringViewTest, ToStringImplSharing) {
  String string(kChars);
  EXPECT_EQ(string.impl(), StringView(string).sharedImpl());
  EXPECT_EQ(string.impl(), StringView(string).toString().impl());
  EXPECT_EQ(string.impl(), StringView(string).toAtomicString().impl());
}

TEST(StringViewTest, NullString) {
  EXPECT_TRUE(StringView().isNull());
  EXPECT_TRUE(StringView(String()).isNull());
  EXPECT_TRUE(StringView(AtomicString()).isNull());
  EXPECT_TRUE(StringView(static_cast<const char*>(nullptr)).isNull());
  StringView view(kChars);
  EXPECT_FALSE(view.isNull());
  view.clear();
  EXPECT_TRUE(view.isNull());
  EXPECT_EQ(String(), StringView());
  EXPECT_TRUE(StringView().toString().isNull());
  EXPECT_FALSE(equalStringView(StringView(), ""));
  EXPECT_TRUE(equalStringView(StringView(), StringView()));
  EXPECT_FALSE(equalStringView(StringView(), "abc"));
  EXPECT_FALSE(equalStringView("abc", StringView()));
  EXPECT_FALSE(equalIgnoringASCIICase(StringView(), ""));
  EXPECT_TRUE(equalIgnoringASCIICase(StringView(), StringView()));
  EXPECT_FALSE(equalIgnoringASCIICase(StringView(), "abc"));
  EXPECT_FALSE(equalIgnoringASCIICase("abc", StringView()));
}

TEST(StringViewTest, IndexAccess) {
  StringView view8(kChars8);
  EXPECT_EQ('1', view8[0]);
  EXPECT_EQ('3', view8[2]);
  StringView view16(kChars16);
  EXPECT_EQ('1', view16[0]);
  EXPECT_EQ('3', view16[2]);
}

TEST(StringViewTest, EqualIgnoringASCIICase) {
  static const char* link8 = "link";
  static const char* linkCaps8 = "LINK";
  static const char* nonASCII8 = "a\xE1";
  static const char* nonASCIICaps8 = "A\xE1";
  static const char* nonASCIIInvalid8 = "a\xC1";

  static const UChar link16[5] = {0x006c, 0x0069, 0x006e, 0x006b, 0};  // link
  static const UChar linkCaps16[5] = {0x004c, 0x0049, 0x004e, 0x004b,
                                      0};                         // LINK
  static const UChar nonASCII16[3] = {0x0061, 0x00e1, 0};         // a\xE1
  static const UChar nonASCIICaps16[3] = {0x0041, 0x00e1, 0};     // A\xE1
  static const UChar nonASCIIInvalid16[3] = {0x0061, 0x00c1, 0};  // a\xC1

  EXPECT_TRUE(equalIgnoringASCIICase(StringView(link16), link8));
  EXPECT_TRUE(equalIgnoringASCIICase(StringView(link16), linkCaps16));
  EXPECT_TRUE(equalIgnoringASCIICase(StringView(link16), linkCaps8));
  EXPECT_TRUE(equalIgnoringASCIICase(StringView(link8), linkCaps8));
  EXPECT_TRUE(equalIgnoringASCIICase(StringView(link8), link16));

  EXPECT_TRUE(equalIgnoringASCIICase(StringView(nonASCII8), nonASCIICaps8));
  EXPECT_TRUE(equalIgnoringASCIICase(StringView(nonASCII8), nonASCIICaps16));
  EXPECT_TRUE(equalIgnoringASCIICase(StringView(nonASCII16), nonASCIICaps16));
  EXPECT_TRUE(equalIgnoringASCIICase(StringView(nonASCII16), nonASCIICaps8));
  EXPECT_FALSE(equalIgnoringASCIICase(StringView(nonASCII8), nonASCIIInvalid8));
  EXPECT_FALSE(
      equalIgnoringASCIICase(StringView(nonASCII8), nonASCIIInvalid16));

  EXPECT_TRUE(equalIgnoringASCIICase(StringView("link"), "lInK"));
  EXPECT_FALSE(equalIgnoringASCIICase(StringView("link"), "INKL"));
  EXPECT_FALSE(
      equalIgnoringASCIICase(StringView("link"), "link different length"));
  EXPECT_FALSE(
      equalIgnoringASCIICase(StringView("link different length"), "link"));

  EXPECT_TRUE(equalIgnoringASCIICase(StringView(""), ""));
}

}  // namespace WTF


text:
exports.BattleScripts = {
	init: function() {
		/*
		Skip any movepools of pre-evolutions, unless they
		contain exclusive moves (such as spearow's sonicboom)

		this.data.Pokedex.cherrimsunshine.types = ['Grass', 'Fire'];
		this.data.Learnsets.azumarill.learnset.bellydrum = ['5L100'];
		this.data.Pokedex.venusaur.abilities['1'] = 'Leaf Guard';
		*/

		this.data.Learnsets.bulbasaur.learnset.naturepower = ['5L29'];
		this.data.Learnsets.bulbasaur.learnset.powerwhip = ['5L41'];

		this.data.Learnsets.ivysaur.learnset.naturepower = ['5L33'];
		this.data.Learnsets.ivysaur.learnset.powerwhip = ['5L49'];
		this.data.Learnsets.ivysaur.learnset.leafstorm = ['5L53'];

		this.data.Learnsets.venusaur.learnset.ancientpower = ['5L0'];
		this.data.Learnsets.venusaur.learnset.naturepower = ['5L33'];
		this.data.Learnsets.venusaur.learnset.powerwhip = ['5L49'];
		this.data.Learnsets.venusaur.learnset.leafstorm = ['5L63'];
		this.data.Learnsets.venusaur.learnset.sludgewave = ['5M'];

		this.data.Learnsets.charmander.learnset.bellydrum = ['5L50'];

		this.data.Learnsets.charmeleon.learnset.bellydrum = ['5L61'];

		this.data.Learnsets.charizard.learnset.crunch = ['5L0'];
		this.data.Learnsets.charizard.learnset.dragonpulse = ['5L41'];
		this.data.Learnsets.charizard.learnset.dragondance = ['5L56'];
		this.data.Learnsets.charizard.learnset.inferno = ['5L61'];
		this.data.Learnsets.charizard.learnset.outrage = ['5L66'];
		this.data.Learnsets.charizard.learnset.bellydrum = ['5L83'];
		this.data.Learnsets.charizard.learnset.hurricane = ['5M'];

		this.data.Learnsets.squirtle.learnset.zenheadbutt = ['5L31'];
		this.data.Learnsets.squirtle.learnset.waterspout = ['5L43'];
		this.data.Learnsets.squirtle.learnset.shellsmash = ['5L46'];

		this.data.Learnsets.wartortle.learnset.aquajet = ['5L16'];
		this.data.Learnsets.wartortle.learnset.zenheadbutt = ['5L36'];
		this.data.Learnsets.wartortle.learnset.waterspout = ['5L52'];
		this.data.Learnsets.wartortle.learnset.shellsmash = ['5L56'];

		this.data.Learnsets.blastoise.learnset.zapcannon = ['5L0'];
		this.data.Learnsets.blastoise.learnset.aquajet = ['5L16'];
		this.data.Learnsets.blastoise.learnset.zenheadbutt = ['5L39'];
		this.data.Learnsets.blastoise.learnset.waterspout = ['5L67'];
		this.data.Learnsets.blastoise.learnset.shellsmash = ['5L74'];

		this.data.Learnsets.caterpie.learnset.bugbite = ['5L0'];
		this.data.Learnsets.caterpie.learnset.strugglebug = ['5L0'];
		this.data.Learnsets.caterpie.learnset.electroweb = ['5L6'];

		this.data.Learnsets.butterfree.learnset.strugglebug = ['5L0'];
		this.data.Learnsets.butterfree.learnset.aircutter = ['5L10'];
		this.data.Learnsets.butterfree.learnset.gigadrain = ['5L26'];
		this.data.Learnsets.butterfree.learnset.airslash = ['5L32'];
		this.data.Learnsets.butterfree.learnset.batonpass = ['5L38'];
		this.data.Learnsets.butterfree.learnset.hurricane = ['5L50','5M'];

		this.data.Learnsets.weedle.learnset.bugbite = ['5L0'];
		this.data.Learnsets.weedle.learnset.strugglebug = ['5L0'];
		this.data.Learnsets.weedle.learnset.poisontail = ['5L6'];

		this.data.Learnsets.beedrill.learnset.bugbite = ['5L0'];
		this.data.Learnsets.beedrill.learnset.crosspoison = ['5L10'];
		this.data.Learnsets.beedrill.learnset.rage = ['5L26'];
		this.data.Learnsets.beedrill.learnset.xscissor = ['5L19'];
		this.data.Learnsets.beedrill.learnset.megahorn = ['5L43'];
		this.data.Learnsets.beedrill.learnset.batonpass = ['5L46'];
		this.data.Learnsets.beedrill.learnset.bugbuzz = ['5M'];

	//pidgey moves

	//pidgeotto moves

		this.data.Learnsets.pidgeot.learnset.superpower = ['5L0'];
		this.data.Learnsets.pidgeot.learnset.tackle = ['5L0'];
		this.data.Learnsets.pidgeot.learnset.sandattack = ['5L5'];
		this.data.Learnsets.pidgeot.learnset.gust = ['5L7'];
		this.data.Learnsets.pidgeot.learnset.quickattack = ['5L9'];
		this.data.Learnsets.pidgeot.learnset.wingattack = ['5L11'];
		this.data.Learnsets.pidgeot.learnset.whirlwind = ['5L13'];
		this.data.Learnsets.pidgeot.learnset.twister = ['5L15'];
		this.data.Learnsets.pidgeot.learnset.featherdance = ['5L17'];
		this.data.Learnsets.pidgeot.learnset.faintattack = ['5L20'];
		this.data.Learnsets.pidgeot.learnset.agility = ['5L23'];
		this.data.Learnsets.pidgeot.learnset.steelwing = ['5L26'];
		this.data.Learnsets.pidgeot.learnset.roost = ['5L29'];
		this.data.Learnsets.pidgeot.learnset.airslash = ['5L32'];
		this.data.Learnsets.pidgeot.learnset.bravebird = ['5L35'];
		this.data.Learnsets.pidgeot.learnset.mirrormove = ['5L40'];
		this.data.Learnsets.pidgeot.learnset.thrash = ['5L45'];
		this.data.Learnsets.pidgeot.learnset.hurricane = ['5L50'];
		this.data.Learnsets.pidgeot.learnset.doubleedge = ['5L55'];

	//rattata moves

		this.data.Learnsets.raticate.learnset.bite = ['5L0'];
		this.data.Learnsets.raticate.learnset.flamewheel = ['5L10'];
		this.data.Learnsets.raticate.learnset.swordsdance = ['5L20'];
		this.data.Learnsets.raticate.learnset.firefang = ['5L20'];
		this.data.Learnsets.raticate.learnset.thunderfang = ['5L20'];
		this.data.Learnsets.raticate.learnset.icefang = ['5L20'];
		this.data.Learnsets.raticate.learnset.reversal = ['5L44'];
		this.data.Learnsets.raticate.learnset.endeavor = ['5L49'];
		this.data.Learnsets.raticate.learnset.mefirst = ['5L54'];
		this.data.Learnsets.raticate.learnset.finalgambit = ['5L59'];
		this.data.Learnsets.raticate.learnset.honeclaws = ['5M'];
		this.data.Learnsets.raticate.learnset.suckerpunch = ['5M'];

		this.data.Learnsets.spearow.learnset.sonicboom = ['5L0'];
		this.data.Learnsets.spearow.learnset.pursuit = ['5L0'];
		this.data.Learnsets.spearow.learnset.steelwing = ['5L13'];

		this.data.Learnsets.fearow.learnset.pursuit = ['5L0'];
		this.data.Learnsets.fearow.learnset.steelwing = ['5L13'];

		this.data.Learnsets.ekans.learnset.poisontail = ['5L22'];

		this.data.Learnsets.arbok.learnset.poisontail = ['5L23'];

		this.data.Learnsets.pichu.learnset.wish = ['5L23'];
		this.data.Learnsets.pichu.learnset.sing = ['5L28'];
		this.data.Learnsets.pichu.learnset.petaldance = ['5L33'];
		this.data.Learnsets.pichu.learnset.dizzypunch = ['5L38'];
		this.data.Learnsets.pichu.learnset.surf = ['5M'];

		this.data.Learnsets.pikachu.learnset.charge = ['5L32'];
		this.data.Learnsets.pikachu.learnset.volttackle = ['5L54'];
		this.data.Learnsets.pikachu.learnset.surf = ['5M'];

		this.data.Learnsets.raichu.learnset.volttackle = ['5L54'];
		this.data.Learnsets.raichu.learnset.surf = ['5M'];

		this.data.Learnsets.sandshrew.learnset.nightslash = ['5L26'];
		this.data.Learnsets.sandshrew.learnset.superfang = ['5L50'];

		this.data.Learnsets.sandslash.learnset.nightslash = ['5L26'];
		this.data.Learnsets.sandslash.learnset.superfang = ['5L50'];

		this.data.Learnsets.nidoranf.learnset.moonlight = ['5L0'];
		this.data.Learnsets.nidoranf.learnset.sweetkiss = ['5L11'];
		this.data.Learnsets.nidoranf.learnset.lovelykiss = ['5L16'];
		this.data.Learnsets.nidoranf.learnset.superfang = ['5L28'];

		this.data.Learnsets.nidorina.learnset.superfang = ['5L31'];

		this.data.Learnsets.nidoranm.learnset.moonlight = ['5L0'];
		this.data.Learnsets.nidoranm.learnset.sweetkiss = ['5L11'];
		this.data.Learnsets.nidoranm.learnset.lovelykiss = ['5L16'];
		this.data.Learnsets.nidoranm.learnset.superfang = ['5L28'];

		this.data.Learnsets.nidorino.learnset.superfang = ['5L31'];

		for (var i in this.data.FormatsData) {
			//this.data.FormatsData[i].dreamWorldRelease = false;
			//if (i == 'mew' || i == 'chikorita' || i == 'bayleef' || i == 'meganium' || i == 'celebi' || i == 'jirachi' || i == 'jellicent' || i == 'braviary') {
				this.data.FormatsData[i].dreamWorldRelease = true;
			//}
		}
	}
};


text:
{% extends "genotype/base.html" %}

{% block title %}
    {{ super() }}
    - {{ sample.id }}
{% endblock %}

{% block navbar_items %}
    {{ super() }}

            {{ sample.id }}

{% endblock %}

{% block body_attribs %}
    {% if sample.status == 'fail' %}
        class="bg-danger"
    {% elif sample.status == 'pass' %}
        class="bg-success"
    {% elif sample.status == 'cancel' %}
        class="bg-warning"
    {% endif %}
{% endblock %}

{% block content %}

        <form action="{{ url_for('genotype.update', sample_id=sample.id) }}" method="POST">

{{ sample.id }}

                {% set gt_analysis = sample.analysis('genotype') %}
                {% if gt_analysis %}

                            Plate

                                    {{ gt_analysis.plate.plate_id }}

                {% endif %}

                            Sex
                            {% for analysis in sample.analyses %}
                                {{ analysis.type|capitalize }} sex
                            {% endfor %}
                            Comment

                                <select class="form-control" name="sample_sex">
                                    <option></option>
                                    {% for option in ['male', 'female', 'unknown'] %}
                                        <option value="{{ option }}" {% if sample.sex == option %}selected{% endif %}>{{ option }}</option>
                                    {% endfor %}
                                </select>

                            {% for analysis in sample.analyses %}

                                    <select class="form-control" name="{{ analysis.type }}_sex">
                                        <option></option>
                                        {% for option in ['male', 'female', 'unknown'] %}
                                            <option value="{{ option }}" {% if analysis.sex == option %}selected{% endif %}>{{ option }}</option>
                                        {% endfor %}
                                    </select>

                            {% endfor %}

                                <textarea class="form-control" name="comment" cols="30" rows="10">{{ sample.comment if sample.comment }}</textarea>

                    <button class="btn btn-default form-control">Save</button>

        </form>

Update status

                <form action="{{ url_for('genotype.update_status', sample_id=sample.id) }}" method="POST">

                            <textarea class="form-control" name="comment" cols="30" rows="5" required></textarea>

                                Status
                                <select class="form-control" name="status">
                                    <option></option>
                                    {% for option in ['pass', 'fail', 'cancel'] %}
                                        <option value="{{ option }}" {% if option == sample.status %}selected {% endif %}>
                                            {{ option }}
                                        </option>
                                    {% endfor %}
                                </select>

                            <button type="submit" class="btn btn-default form-control">Update</button>

                </form>

                <form action="{{ url_for('genotype.check', sample_id=sample.id) }}" method="POST">
                    <button type="submit" class="form-control btn btn-primary">Run check!</button>
                </form>

Genotypes

                        {% for analysis in sample.analyses %}

                                {{ analysis.type|capitalize }}
                                {% for genotype in analysis.genotypes %}
                                    {{ genotype.stringify() }}
                                {% endfor %}

                        {% endfor %}
                        {% if sample.analyses|length == 2 %}

                                {% for gt1, gt2, result in sample.genotype_comparisons() %}
                                    {% if result == 'unknown' %}
                                        🤷
                                    {% elif result == 'match' %}
                                        👍
                                    {% else %}
                                        👎
                                    {% endif %}
                                {% endfor %}

                        {% endif %}

                <form action="{{ url_for('genotype.delete_sample', sample_id=sample.id) }}" method="POST">
                    <button type="submit" class="form-control btn btn-danger" onclick="return confirm('Are you sure?')">Delete</button>
                </form>

{% endblock %}


text:
package net.sourceforge.plantuml.graphic;

import java.awt.geom.Dimension2D;
import java.awt.image.BufferedImage;

import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UImage;
import net.sourceforge.plantuml.ugraphic.UTranslate;

public class TileImage extends AbstractTextBlock implements TextBlock {

	private final BufferedImage image;
	private final int vspace;

	public TileImage(BufferedImage image, ImgValign valign, int vspace) {
		if (image == null) {
			throw new IllegalArgumentException();
		}
		this.image = image;
		this.vspace = vspace;
	}

	public Dimension2D calculateDimension(StringBounder stringBounder) {
		return new Dimension2DDouble(image.getWidth(), image.getHeight() + 2 * vspace);
	}

	public void drawU(UGraphic ug) {
		ug.apply(new UTranslate(0, vspace)).draw(new UImage(image));
	}

}


text:
<?php

return array(

    /*
    |--------------------------------------------------------------------------
    | Password Reminder Language Lines
    |--------------------------------------------------------------------------
    |
    | The following language lines are the default lines which match reasons
    | that are given by the password broker for a password update attempt
    | has failed, such as for an invalid token or invalid new password.
    |
    */

    "password" => "Wachtwoord moet minimaal zes tekens lang zijn en de wachtwoorden moeten overeenkomen.",

    "user"     => "Geen gebruiker bekend met dat e-mailadres.",

    "token"    => "Dit wachtwoord reset token is niet geldig.",

    "sent"     => "Wachtwoord herinnering verzonden!",

    "reset"    => "Password has been reset!",

);


text:
using System;
using System.Collections.Generic;
using System.Linq;
using Azure.Core;

namespace Azure.Storage.Blobs.Models
{
    /// <summary> Blob tags. </summary>
    internal partial class BlobTags
    {
        /// <summary> Initializes a new instance of BlobTags. </summary>
        /// <param name="blobTagSet"></param>
        /// <exception cref="ArgumentNullException"> <paramref name="blobTagSet"/> is null. </exception>
        public BlobTags(IEnumerable<BlobTag> blobTagSet)
        {
            Argument.AssertNotNull(blobTagSet, nameof(blobTagSet));

            BlobTagSet = blobTagSet.ToList();
        }

        /// <summary> Initializes a new instance of BlobTags. </summary>
        /// <param name="blobTagSet"></param>
        internal BlobTags(IList<BlobTag> blobTagSet)
        {
            BlobTagSet = blobTagSet;
        }

        /// <summary> Gets the blob tag set. </summary>
        public IList<BlobTag> BlobTagSet { get; }
    }
}


text:
<?php

namespace ezRPG\Library\Plugin;
use ezRPG\Library\Interfaces\Plugin;
use ezRPG\Library\Interfaces\Container;

/**
 * PlayerRegistration
 * @see Library\Plugin
 */
class PlayerRegistration implements Plugin
{
	protected $container;

	public function __construct(Container $container)
	{
		$this->container = $container;
	}

	/**
	 * playerRegistration
	 * @param array $data
	 * @todo Isnt implemented yet
	*/
	public function playerRegistration($data)
	{
		return;
	}

	/**
	 * playerLogin
	 * @param array $data
	*/
	public function playerLogin($data)
	{
		$session = $this->container['app']->getModel('Session');
		$session->clear();
		$session->set('playerid', $data['id']);
		$session->set('hash', $session->generateSignature());
		$session->set('last_active', time());
		header('Location: Home');
		exit;
	}

}


text:
import blacklist from 'blacklist';
import classnames from 'classnames';
import React from 'react';
import { Container } from 'elemental';

var PrimaryNavItem = React.createClass({
	displayName: 'PrimaryNavItem',
	propTypes: {
		className: React.PropTypes.string,
		children: React.PropTypes.node.isRequired,
		href: React.PropTypes.string.isRequired,
		title: React.PropTypes.string,
	},
	render () {
		return (

					{this.props.children}

		);
	},
});

var PrimaryNavigation = React.createClass({
	displayName: 'PrimaryNavigation',
	propTypes: {
		currentSectionKey: React.PropTypes.string,
		brand: React.PropTypes.string,
		sections: React.PropTypes.array.isRequired,
		signoutUrl: React.PropTypes.string,
	},
	renderSignout () {
		if (!this.props.signoutUrl) return null;

		return (

				<PrimaryNavItem href={this.props.signoutUrl} title="Sign Out">

				</PrimaryNavItem>

		);
	},
	renderBrand () {
		// TODO: support navbarLogo from keystone config
		return (
			<PrimaryNavItem className={this.props.currentSectionKey === 'dashboard' ? 'active' : null} href='/keystone' title={'Dashboard - ' + this.props.brand}>

			</PrimaryNavItem>
		);
	},
	renderNavigation () {
		if (!this.props.sections || !this.props.sections.length) return null;

		return this.props.sections.map((section) => {
			let href = section.lists[0].external ? section.lists[0].path : ('/keystone/' + section.lists[0].path);
			let className = (this.props.currentSectionKey && this.props.currentSectionKey === section.key) ? 'active' : null;

			return (
				<PrimaryNavItem className={className} href={href}>
					{section.label}
				</PrimaryNavItem>
			);
		});
	},
	render () {
		return (

				<Container clearfix>

						{this.renderBrand()}
						{this.renderNavigation()}

					{this.renderSignout()}
				</Container>

		);
	}
});

module.exports = PrimaryNavigation;


text:
import java.io.*;

public class buffered_reader {

	public static String readData(FileInputStream s) throws IOException{

		int n_bytes_available = s.available();
		byte[] temp_data = new byte[n_bytes_available];

		s.read(temp_data,0,n_bytes_available);

		String temp_string = new String(temp_data,0,n_bytes_available);

		//System.out.println("wtf!");

		return temp_string;

	}

	public static String readData(BufferedInputStream s) throws IOException{

		int n_bytes_available = s.available();
		byte[] temp_data = new byte[n_bytes_available];

		s.read(temp_data,0,n_bytes_available);

		String temp_string = new String(temp_data,0,n_bytes_available);

		//System.out.println("wtf!");

		return temp_string;

	}

}

/*

	BufferedInputStream pin;
	FileInputStream perr;
	Process p;

	//CONSTANTS
	//-----------------------------------------------------------------------
	public static final String term_string_const = String.format("\n<oc>\n");
	public static final Pattern pattern = Pattern.compile("\n(oc>)*");

	//??? Use StringBuilder????
	int max_bytes = 10000;
	StringBuffer input_data = new StringBuffer(max_bytes);
	StringBuffer error_data = new StringBuffer(max_bytes);

	//Technically we would expect that this is smaller than the input or output data
	//as those can be formed by many concatenations of repeated reads. Each read
	//writes over temp_data and then gets copied to the next index in the buffers
	byte[] temp_data  	    = new byte[max_bytes];

	//Set by class
	public boolean success_flag           = false;   //aka 'result' or 'success flag'
	public boolean error_flag 		 	  = false; 	 //Set true when error occurs ...
	public boolean detected_end_statement = false;   //Set true if we detect the terminal string
	public boolean stackdump_present      = false; 	 //Set true if stackdump detected
	public boolean process_running        = false;   //Set false if process is no longer running
	public boolean read_timeout 	      = false; 	 //Set true if the reading failed due to a timeout
	public String  result_str             = new String();

	//For repeated calls

	long start_time;
	long wait_time_nanoseconds;
	boolean debug;
	boolean allow_timeout;
	boolean ran_once_after_process_exiting;

	//We start everything in Matlab and pass in the relevant objects here ...
	//CONSTRUCTOR ===================================================================
	public NEURON_reader(BufferedInputStream pin, FileInputStream perr, Process p) {
		this.p    = p;
		this.perr = perr;
		this.pin  = pin;
	}

	public static boolean test_install(){
		return true;
	}

	public String getCurrentInputString(){
		return input_data.toString();
	}

	public String getCurrentErrorString(){
		return error_data.toString();
	}

	public void init_read(long wait_time_seconds, boolean debug_input)
	{
		//Initialization ...
		input_data.setLength(0);
		error_data.setLength(0);
		read_timeout = false;
		stackdump_present = false;
		detected_end_statement = false;
		success_flag = false;

		start_time = System.nanoTime();
		debug = debug_input;
		allow_timeout = wait_time_seconds != -1;
		wait_time_nanoseconds = (long) (wait_time_seconds*1e9);
		ran_once_after_process_exiting = false;
	}

	//MAIN FUNCTION
	//=======================================================================
	public boolean read_result() throws IOException
	{

		//RETURNED VALUE SHOULD BE WHETHER OR NOT TO STOP ...

		//NOTE: I couldn't figure out how to interrupt
		//So I call this function a bunch of times from Matlab ... :/

		int n_bytes_available;

		boolean is_terminal_string = false;

		//OUTLINE
		//------------------------------------------------------------------
		//1 Check if process is running
		//2 Check timing
		//3 Read input
		//4 Read error
		//5 Brief pause ????

		//PROCESS RUNNING CODE
		//---------------------------------------------------
		//NOTE: Asking a process for its exit value will throw an error if it is still running
		//I don't know of any other way to ask if the process is still valid ...
		try {
			p.exitValue();
			if (ran_once_after_process_exiting){
				process_running = false;
				System.err.println("NEURON process Exited");

				//Finalize error string if present
				//NOTE: Unfortunately we don't expose the non-error string :/
				//Might change public access fields ...
				result_str = error_data.toString();
				error_flag = true;
				return true;
			}
			else {
				//This mod should allow flushing of the buffers
				//before we throw an error that the system exited ...
				ran_once_after_process_exiting = true;
			}
		} catch (IllegalThreadStateException e) {
			process_running = true;
		}

		//TIME CHECKING - did we time out?
		//---------------------------------------------------
		if (allow_timeout && ((System.nanoTime() - start_time) > wait_time_nanoseconds)) {
			read_timeout = true;
			System.err.println("Reading from NEURON timed out");
			error_flag = true;
			return true;
		}

		//READING ERROR
		//---------------------------------------------------
		n_bytes_available = perr.available();
		if (n_bytes_available > 0){
			perr.read(temp_data,0,n_bytes_available);
			readStream(n_bytes_available, debug, false); //false indicates error stream
			//NOTE: We'll never get the terminal string from the error stream
			//Don't assign variable from function call..

		}

		//READING INPUT
		//---------------------------------------------------
		n_bytes_available = pin.available();
		if (n_bytes_available > max_bytes){
			System.err.println("Too many bytes needed for input: " + max_bytes + " initialized, " + n_bytes_available + "requested");
		}

		if (n_bytes_available > 0){

			// I am getting an error here:
			//java.io.BufferedInputStream.read(Unknown Source)
			//This is after an error ...

			//Java exception occurred:
//java.lang.IndexOutOfBoundsException

	//at java.io.BufferedInputStream.read(Unknown Source)

	//at NEURON_reader.read_result(NEURON_reader.java:143)

			pin.read(temp_data,0,n_bytes_available);
			is_terminal_string = readStream(n_bytes_available, debug, true);
		}

		if (is_terminal_string){
			detected_end_statement = true;

			//SETTING THE FINAL STRING
			//--------------------------------------------------------------------------
			if (error_data.length() > 0){
				success_flag = false;
				//NOTE: We'll Ignore partially good strings for now ...

	        //if obj.temp_stdout_index > 0
            //obj.partial_good_str = obj.temp_stdout_str(1:obj.temp_stdout_index-1);
			//end
				result_str = error_data.toString();
			}else {
				success_flag = true;
				result_str = input_data.toString();
			}
		}

		return is_terminal_string;
	}

	private boolean isStackdumpPresent(String temp_string, boolean is_success){

		//NOTE: This code is a bit messy, essentially we look for a particular string
		//in the current error string.

		boolean potential_stackdump;
		String  possible_error_string;
		boolean stackdump_present = false;

		potential_stackdump = is_success && error_data.length() > 0;
		if (potential_stackdump){
			possible_error_string = error_data.toString();
			stackdump_present     = possible_error_string.lastIndexOf("Dumping stack trace to") != -1;
			if (stackdump_present){
				System.err.printf("STACKDUMP ERROR MESSAGE:\n%s\n",possible_error_string);
				error_flag = true;
			}
		}

		return stackdump_present;
	}

	private String cleanString(int n_bytes_available){

		Matcher matcher;
		String temp_string;

		//Add newline to facilitate oc> matching ...
		//Convert from bytes to string ...
		temp_string = "\n" + new String(temp_data,0,n_bytes_available);

		//Replace with a replacement of \noc>oc>* with just the newline.
		matcher     = pattern.matcher(temp_string);
		temp_string = matcher.replaceAll("\n");

		//NOTE: I need to remove the first newline since I added it to facilitate matching
		return temp_string.substring(1);
	}

	private boolean readStream(int n_bytes_available, boolean debug, boolean is_input_string){

		String temp_string;
		int index_term_string_match;
		boolean is_terminal_string = false;

		//Bytes to string
		//------------------------------------------------------------
		temp_string = cleanString(n_bytes_available);

		//Check if the terminal string is present
		//If it is, trim it out of the result ...
		//------------------------------------------------------------
		if (is_input_string){
			index_term_string_match = temp_string.lastIndexOf(term_string_const);
			if (index_term_string_match >= 0){
				is_terminal_string = true;
				//Remove the terminal string ...
				if (index_term_string_match == 0){
					temp_string = new String("");
				}else{
					temp_string = temp_string.substring(0,index_term_string_match-1);
				}
			}
		}

		//Print out things if debugging ...
		if (debug && temp_string.length() > 0){
			if (is_input_string){
				System.out.println(temp_string);
			} else {
				System.err.println(temp_string);
			}
		}

		if (is_terminal_string){
			//NOTE: We will eventually remove this ...
			//System.out.println("Terminal String Detected");
		}else{
			if (isStackdumpPresent(temp_string,is_input_string)){
				stackdump_present = true;
			}
		}

		//String copying to buffer ...
		if (is_input_string){
			input_data.append(temp_string);
		} else {
			error_data.append(temp_string);
		}
		return is_terminal_string;
	}

}
*/


text:
<?php
Class Group_Form_FrmInvoice extends Zend_Dojo_Form {
	protected $tr;
	public function init()
	{
		$this->tr = Application_Form_FrmLanguages::getCurrentlanguage();
	}
	public function FrmAddInvoice($data=null,$action=null){

		$request=Zend_Controller_Front::getInstance()->getRequest();
		$db = new Application_Model_DbTable_DbGlobal();
		$db_vdG = new Application_Model_DbTable_DbVdGlobal();
		$_invoice_no = new Zend_Dojo_Form_Element_ValidationTextBox('invoice_no');
		$_invoice_no->setAttribs(array(
				'dojoType'=>'dijit.form.ValidationTextBox',
				'class'=>'fullside',
				'required'=>'true',
				'placeholder'=>$this->tr->translate("INVOICE_NO")
		));
		$_client_id = new Zend_Dojo_Form_Element_FilteringSelect('client_id');
		$_client_id->setAttribs(array(
				'dojoType'=>'dijit.form.FilteringSelect',
				'class'=>'fullside',
				'onchange'=>'showFormClient();',
		));

		$rows =  $db_vdG->getAllClient();
		if (!empty($action)){
			$options=array(0=>$this->tr->translate("SELECT_CUSTOMER"));
		}else{
			$options=array(0=>$this->tr->translate("SELECT_CUSTOMER"),"-1"=>$this->tr->translate("ADD_NEW_CUSTOMER"));
		}
		if(!empty($rows))foreach($rows AS $row) $options[$row['id']]=$row['name'];
		$_client_id->setMultiOptions($options);

		$_order_date = new Zend_Dojo_Form_Element_DateTextBox('order_date');
		$_order_date->setAttribs(array('dojoType'=>'dijit.form.DateTextBox',
				//'required'=>'true',
				'class'=>'fullside',
				'constraints'=>"{datePattern:'dd/MM/yyyy'}",
		));

		$_date = date("Y-m-d");
		$_order_date->setValue($_date);

		$_note = new Zend_Dojo_Form_Element_Textarea("note");
		$_note->setAttribs(array(
				'dojoType'=>'dijit.form.Textarea',
				'class'=>'fullside',
				'style'=>'width:100%;min-height:60px; font-size:inherit; font-family:Kh Battambang'
		));

		$_province = new Zend_Dojo_Form_Element_FilteringSelect('province');
		$_province->setAttribs(array(
				'dojoType'=>'dijit.form.FilteringSelect',
				'class'=>'fullside',
				'onchange'=>'filterDistrict();',
		));

		$rows =  $db->getAllProvince();
		$options=array($this->tr->translate("SELECT_PROVINCE"));
		if(!empty($rows))foreach($rows AS $row) $options[$row['id']]=$row['province_en_name'];
		$_province->setMultiOptions($options);

		$_delivery_info=  new Zend_Dojo_Form_Element_FilteringSelect('delivery_info');
		$_delivery_info->setAttribs(array('dojoType'=>'dijit.form.FilteringSelect','class'=>'fullside',));
		if (!empty($action)){
			$_delivery_info_opt = array(
					0=>$this->tr->translate("DELIVERY_INFO"),
					1=>$this->tr->translate("SHIPPING"),
					2=>$this->tr->translate("RECEICED"));
		}else{
		$_delivery_info_opt = array(
				1=>$this->tr->translate("SHIPPING"),
				2=>$this->tr->translate("RECEICED"));

		}
		$_delivery_info->setMultiOptions($_delivery_info_opt);
		if (empty($action)){
		$_delivery_info->setValue(2);
		}
		$_amount = new Zend_Dojo_Form_Element_NumberTextBox('amount');
		$_amount->setAttribs(array(
				'dojoType'=>'dijit.form.NumberTextBox',
				'class'=>'fullside',
				'onKeyup'=>'setBalance();',
				'required'=>true,
		));
		$_balance = new Zend_Dojo_Form_Element_NumberTextBox('balance');
		$_balance->setAttribs(array(
				'dojoType'=>'dijit.form.NumberTextBox',
				'class'=>'fullside',
				'required'=>true,
		));
		$_status=  new Zend_Dojo_Form_Element_FilteringSelect('status');
		$_status->setAttribs(array('dojoType'=>'dijit.form.FilteringSelect','class'=>'fullside',));
		$_status_opt = array(
				1=>$this->tr->translate("ACTIVE"),
				0=>$this->tr->translate("DACTIVE"));
		$_status->setMultiOptions($_status_opt);
		if($data!=null){
			$_invoice_no->setValue($data['invoice_no']);
			$_client_id->setValue($data['client_id']);
			$_order_date->setValue($data['order_date']);
			$_delivery_info->setValue($data['delivery_status']);
			$_note->setValue($data['note']);
			$_status->setValue($data['status']);
			$_amount->setValue($data['amount']);
			$_balance->setValue($data['balance']);
		}
		$this->addElements(array($_invoice_no,$_client_id,$_order_date,
				$_delivery_info,$_amount,$_balance,
			$_note,$_province,
			$_status));
		return $this;

	}

}


text:
var _each = require("lodash-node/modern/collection/forEach");

var StoreWatchMixin = function() {
  var storeNames = Array.prototype.slice.call(arguments);
  return {
    componentDidMount: function() {
      var flux = this.props.flux || this.context.flux;
      _each(storeNames, function(store) {
        flux.store(store).on("change", this._setStateFromFlux);
      }, this);
    },

    componentWillUnmount: function() {
      var flux = this.props.flux || this.context.flux;
      _each(storeNames, function(store) {
        flux.store(store).removeListener("change", this._setStateFromFlux);
      }, this);
    },

    _setStateFromFlux: function() {
      if(this.isMounted()) {
        this.setState(this.getStateFromFlux());
      }
    },

    getInitialState: function() {
      return this.getStateFromFlux();
    }
  };
};

StoreWatchMixin.componentWillMount = function() {
  throw new Error("Fluxxor.StoreWatchMixin is a function that takes one or more " +
    "store names as parameters and returns the mixin, e.g.: " +
    "mixins: [Fluxxor.StoreWatchMixin(\"Store1\", \"Store2\")]");
};

module.exports = StoreWatchMixin;


text:
namespace Krompaco.SendGridForEpi.Models;

/// <summary>
/// The model that can be queued
/// </summary>
public class MailQueueItem
{
    /// <summary>
    /// Gets or sets the Sequential ID to keep track of number of items processed. Will always be overwritten in AddToQueue() method.
    /// </summary>
    public long MailQueueItemId { get; set; }

    /// <summary>
    /// Gets or sets the date and time for the mail, normally you would use DateTime.UtcNow.
    /// </summary>
    public DateTime Date { get; set; }

    /// <summary>
    /// Gets or sets the SendGrid Mail object. Typically you would set From, TemplateId and use AddPersonalization().
    /// </summary>
    public SendGrid.Helpers.Mail.SendGridMessage? Mail { get; set; }

    /// <summary>
    /// Gets or sets the LastAttempt property. Will always be overwritten to DateTime.UtcNow in AddToQueue() method.
    /// </summary>
    public DateTime LastAttempt { get; set; }

    /// <summary>
    /// Gets or sets the number of attempts. GetAddToQueue() is sorted by ascending Attempts.
    /// </summary>
    public int Attempts { get; set; }

    /// <summary>
    /// Gets or sets the error message of the last attempt.
    /// </summary>
    public string? AttemptMessage { get; set; }
}