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

namespace Cake\Test\TestCase\Collection\Iterator;

use ArrayIterator;
use Cake\Collection\Iterator\MapReduce;
use Cake\TestSuite\TestCase;
use LogicException;

/**
 * Tests MapReduce class
 */
class MapReduceTest extends TestCase
{
    /**
     * Tests the creation of an inversed index of words to documents using
     * MapReduce
     */
    public function testInvertedIndexCreation(): void
    {
        $data = [
            'document_1' => 'Dogs are the most amazing animal in history',
            'document_2' => 'History is not only amazing but boring',
            'document_3' => 'One thing that is not boring is dogs',
        ];
        $mapper = function ($row, $document, $mr): void {
            $words = array_map('strtolower', explode(' ', $row));
            foreach ($words as $word) {
                $mr->emitIntermediate($document, $word);
            }
        };
        $reducer = function ($documents, $word, $mr): void {
            $mr->emit(array_unique($documents), $word);
        };
        $results = new MapReduce(new ArrayIterator($data), $mapper, $reducer);
        $expected = [
            'dogs' => ['document_1', 'document_3'],
            'are' => ['document_1'],
            'the' => ['document_1'],
            'most' => ['document_1'],
            'amazing' => ['document_1', 'document_2'],
            'animal' => ['document_1'],
            'in' => ['document_1'],
            'history' => ['document_1', 'document_2'],
            'is' => ['document_2', 'document_3'],
            'not' => ['document_2', 'document_3'],
            'only' => ['document_2'],
            'but' => ['document_2'],
            'boring' => ['document_2', 'document_3'],
            'one' => ['document_3'],
            'thing' => ['document_3'],
            'that' => ['document_3'],
        ];
        $this->assertEquals($expected, iterator_to_array($results));
    }

    /**
     * Tests that it is possible to use the emit function directly in the mapper
     */
    public function testEmitFinalInMapper(): void
    {
        $data = ['a' => ['one', 'two'], 'b' => ['three', 'four']];
        $mapper = function ($row, $key, $mr): void {
            foreach ($row as $number) {
                $mr->emit($number);
            }
        };
        $results = new MapReduce(new ArrayIterator($data), $mapper);
        $expected = ['one', 'two', 'three', 'four'];
        $this->assertEquals($expected, iterator_to_array($results));
    }

    /**
     * Tests that a reducer is required when there are intermediate results
     */
    public function testReducerRequired(): void
    {
        $this->expectException(LogicException::class);
        $data = ['a' => ['one', 'two'], 'b' => ['three', 'four']];
        $mapper = function ($row, $key, $mr): void {
            foreach ($row as $number) {
                $mr->emitIntermediate('a', $number);
            }
        };
        $results = new MapReduce(new ArrayIterator($data), $mapper);
        iterator_to_array($results);
    }
}


text:
package com.github.weisj.darklaf.ui.demo;

import javax.swing.JComponent;

public interface SpecBinding<T> {

    T get(final JComponent component);

    void set(final JComponent component, final T value);
}

redpajama_set_name: RedPajamaGithub


text:
ACCEPTED

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

#### Published in
Akad. Nauk Estonskoi S. S. R. , Inst. Zool. Bot. , Tartu 72 (1970)

#### Original name
Octospora nivea R. Hedw., 1802

### Remarks
null


text:
<?php

/**
 * @file
 * Contains \Drupal\Core\Entity\EntityFormInterface.
 */

namespace Drupal\Core\Entity;

use Drupal\Core\Extension\ModuleHandlerInterface;
use Drupal\Core\Form\BaseFormIdInterface;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\Core\StringTranslation\TranslationInterface;

/**
 * Defines an interface for entity form classes.
 */
interface EntityFormInterface extends BaseFormIdInterface {

  /**
   * Sets the operation for this form.
   *
   * @param string $operation
   *   The name of the current operation.
   *
   * @return $this
   */
  public function setOperation($operation);

  /**
   * Gets the operation identifying the form.
   *
   * @return string
   *   The name of the operation.
   */
  public function getOperation();

  /**
   * Gets the form entity.
   *
   * The form entity which has been used for populating form element defaults.
   *
   * @return \Drupal\Core\Entity\EntityInterface
   *   The current form entity.
   */
  public function getEntity();

  /**
   * Sets the form entity.
   *
   * Sets the form entity which will be used for populating form element
   * defaults. Usually, the form entity gets updated by
   * \Drupal\Core\Entity\EntityFormInterface::submit(), however this may
   * be used to completely exchange the form entity, e.g. when preparing the
   * rebuild of a multi-step form.
   *
   * @param \Drupal\Core\Entity\EntityInterface $entity
   *   The entity the current form should operate upon.
   *
   * @return $this
   */
  public function setEntity(EntityInterface $entity);

  /**
   * Determines which entity will be used by this form from a RouteMatch object.
   *
   * @param \Drupal\Core\Routing\RouteMatchInterface $route_match
   *   The route match.
   * @param string $entity_type_id
   *   The entity type identifier.
   *
   * @return \Drupal\Core\Entity\EntityInterface
   *   The entity object as determined from the passed-in route match.
   */
  public function getEntityFromRouteMatch(RouteMatchInterface $route_match, $entity_type_id);

  /**
   * Builds an updated entity object based upon the submitted form values.
   *
   * For building the updated entity object the form's entity is cloned and
   * the submitted form values are copied to entity properties. The form's
   * entity remains unchanged.
   *
   * @see \Drupal\Core\Entity\EntityFormInterface::getEntity()
   *
   * @param array $form
   *   A nested array form elements comprising the form.
   * @param \Drupal\Core\Form\FormStateInterface $form_state
   *   The current state of the form.
   *
   * @return \Drupal\Core\Entity\EntityInterface
   *   An updated copy of the form's entity object.
   */
  public function buildEntity(array $form, FormStateInterface $form_state);

  /**
   * Form submission handler for the 'save' action.
   *
   * Normally this method should be overridden to provide specific messages to
   * the user and redirect the form after the entity has been saved.
   *
   * @param array $form
   *   An associative array containing the structure of the form.
   * @param \Drupal\Core\Form\FormStateInterface $form_state
   *   The current state of the form.
   *
   * @return int
   *   Either SAVED_NEW or SAVED_UPDATED, depending on the operation performed.
   */
  public function save(array $form, FormStateInterface $form_state);

  /**
   * Sets the string translation service for this form.
   *
   * @param \Drupal\Core\StringTranslation\TranslationInterface $string_translation
   *   The translation manager.
   *
   * @return $this
   */
  public function setStringTranslation(TranslationInterface $string_translation);

  /**
   * Sets the module handler for this form.
   *
   * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
   *   The module handler.
   *
   * @return $this
   */
  public function setModuleHandler(ModuleHandlerInterface $module_handler);

  /**
   * Sets the entity manager for this form.
   *
   * @param \Drupal\Core\Entity\EntityManagerInterface $entity_manager
   *   The entity manager.
   *
   * @return $this
   *
   * @deprecated in Drupal 8.0.0, will be removed before Drupal 9.0.0.
   *
   * @todo Remove this set call in https://www.drupal.org/node/2603542.
   */
  public function setEntityManager(EntityManagerInterface $entity_manager);

  /**
   * Sets the entity type manager for this form.
   *
   * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager
   *   The entity type manager.
   *
   * @return $this
   */
  public function setEntityTypeManager(EntityTypeManagerInterface $entity_type_manager);

}


text:
{% extends 'comm/emails/base.html' -%}

{% block content %}
{{ app.name }} has been escalated for an admin review by a reviewer.

Your app is now in our escalated review queue, and it will need to be checked by one of our senior comm. This means that your review will probably take longer than usual. You don't need to take any further action - we will contact you if any more information is required from you. Thanks for your understanding.

{% include 'comm/emails/includes/questions.html' %}
{% endblock %}


text:
(function(app){

    var ctrl = function(){
        var self = this;
        this.delete_db = function(){
            //app.db.delete();
            indoor.deleteDb();
            app.LogModel.Log('Db deleted');
        };
        this.delete_wifi = function(){
            indoor.deleteWifi(app.log);
        };
        this.clearLog = function(){
            app.LogModel.logs.length = 0;
        };
        this.clearLocalStorage = function(){
            localStorage.clear();
        };
        this.clearKey = function(){
            localStorage.removeItem('APIKEY');
        };
        this.toggle = function(){
            app.local(!app.local());
        };
        this.logs = app.LogModel.logs;
    };

    var view = function(ctrl){
        return [
            m('a', {class: 'waves-effect waves-light btn', onclick: ctrl.delete_db}, 'Delete DB'),
            m('a', {class: 'waves-effect waves-light btn', onclick: ctrl.delete_wifi}, 'Reset wifi data'),
            m('a', {class: 'waves-effect waves-light btn', onclick: ctrl.clearLog}, 'Clear Log'),
            m('a', {class: 'waves-effect waves-light btn', onclick: ctrl.clearLocalStorage}, 'Clear Storage'),
            m('a', {class: 'waves-effect waves-light btn', onclick: ctrl.clearKey}, 'Clear API key'),
            m('p', [
                m('input#local[type=checkbox]', {onchange: ctrl.toggle, checked: app.local()}),
                m('label', {for: 'local'}, 'Local Training')
            ]),
            m('div.range-field', [
                m('input#freq[type=range]', {min: 100, max:5000, step: 100, value: app.freq(), onchange: m.withAttr('value', app.freq)}),
            ]),
            m('div', app.freq()),
            m('label', {for: 'freq'}, 'Polling Freq'),
            m('div.log_list', [
                ctrl.logs.map(function(item){
                    return m('p', item);
                })
            ])
        ];
    };

    var component = {
        controller: ctrl,
        view: view
    };

    app.Page2 = component;
})(app = window.app || {});


text:
<?php

namespace Elmet\AdminBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Elmet\SiteBundle\Entity\CurtainTieBack;
use Elmet\AdminBundle\Entity\TieBackSize;
use Elmet\AdminBundle\Entity\TieBackType;
use Symfony\Component\HttpFoundation\Response;

class TieBackController extends Controller
{
    public function viewAction()
    {
        $repository = $this->getDoctrine()->getRepository('ElmetSiteBundle:CurtainPriceBand');
        $curtainPriceBands = $repository->findAll();

        $repository = $this->getDoctrine()->getRepository('ElmetSiteBundle:CurtainTieBack');
        $tiebacks = $repository->findAll();

        $tiebackSizes = array(new TieBackSize(19),new TieBackSize(26),new TieBackSize(36));
        $tiebackTypes = array(new TieBackType("HomeWindow"),new TieBackType("CaravanWindow"));

        return $this->render('ElmetAdminBundle:TieBack:index.html.twig', array('tiebacks' => $tiebacks, 'curtainPriceBands' => $curtainPriceBands, 'tiebackSizes' => $tiebackSizes, 'tiebackTypes' => $tiebackTypes));

        }

    public function removeAction($id)
    {
        $repository = $this->getDoctrine()->getRepository('ElmetSiteBundle:CurtainTieBack');
        $tieback = $repository->findOneById($id);

        $em = $this->getDoctrine()->getEntityManager();
        $em->remove($tieback);
        $em->flush();

        return $this->viewAction();
    }

    public function updateAction()
    {

        if($this->getRequest()->get('save_new') != null){

            $repository = $this->getDoctrine()->getRepository('ElmetSiteBundle:CurtainPriceBand');
            $curtainPriceBand = $repository->findOneById($this->getRequest()->get('priceband_new'));

            $tieback = new CurtainTieBack();

            $tieback->setCurtainPriceBand($curtainPriceBand);
            $tieback->setSize($this->getRequest()->get('size_new'));
            $tieback->setPrice($this->getRequest()->get('price_new'));
            $tieback->setType($this->getRequest()->get('type_new'));

            $em = $this->getDoctrine()->getEntityManager();
            $em->persist($tieback);
            $em->flush();

        } else {

            if ($this->getRequest()->get('submit_all') != null) {

                $tiebackRepository = $this->getDoctrine()->getRepository('ElmetSiteBundle:CurtainTieBack');
                $priceBandRepository = $this->getDoctrine()->getRepository('ElmetSiteBundle:CurtainPriceBand');

                $tiebacks = $tiebackRepository->findAll();

                foreach($tiebacks as $tieback) {

                    $curtainPriceBand = $priceBandRepository->findOneById($this->getRequest()->get('all:priceband_'.$tieback->getId()));

                    $tieback->setCurtainPriceBand($curtainPriceBand);
                    $tieback->setSize($this->getRequest()->get('all:size_'.$tieback->getId()));
                    $tieback->setPrice($this->getRequest()->get('all:price_'.$tieback->getId()));
                    $tieback->setType($this->getRequest()->get('all:type_'.$tieback->getId()));

                    $em = $this->getDoctrine()->getEntityManager();
                    $em->merge($tieback);
                }

                $em->flush();

            } else {

                $params = $this->getRequest()->request->all();
                $keys = array_keys($params);
                $tieback_id = 0;

                foreach($keys as $key) {
                    $param = $params[$key];

                    if($param=='Save') {
                       $index = stripos($key,'_');
                       $tieback_id = substr($key,$index+1);
                    }
                }

                if ($tieback_id != 0) {

                    $repository = $this->getDoctrine()->getRepository('ElmetSiteBundle:CurtainTieBack');
                    $tieback = $repository->findOneById($tieback_id);

                    $repository = $this->getDoctrine()->getRepository('ElmetSiteBundle:CurtainPriceBand');
                    $curtainPriceBand = $repository->findOneById($this->getRequest()->get('single:priceband_'.$tieback_id));

                    $tieback->setCurtainPriceBand($curtainPriceBand);
                    $tieback->setSize($this->getRequest()->get('single:size_'.$tieback_id));
                    $tieback->setPrice($this->getRequest()->get('single:price_'.$tieback_id));
                    $tieback->setType($this->getRequest()->get('single:type_'.$tieback_id));

                    $em = $this->getDoctrine()->getEntityManager();
                    $em->merge($tieback);
                    $em->flush();
                }
            }

        }

        return $this->viewAction();
    }
}


text:
/*global QUnit */
/*eslint no-undef:1, no-unused-vars:1, strict: 1 */
sap.ui.define([
	"sap/ui/qunit/utils/createAndAppendDiv",
	"sap/ui/core/Core",
	"sap/ui/webc/main/MessageStrip",
	"sap/ui/webc/main/Icon"
], function(createAndAppendDiv, Core, MessageStrip, Icon) {
	"use strict";

	createAndAppendDiv("uiArea");

	QUnit.module("Rendering", {
		beforeEach: function() {
			this.oMessageStrip = new MessageStrip({
				text: "Some text...",
				icon: new Icon({
					color: "blue",
					name: "add",
					click: function(oEvent) {
						// console.log("Event click fired for Icon with parameters: ", oEvent.getParameters());
					}
				}),
				close: function(oEvent) {
					// console.log("Event close fired for MessageStrip with parameters: ", oEvent.getParameters());
				}
			});
			this.oMessageStrip.placeAt("uiArea");
			Core.applyChanges();
		},
		afterEach: function() {
			this.oMessageStrip.destroy();
			this.oMessageStrip = null;
		}
	});

	QUnit.test("Should render", function(assert) {
		assert.ok(this.oMessageStrip.$(), "Rendered");
	});
});


text:
<html>
<head>
  <title>The source code</title>
    <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
    <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
</head>
<body  onload="prettyPrint();">
    <pre class="prettyprint lang-js">Ext.onReady(function(){

    // create the Data Store
    var store = new Ext.data.Store({
        // load using HTTP
        url: 'sheldon.xml',

        // the return will be XML, so lets set up a reader
        reader: new Ext.data.XmlReader({
               // records will have an "Item" tag
               record: 'Item',
               id: 'ASIN',
               totalRecords: '@total'
           }, [
               // set up the fields mapping into the xml doc
               // The first needs mapping, the others are very basic
               {name: 'Author', mapping: 'ItemAttributes > Author'},
               'Title', 'Manufacturer', 'ProductGroup'
           ])
    });

    // create the grid
    var grid = new Ext.grid.GridPanel({
        store: store,
        columns: [
            {header: "Author", width: 120, dataIndex: 'Author', sortable: true},
            {header: "Title", width: 180, dataIndex: 'Title', sortable: true},
            {header: "Manufacturer", width: 115, dataIndex: 'Manufacturer', sortable: true},
            {header: "Product Group", width: 100, dataIndex: 'ProductGroup', sortable: true}
        ],
        renderTo:'example-grid',
        width:540,
        height:200
    });

    store.load();
});
</pre>
</body>
</html>


text:
namespace Dapper.FastCrud.SqlBuilders
{
    using System;
    using System.Globalization;
    using System.Linq;
    using Dapper.FastCrud.EntityDescriptors;
    using Dapper.FastCrud.Mappings;

    internal class MySqlBuilder:GenericStatementSqlBuilder
    {
        public MySqlBuilder(EntityDescriptor entityDescriptor, EntityMapping entityMapping)
            : base(entityDescriptor, entityMapping, SqlDialect.MySql)
        {
        }

        /// <summary>
        /// Constructs a full insert statement
        /// </summary>
        protected override string ConstructFullInsertStatementInternal()
        {
            var sql = this.ResolveWithCultureInvariantFormatter(
                    $"INSERT INTO {this.GetTableName()} ({this.ConstructColumnEnumerationForInsert()}) VALUES ({this.ConstructParamEnumerationForInsert()}); ");

            if (this.RefreshOnInsertProperties.Length > 0)
            {
                // we have to bring some column values back
                if (this.InsertKeyDatabaseGeneratedProperties.Length == 0)
                {
                    throw new NotSupportedException($"Entity '{this.EntityMapping.EntityType.Name}' has database generated fields that don't contain a primary key.");
                }

                // we have an identity column, so we can fetch the rest of them
                if (this.InsertKeyDatabaseGeneratedProperties.Length == 1 && this.RefreshOnInsertProperties.Length == 1)
                {
                    // just one, this is going to be easy
                    sql += this.ResolveWithCultureInvariantFormatter($"SELECT LAST_INSERT_ID() as {this.GetDelimitedIdentifier(this.InsertKeyDatabaseGeneratedProperties[0].PropertyName)}");
                }
                else
                {
                    var databaseGeneratedColumnSelection = string.Join(
                        ",",
                        this.RefreshOnInsertProperties.Select(
                            propInfo =>
                            $"{this.GetColumnName(propInfo, null, true)}"));
                    sql += this.ResolveWithCultureInvariantFormatter($"SELECT {databaseGeneratedColumnSelection} FROM {this.GetTableName()} WHERE {this.GetColumnName(this.InsertKeyDatabaseGeneratedProperties[0], null, false)} = LAST_INSERT_ID()");
                }
            }
            return sql;
        }

        /// <summary>
        /// Constructs a full batch select statement
        /// </summary>
        protected override string ConstructFullBatchSelectStatementInternal(
            FormattableString whereClause = null,
            FormattableString orderClause = null,
            long? skipRowsCount = null,
            long? limitRowsCount = null,
            object queryParameters = null)
        {
            var sql = this.ResolveWithCultureInvariantFormatter($"SELECT {this.ConstructColumnEnumerationForSelect()} FROM {this.GetTableName()}");

            if (whereClause != null)
            {
                sql += string.Format(this.StatementFormatter, " WHERE {0}", whereClause);
            }
            if (orderClause != null)
            {
                sql += string.Format(this.StatementFormatter, " ORDER BY {0}", orderClause);
            }

            if (skipRowsCount.HasValue)
            {
                sql += string.Format(CultureInfo.InvariantCulture, " LIMIT {0},{1}", skipRowsCount, limitRowsCount ?? (int?)int.MaxValue);
            }
            else if (limitRowsCount.HasValue)
            {
                sql += string.Format(CultureInfo.InvariantCulture, " LIMIT {0}", limitRowsCount);
            }

            return sql;
        }
    }
}


text:
<?php echo lang('Manage SSL') ?>

                                                <table id="ssllist" class="table table-striped table-hover"
                                                   data-toolbar="#toolbar"
                                                   data-search="true"
                                                   data-show-refresh="true"
                                                   data-show-toggle="true"
                                                   data-show-export="true"
                                                   data-minimum-count-columns="2"
                                                   data-show-pagination-switch="true"
                                                   data-pagination="true"
                                                   data-id-field="id"
                                                   data-page-list="[10, 25, 50, 100, ALL]"
                                                   data-show-footer="false"
                                                   data-url="/domain/getAllDomains"
                                                   data-pagination="true"
                                                   data-side-pagination="server">

PROCESSING. PLEASE WAIT...


text:
export webc_id=just_testing
homepage=http://example.com
while true
do
	echo Launching $homepage
	homepage="$(./wsc surf2 $homepage)"
	echo cycle
done


text:
using UnityEngine;
using System.Collections;

public class QuickSwitcher : MonoBehaviour {

	public bool m_enabled = false;
	[SerializeField]
	private float m_minProgressToStartTransition;
	[SerializeField]
	private float m_percentageToLockTransition;
	[SerializeField]
	private Vector3 m_wipeOutPosition;

	private Vector3 m_startPosition;

	private enum TransitionState { ON, OFF, MANUAL, TWEENING };
	private TransitionState m_currentTransitionState;
	// Know what the last locked state was so we know what we're transitioning to.
	private TransitionState m_lastLockedState;

	// Where are we transitioning to and from
	private Vector3 m_from;
	private Vector3 m_to;

	private delegate void TweenCompleteDelegate();

	// Use this for initialization
	void Start () {
		m_startPosition = transform.localPosition;
		m_wipeOutPosition = m_startPosition + m_wipeOutPosition;
		m_from = m_startPosition;
		m_to = m_wipeOutPosition;
		m_lastLockedState = TransitionState.ON;
		SystemWipeRecognizerListener.Instance.SystemWipeUpdate += onWipeUpdate;
	}

	// Update is called once per frame
	void Update () {
	}

	private void onWipeUpdate(object sender, SystemWipeArgs eventArgs) {
		if ( !m_enabled ) { return; }

		string debugLine = "Debug";
		if ( eventArgs.WipeInfo.Status == Leap.Util.Status.SwipeAbort ) {
			debugLine += " | Abort";
			// If the user aborts, tween back to original location
			if ( m_lastLockedState == TransitionState.ON ) {
				TweenToOnPosition();
			}
			else {
				TweenToOffPosition();
			}
		}

		if ( m_currentTransitionState == TransitionState.MANUAL ) {
			debugLine += " | Manual Control";
			float percentage = Mathf.Clamp01(eventArgs.WipeInfo.Progress);

			debugLine += ": " + percentage;
			transform.localPosition = Vector3.Lerp(m_from, m_to, percentage);

			// If we're sure of the gesture, just go make the transition
			if ( percentage >= m_percentageToLockTransition ) {
				debugLine += " | Transition Cofirmed";
				if ( m_lastLockedState == TransitionState.OFF ) {
					TweenToOnPosition();
				}
				else {
					TweenToOffPosition();
				}
			}
		}
		else if ( m_currentTransitionState == TransitionState.TWEENING ) {
			debugLine += " | Currently Tweening";
			//Debug.Log(debugLine);
			return;
		}
		else { // We're either on or off
			debugLine += " | Locked";
			if ( eventArgs.WipeInfo.Progress >= m_minProgressToStartTransition ) {
				debugLine += " | Go To Manual";
				m_currentTransitionState = TransitionState.MANUAL;
			}
		}

		//Debug.Log(debugLine);
	}

	private void onOnPosition() {
		//Debug.Log("onOnPosition");
		m_currentTransitionState = TransitionState.ON;
		m_lastLockedState = TransitionState.ON;
		m_from = m_startPosition;
		m_to = m_wipeOutPosition;
	}

	private void onOffPosition() {
		//Debug.Log("onOffPosition");
		m_currentTransitionState = TransitionState.OFF;
		m_lastLockedState = TransitionState.OFF;
		m_from = m_wipeOutPosition;
		m_to = m_startPosition;
	}

	public void TweenToOnPosition() {
		//Debug.Log("tweenToOnPosition");
		StopAllCoroutines();
		StartCoroutine(doPositionTween(0.0f, 0.1f, onOnPosition));
	}

	public void TweenToOffPosition() {
		//Debug.Log("tweenToOffPosition");
		StopAllCoroutines();
		StartCoroutine(doPositionTween(1.0f, 0.1f, onOffPosition));
	}

	public void TweenToPosition(float percentage, float time = 0.4f) {
		m_currentTransitionState = TransitionState.TWEENING;
		StopAllCoroutines();
		StartCoroutine(doPositionTween(percentage, time));
	}

	private IEnumerator doPositionTween(float goalPercent, float transitionTime, TweenCompleteDelegate onComplete = null) {
		//Debug.Log("doPositionTween: " + goalPercent);
		float startTime = Time.time;

		Vector3 from = transform.localPosition;
		Vector3 to = Vector3.Lerp(m_startPosition, m_wipeOutPosition, goalPercent);

		while ( true ) {
			float percentage = Mathf.Clamp01((Time.time - startTime)/transitionTime);
			//Debug.Log("Tween step: " + percentage);

			transform.localPosition = Vector3.Lerp(from, to, percentage);

			// Kick out of the loop if we're done
			if ( percentage == 1 ) {
				break;
			} else { // otherwise continue
				yield return 1;
			}
		}

		if ( onComplete != null ) {
			onComplete();
		}
	}
}


text:
BrowserNonClientFrameView::BrowserNonClientFrameView(BrowserFrame* frame,
                                                     BrowserView* browser_view)
    : frame_(frame),
      browser_view_(browser_view) {
}

BrowserNonClientFrameView::~BrowserNonClientFrameView() {
}

void BrowserNonClientFrameView::VisibilityChanged(views::View* starting_from,
                                                  bool is_visible) {
  if (!is_visible)
    return;
  // The first time UpdateAvatarInfo() is called the window is not visible so
  // DrawTaskBarDecoration() has no effect. Therefore we need to call it again
  // once the window is visible.
  UpdateAvatarInfo();
}

void BrowserNonClientFrameView::OnThemeChanged() {
  UpdateAvatarLabelStyle();
}

void BrowserNonClientFrameView::UpdateAvatarLabelStyle() {
  if (!avatar_label_.get())
    return;

  ui::ThemeProvider* tp = frame_->GetThemeProvider();
  SkColor color_background = tp->GetColor(
      ThemeProperties::COLOR_TOOLBAR);
  avatar_label_->set_background(
      views::Background::CreateSolidBackground(color_background));
  avatar_label_->SetBackgroundColor(color_background);
  SkColor color_label = tp->GetColor(
      ThemeProperties::COLOR_BOOKMARK_TEXT);
  avatar_label_->SetEnabledColor(color_label);
}

void BrowserNonClientFrameView::UpdateAvatarInfo() {
  if (browser_view_->ShouldShowAvatar()) {
    if (!avatar_button_.get()) {
      avatar_button_.reset(
          new AvatarMenuButton(browser_view_->browser(),
                               browser_view_->IsOffTheRecord()));
      AddChildView(avatar_button_.get());
#if defined(ENABLE_MANAGED_USERS)
      Profile* profile = browser_view_->browser()->profile();
      ManagedUserService* service =
          ManagedUserServiceFactory::GetForProfile(profile);
      if (service->ProfileIsManaged() && !avatar_label_.get()) {
        ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
        avatar_label_.reset(new views::Label(
            l10n_util::GetStringUTF16(IDS_MANAGED_USER_AVATAR_LABEL),
            rb.GetFont(ui::ResourceBundle::BoldFont)));
        UpdateAvatarLabelStyle();
        AddChildView(avatar_label_.get());
      }
#endif
      frame_->GetRootView()->Layout();
    }
  } else if (avatar_button_.get()) {
    // The avatar label can just be there if there is also an avatar button.
    if (avatar_label_.get()) {
      RemoveChildView(avatar_label_.get());
      avatar_label_.reset();
    }
    RemoveChildView(avatar_button_.get());
    avatar_button_.reset();
    frame_->GetRootView()->Layout();
  }

  ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
  gfx::Image avatar;
  string16 text;
  bool is_gaia_picture = false;
  if (browser_view_->IsOffTheRecord()) {
    avatar = rb.GetImageNamed(browser_view_->GetOTRIconResourceID());
  } else if (AvatarMenuModel::ShouldShowAvatarMenu()) {
    ProfileInfoCache& cache =
        g_browser_process->profile_manager()->GetProfileInfoCache();
    Profile* profile = browser_view_->browser()->profile();
    size_t index = cache.GetIndexOfProfileWithPath(profile->GetPath());
    if (index == std::string::npos)
      return;
    is_gaia_picture =
        cache.IsUsingGAIAPictureOfProfileAtIndex(index) &&
        cache.GetGAIAPictureOfProfileAtIndex(index);
    avatar = cache.GetAvatarIconOfProfileAtIndex(index);
    text = cache.GetNameOfProfileAtIndex(index);
  }
  if (avatar_button_.get()) {
    avatar_button_->SetAvatarIcon(avatar, is_gaia_picture);
    if (!text.empty())
      avatar_button_->SetText(text);
  }

  // For popups and panels which don't have the avatar button, we still
  // need to draw the taskbar decoration.
  chrome::DrawTaskbarDecoration(
      frame_->GetNativeWindow(),
      AvatarMenuModel::ShouldShowAvatarMenu() ? &avatar : NULL);
}


text:
package foreman

import (
	"sort"
	"testing"

	. "github.com/smartystreets/goconvey/convey"

	"go.polydawn.net/repeatr/core/executor/impl/null"
	"go.polydawn.net/repeatr/rsrch/model/cassandra/impl/mem"
	"go.polydawn.net/repeatr/rsrch/model/catalog"
)

func TestPipeline(t *testing.T) {
	/*
	  [A] ----- <<B>> ----> [B::x] ---- <<E>> ---> [E::x]
	    \
	     \___ <<D>> ----> [D::x]
	     /          \
	    /            \___> [D::y]
	  [C]
	*/
	Convey("Given challenge suite one", t, func(c C) {
		kb := cassandra_mem.New()
		// load up the suite
		commissionChallengeSuiteOne(kb)
		// make a foreman including a full mock executor, and register it up
		mgr := &Foreman{
			cassy:    kb,
			executor: &null.Executor{null.Deterministic},
		}
		mgr.register()

		// This is a huge list list of steps, and will render horribly.
		// But I really do want to test a looong series of stateful transitions.
		type step struct {
			name string
			fn   func()
		}
		steps := []step{}
		steps = append(steps, step{
			"Deliver catalog 'A'; expect commission 'B' to fly",
			func() {
				kb.PublishCatalog(catalog.New(catalog.ID("A")).Release(
					"", catalog.SKU{Hash: "a1"},
				))
				pumpn(mgr, 1)

				// we should get B to run, and not D.
				So(mgr.currentPlans.queue, ShouldHaveLength, 1)
				mgr.evoke()
				So(mgr.currentPlans.queue, ShouldHaveLength, 0)

				// we should get B releases!
				allCatIDs := kb.ListCatalogs()
				sort.Sort(catalog.IDs(allCatIDs))
				So(allCatIDs, ShouldHaveLength, 2)
				So(allCatIDs[0], ShouldEqual, "A")
				So(allCatIDs[1], ShouldEqual, "B::x")
				So(kb.Catalog(catalog.ID("B::x")).Tracks[""], ShouldHaveLength, 1)
			},
		})
		steps = append(steps, step{
			"Pump; expect commission 'E' to fly using B's results",
			func() {
				// pump event from previous step
				pumpn(mgr, 1)

				// B doesn't need to run again, but E should be ready
				So(mgr.currentPlans.queue, ShouldHaveLength, 1)
				mgr.evoke()
				So(mgr.currentPlans.queue, ShouldHaveLength, 0)

				// we should get E releases!
				allCatIDs := kb.ListCatalogs()
				sort.Sort(catalog.IDs(allCatIDs))
				So(allCatIDs, ShouldHaveLength, 3)
				So(allCatIDs[0], ShouldEqual, "A")
				So(allCatIDs[1], ShouldEqual, "B::x")
				So(allCatIDs[2], ShouldEqual, "E::x")
				So(kb.Catalog(catalog.ID("B::x")).Tracks[""], ShouldHaveLength, 1)
				So(kb.Catalog(catalog.ID("E::x")).Tracks[""], ShouldHaveLength, 1)

				// pump event 'E' (it's noise, shouldn't trigger anything)
				So(mgr.chNewCatalog, ShouldHaveLength, 1)
				pumpn(mgr, 1)
			},
		})
		steps = append(steps, step{
			"Deliver catalog 'C'; expect commission 'D' to fly",
			func() {
				kb.PublishCatalog(catalog.New(catalog.ID("C")).Release(
					"", catalog.SKU{Hash: "c1"},
				))
				pumpn(mgr, 1)

				// D has both required inputs now so it can run
				So(mgr.currentPlans.queue, ShouldHaveLength, 1)
				mgr.evoke()
				So(mgr.currentPlans.queue, ShouldHaveLength, 0)

				// we should get double D releases!
				allCatIDs := kb.ListCatalogs()
				sort.Sort(catalog.IDs(allCatIDs))
				So(allCatIDs, ShouldHaveLength, 6)
				So(allCatIDs[5], ShouldEqual, "E::x") // sorted, natch
				So(allCatIDs[2], ShouldEqual, "C")
				So(allCatIDs[3], ShouldEqual, "D::x")
				So(allCatIDs[4], ShouldEqual, "D::y")
				So(kb.Catalog(catalog.ID("D::x")).Tracks[""], ShouldHaveLength, 1)
				So(kb.Catalog(catalog.ID("D::y")).Tracks[""], ShouldHaveLength, 1)

				// pump both 'D::*' events (trailing noise)
				So(mgr.chNewCatalog, ShouldHaveLength, 2)
				pumpn(mgr, 2)
			},
		})
		steps = append(steps, step{
			"Deliver catalog 'A'->2; expect all hell to break loose, eeeeverybody gets a rebuild",
			func() {
				kb.PublishCatalog(
					kb.Catalog(catalog.ID("A")).
						Release("", catalog.SKU{Hash: "a2"}),
				)
				pumpn(mgr, 1)

				// both D and B consume this and neither have incomplete reqs
				// no idea what order they're in!  shouldn't matter!  evoke twice.
				So(mgr.currentPlans.queue, ShouldHaveLength, 2)
				mgr.evoke()
				mgr.evoke()
				// E still hasn't triggered because evoke doesn't pump again
				So(mgr.currentPlans.queue, ShouldHaveLength, 0)

				// D (x2) and B both expect new releases
				allCatIDs := kb.ListCatalogs()
				sort.Sort(catalog.IDs(allCatIDs))
				So(allCatIDs, ShouldHaveLength, 6)
				So(kb.Catalog(catalog.ID("B::x")).Tracks[""], ShouldHaveLength, 2)
				So(kb.Catalog(catalog.ID("D::x")).Tracks[""], ShouldHaveLength, 2)
				So(kb.Catalog(catalog.ID("D::y")).Tracks[""], ShouldHaveLength, 2)

				// trailin 'D::*' and a meaningful 'B::x' event
				So(mgr.chNewCatalog, ShouldHaveLength, 3)
				pumpn(mgr, 3)

				// knock out the E again
				So(mgr.currentPlans.queue, ShouldHaveLength, 1)
				mgr.evoke()
				So(mgr.currentPlans.queue, ShouldHaveLength, 0)
				So(kb.Catalog(catalog.ID("E::x")).Tracks[""], ShouldHaveLength, 2)
			},
		})
		chain := func() {}
		for i := len(steps) - 1; i >= 0; i-- {
			step := steps[i]
			chain = func(chain func()) func() {
				return func() {
					Convey(step.name, func() {
						step.fn()
						chain()
					})
				}
			}(chain)
		}
		chain()
	})
}


text:
package com.shc.silenceengine.backend.lwjgl.glfw;

import java.util.Arrays;

/**
 *
 This class describes the Gamma Ramp of a monitor. To set the gamma ramp, you have to use the
 * {@code setGammaRamp} method on the {@code Monitor} object.

 *
 *

 *     short[] red   = new short[256];
 *     short[] green = new short[256];
 *     short[] blue  = new short[256];
 *
 *     for (int i = 0; i < 256; i++)
 *     {
 *         // Fill out the gamma ramp arrays as desired
 *     }
 *
 *     GammaRamp ramp = new GammaRamp(red, green, blue);
 *     monitor.setGammaRamp(ramp);
 *

 *
 *
 It is recommended to use GammaRamps of size 256, as that is the size supported by the graphic cards of all the
 * platforms, and on windows, the size must be 256.

 *
 * @author Sri Harsha Chilakapati
 */
public class GammaRamp
{
    // The gamma ramp arrays
    private short[] red;
    private short[] green;
    private short[] blue;

    // The size of the gamma ramp, elements in the arrays
    private int size;

    /**
     * Constructs a GammaRamp for a Monitor object using the gamma values from the red, green and blue channels.
     *
     * @param red   The gamma values of the red channel.
     * @param green The gamma values of the green channel.
     * @param blue  The gamma values of the blue channel.
     */
    public GammaRamp(short[] red, short[] green, short[] blue)
    {
        setRed(red);
        setGreen(green);
        setBlue(blue);
    }

    /**
     * @return An array of values describing the response of the red channel.
     */
    public short[] getRed()
    {
        return red;
    }

    /**
     * Sets the array of gamma values that describe the red channel.
     *
     * @param red The array of values describing the response of the red channel.
     */
    public void setRed(short... red)
    {
        size = Math.max(size, red.length);
        this.red = Arrays.copyOf(red, size);
    }

    /**
     * @return An array of values describing the response of the green channel.
     */
    public short[] getGreen()
    {
        return green;
    }

    /**
     * Sets the array of gamma values that describe the green channel.
     *
     * @param green The array of values describing the response of the green channel.
     */
    public void setGreen(short... green)
    {
        size = Math.max(size, green.length);
        this.green = Arrays.copyOf(green, size);
    }

    /**
     * @return An array of values describing the response of the blue channel.
     */
    public short[] getBlue()
    {
        return blue;
    }

    /**
     * Sets the array of gamma values that describe the blue channel.
     *
     * @param blue The array of values describing the response of the blue channel.
     */
    public void setBlue(short... blue)
    {
        size = Math.max(size, blue.length);
        this.blue = Arrays.copyOf(blue, size);
    }

    /**
     * @return The number of elements in each array.
     */
    public int getSize()
    {
        return size;
    }

    @Override
    public int hashCode()
    {
        int result = Arrays.hashCode(red);
        result = 31 * result + Arrays.hashCode(green);
        result = 31 * result + Arrays.hashCode(blue);
        result = 31 * result + size;
        return result;
    }

    @Override
    public boolean equals(Object o)
    {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        GammaRamp gammaRamp = (GammaRamp) o;

        return size == gammaRamp.size &&
               Arrays.equals(red, gammaRamp.red) &&
               Arrays.equals(green, gammaRamp.green) &&
               Arrays.equals(blue, gammaRamp.blue);
    }

    @Override
    public String toString()
    {
        return "GammaRamp{" +
               "red=" + Arrays.toString(red) +
               ",\ngreen=" + Arrays.toString(green) +
               ",\nblue=" + Arrays.toString(blue) +
               ",\nsize=" + size +
               '}';
    }
}


text:
.. include:: ../rest/empty.rest
.. include:: include.rst

ReST Test Data Example
======================

This text should be ignored, even though it's not a comment.
We have a devious plan to rule the world with robots.

.. code:: robotframework

   *Setting*      *Value*

   Documentation  A complex testdata file   in rst format.
   # Default Tags are in include.rst
   Force Tags     force1   force2

   Suite Setup    Log   Setup
   Test Teardown  Log   Test Teardown
   Resource       ../resources/rest_resource.rst
   | Variables  | ../resources/variables.py
   | Library    | OperatingSystem | | | | | | | | | | | | | | | |

Please ignore me and the non-robotframework code blocks below.

.. code:: python

def ignore_me_or_die():
    raise SystemExit('I did warn you!!')

.. code:: NonExistingProgrammingLanguage

   *** Settings ***
   Documentation    This Robot data in non-robot code block should be ignored.
   Force Tags       do    not    add    us

   *** Test Cases ****
   Ignore me or die
       Fatal Error    I did warn you!!

.. code:: robotframework

          * Variable

          ${table_var}   foo
          @{table_listvar}   bar   ${table_var}
          ${quoted}   """this has """"many "" quotes """""
          ${single_quoted}   s'ingle'qu'ot'es''

We support also `code-block` and `sourcecode` directives as alias for `code`.

.. code-block:: robotframework

   ***Test Case***

   Passing   Log   Passing test case.

.. sourcecode:: robotframework

   Failing        [Document]   FAIL    Failing test case.
      Fail                     Failing test case.
   User Keyword   [Document]   FAIL    A cunning argument. != something
      My Keyword With Arg      A cunning argument.

   Nön-äscïï
      [Documentation]   FAIL Nön-äscïï error
      Fail    Nön-äscïï error

   | Own Tags     | [Tags]       | own1      | own2
   |              | Log          | tags test |
   |              |              |
   | Default Tags | No Operation |

   Variable Table   Should Be Equal   ${table_var}   foo
      Should Be Equal   @{table_listvar}[0]   bar
      Should Be Equal   @{table_listvar}[1]   foo

   Resource File   Keyword from ReST resource
      Keyword from ReST resource 2
      Should Be Equal   ${rest_resource_var}   ReST Resource Variable
      Should Be Equal   ${rest_resource_var2}   ReST Resource Variable From Recursive Resource

   Variable File   Should Be Equal   @{file_listvar}[0]   ${True}
      Should Be Equal   @{file_listvar}[1]   ${3.14}
      Should Be Equal   @{file_listvar}[2]   Hello, world!!
      Should Be Equal   ${file_var1}   ${-314}
      Should Be Equal   ${file_var2}   file variable 2

   Library Import   Directory Should Not Be Empty   ${CURDIR}

   Test Timeout   [Timeout]   0.01s
      [Document]   FAIL   Test timeout 10 milliseconds exceeded.
      Sleep   2

   Keyword Timeout   [Document]   FAIL   Keyword timeout 2 milliseconds exceeded.
      Timeouted Keyword

   Empty Rows
      [Document]   Testing that empty rows are ignored.   FAIL Expected failure.

      No operation

      Fail   Expected failure.

   Document   [Document]   Testing the metadata parsing.
      no operation

   Default Fixture   No operation

   Overridden Fixture   [Teardown]   Fail   Failing Teardown
      [Setup]   Log   Own Setup
      [Document]   FAIL   Teardown failed:\n Failing Teardown
      No Operation

   Quotes   Should Be Equal   ${quoted}   """this has """"many "" quotes """""
      Should Be Equal   ${single_quoted}   s'ingle'qu'ot'es''

   Escaping
      Should Be Equal    -c:\\temp-\t-\x00-\${x}-    ${ESCAPING}

.. code:: robotframework

   *User Keywords*   *Action*   *Argument*   *Argument*   *Argument*

   My Keyword With Arg   [Arguments]   ${arg1}
      Keyword with no arguments
      Another Keyword   ${arg1}

   Another Keyword   [Arguments]   ${arg1}   ${arg2}=something
      Should Be Equal   ${arg1}   ${arg2}

   Timeouted Keyword   [Timeout]   2ms
      Sleep   2

   Keyword With No Arguments   Log   Hello world!


text:
#ifndef XUNITMACROS_H_
#define XUNITMACROS_H_

#include <memory>
#include <tuple>
#include <vector>
#include "Attributes.h"
#include "LineInfo.h"
#include "TestCollection.h"
#include "TestEventRecorder.h"
#include "Suite.h"
#include "xUnitCheck.h"
#include "xUnitLog.h"
#include "xUnitMacroHelpers.h"
#include "xUnitWarn.h"

// !!!VS initializer lists can make this faster...
#define ATTRIBUTES(...) \
    namespace XU_UNIQUE_ATT_NS { \
        namespace xUnitAttributes { \
            inline xUnitpp::AttributeCollection Attributes() \
            { \
                xUnitpp::AttributeCollection attributes; \
                XU_ATTRIBUTES(__VA_ARGS__) \
                attributes.sort(); \
                return attributes; \
            } \
        } \
    } \
    namespace XU_UNIQUE_ATT_NS

#define SKIP(reason) \
    namespace XU_UNIQUE_ATT_NS { \
        namespace xUnitAttributes { \
            inline xUnitpp::AttributeCollection Attributes() \
            { \
                xUnitpp::AttributeCollection attributes; \
                XU_ATTRIBUTES(("Skip", reason)) \
                attributes.sort(); \
                return attributes; \
            } \
        } \
    } \
    namespace XU_UNIQUE_ATT_NS

#define SUITE(SuiteName) \
    namespace { \
        namespace xUnitSuite { \
            inline const std::string &Name() \
            { \
                static std::string name = SuiteName; \
                return name; \
            } \
        } \
    } \
    namespace

namespace xUnitpp { struct NoFixture {}; }

#define TIMED_FACT_FIXTURE(FactDetails, FixtureType, timeout) \
    namespace XU_UNIQUE_NS { \
        using xUnitpp::Assert; \
        XU_TEST_EVENTS \
        class XU_UNIQUE_FIXTURE : public FixtureType \
        { \
            /* !!!VS fix when '= delete' is supported */ \
            XU_UNIQUE_FIXTURE &operator =(XU_UNIQUE_FIXTURE) /* = delete */; \
        public: \
            XU_UNIQUE_FIXTURE() \
                : Check(*detail::pCheck) \
                , Warn(*detail::pWarn) \
                , Log(*detail::pLog) \
                { } \
            void XU_UNIQUE_TEST(); \
            const xUnitpp::Check &Check; \
            const xUnitpp::Warn &Warn; \
            const xUnitpp::Log &Log; \
        }; \
        void XU_UNIQUE_RUNNER() { XU_UNIQUE_FIXTURE().XU_UNIQUE_TEST(); } \
        xUnitpp::TestCollection::Register reg(xUnitpp::TestCollection::Instance(), \
            &XU_UNIQUE_RUNNER, std::string(FactDetails), xUnitSuite::Name(), \
            xUnitAttributes::Attributes(), timeout, std::string(__FILE__), __LINE__, std::move(eventRecorders)); \
    } \
    void XU_UNIQUE_NS :: XU_UNIQUE_FIXTURE :: XU_UNIQUE_TEST()

#define UNTIMED_FACT_FIXTURE(FactDetails, FixtureType) TIMED_FACT_FIXTURE(FactDetails, FixtureType, 0)

#define FACT_FIXTURE(FactDetails, FixtureType) TIMED_FACT_FIXTURE(FactDetails, FixtureType, -1)

#define TIMED_FACT(FactDetails, timeout) TIMED_FACT_FIXTURE(FactDetails, xUnitpp::NoFixture, timeout)

#define UNTIMED_FACT(FactDetails) TIMED_FACT_FIXTURE(FactDetails, xUnitpp::NoFixture, 0)

#define FACT(FactDetails) TIMED_FACT_FIXTURE(FactDetails, xUnitpp::NoFixture, -1)

#define TIMED_DATA_THEORY(TheoryDetails, params, DataProvider, timeout) \
    namespace XU_UNIQUE_NS { \
        using xUnitpp::Assert; \
        XU_TEST_EVENTS \
        const xUnitpp::Check &Check = *detail::pCheck; \
        const xUnitpp::Warn &Warn = *detail::pWarn; \
        const xUnitpp::Log &Log = *detail::pLog; \
        void XU_UNIQUE_TEST params; \
        xUnitpp::TestCollection::Register reg(xUnitpp::TestCollection::Instance(), \
            &XU_UNIQUE_TEST, DataProvider, std::string(TheoryDetails), xUnitSuite::Name(), std::string(#params), \
            xUnitAttributes::Attributes(), timeout, std::string(__FILE__), __LINE__, eventRecorders); \
    } \
    void XU_UNIQUE_NS :: XU_UNIQUE_TEST params

#define UNTIMED_DATA_THEORY(TheoryDetails, params, DataProvider, timeout) TIMED_DATA_THEORY(TheoryDetails, params, DataProvider, 0)

#define DATA_THEORY(TheoryDetails, params, DataProvider) TIMED_DATA_THEORY(TheoryDetails, params, DataProvider, -1)

#define TIMED_THEORY(TheoryDetails, params, timeout, ...) \
    namespace XU_UNIQUE_NS { \
        using xUnitpp::Assert; \
        XU_TEST_EVENTS \
        const xUnitpp::Check &Check = *detail::pCheck; \
        const xUnitpp::Warn &Warn = *detail::pWarn; \
        const xUnitpp::Log &Log = *detail::pLog; \
        void XU_UNIQUE_TEST params; \
        decltype(CAR(__VA_ARGS__)) args[] = { __VA_ARGS__ }; \
        xUnitpp::TestCollection::Register reg(xUnitpp::TestCollection::Instance(), \
            &XU_UNIQUE_TEST, xUnitpp::TheoryData(PP_NARGS(__VA_ARGS__), args), std::string(TheoryDetails), \
            xUnitSuite::Name(), std::string(#params), xUnitAttributes::Attributes(), timeout, std::string(__FILE__), __LINE__, eventRecorders); \
    } \
    void XU_UNIQUE_NS :: XU_UNIQUE_TEST params

#define UNTIMED_THEORY(TheoryDetails, params, ...) TIMED_THEORY(TheoryDetails, params, 0, __VA_ARGS__)

#define THEORY(TheoryDetails, params, ...) TIMED_THEORY(TheoryDetails, params, -1, __VA_ARGS__)

#define LI xUnitpp::LineInfo(std::string(__FILE__), __LINE__)

#endif


text:
''' The ``sampledata`` module can be used to download data sets used in Bokeh
examples.

The simplest way to download the data is to use the execute the command line
program:

.. code-block:: sh

    bokeh sampledata

Alternatively, the ``download`` function described below may be called
programmatically.

.. code-block:: python

    >>> import bokeh.sampledata
    >>> bokeh.sampledata.download()

By default, data is downloaded and stored to a directory ``$HOME/.bokeh/data``.
This directory will be created if it does not already exist.

Bokeh also looks for a YAML configuration file at ``$HOME/.bokeh/config``. The
YAML key ``sampledata_dir`` can be set to the absolute path of a directory where
the data should be stored. For example, add the following line to the
config file:

.. code-block:: sh

    sampledata_dir: /tmp/bokeh_data

This will cause the sample data to be stored in ``/tmp/bokeh_data``.

'''

#-----------------------------------------------------------------------------
# Boilerplate
#-----------------------------------------------------------------------------
from __future__ import annotations

import logging # isort:skip
log = logging.getLogger(__name__)

#-----------------------------------------------------------------------------
# Import
#-----------------------------------------------------------------------------

# isort: skip_file

#-----------------------------------------------------------------------------
# Globals and constants
#-----------------------------------------------------------------------------

__all__ = (
    'download',
)

#-----------------------------------------------------------------------------
# General API
#-----------------------------------------------------------------------------

from ..util.sampledata import download

#-----------------------------------------------------------------------------
# Dev API
#-----------------------------------------------------------------------------

#-----------------------------------------------------------------------------
# Private API
#-----------------------------------------------------------------------------

#-----------------------------------------------------------------------------
# Code
#-----------------------------------------------------------------------------


text:
<! - Ceci est le fichier de modèle pour la page principale de l'application. La première
     étape est ici d'ajouter quelques éléments avec des ID spéciale nous lier à plus tard.
     Chaque sur ces éléments auront un contrôle dynamique ajoutée en
     src/main/java/org/spiffyui/hellospiffylocalization/client/Index.java.
->

    Entrez votre nom:

        Il s'agit d'un  Spiffy interface utilisateur  application construite pour vous et en cours d'exécution sur votre ordinateur. Ce simple exemple montre que vous sous une forme aisément ce qui en fait un REST  appel à votre serveur. Vous pouvez l'éditer, le construire, l'exécuter, de le partager avec vos amis, et créer un produit au-dessus de celui-ci. La demande est tout à vous.

Prochaines étapes

        Vous avez joué avec le projet un peu, maintenant faire quelques changements.

             Changer cette page - Cette page est un modèle avec la plupart du code HTML et les contrôles dynamiques ajouté plus tard. Modifier le contenu dans src/main/java/org/spiffyui/hellospiffylocalization/client/MainPanel.html.

            Changer le style  - Vous pouvez définir n'importe quel style dans src/main/java/org/spiffyui/hellospiffylocalization/public/HelloSpiffyLocalization.css.

            Ajouter un  REST Bean  - Faire de cette REST appel réutilisables en l'ajoutant à une REST Bean.

             Ajouter un bar navigation - Une navigation facilitée pour votre application est l'une des grandes caractéristiques de Spiffy assurance-chômage.

        Après avoir apporté tout changement, vous pouvez arrêter le serveur et exécuter le Ant commande pour recompiler votre projet. Vous pouvez également utiliser le Eclipse IDE pour exécuter cette application dans le GWT mode dev.

 Obtenez de l'aide

    Si vous avez des questions ou rencontrez des problèmes, nous voulons savoir. Envoyez-nous une note sur le Spiffy interface Google Group.


text:
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_marginTop="42dp"
    android:clickable="true"
    >

    <android.support.v7.widget.CardView
        android:layout_width="match_parent"
        android:id="@+id/cv_popup"
        android:layout_height="wrap_content"
        xmlns:app="http://schemas.android.com/apk/res-auto"
        android:clickable="true"
        app:cardElevation="32dp"
        xmlns:android="http://schemas.android.com/apk/res/android">
        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="#263238"
            android:clickable="true"
            >
            <ProgressBar
                android:id="@+id/progressbar"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_centerInParent="true"
                android:visibility="visible" />

            <VideoView
                android:layout_width="match_parent"
                android:id="@+id/vid_post"
                android:layout_centerHorizontal="true"
                android:layout_below="@+id/bt_dismiss"
                android:layout_height="200dp"

                />
            <ImageButton
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:id="@+id/bt_dismiss"
                android:src="@drawable/closepopup"
                android:background="#263238"
                android:soundEffectsEnabled="true"
                android:layout_alignRight="@id/vid_post"
                android:layout_margin="12dp">

            </ImageButton>
        </RelativeLayout>
    </android.support.v7.widget.CardView>

</FrameLayout>


text:
include_recipe "mysql::client"
include_recipe "mysql::ruby"

platform_options = node["cinder"]["platform"]

platform_options["cinder_api_packages"].each do |pkg|
  package pkg do
    options platform_options["package_options"]
    action node["osops"]["do_package_upgrades"] == true ? :upgrade : :install
  end
end

include_recipe "cinder::cinder-common"

if volume_endpoint = get_access_endpoint("cinder-all", "cinder", "api")
  Chef::Log.debug("cinder::cinder-api got cinder endpoint info from cinder-all role holder using get_access_endpoint")
elsif volume_endpoint = get_bind_endpoint("cinder", "api")
  Chef::Log.debug("cinder::cinder-api got cinder endpoint info from cinder-api role holder using get_bind_endpoint")
elsif volume_endpoint = get_access_endpoint("nova-volume", "nova", "volume")
  Chef::Log.debug("cinder::cinder-api got cinder endpoint info from nova-volume role holder using get_access_endpoint")
end

# define the cinder-api service
service_provider = Chef::Provider::Service::Upstart if 'ubuntu' == node['platform'] && Chef::VersionConstraint.new('>= 13.10').include?(node['platform_version'])
service "cinder-api" do
  provider service_provider
  service_name platform_options["cinder_api_service"]
  supports :status => true, :restart => true
  unless volume_endpoint["scheme"] == "https"
    action :enable
    subscribes :restart, "cinder_conf[/etc/cinder/cinder.conf]", :delayed
  else
    action [ :disable, :stop ]
  end
end

# Setup SSL
if volume_endpoint["scheme"] == "https"
  include_recipe "cinder::cinder-api-ssl"
else
  if node.recipe?"apache2"
    apache_site "openstack-cinder-api" do
      enable false
      notifies :restart, "service[apache2]", :immediately
    end
  end
end


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Bull. natn. Sci. Mus. , Tokyo, B 8(3): 83 (1982)

#### Original name
Cordyceps ovoideoperitheciata Kobayasi & Shimizu

### Remarks
null


text:
/**
 * Globalization error object
 *
 * @constructor
 * @param code
 * @param message
 */
var GlobalizationError = function(code, message) {
    this.code = code || null;
    this.message = message || '';
};

// Globalization error codes
GlobalizationError.UNKNOWN_ERROR = 0;
GlobalizationError.FORMATTING_ERROR = 1;
GlobalizationError.PARSING_ERROR = 2;
GlobalizationError.PATTERN_ERROR = 3;

module.exports = GlobalizationError;


text:
#import "PNStateListener.h"
#import "PNObjectEventListener.h"
#import "PubNub+CorePrivate.h"
#import "PNSubscribeStatus.h"
#import "PNHelpers.h"

NS_ASSUME_NONNULL_BEGIN

#pragma mark Protected interface declaration

@interface PNStateListener ()

#pragma mark - Information

/**
 @brief  Weak reference on client for which state listeners manager created.

 @since 4.0
 */
@property (nonatomic, weak) PubNub *client;

/**
 @brief  Stores list of listeners which would like to be notified when new message arrive from remote data
         feed objects on which client subscribed at this moment.

 @return Hash table with list of new message listeners.

 @since 4.0
 */
@property (nonatomic, strong) NSHashTable<id <PNObjectEventListener>> *messageListeners;

/**
 @brief  Stores list of listeners which would like to be notified when new presence event arrive from remote
         data feed objects on which client subscribed at this moment.

 @return Hash table with list of presence event listeners.

 @since 4.0
 */
@property (nonatomic, strong) NSHashTable<id <PNObjectEventListener>> *presenceEventListeners;

/**
 @brief  Stores list of listeners which would like to be notified when on subscription state changes
         (connection, access rights error, disconnection and unexpected disconnection).

 @since 4.0
 */
@property (nonatomic, strong) NSHashTable<id <PNObjectEventListener>> *stateListeners;

/**
 @brief  Stores reference on queue which is used to serialize access to shared listener information.

 @since 4.0
 */
@property (nonatomic, strong) dispatch_queue_t resourceAccessQueue;

#pragma mark - Initialization and Configuration

/**
 @brief  Initialize state listener manager for concrete \b PubNub client instance.

 @param client Reference on client for which manager should operate and use data.

 @return Initialized and ready to use state listener manager.

 @since 4.0
 */
- (instancetype)initForClient:(PubNub *)client;

#pragma mark - Notification

/**
 @brief  Notify all status event change subscriber about new event.

 @param status Reference on state object which describe operation and category.
 */
- (void)notifyStatusObservers:(PNStatus *)status;

#pragma mark -

@end

NS_ASSUME_NONNULL_END

#pragma mark - Interface implementation

@implementation PNStateListener

#pragma mark - Initialization and Configuration

+ (instancetype)stateListenerForClient:(PubNub *)client {

    return [[self alloc] initForClient:client];
}

- (instancetype)initForClient:(PubNub *)client {

    // Check whether initialization was successful or not.
    if ((self = [super init])) {

        _client = client;
        _messageListeners = [NSHashTable weakObjectsHashTable];
        _presenceEventListeners = [NSHashTable weakObjectsHashTable];
        _stateListeners = [NSHashTable weakObjectsHashTable];
        _resourceAccessQueue = dispatch_queue_create("com.pubnub.listener", DISPATCH_QUEUE_SERIAL);
    }

    return self;
}

- (void)inheritStateFromListener:(PNStateListener *)listener {

    _messageListeners = [listener.messageListeners mutableCopy];
    _presenceEventListeners = [listener.presenceEventListeners mutableCopy];
    _stateListeners = [listener.stateListeners mutableCopy];
}

#pragma mark - Listeners list modification

- (void)addListener:(id <PNObjectEventListener>)listener {

    dispatch_async(self.resourceAccessQueue, ^{

        if ([listener respondsToSelector:@selector(client:didReceiveMessage:)]) {

            [self.messageListeners addObject:listener];
        }
        if ([listener respondsToSelector:@selector(client:didReceivePresenceEvent:)]) {

            [self.presenceEventListeners addObject:listener];
        }

        if ([listener respondsToSelector:@selector(client:didReceiveStatus:)]) {

            [self.stateListeners addObject:listener];
        }
    });
}

- (void)removeListener:(id <PNObjectEventListener>)listener {

    dispatch_async(self.resourceAccessQueue, ^{

        [self.messageListeners removeObject:listener];
        [self.presenceEventListeners removeObject:listener];
        [self.stateListeners removeObject:listener];
    });
}

- (void)removeAllListeners {

    dispatch_async(self.resourceAccessQueue, ^{

        [self.messageListeners removeAllObjects];
        [self.presenceEventListeners removeAllObjects];
        [self.stateListeners removeAllObjects];
    });
}

#pragma mark - Listeners notification

- (void)notifyWithBlock:(dispatch_block_t)block {

    dispatch_async(self.resourceAccessQueue, block);
}

- (void)notifyMessage:(PNMessageResult *)message {

    NSArray<id <PNObjectEventListener>> *listeners = self.messageListeners.allObjects;
    // Silence static analyzer warnings.
    // Code is aware about this case and at the end will simply call on 'nil' object method.
    // In most cases if referenced object become 'nil' it mean what there is no more need in
    // it and probably whole client instance has been deallocated.
    #pragma clang diagnostic push
    #pragma clang diagnostic ignored "-Wreceiver-is-weak"
    #pragma clang diagnostic ignored "-Warc-repeated-use-of-weak"
    pn_dispatch_async(self.client.callbackQueue, ^{

        for (id <PNObjectEventListener> listener in listeners) {

            [listener client:self.client didReceiveMessage:message];
        }
    });
    #pragma clang diagnostic pop
}

- (void)notifyPresenceEvent:(PNPresenceEventResult *)event {

    NSArray<id <PNObjectEventListener>> *listeners = self.presenceEventListeners.allObjects;
    // Silence static analyzer warnings.
    // Code is aware about this case and at the end will simply call on 'nil' object method.
    // In most cases if referenced object become 'nil' it mean what there is no more need in
    // it and probably whole client instance has been deallocated.
    #pragma clang diagnostic push
    #pragma clang diagnostic ignored "-Wreceiver-is-weak"
    #pragma clang diagnostic ignored "-Warc-repeated-use-of-weak"
    pn_dispatch_async(self.client.callbackQueue, ^{

        for (id <PNObjectEventListener> listener in listeners) {

            [listener client:self.client didReceivePresenceEvent:event];
        }
    });
    #pragma clang diagnostic pop
}

- (void)notifyStatusChange:(PNSubscribeStatus *)status {

    [self notifyStatusObservers:status];
}

- (void)notifyHeartbeatStatus:(PNStatus *)status {

    [self notifyStatusObservers:status];
}

#pragma mark - Notification

- (void)notifyStatusObservers:(PNStatus *)status {

    NSArray<id <PNObjectEventListener>> *listeners = self.stateListeners.allObjects;
    // Silence static analyzer warnings.
    // Code is aware about this case and at the end will simply call on 'nil' object method.
    // In most cases if referenced object become 'nil' it mean what there is no more need in
    // it and probably whole client instance has been deallocated.
    #pragma clang diagnostic push
    #pragma clang diagnostic ignored "-Wreceiver-is-weak"
    #pragma clang diagnostic ignored "-Warc-repeated-use-of-weak"
    pn_dispatch_async(self.client.callbackQueue, ^{

        for (id <PNObjectEventListener> listener in listeners) {

            [listener client:self.client didReceiveStatus:status];
        }
    });
    #pragma clang diagnostic pop
}

#pragma mark -

@end