text:
<?php

/**
 * [Enter Class Description]
 *
 * @package		Todoyu
 * @subpackage	[Subpackage]
 */
class TodoyuValidatorTest extends PHPUnit_Framework_TestCase {

	public function testIsEmail() {
		$this->assertTrue(TodoyuValidator::isEmail('team@todoyu.com'));
		$this->assertTrue(TodoyuValidator::isEmail('a@bc.de'));
		$this->assertTrue(TodoyuValidator::isEmail('with-dash@sub.domain.com'));
		$this->assertFalse(TodoyuValidator::isEmail('with space@sub.domain.com'));
	}

	public function testIsDigit() {
		$this->assertTrue(TodoyuValidator::isDigit(1));
		$this->assertTrue(TodoyuValidator::isDigit('0'));
		$this->assertTrue(TodoyuValidator::isDigit(-2342342));
		$this->assertFalse(TodoyuValidator::isDigit('a10'));
	}

	public function testIsNumber() {
		$this->assertTrue(TodoyuValidator::isNumber(1));
		$this->assertTrue(TodoyuValidator::isNumber(-234));
		$this->assertTrue(TodoyuValidator::isNumber(0));
		$this->assertTrue(TodoyuValidator::isNumber('123'));
		$this->assertFalse(TodoyuValidator::isNumber('1d'));
	}

	public function testIsDecimal() {
		$this->assertTrue(TodoyuValidator::isDecimal(1));
		$this->assertTrue(TodoyuValidator::isDecimal(2.32423));
	}

	public function testisnotempty() {
		$this->assertTrue(TodoyuValidator::isNotEmpty('a'));
		$this->assertFalse(TodoyuValidator::isNotEmpty(' '));
		$this->assertFalse(TodoyuValidator::isNotEmpty(null));
	}

	public function testisinrange() {
		$this->assertTrue(TodoyuValidator::isInRange(2, 1, 3));
		$this->assertFalse(TodoyuValidator::isInRange(2, 1, 2, false));
		$this->assertTrue(TodoyuValidator::isInRange(2, 1, 2));
		$this->assertFalse(TodoyuValidator::isInRange(7, 1, 2));
		$this->assertTrue(TodoyuValidator::isInRange('1', 1, 2));
	}

	public function testismin() {
		$this->assertTrue(TodoyuValidator::isMin(1, 1));
		$this->assertTrue(TodoyuValidator::isMin(2, 1));
		$this->assertFalse(TodoyuValidator::isMin(2, 2, false));
		$this->assertFalse(TodoyuValidator::isMin(-2, 2));
		$this->assertTrue(TodoyuValidator::isMin(-2, -3));
	}

	public function testismax() {
		$this->assertTrue(TodoyuValidator::isMax(1, 1));
		$this->assertTrue(TodoyuValidator::isMax(2, 3));
		$this->assertFalse(TodoyuValidator::isMax(2, 2, false));
		$this->assertFalse(TodoyuValidator::isMax(2, -2));
		$this->assertTrue(TodoyuValidator::isMax(-3, -2));
	}

	public function testhasminlength() {
		$this->assertTrue(TodoyuValidator::hasMinLength('test', 2));
		$this->assertTrue(TodoyuValidator::hasMinLength('test', 4));
		$this->assertFalse(TodoyuValidator::hasMinLength('tes ', 4));
	}

	public function testhasmaxlength() {
		$this->assertTrue(TodoyuValidator::hasMaxLength('test', 6));
		$this->assertTrue(TodoyuValidator::hasMaxLength('test', 4));
		$this->assertTrue(TodoyuValidator::hasMaxLength('tes ', 3));
		$this->assertFalse(TodoyuValidator::hasMaxLength('tes ', 2));
	}

	public function testisnotzerotime() {
		$this->assertTrue(TodoyuValidator::isNotZerotime('00:10'));
		$this->assertTrue(TodoyuValidator::isNotZerotime(':10'));
		$this->assertFalse(TodoyuValidator::isNotZerotime('00:00'));
		$this->assertFalse(TodoyuValidator::isNotZerotime(''));
		$this->assertTrue(TodoyuValidator::isNotZerotime('1:'));
	}

	public function testillegalchars() {
		// Method is not correct yet, no testing until fixed
	}

}

?>


text:
using System;
using System.Collections.ObjectModel;
using Windows.Devices.Enumeration;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Navigation;
using SDKTemplate;

// The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238

namespace DeviceEnumeration
{
    /// <summary>
    /// An empty page that can be used on its own or navigated to within a Frame.
    /// </summary>
    public sealed partial class Scenario4 : Page
    {
        private MainPage rootPage;

        public ObservableCollection<DeviceInformationDisplay> ResultCollection
        {
            get;
            private set;
        }

        public Scenario4()
        {
            this.InitializeComponent();
        }

        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            rootPage = MainPage.Current;
            ResultCollection = new ObservableCollection<DeviceInformationDisplay>();

            selectorComboBox.ItemsSource = DeviceSelectorChoices.Selectors;
            selectorComboBox.SelectedIndex = 0;

            DataContext = this;
        }

        private async void FindButton_Click(object sender, RoutedEventArgs e)
        {
            DeviceSelectorInfo deviceSelectorInfo;
            DeviceInformationCollection deviceInfoCollection;

            findButton.IsEnabled = false;
            ResultCollection.Clear();

            // First get the device selector chosen by the UI.
            deviceSelectorInfo = (DeviceSelectorInfo)selectorComboBox.SelectedItem;

            rootPage.NotifyUser("FindAllAsync operation started...", NotifyType.StatusMessage);

            if (null == deviceSelectorInfo.Selector)
            {
                // If the a pre-canned device class selector was chosen, call the DeviceClass overload
                deviceInfoCollection = await DeviceInformation.FindAllAsync(deviceSelectorInfo.DeviceClassSelector);
            }
            else
            {
                // Use AQS string selector from dynamic call to a device api's GetDeviceSelector call
                deviceInfoCollection = await DeviceInformation.FindAllAsync(
                    deviceSelectorInfo.Selector,
                    null // don't request additional properties for this sample
                    );
            }

            rootPage.NotifyUser(
                String.Format("FindAllAsync operation completed. {0} devices found.", deviceInfoCollection.Count),
                NotifyType.StatusMessage);

            foreach (DeviceInformation deviceInfo in deviceInfoCollection)
            {
                ResultCollection.Add(new DeviceInformationDisplay(deviceInfo));
            }

            findButton.IsEnabled = true;
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
package cc.pizzr.validation;

import java.util.Objects;

import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;

import org.apache.commons.beanutils.BeanUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * 将一个类里面的field和同一类型的其他field(s)比较是否相等。如果相等则通过,否则不通过。
 *
 * @author lijinting01
 *
 */
public class FieldEqualsValidator implements
		ConstraintValidator<FieldEqualsConstraint, Object> {
	private static final Logger logger = LoggerFactory
			.getLogger(FieldEqualsValidator.class);

	private String target;

	private String[] compareTos;

	@Override
	public void initialize(final FieldEqualsConstraint constraintAnnotation) {
		target = constraintAnnotation.targetField();
		compareTos = constraintAnnotation.compareTo();
	}

	@Override
	public boolean isValid(final Object value,
			final ConstraintValidatorContext context) {
		try {
			Object fieldValue = BeanUtils.getProperty(value, target);
			for (String compareTo : compareTos) {
				Object compareToValue = BeanUtils.getProperty(value, compareTo);
				if (!Objects.equals(compareToValue, fieldValue)) {
					context.disableDefaultConstraintViolation();
					context.buildConstraintViolationWithTemplate(
							context.getDefaultConstraintMessageTemplate())
							.addPropertyNode(target).addConstraintViolation();
					return false;
				}
			}

		} catch (Exception ignore) {
			// ignores exception
			logger.error("Exception Occured When Trying To Get Property:",
					ignore);
			throw new RuntimeException("Exception Occured When Trying To Get Property", ignore);
		}
		return true;
	}
}


text:
@interface PodsDummy_Pods_ZSPop_Example : NSObject
@end
@implementation PodsDummy_Pods_ZSPop_Example
@end


text: THE BLOG DEMO


text:
<?xml version="1.0"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.googlecode.libphonenumber</groupId>
  <artifactId>libphonenumber</artifactId>
  <version>8.8.7-SNAPSHOT</version>
  <packaging>jar</packaging>
  <url>https://github.com/googlei18n/libphonenumber/</url>

  <parent>
    <groupId>com.googlecode.libphonenumber</groupId>
    <artifactId>libphonenumber-parent</artifactId>
    <version>8.8.7-SNAPSHOT</version>
  </parent>

  <build>
    <sourceDirectory>src</sourceDirectory>
    <testSourceDirectory>test</testSourceDirectory>
    <resources>
      <resource>
        <directory>src/com/google/i18n/phonenumbers/data</directory>
        <targetPath>com/google/i18n/phonenumbers/data</targetPath>
      </resource>
    </resources>
    <testResources>
      <testResource>
        <directory>test/com/google/i18n/phonenumbers/data</directory>
        <targetPath>com/google/i18n/phonenumbers/data</targetPath>
      </testResource>
    </testResources>
    <plugins>
      <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-bundle-plugin</artifactId>
        <version>3.2.0</version>
        <configuration>
          <instructions>
            <Export-Package>com.google.i18n.phonenumbers</Export-Package>
          </instructions>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-jar-plugin</artifactId>
        <version>3.0.2</version>
        <executions>
          <execution>
            <id>default-jar</id>
            <configuration>
              <archive>
                <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
              </archive>
            </configuration>
          </execution>
          <execution>
            <id>no-metadata</id>
            <phase>package</phase>
            <goals>
              <goal>jar</goal>
            </goals>
            <configuration>
              <classifier>no-metadata</classifier>
              <archive>
                <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
              </archive>
              <excludes>
                <exclude>com/google/i18n/phonenumbers/data/*</exclude>
              </excludes>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>animal-sniffer-maven-plugin</artifactId>
        <version>1.15</version>
        <executions>
          <execution>
            <phase>test</phase>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <signature>
            <groupId>org.codehaus.mojo.signature</groupId>
            <artifactId>java15</artifactId>
            <version>1.0</version>
          </signature>
        </configuration>
      </plugin>
    </plugins>
  </build>

</project>


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.costmanagement.fluent.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.management.ProxyResource;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.costmanagement.models.QueryColumn;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;
import java.util.Map;

/** Result of query. It contains all columns listed under groupings and aggregation. */
@Fluent
public final class QueryResultInner extends ProxyResource {
    @JsonIgnore private final ClientLogger logger = new ClientLogger(QueryResultInner.class);

    /*
     * eTag of the resource. To handle concurrent update scenario, this field
     * will be used to determine whether the user is updating the latest
     * version or not.
     */
    @JsonProperty(value = "eTag")
    private String etag;

    /*
     * Resource location
     */
    @JsonProperty(value = "location", access = JsonProperty.Access.WRITE_ONLY)
    private String location;

    /*
     * Resource SKU
     */
    @JsonProperty(value = "sku", access = JsonProperty.Access.WRITE_ONLY)
    private String sku;

    /*
     * The properties property.
     */
    @JsonProperty(value = "properties")
    private QueryProperties innerProperties;

    /*
     * Resource tags.
     */
    @JsonProperty(value = "tags", access = JsonProperty.Access.WRITE_ONLY)
    @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS)
    private Map<String, String> tags;

    /**
     * Get the etag property: eTag of the resource. To handle concurrent update scenario, this field will be used to
     * determine whether the user is updating the latest version or not.
     *
     * @return the etag value.
     */
    public String etag() {
        return this.etag;
    }

    /**
     * Set the etag property: eTag of the resource. To handle concurrent update scenario, this field will be used to
     * determine whether the user is updating the latest version or not.
     *
     * @param etag the etag value to set.
     * @return the QueryResultInner object itself.
     */
    public QueryResultInner withEtag(String etag) {
        this.etag = etag;
        return this;
    }

    /**
     * Get the location property: Resource location.
     *
     * @return the location value.
     */
    public String location() {
        return this.location;
    }

    /**
     * Get the sku property: Resource SKU.
     *
     * @return the sku value.
     */
    public String sku() {
        return this.sku;
    }

    /**
     * Get the innerProperties property: The properties property.
     *
     * @return the innerProperties value.
     */
    private QueryProperties innerProperties() {
        return this.innerProperties;
    }

    /**
     * Get the tags property: Resource tags.
     *
     * @return the tags value.
     */
    public Map<String, String> tags() {
        return this.tags;
    }

    /**
     * Get the nextLink property: The link (url) to the next page of results.
     *
     * @return the nextLink value.
     */
    public String nextLink() {
        return this.innerProperties() == null ? null : this.innerProperties().nextLink();
    }

    /**
     * Set the nextLink property: The link (url) to the next page of results.
     *
     * @param nextLink the nextLink value to set.
     * @return the QueryResultInner object itself.
     */
    public QueryResultInner withNextLink(String nextLink) {
        if (this.innerProperties() == null) {
            this.innerProperties = new QueryProperties();
        }
        this.innerProperties().withNextLink(nextLink);
        return this;
    }

    /**
     * Get the columns property: Array of columns.
     *
     * @return the columns value.
     */
    public List<QueryColumn> columns() {
        return this.innerProperties() == null ? null : this.innerProperties().columns();
    }

    /**
     * Set the columns property: Array of columns.
     *
     * @param columns the columns value to set.
     * @return the QueryResultInner object itself.
     */
    public QueryResultInner withColumns(List<QueryColumn> columns) {
        if (this.innerProperties() == null) {
            this.innerProperties = new QueryProperties();
        }
        this.innerProperties().withColumns(columns);
        return this;
    }

    /**
     * Get the rows property: Array of rows.
     *
     * @return the rows value.
     */
    public List<List<Object>> rows() {
        return this.innerProperties() == null ? null : this.innerProperties().rows();
    }

    /**
     * Set the rows property: Array of rows.
     *
     * @param rows the rows value to set.
     * @return the QueryResultInner object itself.
     */
    public QueryResultInner withRows(List<List<Object>> rows) {
        if (this.innerProperties() == null) {
            this.innerProperties = new QueryProperties();
        }
        this.innerProperties().withRows(rows);
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (innerProperties() != null) {
            innerProperties().validate();
        }
    }
}


text:
<?php
header("Access-Control-Allow-Origin: *");
header("Content-Type: application/javascript");
?>
UndefinedReference


text:
/**
 * Eine Confirmation-Box, also eine Box mit einer zu bestätigenden Nachricht,
 * die als wichtigste Option das Veröffentlichen der Meldung über soziale
 * Netzwerke etc ermöglicht.
 *
 * @author Phil
 */

/**
 * @param HTMLElement parent_node
 * @param int x
 * @param int y
 * @param uint w
 * @param uint h
 * @param uint buttons [= YES|NO]
 * @param bool grey 	if yes, then grey background will be created
 * @see PureFW.PublishConfirmBox
 */
PureFW.PublishConfirmBox = function(parent_node, x, y, w, h, buttons, grey) {
	if (typeof(parent_node) !== 'undefined') {
		this.init(parent_node, x, y, w, h, buttons, grey);

		this.instance_num = this.constructor.num_instances;
		this.instance_name =
			"PureFW.PublishConfirmBox.instances["+this.instance_num+"]";
		this.id = "PublishConfirmBox"+this.instance_num;
		this.bg_img_id = "PublishConfirmBox_bg_img"+this.instance_num;
		this.content_id = "PublishConfirmBox_cont"+this.instance_num;
		this.grey_layer_node_id ="PublishConfirmBox_grey_layer"
			+this.instance_num;

		this.insert_into_dom_tree();
		this.constructor.num_instances++;
		this.constructor.instances[this.instance_num] = this;
		PureFW.WidgetManager.manager_all.register_widget(this);
	}
};

/********************************************************************
* PublishConfirmBox extends ConfirmationBox
********************************************************************/
PureFW.PublishConfirmBox.extend(PureFW.ConfirmationBox);

/********************************************************************
 * Statische Deklarationen
 ********************************************************************/
PureFW.PublishConfirmBox.num_instances = 0;
PureFW.PublishConfirmBox.instances = new Array();

PureFW.PublishConfirmBox.YES = 1;
PureFW.PublishConfirmBox.NO = 2;
PureFW.PublishConfirmBox.NO_BUTTONS = 4;

/********************************************************************
 * Prototype-Deklarationen
 ********************************************************************/
PureFW.PublishConfirmBox.prototype.init = function(parent_node, x, y, w, h,
		buttons, grey)
{
	PureFW.PublishConfirmBox.parent.init.call(this, parent_node, x, y, w, h,
		buttons, grey);

	this.publish_container = null;
	this.on_publish_functions = new Array();

};

/**
 * Fügt das Widget in den DOM-Tree ein.
 * @see PureFW.Container#insert_into_dom_tree
 */
PureFW.PublishConfirmBox.prototype.insert_into_dom_tree = function() {
	PureFW.PublishConfirmBox.parent.insert_into_dom_tree.call(this);

	var confirm_buttons_position = new PureFW.Point(
		this.position.x + (this.width >> 1)
			+ this.confirm_button_offset.x,
		this.position.y + this.height - (this.confirm_button_height >> 1) + 10
			+ this.confirm_button_offset.y
	);

	if (this.yes_container && this.no_container) {
		var yes_pos_offset = -this.confirm_button_width
			- (this.confirm_button_width>>1);
		var no_pos_offset = -(this.confirm_button_width>>1);
		var publish_pos_offset = (this.confirm_button_width>>1);
	}
	else {
		if (this.yes_container) {
			var yes_pos_offset = -this.confirm_button_width;
		}
		else if (this.no_container) {
			var no_pos_offset = -this.confirm_button_width;
		}
		var publish_pos_offset = 0;
	}

	if (this.yes_container) {
		this.yes_container.set_x(confirm_buttons_position.x + yes_pos_offset);
	}
	if (this.no_container) {
		this.no_container.set_x(confirm_buttons_position.x + no_pos_offset);
		this.no_container.set_pic_url(
			'ui/elements/form/buttons/confirm/confirm_no_grey.png'
		);
	}

	this.publish_container = new PureFW.Image(
		this.parent_node,
		confirm_buttons_position.x + publish_pos_offset,
		confirm_buttons_position.y + (this.confirm_button_height - 62) - 5,
		159, 62,
		'ui/elements/form/buttons/'+MammunUI.LNG+'/PublishConfirmBox'+
			'/btn_share.png'
	);
	this.publish_container.set_z_index(this.get_z_index() + 1);
	this.publish_container.add_event_handler(
		"click",
		(function(_instance) {
			return function(ev) {
				_instance.on_publish();
			};
		})(this)
	);
};

/**
 * Setzt die x-Position des Widgets. Überschrieben, dass die YES-, NO-Buttons
 * ebenfalls korrekt rearrangiert werden.
 *
 * @param uint x
 * @param uint ms			Positionssetzung soll animiert werden mit
 * 							Motiontweening und so viele Millisekunden lang
 * 							dauern.
 * @param Function easing	Funktion zum glätten der Animation
 * @param Function on_finish Funktion, die am Ende der Animation aufgerufen
 * 							 werden soll
 */
PureFW.PublishConfirmBox.prototype.set_x = function(x, ms, easing, on_finish) {
	PureFW.Container.prototype.set_x.call(this, x, ms, easing, on_finish);
	var x = x + (this.width >> 1) + this.confirm_button_offset.x;

	if (this.yes_container && this.no_container) {
		var yes_pos_offset = -this.confirm_button_width
			- (this.confirm_button_width>>1);
		var no_pos_offset = -(this.confirm_button_width>>1);
		var publish_pos_offset = (this.confirm_button_width>>1);
	}
	else {
		if (this.yes_container) {
			var yes_pos_offset = -this.confirm_button_width;
		}
		else if (this.no_container) {
			var no_pos_offset = -this.confirm_button_width;
		}
		var publish_pos_offset = 0;
	}

	if (this.yes_container) {
		this.yes_container.set_x(x + yes_pos_offset);
	}
	if (this.no_container) {
		this.no_container.set_x(x + no_pos_offset);
	}
	if (ms)
		this.publish_container.hide();
	this.publish_container.set_x(x + publish_pos_offset);
};

/**
 * Setzt die y-Position des Widgets. Überschrieben, dass die YES-, NO-Buttons
 * ebenfalls korrekt rearrangiert werden.
 *
 * @param uint y
 * @param uint ms			Positionssetzung soll animiert werden mit
 * 							Motiontweening und so viele Millisekunden lang
 * 							dauern.
 * @param Function easing	Funktion zum glätten der Animation
 * @param Function on_finish Funktion, die am Ende der Animation aufgerufen
 * 							 werden soll
 */
PureFW.PublishConfirmBox.prototype.set_y = function(y, ms, easing, on_finish) {
	PureFW.PublishConfirmBox.parent.set_y.call(this, y, ms, easing, on_finish);
	var y = y + this.height - (this.confirm_button_height >> 1)
				+ this.confirm_button_offset.y;
	if (this.yes_container)
		this.yes_container.set_y(y);
	if (this.no_container)
		this.no_container.set_y(y);
	if (ms)
		this.publish_container.hide();
	this.publish_container.set_y(y - (this.confirm_button_height - 62));
};

/**
 * Setzt den z-index.
 * @see PureFW.Widget#set_z_index
 */
PureFW.PublishConfirmBox.prototype.set_z_index = function(z) {
	PureFW.PublishConfirmBox.parent.set_z_index.call(this, z);
	if (!this.create_grey_bg)
		this.publish_container.set_z_index(z+1);
};

PureFW.PublishConfirmBox.prototype.destroy = function() {
	PureFW.PublishConfirmBox.parent.destroy.call(this);
	this.publish_container.destroy();
};

PureFW.PublishConfirmBox.prototype.hide = function() {
	PureFW.PublishConfirmBox.parent.hide.call(this);
	this.publish_container.hide();
};

PureFW.PublishConfirmBox.prototype.show = function() {
	PureFW.PublishConfirmBox.parent.show.call(this);
	this.publish_container.hide();
};

PureFW.PublishConfirmBox.prototype.fade_in = function(ms, max_opacity, frame_ms)
{
	PureFW.PublishConfirmBox.parent.fade_in.call(this);
	this.publish_container.fade_in(ms, max_opacity, frame_ms);
};

PureFW.PublishConfirmBox.prototype.fade_out = function(ms, max_opacity, frame_ms){
	PureFW.PublishConfirmBox.parent.fade_out.call(this);
	this.publish_container.fade_out(ms, max_opacity, frame_ms);
};

/**
 * Fügt einen EventHandler hinzu. Funktion überschrieben, da zusätzlich
 * der Typ "publish" unterstützt wird, welcher beim Anklicken des Publish-
 * Buttons ausgelöst wird.
 *
 * @param string type
 * @param Function fn
 * @see PureFW.Widget#add_event_handler
 */
PureFW.PublishConfirmBox.prototype.add_event_handler = function(type, fn) {
	if (type === "publish")
		this.on_publish_functions.push(fn);
	else
		PureFW.PublishConfirmBox.parent.add_event_handler.call(this, type, fn);
};

/**
 * Entfernt einen EventHandler. Funktion überschrieben, da zusätzlich
 * der Typ "publish" unterstützt wird, welcher beim Anklicken des Publish-
 * Buttons ausgelöst wird.
 *
 * @param string type
 * @param Function fn
 * @see PureFW.PublishConfirmBox#add_event_handler
 */
PureFW.PublishConfirmBox.prototype.remove_event_handler = function(type, fn) {
	if (type === "publish")
		this.on_publish_functions.remove(fn);
	else
		PureFW.PublishConfirmBox.parent.remove_event_handler.call(this, type,
			fn);
};

/**
 * Ruft das "publish"-Event exlizit auf. Wird normalerweise aufgerufen,
 * wenn der Publish-Knopf gedrückt wurde.
 *
 * @param Event ev [optional]
 */
PureFW.PublishConfirmBox.prototype.on_publish = function(ev) {
	if (!ev) {
		this.create_event("publish")
	}
	var n = this.on_publish_functions.length;
	for (var i = 0; i < n; i++) {
		this.on_publish_functions[i].call(this, ev);
	}
}

/**
 * Ruft das "cancel"-Event explizit auf. Wird normalerweise aufgerufen,
 * wenn die Box geschlossen wurde, ohne Bestätigung (Drücken von (X)).
 *
 * @param Event ev [optional]
 */
PureFW.PublishConfirmBox.prototype.on_cancel = function(ev) {
	if (!ev) {
		this.create_event("cancel")
	}
	/**
	 * Coole Cancel-Animation
	 */
	var tween = new OpacityTween(
		document.getElemById(this.grey_layer_node_id),
		null,
		100,
		0,
		0.2
	);
	tween.start();
	tween.onMotionFinished = (function(_instance) {
		return function() {
			_instance.destroy();
		}
	})(this);

	var n = this.on_cancel_functions.length;
	for (var i = 0; i < n; i++) {
		this.on_cancel_functions[i].call(this,ev);
	}
}


text:
function prt_spnew(results,vnames,fid)
% PURPOSE: Prints output using spatial regression results structures
%---------------------------------------------------
% USAGE: prt_sp(results,vnames,fid)
% Where: results = a structure returned by a spatial panel regression
%        vnames  = an optional vector of variable names
%        fid     = optional file-id for printing results to a file
%                  (defaults to the MATLAB command window)
%---------------------------------------------------
%  NOTES: e.g. vnames = strvcat('y','const','x1','x2');
%         e.g. fid = fopen('ols.out','wr');
%  use prt_sp(results,[],fid) to print to a file with no vnames
% --------------------------------------------------
%  RETURNS: nothing, just prints the spatial panel regression results
% --------------------------------------------------

if ~isstruct(results)
 error('prt_sp requires structure argument');
elseif nargin == 1
 nflag = 0; fid = 1;
elseif nargin == 2
 fid = 1; nflag = 1;
elseif nargin == 3
 nflag = 0;
 [vsize junk] = size(vnames); % user may supply a blank argument
   if vsize > 0
   nflag = 1;
   end;
else
 error('Wrong # of arguments to prt_sp');
end;

nvar = results.nvar;
nobs = results.nobs;

% handling of vnames
Vname = 'Variable';
 for i=1:nvar
    tmp = ['variable ',num2str(i)];
    Vname = strvcat(Vname,tmp);
 end;

if (nflag == 1) % the user supplied variable names
[tst_n nsize] = size(vnames);
 if tst_n ~= nvar+1
 fprintf(fid,'Wrong # of variable names in prt_sp -- check vnames argument \n');
 fprintf(fid,'will use generic variable names \n');
 nflag = 0;
 else,
Vname = 'Variable';
 for i=1:nvar
    Vname = strvcat(Vname,vnames(i+1,:));
 end;
 end; % end of if-else
end; % end of nflag issue

fprintf(fid,'\n');

switch results.meth
case {'psem'}
fprintf(fid,'Pooled model with spatial error autocorrelation, no fixed effects \n');
case {'semsfe'}
fprintf(fid,'Pooled model with spatial error autocorrelation and spatial fixed effects \n');
case {'semtfe'}
fprintf(fid,'Pooled model with spatial error autocorrelation and time period fixed effects \n');
case {'semstfe'}
fprintf(fid,'Pooled model with spatial error autocorrelation, spatial and time period fixed effects \n');
case {'psar'}
fprintf(fid,'Pooled model with spatially lagged dependent variable, no fixed effects \n');
case {'sarsfe'}
fprintf(fid,'Pooled model with spatially lagged dependent variable and spatial fixed effects \n');
case {'sartfe'}
fprintf(fid,'Pooled model with spatially lagged dependent variable and time period fixed effects \n');
case {'sarstfe'}
fprintf(fid,'Pooled model with spatially lagged dependent variable, spatial and time period fixed effects \n');
case ('sarsre')
fprintf(fid,'Pooled model with spatially lagged dependent variable and spatial random effects \n');
case ('semsre')
fprintf(fid,'Pooled model with spatial error autocorrelation and spatial random effects \n');
otherwise
error('results structure not known by prt_sp function');
end % switch statement

switch results.meth

case {'psem','semsfe','semtfe','semstfe'} % <=================== fixed effects spatial error models

% add spatial rho parameter name
    Vname = strvcat(Vname,'spat.aut.');

if (nflag == 1)
fprintf(fid,'Dependent Variable = %16s \n',vnames(1,:));
end;
fprintf(fid,'R-squared       = %9.4f   \n',results.rsqr);
fprintf(fid,'corr-squared    = %9.4f   \n',results.corr2);
fprintf(fid,'sigma^2         = %9.4f   \n',results.sige);
fprintf(fid,'log-likelihood  = %16.8g  \n',results.lik);
fprintf(fid,'Nobs,Nvar,#FE   = %6d,%6d,%6d  \n',results.nobs,results.nvar,results.tnvar);
fprintf(fid,'# iterations    = %6d     \n',results.iter);
fprintf(fid,'min and max rho = %9.4f,%9.4f \n',results.rmin,results.rmax);
% print timing information
fprintf(fid,'total time in secs = %9.4f \n',results.time);
fprintf(fid,'time for optimiz   = %9.4f \n',results.time4);
if results.time1 ~= 0
fprintf(fid,'time for lndet     = %9.4f \n',results.time1);
end;
if results.time2 ~= 0
fprintf(fid,'time for eigs      = %9.4f \n',results.time2);
end;
if results.time3 ~= 0
fprintf(fid,'time for t-stats   = %9.4f \n',results.time3);
end;

if results.lflag == 0
fprintf(fid,'No lndet approximation used \n');
end;
% put in information regarding Pace and Barry approximations
if results.lflag == 1
fprintf(fid,'Pace and Barry, 1999 MC lndet approximation used \n');
fprintf(fid,'order for MC appr  = %6d  \n',results.order);
fprintf(fid,'iter  for MC appr  = %6d  \n',results.miter);
end;
if results.lflag == 2
fprintf(fid,'Pace and Barry, 1998 spline lndet approximation used \n');
end;

fprintf(fid,'***************************************************************\n');

bout = [results.beta
        results.rho];

% <=================== end of sem case

case {'psar','sarsfe','sartfe','sarstfe'} % <=================== fixed effects spatial lag models

% add spatial rho parameter name
    Vname = strvcat(Vname,'W*dep.var.');

if (nflag == 1)
fprintf(fid,'Dependent Variable = %16s \n',vnames(1,:));
end;
fprintf(fid,'R-squared          = %9.4f   \n',results.rsqr);
fprintf(fid,'corr-squared       = %9.4f   \n',results.corr2);
fprintf(fid,'sigma^2            = %9.4f \n',results.sige);
fprintf(fid,'Nobs,Nvar,#FE      = %6d,%6d,%6d  \n',results.nobs,results.nvar+1,results.tnvar); % +1 due to spatially lagged dependent variable
fprintf(fid,'log-likelihood     = %16.8g \n',results.lik);
fprintf(fid,'# of iterations    = %6d   \n',results.iter);
fprintf(fid,'min and max rho    = %9.4f,%9.4f \n',results.rmin,results.rmax);
% print timing information
fprintf(fid,'total time in secs = %9.4f \n',results.time);
fprintf(fid,'time for optimiz   = %9.4f \n',results.time4);
if results.time1 ~= 0
fprintf(fid,'time for lndet     = %9.4f \n',results.time1);
end;
if results.time2 ~= 0
fprintf(fid,'time for eigs      = %9.4f \n',results.time2);
end;
if results.time3 ~= 0
fprintf(fid,'time for t-stats   = %9.4f \n',results.time3);
end;

if results.lflag == 0
fprintf(fid,'No lndet approximation used \n');
end;
% put in information regarding Pace and Barry approximations
if results.lflag == 1
fprintf(fid,'Pace and Barry, 1999 MC lndet approximation used \n');
fprintf(fid,'order for MC appr  = %6d  \n',results.order);
fprintf(fid,'iter  for MC appr  = %6d  \n',results.miter);
end;
if results.lflag == 2
fprintf(fid,'Pace and Barry, 1998 spline lndet approximation used \n');
end;

fprintf(fid,'***************************************************************\n');

bout = [results.beta
        results.rho];

% <=================== end of sar case

case {'sarsre'} % <=================== random effects spatial lag model

results.fe=0;
% add spatial rho parameter name and teta
    Vname = strvcat(Vname,'W*dep.var.','teta');

if (nflag == 1)
fprintf(fid,'Dependent Variable = %16s \n',vnames(1,:));
end;
fprintf(fid,'R-squared          = %9.4f   \n',results.rsqr);
fprintf(fid,'corr-squared       = %9.4f   \n',results.corr2);
fprintf(fid,'sigma^2            = %9.4f \n',results.sige);
fprintf(fid,'Nobs,Nvar          = %6d,%6d \n',results.nobs,results.nvar+1); % +1 due to spatially lagged dependent variable
fprintf(fid,'log-likelihood     = %16.8g \n',results.lik);
fprintf(fid,'# of iterations    = %6d   \n',results.iter);
fprintf(fid,'min and max rho    = %9.4f,%9.4f \n',results.rmin,results.rmax);
% print timing information
fprintf(fid,'total time in secs = %9.4f \n',results.time);
fprintf(fid,'time for optimiz   = %9.4f \n',results.time4);
if results.time1 ~= 0
fprintf(fid,'time for lndet     = %9.4f \n',results.time1);
end;
if results.time2 ~= 0
fprintf(fid,'time for eigs      = %9.4f \n',results.time2);
end;
if results.time3 ~= 0
fprintf(fid,'time for t-stats   = %9.4f \n',results.time3);
end;

if results.lflag == 0
fprintf(fid,'No lndet approximation used \n');
end;
% put in information regarding Pace and Barry approximations
if results.lflag == 1
fprintf(fid,'Pace and Barry, 1999 MC lndet approximation used \n');
fprintf(fid,'order for MC appr  = %6d  \n',results.order);
fprintf(fid,'iter  for MC appr  = %6d  \n',results.miter);
end;
if results.lflag == 2
fprintf(fid,'Pace and Barry, 1998 spline lndet approximation used \n');
end;

fprintf(fid,'***************************************************************\n');

bout = [results.beta
        results.rho
        results.teta];

% <=================== end of sar case

case {'semsre'} % <=================== random effects spatial error model

results.fe=0;
% add spatial rho parameter name and teta
    Vname = strvcat(Vname,'spat.aut.','teta');

if (nflag == 1)
fprintf(fid,'Dependent Variable = %16s \n',vnames(1,:));
end;
fprintf(fid,'R-squared          = %9.4f   \n',results.rsqr);
fprintf(fid,'corr-squared       = %9.4f   \n',results.corr2);
fprintf(fid,'sigma^2            = %9.4f \n',results.sige);
fprintf(fid,'Nobs,Nvar          = %6d,%6d \n',results.nobs,results.nvar);
fprintf(fid,'log-likelihood     = %16.8g \n',results.lik);
fprintf(fid,'# of iterations    = %6d   \n',results.iter);
fprintf(fid,'min and max rho    = %9.4f,%9.4f \n',results.rmin,results.rmax);
% print timing information
fprintf(fid,'total time in secs = %9.4f \n',results.time);
fprintf(fid,'time for optimiz   = %9.4f \n',results.time4);
if results.time2 ~= 0
fprintf(fid,'time for eigs      = %9.4f \n',results.time2);
end;
if results.time3 ~= 0
fprintf(fid,'time for t-stats   = %9.4f \n',results.time3);
end;

fprintf(fid,'***************************************************************\n');

bout = [results.beta
        results.rho
        results.teta];

% <=================== end of sem case

otherwise
error('results structure not known by prt_sp function');
end;

% now print coefficient estimates, t-statistics and probabilities
tout = norm_prb(results.tstat); % find asymptotic z (normal) probabilities, function of LeSage
tmp = [bout results.tstat tout];  % matrix to be printed
% column labels for printing results
bstring = 'Coefficient'; tstring = 'Asymptot t-stat'; pstring = 'z-probability';
cnames = strvcat(bstring,tstring,pstring);
in.cnames = cnames;
in.rnames = Vname;
in.fmt = '%16.6f';
in.fid = fid;
mprint(tmp,in); %function of LeSage

% print fixed effects, t-statistics and probabilities at request of the researcher
if (results.fe==1)
model=results.model;
N=results.N;
T=results.T;
if (model==1)
    fprintf(fid,'Mean intercept and spatial fixed effects \n');
    FEname=strvcat('Variable','intercept');
    for i=1:N
        tmp = ['sfe ',num2str(i)];
        FEname = strvcat(FEname,tmp);
    end
    bout=[results.con;results.sfe];
    tstat=[results.tcon;results.tsfe];
    tout = norm_prb(tstat);
    tmp = [bout tstat tout];
    in.rnames = FEname;
    mprint(tmp,in);
elseif (model==2)
    fprintf(fid,'Mean intercept and time period fixed effects \n');
    FEname=strvcat('Variable','intercept');
    for i=1:T
        tmp = ['tfe ',num2str(i)];
        FEname = strvcat(FEname,tmp);
    end
    bout=[results.con;results.tfe];
    tstat=[results.tcon;results.ttfe];
    tout = norm_prb(tstat);
    tmp = [bout tstat tout];
    in.rnames = FEname;
    mprint(tmp,in);
elseif (model==3)
    fprintf(fid,'Mean intercept, spatial and time period fixed effects \n');
    FEname=strvcat('Variable','intercept');
    for i=1:N
        tmp = ['sfe ',num2str(i)];
        FEname = strvcat(FEname,tmp);
    end
    for i=1:T
        tmp = ['tfe ',num2str(i)];
        FEname = strvcat(FEname,tmp);
    end
    bout=[results.con;results.sfe;results.tfe];
    tstat=[results.tcon;results.tsfe;results.ttfe];
    tout = norm_prb(tstat);
    tmp = [bout tstat tout];
    in.rnames = FEname;
    mprint(tmp,in);
end
end


text:
import {ServiceInterface} from 'chrome://extensions/extensions.js';
import {FakeChromeEvent} from 'chrome://webui-test/fake_chrome_event.js';
import {TestBrowserProxy} from 'chrome://webui-test/test_browser_proxy.js';

// An Service implementation to be used in tests.
export class TestService extends TestBrowserProxy implements ServiceInterface {
  itemStateChangedTarget: FakeChromeEvent = new FakeChromeEvent();
  profileStateChangedTarget: FakeChromeEvent = new FakeChromeEvent();
  extensionActivityTarget: FakeChromeEvent = new FakeChromeEvent();
  userSiteSettingsChangedTarget: FakeChromeEvent = new FakeChromeEvent();
  acceptRuntimeHostPermission: boolean = true;
  testActivities?: chrome.activityLogPrivate.ActivityResultSet;
  userSiteSettings?: chrome.developerPrivate.UserSiteSettings;
  siteGroups?: chrome.developerPrivate.SiteGroup[];
  matchingExtensionsInfo?: chrome.developerPrivate.MatchingExtensionInfo[];

  private retryLoadUnpackedError_?: chrome.developerPrivate.LoadError;
  private forceReloadItemError_: boolean = false;
  private loadUnpackedSuccess_: boolean = true;

  constructor() {
    super([
      'addRuntimeHostPermission',
      'addUserSpecifiedSites',
      'choosePackRootDirectory',
      'choosePrivateKeyPath',
      'deleteActivitiesById',
      'deleteActivitiesFromExtension',
      'deleteErrors',
      'deleteItem',
      'downloadActivities',
      'getExtensionActivityLog',
      'getExtensionsInfo',
      'getExtensionSize',
      'getFilteredExtensionActivityLog',
      'getMatchingExtensionsForSite',
      'getProfileConfiguration',
      'getUserAndExtensionSitesByEtld',
      'getUserSiteSettings',
      'getUserSiteSettingsChangedTarget',
      'inspectItemView',
      'installDroppedFile',
      'loadUnpacked',
      'loadUnpackedFromDrag',
      'notifyDragInstallInProgress',
      'openUrl',
      'packExtension',
      'recordUserAction',
      'reloadItem',
      'removeRuntimeHostPermission',
      'removeUserSpecifiedSites',
      'repairItem',
      'requestFileSource',
      'retryLoadUnpacked',
      'setItemAllowedIncognito',
      'setItemAllowedOnFileUrls',
      'setItemCollectsErrors',
      'setItemEnabled',
      'setItemHostAccess',
      'setProfileInDevMode',
      'setShortcutHandlingSuspended',
      'setShowAccessRequestsInToolbar',
      'shouldIgnoreUpdate',
      'showInFolder',
      'showItemOptionsPage',
      'updateAllExtensions',
      'updateExtensionCommandKeybinding',
      'updateExtensionCommandScope',
    ]);
  }

  setRetryLoadUnpackedError(error: chrome.developerPrivate.LoadError) {
    this.retryLoadUnpackedError_ = error;
  }

  setForceReloadItemError(force: boolean) {
    this.forceReloadItemError_ = force;
  }

  setLoadUnpackedSuccess(success: boolean) {
    this.loadUnpackedSuccess_ = success;
  }

  addRuntimeHostPermission(id: string, host: string) {
    this.methodCalled('addRuntimeHostPermission', [id, host]);
    return this.acceptRuntimeHostPermission ? Promise.resolve() :
                                              Promise.reject();
  }

  choosePackRootDirectory() {
    this.methodCalled('choosePackRootDirectory');
    return Promise.resolve('');
  }

  choosePrivateKeyPath() {
    this.methodCalled('choosePrivateKeyPath');
    return Promise.resolve('');
  }

  getProfileConfiguration() {
    this.methodCalled('getProfileConfiguration');
    return Promise.resolve({
      canLoadUnpacked: false,
      inDeveloperMode: false,
      isDeveloperModeControlledByPolicy: false,
      isIncognitoAvailable: false,
      isChildAccount: false,
    });
  }

  getItemStateChangedTarget() {
    return this.itemStateChangedTarget;
  }

  getProfileStateChangedTarget() {
    return this.profileStateChangedTarget;
  }

  getUserSiteSettingsChangedTarget() {
    return this.userSiteSettingsChangedTarget;
  }

  getExtensionsInfo() {
    this.methodCalled('getExtensionsInfo');
    return Promise.resolve([]);
  }

  getExtensionSize() {
    this.methodCalled('getExtensionSize');
    return Promise.resolve('20 MB');
  }

  inspectItemView(id: string, view: chrome.developerPrivate.ExtensionView) {
    this.methodCalled('inspectItemView', [id, view]);
  }

  removeRuntimeHostPermission(id: string, host: string) {
    this.methodCalled('removeRuntimeHostPermission', [id, host]);
    return Promise.resolve();
  }

  setItemAllowedIncognito(id: string, isAllowedIncognito: boolean) {
    this.methodCalled('setItemAllowedIncognito', [id, isAllowedIncognito]);
  }

  setItemAllowedOnFileUrls(id: string, isAllowedOnFileUrls: boolean) {
    this.methodCalled('setItemAllowedOnFileUrls', [id, isAllowedOnFileUrls]);
  }

  setItemEnabled(id: string, isEnabled: boolean) {
    this.methodCalled('setItemEnabled', [id, isEnabled]);
  }

  setItemCollectsErrors(id: string, collectsErrors: boolean) {
    this.methodCalled('setItemCollectsErrors', [id, collectsErrors]);
  }

  setItemHostAccess(id: string, access: chrome.developerPrivate.HostAccess) {
    this.methodCalled('setItemHostAccess', [id, access]);
  }

  setShortcutHandlingSuspended(enable: boolean) {
    this.methodCalled('setShortcutHandlingSuspended', enable);
  }

  shouldIgnoreUpdate(
      extensionId: string, eventType: chrome.developerPrivate.EventType) {
    this.methodCalled('shouldIgnoreUpdate', [extensionId, eventType]);
  }

  updateExtensionCommandKeybinding(
      extensionId: string, commandName: string, keybinding: string) {
    this.methodCalled(
        'updateExtensionCommandKeybinding',
        [extensionId, commandName, keybinding]);
  }

  updateExtensionCommandScope(
      extensionId: string, commandName: string,
      scope: chrome.developerPrivate.CommandScope): void {
    this.methodCalled(
        'updateExtensionCommandScope', [extensionId, commandName, scope]);
  }

  loadUnpacked() {
    this.methodCalled('loadUnpacked');
    return Promise.resolve(this.loadUnpackedSuccess_);
  }

  reloadItem(id: string) {
    this.methodCalled('reloadItem', id);
    return this.forceReloadItemError_ ? Promise.reject() : Promise.resolve();
  }

  retryLoadUnpacked(guid: string) {
    this.methodCalled('retryLoadUnpacked', guid);
    return (this.retryLoadUnpackedError_ !== undefined) ?
        Promise.reject(this.retryLoadUnpackedError_) :
        Promise.resolve(true);
  }

  requestFileSource(args: chrome.developerPrivate.RequestFileSourceProperties) {
    this.methodCalled('requestFileSource', args);
    return Promise.resolve({
      highlight: '',
      beforeHighlight: '',
      afterHighlight: '',
      title: '',
      message: '',
    });
  }

  openUrl(url: string) {
    this.methodCalled('openUrl', url);
  }

  packExtension(
      rootPath: string, keyPath: string, flag?: number,
      _callback?:
          (response: chrome.developerPrivate.PackDirectoryResponse) => void):
      void {
    this.methodCalled('packExtension', [rootPath, keyPath, flag]);
  }

  repairItem(id: string): void {
    this.methodCalled('repairItem', id);
  }

  setProfileInDevMode(inDevMode: boolean) {
    this.methodCalled('setProfileInDevMode', inDevMode);
  }

  showInFolder(id: string) {
    this.methodCalled('showInFolder', id);
  }

  showItemOptionsPage(extension: chrome.developerPrivate.ExtensionInfo) {
    this.methodCalled('showItemOptionsPage', extension);
  }

  updateAllExtensions(_extensions: chrome.developerPrivate.ExtensionInfo[]) {
    this.methodCalled('updateAllExtensions');
    return this.forceReloadItemError_ ? Promise.reject() : Promise.resolve();
  }

  getExtensionActivityLog(id: string) {
    this.methodCalled('getExtensionActivityLog', id);
    return Promise.resolve(this.testActivities!);
  }

  getFilteredExtensionActivityLog(id: string, searchTerm: string) {
    // This is functionally identical to getFilteredExtensionActivityLog in
    // service.js but we do the filtering here instead of making API calls
    // with filter objects.
    this.methodCalled('getFilteredExtensionActivityLog', id, searchTerm);

    // Convert everything to lowercase as searching is not case sensitive.
    const lowerCaseSearchTerm = searchTerm.toLowerCase();

    const activities = this.testActivities!.activities;
    const apiCallMatches = activities.filter(
        activity =>
            activity.apiCall!.toLowerCase().includes(lowerCaseSearchTerm));
    const pageUrlMatches = activities.filter(
        activity => activity.pageUrl &&
            activity.pageUrl.toLowerCase().includes(lowerCaseSearchTerm));
    const argUrlMatches = activities.filter(
        activity => activity.argUrl &&
            activity.argUrl.toLowerCase().includes(lowerCaseSearchTerm));

    return Promise.resolve(
        {activities: [...apiCallMatches, ...pageUrlMatches, ...argUrlMatches]});
  }

  deleteActivitiesById(activityIds: string[]) {
    // Pretend to delete all activities specified by activityIds.
    const newActivities = this.testActivities!.activities.filter(
        activity => !activityIds.includes(activity.activityId!));
    this.testActivities = {activities: newActivities};

    this.methodCalled('deleteActivitiesById', activityIds);
    return Promise.resolve();
  }

  deleteActivitiesFromExtension(extensionId: string) {
    this.methodCalled('deleteActivitiesFromExtension', extensionId);
    return Promise.resolve();
  }

  deleteErrors(
      extensionId: string, _errorIds?: number[],
      _type?: chrome.developerPrivate.ErrorType) {
    this.methodCalled('deleteErrors', extensionId);
  }

  deleteItem(id: string) {
    this.methodCalled('deleteItem', id);
  }

  getOnExtensionActivity() {
    return this.extensionActivityTarget;
  }

  downloadActivities(rawActivityData: string, fileName: string) {
    this.methodCalled('downloadActivities', [rawActivityData, fileName]);
  }

  recordUserAction(metricName: string) {
    this.methodCalled('recordUserAction', metricName);
  }

  notifyDragInstallInProgress() {
    this.methodCalled('notifyDragInstallInProgress');
  }

  loadUnpackedFromDrag() {
    this.methodCalled('loadUnpackedFromDrag');
    return Promise.resolve(true);
  }

  installDroppedFile() {
    this.methodCalled('installDroppedFile');
  }

  getUserSiteSettings() {
    this.methodCalled('getUserSiteSettings');
    return Promise.resolve(this.userSiteSettings!);
  }

  addUserSpecifiedSites(
      siteSet: chrome.developerPrivate.SiteSet, hosts: string[]) {
    this.methodCalled('addUserSpecifiedSites', [siteSet, hosts]);
    return Promise.resolve();
  }

  removeUserSpecifiedSites(
      siteSet: chrome.developerPrivate.SiteSet, hosts: string[]) {
    this.methodCalled('removeUserSpecifiedSites', [siteSet, hosts]);
    return Promise.resolve();
  }

  getUserAndExtensionSitesByEtld() {
    this.methodCalled('getUserAndExtensionSitesByEtld');
    return Promise.resolve(this.siteGroups!);
  }

  setShowAccessRequestsInToolbar(id: string, showRequests: boolean) {
    this.methodCalled('setShowAccessRequestsInToolbar', id, showRequests);
  }

  getMatchingExtensionsForSite(site: string) {
    this.methodCalled('getMatchingExtensionsForSite', site);
    return Promise.resolve(this.matchingExtensionsInfo!);
  }
}


text:
Found a bug? Have a new feature to suggest? Want to contribute changes to the codebase? Make sure to read this first.

## Bug reporting

Your code doesn't work, and you have determined that the issue lies with Keras? Follow these steps to report a bug.

1. Your bug may already be fixed. Make sure to update to the current Keras master branch, as well as the latest Theano/TensorFlow master branch.
To easily update Theano: `pip install git+git://github.com/Theano/Theano.git --upgrade`

2. Search for similar issues. Make sure to delete `is:open` on the issue search to find solved tickets as well. It's possible somebody has encountered this bug already. Also remember to check out Keras' [FAQ](http://keras.io/faq/). Still having a problem? Open an issue on Github to let us know.

3. Make sure you provide us with useful information about your configuration: what OS are you using? What Keras backend are you using? Are you running on GPU? If so, what is your version of Cuda, of cuDNN? What is your GPU?

4. Provide us with a script to reproduce the issue. This script should be runnable as-is and should not require external data download (use randomly generated data if you need to run a model on some test data). We recommend that you use Github Gists to post your code. Any issue that cannot be reproduced is likely to be closed.

5. If possible, take a stab at fixing the bug yourself --if you can!

The more information you provide, the easier it is for us to validate that there is a bug and the faster we'll be able to take action. If you want your issue to be resolved quickly, following the steps above is crucial.

## Requesting a Feature

You can also use Github issues to request features you would like to see in Keras, or changes in the Keras API.

1. Provide a clear and detailed explanation of the feature you want and why it's important to add. Keep in mind that we want features that will be useful to the majority of our users and not just a small subset. If you're just targeting a minority of users, consider writing an add-on library for Keras. It is crucial for Keras to avoid bloating the API and codebase.

2. Provide code snippets demonstrating the API you have in mind and illustrating the use cases of your feature. Of course, you don't need to write any real code at this point!

3. After discussing the feature you may choose to attempt a Pull Request. If you're at all able, start writing some code. We always have more work to do than time to do it. If you can write some code then that will speed the process along.

## Pull Requests

We love pull requests. Here's a quick guide:

1. If your PR introduces a change in functionality, make sure you start by opening an issue to discuss whether the change should be made, and how to handle it. This will save you from having your PR closed down the road! Of course, if your PR is a simple bug fix, you don't need to do that.

2. Write the code. This is the hard part!

3. Make sure any new function or class you introduce has proper docstrings. Make sure any code you touch still has up-to-date docstrings and documentation.

4. Write tests. Your code should have full unit test coverage. If you want to see your PR merged promptly, this is crucial.

5. Run our test suite locally. It's easy: from the Keras folder, simply run: `py.test tests/`.
  - You will need to install `pytest`, `coveralls`, `pytest-cov`, `pytest-xdist`: `pip install pytest pytest-cov python-coveralls pytest-xdist pep8 pytest-pep8`

6. Make sure all tests are passing:
  - with the Theano backend, on Python 2.7 and Python 3.5
  - with the TensorFlow backend, on Python 2.7

7. We use PEP8 syntax conventions, but we aren't dogmatic when it comes to line length. Make sure your lines stay reasonably sized, though. To make your life easier, we recommend running a PEP8 linter:
  - Install PEP8 packages: `pip install pep8 pytest-pep8 autopep8`
  - Run a standalone PEP8 check: `py.test --pep8 -m pep8`
  - You can automatically fix some PEP8 error by running: `autopep8 -i --select <errors> <FILENAME>` for example: `autopep8 -i --select E128 tests/keras/backend/test_backends.py`

8. When committing, use appropriate, descriptive commit messages. Make sure that your branch history is not a string of "bug fix", "fix", "oops", etc. When submitting your PR, squash your commits into a single commit with an appropriate commit message, to make sure the project history stays clean and readable. See ['rebase and squash'](http://rebaseandsqua.sh/) for technical help on how to squash your commits.

9. Update the documentation. If introducing new functionality, make sure you include code snippets demonstrating the usage of your new feature.

10. Submit your PR. If your changes have been approved in a previous discussion, and if you have complete (and passing) unit tests, your PR is likely to be merged promptly. Otherwise, well...

## Adding new examples

Even if you don't contribute to the Keras source code, if you have an application of Keras that is concise and powerful, please consider adding it to our collection of examples. [Existing examples](https://github.com/fchollet/keras/tree/master/examples) show idiomatic Keras code: make sure to keep your own script in the same spirit.


text:
const assertColor = require('sk/colors/_common').assertColor
const assertFloat = require('sk/colors/_common').assertFloat
const colorToRgb = require('sk/colors/colorToRgb')
const rgbToColor = require('sk/colors/rgbToColor')

/**
 * Shortcut for `blend(0x000000, color2, amount)`.
 *
 * @param {Number} color - The int color.
 * @param {Number} amount - Weight of the blend.
 */
function shade(color, amount) {
  assertColor(color, `shade`)
  amount = assertFloat(amount, `amount`, `shade`)

  let c2 = colorToRgb(color)

  return rgbToColor(
    Math.round(c2.red*amount),
    Math.round(c2.green*amount),
    Math.round(c2.blue*amount)
  )
}

module.exports = shade


text:
package org.magcruise.gaming.ui.api;

import java.io.Serializable;

import org.magcruise.gaming.ui.model.input.InputToUI;
import org.magcruise.gaming.ui.model.message.MessageToUI;

import jp.go.nict.langrid.commons.rpc.intf.Description;
import jp.go.nict.langrid.commons.rpc.intf.Parameter;

/**
 * MAGCruiseCoreからUIへの依頼を登録するサービス.
 *
 * @author nakaguchi, nkjm
 *
 */
public interface RequestToUIRegistry {

	Serializable requestToRegisterGameSession(GameSessionJson json);

	Serializable requestToAssign(
			@Parameter(name = "processId", descriptions = @Description("プロセスID")) String processId,
			@Parameter(name = "playerName", descriptions = @Description("ゲーム上のプレーヤID")) String playerName,
			@Parameter(name = "operatorId", descriptions = @Description("ゲーム上のプレーヤIDと結びつけるMAGCruise上のオペレータID")) String operatorId);

	Serializable requestToInput(
			@Parameter(name = "processId", descriptions = @Description("プロセスID")) String processId,
			@Parameter(name = "recipient", descriptions = @Description("受信者名")) String playerName,
			@Parameter(name = "requestId", descriptions = @Description("リクエストID")) long requestId,
			@Parameter(name = "message", descriptions = @Description("入力欄のラベル")) String label,
			@Parameter(name = "roundnum", descriptions = @Description("ラウンド番号")) int roundnum,
			@Parameter(name = "inputs", descriptions = @Description("入力項目の配列")) InputToUI[] inputs);

	Serializable requestToInputAndAutoResponse(
			@Parameter(name = "processId", descriptions = @Description("プロセスID")) String processId,
			@Parameter(name = "recipient", descriptions = @Description("受信者名")) String playerName,
			@Parameter(name = "requestId", descriptions = @Description("リクエストID")) long requestId,
			@Parameter(name = "message", descriptions = @Description("入力欄のラベル")) String label,
			@Parameter(name = "roundnum", descriptions = @Description("ラウンド番号")) int roundnum,
			@Parameter(name = "inputs", descriptions = @Description("入力項目の配列")) InputToUI[] inputs,
			int maxAutoResponseTime);

	Serializable showMessage(
			@Parameter(name = "processId", descriptions = @Description("プロセスID")) String processId,
			@Parameter(name = "playerName", descriptions = @Description("受信者名")) String playerId,
			@Parameter(name = "messageId", descriptions = @Description("メッセージID")) long messageId,
			@Parameter(name = "roundnum", descriptions = @Description("ラウンド番号")) int roundnum,
			@Parameter(name = "message", descriptions = @Description("メッセージ")) MessageToUI message);

	Serializable notifyStartOfGame(
			@Parameter(name = "processId", descriptions = @Description("プロセスID")) String processId);

	Serializable notifyStartOfRound(
			@Parameter(name = "processId", descriptions = @Description("プロセスID")) String processId,
			@Parameter(name = "roundnum", descriptions = @Description("ラウンド番号")) int roundnum);

	Serializable notifyEndOfRound(
			@Parameter(name = "processId", descriptions = @Description("プロセスID")) String processId,
			@Parameter(name = "roundnum", descriptions = @Description("ラウンド番号")) int roundnum);

	Serializable notifyGameRecord(String processId, int roundnum, String record);

	Serializable notifyEndOfGame(
			@Parameter(name = "processId", descriptions = @Description("プロセスID")) String processId);

	Serializable notifyJoinInGame(String processId, String playerName);

}


text:
<?php
/**
 * Created by PhpStorm.
 * User: robert
 * Date: 1/14/15
 * Time: 2:48 PM
 */

namespace Skema\Directive;

class AutoIncrement extends Base {

}


text:
<Type Name="XPathResultType" FullName="System.Xml.XPath.XPathResultType">
  <TypeSignature Maintainer="auto" Language="C#" Value="public enum XPathResultType" />
  <AssemblyInfo>
    <AssemblyName>System.Xml</AssemblyName>
    <AssemblyPublicKey>[00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00]</AssemblyPublicKey>
    <AssemblyVersion>1.0.5000.0</AssemblyVersion>
    <AssemblyVersion>2.0.0.0</AssemblyVersion>
  </AssemblyInfo>
  <ThreadSafetyStatement>This is an enumeration type. It is always thread safe.</ThreadSafetyStatement>
  <Base>
    <BaseTypeName>System.Enum</BaseTypeName>
  </Base>
  <Docs>
    The type that will be returned from an XPath expression.
    <remarks>This can be used to distinguish between the various return types from an XPath expression.</remarks>
  </Docs>
  <Members>
    <Member MemberName="Any">
      <MemberSignature Language="C#" Value="Any" />
      <MemberType>Field</MemberType>
      <ReturnValue>
        <ReturnType>System.Xml.XPath.XPathResultType</ReturnType>
      </ReturnValue>
      <Parameters />
      <Docs>
        The expression could return any type.
        <remarks>To be added.</remarks>
      </Docs>
      <AssemblyInfo>
        <AssemblyVersion>1.0.5000.0</AssemblyVersion>
        <AssemblyVersion>2.0.0.0</AssemblyVersion>
      </AssemblyInfo>
    </Member>
    <Member MemberName="Boolean">
      <MemberSignature Language="C#" Value="Boolean" />
      <MemberType>Field</MemberType>
      <ReturnValue>
        <ReturnType>System.Xml.XPath.XPathResultType</ReturnType>
      </ReturnValue>
      <Parameters />
      <Docs>
        A boolean. The returned object will be of type System.Boolean.
        <remarks>To be added.</remarks>
      </Docs>
      <AssemblyInfo>
        <AssemblyVersion>1.0.5000.0</AssemblyVersion>
        <AssemblyVersion>2.0.0.0</AssemblyVersion>
      </AssemblyInfo>
    </Member>
    <Member MemberName="Error">
      <MemberSignature Language="C#" Value="Error" />
      <MemberType>Field</MemberType>
      <ReturnValue>
        <ReturnType>System.Xml.XPath.XPathResultType</ReturnType>
      </ReturnValue>
      <Parameters />
      <Docs>
        The expression was not able to be compiled.
        <remarks>To be added.</remarks>
      </Docs>
      <AssemblyInfo>
        <AssemblyVersion>1.0.5000.0</AssemblyVersion>
        <AssemblyVersion>2.0.0.0</AssemblyVersion>
      </AssemblyInfo>
    </Member>
    <Member MemberName="Navigator">
      <MemberSignature Language="C#" Value="Navigator" />
      <MemberType>Field</MemberType>
      <ReturnValue>
        <ReturnType>System.Xml.XPath.XPathResultType</ReturnType>
      </ReturnValue>
      <Parameters />
      <Docs>
        Return type of navigator. This is not currently used.
        <remarks>To be added.</remarks>
      </Docs>
      <AssemblyInfo>
        <AssemblyVersion>1.0.5000.0</AssemblyVersion>
        <AssemblyVersion>2.0.0.0</AssemblyVersion>
      </AssemblyInfo>
    </Member>
    <Member MemberName="NodeSet">
      <MemberSignature Language="C#" Value="NodeSet" />
      <MemberType>Field</MemberType>
      <ReturnValue>
        <ReturnType>System.Xml.XPath.XPathResultType</ReturnType>
      </ReturnValue>
      <Parameters />
      <Docs>
        A nodeset. The returned object will be an XPathNodeIterator.
        <remarks>To be added.</remarks>
      </Docs>
      <AssemblyInfo>
        <AssemblyVersion>1.0.5000.0</AssemblyVersion>
        <AssemblyVersion>2.0.0.0</AssemblyVersion>
      </AssemblyInfo>
    </Member>
    <Member MemberName="Number">
      <MemberSignature Language="C#" Value="Number" />
      <MemberType>Field</MemberType>
      <ReturnValue>
        <ReturnType>System.Xml.XPath.XPathResultType</ReturnType>
      </ReturnValue>
      <Parameters />
      <Docs>
        A number. The retun type will be of type System.Double.
        <remarks>To be added.</remarks>
      </Docs>
      <AssemblyInfo>
        <AssemblyVersion>1.0.5000.0</AssemblyVersion>
        <AssemblyVersion>2.0.0.0</AssemblyVersion>
      </AssemblyInfo>
    </Member>
    <Member MemberName="String">
      <MemberSignature Language="C#" Value="String" />
      <MemberType>Field</MemberType>
      <ReturnValue>
        <ReturnType>System.Xml.XPath.XPathResultType</ReturnType>
      </ReturnValue>
      <Parameters />
      <Docs>
        Return type of string. The returned object will be a System.String.
        <remarks>To be added.</remarks>
      </Docs>
      <AssemblyInfo>
        <AssemblyVersion>1.0.5000.0</AssemblyVersion>
        <AssemblyVersion>2.0.0.0</AssemblyVersion>
      </AssemblyInfo>
    </Member>
  </Members>
</Type>


text:
/*! \mainpage
 * \section intro Introduction
 * This is the documentation for the data structures, functions, variables,
 * defines, enums, and typedefs for the EIC driver. This documentation is also
 * bundled with an example.
 *
 * This example shows how to use the SCAN KEYPAD interface. It is not straightforward
 * to access this feature on the EVKs. Thus, an external connection should be done
 * using wires between EXTINT lines and SCAN lines.
 * Operating mode: In order to get key_number decoded, user should establish
 * manual connection(using the extension connectors zone) between SCAN lines and
 * EXTINT lines, as indicated in the arrays here below. As long as a key is "pressed",
 * its associated LED is on.
 *
 *

 *
Rows & columns view on the EVK1100

 *

 *
 *   SCAN 0(PA25)
 *   SCAN 1(PA26)
 *

 *

 *   EXTINT 6(PA10)
 *   Key 1 -> LED1
 *   Key 2 -> LED2
 *

 *

 *   EXTINT 7(PA08)
 *   Key 3 -> LED3
 *   Key 4 -> LED4
 *

 *

 *
 *

 *
Rows & columns view on the EVK1101

 *

 *
 *   SCAN 4(PB06)
 *   SCAN 5(PB07)
 *

 *

 *   EXTINT 6(PB02)
 *   Key 1 -> LED1
 *   Key 2 -> LED2
 *

 *

 *   EXTINT 7(PB03)
 *   Key 3 -> LED3
 *   Key 4 -> LED4
 *

 *

 *
 *

 *
Rows & columns view on the EVK1104

 *

 *
 *   SCAN 0(PX19)
 *   SCAN 1(PX20)
 *

 *

 *   EXTINT 6(PA09)
 *   Key 1
 *   Key 2
 *

 *

 *   EXTINT 7(PA13)
 *   Key 3
 *   Key 4
 *

 *

 *
 * \section files Main Files
 * - eic.c: EIC driver;
 * - eic.h: EIC driver header file;
 * - eic_example3.c: EIC example application.
 *
 * \section compinfo Compilation Info
 * This software was written for the GNU GCC for AVR32 and IAR Systems compiler
 * for AVR32. Other compilers may or may not work.
 *
 * \section deviceinfo Device Info
 * All AVR32 devices with a EIC module can be used. This example has been tested
 * on the following boards:

 * - EVK1100 evaluation kit
 * - EVK1101 evaluation kit
 * - EVK1104 evaluation kit
 *
 * \section setupinfo Setup Information
 * CPU speed:  Switch to oscillator external OSC0 = 12 MHz.
 *
 * \section contactinfo Contact Information
 * For further information, visit
 * Atmel AVR32.\n
 */
 /**
 * Support and FAQ: visit Atmel Support
 */

#include <avr32/io.h>
#include "compiler.h"
#include "gpio.h"
#include "board.h"
#include "eic.h"
#include "intc.h"

/*! \name Keypad scan index configuration
 * Choose the scan index for each scan column in the [0,7] range.\n
 * \warning: caution should be taken in the choice of this index regarding the
 * board schematics. For instance, on EVK1100, if scan[4] & scan[5] were chosen,
 * LED5 will blink at the keypad scan rate because LED5 and scan[4] and scan[5]
 * are using the same pins(PB19 & PB20).
 */
//! @{
#if BOARD==EVK1100
#define SCAN_COL1_IDX   0   //! Use the keypad scan[0] for column 1.
#define SCAN_COL1_MUX   _0  //! Multiplexed on PA25.
#define SCAN_COL2_IDX   1   //! Use the keypad scan[1] for column 2.
#define SCAN_COL2_MUX   _0  //! Multiplexed on PA26.
#elif BOARD==EVK1101
#define SCAN_COL1_IDX   4   //! Use the keypad scan[4] for column 1.
#define SCAN_COL1_MUX       //! Multiplexed on PB06.
#define SCAN_COL2_IDX   5   //! Use the keypad scan[5] for column 2.
#define SCAN_COL2_MUX       //! Multiplexed on PB07.
#elif BOARD==EVK1104
#define SCAN_COL1_IDX   0   //! Use the keypad scan[0] for column 1.
#define SCAN_COL1_MUX   _0  //! Multiplexed on PX19.
#define SCAN_COL2_IDX   1   //! Use the keypad scan[1] for column 2.
#define SCAN_COL2_MUX   _0  //! Multiplexed on PX20.
#endif
//! @}

/*! \name External Interrupt pin Mappings
 */
//! @{
#if BOARD==EVK1100
// With the datasheet, in section "Peripheral Multiplexing on I/O lines" in the
// table "GPIO Controller Function Multiplexing", for UC3A part, linked to
// EVK1100 board, we see that PA08 and PA10 are multiplexed with respectively
// EXTINT lines 7 and 6. PA25 and PA26 are respectively multiplexed with
// respectively SCAN lines 0 and 1.
// Note: PA08, PA10, PA25 and PA26 are available on extension connectors.
#define EXT_INT_EXAMPLE_PIN_LINE1               AVR32_EIC_EXTINT_6_PIN
#define EXT_INT_EXAMPLE_FUNCTION_LINE1          AVR32_EIC_EXTINT_6_FUNCTION
#define EXT_INT_EXAMPLE_LINE1                   EXT_INT6
#define EXT_INT_EXAMPLE_IRQ_LINE1               AVR32_EIC_IRQ_6
#define EXT_INT_EXAMPLE_PIN_LINE2               AVR32_EIC_EXTINT_7_PIN
#define EXT_INT_EXAMPLE_FUNCTION_LINE2          AVR32_EIC_EXTINT_7_FUNCTION
#define EXT_INT_EXAMPLE_LINE2                   EXT_INT7
#define EXT_INT_EXAMPLE_IRQ_LINE2               AVR32_EIC_IRQ_7
#elif BOARD==EVK1101
// With the datasheet, in section "Peripheral Multiplexing on I/O lines" in the
// table "GPIO Controller Function Multiplexing", for UC3B part, linked to
// EVK1101 board, we see that PB2 and PB3 are multiplexed with EXTINT lines 6
// and 7, and PB6 and PB7 with SCAN lines 4 and 5.
// Note: PB2, PB3, PB6 and PB7 are available on extension connectors.
#define EXT_INT_EXAMPLE_PIN_LINE1               AVR32_EIC_EXTINT_6_PIN
#define EXT_INT_EXAMPLE_FUNCTION_LINE1          AVR32_EIC_EXTINT_6_FUNCTION
#define EXT_INT_EXAMPLE_LINE1                   EXT_INT6
#define EXT_INT_EXAMPLE_IRQ_LINE1               AVR32_EIC_IRQ_6
#define EXT_INT_EXAMPLE_PIN_LINE2               AVR32_EIC_EXTINT_7_PIN
#define EXT_INT_EXAMPLE_FUNCTION_LINE2          AVR32_EIC_EXTINT_7_FUNCTION
#define EXT_INT_EXAMPLE_LINE2                   EXT_INT7
#define EXT_INT_EXAMPLE_IRQ_LINE2               AVR32_EIC_IRQ_7
#elif BOARD==EVK1104
// With the datasheet, in section "Peripheral Multiplexing on I/O lines" in the
// table "GPIO Controller Function Multiplexing", for UC3A3 part, linked to
// EVK1104 board, we see that PA09 and PA13 are multiplexed with respectively
// EXTINT lines 6 and 7. PX19 and PX20 are respectively multiplexed with
// respectively SCAN lines 0 and 1.
// Note: PA09, PA13, PX19 and PX20 are available on extension connectors.
#define EXT_INT_EXAMPLE_PIN_LINE1               AVR32_EIC_EXTINT_6_PIN
#define EXT_INT_EXAMPLE_FUNCTION_LINE1          AVR32_EIC_EXTINT_6_FUNCTION
#define EXT_INT_EXAMPLE_LINE1                   EXT_INT6
#define EXT_INT_EXAMPLE_IRQ_LINE1               AVR32_EIC_IRQ_6
#define EXT_INT_EXAMPLE_PIN_LINE2               AVR32_EIC_EXTINT_7_PIN
#define EXT_INT_EXAMPLE_FUNCTION_LINE2          AVR32_EIC_EXTINT_7_FUNCTION
#define EXT_INT_EXAMPLE_LINE2                   EXT_INT7
#define EXT_INT_EXAMPLE_IRQ_LINE2               AVR32_EIC_IRQ_7
#endif
#define EXT_SCAN_EXAMPLE_PIN_LINE1              ATPASTE4(AVR32_EIC_SCAN_,SCAN_COL1_IDX,SCAN_COL1_MUX,_PIN)
#define EXT_SCAN_EXAMPLE_FUNCTION_LINE1         ATPASTE4(AVR32_EIC_SCAN_,SCAN_COL1_IDX,SCAN_COL1_MUX,_FUNCTION)
#define EXT_SCAN_EXAMPLE_PIN_LINE2              ATPASTE4(AVR32_EIC_SCAN_,SCAN_COL2_IDX,SCAN_COL2_MUX,_PIN)
#define EXT_SCAN_EXAMPLE_FUNCTION_LINE2         ATPASTE4(AVR32_EIC_SCAN_,SCAN_COL2_IDX,SCAN_COL2_MUX,_FUNCTION)
//! @}

//! Structure holding the configuration parameters of the EIC module.
eic_options_t eic_options[2];

//! Global var used to switch between different LED patterns.
unsigned char key_number = 0;

//! Global var used to cancel the software delay if an External Interrupt occurs.
static volatile bool bCancelSwDelay = false;

/*!
 * \brief Interrupt handler of the External interrupt line "1".
 */
#if __GNUC__
__attribute__((__interrupt__))
#elif __ICCAVR32__
__interrupt
#endif
static void eic_int_handler1(void)
{
  int line_number;
  line_number = eic_get_interrupt_pad_scan(&AVR32_EIC);
  switch (line_number)
  {
  case SCAN_COL1_IDX :
    key_number = 1;
    break;
  case SCAN_COL2_IDX :
    key_number = 2;
    break;
  }
  bCancelSwDelay = true;
  eic_clear_interrupt_line(&AVR32_EIC, EXT_INT_EXAMPLE_LINE1);
}

/*!
 * \brief Interrupt handler of the External interrupt line "2".
 */
#if __GNUC__
__attribute__((__interrupt__))
#elif __ICCAVR32__
__interrupt
#endif
static void eic_int_handler2(void)
{
  int line_number;
  line_number = eic_get_interrupt_pad_scan(&AVR32_EIC);
  switch (line_number)
  {
  case SCAN_COL1_IDX :
    key_number = 3;
    break;
  case SCAN_COL2_IDX :
    key_number = 4;
    break;
  }
  bCancelSwDelay = true;
  eic_clear_interrupt_line(&AVR32_EIC, EXT_INT_EXAMPLE_LINE2);
}

/* \brief Software delay
 *
 */
static void software_delay(void)
{
  volatile int i;
  bCancelSwDelay = false;
  for (i=10000; (i>=0)&&(false == bCancelSwDelay); i--);
}

/*
 * \brief This is an example on how to use an external interrupt and to generate
 * interrupt using SCAN lines.
 */
int main(void)
{
  // Enable edge-triggered interrupt.
  eic_options[0].eic_mode  = EIC_MODE_EDGE_TRIGGERED;
  // Interrupt will trigger on falling edge (this is a must-do for the keypad scan
  // feature if the chosen mode is edge-triggered).
  eic_options[0].eic_edge  = EIC_EDGE_FALLING_EDGE;
  // Initialize in synchronous mode : interrupt is synchronized to the clock
  eic_options[0].eic_async = EIC_SYNCH_MODE;
  // Set the interrupt line number.
  eic_options[0].eic_line  = EXT_INT_EXAMPLE_LINE1;

  // Enable edge-triggered interrupt.
  eic_options[1].eic_mode   = EIC_MODE_EDGE_TRIGGERED;
  // Interrupt will trigger on falling edge (this is a must-do for the keypad scan
  // feature if the chosen mode is edge-triggered).
  eic_options[1].eic_edge  = EIC_EDGE_FALLING_EDGE;
  // Initialize in synchronous mode : interrupt is synchronized to the clock
  eic_options[1].eic_async  = EIC_SYNCH_MODE;
  // Set the interrupt line number.
  eic_options[1].eic_line   = EXT_INT_EXAMPLE_LINE2;

  // Activate LED0 & LED1 & LED2 & LED3 pins in GPIO output mode and switch them off.
  gpio_set_gpio_pin(LED0_GPIO);
  gpio_set_gpio_pin(LED1_GPIO);
  gpio_set_gpio_pin(LED2_GPIO);
  gpio_set_gpio_pin(LED3_GPIO);

  // Map the interrupt lines to the GPIO pins with the right peripheral functions.
  static const gpio_map_t EIC_GPIO_MAP =
  {
    {EXT_INT_EXAMPLE_PIN_LINE1, EXT_INT_EXAMPLE_FUNCTION_LINE1},
    {EXT_INT_EXAMPLE_PIN_LINE2, EXT_INT_EXAMPLE_FUNCTION_LINE2},
    {EXT_SCAN_EXAMPLE_PIN_LINE1, EXT_SCAN_EXAMPLE_FUNCTION_LINE1},
    {EXT_SCAN_EXAMPLE_PIN_LINE2, EXT_SCAN_EXAMPLE_FUNCTION_LINE2}
  };
  gpio_enable_module(EIC_GPIO_MAP, sizeof(EIC_GPIO_MAP) / sizeof(EIC_GPIO_MAP[0]));
  // Enable GPIO pullups for the rows.
  gpio_enable_pin_pull_up(EXT_INT_EXAMPLE_PIN_LINE1);
  gpio_enable_pin_pull_up(EXT_INT_EXAMPLE_PIN_LINE2);

  // Disable all interrupts.
  Disable_global_interrupt();

  // Initialize interrupt vectors.
  INTC_init_interrupts();

  // Register the EIC interrupt handler to the interrupt controller.
  // eic_int_handler1 and eic_int_handler2 are the interrupt handlers to register.
  // EXT_INT_EXAMPLE_IRQ_LINE1 and EXT_INT_EXAMPLE_IRQ_LINE2 are the IRQ of the
  // interrupt handlers to register.
  // AVR32_INTC_INT0 is the interrupt priority level to assign to the group of this IRQ.
  // void INTC_register_interrupt(__int_handler handler, unsigned int irq, unsigned int int_level);
  INTC_register_interrupt(&eic_int_handler1, EXT_INT_EXAMPLE_IRQ_LINE1, AVR32_INTC_INT0);
  INTC_register_interrupt(&eic_int_handler2, EXT_INT_EXAMPLE_IRQ_LINE2, AVR32_INTC_INT0);

  // Init the EIC controller with the options
  eic_init(&AVR32_EIC, eic_options, 2);
  // Enable the EIC lines.
  eic_enable_lines(&AVR32_EIC, (1<<eic_options[1].eic_line)|(1<<eic_options[0].eic_line));
  // Enable the interrupt for each EIC line.
  eic_enable_interrupt_lines(&AVR32_EIC, (1<<eic_options[1].eic_line)|(1<<eic_options[0].eic_line));
  // Enable the keypad scanning feature and configure the scan rate to 18ms (== pow(2,(10+1))*RCOsc).
  eic_enable_interrupt_scan(&AVR32_EIC,10);

  // Enable all interrupts.
  Enable_global_interrupt();

  // Loop infinitely, toggling the leds depending on the latest pressed key.
  while(1)
  {
    switch (key_number)
    {
      case 1 :
        gpio_clr_gpio_pin(LED0_GPIO);
        gpio_set_gpio_pin(LED1_GPIO);
        gpio_set_gpio_pin(LED2_GPIO);
        gpio_set_gpio_pin(LED3_GPIO);
        key_number = 0;
        software_delay();
        break;
      case 2 :
        gpio_set_gpio_pin(LED0_GPIO);
        gpio_clr_gpio_pin(LED1_GPIO);
        gpio_set_gpio_pin(LED2_GPIO);
        gpio_set_gpio_pin(LED3_GPIO);
        key_number = 0;
        software_delay();
        break;
      case 3 :
        gpio_set_gpio_pin(LED0_GPIO);
        gpio_set_gpio_pin(LED1_GPIO);
        gpio_clr_gpio_pin(LED2_GPIO);
        gpio_set_gpio_pin(LED3_GPIO);
        key_number = 0;
        software_delay();
        break;
      case 4 :
        gpio_set_gpio_pin(LED0_GPIO);
        gpio_set_gpio_pin(LED1_GPIO);
        gpio_set_gpio_pin(LED2_GPIO);
        gpio_clr_gpio_pin(LED3_GPIO);
        key_number = 0;
        software_delay();
        break;
      default :
        gpio_set_gpio_pin(LED0_GPIO);
        gpio_set_gpio_pin(LED1_GPIO);
        gpio_set_gpio_pin(LED2_GPIO);
        gpio_set_gpio_pin(LED3_GPIO);
        break;
    }
  }
}


text:
All URIs are relative to *https://api.artik.cloud/v1.1*

Method | HTTP request | Description
------------- | ------------- | -------------
[**get_available_manifest_versions**](DeviceTypesApi.md#get_available_manifest_versions) | **GET** /devicetypes/{deviceTypeId}/availablemanifestversions | Get Available Manifest Versions
[**get_device_type**](DeviceTypesApi.md#get_device_type) | **GET** /devicetypes/{deviceTypeId} | Get Device Type
[**get_device_types**](DeviceTypesApi.md#get_device_types) | **GET** /devicetypes | Get Device Types
[**get_device_types_by_application**](DeviceTypesApi.md#get_device_types_by_application) | **GET** /applications/{appId}/devicetypes | Get Device Types by Application
[**get_latest_manifest_properties**](DeviceTypesApi.md#get_latest_manifest_properties) | **GET** /devicetypes/{deviceTypeId}/manifests/latest/properties | Get Latest Manifest Properties
[**get_manifest_properties**](DeviceTypesApi.md#get_manifest_properties) | **GET** /devicetypes/{deviceTypeId}/manifests/{version}/properties | Get manifest properties

# **get_available_manifest_versions**
> ManifestVersionsEnvelope get_available_manifest_versions(device_type_id)

Get Available Manifest Versions

Get a Device Type's available manifest versions

### Example
```ruby
# load the gem
require 'artikcloud'
# setup authorization
ArtikCloud.configure do |config|
  # Configure OAuth2 access token for authorization: artikcloud_oauth
  config.access_token = 'YOUR ACCESS TOKEN'
end

api_instance = ArtikCloud::DeviceTypesApi.new

device_type_id = "device_type_id_example" # String | deviceTypeId

begin
  #Get Available Manifest Versions
  result = api_instance.get_available_manifest_versions(device_type_id)
  p result
rescue ArtikCloud::ApiError => e
  puts "Exception when calling DeviceTypesApi->get_available_manifest_versions: #{e}"
end
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **device_type_id** | **String**| deviceTypeId |

### Return type

[**ManifestVersionsEnvelope**](ManifestVersionsEnvelope.md)

### Authorization

[artikcloud_oauth](../README.md#artikcloud_oauth)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json

# **get_device_type**
> DeviceTypeEnvelope get_device_type(device_type_id)

Get Device Type

Retrieves a Device Type

### Example
```ruby
# load the gem
require 'artikcloud'
# setup authorization
ArtikCloud.configure do |config|
  # Configure OAuth2 access token for authorization: artikcloud_oauth
  config.access_token = 'YOUR ACCESS TOKEN'
end

api_instance = ArtikCloud::DeviceTypesApi.new

device_type_id = "device_type_id_example" # String | deviceTypeId

begin
  #Get Device Type
  result = api_instance.get_device_type(device_type_id)
  p result
rescue ArtikCloud::ApiError => e
  puts "Exception when calling DeviceTypesApi->get_device_type: #{e}"
end
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **device_type_id** | **String**| deviceTypeId |

### Return type

[**DeviceTypeEnvelope**](DeviceTypeEnvelope.md)

### Authorization

[artikcloud_oauth](../README.md#artikcloud_oauth)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json

# **get_device_types**
> DeviceTypesEnvelope get_device_types(name, opts)

Get Device Types

Retrieves Device Types

### Example
```ruby
# load the gem
require 'artikcloud'
# setup authorization
ArtikCloud.configure do |config|
  # Configure OAuth2 access token for authorization: artikcloud_oauth
  config.access_token = 'YOUR ACCESS TOKEN'
end

api_instance = ArtikCloud::DeviceTypesApi.new

name = "name_example" # String | Device Type name

opts = {
  offset: 56, # Integer | Offset for pagination.
  count: 56, # Integer | Desired count of items in the result set
  tags: "tags_example" # String | Elements tagged with the list of tags. (comma separated)
}

begin
  #Get Device Types
  result = api_instance.get_device_types(name, opts)
  p result
rescue ArtikCloud::ApiError => e
  puts "Exception when calling DeviceTypesApi->get_device_types: #{e}"
end
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **name** | **String**| Device Type name |
 **offset** | **Integer**| Offset for pagination. | [optional]
 **count** | **Integer**| Desired count of items in the result set | [optional]
 **tags** | **String**| Elements tagged with the list of tags. (comma separated) | [optional]

### Return type

[**DeviceTypesEnvelope**](DeviceTypesEnvelope.md)

### Authorization

[artikcloud_oauth](../README.md#artikcloud_oauth)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json

# **get_device_types_by_application**
> DeviceTypesEnvelope get_device_types_by_application(app_id, opts)

Get Device Types by Application

Get Device Types by Application

### Example
```ruby
# load the gem
require 'artikcloud'
# setup authorization
ArtikCloud.configure do |config|
  # Configure OAuth2 access token for authorization: artikcloud_oauth
  config.access_token = 'YOUR ACCESS TOKEN'
end

api_instance = ArtikCloud::DeviceTypesApi.new

app_id = "app_id_example" # String | Application ID.

opts = {
  product_info: true, # BOOLEAN | Flag to include the associated ProductInfo if present
  count: 56, # Integer | Desired count of items in the result set.
  offset: 56 # Integer | Offset for pagination.
}

begin
  #Get Device Types by Application
  result = api_instance.get_device_types_by_application(app_id, opts)
  p result
rescue ArtikCloud::ApiError => e
  puts "Exception when calling DeviceTypesApi->get_device_types_by_application: #{e}"
end
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **app_id** | **String**| Application ID. |
 **product_info** | **BOOLEAN**| Flag to include the associated ProductInfo if present | [optional]
 **count** | **Integer**| Desired count of items in the result set. | [optional]
 **offset** | **Integer**| Offset for pagination. | [optional]

### Return type

[**DeviceTypesEnvelope**](DeviceTypesEnvelope.md)

### Authorization

[artikcloud_oauth](../README.md#artikcloud_oauth)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json

# **get_latest_manifest_properties**
> ManifestPropertiesEnvelope get_latest_manifest_properties(device_type_id)

Get Latest Manifest Properties

Get a Device Type's manifest properties for the latest version.

### Example
```ruby
# load the gem
require 'artikcloud'
# setup authorization
ArtikCloud.configure do |config|
  # Configure OAuth2 access token for authorization: artikcloud_oauth
  config.access_token = 'YOUR ACCESS TOKEN'
end

api_instance = ArtikCloud::DeviceTypesApi.new

device_type_id = "device_type_id_example" # String | Device Type ID.

begin
  #Get Latest Manifest Properties
  result = api_instance.get_latest_manifest_properties(device_type_id)
  p result
rescue ArtikCloud::ApiError => e
  puts "Exception when calling DeviceTypesApi->get_latest_manifest_properties: #{e}"
end
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **device_type_id** | **String**| Device Type ID. |

### Return type

[**ManifestPropertiesEnvelope**](ManifestPropertiesEnvelope.md)

### Authorization

[artikcloud_oauth](../README.md#artikcloud_oauth)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json

# **get_manifest_properties**
> ManifestPropertiesEnvelope get_manifest_properties(device_type_id, version)

Get manifest properties

Get a Device Type's manifest properties for a specific version.

### Example
```ruby
# load the gem
require 'artikcloud'
# setup authorization
ArtikCloud.configure do |config|
  # Configure OAuth2 access token for authorization: artikcloud_oauth
  config.access_token = 'YOUR ACCESS TOKEN'
end

api_instance = ArtikCloud::DeviceTypesApi.new

device_type_id = "device_type_id_example" # String | Device Type ID.

version = "version_example" # String | Manifest Version.

begin
  #Get manifest properties
  result = api_instance.get_manifest_properties(device_type_id, version)
  p result
rescue ArtikCloud::ApiError => e
  puts "Exception when calling DeviceTypesApi->get_manifest_properties: #{e}"
end
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **device_type_id** | **String**| Device Type ID. |
 **version** | **String**| Manifest Version. |

### Return type

[**ManifestPropertiesEnvelope**](ManifestPropertiesEnvelope.md)

### Authorization

[artikcloud_oauth](../README.md#artikcloud_oauth)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json


text:
layout: default
---

InAnalysis

                    資料科學入門最佳工具

                    Best Tool to Get Started with Data Science

            Welcome to InAnalysis!

            InAnalysis機器學習平台能將資料變成可行動的商業智慧。無機器學習經驗的開發者,也能透過引導輕鬆上手。

            The InAnalysis machine learning platform turns data into business intelligence. Developers with no machine learning experience can also easily get started with guidance.

                    無需寫程式,快速上手機器學習流程

                    No need to code, to get the hang of machine learning process quickly

                    快速建置API,輕鬆將模型佈署至任何應用

                    Quickly to build up APIs, easily to deploy models to any application

                    無需安裝可隨時隨地使用,RWD設計適用任何行動裝置

                    anytime, anywhere, no need to be installed, RWD is designed for any mobile device

                How Does It Work?

            InAnalysis Work Flow

                Project Management

                能夠察看所有專案相關資訊, 新增專案, 修改專案, 刪除專案。新增專案後點選KDD,進入專案KDD流程

                Can view all project related information, add projects, modify projects, and delete projects. After adding the project, click KDD to enter the project KDD process.

                KDD Process

                Data Pre-process, Feature Selection, Model Training, Model Prediction。訓練出Model後可以在Model Management建置API

                After training the Model, you can build the API in Model Management.

                API Management

                能夠察看使用者建立的API, 修改API, 刪除API。透過API服務,輕鬆將模型佈署至任何應用。

                Ability to view user-created APIs, modify APIs, and remove APIs. Easily deploy models to any application through API services.

            <button type="button" class="btn btn-primary btn-lg btn-block"
                    onclick="window.open('http://ntuesoe.com:8008/login','_blank')">
                立即試用!Try It NOW!
            </button>


text:
require File.expand_path('../../../../spec_helper', __FILE__)

describe "GC::Profiler.disable" do
  before do
    @status = GC::Profiler.enabled?
  end

  after do
    @status ? GC::Profiler.enable : GC::Profiler.disable
  end

  it "disables the profiler" do
    GC::Profiler.disable
    GC::Profiler.enabled?.should == false
  end
end


text:
<!doctype html>
<html lang="en">
	<head prefix="og: http://ogp.me/ns#">
		<meta charset="utf-8">
		<title>{{ site.name }} : The Better Carl Counter</title>
		<link href="favicon.png" rel="shortcut icon">
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<meta name="description" content="{{ site.description }}">
		<meta property="og:title" content="{{ site.name }}">
		<meta property="og:type" content="website">
		<meta property="og:url" content="{{ site.url }}">
		<meta property="og:description" content="{{ site.description }}">
		<meta property="og:image" content="{{ site.url }}/images/ogp.jpg">
		<meta property="og:image:type" content="image/jpeg">
		<meta property="og:image:width" content="1097">
		<meta property="og:image:height" content="611">
		<meta name="twitter:card" content="summary_large_image">
		<meta name="twitter:title" content="CORRRAL">
		<meta name="twitter:description" content="Rick calls Carl, a lot">
		<meta name="twitter:creator" content="VOX_Studios">
		<meta name="twitter:image:src" content="{{ site.url }}/images/ogp.jpg">
		<meta name="twitter:image:width" content="1200">
		<meta name="twitter:image:height" content="600">
		<link href="css/bootstrap.min.css" rel="stylesheet">
		<link href="css/odometer-theme-default.css" rel="stylesheet">
		<link href="css/style.css" rel="stylesheet">
		<script src="js/odometer.min.js"></script>
		<script src="js/modernizr.js"></script>
		<script src="js/jquery-2.1.3.min.js"></script>

		<style>
			.odometer {
				vertical-align: baseline !important;
			}
			.productImage {
				width: 150px;
				height: 100%;
			}
		</style>
	</head>


text:
using QL.QLClasses.Values;

namespace QL.QLClasses.Expressions.Binary.Conditional
{
    public class Or : ConditionalExpression
    {
        public Or(ExpressionBase leftExpression, ExpressionBase rightExpression)
            : base(leftExpression, rightExpression)
        {
        }

        public override QValue Evaluate()
        {
            return ((BoolValue)LeftExpression.Evaluate()).Or((BoolValue)RightExpression.Evaluate());
        }
    }
}


text:
"""
IPv6-to-IPv4 conversion
+++++++++++++++++++++++

Act as a local SNMPv1/v2c Agent listening on a UDP/IPv6 transport, relay
messages to distant SNMPv1/2c Agent over UDP/IPv4 transport:

* with local SNMPv2c community 'public'
* local Agent listening at [::1]:161
* remote SNMPv2c community 'public'
* remote Agent listening at 104.236.166.95:161

This script can be queried with the following Net-SNMP command:

| $ snmpget -v2c -c public udp6:[::1]:161 sysDescr.0

due to proxy, it is equivalent to

| $ snmpget -v2c -c public 104.236.166.95:161 sysDescr.0

Warning: for production operation you would need to modify this script
so that it will re-map possible duplicate request-ID values, coming in
initial request PDUs from different Managers, into unique values to
avoid sending duplicate request-IDs to Agents.

"""#
from pysnmp.carrier.asyncore.dgram import udp, udp6
from pysnmp.entity import engine, config
from pysnmp.entity.rfc3413 import cmdrsp, cmdgen, context
from pysnmp.proto.api import v2c
from pysnmp import error

# Create SNMP engine with autogenernated engineID and pre-bound
# to socket transport dispatcher
snmpEngine = engine.SnmpEngine()

#
# Transport setup
#

# Agent section

# UDP over IPv6
config.addTransport(
    snmpEngine,
    udp6.DOMAIN_NAME,
    udp6.Udp6Transport().openServerMode(('::1', 161))
)

# Manager section

# UDP over IPv4
config.addTransport(
    snmpEngine,
    udp.DOMAIN_NAME,
    udp.UdpTransport().openClientMode()
)

#
# SNMPv1/2c setup (Agent role)
#

# SecurityName <-> CommunityName mapping
config.addV1System(snmpEngine, '1-my-area', 'public')

#
# SNMPv1/v2c setup (Manager role)
#
# Here we configure securityName lexicographically lesser than '1-my-area'
# to let it match first in snmpCommunityTable on response processing.
#

config.addV1System(snmpEngine, '0-distant-area', 'public', transportTag='remote')

#
# Transport target used by Manager
#

config.addTargetParams(
    snmpEngine, 'distant-agent-auth', '0-distant-area', 'noAuthNoPriv', 1
)

config.addTargetAddr(
    snmpEngine, 'distant-agent',
    udp.DOMAIN_NAME, ('104.236.166.95', 161),
    'distant-agent-auth', retryCount=0, tagList='remote'
)

# Default SNMP context
config.addContext(snmpEngine, '')

class CommandResponder(cmdrsp.CommandResponderBase):
    CMDGEN_MAP = {
        v2c.GetRequestPDU.tagSet: cmdgen.GetCommandGenerator(),
        v2c.SetRequestPDU.tagSet: cmdgen.SetCommandGenerator(),
        v2c.GetNextRequestPDU.tagSet: cmdgen.NextCommandGeneratorSingleRun(),
        v2c.GetBulkRequestPDU.tagSet: cmdgen.BulkCommandGeneratorSingleRun()
    }
    SUPPORTED_PDU_TYPES = tuple(CMDGEN_MAP)  # This app will handle these PDUs

    # SNMP request relay
    def handleMgmtOperation(self, snmpEngine, stateReference, contextName,
                            PDU, acInfo):
        cbCtx = stateReference, PDU
        contextEngineId = None  # address authoritative SNMP Engine
        try:
            self.CMDGEN_MAP[PDU.tagSet].sendPdu(
                snmpEngine, 'distant-agent',
                contextEngineId, contextName,
                PDU,
                self.handleResponsePdu, cbCtx
            )

        except error.PySnmpError:
            self.handleResponsePdu(
                snmpEngine, stateReference, 'error', None, cbCtx
            )

    # SNMP response relay
    # noinspection PyUnusedLocal
    def handleResponsePdu(self, snmpEngine, sendRequestHandle,
                          errorIndication, PDU, cbCtx):
        stateReference, reqPDU = cbCtx

        if errorIndication:
            PDU = v2c.apiPDU.getResponse(reqPDU)
            PDU.setErrorStatus(PDU, 5)

        self.sendPdu(
            snmpEngine, stateReference, PDU
        )

        self.releaseStateInformation(stateReference)

CommandResponder(snmpEngine, context.SnmpContext(snmpEngine))

snmpEngine.transportDispatcher.jobStarted(1)  # this job would never finish

# Run I/O dispatcher which would receive queries and send responses
try:
    snmpEngine.transportDispatcher.runDispatcher()

finally:
    snmpEngine.transportDispatcher.closeDispatcher()


text:
import OCL from 'openchemlib-extended';

export const FETCH_MOLECULES = 'FETCH_MOLECULES';
export const NEW_FILTERED_MOLECULES = 'NEW_FILTERED_MOLECULES';
export const LINE_HOVERED = 'LINE_HOVERED';

export function fetchMolecules() {
    return {
        type: FETCH_MOLECULES,
        payload: fetchData()
    }
}

export function setFilteredMolecules(molecules) {
    return {
        type: NEW_FILTERED_MOLECULES,
        payload: molecules
    };
}

export function moleculeLineHovered(data) {
    return {
        type: LINE_HOVERED,
        payload: data
    }
}

async function fetchData() {
    const size = 100;
    const res = await window.fetch('https://www.cheminfo.org/wikipedia/src/json/data.json');
    const text = await res.text();
    const data = JSON.parse(text)
        .data.molecules.slice(0, size)
        .map(molecule => {
            var props = new OCL.MoleculeProperties(OCL.Molecule.fromIDCode(molecule.actID.value));
            return {
                actID: molecule.actID,
                code: molecule.code,
                mf: molecule.mf,
                logP: props.logP,
                logS: props.logS,
                hDonor: props.donorCount,
                hAcceptor: props.acceptorCount,
                polarSurface: props.polarSurfaceArea
            }
        });
    return data;
}


text:
<navbar></navbar>

Contact

    Notice that this page is within a new section.  This is a separate entry point and requires a browser refresh.
    This could be handy for entrance pages where you may not want to load the entire SPA until the user take a certain action.

You can find me in {{ vm.name }}.html.