text:
sap.ui.define([
	"sap/base/Log",
	"sap/ui/core/mvc/Controller",
	"sap/ui/model/Sorter",
	"sap/ui/model/json/JSONModel",
	"sap/ui/core/format/DateFormat",
	"sap/m/ToolbarSpacer",
	"sap/ui/table/library",
	"sap/ui/thirdparty/jquery"
], function(Log, Controller, Sorter, JSONModel, DateFormat, ToolbarSpacer, library, jQuery) {
	"use strict";

	// shortcut for sap.ui.table.SortOrder
	var SortOrder = library.SortOrder;

	return Controller.extend("sap.ui.table.sample.Sorting.Controller", {

		onInit : function() {
			// set explored app's demo model on this sample
			var oJSONModel = this.initSampleDataModel();
			var oView = this.getView();
			oView.setModel(oJSONModel);

			//Initial sorting
			var oProductNameColumn = oView.byId("name");
			oView.byId("table").sort(oProductNameColumn, SortOrder.Ascending);

			sap.ui.require(["sap/ui/table/sample/TableExampleUtils"], function(TableExampleUtils) {
				var oTb = oView.byId("infobar");
				oTb.addContent(new ToolbarSpacer());
				oTb.addContent(TableExampleUtils.createInfoButton("sap/ui/table/sample/Sorting"));
			}, function(oError){/*ignore*/});
		},

		initSampleDataModel : function() {
			var oModel = new JSONModel();

			var oDateFormat = DateFormat.getDateInstance({source: {pattern: "timestamp"}, pattern: "dd/MM/yyyy"});

			jQuery.ajax(sap.ui.require.toUrl("sap/ui/demo/mock/products.json"), {
				dataType: "json",
				success: function(oData) {
					var aTemp1 = [];
					var aTemp2 = [];
					var aSuppliersData = [];
					var aCategoryData = [];
					for (var i = 0; i < oData.ProductCollection.length; i++) {
						var oProduct = oData.ProductCollection[i];
						if (oProduct.SupplierName && aTemp1.indexOf(oProduct.SupplierName) < 0) {
							aTemp1.push(oProduct.SupplierName);
							aSuppliersData.push({Name: oProduct.SupplierName});
						}
						if (oProduct.Category && aTemp2.indexOf(oProduct.Category) < 0) {
							aTemp2.push(oProduct.Category);
							aCategoryData.push({Name: oProduct.Category});
						}
						oProduct.DeliveryDate = (new Date()).getTime() - (i % 10 * 4 * 24 * 60 * 60 * 1000);
						oProduct.DeliveryDateStr = oDateFormat.format(new Date(oProduct.DeliveryDate));
						oProduct.Heavy = oProduct.WeightMeasure > 1000 ? "true" : "false";
						oProduct.Available = oProduct.Status == "Available" ? true : false;
					}

					oData.Suppliers = aSuppliersData;
					oData.Categories = aCategoryData;

					oModel.setData(oData);
				},
				error: function() {
					Log.error("failed to load json");
				}
			});

			return oModel;
		},

		clearAllSortings : function(oEvent) {
			var oTable = this.byId("table");
			oTable.getBinding().sort(null);
			this._resetSortingState();
		},

		sortCategories : function(oEvent) {
			var oView = this.getView();
			var oTable = oView.byId("table");
			var oCategoriesColumn = oView.byId("categories");

			oTable.sort(oCategoriesColumn, this._bSortColumnDescending ? SortOrder.Descending : SortOrder.Ascending, /*extend existing sorting*/true);
			this._bSortColumnDescending = !this._bSortColumnDescending;
		},

		sortCategoriesAndName : function(oEvent) {
			var oView = this.getView();
			var oTable = oView.byId("table");
			oTable.sort(oView.byId("categories"), SortOrder.Ascending, false);
			oTable.sort(oView.byId("name"), SortOrder.Ascending, true);
		},

		sortDeliveryDate : function(oEvent) {
			var oCurrentColumn = oEvent.getParameter("column");
			var oDeliveryDateColumn = this.byId("deliverydate");
			if (oCurrentColumn != oDeliveryDateColumn) {
				oDeliveryDateColumn.setSorted(false); //No multi-column sorting
				return;
			}

			oEvent.preventDefault();

			var sOrder = oEvent.getParameter("sortOrder");
			var oDateFormat = DateFormat.getDateInstance({pattern: "dd/MM/yyyy"});

			this._resetSortingState(); //No multi-column sorting
			oDeliveryDateColumn.setSorted(true);
			oDeliveryDateColumn.setSortOrder(sOrder);

			var oSorter = new Sorter(oDeliveryDateColumn.getSortProperty(), sOrder === SortOrder.Descending);
			//The date data in the JSON model is string based. For a proper sorting the compare function needs to be customized.
			oSorter.fnCompare = function(a, b) {
				if (b == null) {
					return -1;
				}
				if (a == null) {
					return 1;
				}

				var aa = oDateFormat.parse(a).getTime();
				var bb = oDateFormat.parse(b).getTime();

				if (aa < bb) {
					return -1;
				}
				if (aa > bb) {
					return 1;
				}
				return 0;
			};

			this.byId("table").getBinding().sort(oSorter);
		},

		_resetSortingState : function() {
			var oTable = this.byId("table");
			var aColumns = oTable.getColumns();
			for (var i = 0; i < aColumns.length; i++) {
				aColumns[i].setSorted(false);
			}
		}

	});

});


text:
RSpec.describe Graphiti::Debugger do
  context "when disabled" do
    around do |example|
      old_value = described_class.enabled
      described_class.enabled = false
      example.run
      described_class.enabled = old_value
    end

    describe "#on_render" do
      it "does not add data to chunks Array" do
        expect { described_class.on_render("foo", 0, 100, :foo, {}) }.not_to change(described_class.chunks, :count)
      end
    end

    describe "#on_data" do
      let(:payload) do
        {
          resource: :foo,
          parent: nil,
          params: {},
          results: []
        }
      end

      it "does not add data to chunks Array" do
        expect { described_class.on_data("test", 0, 100, :foo, payload) }.not_to change(described_class.chunks, :count)
      end
    end
  end
end

redpajama_set_name: RedPajamaGithub


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>

	<groupId>org.demo</groupId>
	<artifactId>spring-oauth2-tests-parent</artifactId>
	<version>2.0.3.BUILD-SNAPSHOT</version>
    <packaging>pom</packaging>

    <modules>
      <module>common</module>
      <module>vanilla</module>
      <module>mappings</module>
      <module>form</module>
      <module>jwt</module>
      <module>approval</module>
      <module>jdbc</module>
      <module>multi</module>
      <module>client</module>
      <module>resource</module>
    </modules>

	<name>spring-oauth2-tests</name>
	<description>Demo project for OAuth2 and Spring Boot</description>

	<parent>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter-parent</artifactId>
		<version>1.1.0.RELEASE</version>
	</parent>

    <dependencyManagement>
	<dependencies>
		<dependency>
			<groupId>org.springframework.security.oauth</groupId>
			<artifactId>spring-security-oauth2</artifactId>
			<version>2.0.3.BUILD-SNAPSHOT</version>
			<exclusions>
				<exclusion>
					<artifactId>jackson-mapper-asl</artifactId>
					<groupId>org.codehaus.jackson</groupId>
				</exclusion>
			</exclusions>
		</dependency>
		<dependency>
			<groupId>org.springframework.security</groupId>
			<artifactId>spring-security-jwt</artifactId>
			<version>1.0.1.RELEASE</version>
		</dependency>
	</dependencies>
    </dependencyManagement>

    <build>
      <pluginManagement>
        <plugins>
			<plugin>
				<artifactId>maven-surefire-plugin</artifactId>
				<configuration>
					<includes>
						<include>**/*Tests.java</include>
					</includes>
					<excludes>
						<exclude>**/Abstract*.java</exclude>
					</excludes>
					<systemPropertyVariables>
						<java.security.egd>file:/dev/./urandom</java.security.egd>
						<java.awt.headless>true</java.awt.headless>
					</systemPropertyVariables>
					<argLine>-Xmx1024m -XX:MaxPermSize=256m</argLine>
				</configuration>
			</plugin>
	        <plugin>
		      <!--skip deploy (this is just a test module) -->
		      <artifactId>maven-deploy-plugin</artifactId>
		      <configuration>
		        <skip>true</skip>
		      </configuration>
	        </plugin>
        </plugins>
      </pluginManagement>
    </build>

	<properties>
		<start-class>demo.Application</start-class>
        <java.version>1.7</java.version>
	</properties>

	<repositories>
		<repository>
			<id>spring-snapshots</id>
			<name>Spring Snapshots</name>
			<url>http://repo.spring.io/libs-snapshot-local</url>
			<snapshots>
				<enabled>true</enabled>
			</snapshots>
		</repository>
		<repository>
			<id>spring-milestones</id>
			<name>Spring Milestones</name>
			<url>http://repo.spring.io/libs-milestone-local</url>
			<snapshots>
				<enabled>false</enabled>
			</snapshots>
		</repository>
		<repository>
			<id>spring-staging</id>
			<name>Spring Milestones</name>
			<url>http://repo.spring.io/libs-staging-local</url>
			<snapshots>
				<enabled>false</enabled>
			</snapshots>
		</repository>
	</repositories>
	<pluginRepositories>
		<pluginRepository>
			<id>spring-snapshots</id>
			<name>Spring Snapshots</name>
			<url>http://repo.spring.io/libs-snapshot-local</url>
			<snapshots>
				<enabled>true</enabled>
			</snapshots>
		</pluginRepository>
		<pluginRepository>
			<id>spring-staging</id>
			<name>Spring Milestones</name>
			<url>http://repo.spring.io/libs-staging-local</url>
			<snapshots>
				<enabled>false</enabled>
			</snapshots>
		</pluginRepository>
	</pluginRepositories>
</project>


text:
package org.ranji.lemon.persist.liquid.database.prototype;

import org.ranji.lemon.common.core.persist.prototype.IGenericDao;
import org.ranji.lemon.model.liquid.database.BackupDatabaseInfo;

public interface IBackupDatabaseDao extends IGenericDao<BackupDatabaseInfo, Integer> {

}


text:
x$.ready(function() {
  var libraryFilter = FR.$$('graph-filter');

  if (libraryFilter) {
    libraryFilter.style.display = 'block';
  }

  var primaryData = FR.$$('primary-data-table');
  var monthlyToggle = FR.$$('monthly-toggle');

  if (!primaryData) {
    // this is the index page
    return;
  }

  if (monthlyToggle) {
    var $toToggle = x$('thead th:not(:first-child):not(:last-child), td',
      primaryData);

    monthlyToggle.onclick = function() {
      for (i = 0; i < $toToggle.length; i++) {
        $toToggle[i].style.display =
          ($toToggle[i].style.display == 'table-cell'
            ? 'none' : 'table-cell');
      }

      return false;
    };
  }

  var graph = new FR.Reports.LineGraph.Flot(primaryData);

  var uLists = x$('ul', libraryFilter);

  if (uLists.length > 0) {
    FR.Reports.prepareGraphFilter(uLists[0], graph);
  }

  graph.setTarget(FR.$$('primary-graph-target'));
  graph.render();

  var onsiteShareDl = FR.$$('onsite-share-list');

  var onsiteGraph = new FR.Reports.PieChart(onsiteShareDl);
  onsiteGraph.setTitle('Onsite Share');
  onsiteGraph.setTarget(FR.$$('onsite-share-canvas'));
  onsiteGraph.render();
  onsiteShareDl.style.display = 'none';

  var mobileShareDl = FR.$$('mobile-share-list');

  var mobileGraph = new FR.Reports.PieChart(mobileShareDl);
  mobileGraph.setTitle('Mobile Share');
  mobileGraph.setTarget(FR.$$('mobile-share-canvas'));
  mobileGraph.render();
  mobileShareDl.style.display = 'none';

  FR.$$('primary-graph').style.display = 'block';
});


text:
The `mdm/orientdb-wrapper` module contains the implementation of the `mdm/orientdb-api` and the DAO implementations.

Tasks:

* Merge orientdb-api and orientdb-wrapper contents into `mdm/orientdb` module.
* Replace `****DaoWrapper` interfaces with `****Dao` interfaces. The methods must be moved to the `***Dao` interface within the `mdm/api` module once all graph dependencies within the `Hib***` interfaces have been removed.


text:
import { UniqueIdManager, DnDUtils } from '../../app';
import { EventHandler } from '../../base';
import { LayoutContainerEvents } from '../interfaces';
export class ALayoutContainer extends EventHandler {
    constructor(document, options) {
        super();
        this.parent = null;
        this.id = UniqueIdManager.getInstance().uniqueId(ALayoutContainer.MIME_TYPE);
        this.keyDownListener = (evt) => {
            if (evt.keyCode === 27) {
                // Escape
                this.toggleMaximizedView();
            }
        };
        this.isMaximized = false;
        console.assert(document != null);
        this.options = Object.assign(this.defaultOptions(), options);
        if (this.options.fixed) {
            this.options.fixedLayout = true;
        }
        this.header = document.createElement('header');
        this.header.innerHTML = `
        <button type="button" class="btn-close float-end" ${this.options.fixed ? 'hidden' : ''} aria-label="Close"></button>
        <span>${this.name}</span>`;
        // remove
        this.header.firstElementChild.addEventListener('click', (evt) => {
            evt.preventDefault();
            evt.stopPropagation();
            this.destroy();
        });
        // drag
        if (!this.options.fixedLayout) {
            DnDUtils.getInstance().dragAble(this.header, () => {
                return {
                    effectAllowed: 'move',
                    data: {
                        'text/plain': this.name,
                        [ALayoutContainer.MIME_TYPE]: String(this.id),
                    },
                };
            }, true);
        }
    }
    get parents() {
        const r = [];
        let p = this.parent;
        while (p !== null) {
            r.push(p);
            p = p.parent;
        }
        return r;
    }
    get hideAbleHeader() {
        return false;
    }
    get autoWrapOnDrop() {
        return this.options.autoWrap;
    }
    defaultOptions() {
        return {
            name: 'View',
            fixed: false,
            hideAbleHeader: false,
            autoWrap: false,
            fixedLayout: false,
        };
    }
    destroy() {
        this.fire(ALayoutContainer.withChanged(LayoutContainerEvents.EVENT_DESTROYED), this);
    }
    get name() {
        return this.options.name;
    }
    set name(name) {
        if (this.options.name === name) {
            return;
        }
        this.fire(ALayoutContainer.withChanged(LayoutContainerEvents.EVENT_NAME_CHANGED), this.options.name, (this.options.name = name));
        this.updateName(name);
    }
    updateName(name) {
        this.header.children[1].textContent = name;
    }
    persist() {
        return {
            type: '',
            name: this.name,
            fixed: this.options.fixed,
            autoWrap: this.options.autoWrap,
            fixedLayout: this.options.fixedLayout,
        };
    }
    static restoreOptions(dump) {
        return {
            name: dump.name,
            fixed: dump.fixed,
            autoWrap: dump.autoWrap === true,
            fixedLayout: dump.fixedLayout === true,
        };
    }
    static deriveOptions(node) {
        return {
            name: node.dataset.name || 'View',
            fixed: node.dataset.fixed !== undefined,
            autoWrap: node.dataset.autoWrap !== undefined,
            fixedLayout: node.dataset.fixedLayout !== undefined,
        };
    }
    find(id) {
        return (typeof id === 'number' && this.id === id) || (typeof id === 'function' && id(this)) ? this : null;
    }
    findAll(predicate) {
        return predicate(this) ? [this] : [];
    }
    closest(id) {
        if (!this.parent) {
            return null;
        }
        const { parent } = this;
        if ((typeof id === 'number' && parent.id === id) || (typeof id === 'function' && id(parent))) {
            return parent;
        }
        return parent.closest(id);
    }
    toggleMaximizedView() {
        const sizeToggle = this.header.querySelector('.size-toggle');
        const sizeToggleIcon = sizeToggle.querySelector('i');
        const closeButton = this.header.querySelector('.btn-close');
        this.isMaximized = !this.isMaximized;
        if (this.isMaximized) {
            closeButton.toggleAttribute('hidden');
            sizeToggle.title = 'Restore default size';
            sizeToggleIcon.classList.remove('fa-expand');
            sizeToggleIcon.classList.add('fa-compress');
            this.header.ownerDocument.addEventListener('keydown', this.keyDownListener);
            this.fire(LayoutContainerEvents.EVENT_MAXIMIZE, this);
        }
        else {
            if (!this.options.fixedLayout) {
                closeButton.removeAttribute('hidden');
            }
            sizeToggle.title = 'Expand view';
            sizeToggleIcon.classList.add('fa-expand');
            sizeToggleIcon.classList.remove('fa-compress');
            this.header.ownerDocument.removeEventListener('keydown', this.keyDownListener);
            this.fire(LayoutContainerEvents.EVENT_RESTORE_SIZE, this);
        }
        this.updateTitle();
    }
    updateTitle() {
        this.header.title = `Double click to ${this.isMaximized ? 'restore default size' : 'expand view'}`;
    }
    static withChanged(event) {
        return `${event}${EventHandler.MULTI_EVENT_SEPARATOR}${LayoutContainerEvents.EVENT_LAYOUT_CHANGED}`;
    }
}
ALayoutContainer.MIME_TYPE = 'text/x-phovea-layout-container';
//# sourceMappingURL=ALayoutContainer.js.map


text:
<!DOCTYPE html>

    <title>Typealiases  Reference</title>
    <link rel="stylesheet" type="text/css" href="css/jazzy.css" />
    <link rel="stylesheet" type="text/css" href="css/highlight.css" />
    <meta charset='utf-8'>

 Docs (100% documented)

         Reference

        Typealiases  Reference

            Extensions

                Byte

                UInt8

            Typealiases

                Byte

Typealiases

The following typealiases are available globally.

                    Byte

Type alias from 8 bit integer

Declaration

Swift

public typealias Byte = UInt8

© 2016 . All rights reserved. (Last updated: 2016-09-27)

Generated by jazzy ♪♫ v0.7.2, a Realm project.


text:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>OSCsend</title>
    <link rel="stylesheet" type="text/css" href="csound.css" />
    <meta name="generator" content="DocBook XSL Stylesheets V1.78.1" />
    <link rel="home" href="index.html" title="Manuel de référence canonique de Csound" />
    <link rel="up" href="OpcodesTop.html" title="Opcodes et opérateurs de l'orchestre" />
    <link rel="prev" href="OSClisten.html" title="OSClisten" />
    <link rel="next" href="out32.html" title="out32" />

          OSCsend

          Précédent
          Opcodes et opérateurs de l'orchestre
           Suivant

          OSCsend

OSCsend —
      Envoie des données à d'autres processus au moyen du protocole OSC.

Description

      Utilise le protocole OSC pour envoyer un message à d'autres processus
      d'écoute OSC.

Syntaxe

OSCsend kwhen, ihost, iport, idestination, itype [, xdata1, xdata2, ...]

Initialisation

      ihost -- une chaîne de caractères donnant le nom
      de domaine de l'ordinateur hôte destinataire. Une chaîne vide est
      interprétée comme l'ordinateur courant.

      iport -- le numéro du port utilisé pour la
      communication.

      idestination -- une chaîne de caractères indiquant
      l'adresse de destination. Elle prend la forme d'un nom de fichier avec
      des répertoires. Csound ne fait que transmettre cette chaîne au code
      brut envoyé sans faire d'interprétation.

      itype -- une chaîne de caractères indiquant le
      type des arguments facultatifs qui sont lus au taux-k. La chaîne peut
      contenir les caractères "abcdfilmstAG" pour audio, booléen, caractère,
      double, flottant, entier sur 32 bit, entier sur 64 bit, MIDI, chaîne de
      caractères, repère temporel, tableau de taux-k et f-table.

Exécution

      kwhen -- un message est envoyé chaque fois que cette
      valeur change. Un message sera toujours envoyé au premier appel.

      Les données proviennent des valeurs de taux-k ou de taux-a qui suivent la
      chaîne de formatage. De même que pour le format dans printf, la série de
      caractères détermine l'interprétation des arguments. Noter qu'un
      repère temporel prend deux arguments.

Exemples

      L'exemple montre un simple instrument qui, lorsqu'il est appelé, envoie
      un groupe de trois messages à un ordinateur nommé "xenakis", sur le port
      7770, à lire par un processus dont l'adresse est /foo/bar.

      instr   1
          OSCsend     1, "xenakis.cs.bath.ac.uk",7770, "/foo/bar", "sis", "FOO", 42, "bar"
      endin

      Voir la notice d'OSClisten
      pour un exemple d'envoi/réception en utilisant OSC.

Voir aussi

        OSClisten,
        OSCinit

      Plus d'information sur cet opcode :
      http://www.youtube.com/watch?v=JX1C3TqP_9Y,
      par Andrés Cabrera.

Crédits

            Auteur : John ffitch

            2005

Les types de données a, A et G ont été ajoutés dans la version 6.07 ;
    ils envoient les données via des blobs et ne sont réellement utiles qu'aux
    autres instances de Csound ou à des écouteurs particuliers.

          Précédent

            Niveau supérieur

           Suivant

          OSClisten

            Sommaire

           out32


text:
/*
 * reserved comment block
 * DO NOT REMOVE OR ALTER!
 */
/*
 * Copyright 2003,2004 The Apache Software Foundation.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.sun.org.apache.xerces.internal.xs;

/**
 * This interface represents the Model Group schema component.
 */
public interface XSModelGroup extends XSTerm {
    // Content model compositors
    /**
     * This constant value signifies a sequence operator.
     */
    public static final short COMPOSITOR_SEQUENCE       = 1;
    /**
     * This constant value signifies a choice operator.
     */
    public static final short COMPOSITOR_CHOICE         = 2;
    /**
     * This content model represents a simplified version of the SGML
     * &-Connector and is limited to the top-level of any content model.
     * No element in the all content model may appear more than once.
     */
    public static final short COMPOSITOR_ALL            = 3;

    /**
     * [compositor]: one of all, choice or sequence. The valid constant values
     * are:
     * COMPOSITOR_SEQUENCE, COMPOSITOR_CHOICE, COMPOSITOR_ALL.
     */
    public short getCompositor();

    /**
     *  A list of [particles] if it exists, otherwise an empty
     * XSObjectList.
     */
    public XSObjectList getParticles();

    /**
     * An annotation if it exists, otherwise null. If not null
     * then the first [annotation] from the sequence of annotations.
     */
    public XSAnnotation getAnnotation();

    /**
     * A sequence of [annotations] or an empty XSObjectList.
     */
    public XSObjectList getAnnotations();
}


text:
package com.java110.community.dao;

import com.java110.utils.exception.DAOException;
import com.java110.entity.merchant.BoMerchant;
import com.java110.entity.merchant.BoMerchantAttr;
import com.java110.entity.merchant.Merchant;
import com.java110.entity.merchant.MerchantAttr;

import java.util.List;
import java.util.Map;

/**
 * 车位属性组件内部之间使用,没有给外围系统提供服务能力
 * 车位属性服务接口类,要求全部以字符串传输,方便微服务化
 * 新建客户,修改客户,删除客户,查询客户等功能
 *
 * Created by wuxw on 2016/12/27.
 */
public interface IParkingSpaceAttrServiceDao {

    /**
     * 保存 车位属性信息
     * @param businessParkingSpaceAttrInfo 车位属性信息 封装
     * @throws DAOException 操作数据库异常
     */
    void saveBusinessParkingSpaceAttrInfo(Map businessParkingSpaceAttrInfo) throws DAOException;

    /**
     * 查询车位属性信息(business过程)
     * 根据bId 查询车位属性信息
     * @param info bId 信息
     * @return 车位属性信息
     * @throws DAOException DAO异常
     */
    List<Map> getBusinessParkingSpaceAttrInfo(Map info) throws DAOException;

    /**
     * 保存 车位属性信息 Business数据到 Instance中
     * @param info
     * @throws DAOException DAO异常
     */
    void saveParkingSpaceAttrInfoInstance(Map info) throws DAOException;

    /**
     * 查询车位属性信息(instance过程)
     * 根据bId 查询车位属性信息
     * @param info bId 信息
     * @return 车位属性信息
     * @throws DAOException DAO异常
     */
    List<Map> getParkingSpaceAttrInfo(Map info) throws DAOException;

    /**
     * 修改车位属性信息
     * @param info 修改信息
     * @throws DAOException DAO异常
     */
    void updateParkingSpaceAttrInfoInstance(Map info) throws DAOException;

    /**
     * 查询车位属性总数
     *
     * @param info 车位属性信息
     * @return 车位属性数量
     */
    int queryParkingSpaceAttrsCount(Map info);

    int saveParkingSpaceAttr(Map beanCovertMap);
}


text:
<?php
declare(strict_types=1);

namespace Twilio\Http;

final class File {
    /**
     * @var string
     */
    private $fileName;

    /**
     * @var resource|string|mixed|null
     */
    private $contents;

    /**
     * @var string|null
     */
    private $contentType;

    /**
     * @param string $fileName full file path or file name for passed $contents
     * @param string|resource|mixed|null $contents
     * @param string $contentType
     */
    public function __construct(string $fileName, $contents = null, string $contentType = null) {
        $this->fileName = $fileName;
        $this->contents = $contents;
        $this->contentType = $contentType;
    }

    /**
     * @return resource|string|mixed|null
     */
    public function getContents() {
        return $this->contents;
    }

    public function getFileName(): string {
        return $this->fileName;
    }

    public function getContentType(): ?string {
        return $this->contentType;
    }
}


text:
#pragma once

#include <QObject>
#include <QtTest/QtTest>
#include <QDir>

class medPluginGeneratorTest : public QObject
{
    Q_OBJECT
private slots:
    void initTestCase();
    void cleanupTestCase();

    void testCompile_data();
    void testCompile();

private:
    QDir _tmpPath;
};


text:
'use strict'

var utilsLib = require('./utils')
var fs = require('fs')

function metaNode (data) {
  if (!data.meta) {
    return false
  }

  if (!data.meta.generated_at) {
    return false
  }

  if (data.meta.total_events > -1 || data.meta.total_repos > -1) {
    return true
  }

  return false
}

function hasEachNode (data, type) {
  var noNodes = 0
  var compulsoryNodes = []

  if (type === 'events') {
    compulsoryNodes = ['id', 'name', 'location', 'url', 'group_url', 'formatted_time', 'start_time', 'end_time']
  } else if (type === 'repos') {
    compulsoryNodes = ['name', 'html_url', 'pushed_at', 'updated_at', 'stargazers_count', 'owner']
  }

  compulsoryNodes.forEach(function (eachNode) {
    if (!data[ eachNode ]) {
      console.log(eachNode + ' node not found for ' + type + ' on ' + data.formatted_time)
      noNodes++
    }
  })

  return !noNodes
}

function hasNodes (data, type) {
  if (!data[ type ]) {
    console.log('here!')
    return false
  }

  if (data[ type ].length < 1) {
    return true
  }

  var faultCount = 0

  data[ type ].forEach(function (ev) {
    if (!hasEachNode(ev, type)) {
      console.log(ev.name, type)
      faultCount++
    }
  })

  return !faultCount
}

function checkTotal (data, type) {
  return data.meta[ 'total_' + type ] === data[type].length
}

function hasNoSingleDataPerDay (type) {
  var currDay
  var prevDay
  var start = type === 'events' ? 32 : 30
  var hasDuplicate = 0

  utilsLib.listFilePaths(type).forEach(function (file) {
    currDay = file.substr(start, 10)

    if (prevDay === currDay) {
      console.log(file + ' has duplicate data for this day - deleted file!')
      fs.unlink(file)
      hasDuplicate++
    }

    prevDay = currDay
  })

  return hasDuplicate > 0
}

function check (type) {
  var failedCheck = 0

  if (hasNoSingleDataPerDay(type)) {
    failedCheck++
  }

  utilsLib.listFilePaths(type).forEach(function (file) {
    var data = require('.' + file)

    if (!metaNode(data)) {
      failedCheck++
      console.log(file + ' does not have the right meta node')
    }

    if (!checkTotal(data, type)) {
      failedCheck++
      console.log(file + ' does not have the correct total number of ' + type)
    }

    if (!hasNodes(data, type)) {
      failedCheck++
      console.log(file + ' does not have the right data node')
    }
  })

  if (failedCheck === 0) {
    console.log('All ' + type + ' data is in the correct condition!')
  } else {
    console.log('There was a total of ' + failedCheck + ' errors in the data files.')
  }
}

check('events')
check('repos')

exports.check = check
exports.metaNode = metaNode
exports.hasNodes = hasNodes


text:
#ifndef _COMMANDS_TYPES_H_
#define _COMMANDS_TYPES_H_

#include "t_basicdefinitions.h"
#include "LCDriver.h"
#include <string>

/// <summary>
/// Description of ME device.
/// </summary>
/// <param name="szPath">Absolute device path pointing at the described device.</param>
/// <param name="iPathSize">Size of pchPath.</param>
/// <param name="szType">Type of device.</param>
/// <param name="iTypeSize">Size of pchType.</param>
/// <param name="uiBlockSize">Size of the smallest addressable unit in the device [Byte].</param>
/// <param name="uiStart">Offset [Byte] of the start of the device relative its parent's
/// offset 0 with granularity of its parent's block size.</param>
/// <param name="uiLength">Length of the device [Byte].</param>
struct TDevicesInternal {
    std::string Path;
    std::string Type;
    uint64 uiBlockSize;
    uint64 uiStart;
    uint64 uiLength;

    operator TDevices() const {
        TDevices tDevice = {
            Path.c_str(),
            Path.length(),
            Type.c_str(),
            Type.length(),
            uiBlockSize,
            uiStart,
            uiLength
        };

        return tDevice;
    }
};

struct TEntriesInternal {
    std::string Name;
    uint64 uiSize;
    int iMode;
    int iTime;

    operator TEntries() const {
        TEntries tEntry = {
            Name.c_str(),
            Name.length(),
            uiSize,
            iMode,
            iTime
        };

        return tEntry;
    }
};

#endif // _COMMANDS_TYPES_H_


text:
package main

import (
	"github.com/nsf/termbox-go"
	"os"
	"log"
	"time"
)

func main() {
	file, err := os.OpenFile("gorogue.log", os.O_TRUNC|os.O_CREATE|os.O_WRONLY, 0666)
	if err != nil {
		log.Fatalln("Failed to open log file", os.Stderr, ":", err)
	}
	defer file.Close()
	logger := log.New(file, "logger: ", log.Lshortfile)
	logger.Printf("%s: Gorogue started!", time.Now())

	err = termbox.Init()
	if err != nil {
		panic(err)
	}
	termbox.SetOutputMode(termbox.Output216)
	defer termbox.Close()
	termbox.HideCursor()
	termbox.Clear(termbox.ColorWhite, termbox.ColorBlack)
	game := NewGame(logger)
	game.Run()

}


text:
package eventstore
package akka

import scala.concurrent.duration._
import com.typesafe.config.ConfigFactory
import org.specs2.mutable.Specification

class SettingsSpec extends Specification {

  "Settings" should {

    "defaults should be equal to loaded from reference.conf" in {
      Settings() mustEqual Settings.Default
    }

    "use deprecated 'operation-timeout' prior new 'operation.timeout' for backward compatibility" in {
      val config = ConfigFactory.parseString(
        """
          |eventstore {
          |   operation-timeout=1m
          |   operation.timeout=1s
          |}
        """.stripMargin
      ).withFallback(ConfigFactory.load())
      Settings(config).operationTimeout mustEqual 1.minute
    }

    "throw exception if reconnectionDelayMin <= Zero" in {
      Settings(reconnectionDelayMin = Duration.Zero) must throwAn[IllegalArgumentException]
    }

    "throw exception if reconnectionDelayMax <= Zero" in {
      Settings(reconnectionDelayMax = Duration.Zero) must throwAn[IllegalArgumentException]
    }

    "throw exception if operationTimeout <= Zero" in {
      Settings(operationTimeout = Duration.Zero) must throwAn[IllegalArgumentException]
    }

    "throw exception if serializationParallelism <= 0" in {
      Settings(serializationParallelism = 0) must throwAn[IllegalArgumentException]
    }
  }
}


text:
import ipaddress
import socket

from celery import Celery
from flask_socketio import SocketIO

import celeryconfig

app = Celery('tasks')
app.config_from_object(celeryconfig)
socketio = SocketIO(message_queue=celeryconfig.BROKER_URL)

def check_ipv6_tcp(host, port, timeout=1):
    info = socket.getaddrinfo(host, port, proto=socket.IPPROTO_TCP)[0][4]
    conn = socket.socket(socket.AF_INET6, socket.SOCK_STREAM)
    conn.settimeout(timeout)
    try:
        conn.connect(info)
    except OSError:
        return {'host': host, 'port': port, 'status': 'CLOSE'}
    finally:
        conn.close()
    return {'host': host, 'port': port, 'status': 'OPEN'}

def check_ipv4_tcp(host, port, timeout=1):
    conn = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    conn.settimeout(timeout)
    try:
        conn.connect((host, port))
    except OSError:
        return {'host': host, 'port': port, 'status': 'CLOSE'}
    finally:
        conn.close()
    return {'host': host, 'port': port, 'status': 'OPEN'}

@app.task()
def routing(host, port, timeout=1):
    try:
        ip = ipaddress.ip_address(host)
        if ip.version == 4:
            response = check_ipv4_tcp(host, port, timeout)
        elif ip.version == 6:
            response = check_ipv6_tcp(host, port, timeout)
        else:
            response = {'host': host, 'port': port, 'status': 'Unknown Error'}
    except ValueError:
        response = {'host': host, 'port': port, 'status': 'Invalid IP'}
    socketio.emit('monitoring', response)
    return response


text:
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.0-b52-fcs
// See http://java.sun.com/xml/jaxb
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2013.12.20 at 12:48:21 PM GMT
//

package weka.core.pmml.jaxbbindings;

import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;

/**
 *
Java class for DataField element declaration.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *
 *

 * <element name="DataField">
 *   <complexType>
 *     <complexContent>
 *       <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *         <sequence>
 *           <element ref="{http://www.dmg.org/PMML-4_1}Extension" maxOccurs="unbounded" minOccurs="0"/>
 *           <sequence>
 *             <element ref="{http://www.dmg.org/PMML-4_1}Interval" maxOccurs="unbounded" minOccurs="0"/>
 *             <element ref="{http://www.dmg.org/PMML-4_1}Value" maxOccurs="unbounded" minOccurs="0"/>
 *           </sequence>
 *         </sequence>
 *         <attribute name="dataType" use="required" type="{http://www.dmg.org/PMML-4_1}DATATYPE" />
 *         <attribute name="displayName" type="{http://www.w3.org/2001/XMLSchema}string" />
 *         <attribute name="isCyclic" default="0">
 *           <simpleType>
 *             <restriction base="{http://www.w3.org/2001/XMLSchema}string">
 *               <enumeration value="0"/>
 *               <enumeration value="1"/>
 *             </restriction>
 *           </simpleType>
 *         </attribute>
 *         <attribute name="name" use="required" type="{http://www.dmg.org/PMML-4_1}FIELD-NAME" />
 *         <attribute name="optype" use="required" type="{http://www.dmg.org/PMML-4_1}OPTYPE" />
 *         <attribute name="taxonomy" type="{http://www.w3.org/2001/XMLSchema}string" />
 *       </restriction>
 *     </complexContent>
 *   </complexType>
 * </element>
 *

 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
    "extension",
    "interval",
    "value"
})
@XmlRootElement(name = "DataField")
public class DataField {

    @XmlElement(name = "Extension", namespace = "http://www.dmg.org/PMML-4_1", required = true)
    protected List<Extension> extension;
    @XmlElement(name = "Interval", namespace = "http://www.dmg.org/PMML-4_1", required = true)
    protected List<Interval> interval;
    @XmlElement(name = "Value", namespace = "http://www.dmg.org/PMML-4_1", required = true)
    protected List<Value> value;
    @XmlAttribute(required = true)
    protected DATATYPE dataType;
    @XmlAttribute
    protected String displayName;
    @XmlAttribute
    protected String isCyclic;
    @XmlAttribute(required = true)
    protected String name;
    @XmlAttribute(required = true)
    protected OPTYPE optype;
    @XmlAttribute
    protected String taxonomy;

    public DataField() {}

    public DataField(String name, OPTYPE optype) {
    	this.name = name;
    	this.optype = optype;
    }

    /**
     * Gets the value of the extension property.
     *
     *

     * This accessor method returns a reference to the live list,
     * not a snapshot. Therefore any modification you make to the
     * returned list will be present inside the JAXB object.
     * This is why there is not a set method for the extension property.
     *
     *

     * For example, to add a new item, do as follows:
     *

     *    getExtension().add(newItem);
     *

     *
     *
     *

     * Objects of the following type(s) are allowed in the list
     * {@link Extension }
     *
     *
     */
    public List<Extension> getExtension() {
        if (extension == null) {
            extension = new ArrayList<Extension>();
        }
        return this.extension;
    }

    /**
     * Gets the value of the interval property.
     *
     *

     * This accessor method returns a reference to the live list,
     * not a snapshot. Therefore any modification you make to the
     * returned list will be present inside the JAXB object.
     * This is why there is not a set method for the interval property.
     *
     *

     * For example, to add a new item, do as follows:
     *

     *    getInterval().add(newItem);
     *

     *
     *
     *

     * Objects of the following type(s) are allowed in the list
     * {@link Interval }
     *
     *
     */
    public List<Interval> getInterval() {
        if (interval == null) {
            interval = new ArrayList<Interval>();
        }
        return this.interval;
    }

    /**
     * Gets the value of the value property.
     *
     *

     * This accessor method returns a reference to the live list,
     * not a snapshot. Therefore any modification you make to the
     * returned list will be present inside the JAXB object.
     * This is why there is not a set method for the value property.
     *
     *

     * For example, to add a new item, do as follows:
     *

     *    getValue().add(newItem);
     *

     *
     *
     *

     * Objects of the following type(s) are allowed in the list
     * {@link Value }
     *
     */
    public List<Value> getValues() {
        if (value == null) {
            value = new ArrayList<Value>();
        }
        return this.value;
    }

    public void addValue(Value v) {
    	if (value == null) {
            value = new ArrayList<Value>();
        }
    	value.add(v);
    }

    /**
     * Gets the value of the dataType property.
     *
     * @return
     *     possible object is
     *     {@link DATATYPE }
     *
     */
    public DATATYPE getDataType() {
        return dataType;
    }

    /**
     * Sets the value of the dataType property.
     *
     * @param value
     *     allowed object is
     *     {@link DATATYPE }
     *
     */
    public void setDataType(DATATYPE value) {
        this.dataType = value;
    }

    /**
     * Gets the value of the displayName property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getDisplayName() {
        return displayName;
    }

    /**
     * Sets the value of the displayName property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setDisplayName(String value) {
        this.displayName = value;
    }

    /**
     * Gets the value of the isCyclic property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getIsCyclic() {
        if (isCyclic == null) {
            return "0";
        } else {
            return isCyclic;
        }
    }

    /**
     * Sets the value of the isCyclic property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setIsCyclic(String value) {
        this.isCyclic = value;
    }

    /**
     * Gets the value of the name property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getName() {
        return name;
    }

    /**
     * Sets the value of the name property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setName(String value) {
        this.name = value;
    }

    /**
     * Gets the value of the optype property.
     *
     * @return
     *     possible object is
     *     {@link OPTYPE }
     *
     */
    public OPTYPE getOptype() {
        return optype;
    }

    /**
     * Sets the value of the optype property.
     *
     * @param value
     *     allowed object is
     *     {@link OPTYPE }
     *
     */
    public void setOptype(OPTYPE value) {
        this.optype = value;
    }

    /**
     * Gets the value of the taxonomy property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getTaxonomy() {
        return taxonomy;
    }

    /**
     * Sets the value of the taxonomy property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setTaxonomy(String value) {
        this.taxonomy = value;
    }

}


text:
from django.db import migrations, models
import django.db.models.deletion

class Migration(migrations.Migration):

    dependencies = [
        ('contactnetwork', '0002_auto_20180117_1457'),
    ]

    operations = [
        migrations.CreateModel(
            name='Distance',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('distance', models.FloatField()),
            ],
            options={
                'db_table': 'distance',
            },
        ),
        migrations.RemoveField(
            model_name='aromaticinteraction',
            name='interaction_ptr',
        ),
        migrations.RemoveField(
            model_name='facetoedgeinteraction',
            name='aromaticinteraction_ptr',
        ),
        migrations.RemoveField(
            model_name='facetofaceinteraction',
            name='aromaticinteraction_ptr',
        ),
        migrations.RemoveField(
            model_name='hydrophobicinteraction',
            name='interaction_ptr',
        ),
        migrations.RemoveField(
            model_name='picationinteraction',
            name='aromaticinteraction_ptr',
        ),
        migrations.RemoveField(
            model_name='polarbackbonesidechaininteraction',
            name='polarinteraction_ptr',
        ),
        migrations.RemoveField(
            model_name='polarinteraction',
            name='interaction_ptr',
        ),
        migrations.RemoveField(
            model_name='polarsidechainsidechaininteraction',
            name='polarinteraction_ptr',
        ),
        migrations.RemoveField(
            model_name='vanderwaalsinteraction',
            name='interaction_ptr',
        ),
        migrations.RemoveField(
            model_name='interactingresiduepair',
            name='polymorphic_ctype',
        ),
        migrations.RemoveField(
            model_name='interaction',
            name='polymorphic_ctype',
        ),
        migrations.AddField(
            model_name='interaction',
            name='interaction_type',
            field=models.CharField(default='', max_length=100),
            preserve_default=False,
        ),
        migrations.AddField(
            model_name='interaction',
            name='specific_type',
            field=models.CharField(max_length=100, null=True),
        ),
        migrations.DeleteModel(
            name='AromaticInteraction',
        ),
        migrations.DeleteModel(
            name='FaceToEdgeInteraction',
        ),
        migrations.DeleteModel(
            name='FaceToFaceInteraction',
        ),
        migrations.DeleteModel(
            name='HydrophobicInteraction',
        ),
        migrations.DeleteModel(
            name='PiCationInteraction',
        ),
        migrations.DeleteModel(
            name='PolarBackboneSidechainInteraction',
        ),
        migrations.DeleteModel(
            name='PolarInteraction',
        ),
        migrations.DeleteModel(
            name='PolarSidechainSidechainInteraction',
        ),
        migrations.DeleteModel(
            name='VanDerWaalsInteraction',
        ),
        migrations.AddField(
            model_name='distance',
            name='interacting_pair',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='contactnetwork.InteractingResiduePair'),
        ),
    ]


text:
<!doctype html>

    <meta charset="utf-8">
    <title>Flux Tests</title>
    <link rel="stylesheet" href="../../node_modules/mocha/mocha.css" />


text:
package messenger

import (
	"fmt"
	"strings"

	"github.com/gogo/protobuf/proto"
	"github.com/mesos/mesos-go/api/v0/upid"
)

// Message defines the type that passes in the Messenger.
type Message struct {
	UPID         *upid.UPID
	Name         string
	ProtoMessage proto.Message
	Bytes        []byte
}

// RequestURI returns the request URI of the message.
func (m *Message) RequestURI() string {
	if m.isV1API() {
		return fmt.Sprintf("/api/v1/%s", m.Name)
	}

	return fmt.Sprintf("/%s/%s", m.UPID.ID, m.Name)
}

func (m *Message) isV1API() bool {
	return !strings.HasPrefix(m.Name, "mesos.internal")
}

// NOTE: This should not fail or panic.
func extractNameFromRequestURI(requestURI string) string {
	return strings.Split(requestURI, "/")[2]
}


text:
package com.braintreegateway;

import com.braintreegateway.exceptions.NotFoundException;
import com.braintreegateway.util.Http;
import com.braintreegateway.util.NodeWrapper;
import java.util.ArrayList;
import java.util.List;

/**
 * Provides methods to create, delete, find, and update {@link Customer}
 * objects. This class does not need to be instantiated directly. Instead, use
 * {@link BraintreeGateway#customer()} to get an instance of this class:
 *
 *

 * BraintreeGateway gateway = new BraintreeGateway(...);
 * gateway.customer().create(...)
 *

 *
 * For more detailed information on {@link Customer Customers}, see https://developer.paypal.com/braintree/docs/reference/response/customer/java
 */
public class CustomerGateway {
    private Configuration configuration;
    private Http http;

    public CustomerGateway(Http http, Configuration configuration) {
        this.configuration = configuration;
        this.http = http;
    }

    /**
     * Finds all Customers and returns a {@link ResourceCollection}.
     *
     * @return a {@link ResourceCollection}.
     */
    public ResourceCollection<Customer> all() {
        NodeWrapper response = http.post(configuration.getMerchantPath() + "/customers/advanced_search_ids");
        return new ResourceCollection<Customer>(new CustomerPager(this, new CustomerSearchRequest()), response);
    }

    List<Customer> fetchCustomers(CustomerSearchRequest query, List<String> ids) {
        query.ids().in(ids);
        NodeWrapper response = http.post(configuration.getMerchantPath() + "/customers/advanced_search", query);

        List<Customer> items = new ArrayList<Customer>();
        for (NodeWrapper node : response.findAll("customer")) {
            items.add(new Customer(node));
        }

        return items;
    }

    /**
     * Creates a {@link Customer}.
     *
     * @param request
     *            the request.
     * @return a {@link Result}.
     */
    public Result<Customer> create(CustomerRequest request) {
        NodeWrapper node = http.post(configuration.getMerchantPath() + "/customers", request);
        return new Result<Customer>(node, Customer.class);
    }

    /**
     * Deletes a {@link Customer} by id.
     *
     * @param id
     *            the id of the {@link Customer}.
     * @return a {@link Result}.
     */
    public Result<Customer> delete(String id) {
        http.delete(configuration.getMerchantPath() + "/customers/" + id);
        return new Result<Customer>();
    }

    /**
     * Finds a {@link Customer} by id.
     *
     * @param id
     *            the id of the {@link Customer}.
     * @return the {@link Customer} or raises a
     *         {@link com.braintreegateway.exceptions.NotFoundException}.
     */
    public Customer find(String id) {
        if (id == null || id.trim().equals("")) {
            throw new NotFoundException();
        }

        return new Customer(http.get(configuration.getMerchantPath() + "/customers/" + id));
    }

    /**
     * Finds a {@link Customer} by id.
     *
     * @param id
     *            the id of the {@link Customer}.
     * @param associationFilterId
     *            the id of the association filter to use.
     * @return the {@link Customer} or raises a
     *         {@link com.braintreegateway.exceptions.NotFoundException}.
     */
    public Customer find(String id, String associationFilterId) {
        if (id == null || id.trim().equals("")) {
            throw new NotFoundException();
        }

        if (associationFilterId == null || associationFilterId.isEmpty()) {
            throw new NotFoundException();
        }

        String queryParams = "?association_filter_id=" + associationFilterId;
        return new Customer(http.get(configuration.getMerchantPath() + "/customers/" + id + queryParams));
    }

    /**
     * Finds all Transactions that match the query and returns a {@link ResourceCollection}.
     * See: https://developer.paypal.com/braintree/docs/reference/request/transaction/search/java
     * @param query the request query to use for search
     * @return a {@link ResourceCollection}.
     */
    public ResourceCollection<Customer> search(CustomerSearchRequest query) {
        NodeWrapper node = http.post(configuration.getMerchantPath() + "/customers/advanced_search_ids", query);
        return new ResourceCollection<Customer>(new CustomerPager(this, query), node);
    }

    /**
     * Updates a {@link Customer}.
     *
     * @param id
     *            the id of the {@link Customer}.
     * @param request
     *            the request.
     * @return a {@link Result}.
     */
    public Result<Customer> update(String id, CustomerRequest request) {
        NodeWrapper node = http.put(configuration.getMerchantPath() + "/customers/" + id, request);
        return new Result<Customer>(node, Customer.class);
    }

}


text:
import { loadFixtures, unloadFixtures } from 'util/fixtures';
import DataLoaders from '../index';
import fixtures from '../__fixtures__/contributionsLoaderFactory';
import MockDate from 'mockdate';

const loader = new DataLoaders();

describe('contributionsLoaderFactory', () => {
  beforeAll(() => {
    MockDate.set(1609430400000); // 2021-01-01T00:00:00.000+08:00
    return loadFixtures(fixtures);
  });

  it('should load last year of data for given userId', async () => {
    const res = await loader.contributionsLoader.load({
      userId: 'user1',
    });
    expect(res).toMatchSnapshot();
  });

  it('should load data for the date range specified', async () => {
    expect(
      await loader.contributionsLoader.load({
        userId: 'user1',
        dateRange: {
          gte: '2020-02-01T00:00:00.000Z',
          lte: '2020-03-01T00:00:00.000Z',
        },
      })
    ).toMatchSnapshot();
  });

  it('should throw error if userId is not present', async () => {
    let error;
    try {
      await loader.contributionsLoader.load({});
    } catch (e) {
      error = e.message;
    }
    expect(error).toBe('userId is required');
  });

  afterAll(() => {
    MockDate.reset();
    return unloadFixtures(fixtures);
  });
});


text:
import os, subprocess, time

def submitCondorJob(condorFile):
    output = subprocess.Popen(["condor_submit","-verbose",condorFile],stdout=subprocess.PIPE).communicate()[0]

    # Get the process ID for this job so we can monitor it
    s = output.find('** Proc ')+8
    procID = output[s:output.find(':\n',s)]
    return procID

# Detect the current generation
def getCurrentGen(resultsDir, CMAES_exp=False):
    if CMAES_exp:
        return getCurrentCMAESGen(resultsDir)
    else:
        currentGeneration = -1
        for f in os.listdir(resultsDir):
            if f.startswith('generation') and 'tmp' not in f and 'bak' not in f:
                genNumber = int(f[len('generation'):-len('.ser.gz')])
                currentGeneration = max(currentGeneration, genNumber)
        return currentGeneration

# Detect the current generation CMA-ES is on
def getCurrentCMAESGen(resultsDir):
    currentGeneration = -1
    for f in os.listdir(resultsDir):
        if f.startswith('paramswritten_'):
            genNumber = int(f[len('paramswritten_'):-len('.txt')])
            currentGeneration = max(currentGeneration, genNumber)
    return currentGeneration

def getPIDStatus(pid, condor_q):
    if not condor_q:
        return None

    # Returns the status of a given pid in the condor_q output
    for line in condor_q.split('\n'):
        line = line.split()
        if len(line) >= 6 and line[0] == str(pid):
            return line[5]
    return None

# Gets the output of the condor_q command
def condor_q():
    out = subprocess.Popen(["condor_q","mhauskn"],stdout=subprocess.PIPE).communicate()[0]
    if not out or out.find('Failed to fetch ads') >= 0:
        return None
    return out

def condorKillPID(pid):
    # Kills a pid on condor
    return subprocess.Popen(["condor_rm",str(pid)],stdout=subprocess.PIPE).communicate()[0]

# Starts the generator running - either CMAES or normal generator
def startGenerator(generatorNum, executable, resultsDir, dataFile,
                   numIndividuals, numGenerations, seed, rom):
    if dataFile.endswith('AtariCMAExperiment.dat'):
        # First create the initial generation
        firstGenPath = os.path.join(resultsDir,"generation0.ser.gz")
        if not os.path.exists(firstGenPath):
            subprocess.check_call(["./" + executable,
                                   "-I", dataFile,
                                   "-R", str(seed),
                                   "-O", firstGenPath,
                                   "-G", rom])
        # Then start CMA-ES
        return startCMAESGenerator(generatorNum, executable, resultsDir, dataFile,
                   numIndividuals, numGenerations, seed, rom)
    else:
        return startNormalGenerator(generatorNum, executable, resultsDir, dataFile,
                   numIndividuals, numGenerations, seed, rom)

# Starts a worker running - either CMAES or normal worker
def startWorker(workerNum, executable, resultsDir, dataFile, numIndividuals,
                numGenerations, seed, rom):
    if dataFile.endswith('AtariCMAExperiment.dat'):
        return startCMAESWorker(workerNum, executable, resultsDir, dataFile, numIndividuals,
                numGenerations, seed, rom)
    else:
        return startNormalWorker(workerNum, executable, resultsDir, dataFile, numIndividuals,
                numGenerations, seed, rom)

# Submits a condor job which starts a worker running
def startNormalWorker(workerNum, executable, resultsDir, dataFile, numIndividuals, numGenerations, seed, rom):
    cOutFile = os.path.join(resultsDir,"worker" + str(workerNum) + ".out")
    cErrFile = os.path.join(resultsDir,"worker" + str(workerNum) + ".err")
    cLogFile = os.path.join(resultsDir,"worker" + str(workerNum) + ".log")
    confStr = "\
    Output = " + cOutFile +"\n\
    Error = " + cErrFile +"\n\
    Log = " + cLogFile + "\n\
    universe = vanilla\n\
    getenv = true\n\
    Executable = " + "/lusr/bin/python" + "\n\
    Arguments = worker.py -e "+ executable + " -r " + resultsDir + " -d " + dataFile + " -n " + str(numIndividuals) + " -g " + str(numGenerations) + " -R " + str(seed) + " -G " + rom + "\n\
    Requirements = Arch == \"x86_64\" && InMastodon\n\
    +Group=\"GRAD\"\n\
    +Project=\"AI_ROBOTICS\"\n\
    +ProjectDescription=\"HyperNEAT Atari Game Playing Worker.\"\n\
    Queue\n"

    # Submit the condor job
    condorFile = os.path.join(resultsDir,"worker" + str(workerNum) + ".submit")
    condorSubmitPipe = open(condorFile,'w')
    condorSubmitPipe.write(confStr)
    condorSubmitPipe.close()
    procID = submitCondorJob(condorFile)

    # Wait for this job to show up in the condor_q before returning
    for i in range(12):
        time.sleep(10)
        if getPIDStatus(procID, condor_q()) != None:
            return procID

    print 'Failed to start normal worker.'
    return -1

# Submits a condor job which starts the generator running
def startNormalGenerator(generatorNum, executable, resultsDir, dataFile,
                   numIndividuals, numGenerations, seed, rom):
    cOutFile = os.path.join(resultsDir,"generator" + str(generatorNum) + ".out")
    cErrFile = os.path.join(resultsDir,"generator" + str(generatorNum) + ".err")
    cLogFile = os.path.join(resultsDir,"generator" + str(generatorNum) + ".log")
    confStr = "\
    Output = " + cOutFile +"\n\
    Error = " + cErrFile +"\n\
    Log = " + cLogFile + "\n\
    universe = vanilla\n\
    getenv = true\n\
    Executable = " + "/lusr/bin/python" + "\n\
    Arguments = generator.py -e "+ executable + " -r " + resultsDir + " -d " + dataFile + " -n " + str(numIndividuals) + " -g " + str(numGenerations) + " -R " + str(seed) + " -G " + rom + "\n\
    Requirements = Arch == \"x86_64\" && InMastodon\n\
    +Group=\"GRAD\"\n\
    +Project=\"AI_ROBOTICS\"\n\
    +ProjectDescription=\"HyperNEAT Atari Game Playing Generator.\"\n\
    Queue\n"

    # Submit the condor job
    condorFile = os.path.join(resultsDir,"generator" + str(generatorNum) + ".submit")
    condorSubmitPipe = open(condorFile,'w')
    condorSubmitPipe.write(confStr)
    condorSubmitPipe.close()
    procID = submitCondorJob(condorFile)

    # Wait for this job to show up in the condor_q before returning
    for i in range(12):
        if getPIDStatus(procID, condor_q()) != None:
            return procID
        time.sleep(10)

    print 'Failed to start normal generator.'
    print 'Cannot find pid', procID, ' in the condor_q:', condor_q()
    return -1

def startCMAESGenerator(generatorNum, executable, resultsDir, dataFile,
                   numIndividuals, numGenerations, seed, rom):
    cOutFile = os.path.join(resultsDir,"generator" + str(generatorNum) + ".out")
    cErrFile = os.path.join(resultsDir,"generator" + str(generatorNum) + ".err")
    cLogFile = os.path.join(resultsDir,"generator" + str(generatorNum) + ".log")
    inputFile = os.path.join(resultsDir,"FTNeatCMA_Input.txt")

    # paramsGen = getCurrentCMAESGen(resultsDir)
    # if paramsGen >= 0:
    #     confStr = "\
    #     Output = " + cOutFile +"\n\
    #     Error = " + cErrFile +"\n\
    #     Log = " + cLogFile + "\n\
    #     universe = vanilla\n\
    #     getenv = true\n\
    #     Executable = " + "/usr/bin/java" + "\n\
    #     Arguments = -Xmx16192m -cp /u/mhauskn/projects/frameworks/cma/java cma.CMAMain " + resultsDir + " " + str(numGenerations) + " -c " + str(paramsGen) + "\n\
    #     Requirements = Arch == \"x86_64\" && InMastodon\n\
    #     +Group=\"GRAD\"\n\
    #     +Project=\"AI_ROBOTICS\"\n\
    #     +ProjectDescription=\"HyperNEAT Atari Game Playing Generator.\"\n\
    #     Queue\n"
    # else:
    confStr = "\
    Output = " + cOutFile +"\n\
    Error = " + cErrFile +"\n\
    Log = " + cLogFile + "\n\
    universe = vanilla\n\
    getenv = true\n\
    Executable = " + "/usr/bin/java" + "\n\
    Arguments = -Xmx16192m -cp /u/mhauskn/projects/frameworks/cma/java cma.CMAMain " + resultsDir + " " + str(numGenerations) + " " + str(numIndividuals) + " " + inputFile + "\n\
    Requirements = Arch == \"x86_64\"\n\
    +Group=\"GRAD\"\n\
    +Project=\"AI_ROBOTICS\"\n\
    +ProjectDescription=\"HyperNEAT Atari Game Playing Generator.\"\n\
    Queue\n"

    # Submit the condor job
    condorFile = os.path.join(resultsDir,"generator" + str(generatorNum) + ".submit")
    condorSubmitPipe = open(condorFile,'w')
    condorSubmitPipe.write(confStr)
    condorSubmitPipe.close()
    procID = submitCondorJob(condorFile)

    # Wait for this job to show up in the condor_q before returning
    for i in range(12):
        if getPIDStatus(procID, condor_q()) != None:
            return procID
        time.sleep(10)

    print 'Failed to start CMAES generator.'
    return -1

def startCMAESWorker(workerNum, executable, resultsDir, dataFile, numIndividuals, numGenerations, seed, rom):
    cOutFile = os.path.join(resultsDir,"worker" + str(workerNum) + ".out")
    cErrFile = os.path.join(resultsDir,"worker" + str(workerNum) + ".err")
    cLogFile = os.path.join(resultsDir,"worker" + str(workerNum) + ".log")
    confStr = "\
    Output = " + cOutFile +"\n\
    Error = " + cErrFile +"\n\
    Log = " + cLogFile + "\n\
    universe = vanilla\n\
    getenv = true\n\
    Executable = " + "/lusr/bin/python" + "\n\
    Arguments = CMAESWorker.py -e "+ executable + " -r " + resultsDir + " -d " + dataFile + " -n " + str(numIndividuals) + " -g " + str(numGenerations) + " -R " + str(seed) + " -G " + rom + "\n\
    Requirements = Arch == \"x86_64\"\n\
    +Group=\"GRAD\"\n\
    +Project=\"AI_ROBOTICS\"\n\
    +ProjectDescription=\"HyperNEAT Atari Game Playing Worker.\"\n\
    Queue\n"

    # Submit the condor job
    condorFile = os.path.join(resultsDir,"worker" + str(workerNum) + ".submit")
    condorSubmitPipe = open(condorFile,'w')
    condorSubmitPipe.write(confStr)
    condorSubmitPipe.close()
    procID = submitCondorJob(condorFile)

    # Wait for this job to show up in the condor_q before returning
    for i in range(12):
        time.sleep(10)
        if getPIDStatus(procID, condor_q()) != None:
            return procID

    print 'Failed to start CMAES worker.'
    return -1


text:
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.configs = exports.rules = void 0;
const all_1 = require("./configs/all");
const recommended_1 = require("./configs/recommended");
const requireIndex = require("requireindex");
exports.rules = requireIndex(`${__dirname}/rules`);
exports.configs = {
    all: all_1.default,
    recommended: recommended_1.default
};


text:
package fizzle

import (
	"math"

	mgl "github.com/go-gl/mathgl/mgl32"
	graphics "github.com/tbogdala/fizzle/graphicsprovider"
	"github.com/tbogdala/gombz"
)

// RenderableCore contains data that is needed to draw an object on the screen.
// Further, data here can be shared between multiple Renderable instances.
type RenderableCore struct {
	Shader   *RenderShader
	Skeleton *Skeleton

	Tex0          graphics.Texture
	Tex1          graphics.Texture
	DiffuseColor  mgl.Vec4
	SpecularColor mgl.Vec4

	// Shininess is the exponent used while calculating specular highlights
	Shininess float32

	Vao            uint32
	VaoInitialized bool

	VertVBO        graphics.Buffer
	UvVBO          graphics.Buffer
	NormsVBO       graphics.Buffer
	TangentsVBO    graphics.Buffer
	ElementsVBO    graphics.Buffer
	BoneFidsVBO    graphics.Buffer
	BoneWeightsVBO graphics.Buffer
	ComboVBO1      graphics.Buffer
	ComboVBO2      graphics.Buffer

	VBOStride            int32
	VertVBOOffset        int
	UvVBOOffset          int
	NormsVBOOffset       int
	TangentsVBOOffset    int
	BoneFidsVBOOffset    int
	BoneWeightsVBOOffset int
	ComboVBO1Offset      int
	ComboVBO2Offset      int

	IsDestroyed bool
}

// Rectangle3D defines a rectangular 3d structure by two points
type Rectangle3D struct {
	Bottom mgl.Vec3
	Top    mgl.Vec3
}

// DeltaX is the change of the X-axis component of Rectangle3D
func (rect *Rectangle3D) DeltaX() float32 {
	return rect.Top[0] - rect.Bottom[0]
}

// DeltaY is the change of the Y-axis component of Rectangle3D
func (rect *Rectangle3D) DeltaY() float32 {
	return rect.Top[1] - rect.Bottom[1]
}

// DeltaZ is the change of the Z-axis component of Rectangle3D
func (rect *Rectangle3D) DeltaZ() float32 {
	return rect.Top[2] - rect.Bottom[2]
}

// Renderable defines the data necessary to draw an object in OpenGL.
type Renderable struct {
	FaceCount     uint32
	Scale         mgl.Vec3
	Location      mgl.Vec3
	Rotation      mgl.Quat
	LocalRotation mgl.Quat

	// AnimationTime keeps track of the time value to use for the animation
	// currently applied (if any) to the Renderable.
	AnimationTime float32

	// BoundingRect is the unscaled, unrotated bounding rectangle for the renderable.
	BoundingRect Rectangle3D

	IsVisible bool
	IsGroup   bool

	Core     *RenderableCore
	Parent   *Renderable
	Children []*Renderable
}

// NewRenderable creates a new Renderable object and a new RenderableCore
func NewRenderable() *Renderable {
	r := new(Renderable)
	r.Location = mgl.Vec3{0.0, 0.0, 0.0}
	r.Scale = mgl.Vec3{1.0, 1.0, 1.0}
	r.Rotation = mgl.QuatIdent()
	r.LocalRotation = mgl.QuatIdent()
	r.IsVisible = true
	r.IsGroup = false
	r.Children = make([]*Renderable, 0, 4)

	r.Core = NewRenderableCore()
	return r
}

// NewRenderableCore creates a new RenderableCore object
func NewRenderableCore() *RenderableCore {
	rc := new(RenderableCore)
	rc.DiffuseColor = mgl.Vec4{1.0, 1.0, 1.0, 1.0}
	rc.SpecularColor = mgl.Vec4{1.0, 1.0, 1.0, 1.0}
	rc.Shininess = 0.01
	rc.Vao = gfx.GenVertexArray()
	return rc
}

// Destroy releases the RenderableCore data
func (r *Renderable) Destroy() {
	r.Core.DestroyCore()
}

// DestroyCore releases the OpenGL VBO and VAO objects but does not release
// things that could be shared like Tex0.
func (r *RenderableCore) DestroyCore() {
	gfx.DeleteBuffer(r.VertVBO)
	gfx.DeleteBuffer(r.UvVBO)
	gfx.DeleteBuffer(r.ElementsVBO)
	gfx.DeleteBuffer(r.TangentsVBO)
	gfx.DeleteBuffer(r.NormsVBO)
	gfx.DeleteBuffer(r.BoneFidsVBO)
	gfx.DeleteBuffer(r.BoneWeightsVBO)
	gfx.DeleteBuffer(r.ComboVBO1)
	gfx.DeleteBuffer(r.ComboVBO2)
	gfx.DeleteVertexArray(r.Vao)
	r.IsDestroyed = true
}

// Clone makes a new Renderable object but shares the Core member between
// the two. This allows for a different location, scale, rotation, etc ...
func (r *Renderable) Clone() *Renderable {
	clone := NewRenderable()
	clone.FaceCount = r.FaceCount
	clone.Location = r.Location
	clone.Scale = r.Scale
	clone.Rotation = r.Rotation
	clone.LocalRotation = r.LocalRotation
	clone.IsVisible = r.IsVisible
	clone.IsGroup = r.IsGroup
	clone.BoundingRect = r.BoundingRect

	// The render core is shared in the clone
	clone.Core = r.Core

	// Deep clone the child renderables
	for _, rc := range r.Children {
		cloneChild := rc.Clone()
		clone.AddChild(cloneChild)
	}

	return clone
}

// HasSkeleton returns true if the renderable has bones associated with it.
func (r *Renderable) HasSkeleton() bool {
	if r.Core.Skeleton != nil {
		return true
	}
	return false
}

// HasSkeletonDeep returns true if the renderable, or any child, has bones associated with it.
func (r *Renderable) HasSkeletonDeep() bool {
	if r.Core.Skeleton != nil {
		return true
	}

	for _, cn := range r.Children {
		if cn.HasSkeletonDeep() == true {
			return true
		}
	}

	return false
}

// RenderableMapF defines the type of a function that can be passed to Renderable.Map().
type RenderableMapF func(r *Renderable)

// Map takes a function as a parameter that will be called for the renderable and all
// child Renderable objects (as well as their children, etc...)
func (r *Renderable) Map(f RenderableMapF) {
	// call the function for the renderable first
	f(r)

	// loop through all of the children and recurse
	for _, cn := range r.Children {
		cn.Map(f)
	}
}

// GetTransformMat4 creates a transform matrix: scale * transform
func (r *Renderable) GetTransformMat4() mgl.Mat4 {
	scaleMat := mgl.Scale3D(r.Scale[0], r.Scale[1], r.Scale[2])
	transMat := mgl.Translate3D(r.Location[0], r.Location[1], r.Location[2])
	localRotMat := r.LocalRotation.Mat4()
	rotMat := r.Rotation.Mat4()
	modelTransform := rotMat.Mul4(transMat).Mul4(localRotMat).Mul4(scaleMat)
	if r.Parent == nil {
		return modelTransform
	}

	// if there's a parent, apply the transform as well
	parentTransform := r.Parent.GetTransformMat4()
	return parentTransform.Mul4(modelTransform)
}

// AddChild sets the Renderable to be a child of the parent renderable.
func (r *Renderable) AddChild(child *Renderable) {
	r.Children = append(r.Children, child)
	child.Parent = r
}

// GetBoundingRect returns a bounding Rectangle3D for all of the vertices
// passed in.
func GetBoundingRect(verts []float32) (r Rectangle3D) {
	var minx, miny, minz float32 = math.MaxFloat32, math.MaxFloat32, math.MaxFloat32
	var maxx, maxy, maxz float32 = math.MaxFloat32 * -1, math.MaxFloat32 * -1, math.MaxFloat32 * -1

	vertCount := len(verts) / 3
	for i := 0; i < vertCount; i++ {
		offset := i * 3
		x := verts[offset]
		y := verts[offset+1]
		z := verts[offset+2]

		if x < minx {
			minx = x
		}
		if x > maxx {
			maxx = x
		}
		if y < miny {
			miny = y
		}
		if y > maxy {
			maxy = y
		}
		if z < minz {
			minz = z
		}
		if z > maxz {
			maxz = z
		}
	}

	r.Bottom = mgl.Vec3{minx, miny, minz}
	r.Top = mgl.Vec3{maxx, maxy, maxz}
	return r
}

func CreateFromGombz(srcMesh *gombz.Mesh) *Renderable {
	// calculate the memory size of floats used to calculate total memory size of float arrays
	const floatSize = 4
	const uintSize = 4

	// create the new renderable
	r := NewRenderable()
	r.Core = NewRenderableCore()

	// setup a skeleton if the mesh has bones associated with it
	if srcMesh.BoneCount > 0 {
		r.Core.Skeleton = NewSkeleton(srcMesh.Bones, srcMesh.Animations)
	}

	// set some basic properties up
	r.FaceCount = srcMesh.FaceCount

	// create a buffer to hold all the data that is the same size as VertexCount
	vertBuffer := make([]float32, srcMesh.VertexCount*3)

	// setup verts and track the bounding rectangle
	for i, v := range srcMesh.Vertices {
		offset := i * 3
		vertBuffer[offset] = v[0]
		vertBuffer[offset+1] = v[1]
		vertBuffer[offset+2] = v[2]
	}
	r.Core.VertVBO = gfx.GenBuffer()
	gfx.BindBuffer(graphics.ARRAY_BUFFER, r.Core.VertVBO)
	gfx.BufferData(graphics.ARRAY_BUFFER, floatSize*len(vertBuffer), gfx.Ptr(&vertBuffer[0]), graphics.STATIC_DRAW)

	// calculate the bounding rectangle for the mesh
	r.BoundingRect = GetBoundingRect(vertBuffer)

	// setup normals
	if len(srcMesh.Normals) > 0 {
		for i, n := range srcMesh.Normals {
			offset := i * 3
			vertBuffer[offset] = n[0]
			vertBuffer[offset+1] = n[1]
			vertBuffer[offset+2] = n[2]
		}
		r.Core.NormsVBO = gfx.GenBuffer()
		gfx.BindBuffer(graphics.ARRAY_BUFFER, r.Core.NormsVBO)
		gfx.BufferData(graphics.ARRAY_BUFFER, floatSize*len(vertBuffer), gfx.Ptr(&vertBuffer[0]), graphics.STATIC_DRAW)
	}

	// setup tangents
	if len(srcMesh.Tangents) > 0 {
		for i, t := range srcMesh.Tangents {
			offset := i * 3
			vertBuffer[offset] = t[0]
			vertBuffer[offset+1] = t[1]
			vertBuffer[offset+2] = t[2]
		}
		r.Core.TangentsVBO = gfx.GenBuffer()
		gfx.BindBuffer(graphics.ARRAY_BUFFER, r.Core.TangentsVBO)
		gfx.BufferData(graphics.ARRAY_BUFFER, floatSize*len(vertBuffer), gfx.Ptr(&vertBuffer[0]), graphics.STATIC_DRAW)
	}

	// setup UVs
	if len(srcMesh.UVChannels[0]) > 0 {
		uvChan := srcMesh.UVChannels[0]
		for i := uint32(0); i < srcMesh.VertexCount; i++ {
			uv := uvChan[i]
			offset := i * 2
			vertBuffer[offset] = uv[0]
			vertBuffer[offset+1] = uv[1]
		}
		r.Core.UvVBO = gfx.GenBuffer()
		gfx.BindBuffer(graphics.ARRAY_BUFFER, r.Core.UvVBO)
		gfx.BufferData(graphics.ARRAY_BUFFER, int(floatSize*srcMesh.VertexCount*2), gfx.Ptr(&vertBuffer[0]), graphics.STATIC_DRAW)
	}

	// setup vertex weight Ids for bones
	var weightBuffer []float32
	if len(srcMesh.VertexWeightIds) > 0 {
		if weightBuffer == nil {
			weightBuffer = make([]float32, srcMesh.VertexCount*4)
		}
		for i, v := range srcMesh.VertexWeightIds {
			offset := i * 4
			weightBuffer[offset] = v[0]
			weightBuffer[offset+1] = v[1]
			weightBuffer[offset+2] = v[2]
			weightBuffer[offset+3] = v[3]
		}
		r.Core.BoneFidsVBO = gfx.GenBuffer()
		gfx.BindBuffer(graphics.ARRAY_BUFFER, r.Core.BoneFidsVBO)
		gfx.BufferData(graphics.ARRAY_BUFFER, int(floatSize*srcMesh.VertexCount*4), gfx.Ptr(&weightBuffer[0]), graphics.STATIC_DRAW)
	}

	// setup the vertex weights
	if len(srcMesh.VertexWeights) > 0 {
		if weightBuffer == nil {
			weightBuffer = make([]float32, srcMesh.VertexCount*4)
		}
		for i, v := range srcMesh.VertexWeights {
			offset := i * 4
			weightBuffer[offset] = v[0]
			weightBuffer[offset+1] = v[1]
			weightBuffer[offset+2] = v[2]
			weightBuffer[offset+3] = v[3]
		}
		r.Core.BoneWeightsVBO = gfx.GenBuffer()
		gfx.BindBuffer(graphics.ARRAY_BUFFER, r.Core.BoneWeightsVBO)
		gfx.BufferData(graphics.ARRAY_BUFFER, int(floatSize*srcMesh.VertexCount*4), gfx.Ptr(&weightBuffer[0]), graphics.STATIC_DRAW)
	}

	// setup the face indices
	indexBuffer := make([]uint32, len(srcMesh.Faces)*3)
	for i, f := range srcMesh.Faces {
		offset := i * 3
		indexBuffer[offset] = f[0]
		indexBuffer[offset+1] = f[1]
		indexBuffer[offset+2] = f[2]
	}
	r.Core.ElementsVBO = gfx.GenBuffer()
	gfx.BindBuffer(graphics.ELEMENT_ARRAY_BUFFER, r.Core.ElementsVBO)
	gfx.BufferData(graphics.ELEMENT_ARRAY_BUFFER, uintSize*len(indexBuffer), gfx.Ptr(&indexBuffer[0]), graphics.STATIC_DRAW)

	gfx.BindBuffer(graphics.ARRAY_BUFFER, 0)
	gfx.BindBuffer(graphics.ELEMENT_ARRAY_BUFFER, 0)

	return r
}


text:
This file showcases the vector-based shadow study created by @mostapharoudsari . The component is currently in WIP as its high accuracy still comest at a cost of a long run time. Still, you can see that the vision is there.

This file has been submitted by [chriswmackey](https://github.com/chriswmackey)

[Check out this example on Hydra!](http://hydrashare.github.io/hydra/viewer?owner=chriswmackey&fork=hydra_2&id=Vector-BasedShadow_Study)
### Tags
LBExampleFiles, Ladybug, EPW, Weather, Climate, Shadow, Study, Vector, Geometric
### Thumbnail
![Screenshot](https://raw.githubusercontent.com/chriswmackey/hydra/master/Vector-BasedShadow_Study/thumbnail.png)


text:
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="ProjectRootManager" version="2" project-jdk-name="Python 3.4.1 virtualenv at ~/Documents/devel/python/pythonenv" project-jdk-type="Python SDK" />
  <component name="SvnBranchConfigurationManager">
    <option name="myConfigurationMap">
      <map>
        <entry key="$PROJECT_DIR$">
          <value>
            <SvnBranchConfiguration>
              <option name="trunkUrl" value="" />
            </SvnBranchConfiguration>
          </value>
        </entry>
      </map>
    </option>
    <option name="mySupportsUserInfoFilter" value="true" />
  </component>
</project>


text:
#include <memory>
#include <vector>
#include "colormap.hpp"
#include "image.hpp"
#include "../except/illegal_size_exception.hpp"

#pragma once

namespace vis
{
    struct ImageProperties
    {
        ImageProperties() : ImageProperties(0) {};
        ImageProperties(size_t const& widthHeight) : ImageProperties(widthHeight, widthHeight) {};
        ImageProperties(size_t const& width, size_t const& height) : ImageProperties(width, height, 0,0,0,0) {};
        ImageProperties(size_t const width, size_t const height, size_t const marginTop, size_t const marginBottom, size_t const marginLeft, size_t const marginRight)
            :   width(width),
                height(height),
                marginTop(marginTop),
                marginBottom(marginBottom),
                marginLeft(marginLeft),
                marginRight(marginRight),
                scale(1),
                marginColor(0,0,0)
        {};

        size_t width;
        size_t height;
        size_t marginTop;
        size_t marginBottom;
        size_t marginLeft;
        size_t marginRight;
        size_t scale;
        vis::color marginColor;
    };

    /**
     * Class to handle building images from data.
     */
    class ImageBuilder
    {
        public:
            /**
             * Build image from normalized data.
             *
             * \param width Width of the resulting image
             * \param height Height of the resulting image
             * \param normalizedValues A shared pointer to a vector of doubles.
             *        Those are expected to be in range [0;1] and the length of the
             *        vector is expected to be at least width x height.
             * \param colormap A shared pointer to a colormap.
             * \return A shared pointer to an image object.
             */
            static std::shared_ptr<Image> buildImageFromData(ImageProperties const& properties,
                    std::shared_ptr<std::vector<double>> const& normalizedValues,
                    std::shared_ptr<Colormap const> const& colormap);
    };
}


text:
require 'puppet'
require 'json'
require 'yaml'

begin
  require 'httparty'
rescue LoadError => e
  Puppet.info "You need the `httparty` gem to use the Zendesk report"
end

Puppet::Reports.register_report(:zendesk) do

  configfile = File.join([File.dirname(Puppet.settings[:config]), "zendesk.yaml"])
  raise(Puppet::ParseError, "zendesk report config file #{configfile} not readable") unless File.exist?(configfile)
  config = YAML.load_file(configfile)
  ZENDESK_SITE = config[:zendesk_site]
  ZENDESK_USER = config[:zendesk_user]
  ZENDESK_PASS = config[:zendesk_password]

  desc <<-DESC
  Send notification of failed reports to Zendesk and open new tickets.
  DESC

  def process
    if self.status == 'failed'
      Puppet.debug "Creating Zendesk ticket for failed run on #{self.host}."
      payload = {}
      output = []
      self.logs.each do |log|
        output << log
      end
      payload = { :ticket => { :subject => "Puppet run for #{self.host} #{self.status} at #{Time.now.asctime}",
                  :description => output.join("\n"), :priority_id => 0, :requester_email => "#{ZENDESK_USER}" } }
      response = HTTParty.post("#{ZENDESK_SITE}tickets.json", :basic_auth => {:username=>"#{ZENDESK_USER}", :password=> "#{ZENDESK_PASS}"}, :body => payload )
      Puppet.err "Response code: #{response.code} - #{response.body}" unless response.code == 201
    end
  end
end


text:
'use strict';

module.exports = function () {
	var isFinite = Number.isFinite;
	if (typeof isFinite !== 'function') return false;
	return !isFinite('23') && isFinite(34) && !isFinite(Infinity);
};


text:
#region Foreign-License

#endregion
using System;
namespace Tcl.Lang
{

    ///  This class implements the built-in "split" command in Tcl.

    class SplitCmd : ICommand
    {
        ///  Default characters for splitting up strings.

        private static char[] defSplitChars = new char[] { ' ', '\n', '\t', '\r' };

        ///  This procedure is invoked to process the "split" Tcl
        /// command. See Tcl user documentation for details.
        ///
        ///
        /// <param name="interp">the current interpreter.
        /// </param>
        /// <param name="argv">command arguments.
        /// </param>
        /// <exception cref=""> TclException If incorrect number of arguments.
        /// </exception>

        public TCL.CompletionCode CmdProc(Interp interp, TclObject[] argv)
        {
            char[] splitChars = null;
            string inString;

            if (argv.Length == 2)
            {
                splitChars = defSplitChars;
            }
            else if (argv.Length == 3)
            {

                splitChars = argv[2].ToString().ToCharArray();
            }
            else
            {
                throw new TclNumArgsException(interp, 1, argv, "string ?splitChars?");
            }

            inString = argv[1].ToString();
            int len = inString.Length;
            int num = splitChars.Length;

            /*
            * Handle the special case of splitting on every character.
            */

            if (num == 0)
            {
                TclObject list = TclList.NewInstance();

                list.Preserve();
                try
                {
                    for (int i = 0; i < len; i++)
                    {
                        TclList.Append(interp, list, TclString.NewInstance(inString[i]));
                    }
                    interp.SetResult(list);
                }
                finally
                {
                    list.Release();
                }
                return TCL.CompletionCode.RETURN;
            }

            /*
            * Normal case: split on any of a given set of characters.
            * Discard instances of the split characters.
            */
            TclObject list2 = TclList.NewInstance();
            int elemStart = 0;

            list2.Preserve();
            try
            {
                int i, j;
                for (i = 0; i < len; i++)
                {
                    char c = inString[i];
                    for (j = 0; j < num; j++)
                    {
                        if (c == splitChars[j])
                        {
                            TclList.Append(interp, list2, TclString.NewInstance(inString.Substring(elemStart, (i) - (elemStart))));
                            elemStart = i + 1;
                            break;
                        }
                    }
                }
                if (i != 0)
                {
                    TclList.Append(interp, list2, TclString.NewInstance(inString.Substring(elemStart)));
                }
                interp.SetResult(list2);
            }
            finally
            {
                list2.Release();
            }
            return TCL.CompletionCode.RETURN;
        }
    }
}


text:
"""
Cluster definition
part of context, Cluster is used to save connection information.
"""
from teuthology.orchestra import run

class Cluster(object):
    """
    Manage SSH connections to a cluster of machines.
    """

    def __init__(self, remotes=None):
        """
        :param remotes: A sequence of 2-tuples of this format:
                            (Remote, [role_1, role_2 ...])
        """
        self.remotes = {}
        if remotes is not None:
            for remote, roles in remotes:
                self.add(remote, roles)

    def __repr__(self):
        remotes = [(k, v) for k, v in self.remotes.items()]
        remotes.sort(key=lambda tup: tup[0].name)
        remotes = '[' + ', '.join('[{remote!r}, {roles!r}]'.format(
            remote=k, roles=v) for k, v in remotes) + ']'
        return '{classname}(remotes={remotes})'.format(
            classname=self.__class__.__name__,
            remotes=remotes,
            )

    def __str__(self):
        remotes = list(self.remotes.items())
        remotes.sort(key=lambda tup: tup[0].name)
        remotes = ((k, ','.join(v)) for k, v in remotes)
        remotes = ('{k}[{v}]'.format(k=k, v=v) for k, v in remotes)
        return ' '.join(remotes)

    def add(self, remote, roles):
        """
        Add roles to the list of remotes.
        """
        if remote in self.remotes:
            raise RuntimeError(
                'Remote {new!r} already found in remotes: {old!r}'.format(
                    new=remote,
                    old=self.remotes[remote],
                    ),
                )
        self.remotes[remote] = list(roles)

    def run(self, wait=True, parallel=False, **kwargs):
        """
        Run a command on all the nodes in this cluster.

        Goes through nodes in alphabetical order.

        The default usage is when parallel=False and wait=True,
        which is a sequential run for each node one by one.

        If you specify parallel=True, it will be in parallel.

        If you specify wait=False, it returns immediately.
        Since it is not possible to run sequentially and
        do not wait each command run finished, the parallel value
        is ignored and treated as True.

        Returns a list of `RemoteProcess`.
        """
        # -+-------+----------+----------+------------+---------------
        #  | wait  | parallel | run.wait | remote.run | comments
        # -+-------+----------+----------+------------+---------------
        # 1|*True  |*False    | no       | wait=True  | sequentially
        # 2| True  | True     | yes      | wait=False | parallel
        # 3| False | True     | no       | wait=False | parallel
        # 4| False | False    | no       | wait=False | same as above

        # We always run in parallel if wait=False,
        # that is why (4) is equivalent to (3).

        # We wait from remote.run only if run sequentially.
        _wait = (parallel == False and wait == True)

        remotes = sorted(self.remotes.keys(), key=lambda rem: rem.name)
        procs = [remote.run(**kwargs, wait=_wait) for remote in remotes]

        # We do run.wait only if parallel=True, because if parallel=False,
        # we have run sequentially and all processes are complete.

        if parallel and wait:
            run.wait(procs)
        return procs

    def sh(self, script, **kwargs):
        """
        Run a command on all the nodes in this cluster.

        Goes through nodes in alphabetical order.

        Returns a list of the command outputs correspondingly.
        """
        remotes = sorted(self.remotes.keys(), key=lambda rem: rem.name)
        return [remote.sh(script, **kwargs) for remote in remotes]

    def write_file(self, file_name, content, sudo=False, perms=None, owner=None):
        """
        Write text to a file on each node.

        :param file_name: file name
        :param content: file content
        :param sudo: use sudo
        :param perms: file permissions (passed to chmod) ONLY if sudo is True
        """
        remotes = sorted(self.remotes.keys(), key=lambda rem: rem.name)
        for remote in remotes:
            if sudo:
                remote.write_file(file_name, content,
                                  sudo=True, mode=perms, owner=owner)
            else:
                if perms is not None or owner is not None:
                    raise ValueError("To specify perms or owner, sudo must be True")
                remote.write_file(file_name, content)

    def only(self, *roles):
        """
        Return a cluster with only the remotes that have all of given roles.

        For roles given as strings, they are matched against the roles
        on a remote, and the remote passes the check only if all the
        roles listed are present.

        Argument can be callable, and will act as a match on roles of
        the remote. The matcher will be evaluated one role at a time,
        but a match on any role is good enough. Note that this is
        subtly diffent from the behavior of string roles, but is
        logical if you consider a callable to be similar to passing a
        non-string object with an `__eq__` method.

        For example::

	    web = mycluster.only(lambda role: role.startswith('web-'))
        """
        c = self.__class__()
        want = frozenset(r for r in roles if not callable(r))
        matchers = [r for r in roles if callable(r)]

        for remote, has_roles in self.remotes.items():
            # strings given as roles must all match
            if frozenset(has_roles) & want != want:
                # not a match
                continue

            # every matcher given must match at least one role
            if not all(
                any(matcher(role) for role in has_roles)
                for matcher in matchers
                ):
                continue

            c.add(remote, has_roles)

        return c

    def exclude(self, *roles):
        """
        Return a cluster *without* remotes that have all of given roles.

        This is the opposite of `only`.
        """
        matches = self.only(*roles)
        c = self.__class__()
        for remote, has_roles in self.remotes.items():
            if remote not in matches.remotes:
                c.add(remote, has_roles)
        return c

    def filter(self, func):
        """
        Return a cluster whose remotes are filtered by `func`.

        Example::
            cluster = ctx.cluster.filter(lambda r: r.is_online)
        """
        result = self.__class__()
        for rem, roles in self.remotes.items():
            if func(rem):
                result.add(rem, roles)
        return result


text:
@protocol AttendanceDelegate <NSObject>

- (BOOL)confirmAttendance;
- (BOOL)cancelAttendance;

@optional // OPtional implementation. Before: Mandatory

- (void)attendanceStatus;

@end


text:
import React, { Component } from 'react';

class Footer extends Component {
  render() {
    return (
      <footer>
        <div>
          Footer component
        </div>
      </footer>
    )
  }
}

export default Footer;


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web.Http;
using Breeze.WebApi;
using Breeze.WebApi.EF;
using _2.models;
using Newtonsoft.Json.Linq;

namespace _2.Controllers
{
    [BreezeController]
    public class ClientController : ApiController
    {
        //give the controller the dbcontext
        readonly EFContextProvider<MyDatabaseContext> contextProvider = new EFContextProvider<MyDatabaseContext>();

        //get call for metadata
        [HttpGet]
        public string Metadata()
        {
            return contextProvider.Metadata();
        }
        //call for data from dummys table
        [HttpGet]
        public IQueryable<client> clients()
        {
            return contextProvider.Context.clients;
        }

        //save changes to dummys table
        [HttpPost]
        public SaveResult SaveChanges(JObject saveBundle)
        {
            return contextProvider.SaveChanges(saveBundle);
        }
    }
}


text:
package com.baseframework.example.uploadProgress;

public class Progress {
	/** 已上传总字节数 */
	private long pBytesRead;
	/** 总文件字节数 */
	private long pContentLength;
	/** 当前文件索引 */
	private int pItems;

	public long getpBytesRead() {
		return pBytesRead;
	}

	public void setpBytesRead(long pBytesRead) {
		this.pBytesRead = pBytesRead;
	}

	public long getpContentLength() {
		return pContentLength;
	}

	public void setpContentLength(long pContentLength) {
		this.pContentLength = pContentLength;
	}

	public int getpItems() {
		return pItems;
	}

	public void setpItems(int pItems) {
		this.pItems = pItems;
	}

	@Override
	public String toString() {
		return "Progress [pBytesRead=" + pBytesRead + ", pContentLength="
				+ pContentLength + ", pItems=" + pItems + "]";
	}

}


text:
[List](list.pv)

[Dictionary Shirin](format.pv)

[Dictionary Kimberley](format.kim.pv)

[Data Shirin](data_shirin.py)

[Data Kimberley](data_kim.py)

[iTunes](iTunes.pv)

[Typeface Groupassignment](gotham.pv)

[All the works from Poe can be found in Project Gutenberg](Download.texts.rtf)

[Was Poe a cat or a dog person?](Cat/Dog.rtf)

[How many occurances of 'cat' are there in the collected works?](Cat.rtf)

[How many occurances of 'dog' are there in the collected works?](Dog.rtf)

[Find all occurances of 'horror' are there in the collected works of Poe and see them in context and with line numbers](horror.rtf)

[Photoshop](adobe.rtf)

[Cowsay](cowsay.png)

## Concept
The program that I want to write is a joke generator. Using cowsay as inspiration I want the program to output one-line randomly from a database that I created.

## Prototype: working demo
[Jokes working like fortune](1.jpg)

[Jokes working like fortune](2.jpg)

## Program and Documentation
[Subfolder](jokegenerator)


text:
package xsbti.compile;

import java.io.File;

/** Standard compilation options.*/
public interface Options
{
	/** The classpath to use for compilation.
	* This will be modified according to the ClasspathOptions used to configure the ScalaCompiler.*/
	File[] classpath();

	/** All sources that should be recompiled.
	* This should include Scala and Java sources, which are identified by their extension. */
	File[] sources();

	/** Output for the compilation. */
	Output output();

	/** The options to pass to the Scala compiler other than the sources and classpath to use. */
	String[] options();

	/** The options to pass to the Java compiler other than the sources and classpath to use. */
	String[] javacOptions();

	/** Controls the order in which Java and Scala sources are compiled.*/
	CompileOrder order();
}


text:
package org.hisp.dhis.dxf2.metadata.objectbundle.hooks;

import org.hisp.dhis.common.IdentifiableObject;
import org.hisp.dhis.dxf2.metadata.objectbundle.ObjectBundle;
import org.hisp.dhis.period.PeriodType;
import org.hisp.dhis.schema.Property;
import org.hisp.dhis.schema.Schema;
import org.hisp.dhis.system.util.ReflectionUtils;

/**
 * @author Morten Olav Hansen <mortenoh@gmail.com>
 */
public class PeriodTypeObjectBundleHook extends AbstractObjectBundleHook
{
    @Override
    public <T extends IdentifiableObject> void preCreate( T object, ObjectBundle bundle )
    {
        Schema schema = schemaService.getDynamicSchema( object.getClass() );

        for ( Property property : schema.getPropertyMap().values() )
        {
            if ( PeriodType.class.isAssignableFrom( property.getKlass() ) )
            {
                PeriodType periodType = ReflectionUtils.invokeMethod( object, property.getGetterMethod() );

                if ( periodType != null )
                {
                    periodType = bundle.getPreheat().getPeriodTypeMap().get( periodType.getName() );
                    ReflectionUtils.invokeMethod( object, property.getSetterMethod(), periodType );
                }
            }
        }
    }

    @Override
    public <T extends IdentifiableObject> void preUpdate( T object, T persistedObject, ObjectBundle bundle )
    {
        Schema schema = schemaService.getDynamicSchema( object.getClass() );

        for ( Property property : schema.getPropertyMap().values() )
        {
            if ( PeriodType.class.isAssignableFrom( property.getKlass() ) )
            {
                PeriodType periodType = ReflectionUtils.invokeMethod( object, property.getGetterMethod() );

                if ( periodType != null )
                {
                    periodType = bundle.getPreheat().getPeriodTypeMap().get( periodType.getName() );
                    ReflectionUtils.invokeMethod( object, property.getSetterMethod(), periodType );
                }
            }
        }
    }
}


text:
"""
Copyright (c) 2014 windpro

Author  :   windpro
E-mail  :   windprog@gmail.com
Date    :   15/1/28
Desc    :   using  https://github.com/liris/websocket-client
            pip install websocket-client
"""
from gevent.monkey import patch_socket
patch_socket()
import time

import config
from requestspool.util import pdb_pm
from requestspool_client import Client

publish_config = {
    "match": [
        # 只监控百度的下载
        ".*baidu.com"
    ],
    "field": [
        # 以下为所有可用字段,可挑选
        "method", "url", "req_query_string", "req_headers", "req_data", "status_code", "res_headers", "res_data"
    ]
}

client = Client(port=config.PORT, config=publish_config)

while True:
    try:
        result = client.receive()
        print "url:%s data_len:%s" % (result.get("url"), len(result.get("res_data")))
    except:
        pdb_pm()
        print "等待1秒重试"
        time.sleep(1)
        client.reconnect()