text:
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.

defined('MOODLE_INTERNAL') || die();

global $CFG;

class mod_data_events_testcase extends advanced_testcase {

    /**
     * Test set up.
     *
     * This is executed before running any test in this file.
     */
    public function setUp() {
        $this->resetAfterTest();
    }

    /**
     * Test the field created event.
     */
    public function test_field_created() {
        $this->setAdminUser();

        // Create a course we are going to add a data module to.
        $course = $this->getDataGenerator()->create_course();

        // The generator used to create a data module.
        $generator = $this->getDataGenerator()->get_plugin_generator('mod_data');

        // Create a data module.
        $data = $generator->create_instance(array('course' => $course->id));

        // Now we want to create a field.
        $field = data_get_field_new('text', $data);
        $fielddata = new stdClass();
        $fielddata->name = 'Test';
        $fielddata->description = 'Test description';
        $field->define_field($fielddata);

        // Trigger and capture the event for creating a field.
        $sink = $this->redirectEvents();
        $field->insert_field();
        $events = $sink->get_events();
        $event = reset($events);

        // Check that the event data is valid.
        $this->assertInstanceOf('\mod_data\event\field_created', $event);
        $this->assertEquals(context_module::instance($data->cmid), $event->get_context());
        $expected = array($course->id, 'data', 'fields add', 'field.php?d=' . $data->id . '&mode=display&fid=' .
            $field->field->id, $field->field->id, $data->cmid);
        $this->assertEventLegacyLogData($expected, $event);
        $this->assertEventContextNotUsed($event);
        $url = new moodle_url('/mod/data/field.php', array('d' => $data->id));
        $this->assertEquals($url, $event->get_url());
    }

    /**
     * Test the field updated event.
     */
    public function test_field_updated() {
        $this->setAdminUser();

        // Create a course we are going to add a data module to.
        $course = $this->getDataGenerator()->create_course();

        // The generator used to create a data module.
        $generator = $this->getDataGenerator()->get_plugin_generator('mod_data');

        // Create a data module.
        $data = $generator->create_instance(array('course' => $course->id));

        // Now we want to create a field.
        $field = data_get_field_new('text', $data);
        $fielddata = new stdClass();
        $fielddata->name = 'Test';
        $fielddata->description = 'Test description';
        $field->define_field($fielddata);
        $field->insert_field();

        // Trigger and capture the event for updating the field.
        $sink = $this->redirectEvents();
        $field->update_field();
        $events = $sink->get_events();
        $event = reset($events);

        // Check that the event data is valid.
        $this->assertInstanceOf('\mod_data\event\field_updated', $event);
        $this->assertEquals(context_module::instance($data->cmid), $event->get_context());
        $expected = array($course->id, 'data', 'fields update', 'field.php?d=' . $data->id . '&mode=display&fid=' .
            $field->field->id, $field->field->id, $data->cmid);
        $this->assertEventLegacyLogData($expected, $event);
        $this->assertEventContextNotUsed($event);
        $url = new moodle_url('/mod/data/field.php', array('d' => $data->id));
        $this->assertEquals($url, $event->get_url());
    }

    /**
     * Test the field deleted event.
     */
    public function test_field_deleted() {
        $this->setAdminUser();

        // Create a course we are going to add a data module to.
        $course = $this->getDataGenerator()->create_course();

        // The generator used to create a data module.
        $generator = $this->getDataGenerator()->get_plugin_generator('mod_data');

        // Create a data module.
        $data = $generator->create_instance(array('course' => $course->id));

        // Now we want to create a field.
        $field = data_get_field_new('text', $data);
        $fielddata = new stdClass();
        $fielddata->name = 'Test';
        $fielddata->description = 'Test description';
        $field->define_field($fielddata);
        $field->insert_field();

        // Trigger and capture the event for deleting the field.
        $sink = $this->redirectEvents();
        $field->delete_field();
        $events = $sink->get_events();
        $event = reset($events);

        // Check that the event data is valid.
        $this->assertInstanceOf('\mod_data\event\field_deleted', $event);
        $this->assertEquals(context_module::instance($data->cmid), $event->get_context());
        $expected = array($course->id, 'data', 'fields delete', 'field.php?d=' . $data->id, $field->field->name, $data->cmid);
        $this->assertEventLegacyLogData($expected, $event);
        $this->assertEventContextNotUsed($event);
        $url = new moodle_url('/mod/data/field.php', array('d' => $data->id));
        $this->assertEquals($url, $event->get_url());
    }

    /**
     * Test the record created event.
     */
    public function test_record_created() {
        // Create a course we are going to add a data module to.
        $course = $this->getDataGenerator()->create_course();

        // The generator used to create a data module.
        $generator = $this->getDataGenerator()->get_plugin_generator('mod_data');

        // Create a data module.
        $data = $generator->create_instance(array('course' => $course->id));

        // Trigger and capture the event for creating the record.
        $sink = $this->redirectEvents();
        $recordid = data_add_record($data);
        $events = $sink->get_events();
        $event = reset($events);

        // Check that the event data is valid.
        $this->assertInstanceOf('\mod_data\event\record_created', $event);
        $this->assertEquals(context_module::instance($data->cmid), $event->get_context());
        $expected = array($course->id, 'data', 'add', 'view.php?d=' . $data->id . '&rid=' . $recordid,
            $data->id, $data->cmid);
        $this->assertEventLegacyLogData($expected, $event);
        $this->assertEventContextNotUsed($event);
        $url = new moodle_url('/mod/data/view.php', array('d' => $data->id, 'rid' => $recordid));
        $this->assertEquals($url, $event->get_url());
    }

    /**
     * Test the record updated event.
     *
     * There is no external API for updating a record, so the unit test will simply create
     * and trigger the event and ensure the legacy log data is returned as expected.
     */
    public function test_record_updated() {
        // Create a course we are going to add a data module to.
        $course = $this->getDataGenerator()->create_course();

        // The generator used to create a data module.
        $generator = $this->getDataGenerator()->get_plugin_generator('mod_data');

        // Create a data module.
        $data = $generator->create_instance(array('course' => $course->id));

        // Trigger an event for updating this record.
        $event = \mod_data\event\record_updated::create(array(
            'objectid' => 1,
            'context' => context_module::instance($data->cmid),
            'courseid' => $course->id,
            'other' => array(
                'dataid' => $data->id
            )
        ));

        // Trigger and capture the event for updating the data record.
        $sink = $this->redirectEvents();
        $event->trigger();
        $events = $sink->get_events();
        $event = reset($events);

        // Check that the event data is valid.
        $this->assertInstanceOf('\mod_data\event\record_updated', $event);
        $this->assertEquals(context_module::instance($data->cmid), $event->get_context());
        $expected = array($course->id, 'data', 'update', 'view.php?d=' . $data->id . '&rid=1', $data->id, $data->cmid);
        $this->assertEventLegacyLogData($expected, $event);
        $this->assertEventContextNotUsed($event);
        $url = new moodle_url('/mod/data/view.php', array('d' => $data->id, 'rid' => $event->objectid));
        $this->assertEquals($url, $event->get_url());
    }

    /**
     * Test the record deleted event.
     */
    public function test_record_deleted() {
        global $DB;

        // Create a course we are going to add a data module to.
        $course = $this->getDataGenerator()->create_course();

        // The generator used to create a data module.
        $generator = $this->getDataGenerator()->get_plugin_generator('mod_data');

        // Create a data module.
        $data = $generator->create_instance(array('course' => $course->id));

        // Now we want to create a field.
        $field = data_get_field_new('text', $data);
        $fielddata = new stdClass();
        $fielddata->name = 'Test';
        $fielddata->description = 'Test description';
        $field->define_field($fielddata);
        $field->insert_field();

        // Create data record.
        $datarecords = new stdClass();
        $datarecords->userid = '2';
        $datarecords->dataid = $data->id;
        $datarecords->id = $DB->insert_record('data_records', $datarecords);

        // Create data content.
        $datacontent = new stdClass();
        $datacontent->fieldid = $field->field->id;
        $datacontent->recordid = $datarecords->id;
        $datacontent->id = $DB->insert_record('data_content', $datacontent);

        // Trigger and capture the event for deleting the data record.
        $sink = $this->redirectEvents();
        data_delete_record($datarecords->id, $data, $course->id, $data->cmid);
        $events = $sink->get_events();
        $event = reset($events);

        // Check that the event data is valid.
        $this->assertInstanceOf('\mod_data\event\record_deleted', $event);
        $this->assertEquals(context_module::instance($data->cmid), $event->get_context());
        $expected = array($course->id, 'data', 'record delete', 'view.php?id=' . $data->cmid, $data->id, $data->cmid);
        $this->assertEventLegacyLogData($expected, $event);
        $this->assertEventContextNotUsed($event);
        $url = new moodle_url('/mod/data/view.php', array('d' => $data->id));
        $this->assertEquals($url, $event->get_url());
    }

    /**
     * Test the template viewed event.
     *
     * There is no external API for viewing templates, so the unit test will simply create
     * and trigger the event and ensure the legacy log data is returned as expected.
     */
    public function test_template_viewed() {
        // Create a course we are going to add a data module to.
        $course = $this->getDataGenerator()->create_course();

        // The generator used to create a data module.
        $generator = $this->getDataGenerator()->get_plugin_generator('mod_data');

        // Create a data module.
        $data = $generator->create_instance(array('course' => $course->id));

        // Trigger an event for updating this record.
        $event = \mod_data\event\template_viewed::create(array(
            'context' => context_module::instance($data->cmid),
            'courseid' => $course->id,
            'other' => array(
                'dataid' => $data->id
            )
        ));

        // Trigger and capture the event for updating the data record.
        $sink = $this->redirectEvents();
        $event->trigger();
        $events = $sink->get_events();
        $event = reset($events);

        // Check that the event data is valid.
        $this->assertInstanceOf('\mod_data\event\template_viewed', $event);
        $this->assertEquals(context_module::instance($data->cmid), $event->get_context());
        $expected = array($course->id, 'data', 'templates view', 'templates.php?id=' . $data->cmid . '&d=' .
            $data->id, $data->id, $data->cmid);
        $this->assertEventLegacyLogData($expected, $event);
        $this->assertEventContextNotUsed($event);
        $url = new moodle_url('/mod/data/templates.php', array('d' => $data->id));
        $this->assertEquals($url, $event->get_url());
    }

    /**
     * Test the template updated event.
     *
     * There is no external API for updating a template, so the unit test will simply create
     * and trigger the event and ensure the legacy log data is returned as expected.
     */
    public function test_template_updated() {
        // Create a course we are going to add a data module to.
        $course = $this->getDataGenerator()->create_course();

        // The generator used to create a data module.
        $generator = $this->getDataGenerator()->get_plugin_generator('mod_data');

        // Create a data module.
        $data = $generator->create_instance(array('course' => $course->id));

        // Trigger an event for updating this record.
        $event = \mod_data\event\template_updated::create(array(
            'context' => context_module::instance($data->cmid),
            'courseid' => $course->id,
            'other' => array(
                'dataid' => $data->id,
            )
        ));

        // Trigger and capture the event for updating the data record.
        $sink = $this->redirectEvents();
        $event->trigger();
        $events = $sink->get_events();
        $event = reset($events);

        // Check that the event data is valid.
        $this->assertInstanceOf('\mod_data\event\template_updated', $event);
        $this->assertEquals(context_module::instance($data->cmid), $event->get_context());
        $expected = array($course->id, 'data', 'templates saved', 'templates.php?id=' . $data->cmid . '&d=' .
            $data->id, $data->id, $data->cmid);
        $this->assertEventLegacyLogData($expected, $event);
        $this->assertEventContextNotUsed($event);
        $url = new moodle_url('/mod/data/templates.php', array('d' => $data->id));
        $this->assertEquals($url, $event->get_url());
    }
}


text:
package server

import (
	"net"

	"github.com/miekg/coredns/middleware"
)

// Config configuration for a single server.
type Config struct {
	// The hostname or IP on which to serve
	Host string

	// The host address to bind on - defaults to (virtual) Host if empty
	BindHost string

	// The port to listen on
	Port string

	// The directory from which to parse db files
	Root string

	// HTTPS configuration
	TLS TLSConfig

	// Middleware stack
	Middleware []middleware.Middleware

	// Startup is a list of functions (or methods) to execute at
	// server startup and restart; these are executed before any
	// parts of the server are configured, and the functions are
	// blocking. These are good for setting up middlewares and
	// starting goroutines.
	Startup []func() error

	// FirstStartup is like Startup but these functions only execute
	// during the initial startup, not on subsequent restarts.
	//
	// (Note: The server does not ever run these on its own; it is up
	// to the calling application to do so, and do so only once, as the
	// server itself has no notion whether it's a restart or not.)
	FirstStartup []func() error

	// Functions (or methods) to execute when the server quits;
	// these are executed in response to SIGINT and are blocking. These
	// function are *also* called when we are restarting.
	Shutdown []func() error

	// The path to the configuration file from which this was loaded
	ConfigFile string

	// The name of the application
	AppName string

	// The application's version
	AppVersion string
}

// Address returns the host:port of c as a string.
func (c Config) Address() string {
	return net.JoinHostPort(c.Host, c.Port)
}

// TLSConfig describes how TLS should be configured and used.
type TLSConfig struct {
	Enabled                  bool // will be set to true if TLS is enabled
	LetsEncryptEmail         string
	Manual                   bool // will be set to true if user provides own certs and keys
	Managed                  bool // will be set to true if config qualifies for implicit automatic/managed HTTPS
	OnDemand                 bool // will be set to true if user enables on-demand TLS (obtain certs during handshakes)
	Ciphers                  []uint16
	ProtocolMinVersion       uint16
	ProtocolMaxVersion       uint16
	PreferServerCipherSuites bool
	ClientCerts              []string
}

redpajama_set_name: RedPajamaGithub


text:
package fr.liglab.adele.cream.it.functional.extension.test.multiple;

import fr.liglab.adele.cream.it.functional.extension.multiple.ContextEntityImpl;
import fr.liglab.adele.cream.it.functional.extension.multiple.ExtensionSpec;
import fr.liglab.adele.cream.it.functional.extension.multiple.ExtensionSpecBis;
import fr.liglab.adele.cream.it.functional.extension.test.FunctionalExtensionBaseCommonConfig;
import org.apache.felix.ipojo.ConfigurationException;
import org.apache.felix.ipojo.MissingHandlerException;
import org.apache.felix.ipojo.UnacceptableConfiguration;
import org.junit.Test;
import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;
import org.ops4j.pax.exam.spi.reactors.PerMethod;

import java.util.HashMap;

import static org.assertj.core.api.Assertions.assertThat;

@ExamReactorStrategy(PerMethod.class)
public class MultipleFunctionalExtensionImplementationTest extends FunctionalExtensionBaseCommonConfig {

    @Test
    public void testMulipleImplem() throws MissingHandlerException, UnacceptableConfiguration, ConfigurationException {
        createContextEntityToInit();

        ExtensionSpec serviceObj1 = osgiHelper.getServiceObject(ExtensionSpec.class);

        assertThat(serviceObj1).isNotNull();
        assertThat(serviceObj1 instanceof ExtensionSpecBis).isTrue();
        assertThat(serviceObj1.getFalse()).isFalse();
        assertThat(((ExtensionSpecBis) serviceObj1).getTrue()).isTrue();

        ExtensionSpecBis serviceObjBis = osgiHelper.getServiceObject(ExtensionSpecBis.class);

        assertThat(serviceObjBis).isNotNull();
        assertThat(serviceObjBis instanceof ExtensionSpec).isTrue();
        assertThat(((ExtensionSpec) serviceObjBis).getFalse()).isFalse();
        assertThat(serviceObjBis.getTrue()).isTrue();

    }

    private void createContextEntityToInit() throws MissingHandlerException, UnacceptableConfiguration, ConfigurationException {
        contextHelper.getContextEntityHelper().createContextEntity(ContextEntityImpl.class.getName(), "context.entity", new HashMap());
    }

}


text:
package dk.jarry.bukkit;

import org.bukkit.Bukkit;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.block.BlockPlaceEvent;

/**
 * @author Michael Bornholdt Nielsen <mni@jarry.dk>
 */
public class SendMsgToAllPlayersBlockListener implements Listener {

    private JarryPlugin plugin;

    public SendMsgToAllPlayersBlockListener(JarryPlugin plugin) {
        this.plugin = plugin;
    }

    // http://jd.bukkit.org/apidocs/ provide a complete list of events that can be registered.

    @EventHandler
    public void onBlockPlace(BlockPlaceEvent event) {
        Bukkit.getServer().broadcastMessage("Player " + event.getPlayer().getName() + " placed " + event.getBlock().getType() + " at " + event.getBlock().getLocation());
    }

}


text:
Inner model types
=================

.. automodule:: dirty_models.model_types
    :members:
    :show-inheritance:
    :no-undoc-members:


text:
/* -*- Mode: C++; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
/*
 *     Copyright 2011 Couchbase, Inc
 *
 *   Licensed under the Apache License, Version 2.0 (the "License");
 *   you may not use this file except in compliance with the License.
 *   You may obtain a copy of the License at
 *
 *       http://www.apache.org/licenses/LICENSE-2.0
 *
 *   Unless required by applicable law or agreed to in writing, software
 *   distributed under the License is distributed on an "AS IS" BASIS,
 *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *   See the License for the specific language governing permissions and
 *   limitations under the License.
 */
#pragma once

#include <memcached/engine.h>

#include <iostream>
#include <map>
#include <mutex>
#include <string>

/**
 * The value changed listeners runs _without_ the global mutex for
 * the configuration class, so you may access other configuration
 * members from the callback.
 * The callback is fired <b>after</b> the value is set, so if you
 * want to prevent the caller from setting specific values you should
 * use the ValueChangedValidator instead.
 */
class ValueChangedListener {
public:
    void valueChanged(const std::string& key, bool value) {
        booleanValueChanged(key, value);
    }

    void valueChanged(const std::string& key, size_t value) {
        sizeValueChanged(key, value);
    }

    void valueChanged(const std::string& key, ssize_t value) {
        ssizeValueChanged(key, value);
    }

    void valueChanged(const std::string& key, float value) {
        floatValueChanged(key, value);
    }

    void valueChanged(const std::string& key, std::string value) {
        stringValueChanged(key, value.c_str());
    }

    void valueChanged(const std::string& key, const char* value) {
        stringValueChanged(key, value);
    }

    /**
     * Callback if when a boolean configuration value changed
     * @param key the key who changed
     * @param value the new value for the key
     */
    virtual void booleanValueChanged(const std::string& key, bool);

    /**
     * Callback if when a numeric configuration value changed
     * @param key the key who changed
     * @param value the new value for the key
     */
    virtual void sizeValueChanged(const std::string& key, size_t);

    /**
     * Callback if when a numeric configuration value changed
     * @param key the key who changed
     * @param value the new value for the key
     */
    virtual void ssizeValueChanged(const std::string& key, ssize_t);

    /**
     * Callback if when a floatingpoint configuration value changed
     * @param key the key who changed
     * @param value the new value for the key
     */
    virtual void floatValueChanged(const std::string& key, float);
    /**
     * Callback if when a string configuration value changed
     * @param key the key who changed
     * @param value the new value for the key
     */
    virtual void stringValueChanged(const std::string& key, const char*);

    virtual ~ValueChangedListener() { /* EMPTY */}
};

/**
 * The validator for the values runs with the mutex held
 * for the configuration class, so you can't try to access
 * any other configuration variables from the callback
 */
class ValueChangedValidator {
public:
    void validate(const std::string& key, bool value) {
        validateBool(key, value);
    }

    void validate(const std::string& key, size_t value) {
        validateSize(key, value);
    }

    void validate(const std::string& key, ssize_t value) {
        validateSSize(key, value);
    }

    void validate(const std::string& key, float value) {
        validateFloat(key, value);
    }

    void validate(const std::string& key, const char* value) {
        validateString(key, value);
    }
    void validate(const std::string& key, std::string value) {
        validateString(key, value.c_str());
    }

    /**
     * Validator for boolean values
     * @param key the key that is about to change
     * @param value the requested new value
     * @throws runtime_error if the validation failed
     */
    virtual void validateBool(const std::string& key, bool);

    /**
     * Validator for a numeric value
     * @param key the key that is about to change
     * @param value the requested new value
     * @throws runtime_error if the validation failed
     */
    virtual void validateSize(const std::string& key, size_t);

    /**
     * Validator for a signed numeric value
     * @param key the key that is about to change
     * @param value the requested new value
     * @throws runtime_error if the validation failed
     */
    virtual void validateSSize(const std::string& key, ssize_t);

    /**
     * Validator for a floating point
     * @param key the key that is about to change
     * @param value the requested new value
     * @throws runtime_error if the validation failed
     */
    virtual void validateFloat(const std::string& key, float);

    /**
     * Validator for a character string
     * @param key the key that is about to change
     * @param value the requested new value
     * @throws runtime_error if the validation failed
     */
    virtual void validateString(const std::string& key, const char*);

    virtual ~ValueChangedValidator() { }
};

class StatCollector;
class Requirement;

/**
 * The configuration class represents and provides access to the
 * entire configuration of the server.
 */
class Configuration {
public:
    struct value_t;

    Configuration();
    ~Configuration();

    // Include the generated prototypes for the member functions
#include "generated_configuration.h" // NOLINT(*)

    /**
     * Parse a configuration string and set the local members
     *
     * @param str the string to parse
     * @param sapi pointer to the server API
     * @return true if success, false otherwise
     */
    bool parseConfiguration(const char* str, ServerApi* sapi);

    /**
     * Add all of the configuration variables as stats
     * @param collector where to store collected statistics
     */
    void addStats(StatCollector& collector) const;

    using Visitor = std::function<void(
            const std::string& key, bool isDynamic, std::string value)>;

    /**
     * Invokes the given function on all configuration values which have
     * their requirements met.
     */
    void visit(Visitor visitor) const;

    /**
     * Add a listener for changes for a key. The configuration class takes
     * ownership of the listener. There is no way to remove a
     * ValueChangeListener.
     *
     * @param key the key to add the listener for
     * @param val the listener that will receive all of the callbacks
     *            when the value change.
     * @throw invalid_argument if the specified key isn't a valid config key.
     */
    void addValueChangedListener(const std::string& key,
                                 std::unique_ptr<ValueChangedListener> val);

    /**
     * Set a validator for a specific key. The configuration class
     * will release the memory for the ValueChangedValidator by calling
     * delete in its destructor (so you have to allocate it by using
     * new). If a validator exists for the key, that will be returned
     * (and it's up to the caller to release the memory for that
     * validator).
     *
     * @param key the key to set the validator for
     * @param validator the new validator
     * @return the old validator (or NULL if there wasn't a validator)
     */
    ValueChangedValidator *setValueValidator(const std::string &key,
                                             ValueChangedValidator *validator);
    /**
     * Adds an alias for a configuration. Values can be set in configuration
     * under the original or aliased named, but setters/getters will only be
     * generated for the main name.
     *
     * @param key the key to which the alias refers
     * @param alias the new alias
     */
    void addAlias(const std::string& key, const std::string& alias);

    /**
     * Adds a prerequisite to a configuration option. This must be satisfied
     * in order to set/get the config value or for it to appear in stats.
     *
     * @param key the key to set the requirement for
     * @param requirement the requirement
     */
    Requirement* setRequirements(const std::string& key,
                                 Requirement* requirement);

    bool requirementsMet(const value_t& value) const;

    void requirementsMetOrThrow(const std::string& key) const;

protected:
    /**
     * Add a new configuration parameter (size_t, ssize_t, float, bool, string)
     * @param key the key to specify
     * @param value the new value
     * @param dynamic True if this parameter can be changed at runtime,
     *        False if the value cannot be changed once object is constructed.
     */
    template <class T>
    void addParameter(std::string key, T value, bool dynamic);

    /**
     * Set the configuration parameter for a given key to
     * a new value (size_t, ssize_t, float, bool, string)
     * @param key the key to specify
     * @param value the new value
     * @throws invalid_argument if the given key doesn't exist.
     * @throws runtime_error if the validation failed
     */
    template <class T>
    void setParameter(const std::string& key, T value);

    /**
     * Get the configuration parameter for a given key
     * @param key the key to specify
     * @return value the value
     * @throws runtime_error if the validation failed
     */
    template <class T>
    T getParameter(const std::string& key) const;

private:
    void initialize();

    // Access to the configuration variables is protected by the mutex
    mutable std::mutex mutex;
    std::map<std::string, std::shared_ptr<value_t>> attributes;

    friend std::ostream& operator<< (std::ostream& out,
                                     const Configuration &config);
};

// This specialisation is needed to convert char* to std::string to store in
// the variant.
template <>
void Configuration::setParameter<const char*>(const std::string& key,
                                              const char* value);


text:
import os
here = lambda x: os.path.abspath(os.path.join(os.path.dirname(__file__), x))

print(here('static'))


text:
TODO: Practica 8 de Lenguajes y Paradigmas de la programación

## Installation

Add this line to your application's Gemfile:

    gem 'exam'

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install exam

## Usage

TODO: Practica 8 de Lenguajes y Paradigmas de la programación

## Contributing

1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request


text:
<?php

class Utils_Form extends Form
{

	public static function select($field, $values = null, array $options = array(), array $attributes = array())
	{
		if (is_array($field))
		{
			$attributes = $field;

			if ( ! isset($attributes['selected']))
			{
				$attributes['selected'] = ! isset($attributes['value']) ? null : $attributes['value'];
			}
		}
		else
		{
			$attributes['name'] = (string) $field;
			$attributes['selected'] = $values;
			$attributes['options'] = $options;
		}
		unset($attributes['value']);

		if ( ! isset($attributes['options']) || ! is_array($attributes['options']))
		{
			throw new \InvalidArgumentException(sprintf('Select element "%s" is either missing the "options" or "options" is not array.', $attributes['name']));
		}
		// Get the options then unset them from the array
		$options = $attributes['options'];
		unset($attributes['options']);

		// Get the selected options then unset it from the array
		// and make sure they're all strings to avoid type conversions
		$selected = ! isset($attributes['selected']) ? array() : array_map(function($a) { return (string) $a; }, array_values((array) $attributes['selected']));

		unset($attributes['selected']);

		// closure to recusively process the options array
		$listoptions = function (array $options, $selected, $level = 1) use (&$listoptions) {

			$input = PHP_EOL;
			foreach ($options as $key => $val)
			{
				$opt_attr = array('value' => $key, 'style' => 'text-indent: '.(10*($level-1)).'px;');
				(in_array((string)$key, $selected, TRUE)) && $opt_attr[] = 'selected';
				$input .= str_repeat("\t", $level);
				$opt_attr['value'] = (\Config::get('form.prep_value', true) && empty($attributes['dont_prep'])) ?
					\Form::prep_value($opt_attr['value']) : $opt_attr['value'];

				if (isset($val['data']))
				{
					foreach ($val['data'] as $tag => $value)
					{
						$opt_attr[$tag] = $value;
					}
				}

				$input .= html_tag('option', $opt_attr, $val['text']).PHP_EOL;
			}

			return $input;
		};

		// generate the select options list
		$input = $listoptions($options, $selected).str_repeat("\t", 0);

		if (empty($attributes['id']) && \Config::get('form.auto_id', false) == true)
		{
			$attributes['id'] = \Config::get('form.auto_id_prefix', '').$attributes['name'];
		}

		return html_tag('select', \Form::attr_to_string($attributes), $input);
	}

}


text:
require 'dotviz/version'

module Dotviz
  # Your code goes here...
end


text:
.. _ens210:

ams ens210 Relative Humidity and Temperature Sensor
###################################################

Overview
********

This sample application demonstrates how to use the ams ens210 sensor to
measure the ambient temperature and relative humidity.

Building and Running
********************

This sample application uses the sensor connected to the i2c stated in the
ens210.overlay file.
Flash the binary to a board of choice with a sensor connected.
For example build for a nucleo_f446re board:

.. zephyr-app-commands::
   :zephyr-app: samples/sensors/ens210
   :board: nucleo_f446re
   :goals: build flash
   :compact:

Sample Output
=============

.. code-block:: console

    device is 0x20001174, name is ENS210
    Temperature: 28.28881222 C; Humidity: 25.25689737%
    Temperature: 28.28912472 C; Humidity: 25.25799105%
    Temperature: 28.28959347 C; Humidity: 25.25760045%


text:
    <?php $this->load->view('templates/sidebar'); ?>

About <?php echo $total?> results

      <?php if($listObject):?>
        <?php foreach($listObject as $object):
          $detailLink = makeLink($object['id'], $object['title'], 'video');
          ?>

            <a href="<?php echo $detailLink?>">
              <img src="<?php echo getThumbnail($object['series_thumbnail'], 'series') ?>" alt="<?php echo $object['title']?>" class="img-responsive">

<a href="<?php echo $detailLink ?>"><?php echo $object['title']?>

<?php echo $object['series_desctiption']?>

        <?php endforeach;?>
      <?php endif;?>

      <?php $this->load->view("templates/paging_frontend", array('total' => $total, 'max' => $max, 'offset' => $offset)); ?>


text:
package mars.liju;

import java.util.ArrayList;
import java.util.HashMap;

import mars.bigwork.R;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.*;
import android.widget.AdapterView.OnItemClickListener;
public class li03 extends Activity {
	private ListView myListView;
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.limain);
        myListView=(ListView)findViewById(R.id.ListView01);

        ArrayList<HashMap<String, Object>> listitem=new ArrayList<HashMap<String,Object>>();

        HashMap<String, Object> map=new HashMap<String, Object>();
    	  map.put("title", "Who is your idol?");
    	  map.put("info", "Lucy:Hi. What's wrong with you ?");
    	listitem.add(map);
    	  map = new HashMap<String, Object>();
    	  map.put("title", "ÎÒÕæÅå·þ÷Î÷");
    	  map.put("info", "Jackie:Hi! Lili, do you know Messi? ");

    	listitem.add(map);
    	  map = new HashMap<String, Object>();
    	  map.put("title", "ÁõÏèÓ¶á3Á¬¹Ú");
    	  map.put("info", "СÑî:What a pity! I had to go to a wedding");
    	 listitem.add(map);
    	 map = new HashMap<String, Object>();
   	  map.put("title", "ÌåÓý½çµÄ½¾°Á");
   	  map.put("info", "´ó×ì:Who is the pride in sports of our country ?  ");
   	 listitem.add(map);
   	 map = new HashMap<String, Object>();
	  map.put("title", "Ìå̳¾µä˲¼ä");
	  map.put("info", "´ó×ì:What is the most wonderful moment of");
	 listitem.add(map);
	 map = new HashMap<String, Object>();
	  map.put("title", "Ò¦Ã÷");
	  map.put("info", "´ó×ì:The most influential sports-men were chosen");
	 listitem.add(map);
	 map = new HashMap<String, Object>();
	  map.put("title", "ÀîÄÈ´³½øÃÀÍø8Ç¿");
	  map.put("info", "Tom:Did you watch the US Open?");
	 listitem.add(map);

        SimpleAdapter listitemAdapter=new SimpleAdapter(this,//ÉÏÏÂÎÄ
        		listitem, //"µ"þ
        		R.layout.listview_style,//listItemµÄxmlŒ¬F
        		new String[]{"title","info"}, //ÄmapµÄÅú¶¨Key
        		new int[]{R.id.title,R.id.info} //µ½ÒªŒ¬FµÄ¿Ø¼þÉÏ
        );

        myListView.setAdapter(listitemAdapter);

       myListView.setOnItemClickListener(new OnItemClickListener() {

		@Override
		public void onItemClick(AdapterView<?> arg0, View arg1, int arg2,
				long arg3) {

			// TODO Auto-generated method stub
			int arg=arg2+1;
			RelativeLayout lr=(RelativeLayout)arg1;
			TextView mText=(TextView)lr.getChildAt(1);
			Toast.makeText(li03.this, "ÄãµãÁ˵Ú"+arg+"ÏîµÄ"+mText.getText().toString(),
					1000).show();
			Intent intent =new Intent();
			switch(arg){
			case 0:break;
	  		case 1:
	  			 intent.putExtra("testid",15);
	  			 //.putExtra("testid", 0);
	         	// intent.setClass(testListViewAcitivity.this, xiu01.class);
	  	         break;
	  		case 2:
	  			intent.putExtra("testid",16);
	  			//intent.setClass(testListViewAcitivity.this, xiu02.class);
	  			break;
	  		case 3:
	  			intent.putExtra("testid",17);break;
	  		case 4:
	  			intent.putExtra("testid",18);break;
	  		case 5:
	  			intent.putExtra("testid",19);break;
	  		case 6:
	  			intent.putExtra("testid",20);break;
	  		case 7:
	  			intent.putExtra("testid",21);break;

	  	}
			intent.setClass(li03.this, xiu01.class);
			startActivity(intent);

		}
       });

    }

}


text:
The Webduino javascript core, for browser and node.js

## Installation

#### Browser

```Shell
$ bower install webduino-js
```

For dist files and docs:

```Shell
$ cd bower_components/webduino-js
$ npm install && npm run build
```

#### Node.js

```Shell
$ npm install webduino-js
```

## Usage

#### Browser

Insert scripts in your html:

```
<script src="bower_components/webduino-js/dist/webduino-base.min.js"></script>
<script src="bower_components/webduino-js/src/module/Led.js"></script>
```

#### Node.js

Require the module:

```javascript
var webduino = require('webduino-js');
```

Then use it with the same APIs:

```javascript
var board, led;

board = new webduino.WebArduino('device_id');

board.on(webduino.BoardEvent.READY, function() {
	led = new webduino.module.Led(board, board.getDigitalPin(10));
	led.on();
});
```

## API

_(coming soon...)_

## [License](LICENSE)


text:
import numpy as np
import numpy.random
import os
from os.path import join,exists,dirname
from sklearn import svm
import sys

from sklearn.datasets import load_svmlight_file, dump_svmlight_file
from sklearn.metrics import f1_score
from uda_common import evaluate_and_print_scores, align_test_X_train, get_f1, find_best_c, read_feature_groups, read_feature_lookup

def main(args):
    if len(args) < 1:
        sys.stderr.write("Required argument(s): <combined data>\n\n")
        sys.exit(-1)

    goal_ind = 2
    data_file = args[0]
    data_dir = dirname(data_file)

    print("Reading input data from %s" % (data_file))
    all_X, all_y = load_svmlight_file(data_file)
    num_total_instances, num_feats = all_X.shape

    domain_map = read_feature_groups(join(data_dir, 'reduced-feature-groups.txt'))
    domain_inds = domain_map['Domain']

    feature_map = read_feature_lookup(join(data_dir, 'reduced-features-lookup.txt'))

    for direction in [0,1]:
        sys.stderr.write("using domain %s as source, %s as target\n"  %
            (feature_map[domain_inds[direction]],feature_map[domain_inds[1-direction]]))

        train_instance_inds = np.where(all_X[:,domain_inds[direction]].toarray() > 0)[0]
        X_train = all_X[train_instance_inds,:]
        y_train = all_y[train_instance_inds]
        num_train_instances = X_train.shape[0]

        test_instance_inds = np.where(all_X[:,domain_inds[1-direction]].toarray() > 0)[0]
        X_test = all_X[test_instance_inds,:]
        y_test = all_y[test_instance_inds]
        num_test_instances = X_test.shape[0]

        print("Original feature space evaluation (AKA no adaptation, AKA pivot+non-pivot)")
        ## C < 1 => more regularization
        ## C > 1 => more fitting to training
        # C_list = [0.001, 0.01, 0.1, 1.0, 10.0]
        (l1_c, l1_f1) = find_best_c(X_train, y_train, scorer=f1_score, penalty='l1', dual=False, pos_label=goal_ind)
        print("Optimizing l1 with cross-validation gives C=%f and f1=%f" % (l1_c, l1_f1))
        (l2_c, l2_f1) = find_best_c(X_train, y_train, pos_label=goal_ind)
        print("Optimizing l2 with cross-validation gives C=%f and f1=%f" % (l2_c, l2_f1))

        run_oracle_silver_tuning(X_train, y_train, X_test, y_test, goal_ind, l2_c)
        #run_silver_tuning(X_train, y_train, X_test, y_test, goal_ind)
        #run_balanced_bootstrapping(X_train, y_train, X_test, y_test, goal_ind)
        #run_enriched_bootstrapping(X_train, y_train, X_test, y_test, goal_ind)

def run_oracle_silver_tuning(X_train, y_train, X_test, y_test, goal_ind, l2_c):
    print("Tuning regularization using oracle labels from confident/unconfident instances")
    num_train_instances = X_train.shape[0]
    num_feats = X_train.shape[1]
    num_test_instances = X_test.shape[0]

    num_added = 100
    svc = svm.LinearSVC(penalty='l2', C=l2_c)
    svc.fit(X_train, y_train)
    # preds = svc.predict(X_test)  # predict should return 0/1 (maybe experiment with weights?)
    decisions = svc.decision_function(X_test)
    # confidence is signed, so we take the absolute value to get most/least confident
    # decisions in either direction
    confidence_indices = np.argsort(np.abs(decisions))

    for config in ('most_confident', 'least_confident', 'random'):
        if config == 'most_confident':
            target_indices = confidence_indices[-num_added:]
        elif config == 'least_confident':
            target_indices = confidence_indices[:num_added]
        else:
            target_indices = np.random.choice(num_test_instances, num_added, replace=False)

        train_plus_test_X = np.zeros((num_train_instances+num_added, num_feats))
        train_plus_test_X[:num_train_instances, :] += X_train
        train_plus_test_X[num_train_instances:, :] += X_test[target_indices, :]
        train_plus_test_y = np.zeros(num_train_instances+num_added)
        train_plus_test_y[:num_train_instances] += y_train
        train_plus_test_y[num_train_instances:] += y_test[target_indices]
        (gs_l2_c, gs_l2_f1) = find_best_c(train_plus_test_X, train_plus_test_y, pos_label=goal_ind)
        print(" Optimized l2 for gold+silver with %d %s instances added: %f" % (num_added, config, gs_l2_c))
        evaluate_and_print_scores(X_train, y_train, X_test, y_test, goal_ind, gs_l2_c)
        del train_plus_test_X, train_plus_test_y

def run_silver_tuning(X_train, y_train, X_test, y_test, goal_ind):
    print("Tuning regularization parameter on gold+silver:")
    num_train_instances = X_train.shape[0]
    num_feats = X_train.shape[1]
    num_test_instances = X_test.shape[0]

    svc = svm.LinearSVC(penalty='l2', C=l2_c)
    svc.fit(X_train, y_train)
    preds = svc.predict(X_test)  # predict should return 0/1 (maybe experiment with weights?)
    decisions = svc.decision_function(X_test)
    for threshold in (0.0, 1.0):
        sys.stderr.write("Testing silver optimization with confidence threshold %f" % threshold)
        confident_indices = np.where(np.abs(decisions) > threshold)[0]
        num_added = len(confident_indices)

        train_plus_test_X = np.zeros((num_train_instances+num_added, num_feats))
        train_plus_test_X[:num_train_instances, :] += X_train
        train_plus_test_X[num_train_instances:, :] += X_test[confident_indices, :]
        train_plus_test_y = np.zeros(num_train_instances+num_added)
        train_plus_test_y[:num_train_instances] += y_train
        train_plus_test_y[num_train_instances:] += preds[confident_indices]
        (gs_l2_c, gs_l2_f1) = find_best_c(train_plus_test_X, train_plus_test_y, pos_label=goal_ind)
        print(" Optimized l2 for gold+silver: %f" % (gs_l2_c))
        evaluate_and_print_scores(X_train, y_train, X_test, y_test, goal_ind, gs_l2_c)
        del train_plus_test_X, train_plus_test_y

def run_balanced_bootstrapping(X_train, y_train, X_test, y_test, goal_ind):
    print("Balanced bootstrapping method (add equal amounts of true/false examples)")
    num_train_instances = X_train.shape[0]
    num_feats = X_train.shape[1]
    num_test_instances = X_test.shape[0]

    for percentage in [0.01, 0.1, 0.25]:
        svc = svm.LinearSVC()
        svc.fit(X_train, y_train)
        preds = svc.decision_function(X_test)
        added_X = []
        added_y = []
        for i in range(int(percentage * num_test_instances)):
            if i % 2 == 0:
                highest_ind = preds.argmax()
                if preds[highest_ind] <= 0:
                    break
            else:
                highest_ind = preds.argmin()
                if preds[highest_ind] >= 0:
                    break

            added_X.append(X_test[highest_ind,:].toarray()[0])
            added_y.append(1 if preds[highest_ind] < 0 else 2)
            preds[highest_ind] = 0

        print("Added %d instances from target dataset" % (len(added_y)))
        train_plus_bootstrap_X = np.zeros((num_train_instances + len(added_y), num_feats))
        train_plus_bootstrap_X[:num_train_instances, :] += X_train
        train_plus_bootstrap_X[num_train_instances:, :] += np.array(added_X)
        train_plus_bootstrap_y = np.zeros(num_train_instances + len(added_y))
        train_plus_bootstrap_y[:num_train_instances] += y_train
        train_plus_bootstrap_y[num_train_instances:] += np.array(added_y)
        (l2_c, l2_f1) = find_best_c(train_plus_bootstrap_X, train_plus_bootstrap_y, pos_label=goal_ind)
        evaluate_and_print_scores(train_plus_bootstrap_X, train_plus_bootstrap_y, X_test, y_test, goal_ind, l2_c)
        del train_plus_bootstrap_y, train_plus_bootstrap_X

def run_enriched_bootstrapping(X_train, y_train, X_test, y_test, goal_ind):
    print("Enriching bootstrapping method (add minority class examples only)")
    for percentage in [0.01, 0.1, 0.25]:
        svc = svm.LinearSVC()
        svc.fit(X_train, y_train)
        preds = svc.decision_function(X_test)
        added_X = []
        added_y = []
        for i in range(int(percentage * num_test_instances)):
            highest_ind = preds.argmax()
            if preds[highest_ind] <= 0:
                break
            added_X.append(X_test[highest_ind,:].toarray()[0])
            added_y.append(goal_ind)
            preds[highest_ind] = 0

        print("Added %d positive instances from target dataset" % (len(added_y)))
        train_plus_bootstrap_X = np.zeros((num_train_instances + len(added_y), num_feats))
        train_plus_bootstrap_X[:num_train_instances, :] += X_train
        train_plus_bootstrap_X[num_train_instances:, :] += np.array(added_X)
        train_plus_bootstrap_y = np.zeros(num_train_instances + len(added_y))
        train_plus_bootstrap_y[:num_train_instances] += y_train
        train_plus_bootstrap_y[num_train_instances:] += np.array(added_y)
        (l2_c, l2_f1) = find_best_c(train_plus_bootstrap_X, train_plus_bootstrap_y, pos_label=goal_ind)
        evaluate_and_print_scores(train_plus_bootstrap_X, train_plus_bootstrap_y, X_test, y_test, goal_ind, l2_c)
        del train_plus_bootstrap_y, train_plus_bootstrap_X

if __name__ == '__main__':
    args = sys.argv[1:]
    main(args)


text:
typedef int _Atomic_word;

#ifdef _ARCH_PPC
#define _GLIBCXX_READ_MEM_BARRIER __asm __volatile ("isync":::"memory")
#define _GLIBCXX_WRITE_MEM_BARRIER __asm __volatile ("sync":::"memory")
#else
#define _GLIBCXX_READ_MEM_BARRIER __asm __volatile ("":::"memory")
#define _GLIBCXX_WRITE_MEM_BARRIER __asm __volatile ("":::"memory")
#endif

#endif


text:
import struct
import gzip
import bz2

class CompressedFile (object):
    magic = None
    file_type = None
    mime_type = None
    proper_extension = None

    @classmethod
    def is_magic(cls, data):
        return data.startswith(cls.magic)

class GZFile (CompressedFile):
    magic = '\x1f\x8b\x08'
    file_type = 'gz'
    mime_type = 'compressed/gz'

    @classmethod
    def read(cls, c):
        return gzip.GzipFile(fileobj=c).read()

class BZFile (CompressedFile):
    magic = '\x42\x5a\x68'
    file_type = 'bz2'
    mime_type = 'compressed/bz'

    @classmethod
    def read(cls, c):
        return bz2.decompress(c.buf)

def is_compressed_file(f):
    start_of_file = f.read(5)
    f.seek(0)
    for cls in (GZFile, BZFile):
        if cls.is_magic(start_of_file):
            return True
    return False

class FileTypeNotSupportedException(Exception):
    pass

def get_compressed_file(f):
    start_of_file = f.read(5)
    f.seek(0)
    for cls in (GZFile, BZFile):
        if cls.is_magic(start_of_file):
            return cls
    raise FileTypeNotSupportedException


text:
package com.wtl.wawork.core.util;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.datatype.joda.JodaModule;
import com.wtl.wawork.core.persistence.domain.EmploymentType.IdentityEnumSerializer;
import com.wtl.wawork.core.persistence.domain.IdentityEnum;

public class WaJobsObjectMapper extends ObjectMapper {

    private static final long serialVersionUID = 1L;

    public WaJobsObjectMapper() {
        JodaModule module = new JodaModule();
        module.addSerializer(IdentityEnum.class, new IdentityEnumSerializer());
        registerModule(module);
    }

}


text:
package com.musicstore.dao;

import java.util.List;
import java.util.ArrayList;
import com.musicstore.vo.Album;

public interface AlbumDAO {
	public List<Album> findAllAlbums();
	public List<Album> searchBooksByKeyword(String keyword);
	// public List<Category> findAllCategories();
	public void insert(Album album);
	public void update(Album album);
	public void delete(int albumID);

}


text:
package ru.stqa.pft.addressbook.tests;

import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
import ru.stqa.pft.addressbook.model.ContactData;
import ru.stqa.pft.addressbook.model.Contacts;
import ru.stqa.pft.addressbook.model.GroupData;

import java.io.File;

import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.MatcherAssert.assertThat;

/**
 * Created by asviderskiy on 05.04.2016.
 */
public class HbConnectionContactModificationTests extends TestBase {

  @BeforeMethod
  public void ensurePreconditions() {
    app.goTo().homePage();
    if (app.db().contacts().size() == 0) {
      app.goTo().groupPage();
      if (app.db().groups().size() == 0) {
        app.group().create(new GroupData().withName("test 1"));
      }
      app.goTo().homePage();
      File photo = new File("src/test/resources/ava.jpeg");
      app.contact().create(new ContactData().
          withFirstName("testFirstName").withMiddleName("testMiddleName").withLastName("testLastName").
          withNickName("Guru").withTitle("testTitle").withCompany("testCompany").withAddress("testAddress").
          withPhoto(photo).
          withHomePhone("+38 067 456-66-31").withMobilePhone("22-22-22").withWorkPhone("33 33 33").
          withEmail("email1@test.com").withEmail2("email2@test.com").withEmail3("email3@test.com").
          withHomeFromSecondary("(999)99-99-99").
          withGroup("test 1").withNote("testNote"));
    }
  }

  @Test
  public void testContactModificationViaHbConnection() {
    Contacts before = app.db().contacts();
    ContactData modifiedContact = before.iterator().next();
    File photo = new File("src/test/resources/ava.jpeg");
    ContactData contact = new ContactData().withId(modifiedContact.getId()).
        withFirstName("testFirstName-1").withMiddleName("testMiddleName-1").withLastName("testLastName-1").
        withNickName("Guru-1").withTitle("testTitle-1").withCompany("testCompany-1").withAddress("testAddress-1").
        withPhoto(photo).
        withHomePhone("+38 067 456-66-31-1").withMobilePhone("22-22-22-1").withWorkPhone("33 33 33-1").
        withEmail("email1@test.com").withEmail2("email2@test.com").withEmail3("email3@test.com").
        withHomeFromSecondary("(999)99-99-99-1").
        withGroup("test 1").withNote("testNote-1");
    app.goTo().homePage();
    app.contact().modify(contact);
    app.goTo().homePage();
    assertThat(app.contact().count(), equalTo(before.size()));
    Contacts after = app.db().contacts();
    assertThat(after, equalTo(before.without(modifiedContact).withAdded(contact)));
    verifyContactListInUI();
  }
}


text:
package com.twitter.ostrich.stats

import org.junit.runner.RunWith
import org.scalatest.FunSuite
import org.scalatest.junit.JUnitRunner

@RunWith(classOf[JUnitRunner])
class MetricTest extends FunSuite {

  test("min, max, mean") {
    val metric = new Metric()
    metric.add(10)
    metric.add(20)
    assert(metric() === Distribution(Histogram(10, 20)))
    metric.add(60)
    assert(metric() === Distribution(Histogram(10, 20, 60)))

    assert(metric().histogram.get(false) === Histogram(10, 20, 60).get(false))
  }

  test("add distribution") {
    val metric = new Metric()
    metric.add(Distribution(Histogram(10, 20)))
    metric.add(60)
    assert(metric() === Distribution(Histogram(10, 20, 60)))
  }

  test("clear") {
    val metric = new Metric()
    metric.add(10)
    metric.add(20)
    assert(metric() === Distribution(Histogram(10, 20)))
    assert(metric() === Distribution(Histogram(10, 20)))
    metric.clear()
    assert(metric() === Distribution(Histogram()))
  }

}


text:
const httpMethods = ['get', 'post', 'put', 'head', 'delete', 'options'];
function wrapRouter(router) {
  httpMethods.concat(['use', 'all', 'param']).forEach(method => {
    if (typeof router[method] === 'function') {
      const originMethod = `__${method}`;
      router[originMethod] = router[method].bind(router);
      // eslint-disable-next-line
      router[method] = function(...handlers) {
        router[originMethod](...handlers.map(fn => wrapAsyncHandler(fn, method !== 'param')));
        return router;
      };
    }
  });

  if (typeof router.route === 'function') {
    router.__route = router.route.bind(router);
    // eslint-disable-next-line
    router.route = function(...args) {
      return wrapRouter(router.__route(...args));
    };
  }
  return router;
}

function wrapAsyncHandler(fn, withErrorParam = true) {
  if (typeof fn !== 'function') {
    return fn;
  }
  if (withErrorParam && fn.length > 3) {
    // error handler
    // eslint-disable-next-line
    return function(err, req, res, next) {
      // eslint-disable-next-line
      return callAndCatchPromiseError(fn, ...toArray(arguments));
    };
  }
  // eslint-disable-next-line
  return function(req, res, next) {
    // eslint-disable-next-line
    return callAndCatchPromiseError(fn, ...toArray(arguments));
  };
}
// eslint-disable-next-line
function callAndCatchPromiseError(fn, ...args) {
  const next = args[args.length - 1];
  let p = null;
  try {
    p = fn.apply(null, args);
  } catch (err) {
    return next(err);
  }
  if (p && p.then && p.catch) {
    // eslint-disable-next-line
    p.catch(err => next(err));
  }
}

function toArray(args) {
  return Array.prototype.slice.call(args);
}

export { wrapRouter };


text:
namespace renderer  { class Material;}
namespace renderer  { class OSLShaderGroupExec; }
namespace renderer  { class Scene; }
namespace renderer  { class ShadingContext; }
namespace renderer  { class TextureCache; }

namespace renderer
{

//
// The Tracer class wraps the Intersector class and allows to compute
// visibility from a given point along a given direction, as well as
// point-to-point visibility. It automatically takes into account alpha
// transparency.
//

class Tracer
  : public foundation::NonCopyable
{
  public:
    // Constructors.
    Tracer(
        const Scene&                    scene,
        const Intersector&              intersector,
        TextureCache&                   texture_cache,
        OSLShaderGroupExec&             shadergroup_exec,
        const float                     transparency_threshold = 0.001f,
        const size_t                    max_iterations = 1000,
        const bool                      print_details = true);

    // Compute the transmission in a given direction.
    // Returns the transmission factor up to (but excluding) this occluder.
    void trace_simple(
        const ShadingContext&           shading_context,
        const ShadingRay&               ray,
        Spectrum&                       transmission);
    void trace_simple(
        const ShadingContext&           shading_context,
        const ShadingPoint&             origin,
        const ShadingRay&               ray,
        Spectrum&                       transmission);

    // Compute the transmission between two points.
    // Returns the transmission factor up to (but excluding) this occluder.
    void trace_between_simple(
        const ShadingContext&           shading_context,
        const ShadingPoint&             origin,
        const foundation::Vector3d&     target,
        const VisibilityFlags::Type     ray_flags,
        Spectrum&                       transmission);
    void trace_between_simple(
        const ShadingContext&           shading_context,
        const ShadingPoint&             origin,
        const foundation::Vector3d&     target,
        const ShadingRay&               parent_ray,
        const VisibilityFlags::Type     ray_flags,
        Spectrum&                       transmission);
    void trace_between_simple(
        const ShadingContext&           shading_context,
        const foundation::Vector3d&     origin,
        const foundation::Vector3d&     target,
        const ShadingRay&               parent_ray,
        const VisibilityFlags::Type     ray_flags,
        Spectrum&                       transmission);
    void trace_between_simple(
        const ShadingContext&           shading_context,
        const foundation::Vector3d&     origin,
        const foundation::Vector3d&     target,
        const ShadingRay::Time&         ray_time,
        const VisibilityFlags::Type     ray_flags,
        const ShadingRay::DepthType     ray_depth,
        Spectrum&                       transmission);

    // Compute the transmission in a given direction.
    // Returns the intersection with the closest fully opaque occluder
    // and the transmission factor up to (but excluding) this occluder,
    // or a miss if there is no fully opaque occluder in this direction.
    const ShadingPoint& trace_full(
        const ShadingContext&           shading_context,
        const ShadingRay&               ray,
        Spectrum&                       transmission);
    const ShadingPoint& trace_full(
        const ShadingContext&           shading_context,
        const ShadingPoint&             origin,
        const ShadingRay&               ray,
        Spectrum&                       transmission);

    // Compute the transmission between two points.
    // Returns the intersection with the closest fully opaque occluder
    // and the transmission factor up to (but excluding) this occluder,
    // or a miss if there is no fully opaque occluder in the segment [origin, target).
    const ShadingPoint& trace_between_full(
        const ShadingContext&           shading_context,
        const ShadingPoint&             origin,
        const foundation::Vector3d&     target,
        const VisibilityFlags::Type     ray_flags,
        Spectrum&                       transmission);
    const ShadingPoint& trace_between_full(
        const ShadingContext&           shading_context,
        const ShadingPoint&             origin,
        const foundation::Vector3d&     target,
        const ShadingRay&               parent_ray,
        const VisibilityFlags::Type     ray_flags,
        Spectrum&                       transmission);
    const ShadingPoint& trace_between_full(
        const ShadingContext&           shading_context,
        const foundation::Vector3d&     origin,
        const foundation::Vector3d&     target,
        const ShadingRay&               parent_ray,
        const VisibilityFlags::Type     ray_flags,
        Spectrum&                       transmission);
    const ShadingPoint& trace_between_full(
        const ShadingContext&           shading_context,
        const foundation::Vector3d&     origin,
        const foundation::Vector3d&     target,
        const ShadingRay::Time&         ray_time,
        const VisibilityFlags::Type     ray_flags,
        const ShadingRay::DepthType     ray_depth,
        Spectrum&                       transmission);

  private:
    const Intersector&                  m_intersector;
    TextureCache&                       m_texture_cache;
    OSLShaderGroupExec&                 m_shadergroup_exec;
    const bool                          m_assume_no_alpha_mapping;
    const bool                          m_assume_no_participating_media;
    const float                         m_transmission_threshold;
    const size_t                        m_max_iterations;
    ShadingPoint                        m_shading_points[2];

    const ShadingPoint& do_trace(
        const ShadingContext&           shading_context,
        const ShadingRay&               ray,
        Spectrum&                       transmission,
        const ShadingPoint*             parent_shading_point);

    const ShadingPoint& do_trace_between(
        const ShadingContext&           shading_context,
        const foundation::Vector3d&     target,
        const ShadingRay&               ray,
        Spectrum&                       transmission,
        const ShadingPoint*             parent_shading_point);

    void evaluate_alpha(
        const Material&                 material,
        const ShadingPoint&             shading_point,
        Alpha&                          alpha) const;
};

//
// Tracer class implementation.
//

inline void Tracer::trace_simple(
    const ShadingContext&               shading_context,
    const ShadingRay&                   ray,
    Spectrum&                           transmission)
{
    if (m_assume_no_alpha_mapping && m_assume_no_participating_media)
        transmission.set(m_intersector.trace_probe(ray) ? 0.0f : 1.0f);
    else
    {
        const ShadingPoint& shading_point =
            trace_full(
                shading_context,
                ray,
                transmission);

        if (shading_point.hit_surface())
            transmission.set(0.0f);
    }
}

inline void Tracer::trace_simple(
    const ShadingContext&               shading_context,
    const ShadingPoint&                 origin,
    const ShadingRay&                   ray,
    Spectrum&                           transmission)
{
    if (m_assume_no_alpha_mapping && m_assume_no_participating_media)
        transmission.set(m_intersector.trace_probe(ray, &origin) ? 0.0f : 1.0f);
    else
    {
        const ShadingPoint& shading_point =
            trace_full(
                shading_context,
                origin,
                ray,
                transmission);

        if (shading_point.hit_surface())
            transmission.set(0.0f);
    }
}

inline void Tracer::trace_between_simple(
    const ShadingContext&               shading_context,
    const ShadingPoint&                 origin,
    const foundation::Vector3d&         target,
    const VisibilityFlags::Type         ray_flags,
    Spectrum&                           transmission)
{
    if (m_assume_no_alpha_mapping && m_assume_no_participating_media)
    {
        const foundation::Vector3d direction = target - origin.get_point();
        const double dist = foundation::norm(direction);

        const ShadingRay ray(
            origin.get_biased_point(direction),
            direction / dist,
            0.0,                        // ray tmin
            dist * (1.0 - 1.0e-6),      // ray tmax
            origin.get_time(),
            ray_flags,
            origin.get_ray().m_depth + 1);

        transmission.set(m_intersector.trace_probe(ray, &origin) ? 0.0f : 1.0f);
    }
    else
    {
        const ShadingPoint& shading_point =
            trace_between_full(
                shading_context,
                origin,
                target,
                ray_flags,
                transmission);

        if (shading_point.hit_surface())
            transmission.set(0.0f);
    }
}

inline void Tracer::trace_between_simple(
    const ShadingContext&               shading_context,
    const ShadingPoint&                 origin,
    const foundation::Vector3d&         target,
    const ShadingRay&                   parent_ray,
    const VisibilityFlags::Type         ray_flags,
    Spectrum&                           transmission)
{
    if (m_assume_no_alpha_mapping && m_assume_no_participating_media)
    {
        const foundation::Vector3d direction = target - origin.get_point();
        const double dist = foundation::norm(direction);

        const ShadingRay ray(
            origin.get_biased_point(direction),
            direction / dist,
            0.0,                        // ray tmin
            dist * (1.0 - 1.0e-6),      // ray tmax
            parent_ray.m_time,
            ray_flags,
            parent_ray.m_depth);

        transmission.set(m_intersector.trace_probe(ray, &origin) ? 0.0f : 1.0f);
    }
    else
    {
        const ShadingPoint& shading_point =
            trace_between_full(
                shading_context,
                origin,
                target,
                parent_ray,
                ray_flags,
                transmission);

        if (shading_point.hit_surface())
            transmission.set(0.0f);
    }
}

inline void Tracer::trace_between_simple(
    const ShadingContext&               shading_context,
    const foundation::Vector3d&         origin,
    const foundation::Vector3d&         target,
    const ShadingRay&                   parent_ray,
    const VisibilityFlags::Type         ray_flags,
    Spectrum&                           transmission)
{
    if (m_assume_no_alpha_mapping && m_assume_no_participating_media)
    {
        const foundation::Vector3d direction = target - origin;
        const double dist = foundation::norm(direction);

        const ShadingRay ray(
            origin,
            direction / dist,
            0.0,                        // ray tmin
            dist * (1.0 - 1.0e-6),      // ray tmax
            parent_ray.m_time,
            ray_flags,
            parent_ray.m_depth);

        transmission.set(m_intersector.trace_probe(ray) ? 0.0f : 1.0f);
    }
    else
    {
        const ShadingPoint& shading_point =
            trace_between_full(
                shading_context,
                origin,
                target,
                parent_ray,
                ray_flags,
                transmission);

        if (shading_point.hit_surface())
            transmission.set(0.0f);
    }
}

inline void Tracer::trace_between_simple(
    const ShadingContext&               shading_context,
    const foundation::Vector3d&         origin,
    const foundation::Vector3d&         target,
    const ShadingRay::Time&             ray_time,
    const VisibilityFlags::Type         ray_flags,
    const ShadingRay::DepthType         ray_depth,
    Spectrum&                           transmission)
{
    if (m_assume_no_alpha_mapping && m_assume_no_participating_media)
    {
        const foundation::Vector3d direction = target - origin;
        const double dist = foundation::norm(direction);

        const ShadingRay ray(
            origin,
            direction / dist,
            0.0,                        // ray tmin
            dist * (1.0 - 1.0e-6),      // ray tmax
            ray_time,
            ray_flags,
            ray_depth);

        transmission.set(m_intersector.trace_probe(ray) ? 0.0f : 1.0f);
    }
    else
    {
        const ShadingPoint& shading_point =
            trace_between_full(
                shading_context,
                origin,
                target,
                ray_time,
                ray_flags,
                ray_depth,
                transmission);

        if (shading_point.hit_surface())
            transmission.set(0.0f);
    }
}

inline const ShadingPoint& Tracer::trace_full(
    const ShadingContext&               shading_context,
    const ShadingRay&                   ray,
    Spectrum&                           transmission)
{
    return
        do_trace(
            shading_context,
            ray,
            transmission,
            nullptr);
}

inline const ShadingPoint& Tracer::trace_full(
    const ShadingContext&               shading_context,
    const ShadingPoint&                 origin,
    const ShadingRay&                   ray,
    Spectrum&                           transmission)
{
    return
        do_trace(
            shading_context,
            ray,
            transmission,
            &origin);
}

inline const ShadingPoint& Tracer::trace_between_full(
    const ShadingContext&               shading_context,
    const ShadingPoint&                 origin,
    const foundation::Vector3d&         target,
    const VisibilityFlags::Type         ray_flags,
    Spectrum&                           transmission)
{
    const foundation::Vector3d direction = target - origin.get_point();
    const double dist = foundation::norm(direction);

    ShadingRay ray(
        origin.get_biased_point(direction),
        direction / dist,
        0.0,
        dist * (1.0 - 1.0e-6),
        origin.get_ray().m_time,
        ray_flags,
        origin.get_ray().m_depth + 1);

    return
        do_trace_between(
            shading_context,
            target,
            ray,
            transmission,
            &origin);
}

inline const ShadingPoint& Tracer::trace_between_full(
    const ShadingContext&               shading_context,
    const ShadingPoint&                 origin,
    const foundation::Vector3d&         target,
    const ShadingRay&                   parent_ray,
    const VisibilityFlags::Type         ray_flags,
    Spectrum&                           transmission)
{
    const foundation::Vector3d direction = target - origin.get_point();
    const double dist = foundation::norm(direction);

    ShadingRay ray(
        origin.get_biased_point(direction),
        direction / dist,
        0.0,
        dist * (1.0 - 1.0e-6),
        parent_ray.m_time,
        ray_flags,
        parent_ray.m_depth + 1);

    ray.copy_media_from(parent_ray);

    return
        do_trace_between(
            shading_context,
            target,
            ray,
            transmission,
            &origin);
}

inline const ShadingPoint& Tracer::trace_between_full(
    const ShadingContext&               shading_context,
    const foundation::Vector3d&         origin,
    const foundation::Vector3d&         target,
    const ShadingRay&                   parent_ray,
    const VisibilityFlags::Type         ray_flags,
    Spectrum&                           transmission)
{
    const double dist = foundation::norm(target - origin);

    ShadingRay ray(
        origin,
        (target - origin) / dist,
        0.0,
        dist * (1.0 - 1.0e-6),
        parent_ray.m_time,
        ray_flags,
        parent_ray.m_depth + 1);

    ray.copy_media_from(parent_ray);

    return
        do_trace_between(
            shading_context,
            target,
            ray,
            transmission,
            nullptr);
}

inline const ShadingPoint& Tracer::trace_between_full(
    const ShadingContext&               shading_context,
    const foundation::Vector3d&         origin,
    const foundation::Vector3d&         target,
    const ShadingRay::Time&             ray_time,
    const VisibilityFlags::Type         ray_flags,
    const ShadingRay::DepthType         ray_depth,
    Spectrum&                           transmission)
{
    const double dist = foundation::norm(target - origin);

    const ShadingRay ray(
        origin,
        (target - origin) / dist,
        dist * 1.0e-6,
        dist * (1.0 - 1.0e-6),
        ray_time,
        ray_flags,
        ray_depth + 1);

    return
        do_trace_between(
            shading_context,
            target,
            ray,
            transmission,
            nullptr);
}

}       // namespace renderer

#endif  // !APPLESEED_RENDERER_KERNEL_LIGHTING_TRACER_H


text:
#ifndef ARRAY_H
#define ARRAY_H

#include <stdlib.h>
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#ifdef HAVE_PCRE_H
# include <pcre.h>
#endif
#include "buffer.h"

#define DATA_IS_STRING(x) (x->type == TYPE_STRING)

typedef enum { TYPE_UNSET, TYPE_STRING, TYPE_COUNT, TYPE_ARRAY, TYPE_INTEGER, TYPE_FASTCGI, TYPE_CONFIG } data_type_t;
#define DATA_UNSET \
	data_type_t type; \
	buffer *key; \
	int is_index_key; /* 1 if key is a array index (autogenerated keys) */ \
	struct data_unset *(*copy)(const struct data_unset *src); \
	void (* free)(struct data_unset *p); \
	void (* reset)(struct data_unset *p); \
	int (*insert_dup)(struct data_unset *dst, struct data_unset *src); \
	void (*print)(const struct data_unset *p, int depth)

typedef struct data_unset {
	DATA_UNSET;
} data_unset;

typedef struct {
	data_unset  **data;

	size_t *sorted;

	size_t used;
	size_t size;

	size_t unique_ndx;

	size_t next_power_of_2;
	int is_weakref; /* data is weakref, don't bother the data */
} array;

typedef struct {
	DATA_UNSET;

	int count;
} data_count;

data_count *data_count_init(void);

typedef struct {
	DATA_UNSET;

	buffer *value;
} data_string;

data_string *data_string_init(void);
data_string *data_response_init(void);

typedef struct {
	DATA_UNSET;

	array *value;
} data_array;

data_array *data_array_init(void);

/**
 * possible compare ops in the configfile parser
 */
typedef enum {
	CONFIG_COND_UNSET,
	CONFIG_COND_EQ,      /** == */
	CONFIG_COND_MATCH,   /** =~ */
	CONFIG_COND_NE,      /** != */
	CONFIG_COND_NOMATCH  /** !~ */
} config_cond_t;

/**
 * possible fields to match against
 */
typedef enum {
	COMP_UNSET,
	COMP_SERVER_SOCKET,
	COMP_HTTP_URL,
	COMP_HTTP_HOST,
	COMP_HTTP_REFERER,
	COMP_HTTP_USERAGENT,
	COMP_HTTP_COOKIE,
	COMP_HTTP_REMOTEIP,
	COMP_HTTP_QUERYSTRING,

	COMP_LAST_ELEMENT
} comp_key_t;

/* $HTTP["host"] ==    "incremental.home.kneschke.de" { ... }
 * for print:   comp_key      op    string
 * for compare: comp          cond  string/regex
 */

typedef struct _data_config data_config;
struct _data_config {
	DATA_UNSET;

	array *value;

	buffer *comp_key;
	comp_key_t comp;

	config_cond_t cond;
	buffer *op;

	int context_ndx; /* more or less like an id */
	array *childs;
	/* nested */
	data_config *parent;
	/* for chaining only */
	data_config *prev;
	data_config *next;

	buffer *string;
#ifdef HAVE_PCRE_H
	pcre   *regex;
	pcre_extra *regex_study;
#endif
};

data_config *data_config_init(void);

typedef struct {
	DATA_UNSET;

	int value;
} data_integer;

data_integer *data_integer_init(void);

typedef struct {
	DATA_UNSET;

	buffer *host;

	unsigned short port;

	time_t disable_ts;
	int is_disabled;
	size_t balance;

	int usage; /* fair-balancing needs the no. of connections active on this host */
	int last_used_ndx; /* round robin */
} data_fastcgi;

data_fastcgi *data_fastcgi_init(void);

array *array_init(void);
array *array_init_array(array *a);
void array_free(array *a);
void array_reset(array *a);
int array_insert_unique(array *a, data_unset *str);
data_unset *array_pop(array *a);
int array_print(array *a, int depth);
data_unset *array_get_unused_element(array *a, data_type_t t);
data_unset *array_get_element(array *a, const char *key);
data_unset *array_replace(array *a, data_unset *du);
int array_strcasecmp(const char *a, size_t a_len, const char *b, size_t b_len);
void array_print_indent(int depth);
size_t array_get_max_key_length(array *a);

#endif


text:
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >

    <item android:drawable="@drawable/material_design_background_button">
    </item>
    <item android:id="@+id/shape_bacground">
        <shape android:shape="rectangle" >
            <corners android:radius="2dp" />

            <solid android:color="#FFF" />
        </shape>
    </item>

</layer-list>


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
package com.azure.resourcemanager.eventhubs.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.http.rest.PagedFlux;
import com.azure.core.http.rest.PagedIterable;
import com.azure.resourcemanager.eventhubs.EventHubsManager;
import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingById;
import com.azure.resourcemanager.resources.fluentcore.arm.models.HasManager;
import com.azure.resourcemanager.resources.fluentcore.collection.SupportsCreating;
import com.azure.resourcemanager.resources.fluentcore.collection.SupportsDeletingById;
import reactor.core.publisher.Mono;

/**
 * Entry point to manage event hub consumer groups.
 */
@Fluent
public interface EventHubConsumerGroups extends
    SupportsCreating<EventHubConsumerGroup.DefinitionStages.Blank>,
    SupportsDeletingById,
    SupportsGettingById<EventHubConsumerGroup>,
    HasManager<EventHubsManager> {
    /**
     * Lists the consumer groups of an event hub in a namespace under a resource group.
     *
     * @param resourceGroupName namespace resource group name
     * @param namespaceName event hub parent namespace name
     * @param eventHubName event hub name
     * @return list of consumer groups
     */
    PagedIterable<EventHubConsumerGroup> listByEventHub(
        String resourceGroupName, String namespaceName, String eventHubName);

    /**
     * Lists the consumer groups of an event hub in a namespace under a resource group.
     *
     * @param resourceGroupName namespace resource group name
     * @param namespaceName event hub parent namespace name
     * @param eventHubName event hub name
     * @return observable that emits the consumer groups
     */
    PagedFlux<EventHubConsumerGroup> listByEventHubAsync(
        String resourceGroupName, String namespaceName, String eventHubName);

    /**
     * Gets a consumer group of an event hub in a namespace in a resource group.
     *
     * @param resourceGroupName namespace resource group name
     * @param namespaceName event hub parent namespace name
     * @param eventHubName event hub name
     * @param name consumer group name
     * @return observable that emits the consumer group
     */
    Mono<EventHubConsumerGroup> getByNameAsync(
        String resourceGroupName, String namespaceName, String eventHubName, String name);

    /**
     * Gets a consumer group of an event hub in a namespace under a resource group.
     *
     * @param resourceGroupName namespace resource group name
     * @param namespaceName event hub parent namespace name
     * @param eventHubName event hub name
     * @param name consumer group name
     * @return the consumer group
     */
    EventHubConsumerGroup getByName(
        String resourceGroupName, String namespaceName, String eventHubName, String name);

    /**
     * Deletes a consumer group of an event hub in a namespace under a resource group.
     *
     * @param resourceGroupName namespace resource group name
     * @param namespaceName event hub parent namespace name
     * @param eventHubName event hub name
     * @param name consumer group name
     * @return the completable representing the task
     */
    Mono<Void> deleteByNameAsync(
        String resourceGroupName, String namespaceName, String eventHubName, String name);

    /**
     * Deletes a consumer group of an event hub in a namespace under a resource group.
     *
     * @param resourceGroupName namespace resource group name
     * @param namespaceName event hub parent namespace name
     * @param eventHubName event hub name
     * @param name consumer group name
     */
    void deleteByName(
        String resourceGroupName, String namespaceName, String eventHubName, String name);
}


text:
<!DOCTYPE html >

          <meta http-equiv="X-UA-Compatible" content="IE=edge" />
          <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
          <title></title>
          <meta name="description" content="" />
          <meta name="keywords" content="" />
          <meta http-equiv="content-type" content="text/html; charset=UTF-8" />

      <link href="../lib/index.css" media="screen" type="text/css" rel="stylesheet" />
      <link href="../lib/template.css" media="screen" type="text/css" rel="stylesheet" />
      <link href="../lib/diagrams.css" media="screen" type="text/css" rel="stylesheet" id="diagrams-css" />

        < Back

            <input autocapitalize="none" placeholder="Search" id="index-input" type="text" accesskey="/" />
            
            

Packages

        

        package

              root

Definition Classes

root

        

        package

              collection

Definition Classes

root

                          FeatureSet

                          GTF22FeatureSet

t

collection

FeatureSet

        

        trait

        FeatureSet[T <: Feature] extends AnyRef

A data structure storing a set of Features.

Supports common operations on collections of genomic features, such as extracting overlappers
of a given locus, and some common collection operations such as contains.

T

The type of Features contained in the set

            Linear Supertypes

AnyRef, Any

              Known Subclasses

GTF22FeatureSet

          

            <input id="mbrsel-input" placeholder="Filter all members" type="text" accesskey="/" />

          

            Ordering

Alphabetic

By Inheritance

                  Inherited

FeatureSet

AnyRef

Any

Hide All

Show All

              Visibility

Public

All

Abstract Value Members

        

        abstract
        def

        contains(t: T): Boolean

Returns a boolean value representing whether this set contains the given Feature.

Returns a boolean value representing whether this set contains the given Feature.

t

Feature to look for

        

        abstract
        def

        iterator: Iterator[T]

Returns an iterator over the entire set.

Returns an iterator over the entire set.

The returned iterator is not guaranteed to conform to any particular ordering.

returns

Iterator over the set in no particular order

        

        abstract
        def

        nearest(chr: String, start: Int, end: Int): Iterator[T]

Returns an iterator over the nearest Features to a genomic interval.

Returns an iterator over the nearest Features to a genomic interval.

If this set contains one or more Features whose span (including introns) overlaps the given interval,
an iterator over those overlappers is returned.

Otherwise, all Features tied for the minimum distance are returned. Distance is defined
as in Feature.distance.

Orientation is ignored.

The returned iterator is not guaranteed to conform to any particular ordering.

chr

Chromosome name of query interval

start

Zero-based inclusive start position of query interval

end

Zero-based exclusive end position of query interval

returns

Iterator over nearest Features in no particular order, or Iterator.empty
        if there are no Features on the chromosome

        

        abstract
        def

        overlappers(feat: Feature): Iterator[T]

Returns an iterator over overlappers of a given Feature.

Returns an iterator over overlappers of a given Feature.

Overlappers are the Features contained in this set that overlap the given
Feature as defined by Feature.overlaps.

The returned iterator is not guaranteed to conform to any particular ordering.

feat

Query Feature

returns

Iterator over overlappers of the given Feature in no particular order,
        or Iterator.empty if there are no overlappers

        

        abstract
        def

        overlappers(chr: String, start: Int, end: Int, orientation: Orientation): Iterator[T]

Returns an iterator over overlappers of a genomic interval.

Returns an iterator over overlappers of a genomic interval.

Overlappers are the Features contained in this set that overlap the interval
accounting for Orientation, as defined by Feature.overlaps.

The returned iterator is not guaranteed to conform to any particular ordering.

chr

Chromosome name of query interval

start

Zero-based inclusive start position of query interval

end

Zero-based exclusive end position of query interval

orientation

Orientation of query interval. Only overlappers with a compatible
                   Orientation (as defined by Orientation.isCompatible) will
                   be returned.

returns

Iterator over overlappers in no particular order, or Iterator.empty if
        there are no overlappers

        

        abstract
        def

        overlappersSpan(feat: Feature): Iterator[T]

Returns an iterator over Ts whose span overlaps that of a given Feature.

Returns an iterator over Ts whose span overlaps that of a given Feature.

Overlappers are the Features contained in this set whose span overlaps that of
the given Feature as defined by Feature.overlapsSpan.

The returned iterator is not guaranteed to conform to any particular ordering.

feat

Query Feature

returns

Iterator over span overlappers of the given Feature in no particular order,
        or Iterator.empty if there are none

        

        abstract
        def

        overlappersSpan(chr: String, start: Int, end: Int, orientation: Orientation): Iterator[T]

Returns an iterator over Ts whose span overlaps a genomic interval.

Returns an iterator over Ts whose span overlaps a genomic interval.

Overlappers are the Features contained in this set whose span overlaps the interval
accounting for Orientation, as defined by Feature.overlapsSpan.

The returned iterator is not guaranteed to conform to any particular ordering.

chr

Chromosome name of query interval

start

Zero-based inclusive start position of query interval

end

Zero-based exclusive end position of query interval

orientation

Orientation of query interval. Only overlappers with a compatible
                   Orientation (as defined by Orientation.isCompatible) will
                   be returned.

returns

Iterator over span overlappers in no particular order, or Iterator.empty if
        there are none

        

        abstract
        val

        size: Long

The number of features contained in this set.

Concrete Value Members

        

        final
        def

        !=(arg0: Any): Boolean

Definition Classes

AnyRef → Any

        

        final
        def

        ##(): Int

Definition Classes

AnyRef → Any

        

        final
        def

        ==(arg0: Any): Boolean

Definition Classes

AnyRef → Any

        

        final
        def

        asInstanceOf[T0]: T0

Definition Classes

Any

        

        def

        clone(): AnyRef

Attributes

protected[java.lang]

Definition Classes

AnyRef

Annotations

                @throws(

      ...
    )

        

        final
        def

        eq(arg0: AnyRef): Boolean

Definition Classes

AnyRef

        

        def

        equals(arg0: Any): Boolean

Definition Classes

AnyRef → Any

        

        def

        finalize(): Unit

Attributes

protected[java.lang]

Definition Classes

AnyRef

Annotations

                @throws(

      classOf[java.lang.Throwable]
    )

        

        final
        def

        getClass(): Class[_]

Definition Classes

AnyRef → Any

        

        def

        hashCode(): Int

Definition Classes

AnyRef → Any

        

        final
        def

        isInstanceOf[T0]: Boolean

Definition Classes

Any

        

        final
        def

        ne(arg0: AnyRef): Boolean

Definition Classes

AnyRef

        

        def

        nearest(feat: Feature): Iterator[T]

Returns an iterator over the nearest Features to a given Feature.

Returns an iterator over the nearest Features to a given Feature.

If this set contains one or more Features whose span (including introns) overlaps the span
(including introns) of the given Feature, an iterator over those overlappers is returned.

Otherwise, all Features tied for the minimum distance are returned. Distance is defined
as in Feature.distance.

Orientation is ignored.

The returned iterator is not guaranteed to conform to any particular ordering.

feat

Query Feature

returns

Iterator over nearest Features in no particular order, or Iterator.empty
        if there are no Features on the chromosome

        

        final
        def

        notify(): Unit

Definition Classes

AnyRef

        

        final
        def

        notifyAll(): Unit

Definition Classes

AnyRef

        

        final
        def

        synchronized[T0](arg0: ⇒ T0): T0

Definition Classes

AnyRef

        

        def

        toString(): String

Definition Classes

AnyRef → Any

        

        final
        def

        wait(): Unit

Definition Classes

AnyRef

Annotations

                @throws(

      ...
    )

        

        final
        def

        wait(arg0: Long, arg1: Int): Unit

Definition Classes

AnyRef

Annotations

                @throws(

      ...
    )

        

        final
        def

        wait(arg0: Long): Unit

Definition Classes

AnyRef

Annotations

                @throws(

      ...
    )

Inherited from AnyRef

Inherited from Any

Ungrouped


text:
import type { RGBA } from './interfaces.js'

export function rgbaString(rgba: RGBA) {
  return 'rgba(' + rgba.join(',') + ')';
}


text:
package com.github.skjolber.nfc.acs;

public class AcrReaderException extends RuntimeException {

	private static final long serialVersionUID = 1L;

	public AcrReaderException() {
		super();
	}

	public AcrReaderException(String detailMessage, Throwable throwable) {
		super(detailMessage, throwable);
	}

	public AcrReaderException(String detailMessage) {
		super(detailMessage);
	}

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

}


text:
/**
 * Module dependencies.
 */

var jade = require('..')
  , fs = require('fs')
  , read = fs.readFileSync;

var str = read('testing/index.jade', 'utf8');

var fn = jade.compile(str, { pretty: true, debug: true, compileDebug: false, filename: 'testing/index.jade' });

console.log(fn());


text:
using UnityEngine;

namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityGameObject
{
    [TaskCategory("Basic/GameObject")]
    [TaskDescription("Finds a GameObject by name. Returns Success.")]
    public class Find : Action
    {
        [Tooltip("The GameObject name to find")]
        public SharedString gameObjectName;
        [Tooltip("The object found by name")]
        [RequiredField]
        public SharedGameObject storeValue;

        public override TaskStatus OnUpdate()
        {
            storeValue.Value = GameObject.Find(gameObjectName.Value);

            return TaskStatus.Success;
        }

        public override void OnReset()
        {
            gameObjectName = null;
            storeValue = null;
        }
    }
}