text:
<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/translate/v3/translation_service.proto

namespace Google\Cloud\Translate\V3;

use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;

/**
 * Stored in the
 * [google.longrunning.Operation.response][google.longrunning.Operation.response]
 * field returned by BatchTranslateDocument if at least one document is
 * translated successfully.
 *
 * Generated from protobuf message google.cloud.translation.v3.BatchTranslateDocumentResponse
 */
class BatchTranslateDocumentResponse extends \Google\Protobuf\Internal\Message
{
    /**
     * Total number of pages to translate in all documents. Documents without
     * clear page definition (such as XLSX) are not counted.
     *
     * Generated from protobuf field int64 total_pages = 1;
     */
    private $total_pages = 0;
    /**
     * Number of successfully translated pages in all documents. Documents without
     * clear page definition (such as XLSX) are not counted.
     *
     * Generated from protobuf field int64 translated_pages = 2;
     */
    private $translated_pages = 0;
    /**
     * Number of pages that failed to process in all documents. Documents without
     * clear page definition (such as XLSX) are not counted.
     *
     * Generated from protobuf field int64 failed_pages = 3;
     */
    private $failed_pages = 0;
    /**
     * Number of billable pages in documents with clear page definition (such as
     * PDF, DOCX, PPTX)
     *
     * Generated from protobuf field int64 total_billable_pages = 4;
     */
    private $total_billable_pages = 0;
    /**
     * Total number of characters (Unicode codepoints) in all documents.
     *
     * Generated from protobuf field int64 total_characters = 5;
     */
    private $total_characters = 0;
    /**
     * Number of successfully translated characters (Unicode codepoints) in all
     * documents.
     *
     * Generated from protobuf field int64 translated_characters = 6;
     */
    private $translated_characters = 0;
    /**
     * Number of characters that have failed to process (Unicode codepoints) in
     * all documents.
     *
     * Generated from protobuf field int64 failed_characters = 7;
     */
    private $failed_characters = 0;
    /**
     * Number of billable characters (Unicode codepoints) in documents without
     * clear page definition, such as XLSX.
     *
     * Generated from protobuf field int64 total_billable_characters = 8;
     */
    private $total_billable_characters = 0;
    /**
     * Time when the operation was submitted.
     *
     * Generated from protobuf field .google.protobuf.Timestamp submit_time = 9;
     */
    private $submit_time = null;
    /**
     * The time when the operation is finished and
     * [google.longrunning.Operation.done][google.longrunning.Operation.done] is
     * set to true.
     *
     * Generated from protobuf field .google.protobuf.Timestamp end_time = 10;
     */
    private $end_time = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int|string $total_pages
     *           Total number of pages to translate in all documents. Documents without
     *           clear page definition (such as XLSX) are not counted.
     *     @type int|string $translated_pages
     *           Number of successfully translated pages in all documents. Documents without
     *           clear page definition (such as XLSX) are not counted.
     *     @type int|string $failed_pages
     *           Number of pages that failed to process in all documents. Documents without
     *           clear page definition (such as XLSX) are not counted.
     *     @type int|string $total_billable_pages
     *           Number of billable pages in documents with clear page definition (such as
     *           PDF, DOCX, PPTX)
     *     @type int|string $total_characters
     *           Total number of characters (Unicode codepoints) in all documents.
     *     @type int|string $translated_characters
     *           Number of successfully translated characters (Unicode codepoints) in all
     *           documents.
     *     @type int|string $failed_characters
     *           Number of characters that have failed to process (Unicode codepoints) in
     *           all documents.
     *     @type int|string $total_billable_characters
     *           Number of billable characters (Unicode codepoints) in documents without
     *           clear page definition, such as XLSX.
     *     @type \Google\Protobuf\Timestamp $submit_time
     *           Time when the operation was submitted.
     *     @type \Google\Protobuf\Timestamp $end_time
     *           The time when the operation is finished and
     *           [google.longrunning.Operation.done][google.longrunning.Operation.done] is
     *           set to true.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Translate\V3\TranslationService::initOnce();
        parent::__construct($data);
    }

    /**
     * Total number of pages to translate in all documents. Documents without
     * clear page definition (such as XLSX) are not counted.
     *
     * Generated from protobuf field int64 total_pages = 1;
     * @return int|string
     */
    public function getTotalPages()
    {
        return $this->total_pages;
    }

    /**
     * Total number of pages to translate in all documents. Documents without
     * clear page definition (such as XLSX) are not counted.
     *
     * Generated from protobuf field int64 total_pages = 1;
     * @param int|string $var
     * @return $this
     */
    public function setTotalPages($var)
    {
        GPBUtil::checkInt64($var);
        $this->total_pages = $var;

        return $this;
    }

    /**
     * Number of successfully translated pages in all documents. Documents without
     * clear page definition (such as XLSX) are not counted.
     *
     * Generated from protobuf field int64 translated_pages = 2;
     * @return int|string
     */
    public function getTranslatedPages()
    {
        return $this->translated_pages;
    }

    /**
     * Number of successfully translated pages in all documents. Documents without
     * clear page definition (such as XLSX) are not counted.
     *
     * Generated from protobuf field int64 translated_pages = 2;
     * @param int|string $var
     * @return $this
     */
    public function setTranslatedPages($var)
    {
        GPBUtil::checkInt64($var);
        $this->translated_pages = $var;

        return $this;
    }

    /**
     * Number of pages that failed to process in all documents. Documents without
     * clear page definition (such as XLSX) are not counted.
     *
     * Generated from protobuf field int64 failed_pages = 3;
     * @return int|string
     */
    public function getFailedPages()
    {
        return $this->failed_pages;
    }

    /**
     * Number of pages that failed to process in all documents. Documents without
     * clear page definition (such as XLSX) are not counted.
     *
     * Generated from protobuf field int64 failed_pages = 3;
     * @param int|string $var
     * @return $this
     */
    public function setFailedPages($var)
    {
        GPBUtil::checkInt64($var);
        $this->failed_pages = $var;

        return $this;
    }

    /**
     * Number of billable pages in documents with clear page definition (such as
     * PDF, DOCX, PPTX)
     *
     * Generated from protobuf field int64 total_billable_pages = 4;
     * @return int|string
     */
    public function getTotalBillablePages()
    {
        return $this->total_billable_pages;
    }

    /**
     * Number of billable pages in documents with clear page definition (such as
     * PDF, DOCX, PPTX)
     *
     * Generated from protobuf field int64 total_billable_pages = 4;
     * @param int|string $var
     * @return $this
     */
    public function setTotalBillablePages($var)
    {
        GPBUtil::checkInt64($var);
        $this->total_billable_pages = $var;

        return $this;
    }

    /**
     * Total number of characters (Unicode codepoints) in all documents.
     *
     * Generated from protobuf field int64 total_characters = 5;
     * @return int|string
     */
    public function getTotalCharacters()
    {
        return $this->total_characters;
    }

    /**
     * Total number of characters (Unicode codepoints) in all documents.
     *
     * Generated from protobuf field int64 total_characters = 5;
     * @param int|string $var
     * @return $this
     */
    public function setTotalCharacters($var)
    {
        GPBUtil::checkInt64($var);
        $this->total_characters = $var;

        return $this;
    }

    /**
     * Number of successfully translated characters (Unicode codepoints) in all
     * documents.
     *
     * Generated from protobuf field int64 translated_characters = 6;
     * @return int|string
     */
    public function getTranslatedCharacters()
    {
        return $this->translated_characters;
    }

    /**
     * Number of successfully translated characters (Unicode codepoints) in all
     * documents.
     *
     * Generated from protobuf field int64 translated_characters = 6;
     * @param int|string $var
     * @return $this
     */
    public function setTranslatedCharacters($var)
    {
        GPBUtil::checkInt64($var);
        $this->translated_characters = $var;

        return $this;
    }

    /**
     * Number of characters that have failed to process (Unicode codepoints) in
     * all documents.
     *
     * Generated from protobuf field int64 failed_characters = 7;
     * @return int|string
     */
    public function getFailedCharacters()
    {
        return $this->failed_characters;
    }

    /**
     * Number of characters that have failed to process (Unicode codepoints) in
     * all documents.
     *
     * Generated from protobuf field int64 failed_characters = 7;
     * @param int|string $var
     * @return $this
     */
    public function setFailedCharacters($var)
    {
        GPBUtil::checkInt64($var);
        $this->failed_characters = $var;

        return $this;
    }

    /**
     * Number of billable characters (Unicode codepoints) in documents without
     * clear page definition, such as XLSX.
     *
     * Generated from protobuf field int64 total_billable_characters = 8;
     * @return int|string
     */
    public function getTotalBillableCharacters()
    {
        return $this->total_billable_characters;
    }

    /**
     * Number of billable characters (Unicode codepoints) in documents without
     * clear page definition, such as XLSX.
     *
     * Generated from protobuf field int64 total_billable_characters = 8;
     * @param int|string $var
     * @return $this
     */
    public function setTotalBillableCharacters($var)
    {
        GPBUtil::checkInt64($var);
        $this->total_billable_characters = $var;

        return $this;
    }

    /**
     * Time when the operation was submitted.
     *
     * Generated from protobuf field .google.protobuf.Timestamp submit_time = 9;
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getSubmitTime()
    {
        return $this->submit_time;
    }

    public function hasSubmitTime()
    {
        return isset($this->submit_time);
    }

    public function clearSubmitTime()
    {
        unset($this->submit_time);
    }

    /**
     * Time when the operation was submitted.
     *
     * Generated from protobuf field .google.protobuf.Timestamp submit_time = 9;
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setSubmitTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->submit_time = $var;

        return $this;
    }

    /**
     * The time when the operation is finished and
     * [google.longrunning.Operation.done][google.longrunning.Operation.done] is
     * set to true.
     *
     * Generated from protobuf field .google.protobuf.Timestamp end_time = 10;
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getEndTime()
    {
        return $this->end_time;
    }

    public function hasEndTime()
    {
        return isset($this->end_time);
    }

    public function clearEndTime()
    {
        unset($this->end_time);
    }

    /**
     * The time when the operation is finished and
     * [google.longrunning.Operation.done][google.longrunning.Operation.done] is
     * set to true.
     *
     * Generated from protobuf field .google.protobuf.Timestamp end_time = 10;
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setEndTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->end_time = $var;

        return $this;
    }

}


text:
import {Component} from '@angular/core';

@Component({
    selector: 'jhi-the-buyback',
    templateUrl: './the-buyback.component.html',
    styleUrls: [
        'the-buyback.css'
    ]
})
export class TheBuybackComponent {
}

redpajama_set_name: RedPajamaGithub


text:
module qec {
    export class svgHelper {
        imgWidth: number;
        imgHeight: number;
        contentSvg: string;
        svgRootElement: HTMLElement;
        layers: SVGElement[];
        elements: SVGElement[];
        elementsId: string[];
        canvas = document.createElement('canvas');
        canvas2 = document.createElement('canvas');

        setSvg(content: string, done: () => void) {
            //document.body.appendChild(this.canvas);
            this.contentSvg = content;

            var parser = new DOMParser();
            var doc = parser.parseFromString(content, "image/svg+xml");
            this.svgRootElement = doc.documentElement;

            this.layers = this.findLayers(this.svgRootElement);

            this.elements = [];
            this.layers.forEach(l => this.getAllElementsInLayer(l, this.elements));
            this.elementsId = this.elements.map(e => e.getAttribute('id'));

            var img = new Image();
            img.onload = () => {
                this.imgWidth = img.width;
                this.imgHeight = img.height;
                console.log("img dimension : " + this.imgWidth + "," + this.imgHeight);
                done();
            }
            img.src = "data:image/svg+xml;base64," + btoa(this.contentSvg);

        }

        getElementsId(): string[] {
            return this.elementsId;
        }

        currentId: string;
        drawOnly(id: string, done: () => void) {
            this.currentId = id;
            this.elements.forEach(e => this.setVisible(e, 'hidden'));
            var found = this.elements.find(e => e.getAttribute('id') == id);
            this.setVisible(found, 'visible');

            this.canvas.width = this.imgWidth;
            this.canvas.height = this.imgHeight;

            var ctx = this.canvas.getContext('2d');
            ctx.clearRect(0, 0, this.canvas.width, this.canvas.height);
            var svg_xml = (new XMLSerializer()).serializeToString(this.svgRootElement);

            var img = new Image();
            img.onload = () => {
                ctx.drawImage(img, 0, 0);

                var boundingInPx = this.getBoundingBoxInPx();
                var w = boundingInPx[2] - boundingInPx[0] + 1;
                var h = boundingInPx[3] - boundingInPx[1] + 1;
                this.canvas2.width = w;
                this.canvas2.height = h;
                var ctx2 = this.canvas2.getContext('2d');
                ctx2.drawImage(img, boundingInPx[0], boundingInPx[1], w, h, 0, 0, w, h);
                done();
            }
            img.src = "data:image/svg+xml;base64," + btoa(svg_xml);
        }

        private setVisible(elt: SVGElement, v: string) {

            var style = {};
            var styleStr = elt.getAttribute('style');
            if (styleStr == null)
                styleStr = '';

            var newStyle = styleAttribute.setField(styleStr, 'visibility', v);
            elt.setAttribute('style', newStyle);
        }

        getColor(): number[] {
            var found = this.elements.find(e => e.getAttribute('id') == this.currentId);
            var style = found.getAttribute('style');
            var i = style.indexOf('fill:');
            if (i >= 0) {
                var col = style.substring(i + 5, i + 5 + 7);
                var rgb = this.hexToRgb(col);
                if (rgb != null)
                    return rgb;
            }
            return [0.5, 0.5, 0.5];
        }

        realSize = vec2.create();
        setRealSizeToFit(realSizeContainer: Float32Array) {
            var scaleX = (realSizeContainer[0]) / this.imgWidth;
            var scaleY = (realSizeContainer[1]) / this.imgHeight;
            var scale = Math.min(scaleX, scaleY);
            this.realSize[0] = this.imgWidth * scale;
            this.realSize[1] = this.imgHeight * scale;
        }

        getBoundingRealSize(): number[] {
            var bounds = this.getBoundingBoxInPx();
            var pxWidth = bounds[2] - bounds[0];
            var pxHeight = bounds[3] - bounds[1];
            return [pxWidth / this.imgWidth * this.realSize[0], pxHeight / this.imgHeight * this.realSize[1]];
        }

        getRealCenter(): number[] {
            var bounds = this.getBoundingBoxInPx();
            var cx = 0.5 * bounds[2] + 0.5 * bounds[0];
            var cy = 0.5 * bounds[3] + 0.5 * bounds[1];
            return [(cx - this.imgWidth / 2) / this.imgWidth * this.realSize[0],
            -1 * ((cy - this.imgHeight / 2) / this.imgHeight) * this.realSize[1]];
        }

        getBoundingBoxInPx(): number[] {
            var ctx = this.canvas.getContext('2d');
            var imageData = ctx.getImageData(0, 0, this.canvas.width, this.canvas.height);

            var bounds = [0, 0, 0, 0];
            var first = true;
            for (var i = 0; i < imageData.width; ++i) {
                for (var j = 0; j < imageData.height; ++j) {
                    var q = 4 * (i + j * imageData.width);
                    if (imageData.data[q + 3] > 0 &&
                        (imageData.data[q] != 255
                            || imageData.data[q + 1] != 255
                            || imageData.data[q + 2] != 255)) {
                        if (first || i < bounds[0])
                            bounds[0] = i;
                        if (first || j < bounds[1])
                            bounds[1] = j;
                        if (first || i > bounds[2])
                            bounds[2] = i;
                        if (first || j > bounds[3])
                            bounds[3] = j;

                        first = false;
                    }
                }
            }
            return bounds;
        }

        private findLayers(elt: Element): SVGElement[] {
            var foundList: SVGElement[] = [];
            for (var i = 0; i < elt.childNodes.length; ++i) {
                var child = elt.childNodes[i];
                if (child instanceof SVGGElement) {
                    foundList.push(child);
                    //console.log('layer: ' + child.getAttribute('id'));
                }
            }
            return foundList;
        }

        private getAllElementsInLayer(elt: Element, foundList: SVGElement[]) {
            for (var i = 0; i < elt.childNodes.length; ++i) {
                var child = elt.childNodes[i];
                if (child instanceof SVGElement) {
                    foundList.push(child);
                    //console.log('drawable: ' + child.getAttribute('id'));
                }
            }
        }

        private hexToRgb(hex): number[] {
            // Expand shorthand form (e.g. "03F") to full form (e.g. "0033FF")
            var shorthandRegex = /^#?([a-f\d])([a-f\d])([a-f\d])$/i;
            hex = hex.replace(shorthandRegex, function (m, r, g, b) {
                return r + r + g + g + b + b;
            });

            var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
            return result ? [
                parseInt(result[1], 16) / 255,
                parseInt(result[2], 16) / 255,
                parseInt(result[3], 16) / 255
            ] : null;
        }
    }
}


text:
using System.Globalization;
using osu.Framework.IO.Network;

namespace osu.Game.Online.API.Requests
{
    public abstract class PaginatedAPIRequest<T> : APIRequest<T> where T : class
    {
        private readonly PaginationParameters pagination;

        protected PaginatedAPIRequest(PaginationParameters pagination)
        {
            this.pagination = pagination;
        }

        protected override WebRequest CreateWebRequest()
        {
            var req = base.CreateWebRequest();

            req.AddParameter("offset", pagination.Offset.ToString(CultureInfo.InvariantCulture));
            req.AddParameter("limit", pagination.Limit.ToString(CultureInfo.InvariantCulture));

            return req;
        }
    }
}


text:
    var ProductionRequestServices = angular.module('ProductionRequestServices', ['ngResource']);
    ProductionRequestServices.run(run);
    run.$inject = ['$http'];
    /**
    * @name run
    * @desc Update xsrf $http headers to align with Django's defaults
    */
    function run($http) {
      $http.defaults.xsrfHeaderName = 'X-CSRFToken';
      $http.defaults.xsrfCookieName = 'csrftoken';
    }

    var ProductionRequestApp = angular.module('ProductionRequestApp',['ngRoute','ProductionRequestServices','datatables']);
       ProductionRequestApp.config(function($resourceProvider) {
       $resourceProvider.defaults.stripTrailingSlashes = false;
   });

ProductionRequestApp.controller('WithAjaxCtrl',['DTOptionsBuilder','DTColumnBuilder','$http','$q',
function (DTOptionsBuilder, DTColumnBuilder,http, q) {
    var vm = this;
        // vm.dtOptions = DTOptionsBuilder.fromSource('/prodtask/production_request_api/')
        // .withPaginationType('full_numbers');
    vm.dtOptions = DTOptionsBuilder.newOptions()
        .withOption('ajax', {
         // Either you specify the AjaxDataProp here
         // dataSrc: 'data',
         url: '/prodtask/production_request_api/',
     })
     // or here
     .withDataProp('data')
        .withOption('processing', true)
        .withOption('serverSide', true)
        .withPaginationType('full_numbers');
    // vm.dtOptions = DTOptionsBuilder.fromFnPromise(function() {
    //     var defer = q.defer();
    //     http.get('/prodtask/production_request_api/').then(function(result) {
    //         defer.resolve(result.data);
    //     });
    //     return defer.promise;
    // }).withPaginationType('full_numbers');

    vm.dtColumns = [
        DTColumnBuilder.newColumn('reqid').withTitle('ID'),
        DTColumnBuilder.newColumn('description').withTitle('Description'),
        DTColumnBuilder.newColumn('cstatus').withTitle('Status')
    ];
}]);

ProductionRequestApp.config(function($routeProvider) {
      $routeProvider.
        when('/', {
          templateUrl:'/static/html/_ng_request_table.html',
          controller: 'WithAjaxCtrl as showCase'
        })

});


text:
import os
import psycopg2
from petl import *
import argparse

# get the subdirectory containing the .csv files from the command line and check that it exists.
#
parser = argparse.ArgumentParser(description='Import .csv files for the Freshwater Species Database.')
parser.add_argument('subdir', help="name of the database subdirectory (expected to be in 'wkg/')")
args = parser.parse_args()
if not os.path.exists(os.path.join('wkg', args.subdir)):
    print('Error: ' + args.subdir + " does not exist as a subdirectory of 'wkg/'.")
    exit()

# Set up the database connection
#
connection = psycopg2.connect(
    database=os.environ['DB'],
    user=os.environ['DB_USER'],
    password=os.environ['DB_PASSWORD'],
    host=os.environ['DB_HOST'],
)
cursor = connection.cursor()

# Origin: create, map, and load
#
cursor.execute("""
DROP TABLE IF EXISTS origins CASCADE;
CREATE TABLE origins (
    id                          BIGSERIAL NOT NULL UNIQUE PRIMARY KEY,
    org_id                      INTEGER NOT NULL UNIQUE,
    org_name                    VARCHAR(32) NOT NULL
);
""")
f = fromcsv(os.path.join('wkg', args.subdir, 'Origin.csv'))
f = cutout(f, 'OBJECTID')
f = rename(f, {
    'Org_ID':                   'org_id',
    'Org_Name':                 'org_name',
})
f = convertnumbers(f)
todb(f, connection, 'origins')

# ObservationType: create, map, and load
#
cursor.execute("""
DROP TABLE IF EXISTS observation_types CASCADE;
CREATE TABLE observation_types (
    id                          BIGSERIAL NOT NULL UNIQUE PRIMARY KEY,
    obs_typ_id                  INTEGER UNIQUE,
    obs_typ_name                VARCHAR(64) NOT NULL UNIQUE,
    range_obs                   VARCHAR(32),
    current_other               VARCHAR(32),
    group_                      VARCHAR(32)
);
""")
f = fromcsv(os.path.join('wkg', args.subdir, 'ObservationType.csv'))
f = cutout(f, 'OBJECTID')
f = rename(f, {
    'ObsTyp_ID':                'obs_typ_id',
    'ObsTyp_Name':              'obs_typ_name',
    'Range_Obs':                'range_obs',
    'Current_Other':            'current_other',
    'Group_':                   'group_',
})
f = convertnumbers(f)
todb(f, connection, 'observation_types')

# Source: create, map, and load
#
# @todo source_name should be UNIQUE.
cursor.execute("""
DROP TABLE IF EXISTS sources CASCADE;
CREATE TABLE sources (
    id                          BIGSERIAL NOT NULL UNIQUE PRIMARY KEY,
    source_id                   INTEGER NOT NULL UNIQUE,
    source_name                 VARCHAR(256),
    sourcegrp_name              VARCHAR(64),
    use_agree                   TEXT,
    permission_request_needed   VARCHAR(64),
    permission_contact_name     VARCHAR(32),
    permission_contact_email    VARCHAR(64),
    permission_status           TEXT,
    permission                  VARCHAR(32),
    comment_id                  INTEGER,
    citation                    TEXT,
    weblink                     VARCHAR(128),
    pre_release_review          VARCHAR(8),
    aggregator                  VARCHAR(32),
    count_huc12s                INTEGER,
    count_elm_ids               INTEGER
);
CREATE INDEX ON sources (source_id);
""")
f = fromcsv(os.path.join('wkg', args.subdir, 'Source.csv'))
f = cutout(f, 'OBJECTID')
f = rename(f, {
    'Source_ID':                 'source_id',
    'Source_Name':               'source_name',
    'SourceGrp_Name':            'sourcegrp_name',
    'Use_agree':                 'use_agree',
    'Permission_request_needed': 'permission_request_needed',
    'Permission_contact_name':   'permission_contact_name',
    'Permission_contact_email':  'permission_contact_email',
    'Permission_status':         'permission_status',
    'Permission':                'permission',
    'Comment_ID':                'comment_id',
    'Citation':                  'citation',
    'Weblink':                   'weblink',
    'Pre_release_review':        'pre_release_review',
    'Aggregator':                'aggregator',
    'Count_HUC12s':              'count_huc12s',
    'Count_Elm_IDs':             'count_elm_ids'
})
f = convertnumbers(f)
f = convert(f, (
    'source_id',
    'comment_id',
    'count_huc12s',
    'count_elm_ids',
), lambda v: int(v))
todb(f, connection, 'sources')

# HabitatUsage: create, map, and load
#
cursor.execute("""
DROP TABLE IF EXISTS habitat_usages CASCADE;
CREATE TABLE habitat_usages (
    id                          BIGSERIAL NOT NULL UNIQUE PRIMARY KEY,
    hab_usage_id                INTEGER UNIQUE,
    hab_usage_name              VARCHAR(32) UNIQUE
);
""")
f = fromcsv(os.path.join('wkg', args.subdir, 'HabitatUsage.csv'))
f = cutout(f, 'OBJECTID')
f = rename(f, {
    'HabU_ID':                  'hab_usage_id',
    'HabU_Name':                'hab_usage_name',
})
f = convertnumbers(f)
todb(f, connection, 'habitat_usages')

# Element: create, map, and load
#
cursor.execute("""
DROP TABLE IF EXISTS elements CASCADE;
CREATE TABLE elements (
    id                          BIGSERIAL NOT NULL UNIQUE PRIMARY KEY,
    elm_scinam                  VARCHAR(64),
    elm_comnam                  VARCHAR(64),
    group_                      VARCHAR(32) NOT NULL,
    fwa_v1                      INTEGER,
    tax_list                    VARCHAR(32),
    g_rank                      VARCHAR(16),
    s_rank                      VARCHAR(32),
    elm_scin_1                  VARCHAR(64),
    elm_scin_2                  VARCHAR(64),
    elm_scin_3                  VARCHAR(64),
    elm_scin_4                  VARCHAR(64),
    kingdom                     VARCHAR(32),
    phylum                      VARCHAR(32),
    tax_class                   VARCHAR(32),
    tax_order                   VARCHAR(32),
    family                      VARCHAR(32),
    genus                       VARCHAR(32),
    species                     VARCHAR(32),
    subsp_var                   VARCHAR(32),
    kingdom_id                  VARCHAR(5),
    phylum_id                   VARCHAR(5),
    tax_class_i                 VARCHAR(5),
    tax_order_i                 VARCHAR(5),
    family_id                   VARCHAR(5),
    genus_id                    VARCHAR(5),
    species_id                  VARCHAR(5),
    elm_id                      INTEGER NOT NULL UNIQUE,
    other_id                    VARCHAR(5),
    sensitive_fam               VARCHAR(32),
    ns_endemic                  INTEGER,
    safit_endemic               INTEGER,
    other_endemic               INTEGER,
    endemism_comment            TEXT,
    fed_list                    VARCHAR(64),
    state_list                  VARCHAR(64),
    other_list                  VARCHAR(64),
    mgtag_list                  VARCHAR(32),
    listed                      BOOLEAN,
    vulnerable                  BOOLEAN,
    endemic                     BOOLEAN,
    common                      BOOLEAN,
    not_evaluated               BOOLEAN,
    extinct                     BOOLEAN,
    status                      VARCHAR(32)
);
CREATE INDEX ON elements (elm_id);
CREATE INDEX ON elements (group_);
""")
f = fromcsv(os.path.join('wkg', args.subdir, 'Elements.csv'))
f = cutout(f, 'OBJECTID')
f = rename(f, {
    'ELM_SCINAM':             'elm_scinam',
    'ELM_COMNAM':             'elm_comnam',
    'GROUP_':                 'group_',
    'FWA_v1':                 'fwa_v1',
    'TAX_LIST':               'tax_list',
    'G_Rank':                 'g_rank',
    'S_Rank':                 's_rank',
    'ELM_SCIN_1':             'elm_scin_1',
    'ELM_SCIN_2':             'elm_scin_2',
    'ELM_SCIN_3':             'elm_scin_3',
    'ELM_SCIN_4':             'elm_scin_4',
    'Kingdom':                'kingdom',
    'Phylum':                 'phylum',
    'TaxClass':               'tax_class',
    'TaxOrder':               'tax_order',
    'Family':                 'family',
    'Genus':                  'genus',
    'Species':                'species',
    'Subsp_Var':              'subsp_var',
    'Kingdom_ID':             'kingdom_id',
    'Phylum_ID':              'phylum_id',
    'TaxClass_I':             'tax_class_i',
    'TaxOrder_I':             'tax_order_i',
    'Family_ID':              'family_id',
    'Genus_ID':               'genus_id',
    'Species_ID':             'species_id',
    'ELM_ID':                 'elm_id',
    'Other_ID':               'other_id',
    'Sensitive_Fam':          'sensitive_fam',
    'NS_endemic':             'ns_endemic',
    'SAFIT_endemic':          'safit_endemic',
    'Other_endemic':          'other_endemic',
    'Endemism_comment':       'endemism_comment',
    'Fed_list':               'fed_list',
    'State_list':             'state_list',
    'Other_list':             'other_list',
    'MgtAg_list':             'mgtag_list',
    'Listed':                 'listed',
    'Vulnerable':             'vulnerable',
    'Endemic':                'endemic',
    'Common':                 'common',
    'Not_evaluated':          'not_evaluated',
    'Extinct':                'extinct',
    'Status':                 'status',
})
# @todo resolve this hack: Deal with the mussels (multiple rows having elm_id = 81077)
f = selectnotin(f, 'elm_scinam', [
    'Anodonta californiensis',
    'Anodonta dejecta',
    'Anodonta oregonensis',
])
# Attempt to pull the comma-as-thousands separator out.
f = sub(f, (
    'fwa_v1',
    'kingdom_id',
    'phylum_id',
    'tax_class_i',
    'tax_order_i',
    'family_id',
    'genus_id',
    'species_id',
    'elm_id',
    'other_id',
), ',', '')
# Convert the new values to integers; this can handle nulls.
f = convert(f, (
    'fwa_v1',
    'elm_id',
), lambda v: int(v))
# Don't really have to do this, but seems cleaner.
f = convert(f, (
    'listed',
    'vulnerable',
    'endemic',
    'common',
    'not_evaluated',
    'extinct',
), { 0: False, 1 : True })
todb(f, connection, 'elements')

# AU_v_elm: create, map, and load
#
cursor.execute("""
DROP TABLE IF EXISTS au_v_elms CASCADE;
CREATE TABLE au_v_elms (
    id                          BIGSERIAL NOT NULL UNIQUE PRIMARY KEY,
    elm_id                      INTEGER REFERENCES elements (elm_id),
    huc_12                      VARCHAR(12),
    obs_typ_id                  INTEGER REFERENCES observation_types (obs_typ_id),
    source_id                   INTEGER REFERENCES sources (source_id),
    frequency                   DOUBLE PRECISION,
    sum_amount                  DOUBLE PRECISION
);
""")
f = fromcsv(os.path.join('wkg', args.subdir, 'AU_v_Elm_sum.csv'))
f = cutout(f, 'OID_')
f = rename(f, {
    'Elm_ID':                   'elm_id',
    'HUC_12':                   'huc_12',
    'ObsTyp_ID':                'obs_typ_id',
    'Source_ID':                'source_id',
    'FREQUENCY':                'frequency',
    'SUM_Amount':               'sum_amount',
})
f = sub(f, (
    'elm_id',
    'source_id',
    'sum_amount',
), ',', '')
f = convert(f, ('elm_id', 'source_id'), lambda v: int(float(v)))
f = convert(f, ('sum_amount'), lambda v: float(v))
todb(f, connection, 'au_v_elms')

# Persist and be tidy
connection.commit()
cursor.close()
connection.close()


text:
describe Travis::Services::FindRepo do

  let(:user) { FactoryBot.create(:user) }
  let!(:repo)   { FactoryBot.create(:repository_without_last_build, :owner => user, :owner_name => 'travis-ci', :name => 'travis-core') }
  let(:service) { described_class.new(user, params) }

  attr_reader :params

  describe 'run' do
    it 'finds a repository by the given id' do
      @params = { :id => repo.id }
      expect(service.run).to eq(repo)
    end

    it 'finds a repository by the given owner_name and name' do
      @params = { :owner_name => repo.owner_name, :name => repo.name }
      expect(service.run).to eq(repo)
    end

    it 'does not raise if the repository could not be found' do
      @params = { :id => repo.id + 1 }
      expect { service.run }.not_to raise_error
    end
  end

  describe 'updated_at' do
    it 'returns jobs updated_at attribute' do
      @params = { :id => repo.id }
      expect(service.updated_at.to_s).to eq(repo.updated_at.to_s)
    end
  end

  context do
    let(:user) { FactoryBot.create(:user, login: :rkh) }
    let(:org)  { FactoryBot.create(:org, login: :travis) }
    let(:private_repo) { FactoryBot.create(:repository, owner: org, private: true) }
    let(:public_repo)  { FactoryBot.create(:repository, owner: org, private: false) }

    before { Travis.config.host = 'example.com' }

    describe 'public mode' do
      before { Travis.config.public_mode = true }

      describe 'given the current user has a permission on the repository' do
        it 'finds a private repository' do
          FactoryBot.create(:permission, user: user, repository: private_repo)
          service = described_class.new(user, id: private_repo.id)
          expect(service.run).to eq(private_repo)
        end

        it 'finds a public repository' do
          FactoryBot.create(:permission, user: user, repository: public_repo)
          service = described_class.new(user, id: public_repo.id)
          expect(service.run).to eq(public_repo)
        end
      end

      describe 'given the current user does not have a permission on the repository' do
        it 'does not find a private repository' do
          service = described_class.new(user, id: private_repo.id)
          expect(service.run).to be_nil
        end

        it 'finds a public repository' do
          service = described_class.new(user, id: public_repo.id)
          expect(service.run).to eq(public_repo)
        end
      end
    end

    describe 'private mode' do
      before { Travis.config.public_mode = false }

      describe 'given the current user has a permission on the repository' do

        it 'finds a private repository' do
          FactoryBot.create(:permission, user: user, repository: private_repo)
          service = described_class.new(user, id: private_repo.id)
          expect(service.run).to eq(private_repo)
        end

        it 'finds a public repository' do
          FactoryBot.create(:permission, user: user, repository: public_repo)
          service = described_class.new(user, id: public_repo.id)
          expect(service.run).to eq(public_repo)
        end
      end

      describe 'given the current user does not have a permission on the repository' do
        it 'does not find a private repository' do
          service = described_class.new(user, id: private_repo.id)
          expect(service.run).to be_nil
        end

        it 'does not find a public repository'  do
          service = described_class.new(user, id: public_repo.id)
          expect(service.run).to be_nil
        end
      end
    end
  end
end


text:
package org.apache.hadoop.hbase.io.hfile;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;

import java.util.HashMap;
import java.util.Map;

import org.apache.hadoop.hbase.SmallTests;
import org.junit.Test;
import org.junit.experimental.categories.Category;

/**
 * Tests the BlockCacheColumnFamilySummary class
 *
 */
@Category(SmallTests.class)
public class TestBlockCacheColumnFamilySummary {

  /**
   *
   */
  @Test
  public void testEquals()  {

    BlockCacheColumnFamilySummary e1 = new BlockCacheColumnFamilySummary();
    e1.setTable("table1");
    e1.setColumnFamily("cf1");

    BlockCacheColumnFamilySummary e2 = new BlockCacheColumnFamilySummary();
    e2.setTable("table1");
    e2.setColumnFamily("cf1");

    assertEquals("bcse", e1, e2);
  }

  /**
   *
   */
  @Test
  public void testNotEquals() {

    BlockCacheColumnFamilySummary e1 = new BlockCacheColumnFamilySummary();
    e1.setTable("table1");
    e1.setColumnFamily("cf1");

    BlockCacheColumnFamilySummary e2 = new BlockCacheColumnFamilySummary();
    e2.setTable("tablexxxxxx");
    e2.setColumnFamily("cf1");

    assertTrue("bcse", ! e1.equals(e2));
  }

  /**
   *
   */
  @Test
  public void testMapLookup() {

    Map<BlockCacheColumnFamilySummary, BlockCacheColumnFamilySummary> bcs =
      new HashMap<BlockCacheColumnFamilySummary, BlockCacheColumnFamilySummary>();

    BlockCacheColumnFamilySummary e1 = new BlockCacheColumnFamilySummary("table1","cf1");

    BlockCacheColumnFamilySummary lookup = bcs.get(e1);

    if (lookup == null) {
      lookup = BlockCacheColumnFamilySummary.create(e1);
      bcs.put(e1,lookup);
      lookup.incrementBlocks();
      lookup.incrementHeapSize(100L);
    }

    BlockCacheColumnFamilySummary e2 = new BlockCacheColumnFamilySummary("table1","cf1");

    BlockCacheColumnFamilySummary l2 = bcs.get(e2);
    assertEquals("blocks",1,l2.getBlocks());
    assertEquals("heap",100L,l2.getHeapSize());
  }

  /**
   *
   */
  @Test
  public void testMapEntry() {

    Map<BlockCacheColumnFamilySummary, BlockCacheColumnFamilySummary> bcs =
      new HashMap<BlockCacheColumnFamilySummary, BlockCacheColumnFamilySummary>();

    BlockCacheColumnFamilySummary e1 = new BlockCacheColumnFamilySummary("table1","cf1");
    bcs.put(e1, e1);

    BlockCacheColumnFamilySummary e2 = new BlockCacheColumnFamilySummary("table1","cf1");
    bcs.put(e2, e2);

    BlockCacheColumnFamilySummary e3 = new BlockCacheColumnFamilySummary("table1","cf1");
    bcs.put(e3, e3);

    assertEquals("mapSize",1,bcs.size());
  }

  @org.junit.Rule
  public org.apache.hadoop.hbase.ResourceCheckerJUnitRule cu =
    new org.apache.hadoop.hbase.ResourceCheckerJUnitRule();
}


text:
package ff.transform;

public interface TraversalModel {

	public void process(Object value, ModelTransform visitor);

}


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <title>math - xeoengine</title>
    <link rel="stylesheet" href="http://yui.yahooapis.com/3.9.1/build/cssgrids/cssgrids-min.css">
    <link rel="stylesheet" href="../assets/vendor/prettify/prettify-min.css">
    <link rel="stylesheet" href="../assets/css/main.css" id="site_styles">
    <link rel="icon" href="../assets/favicon.ico">

            API Docs for: 0.1.0

APIs

Classes

Modules

                            <input type="search" id="api-filter" placeholder="Type to filter APIs">

AmbientLight

Camera

Canvas

Clip

Clips

ColorBuf

ColorTarget

Component

Configs

DepthBuf

DepthTarget

DirLight

Fresnel

Frustum

GameObject

Geometry

Input

Layer

Lights

Lookat

Material

math

Modes

MorphTargets

Ortho

PBRMaterial

Perspective

PhongMaterial

PointLight

Quaternion

Reflect

Rotate

Scale

Scene

Shader

ShaderParams

Stage

Stats

Task

Tasks

Texture

Transform

Translate

Visibility

XEO

XEO

                    Show:

                        <input type="checkbox" id="api-show-inherited" checked>
                        Inherited

                        <input type="checkbox" id="api-show-protected">
                        Protected

                        <input type="checkbox" id="api-show-private">
                        Private

                        <input type="checkbox" id="api-show-deprecated">
                        Deprecated

math Class

            Defined in: src/core/math/math.js:33

            Module: XEO

This utility object provides math functions that are used within xeoEngine. These functions are also part xeoEngine's
public API and are therefore available for you to use within your application code.

Index

Methods

Item Index

Methods

                                addMat4

                                    static

                                addMat4Scalar

                                    static

                                addScalarMat4

                                    static

                                addVec3

                                    static

                                addVec4

                                    static

                                addVec4Scalar

                                    static

                                addVec4Scalar

                                    static

                                createUUID

                                    static

                                cross3Vec3

                                    static

                                cross3Vec4

                                    static

                                determinantMat4

                                    static

                                diagonalMat4c

                                    static

                                diagonalMat4s

                                    static

                                divScalarVec3

                                    static

                                divScalarVec4

                                    static

                                divVec3

                                    static

                                divVec3Scalar

                                    static

                                divVec4

                                    static

                                divVec4Scalar

                                    static

                                dotVec4

                                    static

                                dotVec4

                                    static

                                dotVec4

                                    static

                                dupMat4

                                    static

                                fmod

                                    static

                                frustumMat4v

                                frustumMat4v

                                identityMat4

                                    static

                                inverseMat4

                                    static

                                isIdentityMat4

                                    static

                                lenVec2

                                    static

                                lenVec3

                                    static

                                lenVec4

                                    static

                                lookAtMat4c

                                lookAtMat4v

                                m4s

                                    static

                                mat3

                                    static

                                mat4

                                    static

                                mat4To3

                                    static

                                mulMat4

                                    static

                                mulMat4Scalar

                                    static

                                mulMat4v4

                                    static

                                mulVec2Scalar

                                    static

                                mulVec3

                                    static

                                mulVec34calar

                                    static

                                mulVec3Scalar

                                    static

                                negateMat4

                                    static

                                negateVec4

                                    static

                                normalizeVec2

                                    static

                                normalizeVec4

                                    static

                                normalizeVec4

                                    static

                                orthoMat4c

                                perspectiveMatrix4v

                                projectVec4

                                rcpVec3

                                    static

                                rotationMat4c

                                    static

                                rotationMat4v

                                    static

                                scalingMat4c

                                    static

                                scalingMat4s

                                    static

                                scalingMat4v

                                    static

                                setMat4ToOnes

                                    static

                                setMat4ToOnes

                                    static

                                setMat4ToZeroes

                                    static

                                subMat4

                                    static

                                subMat4Scalar

                                    static

                                subScalarMat4

                                    static

                                subScalarVec4

                                    static

                                subVec2

                                    static

                                subVec3

                                    static

                                subVec4

                                    static

                                subVec4Scalar

                                    static

                                traceMat4

                                    static

                                transformPoint3

                                transformPoints3

                                transformVec3

                                transformVec4

                                translationMat4

                                    static

                                translationMat4c

                                    static

                                translationMat4s

                                    static

                                transposeMat4

                                    static

                                vec2

                                    static

                                vec3

                                    static

                                vec4

                                    static

Methods

addMat4

        ()

        static

                Defined in
        src/core/math/math.js:835

Adds the given 4x4 matrices together.

addMat4Scalar

        ()

        static

                Defined in
        src/core/math/math.js:863

Adds the given scalar to each element of the given 4x4 matrix.

addScalarMat4

        ()

        static

                Defined in
        src/core/math/math.js:891

Adds the given scalar to each element of the given 4x4 matrix.

addVec3

            (

                        u

                        v

                        [dest]

)

            Array(Number)

        static

                Defined in
        src/core/math/math.js:199

Adds one three-element vector to another.

Parameters:

                        u
                        Array(Number)

First vector

                        v
                        Array(Number)

Second vector

                        [dest]
                        Array(Number)
                        optional

Destination vector

Returns:

                        Array(Number):

dest if specified, u otherwise

addVec4

            (

                        u

                        v

                        [dest]

)

            Array(Number)

        static

                Defined in
        src/core/math/math.js:159

Adds one four-element vector to another.

Parameters:

                        u
                        Array(Number)

First vector

                        v
                        Array(Number)

Second vector

                        [dest]
                        Array(Number)
                        optional

Destination vector

Returns:

                        Array(Number):

dest if specified, u otherwise

addVec4Scalar

            (

                        v

                        s

                        [dest]

)

            Array(Number)

        static

                Defined in
        src/core/math/math.js:179

Adds a scalar value to each element of a four-element vector.

Parameters:

                        v
                        Array(Number)

The vector

                        s
                        Number

The scalar

                        [dest]
                        Array(Number)
                        optional

Destination vector

Returns:

                        Array(Number):

dest if specified, v otherwise

addVec4Scalar

            (

                        v

                        s

                        [dest]

)

            Array(Number)

        static

                Defined in
        src/core/math/math.js:218

Adds a scalar value to each element of a three-element vector.

Parameters:

                        v
                        Array(Number)

The vector

                        s
                        Number

The scalar

                        [dest]
                        Array(Number)
                        optional

Destination vector

Returns:

                        Array(Number):

dest if specified, v otherwise

createUUID

        ()

        static

                Defined in
        src/core/math/math.js:92

Returns a new UUID.

Returns:

string The new UUID

cross3Vec3

            (

                        u

                        v

)

        static

                Defined in
        src/core/math/math.js:559

Returns the cross product of two three-element vectors.

Parameters:

                        u
                        Array(Number)

First vector

                        v
                        Array(Number)

Second vector

Returns:

The cross product

cross3Vec4

            (

                        u

                        v

)

        static

                Defined in
        src/core/math/math.js:541

Returns the cross product of two four-element vectors.

Parameters:

                        u
                        Array(Number)

First vector

                        v
                        Array(Number)

Second vector

Returns:

The cross product

determinantMat4

        ()

        static

                Defined in
        src/core/math/math.js:1114

Returns the determinant of the given 4x4 matrix.

diagonalMat4c

        ()

        static

                Defined in
        src/core/math/math.js:765

Returns a 4x4 matrix with diagonal elements set to the given vector.

diagonalMat4s

        ()

        static

                Defined in
        src/core/math/math.js:774

Returns a 4x4 matrix with diagonal elements set to the given scalar.

divScalarVec3

            (

                        v

                        s

                        dest

)

        static

                Defined in
        src/core/math/math.js:450

Divides a scalar by a three-element vector, returning a new vector.

Parameters:

                        v
                        Object

vec3

                        s
                        Object

scalar

                        dest
                        Object

vec3 - optional destination

Returns:

[] dest if specified, v otherwise

divScalarVec4

            (

                        s

                        v

                        dest

)

        static

                Defined in
        src/core/math/math.js:509

Divides a scalar by a four-element vector, returning a new vector.

Parameters:

                        s
                        Object

scalar

                        v
                        Object

vec4

                        dest
                        Object

vec4 - optional destination

Returns:

[] dest if specified, v otherwise

divVec3

            (

                        u

                        v

                        [dest]

)

            Array(Number)

        static

                Defined in
        src/core/math/math.js:411

Divides one three-element vector by another.

Parameters:

                        u
                        Array(Number)

First vector

                        v
                        Array(Number)

Second vector

                        [dest]
                        Array(Number)
                        optional

Destination vector

Returns:

                        Array(Number):

dest if specified, u otherwise

divVec3Scalar

            (

                        v

                        s

                        dest

)

        static

                Defined in
        src/core/math/math.js:469

Divides a three-element vector by a scalar.

Parameters:

                        v
                        Object

vec3

                        s
                        Object

scalar

                        dest
                        Object

vec3 - optional destination

Returns:

[] dest if specified, v otherwise

divVec4

            (

                        u

                        v

                        [dest]

)

            Array(Number)

        static

                Defined in
        src/core/math/math.js:430

Divides one four-element vector by another.

Parameters:

                        u
                        Array(Number)

First vector

                        v
                        Array(Number)

Second vector

                        [dest]
                        Array(Number)
                        optional

Destination vector

Returns:

                        Array(Number):

dest if specified, u otherwise

divVec4Scalar

            (

                        v

                        s

                        dest

)

        static

                Defined in
        src/core/math/math.js:488

Divides a four-element vector by a scalar.

Parameters:

                        v
                        Object

vec4

                        s
                        Object

scalar

                        dest
                        Object

vec4 - optional destination

Returns:

[] dest if specified, v otherwise

dotVec4

            (

                        u

                        v

)

        static

                Defined in
        src/core/math/math.js:595

Returns the dot product of two three-element vectors.

Parameters:

                        u
                        Array(Number)

First vector

                        v
                        Array(Number)

Second vector

Returns:

The dot product

dotVec4

            (

                        u

                        v

)

        static

                Defined in
        src/core/math/math.js:529

Returns the dot product of two four-element vectors.

Parameters:

                        u
                        Array(Number)

First vector

                        v
                        Array(Number)

Second vector

Returns:

The dot product

dotVec4

            (

                        u

                        v

)

        static

                Defined in
        src/core/math/math.js:607

Returns the dot product of two two-element vectors.

Parameters:

                        u
                        Array(Number)

First vector

                        v
                        Array(Number)

Second vector

Returns:

The dot product

dupMat4

        ()

        static

                Defined in
        src/core/math/math.js:697

Duplicates a 4x4 identity matrix.

fmod

            (

                        a

                        b

)

        static

                Defined in
        src/core/math/math.js:121

Floating-point modulus

Parameters:

                        a
                        Number

                        b
                        Number

Returns:

                        :

frustumMat4v

        ()

                Defined in
        src/core/math/math.js:1453

Returns a 4x4 perspective projection matrix.

frustumMat4v

        ()

                Defined in
        src/core/math/math.js:1492

Returns a 4x4 perspective projection matrix.

identityMat4

        ()

        static

                Defined in
        src/core/math/math.js:783

Returns a 4x4 identity matrix.

inverseMat4

        ()

        static

                Defined in
        src/core/math/math.js:1133

Returns the inverse of the given 4x4 matrix.

isIdentityMat4

        ()

        static

                Defined in
        src/core/math/math.js:792

Tests if the given 4x4 matrix is the identity matrix.

lenVec2

            (

                        v

)

        static

                Defined in
        src/core/math/math.js:640

Returns the length of a two-element vector.

Parameters:

                        v
                        Array(Number)

The vector

Returns:

The length

lenVec3

            (

                        v

)

        static

                Defined in
        src/core/math/math.js:629

Returns the length of a three-element vector.

Parameters:

                        v
                        Array(Number)

The vector

Returns:

The length

lenVec4

            (

                        v

)

        static

                Defined in
        src/core/math/math.js:584

Returns the length of a four-element vector.

Parameters:

                        v
                        Array(Number)

The vector

Returns:

The length

lookAtMat4c

        ()

                Defined in
        src/core/math/math.js:1410

Returns a 4x4 'lookat' viewing transform matrix.

lookAtMat4v

            (

                        pos

                        target

                        up

                        dest

)

            Mat4

                Defined in
        src/core/math/math.js:1315

Returns a 4x4 'lookat' viewing transform matrix.

Parameters:

                        pos
                        Object

vec3 position of the viewer

                        target
                        Object

vec3 point the viewer is looking at

                        up
                        Object

vec3 pointing "up"

                        dest
                        Object

mat4 Optional, mat4 frustum matrix will be written into

Returns:

                        Mat4:

dest if specified, a new mat4 otherwise

m4s

        ()

        static

                Defined in
        src/core/math/math.js:719

Returns a 4x4 matrix with each element set to the given scalar value.

mat3

        ()

            Float64Array

        static

                Defined in
        src/core/math/math.js:72

Returns a new, uninitialized 3x3 matrix.

Returns:

                        Float64Array:

mat4

        ()

            Float64Array

        static

                Defined in
        src/core/math/math.js:82

Returns a new, uninitialized 4x4 matrix.

Returns:

                        Float64Array:

mat4To3

        ()

        static

                Defined in
        src/core/math/math.js:706

Extracts a 3x3 matrix from a 4x4 matrix.

mulMat4

        ()

        static

                Defined in
        src/core/math/math.js:984

Multiplies the two given 4x4 matrix by each other.

mulMat4Scalar

        ()

        static

                Defined in
        src/core/math/math.js:1025

Multiplies each element of the given 4x4 matrix by the given scalar.

mulMat4v4

        ()

        static

                Defined in
        src/core/math/math.js:1053

Multiplies the given 4x4 matrix by the given four-element vector.

mulVec2Scalar

            (

                        v

                        s

                        [dest]

)

            Array(Number)

        static

                Defined in
        src/core/math/math.js:393

Multiplies each element of a two-element vector by a scalar.

Parameters:

                        v
                        Array(Number)

The vector

                        s
                        Number

The scalar

                        [dest]
                        Array(Number)
                        optional

Destination vector

Returns:

                        Array(Number):

dest if specified, v otherwise

mulVec3

            (

                        u

                        v

                        [dest]

)

            Array(Number)

        static

                Defined in
        src/core/math/math.js:334

Multiplies one three-element vector by another.

Parameters:

                        u
                        Array(Number)

First vector

                        v
                        Array(Number)

Second vector

                        [dest]
                        Array(Number)
                        optional

Destination vector

Returns:

                        Array(Number):

dest if specified, u otherwise

mulVec34calar

            (

                        v

                        s

                        [dest]

)

            Array(Number)

        static

                Defined in
        src/core/math/math.js:354

Multiplies each element of a four-element vector by a scalar.

Parameters:

                        v
                        Array(Number)

The vector

                        s
                        Number

The scalar

                        [dest]
                        Array(Number)
                        optional

Destination vector

Returns:

                        Array(Number):

dest if specified, v otherwise

mulVec3Scalar

            (

                        v

                        s

                        [dest]

)

            Array(Number)

        static

                Defined in
        src/core/math/math.js:374

Multiplies each element of a three-element vector by a scalar.

Parameters:

                        v
                        Array(Number)

The vector

                        s
                        Number

The scalar

                        [dest]
                        Array(Number)
                        optional

Destination vector

Returns:

                        Array(Number):

dest if specified, v otherwise

negateMat4

        ()

        static

                Defined in
        src/core/math/math.js:807

Negates the given 4x4 matrix.

negateVec4

            (

                        v

                        [dest]

)

            Array(Number)

        static

                Defined in
        src/core/math/math.js:140

Negates a four-element vector.

Parameters:

                        v
                        Array(Number)

Vector to negate

                        [dest]
                        Array(Number)
                        optional

Destination vector

Returns:

                        Array(Number):

dest if specified, v otherwise

normalizeVec2

        ()

        static

                Defined in
        src/core/math/math.js:687

Normalizes a two-element vector

normalizeVec4

        ()

        static

                Defined in
        src/core/math/math.js:677

Normalizes a three-element vector

normalizeVec4

            (

                        v

                        dest

)

        static

                Defined in
        src/core/math/math.js:663

Normalizes a four-element vector

Parameters:

                        v
                        Object

vec4

                        dest
                        Object

vec4 - optional destination

Returns:

[] dest if specified, v otherwise

orthoMat4c

        ()

                Defined in
        src/core/math/math.js:1418

Returns a 4x4 orthographic projection matrix.

perspectiveMatrix4v

        ()

                Defined in
        src/core/math/math.js:1522

Returns a 4x4 perspective projection matrix.

projectVec4

        ()

                Defined in
        src/core/math/math.js:1618

Transforms a four-element vector by a 4x4 projection matrix.

rcpVec3

            (

                        v

                        dest

)

        static

                Defined in
        src/core/math/math.js:651

Parameters:

                        v
                        Object

vec3

                        dest
                        Object

vec3 - optional destination

Returns:

[] dest if specified, v otherwise

rotationMat4c

        ()

        static

                Defined in
        src/core/math/math.js:1275

Returns 4x4 rotation matrix.

rotationMat4v

        ()

        static

                Defined in
        src/core/math/math.js:1223

Returns 4x4 rotation matrix.

scalingMat4c

        ()

        static

                Defined in
        src/core/math/math.js:1297

Returns 4x4 scale matrix.

scalingMat4s

        ()

        static

                Defined in
        src/core/math/math.js:1306

Returns 4x4 scale matrix.

scalingMat4v

        ()

        static

                Defined in
        src/core/math/math.js:1284

Returns 4x4 scale matrix.

setMat4ToOnes

        ()

        static

                Defined in
        src/core/math/math.js:751

Returns a 4x4 matrix with each element set to 1.0.

setMat4ToOnes

        ()

        static

                Defined in
        src/core/math/math.js:742

Returns a 4x4 matrix with each element set to 1.0.

setMat4ToZeroes

        ()

        static

                Defined in
        src/core/math/math.js:733

Returns a 4x4 matrix with each element set to zero.

subMat4

        ()

        static

                Defined in
        src/core/math/math.js:900

Subtracts the second 4x4 matrix from the first.

subMat4Scalar

        ()

        static

                Defined in
        src/core/math/math.js:928

Subtracts the given scalar from each element of the given 4x4 matrix.

subScalarMat4

        ()

        static

                Defined in
        src/core/math/math.js:956

Subtracts the given scalar from each element of the given 4x4 matrix.

subScalarVec4

            (

                        v

                        s

                        [dest]

)

            Array(Number)

        static

                Defined in
        src/core/math/math.js:314

Sets each element of a 4-element vector to a scalar value minus the value of that element.

Parameters:

                        v
                        Array(Number)

The vector

                        s
                        Number

The scalar

                        [dest]
                        Array(Number)
                        optional

Destination vector

Returns:

                        Array(Number):

dest if specified, v otherwise

subVec2

            (

                        u

                        v

                        [dest]

)

            Array(Number)

        static

                Defined in
        src/core/math/math.js:276

Subtracts one two-element vector from another.

Parameters:

                        u
                        Array(Number)

First vector

                        v
                        Array(Number)

Vector to subtract

                        [dest]
                        Array(Number)
                        optional

Destination vector

Returns:

                        Array(Number):

dest if specified, u otherwise

subVec3

            (

                        u

                        v

                        [dest]

)

            Array(Number)

        static

                Defined in
        src/core/math/math.js:257

Subtracts one three-element vector from another.

Parameters:

                        u
                        Array(Number)

First vector

                        v
                        Array(Number)

Vector to subtract

                        [dest]
                        Array(Number)
                        optional

Destination vector

Returns:

                        Array(Number):

dest if specified, u otherwise

subVec4

            (

                        u

                        v

                        [dest]

)

            Array(Number)

        static

                Defined in
        src/core/math/math.js:237

Subtracts one four-element vector from another.

Parameters:

                        u
                        Array(Number)

First vector

                        v
                        Array(Number)

Vector to subtract

                        [dest]
                        Array(Number)
                        optional

Destination vector

Returns:

                        Array(Number):

dest if specified, u otherwise

subVec4Scalar

            (

                        v

                        s

                        [dest]

)

            Array(Number)

        static

                Defined in
        src/core/math/math.js:294

Subtracts a scalar value from each element of a four-element vector.

Parameters:

                        v
                        Array(Number)

The vector

                        s
                        Number

The scalar

                        [dest]
                        Array(Number)
                        optional

Destination vector

Returns:

                        Array(Number):

dest if specified, v otherwise

traceMat4

        ()

        static

                Defined in
        src/core/math/math.js:1183

Returns the trace of the given 4x4 matrix.

transformPoint3

        ()

                Defined in
        src/core/math/math.js:1542

Transforms a three-element position by a 4x4 matrix.

transformPoints3

        ()

                Defined in
        src/core/math/math.js:1557

Transforms an array of three-element positions by a 4x4 matrix.

transformVec3

        ()

                Defined in
        src/core/math/math.js:1591

Transforms a three-element vector by a 4x4 matrix.

transformVec4

        ()

                Defined in
        src/core/math/math.js:1604

Transforms a four-element vector by a 4x4 matrix.

translationMat4

        ()

        static

                Defined in
        src/core/math/math.js:1192

Returns 4x4 translation matrix.

translationMat4c

        ()

        static

                Defined in
        src/core/math/math.js:1205

Returns 4x4 translation matrix.

translationMat4s

        ()

        static

                Defined in
        src/core/math/math.js:1214

Returns 4x4 translation matrix.

transposeMat4

        ()

        static

                Defined in
        src/core/math/math.js:1068

Transposes the given 4x4 matrix.

vec2

        ()

            Float64Array

        static

                Defined in
        src/core/math/math.js:42

Returns a new, uninitialized two-element vector.

Returns:

                        Float64Array:

vec3

        ()

            Float64Array

        static

                Defined in
        src/core/math/math.js:52

Returns a new, uninitialized three-element vector.

Returns:

                        Float64Array:

vec4

        ()

            Float64Array

        static

                Defined in
        src/core/math/math.js:62

Returns a new, uninitialized four-element vector.

Returns:

                        Float64Array:


text:
package sshdemo.core.mq;

import java.io.Serializable;

public interface MQSender {

    void setPersistent(final boolean persistent);

    /** 发送出去的消息的存活时间。默认为0,即永不超时 */
    void setTimeToLive(long millisecond);

    void sendMessage2Queue(final String dest, final String msg) throws MQException;

    void sendMessage2Queue(final String dest, final String msg, int priority) throws MQException;

    void sendMessage2Queue(final String dest, final Serializable obj) throws MQException;

    void sendMessage2Queue(final String dest, final Serializable obj, int priority) throws MQException;

    void sendMessage2Topic(final String dest, final String msg) throws MQException;

    /** 发送Topic设优先级的话,有可能把前面的message冲掉,容易造成丢数据 */
    @Deprecated
    void sendMessage2Topic(final String dest, final String msg, int priority) throws MQException;

    void sendMessage2Topic(final String dest, final Serializable obj) throws MQException;

    /** 发送Topic设优先级的话,有可能把前面的message冲掉,容易造成丢数据 */
    @Deprecated
    void sendMessage2Topic(final String dest, final Serializable obj, int priority) throws MQException;

    //TODO 支持异步发送
}