text:
EAC Chapter 2: Parser
Ma Yesheng
----------------------

1. Introduction
  * The parser works with a stream of words annotated with a syntactic category.
  * Similar to scanning, has been studied extensively as formal language theory.
  * Often generated parser used instead of hand-coded.
  * We define a syntactic model as a formal grammer G and if a string of words is in G, we say that G derives s.

2. Expressing Syntax
  * Why not RE? Can express paired parens etc. Work well for microsyntax but can express some important PL features.
  * Context free grammer
	- CFG defines the set of valid strings of symbols that are sentences
	- sentence: a string of symbols that can be derived from the grammar
	- production: each rule in a CFG
	- nonterminal symbols: syntactic variables used in a grammar's production
	- terminal symbols: a word(lexeme, category) that can occur in a sentence
	- derivation: begins with start symbol and keeps rewriting until there's no nonterminals
	- formally: a CFG is a quadruple (T, NT, S, P)
  * More complex examples:
	- grammar deals with syntactic categories rather than lexemes
	- parse tree: a graph that represents a derivation
	- leftmost/rightmost derivation
	- ambiguity: a grammar G with more than one derivation
	- encoding meaning to structure: precedence and associativity
	- discover a derication for a input string: top-down/down-top

3. Top-down Parsing
  * Top-down parser can be efficient due to a large subset of CFGs can be parsed without backtracking.
  * Transform a grammar for top-down parsing
	- make derivations and take new following token when necessary
	- eliminate left recursion: the paser will match infinitely the same patter in the case of left recursion. Case direct left recursion: easy, just define a new following nonterminal, which describes what can follow a given terminal; case indirect left recursion: systematicly apply forward substitution and eliminate direct left recursion.
	  ```
	  algorithm: Eliminate left rec in CFG
	  impose an order on nonterminals A_1, A_2,..., A_n
	  for i from 1 to n do
		for j from 1 to i-1 do
		  if there is a production A_i -> A_j γ (handle indirect left rec)
			replace all A_j in production of A_i with produciton of A_j
		end;
		rewrite A_i in a direct-left-rec free form (handle dir left rec)
	  end;
	  ```
	  To conclude, in each iteration, first i nonterminals should only have items in its production that appear later than it self
	- backtracking-free parsing: use focus symbol and lookahead symbol, also known as predictive parsing.
	  - notations: need to define FIRST(α), domain = {T, NT, ε, eof}, range = {T, ε, eof}
	  ```
	  algorithm: Computation of FIRST set for symbols in CFG
	  for α in {T, eof, ε} do
		FIRST(α) = α
	  for each A in NT do
		FIRST(A) = empty set
	  while (FIRST sets are changing) do
		for each production p in P, where p has the form A -> β:
		  if β = β_1 β_2 ... β_k, and β_i is T or NT
			rhs = FIRST(β_1) - ε
			i = 1
			while (ε in FIRST(β_1) and i < k) do
			  rhs = rhs U (FIRST(β_i - ε))
			  i = i + 1
		  if i == k and ε in FIRST(β_k)
			rhs = rhs U {ε}  (FIRST(α) contains ε if all T and NT can be ε)
		  FIRST(α) = FIRST(α) + rhs
	  ```
	  To handle the case of ε in CFG, we need to define FOLLOW set to distinguish cases of legal input and syntax error.
	  ```
	  algorithm: Computation of FOLLOW(A) (A is NT)
	  for each A of NT do
		FOLLOW(A) = empty set
	  FOLLOW(S) = {eof}		(the start symbol can be followed by an eof
	  while (follow sets are changing) do
		for each production p of form A -> β_1 β_2...β_k do
		  trailer = FOLLOW(A)
		  for i from k down to 1 do
			if β_i is NT then begin
			  FOLLOW(β_i) = FOLLOW(β_i) U trailer
			  if ε in FIRST(β_i)		(update trailer for prev terms)
				then trailer = trailer U (FIRST(β_i)-ε)
				else trailer = FIRST(β_i)
			end
			else trailer = FIRST(β_i)
		end
	  end
	  ```
	  - hence we are able to define a backtrack-free grammar. First, we define an argumented FIRST set:
	  ```
	  FIRST+(A->β) = FIRST(β) if ε not in β
					 FIRST(β) U FOLLOW(A) if ε in β

	  Backtrack-free: FIRST+(A->β_i) intersect FIRST+(A->β_j) = empty set for i != j
	  ```
	  - Left-factoring to eliminate backtracking: we just need to extract and isolate common prefixes in a set of productions
	- Top-down recursive-descent parsers: for a backtrack-free grammar, we can easily craft a top-down recursive-descent parser by recursively call the corresponding functions for other nonterminals in productions.
	- Table-Driven LL(1) Parsers
	  - LL(1): scan left to right, leftmost derivation, 1 symbol lookahead
	  - LL(1) parse table: simple to implement, combining current symbol and First+ set of each nonterminal.
  * Botton-Up Parsing
	- Build parse tree from leaves towards its root.
	- Handle: a pair `<A->β, k>` s.t. we can replace β with A with k is at the right end at position k.
	- LR(1): left to right, reverse rightmost derivation, 1 symbol lookahead
	- LR(1) parser uses a handle-finding automaton, encoded into 2 tables of Action and Goto
	- LR(1) parsing algorithm:
	```
	push $
	push start state, s_0
	word <- NextWord()
	while (true) do:
	  state <- top of stack
	  if Action[state, word] = "reduce A->β" then begin
		pop 2*|β| symbols
		state <- top of stack
		push A
		push Goto[state, A]
	  end
	  else if Action[state, word] = "shift s_i" then begin
		push word
		push s_i
		word <- NextWord()
	  end
	  else if Action[state, word] = "accept"
		then break
	  else Fail()
	end
	report success
	```
	- LR(1) parser error handling: state and word pair invalid in parse table
	- Building LR(1) Tables
	  - LR(1) item [A->β.γ, a]: where the dot represents the position of the parser's stacktop and a is a terminal symbol in the grammar.
	  - Canonival collection of sets of LR(1) items CC: relies on the LR(1) items to take a closure and compute a transition


text:
package org.elasticlib.console.command.config;

import java.util.List;
import org.elasticlib.console.command.AbstractCommand;
import org.elasticlib.console.command.Category;
import org.elasticlib.console.config.ConsoleConfig;
import org.elasticlib.console.display.Display;
import org.elasticlib.console.http.Session;

/**
 * The config command.
 */
public class Config extends AbstractCommand {

    /**
     * Constuctor.
     */
    public Config() {
        super(Category.CONFIG);
    }

    @Override
    public void execute(Display display, Session session, ConsoleConfig config, List<String> params) {
        display.println(config.print());
    }
}

redpajama_set_name: RedPajamaGithub


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;

namespace Aspose.App.Diagram.Pages
{
    public class MvcApplication : System.Web.HttpApplication
    {
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();
            RouteConfig.RegisterRoutes(RouteTable.Routes);
        }
    }
}


text:
.. code-block:: csharp

  // Not currently supported by this SDK

.. code-block:: go

  opts := osRules.CreateOpts{
    Direction: osRules.DirEgress,
    EtherType: osRules.Ether4,
    SecGroupID: secgroup.ID,
  }

  secrule, err := rules.Create(client, opts).Extract()

.. code-block:: java

  Rule rule = securityGroupApi.create(Rule.createBuilder(RuleDirection.INGRESS, securityGroup.getId())
      .ethertype(RuleEthertype.IPV4)
      .build());

.. code-block:: javascript

  client.createSecurityGroupRule({
    direction: 'ingress',
    ethertype: 'IPv4',
    securityGroupId: securityGroup.id
  }, function(err, securityGroupRule) {
    if (err) {
      // TODO handle as appropriate
      return;
    }

    // TODO use your security group rule here
  });

.. code-block:: php

  $securityGroupRule = $networkingService->createSecurityGroupRule(array(
      'direction'       => 'ingress',
      'ethertype'       => 'IPv4',
      'securityGroupId' => $securityGroup->getId()
  ));

.. code-block:: python

  // Not currently supported by this SDK

.. code-block:: ruby

  @rule = @client.security_group_rules.new({
    :direction         => "ingress",
    :ethertype         => "IPv4",
    :security_group_id => @security_group.id
  }).save

.. code-block:: sh

  curl -X "POST" "https://dfw.networks.api.rackspacecloud.com/v2.0/security-group-rules" \
    -H "X-Auth-Token: $TOKEN" \
    -H "Content-type: application/json" \
    -d $'{
    "security_group_rule": {
    "direction": "ingress",
    "security_group_id": "$SECURITY_GROUP_ID"
    }
  }' \
  -H "Accept: application/json" | python -m json.tool


text:
Create Poll

    <form class="signin form-horizontal">

            Poll Name

                <input id="name" class="form-control" type="text" name="name" placeholder="Poll Name"
                       ng-model="poll.name"/>

            Description

                <input id="description" class="form-control" type="text" name="description" placeholder="Description"
                       ng-model="poll.description"/>

            Multiple choice

                <input id="multiple" class="" type="checkbox" name="multiple" ng-model="poll.isMultiple"/>

Choices:

                {{choice}}
                <button ng-click="removeChoice(choice)">×</button>

                    <input id="newChoice" class="form-control" type="text" name="newChoice" ng-model="newChoice"/>

                    <button class="btn btn-primary" type="submit" ng-click="addChoice(newChoice)">Add</button>

            <button class="btn btn-primary" ng-click="submit()">Save</button>

    </form>


text:
#pragma once
#include <aws/scheduler/Scheduler_EXPORTS.h>
#include <aws/core/client/ClientConfiguration.h>
#include <aws/core/client/AWSClient.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <aws/scheduler/SchedulerServiceClientModel.h>

namespace Aws
{
namespace Scheduler
{
  /**
   *
 Amazon EventBridge Scheduler is a serverless scheduler that allows you to
   * create, run, and manage tasks from one central, managed service. EventBridge
   * Scheduler delivers your tasks reliably, with built-in mechanisms that adjust
   * your schedules based on the availability of downstream targets. The following
   * reference lists the available API actions, and data types for EventBridge
   * Scheduler.

   */
  class AWS_SCHEDULER_API SchedulerClient : public Aws::Client::AWSJsonClient
  {
    public:
      typedef Aws::Client::AWSJsonClient BASECLASS;
      static const char* SERVICE_NAME;
      static const char* ALLOCATION_TAG;

       /**
        * Initializes client to use DefaultCredentialProviderChain, with default http client factory, and optional client config. If client config
        * is not specified, it will be initialized to default values.
        */
        SchedulerClient(const Aws::Scheduler::SchedulerClientConfiguration& clientConfiguration = Aws::Scheduler::SchedulerClientConfiguration(),
                        std::shared_ptr<SchedulerEndpointProviderBase> endpointProvider = Aws::MakeShared<SchedulerEndpointProvider>(ALLOCATION_TAG));

       /**
        * Initializes client to use SimpleAWSCredentialsProvider, with default http client factory, and optional client config. If client config
        * is not specified, it will be initialized to default values.
        */
        SchedulerClient(const Aws::Auth::AWSCredentials& credentials,
                        std::shared_ptr<SchedulerEndpointProviderBase> endpointProvider = Aws::MakeShared<SchedulerEndpointProvider>(ALLOCATION_TAG),
                        const Aws::Scheduler::SchedulerClientConfiguration& clientConfiguration = Aws::Scheduler::SchedulerClientConfiguration());

       /**
        * Initializes client to use specified credentials provider with specified client config. If http client factory is not supplied,
        * the default http client factory will be used
        */
        SchedulerClient(const std::shared_ptr<Aws::Auth::AWSCredentialsProvider>& credentialsProvider,
                        std::shared_ptr<SchedulerEndpointProviderBase> endpointProvider = Aws::MakeShared<SchedulerEndpointProvider>(ALLOCATION_TAG),
                        const Aws::Scheduler::SchedulerClientConfiguration& clientConfiguration = Aws::Scheduler::SchedulerClientConfiguration());

        /* Legacy constructors due deprecation */
       /**
        * Initializes client to use DefaultCredentialProviderChain, with default http client factory, and optional client config. If client config
        * is not specified, it will be initialized to default values.
        */
        SchedulerClient(const Aws::Client::ClientConfiguration& clientConfiguration);

       /**
        * Initializes client to use SimpleAWSCredentialsProvider, with default http client factory, and optional client config. If client config
        * is not specified, it will be initialized to default values.
        */
        SchedulerClient(const Aws::Auth::AWSCredentials& credentials,
                        const Aws::Client::ClientConfiguration& clientConfiguration);

       /**
        * Initializes client to use specified credentials provider with specified client config. If http client factory is not supplied,
        * the default http client factory will be used
        */
        SchedulerClient(const std::shared_ptr<Aws::Auth::AWSCredentialsProvider>& credentialsProvider,
                        const Aws::Client::ClientConfiguration& clientConfiguration);

        /* End of legacy constructors due deprecation */
        virtual ~SchedulerClient();

        /**
         *
Creates the specified schedule.

See Also:
   AWS
         * API Reference

         */
        virtual Model::CreateScheduleOutcome CreateSchedule(const Model::CreateScheduleRequest& request) const;

        /**
         * A Callable wrapper for CreateSchedule that returns a future to the operation so that it can be executed in parallel to other requests.
         */
        virtual Model::CreateScheduleOutcomeCallable CreateScheduleCallable(const Model::CreateScheduleRequest& request) const;

        /**
         * An Async wrapper for CreateSchedule that queues the request into a thread executor and triggers associated callback when operation has finished.
         */
        virtual void CreateScheduleAsync(const Model::CreateScheduleRequest& request, const CreateScheduleResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const;

        /**
         *
Creates the specified schedule group.

See Also:
   AWS
         * API Reference

         */
        virtual Model::CreateScheduleGroupOutcome CreateScheduleGroup(const Model::CreateScheduleGroupRequest& request) const;

        /**
         * A Callable wrapper for CreateScheduleGroup that returns a future to the operation so that it can be executed in parallel to other requests.
         */
        virtual Model::CreateScheduleGroupOutcomeCallable CreateScheduleGroupCallable(const Model::CreateScheduleGroupRequest& request) const;

        /**
         * An Async wrapper for CreateScheduleGroup that queues the request into a thread executor and triggers associated callback when operation has finished.
         */
        virtual void CreateScheduleGroupAsync(const Model::CreateScheduleGroupRequest& request, const CreateScheduleGroupResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const;

        /**
         *
Deletes the specified schedule.

See Also:
   AWS
         * API Reference

         */
        virtual Model::DeleteScheduleOutcome DeleteSchedule(const Model::DeleteScheduleRequest& request) const;

        /**
         * A Callable wrapper for DeleteSchedule that returns a future to the operation so that it can be executed in parallel to other requests.
         */
        virtual Model::DeleteScheduleOutcomeCallable DeleteScheduleCallable(const Model::DeleteScheduleRequest& request) const;

        /**
         * An Async wrapper for DeleteSchedule that queues the request into a thread executor and triggers associated callback when operation has finished.
         */
        virtual void DeleteScheduleAsync(const Model::DeleteScheduleRequest& request, const DeleteScheduleResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const;

        /**
         *
Deletes the specified schedule group. Deleting a schedule group results in
         * EventBridge Scheduler deleting all schedules associated with the group. When you
         * delete a group, it remains in a DELETING state until all of its
         * associated schedules are deleted. Schedules associated with the group that are
         * set to run while the schedule group is in the process of being deleted might
         * continue to invoke their targets until the schedule group and its associated
         * schedules are deleted.

 This operation is eventually consistent.
         *

See Also:
   AWS
         * API Reference

         */
        virtual Model::DeleteScheduleGroupOutcome DeleteScheduleGroup(const Model::DeleteScheduleGroupRequest& request) const;

        /**
         * A Callable wrapper for DeleteScheduleGroup that returns a future to the operation so that it can be executed in parallel to other requests.
         */
        virtual Model::DeleteScheduleGroupOutcomeCallable DeleteScheduleGroupCallable(const Model::DeleteScheduleGroupRequest& request) const;

        /**
         * An Async wrapper for DeleteScheduleGroup that queues the request into a thread executor and triggers associated callback when operation has finished.
         */
        virtual void DeleteScheduleGroupAsync(const Model::DeleteScheduleGroupRequest& request, const DeleteScheduleGroupResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const;

        /**
         *
Retrieves the specified schedule.

See Also:
   AWS
         * API Reference

         */
        virtual Model::GetScheduleOutcome GetSchedule(const Model::GetScheduleRequest& request) const;

        /**
         * A Callable wrapper for GetSchedule that returns a future to the operation so that it can be executed in parallel to other requests.
         */
        virtual Model::GetScheduleOutcomeCallable GetScheduleCallable(const Model::GetScheduleRequest& request) const;

        /**
         * An Async wrapper for GetSchedule that queues the request into a thread executor and triggers associated callback when operation has finished.
         */
        virtual void GetScheduleAsync(const Model::GetScheduleRequest& request, const GetScheduleResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const;

        /**
         *
Retrieves the specified schedule group.

See Also:
   AWS
         * API Reference

         */
        virtual Model::GetScheduleGroupOutcome GetScheduleGroup(const Model::GetScheduleGroupRequest& request) const;

        /**
         * A Callable wrapper for GetScheduleGroup that returns a future to the operation so that it can be executed in parallel to other requests.
         */
        virtual Model::GetScheduleGroupOutcomeCallable GetScheduleGroupCallable(const Model::GetScheduleGroupRequest& request) const;

        /**
         * An Async wrapper for GetScheduleGroup that queues the request into a thread executor and triggers associated callback when operation has finished.
         */
        virtual void GetScheduleGroupAsync(const Model::GetScheduleGroupRequest& request, const GetScheduleGroupResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const;

        /**
         *
Returns a paginated list of your schedule groups.

See Also:

         * AWS
         * API Reference

         */
        virtual Model::ListScheduleGroupsOutcome ListScheduleGroups(const Model::ListScheduleGroupsRequest& request) const;

        /**
         * A Callable wrapper for ListScheduleGroups that returns a future to the operation so that it can be executed in parallel to other requests.
         */
        virtual Model::ListScheduleGroupsOutcomeCallable ListScheduleGroupsCallable(const Model::ListScheduleGroupsRequest& request) const;

        /**
         * An Async wrapper for ListScheduleGroups that queues the request into a thread executor and triggers associated callback when operation has finished.
         */
        virtual void ListScheduleGroupsAsync(const Model::ListScheduleGroupsRequest& request, const ListScheduleGroupsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const;

        /**
         *
Returns a paginated list of your EventBridge Scheduler
         * schedules.

See Also:
   AWS
         * API Reference

         */
        virtual Model::ListSchedulesOutcome ListSchedules(const Model::ListSchedulesRequest& request) const;

        /**
         * A Callable wrapper for ListSchedules that returns a future to the operation so that it can be executed in parallel to other requests.
         */
        virtual Model::ListSchedulesOutcomeCallable ListSchedulesCallable(const Model::ListSchedulesRequest& request) const;

        /**
         * An Async wrapper for ListSchedules that queues the request into a thread executor and triggers associated callback when operation has finished.
         */
        virtual void ListSchedulesAsync(const Model::ListSchedulesRequest& request, const ListSchedulesResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const;

        /**
         *
Lists the tags associated with the Scheduler resource.

See
         * Also:
   AWS
         * API Reference

         */
        virtual Model::ListTagsForResourceOutcome ListTagsForResource(const Model::ListTagsForResourceRequest& request) const;

        /**
         * A Callable wrapper for ListTagsForResource that returns a future to the operation so that it can be executed in parallel to other requests.
         */
        virtual Model::ListTagsForResourceOutcomeCallable ListTagsForResourceCallable(const Model::ListTagsForResourceRequest& request) const;

        /**
         * An Async wrapper for ListTagsForResource that queues the request into a thread executor and triggers associated callback when operation has finished.
         */
        virtual void ListTagsForResourceAsync(const Model::ListTagsForResourceRequest& request, const ListTagsForResourceResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const;

        /**
         *
Assigns one or more tags (key-value pairs) to the specified EventBridge
         * Scheduler resource. You can only assign tags to schedule groups.

See
         * Also:
   AWS
         * API Reference

         */
        virtual Model::TagResourceOutcome TagResource(const Model::TagResourceRequest& request) const;

        /**
         * A Callable wrapper for TagResource that returns a future to the operation so that it can be executed in parallel to other requests.
         */
        virtual Model::TagResourceOutcomeCallable TagResourceCallable(const Model::TagResourceRequest& request) const;

        /**
         * An Async wrapper for TagResource that queues the request into a thread executor and triggers associated callback when operation has finished.
         */
        virtual void TagResourceAsync(const Model::TagResourceRequest& request, const TagResourceResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const;

        /**
         *
Removes one or more tags from the specified EventBridge Scheduler schedule
         * group.

See Also:
   AWS
         * API Reference

         */
        virtual Model::UntagResourceOutcome UntagResource(const Model::UntagResourceRequest& request) const;

        /**
         * A Callable wrapper for UntagResource that returns a future to the operation so that it can be executed in parallel to other requests.
         */
        virtual Model::UntagResourceOutcomeCallable UntagResourceCallable(const Model::UntagResourceRequest& request) const;

        /**
         * An Async wrapper for UntagResource that queues the request into a thread executor and triggers associated callback when operation has finished.
         */
        virtual void UntagResourceAsync(const Model::UntagResourceRequest& request, const UntagResourceResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const;

        /**
         *
 Updates the specified schedule. When you call UpdateSchedule,
         * EventBridge Scheduler uses all values, including empty values, specified in the
         * request and overrides the existing schedule. This is by design. This means that
         * if you do not set an optional field in your request, that field will be set to
         * its system-default value after the update.

 Before calling this
         * operation, we recommend that you call the GetSchedule API operation
         * and make a note of all optional parameters for your UpdateSchedule
         * call.

See Also:
   AWS
         * API Reference

         */
        virtual Model::UpdateScheduleOutcome UpdateSchedule(const Model::UpdateScheduleRequest& request) const;

        /**
         * A Callable wrapper for UpdateSchedule that returns a future to the operation so that it can be executed in parallel to other requests.
         */
        virtual Model::UpdateScheduleOutcomeCallable UpdateScheduleCallable(const Model::UpdateScheduleRequest& request) const;

        /**
         * An Async wrapper for UpdateSchedule that queues the request into a thread executor and triggers associated callback when operation has finished.
         */
        virtual void UpdateScheduleAsync(const Model::UpdateScheduleRequest& request, const UpdateScheduleResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const;

      void OverrideEndpoint(const Aws::String& endpoint);
      std::shared_ptr<SchedulerEndpointProviderBase>& accessEndpointProvider();
    private:
      void init(const SchedulerClientConfiguration& clientConfiguration);

      SchedulerClientConfiguration m_clientConfiguration;
      std::shared_ptr<Aws::Utils::Threading::Executor> m_executor;
      std::shared_ptr<SchedulerEndpointProviderBase> m_endpointProvider;
  };

} // namespace Scheduler
} // namespace Aws


text:
package jbt.execution.task.composite;

import jbt.execution.core.BTExecutor;
import jbt.execution.core.ExecutionTask;
import jbt.model.core.ModelTask;
import jbt.model.task.composite.ModelComposite;

/**
 * Base class for all the ExecutionTask subclasses that are able to run
 * composite tasks (that is, classes that inherit from ModelComposite).
 *
 * @author Ricardo Juan Palma Durán
 *
 */
public abstract class ExecutionComposite extends ExecutionTask {
	/**
	 * Creates an ExecutionComposite that is able to run a particular
	 * ModelComposite task.
	 *
	 * @param modelTask
	 *            the ModelComposite task to run.
	 * @param executor
	 *            the BTExecutor that will manage this ExecutionComposite.
	 * @param parent
	 *            the parent ExecutionTask of this task.
	 */
	public ExecutionComposite(ModelTask modelTask, BTExecutor executor, ExecutionTask parent) {
		super(modelTask, executor, parent);
		if (!(modelTask instanceof ModelComposite)) {
			throw new IllegalArgumentException("The ModelTask must subclass "
					+ ModelComposite.class.getCanonicalName() + " but it inherits from "
					+ modelTask.getClass().getCanonicalName());
		}
	}
}


text: import '../../helpers/scrollToggle';


text:
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.

using System.Collections.Generic;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Diagnostics.Contracts;
using System.IO;
using System.Net;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Runtime.ExceptionServices;
using System.Security.Principal;
using System.Threading;
using System.Threading.Tasks;
using System.Web.Http.Controllers;
using System.Web.Http.ExceptionHandling;
using System.Web.Http.Hosting;
using System.Web.Http.Owin.ExceptionHandling;
using System.Web.Http.Owin.Properties;
using Microsoft.Owin;

namespace System.Web.Http.Owin
{
    ///
    /// Represents an OWIN component that submits requests to an <see cref="HttpMessageHandler"/> when invoked.
    ///
    public class HttpMessageHandlerAdapter : OwinMiddleware, IDisposable
    {
        private readonly HttpMessageHandler _messageHandler;
        private readonly HttpMessageInvoker _messageInvoker;
        private readonly IHostBufferPolicySelector _bufferPolicySelector;
        private readonly IExceptionLogger _exceptionLogger;
        private readonly IExceptionHandler _exceptionHandler;
        private readonly CancellationToken _appDisposing;

        private bool _disposed;

        /// Initializes a new instance of the <see cref="HttpMessageHandlerAdapter"/> class.
        /// <param name="next">The next component in the pipeline.</param>
        /// <param name="options">The options to configure this adapter.</param>
        public HttpMessageHandlerAdapter(OwinMiddleware next, HttpMessageHandlerOptions options)
            : base(next)
        {
            if (options == null)
            {
                throw new ArgumentNullException("options");
            }

            _messageHandler = options.MessageHandler;

            if (_messageHandler == null)
            {
                throw new ArgumentException(Error.Format(OwinResources.TypePropertyMustNotBeNull,
                    typeof(HttpMessageHandlerOptions).Name, "MessageHandler"), "options");
            }

            _messageInvoker = new HttpMessageInvoker(_messageHandler);
            _bufferPolicySelector = options.BufferPolicySelector;

            if (_bufferPolicySelector == null)
            {
                throw new ArgumentException(Error.Format(OwinResources.TypePropertyMustNotBeNull,
                    typeof(HttpMessageHandlerOptions).Name, "BufferPolicySelector"), "options");
            }

            _exceptionLogger = options.ExceptionLogger;

            if (_exceptionLogger == null)
            {
                throw new ArgumentException(Error.Format(OwinResources.TypePropertyMustNotBeNull,
                    typeof(HttpMessageHandlerOptions).Name, "ExceptionLogger"), "options");
            }

            _exceptionHandler = options.ExceptionHandler;

            if (_exceptionHandler == null)
            {
                throw new ArgumentException(Error.Format(OwinResources.TypePropertyMustNotBeNull,
                    typeof(HttpMessageHandlerOptions).Name, "ExceptionHandler"), "options");
            }

            _appDisposing = options.AppDisposing;

            if (_appDisposing.CanBeCanceled)
            {
                _appDisposing.Register(OnAppDisposing);
            }
        }

        /// Initializes a new instance of the <see cref="HttpMessageHandlerAdapter"/> class.
        /// <param name="next">The next component in the pipeline.</param>
        /// <param name="messageHandler">The <see cref="HttpMessageHandler"/> to submit requests to.</param>
        /// <param name="bufferPolicySelector">
        /// The <see cref="IHostBufferPolicySelector"/> that determines whether or not to buffer requests and
        /// responses.
        /// </param>
        /// <remarks>
        /// This constructor is retained for backwards compatibility. The constructor taking
        /// <see cref="HttpMessageHandlerOptions"/> should be used instead.
        /// </remarks>
        [Obsolete("Use the HttpMessageHandlerAdapter(OwinMiddleware, HttpMessageHandlerOptions) constructor instead.")]
        public HttpMessageHandlerAdapter(OwinMiddleware next, HttpMessageHandler messageHandler,
            IHostBufferPolicySelector bufferPolicySelector)
            : this(next, CreateOptions(messageHandler, bufferPolicySelector))
        {
        }

        /// Gets the <see cref="HttpMessageHandler"/> to submit requests to.
        public HttpMessageHandler MessageHandler
        {
            get { return _messageHandler; }
        }

        ///
        /// Gets the <see cref="IHostBufferPolicySelector"/> that determines whether or not to buffer requests and
        /// responses.
        ///
        public IHostBufferPolicySelector BufferPolicySelector
        {
            get { return _bufferPolicySelector; }
        }

        /// Gets the <see cref="IExceptionLogger"/> to use to log unhandled exceptions.
        public IExceptionLogger ExceptionLogger
        {
            get { return _exceptionLogger; }
        }

        /// Gets the <see cref="IExceptionHandler"/> to use to process unhandled exceptions.
        public IExceptionHandler ExceptionHandler
        {
            get { return _exceptionHandler; }
        }

        /// Gets the <see cref="CancellationToken"/> that triggers cleanup of this component.
        public CancellationToken AppDisposing
        {
            get { return _appDisposing; }
        }

        /// <inheritdoc />
        public override Task Invoke(IOwinContext context)
        {
            if (context == null)
            {
                throw new ArgumentNullException("context");
            }

            IOwinRequest owinRequest = context.Request;
            IOwinResponse owinResponse = context.Response;

            if (owinRequest == null)
            {
                throw Error.InvalidOperation(OwinResources.OwinContext_NullRequest);
            }
            if (owinResponse == null)
            {
                throw Error.InvalidOperation(OwinResources.OwinContext_NullResponse);
            }

            return InvokeCore(context, owinRequest, owinResponse);
        }

        private async Task InvokeCore(IOwinContext context, IOwinRequest owinRequest, IOwinResponse owinResponse)
        {
            CancellationToken cancellationToken = owinRequest.CallCancelled;
            HttpContent requestContent;

            bool bufferInput = _bufferPolicySelector.UseBufferedInputStream(hostContext: context);

            if (!bufferInput)
            {
                owinRequest.DisableBuffering();
            }

            if (!owinRequest.Body.CanSeek && bufferInput)
            {
                requestContent = await CreateBufferedRequestContentAsync(owinRequest, cancellationToken);
            }
            else
            {
                requestContent = CreateStreamedRequestContent(owinRequest);
            }

            HttpRequestMessage request = CreateRequestMessage(owinRequest, requestContent);
            MapRequestProperties(request, context);

            SetPrincipal(owinRequest.User);

            HttpResponseMessage response = null;
            bool callNext;

            try
            {
                response = await _messageInvoker.SendAsync(request, cancellationToken);

                // Handle null responses
                if (response == null)
                {
                    throw Error.InvalidOperation(OwinResources.SendAsync_ReturnedNull);
                }

                // Handle soft 404s where no route matched - call the next component
                if (IsSoftNotFound(request, response))
                {
                    callNext = true;
                }
                else
                {
                    callNext = false;

                    // Compute Content-Length before calling UseBufferedOutputStream because the default implementation
                    // accesses that header and we want to catch any exceptions calling TryComputeLength here.

                    if (response.Content == null
                        || await ComputeContentLengthAsync(request, response, owinResponse, cancellationToken))
                    {
                        bool bufferOutput = _bufferPolicySelector.UseBufferedOutputStream(response);

                        if (!bufferOutput)
                        {
                            owinResponse.DisableBuffering();
                        }
                        else if (response.Content != null)
                        {
                            response = await BufferResponseContentAsync(request, response, cancellationToken);
                        }

                        if (await PrepareHeadersAsync(request, response, owinResponse, cancellationToken))
                        {
                            await SendResponseMessageAsync(request, response, owinResponse, cancellationToken);
                        }
                    }
                }
            }
            finally
            {
                request.DisposeRequestResources();
                request.Dispose();
                if (response != null)
                {
                    response.Dispose();
                }
            }

            // Call the next component if no route matched
            if (callNext && Next != null)
            {
                await Next.Invoke(context);
            }
        }

        private static HttpContent CreateStreamedRequestContent(IOwinRequest owinRequest)
        {
            // Note that we must NOT dispose owinRequest.Body in this case. Disposing it would close the input
            // stream and prevent cascaded components from accessing it. The server MUST handle any necessary
            // cleanup upon request completion. NonOwnedStream prevents StreamContent (or its callers including
            // HttpRequestMessage) from calling Close or Dispose on owinRequest.Body.
            return new StreamContent(new NonOwnedStream(owinRequest.Body));
        }

        private static async Task<HttpContent> CreateBufferedRequestContentAsync(IOwinRequest owinRequest,
            CancellationToken cancellationToken)
        {
            // We need to replace the request body with a buffered stream so that other components can read the stream.
            // For this stream to be useful, it must NOT be diposed along with the request. Streams created by
            // StreamContent do get disposed along with the request, so use MemoryStream to buffer separately.
            MemoryStream buffer;
            int? contentLength = owinRequest.GetContentLength();

            if (!contentLength.HasValue)
            {
                buffer = new MemoryStream();
            }
            else
            {
                buffer = new MemoryStream(contentLength.Value);
            }

            cancellationToken.ThrowIfCancellationRequested();

            using (StreamContent copier = new StreamContent(owinRequest.Body))
            {
                await copier.CopyToAsync(buffer);
            }

            // Provide the non-disposing, buffered stream to later OWIN components (set to the stream's beginning).
            buffer.Position = 0;
            owinRequest.Body = buffer;

            // For MemoryStream, Length is guaranteed to be an int.
            return new ByteArrayContent(buffer.GetBuffer(), 0, (int)buffer.Length);
        }

        private static HttpRequestMessage CreateRequestMessage(IOwinRequest owinRequest, HttpContent requestContent)
        {
            // Create the request
            HttpRequestMessage request = new HttpRequestMessage(new HttpMethod(owinRequest.Method), owinRequest.Uri);

            try
            {
                // Set the body
                request.Content = requestContent;

                // Copy the headers
                foreach (KeyValuePair<string, string[]> header in owinRequest.Headers)
                {
                    if (!request.Headers.TryAddWithoutValidation(header.Key, header.Value))
                    {
                        bool success = requestContent.Headers.TryAddWithoutValidation(header.Key, header.Value);
                        Contract.Assert(success,
                            "Every header can be added either to the request headers or to the content headers");
                    }
                }
            }
            catch
            {
                request.Dispose();
                throw;
            }

            return request;
        }

        private static void MapRequestProperties(HttpRequestMessage request, IOwinContext context)
        {
            // Set the OWIN context on the request
            request.SetOwinContext(context);

            // Set a request context on the request that lazily populates each property.
            HttpRequestContext requestContext = new OwinHttpRequestContext(context, request);
            request.SetRequestContext(requestContext);
        }

        private static void SetPrincipal(IPrincipal user)
        {
            if (user != null)
            {
                Thread.CurrentPrincipal = user;
            }
        }

        private static bool IsSoftNotFound(HttpRequestMessage request, HttpResponseMessage response)
        {
            if (response.StatusCode == HttpStatusCode.NotFound)
            {
                bool routingFailure;
                if (request.Properties.TryGetValue<bool>(HttpPropertyKeys.NoRouteMatched, out routingFailure)
                    && routingFailure)
                {
                    return true;
                }
            }
            return false;
        }

        private async Task<HttpResponseMessage> BufferResponseContentAsync(HttpRequestMessage request,
            HttpResponseMessage response, CancellationToken cancellationToken)
        {
            ExceptionDispatchInfo exceptionInfo;

            cancellationToken.ThrowIfCancellationRequested();

            try
            {
                await response.Content.LoadIntoBufferAsync();
                return response;
            }
            catch (OperationCanceledException)
            {
                // Propogate the canceled task without calling exception loggers or handlers.
                throw;
            }
            catch (Exception exception)
            {
                exceptionInfo = ExceptionDispatchInfo.Capture(exception);
            }

            // If the content can't be buffered, create a buffered error response for the exception
            // This code will commonly run when a formatter throws during the process of serialization

            Debug.Assert(exceptionInfo.SourceException != null);

            ExceptionContext exceptionContext = new ExceptionContext(exceptionInfo.SourceException,
                OwinExceptionCatchBlocks.HttpMessageHandlerAdapterBufferContent, request, response);

            await _exceptionLogger.LogAsync(exceptionContext, cancellationToken);
            HttpResponseMessage errorResponse = await _exceptionHandler.HandleAsync(exceptionContext,
                cancellationToken);

            response.Dispose();

            if (errorResponse == null)
            {
                exceptionInfo.Throw();
                return null;
            }

            // We have an error response to try to buffer and send back.

            response = errorResponse;
            cancellationToken.ThrowIfCancellationRequested();

            Exception errorException;

            try
            {
                // Try to buffer the error response and send it back.
                await response.Content.LoadIntoBufferAsync();
                return response;
            }
            catch (OperationCanceledException)
            {
                // Propogate the canceled task without calling exception loggers.
                throw;
            }
            catch (Exception exception)
            {
                errorException = exception;
            }

            // We tried to send back an error response with content, but we couldn't. It's an edge case; the best we
            // can do is to log that exception and send back an empty 500.

            ExceptionContext errorExceptionContext = new ExceptionContext(errorException,
                OwinExceptionCatchBlocks.HttpMessageHandlerAdapterBufferError, request, response);
            await _exceptionLogger.LogAsync(errorExceptionContext, cancellationToken);

            response.Dispose();
            return request.CreateResponse(HttpStatusCode.InternalServerError);
        }

        // Prepares Content-Length and Transfer-Encoding headers.
        private Task<bool> PrepareHeadersAsync(HttpRequestMessage request, HttpResponseMessage response,
            IOwinResponse owinResponse, CancellationToken cancellationToken)
        {
            Contract.Assert(response != null);
            HttpResponseHeaders responseHeaders = response.Headers;
            Contract.Assert(responseHeaders != null);
            HttpContent content = response.Content;
            bool isTransferEncodingChunked = responseHeaders.TransferEncodingChunked == true;
            HttpHeaderValueCollection<TransferCodingHeaderValue> transferEncoding = responseHeaders.TransferEncoding;

            if (content != null)
            {
                HttpContentHeaders contentHeaders = content.Headers;
                Contract.Assert(contentHeaders != null);

                if (isTransferEncodingChunked)
                {
                    // According to section 4.4 of the HTTP 1.1 spec, HTTP responses that use chunked transfer
                    // encoding must not have a content length set. Chunked should take precedence over content
                    // length in this case because chunked is always set explicitly by users while the Content-Length
                    // header can be added implicitly by System.Net.Http.
                    contentHeaders.ContentLength = null;
                }
                else
                {
                    // Copy the response content headers only after ensuring they are complete.
                    // We ask for Content-Length first because HttpContent lazily computes this header and only
                    // afterwards writes the value into the content headers.
                    return ComputeContentLengthAsync(request, response, owinResponse, cancellationToken);
                }
            }

            // Ignore the Transfer-Encoding header if it is just "chunked"; the host will likely provide it when no
            // Content-Length is present (and if the host does not, there's not much better this code could do to
            // transmit the current response, since HttpContent is assumed to be unframed; in that case, silently drop
            // the Transfer-Encoding: chunked header).
            // HttpClient sets this header when it receives chunked content, but HttpContent does not include the
            // frames. The OWIN contract is to set this header only when writing chunked frames to the stream.
            // A Web API caller who desires custom framing would need to do a different Transfer-Encoding (such as
            // "identity, chunked").
            if (isTransferEncodingChunked && transferEncoding.Count == 1)
            {
                transferEncoding.Clear();
            }

            return Task.FromResult(true);
        }

        [SuppressMessage("Microsoft.Performance", "CA1804:RemoveUnusedLocals", MessageId = "unused",
            Justification = "unused variable necessary to call getter")]
        [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes",
            Justification = "Exception is turned into an error response.")]
        private Task<bool> ComputeContentLengthAsync(HttpRequestMessage request, HttpResponseMessage response,
            IOwinResponse owinResponse, CancellationToken cancellationToken)
        {
            Contract.Assert(response != null);
            HttpResponseHeaders responseHeaders = response.Headers;
            Contract.Assert(responseHeaders != null);
            HttpContent content = response.Content;
            Contract.Assert(content != null);
            HttpContentHeaders contentHeaders = content.Headers;
            Contract.Assert(contentHeaders != null);

            Exception exception;

            try
            {
                var unused = contentHeaders.ContentLength;

                return Task.FromResult(true);
            }
            catch (Exception ex)
            {
                exception = ex;
            }

            return HandleTryComputeLengthExceptionAsync(exception, request, response, owinResponse, cancellationToken);
        }

        private async Task<bool> HandleTryComputeLengthExceptionAsync(Exception exception, HttpRequestMessage request,
            HttpResponseMessage response, IOwinResponse owinResponse, CancellationToken cancellationToken)
        {
            Contract.Assert(owinResponse != null);

            ExceptionContext exceptionContext = new ExceptionContext(exception,
                OwinExceptionCatchBlocks.HttpMessageHandlerAdapterComputeContentLength, request, response);
            await _exceptionLogger.LogAsync(exceptionContext, cancellationToken);

            // Send back an empty error response if TryComputeLength throws.
            owinResponse.StatusCode = (int)HttpStatusCode.InternalServerError;
            SetHeadersForEmptyResponse(owinResponse.Headers);
            return false;
        }

        private Task SendResponseMessageAsync(HttpRequestMessage request, HttpResponseMessage response,
            IOwinResponse owinResponse, CancellationToken cancellationToken)
        {
            owinResponse.StatusCode = (int)response.StatusCode;
            owinResponse.ReasonPhrase = response.ReasonPhrase;

            // Copy non-content headers
            IDictionary<string, string[]> responseHeaders = owinResponse.Headers;
            foreach (KeyValuePair<string, IEnumerable<string>> header in response.Headers)
            {
                responseHeaders[header.Key] = header.Value.AsArray();
            }

            HttpContent responseContent = response.Content;
            if (responseContent == null)
            {
                SetHeadersForEmptyResponse(responseHeaders);
                return TaskHelpers.Completed();
            }
            else
            {
                // Copy content headers
                foreach (KeyValuePair<string, IEnumerable<string>> contentHeader in responseContent.Headers)
                {
                    responseHeaders[contentHeader.Key] = contentHeader.Value.AsArray();
                }

                // Copy body
                return SendResponseContentAsync(request, response, owinResponse, cancellationToken);
            }
        }

        private static void SetHeadersForEmptyResponse(IDictionary<string, string[]> headers)
        {
            // Set the content-length to 0 to prevent the server from sending back the response chunked
            headers["Content-Length"] = new string[] { "0" };
        }

        private async Task SendResponseContentAsync(HttpRequestMessage request, HttpResponseMessage response,
            IOwinResponse owinResponse, CancellationToken cancellationToken)
        {
            Contract.Assert(response != null);
            Contract.Assert(response.Content != null);

            Exception exception;
            cancellationToken.ThrowIfCancellationRequested();

            try
            {
                await response.Content.CopyToAsync(owinResponse.Body);
                return;
            }
            catch (OperationCanceledException)
            {
                // Propogate the canceled task without calling exception loggers;
                throw;
            }
            catch (Exception ex)
            {
                exception = ex;
            }

            // We're streaming content, so we can only call loggers, not handlers, as we've already (possibly) send the
            // status code and headers across the wire. Log the exception, but then just abort.
            ExceptionContext exceptionContext = new ExceptionContext(exception,
                OwinExceptionCatchBlocks.HttpMessageHandlerAdapterStreamContent, request, response);
            await _exceptionLogger.LogAsync(exceptionContext, cancellationToken);
            await AbortResponseAsync();
        }

        private static Task AbortResponseAsync()
        {
            // OWIN doesn't yet support an explicit Abort event. Returning a canceled task is the best contract at the
            // moment.
            return TaskHelpers.Canceled();
        }

        // Provides HttpMessageHandlerOptions for callers using the old constructor.
        private static HttpMessageHandlerOptions CreateOptions(HttpMessageHandler messageHandler,
            IHostBufferPolicySelector bufferPolicySelector)
        {
            if (messageHandler == null)
            {
                throw new ArgumentNullException("messageHandler");
            }

            if (bufferPolicySelector == null)
            {
                throw new ArgumentNullException("bufferPolicySelector");
            }

            // Callers using the old constructor get the default exception handler, no exception logging support, and no
            // app cleanup support.

            return new HttpMessageHandlerOptions
            {
                MessageHandler = messageHandler,
                BufferPolicySelector = bufferPolicySelector,
                ExceptionLogger = new EmptyExceptionLogger(),
                ExceptionHandler = new DefaultExceptionHandler(),
                AppDisposing = CancellationToken.None
            };
        }

        ///
        /// Releases unmanaged and optionally managed resources.
        ///
        /// <param name="disposing">
        /// <see langword="true"/> to release both managed and unmanaged resources; <see langword="false"/> to release
        /// only unmanaged resources.
        /// </param>
        /// <remarks>
        /// This class implements <see cref="IDisposable"/> for legacy reasons. New callers should instead provide a
        /// cancellation token via <see cref="AppDisposing"/> using the constructor that takes
        /// <see cref="HttpMessageHandlerOptions"/>.
        /// </remarks>
        protected virtual void Dispose(bool disposing)
        {
            if (disposing)
            {
                OnAppDisposing();
            }
        }

        /// <inheritdoc />
        /// <remarks>
        /// This class implements <see cref="IDisposable"/> for legacy reasons. New callers should instead provide a
        /// cancellation token via <see cref="AppDisposing"/> using the constructor that takes
        /// <see cref="HttpMessageHandlerOptions"/>.
        /// </remarks>
        public void Dispose()
        {
            Dispose(true);
            GC.SuppressFinalize(this);
        }

        private void OnAppDisposing()
        {
            if (!_disposed)
            {
                _messageInvoker.Dispose();
                _disposed = true;
            }
        }
    }
}


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
   "http://www.w3.org/TR/html4/strict.dtd">

  <title></title>
  <meta http-equiv="content-type" content="text/html; charset=utf-8">

seq = input("Enter a DNA sequence: ") # get user input and save it to seq
count_A = 0 # four variables to store the base counts
count_G = 0
count_C = 0
count_T = 0

for base in seq:     # loop through all the bases in the sequence
    if base == "A":  # if we find an A
        count_A += 1 # then update our count of A's
    if base == "G":  # if we find a G
        count_G += 1 # then update our count of G's
    if base == "C":  # etc...
        count_C += 1
    if base == "T":
        count_T += 1

print(count_A, count_G, count_C, count_T) # print all the counts on one line


text:
package com.qrokodial.sparkle.events.emission;

import com.qrokodial.sparkle.events.Event;
import com.qrokodial.sparkle.events.EventSubscriber;
import com.qrokodial.sparkle.events.filtering.IgnoreExcept;
import com.qrokodial.sparkle.events.filtering.ListenerFilter;
import com.qrokodial.sparkle.events.util.Priority;
import com.qrokodial.sparkle.utilities.collections.ArrayUtils;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;

public class EventListener implements Comparable<EventListener> {
    private Object instance;
    private Method method;
    private EventSubscriber subscriber;
    private List<ListenerFilter> filters;

    /**
     * Constructs the class.
     *
     * @param instance
     * @param method
     * @param subscriber
     * @param filters
     */
    public EventListener(Object instance, Method method, EventSubscriber subscriber, ListenerFilter... filters) {
        this.instance = instance;
        this.method = method;
        this.subscriber = subscriber;
        this.filters = Collections.synchronizedList(Arrays.stream(filters).collect(Collectors.toList()));

        if (subscriber.requires().length > 0) {
            this.filters.add(new IgnoreExcept(subscriber.requires()));
        }
    }

    /**
     * @return the priority that this event listener has
     */
    public Priority getPriority() {
        return getSubscriber().priority();
    }

    /**
     * @return the instance of the listener that owns this {@link #getMethod()}
     */
    public Object getInstance() {
        return instance;
    }

    /**
     * @return the method to be invoked when an event is fired
     */
    public Method getMethod() {
        return method;
    }

    /**
     * @return the subscriber annotation attached to this {@link #getMethod()}
     */
    public EventSubscriber getSubscriber() {
        return subscriber;
    }

    /**
     * @return the filters associated with this event listener
     */
    public List<ListenerFilter> getFilters() {
        return Collections.unmodifiableList(filters);
    }

    /**
     * Checks to see if an event should be filtered.
     *
     * @param event the event to check
     * @return true if the event should be filtered, false otherwise
     */
    public boolean shoudFilter(Event event) {
        for (ListenerFilter filter : getFilters()) {
            if (filter.shouldFilter(event)) {
                return true;
            }
        }

        return false;
    }

    /**
     * Fires the method with an event.
     *
     * @param event the event to pass to the method
     */
    public void fire(Event event) {
        try {
            getMethod().invoke(getInstance(), event);
        } catch (IllegalAccessException | InvocationTargetException e) {
            e.printStackTrace();
        }
    }

    @Override
    public int compareTo(EventListener otherListener) {
        return getPriority().compareTo(otherListener.getPriority());
    }
}


text:
/*global browser */
exports.config = {

    //
    // ==================
    // Specify Test Files
    // ==================
    // Define which test specs should run. The pattern is relative to the directory
    // from which `wdio` was called. Notice that, if you are calling `wdio` from an
    // NPM script (see https://docs.npmjs.com/cli/run-script) then the current working
    // directory is where your package.json resides, so `wdio` will be called from there.
    //
    specs: [
        './tests/e2e/*.js'
    ],
    // Patterns to exclude.
    exclude: [
        // 'path/to/excluded/files'
    ],
    //
    // ============
    // Capabilities
    // ============
    // Define your capabilities here. WebdriverIO can run multiple capabilities at the same
    // time. Depending on the number of capabilities, WebdriverIO launches several test
    // sessions. Within your capabilities you can overwrite the spec and exclude options in
    // order to group specific specs to a specific capability.
    //
    // First, you can define how many instances should be started at the same time. Let's
    // say you have 3 different capabilities (Chrome, Firefox, and Safari) and you have
    // set maxInstances to 1; wdio will spawn 3 processes. Therefore, if you have 10 spec
    // files and you set maxInstances to 10, all spec files will get tested at the same time
    // and 30 processes will get spawned. The property handles how many capabilities
    // from the same test should run tests.
    //
    maxInstances: 1,
    //
    // If you have trouble getting all important capabilities together, check out the
    // Sauce Labs platform configurator - a great tool to configure your capabilities:
    // https://docs.saucelabs.com/reference/platforms-configurator
    //
    capabilities: [{
        // maxInstances can get overwritten per capability. So if you have an in-house Selenium
        // grid with only 5 firefox instances available you can make sure that not more than
        // 5 instances get started at a time.
        maxInstances: 1,
        //
        browserName: 'chrome'
    }],
    //
    // ===================
    // Test Configurations
    // ===================
    // Define all options that are relevant for the WebdriverIO instance here
    //
    // By default WebdriverIO commands are executed in a synchronous way using
    // the wdio-sync package. If you still want to run your tests in an async way
    // e.g. using promises you can set the sync option to false.
    sync: true,
    //
    // Level of logging verbosity: silent | verbose | command | data | result | error
    logLevel: 'silent',
    //
    // Enables colors for log output.
    coloredLogs: true,
    //
    // If you only want to run your tests until a specific amount of tests have failed use
    // bail (default is 0 - don't bail, run all tests).
    bail: 0,
    //
    // Saves a screenshot to a given path if a command fails.
    screenshotPath: './errorShots/',
    //
    // Set a base URL in order to shorten url command calls. If your url parameter starts
    // with "/", then the base url gets prepended.
    baseUrl: process.env.TRAVIS_EVENT_TYPE !== 'cron' ? 'http://localhost:6001' : process.env.MONITORED_URL,
    //
    // Default timeout for all waitFor* commands.
    waitforTimeout: 30000,
    //
    // Default timeout in milliseconds for request
    // if Selenium Grid doesn't send response
    connectionRetryTimeout: 90000,
    //
    // Default request retries count
    connectionRetryCount: 3,
    //
    // Initialize the browser instance with a WebdriverIO plugin. The object should have the
    // plugin name as key and the desired plugin options as properties. Make sure you have
    // the plugin installed before running any tests. The following plugins are currently
    // available:
    // WebdriverCSS: https://github.com/webdriverio/webdrivercss
    // WebdriverRTC: https://github.com/webdriverio/webdriverrtc
    // Browserevent: https://github.com/webdriverio/browserevent
    // plugins: {
    //     webdrivercss: {
    //         screenshotRoot: 'my-shots',
    //         failedComparisonsRoot: 'diffs',
    //         misMatchTolerance: 0.05,
    //         screenWidth: [320,480,640,1024]
    //     },
    //     webdriverrtc: {},
    //     browserevent: {}
    // },
    //
    // Test runner services
    // Services take over a specific job you don't want to take care of. They enhance
    // your test setup with almost no effort. Unlike plugins, they don't add new
    // commands. Instead, they hook themselves up into the test process.
    services: ['selenium-standalone','webpack'],
    //
    // Framework you want to run your specs with.
    // The following are supported: Mocha, Jasmine, and Cucumber
    // see also: http://webdriver.io/guide/testrunner/frameworks.html
    //
    // Make sure you have the wdio adapter package for the specific framework installed
    // before running any tests.
    framework: 'mocha',
    //
    // Test reporter for stdout.
    // The only one supported by default is 'dot'
    // see also: http://webdriver.io/guide/testrunner/reporters.html
    reporters: ['dot', 'spec'],

    //
    // Options to be passed to Mocha.
    // See the full list at http://mochajs.org/
    mochaOpts: {
        ui: 'bdd',
        compilers: ['js:babel-register']
    },
    //
    // =====
    // Hooks
    // =====
    // WebdriverIO provides several hooks you can use to interfere with the test process in order to enhance
    // it and to build services around it. You can either apply a single function or an array of
    // methods to it. If one of them returns with a promise, WebdriverIO will wait until that promise got
    // resolved to continue.
    /**
     * Gets executed once before all workers get launched.
     * @param {Object} config wdio configuration object
     * @param {Array.<Object>} capabilities list of capabilities details
     */
    onPrepare: function (config, capabilities) {
      if(process.env.TRAVIS_EVENT_TYPE !== 'cron'){
          this.app = require('./src-server/app.js');
      }
      if(!process.env.TEST_USER1_LOGIN){
        console.error('No test user configured, set env variable TEST_USER1_LOGIN');
      }
      if(!process.env.TEST_USER1_PASSWORD){
        console.error('No test user configured, set env variable TEST_USER1_PASSWORD');
      }
    },
    /**
     * Gets executed just before initialising the webdriver session and test framework. It allows you
     * to manipulate configurations depending on the capability or spec.
     * @param {Object} config wdio configuration object
     * @param {Array.<Object>} capabilities list of capabilities details
     * @param {Array.<String>} specs List of spec file paths that are to be run
     */
    // beforeSession: function (config, capabilities, specs) {
    // },
    /**
     * Gets executed before test execution begins. At this point you can access to all global
     * variables like `browser`. It is the perfect place to define custom commands.
     * @param {Array.<Object>} capabilities list of capabilities details
     * @param {Array.<String>} specs List of spec file paths that are to be run
     */
    before: function (capabilities, specs) {
      browser.addCommand("newNode", function (type, nodeText) {
        browser.dragAndDrop('#jsPlumb_1_' + type, '#app-container > div > div:nth-child(3) > div.col-lg-11.col-md-10.col-sm-10.col-xs-9 > div > div:nth-child(1)');

        browser.waitForVisible('h4.modal-title');
        if (type === 1) {
          browser.getText('h4.modal-title').should.equal('Create a new user');
        } else {
          browser.getText('h4.modal-title').should.equal('Create a new node');
        }

        browser.setValue('input#name', nodeText);
        browser.setValue('textarea#description', "Component description");
        if (type !== 1) {
          browser.setValue('input#responsiblePerson', "dummy@dummy.dummy");
        }

        browser.click('button=Create');
        browser.waitForVisible('button=Create',5000, true);
        browser.waitForVisible('//div[text()=\'' + nodeText + '\']');
      });

      browser.addCommand("moveNode", function (nodeText, x, y) {
        if(!browser.isExisting('.glyphicon-move')){
            browser.click('//div[text()=\'' + nodeText + '\']');
        } else {
          browser.click('//div[text()=\'' + nodeText + '\']');
          browser.click('//div[text()=\'' + nodeText + '\']');
        }
        browser.waitForVisible('.glyphicon-move');
        browser.moveToObject('.glyphicon-move',0,0);
        browser.buttonDown(0);
        browser.moveToObject('.glyphicon-move',x,y);
        browser.buttonUp(0);
        if(browser.isExisting('.glyphicon-move')){
            browser.click('//div[text()=\'' + nodeText + '\']');
        }
      });

      browser.addCommand("deleteNode", function (nodeText) {
        browser.pause(1000);
        browser.click('//div[text()=\'' + nodeText + '\']');
        browser.waitForVisible('div.jtk-draggable div .glyphicon-remove');
        browser.click('div.jtk-draggable div .glyphicon-remove');
      });

      browser.addCommand("connectNodes", function (nodeText1, nodeText2) {
        if(!browser.isExisting('.glyphicon-link')){
            browser.click('//div[text()=\'' + nodeText1 + '\']');
        } else {
          browser.click('//div[text()=\'' + nodeText1 + '\']');
          browser.click('//div[text()=\'' + nodeText1 + '\']');
        }
        browser.waitForVisible('.glyphicon-link');
        browser.dragAndDrop('.glyphicon-link','//div[text()=\'' + nodeText2 + '\']/..');
        if(browser.isExisting('.glyphicon-link')){
            browser.click('//div[text()=\'' + nodeText1 + '\']');
        }
      });
    },
    //
    /**
     * Hook that gets executed before the suite starts
     * @param {Object} suite suite details
     */
    // beforeSuite: function (suite) {
    // },
    /**
     * Hook that gets executed _before_ a hook within the suite starts (e.g. runs before calling
     * beforeEach in Mocha)
     */
    // beforeHook: function () {
    // },
    /**
     * Hook that gets executed _after_ a hook within the suite starts (e.g. runs after calling
     * afterEach in Mocha)
     */
    // afterHook: function () {
    // },
    /**
     * Function to be executed before a test (in Mocha/Jasmine) or a step (in Cucumber) starts.
     * @param {Object} test test details
     */
    // beforeTest: function (test) {
    // },
    /**
     * Runs before a WebdriverIO command gets executed.
     * @param {String} commandName hook command name
     * @param {Array} args arguments that command would receive
     */
    // beforeCommand: function (commandName, args) {
    // },
    /**
     * Runs after a WebdriverIO command gets executed
     * @param {String} commandName hook command name
     * @param {Array} args arguments that command would receive
     * @param {Number} result 0 - command success, 1 - command error
     * @param {Object} error error object if any
     */
    // afterCommand: function (commandName, args, result, error) {
    // },
    /**
     * Function to be executed after a test (in Mocha/Jasmine) or a step (in Cucumber) starts.
     * @param {Object} test test details
     */
    // afterTest: function (test) {
    // },
    /**
     * Hook that gets executed after the suite has ended
     * @param {Object} suite suite details
     */
    // afterSuite: function (suite) {
    // },
    /**
     * Gets executed after all tests are done. You still have access to all global variables from
     * the test.
     * @param {Number} result 0 - test pass, 1 - test fail
     * @param {Array.<Object>} capabilities list of capabilities details
     * @param {Array.<String>} specs List of spec file paths that ran
     */
    // after: function (result, capabilities, specs) {
    // },
    /**
     * Gets executed right after terminating the webdriver session.
     * @param {Object} config wdio configuration object
     * @param {Array.<Object>} capabilities list of capabilities details
     * @param {Array.<String>} specs List of spec file paths that ran
     */
    // afterSession: function (config, capabilities, specs) {
    // },
    /**
     * Gets executed after all workers got shut down and the process is about to exit. It is not
     * possible to defer the end of the process using a promise.
     * @param {Object} exitCode 0 - success, 1 - fail
     */
    onComplete: function(exitCode) {
      if(process.env.TRAVIS_EVENT_TYPE !== 'cron'){
        this.app.___conn.db.dropDatabase();
      }
      return exitCode;
    }
};


text:
package org.spontaneous.server.config.oauth2;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.http.SessionCreationPolicy;
import org.springframework.security.oauth2.config.annotation.web.configuration.EnableResourceServer;
import org.springframework.security.oauth2.config.annotation.web.configuration.ResourceServerConfigurerAdapter;
import org.springframework.security.oauth2.config.annotation.web.configurers.ResourceServerSecurityConfigurer;

/**
 * Configuration for the OAuth2 ResourceServer.
 * <p>
 * Protected resources are all mobile client requests: "/spontaneous/secure"
 *
 * @author Horst Jilg
 */
@Configuration
@EnableResourceServer
public class ResourceServerConfiguration extends ResourceServerConfigurerAdapter {

  @Value("spontaneous/secure")
  private String resourceId;

  @Override
  public void configure(ResourceServerSecurityConfigurer resources) {
    resources.resourceId(resourceId);
  }

  @Override
  public void configure(HttpSecurity http) throws Exception {
    http.sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS).and().requestMatchers().antMatchers("/spontaneous/secure/**").and()
        .authorizeRequests().antMatchers("/secure/**").hasAnyRole("USER", "ADMIN", "SUPERADMIN");
  }

}


text:
package org.semanticweb.elk.reasoner.indexing.model;

/**
 * An {@link IndexedSubObjectPropertyOfAxiomInference} that can be modified as a
 * result of updating the {@link ModifiableOntologyIndex} where this object is
 * stored.
 *
 * @author "Yevgeny Kazakov"
 */
public interface ModifiableIndexedSubObjectPropertyOfAxiomInference
		extends ModifiableIndexedAxiomInference,
		IndexedSubObjectPropertyOfAxiomInference {

	/**
	 * @param factory
	 *            the factory for creating conclusions
	 *
	 * @return the conclusion produced by this inference
	 */
	public ModifiableIndexedSubObjectPropertyOfAxiom getConclusion(
			ModifiableIndexedSubObjectPropertyOfAxiom.Factory factory);

	/**
	 * A factory for creating instances
	 *
	 * @author Yevgeny Kazakov
	 *
	 */
	interface Factory extends
			ModifiableElkEquivalentObjectPropertiesAxiomConversion.Factory,
			ModifiableElkSubObjectPropertyOfAxiomConversion.Factory,
			ModifiableElkTransitiveObjectPropertyAxiomConversion.Factory {

		// combined interface

	}

	/**
	 * The visitor pattern for instances
	 *
	 * @author Yevgeny Kazakov
	 *
	 * @param <O>
	 *            the type of the output
	 */
	interface Visitor<O> extends
			ModifiableElkEquivalentObjectPropertiesAxiomConversion.Visitor<O>,
			ModifiableElkSubObjectPropertyOfAxiomConversion.Visitor<O>,
			ModifiableElkTransitiveObjectPropertyAxiomConversion.Visitor<O> {

		// combined interface

	}

	<O> O accept(Visitor<O> visitor);

}


text:
<?xml version="1.0" encoding="UTF-8"?>
<GeocodeResponse>
 <status>OK</status>
 <result>
  <type>locality</type>
  <type>political</type>
  <formatted_address>2144 Altlichtenwarth, Austria</formatted_address>
  <address_component>
   <long_name>Altlichtenwarth</long_name>
   <short_name>Altlichtenwarth</short_name>
   <type>locality</type>
   <type>political</type>
  </address_component>
  <address_component>
   <long_name>Altlichtenwarth</long_name>
   <short_name>Altlichtenwarth</short_name>
   <type>administrative_area_level_3</type>
   <type>political</type>
  </address_component>
  <address_component>
   <long_name>Mistelbach District</long_name>
   <short_name>Mistelbach District</short_name>
   <type>administrative_area_level_2</type>
   <type>political</type>
  </address_component>
  <address_component>
   <long_name>Lower Austria</long_name>
   <short_name>Lower Austria</short_name>
   <type>administrative_area_level_1</type>
   <type>political</type>
  </address_component>
  <address_component>
   <long_name>Austria</long_name>
   <short_name>AT</short_name>
   <type>country</type>
   <type>political</type>
  </address_component>
  <address_component>
   <long_name>2144</long_name>
   <short_name>2144</short_name>
   <type>postal_code</type>
  </address_component>
  <geometry>
   <location>
    <lat>48.6446495</lat>
    <lng>16.7961953</lng>
   </location>
   <location_type>APPROXIMATE</location_type>
   <viewport>
    <southwest>
     <lat>48.6280199</lat>
     <lng>16.7508201</lng>
    </southwest>
    <northeast>
     <lat>48.6695900</lat>
     <lng>16.8452799</lng>
    </northeast>
   </viewport>
   <bounds>
    <southwest>
     <lat>48.6280199</lat>
     <lng>16.7508201</lng>
    </southwest>
    <northeast>
     <lat>48.6695900</lat>
     <lng>16.8452799</lng>
    </northeast>
   </bounds>
  </geometry>
  <place_id>ChIJKQ1uWDwobUcRzs1ZRR2VEaw</place_id>
 </result>
</GeocodeResponse>


text:
import * as React from 'react';
import * as fp from 'lodash/fp';

import { TextModal } from 'app/components/text-modal';

import { SupportMailto } from './support';

interface State {
  show: boolean;
  title: string;
  body: string;
}

export interface WithErrorModalProps {
  showErrorModal: (title: string, body: string) => void;
}

export const withErrorModalWrapper = () => {
  return (WrappedComponent) => {
    return class ErrorModalWrapper extends React.Component<any, State> {
      constructor(props) {
        super(props);

        this.state = {
          show: false,
          title: 'Title',
          body: 'Body',
        };
      }

      show(title: string, body: string) {
        this.setState({
          show: true,
          title: title,
          body: body,
        });
      }

      render() {
        return (
          <React.Fragment>
            {this.state.show && (
              <TextModal
                role='alertdialog'
                title={this.state.title}
                body={this.state.body}
                closeFunction={() => this.setState({ show: false })}
              />
            )}
            <WrappedComponent
              showErrorModal={this.show.bind(this)}
              {...this.props}
            />
          </React.Fragment>
        );
      }
    };
  };
};

export interface WithProfileErrorModalProps {
  showProfileErrorModal?: (message: string) => void;
}

export const withProfileErrorWrapper = (WrappedComponent) => {
  const body = ({ message }) => (
    <React.Fragment>

        An error occurred while saving your profile. The following message was
        returned:

"{message}"

        Please try again or contact <SupportMailto />.

    </React.Fragment>
  );

  return ({ showErrorModal, ...props }) => (
    <WrappedComponent
      showProfileErrorModal={(message) =>
        showErrorModal('Error saving profile', body({ message }))
      }
      {...props}
    />
  );
};

export const withProfileErrorModal = fp.flow(
  withProfileErrorWrapper,
  withErrorModalWrapper()
);


text:
Fluid-RWD
=========

Light framework for making a fluid responsive web design


text:
A method that unmounts the component. This can be used to simulate a component going through
an unmount/mount lifecycle.

#### Returns

`ShallowWrapper`: Returns itself.

#### Example

```jsx
import PropTypes from 'prop-types';
import sinon from 'sinon';

const spy = sinon.spy();

class Foo extends React.Component {
  constructor(props) {
    super(props);
    this.componentWillUnmount = spy;
  }

  render() {
    const { id } = this.props;
    return (
      <div className={id}>
        {id}
      </div>
    );
  }
}
Foo.propTypes = {
  id: PropTypes.string.isRequired,
};
const wrapper = shallow(<Foo id="foo" />);
expect(spy).to.have.property('callCount', 0);
wrapper.unmount();
expect(spy).to.have.property('callCount', 1);
```


text:
namespace boost { namespace fusion
{
    template <typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9>
    struct tuple : vector<T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9>
    {
        typedef vector<
            T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9>
        base_type;
        tuple()
            : base_type() {}
        tuple(tuple const& rhs)
            : base_type(rhs) {}
        template <typename U1, typename U2>
        tuple(std::pair<U1, U2> const& rhs)
            : base_type(rhs) {}
    explicit
    tuple(typename detail::call_param<T0 >::type _0)
        : base_type(_0) {}
    template <typename U0>
    tuple(tuple<U0> const& rhs)
        : base_type(rhs) {}
    template <typename U0>
    tuple& operator=(tuple<U0> const& rhs)
    {
        base_type::operator=(rhs);
        return *this;
    }
    tuple(typename detail::call_param<T0 >::type _0 , typename detail::call_param<T1 >::type _1)
        : base_type(_0 , _1) {}
    template <typename U0 , typename U1>
    tuple(tuple<U0 , U1> const& rhs)
        : base_type(rhs) {}
    template <typename U0 , typename U1>
    tuple& operator=(tuple<U0 , U1> const& rhs)
    {
        base_type::operator=(rhs);
        return *this;
    }
    tuple(typename detail::call_param<T0 >::type _0 , typename detail::call_param<T1 >::type _1 , typename detail::call_param<T2 >::type _2)
        : base_type(_0 , _1 , _2) {}
    template <typename U0 , typename U1 , typename U2>
    tuple(tuple<U0 , U1 , U2> const& rhs)
        : base_type(rhs) {}
    template <typename U0 , typename U1 , typename U2>
    tuple& operator=(tuple<U0 , U1 , U2> const& rhs)
    {
        base_type::operator=(rhs);
        return *this;
    }
    tuple(typename detail::call_param<T0 >::type _0 , typename detail::call_param<T1 >::type _1 , typename detail::call_param<T2 >::type _2 , typename detail::call_param<T3 >::type _3)
        : base_type(_0 , _1 , _2 , _3) {}
    template <typename U0 , typename U1 , typename U2 , typename U3>
    tuple(tuple<U0 , U1 , U2 , U3> const& rhs)
        : base_type(rhs) {}
    template <typename U0 , typename U1 , typename U2 , typename U3>
    tuple& operator=(tuple<U0 , U1 , U2 , U3> const& rhs)
    {
        base_type::operator=(rhs);
        return *this;
    }
    tuple(typename detail::call_param<T0 >::type _0 , typename detail::call_param<T1 >::type _1 , typename detail::call_param<T2 >::type _2 , typename detail::call_param<T3 >::type _3 , typename detail::call_param<T4 >::type _4)
        : base_type(_0 , _1 , _2 , _3 , _4) {}
    template <typename U0 , typename U1 , typename U2 , typename U3 , typename U4>
    tuple(tuple<U0 , U1 , U2 , U3 , U4> const& rhs)
        : base_type(rhs) {}
    template <typename U0 , typename U1 , typename U2 , typename U3 , typename U4>
    tuple& operator=(tuple<U0 , U1 , U2 , U3 , U4> const& rhs)
    {
        base_type::operator=(rhs);
        return *this;
    }
    tuple(typename detail::call_param<T0 >::type _0 , typename detail::call_param<T1 >::type _1 , typename detail::call_param<T2 >::type _2 , typename detail::call_param<T3 >::type _3 , typename detail::call_param<T4 >::type _4 , typename detail::call_param<T5 >::type _5)
        : base_type(_0 , _1 , _2 , _3 , _4 , _5) {}
    template <typename U0 , typename U1 , typename U2 , typename U3 , typename U4 , typename U5>
    tuple(tuple<U0 , U1 , U2 , U3 , U4 , U5> const& rhs)
        : base_type(rhs) {}
    template <typename U0 , typename U1 , typename U2 , typename U3 , typename U4 , typename U5>
    tuple& operator=(tuple<U0 , U1 , U2 , U3 , U4 , U5> const& rhs)
    {
        base_type::operator=(rhs);
        return *this;
    }
    tuple(typename detail::call_param<T0 >::type _0 , typename detail::call_param<T1 >::type _1 , typename detail::call_param<T2 >::type _2 , typename detail::call_param<T3 >::type _3 , typename detail::call_param<T4 >::type _4 , typename detail::call_param<T5 >::type _5 , typename detail::call_param<T6 >::type _6)
        : base_type(_0 , _1 , _2 , _3 , _4 , _5 , _6) {}
    template <typename U0 , typename U1 , typename U2 , typename U3 , typename U4 , typename U5 , typename U6>
    tuple(tuple<U0 , U1 , U2 , U3 , U4 , U5 , U6> const& rhs)
        : base_type(rhs) {}
    template <typename U0 , typename U1 , typename U2 , typename U3 , typename U4 , typename U5 , typename U6>
    tuple& operator=(tuple<U0 , U1 , U2 , U3 , U4 , U5 , U6> const& rhs)
    {
        base_type::operator=(rhs);
        return *this;
    }
    tuple(typename detail::call_param<T0 >::type _0 , typename detail::call_param<T1 >::type _1 , typename detail::call_param<T2 >::type _2 , typename detail::call_param<T3 >::type _3 , typename detail::call_param<T4 >::type _4 , typename detail::call_param<T5 >::type _5 , typename detail::call_param<T6 >::type _6 , typename detail::call_param<T7 >::type _7)
        : base_type(_0 , _1 , _2 , _3 , _4 , _5 , _6 , _7) {}
    template <typename U0 , typename U1 , typename U2 , typename U3 , typename U4 , typename U5 , typename U6 , typename U7>
    tuple(tuple<U0 , U1 , U2 , U3 , U4 , U5 , U6 , U7> const& rhs)
        : base_type(rhs) {}
    template <typename U0 , typename U1 , typename U2 , typename U3 , typename U4 , typename U5 , typename U6 , typename U7>
    tuple& operator=(tuple<U0 , U1 , U2 , U3 , U4 , U5 , U6 , U7> const& rhs)
    {
        base_type::operator=(rhs);
        return *this;
    }
    tuple(typename detail::call_param<T0 >::type _0 , typename detail::call_param<T1 >::type _1 , typename detail::call_param<T2 >::type _2 , typename detail::call_param<T3 >::type _3 , typename detail::call_param<T4 >::type _4 , typename detail::call_param<T5 >::type _5 , typename detail::call_param<T6 >::type _6 , typename detail::call_param<T7 >::type _7 , typename detail::call_param<T8 >::type _8)
        : base_type(_0 , _1 , _2 , _3 , _4 , _5 , _6 , _7 , _8) {}
    template <typename U0 , typename U1 , typename U2 , typename U3 , typename U4 , typename U5 , typename U6 , typename U7 , typename U8>
    tuple(tuple<U0 , U1 , U2 , U3 , U4 , U5 , U6 , U7 , U8> const& rhs)
        : base_type(rhs) {}
    template <typename U0 , typename U1 , typename U2 , typename U3 , typename U4 , typename U5 , typename U6 , typename U7 , typename U8>
    tuple& operator=(tuple<U0 , U1 , U2 , U3 , U4 , U5 , U6 , U7 , U8> const& rhs)
    {
        base_type::operator=(rhs);
        return *this;
    }
    tuple(typename detail::call_param<T0 >::type _0 , typename detail::call_param<T1 >::type _1 , typename detail::call_param<T2 >::type _2 , typename detail::call_param<T3 >::type _3 , typename detail::call_param<T4 >::type _4 , typename detail::call_param<T5 >::type _5 , typename detail::call_param<T6 >::type _6 , typename detail::call_param<T7 >::type _7 , typename detail::call_param<T8 >::type _8 , typename detail::call_param<T9 >::type _9)
        : base_type(_0 , _1 , _2 , _3 , _4 , _5 , _6 , _7 , _8 , _9) {}
    template <typename U0 , typename U1 , typename U2 , typename U3 , typename U4 , typename U5 , typename U6 , typename U7 , typename U8 , typename U9>
    tuple(tuple<U0 , U1 , U2 , U3 , U4 , U5 , U6 , U7 , U8 , U9> const& rhs)
        : base_type(rhs) {}
    template <typename U0 , typename U1 , typename U2 , typename U3 , typename U4 , typename U5 , typename U6 , typename U7 , typename U8 , typename U9>
    tuple& operator=(tuple<U0 , U1 , U2 , U3 , U4 , U5 , U6 , U7 , U8 , U9> const& rhs)
    {
        base_type::operator=(rhs);
        return *this;
    }
        template <typename T>
        tuple& operator=(T const& rhs)
        {
            base_type::operator=(rhs);
            return *this;
        }
        tuple& operator=(tuple const& rhs)
        {
            base_type::operator=(rhs);
            return *this;
        }
        template <typename U1, typename U2>
        tuple& operator=(std::pair<U1, U2> const& rhs)
        {
            base_type::operator=(rhs);
            return *this;
        }
    };
    template <typename Tuple>
    struct tuple_size : result_of::size<Tuple> {};
    template <int N, typename Tuple>
    struct tuple_element : result_of::value_at_c<Tuple, N> {};
    template <int N, typename Tuple>
    inline typename
        lazy_disable_if<
            is_const<Tuple>
          , result_of::at_c<Tuple, N>
        >::type
    get(Tuple& tup)
    {
        return at_c<N>(tup);
    }
    template <int N, typename Tuple>
    inline typename result_of::at_c<Tuple const, N>::type
    get(Tuple const& tup)
    {
        return at_c<N>(tup);
    }
}}


text:
.. _ref::Runnable:

Runnable
--------

.. autoclass:: amplpy.Runnable
  :member-order: bysource
  :members:
  :undoc-members:
  :special-members:


text:
module World where

import Test.HUnit
import Game.Render.World
import Control.Lens

import Game.World.Import.Tiled

--tests :: Test
--tests = TestList [TestLabel "test1" test1, TestLabel "test2" test2]

--testLoadMap :: Test
--testLoadMap = TestCase (do
--		tm <- tMap
--		let world = loadMapFromTiled tm

--		let nWorld = wUpdate (do
--				Just tsId <- use $ mapHashes.gameTilesets.at "sprite_klein3"
--				wObject "Player1" .= (Just $ newObject tsId 0)
--				Just objId <- use $ mapHashes.gameObjects.at "Player1"
--				wLayer "ObjectLayer" .= (Just $ newLayer ObjectLayerType)
--				wLayerObject "ObjectLayer" "Player1" .= (Just $ newRenderObject objId (50, 50) 0)

--			) world

--		print nWorld
--		return ()
--	)

--testAddRemove :: Test
--testAddRemove = TestCase (do
--		let w = newWorld
--			& wSize .~ (50, 50)
--			& wTileSize .~ (24, 24)
--			& wTileset "BaseTileset" .~ Just newTileset
--				& wTileSize .~ (24, 24)
--		let wb = w
--			& wTileset "TestTs" .~ Just newTileset
--		let w' = w
--			& wTileset "TestTileset" .~ Just newTileset
--			& wTileset "TestTs" .~ Just newTileset
--		let w'' = w'
--			& wTileset "TestTileset" .~ Nothing
--		assertBool "world differs after add and remove" (shallowEqual wb w'')
--	)


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="generator" content="rustdoc">
    <meta name="description" content="API documentation for the Rust `MutexGuard` struct in crate `spin`.">
    <meta name="keywords" content="rust, rustlang, rust-lang, MutexGuard">

    <title>spin::MutexGuard - Rust</title>

    <link rel="stylesheet" type="text/css" href="../rustdoc.css">
    <link rel="stylesheet" type="text/css" href="../main.css">

spin

        <form class="search-form js-only">

                <input class="search-input" name="search"
                       autocomplete="off"
                       placeholder="Click or press 'S' to search, '?' for more options…"
                       type="search">

        </form>

Struct spin::<wbr>MutexGuard

                       [−]

               [src]

pub struct MutexGuard<'a, T: ?Sized + 'a> {
    // some fields omitted
}

A guard to which the protected data can be accessed

When the guard falls out of scope it will release the lock.

Trait Implementations

impl<'a, T: ?Sized> Deref for MutexGuard<'a, T>

[src]

type Target = T

The resulting type after dereferencing

fn deref<'b>(&'b self) -> &'b T

The method called to dereference a value

impl<'a, T: ?Sized> DerefMut for MutexGuard<'a, T>

[src]

fn deref_mut<'b>(&'b mut self) -> &'b mut T

The method called to mutably dereference a value

impl<'a, T: ?Sized> Drop for MutexGuard<'a, T>

[src]

fn drop(&mut self)

The dropping of the MutexGuard will release the lock it was created from.

Help

Keyboard Shortcuts

?

Show this help dialog

S

Focus the search field

⇤

Move up in search results

⇥

Move down in search results

⏎

Go to active search result

+

Collapse/expand all sections

Search Tricks

                    Prefix searches with a type followed by a colon (e.g.
                    fn:) to restrict the search to a given type.

                    Accepted types are: fn, mod,
                    struct, enum,
                    trait, type, macro,
                    and const.

                    Search functions by type signature (e.g.
                    vec -> usize or * -> vec)


text:
<?php namespace Toyotadjakarta\SalesModule\Model;

use Anomaly\Streams\Platform\Entry\EntryCollection;

class ModelCollection extends EntryCollection
{

}


text:
<?php
defined('C5_EXECUTE') or die("Access Denied.");
?>

<div data-search="pages" class="ccm-ui">

	<?php
	$header->render();
	?>

	<?php Loader::element('pages/search', array('result' => $result))?>

</div>

<script type="text/javascript">
	$(function() {
		$('div[data-search=pages]').concretePageAjaxSearch({
			result: <?=json_encode($result->getJSONObject())?>,
			mode: 'choose'
		});
	});
</script>


text:
import {Component, View} from 'angular2/core';

@Component({
	selector:'splash'
})
@View({
	templateUrl:'client/splash/splash.html'
})

export class Splash{}