text:
from asyncio.test_utils import TestCase
from datetime import datetime, timezone
import asyncio

import aiohttp
import aiomysql
from domopyc.subscribers.mysql_toolbox import MysqlCurrentCostMessageHandler
from domopyc.web import domopyc_server

__author__ = 'bruno'

class RedisGetDataOfDay(TestCase):
    @asyncio.coroutine
    def setUp(self):
        self.pool = yield from aiomysql.create_pool(host='127.0.0.1', port=3306,
                                                    user='test', password='test', db='test',
                                                    loop=asyncio.get_event_loop())

        self.server = yield from domopyc_server.init(asyncio.get_event_loop(), self.pool, port=12345)
        self.message_handler = MysqlCurrentCostMessageHandler(self.pool)
        with (yield from self.pool) as conn:
            cur = yield from conn.cursor()
            yield from cur.execute("truncate current_cost")
            yield from cur.close()

    @asyncio.coroutine
    def tearDown(self):
        self.server.close()
        self.pool.close()
        yield from self.pool.wait_closed()

    @asyncio.coroutine
    def test_get_current_cost_history_one_line(self):
        yield from self.message_handler.save({'date': datetime(2015, 5, 28, 12, 0, 0, tzinfo=timezone.utc), 'watt': 123, 'minutes': 60, 'nb_data': 120, 'temperature': 20.2})

        response = yield from aiohttp.request('GET', 'http://127.0.0.1:12345/power/history')
        json_response = yield from response.json()

        self.assertEqual(1, len(json_response['data']))
        self.assertEqual(['2015-05-28T00:00:00', 0.123], json_response['data'][0])

    @asyncio.coroutine
    def test_get_current_cost_by_day_with_previous_day(self):
        yield from self.message_handler.save({'date': datetime(2015, 5, 29, 12, 10, 0), 'watt': 1000, 'minutes': 60, 'nb_data': 120, 'temperature': 20.6})
        yield from self.message_handler.save({'date': datetime(2015, 5, 30, 23, 20, 0), 'watt': 500, 'minutes': 180, 'nb_data': 120, 'temperature': 20.2})

        response = yield from aiohttp.request('GET', 'http://127.0.0.1:12345/power/day/%s' % datetime(2015, 5, 30, 0, 0).isoformat())
        json_response = yield from response.json()

        self.assertEqual(1, len(json_response['day_data']))
        self.assertEqual(1, len(json_response['previous_day_data']))
        self.assertEqual(['2015-05-30T23:20:00', 500, 20.2], json_response['day_data'][0])
        self.assertEqual(['2015-05-29T12:10:00', 1000, 20.6], json_response['previous_day_data'][0])

redpajama_set_name: RedPajamaGithub


text:
<?php

namespace Account;

use Account\Form\LoginForm;
use Account\Form\RegisterForm;
use Account\Model\LoginAccount;
use Api\Model\Dao\LocationDao;
use Api\Model\Entity\State;
use Api\Model\Entity\City;
use Api\Model\Entity\Municipality;
use Zend\Db\TableGateway\TableGateway;
use Zend\Db\ResultSet\ResultSet;
use Zend\ModuleManager\ModuleManager;
use Zend\Mvc\MvcEvent;

class Module {

    public function onBootstrap(MvcEvent $e) {
        $this->initRegister($e);
        $this->initLogin($e);
    }

    public function init(ModuleManager $moduleManager) {
        $moduleName = $moduleManager->getEvent()->getModuleName();
        if ($moduleName == 'Account') {
            $events = $moduleManager->getEventManager();
            $sharedEvents = $events->getSharedManager();
            $sharedEvents->attach(array(__NAMESPACE__, 'Application', 'Account', 'Catalog', 'Sale', 'Payment'), 'dispatch', array($this, 'initAuth'), 100);
        }
    }

    public function initAuth(MvcEvent $e) {

        $app = $e->getApplication();
        $routerMatch = $e->getRouteMatch();
        $controller = $routerMatch->getParam('controller');
        $action = $routerMatch->getParam('action');

        $sm = $app->getServiceManager();
        $auth = $sm->get('Account\Model\LoginAccount');

        if ($controller === 'Account\Controller\Index' && !$auth->isLoggedIn()) {
            $controller = $e->getTarget();
            return $controller->redirect()->toRoute('account', array('controller' => 'register', 'action' => 'add'));
        }

        if ($auth->isLoggedIn()) {

            $viewModel = $e->getViewModel();
            $viewModel->userIdentity = $auth->getIdentity();
        }
    }

    protected function initRegister($e) {
        $viewModel = $e->getViewModel();
        $viewModel->registerForm = new RegisterForm();
    }

    protected function initLogin($e) {
        $viewModel = $e->getViewModel();
        $viewModel->loginForm = new LoginForm();
    }

    public function getServiceConfig() {
        return array(
            'factories' => array(
                'Account\Model\LoginAccount' => function ($sm) {
                    $dbAdapter = $sm->get('Zend\Db\Adapter\Adapter');
                    return new LoginAccount($dbAdapter);
                },
                'CountryTableGateway' => function ($sm) {
                    $dbAdapter = $sm->get('Zend\Db\Adapter\Adapter');
                    $resultSetPrototype = new ResultSet();
                    $resultSetPrototype->setArrayObjectPrototype(new Country());
                    return new TableGateway('pr_country', $dbAdapter, null, $resultSetPrototype);
                },
                'CountryDao' => function($sm) {
                    $tableGateway = $sm->get('CountryTableGateway');
                    $table = new LocationDao($tableGateway);
                    return $table;
                },
                'StateTableGateway' => function ($sm) {
                    $dbAdapter = $sm->get('Zend\Db\Adapter\Adapter');
                    $resultSetPrototype = new ResultSet();
                    $resultSetPrototype->setArrayObjectPrototype(new State());
                    return new TableGateway('pr_state', $dbAdapter, null, $resultSetPrototype);
                },
                'StateDao' => function($sm) {
                    $tableGateway = $sm->get('StateTableGateway');
                    $table = new LocationDao($tableGateway);
                    return $table;
                },
                'MunicipalityTableGateway' => function ($sm) {
                    $dbAdapter = $sm->get('Zend\Db\Adapter\Adapter');
                    $resultSetPrototype = new ResultSet();
                    $resultSetPrototype->setArrayObjectPrototype(new Municipality());
                    return new TableGateway('pr_municipality', $dbAdapter, null, $resultSetPrototype);
                },
                'MunicipalityDao' => function($sm) {
                    $tableGateway = $sm->get('MunicipalityTableGateway');
                    $table = new LocationDao($tableGateway);
                    return $table;
                },
                'CityTableGateway' => function ($sm) {
                    $dbAdapter = $sm->get('Zend\Db\Adapter\Adapter');
                    $resultSetPrototype = new ResultSet();
                    $resultSetPrototype->setArrayObjectPrototype(new City());
                    return new TableGateway('pr_city', $dbAdapter, null, $resultSetPrototype);
                },
                'CityDao' => function($sm) {
                    $tableGateway = $sm->get('CityTableGateway');
                    $table = new LocationDao($tableGateway);
                    return $table;
                },
            ),
        );
    }

    public function getConfig() {
        return include __DIR__ . '/config/module.config.php';
    }

    public function getAutoloaderConfig() {
        return array(
            'Zend\Loader\StandardAutoloader' => array(
                'namespaces' => array(
                    __NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__,
                ),
            ),
        );
    }

}


text:
<!DOCTYPE html>

  <title>Mimic mixin</title>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <meta name="viewport" content="width=device-width, target-densitydpi=160dpi, initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
  <link rel="stylesheet" media="all" href="../../docco.css" />

          Jump To …
          +

                  ./source/core/animationloop.js

                  ./source/core/document.js

                  ./source/core/events.js

                  ./source/core/init.js

                  ./source/core/library.js

                  ./source/core/random-seed.js

                  ./source/core/snippets.js

                  ./source/core/userInteraction.js

                  ./source/core/utilities.js

                  ./source/factory/action.js

                  ./source/factory/anchor.js

                  ./source/factory/animation.js

                  ./source/factory/bezier.js

                  ./source/factory/block.js

                  ./source/factory/canvas.js

                  ./source/factory/cell.js

                  ./source/factory/cog.js

                  ./source/factory/color.js

                  ./source/factory/conicGradient.js

                  ./source/factory/coordinate.js

                  ./source/factory/crescent.js

                  ./source/factory/element.js

                  ./source/factory/emitter.js

                  ./source/factory/filter.js

                  ./source/factory/filterEngine-bluenoiseData.js

                  ./source/factory/filterEngine.js

                  ./source/factory/fontAttributes.js

                  ./source/factory/gradient.js

                  ./source/factory/grid.js

                  ./source/factory/group.js

                  ./source/factory/imageAsset.js

                  ./source/factory/line.js

                  ./source/factory/lineSpiral.js

                  ./source/factory/loom.js

                  ./source/factory/mesh.js

                  ./source/factory/net.js

                  ./source/factory/noiseAsset.js

                  ./source/factory/oval.js

                  ./source/factory/palette.js

                  ./source/factory/particle.js

                  ./source/factory/particleForce.js

                  ./source/factory/particleHistory.js

                  ./source/factory/particleSpring.js

                  ./source/factory/particleWorld.js

                  ./source/factory/pattern.js

                  ./source/factory/phrase.js

                  ./source/factory/picture.js

                  ./source/factory/polygon.js

                  ./source/factory/polyline.js

                  ./source/factory/quadratic.js

                  ./source/factory/quaternion.js

                  ./source/factory/radialGradient.js

                  ./source/factory/rawAsset.js

                  ./source/factory/rdAsset.js

                  ./source/factory/rectangle.js

                  ./source/factory/renderAnimation.js

                  ./source/factory/shape.js

                  ./source/factory/spiral.js

                  ./source/factory/spriteAsset.js

                  ./source/factory/stack.js

                  ./source/factory/star.js

                  ./source/factory/state.js

                  ./source/factory/tetragon.js

                  ./source/factory/ticker.js

                  ./source/factory/tracer.js

                  ./source/factory/tween.js

                  ./source/factory/unstackedElement.js

                  ./source/factory/vector.js

                  ./source/factory/videoAsset.js

                  ./source/factory/wheel.js

                  ./source/mixin/anchor.js

                  ./source/mixin/asset.js

                  ./source/mixin/assetAdvancedFunctionality.js

                  ./source/mixin/assetConsumer.js

                  ./source/mixin/base.js

                  ./source/mixin/cascade.js

                  ./source/mixin/delta.js

                  ./source/mixin/displayShape.js

                  ./source/mixin/dom.js

                  ./source/mixin/entity.js

                  ./source/mixin/filter.js

                  ./source/mixin/mimic.js

                  ./source/mixin/path.js

                  ./source/mixin/pattern.js

                  ./source/mixin/pivot.js

                  ./source/mixin/position.js

                  ./source/mixin/shapeBasic.js

                  ./source/mixin/shapeCurve.js

                  ./source/mixin/shapePathCalculation.js

                  ./source/mixin/styles.js

                  ./source/mixin/tween.js

                §

Mimic mixin

This mixin defines additional attributes and functions to allow an artefact to use a range of attribute values set in another artefact.

                §

Imports

import { artefact, asset } from '../core/library.js';
import { mergeOver, pushUnique, isa_boolean, Ωempty, removeItem } from '../core/utilities.js';

                §

Export function

export default function (P = Ωempty) {

                §

Shared attributes

    let defaultAttributes = {

                §

mimic - reference artefact object. Can also be set using the artefact's name-String.

        mimic: '',

                §

useMimic… - a set of Boolean flags determining which attributes should be taken from the mimic reference artefact. By default, the artefact will use its own attribute values; setting any of these flags changes the behaviour for that attribute.

        useMimicDimensions: false,
        useMimicScale: false,
        useMimicStart: false,
        useMimicHandle: false,
        useMimicOffset: false,
        useMimicRotation: false,
        useMimicFlip: false,

                §

addOwn…ToMimic - a set of Boolean flags determining which mimic attributes should be added to this artefact's own attribute values. By default, none are added; setting any of these flags changes the behaviour for that attribute.

        addOwnDimensionsToMimic: false,
        addOwnScaleToMimic: false,
        addOwnStartToMimic: false,
        addOwnHandleToMimic: false,
        addOwnOffsetToMimic: false,
        addOwnRotationToMimic: false,
    };
    P.defs = mergeOver(P.defs, defaultAttributes);
    mergeOver(P, defaultAttributes);

                §

Packet management

    P.packetObjects = pushUnique(P.packetObjects, ['mimic']);

                §

Clone management

No additional clone functionality defined here

                §

Kill management

No additional kill functionality defined here

                §

Get, Set, deltaSet

    let G = P.getters,
        S = P.setters,
        D = P.deltaSetters;

                §

Prototype functions

                §

mimic

    S.mimic = function (item) {

        if (isa_boolean(item) && !item) {

            this.mimic = null;

            if (this.lockTo[0] === 'mimic') this.lockTo[0] = 'start';
            if (this.lockTo[1] === 'mimic') this.lockTo[1] = 'start';

            this.dirtyStampPositions = true;
            this.dirtyStampHandlePositions = true;
        }
        else {

            let oldMimic = this.mimic,
                name = this.name;

            let newMimic = (item.substring) ? artefact[item] : item;

            if (!newMimic) {

                newMimic = asset[item];

                if (newMimic && newMimic.type !== 'Cell') newMimic = false;
            }

            if (newMimic && newMimic.name) {

                if (oldMimic && oldMimic.name !== newMimic.name) removeItem(oldMimic.mimicked, name);

                pushUnique(newMimic.mimicked, name);

                this.mimic = newMimic;

                if (this.useMimicDimensions) this.dirtyDimensions = true;
                if (this.useMimicScale) this.dirtyScale = true;
                if (this.useMimicStart) this.dirtyStart = true;
                if (this.useMimicHandle) this.dirtyHandle = true;
                if (this.useMimicOffset) this.dirtyOffset = true;
                if (this.useMimicRotation) this.dirtyRotation = true;
            }
        }
    };

                §

useMimicDimensions, useMimicScale, useMimicStart, useMimicHandle, useMimicOffset, useMimicRotation

    S.useMimicDimensions = function (item) {

        this.useMimicDimensions = item;
        this.dirtyDimensions = true;
    };
    S.useMimicScale = function (item) {

        this.useMimicScale = item;
        this.dirtyScale = true;
    };
    S.useMimicStart = function (item) {

        this.useMimicStart = item;
        this.dirtyStart = true;
    };
    S.useMimicHandle = function (item) {

        this.useMimicHandle = item;
        this.dirtyHandle = true;
    };
    S.useMimicOffset = function (item) {

        this.useMimicOffset = item;
        this.dirtyOffset = true;
    };
    S.useMimicRotation = function (item) {

        this.useMimicRotation = item;
        this.dirtyRotation = true;
    };

                §

addOwnDimensionsToMimic, addOwnScaleToMimic, addOwnStartToMimic, addOwnHandleToMimic, addOwnOffsetToMimic, addOwnRotationToMimic

    S.addOwnDimensionsToMimic = function (item) {

        this.addOwnDimensionsToMimic = item;
        this.dirtyDimensions = true;
    };
    S.addOwnScaleToMimic = function (item) {

        this.addOwnScaleToMimic = item;
        this.dirtyScale = true;
    };
    S.addOwnStartToMimic = function (item) {

        this.addOwnStartToMimic = item;
        this.dirtyStart = true;
    };
    S.addOwnHandleToMimic = function (item) {

        this.addOwnHandleToMimic = item;
        this.dirtyHandle = true;
    };
    S.addOwnOffsetToMimic = function (item) {

        this.addOwnOffsetToMimic = item;
        this.dirtyOffset = true;
    };
    S.addOwnRotationToMimic = function (item) {

        this.addOwnRotationToMimic = item;
        this.dirtyRotation = true;
    };

                §

Prototype functions

                §

updateMimicSubscribers

    P.updateMimicSubscribers = function () {

        let DMH = this.dirtyMimicHandle;
        let DMO = this.dirtyMimicOffset;
        let DMR = this.dirtyMimicRotation;
        let DMS = this.dirtyMimicScale;
        let DMD = this.dirtyMimicDimensions;

        this.mimicked.forEach(name => {

            let instance = artefact[name];

            if (!instance) {

                instance = asset[name];

                if (!instance || instance.type !== 'Cell') instance = false;
            }

            if (instance) {

                if (instance.useMimicStart) instance.dirtyStart = true;
                if (DMH && instance.useMimicHandle) instance.dirtyHandle = true;
                if (DMO && instance.useMimicOffset) instance.dirtyOffset = true;
                if (DMR && instance.useMimicRotation) instance.dirtyRotation = true;
                if (DMS && instance.useMimicScale) instance.dirtyScale = true;
                if (DMD && instance.useMimicDimensions) instance.dirtyDimensions = true;
            }
        });

        this.dirtyMimicHandle = false;
        this.dirtyMimicOffset = false;
        this.dirtyMimicRotation = false;
        this.dirtyMimicScale = false;
        this.dirtyMimicDimensions = false;
    };

                §

Return the prototype

    return P;
};


text:
When drawing bounding boxes on images via `BoundingBox.draw_on_image()`
or `BoundingBoxesOnImage.draw_on_image()`, a box containing the label will now
be drawn over each bounding box's rectangle. If the bounding box's label is
set to `None`, the label box will not be drawn. For more detailed control,
use `BoundingBox.draw_label_on_image()`.

* Added method `imgaug.augmentables.BoundingBox.draw_label_on_image()`.
* Added method `imgaug.augmentables.BoundingBox.draw_box_on_image()`.
* Changed method `imgaug.augmentables.BoundingBox.draw_on_image()`
  to automatically draw a bounding box's label.


text:
package com.jvc.projector.dla.swing;

import java.awt.BorderLayout;
import java.awt.EventQueue;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;

import javax.swing.JFrame;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;
import javax.swing.border.EmptyBorder;

import com.jvc.projector.dla.DLAController;
import com.jvc.projector.dla.external.DLAExternalConnector;

public class DLAInterface extends JFrame {
	/**
	 *
	 */
	private static final long serialVersionUID = 1L;
	private static final String FILE = "./Status.dat";
	private JPanel contentPane;
	private static DLAController controller;

	public static DLAController getController() {
		return controller;
	}

	static void setController(DLAController cont) {
		controller = cont;
		storeToFile(FILE);
	}
    private static void storeToFile(String f){
    	try
    	{
    		FileOutputStream saveFile = new FileOutputStream(f);
    		ObjectOutputStream save = new ObjectOutputStream(saveFile);
    		save.writeObject(controller.getConnector());
    		save.close();
    	}
    	catch (FileNotFoundException e)
    	{
    		e.printStackTrace();
    	}
    	catch (IOException e)
    	{
    		e.printStackTrace();
    	}
    }

	private static void loadFromFile(String f) {
		try {
			FileInputStream saveFile = new FileInputStream(f);

			ObjectInputStream save = new ObjectInputStream(saveFile);

			DLAExternalConnector con = (DLAExternalConnector) save.readObject();
			controller = new DLAController(con);
			save.close();
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	public static void main(String[] args) {
		String statusFile = "./Status.dat";
		if (args.length > 0) {
			statusFile = args[0];
		}
		if (new File(statusFile).exists()) {
			loadFromFile(statusFile);
		}
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					DLAInterface frame = new DLAInterface();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	public DLAInterface() {
		setDefaultCloseOperation(3);
		setBounds(100, 100, 257, 626);

		JMenuBar menuBar = new JMenuBar();
		setJMenuBar(menuBar);

		JMenuItem mntmConnection = new JMenuItem("Connection");
		mntmConnection.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				SwingUtilities.invokeLater(new Runnable() {
					public void run() {
						new DLALANConfigurator(DLAInterface.this)
								.setVisible(true);
					}
				});
			}
		});
		menuBar.add(mntmConnection);
		this.contentPane = new JPanel();
		this.contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		this.contentPane.setLayout(new BorderLayout(0, 0));
		setContentPane(this.contentPane);

//		JTabbedPane tabbedPane = new JTabbedPane(1);
//		this.contentPane.add(tabbedPane, "Center");
//
//		JPanel panel = new DLABasicControl();
//		tabbedPane.addTab("Basic", null, panel, null);
//
//		JPanel panel_1 = new DLAVirtualRemote();
//		tabbedPane.addTab("Remote", null, panel_1, null);

		this.contentPane.add(new DLAVirtualRemote(), "Center");
	}
}


text:
using ExtAspNet;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace CJia.Evaluation.Web.Backstage
{
    public partial class FileQuery : CJia.Evaluation.Tools.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                InitTree(QueryAllDept());
                ExeBindDataType(QueryFileType());
            }
        }

        protected override object CreatePresenter()
        {
            return null;
        }

        public DataTable QueryAllDept()
        {
            using (Adapter ad = new Adapter())
            {
                DataTable dtDept = ad.Query(CJia.Evaluation.Models.SqlToos.SqlQueryAllDept, null);
                return dtDept;
            }
        }

        public void InitTree(DataTable data)
        {
            this.tree_Main.Nodes.Clear();
            ExtAspNet.TreeNode node = new ExtAspNet.TreeNode();
            //node.NodeID = "1";
            //node.Text = "全部";
            //node.IconUrl = "~/Icons/package.png";
            //node.EnablePostBack = true;
            //node.Expanded = true;
            //this.tree_Main.Nodes.Add(node);
            if (data != null && data.Rows.Count != 0)
            {
                foreach (DataRow dr in data.Rows)
                {
                    if (dr["PARENT_ID"].ToString() == string.Empty)
                    {
                        node = new ExtAspNet.TreeNode();
                        node.NodeID = dr["DEPT_ID"].ToString();
                        node.Text = dr["DEPT_NAME"].ToString();
                        //node.IconUrl = "~/Icons/group.png";
                        node.Expanded = true;
                        node.EnablePostBack = true;
                        CreateTree(dr["DEPT_ID"].ToString(), node, data);
                        this.tree_Main.Nodes.Add(node);
                    }
                }
            }
        }
        /// <summary>
        /// 创建树节点
        /// </summary>
        /// <param name="parent">父编码</param>
        /// <param name="pnode">节点</param>
        /// <param name="featList">数据</param>
        public void CreateTree(string parent, ExtAspNet.TreeNode pnode, DataTable data)
        {
            foreach (DataRow dr in data.Rows)
            {
                if (dr["PARENT_ID"].ToString() == parent)
                {
                    ExtAspNet.TreeNode node = new ExtAspNet.TreeNode();
                    node.NodeID = dr["DEPT_ID"].ToString();
                    node.Text = dr["DEPT_NAME"].ToString();
                    //node.IconUrl = "~/Icons/group.png";
                    node.EnablePostBack = true;
                    CreateTree(dr["DEPT_ID"].ToString(), node, data);
                    pnode.Nodes.Add(node);
                }
            }
        }

        public void ExeBindDataType(System.Data.DataTable dtDataType)
        {
            ddl_Data_Type.DataValueField = "TYPE_ID";
            ddl_Data_Type.DataTextField = "TYPE_VALUE";
            ddl_Data_Type.DataSource = dtDataType;
            ddl_Data_Type.DataBind();
        }

        void ExeBindDataUser(System.Data.DataTable dtDataType)
        {
            ddl_Data_User.DataValueField = "USER_ID";
            ddl_Data_User.DataTextField = "USER_NAME";
            ddl_Data_User.DataSource = dtDataType;
            ddl_Data_User.DataBind();
        }

        public DataTable QueryFileType()
        {
            using (Adapter ad = new Adapter())
            {
                DataTable dtDept = ad.Query(CJia.Evaluation.Models.SqlToos.SqlQueryDataType, null);
                DataRow dr = dtDept.NewRow();
                dr["TYPE_ID"] = "0";
                dr["TYPE_VALUE"] = "<全部>";
                dtDept.Rows.InsertAt(dr, 0);
                return dtDept;
            }
        }

        protected void tree_Main_NodeCommand(object sender, ExtAspNet.TreeCommandEventArgs e)
        {
            string selectedId = tree_Main.SelectedNodeID;
            if (!String.IsNullOrEmpty(selectedId))
            {
                ExeBindDataUser(QueryUserByDeptID(selectedId));
            }
            else
            {
                Alert.ShowInTop("请选择节点!", MessageBoxIcon.Warning);
            }
        }

        DataTable QueryUserByDeptID(string DeptID)
        {
            using (Adapter ad = new Adapter())
            {
                object[] ob = new object[] { DeptID };
                DataTable dtDept = ad.Query(@"select user_id,user_name from gm_user GU
                                                                         where GU.STATUS = '1'
                                                                           AND Gu.DEPT_ID in (select dept_id
                                                                                from gm_dept
                                                                                start with dept_id = ?
                                                                                connect by prior dept_id = parent_id)", ob);
                DataRow dr = dtDept.NewRow();
                dr["USER_ID"] = "0";
                dr["USER_NAME"] = "<全部>";
                dtDept.Rows.InsertAt(dr, 0);
                return dtDept;
            }
        }

        protected void btn_Query_Click(object sender, EventArgs e)
        {
            using (Adapter ad = new Adapter())
            {
                object[] ob = new object[] { ddl_Data_Type.SelectedValue, ddl_Data_Type.SelectedValue, ddl_Data_User.SelectedValue, ddl_Data_User.SelectedValue, txt_Subject.Text, txt_Subject.Text, tree_Main.SelectedNodeID };
                DataTable dtFileData = ad.Query(@"select gd.data_id,
                                                                                gd.data_name,
                                                                                gd.data_content,
                                                                                gc.type_value,
                                                                                gu.user_name,
                                                                                gd.creater_date,
                                                                                tree_path
                                                                                from GM_DATA gd, gm_user gu, gm_type gc, vw_column_tree gct
                                                                                where gd.status = '1'
                                                                                and gd.data_type = gc.type_id
                                                                                and gd.creater_by = gu.user_id
                                                                                and gd.column_tree_id = gct.column_tree_id
                                                                                and (gd.data_type = ? or ? = '0')
                                                                                and (gd.creater_by = ? or ? = '0')
                                                                                and (gd.data_name like '%'||?||'%' or ? is null)
                                                                                and  Gu.DEPT_ID in (select dept_id
                                                                                from gm_dept
                                                                                start with dept_id = ?
                                                                                connect by prior dept_id = parent_id)", ob);
                BindGrid(gr_Data, dtFileData);
                Session["PageData"] = dtFileData;
            }
        }

        private void BindGrid(ExtAspNet.Grid grid, DataTable dtResult)
        {
            // 1.设置总项数
            grid.RecordCount = dtResult.Rows.Count;

            // 2.获取当前分页数据
            DataTable paged = dtResult.Clone();

            int rowbegin = grid.PageIndex * grid.PageSize;
            int rowend = (grid.PageIndex + 1) * grid.PageSize;
            if (rowend > dtResult.Rows.Count)
            {
                rowend = dtResult.Rows.Count;
            }

            for (int i = rowbegin; i < rowend; i++)
            {
                paged.ImportRow(dtResult.Rows[i]);
            }

            // 3.绑定到Grid
            grid.DataSource = paged;
            grid.DataBind();
        }

        protected void gr_Data_PageIndexChange(object sender, GridPageEventArgs e)
        {
            DataTable dtCheck = Session["PageData"] as DataTable;
            gr_Data.PageIndex = e.NewPageIndex;
            BindGrid(gr_Data, dtCheck);
        }

        protected void gr_Data_Sort(object sender, GridSortEventArgs e)
        {
            DataTable table = Session["PageData"] as DataTable;
            DataView view1 = table.DefaultView;
            view1.Sort = String.Format("{0} {1}", e.SortField, e.SortDirection);
            gr_Data.DataSource = view1;
            gr_Data.DataBind();
        }

        protected void gr_Data_RowCommand(object sender, GridCommandEventArgs e)
        {
            object[] keys = gr_Data.DataKeys[e.RowIndex];
            if (e.CommandName == "data_Query")
            {
                PageContext.RegisterStartupScript(window1.GetShowReference("EditData.aspx?DataId=" + keys[0].ToString() + "&OperType=Select", "添加资料"));
            }
        }
    }
}


text:
% prtOptionsClassPlot contains available options for plotting within the PRT
%
% Properties
%   nSamplesPerDim - 1x3 int array - number of samples to use for plotting
%       classifier confidence as a function of dimensionality [1D 2D 3D]
%       Default=[500 100 20]
%   colorsFunction - Function handle that returns the colors to use for
%       plotting datasets. Must accept an int (nClasses) and return an
%       nClassesx3 double of RGB colors Default=@prtPlotUtilClassColors;
%   symbolsFunction - Function handle that returns the symbols to use for
%       plotting datasets. Must accept an int (nClasses) and return a
%       1xnClasses char array of plotting symbols.
%       Default=@prtPlotUtilClassSymbols
%   twoClassColorMapFunction - Function handle that returns a colormap for
%       plotting confidence in two class problems. Must be able to accept
%       a single int (nColorInds) and return a valid MATLAB colormap
%       Default=@prtPlotUtilTwoClassColorMap
%   mappingFunction - A function handle that maps the confidence values
%       prior to visualization traditional plot function. Must accept a
%       double array of Nx1, Nx2, or Nx3 and return a double array of the
%       same size. Default=[]
%   additionalPlotFunction - A function handle that gets executed after the
%       traditional plot function. Must accept two arguments
%       (PrtActionObj, DataSet) Default=[]
%
% Methods
%   Obj = prtPlotOpt('paramName',paramVal,...) - Contructor
%

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

classdef prtOptionsClassPlot
    % xxx Need Help xxx
    properties
        nSamplesPerDim = [500 100 20]; % Number of samples to use for plotting
        colorsFunction = @prtPlotUtilClassColors; % Colors function handle

        twoClassColorMapFunction = @prtPlotUtilTwoClassColorMap; % Two class colormap function handle
    end

    methods
        function obj = prtOptionsClassPlot(varargin)
            obj = prtUtilAssignStringValuePairs(obj,varargin{:});
        end
    end
end


text:
var oauthRequest = require('../');
var credentials = require('./credentials');

var options = {
  consumerKey: credentials.key,
  consumerSecret: credentials.secret,
  url: 'http://api.v3.factual.com/t/products-cpg-nutrition',
  qs: {
    include_count: 't',
    q: '052000131512'
  }
}

oauthRequest(options, function (error, response) {
  if (error) {
    return console.log('Error: ', error);
  }
  console.log(response.body);
});


text:
require 'sensu-plugin/check/cli'
require 'socket'
require 'net/http'
require 'json'

class CheckZookeeperCluster < Sensu::Plugin::Check::CLI
  option :count,
         description: 'Zookeeper cluster node count',
         short: '-c count',
         long: '--count count',
         default: 3,
         proc: proc(&:to_i)

  option :zk_port,
         description: 'Zookeeper nodes\' listen port',
         short: '-p port',
         long: '--port port',
         default: 2181,
         proc: proc(&:to_i)

  option :exhibitor,
         description: 'exhibitor end node for status checks',
         short: '-e Exhibitor status end point',
         long: '--exhibitor status end point',
         default: 'http://localhost/exhibitor/v1/cluster/status'

  option :latency,
         description: 'Critical threshold for Zookeeper average latency',
         short: '-l TICKS',
         long: '--latency TICKS',
         proc: proc(&:to_i),
         default: 10

  option :timeout,
         description: 'How long to wait for a reply in seconds.',
         short: '-t SECS',
         long: '--timeout SECS',
         proc: proc(&:to_i),
         default: 5

  def zookeeper_latency(server, port)
    l = 0
    TCPSocket.open(server, port) do |socket|
      socket.write 'mntr'
      ready = IO.select([socket], nil, nil, config[:timeout])
      if ready.nil?
        critical %(Zookeeper did not respond to 'mntr' within #{config[:timeout]} seconds)
      end
      l = ready.first.first.read.chomp.split("\n")[1].split("\t")[1].to_i
    end
  end

  def check_ruok(server, port)
    result = false
    TCPSocket.open(server, port) do |socket|
      socket.write 'ruok'
      ready = IO.select([socket], nil, nil, config[:timeout])

      if ready.nil?
        critical %(Zookeeper did not respond to 'ruok' within #{config[:timeout]} seconds)
      end

      result = ready.first.first.read.chomp
    end
    result == 'imok'
  end

  def _leader_count(json)
    l_count = max_latency = 0
    json.each do |zk|
      l_count += 1 if zk['isLeader']
      l = zookeeper_latency(zk['hostname'], config[:zk_port])
      max_latency = [max_latency, l].max
    end
    [l_count, max_latency]
  end

  def _check_leader(json)
    e = []
    l_count, max_latency = _leader_count(json)
    unless l_count == 1
      e.push("cluster should have a leader (#{l_count})")
    end
    if max_latency > config[:latency]
      e.push("cluster should have a lower latecy #{max_latency}")
    end
    return [true, e] if l_count == 1 && max_latency < config[:latency]
    [false, e]
  end

  def check_exhibitor_endpoint(response)
    json = JSON.parse(response.body)
    e = []
    r = false
    if json.length == config[:count]
      r, e = _check_leader(json)
    else
      e = ["cluster size mismatch (#{json.length}!=#{config[:count]})"]
    end
    [r, json, e]
  end

  def check_exhibitor
    response = ''
    json = ''
    url = URI.parse(config[:exhibitor])
    req = Net::HTTP::Get.new(url.path)
    Net::HTTP.new(url.host, url.port).start do |http|
      response = http.request(req)
    end
    return [false, json, ['exhibitor status is not http 200']] unless
      response.is_a? Net::HTTPSuccess
    r, json, e = check_exhibitor_endpoint(response)
    [r, json, e]
  end

  def check_each_zk(json)
    r = true
    hosts = []
    json.each do |zk|
      r = check_ruok(zk['hostname'], config[:zk_port])
      hosts.push(zk['hostname'])
      return [false, ["#{zk['hostname']} is not ok"]] unless r
    end
    [true, hosts]
  end

  def run
    result, json, errors = check_exhibitor
    result, errors = check_each_zk(json) if result
    message errors.join(', ')
    ok if result
    critical
  end
end


text:
<?php

namespace SimpleLog\Test;

use SimpleLog\Log;
use SimpleLog\LogStatic;
use SimpleLog\Storage\File;
use SimpleLog\Message\DefaultInlineMessage;
use PHPUnit\Framework\TestCase;
use SimpleLog\Message\DefaultMessage;

class SimpleLogTest extends TestCase
{
    /**
     * name of test event log file
     */
    const NOTICE_LOG_NAME = '/notice.log';

    /**
     * name of test event log file
     */
    const WARNING_LOG_NAME = '/warning.log';

    /**
     * store generated log file path
     *
     * @var string
     */
    protected $logPath;

    /**
     * actions launched before test starts
     */
    protected function setUp()
    {
        $this->logPath = __DIR__ . '/log';

        $this->tearDown();
    }

    /**
     * @expectedException \Psr\Log\InvalidArgumentException
     * @expectedExceptionMessage Level not defined: incorrect
     */
    public function testCreateLogMessageWithIncorrectLevel()
    {
        (new Log(['log_path' => $this->logPath]))
            ->log('incorrect', 'Some log message');
    }

    /**
     * @expectedException \Psr\Log\InvalidArgumentException
     * @expectedExceptionMessage Incorrect message type. Must be string, array or object with __toString method.
     */
    public function testCreateIncorrectLogMessage()
    {
        (new Log(['log_path' => $this->logPath]))
            ->makeLog(12312312);
    }

    /**
     * simple create log object and create log message in given directory
     */
    public function testCreateSimpleLogMessage()
    {
        $log = new Log(['log_path' => $this->logPath]);

        $this->assertFileNotExists($this->logPath . self::NOTICE_LOG_NAME);

        $log->makeLog('Some log message');

        $this->assertFileExists($this->logPath . self::NOTICE_LOG_NAME);

        $content = file_get_contents($this->logPath . self::NOTICE_LOG_NAME);

        //because of different time and date of creating log file, we remove first line with date
        $this->assertEquals($this->getSampleContent(), substr($content, strpos($content, "\n") +1));
    }

    /**
     * simple create log object and create log message in given directory
     */
    public function testCreateMultipleSimpleLogMessage()
    {
        $log = new Log(['log_path' => $this->logPath]);

        $this->assertFileNotExists($this->logPath . self::NOTICE_LOG_NAME);

        $log->makeLog('Some log message');

        $this->assertFileExists($this->logPath . self::NOTICE_LOG_NAME);

        $log->makeLog('Some log message');

        $content = file_get_contents($this->logPath . self::NOTICE_LOG_NAME);
        //because of different time and date of creating log file, we remove first line with date
        $this->assertEquals(
            $this->getSampleContent() . $this->getSampleContent(),
            preg_replace('#[\d]{4}-[\d]{2}-[\d]{2} - [\d]{2}:[\d]{2}:[\d]{2}\n#', '', $content)
        );
    }

    public function testCreateSimpleLogWithOtherStorage()
    {
        $log = new Log([
            'storage' => new File(
                ['log_path' => $this->logPath]
            )
        ]);

        $this->assertFileNotExists($this->logPath . self::NOTICE_LOG_NAME);

        $log->makeLog('Some log message');

        $this->assertFileExists($this->logPath . self::NOTICE_LOG_NAME);
    }

    public function testCreateSimpleLogWithOtherMessage()
    {
        $log = new Log([
            'message' => new DefaultInlineMessage,
            'log_path' => $this->logPath,
        ]);

        $this->assertFileNotExists($this->logPath . self::NOTICE_LOG_NAME);

        $log->makeLog('Some log message');

        $this->assertFileExists($this->logPath . self::NOTICE_LOG_NAME);
    }

    public function testGetLastMessage()
    {
        $log = new Log(['log_path' => $this->logPath]);

        $log->makeLog('Some log message');

        $content = $log->getLastMessage();
        //because of different time and date of creating log file, we remove first line with date
        $this->assertEquals($this->getSampleContent(), substr($content, strpos($content, "\n") +1));
    }

    /**
     * simple create log object and create log message from array data in given directory
     */
    public function testCreateLogWithArrayMessage()
    {
        $log = new Log(['log_path' => $this->logPath]);

        $this->assertFileNotExists($this->logPath . self::NOTICE_LOG_NAME);

        $log->makeLog(
            [
                'message key' => 'some message',
                'another key' => 'some another message',
                'no key message',
            ]
        );

        $this->assertFileExists($this->logPath . self::NOTICE_LOG_NAME);

        $content = file_get_contents($this->logPath . self::NOTICE_LOG_NAME);

        //because of different time and date of creating log file, we remove first line with date
        $this->assertEquals($this->getArrayMessageContent(), substr($content, strpos($content, "\n") +1));
    }

    /**
     * simple create log object and create log message from array with sub arrays data in given directory
     */
    public function testCreateLogWithSubArrayMessage()
    {
        $log = new Log(['log_path' => $this->logPath]);

        $this->assertFileNotExists($this->logPath . self::NOTICE_LOG_NAME);

        $log->makeLog(
            [
                'sub array' => [
                    'key' => 'val',
                    'key 2' => 'val 2',
                ],
            ]
        );

        $this->assertFileExists($this->logPath . self::NOTICE_LOG_NAME);

        $content = file_get_contents($this->logPath . self::NOTICE_LOG_NAME);

        //because of different time and date of creating log file, we remove first line with date
        //hack with remove new lines because of differences between output and stored expectation
        $this->assertEquals(
            str_replace("\n", '', $this->getSubArrayMessageContent()),
            str_replace("\n", '', substr($content, strpos($content, "\n") +1))
        );
    }

    /**
     * test setting and getting options via specified methods
     */
    public function testCreateLogObjectWithOtherConfig()
    {
        $log = new Log;

        $this->assertFileNotExists($this->logPath . self::WARNING_LOG_NAME);

        $log->setOption('log_path', $this->logPath)
            ->setOption('level', 'warning')
            ->makeLog('Some log message');

        $this->assertFileExists($this->logPath . self::WARNING_LOG_NAME);
        $this->assertEquals('warning', $log->getOption('level'));
        $this->assertEquals(
            [
                'log_path' => $this->logPath,
                'level' => 'warning',
                'storage' => 'SimpleLog\Storage\File',
                'message' => DefaultMessage::class,
            ],
            $log->getOption()
        );
    }

    /**
     * check static log interface
     */
    public function testCreateStaticMakeLog()
    {
        LogStatic::setOption('log_path', $this->logPath);

        $this->assertFileNotExists($this->logPath . self::NOTICE_LOG_NAME);
        $this->assertEquals($this->logPath, LogStatic::getOption('log_path'));

        LogStatic::makeLog('Some log message');

        $this->assertFileExists($this->logPath . self::NOTICE_LOG_NAME);
    }

    /**
     * check static log interface
     */
    public function testCreateStaticLog()
    {
        LogStatic::setOption('log_path', $this->logPath);

        $this->assertFileNotExists($this->logPath . self::NOTICE_LOG_NAME);
        $this->assertEquals($this->logPath, LogStatic::getOption('log_path'));

        LogStatic::log('notice', 'Some log message');

        $this->assertFileExists($this->logPath . self::NOTICE_LOG_NAME);
    }

    public function testLogWithContext()
    {
        $log = new Log(['log_path' => $this->logPath]);

        $this->assertFileNotExists($this->logPath . self::NOTICE_LOG_NAME);

        $log->makeLog('Some log message with {context}', ['context' => 'some value']);

        $this->assertFileExists($this->logPath . self::NOTICE_LOG_NAME);

        $content = file_get_contents($this->logPath . self::NOTICE_LOG_NAME);

        //because of different time and date of creating log file, we remove first line with date
        $this->assertEquals(
            $this->getSampleContentWithContext(),
            substr($content, strpos($content, "\n") +1)
        );
    }

    protected function getSampleContent()
    {
        return <<<EOT
Some log message
-----------------------------------------------------------

EOT;
    }

    protected function getSampleContentWithContext()
    {
        return <<<EOT
Some log message with some value
-----------------------------------------------------------

EOT;
    }

    protected function getArrayMessageContent()
    {
        return <<<EOT
- message key: some message
- another key: some another message
- no key message
-----------------------------------------------------------

EOT;
    }

    protected function getSubArrayMessageContent()
    {
        return <<<EOT
- sub array:
    - key: val
    - key 2: val 2
-----------------------------------------------------------

EOT;
    }

    /**
     * actions launched after test was finished
     */
    protected function tearDown()
    {
        if (file_exists($this->logPath . self::NOTICE_LOG_NAME)) {
            unlink($this->logPath . self::NOTICE_LOG_NAME);
        }

        if (file_exists($this->logPath . self::WARNING_LOG_NAME)) {
            unlink($this->logPath . self::WARNING_LOG_NAME);
        }

        if (file_exists($this->logPath)) {
            rmdir($this->logPath);
        }
    }
}


text:
package net.piemaster.jario.systems.handling;

import net.piemaster.jario.components.Collisions;
import net.piemaster.jario.components.Health;
import net.piemaster.jario.components.Invulnerable;
import net.piemaster.jario.components.Recovering;
import net.piemaster.jario.components.Shell;
import net.piemaster.jario.components.Velocity;
import net.piemaster.jario.systems.CollisionSystem.EdgeType;
import net.piemaster.jario.systems.SoundSystem;

import com.artemis.ComponentMapper;
import com.artemis.Entity;

public class ShellHandlingSystem extends EnemyHandlingSystem
{
	private ComponentMapper<Shell> shellMapper;

	@SuppressWarnings("unchecked")
	public ShellHandlingSystem()
	{
		super(Shell.class, Collisions.class);
	}

	@Override
	public void initialize()
	{
		super.initialize();

		shellMapper = new ComponentMapper<Shell>(Shell.class, world);
	}

	@Override
	protected void handlePlayerCollision(Entity shell, Entity player, EdgeType edge)
	{
		if(player.getComponent(Recovering.class) != null)
			return;

		Invulnerable invuln = player.getComponent(Invulnerable.class);
		if(invuln != null)
		{
			if(!invuln.isDeadly())
				return;
			else
			{
				// Let the HealthSystem do the generic death stuff
				shell.addComponent(new Health(0f));
				shell.refresh();
				velocityMapper.get(shell).setY(-0.3f);
				EdgeType sideEdge = determineSideEdge(shell, player, edge);
				velocityMapper.get(shell).setX(0.1f * (sideEdge == EdgeType.EDGE_LEFT ? 1 : -1));
				SoundSystem.pushSound(SoundSystem.POP_SOUND, shell);
			}
		}
		else
		{
			Velocity vel = velocityMapper.get(shell);

			if (vel.getX() == 0)
				kick(shell, player, edge);
			else if (edge == EdgeType.EDGE_TOP)
				stop(shell);
		}
	}

	@Override
	protected void handleWeaponCollision(Entity shell, Entity weapon, EdgeType edge)
	{
		Velocity vel = velocityMapper.get(shell);

		if (vel.getX() == 0)
			kick(shell, edge);
		else
		{
			int dir = (edge == EdgeType.EDGE_RIGHT) ? -1 : 1;
			int vDir = (int) Math.signum(vel.getX());
			if (dir == vDir)
				stop(shell);
			else
				kick(shell, edge);
		}
	}

	@Override
	protected void handleTerrainCollision(Entity shell, Entity terrain, EdgeType edge)
	{
		super.handleTerrainCollision(shell, terrain, edge);

		if(edge == EdgeType.EDGE_LEFT || edge == EdgeType.EDGE_RIGHT)
		{
			SoundSystem.pushSound(SoundSystem.QUIET_CLICK_SOUND, shell);
		}
	}

	// -------------------------------------------------------------------------

	private void kick(Entity shell, EdgeType collEdge)
	{
		int dir = (collEdge == EdgeType.EDGE_RIGHT) ? -1 : 1;

		Velocity vel = velocityMapper.get(shell);
		vel.setX(shellMapper.get(shell).getKickSpeed() * dir);

		SoundSystem.pushSound(SoundSystem.POP_SOUND, shell);
	}

	private void kick(Entity shell, Entity collider, EdgeType collEdge)
	{
		placeEntityOnOther(shell, collider, reverseEdge(collEdge));

		kick(shell, determineSideEdge(shell, collider, collEdge));
	}

	private EdgeType determineSideEdge(Entity shell, Entity collider, EdgeType collEdge)
	{
		if (collEdge == EdgeType.EDGE_TOP || collEdge == EdgeType.EDGE_BOTTOM)
		{
			float cMid = transformMapper.get(collider).getX()
					+ spatialMapper.get(collider).getWidth() / 2;
			float sMid = transformMapper.get(shell).getX() + spatialMapper.get(shell).getWidth()
					/ 2;
			return (cMid < sMid) ? EdgeType.EDGE_LEFT : EdgeType.EDGE_RIGHT;
		}
		else
		{
			return collEdge;
		}
	}

	private void stop(Entity shell)
	{
		velocityMapper.get(shell).setX(0);
		SoundSystem.pushSound(SoundSystem.POP_SOUND, shell);
	}
}


text:
Profile

            <form class="form-horizontal">

                    Username:

                        <input readonly ng-model="model.puser.username" type="text" class="form-control" id="username" placeholder="Username">

                    Password:

                        <input readonly ng-model="model.puser.password" type="password" class="form-control" id="password" placeholder="Password">

                    First Name:

                        <input ng-model="model.puser.firstName" type="text" class="form-control" id="firstname" placeholder="First Name">

                    Last Name:

                        <input ng-model="model.puser.lastName" type="text" class="form-control" id="lastname" placeholder="Last Name">

                    Email:

                        <input ng-model="model.puser.email" type="text" class="form-control" id="email" placeholder="Email">

                    Phone Number:

                        <input ng-model="model.puser.phone" type="text" class="form-control" id="phone" placeholder="123-456-7890">

                        Update

            </form>


text:
# 与其它构建工具整合

构建工具

* [Babel](integrating-with-build-tools.md#babel)
* [Browserify](integrating-with-build-tools.md#browserify)
* [Duo](integrating-with-build-tools.md#duo)
* [Grunt](integrating-with-build-tools.md#grunt)
* [Gulp](integrating-with-build-tools.md#gulp)
* [Jspm](integrating-with-build-tools.md#jspm)
* [Webpack](integrating-with-build-tools.md#webpack)
* [MSBuild](integrating-with-build-tools.md#msbuild)
* [NuGet](integrating-with-build-tools.md#nuget)

## Babel

### 安装

```bash
npm install @babel/cli @babel/core @babel/preset-typescript --save-dev
```

### .babelrc

```javascript
{
  "presets": ["@babel/preset-typescript"]
}
```

### 使用命令行工具

```bash
./node_modules/.bin/babel --out-file bundle.js src/index.ts
```

### package.json

```javascript
{
  "scripts": {
    "build": "babel --out-file bundle.js main.ts"
  },
}
```

### 在命令行上运行Babel

```bash
npm run build
```

## Browserify

### 安装

```bash
npm install tsify
```

### 使用命令行交互

```bash
browserify main.ts -p [ tsify --noImplicitAny ] > bundle.js
```

### 使用API

```javascript
var browserify = require("browserify");
var tsify = require("tsify");

browserify()
    .add('main.ts')
    .plugin('tsify', { noImplicitAny: true })
    .bundle()
    .pipe(process.stdout);
```

更多详细信息:[smrq/tsify](https://github.com/smrq/tsify)

## Duo

### 安装

```bash
npm install duo-typescript
```

### 使用命令行交互

```bash
duo --use duo-typescript entry.ts
```

### 使用API

```javascript
var Duo = require('duo');
var fs = require('fs')
var path = require('path')
var typescript = require('duo-typescript');

var out = path.join(__dirname, "output.js")

Duo(__dirname)
    .entry('entry.ts')
    .use(typescript())
    .run(function (err, results) {
        if (err) throw err;
        // Write compiled result to output file
        fs.writeFileSync(out, results.code);
    });
```

更多详细信息:[frankwallis/duo-typescript](https://github.com/frankwallis/duo-typescript)

## Grunt

### 安装

```bash
npm install grunt-ts
```

### 基本Gruntfile.js

```javascript
module.exports = function(grunt) {
    grunt.initConfig({
        ts: {
            default : {
                src: ["**/*.ts", "!node_modules/**/*.ts"]
            }
        }
    });
    grunt.loadNpmTasks("grunt-ts");
    grunt.registerTask("default", ["ts"]);
};
```

更多详细信息:[TypeStrong/grunt-ts](https://github.com/TypeStrong/grunt-ts)

## Gulp

### 安装

```bash
npm install gulp-typescript
```

### 基本gulpfile.js

```javascript
var gulp = require("gulp");
var ts = require("gulp-typescript");

gulp.task("default", function () {
    var tsResult = gulp.src("src/*.ts")
        .pipe(ts({
              noImplicitAny: true,
              out: "output.js"
        }));
    return tsResult.js.pipe(gulp.dest('built/local'));
});
```

更多详细信息:[ivogabe/gulp-typescript](https://github.com/ivogabe/gulp-typescript)

## Jspm

### 安装

```bash
npm install -g jspm@beta
```

_注意:目前jspm的0.16beta版本支持TypeScript_

更多详细信息:[TypeScriptSamples/jspm](https://github.com/Microsoft/TypeScriptSamples/tree/master/jspm)

## Webpack

### 安装

```bash
npm install ts-loader --save-dev
```

### Webpack 2 webpack.config.js 基础配置

```javascript
module.exports = {
    entry: "./src/index.tsx",
    output: {
        path: '/',
        filename: "bundle.js"
    },
    resolve: {
        extensions: [".tsx", ".ts", ".js", ".json"]
    },
    module: {
        rules: [
            // all files with a '.ts' or '.tsx' extension will be handled by 'ts-loader'
            { test: /\.tsx?$/, use: ["ts-loader"], exclude: /node_modules/ }
        ]
    }
}
```

### Webpack 1 webpack.config.js 基础配置

```javascript
module.exports = {
    entry: "./src/index.tsx",
    output: {
        filename: "bundle.js"
    },
    resolve: {
        // Add '.ts' and '.tsx' as a resolvable extension.
        extensions: ["", ".webpack.js", ".web.js", ".ts", ".tsx", ".js"]
    },
    module: {
        loaders: [
            // all files with a '.ts' or '.tsx' extension will be handled by 'ts-loader'
            { test: /\.tsx?$/, loader: "ts-loader" }
        ]
    }
};
```

查看[更多关于ts-loader的详细信息](https://www.npmjs.com/package/ts-loader)

或者

* [awesome-typescript-loader](https://www.npmjs.com/package/awesome-typescript-loader)

## MSBuild

更新工程文件,包含本地安装的`Microsoft.TypeScript.Default.props`(在顶端)和`Microsoft.TypeScript.targets`(在底部)文件:

```markup
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <!-- Include default props at the top -->
  <Import
      Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TypeScript\Microsoft.TypeScript.Default.props"
      Condition="Exists('$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TypeScript\Microsoft.TypeScript.Default.props')" />

  <!-- TypeScript configurations go here -->
  <PropertyGroup Condition="'$(Configuration)' == 'Debug'">
    <TypeScriptRemoveComments>false</TypeScriptRemoveComments>
    <TypeScriptSourceMap>true</TypeScriptSourceMap>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)' == 'Release'">
    <TypeScriptRemoveComments>true</TypeScriptRemoveComments>
    <TypeScriptSourceMap>false</TypeScriptSourceMap>
  </PropertyGroup>

  <!-- Include default targets at the bottom -->
  <Import
      Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TypeScript\Microsoft.TypeScript.targets"
      Condition="Exists('$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TypeScript\Microsoft.TypeScript.targets')" />
</Project>
```

关于配置MSBuild编译器选项的更多详细信息,请参考:[在MSBuild里使用编译选项](compiler-options-in-msbuild.md)

## NuGet

* 右键点击 -> Manage NuGet Packages
* 查找`Microsoft.TypeScript.MSBuild`
* 点击`Install`
* 安装完成后,Rebuild。

更多详细信息请参考[Package Manager Dialog](http://docs.nuget.org/Consume/Package-Manager-Dialog)和[using nightly builds with NuGet](https://github.com/Microsoft/TypeScript/wiki/Nightly-drops#using-nuget-with-msbuild)


text:
<pnp:Provisioning xmlns:pnp="http://schemas.dev.office.com/PnP/2015/05/ProvisioningSchema">
  <pnp:Preferences Author="John White" Version="1.0" Generator="Human being :-)">
    <pnp:Parameters>
      <pnp:Parameter Key="O365TenantName">contoso</pnp:Parameter>
      <pnp:Parameter Key="CodeProvidedParam" Required="true"/>
      <pnp:Parameter Key="YammerNetwork">contoso.com</pnp:Parameter>
      <pnp:Parameter Key="lcid">1033</pnp:Parameter>
      <pnp:Parameter Key="CompanyName">Contoso Inc.</pnp:Parameter>
    </pnp:Parameters>
  </pnp:Preferences>
  <pnp:Templates ID="SAMPLE-TEMPLATES">

    <pnp:ProvisioningTemplateFile ID="WORKFLOWSITE" File="ProvisioningSchema-2015-05-ReferenceSample-01.xml" />

    <pnp:ProvisioningTemplate ID="SPECIALTEAM" Version="1.0">

      <pnp:SitePolicy>HBI</pnp:SitePolicy>

      <pnp:PropertyBagEntries>
        <pnp:PropertyBagEntry Key="KEY1" Value ="value1" />
        <pnp:PropertyBagEntry Key="KEY2" Value ="value2" />
      </pnp:PropertyBagEntries>

      <pnp:Security>
        <pnp:AdditionalAdministrators>
          <pnp:User Name="user@contoso.com"/>
          <pnp:User Name="U_SHAREPOINT_ADMINS"/>
        </pnp:AdditionalAdministrators>
        <pnp:AdditionalOwners>
          <pnp:User Name="user@contoso.com"/>
          <pnp:User Name="U_SHAREPOINT_ADMINS"/>
        </pnp:AdditionalOwners>
        <pnp:AdditionalMembers>
          <pnp:User Name="user@contoso.com"/>
          <pnp:User Name="U_SHAREPOINT_ADMINS"/>
        </pnp:AdditionalMembers>
        <pnp:AdditionalVisitors>
          <pnp:User Name="user@contoso.com"/>
          <pnp:User Name="U_SHAREPOINT_ADMINS"/>
        </pnp:AdditionalVisitors>
      </pnp:Security>

      <pnp:SiteFields>
        <Field ID="{23203E97-3BFE-40CB-AFB4-07AA2B86BF45}" Type="Text" Name="ProjectID" DisplayName="Project ID" Group="Base.Foundation.Columns" MaxLength="255" AllowDeletion="TRUE" />
        <Field ID="{B01B3DBC-4630-4ED1-B5BA-321BC7841E3D}" Type="Text" Name="ProjectName" DisplayName="Project Name" Group="Base.Foundation.Columns" MaxLength="255" AllowDeletion="TRUE" />
        <Field ID="{A5DE9600-B7A6-42DD-A05E-10D4F1500208}" Type="Text" Name="ProjectManager" DisplayName="Project Manager" Group="Base.Foundation.Columns"  MaxLength="255" AllowDeletion="TRUE" />
        <Field ID="{F1A1715E-6C52-40DE-8403-E9AAFD0470D0}" Type="Text" Name="DocumentDescription" DisplayName="Document Description" Group="Base.Foundation.Columns" MaxLength="255" AllowDeletion="TRUE" />
      </pnp:SiteFields>

      <pnp:ContentTypes>
        <pnp:ContentType ID="0x01005D4F34E4BE7F4B6892AEBE088EDD215E"
                     Name="General Project Document"
                     Group="Base Foundation Content Types"
                     Description="General Project Document Content Type">
          <pnp:FieldRefs>
            <!-- Project ID -->
            <pnp:FieldRef ID="{23203E97-3BFE-40CB-AFB4-07AA2B86BF45}" />
            <!-- Project Name -->
            <pnp:FieldRef ID="{B01B3DBC-4630-4ED1-B5BA-321BC7841E3D}" />
            <!-- Project Manager -->
            <pnp:FieldRef ID="{A5DE9600-B7A6-42DD-A05E-10D4F1500208}" />
            <!-- Project Description -->
            <pnp:FieldRef ID="{F1A1715E-6C52-40DE-8403-E9AAFD0470D0}" />
          </pnp:FieldRefs>
        </pnp:ContentType>

      </pnp:ContentTypes>

      <pnp:Lists>
        <pnp:ListInstance Title="{CompanyName} - Projects"
                    Description="Project Documents are stored here"
                    DocumentTemplate=""
                    OnQuickLaunch="true"
                    TemplateType="101"
                    Url="Lists/Projects"
                    EnableVersioning="true"
                    RemoveExistingContentTypes="false">
          <pnp:ContentTypeBindings>
            <pnp:ContentTypeBinding ContentTypeID="0x01005D4F34E4BE7F4B6892AEBE088EDD215E" Default="true"/>
          </pnp:ContentTypeBindings>
          <pnp:DataRows>
            <pnp:DataRow>
              <pnp:DataValue FieldName="ProjectID">PRJ01</pnp:DataValue>
              <pnp:DataValue FieldName="ProjectName">Sample Project 01</pnp:DataValue>
              <pnp:DataValue FieldName="ProjectManager">Me</pnp:DataValue>
              <pnp:DataValue FieldName="ProjectDescription">This is a sample Project</pnp:DataValue>
            </pnp:DataRow>
            <pnp:DataRow>
              <pnp:DataValue FieldName="ProjectID">PRJ021</pnp:DataValue>
              <pnp:DataValue FieldName="ProjectName">Sample Project 02</pnp:DataValue>
              <pnp:DataValue FieldName="ProjectManager">You</pnp:DataValue>
              <pnp:DataValue FieldName="ProjectDescription">This is another sample Project</pnp:DataValue>
            </pnp:DataRow>
          </pnp:DataRows>
        </pnp:ListInstance>
        <pnp:ListInstance Title="General Documents"
                     Description="Project Documents are stored here"
                     DocumentTemplate=""
                     OnQuickLaunch="true"
                     TemplateType="101"
                     Url="Lists/GeneralDocuments"
                     EnableVersioning="true"
                     RemoveExistingContentTypes="true">
          <pnp:ContentTypeBindings>
            <pnp:ContentTypeBinding ContentTypeID="0x01005D4F34E4BE7F4B6892AEBE088EDD215E" Default="true"/>
          </pnp:ContentTypeBindings>
        </pnp:ListInstance>
      </pnp:Lists>

      <pnp:Features>
        <pnp:SiteFeatures>
          <pnp:Feature ID="b50e3104-6812-424f-a011-cc90e6327318" Description="Document ID Service (DocID) site collection feature" />
          <pnp:Feature ID="9c0834e1-ba47-4d49-812b-7d4fb6fea211" Description="Search Server Web Parts and Templates (SearchMaster) site collection feature" />
          <pnp:Feature ID="0af5989a-3aea-4519-8ab0-85d91abe39ff" Deactivate="true" Description="Workflows (Workflows) site collection feature" />
        </pnp:SiteFeatures>
        <pnp:WebFeatures>
          <pnp:Feature ID="7201d6a4-a5d3-49a1-8c19-19c4bac6e668" Deactivate="false" Description="Metadata Navigation and Filtering (MetaDataNav) site feature" />
          <pnp:Feature ID="961d6a9c-4388-4cf2-9733-38ee8c89afd4" Description="Community Site Feature (CommunitySite) site feature" />
          <pnp:Feature ID="e2f2bb18-891d-4812-97df-c265afdba297" Description="Project Functionality (ProjectFunctionality) site feature" />
          <pnp:Feature ID="4aec7207-0d02-4f4f-aa07-b370199cd0c7" Deactivate="true" Description="Getting Started (GettingStarted) site feature" />
        </pnp:WebFeatures>
      </pnp:Features>

      <pnp:CustomActions>
        <pnp:SiteCustomActions>
          <!--Must have deployed the Provider Hosted App, for Rights see Microsoft.SharePoint.Client.PermissionKind -->
          <pnp:CustomAction Name="CA_SITE_SETTINGS_SITECLASSIFICATION" Description="Site Classification Application" Group="SiteTasks" Location="Microsoft.SharePoint.SiteSettings" Title="Site Classification" Sequence="1000" Url="https://spmanaged.azurewebsites.net/pages/index.aspx?SPHostUrl={0}" Rights="31" Enabled="true"/>
          <pnp:CustomAction Name="CA_STDMENU_SITECLASSIFICATION" Description="Site Classification Application" Group="SiteActions" Location="Microsoft.SharePoint.StandardMenu" Title="Site Classification" Sequence="1000" Url="https://spmanaged.azurewebsites.net/pages/index.aspx?SPHostUrl={0}" Rights="31" Enabled="true"/>
        </pnp:SiteCustomActions>
        <pnp:WebCustomActions>
          <pnp:CustomAction Name="CA_SUBSITE_OVERRIDE" Description="Override new sub-site link" Group="SiteTasks" Location="Microsoft.SharePoint.SiteSettings" Title="SubSite Overide" Sequence="1000" Url="https://spmanaged.azurewebsites.net/pages/index.aspx?SPHostUrl={0}" Rights="31" Enabled="true"/>
        </pnp:WebCustomActions>
      </pnp:CustomActions>

      <pnp:Files>
        <pnp:File Src="Logo.png" Folder="SiteAssets" Overwrite="true" />
        <pnp:File Src="CustomPage.aspx" Folder="SitePages" Overwrite="true" />
        <pnp:File Src="CustomMaster.master" Folder="_catalogs/MasterPage" Overwrite="true" />
        <pnp:File Src="Custom.spcolor" Folder="_catalogs/Theme/15" Overwrite="true" />
        <pnp:File Src="Custom.spfont" Folder="_catalogs/Theme/15" Overwrite="true" />
      </pnp:Files>

      <pnp:Pages>
        <pnp:Page Layout="TwoColumns" Overwrite="true" Url="{site}/SitePages/DemoWikiPage.aspx"></pnp:Page>
      </pnp:Pages>

      <pnp:TermGroups>
        <pnp:TermGroup ID="{0E8F395E-FF58-4D45-9FF7-E331AB728BEB}" Name="{CompanyName} TermSets">
          <pnp:TermSets>
            <pnp:TermSet Name="Projects" ID="{5880B01B-5D6F-4606-A492-3B03A2FB4DD7}" Language="1040">
              <pnp:Terms>
                <pnp:Term Name="IT Projects" ID="{3D212FC2-F176-4621-AED1-128219666D95}">
                  <pnp:CustomProperties>
                    <pnp:Property Key="Property1" Value="Value1" />
                    <pnp:Property Key="Property2" Value="Value2" />
                  </pnp:CustomProperties>
                  <pnp:LocalCustomProperties>
                    <pnp:Property Key="LocalProperty1" Value="Value1" />
                    <pnp:Property Key="LocalProperty2" Value="Value2" />
                  </pnp:LocalCustomProperties>
                  <pnp:Terms>
                    <pnp:Term Name="Cloud" ID="{87C55100-8316-4DA0-97FD-FEB5731880F6}">
                      <pnp:Labels>
                        <pnp:Label Language="1040" Value="Nuvola"/>
                      </pnp:Labels>
                    </pnp:Term>
                    <pnp:Term Name="New Farm" ID="{C422BD0D-681D-448F-A41E-C71C473A95CC}">
                      <pnp:Labels>
                        <pnp:Label Language="1040" Value="Nuova Farm"/>
                      </pnp:Labels>
                    </pnp:Term>
                  </pnp:Terms>
                </pnp:Term>
                <pnp:Term Name="HSE Projects" ID="{1F1B9EE8-74EA-4D89-B502-FEAA44340385}">
                  <pnp:Terms>
                    <pnp:Term Name="Security Assessment" ID="{3279FE80-95DB-4D35-B235-A9B2F0FB6F9E}">
                      <pnp:Labels>
                        <pnp:Label Language="1040" Value="Valutazione Sicurezza"/>
                      </pnp:Labels>
                    </pnp:Term>
                    <pnp:Term Name="Safety Program" ID="{FBEA36EA-A750-4A97-9667-5D51A6C895AF}">
                      <pnp:Labels>
                        <pnp:Label Language="1040" Value="Programma Sicurezza"/>
                      </pnp:Labels>
                    </pnp:Term>
                  </pnp:Terms>
                </pnp:Term>
              </pnp:Terms>
            </pnp:TermSet>
          </pnp:TermSets>
        </pnp:TermGroup>
      </pnp:TermGroups>

      <pnp:ComposedLook Name="Custom Look" Version="1"
        BackgroundFile="{sitecollection}/Resources/Themes/Contoso/contosobg.jpg"
        AlternateCSS="{sitecollection}/Resources/Themes/Contoso/Contoso.css"
        MasterPage="{sitecollection}/_catalogs/MasterPage/CustomMaster.master"
        ColorFile="{sitecollection}/_catalogs/Theme/15/Custom.spcolor"
        FontFile="{sitecollection}/_catalogs/Theme/15/Custom.spfont"
        SiteLogo="{sitecollection}/SiteAssets/Logo.png" />

      <pnp:Providers>
        <pnp:Provider HandlerType="OfficeDev.PnP.Provisioning.Providers.FakeProvider, OfficeDev.PnP.Provisioning.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" Enabled="false">
          <pnp:Configuration>
            <MyProviderConfiguration id="SampleConfig" xmlns="http://schemas.somecompany.com/MyProviderConfiguration">
              <ChildNode Attribute="value">TextContent</ChildNode>
            </MyProviderConfiguration>
          </pnp:Configuration>
        </pnp:Provider>
        <pnp:Provider HandlerType="MySampleProviderNode.js" Enabled="false">
          <pnp:Configuration>
            <AnotherConfiguration id="AnotherConfig" xmlns="http://schemas.othercompany.com/AnotherConfiguration" />
          </pnp:Configuration>
        </pnp:Provider>
      </pnp:Providers>

    </pnp:ProvisioningTemplate>

  </pnp:Templates>

  <pnp:Sequence ID="SAMPLE-SEQUENCE" SequenceType="Synchronous">

    <!-- Let's create a Site Collection -->
    <pnp:SiteCollection Language="1040"
                        PrimarySiteCollectionAdmin="john@contoso.com"
                        MembersCanShare="true"
                        TimeZone="GMT+1"
                        Title="{CompanyName} Intranet"
                        Url="https://{O365TenantName}.sharepoint.com/sites/Intranet">
      <pnp:Templates>
        <!-- And let's use the SPECIALTEAM SharePointProvisioningTemplate -->
        <pnp:ProvisioningTemplateReference ID="SPECIALTEAM" />
      </pnp:Templates>
    </pnp:SiteCollection>

    <!-- Now create a Site into the previously created Site Collection -->
    <pnp:Site Language="1040"
              QuickLaunchEnabled="true"
              TimeZone="GMT+1"
              Title="{CompanyName} Intranet Workflows"
              Url="Workflows"
              UseSamePermissionsAsParentSite="true">
      <pnp:Templates>
        <pnp:ProvisioningTemplateReference ID="WORKFLOWSITE" />
      </pnp:Templates>
    </pnp:Site>

    <!-- Provision the TermStore -->
    <pnp:TermStore Scope="Current">
      <pnp:TermGroup ID="{0E8F395E-FF58-4D45-9FF7-E331AB728BEB}" Name="{CompanyName} TermSets">
        <pnp:TermSets>
          <pnp:TermSet Name="Projects" ID="{5880B01B-5D6F-4606-A492-3B03A2FB4DD7}">
            <pnp:Terms>
              <pnp:Term Name="IT Projects" ID="{3D212FC2-F176-4621-AED1-128219666D95}">
                <pnp:CustomProperties>
                  <pnp:Property Key="Property1" Value="Value1" />
                  <pnp:Property Key="Property2" Value="Value2" />
                </pnp:CustomProperties>
                <pnp:LocalCustomProperties>
                  <pnp:Property Key="LocalProperty1" Value="Value1" />
                  <pnp:Property Key="LocalProperty2" Value="Value2" />
                </pnp:LocalCustomProperties>
                <pnp:Terms>
                  <pnp:Term Name="Cloud" ID="{87C55100-8316-4DA0-97FD-FEB5731880F6}">
                    <pnp:Labels>
                      <pnp:Label Language="1040" Value="Nuvola"/>
                    </pnp:Labels>
                  </pnp:Term>
                  <pnp:Term Name="New Farm" ID="{C422BD0D-681D-448F-A41E-C71C473A95CC}">
                    <pnp:Labels>
                      <pnp:Label Language="1040" Value="Nuova Farm"/>
                    </pnp:Labels>
                  </pnp:Term>
                </pnp:Terms>
              </pnp:Term>
              <pnp:Term Name="HSE Projects" ID="{1F1B9EE8-74EA-4D89-B502-FEAA44340385}">
                <pnp:Terms>
                  <pnp:Term Name="Security Assessment" ID="{3279FE80-95DB-4D35-B235-A9B2F0FB6F9E}">
                    <pnp:Labels>
                      <pnp:Label Language="1040" Value="Valutazione Sicurezza"/>
                    </pnp:Labels>
                  </pnp:Term>
                  <pnp:Term Name="Safety Program" ID="{FBEA36EA-A750-4A97-9667-5D51A6C895AF}">
                    <pnp:Labels>
                      <pnp:Label Language="1040" Value="Programma Sicurezza"/>
                    </pnp:Labels>
                  </pnp:Term>
                </pnp:Terms>
              </pnp:Term>
            </pnp:Terms>
          </pnp:TermSet>
        </pnp:TermSets>
      </pnp:TermGroup>
    </pnp:TermStore>

    <pnp:Extensions>
      <my:CustomExtension xmlns:my="http://tempuri"/>
      <my2:AnotherExtension xmlns:my2="http://tempuri2"/>
    </pnp:Extensions>

  </pnp:Sequence>

  <pnp:ImportSequence File="AnotherSequence.xml" />

</pnp:Provisioning>


text:
package com.microsoft.azure.cognitiveservices.search.imagesearch.models;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.annotation.JsonTypeName;

/**
 * Defines a cooking recipe.
 */
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "_type", defaultImpl = Recipe.class)
@JsonTypeName("Recipe")
public class Recipe extends CreativeWork {
    /**
     * The amount of time the food takes to cook. For example, PT25M. For
     * information about the time format, see
     * http://en.wikipedia.org/wiki/ISO_8601#Durations.
     */
    @JsonProperty(value = "cookTime", access = JsonProperty.Access.WRITE_ONLY)
    private String cookTime;

    /**
     * The amount of time required to prepare the ingredients. For example,
     * PT15M. For information about the time format, see
     * http://en.wikipedia.org/wiki/ISO_8601#Durations.
     */
    @JsonProperty(value = "prepTime", access = JsonProperty.Access.WRITE_ONLY)
    private String prepTime;

    /**
     * The total amount of time it takes to prepare and cook the recipe. For
     * example, PT45M. For information about the time format, see
     * http://en.wikipedia.org/wiki/ISO_8601#Durations.
     */
    @JsonProperty(value = "totalTime", access = JsonProperty.Access.WRITE_ONLY)
    private String totalTime;

    /**
     * Get the cookTime value.
     *
     * @return the cookTime value
     */
    public String cookTime() {
        return this.cookTime;
    }

    /**
     * Get the prepTime value.
     *
     * @return the prepTime value
     */
    public String prepTime() {
        return this.prepTime;
    }

    /**
     * Get the totalTime value.
     *
     * @return the totalTime value
     */
    public String totalTime() {
        return this.totalTime;
    }

}


text:
package com.mindcoders.phial.internal;

import android.app.Application;
import android.content.Context;
import android.content.SharedPreferences;
import android.support.annotation.NonNull;

import com.mindcoders.phial.Attacher;
import com.mindcoders.phial.ListAttacher;
import com.mindcoders.phial.OverlayCallback;
import com.mindcoders.phial.Page;
import com.mindcoders.phial.PhialBuilder;
import com.mindcoders.phial.R;
import com.mindcoders.phial.TargetScreen;
import com.mindcoders.phial.internal.keyvalue.InfoWriter;
import com.mindcoders.phial.internal.keyvalue.KVAttacher;
import com.mindcoders.phial.internal.keyvalue.KVSaver;
import com.mindcoders.phial.internal.keyvalue.KeyValueView;
import com.mindcoders.phial.internal.share.ShareManager;
import com.mindcoders.phial.internal.share.ShareView;
import com.mindcoders.phial.internal.share.attachment.AttacherAdaptor;
import com.mindcoders.phial.internal.share.attachment.AttachmentManager;
import com.mindcoders.phial.internal.share.attachment.ScreenShotAttacher;
import com.mindcoders.phial.internal.util.CurrentActivityProvider;
import com.mindcoders.phial.keyvalue.Phial;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

import static com.mindcoders.phial.internal.InternalPhialConfig.DEFAULT_SHARE_IMAGE_QUALITY;

/**
 * Created by rost on 10/23/17.
 */

public final class PhialCore {
    public static final String KEYVALUE_PAGE_KEY = "keyvalue";
    public static final String SHARE_PAGE_KEY = "share";
    private final Application application;
    private final ShareManager shareManager;
    private final AttachmentManager attachmentManager;
    private final KVSaver kvSaver;
    private final PhialNotifier notifier;
    private final CurrentActivityProvider activityProvider;
    private final ScreenTracker screenTracker;
    private final SharedPreferences sharedPreferences;
    private final List<Page> pages;

    private PhialCore(
            Application application,
            ShareManager shareManager,
            AttachmentManager attachmentManager,
            KVSaver kvSaver,
            PhialNotifier notifier,
            CurrentActivityProvider activityProvider,
            ScreenTracker screenTracker,
            SharedPreferences sharedPreferences,
            List<Page> pages) {
        this.application = application;
        this.shareManager = shareManager;
        this.attachmentManager = attachmentManager;
        this.kvSaver = kvSaver;
        this.notifier = notifier;
        this.activityProvider = activityProvider;
        this.screenTracker = screenTracker;
        this.sharedPreferences = sharedPreferences;
        this.pages = pages;
    }

    public static PhialCore create(PhialBuilder phialBuilder) {
        final Application application = phialBuilder.getApplication();

        final CurrentActivityProvider activityProvider = new CurrentActivityProvider();
        final ScreenTracker screenTracker = new ScreenTracker();
        final PhialNotifier phialNotifier = new PhialNotifier();
        final KVSaver kvSaver = new KVSaver();
        final ShareManager shareManager = new ShareManager(
                application,
                InternalPhialConfig.getPhialAuthority(application),
                phialBuilder.getShareables()
        );
        final AttachmentManager attachmentManager = createAttachmentManager(phialBuilder, kvSaver, activityProvider);

        Phial.addSaver(kvSaver);
        phialNotifier.addListener(attachmentManager);
        application.registerActivityLifecycleCallbacks(activityProvider);
        application.registerActivityLifecycleCallbacks(screenTracker);
        PhialScopeNotifier.addListener(screenTracker);

        final List<InfoWriter> writers = phialBuilder.getInfoWriters();
        for (InfoWriter writer : writers) {
            writer.writeInfo();
        }
        final SharedPreferences sharedPreferences = application.getSharedPreferences(
                InternalPhialConfig.PREFERENCES_FILE_NAME,
                Context.MODE_PRIVATE
        );

        final List<Page> pages = new ArrayList<>();
        if (phialBuilder.enableKeyValueView()) {
            final Page page = createKVPage(application, kvSaver);
            pages.add(page);
        }

        if (phialBuilder.enableShareView()) {
            final Page page = createShareView(application, shareManager, attachmentManager);
            pages.add(page);
        }

        pages.addAll(phialBuilder.getPages());

        return new PhialCore(
                application,
                shareManager,
                attachmentManager,
                kvSaver,
                phialNotifier,
                activityProvider,
                screenTracker,
                sharedPreferences,
                pages
        );
    }

    public void destroy() {
        application.unregisterActivityLifecycleCallbacks(activityProvider);
        Phial.removeSaver(kvSaver);
        notifier.destroy();
        screenTracker.destroy();
    }

    @NonNull
    private static AttachmentManager createAttachmentManager(
            PhialBuilder phialBuilder,
            KVSaver kvSaver,
            CurrentActivityProvider activityProvider
    ) {
        final List<ListAttacher> attachers = prepareAttachers(phialBuilder, kvSaver, activityProvider);
        return new AttachmentManager(
                attachers,
                InternalPhialConfig.getWorkingDirectory(phialBuilder.getApplication()),
                phialBuilder.getShareDataFilePattern()
        );
    }

    private static List<ListAttacher> prepareAttachers(
            PhialBuilder phialBuilder,
            KVSaver kvSaver,
            CurrentActivityProvider activityProvider
    ) {
        final List<ListAttacher> attachers = new ArrayList<>(phialBuilder.getAttachers());

        if (phialBuilder.attachKeyValues()) {
            final KVAttacher attacher = new KVAttacher(
                    kvSaver,
                    InternalPhialConfig.getKeyValueFile(phialBuilder.getApplication())
            );
            attachers.add(AttacherAdaptor.adapt(attacher));
        }

        if (phialBuilder.attachScreenshots()) {
            final Attacher screenShotAttacher = new ScreenShotAttacher(
                    activityProvider,
                    InternalPhialConfig.getScreenShotFile(phialBuilder.getApplication()),
                    DEFAULT_SHARE_IMAGE_QUALITY
            );
            attachers.add(AttacherAdaptor.adapt(screenShotAttacher));
        }

        return attachers;
    }

    public Application getApplication() {
        return application;
    }

    public PhialNotifier getNotifier() {
        return notifier;
    }

    public CurrentActivityProvider getActivityProvider() {
        return activityProvider;
    }

    public ScreenTracker getScreenTracker() {
        return screenTracker;
    }

    public SharedPreferences getSharedPreferences() {
        return sharedPreferences;
    }

    public ShareManager getShareManager() {
        return shareManager;
    }

    public AttachmentManager getAttachmentManager() {
        return attachmentManager;
    }

    public KVSaver getKvSaver() {
        return kvSaver;
    }

    public List<Page> getPages() {
        return pages;
    }

    @NonNull
    private static Page createShareView(Application application, ShareManager shareManager, AttachmentManager attachmentManager) {
        return new Page(
                SHARE_PAGE_KEY,
                R.drawable.ic_share,
                application.getString(R.string.share_page_title),
                new ShareViewFactory(shareManager, attachmentManager),
                Collections.<TargetScreen>emptySet()
        );
    }

    @NonNull
    private static Page createKVPage(Application application, KVSaver kvSaver) {
        return new Page(
                KEYVALUE_PAGE_KEY,
                R.drawable.ic_keyvalue,
                application.getString(R.string.system_info_page_title),
                new KVPageFactory(kvSaver),
                Collections.<TargetScreen>emptySet()
        );
    }

    private static final class KVPageFactory implements Page.PageViewFactory<KeyValueView> {
        private final KVSaver kvSaver;

        KVPageFactory(KVSaver kvSaver) {
            this.kvSaver = kvSaver;
        }

        @Override
        public KeyValueView createPageView(Context context, OverlayCallback overlayCallback) {
            return new KeyValueView(context, kvSaver);
        }
    }

    private static final class ShareViewFactory implements Page.PageViewFactory<ShareView> {
        private final ShareManager shareManager;
        private final AttachmentManager attachmentManager;

        ShareViewFactory(ShareManager shareManager, AttachmentManager attachmentManager) {
            this.shareManager = shareManager;
            this.attachmentManager = attachmentManager;
        }

        @Override
        public ShareView createPageView(Context context, OverlayCallback overlayCallback) {
            return new ShareView(context, shareManager, attachmentManager, overlayCallback);
        }
    }
}


text:
module RuboCop
  module Cop
    # Common functionality for checking instance methods and singleton methods.
    module OnMethodDef
      def on_def(node)
        method_name, args, body = *node
        on_method_def(node, method_name, args, body)
      end

      def on_defs(node)
        _scope, method_name, args, body = *node
        on_method_def(node, method_name, args, body)
      end

      # This method provides scope agnostic method node destructuring by moving
      # the scope to the end where it can easily be ignored.
      def method_def_node_parts(node)
        if node.def_type?
          method_name, args, body = *node
        elsif node.defs_type?
          scope, method_name, args, body = *node
        else
          return []
        end

        [method_name, args, body, scope]
      end

      private

      # Returns true for constructs such as
      # private def my_method
      # which are allowed in Ruby 2.1 and later.
      def modifier_and_def_on_same_line?(send_node)
        send_node.receiver.nil? &&
          send_node.method_name != :def &&
          send_node.method_args.size == 1 &&
          [:def, :defs].include?(send_node.method_args.first.type)
      end
    end
  end
end


text:
import Ember from 'ember';
import _ from 'lodash/lodash';

export function letterFrequency([string]) {
  let chars = _.countBy((string || '').split(''), (char) => char.toLowerCase());
  return _.map(chars, (count, char) => {
    return { count, char };
  });
}

export default Ember.Helper.helper(letterFrequency);


text:
using System;

namespace EntityFrameworkExtras.Tests.Integration.StoredProcedures
{
    public class AllTypesStoredProcedureReturn
    {
        public String ParameterNvarChar { get; set; }
        public Int64? ParameterBigInt { get; set; }
        public Byte[] ParameterBinary { get; set; }
        public Boolean? ParameterBit { get; set; }
        public String ParameterChar { get; set; }
        public DateTime? ParameterDate { get; set; }
        public DateTime? ParameterDateTime { get; set; }
        public DateTime? ParameterDateTime2 { get; set; }
        public DateTimeOffset? ParameterDateTimeOffset { get; set; }
        public Decimal? ParameterDecimal { get; set; }
        public Double? ParameterFloat { get; set; }
        public Byte[] ParameterImage { get; set; }
        public Int32? ParameterInt { get; set; }
        public Decimal? ParameterMoney { get; set; }
        public String ParameterNChar { get; set; }
        public String ParameterNText { get; set; }
        public Single? ParameterReal { get; set; }
        public DateTime? ParameterSmallDateTime { get; set; }
        public Int16? ParameterSmallInt { get; set; }
        public Decimal? ParameterSmallMoney { get; set; }
        public String ParameterText { get; set; }
        public TimeSpan? ParameterTime { get; set; }
        public Byte? ParameterTinyInt { get; set; }
        public Guid? ParameterUniqueIdentifier { get; set; }
        public Byte[] ParameterVarBinary { get; set; }
        public String ParameterVarChar { get; set; }
        public String ParameterXml { get; set; }
    }
}


text:
SYNONYM

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Svensk bot. Tidskr. 25: 25 (1931)

#### Original name
Fusarium amentorum Lacroix

### Remarks
null


text:
using System.Collections.Generic;
using FairyGUI.Utils;
using System;
using UnityEngine;

namespace FairyGUI
{
	/// <summary>
	/// Controller class.
	/// 控制器类。控制器的创建和设计需通过编辑器完成,不建议使用代码创建。
	/// 最常用的方法是通过selectedIndex获得或改变控制器的活动页面。如果要获得控制器页面改变的通知,使用onChanged事件。
	/// </summary>
	public class Controller : EventDispatcher
	{
		/// <summary>
		/// Name of the controller
		/// 控制器名称。
		/// </summary>
		public string name;

		/// <summary>
		/// When controller page changed.
		/// 当控制器活动页面改变时,此事件被触发。
		/// </summary>
		public EventListener onChanged { get; private set; }

		internal GComponent parent;
		internal bool autoRadioGroupDepth;
		internal bool changing;

		int _selectedIndex;
		int _previousIndex;
		List<string> _pageIds;
		List<string> _pageNames;
		List<ControllerAction> _actions;

		static uint _nextPageId;

		public Controller()
		{
			_pageIds = new List<string>();
			_pageNames = new List<string>();
			_selectedIndex = -1;
			_previousIndex = -1;

			onChanged = new EventListener(this, "onChanged");
		}

		/// <summary>
		/// Current page index.
		/// 获得或设置当前活动页面索引。
		/// </summary>
		public int selectedIndex
		{
			get
			{
				return _selectedIndex;
			}
			set
			{
				if (_selectedIndex != value)
				{
					if (value > _pageIds.Count - 1)
						throw new IndexOutOfRangeException("" + value);

					changing = true;

					_previousIndex = _selectedIndex;
					_selectedIndex = value;
					parent.ApplyController(this);

					onChanged.Call();

					changing = false;
				}
			}
		}

		/// <summary>
		/// Set current page index, no onChanged event.
		/// 通过索引设置当前活动页面,和selectedIndex的区别在于,这个方法不会触发onChanged事件。
		/// </summary>
		/// <param name="value">Page index</param>
		public void SetSelectedIndex(int value)
		{
			if (_selectedIndex != value)
			{
				if (value > _pageIds.Count - 1)
					throw new IndexOutOfRangeException("" + value);

				changing = true;
				_previousIndex = _selectedIndex;
				_selectedIndex = value;
				parent.ApplyController(this);
				changing = false;
			}
		}

		/// <summary>
		/// Set current page by name, no onChanged event.
		/// 通过页面名称设置当前活动页面,和selectedPage的区别在于,这个方法不会触发onChanged事件。
		/// </summary>
		/// <param name="value">Page name</param>
		public void SetSelectedPage(string value)
		{
			int i = _pageNames.IndexOf(value);
			if (i == -1)
				i = 0;
			this.SetSelectedIndex(i);
		}

		/// <summary>
		/// Current page name.
		/// 获得当前活动页面名称
		/// </summary>
		public string selectedPage
		{
			get
			{
				if (_selectedIndex == -1)
					return null;
				else
					return _pageNames[_selectedIndex];
			}
			set
			{
				int i = _pageNames.IndexOf(value);
				if (i == -1)
					i = 0;
				this.selectedIndex = i;
			}
		}

		/// <summary>
		/// Previouse page index.
		/// 获得上次活动页面索引
		/// </summary>
		public int previsousIndex
		{
			get { return _previousIndex; }
		}

		/// <summary>
		/// Previous page name.
		/// 获得上次活动页面名称。
		/// </summary>
		public string previousPage
		{
			get
			{
				if (_previousIndex == -1)
					return null;
				else
					return _pageNames[_previousIndex];
			}
		}

		/// <summary>
		/// Page count of this controller.
		/// 获得页面数量。
		/// </summary>
		public int pageCount
		{
			get { return _pageIds.Count; }
		}

		/// <summary>
		/// Get page name by an index.
		/// 通过页面索引获得页面名称。
		/// </summary>
		/// <param name="index">Page index</param>
		/// <returns>Page Name</returns>
		public string GetPageName(int index)
		{
			return _pageNames[index];
		}

		/// <summary>
		/// Get page id by name
		/// </summary>
		/// <param name="aName"></param>
		/// <returns></returns>
		public string GetPageIdByName(string aName)
		{
			int i = _pageNames.IndexOf(aName);
			if (i != -1)
				return _pageIds[i];
			else
				return null;
		}

		/// <summary>
		/// Add a new page to this controller.
		/// </summary>
		/// <param name="name">Page name</param>
		public void AddPage(string name)
		{
			if (name == null)
				name = string.Empty;

			AddPageAt(name, _pageIds.Count);
		}

		/// <summary>
		/// Add a new page to this controller at a certain index.
		/// </summary>
		/// <param name="name">Page name</param>
		/// <param name="index">Insert position</param>
		public void AddPageAt(string name, int index)
		{
			string nid = "_" + (_nextPageId++);
			if (index == _pageIds.Count)
			{
				_pageIds.Add(nid);
				_pageNames.Add(name);
			}
			else
			{
				_pageIds.Insert(index, nid);
				_pageNames.Insert(index, name);
			}
		}

		/// <summary>
		/// Remove a page.
		/// </summary>
		/// <param name="name">Page name</param>
		public void RemovePage(string name)
		{
			int i = _pageNames.IndexOf(name);
			if (i != -1)
			{
				_pageIds.RemoveAt(i);
				_pageNames.RemoveAt(i);
				if (_selectedIndex >= _pageIds.Count)
					this.selectedIndex = _selectedIndex - 1;
				else
					parent.ApplyController(this);
			}
		}

		/// <summary>
		/// Removes a page at a certain index.
		/// </summary>
		/// <param name="index"></param>
		public void RemovePageAt(int index)
		{
			_pageIds.RemoveAt(index);
			_pageNames.RemoveAt(index);
			if (_selectedIndex >= _pageIds.Count)
				this.selectedIndex = _selectedIndex - 1;
			else
				parent.ApplyController(this);
		}

		/// <summary>
		/// Remove all pages.
		/// </summary>
		public void ClearPages()
		{
			_pageIds.Clear();
			_pageNames.Clear();
			if (_selectedIndex != -1)
				this.selectedIndex = -1;
			else
				parent.ApplyController(this);
		}

		/// <summary>
		/// Check if the controller has a page.
		/// </summary>
		/// <param name="aName">Page name.</param>
		/// <returns></returns>
		public bool HasPage(string aName)
		{
			return _pageNames.IndexOf(aName) != -1;
		}

		internal int GetPageIndexById(string aId)
		{
			return _pageIds.IndexOf(aId);
		}

		internal string GetPageNameById(string aId)
		{
			int i = _pageIds.IndexOf(aId);
			if (i != -1)
				return _pageNames[i];
			else
				return null;
		}

		internal string GetPageId(int index)
		{
			return _pageIds[index];
		}

		internal string selectedPageId
		{
			get
			{
				if (_selectedIndex == -1)
					return null;
				else
					return _pageIds[_selectedIndex];
			}
			set
			{
				int i = _pageIds.IndexOf(value);
				if (i != -1)
					this.selectedIndex = i;
			}
		}

		internal string oppositePageId
		{
			set
			{
				int i = _pageIds.IndexOf(value);
				if (i > 0)
					this.selectedIndex = 0;
				else if (_pageIds.Count > 1)
					this.selectedIndex = 1;
			}
		}

		internal string previousPageId
		{
			get
			{
				if (_previousIndex == -1)
					return null;
				else
					return _pageIds[_previousIndex];
			}
		}

		public void RunActions()
		{
			if (_actions != null)
			{
				int cnt = _actions.Count;
				for (int i = 0; i < cnt; i++)
				{
					_actions[i].Run(this, previousPageId, selectedPageId);
				}
			}
		}

		public void Setup(XML xml)
		{
			string[] arr;

			name = xml.GetAttribute("name");
			autoRadioGroupDepth = xml.GetAttributeBool("autoRadioGroupDepth");

			arr = xml.GetAttributeArray("pages");
			if (arr != null)
			{
				int cnt = arr.Length;
				for (int i = 0; i < cnt; i += 2)
				{
					_pageIds.Add(arr[i]);
					_pageNames.Add(arr[i + 1]);
				}
			}

			XMLList.Enumerator et = xml.GetEnumerator("action");
			while (et.MoveNext())
			{
				if (_actions == null)
					_actions = new List<ControllerAction>();

				XML cxml = et.Current;
				ControllerAction action = ControllerAction.CreateAction(cxml.GetAttribute("type"));
				action.Setup(cxml);
				_actions.Add(action);
			}

			arr = xml.GetAttributeArray("transitions");
			if (arr != null)
			{
				if (_actions == null)
					_actions = new List<ControllerAction>();

				int cnt = arr.Length;
				for (int i = 0; i < cnt; i++)
				{
					string str = arr[i];

					PlayTransitionAction taction = new PlayTransitionAction();
					int k = str.IndexOf("=");
					taction.transitionName = str.Substring(k + 1);
					str = str.Substring(0, k);
					k = str.IndexOf("-");
					int ii = int.Parse(str.Substring(k + 1));
					if (ii < _pageIds.Count)
						taction.toPage = new string[] { _pageIds[ii] };
					str = str.Substring(0, k);
					if (str != "*")
					{
						ii = int.Parse(str);
						if (ii < _pageIds.Count)
							taction.fromPage = new string[] { _pageIds[ii] };
					}
					taction.stopOnExit = true;
					_actions.Add(taction);
				}
			}

			if (parent != null && _pageIds.Count >= 0)
				_selectedIndex = 0;
			else
				_selectedIndex = -1;
		}
	}
}


text:
#ifndef SEAFILE_CLIENT_MESSAGE_LISTENER_H
#define SEAFILE_CLIENT_MESSAGE_LISTENER_H

#include <QObject>

struct _CcnetClient;
struct _CcnetMqclientProc;
struct _CcnetMessage;

class QSocketNotifier;

/**
 * Handles ccnet message
 */
class MessageListener : QObject {
    Q_OBJECT
public:
    MessageListener();
    ~MessageListener();

    void connectDaemon();
    void handleMessage(_CcnetMessage *message);

private slots:
    void readConnfd();

private:
    Q_DISABLE_COPY(MessageListener)

    void startMqClient();

    _CcnetClient *async_client_;
    _CcnetClient *sync_client_;
    _CcnetMqclientProc *mqclient_proc_;

    QSocketNotifier *socket_notifier_;
};

#endif // SEAFILE_CLIENT_MESSAGE_LISTENER_H