text:
<?php
/**
 *
 * @package framework
 * @subpackage forms
 *
 * @uses DBField::scaffoldFormField()
 * @uses DataObject::fieldLabels()
 */
class FormScaffolder extends Object {

	/**
	 * @var DataObject $obj The object defining the fields to be scaffolded
	 * through its metadata like $db, $searchable_fields, etc.
	 */
	protected $obj;

	/**
	 * @var boolean $tabbed Return fields in a tabset, with all main fields in the path "Root.Main",
	 * relation fields in "Root.<relationname>" (if {@link $includeRelations} is enabled).
	 */
	public $tabbed = false;

	/**
	 * @var boolean $ajaxSafe
	 */
	public $ajaxSafe = false;

	/**
	 * @var array $restrictFields Numeric array of a field name whitelist.
	 * If left blank, all fields from {@link DataObject->db()} will be included.
	 *
	 * @todo Implement restrictions for has_many and many_many relations.
	 */
	public $restrictFields;

	/**
	 * @var array $fieldClasses Optional mapping of fieldnames to subclasses of {@link FormField}.
	 * By default the scaffolder will determine the field instance by {@link DBField::scaffoldFormField()}.
	 *
	 * @todo Implement fieldClasses for has_many and many_many relations
	 */
	public $fieldClasses;

	/**
	 * @var boolean $includeRelations Include has_one, has_many and many_many relations
	 */
	public $includeRelations = false;

	/**
	 * @param DataObject $obj
	 * @param array $params
	 */
	public function __construct($obj) {
		$this->obj = $obj;
		parent::__construct();
	}

	/**
	 * Gets the form fields as defined through the metadata
	 * on {@link $obj} and the custom parameters passed to FormScaffolder.
	 * Depending on those parameters, the fields can be used in ajax-context,
	 * contain {@link TabSet}s etc.
	 *
	 * @return FieldList
	 */
	public function getFieldList() {
		$fields = new FieldList();

		// tabbed or untabbed
		if($this->tabbed) {
			$fields->push(new TabSet("Root", $mainTab = new Tab("Main")));
			$mainTab->setTitle(_t('SiteTree.TABMAIN', "Main"));
		}

		// add database fields
		foreach($this->obj->db() as $fieldName => $fieldType) {
			if($this->restrictFields && !in_array($fieldName, $this->restrictFields)) continue;

			// @todo Pass localized title
			if($this->fieldClasses && isset($this->fieldClasses[$fieldName])) {
				$fieldClass = $this->fieldClasses[$fieldName];
				$fieldObject = new $fieldClass($fieldName);
			} else {
				$fieldObject = $this->obj->dbObject($fieldName)->scaffoldFormField(null, $this->getParamsArray());
			}
			$fieldObject->setTitle($this->obj->fieldLabel($fieldName));
			if($this->tabbed) {
				$fields->addFieldToTab("Root.Main", $fieldObject);
			} else {
				$fields->push($fieldObject);
			}
		}

		// add has_one relation fields
		if($this->obj->hasOne()) {
			foreach($this->obj->hasOne() as $relationship => $component) {
				if($this->restrictFields && !in_array($relationship, $this->restrictFields)) continue;
				$fieldName = $component === 'DataObject'
					? $relationship // Polymorphic has_one field is composite, so don't refer to ID subfield
					: "{$relationship}ID";
				if($this->fieldClasses && isset($this->fieldClasses[$fieldName])) {
					$fieldClass = $this->fieldClasses[$fieldName];
					$hasOneField = new $fieldClass($fieldName);
				} else {
					$hasOneField = $this->obj->dbObject($fieldName)->scaffoldFormField(null, $this->getParamsArray());
				}
				if(empty($hasOneField)) continue; // Allow fields to opt out of scaffolding
				$hasOneField->setTitle($this->obj->fieldLabel($relationship));
				if($this->tabbed) {
					$fields->addFieldToTab("Root.Main", $hasOneField);
				} else {
					$fields->push($hasOneField);
				}
			}
		}

		// only add relational fields if an ID is present
		if($this->obj->ID) {
			// add has_many relation fields
			if($this->obj->hasMany()
					&& ($this->includeRelations === true || isset($this->includeRelations['has_many']))) {

				foreach($this->obj->hasMany() as $relationship => $component) {
					if($this->tabbed) {
						$relationTab = $fields->findOrMakeTab(
							"Root.$relationship",
							$this->obj->fieldLabel($relationship)
						);
					}
					$fieldClass = (isset($this->fieldClasses[$relationship]))
						? $this->fieldClasses[$relationship]
						: 'GridField';
					$grid = Object::create($fieldClass,
						$relationship,
						$this->obj->fieldLabel($relationship),
						$this->obj->$relationship(),
						GridFieldConfig_RelationEditor::create()
					);
					if($this->tabbed) {
						$fields->addFieldToTab("Root.$relationship", $grid);
					} else {
						$fields->push($grid);
					}
				}
			}

			if($this->obj->manyMany()
					&& ($this->includeRelations === true || isset($this->includeRelations['many_many']))) {

				foreach($this->obj->manyMany() as $relationship => $component) {
					if($this->tabbed) {
						$relationTab = $fields->findOrMakeTab(
							"Root.$relationship",
							$this->obj->fieldLabel($relationship)
						);
					}

					$fieldClass = (isset($this->fieldClasses[$relationship]))
						? $this->fieldClasses[$relationship]
						: 'GridField';

					$grid = Object::create($fieldClass,
						$relationship,
						$this->obj->fieldLabel($relationship),
						$this->obj->$relationship(),
						GridFieldConfig_RelationEditor::create()
					);
					if($this->tabbed) {
						$fields->addFieldToTab("Root.$relationship", $grid);
					} else {
						$fields->push($grid);
					}
				}
			}
		}

		return $fields;
	}

	/**
	 * Return an array suitable for passing on to {@link DBField->scaffoldFormField()}
	 * without tying this call to a FormScaffolder interface.
	 *
	 * @return array
	 */
	protected function getParamsArray() {
		return array(
			'tabbed' => $this->tabbed,
			'includeRelations' => $this->includeRelations,
			'restrictFields' => $this->restrictFields,
			'fieldClasses' => $this->fieldClasses,
			'ajaxSafe' => $this->ajaxSafe
		);
	}
}


text:
import {nextIndex} from 'rambda'

const list = [1, 2, 3]

describe('R.nextIndex', () => {
  it('happy', () => {
    const result = nextIndex(4, list)

    result // $ExpectType number
  })
})

redpajama_set_name: RedPajamaGithub


text:
.. _volume-drivers:

==============
Volume drivers
==============

To use different volume drivers for the cinder-volume service, use the
parameters described in these sections.

These volume drivers are included in the `Block Storage repository
<https://opendev.org/openstack/cinder>`_. To set a volume
driver, use the ``volume_driver`` flag.

The default is:

.. code-block:: ini

    volume_driver = cinder.volume.drivers.lvm.LVMVolumeDriver

Note that some third party storage systems may maintain more detailed
configuration documentation elsewhere. Contact your vendor for more information
if needed.

Driver Configuration Reference
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. sort by the drivers by open source software
.. and the drivers for proprietary components

.. toctree::
   :glob:
   :maxdepth: 1

   drivers/ceph-rbd-volume-driver
   drivers/lvm-volume-driver
   drivers/nfs-volume-driver
   drivers/*


text:
package com.sun.xml.ws.streaming;

import com.sun.istack.localization.Localizable;
import com.sun.xml.ws.util.exception.JAXWSExceptionBase;

/**
 * <p> XMLStream ReaderException represents an exception that occurred while reading an
 * XML document. </p>
 *
 * @see JAXWSExceptionBase
 *
 * @author WS Development Team
 */
public class XMLStreamReaderException extends JAXWSExceptionBase {

    private static final long serialVersionUID = -8070972916909105760L;

    @SuppressWarnings({"deprecation"})
    public XMLStreamReaderException(String key, Object... args) {
        super(key, args);
    }

    public XMLStreamReaderException(Throwable throwable) {
        super(throwable);
    }

    @SuppressWarnings({"deprecation"})
    public XMLStreamReaderException(Localizable arg) {
        super("xmlreader.nestedError", arg);
    }

    @Override
    public String getDefaultResourceBundleName() {
        return "com.sun.xml.ws.resources.streaming";
    }
}


text:
using System;
using System.Threading;
using System.Threading.Tasks;
using RabbitLink.Connection;
using RabbitLink.Topology;

#endregion

namespace RabbitLink.Builders
{
    /// <summary>
    ///     Builder for <see cref="ILinkTopology" />
    /// </summary>
    public interface ILinkTopologyBuilder
    {
        /// <summary>
        ///     Channel / Topology recovery interval
        ///     By default <see cref="ILinkBuilder.RecoveryInterval" />
        /// </summary>
        ILinkTopologyBuilder RecoveryInterval(TimeSpan value);

        /// <summary>
        ///     Sets handler for state changes
        /// </summary>
        ILinkTopologyBuilder OnStateChange(LinkStateHandler<LinkTopologyState> value);

        /// <summary>
        ///     Sets handler for channel state changes
        /// </summary>
        ILinkTopologyBuilder OnChannelStateChange(LinkStateHandler<LinkChannelState> value);

        /// <summary>
        ///     Sets topology handler
        /// </summary>
        ILinkTopologyBuilder Handler(ILinkTopologyHandler handler);

        /// <summary>
        ///     Sets topology configuration handler
        /// </summary>
        ILinkTopologyBuilder Handler(LinkTopologyConfigDelegate config);

        /// <summary>
        ///     Sets topology configuration and ready handlers
        /// </summary>
        ILinkTopologyBuilder Handler(LinkTopologyConfigDelegate config, LinkTopologyReadyDelegate ready);

        /// <summary>
        ///     Sets topology configuration, ready and error handlers
        /// </summary>
        ILinkTopologyBuilder Handler(
            LinkTopologyConfigDelegate config,
            LinkTopologyReadyDelegate ready,
            LinkTopologyErrorDelegate error
        );

        /// <summary>
        ///     Builds <see cref="ILinkTopology" /> instance
        /// </summary>
        ILinkTopology Build();

        /// <summary>
        ///     Builds <see cref="ILinkTopology" /> instance, waits when it will be ready and then dispose it
        /// </summary>
        Task WaitAsync(CancellationToken? cancellation = null);
    }
}


text:
    <link rel="stylesheet" href="http://yui.yahooapis.com/combo?3.5.0/build/cssreset/reset-min.css&3.5.0/build/cssfonts/fonts-min.css&3.5.0/build/cssgrids/grids-min.css&3.5.0/build/cssbase/base-min.css&3.5.0/build/cssbutton/cssbutton.css">

    <link href='http://fonts.googleapis.com/css?family=Coustard:400,900' rel='stylesheet' type='text/css'>
    <link href='../style.css' rel='stylesheet' type='text/css'>
    <title>Part 3 – Shader Editor</title>

        <link href="../syntaxhighlighter_3.0.83/styles/shCore.css" rel="stylesheet" type="text/css" />
        <link href="../syntaxhighlighter_3.0.83/styles/shThemeDefault.css" rel="stylesheet" type="text/css" />

Part 3 – Shader Editor

Besides the built-in shaders, KickJS also support custom built shaders. These shaders can be created using the KickJS shader editor.

http://www.kickjs.org/example/shader_editor/shader_editor.html

        The following code shows how to setup a custom shader in KickJS:

// init engine (create 3d context)
 var engine = new kick.core.Engine('3dCanvas');
 // create a game object in [0,0,0] facing down the -z axis
 var cameraObject = engine.activeScene.createGameObject();
 cameraObject.transform.position = [0,0,5];
 // create a orthographics camera
 var camera = new kick.scene.Camera({
      perspective: false,
      left:-5,
      right:5,
      top:5,
      bottom:-5
 });
 cameraObject.addComponent(camera);
 // create shader - Note that it is bad practice to inline GLSL shader code in JavaScript
 var vertexShaderStr = "attribute vec3 vertex;\n"+
      "uniform mat4 _mvProj;\n"+
      "void main(void) {\n"+
      " gl_Position = _mvProj * vec4(vertex, 1.0);\n"+
      "}";
 var fragmentShaderStr = "uniform highp float _time;\n"+
      "void main(void) {\n"+
      " highp float fraction = mod(_time/1000.0,1.0);\n"+
      " gl_FragColor = vec4(fraction,fraction,fraction, 1.0);\n"+
      "}";
 var shader = new kick.material.Shader( {
      vertexShaderSrc: vertexShaderStr,
      fragmentShaderSrc: fragmentShaderStr
 });
 var material = new kick.material.Material({
      shader: shader,
      uniformData:{
 }
 });
 // create cube
 var gameObject = engine.activeScene.createGameObject();
 gameObject.transform.position = [0.0,0,0];
 var meshRenderer = new kick.scene.MeshRenderer();
 meshRenderer.mesh = engine.project.load(engine.project.ENGINE_MESH_CUBE);
 meshRenderer.material = material;
 gameObject.addComponent(meshRenderer);


text:
@implementation FastQueueTest

-(void) testInit
{
	FastQueue *queue = [[FastQueue newFastQueue] retain];
	STAssertNotNil(queue, @"Queue was not created and was nil");
	[queue release];
}

-(void) testAddAndGet
{
	FastQueue *queue = [[FastQueue newFastQueue] retain];
	STAssertNotNil(queue, @"Queue was not created and was nil");
	[queue addObject:@"My String"];
	STAssertTrue([[queue objectAtIndex:0] isKindOfClass:[NSString class]], @"First object is not a NSString");
	STAssertEquals([queue objectAtIndex:0], @"My String", @"Object at index zero is invalid");
	STAssertTrue([queue size] == 1, @"Queue is the wrong size: %d", [queue size]);
	[queue release];
}

-(void) testInvalidElementIndex
{
    //RuntimeException *NoSuchElementException = [NoSuchElementException newException:@"No such element exception"];
    id retVal;
	FastQueue *queue = [[FastQueue newFastQueue] retain];
	STAssertNotNil(queue, @"Queue was not created and was nil");
	@try
	{
		retVal = [queue objectAtIndex:100];
	}
	@catch (NoSuchElementException *e)
	{
		STAssertTrue([[e name] isEqualTo:@"NoSuchElementException"], @"Exception was not type: NoSuchElementException -- %@", [e name]);
		return;
	}
	STFail(@"Exception NoSuchElementException was not thrown -- %@", [retVal name]);
    [queue release];
}

-(void) testHead
{
	FastQueue *queue = [[FastQueue newFastQueue] retain];
	STAssertNotNil(queue, @"Queue was not created and was nil");
	[queue addObject:@"Item 1"];
	[queue addObject:@"Item 2"];
	[queue addObject:@"Item 3"];
	id head = [queue head];
	STAssertNotNil(head, @"Object returned from head is nil");
	STAssertEquals(head, @"Item 1", @"Object returned was not first item in");
	[queue release];
}

-(void) testClear
{
	FastQueue *queue = [[FastQueue newFastQueue] retain];
	STAssertNotNil(queue, @"Queue was not created and was nil");
	[queue addObject:@"Item 1"];
	[queue addObject:@"Item 2"];
	[queue addObject:@"Item 3"];
	STAssertTrue([queue size] == 3, @"Queue was too small, was: %d expected 3", [queue size]);
	[queue reset];
	STAssertTrue([queue size] == 0, @"Queue is not empty, it's still %d", [queue size]);
	[queue release];
}

-(void) testDescription
{
	FastQueue *queue = [[FastQueue newFastQueue] retain];
	STAssertNotNil(queue, @"Queue was not created and was nil");
	[queue addObject:@"My"];
	[queue addObject:@"String"];
	STAssertTrue([[queue description] isEqualToString:@"My String"], @"Queue description was not right, got: \"%@\" expected: \"My String\"", [queue description]);
	[queue release];
}

-(void) testRemove
{
	FastQueue *queue = [[FastQueue newFastQueue] retain];
	STAssertNotNil(queue, @"Queue was not created and was nil");
	[queue addObject:@"My"];
	[queue addObject:@"String"];
	STAssertTrue([queue size] == 2, @"Queue not the correct size, was: %d expected 2", [queue size]);
	[queue remove];
	STAssertTrue([queue size] == 1, @"Queue not the correct size, was %d expected 1", [queue size]);
	[queue remove]; // test that the queue is reset when we remove the last object...
	STAssertTrue([queue size] == 0, @"Queue was not reset, when we hit the buffer, was still %d", [queue size]);
	[queue release];
}

@end


text:
define([
	'global/runloop',
	'utils/warn',
	'utils/isArray',
	'utils/Promise',
	'shared/set',
	'Ractive/prototype/merge/mapOldToNewIndex',
	'Ractive/prototype/merge/propagateChanges'
], function (
	runloop,
	warn,
	isArray,
	Promise,
	set,
	mapOldToNewIndex,
	propagateChanges
) {

	'use strict';

	var comparators = {};

	return function merge ( keypath, array, options ) {

		var currentArray,
			oldArray,
			newArray,
			comparator,
			lengthUnchanged,
			newIndices,
			promise,
			fulfilPromise;

		currentArray = this.get( keypath );

		// If either the existing value or the new value isn't an
		// array, just do a regular set
		if ( !isArray( currentArray ) || !isArray( array ) ) {
			return this.set( keypath, array, options && options.complete );
		}

		lengthUnchanged = ( currentArray.length === array.length );

		if ( options && options.compare ) {

			comparator = getComparatorFunction( options.compare );

			try {
				oldArray = currentArray.map( comparator );
				newArray = array.map( comparator );
			} catch ( err ) {
				// fallback to an identity check - worst case scenario we have
				// to do more DOM manipulation than we thought...

				// ...unless we're in debug mode of course
				if ( this.debug ) {
					throw err;
				} else {
					warn( 'Merge operation: comparison failed. Falling back to identity checking' );
				}

				oldArray = currentArray;
				newArray = array;
			}

		} else {
			oldArray = currentArray;
			newArray = array;
		}

		// find new indices for members of oldArray
		newIndices = mapOldToNewIndex( oldArray, newArray );

		// Manage transitions
		promise = new Promise( function ( fulfil ) { fulfilPromise = fulfil; });
		runloop.start( this, fulfilPromise );

		// Update the model
		// TODO allow existing array to be updated in place, rather than replaced?
		set( this, keypath, array, true );
		propagateChanges( this, keypath, newIndices, lengthUnchanged );
		runloop.end();

		// attach callback as fulfilment handler, if specified
		if ( options && options.complete ) {
			promise.then( options.complete );
		}

		return promise;
	};

	function stringify ( item ) {
		return JSON.stringify( item );
	}

	function getComparatorFunction ( comparator ) {
		// If `compare` is `true`, we use JSON.stringify to compare
		// objects that are the same shape, but non-identical - i.e.
		// { foo: 'bar' } !== { foo: 'bar' }
		if ( comparator === true ) {
			return stringify;
		}

		if ( typeof comparator === 'string' ) {
			if ( !comparators[ comparator ] ) {
				comparators[ comparator ] = function ( item ) {
					return item[ comparator ];
				};
			}

			return comparators[ comparator ];
		}

		if ( typeof comparator === 'function' ) {
			return comparator;
		}

		throw new Error( 'The `compare` option must be a function, or a string representing an identifying field (or `true` to use JSON.stringify)' );
	}

});


text:
		Try Again

		{{mentalState.name}}

			{{recommendation.text}}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;
using System.Web.Mvc;
using System.IO;
namespace MvcMovie.Models
{
    public class Video
    {

        public IEnumerable<HttpPostedFileBase> Files { get; set; }
    }
}


text:
#import <Foundation/Foundation.h>

#import <Parse/PFObject.h>
#import <Parse/PFSubclassing.h>

extern NSString *const PFPinKeyName;
extern NSString *const PFPinKeyObjects;

/**
 PFPin represent internal pin implementation of PFObject's `pin`.
 */
@interface PFPin : PFObject<PFSubclassing>

@property (nonatomic, copy) NSString *name;
@property (nonatomic, strong) NSMutableArray *objects;

///--------------------------------------
/// @name Init
///--------------------------------------

- (instancetype)initWithName:(NSString *)name;
+ (instancetype)pinWithName:(NSString *)name;

@end


text:
Plugin.define "MShift" do
author "Brendan Coles <bcoles@gmail.com>" # 2011-05-12
version "0.1"
description "MShift - Comprehensive Mobile Banking - Over 200 US Financial Institutions are MShift clients. With a base comprised of the largest banks in the world, as well as regional credit unions and local banks, MShift is the standard by which Mobile Banking is measured."
website "http://www.mshift.com/"

# Google results as at 2011-05-12 #
# 53 for inurl:msestks

# Dorks #
dorks [
'inurl:msestks'
]

# Matches #
matches [

# Default Page # body
{ :text=>'MShift, Inc
Relevant Mobile Solutions
http://www.mshift.com' },

# Powered by text
{ :text=>'Powered by MShift®
' },
{ :text=>'Powered by MShift®
' },
{ :text=>'
Powered by MShift ®
' },

]

# Passive #
def passive
	m=[]

	# dcttype cookie
	m << { :certainty=>25, :name=>"dcttype cookie" } if @headers["set-cookie"] =~ /^dcttype=1$/

	# Return passive matches
	m
end

end


text:
import logging
from abc import ABC, abstractmethod
from typing import Optional

from sqlalchemy.exc import SQLAlchemyError

from superset.commands.base import BaseCommand
from superset.temporary_cache.commands.exceptions import TemporaryCacheUpdateFailedError
from superset.temporary_cache.commands.parameters import CommandParameters

logger = logging.getLogger(__name__)

class UpdateTemporaryCacheCommand(BaseCommand, ABC):
    def __init__(
        self,
        cmd_params: CommandParameters,
    ):
        self._parameters = cmd_params

    def run(self) -> Optional[str]:
        try:
            return self.update(self._parameters)
        except SQLAlchemyError as ex:
            logger.exception("Error running update command")
            raise TemporaryCacheUpdateFailedError() from ex

    def validate(self) -> None:
        pass

    @abstractmethod
    def update(self, cmd_params: CommandParameters) -> Optional[str]:
        ...


text:
<!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="refresh" content="0; url=views/login.xhtml" />
</head>
<body>

</body>
</html>


text:
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const CleanWebpackPlugin = require('clean-webpack-plugin');
const ManifestPlugin = require('webpack-manifest-plugin');
const webpack = require('webpack');

// // 配置分为两个文件,根据cli传参选择配置文件
// module.exports = function(env) {
//     return require(`./webpack.${env}.js`);
// }

module.exports = {
    entry: {
        app: './src/index.js',
    },
    devtool: 'inline-source-map',
    devServer: {
        contentBase: './dist',
        hot: true
    },
    plugins: [
        new webpack.DefinePlugin({
            'process.env.NODE_ENV': JSON.stringify('production')
        }),
        new webpack.optimize.UglifyJsPlugin({
            sourceMap: options.devtool && (options.devtool.indexOf("sourcemap") >= 0 || options.devtool.indexOf("source-map") >= 0)
        }),
        new ManifestPlugin(),
        new CleanWebpackPlugin(['dist']),
        new HtmlWebpackPlugin({
            title: 'Output Management by HtmlWebpackPlugin'
        }),
        new webpack.HotModuleReplacementPlugin()
    ],
    output: {
        filename: '[name].bundle.js',
        path: path.resolve(__dirname, 'dist')
    },
    module: {
        rules: [{
            test: /\.css$/,
            use: ['style-loader', 'css-loader']
        }, {
            test: /\.(png|svg|jpg|gif)$/,
            use: ['file-loader']
        }, {
            test: /\.(woff|woff2|eot|ttf|otf)$/,
            use: ['file-loader']
        }, {
            test: /\.(csv|tsv)$/,
            use: ['csv-loader']
        }, {
            test: /\.xml$/,
            use: ['xml-loader']
        }]
    }
};


text:
package org.onetwo.boot.core.ms;

import org.onetwo.boot.core.BootContextConfig;
import org.onetwo.boot.core.BootWebCommonAutoConfig;
import org.onetwo.boot.core.config.BootBusinessConfig;
import org.onetwo.boot.core.config.BootJFishConfig;
import org.onetwo.boot.core.config.BootSiteConfig;
import org.onetwo.boot.core.config.BootSpringConfig;
import org.onetwo.boot.core.embedded.TomcatProperties;
import org.onetwo.boot.plugin.PluginContextConfig;
import org.springframework.boot.autoconfigure.web.HttpEncodingProperties;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;

@Configuration
@EnableConfigurationProperties({HttpEncodingProperties.class, BootJFishConfig.class, BootSpringConfig.class, BootBusinessConfig.class, BootSiteConfig.class, TomcatProperties.class})
@Import({BootContextConfig.class, PluginContextConfig.class})
//@Import({BootContextConfig.class})
//@ConditionalOnProperty(name=BootJFishConfig.ENABLE_JFISH_AUTO_CONFIG, havingValue=BootJFishConfig.VALUE_AUTO_CONFIG_WEB_MS)
public class BootMSContextAutoConfig extends BootWebCommonAutoConfig {

	public BootMSContextAutoConfig(){
	}

}


text:
package com.eden.orchid.impl.themes.components;

import com.eden.orchid.api.options.annotations.BooleanDefault;
import com.eden.orchid.api.options.annotations.Description;
import com.eden.orchid.api.options.annotations.Option;
import com.eden.orchid.api.theme.components.OrchidComponent;

import javax.inject.Inject;

@Description(value = "Compile and render the default page content. This is added to all pages by default if no other components have been added by the user.", name = "Page Content")
public final class PageContentComponent extends OrchidComponent {

    @Option
    @BooleanDefault(true)
    @Description("Whether to include a wrapper around the normal page content template.")
    protected boolean noWrapper;

    @Inject
    public PageContentComponent() {
        super("pageContent");
    }

    public boolean isNoWrapper() {
        return this.noWrapper;
    }

    public void setNoWrapper(final boolean noWrapper) {
        this.noWrapper = noWrapper;
    }
}


text:
using UnityEngine;

/// <summary>
/// Test for the roulette simulation.
/// </summary>
namespace Roulette.Tests
{
    /// <summary>
    /// Monobehaviour to run unit tests.
    /// </summary>
    public class UnitTestRunner : MonoBehaviour
    {
        IOutputService console
        {
            get
            {
                return uGUIConsole.Instance;
            }
        }

		#region Tests to run.
		public bool outcomeTests = true;
		public bool binTests = true;
		public bool wheelTests = true;
		public bool binBuilderUsTests = true;
		public bool betTests = true;
		public bool tableTests = true;
		public bool runP57Demo = true;
		#endregion

		/// <summary>
		/// Runs tests that have been selected in the inspector.
		/// </summary>
		void Start()
        {
			if (outcomeTests)
				RunOutcomeTests();
			if (binTests)
				RunBinTests();
			if (wheelTests)
				RunWheelTests();
			if (binBuilderUsTests)
				RunBinBuilderUSTests();
			if (betTests)
				RunBetTests();
			if (tableTests)
				RunTableTests();
			if (runP57Demo)
				RunGameDemoP57();

		}

        /// <summary>
        /// Runs tests for the Outcome class.
        /// </summary>
        void RunOutcomeTests()
        {

            Outcome_Tests outcome_tests = new Outcome_Tests(console);

            bool pass = true;
			ushort testCount = 100;
            for (int i = 0; i < testCount; i++)
            {
                if (!outcome_tests.TestEqualityComparer(testCount))
                {
                    pass = false;
                    break;
                }
            }

            if (pass)
                console.WriteLine("Outcome_Tests.TestEqualityComparer() - all tests passed");
            else
                console.WriteLine("Outcome_Tests.TestEqualityComparer() - tests failed");

            pass = outcome_tests.TestExceptions(false);

            if (pass)
                console.WriteLine("Outcome_Tests.TestExceptions() - all tests passed");
            else
                console.WriteLine("Outcome_Tests.TestExceptions() - tests failed");

            pass = outcome_tests.TestWinAmounts(500);

            if (pass)
                console.WriteLine("Outcome_Tests.TestWinAmounts() - all tests passed");
            else
                console.WriteLine("Outcome_Tests.TestWinAmounts() - tests failed");

			pass = outcome_tests.TestToString();
			if (pass)
				console.WriteLine("Outcome_Tests.TestToString() - all tests passed");
			else
				console.WriteLine("Outcome_Tests.TestToString() - tests failed");
		}

		/// <summary>
		/// Runs tests for the Bin class.
		/// </summary>
        void RunBinTests()
        {
            Bin_Tests binTests = new Bin_Tests(console);

            if (binTests.Test())
                console.WriteLine("Bin_Tests.Test() - all tests pased");
            else
                console.WriteLine("Bin_Tests.Test() - tests failed");

			if (binTests.TestToString())
				console.WriteLine("Bin_Tests.TestToString() - all tests pased");
			else
				console.WriteLine("Bin_Tests.TestToString() - tests failed");
		}

		/// <summary>
		/// Runs tests for the Wheel class.
		/// </summary>
        void RunWheelTests()
        {
            Wheel_Tests wheelTests = new Wheel_Tests(console);
            if (wheelTests.TestGetRandomBin())
                console.WriteLine("Wheel_Tests.TestGetRandomBin() - all tests pased");
            else
                console.WriteLine("Wheel_Tests.TestGetRandomBin() - tests failed");

			if (wheelTests.TestOutcomesDictionary())
				console.WriteLine("Wheel_Tests.TestOutcomesDictionary() - all tests pased");
			else
				console.WriteLine("Wheel_Tests.TestOutcomesDictionary() - tests failed");
		}

		/// <summary>
		/// Runs tests for the BinBuilderUS class.
		/// See RouletteTableLayout.png to compare these results with.
		/// </summary>
		void RunBinBuilderUSTests()
        {
            BinBuilderUS_Tests bbusTests = new BinBuilderUS_Tests(console);

			//bbusTests.DisplayFiveBet();
			//bbusTests.DisplayStraightBets();
			//bbusTests.DisplayStreetBets();
			//bbusTests.DisplaySplitBets();
			//bbusTests.DisplayColumnBets();
			//bbusTests.DisplayDozenBets();
			//bbusTests.DisplayLineBets();
			//bbusTests.DisplayEvenMoneyBets();
			//bbusTests.DisplayCornerBets();
			bbusTests.DisplayAll();
        }

		/// <summary>
		/// Runs tests for the Bets class.
		/// </summary>
		void RunBetTests()
		{
			Bet_Tests betTests = new Bet_Tests(console);
			if (betTests.TestWinAmount())
				console.WriteLine("Bet_Tests.TestWinAndLoseAmounts() - all tests pased");
			else
				console.WriteLine("Bet_Tests.TestWinAndLoseAmounts() - tests failed");

			if (betTests.TestToString())
				console.WriteLine("Bet_Tests.TestToString() - all tests pased");
			else
				console.WriteLine("Bet_Tests.TestToString() - tests failed");

			if (betTests.TestToString())
				console.WriteLine("Bet_Tests.TestToString() - all tests pased");
			else
				console.WriteLine("Bet_Tests.TestToString() - tests failed");
		}

		/// <summary>
		/// Runs tests on the Table class.
		/// </summary>
		void  RunTableTests()
		{
			Table_Tests tt = new Table_Tests(console);

			//tt.DisplayToStringMethods();

			if (tt.Tests())
				console.WriteLine("Table_Tests.Tests() - all tests pased");
			else
				console.WriteLine("Table_Tests.Tests() - tests failed");
		}

		void RunGameDemoP57()
		{
			GameDemoPassenger57 demo = new GameDemoPassenger57();
			demo.Main(console);
		}
    }
}


text:
using Microsoft.AspNet.Mvc;

// For more information on enabling MVC for empty projects, visit http://go.microsoft.com/fwlink/?LinkID=397860

namespace Aspnet5_EmptyApp_46.Controllers
{
    public class ExceptionController : Controller
    {
        public string Throw()
        {
            throw new System.Exception("Unhandled Exception from controller.");
        }
    }
}


text:
<?php print _t('Browse the Archive'); ?>

		Lorem ipsum dolor sit amet, sapien vestibulum deleniti, ante sapien dolor ut, orci parturient in rerum, nunc euismod urna nec, donec aliquam ac
		sed et. Justo pellentesque. Metus metus purus elementum, commodo ante, sed justo ducimus, ac id sit. Vivamus urna lacinia, sodales ultricies
		tellus odio eros felis fringilla, suscipit arcu est suspendisse auctor, enim nulla praesent nascetur, suspendisse magna. Ullamcorper arcu turpis.
		Sed erat iaculis ut dignissim, aliquam in. Odio metus dolor, nisl in non, lectus et blanditiis nascetur wisi, interdum eu augue eget porta maecenas
		magna. Orci varius rhoncus et curabitur in, eros ac sed sapien, in in nulla. Augue ut, facilisis pellentesque eleifend a, reiciendis sit, ac nulla
		tortor viverra, porta et sodales. Orci sit ullamcorper accumsan, est a eu ultrices elementum, purus in sed, sed ut facilisis. Arcu pede amet,
		sagittis turpis, velit amet nonummy nulla turpis litora leo, massa lectus quisque varius semper sit ornare. Vestibulum pariatur velit libero diam
		sollicitudin praesent, ipsum in tortor orci, ac bibendum.

		Duis volutpat, nunc vel pharetra rutrum, arcu massa pulvinar neque, eu convallis quam metus sed metus. Donec odio nibh,
		iaculis in bibendum nec, eleifend in ipsum. Aenean lacinia nunc non metus convallis ornare. Quisque tristique augue at
		purus consectetur pellentesque. Vivamus eget lacus lacus. Sed condimentum, ipsum at mollis consequat, tortor enim elementum
		tellus, at sodales tortor risus sit amet tellus. Vivamus congue venenatis leo, vel sollicitudin lacus tempor a. Sed congue
		elementum nibh eget commodo. Phasellus varius metus nec justo vestibulum a fringilla sapien aliquet. Donec vel odio turpis,
		vitae aliquam mi. Donec eleifend vehicula quam. Sed luctus magna vel tellus laoreet eget interdum lacus tempor. In et lectus
		sit amet risus cursus bibendum vitae ut libero. Nunc molestie, massa tincidunt posuere rhoncus, odio nisi euismod quam, at
		ultricies risus neque sit amet eros. Duis ut ante id diam fermentum pretium vel ut ipsum. Sed sed sapien velit. Curabitur purus
		lacus, eleifend bibendum consequat non, luctus ac velit.


text:
using System.Collections.Generic;

namespace CollectionTestClasses
{
    public class CollectionTestClass
    {
        public string[] NavigationArray { get; set; }
        public ICollection<string> NavigationCollection { get; set; }
        public List<string> NavigationList { get; set; }
    }
}


text:
package org.batfish.specifier.parboiled;

import com.google.common.base.MoreObjects;
import java.util.Objects;
import org.batfish.datamodel.Prefix;

final class PrefixAstNode implements IpSpaceAstNode {
  private final Prefix _prefix;

  PrefixAstNode(Prefix prefix) {
    _prefix = prefix;
  }

  PrefixAstNode(String prefix) {
    _prefix = Prefix.parse(prefix);
  }

  @Override
  public <T> T accept(AstNodeVisitor<T> visitor) {
    return visitor.visitPrefixAstNode(this);
  }

  @Override
  public <T> T accept(IpSpaceAstNodeVisitor<T> visitor) {
    return visitor.visitPrefixAstNode(this);
  }

  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (!(o instanceof PrefixAstNode)) {
      return false;
    }
    PrefixAstNode that = (PrefixAstNode) o;
    return Objects.equals(_prefix, that._prefix);
  }

  public Prefix getPrefix() {
    return _prefix;
  }

  @Override
  public int hashCode() {
    return Objects.hashCode(_prefix);
  }

  @Override
  public String toString() {
    return MoreObjects.toStringHelper(getClass()).add("prefix", _prefix).toString();
  }
}


text:
(function ($) {
    'use strict';

    /**
     * Panda Cookies Service
     * @type {void|Object|*}
     */
    Panda.Env.Cookies = $.extend(true, Panda.Env.Cookies || {}, {
        /**
         * Get cookie value
         *
         * @param {string} name
         * @return {*}
         */
        get: function (name) {
            var i, b, c;
            var documentCookies = document.cookie.split(";");
            for (i = 0; i < documentCookies.length; i++) {
                b = documentCookies[i].substr(0, documentCookies[i].indexOf("="));
                c = documentCookies[i].substr(documentCookies[i].indexOf("=") + 1);
                b = b.replace(/^\s+|\s+$/g, "");
                var flag = (b === name);
                if (flag) {
                    return decodeURIComponent(c);
                }
            }

            return null;
        },

        /**
         * Set a cookie value
         *
         * @param {string} name
         * @param {string} value
         * @param {Date} expireDate
         * @param {string} path
         */
        set: function (name, value, expireDate, path) {
            // Add backwards compatible check for days
            if (typeof expireDate === 'number') {
                var expireDays = expireDate;
                expireDate = new Date();
                expireDate.setDate(expireDate.getDate() + expireDays);
            }

            // Set cookie
            var domain = Panda.Env.Url.getDomain();
            var c_value = encodeURIComponent(value) + "; domain=." + domain + "; path=" + path + ";" + ((expireDate === null) ? "" : "expires=" + expireDate.toUTCString());
            document.cookie = name + "=" + c_value;
        }
    });
})(jQuery);


text:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
	"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
	"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
	<class name="com.swfarm.biz.aliexpress.bo.DomesticLogisticsCompany"
		table="DomesticLogisticsCompany">
		<id name="id" column="id">
			<generator class="native" />
		</id>
		<property name="name" column="name" />
		<property name="companyId" column="companyId" />
		<property name="companyCode" column="companyCode" />
	</class>
</hibernate-mapping>


text:
require 'spec_helper'

describe Facilethings::Event do
	before(:each) do
    @client = Facilethings::REST::Client.new(:key => FT_KEY, :secret => FT_SECRET, :token =>  MY_ACCESS_TOKEN, :endpoint => FT_ENDPOINT)
	end

	describe "#attr_reader and #attr_accessor" do
		it "should build get methods for all attributes" do
			event = Facilethings::Event.new(@client, { :id => 2, :created_at => DateTime.now,
				:name => "pay", :description => "this guy paid!" })

			expect(event.id).to eq(2)
			expect(event.created_at).to be_a DateTime
			expect(event.name).to eq "pay"
			expect(event.description).to eq "this guy paid!"
		end
		it "should not build set methods for reader attributes" do
			event = Facilethings::Event.new(@client)

			expect{event.id = 4}.to raise_error(NoMethodError)
			expect{event.created_at = DateTime.now}.to raise_error(NoMethodError)
			expect{event.name = "pay"}.to raise_error(NoMethodError)
			expect{event.description = "client"}.to raise_error(NoMethodError)
		end
	end

end


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

package org.camunda.bpm.engine.impl.cmd;

import static org.camunda.bpm.engine.impl.util.EnsureUtil.ensureNotEmpty;
import static org.camunda.bpm.engine.impl.util.EnsureUtil.ensureNotNull;

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

import org.camunda.bpm.engine.impl.interceptor.Command;
import org.camunda.bpm.engine.impl.interceptor.CommandContext;
import org.camunda.bpm.engine.impl.persistence.entity.AuthorizationManager;
import org.camunda.bpm.engine.impl.persistence.entity.EventSubscriptionManager;
import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity;
import org.camunda.bpm.engine.impl.persistence.entity.ExecutionManager;
import org.camunda.bpm.engine.impl.persistence.entity.SignalEventSubscriptionEntity;

/**
 * @author Daniel Meyer
 * @author Joram Barrez
 */
public class SignalEventReceivedCmd implements Command<Void> {

  protected final String eventName;
  protected final String executionId;
  protected final Map<String, Object> variables;

  public SignalEventReceivedCmd(String eventName, String executionId, Map<String, Object> variables) {
    this.eventName = eventName;
    this.executionId = executionId;
    this.variables = variables;
  }

  public Void execute(final CommandContext commandContext) {
    final EventSubscriptionManager eventSubscriptionManager = commandContext.getEventSubscriptionManager();
    List<SignalEventSubscriptionEntity> signalEvents = null;

    if(executionId == null) {
      signalEvents =eventSubscriptionManager.findSignalEventSubscriptionsByEventName(eventName);

    } else {

      ExecutionManager executionManager = commandContext.getExecutionManager();
      ExecutionEntity execution = executionManager.findExecutionById(executionId);
      ensureNotNull("Cannot find execution with id '" + executionId + "'", "execution", execution);

      signalEvents = eventSubscriptionManager.findSignalEventSubscriptionsByNameAndExecution(eventName, executionId);
      ensureNotEmpty("Execution '" + executionId + "' has not subscribed to a signal event with name '" + eventName + "'.", signalEvents);
    }

    // check authorization for each fetched signal event
    AuthorizationManager authorizationManager = commandContext.getAuthorizationManager();
    for (SignalEventSubscriptionEntity event : signalEvents) {
      String processInstanceId = event.getProcessInstanceId();
      authorizationManager.checkUpdateProcessInstanceById(processInstanceId);
    }

    HashMap<String, Object> payload = null;
    if(variables != null) {
      payload = new HashMap<String, Object>(variables);
    }

    for (SignalEventSubscriptionEntity signalEventSubscriptionEntity : signalEvents) {
      signalEventSubscriptionEntity.eventReceived(payload, false);
    }

    return null;
  }

}


text:
task :xp5k do
  puts "  XP5K launched (submission and deployment)"
end

desc 'Submit jobs'
task :submit do
  $myxp.submit
  $myxp.wait_for_jobs
end

desc 'Deploy with Kadeploy'
task :deploy  do
  $myxp.deploy
end

desc 'Remove all running jobs'
task :clean do
logger.debug "Clean all Grid'5000 running jobs..."
  $myxp.clean
end

desc 'Describe the cluster'
task :describe do
  servers = find_servers
  servers_by_roles = {}
  servers.each do |server|
    role_names = role_names_for_host(server)
    role_names.each do |role|
      servers_by_roles[role] ||= []
      servers_by_roles[role] << server
    end
  end
  puts "+----------------------------------------------------------------------+"
  servers_by_roles.each do |role, servers|
    print "|"+"%-30s".blue % role
    server = servers.pop
    puts "%-40s|" % server
    servers.each do |server|
      print "|"+"%-30s" % " "
      puts "%-40s|" % server
    end
    puts "+----------------------------------------------------------------------+"
  end
end

desc 'Prepare my stuff'
task :prepare, :roles => [:controller] do
  set :user, "root"
  set :default_environment, {
    "OS_USERNAME" => "test",
    "OS_PASSWORD" => "abc123",
    "OS_TENANT_NAME" => "test",
    "OS_AUTH_URL" => "http://localhost:5000/v2.0/"
  }
  run "apt-get install --yes git &&
  git clone https://davidguyon@bitbucket.org/davidguyon/greenerbar.git &&
  cd greenerbar &&
  bash install-greenerbar.bash &&
  unset http_proxy https_proxy &&
  nova keypair-add test_key > ~/.ssh/test_key.pem &&
  chmod 600 ~/.ssh/test_key.pem &&
  echo 'export EC2_KEYPAIR=test_key' >> ~/.bashrc &&
  echo 'export EC2_SECURITY_GROUP=vm_jdoe_sec_group' >> ~/.bashrc"
end

after "xp5k", "submit", "deploy"


text:
	<select ng-model="model.value">
		<option value="0">Csv</option>
		<option value="1">Json</option>
		<option value="2" disabled="disabled">Xml</option>
        <option value="3">Csv include Search typed</option>
	</select>


text:
<?php

namespace phpDocumentor\Descriptor;

use \Mockery as m;

/**
 * Tests the functionality for the MethodDescriptor class.
 */
class MethodDescriptorTest extends \PHPUnit_Framework_TestCase
{
    /** @var MethodDescriptor $fixture */
    protected $fixture;

    /**
     * Creates a new (emoty) fixture object.
     */
    protected function setUp()
    {
        $this->fixture = new MethodDescriptor();
    }

    /**
     * Tests whether all collection objects are properly initialized.
     *
     * @covers phpDocumentor\Descriptor\MethodDescriptor::__construct
     */
    public function testInitialize()
    {
        $this->assertAttributeInstanceOf('phpDocumentor\Descriptor\Collection', 'arguments', $this->fixture);
    }

    /**
     * @covers phpDocumentor\Descriptor\MethodDescriptor::setArguments
     * @covers phpDocumentor\Descriptor\MethodDescriptor::getArguments
     */
    public function testSettingAndGettingArguments()
    {
        $this->assertInstanceOf('phpDocumentor\Descriptor\Collection', $this->fixture->getArguments());

        $mock = m::mock('phpDocumentor\Descriptor\Collection');

        $this->fixture->setArguments($mock);

        $this->assertSame($mock, $this->fixture->getArguments());
    }

    /**
     * @covers phpDocumentor\Descriptor\MethodDescriptor::isAbstract
     * @covers phpDocumentor\Descriptor\MethodDescriptor::setAbstract
     */
    public function testSettingAndGettingWhetherMethodIsAbstract()
    {
        $this->assertFalse($this->fixture->isAbstract());

        $this->fixture->setAbstract(true);

        $this->assertTrue($this->fixture->isAbstract());
    }

    /**
     * @covers phpDocumentor\Descriptor\MethodDescriptor::isFinal
     * @covers phpDocumentor\Descriptor\MethodDescriptor::setFinal
     */
    public function testSettingAndGettingWhetherMethodIsFinal()
    {
        $this->assertFalse($this->fixture->isFinal());

        $this->fixture->setFinal(true);

        $this->assertTrue($this->fixture->isFinal());
    }

    /**
     * @covers phpDocumentor\Descriptor\MethodDescriptor::isStatic
     * @covers phpDocumentor\Descriptor\MethodDescriptor::setStatic
     */
    public function testSettingAndGettingWhetherMethodIsStatic()
    {
        $this->assertFalse($this->fixture->isStatic());

        $this->fixture->setStatic(true);

        $this->assertTrue($this->fixture->isStatic());
    }

    /**
     * @covers phpDocumentor\Descriptor\MethodDescriptor::getVisibility
     * @covers phpDocumentor\Descriptor\MethodDescriptor::setVisibility
     */
    public function testSettingAndGettingVisibility()
    {
        $this->assertEquals('public', $this->fixture->getVisibility());

        $this->fixture->setVisibility('private');

        $this->assertEquals('private', $this->fixture->getVisibility());
    }

    /**
     * @covers phpDocumentor\Descriptor\MethodDescriptor::getResponse
     */
    public function testRetrieveReturnTagForResponse()
    {
        $mock = new \stdClass();

        $this->assertNull($this->fixture->getResponse());

        $this->fixture->getTags()->set('return', new Collection(array($mock)));

        $this->assertSame($mock, $this->fixture->getResponse());
    }
}


text: - Updated Docker image to demisto/python3:3.10.7.33922.


text:
[Home](./index.md) > [sip.js](./sip.js.md) > [Info](./sip.js.info.md) > [reject](./sip.js.info.reject.md)

## Info.reject() method

Reject the request.

Signature:

```typescript
reject(options?: ResponseOptions): Promise<void>;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  options | ResponseOptions |  |

Returns:

Promise<void>


text:
@interface EditOrCreateTV ()<UITextFieldDelegate>
{
    UIBarButtonItem *saveButton;
    UIView *keyboardView;
}
@end

@implementation EditOrCreateTV

- (void)viewDidLoad {
    [super viewDidLoad];

    if (_isNew) {
        self.navigationItem.title = @"新建";
    }else {
        self.navigationItem.title = @"编辑";
    }

    saveButton = [[UIBarButtonItem alloc] initWithTitle:@"保存并退出" style:UIBarButtonItemStyleDone target:self action:@selector(doneAndExit)];
    self.navigationItem.rightBarButtonItem = saveButton;

    self.tableView.backgroundColor = whiteColor;
    self.view.backgroundColor = whiteColor;
    self.tableView.showsVerticalScrollIndicator = NO;

    if (!_store) {
        _store = [Stores new];
        _store.bigOrSmall = YES;
        _store.callFirst = NO;
        _store.parking = NO;
        _store.mealing = NO;

        _store.phoneNum = @"";
        _store.state = 0;
        _store.points = 3;

        _store.createDate = [[self dateFormatter] stringFromDate:[NSDate date]];
        _store.wholeNote = @"";
        _store.allPrice = @"";
        _store.distance = 0;
        _store.lowestPrice = 0;
        _store.webLink = @"https://www.baidu.com/";
    }

    [self initTheKeyboardView];
}

- (void)initTheKeyboardView {
    //键盘上放的View
    keyboardView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, screenWidth, 36)];
    keyboardView.backgroundColor = [UIColor colorWithWhite:0.95 alpha:0.8];
    UIView *sepView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, screenWidth, 0.5)];
    sepView.backgroundColor = [UIColor lightGrayColor];

    UIButton *finishButton = [[UIButton alloc] initWithFrame:CGRectMake(screenWidth - 100, 4, 90, 30)];
    [finishButton setTitle:@"完成" forState:UIControlStateNormal];
    finishButton.titleLabel.font = [UIFont systemFontOfSize:15];
    [finishButton setTitleColor:MYGreenColor forState:UIControlStateNormal];
    UIImageView *finishImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"finishType"]];
    finishImageView.image = [finishImageView.image imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
    [finishButton setImage:finishImageView.image forState:UIControlStateNormal];
    finishButton.tintColor = MYGreenColor;
    finishButton.imageEdgeInsets = UIEdgeInsetsMake(0, 0, 5, 8);
    [finishButton addTarget:self action:@selector(finishTyping:) forControlEvents:UIControlEventTouchUpInside];

    UIButton *cancelButton = [[UIButton alloc] initWithFrame:CGRectMake(0, 4, 100, 30)];
    [cancelButton setTitle:@"取消" forState:UIControlStateNormal];
    [cancelButton setTitleColor:MYGreenColor forState:UIControlStateNormal];
    cancelButton.tintColor = MYGreenColor;
    cancelButton.titleLabel.font = [UIFont systemFontOfSize:15];
    UIImageView *cancelImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"cancelTyoe"]];
    cancelImageView.image = [cancelImageView.image imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
    [cancelButton setImage:cancelImageView.image forState:UIControlStateNormal];
    cancelButton.imageEdgeInsets = UIEdgeInsetsMake(0, 0, 0, 8);
    [cancelButton addTarget:self action:@selector(cancelTyping) forControlEvents:UIControlEventTouchUpInside];
    [keyboardView addSubview:sepView];
    [keyboardView addSubview:cancelButton];
    [keyboardView addSubview:finishButton];
}

- (NSDateFormatter *)dateFormatter {
    static NSDateFormatter *dateFormatter;
    if(!dateFormatter){
        dateFormatter = [NSDateFormatter new];
        dateFormatter.dateFormat = @"yyyy-MM-dd";
    }
    return dateFormatter;
}

- (void)doneAndExit {
    if (_isNew) {
        [_store save];
    }else {
        [_store update];
    }
    [self.navigationController popViewControllerAnimated:YES];
}

- (void)finishTyping: (id)sender {
    [self.view endEditing:YES];
    saveButton.enabled = YES;
}

- (void)cancelTyping {
    [self.view endEditing:YES];
    saveButton.enabled = YES;
}

- (BOOL)textFieldShouldBeginEditing:(UITextField *)textField {
    saveButton.enabled = NO;
    return YES;
}

- (BOOL)textFieldShouldReturn:(UITextField *)textField {
    saveButton.enabled = NO;
    return YES;
}

- (BOOL)textFieldShouldEndEditing:(UITextField *)textField {
    if (textField.tag == 101) {
        _store.StoreName = textField.text;
    }else if (textField.tag == 201) {
        _store.add_province = textField.text;
    }else if (textField.tag == 202) {
        _store.add_city = textField.text;
    }else if (textField.tag == 203) {
        _store.add_address = textField.text;
    }else if (textField.tag == 204) {
        _store.add_more = textField.text;
    }

    return YES;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

#pragma mark - Table view data source

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    return 3;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    if (section == 0) {
        return 1;
    }else if (section == 1) {
        return 1;
    }else {
        return 4;
    }
}

- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
    if (section == 0) {
        return 30;
    }else {
        return 15;
    }
}

- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section {
    return 1;
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
    if (indexPath.section == 0) {
        return 44;
    }else if (indexPath.section == 1) {
        return 115;
    }
    return 40;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    if (indexPath.section == 0) {
        static NSString *cellIdentifier = @"titleEditCell";
        titleEditCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier];
        if(cell == nil) {
            cell = [[[NSBundle mainBundle]loadNibNamed:cellIdentifier owner:nil options:nil] firstObject];
        }
        cell.selectionStyle = UITableViewCellSelectionStyleNone;
        cell.nameTextField.inputAccessoryView = keyboardView;

        cell.nameTextField.delegate = self;
        cell.nameTextField.tag = 101;
        cell.nameTextField.text = _store.StoreName;

        return cell;
    }else if (indexPath.section == 1) {
        static NSString *cellIdentifier = @"AddressEditCell";
        AddressEditCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier];
        if(cell == nil) {
            cell = [[[NSBundle mainBundle]loadNibNamed:cellIdentifier owner:nil options:nil] firstObject];
        }
        cell.selectionStyle = UITableViewCellSelectionStyleNone;
        cell.stateTextField.delegate = self;
        cell.cityTextField.delegate = self;
        cell.addressTextField.delegate = self;
        cell.otherTextField.delegate = self;
        cell.stateTextField.inputAccessoryView = keyboardView;
        cell.cityTextField.inputAccessoryView = keyboardView;
        cell.addressTextField.inputAccessoryView = keyboardView;
        cell.otherTextField.inputAccessoryView = keyboardView;
        cell.stateTextField.tag = 201;
        cell.cityTextField.tag = 202;
        cell.addressTextField.tag = 203;
        cell.otherTextField.tag = 204;
        cell.stateTextField.text = _store.add_province;
        cell.cityTextField.text = _store.add_city;
        cell.addressTextField.text = _store.add_address;
        cell.otherTextField.text = _store.add_more;

        return cell;
    }else {
        static NSString *cellIdentifier = @"CallFirstCell";
        CallFirstCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier];
        if(cell == nil) {
            cell = [[[NSBundle mainBundle]loadNibNamed:cellIdentifier owner:nil options:nil] firstObject];
        }
        cell.selectionStyle = UITableViewCellSelectionStyleNone;
        cell.isEdit = YES;

        if (indexPath.row == 0) {
            cell.needCallFirst = _store.bigOrSmall;
            cell.titleLabel.text = @"大小";
            cell.iconImageView.image = [UIImage imageNamed:@"wedding_rings_filled"];
        }else if (indexPath.row == 1) {
            cell.needCallFirst = _store.callFirst;
            cell.titleLabel.text = @"房内换衣";
            cell.iconImageView.image = [UIImage imageNamed:@"christmas_star"];
        }else if (indexPath.row == 2) {
            cell.needCallFirst = _store.parking;
            cell.titleLabel.text = @"车位";
            cell.iconImageView.image = [UIImage imageNamed:@"parking"];
        }else if (indexPath.row == 3) {
            cell.needCallFirst = _store.mealing;
            cell.titleLabel.text = @"留宿";
            cell.iconImageView.image = [UIImage imageNamed:@"meal"];
        }

        cell.changeBlock = ^(BOOL isYes, NSString *state){
//            NSLog(@"state: %@, bool: %@", state, isYes?@"Yes":@"No");
            if ([state isEqualToString:@"房内换衣"]) {
                _store.callFirst = isYes;
            }else if ([state isEqualToString:@"车位"]) {
                _store.parking = isYes;
            }else if ([state isEqualToString:@"留宿"]) {
                _store.mealing = isYes;
            }else if ([state isEqualToString:@"大小"]) {
                _store.bigOrSmall = isYes;
            }
        };

        return cell;
    }
}

@end


text:
#region Licence

#endregion

using System;

namespace WmcSoft.Monitoring.Instruments
{
    /// <summary>
    /// Represents an instrument observing an observable and computing using a custom function.
    /// </summary>
    /// <typeparam name="T"></typeparam>
    public class CustomObservingInstrument<T> : ObservingInstrument<T>
    {
        private readonly Func<T, decimal> measure;

        static decimal Convert(T value)
        {
            return System.Convert.ToDecimal(value);
        }

        public CustomObservingInstrument(string name, IObservable<T> observable, Func<T, decimal> measure)
            : base(name, observable)
        {
            this.measure = measure ?? Convert;
        }

        protected override decimal Measure(T value)
        {
            return measure(value);
        }
    }
}


text:
[assembly: global::Android.Runtime.ResourceDesignerAttribute("com.xamarin.AndroidIconics.Resource", IsApplication=false)]

namespace com.xamarin.AndroidIconics
{

	[System.CodeDom.Compiler.GeneratedCodeAttribute("Xamarin.Android.Build.Tasks", "1.0.0.0")]
	public partial class Resource
	{

		static Resource()
		{
			global::Android.Runtime.ResourceIdManager.UpdateIdValues();
		}

		public partial class Attribute
		{

			// aapt resource value: 0x7f010001
			public static int iiv_color = 2130771969;

			// aapt resource value: 0x7f010000
			public static int iiv_icon = 2130771968;

			static Attribute()
			{
				global::Android.Runtime.ResourceIdManager.UpdateIdValues();
			}

			private Attribute()
			{
			}
		}

		public partial class String
		{

			// aapt resource value: 0x7f02000c
			public static int app_name = 2130837516;

			// aapt resource value: 0x7f020000
			public static int define_AndroidIconics = 2130837504;

			// aapt resource value: 0x7f020001
			public static int library_AndroidIconics_author = 2130837505;

			// aapt resource value: 0x7f020002
			public static int library_AndroidIconics_authorWebsite = 2130837506;

			// aapt resource value: 0x7f020008
			public static int library_AndroidIconics_isOpenSource = 2130837512;

			// aapt resource value: 0x7f020004
			public static int library_AndroidIconics_libraryDescription = 2130837508;

			// aapt resource value: 0x7f020003
			public static int library_AndroidIconics_libraryName = 2130837507;

			// aapt resource value: 0x7f020005
			public static int library_AndroidIconics_libraryVersion = 2130837509;

			// aapt resource value: 0x7f020006
			public static int library_AndroidIconics_libraryWebsite = 2130837510;

			// aapt resource value: 0x7f020007
			public static int library_AndroidIconics_licenseId = 2130837511;

			// aapt resource value: 0x7f02000a
			public static int library_AndroidIconics_owner = 2130837514;

			// aapt resource value: 0x7f020009
			public static int library_AndroidIconics_repositoryLink = 2130837513;

			// aapt resource value: 0x7f02000b
			public static int library_AndroidIconics_year = 2130837515;

			static String()
			{
				global::Android.Runtime.ResourceIdManager.UpdateIdValues();
			}

			private String()
			{
			}
		}

		public partial class Styleable
		{

			public static int[] IconicsImageView = new int[] {
					2130771968,
					2130771969};

			// aapt resource value: 1
			public static int IconicsImageView_iiv_color = 1;

			// aapt resource value: 0
			public static int IconicsImageView_iiv_icon = 0;

			static Styleable()
			{
				global::Android.Runtime.ResourceIdManager.UpdateIdValues();
			}

			private Styleable()
			{
			}
		}
	}
}
#pragma warning restore 1591


text:
/*global require: false, module: false */
"use strict";

var mod = function(
  _
) {

  /**
   * A mixin enabling pubsub on an object. To use, copy the singleton methods into the object or object prototype:
   *
   *     var myObj = _.extend({}, PubSub);
   *     myObj.on('foo', function(evt) { console.log(evt) }); // logs `{ 'some': 'data' }`
   *     myObj.notify('foo', { some: 'data' });
   *
   */
  var PubSub = {
    on: function(eventName, handler, context) {
      var bucket = this.__pubSubBucket(eventName);
      bucket.subscribe(handler, context);
    },
    off: function(eventName, handler, context) {
      var bucket = this.__pubSubBucket(eventName);
      bucket.unsubscribe(handler, context);
    },
    notify: function() {
      var args      = _.toArray(arguments),
          eventName = args.shift();

      var bucket = this.__pubSubBucket(eventName);
      bucket.notify(args);
    },
    __pubSubBucket: function(eventName) {
      this.__pubSubEvents = this.__pubSubEvents || {};
      this.__pubSubEvents[eventName] = this.__pubSubEvents[eventName] || new EventBucket(eventName);
      return this.__pubSubEvents[eventName];
    }
  };

  var EventBucket = function() {
    this.initialize.apply(this, arguments);
  };

  _.extend(EventBucket.prototype, {
    initialize: function(eventName) {
      this._eventName = eventName;
      this._subscriptions = [];
    },
    subscribe: function(handler, context) {
      if (handler) {
        this._subscriptions.push(new Subscription(handler, context));
      } else {
        throw new Error("Subscription requires handler: " + this._eventName);
      }
    },
    unsubscribe: function(handler, context) {
      var subs;
      if (handler) {
        subs = _.filter(this._subscriptions, function(sub) {
          return sub.matches(handler, context);
        });
      } else {
        subs = this._subscriptions;
      }

      _.each(subs, function(sub) {
        sub.dispose();
      });

      this._subscriptions = _.difference(this._subscriptions, subs);
    },
    notify: function(args) {
      _.invoke(this._subscriptions, "notify", args);
    }
  });

  var Subscription = function() {
    this.initialize.apply(this, arguments);
  };

  _.extend(Subscription.prototype, {
    initialize: function(handler, context) {
      this._handler = handler;
      this._context = context;
    },
    matches: function(handler, context) {
      if (this._context) {
        // Compare context refs as refs iff we have a context object
        return (handler === this._handler && context === this._context);
      } else {
        // Otherwise, just make sure we don't have a context (null or undefined are fine)
        return (handler === this._handler && !context);
      }
    },
    notify: function(args) {
      // We shouldn't be called after dispose, but
      // just in case...
      if (this._handler) {
        this._handler.apply(this._context, args);
      } else {
        // Something went wrong here...
      }
    },
    dispose: function() {
      this._handler = null;
      this._context = null;
    }
  })

  return PubSub;
};

module.exports = mod(
  require("underscore")
);


text:
Hello-libs
=========
Hello-Libs is an Android sample that demos native lib management in Android Studio.

This sample uses the new [Gradle Experimental Android plugin](http://tools.android.com/tech-docs/new-build-system/gradle-experimental) with external lib support:
*    Build JUST a native shared library[for distribution]
*    Use 3rd party shared library / Static library

The key points are:
*    Inform Android Studio where lib/header is
*    Add lib dependency to application
Details are inside projects' build.gradle files

Sample content:
*    Create 2 shared libs
*    Copy built libs into distribution directory
*    Create one application to use libs from the given distribution directory

Pre-requisites
--------------
- Android Studio 2.0+ with [NDK](https://developer.android.com/ndk/) bundle.

Getting Started
---------------
1. [Download Android Studio](http://developer.android.com/sdk/index.html)
1. Launch Android Studio.
1. Open the sample directory.
1. Open *File/Project Structure...*
  - Click *Download* or *Select NDK location*.
1. Click *Tools/Android/Sync Project with Gradle Files*.
1. Click *Run/Run 'app'*.

Screenshots
-----------
![screenshot](screenshot.png)

Support
-------
If you've found an error in these samples, please [file an issue](https://github.com/googlesamples/android-ndk/issues/new).

Patches are encouraged, and may be submitted by [forking this project](https://github.com/googlesamples/android-ndk/fork) and
submitting a pull request through GitHub. Please see [CONTRIBUTING.md](../CONTRIBUTING.md) for more details.

- [Stack Overflow](http://stackoverflow.com/questions/tagged/android-ndk)
- [Google+ Community](https://plus.google.com/communities/105153134372062985968)
- [Android Tools Feedbacks](http://tools.android.com/feedback)

License
-------
Copyright 2015 Google, Inc.

Licensed to the Apache Software Foundation (ASF) under one or more contributor
license agreements.  See the NOTICE file distributed with this work for
additional information regarding copyright ownership.  The ASF licenses this
file to you under the Apache License, Version 2.0 (the "License"); you may not
use this file except in compliance with the License.  You may obtain a copy of
the License at

  http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
License for the specific language governing permissions and limitations under
the License.


text:
//
//  XDKDropdownMenu.m
//  XDK微博
//
//  Created by 徐宽阔 on 15/6/3.
//  Copyright (c) 2015年 xdk. All rights reserved.
//

#import "XDKDropdownMenu.h"

@interface XDKDropdownMenu()
/**
 *  显示具体内容的容器
 */
@property (nonatomic,weak)UIImageView *containerView;

@end

@implementation XDKDropdownMenu
/**
 *  重写set方法
 *
 *  @param content 调用containerView的懒加载
 */
-(void)setContent:(UIView *)content
{
    _content = content;

    // 调整内容的位置
    content.x = 10;
    content.y = 15;
    // 调整内容的宽度
//    content.width = self.containerView.width - 2 * content.x;

    // 设置灰色容器的尺寸
    // 宽度
    self.containerView.width = CGRectGetMaxX(content.frame) + 10;
    // 高度
    self.containerView.height = CGRectGetMaxY(content.frame) + 11;

    [self.containerView addSubview:content];
}

-(void)setContentController:(UIViewController *)contentController
{
    _contentController = contentController;
    self.content = contentController.view;
}

-(UIImageView *)containerView
{
    if (!_containerView) {
        UIImageView *containerView = [[UIImageView alloc] init];
        containerView.image = [UIImage imageNamed:@"popover_background"];
        containerView.userInteractionEnabled = YES;
//        containerView.width = 217;
//        containerView.height = 217;
        [self addSubview:containerView];
        self.containerView = containerView;
    }
    return _containerView;
}

-(instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];

    if (self) {
        self.backgroundColor = [UIColor clearColor];
    }

    return self;
}

+(instancetype)menu
{
    return [[self alloc] init];
}

-(void)showFrom:(UIView *)from
{
    UIWindow *window = [[UIApplication sharedApplication].windows lastObject];
    [window addSubview:self];
    self.frame = window.frame;

    // 调整灰色图片的位置
    // 默认情况下,frame是以父控件左上角为坐标原点
    // 可以转换坐标系原点,改变frame的参照点
    CGRect newFrame = [from convertRect:from.bounds toView:window];
//    CGRect newFrame = [from.superview convertRect:from.frame toView:window];
    self.containerView.y = CGRectGetMaxY(newFrame);

//    self.containerView.x = (self.width - self.containerView.width) * 0.5;

    self.containerView.centerX = CGRectGetMidX(newFrame);

    if ([self.delegate respondsToSelector:@selector(dropdownMenuDidShow:)]) {
        [self.delegate dropdownMenuDidShow:self];
    }

}

-(void)disMiss
{
    [self removeFromSuperview];
    if ([self.delegate respondsToSelector:@selector(dropdownMenuDidDisMiss:)]) {
        [self.delegate dropdownMenuDidDisMiss:self];
    }
}

-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
    [self disMiss];
}

@end


text:
(function(window, document, $) { //The function wrapper prevents leaking variables to global space
    'use strict';
    var IC;

    //These lines register the Example object in a plugin namespace that makes
    //referencing the plugin easier when debugging.
    var plugins = namespace('plugins');
    plugins.IC = IC;

    IC = function IC(cockpit) {

      console.log('Loading internet-control plugin in the browser.');

      //instance variables
      this.cockpit = cockpit;
      this.rov = cockpit.rov;
      this.settings = {};

      // for plugin management:
      this.Plugin_Meta = {
        name: 'Internet Control', // for the settings
        viewName: 'Internet Control plugin', // for the UI
        defaultEnabled: false
      };
      this.enabled=false;
      this.connected = false;
      this.connecting = false;
      this.viewers = 0;
      this.peers = [];

    };

    //private functions and variables (hidden within the function, available via the closure)

    //Adding the public methods using prototype simply groups those methods
    //together outside the parent function definition for easier readability.

    //Called by the plugin-manager to enable a plugin
    IC.prototype.enable = function enable() {
      this.startlisten();
    };

    //Called by the plugin-manager to disable a plugin
    IC.prototype.disable = function disable() {
      //TODO: Impliment and unlisten
    };

    //listen gets called by the plugin framework after all of the plugins
    //have loaded.
    IC.prototype.startlisten = function startlisten() {
      if (!this.isEnabled){return;}
      var self = this;

      var statusUpdate=function(){
        var status = {status:'off',stats:{viewers:0,pilots:0,connection:{}},pilots:{}};
        if (self.connecting){
          status.status='starting';
        }
        if (self.connected){
          status.status='streaming';
        }
        status.stats.viewers = self.viewers;

        //TODO: Figure out how to show stats
        /*
        status.stats.connection = self.peers.map(function(item){
          item._pc.getStats(function(res){
            return res.result();
          });
        }).reduce(function(previousValue,currentValue){
          if (previousValue===null){
            return currentValue;
          }
          for (var property in currentValue) {
              if (object.hasOwnProperty(property)) {
                  previousValue[property]=previousValue[property]+currentValue[property];
              }
          }
          return previousValue;
        },null);

        */
        self.cockpit.emit('plugin-internetControl-status',status);
      }
      setInterval(statusUpdate,1000);

      //Response from the getSettings call. Using the withHistory will call the
      //update function with the last copy of this message that had been sent.
      //The settings manager sends a change message for each section when
      //first read in.
      this.rov.withHistory.on('settings-change.ic', function(settings) {
          console.log("Settings changed for IC");
          self.settings = settings.ic;

          //TODO: Move to a pattern that can retry the connection when the setting changes
          $.getScript(self.settings.webRTCSignalServerURI + "/msgpack.min.js");
          $.getScript(self.settings.webRTCSignalServerURI + "/components/simple-peer/simplepeer.min.js", function() {
              var _self = self
              var Peer = window.SimplePeer;
              var io = window.io;
              var socket = io(self.settings.webRTCSignalServerURI,{path:'/netcockpit-signal'});
              self.connecting = true;
              var peerOpts= {
                  channelConfig: {
                    ordered: false,
                    maxRetransmits: 0
                  }
                }

              var heartbeatInterval = null;
              socket.on('close',function(){
                if (heartbeatInterval!==null){
                  clearInterval(heartbeatInterval);
                }
                self.connected=false;
              });

              var connectionTimeOutTimer=null;
              socket.on('disconnect',function(){
                console.log("disconneted");
                self.connected = false;
              })

              socket.on('reconnect',function(){
                console.log("disconneted");
                self.connected = true;
              })

              socket.on('heartbeat',function(data){
                console.log('Heartbeat: ' + JSON.stringify(data));
              });

              socket.on('connect',function(){
                self.connected = true;
                self.connecting= false;

                //var msgpack = require("msgpack-lite");

                heartbeatInterval=setInterval(function(){
                  if (!self.connected){return;}
                  socket.emit('heartbeat','server');
                },1000);
                var pilot_sender_id = null;

                socket.on('peer-connect-offer',function(peer_id,callback){
                  var p = new Peer(peerOpts);

                  p.withHistory = {
                    on: function(event, fn) {
                      p.on(event, fn);
                    }
                  };

                  p.on('error', function (err) {
                    console.error('error', err)
                  })

                  p.on('signal', function (data) {
                    socket.emit('signal',peer_id, data);
                    console.log('SIGNAL SENT:', JSON.stringify(data))
                  })

                  var onSignalHanlder = function(data,sender_id){
                    if (sender_id !== peer_id){
                      console.error('Invalid sender_id');
                      return;
                    }
                    p.signal(data);
                  };

                  socket.on('signal',onSignalHanlder);

                  callback(true);

                  p.on('connect', function(){
                    _self.viewers++;
                    _self.peers.push(p);
                    //make last person to connect pilot by default
//                    pilot_sender_id = peer_id;
//                    _self.cockpit.emit('plugin.rovpilot.sendToROVEnabled',false);
                    p.sendemit = function sendemit(){
                      var args = new Array(arguments.length);
                      for(var i = 0; i < args.length; ++i) {
                                  //i is always valid index in the arguments object
                          args[i] = arguments[i];
                      }
                      p.send(msgpack.encode(args));
                    }

                    //Test data payload sizes
                    for (var i=1;i<=10;i++){
                      var size = Math.pow(2,i);
                      p.sendemit('data-msg',size,new ArrayBuffer(size),'ok');
                    }

                    var onevent = _self.rov.socket.onevent;

                    _self.rov.socket.onevent = function (packet) {
                        var args = packet.data || [];
                        onevent.call (this, packet);    // original call

                        if (p==null) {return;}
                        args = args.filter(function(n){ return n != null });
                        p.sendemit.apply(this,args);
                    };

                    var onAnyHandler = function() {
                      var event = this.event;
                      if (event !== 'newListener') {
                      //  console.log(event);
                        var args = new Array(arguments.length);
                        for(var i = 0; i < args.length; ++i) {
                                    //i is always valid index in the arguments object
                            args[i] = arguments[i];
                        }
                        args.unshift(event);
                        p.sendemit.apply(p,args);
                      }
                    }
                    _self.rov.onAny(onAnyHandler);

                    //Since the video comes in via a different route...
                    const webRTCDataChannelChunkLimit=16*1024; //16KB Chunk Recommendation
                    var videodataHanlder = function(data){
                      var chunk_count = 1;
                      var sliceend=0;
                      var end = 0;
                      while(end<data.byteLength){
                        var sliceend = sliceend+webRTCDataChannelChunkLimit>data.byteLength?data.byteLength:sliceend+webRTCDataChannelChunkLimit
                        var chunk = data.slice(end,sliceend);
                        p.sendemit('x-h264-video.chunk',chunk_count,data.byteLength-sliceend,chunk);
                        chunk_count++;
                        end=sliceend;
                      }
                    }
                    _self.cockpit.on('x-h264-video.data',videodataHanlder);

                    p.on('data',function(data){
                      var msg = msgpack.decode(data);
                      switch(msg[0]){
                        case 'request_Init_Segment':
                          _self.cockpit.emit('request_Init_Segment',function(init){
                              p.sendemit('x-h264-video.init',init);
                          });
                        break;
                      }

                      if (peer_id == pilot_sender_id){
                        switch(msg[0]){
                          case 'throttle':
                          case 'yaw':
                          case 'list':
                          case 'pitch':
                          case 'roll':
                          case 'strafe':
                            _self.rov.emit(msg[0],msg[1]);
                          break;
                          case 'plugin.rovpilot.desiredControlRates':
                          case 'plugin.externalLights.toggle':
                          case 'plugin.externalLights.adjust':
                          case 'plugin.externalLights.set':
                          case 'plugin.laser.set':
                          case 'plugin.lights.toggle':
                          case 'plugin.lights.adjust':
                          case 'plugin.lights.set':
                          case 'plugin.rovpilot.depthHold.set':
                          case 'plugin.rovpilot.headingHold.set':
                            _self.rov.emit.apply(_self.rov,msg);
                          break;
                        }
                      }

                    });

                  p.on('close', function(){
                    _self.viewers--;
                    socket.off('signal',onSignalHanlder);
                    _self.rov.offAny(onAnyHandler);
                    _self.cockpit.off('x-h264-video.data',videodataHanlder);
                    _self.cockpit.emit('plugin.rovpilot.sendToROVEnabled',true);
                    var index = _self.peers.indexOf(p);
                    if (index > -1) {
                      _self.peers.splice(index, 1);
                    }
                    p = null;
                  });

                })
              });

          });

      });
    });
  }

      IC.prototype.inputDefaults = function inputDefaults() {
        var self = this;
        return []
      };

      //headsUpMenuItems is called by the headsup-menu plugin if present.
      IC.prototype.altMenuDefaults = function altMenuDefaults() {
        //TODO: Need to cleanup the interface to the alt-menu
        var self = this;
        var item = {
          label: 'Internet Control',
          callback: function() {
            console.log("Internet Control")
          }
        };
        return item;
      }

      window.Cockpit.plugins.push(IC);

    }(window, document, $));


text:
/*
 * IntegerAsnOneObject.h
 *
 *  Created on: 13.05.2017
 *      Author: felix
 */

#ifndef SRC_INTEGERASNONEOBJECT_H_
#define SRC_INTEGERASNONEOBJECT_H_

#include <asn-one-objects/GenericAsnOneObject.h>

namespace Flix {

class IntegerAsnOneObject: public GenericAsnOneObject {
public:
    IntegerAsnOneObject();
    virtual ~IntegerAsnOneObject();

    int getValue(void) const;

    void setValue(int value);

    static IntegerAsnOneObject* decode(StreamBuffer buffer, AsnOneDecodeStatus& decodeStatus);
    static IntegerAsnOneObject* castObject(GenericAsnOneObject* object);

    virtual StreamBuffer serialize(void) const;
    virtual std::string dump(void) const;

private:
    int value;
};

} /* namespace Flix */

#endif /* SRC_INTEGERASNONEOBJECT_H_ */


text:
package com.annotations.openface.sdk.net.coder;

import java.nio.ByteBuffer;
import java.nio.ByteOrder;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.annotations.openface.omnibean.OmniBean;
import com.annotations.openface.omnibean.util.BeanUtil;
import com.annotations.openface.sdk.net.msg.IMessage;
import com.annotations.openface.sdk.net.msg.MessageMap;
import com.annotations.openface.sdk.net.msg.MessageReadException;
import com.annotations.openface.sdk.util.IoBuffer;

public class OGMessage implements IMessage {
	private static final ByteOrder BYTE_ORDER= ByteOrder.LITTLE_ENDIAN;
	private static final String CHAR_SET = "GBK";

	private int msgType;
	private int msgLength;
	private OmniBean message;
	private long sessionId;

	private Logger logger = LoggerFactory.getLogger(OGMessage.class);

	public OGMessage(){}
	public OGMessage(int type,OmniBean msg){
		this.msgType = type;
		this.message = msg;
	}
	@Override
	public int getMessageType() {
		return msgType;
	}

	@Override
	public Object getMessage() {
		return message;
	}
	@Override
	public ByteBuffer toByteArray() {
		byte[] bytes = message.toByteArray(CHAR_SET);
		ByteBuffer bb = ByteBuffer.allocate(bytes.length+12);
		bb.order(BYTE_ORDER);
		bb.putInt(msgType);
		bb.putInt(bytes.length);
		bb.putInt(0);

		bb.put(bytes);
		bb.flip();
//		System.out.println(message.getClass().getSimpleName()+">>>>len="+msgLength+">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
//		BeanUtil.printBytes(bb.array());
//		System.out.println(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");

		return bb;
	}

	@Override
	public int readFrom(IoBuffer iob,MessageMap msgMap,int linkId,int intIP) throws MessageReadException{
		if(iob.getRemainLength()<12)
			return 0;
		iob.setByteOrder(ByteOrder.LITTLE_ENDIAN);
		this.msgType = iob.getInt();
		this.msgLength = iob.getInt();
		iob.getInt();
		if(msgLength>iob.getRemainLength())
			return 0;
		sessionId = linkId;

		try{
			Class<?> clazz = msgMap.getMessageClassByType(msgType);
			message = (OmniBean)clazz.newInstance();
			byte[] buffer = new byte[msgLength];
//			System.out.println(clazz.getSimpleName()+"----len="+msgLength+"----------------------------------------------------------------");
//			BeanUtil.printBytes(buffer,0,buffer.length);
//			System.out.println("--------------------------------------------------------------------");
			iob.readBytes(buffer, msgLength);
			message.readFrom(buffer,CHAR_SET);
		}catch(Exception e){
			message = null;
			iob.clear();
			logger.error("Parse message error."+e.getMessage());
		}
		return msgLength + 12;
	}

	@Override
	public int length() {
		if(message == null)
			return 0;
		return msgLength+12;
	}

	@Override
	public long getSessionId() {
		return sessionId;
	}
}