text:
package com.twosigma.beaker.core.module;

import com.google.inject.AbstractModule;
import com.google.inject.Injector;
import com.google.inject.Provides;
import com.google.inject.Singleton;
import com.twosigma.beaker.shared.json.serializer.StringObject;
import com.twosigma.beaker.core.rest.SessionBackupRest;
import org.codehaus.jackson.Version;
import org.codehaus.jackson.jaxrs.JacksonJsonProvider;
import org.codehaus.jackson.map.ObjectMapper;
import org.codehaus.jackson.map.SerializationConfig;
import org.codehaus.jackson.map.module.SimpleModule;

/**
 * The Guice module as the registry of mapping from classes to serializers
 */
public class SerializerModule
        extends AbstractModule {

  @Override
  protected void configure() {
    bind(StringObject.Serializer.class);
    bind(SessionBackupRest.PluginSerializer.class);
    bind(SessionBackupRest.SessionSerializer.class);
  }

  @Provides
  @Singleton
  public ObjectMapper getObjectMapper(Injector injector) {
    ObjectMapper mapper = new ObjectMapper();

    SimpleModule module =
            new SimpleModule("MySerializer", new Version(1, 0, 0, null));

    module.addSerializer(StringObject.class,
        injector.getInstance(StringObject.Serializer.class));
    module.addSerializer(SessionBackupRest.Plugin.class,
        injector.getInstance(SessionBackupRest.PluginSerializer.class));
    module.addSerializer(SessionBackupRest.Session.class,
        injector.getInstance(SessionBackupRest.SessionSerializer.class));

    mapper.registerModule(module);

    SerializationConfig config = mapper.getSerializationConfig();

    // Pretty
    mapper.enable(SerializationConfig.Feature.INDENT_OUTPUT);

    // Manually serialize everything, either through mixin or serializer
    mapper.disable(SerializationConfig.Feature.AUTO_DETECT_GETTERS);
    mapper.disable(SerializationConfig.Feature.AUTO_DETECT_IS_GETTERS);
    mapper.disable(SerializationConfig.Feature.AUTO_DETECT_FIELDS);

    return mapper;
  }

  @Provides
  @Singleton
  public JacksonJsonProvider getJackson(ObjectMapper mapper) {
    return new JacksonJsonProvider(mapper);
  }
}


text:
THREE.DK2Controls = function(camera) {

  this.camera = camera;
  this.ws;
  this.sensorData;
  this.lastId = -1;

  this.moveForward = false;
  this.moveBackward = false;
  this.moveLeft = false;
  this.moveRight = false;
  this.moveUp = false;
  this.moveDown = false;

  this.controller = new THREE.Object3D();

  this.headPos = new THREE.Vector3();
  this.headQuat = new THREE.Quaternion();

  this.translationSpeed  = 5;

  this.wasd = {
    left: false,
    up: false,
    right: false,
    down: false
  };

  var that = this;
  var ws = new WebSocket("ws://localhost:8888/ws");
  ws.onopen = function () {
    console.log("### Connected ####");
  };

  ws.onmessage = function (evt) {
    var message = evt.data;
    try {
      that.sensorData = JSON.parse(message);
    } catch (err) {
      console.log(message);
    }
  };

  ws.onclose = function () {
    console.log("### Closed ####");
  };

  this.onKeyDown = function (event) {

    if(!pause) {

      switch (event.keyCode) {

        case 87: /*W*/
          this.wasd.up = true;
          this.moveForward = true;
          break;

        case 83: /*S*/
          this.wasd.down = true;
          this.moveBackward = true;
          break;

        case 68: /*D*/
          this.wasd.right = true;
          break;

        case 65: /*A*/
            this.wasd.left = true;
            break;

        case 82: /*R*/
            this.moveUp = true;
            break;

        case 70: /*F*/
            this.moveDown = true;
            break;
      }

    }
  };

  // moveForward and moveBackward are used to move the pathCamera (see render method in index)
  this.onKeyUp = function (event) {
    switch (event.keyCode) {

      case 87: /*W*/
        this.wasd.up = false;
        this.moveForward = false;
        break;

      case 83: /*S*/
        this.wasd.down = false;
        this.moveBackward = false;
        break;

      case 68: /*D*/
        this.wasd.right = false;
        break;

      case 65: /*A*/
          this.wasd.left = false;
          break;

      case 82: /*R*/
          this.moveUp = false;
          break;

      case 70: /*F*/
          this.moveDown = false;
          break;
    }
  };

  this.update = function(delta) {

    if (this.sensorData) {
      var id = this.sensorData[0];
      if (id > this.lastId) {
        this.headPos.set(this.sensorData[1]*10, this.sensorData[2]*10, this.sensorData[3]*10);
        this.headQuat.set(this.sensorData[4], this.sensorData[5], this.sensorData[6], this.sensorData[7]);

        this.camera.setRotationFromQuaternion(this.headQuat);
        this.controller.setRotationFromMatrix(this.camera.matrix);
      }

      this.lastId = id;
    }

    // update position
    if (this.wasd.up)
      this.controller.translateZ(-this.translationSpeed * delta);

    if (this.wasd.down)
      this.controller.translateZ(this.translationSpeed * delta);

    if (this.wasd.right)
      this.controller.translateX(this.translationSpeed * delta);

    if (this.wasd.left)
      this.controller.translateX(-this.translationSpeed * delta);

    if (  this.moveUp)
      this.controller.translateY( this.translationSpeed * delta );
    if (this.moveDown)
      this.controller.translateY( - this.translationSpeed * delta );

    // update the position of the camera ONLY if pathEnabled == false. Otherwise the camare will follow the path.
    if(!pathEnabled) {
      this.camera.position.addVectors(this.controller.position, this.headPos);
    }

    if (this.camera.position.y < -10) {
        this.camera.position.y = -10;
      }

      if (ws) {
        if (ws.readyState === 1) {
          ws.send("get\n");
        }
      }
  };

  window.addEventListener( 'keydown', bind( this, this.onKeyDown ), false );
  window.addEventListener( 'keyup', bind( this, this.onKeyUp ), false );

  function bind( scope, fn ) {

    return function () {

      fn.apply( scope, arguments );

    };

  };

};

redpajama_set_name: RedPajamaGithub


text:
"""
This radish extension provides the functionality to write the feature file run to the console.
"""

import sys
import colorful as cf

from radish.terrain import world
from radish.hookregistry import before, after
from radish.scenariooutline import ScenarioOutline
from radish.scenarioloop import ScenarioLoop
from radish.stepmodel import Step
from radish.extensionregistry import extension

@extension
class DotOutputFormatter(object):
    """
    Output formatter in the dot style.
    """

    LOAD_IF = staticmethod(lambda config: config.formatter == "dots")
    LOAD_PRIORITY = 30

    STATE_SYMBOLS = {
        Step.State.PASSED: ".",
        Step.State.PENDING: "P",
        Step.State.UNTESTED: "U",
        Step.State.SKIPPED: "S",
        Step.State.FAILED: "F",
    }

    def __init__(self):
        before.each_feature(self.dot_formatter_before_each_feature)
        after.each_feature(lambda *args, **kwargs: sys.stdout.write("\n"))
        after.each_scenario(self.dot_formatter_after_each_scenario)
        after.each_step(self.dot_formatter_after_each_step)
        after.all(self.dot_formatter_failure_summary)

        self._failed_steps = []

    def dot_formatter_before_each_feature(self, feature):
        """
        Writes feature header to the console

        :param Feature feature: the feature to write to the console
        """
        output = cf.bold_black(feature.path) + ": "
        sys.stdout.write(str(output))

    def dot_formatter_after_each_scenario(self, scenario):
        """
        If the scenario is a ExampleScenario it will write the Examples header

        :param Scenario scenario: the scenario which was ran.
        """
        if isinstance(scenario, (ScenarioOutline, ScenarioLoop)):
            return

        sys.stdout.write(str(self.STATE_SYMBOLS[scenario.state]))

    def dot_formatter_after_each_step(self, step):
        if step.state == Step.State.FAILED:
            self._failed_steps.append(step)

    def dot_formatter_failure_summary(self, features, marker):
        """Output summary for failed Scenarios."""
        if not self._failed_steps:
            return

        output = "\n" + cf.bold_red("Failures:") + "\n"

        for step in self._failed_steps:
            output += "{}: {}\n    {}\n".format(
                step.path, step.parent.sentence, cf.red(step.sentence)
            )
            if world.config.with_traceback:
                output += "      {}\n".format(
                    "\n      ".join(
                        [
                            str(cf.red(l))
                            for l in step.failure.traceback.split("\n")[:-2]
                        ]
                    )
                )
            output += "      {}: {}\n\n".format(
                cf.bold_red(step.failure.name), cf.red(step.failure.reason)
            )

        sys.stdout.write(str(output + "\n"))


text:
using System;
using System.CodeDom;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;

namespace EmptyKeys.UserInterface.Generator
{
    /// <summary>
    /// Implements resource dictionary generator
    /// </summary>
    public class ResourceDictionaryGenerator
    {
        private int uniqueId;

        /// <summary>
        /// Generates the specified dictionary.
        /// </summary>
        /// <param name="dictionary">The dictionary.</param>
        /// <param name="classType">Type of the class.</param>
        /// <param name="initMethod">The initialize method.</param>
        /// <param name="fieldReference">The field reference.</param>
        public void Generate(ResourceDictionary dictionary, CodeTypeDeclaration classType, CodeMemberMethod initMethod, CodeExpression fieldReference)
        {
            foreach (var mergedDict in dictionary.MergedDictionaries)
            {
                string name = string.Empty;
                if (mergedDict.Source.IsAbsoluteUri)
                {
                    name = Path.GetFileNameWithoutExtension(mergedDict.Source.LocalPath);
                }
                else
                {
                    name = Path.GetFileNameWithoutExtension(mergedDict.Source.OriginalString);
                }

                if (string.IsNullOrEmpty(name))
                {
                    Console.WriteLine("Dictionary name not found.");
                    continue;
                }

                CodeMethodInvokeExpression addMergedDictionary = new CodeMethodInvokeExpression(
                        fieldReference, "MergedDictionaries.Add", new CodeFieldReferenceExpression(new CodeTypeReferenceExpression(name), "Instance"));
                initMethod.Statements.Add(addMergedDictionary);
            }

            ValueGenerator valueGenerator = new ValueGenerator();
            List<object> keys = dictionary.Keys.Cast<object>().OrderBy(k => k.ToString()).ToList();
            foreach (var resourceKey in keys)
            {
                object resourceValue = dictionary[resourceKey];

                CodeComment comment = new CodeComment("Resource - [" + resourceKey.ToString() + "] " + resourceValue.GetType().Name);
                initMethod.Statements.Add(new CodeCommentStatement(comment));

                CodeExpression keyExpression = CodeComHelper.GetResourceKeyExpression(resourceKey);
                CodeExpression valueExpression = valueGenerator.ProcessGenerators(classType, initMethod, resourceValue, "r_" + uniqueId, dictionary);

                if (valueExpression != null)
                {
                    CodeMethodInvokeExpression addResourceMethod = new CodeMethodInvokeExpression(fieldReference, "Add", keyExpression, valueExpression);
                    initMethod.Statements.Add(addResourceMethod);
                }

                uniqueId++;
            }
        }
    }
}


text:
<?php

namespace Oro\Bundle\NavigationBundle\Tests\Behat\Element;

use Behat\Mink\Element\NodeElement;
use Behat\Mink\Exception\ElementNotFoundException;
use Oro\Bundle\TestFrameworkBundle\Behat\Element\Element;

class MainMenu extends Element
{
    /**
     * @param string $path
     * @throws ElementNotFoundException
     */
    public function openAndClick($path)
    {
        $items = explode('/', $path);
        $linkLocator = array_pop($items);
        $that = $this;

        while ($item = array_shift($items)) {
            /** @var NodeElement $link */
            $link = $that->findLink(trim($item));

            if (null === $link) {
                throw new ElementNotFoundException($this->getDriver(), 'link', 'id|title|alt|text', trim($item));
            }

            $link->mouseOver();
            $that = $link->getParent();
        }

        $that->clickLink(trim($linkLocator));
    }
}


text:
class CreateBusyIntervals < ActiveRecord::Migration
  def change
    create_table :busy_intervals do |t|
      t.date :start_date
      t.date :end_date
      t.belongs_to :user, index: true

      t.timestamps null: false
    end
  end
end


text:
package org.slieb.throwables;
import org.junit.Test;
import java.io.IOException;
import static org.slieb.throwables.DoubleUnaryOperatorWithThrowable.rethrowDoubleUnaryOperator;
@java.lang.SuppressWarnings({"CodeBlock2Expr"})
public class DoubleUnaryOperatorWithThrowableRethrowTest {

  @Test
  public void testThrowCheckedException() {
    IOException expected = new IOException("EXPECTED ERROR");
    IOException actual = null;
    try {
      rethrowDoubleUnaryOperator((v1) -> {
        throw expected;
      }).applyAsDouble(0);
      org.junit.Assert.fail("Exception should have been thrown");
    } catch (IOException e) {
      actual=e;
    }
    org.junit.Assert.assertEquals(expected, actual);
  }

  @Test
  public void testNormalOperation() {
    try {
      rethrowDoubleUnaryOperator((v1) -> {
        if(false) throw new IOException();
        return 0;
      }).applyAsDouble(0);
    } catch (IOException ignored) {
      org.junit.Assert.fail("");
    }
  }

}


text:
/*
 *
 * FunctionListItem
 *
 */

import React, { PropTypes } from 'react';
import { FormattedMessage } from 'react-intl';
import { Link } from 'react-router';
import commonMessages from 'messages';
import messages from './messages';

export class FunctionListItem extends React.Component { // eslint-disable-line react/prefer-stateless-function
  render() {
    const { item, onRemove } = this.props;
    return (

        { item.name }
        <Link to={`/environments/edit/${item.environment}`}>{ item.environment }</Link>

          { item.triggersHttp.length > 0 && renderTriggersHttp(item) }
          { item.triggersTimer.length > 0 && renderTriggersTimer(item) }
          { item.triggersMQ.length > 0 && renderTriggersMQ(item) }
          { item.kubeWatchers.length > 0 && renderKubeWatchers(item) }

          <Link className="btn btn-primary" to={`/functions/edit/${item.name}`}><FormattedMessage {...commonMessages.edit} /></Link>
          { ' ' }
          <FormattedMessage {...commonMessages.delete} />

    );
  }
}

function renderTriggersHttp(item) {
  return (

      <Link to={`/functions/edit/${item.name}#trigger`}><FormattedMessage {...messages.httptriggers} /></Link>

        {
        item.triggersHttp.map((trigger, index) => (
          <li key={`triggerHttp-${index}`}>
            {trigger.method}{ ' ' }
            {trigger.urlpattern}{ ' ' }

        ))
      }

  );
}

function renderTriggersTimer(item) {
  return (

      <Link to={`/functions/edit/${item.name}#trigger`}><FormattedMessage {...messages.timertriggers} /></Link>

        {
          item.triggersTimer.map((timer, index) => (
            <li key={`triggerTimer-${index}`}>
              {timer.cron}{ ' ' }

          ))
        }

  );
}

function renderTriggersMQ(item) {
  return (

      <Link to={`/functions/edit/${item.name}#trigger`}><FormattedMessage {...messages.timertriggers} /></Link>

        {
          item.triggersMQ.map((mqt, index) => (
            <li key={`triggerMQ-${index}`}>
              {mqt.topic}{ ' ' }
              {mqt.respTopic}{ ' ' }

          ))
        }

  );
}

function renderKubeWatchers(item) {
  return (

      <Link to={`/functions/edit/${item.name}#trigger`}><FormattedMessage {...messages.kubewatchers} /></Link>

        {
          item.kubeWatchers.map((watcher, index) => (
            <li key={`kubeWatcher-${index}`}>
              {watcher.namespace}{ ' ' }
              {watcher.objtype}{ ' ' }
              {watcher.labelselector}{ ' ' }

          ))
        }

  );
}

FunctionListItem.propTypes = {
  item: PropTypes.object,
  onRemove: PropTypes.func,
};

export default FunctionListItem;


text:
<?xml version="1.0" encoding="UTF-8"?><!--
	@operation getNetworkInventory
	@action queryNetworkInventory
	@sender FLS
	@receiver EPS
	@scenario Query network inventory fails - Internal error
	@name Exception - Query network inventory fails - Internal error
	@description This is a sample request message for the scenario: Query network inventory fails due to an internal error (EPS or IB2B)
	@version V1.0
-->
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
	xmlns:dns="http://www.nbnco.com.au/cim/manageSPInventory/v5"
	xmlns:mhe="http://www.nbnco.com.au/cim/common/messageHeader/v3">
	<soapenv:Header>
		<mhe:MessageHeader>
			<activityName>getNetworkInventory</activityName>
			<msgName>ManageSPInventorygetNetworkInventoryRequest</msgName>
			<businessServiceName>ManageSPInventory</businessServiceName>
			<businessServiceVersion>V1.0</businessServiceVersion>
			<msgType>Request</msgType>
			<accessSeekerID>SDP000000000001</accessSeekerID>
			<correlationId>4eef4405-606e-46db-8c5c-af78e2874077</correlationId>
			<security>Placeholder Security</security>
			<priority>6</priority>
			<communicationPattern>RequestReply</communicationPattern>
			<timestamp>2014-08-18T12:00:01Z</timestamp>
			<businessChannel>Fulfilment</businessChannel>
			<HeaderCharacteristicValue>
				<value>FALSE</value>
				<Characteristic>
					<name>Mocked</name>
				</Characteristic>
			</HeaderCharacteristicValue>
		</mhe:MessageHeader>
	</soapenv:Header>
	<soapenv:Body>
		<dns:ManageSPInventoryRequest>
			<SPInventory>
				<interactionDate>2014-08-18T12:00:00.000Z</interactionDate>
				<SPInventoryComprisedOf>
					<!-- NSAS or NWAS -->
					<ItemInvolvesProduct>
						<type>NSAS</type>
					</ItemInvolvesProduct>
					<ReferencesSPInventoryItem>
						<ItemInvolvesResource>
							<ID>123</ID>
							<type>DPC</type>
						</ItemInvolvesResource>
					</ReferencesSPInventoryItem>
				</SPInventoryComprisedOf>
			</SPInventory>
		</dns:ManageSPInventoryRequest>
	</soapenv:Body>
</soapenv:Envelope>


text:
Date: Thu, 21 Nov 1996 20:55:28 GMT
Server: Apache/1.1b3
Content-type: text/html

<TITLE>Linda Petzold</TITLE>

Linda Petzold

<!WA0>

Professor

Numerical analysis, differential-algebraic equations, scientific computing,
mathematical software

petzold@cs.umn.edu

(612)625-2013

Positions Held:

Professor, Department of Computer Science, University of Minnesota, 1991-present

Group Leader, Numerical Mathematics Group, Lawrence Livermore National
Laboratory, 1985-1991

Member of Technical Staff, Applied Mathematics Division, Sandia National
Laboratories, Livermore, California 1978-1985

Education:

Ph.D. 1978, Computer Science, University of Illinois at Urbana-Champaign

B.A. 1974, Mathematics, University of Illinois at Urbana-Champaign

Research in the group of Professor Petzold is centered on the analysis
and development of numerical methods for differential equations and
differential-algebraic equation (DAE) systems, scientific computing,
parallel computing and mathematical software.

Differential equations and differential-algebraic systems arise in a
wide variety of scientific and engineering applications.
Differential-algebraic equations often occur as differential equations
which are subject to constraints.  The constraints may be linear or
nonlinear, equality or inequality.  DAE systems arise frequently as
initial value problems in the computer-aided design and modeling of
mechanical systems subject to constraints (multibody systems), circuit
simulation, flowsheeting for chemical processes, modeling of the flow
of incompressible fluids, and in many other applications.  Boundary
value problems in DAEs arise in parameter estimation and control for
multibody systems and for chemical processes and determination of
periodic solutions for circuits.  The presence of the constraints in a
DAE system leads to an interesting mathematical structure and presents
challenges for numerical algorithms.  Current research focuses on
numerical methods for real-time simulation of mechanical systems,
parameter estimation and optimal control of differential-algebraic
systems, and parallel methods and software for very-large-scale
systems of DAEs in geophysics and other applications.

Research Monograph:

K. E. Brenan, S. L. Campbell and L. R. Petzold, The Numerical Solution
of Initial Value Problems in Differential-Algebraic Equations,
Elsevier Science Publishing Co., (1989).

Research Articles:

R. S. Maier, L. R. Petzold and W. Rath, Using DASPK on the TMC CM5:
Experiences with Two Programming Models, Proc. 1993 Scalable Parallel
Libraries Conf., 1993 (with R. S. Maier and W. Rath).

R. S. Maier, L. R. Petzold and W. Rath, Solving Large-Scale
Differential-Algebraic Equations via DASPK on the CM5, submitted to
Concurrency: Practice and Experience, 1994.

P. N Brown, A. C. Hindmarsh and L. R. Petzold, Using Krylov Methods in
the Solution of Large-Scale Differential-Algebraic Systems, to appear,
SIAM J. Scientific Computing.

U. Ascher and L. R. Petzold, The Numerical Solution of
Delay-Differential-Algebraic Equations of Retarded and Neutral Type,
to appear, SIAM J. Numerical Analysis.

U. Ascher, H. Chin, L. R. Petzold and S. Reich, Stabilization of
Constrained Mechanical Systems with DAEs and Invariant Manifolds,
submitted to Mechanics of Structures and Machines, 1993.

U. Ascher and L. R. Petzold, Stability of Computational Methods for
Constrained Dynamics Systems, SIAM J. on Scientific and Statistical
Computing 14, 1993.

L. R. Petzold, Numerical Solution of Differential-Algebraic Equations
in Mechanical Systems Simulation, Physica D 60 (1992), 269-279.

U. Ascher and L. R. Petzold, Projected Implicit Runge-Kutta Methods
for Differential-Algebraic Equations, SIAM J. on Numerical Analysis 28
(1991), 1097-1120.

C. W. Gear, B. J. Leimkuhler and L. R. Petzold, Approximation Methods
for the Consistent Initialization of Differential-Algebraic Equations,
SIAM J. on Numerical Analysis 28 (1991).

<!WA1><!WA2>

<!WA3>Comments and Questions | <!WA4>On-Line Help and Software List | <!WA5>Department Home Page |<!WA6>Department FTP Server | <!WA7>Research Projects | <!WA8>System Information

<!WA9><!WA10>
Last Modified on: Friday, December 15, 1995


text:
$(function() {
	// Deck initialization
	$.deck('.slide');

	$('#style-themes').change(function() {
		$('#style-theme-link').attr('href', $(this).val());
	});

	$('#transition-themes').change(function() {
		$('#transition-theme-link').attr('href', $(this).val());
	});
});


text:
#include <aws/rds/model/RestoreDBClusterFromS3Request.h>
#include <aws/core/utils/StringUtils.h>
#include <aws/core/utils/memory/stl/AWSStringStream.h>

using namespace Aws::RDS::Model;
using namespace Aws::Utils;

RestoreDBClusterFromS3Request::RestoreDBClusterFromS3Request() :
    m_availabilityZonesHasBeenSet(false),
    m_backupRetentionPeriod(0),
    m_backupRetentionPeriodHasBeenSet(false),
    m_characterSetNameHasBeenSet(false),
    m_databaseNameHasBeenSet(false),
    m_dBClusterIdentifierHasBeenSet(false),
    m_dBClusterParameterGroupNameHasBeenSet(false),
    m_vpcSecurityGroupIdsHasBeenSet(false),
    m_dBSubnetGroupNameHasBeenSet(false),
    m_engineHasBeenSet(false),
    m_engineVersionHasBeenSet(false),
    m_port(0),
    m_portHasBeenSet(false),
    m_masterUsernameHasBeenSet(false),
    m_masterUserPasswordHasBeenSet(false),
    m_optionGroupNameHasBeenSet(false),
    m_preferredBackupWindowHasBeenSet(false),
    m_preferredMaintenanceWindowHasBeenSet(false),
    m_tagsHasBeenSet(false),
    m_storageEncrypted(false),
    m_storageEncryptedHasBeenSet(false),
    m_kmsKeyIdHasBeenSet(false),
    m_enableIAMDatabaseAuthentication(false),
    m_enableIAMDatabaseAuthenticationHasBeenSet(false),
    m_sourceEngineHasBeenSet(false),
    m_sourceEngineVersionHasBeenSet(false),
    m_s3BucketNameHasBeenSet(false),
    m_s3PrefixHasBeenSet(false),
    m_s3IngestionRoleArnHasBeenSet(false),
    m_backtrackWindow(0),
    m_backtrackWindowHasBeenSet(false),
    m_enableCloudwatchLogsExportsHasBeenSet(false),
    m_deletionProtection(false),
    m_deletionProtectionHasBeenSet(false),
    m_copyTagsToSnapshot(false),
    m_copyTagsToSnapshotHasBeenSet(false),
    m_domainHasBeenSet(false),
    m_domainIAMRoleNameHasBeenSet(false)
{
}

Aws::String RestoreDBClusterFromS3Request::SerializePayload() const
{
  Aws::StringStream ss;
  ss << "Action=RestoreDBClusterFromS3&";
  if(m_availabilityZonesHasBeenSet)
  {
    unsigned availabilityZonesCount = 1;
    for(auto& item : m_availabilityZones)
    {
      ss << "AvailabilityZones.member." << availabilityZonesCount << "="
          << StringUtils::URLEncode(item.c_str()) << "&";
      availabilityZonesCount++;
    }
  }

  if(m_backupRetentionPeriodHasBeenSet)
  {
    ss << "BackupRetentionPeriod=" << m_backupRetentionPeriod << "&";
  }

  if(m_characterSetNameHasBeenSet)
  {
    ss << "CharacterSetName=" << StringUtils::URLEncode(m_characterSetName.c_str()) << "&";
  }

  if(m_databaseNameHasBeenSet)
  {
    ss << "DatabaseName=" << StringUtils::URLEncode(m_databaseName.c_str()) << "&";
  }

  if(m_dBClusterIdentifierHasBeenSet)
  {
    ss << "DBClusterIdentifier=" << StringUtils::URLEncode(m_dBClusterIdentifier.c_str()) << "&";
  }

  if(m_dBClusterParameterGroupNameHasBeenSet)
  {
    ss << "DBClusterParameterGroupName=" << StringUtils::URLEncode(m_dBClusterParameterGroupName.c_str()) << "&";
  }

  if(m_vpcSecurityGroupIdsHasBeenSet)
  {
    unsigned vpcSecurityGroupIdsCount = 1;
    for(auto& item : m_vpcSecurityGroupIds)
    {
      ss << "VpcSecurityGroupIds.member." << vpcSecurityGroupIdsCount << "="
          << StringUtils::URLEncode(item.c_str()) << "&";
      vpcSecurityGroupIdsCount++;
    }
  }

  if(m_dBSubnetGroupNameHasBeenSet)
  {
    ss << "DBSubnetGroupName=" << StringUtils::URLEncode(m_dBSubnetGroupName.c_str()) << "&";
  }

  if(m_engineHasBeenSet)
  {
    ss << "Engine=" << StringUtils::URLEncode(m_engine.c_str()) << "&";
  }

  if(m_engineVersionHasBeenSet)
  {
    ss << "EngineVersion=" << StringUtils::URLEncode(m_engineVersion.c_str()) << "&";
  }

  if(m_portHasBeenSet)
  {
    ss << "Port=" << m_port << "&";
  }

  if(m_masterUsernameHasBeenSet)
  {
    ss << "MasterUsername=" << StringUtils::URLEncode(m_masterUsername.c_str()) << "&";
  }

  if(m_masterUserPasswordHasBeenSet)
  {
    ss << "MasterUserPassword=" << StringUtils::URLEncode(m_masterUserPassword.c_str()) << "&";
  }

  if(m_optionGroupNameHasBeenSet)
  {
    ss << "OptionGroupName=" << StringUtils::URLEncode(m_optionGroupName.c_str()) << "&";
  }

  if(m_preferredBackupWindowHasBeenSet)
  {
    ss << "PreferredBackupWindow=" << StringUtils::URLEncode(m_preferredBackupWindow.c_str()) << "&";
  }

  if(m_preferredMaintenanceWindowHasBeenSet)
  {
    ss << "PreferredMaintenanceWindow=" << StringUtils::URLEncode(m_preferredMaintenanceWindow.c_str()) << "&";
  }

  if(m_tagsHasBeenSet)
  {
    unsigned tagsCount = 1;
    for(auto& item : m_tags)
    {
      item.OutputToStream(ss, "Tags.member.", tagsCount, "");
      tagsCount++;
    }
  }

  if(m_storageEncryptedHasBeenSet)
  {
    ss << "StorageEncrypted=" << std::boolalpha << m_storageEncrypted << "&";
  }

  if(m_kmsKeyIdHasBeenSet)
  {
    ss << "KmsKeyId=" << StringUtils::URLEncode(m_kmsKeyId.c_str()) << "&";
  }

  if(m_enableIAMDatabaseAuthenticationHasBeenSet)
  {
    ss << "EnableIAMDatabaseAuthentication=" << std::boolalpha << m_enableIAMDatabaseAuthentication << "&";
  }

  if(m_sourceEngineHasBeenSet)
  {
    ss << "SourceEngine=" << StringUtils::URLEncode(m_sourceEngine.c_str()) << "&";
  }

  if(m_sourceEngineVersionHasBeenSet)
  {
    ss << "SourceEngineVersion=" << StringUtils::URLEncode(m_sourceEngineVersion.c_str()) << "&";
  }

  if(m_s3BucketNameHasBeenSet)
  {
    ss << "S3BucketName=" << StringUtils::URLEncode(m_s3BucketName.c_str()) << "&";
  }

  if(m_s3PrefixHasBeenSet)
  {
    ss << "S3Prefix=" << StringUtils::URLEncode(m_s3Prefix.c_str()) << "&";
  }

  if(m_s3IngestionRoleArnHasBeenSet)
  {
    ss << "S3IngestionRoleArn=" << StringUtils::URLEncode(m_s3IngestionRoleArn.c_str()) << "&";
  }

  if(m_backtrackWindowHasBeenSet)
  {
    ss << "BacktrackWindow=" << m_backtrackWindow << "&";
  }

  if(m_enableCloudwatchLogsExportsHasBeenSet)
  {
    unsigned enableCloudwatchLogsExportsCount = 1;
    for(auto& item : m_enableCloudwatchLogsExports)
    {
      ss << "EnableCloudwatchLogsExports.member." << enableCloudwatchLogsExportsCount << "="
          << StringUtils::URLEncode(item.c_str()) << "&";
      enableCloudwatchLogsExportsCount++;
    }
  }

  if(m_deletionProtectionHasBeenSet)
  {
    ss << "DeletionProtection=" << std::boolalpha << m_deletionProtection << "&";
  }

  if(m_copyTagsToSnapshotHasBeenSet)
  {
    ss << "CopyTagsToSnapshot=" << std::boolalpha << m_copyTagsToSnapshot << "&";
  }

  if(m_domainHasBeenSet)
  {
    ss << "Domain=" << StringUtils::URLEncode(m_domain.c_str()) << "&";
  }

  if(m_domainIAMRoleNameHasBeenSet)
  {
    ss << "DomainIAMRoleName=" << StringUtils::URLEncode(m_domainIAMRoleName.c_str()) << "&";
  }

  ss << "Version=2014-10-31";
  return ss.str();
}

void  RestoreDBClusterFromS3Request::DumpBodyToUrl(Aws::Http::URI& uri ) const
{
  uri.SetQueryString(SerializePayload());
}


text:
test_description='git shortlog
'

. ./test-lib.sh

test_expect_success 'setup' '
	echo 1 >a1 &&
	git add a1 &&
	tree=$(git write-tree) &&
	commit=$(printf "%s\n" "Test" "" | git commit-tree "$tree") &&
	git update-ref HEAD "$commit" &&

	echo 2 >a1 &&
	git commit --quiet -m "This is a very, very long first line for the commit message to see if it is wrapped correctly" a1 &&

	# test if the wrapping is still valid
	# when replacing all is by treble clefs.
	echo 3 >a1 &&
	git commit --quiet -m "$(
		echo "This is a very, very long first line for the commit message to see if it is wrapped correctly" |
		sed "s/i/1234/g" |
		tr 1234 "\360\235\204\236")" a1 &&

	# now fsck up the utf8
	git config i18n.commitencoding non-utf-8 &&
	echo 4 >a1 &&
	git commit --quiet -m "$(
		echo "This is a very, very long first line for the commit message to see if it is wrapped correctly" |
		sed "s/i/1234/g" |
		tr 1234 "\370\235\204\236")" a1 &&

	echo 5 >a1 &&
	git commit --quiet -m "a								12	34	56	78" a1 &&

	echo 6 >a1 &&
	git commit --quiet -m "Commit by someone else" \
		--author="Someone else <not!me>" a1 &&

	cat >expect.template <<-\EOF
	A U Thor (5):
	      SUBJECT
	      SUBJECT
	      SUBJECT
	      SUBJECT
	      SUBJECT

	Someone else (1):
	      SUBJECT

	EOF
'

fuzz() {
	file=$1 &&
	sed "
			s/$_x40/OBJECT_NAME/g
			s/$_x05/OBJID/g
			s/^ \{6\}[CTa].*/      SUBJECT/g
			s/^ \{8\}[^ ].*/        CONTINUATION/g
		" <"$file" >"$file.fuzzy" &&
	sed "/CONTINUATION/ d" <"$file.fuzzy"
}

test_expect_success 'default output format' '
	git shortlog HEAD >log &&
	fuzz log >log.predictable &&
	test_cmp expect.template log.predictable
'

test_expect_success 'pretty format' '
	sed s/SUBJECT/OBJECT_NAME/ expect.template >expect &&
	git shortlog --format="%H" HEAD >log &&
	fuzz log >log.predictable &&
	test_cmp expect log.predictable
'

test_expect_success '--abbrev' '
	sed s/SUBJECT/OBJID/ expect.template >expect &&
	git shortlog --format="%h" --abbrev=5 HEAD >log &&
	fuzz log >log.predictable &&
	test_cmp expect log.predictable
'

test_expect_success 'output from user-defined format is re-wrapped' '
	sed "s/SUBJECT/two lines/" expect.template >expect &&
	git shortlog --format="two%nlines" HEAD >log &&
	fuzz log >log.predictable &&
	test_cmp expect log.predictable
'

test_expect_success 'shortlog wrapping' '
	cat >expect <<\EOF &&
A U Thor (5):
      Test
      This is a very, very long first line for the commit message to see if
         it is wrapped correctly
      Th𝄞s 𝄞s a very, very long f𝄞rst l𝄞ne for the comm𝄞t message to see 𝄞f
         𝄞t 𝄞s wrapped correctly
      Thø"žs ø"žs a very, very long fø"žrst lø"žne for the commø"žt
         message to see ø"žf ø"žt ø"žs wrapped correctly
      a								12	34
         56	78

Someone else (1):
      Commit by someone else

EOF
	git shortlog -w HEAD >out &&
	test_cmp expect out
'

test_expect_success 'shortlog from non-git directory' '
	git log HEAD >log &&
	GIT_DIR=non-existing git shortlog -w <log >out &&
	test_cmp expect out
'

iconvfromutf8toiso88591() {
	printf "%s" "$*" | iconv -f UTF-8 -t ISO8859-1
}

DSCHO="Jöhännës \"Dschö\" Schindëlin"
DSCHOE="$DSCHO <Johannes.Schindelin@gmx.de>"
MSG1="set a1 to 2 and some non-ASCII chars: Äßø"
MSG2="set a1 to 3 and some non-ASCII chars: áæï"
cat > expect << EOF
$DSCHO (2):
      $MSG1
      $MSG2

EOF

test_expect_success 'shortlog encoding' '
	git reset --hard "$commit" &&
	git config --unset i18n.commitencoding &&
	echo 2 > a1 &&
	git commit --quiet -m "$MSG1" --author="$DSCHOE" a1 &&
	git config i18n.commitencoding "ISO8859-1" &&
	echo 3 > a1 &&
	git commit --quiet -m "$(iconvfromutf8toiso88591 "$MSG2")" \
		--author="$(iconvfromutf8toiso88591 "$DSCHOE")" a1 &&
	git config --unset i18n.commitencoding &&
	git shortlog HEAD~2.. > out &&
test_cmp expect out'

test_done


text:
{% extends 'environs/env_base.html'%}
{% block breadcrumb-items %}

Home

Environments

Not Authorized

{% endblock %}
{% load static %}

{% block side-panel-actions %}

Options

            Home

{% endblock %}

{% block new-builds-panel %}
{% endblock %}
{% block new-pred-deploys-panel %}
{% endblock %}

{% block main %}
{% include "users/not_authorized.tmpl" %}
{% endblock %}


text:
<?php

namespace Application;

use Zend\Mvc\ModuleRouteListener;
use Zend\Mvc\MvcEvent;
use Zend\Mvc\Controller\Plugin\FlashMessenger;

class Module
{
    public function onBootstrap(MvcEvent $e)
    {
        $eventManager        = $e->getApplication()->getEventManager();
        $moduleRouteListener = new ModuleRouteListener();
        $moduleRouteListener->attach($eventManager);
    }

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

    public function getAutoloaderConfig()
    {
        return [
//            'Zend\Loader\ClassMapAutoloader' => [
//                __DIR__ . '/autoload_classmap.php',
//            ],
            'Zend\Loader\StandardAutoloader' => [
                'namespaces' => [
                    __NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__,
                ],
            ],
        ];
    }
}


text:
/**
 * Created by fitark on 15-3-12.
 */
Template.postsList.helpers({
    posts: function(){
        return Posts.find({},{sort:{submitted:-1}});
    }
});


text:
________________________________________________________________________

This file is part of Logtalk <https://logtalk.org/>
Copyright 1998-2022 Paulo Moura <pmoura@logtalk.org>
SPDX-License-Identifier: Apache-2.0

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.
________________________________________________________________________

`events`
========

The objects `event_registry`, `before_event_registry`, and `after_event_registry`
implement convenient predicates for registering before and after events.

The code makes use of the `monitoring` built-in protocol, which declares the two
basic event handler predicates (`before/3` and `after/3`). You will need to refer
to this protocol in your objects if you want to use the super control structure
`(^^/1)` with these predicates.

The `monitor` object implements more sophisticated event handling predicates.

API documentation
-----------------

Open the [../../docs/library_index.html#events](../../docs/library_index.html#events)
link in a web browser.

Loading
-------

To load all entities in this library, load the `loader.lgt` loader file:

	| ?- logtalk_load(events(loader)).


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Xylaria juniperus var. asperula Starbäck

### Remarks
null


text:
package org.springframework.social.evernote.connect;

import com.evernote.auth.EvernoteService;

/**
 * @author Tadaya Tsuyukubo
 */
public class EvernoteSandboxConnectionFactory extends EvernoteConnectionFactory {

	public EvernoteSandboxConnectionFactory(String consumerKey, String consumerSecret) {
		this(consumerKey, consumerSecret, "evernote-sandbox");
	}

	public EvernoteSandboxConnectionFactory(String consumerKey, String consumerSecret, String providerId) {
		super(consumerKey, consumerSecret, EvernoteService.SANDBOX, providerId);
	}

}


text:
<!DOCTYPE html>

    <meta charset="utf-8"/>

    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

    <link rel="stylesheet" href="css/bootstrap-reboot.min.css">
    <link rel="stylesheet" href="css/bootstrap.min.css">
    <link rel="stylesheet" href="css/fontawesome.min.css">
    <link rel="stylesheet" href="css/solid.min.css">
    <link rel="stylesheet" href="css/styles.css">

    <title>Регистрация в системе OSMI Cards</title>

                     OSMI Cards

Произошла ошибка

Уважаемый читатель! При обработке Вашего запроса произошла ошибка.

!!!Невозможно связаться с сервером OSMI Cards.!!!

                        OK

                    Обратитесь в Отдел по работе с читателями.


text:
__author__ = 'Demi Yu'

from kafka import KafkaConsumer

consumer = KafkaConsumer('result')
for msg in consumer:
    print((msg.value).decode('utf8'))


text:
package cognitivej.vision.face.person;

import cognitivej.core.Utils;
import cognitivej.core.Validation;
import cognitivej.core.error.exceptions.ParameterValidationException;
import cognitivej.vision.face.CognitiveContext;
import cognitivej.vision.face.person.action.*;
import cognitivej.vision.face.persongroup.error.ListPersonsInPersonGroupAction;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.io.File;
import java.io.InputStream;

public class PersonBuilder {
    private final CognitiveContext cognitiveContext;

    public PersonBuilder(CognitiveContext cognitiveContext) {
        this.cognitiveContext = cognitiveContext;
    }

    /**
     * Create a new person in a specified person group for identify. A newly created person have no registered face, you can call Person - Add a Person Face API to add faces to the person.
     *

     * The number of persons has a subscription limit.
     *
     * @param personGroupId - The target person's belonging person group's ID.
     * @param name          - Target person's display name. The maximum length is 128.
     * @param userData      - 	Optional fields for user-provided data attached to a person. Size limit is 16KB.
     * @return a built {@link CreatePersonAction}
     * @see MS Cognitive Docs (Person  - CREATE)
     */
    @NotNull
    public CreatePersonAction createPerson(@NotNull String personGroupId, @NotNull String name, @Nullable String userData) {
        Validation.validate(personGroupId, "^[a-z0-9_-]{1,64}$", new ParameterValidationException("personGroupId", "Person group ID is invalid. Valid format should be a string composed by numbers, english letters in lower case, '-', '_', and no longer than 64 characters."));
        Validation.validate(name, "^.{1,128}$", new ParameterValidationException("name", "The maximum length is 128"));
        Validation.validate(userData, 16, new ParameterValidationException("userData", "The size limit is 16KB"));
        return new CreatePersonAction(cognitiveContext, personGroupId, name, userData);
    }

    /**
     * Add a representative face to a person for identification. The input face is specified as an image with a targetFace rectangle. It returns an persistedFaceId representing the added face and this persistedFaceId will not expire.
     *

     * The persistedFaceId is only used in Face - Identify and Person - Delete a Person Face
     * Each person has a maximum of 248 faces.
     *

     * JPEG, PNG, GIF(the first frame), and BMP are supported. The image file size should be no larger than 4MB.
     *

     * The detectable face size is between 36x36 to 4096x4096 pixels. The faces out of this range will not be detected.
     *

     * Rectangle specified by targetFace should contain exactly one face. Zero or multiple faces will be regarded as an error. Out of detectable face size, large head-pose, or very large occlusions will also result in fail to add a person face.
     *

     * The given rectangle specifies both face location and face size at the same time. There is no guarantee of corrent result if you are using rectangle which are not returned from Face - Detect.
     *
     * @param personGroupId - The target person's belonging person group's ID.
     * @param personId      - Target person that the face is added to.
     * @param userData      - 	Optional fields for user-provided data attached to a person. Size limit is 16KB.
     * @param url           - 	Face image URL. Valid image size is from 1KB to 4MB. Only one face is allowed per image.
     * @return a built {@link AddFaceToPersonAction}
     * @see MS Cognitive Docs (Person - Add a Person Face)
     */
    @NotNull
    public AddFaceToPersonAction addFaceToPerson(@NotNull String personGroupId, @NotNull String personId, @Nullable String userData, @NotNull String url) {
        Validation.validate(personGroupId, "^[a-z0-9_-]{1,64}$", new ParameterValidationException("personGroupId", "Person group ID is invalid. Valid format should be a string composed by numbers, english letters in lower case, '-', '_', and no longer than 64 characters."));
        Validation.validate(userData, 1, new ParameterValidationException("userData", "User-specified data for any purpose. The maximum length is 1KB."));
        return new AddFaceToPersonAction(cognitiveContext, personGroupId, personId, userData, url);
    }

    /**
     * Add a representative face to a person for identification. The input face is specified as an image with a targetFace rectangle. It returns an persistedFaceId representing the added face and this persistedFaceId will not expire.
     *

     * The persistedFaceId is only used in Face - Identify and Person - Delete a Person Face
     * Each person has a maximum of 248 faces.
     *

     * JPEG, PNG, GIF(the first frame), and BMP are supported. The image file size should be no larger than 4MB.
     *

     * The detectable face size is between 36x36 to 4096x4096 pixels. The faces out of this range will not be detected.
     *

     * Rectangle specified by targetFace should contain exactly one face. Zero or multiple faces will be regarded as an error. Out of detectable face size, large head-pose, or very large occlusions will also result in fail to add a person face.
     *

     * The given rectangle specifies both face location and face size at the same time. There is no guarantee of corrent result if you are using rectangle which are not returned from Face - Detect.
     *
     * @param personGroupId    - The target person's belonging person group's ID.
     * @param personId         - Target person that the face is added to.
     * @param userData         - 	Optional fields for user-provided data attached to a person. Size limit is 16KB.
     * @param imageInputStream - 	Face image image. Valid image size is from 1KB to 4MB. Only one face is allowed per image.
     * @return a built {@link AddFaceToPersonAction}
     * @see MS Cognitive Docs (Person - Add a Person Face)
     */
    @NotNull
    public AddFaceToPersonAction addFaceToPerson(@NotNull String personGroupId, @NotNull String personId, @Nullable String userData, @NotNull InputStream imageInputStream) {
        return new AddFaceToPersonAction(cognitiveContext, personGroupId, personId, userData, imageInputStream);

    }

    /**
     * Add a representative face to a person for identification. The input face is specified as an image with a targetFace rectangle. It returns an persistedFaceId representing the added face and this persistedFaceId will not expire.
     *

     * The persistedFaceId is only used in Face - Identify and Person - Delete a Person Face
     * Each person has a maximum of 248 faces.
     *

     * JPEG, PNG, GIF(the first frame), and BMP are supported. The image file size should be no larger than 4MB.
     *

     * The detectable face size is between 36x36 to 4096x4096 pixels. The faces out of this range will not be detected.
     *

     * Rectangle specified by targetFace should contain exactly one face. Zero or multiple faces will be regarded as an error. Out of detectable face size, large head-pose, or very large occlusions will also result in fail to add a person face.
     *

     * The given rectangle specifies both face location and face size at the same time. There is no guarantee of corrent result if you are using rectangle which are not returned from Face - Detect.
     *
     * @param personGroupId The target person's belonging person group's ID.
     * @param personId      Target person that the face is added to.
     * @param userData      Optional fields for user-provided data attached to a person. Size limit is 16KB.
     * @param image         Face image image (as a file). Valid image size is from 1KB to 4MB. Only one face is allowed per image.
     * @return a built {@link AddFaceToPersonAction}
     * @see MS Cognitive Docs (Person - Add a Person Face)
     */
    @NotNull
    public AddFaceToPersonAction addFaceToPerson(@NotNull String personGroupId, @NotNull String personId, String userData, File image) {
        return addFaceToPerson(personGroupId, personId, userData, Utils.fileToFileInputStream(image));

    }

    /**
     * Retrieve a person's information, including registered faces, name and userData.
     *
     * @param personGroupId - The target person's belonging person group's ID.
     * @param personId      - The target person ID.
     * @return a built {@link GetPersonAction}
     * @see MS Cognitive Docs (Person - Get a Person)
     */
    @NotNull
    public GetPersonAction getPerson(@NotNull String personGroupId, @NotNull String personId) {
        Validation.validate(personGroupId, "^[a-z0-9_-]{1,64}$", new ParameterValidationException("personGroupId", "Person group ID is invalid. Valid format should be a string composed by numbers, english letters in lower case, '-', '_', and no longer than 64 characters."));
        return new GetPersonAction(cognitiveContext, personGroupId, personId);
    }

    /**
     * Delete an existing person from a person group. Persisted face images of the person will also be deleted.
     *
     * @param personGroupId - The target person's belonging person group's ID.
     * @param personId      - The target person ID.
     * @return a built {@link GetPersonAction}
     * @see MS Cognitive Docs (Person - Delete a Person)
     */
    @NotNull
    public DeletePersonAction deletePerson(@NotNull String personGroupId, @NotNull String personId) {
        Validation.validate(personGroupId, "^[a-z0-9_-]{1,64}$", new ParameterValidationException("personGroupId", "Person group ID is invalid. Valid format should be a string composed by numbers, english letters in lower case, '-', '_', and no longer than 64 characters."));
        return new DeletePersonAction(cognitiveContext, personGroupId, personId);
    }

    /**
     * Update a person's name or userData field.
     *
     * @param personGroupId - The target person's belonging person group's ID.
     * @param personId      - The target person ID.
     * @param name          - Target person's display name. The maximum length is 128.
     * @param userData      - 	Optional fields for user-provided data attached to a person. Size limit is 16KB.
     * @return a built {@link UpdatePersonAction}
     * @see MS Cognitive Docs (Person - Update a Person)
     */
    @NotNull
    public UpdatePersonAction updatePerson(@NotNull String personGroupId, @NotNull String personId, String name, String userData) {
        Validation.validate(personGroupId, "^[a-z0-9_-]{1,64}$", new ParameterValidationException("personGroupId", "Person group ID is invalid. Valid format should be a string composed by numbers, english letters in lower case, '-', '_', and no longer than 64 characters."));
        Validation.validate(name, "^.{1,128}$", new ParameterValidationException("name", "The maximum length is 128"));
        Validation.validate(userData, 16, new ParameterValidationException("userData", "The size limit is 16KB"));
        return new UpdatePersonAction(cognitiveContext, personGroupId, personId, name, userData);
    }

    /**
     * Retrieve information about a face (specified by face ID, person ID and its belonging person group ID).
     *
     * @param personGroupId   - The target person's belonging person group's ID.
     * @param personId        - The target person ID.
     * @param persistedFaceId - The target face ID.
     * @return a built {@link GetPersonFaceAction}
     * @see MS Cognitive Docs (Person - Get a Person Face)
     */
    @NotNull
    public GetPersonFaceAction getPersonFace(@NotNull String personGroupId, @NotNull String personId, String persistedFaceId) {
        Validation.validate(personGroupId, "^[a-z0-9_-]{1,64}$", new ParameterValidationException("personGroupId", "Person group ID is invalid. Valid format should be a string composed by numbers, english letters in lower case, '-', '_', and no longer than 64 characters."));
        return new GetPersonFaceAction(cognitiveContext, personGroupId, personId, persistedFaceId);
    }

    /**
     * Delete a face from a person. Relative image for the persisted face will also be deleted.
     *
     * @param personGroupId   - The target person's belonging person group's ID.
     * @param personId        - The target person ID.
     * @param persistedFaceId - The target face ID.
     * @return a built {@link DeletePersonFaceAction}
     * @see MS Cognitive Docs (Person - Delete a Person Face)
     */
    @NotNull
    public DeletePersonFaceAction deletePersonFace(@NotNull String personGroupId, String personId, String persistedFaceId) {
        Validation.validate(personGroupId, "^[a-z0-9_-]{1,64}$", new ParameterValidationException("personGroupId", "Person group ID is invalid. Valid format should be a string composed by numbers, english letters in lower case, '-', '_', and no longer than 64 characters."));
        return new DeletePersonFaceAction(cognitiveContext, personGroupId, personId, persistedFaceId);
    }

    /**
     * Update a person face's userData field.
     *
     * @param personGroupId   - The target person's belonging person group's ID.
     * @param personId        - The target person ID.
     * @param persistedFaceId - The target face ID.
     * @param userData        - Attach user data to person's face. The size limit is 1KB.
     * @return a built {@link UpdateFaceToPersonAction}
     * @see MS Cognitive Docs (Person - Update a Person Face)
     */
    @NotNull
    public UpdateFaceToPersonAction updatePersonFace(@NotNull String personGroupId, @NotNull String personId, @NotNull String persistedFaceId, @Nullable String userData) {
        Validation.validate(personGroupId, "^[a-z0-9_-]{1,64}$", new ParameterValidationException("personGroupId", "Person group ID is invalid. Valid format should be a string composed by numbers, english letters in lower case, '-', '_', and no longer than 64 characters."));
        Validation.validate(userData, 1, new ParameterValidationException("userData", "User-specified data for any purpose. The maximum length is 1KB."));
        return new UpdateFaceToPersonAction(cognitiveContext, personGroupId, personId, persistedFaceId, userData);
    }

    /**
     * List all people in a person group, and retrieve person information (including person ID, name, user data and registered faces of the person).
     *
     * @param personGroupId - The target person's belonging person group's ID.
     * @return a built {@link ListPersonsInPersonGroupAction}
     * @see MS Cognitive Docs (Person - List Persons in a Person Group)
     */
    @NotNull
    public ListPersonsInPersonGroupAction listPersonsInPersonGroup(@NotNull String personGroupId) {
        Validation.validate(personGroupId, "^[a-z0-9_-]{1,64}$", new ParameterValidationException("personGroupId", "Person group ID is invalid. Valid format should be a string composed by numbers, english letters in lower case, '-', '_', and no longer than 64 characters."));
        return new ListPersonsInPersonGroupAction(cognitiveContext, personGroupId);
    }
}


text:
namespace lib {

    BOOST_PARAMETER_NAME(name)
    BOOST_PARAMETER_NAME(index)

    BOOST_PARAMETER_FUNCTION(
        (int), f, tag, (optional (name,*,"bob")(index,(int),1))
    )
    {
        std::cout << name << ":" << index << std::endl;
        return index;
    }
}

#include <boost/core/lightweight_test.hpp>

using lib::_name;
using lib::_index;

int main()
{
    int x = lib::f(_name = "jill", _index = 1);
    BOOST_TEST_EQ(x, 1);
    return boost::report_errors();
}


text:
    $("#stw").click(function()
    {
    	$("#practicas").show();
    	$("#asignatura_seleccionada").html("Sistemas y tecnologías web");
    	location.href="#practicas";
   		$("#mensaje_aviso").css("display","none");
   		$("#practica1").fadeIn();
    });
    $("#gco").click(function()
    {
    	$("#practicas").show();
    	$("#asignatura_seleccionada").html("Gestión del conocimiento en las organizaciones");
    	location.href="#practicas";
    	$("#practica1").css("display","none");
    	$("#mensaje_aviso").fadeIn();
 		$("#mensaje_aviso").html("No se han realizado prácticas");
    });
    $("#dsi").click(function()
    {
    	$("#practicas").show();
    	$("#asignatura_seleccionada").html("Desarrollo de sistemas informáticos");
    	location.href="#practicas";
    	$("#practica1").css("display","none");
    	$("#mensaje_aviso").fadeIn();
 		$("#mensaje_aviso").html("No se han realizado prácticas");
    });
    $("#tio").click(function()
    {
    	$("#practicas").show();
    	$("#asignatura_seleccionada").html("Tecnologías de la información para las organizaciones");
    	location.href="#practicas";
    	$("#practica1").css("display","none");
    	$("#mensaje_aviso").fadeIn();
		$("#mensaje_aviso").html("No se han realizado prácticas");
    	$("#resumen_practica").css("display","none");
    });
    $("#lpp").click(function()
    {
    	$("#practicas").show();
    	$("#asignatura_seleccionada").html("Lenguajes y paradigmas de programación");
    	location.href="#practicas";
    	$("#practica1").css("display","none");
    	$("#mensaje_aviso").fadeIn();
		$("#mensaje_aviso").html("No se han realizado prácticas");
    });
    $("#ia").click(function()
    {
    	$("#practicas").show();
    	$("#asignatura_seleccionada").html("Inteligencia artificial");
      	location.href="#practicas";
      	$("#practica1").css("display","none");
      	$("#mensaje_aviso").fadeIn();
		$("#mensaje_aviso").html("No se han realizado prácticas");
    });
    $("#ssi").click(function()
    {
    	$("#practicas").show();
    	$("#asignatura_seleccionada").html("Seguridad de Sistemas Informáticos");
      	location.href="#practicas";
      	$("#practica1").css("display","none");
      	$("#mensaje_aviso").fadeIn();
		$("#mensaje_aviso").html("No se han realizado prácticas");
    });
    $("#aeda").click(function()
    {
    	$("#practicas").show();
    	$("#asignatura_seleccionada").html("Algoritmos y Estructuras de Datos Avanzadas");
      	location.href="#practicas";
      	$("#practica1").css("display","none");
      	$("#mensaje_aviso").fadeIn();
		$("#mensaje_aviso").html("No se han realizado prácticas");
    });
    $("#uya").click(function()
    {
    	$("#practicas").show();
    	$("#asignatura_seleccionada").html("Usabilidad y Accesibilidad");
      	location.href="#practicas";
      	$("#practica1").css("display","none");
      	$("#mensaje_aviso").fadeIn();
		$("#mensaje_aviso").html("No se han realizado prácticas");
    });

    $("#practica1").click(function()
    {

    	$("#resumen_practica").fadeIn();
    });


text:
XMLDocument::XMLDocument(NAHeap *heap, XMLElementMapper &elementMapper)
  : documentElementMapper_(elementMapper),
    documentElement_(NULL),
    currElemPtr_(NULL),
    parser(XML_ParserCreate(NULL))
{
  XML_UseParserAsHandlerArg(parser);
  XML_SetElementHandler(parser, startElementHandler, endElementHandler);
  XML_SetCharacterDataHandler(parser, charDataHandler);

  // The heap used while parsing the XML document is accessed through the
  // XML_GetNAHeap/XML_SetNAHeap functions we added to expat.
  XML_SetNAHeap(parser, heap);

  // Put ptr to XMLDocument in parser's user data. If a shared pointer is used
  // for the XMLDocument this is still ok, because when the reference count
  // for the shared pointer gets to 0 and the XMLDocument gets deleted, the
  // then-dangling conventional pointer stored in the parser data structure will
  // not be accessible because the parser is private to XMLDocument.
  XML_SetUserData(parser, this);
}

XMLElementPtr XMLDocument::parse(const char *buf, Int32 len, Int32 done)
{
  if (documentElement_)
    throw XMLException("Already contains a document; use clear() first");
  if (!XML_Parse(parser, buf, len, done))
    throw XMLException("%s at column %d of line %d",
                       XML_ErrorString(XML_GetErrorCode(parser)),
                       XML_GetCurrentColumnNumber(parser),
                       XML_GetCurrentLineNumber(parser));
  if (done)
    documentElement_ = getCurrentElement(parser);
  return documentElement_;
}

void XMLDocument::serialize(XMLString &xml)
{
  if (documentElement_)
    documentElement_->toXML(xml);
  else
    throw XMLException("This XMLDocument does not currently contain a document");
}

const XMLElementPtr& XMLDocument::getDocumentElement() const
{
  return documentElement_;
}

void XMLDocument::startElementHandler(void *parser,
                                        const char *elemName,
                                        const char **atts)
{
  XMLElementPtr containingElement = getCurrentElement(parser);
  if (containingElement)
    containingElement->startElement(parser, elemName, atts);
  else
    {
      containingElement = ((XMLDocument*)(XML_GetUserData(parser)))->documentElementMapper_(parser, (char*)elemName, atts);
      if (!containingElement)
        throw XMLException("Unknown top-level element: %s", elemName);
      else
        setCurrentElement(parser, containingElement);
    }
}

void XMLDocument::endElementHandler(void *parser, const char *name)
{
  getCurrentElement(parser)->endElement(parser, name);
//  setCurrentElement(parser, getCurrentElement(parser)->getParent());
}

void XMLDocument::charDataHandler(void *parser, const char *data, Int32 len)
{
  // @ZX
  XMLElementPtr ptr = getCurrentElement(parser);
  ptr->charData(parser, data, len);
  //getCurrentElement(parser)->charData(parser, data, len);
}

//
// XMLElement
//

void XMLElement::toXML(XMLString& xml, NABoolean sameLine, NABoolean noEndTag)
{
  // Indent to the current level and write start tag and attributes.
  xml.indent();
  xml.append('<').append(getElementName()).append(' ');
  serializeAttrs(xml);
  if (xml[xml.length()-1] == ' ')
    xml.remove(xml.length()-1);

  // If caller requests abbreviated form for element with no content, make sure
  // the element is actually empty. Note the early return if the abbreviated
  // form is used.
  if (noEndTag)
    {
      size_t len = xml.length();
      serializeBody(xml);
      assertLogAndThrow(CAT_SQL_COMP_QR_COMMON, LL_MVQR_FAIL,
                        len == xml.length(), QRLogicException,
		        "Tried to omit closing tag, but element has content");
      xml.append("/>");
      xml.endLine();
      return;
    }
  else
    xml.append('>');

  // If content is to appear on same line, serialize the body without any
  // newlines or indentation.
  if (sameLine)
    serializeBody(xml);
  else
    {
      xml.endLine();
      xml.incrementLevel();
      serializeBody(xml);
      xml.decrementLevel();
      xml.indent();
    }

  // Write the end tag and end the line.
  xml.append("</").append(getElementName()).append('>');
  xml.endLine();
}

void XMLElement::stripWhitespace(const char*& data, Int32& len)
{
  const char* endPtr = data + len - 1;
  while (data <= endPtr && isspace(*data))
    data++;
  while (data <= endPtr && isspace(*endPtr))
    endPtr--;
  len = (endPtr - data) + 1;
}

NABoolean XMLElement::isspace(char c)
{
  switch (c)
  {
  case ' ':
  case '\t':
  case '\r':
  case '\n':
    return TRUE;

  default:
    return FALSE;
  }
}

//
// XMLBitmap
//

char XMLBitmap::HexChars_[] =
  { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' };

void XMLBitmap::toXML(XMLString& xml) const
{
  Int32 nWords = getWordSize();
  Int32 nBytes = nWords * sizeof(WordAsBits);
  NAString hexString((NASize_T)(nBytes*2));
  for (Int32 i=0; i<nWords; i++)
  {
    // Get the word.
    WordAsBits thisWord = word(i);

    for (Int32 j=0; j<sizeof(WordAsBits)*2; j++)
    {
      // Get the half byte.
      Int32 offset = j*4;
      WordAsBits mask = 0x000F << offset;
      unsigned char thisHalfByte = (unsigned char)((thisWord & mask) >> offset);

      char thisChar = HexChars_[thisHalfByte];
      hexString += thisChar;
    }
  }

  xml.append(hexString);
}  // toXML()

void XMLBitmap::initFromHexString(const char* hexChar, UInt32 nBits)
{
  resize((nBits + BitsPerWord) / BitsPerWord);

  Int32 nWords = getWordSize();
  CollIndex wordStartBit;

  // The outer loop is on 32 bit words.
  for (Int32 wordIndex=0; wordIndex<nWords; wordIndex++)
  {
    wordStartBit = wordIndex * BitsPerWord;

    // Next loop is on 4 bit nibbles (each is 1 hex digit)
    // Note that the index of this loop must be a signed int, because it goes
    // negative for the termination condition.
    for (Int32 nibbleBitOffsetInWord = (sizeof(WordAsBits)*2-1)*4;
             nibbleBitOffsetInWord >= 0;
             nibbleBitOffsetInWord -= 4)
    {
      char thisDigit = *(hexChar++);
      if (thisDigit == '0')
	continue;

      // Finally loop on the bits within the nibble.
      unsigned char thisBits = hexDigitToInt(thisDigit);
      for (Int32 bitInNibble=0; bitInNibble<4; bitInNibble++)
      {
        if ((thisBits >> (3 - bitInNibble)) & BIT0)
          addElementFast(wordStartBit + nibbleBitOffsetInWord + bitInNibble);
      }
    }
  }
}  // initFromHexString()

unsigned char XMLBitmap::hexDigitToInt(char c)
{
  assertLogAndThrow1(CAT_SQL_COMP_QR_COMMON, LL_MVQR_FAIL,
                     (c>='0' && c<='9') || (c>='A' && c<='F'), QRLogicException,
		      "input to hexDigitToInt() must be a hex digit, not '%c'.", c);
  if (c <= '9')
    return c-'0';
  else
    return 10 + (c-'A');
}


text:
package EBiSC::Question::Biosamples::OriginDonor;
use Moose;
use namespace::autoclean;
use boolean qw(true false);
use strict;
use warnings;

our $title = 'Is batch "Origin donor" in Biosamples always consistent with the IMS donor?';
our $description = <<EOF;

A batch is tested if...

* If batch is listed for a cell line in the IMS API
* ...and if batch is exported by Biosamples API
* ...and if IMS has a donor biosample id

Requirements to pass:

Passes if "origin donor" tag in Biosamples matches donor biosamples ID in IMS

EOF

sub run {
  my ($self) = @_;

  my $cursor = $self->db->ims_line->c->find(
    {'obj.donor.biosamples_id' => {'$exists' => boolean::true}},
    {projection => {'name' => 1, 'obj.batches.biosamples_id' => 1, 'obj.donor.biosamples_id' => 1}},
  );
  my $num_tested = 0;
  LINE:
  while (my $next = $cursor->next) {
    ID:
    foreach my $id ( map {$_->{biosamples_id}} @{$next->{obj}{batches}}) {
      my $biosamples_doc = $self->db->biosample_group->c->find_one(
        {biosample_id => $id},
        {'obj.characteristics.originDonor.text' => 1},
      );
      next ID if !$biosamples_doc;
      $num_tested += 1;
      my ($pass, $fail) = (0,0);
      foreach my $char (@{$biosamples_doc->{obj}{characteristics}{originDonor}}) {
        if ($char->{text} && $char->{text} eq $next->{obj}{donor}{biosamples_id}) {
          $pass = 1;
        }
        else {
          $fail = 1;
        }
      }
      next ID if $pass && !$fail;
      $self->add_failed_batch(cell_line => $next->{name}, batch => $id);
    }
  }

  $self->num_tested($num_tested);

}

with 'EBiSC::Question::Role::Question';

1;


text:
import pytest

from vcr.request import Request
from vcr.serializers.jsonserializer import serialize

def test_serialize_binary():
    request = Request(method="GET", uri="http://localhost/", body="", headers={})
    cassette = {"requests": [request], "responses": [{"body": b"\x8c"}]}

    with pytest.raises(Exception) as e:
        serialize(cassette)
        assert (
            e.message
            == "Error serializing cassette to JSON. Does this \
            HTTP interaction contain binary data? If so, use a different \
            serializer (like the yaml serializer) for this request"
        )


text:
Sacred Texts
Sagas and Legends
English Folklore
Index
Previous
Next

THE WELL AT ALTAR-NUN.

CURE OF INSANITY.

MONGST the numerous holy wells which exist in Cornwall,
that of Alternosi, or Altar-Nun, is the only one, as far as I can learn,
which possessed the virtue of curing the insane.

We are told that Saint Nunne or Nuanita was the daughter
of an Earl of Cornwall, and the mother of St David; that the holy well,
which is situated about a mile from the cathedral of St David, was dedicated
to her; and that she bestowed on the waters of the Cornish well those
remarkable powers, which were not given to the Welsh one, from her fondness
for the county of her birth.

Carew, in his "Survey of Cornwall," thus describes the
practice :--

"The water running from St Nun's well fell into a square and
enclosed walled plot, which might be filled at what depth they listed. Upon
this wall was the frantic person put to stand, his back towards the pool,
and from thence, with a sudden blow in the breast, tumbled headlong into the
pond; where a strong fellow, provided for the nonce, took him, and tossed
him up and down, amongst and athwart the water, till the patient, by
foregoing his' strength, had somewhat forgot his fury. Then was he conveyed
to the church, and certain masses said over him; upon which handling, if his
right wits returned, St Nun had the thanks; but if there appeared small
amendment, he was bowssened again and again, while there remained in him any
hope of life or recovery."

The 2d of March is dedicated to St Nun, and the influence
of the water is greatly exalted on that day.

Although St Nun's well has been long famous, and the
celebrity of its waters extended far, yet there was a belief prevailing
amidst the uneducated, that the sudden shock produced by suddenly plunging
an insane person into water was most effective in producing a return to
reason.

On one occasion, a woman of weak mind, who was suffering
under the influence of a religious monomania, consulted me on the benefit
she might hope to receive from electricity. The burden of her
ever-melancholy tale was, that "she had lost her God; "and she told me, with
a strange mixture of incoherence and reason, that her conviction was, that a
sudden shock would cure her. She had herself proposed to her husband and
friends that they should take her to a certain rock on St Michael's Mount,
stand her on it, with her back to the sea, when "the waters were the
strongest, at the flowing of the tide;" and after having prayed with her,
give her the necessary blow on the chest, and thus plunge her into the
waters below. I know not that the experiment was ever made in the case of
this poor woman, but I have heard of several instances where this sudden
plunge had been tried as a cure for insanity.

Mr T. Q. Couch thus describes the present condition of
this well in a paper on "Well-Worship: " [a]

"On the western side of the beautiful valley through
which flows the Trelawney River, and near Hobb's Park, in the parish of
Pelynt, Cornwall, is St Nun's, or St Ninnie's Well. Its position was, until
lately, to be discovered by the oak-tree matted with ivy, and the thicket of
willow and bramble which grew upon its roof. The front of the well is of a
pointed form, and has a rude entrance about four feet high, and spanned
above by a single flat stone, which leads into a grotto with arched roof.
The walls on the interior are draped with luxuriant fronds of spleenwort,
hart's-tongue, and a rich undercovering of liverwort. At the further end of
the floor is a round granite basin, with a deeply moulded brim, and
ornamented on' its circumference with a series of rings, each enclosing a
cross or a ball. The water weeps into it from an opening at the back, and
escapes again by a hole in the bottom. This interesting piece of antiquity
has been protected by a tradition which we could wish to attach to some of
our cromlechs and circles in danger of spoliation."

According to the narrative given by Mr Bond in his "History
of Looe," the sacred

protection given must have been limited in time, as the
following story will prove :--

"KIPPISCOMBE LANE,

Probably so called from a consecrated well on the right
hand .side of the road. The titular saint of this well is supposed to have
been St Cuby, now corrupted into Keby's Well. The spring flows Into a
circular basin or reservoir of granite, or of some stone like it, two feet
four inches at its extreme diameter at top, and about two feet high. It
appears to have been neatly carved and ornamented in its lower part with the
figure of a griffin, and round the edge with dolphins, now much defaced. The
water was formerly carried off by a drain or hole at the bottom, like those
usually seen in fonts and piscinas. This basin (which I take to be an old
font) was formerly much respected by the neighbours, who conceived some
great misfortune would befall the person who should attempt to remove it
from where it stood, and that it required immense power to remove it. A
daring fellow, however (says a story), once went with a team of oxen for the
express purpose of removing it. On his arrival at the spot, one of the oxen
fell down dead, which so alarmed the fellow that he desisted from the
attempt he was about to make. There are several loose stones scattered round
this basin or reservoir, perhaps the remains of some building which formerly
enclosed it--a small chapel likely. The last time I saw this reservoir, it
had been taken many feet from where it used to stand, and a piece of the
brim of it had been recently struck off ?'

[a] Notes and Queries.

Next: St Gundred's Well at Roach Rock


text:
package com.bobcat.dao.impl;

import javax.persistence.FlushModeType;
import javax.persistence.NoResultException;

import org.springframework.stereotype.Repository;

import com.bobcat.dao.AdminDao;
import com.bobcat.entity.Admin;

@Repository("adminDaoImpl")
public class AdminDaoImpl extends BaseDaoImpl<Admin, Long> implements AdminDao
{

	public boolean usernameExists(String username)
	{
		if (username == null)
		{
			return false;
		}
		String jpql = "select count(*) from Admin admin where lower(admin.username) = lower(:username)";
		Long count = entityManager.createQuery(jpql, Long.class).setFlushMode(FlushModeType.COMMIT)
				.setParameter("username", username).getSingleResult();
		return count > 0;
	}

	public Admin findByUsername(String username)
	{
		if (username == null)
		{
			return null;
		}
		try
		{
			String jpql = "select admin from Admin admin where lower(admin.username) = lower(:username)";
			return entityManager.createQuery(jpql, Admin.class).setFlushMode(FlushModeType.COMMIT)
					.setParameter("username", username).getSingleResult();
		} catch (NoResultException e)
		{
			return null;
		}
	}

}


text: An android application to notify your close ones when in trouble


text:
import { spawn } from 'process-promises';

var testdata = require('../testdata.json');

describe('spawn', () => {
    describe('node test/executable.js', () => {
        it('should emit child process', done => {
            let childProcess;

            spawn('node', ['test/executable.js'])
                .on('process', process => childProcess = process)
                .then(result => {
                    expect(childProcess).not.toBeUndefined();
                    expect(childProcess).not.toBeNull();
                }, err => fail(err))
                .finally(done);
        });

        it('should emit stdout', done => {
            let lines = [];

            spawn('node', ['test/executable.js'])
                .on('stdout', line => lines.push(line))
                .then(result => {
                    expect(lines).toEqual(testdata.stdout);
                }, err => fail(err))
                .finally(done);
        });

        it('should emit stderr', done => {
            let lines = [];

            spawn('node', ['test/executable.js'])
                .on('stderr', line => lines.push(line))
                .then(result => {
                    expect(lines).toEqual(testdata.stderr);
                }, err => fail(err))
                .finally(done);
        });

        it('should return with exit code 0', done => {
            spawn('node', ['test/executable.js'])
                .then(result => {
                    expect(result.exitCode).toBe(0);
                }, err => fail(err))
                .finally(done);
        });
    });
});


text:
require 'spec_helper'

describe Dolphin::Deploy do

  it "must be defined" do
    Dolphin::Deploy.wont_be_nil
  end

end


text:
// @filename: /types/lib/index.d.ts

interface Lib { x }

// @filename: /mod1.ts

export function foo(): Lib { return {x: 1} }

// @filename: /mod2.ts

import {foo} from "./mod1";
export const bar = foo();


text:
module Ferry
  module DSL
    module Env

      def configure_backend
        env.configure_backend
      end

      def fetch(key, default=nil, &block)
        env.fetch(key, default, &block)
      end

      def any?(key)
        value = fetch(key)
        if value && value.respond_to?(:any?)
          value.any?
        else
          !fetch(key).nil?
        end
      end

      def set(key, value)
        env.set(key, value)
      end

      def set_if_empty(key, value)
        env.set_if_empty(key, value)
      end

      def delete(key)
        env.delete(key)
      end

      def ask(key, value, options={})
        env.ask(key, value, options)
      end

      def role(name, servers, options={})
        env.role(name, servers, options)
      end

      def server(name, properties={})
        env.server(name, properties)
      end

      def roles(*names)
        env.roles_for(names.flatten)
      end

      def role_properties(*names, &block)
        env.role_properties_for(names, &block)
      end

      def release_roles(*names)
        if names.last.is_a? Hash
          names.last.merge!({ :exclude => :no_release })
        else
          names << { exclude: :no_release }
        end
        roles(*names)
      end

      def primary(role)
        env.primary(role)
      end

      def env
        Configuration.env
      end

      def release_timestamp
        env.timestamp.strftime("%Y%m%d%H%M%S")
      end

      def asset_timestamp
        env.timestamp.strftime("%Y%m%d%H%M.%S")
      end

    end
  end
end


text:
#pragma once
#include <memory>
#include <list>
#include <queue>
#include <set>
#include <chrono>
#include "J2534_v0404.h"
#include "panda_shared/panda.h"
#include "synchronize.h"
#include "Action.h"
#include "MessageTx.h"
#include "J2534Connection.h"

class J2534Connection;
class Action;
class MessageTx;

/**
Class representing a physical panda adapter. Instances are created by
PassThruOpen in the J2534 API. A Device can create one or more
J2534Connections.
*/
class PandaJ2534Device {
public:
	PandaJ2534Device(std::unique_ptr<panda::Panda> new_panda);

	~PandaJ2534Device();

	static std::shared_ptr<PandaJ2534Device> openByName(std::string sn);

	DWORD closeChannel(unsigned long ChannelID);
	DWORD addChannel(std::shared_ptr<J2534Connection>& conn, unsigned long* channel_id);

	std::unique_ptr<panda::Panda> panda;
	std::vector<std::shared_ptr<J2534Connection>> connections;

	//Place the Action in the task queue based on the Action's expiration time,
	//then signal the thread that processes actions.
	void insertActionIntoTaskList(std::shared_ptr<Action> action);

	void scheduleAction(std::shared_ptr<Action> msg, BOOL startdelayed=FALSE);

	void registerConnectionTx(std::shared_ptr<J2534Connection> conn);

	//Resume sending messages from the provided Connection's TX queue.
	void unstallConnectionTx(std::shared_ptr<J2534Connection> conn);

	//Cleans up several queues after a message completes, is canceled, or otherwise goes away.
	void removeConnectionTopAction(std::shared_ptr<J2534Connection> conn, std::shared_ptr<MessageTx> msg);

	//Messages that have been sent on the wire will be echoed by the panda when
	//transmission is complete. This tracks what is still waiting to hear an echo.
	std::queue<std::shared_ptr<MessageTx>> txMsgsAwaitingEcho;

private:
	HANDLE thread_kill_event;

	HANDLE can_recv_handle;
	static DWORD WINAPI _can_recv_threadBootstrap(LPVOID This) {
		return ((PandaJ2534Device*)This)->can_recv_thread();
	}
	DWORD can_recv_thread();

	HANDLE can_process_handle;
	static DWORD WINAPI _can_process_threadBootstrap(LPVOID This) {
		return ((PandaJ2534Device*)This)->can_process_thread();
	}
	DWORD can_process_thread();

	HANDLE flow_control_wakeup_event;
	HANDLE flow_control_thread_handle;
	static DWORD WINAPI _msg_tx_threadBootstrap(LPVOID This) {
		return ((PandaJ2534Device*)This)->msg_tx_thread();
	}
	DWORD msg_tx_thread();
	std::list<std::shared_ptr<Action>> task_queue;
	Mutex task_queue_mutex;

	std::queue<std::shared_ptr<J2534Connection>> ConnTxQueue;
	std::set<std::shared_ptr<J2534Connection>> ConnTxSet;
	Mutex connTXSet_mutex;
	BOOL txInProgress;
};


text:
namespace BeeEnginePerfTests
{
    class BeePerfTests
    {
        static void Main(string[] args)
        {
            new FindMateTest().Run();
        }
    }
}


text:
namespace google {
namespace protobuf {

UnknownFieldSet::UnknownFieldSet()
  : fields_(NULL) {}

UnknownFieldSet::~UnknownFieldSet() {
  Clear();
  delete fields_;
}

void UnknownFieldSet::Clear() {
  if (fields_ != NULL) {
    for (int i = 0; i < fields_->size(); i++) {
      (*fields_)[i].Delete();
    }
    fields_->clear();
  }
}

void UnknownFieldSet::MergeFrom(const UnknownFieldSet& other) {
  for (int i = 0; i < other.field_count(); i++) {
    AddField(other.field(i));
  }
}

int UnknownFieldSet::SpaceUsedExcludingSelf() const {
  if (fields_ == NULL) return 0;

  int total_size = sizeof(*fields_) + sizeof(UnknownField) * fields_->size();
  for (int i = 0; i < fields_->size(); i++) {
    const UnknownField& field = (*fields_)[i];
    switch (field.type()) {
      case UnknownField::TYPE_LENGTH_DELIMITED:
        total_size += sizeof(*field.length_delimited_) +
          internal::StringSpaceUsedExcludingSelf(*field.length_delimited_);
        break;
      case UnknownField::TYPE_GROUP:
        total_size += field.group_->SpaceUsed();
        break;
      default:
        break;
    }
  }
  return total_size;
}

int UnknownFieldSet::SpaceUsed() const {
  return sizeof(*this) + SpaceUsedExcludingSelf();
}

void UnknownFieldSet::AddVarint(int number, uint64 value) {
  if (fields_ == NULL) fields_ = new vector<UnknownField>;
  UnknownField field;
  field.number_ = number;
  field.type_ = UnknownField::TYPE_VARINT;
  field.varint_ = value;
  fields_->push_back(field);
}

void UnknownFieldSet::AddFixed32(int number, uint32 value) {
  if (fields_ == NULL) fields_ = new vector<UnknownField>;
  UnknownField field;
  field.number_ = number;
  field.type_ = UnknownField::TYPE_FIXED32;
  field.fixed32_ = value;
  fields_->push_back(field);
}

void UnknownFieldSet::AddFixed64(int number, uint64 value) {
  if (fields_ == NULL) fields_ = new vector<UnknownField>;
  UnknownField field;
  field.number_ = number;
  field.type_ = UnknownField::TYPE_FIXED64;
  field.fixed64_ = value;
  fields_->push_back(field);
}

string* UnknownFieldSet::AddLengthDelimited(int number) {
  if (fields_ == NULL) fields_ = new vector<UnknownField>;
  UnknownField field;
  field.number_ = number;
  field.type_ = UnknownField::TYPE_LENGTH_DELIMITED;
  field.length_delimited_ = new string;
  fields_->push_back(field);
  return field.length_delimited_;
}

UnknownFieldSet* UnknownFieldSet::AddGroup(int number) {
  if (fields_ == NULL) fields_ = new vector<UnknownField>;
  UnknownField field;
  field.number_ = number;
  field.type_ = UnknownField::TYPE_GROUP;
  field.group_ = new UnknownFieldSet;
  fields_->push_back(field);
  return field.group_;
}

void UnknownFieldSet::AddField(const UnknownField& field) {
  if (fields_ == NULL) fields_ = new vector<UnknownField>;
  fields_->push_back(field);
  fields_->back().DeepCopy();
}

bool UnknownFieldSet::MergeFromCodedStream(io::CodedInputStream* input) {

  UnknownFieldSet other;
  if (internal::WireFormat::SkipMessage(input, &other) &&
                                  input->ConsumedEntireMessage()) {
    MergeFrom(other);
    return true;
  } else {
    return false;
  }
}

bool UnknownFieldSet::ParseFromCodedStream(io::CodedInputStream* input) {
  Clear();
  return MergeFromCodedStream(input);
}

bool UnknownFieldSet::ParseFromZeroCopyStream(io::ZeroCopyInputStream* input) {
  io::CodedInputStream coded_input(input);
  return ParseFromCodedStream(&coded_input) &&
    coded_input.ConsumedEntireMessage();
}

bool UnknownFieldSet::ParseFromArray(const void* data, int size) {
  io::ArrayInputStream input(data, size);
  return ParseFromZeroCopyStream(&input);
}

void UnknownField::Delete() {
  switch (type()) {
    case UnknownField::TYPE_LENGTH_DELIMITED:
      delete length_delimited_;
      break;
    case UnknownField::TYPE_GROUP:
      delete group_;
      break;
    default:
      break;
  }
}

void UnknownField::DeepCopy() {
  switch (type()) {
    case UnknownField::TYPE_LENGTH_DELIMITED:
      length_delimited_ = new string(*length_delimited_);
      break;
    case UnknownField::TYPE_GROUP: {
      UnknownFieldSet* group = new UnknownFieldSet;
      group->MergeFrom(*group_);
      group_ = group;
      break;
    }
    default:
      break;
  }
}

}  // namespace protobuf
}  // namespace google


text:
# Authorize.Net AIM. Get it started.

In this chapter we are going to talk about the most common task: purchase of a product using [Authorize.Net AIM](http://www.authorize.net/).
We assume you already read basic [get it started](../get-it-started.md).
Here we just show you modifications you have to put to the files shown there.

## Installation

The preferred way to install the library is using [composer](http://getcomposer.org/).
Run composer require to add dependencies to _composer.json_:

```bash
php composer.phar require payum/authorize-net-aim php-http/guzzle6-adapter
```

## config.php

We have to only add the gateway factory. All the rest remain the same:

```php
<?php
//config.php

use Payum\Core\PayumBuilder;
use Payum\Core\Payum;

/** @var Payum $payum */
$payum = (new PayumBuilder())
    ->addDefaultStorages()
    ->addGateway('authorize_net', [
        'factory' => 'authorize_net_aim',
        'login_id' => 'REPLACE IT',
        'transaction_key' => 'REPLACE IT',
        'sandbox' => true,
    ])

    ->getPayum()
;
```

## prepare.php

Here you have to modify a `gatewayName` value. Set it to `authorize_net`. The rest remain the same as described in basic [get it started](../get-it-started.md) documentation.

Back to [index](../../index.md).


text:
Custom Validators
-----------------

The Custom validators are useful when you want to change a particular
behavior of an existing grant. That is often needed because of the
diversity of the identity softwares and to let the oauthlib framework to be
flexible as possible.

However, if you are looking into writing a custom grant type, please
refer to the :doc:`Custom Grant Type </oauth2/grants/custom_grant>`
instead.

.. autoclass::
               oauthlib.oauth2.rfc6749.grant_types.base.ValidatorsContainer
    :members:


text:
import { Component } from '@angular/core';
import { NGL_COLORPICKER_CONFIG, NglColorpickerConfig } from 'ng-lightning';

@Component({
  selector: 'app-demo-colorpicker-config',
  templateUrl: './config.html',
  providers: [
    {
      provide: NGL_COLORPICKER_CONFIG,
      useValue: <NglColorpickerConfig>{
        swatchColors: ['#000000', '#fe4a49', '#2ab7ca', '#fed766', '#e6e6ea', '#f4f4f8', '#ffffff'],
        variant: 'swatches',
      }
    },
  ],
})
export class DemoColorpickerConfig {
  color: string;
}


text:
class Webmail::Filter
  include SS::Document
  include SS::Reference::User
  include SS::UserPermission
  include Webmail::ImapAccessor
  include Webmail::Addon::ApplyFilter

  # 一括処理件数
  APPLY_PER = 100

  field :name, type: String
  field :state, type: String, default: 'enabled'
  field :order, type: Integer, default: 0
  field :from, type: String
  field :to, type: String
  field :subject, type: String
  field :action, type: String
  field :mailbox, type: String

  permit_params :name, :state, :order, :from, :to, :subject, :action, :mailbox

  validates :name, presence: true
  validates :action, presence: true
  validates :mailbox, presence: true, if: ->{ action =~ /copy|move/ }

  validate :validate_conditions

  default_scope -> { order_by order: 1 }

  scope :enabled, -> { where state: 'enabled' }

  scope :search, ->(params) {
    criteria = where({})
    return criteria if params.blank?

    criteria = criteria.keyword_in params[:keyword], :name if params[:keyword].present?
    criteria
  }

  def state_options
    %w(enabled disabled).map { |m| [I18n.t("views.options.state.#{m}"), m] }
  end

  def action_options
    %w(copy move trash delete).map { |m| [I18n.t("webmail.options.action.#{m}"), m] }
  end

  def mailbox_options
    imap.mailboxes.all.map do |box|
      pad = ' ' * 4 * (box.depth)
      ["#{pad}#{ERB::Util.html_escape(box.basename)}".html_safe, box.original_name]
    end
  end

  def decode_mailbox
    return nil if mailbox.blank?
    Net::IMAP.decode_utf7(mailbox)
  end

  def search_keys
    keys = []
    %w(from to subject).each do |key|
      keys += [key.upcase, send(key)] if send(key).present?
    end
    keys
  end

  def apply(mailbox, add_search_keys = [])
    imap.examine(mailbox)
    uids = imap.conn.uid_sort(%w(REVERSE ARRIVAL), add_search_keys + search_keys, 'UTF-8')
    uids_apply(uids, mailbox)
  end

  private
    def validate_conditions
      %w(from to subject).each do |key|
        return true if send(key).present?
      end
      errors.add :base, I18n.t("webmail.errors.blank_conditions")
    end

    def uids_apply(uids, mailbox)
      count = 0
      return count if uids.blank?

      uids.each_slice(APPLY_PER) do |sliced_uids|
        if action == "copy"
          imap.uids_copy(sliced_uids, self.mailbox)
        elsif action == "move"
          imap.examine(mailbox)
          imap.uids_move(sliced_uids, self.mailbox)
        elsif action == "trash"
          imap.uids_move_trash(sliced_uids)
        elsif action == "delete"
          imap.uids_delete(sliced_uids)
        end

        count += imap.last_response_size
      end

      count
    end
end


text:
package io.github.resilience4j.consumer;

import io.github.resilience4j.circuitbreaker.CircuitBreaker;
import io.github.resilience4j.circuitbreaker.CircuitBreakerConfig;
import io.github.resilience4j.circuitbreaker.event.CircuitBreakerEvent;
import org.junit.Test;

import java.io.IOException;
import java.util.concurrent.TimeUnit;

import static io.github.resilience4j.circuitbreaker.event.CircuitBreakerEvent.Type;
import static org.assertj.core.api.Assertions.assertThat;

public class CircularEventConsumerTest {

    @Test
    public void shouldBufferErrorEvents() {
        // tag::shouldBufferEvents[]
        CircuitBreaker circuitBreaker = CircuitBreaker.ofDefaults("testName");
        CircularEventConsumer<CircuitBreakerEvent> ringBuffer = new CircularEventConsumer<>(2);
        circuitBreaker.getEventPublisher().onEvent(ringBuffer);
        // end::shouldBufferEvents[]
        assertThat(ringBuffer.getBufferedEvents()).isEmpty();

        circuitBreaker.onError(0, TimeUnit.NANOSECONDS, new RuntimeException("Bla"));
        circuitBreaker.onError(0, TimeUnit.NANOSECONDS, new RuntimeException("Bla"));
        circuitBreaker.onError(0, TimeUnit.NANOSECONDS, new RuntimeException("Bla"));

        CircuitBreaker.Metrics metrics = circuitBreaker.getMetrics();
        assertThat(metrics.getNumberOfBufferedCalls()).isEqualTo(3);
        assertThat(metrics.getNumberOfFailedCalls()).isEqualTo(3);
        //Because capacity is 2
        assertThat(ringBuffer.getBufferedEvents()).hasSize(2);
    }

    @Test
    public void shouldBufferAllEvents() {
        CircuitBreakerConfig circuitBreakerConfig = CircuitBreakerConfig.custom()
            .slidingWindowSize(3)
            .ignoreExceptions(IOException.class)
            .build();
        CircuitBreaker circuitBreaker = CircuitBreaker.of("testName", circuitBreakerConfig);
        CircularEventConsumer<CircuitBreakerEvent> ringBuffer = new CircularEventConsumer<>(10);
        circuitBreaker.getEventPublisher().onEvent(ringBuffer);
        assertThat(ringBuffer.getBufferedEvents()).isEmpty();

        circuitBreaker.onSuccess(0, TimeUnit.NANOSECONDS);
        circuitBreaker.onError(0, TimeUnit.NANOSECONDS, new RuntimeException("Bla"));
        circuitBreaker.onError(0, TimeUnit.NANOSECONDS, new IOException("Bla"));
        circuitBreaker.onError(0, TimeUnit.NANOSECONDS, new RuntimeException("Bla"));

        CircuitBreaker.Metrics metrics = circuitBreaker.getMetrics();
        assertThat(metrics.getNumberOfBufferedCalls()).isEqualTo(3);
        assertThat(metrics.getNumberOfFailedCalls()).isEqualTo(2);
        circuitBreaker.reset();
        CircuitBreaker.Metrics resetMetrics = circuitBreaker.getMetrics();
        assertThat(resetMetrics.getNumberOfBufferedCalls()).isEqualTo(0);
        assertThat(resetMetrics.getNumberOfFailedCalls()).isEqualTo(0);
        //Because circuit emits 2 error events and one state transition event
        assertThat(ringBuffer.getBufferedEvents()).hasSize(8);
        assertThat(ringBuffer.getBufferedEvents()).extracting("eventType")
            .containsExactly(Type.SUCCESS, Type.ERROR, Type.IGNORED_ERROR, Type.ERROR,
                Type.FAILURE_RATE_EXCEEDED, Type.STATE_TRANSITION, Type.STATE_TRANSITION,
                Type.RESET);
    }

    @Test
    public void shouldNotBufferEvents() {
        CircuitBreaker circuitBreaker = CircuitBreaker.ofDefaults("testName");
        CircularEventConsumer<CircuitBreakerEvent> ringBuffer = new CircularEventConsumer<>(2);
        assertThat(ringBuffer.getBufferedEvents()).isEmpty();

        circuitBreaker.onError(0, TimeUnit.NANOSECONDS, new RuntimeException("Bla"));
        circuitBreaker.onError(0, TimeUnit.NANOSECONDS, new RuntimeException("Bla"));
        circuitBreaker.onError(0, TimeUnit.NANOSECONDS, new RuntimeException("Bla"));
        //Subscription is too late
        circuitBreaker.getEventPublisher().onEvent(ringBuffer);

        CircuitBreaker.Metrics metrics = circuitBreaker.getMetrics();
        assertThat(metrics.getNumberOfBufferedCalls()).isEqualTo(3);
        assertThat(metrics.getNumberOfFailedCalls()).isEqualTo(3);
        //Because Subscription was too late
        assertThat(ringBuffer.getBufferedEvents()).hasSize(0);
    }
}


text:
export enum CommandEvent {
  Room = '[Command Event]',
  Send = '[Command Event] Send',
  ChangeCamToStatic = '[Command Event] Change Cam',
  ChangeCamToTrain = '[Command Event] Change Cam to Train',
  ChangeCamToRollingStock = '[Command Event] Change Cam to RollingStock',
  ChangeSetting = '[Command Event] Change Setting',
}


text:
require "active_tax/version"
require "active_tax/states/wa"
require "active_tax/tax"


text:
<?php if($this->session->flashdata('notif')){ ?>
    <div class="alert alert-<?php echo $this->session->flashdata('notif') ?>">
<button class="close" data-dismiss="alert"></button>
<?php echo $this->session->flashdata('notif') ?>: <?php echo $this->session->flashdata('msg') ?>

<?php } ?>

<?php echo $method ?>

              <input type="hidden" name="base_url" value="<?php echo base_url() ?>" id="base_url">
              <input type="hidden" name="controller" id="controller" value="<?php echo $controller ?>">
              <input type="hidden" name="method" value="<?php echo $function ?>" id="method">

                  No
                   Name
                     Area
                      Unit Type
                      Luas Netto
                      Luas Semigross
                      Block
                      Number
                      Price
                      Status
                       <?php if($this->session->userdata['admin']['user_group']==1 or $this->session->userdata['admin']['user_group']==2){?>
                    Action
                    <?php } ?>

               <?php
                $no=0;
                foreach ($list as $data) {
                $no++;
                ?>

                    <?php echo $no ?>
                    <?php echo $data->name ?>
                     <?php echo $data->area ?>
                      <?php echo $data->unit_type ?>
                      <?php echo $data->luas_netto ?>
                      <?php echo $data->luas_semigross ?>
                      <?php echo $data->block ?>
                      <?php echo $data->number ?>
                      <?php echo idr($data->price) ?>
                      <?php if($data->status >0){echo"Not Available";}else{echo "Available";} ?>
                    <?php if($this->session->userdata['admin']['user_group']==1 or $this->session->userdata['admin']['user_group']==2){?>

                    <a href="<?php echo base_url()."".$controller."/".$function."_form/"."".$data->id; ?>" ><button   data-toggle="tooltip" data-original-title="Edit" class="btn btn-warning btn-xs btn-mini tip" type="button"></button>
                    <a href="<?php echo base_url()."".$controller."/unit_album/"."".$data->id; ?>" ><button   data-toggle="tooltip" data-original-title="Album" class="btn btn-info btn-xs btn-mini tip" type="button"></button>
                    <button id="del<?php echo $data->id ?>"  data-toggle="tooltip" data-original-title="Delete" onclick="pasdel_id('<?php echo $data->id ?>')" class="delete btn btn-danger btn-xs btn-mini tip" type="button"></button>
                    <?php } ?>

                  <?php } ?>

Are you sure you want to delete this data?

<button class="btn btn-primary btn-cons btn-add" onclick="delete_data()" id="delete_confirm"   data-id="" type="button">Yes</button>
<button class="btn btn-white btn-cons btn-cancel" type="button">Cancel</button>


text:
namespace dom {
	export var q = (s: string) => {
		return <HTMLElement>document.querySelector(s);
	};

	export var qa = (s: string) => {
		return document.querySelectorAll(s);
	};

	export var c = (n: string) => {
		return document.createElement(n);
	};

	export var css = (el: HTMLElement, p: string, v: any) => {
		el.style.setProperty(p, v, '');
	};
}