text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

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

    <title>hyperstream.tool.tool — HyperStream 1.0 documentation</title>

    <link rel="stylesheet" href="../../../static/alabaster.css" type="text/css" />
    <link rel="stylesheet" href="../../../static/pygments.css" type="text/css" />

    <link rel="top" title="HyperStream 1.0 documentation" href="../../../index.html" />
    <link rel="up" title="Module code" href="../../index.html" />

  <link rel="stylesheet" href="../../../static/custom.css" type="text/css" />

  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />

Source code for hyperstream.tool.tool

# The MIT License (MIT)
# Copyright (c) 2014-2017 University of Bristol
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
# OR OTHER DEALINGS IN THE SOFTWARE.

from . import BaseTool
from ..time_interval import TimeInterval, TimeIntervals
from ..stream import Stream
from ..utils import StreamNotAvailableError, ToolExecutionError

from datetime import timedelta
import logging

[docs]class Tool(BaseTool):
    """
    Base class for tools. Tools are the unit of computation, operating on input streams to produce an output stream
    """

    def _execute(self, sources, alignment_stream, interval):
        """
        Tool implementations should override this function to actually perform computations

        :param sources: The source streams (possibly None)
        :param alignment_stream: The alignment stream
        :param interval: The time interval
        :type sources: list[Stream] | tuple[Stream] | None
        :type alignment_stream: Stream | None
        :type interval: TimeInterval
        :return: None
        """
        raise NotImplementedError

[docs]    def execute(self, sources, sink, alignment_stream, interval):
        """
        Execute the tool over the given time interval.
        If an alignment stream is given, the output instances will be aligned to this stream

        :param sources: The source streams (possibly None)
        :param sink: The sink stream
        :param alignment_stream: The alignment stream
        :param interval: The time interval
        :type sources: list[Stream] | tuple[Stream] | None
        :type sink: Stream
        :type alignment_stream: Stream | None
        :type interval: TimeInterval
        :return: None
        """
        if not isinstance(interval, TimeInterval):
            raise TypeError('Expected TimeInterval, got {}'.format(type(interval)))
        # logging.info(self.message(interval))

        if interval.end > sink.channel.up_to_timestamp:
            raise StreamNotAvailableError(self.up_to_timestamp)

        required_intervals = TimeIntervals([interval]) - sink.calculated_intervals

        if not required_intervals.is_empty:
            produced_data = False

            for interval in required_intervals:
                for stream_instance in self._execute(
                        sources=sources, alignment_stream=alignment_stream, interval=interval):
                    sink.writer(stream_instance)
                    produced_data = True
                sink.calculated_intervals += interval

            required_intervals = TimeIntervals([interval]) - sink.calculated_intervals
            if not required_intervals.is_empty:
                # raise ToolExecutionError(required_intervals)
                logging.error("{} execution error for time interval {} on stream {}".format(
                    self.name, interval, sink))

            if not produced_data:
                logging.debug("{} did not produce any data for time interval {} on stream {}".format(
                    self.name, interval, sink))

Related Topics

Documentation overview

Module code

Quick search

    <form class="search" action="../../../search.html" method="get">

<input type="text" name="q" />

<input type="submit" value="Go" />

      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>

      ©2016, SPHERE WP5.

      |
      Powered by Sphinx 1.4.6
      & Alabaster 0.7.9


text:
/*!
 * \file   text_ostream_backend.hpp
 * \author Andrey Semashev
 * \date   22.04.2007
 *
 * The header contains implementation of a text output stream sink backend.
 */

#ifndef BOOST_LOG_SINKS_TEXT_OSTREAM_BACKEND_HPP_INCLUDED_
#define BOOST_LOG_SINKS_TEXT_OSTREAM_BACKEND_HPP_INCLUDED_

#include <ostream>
#include <boost/smart_ptr/shared_ptr.hpp>
#include <boost/log/detail/config.hpp>
#include <boost/log/sinks/basic_sink_backend.hpp>
#include <boost/log/sinks/frontend_requirements.hpp>
#include <boost/log/detail/header.hpp>

#ifdef BOOST_HAS_PRAGMA_ONCE
#pragma once
#endif

namespace boost {

BOOST_LOG_OPEN_NAMESPACE

namespace sinks {

/*!
 * \brief An implementation of a text output stream logging sink backend
 *
 * The sink backend puts formatted log records to one or more text streams.
 */
template< typename CharT >
class basic_text_ostream_backend :
    public basic_formatted_sink_backend<
        CharT,
        combine_requirements< synchronized_feeding, flushing >::type
    >
{
    //! Base type
    typedef basic_formatted_sink_backend<
        CharT,
        combine_requirements< synchronized_feeding, flushing >::type
    > base_type;

public:
    //! Character type
    typedef typename base_type::char_type char_type;
    //! String type to be used as a message text holder
    typedef typename base_type::string_type string_type;
    //! Output stream type
    typedef std::basic_ostream< char_type > stream_type;

private:
    //! \cond

    struct implementation;
    implementation* m_pImpl;

    //! \endcond

public:
    /*!
     * Constructor. No streams attached to the constructed backend, auto flush feature disabled.
     */
    BOOST_LOG_API basic_text_ostream_backend();
    /*!
     * Destructor
     */
    BOOST_LOG_API ~basic_text_ostream_backend();

    /*!
     * The method adds a new stream to the sink.
     *
     * \param strm Pointer to the stream. Must not be NULL.
     */
    BOOST_LOG_API void add_stream(shared_ptr< stream_type > const& strm);
    /*!
     * The method removes a stream from the sink. If the stream is not attached to the sink,
     * the method has no effect.
     *
     * \param strm Pointer to the stream. Must not be NULL.
     */
    BOOST_LOG_API void remove_stream(shared_ptr< stream_type > const& strm);

    /*!
     * Sets the flag to automatically flush buffers of all attached streams after each log record
     */
    BOOST_LOG_API void auto_flush(bool f = true);

    /*!
     * The method writes the message to the sink
     */
    BOOST_LOG_API void consume(record_view const& rec, string_type const& formatted_message);

    /*!
     * The method flushes the associated streams
     */
    BOOST_LOG_API void flush();
};

#ifdef BOOST_LOG_USE_CHAR
typedef basic_text_ostream_backend< char > text_ostream_backend;        //!< Convenience typedef for narrow-character logging
#endif
#ifdef BOOST_LOG_USE_WCHAR_T
typedef basic_text_ostream_backend< wchar_t > wtext_ostream_backend;    //!< Convenience typedef for wide-character logging
#endif

} // namespace sinks

BOOST_LOG_CLOSE_NAMESPACE // namespace log

} // namespace boost

#include <boost/log/detail/footer.hpp>

#endif // BOOST_LOG_SINKS_TEXT_OSTREAM_BACKEND_HPP_INCLUDED_

redpajama_set_name: RedPajamaGithub


text:
Expression that describes the relationship between the tag names and the build names.

It is an expression where * can be used as a placeholder.

If using (...), the part in parenthesis if the build name.

If no parenthesis is used, the whole match is meant as build name.

It defaults to *, meaning that we have a 1:1 relationship between the tag and the build name.

Examples:

2.0.* - only tag names starting with 2.0. can be considered as builds. The tag
    name is the same as the build name.

v(2.0.*) - only tag names starting with v2.0. can be considered as builds and
    the build name is created from the tag name by removing the v prefix.


text:
<?php

require_once(__DIR__.'/class.exception.php');

//
// Set exception handler
//
set_exception_handler(function($e) {
  echo $e;
  die;
});

//
// Check for .htaccess-file
//
if (file_exists(__DIR__.'/../.htaccess') &&
  md5_file(__DIR__.'/../.htaccess')!='f35889f49bba03695ce0bdcf6c132f54') {
  throw new \yawf\exception(
    'The .htaccess file is corrupted.',
    'Reinstall it freshly.');
}

//
// Check file permissons
//
$files = array( 'cache/config.manifest', 'cache/config.cache' );
foreach ($files as $file) {
  if (! @is_writable(__DIR__.'/'.$file)) {
    if (! @chmod(__DIR__.'/'.$file, 0666)) {
      throw new yawf_exception(
      'While setting up YAWF framework',
      'The cache files of the framework are not writeable',
      'Increase writing permissons (chmod) of all files in folder [core/cache/]. Dependet on your system, permissons must be set up to 666.');
    }
  }
}
unset($files);

?>


text:
<?php
class Kwc_Chained_Abstract_MasterGenerator extends Kwf_Component_Generator_PseudoPage_Static
{
    protected $_inherits = true;
    protected $_loadTableFromComponent = true;
    protected $_addUrlPart = false;

    public function getPagesControllerConfig($component, $generatorClass = null)
    {
        $ret = parent::getPagesControllerConfig($component, $generatorClass);
        $ret['icon'] = 'layout_content';
        return $ret;
    }

    protected function _init()
    {
        parent::_init();
    }

    public function getGeneratorFlags()
    {
        $ret = parent::getGeneratorFlags();
        $ret['showInPageTreeAdmin'] = true;
        return $ret;
    }
}


text: tfaruq's personal blog


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--

    Copyright 2005-2014 The Kuali Foundation

    Licensed under the Educational Community License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

    http://www.opensource.org/licenses/ecl2.php

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

    <modelVersion>4.0.0</modelVersion>

    <groupId>org.kuali.rice</groupId>
    <artifactId>scripts-krad-conv</artifactId>
    <name>scripts-krad-conv project</name>
    <version>1.0-SNAPSHOT</version>
  <description>
    Conversion Scripts related to KNS KRAD Conversion
  </description>
  <dependencies>
    <dependency>
      <groupId>org.codehaus.gmaven.runtime</groupId>
      <artifactId>gmaven-runtime-1.8</artifactId>
      <version>1.5</version>
      <exclusions>
        <exclusion>
          <groupId>org.codehaus.groovy</groupId>
          <artifactId>groovy-all</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.codehaus.groovy</groupId>
      <artifactId>groovy-all</artifactId>
      <version>1.8.7</version>
    </dependency>
    <dependency>
      <groupId>commons-io</groupId>
      <artifactId>commons-io</artifactId>
      <version>2.1</version>
    </dependency>
    <dependency>
      <groupId>commons-lang</groupId>
      <artifactId>commons-lang</artifactId>
      <version>2.6</version>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.10</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>net.sourceforge.nekohtml</groupId>
      <artifactId>nekohtml</artifactId>
      <version>1.9.14</version>
    </dependency>
    <!-- testing jsoup parser -->
    <dependency>
      <groupId>org.jsoup</groupId>
      <artifactId>jsoup</artifactId>
      <version>1.7.2</version>
    </dependency>
  </dependencies>

    <build>
        <plugins>
          <plugin>
            <groupId>org.codehaus.gmaven</groupId>
            <artifactId>gmaven-plugin</artifactId>
            <version>1.4</version>
            <configuration>
              <scriptpath>
                <element>${pom.basedir}/src/main/groovy</element>
              </scriptpath>
              <source>src/main/groovy/org/kuali/rice/scripts/KradConversion.groovy</source>
              <providerSelection>1.8</providerSelection>
            </configuration>
            <dependencies>
            <dependency>
            <groupId>org.codehaus.gmaven.runtime</groupId>
            <artifactId>gmaven-runtime-1.8</artifactId>
            <version>1.4</version>
            </dependency>
            </dependencies>
            <executions>
              <execution>
                <id>build</id>
                <goals>
                  <goal>generateStubs</goal>
                  <goal>compile</goal>
                  <goal>generateTestStubs</goal>
                  <goal>testCompile</goal>
                </goals>
              </execution>
              <execution>
                <id>execute</id>
                <phase>install</phase>
                <!--<phase>generate-resources</phase>-->
                <goals>
                  <goal>execute</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
    </build>
  <profiles>
    <profile>
      <id>testing</id>
      <build>
        <plugins>
        <plugin>
          <groupId>org.codehaus.gmaven</groupId>
          <artifactId>gmaven-plugin</artifactId>
          <version>1.4</version>
          <configuration>
            <scriptpath>
              <element>${pom.basedir}/src/main/groovy</element>
            </scriptpath>
            <source>src/main/groovy/org/kuali/rice/scripts/KradConversion.groovy</source>
            <providerSelection>1.8</providerSelection>
          </configuration>
          <dependencies>
            <dependency>
              <groupId>org.codehaus.gmaven.runtime</groupId>
              <artifactId>gmaven-runtime-1.8</artifactId>
              <version>1.4</version>
            </dependency>
          </dependencies>
          <executions>
            <execution>
              <id>build</id>
              <goals>
                <goal>generateStubs</goal>
                <goal>compile</goal>
                <goal>generateTestStubs</goal>
                <goal>testCompile</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
      </plugins>
      </build>
    </profile>
  </profiles>

</project>


text:
class Profile;

namespace extensions {
class AppNotifyChannelSetupTest;

// This class uses the browser login credentials to setup app notifications
// for a given app.
//
// Performs the following steps when Start() is called:
// 1. If the user is not logged in, prompt the user to login.
// 2. OAuth2: Record a notifications grant for the user and the given app.
// 3. Get notifications channel id for the current user.
// 4. Call the delegate passed in to the constructor with the results of
//    the above steps.
class AppNotifyChannelSetup
    : public net::URLFetcherDelegate,
      public AppNotifyChannelUI::Delegate,
      public OAuth2AccessTokenConsumer,
      public base::RefCountedThreadSafe<AppNotifyChannelSetup> {
 public:
  // These are the various error conditions, made public for use by the test
  // interceptor.
  enum SetupError {
    NONE,
    AUTH_ERROR,
    INTERNAL_ERROR,
    USER_CANCELLED,

    // This is used for histograms, and should always be the last value.
    SETUP_ERROR_BOUNDARY
  };

  class Delegate {
   public:
    // If successful, |channel_id| will be non-empty. On failure, |channel_id|
    // will be empty and |error| will contain an error to report to the JS
    // callback.
    virtual void AppNotifyChannelSetupComplete(
        const std::string& channel_id,
        const std::string& error,
        const AppNotifyChannelSetup* setup) = 0;
  };

  // For tests, we allow intercepting the request to setup the channel and
  // forcing the return of a certain result to the delegate.
  class InterceptorForTests {
   public:
    virtual void DoIntercept(
        const AppNotifyChannelSetup* setup,
        std::string* result_channel_id,
        AppNotifyChannelSetup::SetupError* result_error) = 0;
  };
  static void SetInterceptorForTests(InterceptorForTests* interceptor);

  // Ownership of |ui| is transferred to this object.
  AppNotifyChannelSetup(Profile* profile,
                        const std::string& extension_id,
                        const std::string& client_id,
                        const GURL& requestor_url,
                        int return_route_id,
                        int callback_id,
                        AppNotifyChannelUI* ui,
                        base::WeakPtr<Delegate> delegate);

  AppNotifyChannelUI* ui() { return ui_.get(); }

  // This begins the process of fetching the channel id using the browser login
  // credentials (or using |ui_| to prompt for login if needed).
  void Start();

  // OAuth2AccessTokenConsumer implementation.
  virtual void OnGetTokenSuccess(const std::string& access_token,
                                 const base::Time& expiration_time) OVERRIDE;
  virtual void OnGetTokenFailure(const GoogleServiceAuthError& error) OVERRIDE;

  // Getters for various members.
  const std::string& extension_id() const { return extension_id_; }
  const std::string& client_id() const { return client_id_; }
  int return_route_id() const { return return_route_id_; }
  int callback_id() const { return callback_id_; }

 protected:
  // net::URLFetcherDelegate.
  virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE;

  // AppNotifyChannelUI::Delegate.
  virtual void OnSyncSetupResult(bool enabled) OVERRIDE;

 private:
  enum State {
    INITIAL,
    LOGIN_STARTED,
    LOGIN_DONE,
    FETCH_ACCESS_TOKEN_STARTED,
    FETCH_ACCESS_TOKEN_DONE,
    RECORD_GRANT_STARTED,
    RECORD_GRANT_DONE,
    CHANNEL_ID_SETUP_STARTED,
    CHANNEL_ID_SETUP_DONE,
    ERROR_STATE
  };

  friend class base::RefCountedThreadSafe<AppNotifyChannelSetup>;
  friend class AppNotifyChannelSetupTest;

  virtual ~AppNotifyChannelSetup();

  // Creates an instance of URLFetcher that does not send or save cookies.
  // The URLFether's method will be GET if body is empty, POST otherwise.
  // Caller owns the returned instance.
  net::URLFetcher* CreateURLFetcher(
    const GURL& url, const std::string& body, const std::string& auth_token);
  void BeginLogin();
  void EndLogin(bool success);
  void BeginGetAccessToken();
  void EndGetAccessToken(bool success);
  void BeginRecordGrant();
  void EndRecordGrant(const net::URLFetcher* source);
  void BeginGetChannelId();
  void EndGetChannelId(const net::URLFetcher* source);

  void ReportResult(const std::string& channel_id, SetupError error);

  static std::string GetErrorString(SetupError error);
  static GURL GetCWSChannelServiceURL();
  static GURL GetOAuth2IssueTokenURL();
  static std::string MakeOAuth2IssueTokenBody(
      const std::string& oauth_client_id, const std::string& extension_id);
  static std::string MakeAuthorizationHeader(const std::string& auth_token);
  static bool ParseCWSChannelServiceResponse(
      const std::string& data, std::string* result);
  // Checks if the user needs to be prompted for login.
  bool ShouldPromptForLogin() const;
  void RegisterForTokenServiceNotifications();
  void UnregisterForTokenServiceNotifications();

  Profile* profile_;
  std::string extension_id_;
  std::string client_id_;
  GURL requestor_url_;
  int return_route_id_;
  int callback_id_;
  base::WeakPtr<Delegate> delegate_;
  scoped_ptr<net::URLFetcher> url_fetcher_;
  scoped_ptr<OAuth2AccessTokenFetcher> oauth2_fetcher_;
  scoped_ptr<AppNotifyChannelUI> ui_;
  State state_;
  std::string oauth2_access_token_;
  // Keeps track of whether we have encountered failure in OAuth2 access
  // token generation already. We use this to prevent us from doing an
  // infinite loop of trying to generate access token, if that fails, try
  // to login the user and generate access token, etc.
  bool oauth2_access_token_failure_;

  DISALLOW_COPY_AND_ASSIGN(AppNotifyChannelSetup);
};

}  // namespace extensions

#endif  // CHROME_BROWSER_EXTENSIONS_APP_NOTIFY_CHANNEL_SETUP_H_


text:
package org.jboss.netty.example.objectecho;

import java.util.concurrent.atomic.AtomicLong;
import java.util.logging.Level;
import java.util.logging.Logger;

import org.jboss.netty.channel.ChannelEvent;
import org.jboss.netty.channel.ChannelHandlerContext;
import org.jboss.netty.channel.ChannelState;
import org.jboss.netty.channel.ChannelStateEvent;
import org.jboss.netty.channel.ExceptionEvent;
import org.jboss.netty.channel.MessageEvent;
import org.jboss.netty.channel.SimpleChannelUpstreamHandler;

/**
 * Handles both client-side and server-side handler depending on which
 * constructor was called.
 */
public class ObjectEchoServerHandler extends SimpleChannelUpstreamHandler {

    private static final Logger logger = Logger.getLogger(
            ObjectEchoServerHandler.class.getName());

    private final AtomicLong transferredMessages = new AtomicLong();

    public long getTransferredMessages() {
        return transferredMessages.get();
    }

    @Override
    public void handleUpstream(
            ChannelHandlerContext ctx, ChannelEvent e) throws Exception {
        if (e instanceof ChannelStateEvent &&
            ((ChannelStateEvent) e).getState() != ChannelState.INTEREST_OPS) {
            logger.info(e.toString());
        }
        super.handleUpstream(ctx, e);
    }

    @Override
    public void messageReceived(
            ChannelHandlerContext ctx, MessageEvent e) {
        // Echo back the received object to the client.
        transferredMessages.incrementAndGet();
        e.getChannel().write(e.getMessage());
    }

    @Override
    public void exceptionCaught(
            ChannelHandlerContext ctx, ExceptionEvent e) {
        logger.log(
                Level.WARNING,
                "Unexpected exception from downstream.",
                e.getCause());
        e.getChannel().close();
    }
}


text:
@implementation AXTableViewCell

@end


text:
package fixtures.lro.implementation;

import com.fasterxml.jackson.annotation.JsonProperty;

/**
 * Defines headers for putAsyncNoHeaderInRetry operation.
 */
public class LROsPutAsyncNoHeaderInRetryHeadersInner {
    /**
     * The azureAsyncOperation property.
     */
    @JsonProperty(value = "Azure-AsyncOperation")
    private String azureAsyncOperation;

    /**
     * Get the azureAsyncOperation value.
     *
     * @return the azureAsyncOperation value
     */
    public String azureAsyncOperation() {
        return this.azureAsyncOperation;
    }

    /**
     * Set the azureAsyncOperation value.
     *
     * @param azureAsyncOperation the azureAsyncOperation value to set
     * @return the LROsPutAsyncNoHeaderInRetryHeadersInner object itself.
     */
    public LROsPutAsyncNoHeaderInRetryHeadersInner withAzureAsyncOperation(String azureAsyncOperation) {
        this.azureAsyncOperation = azureAsyncOperation;
        return this;
    }

}


text:
// AreSigsLinkable unit tests for split signatures.
/*! \file */

#include "gtest/gtest.h"
#include "testhelper/epid_gtest-testhelper.h"

extern "C" {
#include "epid/verifier.h"
}

#include "testhelper/verifier_wrapper-testhelper.h"
#include "verifier-testhelper.h"

namespace {

TEST_F(EpidVerifierSplitTest, AreSigsLinkedReturnsFalseGivenNullParameters) {
  auto& sig = this->kSigGrpXMember0Sha256Bsn0Msg0;
  EXPECT_FALSE(EpidAreSigsLinked(nullptr, sizeof(BasicSignature), nullptr,
                                 sizeof(BasicSignature)));
  EXPECT_FALSE(EpidAreSigsLinked(sig.data(), sig.size(), nullptr,
                                 sizeof(BasicSignature)));
  EXPECT_FALSE(EpidAreSigsLinked(nullptr, sizeof(BasicSignature), sig.data(),
                                 sig.size()));
}

TEST_F(EpidVerifierSplitTest, SigsBySameMemberWithRandomBaseAreNotLinkable) {
  auto& sig1 = this->kSplitSigGrpXMember3Sha256RandombaseTest1NoSigRl;
  auto& sig2 = this->kSplitSigGrpXMember3Sha256RndBsn2Data_0_255NoSigRl;
  EXPECT_FALSE(
      EpidAreSigsLinked(sig1.data(), sig1.size(), sig2.data(), sig2.size()));
}

TEST_F(EpidVerifierSplitTest, SigsBySameMemberWithSameBasenameAreLinkable) {
  auto& sig1 = this->kSplitSigGrpXMember3Sha256Basename1Test1NoSigRl;
  auto& sig2 = this->kSplitSigGrpXMember3Sha256Basename1Test2NoSigRl;
  EXPECT_TRUE(
      EpidAreSigsLinked(sig1.data(), sig1.size(), sig2.data(), sig2.size()));
}

TEST_F(EpidVerifierSplitTest,
       SigsBySameMemberWithDifferentBasenameAreNotLinkable) {
  auto& sig1 = this->kSplitSigGrpXMember3Sha256Basename1Test1NoSigRl;
  auto& sig2 = this->kSplitSigGrpXMember3Sha256RandombaseTest1NoSigRl;
  EXPECT_FALSE(
      EpidAreSigsLinked(sig1.data(), sig1.size(), sig2.data(), sig2.size()));
}

TEST_F(EpidVerifierSplitTest,
       SigsByDifferentMembersWithSameBasenameAreNotLinkable) {
  auto& sig1 = this->kSplitSigGrpXMember3Sha256Basename1Test1NoSigRl;
  auto& sig2 = this->kSplitSigGrpXMember4Sha256Basename1Test1NoSigRl;
  EXPECT_FALSE(
      EpidAreSigsLinked(sig1.data(), sig1.size(), sig2.data(), sig2.size()));
}

TEST_F(EpidVerifierSplitTest, AreSigsLinkedReturnsFalseIfSignaturesTooSmall) {
  auto& sig1 = this->kSplitSigGrpXMember3Sha256Basename1Test1NoSigRl;
  auto& sig2 = this->kSplitSigGrpXMember3Sha256Basename1Test2NoSigRl;
  const size_t bad_size = sizeof(BasicSignature) - 1;
  EXPECT_FALSE(
      EpidAreSigsLinked(sig1.data(), bad_size, sig2.data(), sig2.size()));
  EXPECT_FALSE(
      EpidAreSigsLinked(sig1.data(), sig1.size(), sig2.data(), bad_size));
}

}  // namespace


text:
```ruby
This gem is a part of TheOpenCMS project. https://github.com/TheOpenCMS
```

## Notifications

Just add JSON on HTML notifications in your Rails app

```ruby
gem 'notifications'
```

## How it works

This gem helps you to get rid of this bunch of a code

```ruby
<%= form_for(@resource) do |f| %>
  <% if @resource.errors.any? %>
    <div id="error_explanation">
      <h2><%= pluralize(@resource.errors.count, "error") %> prohibited this resource from being saved:</h2>

      <ul>
      <% @resource.errors.full_messages.each do |msg| %>
        <li><%= msg %></li>
      <% end %>
      </ul>
    </div>
  <% end %>

  # ....

<% end %>
```

and replace it with the following code:

```slim
  - form_for(@post) do |f|
    = render partial: 'notifications/form', locals: { object: @post }
```

and this code to render Flash messages:

```slim
body
  = render partial: 'notifications/flash'
  = yield
```

## How to use

*Note:* `toastr` is an external dependency for `format: :json` case. Download and and install it yourself. `vendors/toastr` is just a demo path to assets

*application.css*

```css
/*
  //= require notifications/base
*/
```

*application.js*

```js
//= require notifications/base
```

*application_initializer.js*

```coffee
$ ->
  do Notifications.init
```

### Format `html` or `json`

You can select a way how to render notifications. There are 2 options: `format: :html` and `format: :json`

```slim
= render partial: 'notifications/flash', locals: { format: :html }
= render partial: 'notifications/form', locals: { object: @post, format: :json }
```

### Default notifications format

*initializers/notifications.rb*

```ruby
Notifications.configure do |config|
  config.default_type = :json # :html
end
```

### Errors' localization

To avoid this case

```
Title: не может быть пустым
```

Do the following steps:

*models/user.rb*

```ruby
class Post < ActiveRecord::Base
  include ::Notifications::LocalizedErrors
end
```

*config/locales/ru.yml*

```yml
activerecord:
  models:
    post: Публикация
  attributes:
    post:
      title: "Загловок"
```

Now errors messages will look so:

```
Загловок: не может быть пустым
```

### MIT License

Copyright (c) 2013-[Current Year] Ilya N. Zykin

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


text:
Store Ruboty's memory in backend via [moneta](https://github.com/minad/moneta).

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'ruboty-moneta'
```

## Usage

### setting moneta backend

please setting [backend_type](https://github.com/minad/moneta#supported-backends) to MONETA_BACKEND

```shell
 MONETA_BACKEND="{backend_type}"
```

### setting initialize options

please setting [options](http://www.rubydoc.info/gems/moneta/Moneta/Adapters)

MONETA_#{バックエンドの形式}_{initialize時のoptionパラメータに渡したいキー名}で
指定してください。

Sqlite3のfileパラメータを指定したいときは下記のようになります。

```shell
 # MONETA_#{Backend}_#{Options Hash}
 MONETA_SQLITE_FILE = "{file path}"
```
### Setting replicate

複数のbackendに同時に書き込みます。
MONETA_BACKENDで設定されたbackendのデータをmasterとして扱います。
ストアの移行作業時などに使ってください

```
MONETA_BACKEND_SLAVE={"backend" or ["backend1", "backend2"]}

# example

# Replicate in YAML
MONETA_BACKEND_SLAVE="YAML"
MONETA_YAML_FILE="./ruboty.yml"

# Replicate in YAML and File
MONETA_BACKEND_SLAVE=["YAML", "File"]
MONETA_FILE_DIR="./db"
MONETA_YAML_FILE="./ruboty.yml"

```

### example

#### use memory

```ruby
gem 'ruboty-moneta'
```

#### use File

```ruby
gem 'ruboty-moneta'
```

```shell
MONETA_BACKEND="File"
MONETA_FILE_DIR="./db"
```

#### use Sqlite

```ruby
gem 'ruboty-moneta'
gem 'sqlite3'
```

```shell
MONETA_BACKEND="Sqlite"
MONETA_SQLITE_FILE="./ruboty.db"
```

## Development

After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).

## Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/rike422/ruboty-moneta. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](contributor-covenant.org) code of conduct.

## License

The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).


text:
.PHONY: book images dot

FILE=vonLaszewski-bigdata
#FLAGS=-interaction nonstopmode -halt-on-error -file-line-error
#FLAGS=-interaction nonstopmode  -file-line-error
FLAGS=-shell-escape
CLOUD=cloud
FLAGS=-shell-escape -output-directory=dest -aux-directory=dest --max-print-line=140

DEFAULT=$(CLOUD)

LATEX=pdflatex

#LATEX=pdfflatex
#LATEX=pydflatex -k

g: dest markdown graphicspath
	latexmk -jobname=$(FILE) $(FLAGS) -pvc -view=pdf $(FILE)

boat: dest markdown graphicspath
	latexmk -jobname=boat $(FLAGS) -pvc -view=pdf boat

setup:
	export max_print_line=1000

graphicspath:
	bin/list-images-dirs.py > graphicspath.tex

once: setup clean dest markdown graphicspath
	latexmk -jobname=$(FILE) $(FLAGS) -view=pdf $(FILE)
	# make html

abc:
	latexmk -jobname=b $(FLAGS) -pvc -view=pdf b

travis: dest markdown graphicspath
	latexmk -pdflatex='pdflatex -file-line-error -synctex=1' -jobname=$(FILE) $(FLAGS) -pdf $(FILE)

issues: clean dest
	python bin/issues.py > section/preface/issues.tex
	pdflatex issues
	#latexmk -jobname=issues $(FLAGS) -view=pdf issues

dot:
	cd dot; dot -Tpdf gr.dot -o gr.pdf

markdown:
	bin/md-all-to-tex.py

test: dest markdown
	pdflatex $(FILE)

gg: setup dest markdown graphicspath
	pdflatex -shell-escape $(FILE)

check:
	make gg

pdflatex:
	make gg

google:
	gdrive update 1Mdd_TJcbXurJYRpG2gKCVqWmbhvED2Mp dest/vonLaszewski-bigdata.pdf

single: dest graphicspath
	latexmk -jobname=single $(FLAGS) -pvc -view=pdf single

draft: clean dest graphicspath
	curl -s https://raw.githubusercontent.com/cloudmesh-community/hid-sp18-503/master/sd-card-ubuntu.md > tmp/sd-card-ubuntu.md
	curl -s https://raw.githubusercontent.com/cloudmesh-community/hid-sp18-508/master/cluster/sd-card-osx.md > tmp/sd-card-osx.md
	curl -s https://raw.githubusercontent.com/cloudmesh-community/hid-sp18-602/master/sd-card-windows.md > tmp/sd-card-windows.md
	curl -s https://raw.githubusercontent.com/cloudmesh-community/hid-sp18-421/master/ssh-keygen.md > tmp/ssh-keygen.md
	curl -s https://raw.githubusercontent.com/cloudmesh-community/hid-sp18-412/master/cluster/readme-spark.md > tmp/readme-spark.md
	curl -s https://raw.githubusercontent.com/cloudmesh-community/hid-sp18-526/master/cluster/readme-kube.md > tmp/readme-kube.md
	curl -s https://raw.githubusercontent.com/cloudmesh-community/hid-sp18-405/master/Cluster/pi-dhcp.md > tmp/pi-dhcp.md
	bin/md-tmp-to-tex.py
	latexmk -jobname=draft $(FLAGS) -view=pdf draft

dd: dest graphicspath
	cd tmp; python ../bin/md-all-to-tex.py
	latexmk -jobname=draft $(FLAGS) -pvc -view=pdf draft

c: dest graphicspath
	latexmk -jobname=$(FILE) $(FLAGS) -pvc -view=pdf chameleon

plain: dest graphicspath
	latexmk -jobname=$(FILE) $(FLAGS) -pvc -view=pdf plain

cloud: dest markdown graphicspath
	$(LATEX) $(FLAGS) $(CLOUD)
	makeindex $(CLOUD).idx -s format/StyleInd.ist
	biber $(CLOUD)
	$(LATEX) $(FLAGS)  $(CLOUD)
	$(LATEX) $(FLAGS)  $(CLOUD)

skim: dest
	echo $(DEFAULT)
	open -a /Applications/skim.app $(DEFAULT).pdf

all: dest makedown graphicspath
	$(LATEX) $(FLAGS) $(FILE)
	makeindex $(FILE).idx -s format/StyleInd.ist
	biber $(FILE)
	$(LATEX) $(FLAGS)  $(FILE)
	$(LATEX) $(FLAGS)  $(FILE)

all2:
	$(LATEX) $(FLAGS) $(FILE)
	makeindex $(FILE).idx -s format/StyleInd.ist
	biber $(FILE)
	$(LATEX) $(FLAGS)  $(FILE) x 2
	$(LATEX) $(FLAGS)  $(FILE) x 2

simple:
	$(LATEX) $(FLAGS) $(FILE)
#|fgrep -v "Underfull" |fgrep -v "Overfull" | fgrep -v "undefined on input"
#	makeindex $(FILE).idx -s format/StyleInd.ist
#	biber $(FILE)
#	$(LATEX) $(FLAGS)  $(FILE) x 2
#	$(LATEX) $(FLAGS)  $(FILE) x 2

book:
	python book.py

images:
	cp -r ~/github/cloudmesh/classes/docs/source/images/ images

fetch:
	cd chapter; make

old:
	$(LATEX) $(FILE)
	makeindex $(FILE).idx -s StyleInd.ist
	biber $(FILE)
	$(LATEX) $(FILE) x 2

clean:
	rm -fr single
	rm -fr $(FILE)
	rm -f *.aux
	rm -f *.bbl
	rm -f *.bcf
	rm -f *.blg
	rm -f *.idx
	rm -f *.ilg
	rm -f *.ind
	rm -f *.pdf
	rm -f *.ptc
	rm -f *.run.xml
	rm -f *.toc
	rm -f *.log
	rm -f *.markdown.out
	rm -f *.markdown.lua
	rm -f *.markdown.err
	rm -f *.fls
	rm -f *.listing
	rm -f *.fdb_latexmk
	rm -f *.synctex.gz
	rm -rf _markdown_*
	rm -rf dest
	rm -rf *.tdo
	find . -name '*.aux' -delete
	find . -name ".#*" -delete
	rm -fr _minted-*
	rm -f tmp/*
	rm -f *-dot2tex-*
	rm -f *.out
	bin/md-clean-tex.py

view:
	open dest/$(FILE).pdf

publish:
	echo pdf document copied to google
#	cp dest/$(FILE).pdf .
#	cp $(FILE).pdf ~/github/laszewsk/papers/
#	cd ~/github/laszewsk/papers; git add $(FILE).pdf; git commit -m "update $(FILE)"; git push
#	cp $(FILE).pdf ~/github/laszewsk/laszewski.github.io/papers/$(FILE).pdf
#	cd ~/github/laszewsk/laszewski.github.io/papers; git add $(FILE).pdf; git commit -m "update $(FILE)"; git push
	make -f Makefile.publish
	make -f Makefile google

html:
	mkdir -p ~/pdf
	cp dest/$(FILE).pdf ~/pdf
	docker run -ti --rm -v ~/pdf:/pdf bwits/pdf2htmlex pdf2htmlEX --zoom 1.3 $(FILE).pdf
	# gdrive update 10zA34VsM-WnsQo31rHzDOtqdU3rqvkvQ ~/pdf/vonLaszewski-bigdata.html

size:
	du -c -h dest/vonLaszewski-bigdata.pdf | fgrep total > dest/size.txt
	du -c -h dest/vonLaszewski-bigdata.pdf | fgrep total

watch:
	latexmk -pvc -view=pdf ${FILE}

dest: setup
	python bin/create-dirs.py


text:
package com.graphhopper.routing.ch;

import com.graphhopper.routing.util.CarFlagEncoder;
import com.graphhopper.routing.util.EncodingManager;
import com.graphhopper.routing.weighting.ShortestWeighting;
import com.graphhopper.routing.weighting.TurnWeighting;
import com.graphhopper.routing.weighting.Weighting;
import com.graphhopper.storage.CHGraph;
import com.graphhopper.storage.GraphBuilder;
import com.graphhopper.storage.GraphHopperStorage;
import com.graphhopper.storage.TurnCostExtension;
import com.graphhopper.util.EdgeIterator;
import com.graphhopper.util.PMap;
import org.junit.Before;
import org.junit.Test;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;

public class WitnessPathSearcherTest {

    private GraphHopperStorage graph;
    private CHGraph chGraph;
    private TurnWeighting chTurnWeighting;

    @Before
    public void setup() {
        CarFlagEncoder encoder = new CarFlagEncoder(5, 5, 10);
        EncodingManager encodingManager = EncodingManager.create(encoder);
        Weighting weighting = new ShortestWeighting(encoder);
        PreparationWeighting preparationWeighting = new PreparationWeighting(weighting);
        graph = new GraphBuilder(encodingManager).setCHGraph(weighting).setEdgeBasedCH(true).create();
        TurnCostExtension turnCostExtension = (TurnCostExtension) graph.getExtension();
        chTurnWeighting = new TurnWeighting(preparationWeighting, turnCostExtension);
        chGraph = graph.getGraph(CHGraph.class);
    }

    @Test
    public void test_shortcut_needed_basic() {
        // 0 -> 1 -> 2 -> 3 -> 4
        graph.edge(0, 1, 1, false);
        graph.edge(1, 2, 1, false);
        graph.edge(2, 3, 1, false);
        graph.edge(3, 4, 1, false);
        graph.freeze();
        setMaxLevelOnAllNodes();
        WitnessPathSearcher finder = createFinder();
        finder.initSearch(2, 1, 0);
        CHEntry result = finder.runSearch(3, 3);
        CHEntry expected = new ExpectedResultBuilder(3, 2, 2, 2.0)
                .withParent(2, 1, 1, 1.0)
                .build(1);
        assertFinderResult(expected, result);
    }

    @Test
    public void test_shortcut_needed_bidirectional() {
        // 0 -> 1 -> 2 -> 3 -> 4
        graph.edge(0, 1, 1, true);
        graph.edge(1, 2, 1, true);
        graph.edge(2, 3, 1, true);
        graph.edge(3, 4, 1, true);
        graph.freeze();
        setMaxLevelOnAllNodes();
        WitnessPathSearcher finder = createFinder();
        finder.initSearch(2, 1, 0);
        CHEntry result = finder.runSearch(3, 3);
        CHEntry expected = new ExpectedResultBuilder(3, 2, 2, 2.0)
                .withParent(2, 1, 1, 1.0)
                .build(1);
        assertFinderResult(expected, result);
    }

    @Test
    public void test_witness_basic() {
        // 0 -> 1 -> 2 -> 3 -> 4
        //       \       /
        //        \> 5 >/
        graph.edge(0, 1, 1, false);
        graph.edge(1, 2, 1, false);
        graph.edge(2, 3, 2, false);
        graph.edge(3, 4, 1, false);
        graph.edge(1, 5, 1, false);
        graph.edge(5, 3, 1, false);
        graph.freeze();
        setMaxLevelOnAllNodes();
        WitnessPathSearcher finder = createFinder();
        finder.initSearch(2, 1, 0);
        CHEntry result = finder.runSearch(3, 3);
        assertNull(result);
    }

    @Test
    public void test_witness_bidirectional() {
        // 0 -> 1 -> 2 -> 3 -> 4
        //       \       /
        //        \> 5 >/
        graph.edge(0, 1, 1, true);
        graph.edge(1, 2, 1, true);
        graph.edge(2, 3, 2, true);
        graph.edge(3, 4, 1, true);
        graph.edge(1, 5, 1, true);
        graph.edge(5, 3, 1, true);
        graph.freeze();
        setMaxLevelOnAllNodes();
        WitnessPathSearcher finder = createFinder();
        finder.initSearch(2, 1, 0);
        CHEntry result = finder.runSearch(3, 3);
        assertNull(result);
    }

    private WitnessPathSearcher createFinder() {
        return new WitnessPathSearcher(chGraph, chTurnWeighting, new PMap());
    }

    private void setMaxLevelOnAllNodes() {
        int nodes = chGraph.getNodes();
        for (int node = 0; node < nodes; node++) {
            chGraph.setLevel(node, nodes);
        }
    }

    private void assertFinderResult(CHEntry expected, CHEntry result) {
        while (expected.parent != null) {
            assertEquals(expected.adjNode, result.adjNode);
            assertEquals(expected.edge, result.edge);
            assertEquals(expected.incEdge, result.incEdge);
            assertEquals(expected.weight, result.weight, 1.e-6);
            expected = expected.getParent();
            result = result.getParent();
        }
    }

    private static class ExpectedResultBuilder {
        private CHEntry result;
        private CHEntry last;

        private ExpectedResultBuilder(int adjNode, int edge, int incEdge, double weight) {
            result = new CHEntry(edge, incEdge, adjNode, weight);
            last = result;
        }

        ExpectedResultBuilder withParent(int adjNode, int edge, int incEdge, double weight) {
            CHEntry parent = new CHEntry(edge, incEdge, adjNode, weight);
            last.parent = parent;
            last = parent;
            return this;
        }

        CHEntry build(int firstEdge) {
            last.parent = new CHEntry(EdgeIterator.NO_EDGE, firstEdge, -1, 0.0);
            return result;
        }

    }

}


text:
<?php

namespace Core\AccountingBundle\Form;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
use Doctrine\ORM\EntityRepository;

class JournalsType extends AbstractType
{
	/**
     * @param FormBuilderInterface $builder
     * @param array $options
     */
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
	      	->add('typeno','integer')
            ->add('trandate')
            ->add('periodno','entity',array(
            		'class' => 'CoreAccountingBundle:Periods',
            		'property' => 'periodno'
            		))
            ->add('tag','entity',array(
            		'class' => 'CoreAccountingBundle:Tags',
            		'property' => 'tagdescription',
            		'data' => ''
            		))
        	->add('journalentries','collection',array(
        		'type' => new GltransType(),
        		'allow_add' => true
        		))
            ->add('Confirm','submit');
    }

    /**
     * @param OptionsResolverInterface $resolver
     */
    public function setDefaultOptions(OptionsResolverInterface $resolver)
    {
        $resolver->setDefaults(array(
            'data_class' => 'Core\AccountingBundle\Entity\Journal'
        ));
    }

    /**
     * @return string
     */
    public function getName()
    {
        return 'core_accountingbundle_journals';
    }
}


text:
using System;
using System.Collections.Generic;
using System.Linq;

namespace Cassette
{
    class RawFileReferenceFinder : IBundleVisitor
    {
        public static bool RawFileReferenceExists(string filename, IEnumerable<Bundle> bundles)
        {
            var finder = new RawFileReferenceFinder(filename);
            bundles.Accept(finder);
            return finder.IsRawFileReferenceFound;
        }

        readonly string filename;

        public RawFileReferenceFinder(string filename)
        {
            this.filename = filename;
        }

        public bool IsRawFileReferenceFound { get; private set; }

        public void Visit(Bundle bundle)
        {
        }

        public void Visit(IAsset asset)
        {
            if (IsRawFileReferenceFound) return;

            var found = asset.References.Any(
                r => r.Type == AssetReferenceType.RawFilename
                     && r.ToPath.Equals(filename, StringComparison.OrdinalIgnoreCase)
                );
            if (found)
            {
                IsRawFileReferenceFound = true;
            }
        }
    }
}


text:
/**
 * Moddle base element.
 */
export default function Base() { }

Base.prototype.get = function(name) {
  return this.$model.properties.get(this, name);
};

Base.prototype.set = function(name, value) {
  this.$model.properties.set(this, name, value);
};


text:
@interface TPSCardFieldManager : RCTViewManager

@end


text:
namespace flixel{
namespace _hx_system{
namespace debug{

::flixel::_hx_system::debug::FlxDebuggerLayout FlxDebuggerLayout_obj::BIG;

::flixel::_hx_system::debug::FlxDebuggerLayout FlxDebuggerLayout_obj::LEFT;

::flixel::_hx_system::debug::FlxDebuggerLayout FlxDebuggerLayout_obj::MICRO;

::flixel::_hx_system::debug::FlxDebuggerLayout FlxDebuggerLayout_obj::RIGHT;

::flixel::_hx_system::debug::FlxDebuggerLayout FlxDebuggerLayout_obj::STANDARD;

::flixel::_hx_system::debug::FlxDebuggerLayout FlxDebuggerLayout_obj::TOP;

bool FlxDebuggerLayout_obj::__GetStatic(const ::String &inName, ::Dynamic &outValue, hx::PropertyAccess inCallProp)
{
	if (inName==HX_("BIG",a0,54,32,00)) { outValue = FlxDebuggerLayout_obj::BIG; return true; }
	if (inName==HX_("LEFT",07,d0,70,32)) { outValue = FlxDebuggerLayout_obj::LEFT; return true; }
	if (inName==HX_("MICRO",e4,5c,4e,86)) { outValue = FlxDebuggerLayout_obj::MICRO; return true; }
	if (inName==HX_("RIGHT",bc,43,52,67)) { outValue = FlxDebuggerLayout_obj::RIGHT; return true; }
	if (inName==HX_("STANDARD",3d,c7,fd,43)) { outValue = FlxDebuggerLayout_obj::STANDARD; return true; }
	if (inName==HX_("TOP",75,02,40,00)) { outValue = FlxDebuggerLayout_obj::TOP; return true; }
	return super::__GetStatic(inName, outValue, inCallProp);
}

HX_DEFINE_CREATE_ENUM(FlxDebuggerLayout_obj)

int FlxDebuggerLayout_obj::__FindIndex(::String inName)
{
	if (inName==HX_("BIG",a0,54,32,00)) return 2;
	if (inName==HX_("LEFT",07,d0,70,32)) return 4;
	if (inName==HX_("MICRO",e4,5c,4e,86)) return 1;
	if (inName==HX_("RIGHT",bc,43,52,67)) return 5;
	if (inName==HX_("STANDARD",3d,c7,fd,43)) return 0;
	if (inName==HX_("TOP",75,02,40,00)) return 3;
	return super::__FindIndex(inName);
}

int FlxDebuggerLayout_obj::__FindArgCount(::String inName)
{
	if (inName==HX_("BIG",a0,54,32,00)) return 0;
	if (inName==HX_("LEFT",07,d0,70,32)) return 0;
	if (inName==HX_("MICRO",e4,5c,4e,86)) return 0;
	if (inName==HX_("RIGHT",bc,43,52,67)) return 0;
	if (inName==HX_("STANDARD",3d,c7,fd,43)) return 0;
	if (inName==HX_("TOP",75,02,40,00)) return 0;
	return super::__FindArgCount(inName);
}

hx::Val FlxDebuggerLayout_obj::__Field(const ::String &inName,hx::PropertyAccess inCallProp)
{
	if (inName==HX_("BIG",a0,54,32,00)) return BIG;
	if (inName==HX_("LEFT",07,d0,70,32)) return LEFT;
	if (inName==HX_("MICRO",e4,5c,4e,86)) return MICRO;
	if (inName==HX_("RIGHT",bc,43,52,67)) return RIGHT;
	if (inName==HX_("STANDARD",3d,c7,fd,43)) return STANDARD;
	if (inName==HX_("TOP",75,02,40,00)) return TOP;
	return super::__Field(inName,inCallProp);
}

static ::String FlxDebuggerLayout_obj_sStaticFields[] = {
	HX_("STANDARD",3d,c7,fd,43),
	HX_("MICRO",e4,5c,4e,86),
	HX_("BIG",a0,54,32,00),
	HX_("TOP",75,02,40,00),
	HX_("LEFT",07,d0,70,32),
	HX_("RIGHT",bc,43,52,67),
	::String(null())
};

static void FlxDebuggerLayout_obj_sMarkStatics(HX_MARK_PARAMS) {
	HX_MARK_MEMBER_NAME(FlxDebuggerLayout_obj::BIG,"BIG");
	HX_MARK_MEMBER_NAME(FlxDebuggerLayout_obj::LEFT,"LEFT");
	HX_MARK_MEMBER_NAME(FlxDebuggerLayout_obj::MICRO,"MICRO");
	HX_MARK_MEMBER_NAME(FlxDebuggerLayout_obj::RIGHT,"RIGHT");
	HX_MARK_MEMBER_NAME(FlxDebuggerLayout_obj::STANDARD,"STANDARD");
	HX_MARK_MEMBER_NAME(FlxDebuggerLayout_obj::TOP,"TOP");
};

#ifdef HXCPP_VISIT_ALLOCS
static void FlxDebuggerLayout_obj_sVisitStatic(HX_VISIT_PARAMS) {
	HX_VISIT_MEMBER_NAME(FlxDebuggerLayout_obj::__mClass,"__mClass");
	HX_VISIT_MEMBER_NAME(FlxDebuggerLayout_obj::BIG,"BIG");
	HX_VISIT_MEMBER_NAME(FlxDebuggerLayout_obj::LEFT,"LEFT");
	HX_VISIT_MEMBER_NAME(FlxDebuggerLayout_obj::MICRO,"MICRO");
	HX_VISIT_MEMBER_NAME(FlxDebuggerLayout_obj::RIGHT,"RIGHT");
	HX_VISIT_MEMBER_NAME(FlxDebuggerLayout_obj::STANDARD,"STANDARD");
	HX_VISIT_MEMBER_NAME(FlxDebuggerLayout_obj::TOP,"TOP");
};
#endif

hx::Class FlxDebuggerLayout_obj::__mClass;

Dynamic __Create_FlxDebuggerLayout_obj() { return new FlxDebuggerLayout_obj; }

void FlxDebuggerLayout_obj::__register()
{

hx::Static(__mClass) = hx::_hx_RegisterClass(HX_HCSTRING("flixel.system.debug.FlxDebuggerLayout","\x15","\xd0","\x5b","\x09"), hx::TCanCast< FlxDebuggerLayout_obj >,FlxDebuggerLayout_obj_sStaticFields,0,
	&__Create_FlxDebuggerLayout_obj, &__Create,
	&super::__SGetClass(), &CreateFlxDebuggerLayout_obj, FlxDebuggerLayout_obj_sMarkStatics
#ifdef HXCPP_VISIT_ALLOCS
    , FlxDebuggerLayout_obj_sVisitStatic
#endif
#ifdef HXCPP_SCRIPTABLE
    , 0
#endif
);
	__mClass->mGetStaticField = &FlxDebuggerLayout_obj::__GetStatic;
}

void FlxDebuggerLayout_obj::__boot()
{
BIG = hx::CreateEnum< FlxDebuggerLayout_obj >(HX_HCSTRING("BIG","\xa0","\x54","\x32","\x00"),2,0);
LEFT = hx::CreateEnum< FlxDebuggerLayout_obj >(HX_HCSTRING("LEFT","\x07","\xd0","\x70","\x32"),4,0);
MICRO = hx::CreateEnum< FlxDebuggerLayout_obj >(HX_HCSTRING("MICRO","\xe4","\x5c","\x4e","\x86"),1,0);
RIGHT = hx::CreateEnum< FlxDebuggerLayout_obj >(HX_HCSTRING("RIGHT","\xbc","\x43","\x52","\x67"),5,0);
STANDARD = hx::CreateEnum< FlxDebuggerLayout_obj >(HX_HCSTRING("STANDARD","\x3d","\xc7","\xfd","\x43"),0,0);
TOP = hx::CreateEnum< FlxDebuggerLayout_obj >(HX_HCSTRING("TOP","\x75","\x02","\x40","\x00"),3,0);
}

} // end namespace flixel
} // end namespace system
} // end namespace debug


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>

    <!-- From: file:/home/matthew/Documents/Secrecy/aFileChooser/build/intermediates/exploded-aar/com.android.support/appcompat-v7/19.0.0/res/values-nl/values.xml -->
    <eat-comment />

    <string name="abc_action_bar_home_description" msgid="4600421777120114993">"Navigeren naar startpositie"</string>
    <string name="abc_action_bar_up_description" msgid="1594238315039666878">"Omhoog navigeren"</string>
    <string name="abc_action_menu_overflow_description" msgid="3588849162933574182">"Meer opties"</string>
    <string name="abc_action_mode_done" msgid="4076576682505996667">"Gereed"</string>
    <string name="abc_activity_chooser_view_see_all" msgid="7468859129482906941">"Alles weergeven"</string>
    <string name="abc_activitychooserview_choose_application" msgid="2031811694353399454">"Een app selecteren"</string>
    <string name="abc_searchview_description_clear" msgid="3691816814315814921">"Zoekopdracht wissen"</string>
    <string name="abc_searchview_description_query" msgid="2550479030709304392">"Zoekopdracht"</string>
    <string name="abc_searchview_description_search" msgid="8264924765203268293">"Zoeken"</string>
    <string name="abc_searchview_description_submit" msgid="8928215447528550784">"Zoekopdracht verzenden"</string>
    <string name="abc_searchview_description_voice" msgid="893419373245838918">"Gesproken zoekopdracht"</string>
    <string name="abc_shareactionprovider_share_with" msgid="3421042268587513524">"Delen met"</string>
    <string name="abc_shareactionprovider_share_with_application" msgid="7165123711973476752">"Delen met %s"</string>

</resources>


text:
Tcl Library Source Code

Packages - [Table Of Contents](md/toc.md)

[Keyword Index](md/index.md)

	<form action='../../../docsrch' method='GET'>
	<input type="text" name="s" size="40" autofocus>
	<input type="submit" value="Search Package Documentation">
	</form>

## Releases / Downloads

The download links are on the referenced pages.

   * [Trunk Head](head.md)
   * [Current Release](../../../technote/cd3a11c3065120d491009e64a19f7676176045cd) __1.20 (Dec 1, 2019)__
   * [Past Releases](../../../wiki?name=Past+Releases)
   * [Development Snapshots](../../../wiki?name=Development+Snapshots)
   * [@ SourceForge](https://sourceforge.net/projects/tcllib/files/)

## Guides to Tcllib

   * [Tcl Community - Kind Communication](md/tcllib/files/devdoc/tcl_community_communication.md)
   * [License](md/tcllib/files/devdoc/tcllib_license.md)
   * [How To Get The Sources](md/tcllib/files/devdoc/tcllib_sources.md)
   * [How To Build And Install Tcllib](md/tcllib/files/devdoc/tcllib_installer.md)
   * [The Developer's Guide](md/tcllib/files/devdoc/tcllib_devguide.md)
   * [The Release Manager's Guide](md/tcllib/files/devdoc/tcllib_releasemgr.md)

## Discussion & Contact

Tcllib has two
[mailing lists](https://sourceforge.net/p/tcllib/mailman/).

One for notifications (commits, ticket changes), the other for general
discussion. These are managed at SourceForge, at the aforementioned
link. A few direct links for various topics:

|tcllib-bugs| : |[Subscribe](https://lists.sourceforge.net/lists/listinfo/tcllib-bugs) [Archive](https://sourceforge.net/p/tcllib/mailman/tcllib-bugs) [Search](https://sourceforge.net/p/tcllib/mailman/search/?mail_list=tcllib-bugs)|
|tcllib-devel| : |[Subscribe](https://lists.sourceforge.net/lists/listinfo/tcllib-devel) [Archive](https://sourceforge.net/p/tcllib/mailman/tcllib-devel) [Search](https://sourceforge.net/p/tcllib/mailman/search/?mail_list=tcllib-devel)|

## Related Repositories

   * [Tklib](../../../../tklib)
   * [Tcl Apps](../../../../tclapps)
   * [Tcl Bench](../../../../tclbench)
   * [Multicolumn Listbox](../../../../mclistbox)
   * [Widget](../../../../widget)
   * [BWidget](../../../../bwidget)

## Feedback

Please go to and use our
[Local Trackers](../../../reportlist).
They are for

   * Bugs,
   * Patches, and
   * Ideas & Feature Requests.

## See also

   * [Landing page for this package at the Tcl Developer eXchange](http://www.tcl.tk/software/tcllib/)


text:
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="ChangeListManager">
    <list default="true" id="15c1498c-8ea4-4481-b500-5c599e754b36" name="Default" comment="">
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/inspectionProfiles/Project_Default.xml" afterPath="$PROJECT_DIR$/.idea/inspectionProfiles/Project_Default.xml" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/_posts/Python/2017-01-12-final-project.md" afterPath="$PROJECT_DIR$/_posts/Python/2017-01-12-final-project.md" />
    </list>
    <ignored path="CS9.iws" />
    <ignored path=".idea/workspace.xml" />
    <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
    <option name="TRACKING_ENABLED" value="true" />
    <option name="SHOW_DIALOG" value="false" />
    <option name="HIGHLIGHT_CONFLICTS" value="true" />
    <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
    <option name="LAST_RESOLUTION" value="IGNORE" />
  </component>
  <component name="CreatePatchCommitExecutor">
    <option name="PATCH_PATH" value="" />
  </component>
  <component name="ExecutionTargetManager" SELECTED_TARGET="default_target" />
  <component name="FavoritesManager">
    <favorites_list name="CS9" />
  </component>
  <component name="FileEditorManager">
    <leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
      <file leaf-file-name="scratch_11.py" pinned="false" current-in-tab="false">
        <entry file="file://$APPLICATION_CONFIG_DIR$/scratches/scratch_11.py">
          <provider selected="true" editor-type-id="text-editor">
            <state relative-caret-position="360">
              <caret line="20" column="0" selection-start-line="20" selection-start-column="0" selection-end-line="20" selection-end-column="0" />
              <folding />
            </state>
          </provider>
        </entry>
      </file>
      <file leaf-file-name="scratch_12.py" pinned="false" current-in-tab="true">
        <entry file="file://$APPLICATION_CONFIG_DIR$/scratches/scratch_12.py">
          <provider selected="true" editor-type-id="text-editor">
            <state relative-caret-position="54">
              <caret line="3" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="3" selection-end-column="0" />
              <folding />
            </state>
          </provider>
        </entry>
      </file>
      <file leaf-file-name="Hangman.py" pinned="false" current-in-tab="false">
        <entry file="file://$PROJECT_DIR$/Code Examples/Hangman.py">
          <provider selected="true" editor-type-id="text-editor">
            <state relative-caret-position="144">
              <caret line="8" column="18" selection-start-line="8" selection-start-column="18" selection-end-line="8" selection-end-column="18" />
              <folding />
            </state>
          </provider>
        </entry>
      </file>
    </leaf>
  </component>
  <component name="FileTemplateManagerImpl">
    <option name="RECENT_TEMPLATES">
      <list>
        <option value="Python Script" />
      </list>
    </option>
  </component>
  <component name="Git.Settings">
    <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
  </component>
  <component name="IdeDocumentHistory">
    <option name="CHANGED_PATHS">
      <list>
        <option value="$PROJECT_DIR$/Code Examples/Hangman.py" />
        <option value="$APPLICATION_CONFIG_DIR$/scratches/scratch_11.py" />
        <option value="$APPLICATION_CONFIG_DIR$/scratches/scratch_12.py" />
      </list>
    </option>
  </component>
  <component name="ProjectFrameBounds">
    <option name="x" value="411" />
    <option name="y" value="79" />
    <option name="width" value="816" />
    <option name="height" value="791" />
  </component>
  <component name="ProjectInspectionProfilesVisibleTreeState">
    <entry key="Project Default">
      <profile-state>
        <expanded-state>
          <State>
            <id />
          </State>
          <State>
            <id>Python</id>
          </State>
          <State>
            <id>Spelling</id>
          </State>
          <State>
            <id>XML</id>
          </State>
        </expanded-state>
        <selected-state>
          <State>
            <id>Buildout</id>
          </State>
        </selected-state>
      </profile-state>
    </entry>
  </component>
  <component name="ProjectLevelVcsManager" settingsEditedManually="false">
    <OptionsSetting value="true" id="Add" />
    <OptionsSetting value="true" id="Remove" />
    <OptionsSetting value="true" id="Checkout" />
    <OptionsSetting value="true" id="Update" />
    <OptionsSetting value="true" id="Status" />
    <OptionsSetting value="true" id="Edit" />
    <ConfirmationsSetting value="0" id="Add" />
    <ConfirmationsSetting value="0" id="Remove" />
  </component>
  <component name="ProjectView">
    <navigator currentView="ProjectPane" proportions="" version="1">
      <flattenPackages />
      <showMembers />
      <showModules />
      <showLibraryContents />
      <hideEmptyPackages />
      <abbreviatePackageNames />
      <autoscrollToSource />
      <autoscrollFromSource />
      <sortByType />
      <manualOrder />
      <foldersAlwaysOnTop value="true" />
    </navigator>
    <panes>
      <pane id="Scratches" />
      <pane id="ProjectPane">
        <subPane>
          <PATH>
            <PATH_ELEMENT>
              <option name="myItemId" value="CS9" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
            </PATH_ELEMENT>
          </PATH>
        </subPane>
      </pane>
    </panes>
  </component>
  <component name="PropertiesComponent">
    <property name="settings.editor.selected.configurable" value="preferences.customizations" />
    <property name="settings.editor.splitter.proportion" value="0.2" />
    <property name="last_opened_file_path" value="$USER_HOME$" />
    <property name="com.intellij.ide.scratch.LRUPopupBuilder$2/Languages" value="Python" />
  </component>
  <component name="RunManager" selected="Python.scratch_12">
    <configuration default="false" name="scratch_11" type="PythonConfigurationType" factoryName="Python" temporary="true">
      <option name="INTERPRETER_OPTIONS" value="" />
      <option name="PARENT_ENVS" value="true" />
      <envs>
        <env name="PYTHONUNBUFFERED" value="1" />
      </envs>
      <option name="SDK_HOME" value="" />
      <option name="WORKING_DIRECTORY" value="$APPLICATION_CONFIG_DIR$/scratches" />
      <option name="IS_MODULE_SDK" value="false" />
      <option name="ADD_CONTENT_ROOTS" value="true" />
      <option name="ADD_SOURCE_ROOTS" value="true" />
      <module name="CS9" />
      <option name="SCRIPT_NAME" value="$APPLICATION_CONFIG_DIR$/scratches/scratch_11.py" />
      <option name="PARAMETERS" value="" />
      <option name="SHOW_COMMAND_LINE" value="false" />
      <method />
    </configuration>
    <configuration default="false" name="Hangman" type="PythonConfigurationType" factoryName="Python" temporary="true">
      <option name="INTERPRETER_OPTIONS" value="" />
      <option name="PARENT_ENVS" value="true" />
      <envs>
        <env name="PYTHONUNBUFFERED" value="1" />
      </envs>
      <option name="SDK_HOME" value="" />
      <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/Code Examples" />
      <option name="IS_MODULE_SDK" value="true" />
      <option name="ADD_CONTENT_ROOTS" value="true" />
      <option name="ADD_SOURCE_ROOTS" value="true" />
      <module name="CS9" />
      <option name="SCRIPT_NAME" value="$PROJECT_DIR$/Code Examples/Hangman.py" />
      <option name="PARAMETERS" value="" />
      <option name="SHOW_COMMAND_LINE" value="false" />
      <method />
    </configuration>
    <configuration default="false" name="scratch_12" type="PythonConfigurationType" factoryName="Python" temporary="true">
      <option name="INTERPRETER_OPTIONS" value="" />
      <option name="PARENT_ENVS" value="true" />
      <envs>
        <env name="PYTHONUNBUFFERED" value="1" />
      </envs>
      <option name="SDK_HOME" value="" />
      <option name="WORKING_DIRECTORY" value="$APPLICATION_CONFIG_DIR$/scratches" />
      <option name="IS_MODULE_SDK" value="false" />
      <option name="ADD_CONTENT_ROOTS" value="true" />
      <option name="ADD_SOURCE_ROOTS" value="true" />
      <module name="CS9" />
      <option name="SCRIPT_NAME" value="$APPLICATION_CONFIG_DIR$/scratches/scratch_12.py" />
      <option name="PARAMETERS" value="" />
      <option name="SHOW_COMMAND_LINE" value="false" />
      <method />
    </configuration>
    <configuration default="true" type="PythonConfigurationType" factoryName="Python">
      <option name="INTERPRETER_OPTIONS" value="" />
      <option name="PARENT_ENVS" value="true" />
      <envs>
        <env name="PYTHONUNBUFFERED" value="1" />
      </envs>
      <option name="SDK_HOME" value="" />
      <option name="WORKING_DIRECTORY" value="" />
      <option name="IS_MODULE_SDK" value="false" />
      <option name="ADD_CONTENT_ROOTS" value="true" />
      <option name="ADD_SOURCE_ROOTS" value="true" />
      <module name="CS9" />
      <option name="SCRIPT_NAME" value="" />
      <option name="PARAMETERS" value="" />
      <option name="SHOW_COMMAND_LINE" value="false" />
      <method />
    </configuration>
    <configuration default="true" type="Tox" factoryName="Tox">
      <option name="INTERPRETER_OPTIONS" value="" />
      <option name="PARENT_ENVS" value="true" />
      <envs />
      <option name="SDK_HOME" value="" />
      <option name="WORKING_DIRECTORY" value="" />
      <option name="IS_MODULE_SDK" value="false" />
      <option name="ADD_CONTENT_ROOTS" value="true" />
      <option name="ADD_SOURCE_ROOTS" value="true" />
      <module name="CS9" />
      <method />
    </configuration>
    <configuration default="true" type="ccruntests" factoryName="Run Study Tests">
      <option name="INTERPRETER_OPTIONS" value="" />
      <option name="PARENT_ENVS" value="true" />
      <envs />
      <option name="SDK_HOME" value="" />
      <option name="WORKING_DIRECTORY" value="" />
      <option name="IS_MODULE_SDK" value="false" />
      <option name="ADD_CONTENT_ROOTS" value="true" />
      <option name="ADD_SOURCE_ROOTS" value="true" />
      <module name="CS9" />
      <option name="studyTest" value="" />
      <method />
    </configuration>
    <configuration default="true" type="tests" factoryName="Attests">
      <option name="INTERPRETER_OPTIONS" value="" />
      <option name="PARENT_ENVS" value="true" />
      <envs />
      <option name="SDK_HOME" value="" />
      <option name="WORKING_DIRECTORY" value="" />
      <option name="IS_MODULE_SDK" value="false" />
      <option name="ADD_CONTENT_ROOTS" value="true" />
      <option name="ADD_SOURCE_ROOTS" value="true" />
      <module name="CS9" />
      <option name="SCRIPT_NAME" value="" />
      <option name="CLASS_NAME" value="" />
      <option name="METHOD_NAME" value="" />
      <option name="FOLDER_NAME" value="" />
      <option name="TEST_TYPE" value="TEST_SCRIPT" />
      <option name="PATTERN" value="" />
      <option name="USE_PATTERN" value="false" />
      <method />
    </configuration>
    <configuration default="true" type="tests" factoryName="Doctests">
      <option name="INTERPRETER_OPTIONS" value="" />
      <option name="PARENT_ENVS" value="true" />
      <envs />
      <option name="SDK_HOME" value="" />
      <option name="WORKING_DIRECTORY" value="" />
      <option name="IS_MODULE_SDK" value="false" />
      <option name="ADD_CONTENT_ROOTS" value="true" />
      <option name="ADD_SOURCE_ROOTS" value="true" />
      <module name="CS9" />
      <option name="SCRIPT_NAME" value="" />
      <option name="CLASS_NAME" value="" />
      <option name="METHOD_NAME" value="" />
      <option name="FOLDER_NAME" value="" />
      <option name="TEST_TYPE" value="TEST_SCRIPT" />
      <option name="PATTERN" value="" />
      <option name="USE_PATTERN" value="false" />
      <method />
    </configuration>
    <configuration default="true" type="tests" factoryName="Nosetests">
      <option name="INTERPRETER_OPTIONS" value="" />
      <option name="PARENT_ENVS" value="true" />
      <envs />
      <option name="SDK_HOME" value="" />
      <option name="WORKING_DIRECTORY" value="" />
      <option name="IS_MODULE_SDK" value="false" />
      <option name="ADD_CONTENT_ROOTS" value="true" />
      <option name="ADD_SOURCE_ROOTS" value="true" />
      <module name="CS9" />
      <option name="SCRIPT_NAME" value="" />
      <option name="CLASS_NAME" value="" />
      <option name="METHOD_NAME" value="" />
      <option name="FOLDER_NAME" value="" />
      <option name="TEST_TYPE" value="TEST_SCRIPT" />
      <option name="PATTERN" value="" />
      <option name="USE_PATTERN" value="false" />
      <option name="PARAMS" value="" />
      <option name="USE_PARAM" value="false" />
      <method />
    </configuration>
    <configuration default="true" type="tests" factoryName="Unittests">
      <option name="INTERPRETER_OPTIONS" value="" />
      <option name="PARENT_ENVS" value="true" />
      <envs />
      <option name="SDK_HOME" value="" />
      <option name="WORKING_DIRECTORY" value="" />
      <option name="IS_MODULE_SDK" value="false" />
      <option name="ADD_CONTENT_ROOTS" value="true" />
      <option name="ADD_SOURCE_ROOTS" value="true" />
      <module name="CS9" />
      <option name="SCRIPT_NAME" value="" />
      <option name="CLASS_NAME" value="" />
      <option name="METHOD_NAME" value="" />
      <option name="FOLDER_NAME" value="" />
      <option name="TEST_TYPE" value="TEST_SCRIPT" />
      <option name="PATTERN" value="" />
      <option name="USE_PATTERN" value="false" />
      <option name="PUREUNITTEST" value="true" />
      <option name="PARAMS" value="" />
      <option name="USE_PARAM" value="false" />
      <method />
    </configuration>
    <configuration default="true" type="tests" factoryName="py.test">
      <option name="INTERPRETER_OPTIONS" value="" />
      <option name="PARENT_ENVS" value="true" />
      <envs />
      <option name="SDK_HOME" value="" />
      <option name="WORKING_DIRECTORY" value="" />
      <option name="IS_MODULE_SDK" value="false" />
      <option name="ADD_CONTENT_ROOTS" value="true" />
      <option name="ADD_SOURCE_ROOTS" value="true" />
      <module name="CS9" />
      <option name="SCRIPT_NAME" value="" />
      <option name="CLASS_NAME" value="" />
      <option name="METHOD_NAME" value="" />
      <option name="FOLDER_NAME" value="" />
      <option name="TEST_TYPE" value="TEST_SCRIPT" />
      <option name="PATTERN" value="" />
      <option name="USE_PATTERN" value="false" />
      <option name="testToRun" value="" />
      <option name="keywords" value="" />
      <option name="params" value="" />
      <option name="USE_PARAM" value="false" />
      <option name="USE_KEYWORD" value="false" />
      <method />
    </configuration>
    <list size="3">
      <item index="0" class="java.lang.String" itemvalue="Python.scratch_11" />
      <item index="1" class="java.lang.String" itemvalue="Python.Hangman" />
      <item index="2" class="java.lang.String" itemvalue="Python.scratch_12" />
    </list>
    <recent_temporary>
      <list size="3">
        <item index="0" class="java.lang.String" itemvalue="Python.scratch_12" />
        <item index="1" class="java.lang.String" itemvalue="Python.scratch_11" />
        <item index="2" class="java.lang.String" itemvalue="Python.Hangman" />
      </list>
    </recent_temporary>
  </component>
  <component name="ShelveChangesManager" show_recycled="false">
    <option name="remove_strategy" value="false" />
  </component>
  <component name="ToolWindowManager">
    <frame x="411" y="79" width="816" height="791" extended-state="0" />
    <editor active="true" />
    <layout>
      <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
      <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
      <window_info id="Python Console" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
      <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.434492" sideWeight="0.5" order="8" side_tool="false" content_ui="tabs" />
      <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
      <window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
      <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
      <window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
      <window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
      <window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
      <window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
      <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
      <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
      <window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
    </layout>
  </component>
  <component name="Vcs.Log.UiProperties">
    <option name="RECENTLY_FILTERED_USER_GROUPS">
      <collection />
    </option>
    <option name="RECENTLY_FILTERED_BRANCH_GROUPS">
      <collection />
    </option>
  </component>
  <component name="VcsContentAnnotationSettings">
    <option name="myLimit" value="2678400000" />
  </component>
  <component name="XDebuggerManager">
    <breakpoint-manager />
    <watches-manager />
  </component>
  <component name="editorHistoryManager">
    <entry file="file://$APPLICATION_CONFIG_DIR$/scratches/scratch_11.py">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="0">
          <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/Code Examples/Hangman.py">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="144">
          <caret line="8" column="18" selection-start-line="8" selection-start-column="18" selection-end-line="8" selection-end-column="18" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$APPLICATION_CONFIG_DIR$/scratches/scratch_11.py">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="0">
          <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/Code Examples/Hangman.py">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="144">
          <caret line="8" column="18" selection-start-line="8" selection-start-column="18" selection-end-line="8" selection-end-column="18" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$APPLICATION_CONFIG_DIR$/scratches/scratch_11.py">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="0">
          <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/Code Examples/Hangman.py">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="144">
          <caret line="8" column="18" selection-start-line="8" selection-start-column="18" selection-end-line="8" selection-end-column="18" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$APPLICATION_CONFIG_DIR$/scratches/scratch_11.py">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="0">
          <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/Code Examples/Hangman.py">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="144">
          <caret line="8" column="18" selection-start-line="8" selection-start-column="18" selection-end-line="8" selection-end-column="18" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$APPLICATION_CONFIG_DIR$/scratches/scratch_11.py">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="1944">
          <caret line="108" column="17" selection-start-line="108" selection-start-column="17" selection-end-line="108" selection-end-column="17" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/Code Examples/Hangman.py">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="0">
          <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$APPLICATION_CONFIG_DIR$/scratches/scratch_11.py">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="0">
          <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$APPLICATION_CONFIG_DIR$/scratches/scratch_11.py">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="0">
          <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$APPLICATION_CONFIG_DIR$/scratches/scratch_11.py">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="54">
          <caret line="3" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="4" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$APPLICATION_CONFIG_DIR$/scratches/scratch_11.py">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="0">
          <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$APPLICATION_CONFIG_DIR$/scratches/scratch_11.py">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="0">
          <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$APPLICATION_CONFIG_DIR$/scratches/scratch_11.py">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="0">
          <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$APPLICATION_CONFIG_DIR$/scratches/scratch_11.py">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="360">
          <caret line="20" column="0" selection-start-line="20" selection-start-column="0" selection-end-line="20" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/Code Examples/Hangman.py">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="144">
          <caret line="8" column="18" selection-start-line="8" selection-start-column="18" selection-end-line="8" selection-end-column="18" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$APPLICATION_CONFIG_DIR$/scratches/scratch_12.py">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="54">
          <caret line="3" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="3" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
  </component>
</project>


text:
require 'isolation/abstract_unit'
require 'env_helpers'

module ApplicationTests
  class RunnerTest < ActiveSupport::TestCase
    include ActiveSupport::Testing::Isolation
    include EnvHelpers

    def setup
      build_app
      boot_rails

      # Lets create a model so we have something to play with
      app_file "app/models/user.rb", <<-MODEL
      class User
        def self.count
          42
        end
      end
      MODEL
    end

    def teardown
      teardown_app
    end

    def test_should_include_runner_in_shebang_line_in_help_without_option
      assert_match "/rails runner", Dir.chdir(app_path) { `bundle exec rails runner` }
    end

    def test_should_include_runner_in_shebang_line_in_help
      assert_match "/rails runner", Dir.chdir(app_path) { `bundle exec rails runner --help` }
    end

    def test_should_run_ruby_statement
      assert_match "42", Dir.chdir(app_path) { `bundle exec rails runner "puts User.count"` }
    end

    def test_should_run_file
      app_file "bin/count_users.rb", <<-SCRIPT
      puts User.count
      SCRIPT

      assert_match "42", Dir.chdir(app_path) { `bundle exec rails runner "bin/count_users.rb"` }
    end

    def test_should_set_dollar_0_to_file
      app_file "bin/dollar0.rb", <<-SCRIPT
      puts $0
      SCRIPT

      assert_match "bin/dollar0.rb", Dir.chdir(app_path) { `bundle exec rails runner "bin/dollar0.rb"` }
    end

    def test_should_set_dollar_program_name_to_file
      app_file "bin/program_name.rb", <<-SCRIPT
      puts $PROGRAM_NAME
      SCRIPT

      assert_match "bin/program_name.rb", Dir.chdir(app_path) { `bundle exec rails runner "bin/program_name.rb"` }
    end

    def test_with_hook
      add_to_config <<-RUBY
        runner do |app|
          app.config.ran = true
        end
      RUBY

      assert_match "true", Dir.chdir(app_path) { `bundle exec rails runner "puts Rails.application.config.ran"` }
    end

    def test_default_environment
      assert_match "development", Dir.chdir(app_path) { `bundle exec rails runner "puts Rails.env"` }
    end

    def test_environment_with_rails_env
      with_rails_env "production" do
        assert_match "production", Dir.chdir(app_path) { `bundle exec rails runner "puts Rails.env"` }
      end
    end

    def test_environment_with_rack_env
      with_rack_env "production" do
        assert_match "production", Dir.chdir(app_path) { `bundle exec rails runner "puts Rails.env"` }
      end
    end
  end
end


text:
var request = require('request');

//Lets configure and request
request({
  url: 'https://modulus.io/contact/demo', //URL to hit
  qs: {from: 'blog example', time: +new Date()}, //Query string data
  method: 'POST',
  //Lets post the following key/values as form
  form: {
    field1: 'data',
    field2: 'data'
  }
}, function (error, response, body) {
  if (error) {
    console.log(error);
  } else {
    console.log(response.statusCode, body);
  }
});


text:
package com.atexpose.dispatcher;

import com.atexpose.api.API;
import com.atexpose.api.MethodObject;
import com.atexpose.dispatcher.channels.IChannel;
import com.atexpose.dispatcher.logging.LogEntry;
import com.atexpose.dispatcher.logging.Logger;
import com.atexpose.dispatcher.parser.IParser;
import com.atexpose.dispatcher.parser.Request;
import com.atexpose.dispatcher.wrapper.IWrapper;
import com.atexpose.util.ByteStorage;
import com.google.common.collect.ImmutableMap;
import io.schinzel.basicutils.UTF8;
import io.schinzel.basicutils.state.State;
import io.schinzel.basicutils.thrower.Thrower;
import lombok.Builder;
import lombok.Getter;
import lombok.experimental.Accessors;
import org.apache.commons.lang3.StringUtils;
import java.time.Instant;
import java.time.temporal.ChronoUnit;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/**
 * The dispatcher is the central cog wheel.
 *

 * From the assigned channel the dispatcher pulls an incoming messages.
 * The parser extracts method name and argument values from the incoming message.
 * The incoming request is executed.
 * The response is wrapped with the assigned wrapper.
 * The wrapped response is sent with the assigned channel.
 *

 * The log data is sent to the assigned loggers (zero, one or many).
 *
 * @author Schinzel
 */
@Accessors(prefix = "m")
public class Dispatcher implements Runnable, IDispatcher {
    /** The name as part of the IValueWithKey interface. Is the name of the Dispatchers. */
    @Getter final String mKey;
    /** The API that is exposed. */
    private API mAPI;
    /** Receives incoming messages and sends wrapped responses. */
    @Getter
    private final IChannel mChannel;
    /** Parses the incoming messages. */
    @Getter private final IParser mParser;
    /** Wraps the responses to send. */
    @Getter private final IWrapper mWrapper;
    /**
     * The access level of this dispatcher. The dispatcher can invoke methods with the same access
     * level or lower.
     **/
    @Getter private final int mAccessLevel;
    /** Says which thread this object is. Useful for debugging and diagnostics. */
    @Getter private final int mThreadNumber;
    /** The thread that this dispatcher executes in. */
    private Thread mThread;
    /** The loggers assigned to this dispatcher. */
    @Getter private List<Logger> mLoggers = new ArrayList<>();
    /**
     * If this dispatcher runs as a background services like a web server or it executes and then
     * returns like a script file dispatcher. If true, the dispatcher is to run in the invoking
     * thread. If false, the dispatcher will start a new thread and execute in this.
     */
    @Getter private final boolean mIsSynchronized;
    /**
     * Contains a reference to the next dispatcher if this dispatcher is
     * multi-threaded. Multi-threaded dispatchers are stored as a linked-list.
     * This variable is a reference to the next dispatcher in the list. If it is
     * null, it is the last in the list or the it is single-threaded.
     */
    private Dispatcher mNextDispatcher;
    // ------------------------------------
    // - CONSTRUCTOR
    // ------------------------------------

    /**
     * Sets up a dispatcher.
     */
    @Builder
    private Dispatcher(String name, int noOfThreads, int accessLevel, boolean isSynchronized, IChannel channel, IParser parser, IWrapper wrapper) {
        mKey = name;
        Thrower.throwIfVarTooSmall(noOfThreads, "noOfThreads", 1);
        Thrower.throwIfVarEmpty(name, "name");
        Thrower.throwIfVarOutsideRange(accessLevel, "accessLevel", 1, 3);
        mThreadNumber = noOfThreads;
        mAccessLevel = accessLevel;
        mIsSynchronized = isSynchronized;
        mChannel = channel;
        mParser = parser;
        mWrapper = wrapper;
        //If more than one dispatcher to set up
        if (mThreadNumber > 1) {
            //Set up the next dispatcher
            mNextDispatcher = Dispatcher.builder()
                    .name(this.getKey())
                    .accessLevel(mAccessLevel)
                    .isSynchronized(mIsSynchronized)
                    .channel(mChannel.getClone())
                    .parser(mParser.getClone())
                    .wrapper(mWrapper)
                    .noOfThreads(mThreadNumber - 1)
                    .build();
        }
    }
    // ------------------------------------
    // - START & STOP
    // ------------------------------------

    /**
     * Starts the messaging and tells the next dispatcher to start its messaging recursively until
     * all dispatchers of that a siblings to this have been started.
     */
    public Dispatcher commenceMessaging(API api) {
        mAPI = api;
        //If there is a next dispatcher
        if (mNextDispatcher != null) {
            //Tell the next dispatcher to start its messaging.
            mNextDispatcher.commenceMessaging(api);
        }
        //If this is a synchronized execution
        if (mIsSynchronized) {
            //Run in the requesting thread.
            this.run();
        }//Else, i.e. should run in a new separate thread.
        else {
            //Start a new thread and let this dispatcher execute in this thread.
            mThread = new Thread(this);
            mThread.setName(this.getKey() + ":" + mThreadNumber);
            mThread.start();
        }
        return this;
    }

    /**
     * Shutdown this and the next dispatcher.
     */
    public void shutdown() {
        //If there was a next dispatchers
        if (this.mNextDispatcher != null) {
            //Tell the next dispatcher to shutdown
            this.mNextDispatcher.shutdown();
        }
        //Tell the channel to shut down. Send this thread as it is required for some channels to interrupt listening.
        this.mChannel.shutdown(mThread);
    }

    // ------------------------------------
    // - REQUEST HANDLING
    // ------------------------------------
    @Override
    public void run() {
        ByteStorage incomingRequest = new ByteStorage();
        String decodedIncomingRequest;
        String responseAsString;
        String wrappedResponse;
        byte[] wrappedResponseAsUtf8ByteArray;
        while (true) {
            boolean isError = false;
            Instant timeOfIncomingRequest = null;
            Request request = Request.EMPTY;
            try {
                if (!mChannel.getRequest(incomingRequest)) {
                    break;
                }
                timeOfIncomingRequest = Instant.now();
                // Get incoming request as string.
                decodedIncomingRequest = incomingRequest.getAsString();
                //Send the incoming request to the protocol for extracting method name and arguments
                request = mParser.getRequest(decodedIncomingRequest);
                //if is a file request
                if (request.isFileRequest()) {
                    wrappedResponse = StringUtils.EMPTY;
                    wrappedResponseAsUtf8ByteArray = mWrapper.wrapFile(request.getFileName());
                } // Else must be a method call
                else {
                    MethodObject methodObject = mAPI.getMethodObject(request.getMethodName());
                    // is the dispatcher authorized to access this method
                    checkAccessLevel(methodObject.getAccessLevelRequiredToUseThisMethod());
                    checkNumberOfArguments(request.getArgumentValues().size(), methodObject.getNoOfRequiredArguments());
                    Object[] requestArgumentValues = RequestArguments.builder()
                            .methodArguments(methodObject.getMethodArguments())
                            .requestArgumentValuesAsStrings(request.getArgumentValues())
                            .requestArgumentNames(request.getArgumentNames())
                            .build()
                            .getArgumentValuesAsObjects();
                    Object responseAsObject = methodObject
                            .getMethod()
                            .invoke(methodObject.getObject(), requestArgumentValues);
                    responseAsString = methodObject
                            .getReturnDataType()
                            .convertFromDataTypeToString(responseAsObject);
                    wrappedResponse = mWrapper.wrapResponse(responseAsString);
                    wrappedResponseAsUtf8ByteArray = UTF8.getBytes(wrappedResponse);
                }
            } catch (Exception e) {
                isError = true;
                String errorMessage = (e.getMessage() == null)
                        ? e.getCause().getMessage()
                        : e.getMessage();
                if (errorMessage == null) errorMessage = "";
                String errorClassName = e.getClass().getSimpleName();
                errorMessage = errorClassName + ". " + errorMessage;
                ImmutableMap<String, String> requestExceptionInfo = (request.isFileRequest())
                        ? ImmutableMap.<String, String>builder()
                        .put("error_message", errorMessage)
                        .put("file_name", request.getFileName())
                        .build()
                        : ImmutableMap.<String, String>builder()
                        .put("error_message", errorMessage)
                        .put("method_name", request.getMethodName())
                        .put("argument_values", request.getArgumentValues().toString())
                        .put("argument_names", request.getArgumentNames().toString())
                        .build();
                //If the exception has properties
                wrappedResponse = mWrapper.wrapError(requestExceptionInfo);
                wrappedResponseAsUtf8ByteArray = UTF8.getBytes(wrappedResponse);
            } finally {
                timeOfIncomingRequest = (timeOfIncomingRequest == null) ? Instant.now() : timeOfIncomingRequest;
                // Get incoming request as string.
                decodedIncomingRequest = incomingRequest.getAsString();
            }
            mChannel.writeResponse(wrappedResponseAsUtf8ByteArray);
            LogEntry logEntry = LogEntry.builder()
                    .isError(isError)
                    .timeOfIncomingRequest(timeOfIncomingRequest)
                    .requestString(decodedIncomingRequest)
                    .response(wrappedResponse)
                    .threadNumber(mThreadNumber)
                    .requestReadTime(mChannel.requestReadTime())
                    .execTime(timeOfIncomingRequest.until(Instant.now(), ChronoUnit.MILLIS))
                    .responseWriteTime(mChannel.responseWriteTime())
                    .senderInfo(mChannel.senderInfo())
                    .argNames(request.getArgumentNames())
                    .argValues(request.getArgumentValues())
                    .isFileRequest(request.isFileRequest())
                    .fileName(request.getFileName())
                    .methodName(request.getMethodName())
                    .build();
            this.log(logEntry);
            incomingRequest.clear();
        }
    }

    private void checkAccessLevel(int methodAccessLevel) {
        Thrower.throwIfTrue(methodAccessLevel > this.mAccessLevel)
                .message("Cannot access the requested method through this dispatcher. Method requires access level "
                        + methodAccessLevel + " and the used dispatcher only has access level " + this.mAccessLevel + ".");
    }

    private static void checkNumberOfArguments(int actualNumberOfArguments, int requiredNumberOfArguments) {
        Thrower.throwIfTrue(actualNumberOfArguments < requiredNumberOfArguments)
                .message("To few arguments. Was " + actualNumberOfArguments + " but required " + requiredNumberOfArguments + ".");
    }
    // ------------------------------------
    // - Logger
    // ------------------------------------

    /**
     * Adds a logger to this dispatcher.
     *
     * @param logger The logger to add.
     * @return This for chaining
     */
    public Dispatcher addLogger(Logger logger) {
        mLoggers.add(logger);
        if (mNextDispatcher != null) {
            mNextDispatcher.addLogger(logger);
        }
        return this;
    }

    /**
     * Removes all loggers from this dispatcher.
     */
    public Dispatcher removeLoggers() {
        mLoggers = Collections.emptyList();
        if (mNextDispatcher != null) {
            mNextDispatcher.removeLoggers();
        }
        return this;
    }

    /**
     * Logs the argument log entry all attached (if any) loggers.
     *
     * @param logEntry The entry to add to logs.
     */
    private void log(LogEntry logEntry) {
        //Go through all logger attached to this dispatcher
        for (Logger logger : mLoggers) {
            //Log event
            logger.log(logEntry);
        }
    }
    // ------------------------------------
    // - State
    // ------------------------------------

    public State getState() {
        return State.getBuilder()
                .add("Name", this.getKey())
                .add("AccessLevel", mAccessLevel)
                .add("Threads", this.mThreadNumber)
                .addChild("Parser", mParser)
                .addChild("Wrapper", mWrapper)
                .addChild("Channel", mChannel)
                .addChildren("Loggers", mLoggers)
                .build();
    }

}