text:
<mvc:View
	xmlns="sap.m"
	xmlns:mvc="sap.ui.core.mvc"
	xmlns:core="sap.ui.core"
	height="100%"
	controllerName="sap.m.sample.Button.Page">

	<Page
		title="Page"
		class="sapUiContentPadding" >
		<customHeader>
			<Toolbar>
				<Button type="Back" press="onPress" />
				<ToolbarSpacer/>
				<Title text="Title" level="H2"/>
				<ToolbarSpacer/>
				<Button icon="sap-icon://edit" type="Transparent" press="onPress" ariaLabelledBy="editButtonLabel"/>
			</Toolbar>

		</customHeader>
		<subHeader>
			<Toolbar>
				<ToolbarSpacer/>
				<Button text="Default" press="onPress" />
				<Button type="Reject" text="Reject" press="onPress" />
				<Button icon="sap-icon://action" type="Transparent" press="onPress" ariaLabelledBy="actionButtonLabel"/>
				<ToolbarSpacer/>
			</Toolbar>

		</subHeader>
		<content>
			<HBox>
				<Button text="Default"
						press="onPress"
						ariaDescribedBy="defaultButtonDescription genericButtonDescription">
					<layoutData>
						<FlexItemData growFactor="1" />
					</layoutData>
				</Button>
				<Button type="Accept"
						text="Accept"
						press="onPress"
						ariaDescribedBy="acceptButtonDescription genericButtonDescription">
					<layoutData>
						<FlexItemData growFactor="1" />
					</layoutData>
				</Button>
				<Button type="Reject"
						text="Reject"
						press="onPress"
						ariaDescribedBy="rejectButtonDescription genericButtonDescription">
					<layoutData>
						<FlexItemData growFactor="1" />
					</layoutData>
				</Button>
				<Button text="Coming Soon"
						press="onPress"
						ariaDescribedBy="comingSoonButtonDescription genericButtonDescription"
						enabled="false">
					<layoutData>
						<FlexItemData growFactor="1" />
					</layoutData>
				</Button>

			</HBox>

			<!-- Collection of labels (some of which are invisible) used to provide ARIA descriptions for the buttons -->
			<Label id="genericButtonDescription" text="Note: The buttons in this sample display MessageToast when pressed."/>

			<core:InvisibleText id="defaultButtonDescription" text="Description of default button goes here."/>
			<core:InvisibleText id="acceptButtonDescription" text="Description of accept button goes here."/>
			<core:InvisibleText id="rejectButtonDescription" text="Description of reject button goes here."/>
			<core:InvisibleText id="comingSoonButtonDescription" text="This feature is not active just now."/>
			<!-- These labels exist only to provide targets for the ARIA label on the Edit and Action buttons -->
			<core:InvisibleText id="editButtonLabel" text="Edit Button Label"/>
			<core:InvisibleText id="actionButtonLabel" text="Action Button Label"/>
		</content>
		<footer>
			<Toolbar>
				<ToolbarSpacer/>
				<Button type="Emphasized" text="Emphasized" press="onPress" />
				<Button text="Default" press="onPress" />
				<Button icon="sap-icon://action" type="Transparent" press="onPress" />
			</Toolbar>
		</footer>
	</Page>
</mvc:View>


text:
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.11
// See http://java.sun.com/xml/jaxb
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2016.09.16 at 03:29:52 PM PDT
//

package com.wb.nextgenlibrary.parser.cpestyle;

import java.util.ArrayList;
import java.util.List;
import com.wb.nextgenlibrary.parser.XmlAccessType;
import com.wb.nextgenlibrary.parser.XmlAccessorType;
import com.wb.nextgenlibrary.parser.XmlElement;
import com.wb.nextgenlibrary.parser.XmlType;

/**
 *
Java class for CompatibilityDevice-type complex type.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *
 *

 * <complexType name="CompatibilityDevice-type">
 *   <complexContent>
 *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *       <sequence>
 *         <element name="Class" type="{http://www.w3.org/2001/XMLSchema}string"/>
 *         <element name="SubClass" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/>
 *       </sequence>
 *     </restriction>
 *   </complexContent>
 * </complexType>
 *

 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "CompatibilityDevice-type", propOrder = {
    "clazz",
    "subClass"
})
public class CompatibilityDeviceType {

    @XmlElement(name = "Class", required = true)
    protected String clazz;
    @XmlElement(name = "SubClass")
    protected List<String> subClass;

    /**
     * Gets the value of the clazz property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getClazz() {
        return clazz;
    }

    /**
     * Sets the value of the clazz property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setClazz(String value) {
        this.clazz = value;
    }

    /**
     * Gets the value of the subClass property.
     *
     *

     * This accessor method returns a reference to the live list,
     * not a snapshot. Therefore any modification you make to the
     * returned list will be present inside the JAXB object.
     * This is why there is not a set method for the subClass property.
     *
     *

     * For example, to add a new item, do as follows:
     *

     *    getSubClass().add(newItem);
     *

     *
     *
     *

     * Objects of the following type(s) are allowed in the list
     * {@link String }
     *
     *
     */
    public List<String> getSubClass() {
        if (subClass == null) {
            subClass = new ArrayList<String>();
        }
        return this.subClass;
    }

}

redpajama_set_name: RedPajamaGithub


text:
"""
    Module designed to route messages based on strategy pattern.

    This module includes class mapper tuple to correlate received from telegram
    user command with target command class to run. Additionally, this module
    generates help message based on command list.
"""

from typing import Any, Dict

from .command.help.commands import GreetingsCommand, HelpCommand
from .command.nasa.apod import APODCommand
from .command.nasa.asteroid import AsteroidCommand
from .command.nasa.curiosity import CuriosityCommand
from .command.search.google import GoogleCommand
from .command.search.wiki import WikiCommand, RandomCommand
from .command.search.urban import UrbanDictionaryCommand
from .command.search.dictionary import DictionaryCommand
from .command.weather.weather import WeatherCommand
from .command.weather.forecast import ForecastCommand
from .command.exchange.exchange import ExchangeCommand
from .command.remember.rememberall import RememberAll
from .command.remember.searchtag import SearchTagCommand
from .command.comics.xkcd import XkcdCommand
from .command.tools.qrgenerator import QrCommand
from .command.tools.ocr import OcrCommand
from .command.news.hackernews import LatestNewsCommand, TopNewsCommand, BestNewsCommand
from .command.news.canadanews import CanadaStatsCommand

class CommandRouter:
    command_class_mapper = (
        ('/help', HelpCommand),
        ('/asteroid', AsteroidCommand),
        ('/start', GreetingsCommand),
        ('/canadastat', CanadaStatsCommand),
        ('/oxford', DictionaryCommand),
        ('/exchange', ExchangeCommand),
        ('/forecast', ForecastCommand),
        ('/google', GoogleCommand),
        ('/search', SearchTagCommand),
        ('/urban', UrbanDictionaryCommand),
        ('/weather', WeatherCommand),
        ('/curiosity', CuriosityCommand),
        ('/qr', QrCommand),
        ('/ocr', OcrCommand),
        ('/apod', APODCommand),
        ('/wiki', WikiCommand),
        ('/random', RandomCommand),
        ('/xkcd', XkcdCommand),
        ('/latestnews', LatestNewsCommand),
        ('/topnews', TopNewsCommand),
        ('/bestnews', BestNewsCommand),
        ('/remember', RememberAll),
    )

    @classmethod
    def route(cls, message: Dict[str, Any]):
        command, _, query = message['text'].partition(' ')
        command = command.lower()
        if command not in dict(cls.command_class_mapper):
            return
        command_class = dict(cls.command_class_mapper).get(command, None)
        command_instance = command_class(cls, query, message)
        return command_instance()

    @classmethod
    def get_commands_help(cls):
        return (
            (command, command_class.help_text)
            for command, command_class in cls.command_class_mapper
            if command_class.help_text is not None
        )


text:
DISTNAME=		nosexcover-${VERSION}
VERSION=		1.0.10
PKGNAME=		${PYPKGPREFIX}-${DISTNAME}
CATEGORIES=		textproc python
MASTER_SITES=		https://pypi.python.org/packages/79/5e/e882c69e11c7fa1ae1c73f8470294559420593a12ec876acbcd44b4e58e5/

MAINTAINER=		pkgsrc-users@NetBSD.org
HOMEPAGE=		http://github.com/cmheisel/nose-xcover/
COMMENT=		Extends nose.plugins.cover to add Cobertura-style XML reports
LICENSE=		bsd

.include "../../lang/python/egg.mk"
.include "../../mk/bsd.pkg.mk"


text:
.. _network_debug_troubleshooting:

***************************************
Network Debug and Troubleshooting Guide
***************************************

.. contents::
   :local:

Introduction
============

Starting with Ansible version 2.1, you can now use the familiar Ansible models of playbook authoring and module development to manage heterogeneous networking devices. Ansible supports a growing number of network devices using both CLI over SSH and API (when available) transports.

This section discusses how to debug and troubleshoot network modules in Ansible 2.3.

How to troubleshoot
===================

This section covers troubleshooting issues with Network Modules.

Errors generally fall into one of the following categories:

:Authentication issues:
  * Not correctly specifying credentials
  * Remote device (network switch/router) not falling back to other other authentication methods
  * SSH key issues
:Timeout issues:
  * Can occur when trying to pull a large amount of data
  * May actually be masking a authentication issue
:Playbook issues:
  * Use of ``delegate_to``, instead of ``ProxyCommand``. See :ref:`network proxy guide <network_delegate_to_vs_ProxyCommand>` for more information.

.. warning:: ``unable to open shell``

  The ``unable to open shell`` message is new in Ansible 2.3, it means that the ``ansible-connection`` daemon has not been able to successfully
  talk to the remote network device. This generally means that there is an authentication issue. See the "Authentication and connection issues" section
  in this document for more information.

.. _enable_network_logging:

Enabling Networking logging and how to read the logfile
-------------------------------------------------------

**Platforms:** Any

Ansible 2.3 features improved logging to help diagnose and troubleshoot issues regarding Ansible Networking modules.

Because logging is very verbose it is disabled by default. It can be enabled via the :envvar:`ANSIBLE_LOG_PATH` and :envvar:`ANSIBLE_DEBUG` options on the ansible-controller, that is the machine running ansible-playbook.

Before running ``ansible-playbook`` run the following commands to enable logging::

   # Specify the location for the log file
   export ANSIBLE_LOG_PATH=~/ansible.log
   # Enable Debug
   export ANSIBLE_DEBUG=True

   # Run with 4*v for connection level verbosity
   ansible-playbook -vvvv ...

After Ansible has finished running you can inspect the log file which has been created on the ansible-controller:

.. code::

  less $ANSIBLE_LOG_PATH

  2017-03-30 13:19:52,740 p=28990 u=fred |  creating new control socket for host veos01:22 as user admin
  2017-03-30 13:19:52,741 p=28990 u=fred |  control socket path is /home/fred/.ansible/pc/ca5960d27a
  2017-03-30 13:19:52,741 p=28990 u=fred |  current working directory is /home/fred/ansible/test/integration
  2017-03-30 13:19:52,741 p=28990 u=fred |  using connection plugin network_cli
  ...
  2017-03-30 13:20:14,771 paramiko.transport userauth is OK
  2017-03-30 13:20:15,283 paramiko.transport Authentication (keyboard-interactive) successful!
  2017-03-30 13:20:15,302 p=28990 u=fred |  ssh connection done, setting terminal
  2017-03-30 13:20:15,321 p=28990 u=fred |  ssh connection has completed successfully
  2017-03-30 13:20:15,322 p=28990 u=fred |  connection established to veos01 in 0:00:22.580626

From the log notice:

* ``p=28990`` Is the PID (Process ID) of the ``ansible-connection`` process
* ``u=fred`` Is the user `running` ansible, not the remote-user you are attempting to connect as
* ``creating new control socket for host veos01:22 as user admin`` host:port as user
* ``control socket path is`` location on disk where the persistent connection socket is created
* ``using connection plugin network_cli`` Informs you that persistent connection is being used
* ``connection established to veos01 in 0:00:22.580626`` Time taken to obtain a shell on the remote device

.. note: Port None ``creating new control socket for host veos01:None``

   If the log reports the port as ``None`` this means that the default port is being used.
   A future Ansible release will improve this message so that the port is always logged.

Because the log files are verbose, you can use grep to look for specific information. For example, once you have identified the ``pid`` from the ``creating new control socket for host`` line you can search for other connection log entries::

  grep "p=28990" $ANSIBLE_LOG_PATH

Enabling Networking device interaction logging
----------------------------------------------

**Platforms:** Any

Ansible 2.8 features added logging of device interaction in log file to help diagnose and troubleshoot
issues regarding Ansible Networking modules. The messages are logged in file pointed by ``log_path`` configuration
option in Ansible configuration file or by set :envvar:`ANSIBLE_LOG_PATH` as mentioned in above section.

.. warning::
  The device interaction messages consist of command executed on target device and the returned response, as this
  log data can contain sensitive information including passwords in plain text it is disabled by default.
  Additionally, in order to prevent accidental leakage of data, a warning will be shown on every task with this
  setting enabled specifying which host has it enabled and where the data is being logged.

Be sure to fully understand the security implications of enabling this option. The device interaction logging can be enabled either globally by setting in configuration file or by setting environment or enabled on per task basis by passing special variable to task.

Before running ``ansible-playbook`` run the following commands to enable logging::

   # Specify the location for the log file
   export ANSIBLE_LOG_PATH=~/ansible.log

Enable device interaction logging for a given task

.. code-block:: yaml

  - name: get version information
    ios_command:
      commands:
        - show version
    vars:
      ansible_persistent_log_messages: True

To make this a global setting, add the following to your ``ansible.cfg`` file:

.. code-block:: ini

   [persistent_connection]
   log_messages = True

or enable environment variable `ANSIBLE_PERSISTENT_LOG_MESSAGES`

   # Enable device interaction logging
   export ANSIBLE_PERSISTENT_LOG_MESSAGES=True

If the task is failing at the time on connection initialization itself it is recommended to enable this option
globally else if an individual task is failing intermittently this option can be enabled for that task itself to
find the root cause.

After Ansible has finished running you can inspect the log file which has been created on the ansible-controller

.. note:: Be sure to fully understand the security implications of enabling this option as it can log sensitive
          information in log file thus creating security vulnerability.

Isolating an error
------------------

**Platforms:** Any

As with any effort to troubleshoot it's important to simplify the test case as much as possible.

For Ansible this can be done by ensuring you are only running against one remote device:

* Using ``ansible-playbook --limit switch1.example.net...``
* Using an ad-hoc ``ansible`` command

`ad-hoc` refers to running Ansible to perform some quick command using ``/usr/bin/ansible``, rather than the orchestration language, which is ``/usr/bin/ansible-playbook``. In this case we can ensure connectivity by attempting to execute a single command on the remote device::

  ansible -m eos_command -a 'commands=?' -i inventory switch1.example.net -e 'ansible_connection=local' -u admin -k

In the above example, we:

* connect to ``switch1.example.net`` specified in the inventory file ``inventory``
* use the module ``eos_command``
* run the command ``?``
* connect using the username ``admin``
* inform ansible to prompt for the ssh password by specifying ``-k``

If you have SSH keys configured correctly, you don't need to specify the ``-k`` parameter

If the connection still fails you can combine it with the enable_network_logging parameter. For example::

   # Specify the location for the log file
   export ANSIBLE_LOG_PATH=~/ansible.log
   # Enable Debug
   export ANSIBLE_DEBUG=True
   # Run with 4*v for connection level verbosity
   ansible -m eos_command -a 'commands=?' -i inventory switch1.example.net -e 'ansible_connection=local' -u admin -k

Then review the log file and find the relevant error message in the rest of this document.

.. For details on other ways to authenticate, see LINKTOAUTHHOWTODOCS.

.. _socket_path_issue:

Category "socket_path issue"
============================

**Platforms:** Any

The ``socket_path does not exist or cannot be found``  and ``unable to connect to socket`` messages are new in Ansible 2.5. These messages indicate that the socket used to communicate with the remote network device is unavailable or does not exist.

For example:

.. code-block:: none

   fatal: [spine02]: FAILED! => {
       "changed": false,
       "failed": true,
       "module_stderr": "Traceback (most recent call last):\n  File \"/tmp/ansible_TSqk5J/ansible_modlib.zip/ansible/module_utils/connection.py\", line 115, in _exec_jsonrpc\nansible.module_utils.connection.ConnectionError: socket_path does not exist or cannot be found\n",
       "module_stdout": "",
       "msg": "MODULE FAILURE",
       "rc": 1
   }

or

.. code-block:: none

   fatal: [spine02]: FAILED! => {
       "changed": false,
       "failed": true,
       "module_stderr": "Traceback (most recent call last):\n  File \"/tmp/ansible_TSqk5J/ansible_modlib.zip/ansible/module_utils/connection.py\", line 123, in _exec_jsonrpc\nansible.module_utils.connection.ConnectionError: unable to connect to socket\n",
       "module_stdout": "",
       "msg": "MODULE FAILURE",
       "rc": 1
   }

Suggestions to resolve:

Follow the steps detailed in :ref:`enable network logging <enable_network_logging>`.

If the identified error message from the log file is:

.. code-block:: yaml

   2017-04-04 12:19:05,670 p=18591 u=fred |  command timeout triggered, timeout value is 30 secs

or

.. code-block:: yaml

   2017-04-04 12:19:05,670 p=18591 u=fred |  persistent connection idle timeout triggered, timeout value is 30 secs

Follow the steps detailed in :ref:`timeout issues <timeout_issues>`

.. _unable_to_open_shell:

Category "Unable to open shell"
===============================

**Platforms:** Any

The ``unable to open shell`` message is new in Ansible 2.3. This message means that the ``ansible-connection`` daemon has not been able to successfully talk to the remote network device. This generally means that there is an authentication issue. It is a "catch all" message, meaning you need to enable :ref:logging`a_note_about_logging` to find the underlying issues.

For example:

.. code-block:: none

  TASK [prepare_eos_tests : enable cli on remote device] **************************************************
  fatal: [veos01]: FAILED! => {"changed": false, "failed": true, "msg": "unable to open shell"}

or:

.. code-block:: none

   TASK [ios_system : configure name_servers] *************************************************************
   task path:
   fatal: [ios-csr1000v]: FAILED! => {
       "changed": false,
       "failed": true,
       "msg": "unable to open shell",
   }

Suggestions to resolve:

Follow the steps detailed in enable_network_logging_.

Once you've identified the error message from the log file, the specific solution can be found in the rest of this document.

Error: "[Errno -2] Name or service not known"
---------------------------------------------

**Platforms:** Any

Indicates that the remote host you are trying to connect to can not be reached

For example:

.. code-block:: yaml

   2017-04-04 11:39:48,147 p=15299 u=fred |  control socket path is /home/fred/.ansible/pc/ca5960d27a
   2017-04-04 11:39:48,147 p=15299 u=fred |  current working directory is /home/fred/git/ansible-inc/stable-2.3/test/integration
   2017-04-04 11:39:48,147 p=15299 u=fred |  using connection plugin network_cli
   2017-04-04 11:39:48,340 p=15299 u=fred |  connecting to host veos01 returned an error
   2017-04-04 11:39:48,340 p=15299 u=fred |  [Errno -2] Name or service not known

Suggestions to resolve:

* If you are using the ``provider:`` options ensure that its suboption ``host:`` is set correctly.
* If you are not using ``provider:`` nor top-level arguments ensure your inventory file is correct.

Error: "Authentication failed"
------------------------------

**Platforms:** Any

Occurs if the credentials (username, passwords, or ssh keys) passed to ``ansible-connection`` (via ``ansible`` or ``ansible-playbook``) can not be used to connect to the remote device.

For example:

.. code-block:: yaml

   <ios01> ESTABLISH CONNECTION FOR USER: cisco on PORT 22 TO ios01
   <ios01> Authentication failed.

Suggestions to resolve:

If you are specifying credentials via ``password:`` (either directly or via ``provider:``) or the environment variable `ANSIBLE_NET_PASSWORD` it is possible that ``paramiko`` (the Python SSH library that Ansible uses) is using ssh keys, and therefore the credentials you are specifying are being ignored. To find out if this is the case, disable "look for keys". This can be done like this:

.. code-block:: yaml

   export ANSIBLE_PARAMIKO_LOOK_FOR_KEYS=False

To make this a permanent change, add the following to your ``ansible.cfg`` file:

.. code-block:: ini

   [paramiko_connection]
   look_for_keys = False

Error: "connecting to host <hostname> returned an error" or "Bad address"
-------------------------------------------------------------------------

This may occur if the SSH fingerprint hasn't been added to Paramiko's (the Python SSH library) know hosts file.

When using persistent connections with Paramiko, the connection runs in a background process.  If the host doesn't already have a valid SSH key, by default Ansible will prompt to add the host key.  This will cause connections running in background processes to fail.

For example:

.. code-block:: yaml

   2017-04-04 12:06:03,486 p=17981 u=fred |  using connection plugin network_cli
   2017-04-04 12:06:04,680 p=17981 u=fred |  connecting to host veos01 returned an error
   2017-04-04 12:06:04,682 p=17981 u=fred |  (14, 'Bad address')
   2017-04-04 12:06:33,519 p=17981 u=fred |  number of connection attempts exceeded, unable to connect to control socket
   2017-04-04 12:06:33,520 p=17981 u=fred |  persistent_connect_interval=1, persistent_connect_retries=30

Suggestions to resolve:

Use ``ssh-keyscan`` to pre-populate the known_hosts. You need to ensure the keys are correct.

.. code-block:: shell

   ssh-keyscan veos01

or

You can tell Ansible to automatically accept the keys

Environment variable method::

  export ANSIBLE_PARAMIKO_HOST_KEY_AUTO_ADD=True
  ansible-playbook ...

``ansible.cfg`` method:

ansible.cfg

.. code-block:: ini

  [paramiko_connection]
  host_key_auto_add = True

.. warning: Security warning

   Care should be taken before accepting keys.

Error: "No authentication methods available"
--------------------------------------------

For example:

.. code-block:: yaml

   2017-04-04 12:19:05,670 p=18591 u=fred |  creating new control socket for host veos01:None as user admin
   2017-04-04 12:19:05,670 p=18591 u=fred |  control socket path is /home/fred/.ansible/pc/ca5960d27a
   2017-04-04 12:19:05,670 p=18591 u=fred |  current working directory is /home/fred/git/ansible-inc/ansible-workspace-2/test/integration
   2017-04-04 12:19:05,670 p=18591 u=fred |  using connection plugin network_cli
   2017-04-04 12:19:06,606 p=18591 u=fred |  connecting to host veos01 returned an error
   2017-04-04 12:19:06,606 p=18591 u=fred |  No authentication methods available
   2017-04-04 12:19:35,708 p=18591 u=fred |  connect retry timeout expired, unable to connect to control socket
   2017-04-04 12:19:35,709 p=18591 u=fred |  persistent_connect_retry_timeout is 15 secs

Suggestions to resolve:

No password or SSH key supplied

Clearing Out Persistent Connections
-----------------------------------

**Platforms:** Any

In Ansible 2.3, persistent connection sockets are stored in ``~/.ansible/pc`` for all network devices.  When an Ansible playbook runs, the persistent socket connection is displayed when verbose output is specified.

``<switch> socket_path: /home/fred/.ansible/pc/f64ddfa760``

To clear out a persistent connection before it times out (the default timeout is 30 seconds
of inactivity), simple delete the socket file.

.. _timeout_issues:

Timeout issues
==============

Persistent connection idle timeout
----------------------------------

By default, ``ANSIBLE_PERSISTENT_CONNECT_TIMEOUT`` is set to 30 (seconds). You may see the following error if this value is too low:

.. code-block:: yaml

   2017-04-04 12:19:05,670 p=18591 u=fred |  persistent connection idle timeout triggered, timeout value is 30 secs

Suggestions to resolve:

Increase value of persistent connection idle timeout:

.. code-block:: sh

   export ANSIBLE_PERSISTENT_CONNECT_TIMEOUT=60

To make this a permanent change, add the following to your ``ansible.cfg`` file:

.. code-block:: ini

   [persistent_connection]
   connect_timeout = 60

Command timeout
---------------

By default, ``ANSIBLE_PERSISTENT_COMMAND_TIMEOUT`` is set to 30 (seconds). Prior versions of Ansible had this value set to 10 seconds by default.
You may see the following error if this value is too low:

.. code-block:: yaml

   2017-04-04 12:19:05,670 p=18591 u=fred |  command timeout triggered, timeout value is 30 secs

Suggestions to resolve:

* Option 1 (Global command timeout setting):
  Increase value of command timeout in configuration file or by setting environment variable.

  .. code-block:: yaml

     export ANSIBLE_PERSISTENT_COMMAND_TIMEOUT=60

  To make this a permanent change, add the following to your ``ansible.cfg`` file:

  .. code-block:: ini

     [persistent_connection]
     command_timeout = 60

* Option 2 (Per task command timeout setting):
  Increase command timeout per task basis. All network modules support a
  timeout value that can be set on a per task basis.
  The timeout value controls the amount of time in seconds before the
  task will fail if the command has not returned.

  For local connection type:

  .. FIXME: Detail error here

  Suggestions to resolve:

  .. code-block:: yaml

      - name: save running-config
        ios_command:
          commands: copy running-config startup-config
          provider: "{{ cli }}"
          timeout: 30

  For network_cli, netconf connection type (applicable from 2.7 onwards):

  .. FIXME: Detail error here

  Suggestions to resolve:

  .. code-block:: yaml

      - name: save running-config
        ios_command:
          commands: copy running-config startup-config
        vars:
          ansible_command_timeout: 60

Some operations take longer than the default 30 seconds to complete.  One good
example is saving the current running config on IOS devices to startup config.
In this case, changing the timeout value from the default 30 seconds to 60
seconds will prevent the task from failing before the command completes
successfully.

Persistent connection retry timeout
-----------------------------------

By default, ``ANSIBLE_PERSISTENT_CONNECT_RETRY_TIMEOUT`` is set to 15 (seconds). You may see the following error if this value is too low:

.. code-block:: yaml

   2017-04-04 12:19:35,708 p=18591 u=fred |  connect retry timeout expired, unable to connect to control socket
   2017-04-04 12:19:35,709 p=18591 u=fred |  persistent_connect_retry_timeout is 15 secs

Suggestions to resolve:

Increase the value of the persistent connection idle timeout.
Note: This value should be greater than the SSH timeout value (the timeout value under the defaults
section in the configuration file) and less than the value of the persistent
connection idle timeout (connect_timeout).

.. code-block:: yaml

   export ANSIBLE_PERSISTENT_CONNECT_RETRY_TIMEOUT=30

To make this a permanent change, add the following to your ``ansible.cfg`` file:

.. code-block:: ini

   [persistent_connection]
   connect_retry_timeout = 30

Timeout issue due to platform specific login menu with ``network_cli`` connection type
--------------------------------------------------------------------------------------

In Ansible 2.9 and later, the network_cli connection plugin configuration options are added
to handle the platform specific login menu. These options can be set as group/host or tasks
variables.

Example: Handle single login menu prompts with host variables

.. code-block:: console

    $cat host_vars/<hostname>.yaml
    ---
    ansible_terminal_initial_prompt:
      - "Connect to a host"
    ansible_terminal_initial_answer:
      - "3"

Example: Handle remote host multiple login menu prompts with host variables

.. code-block:: console

    $cat host_vars/<inventory-hostname>.yaml
    ---
    ansible_terminal_initial_prompt:
      - "Press any key to enter main menu"
      - "Connect to a host"
    ansible_terminal_initial_answer:
      - "\\r"
      - "3"
    ansible_terminal_initial_prompt_checkall: True

To handle multiple login menu prompts:

* The values of ``ansible_terminal_initial_prompt`` and ``ansible_terminal_initial_answer`` should be a list.
* The prompt sequence should match the answer sequence.
* The value of ``ansible_terminal_initial_prompt_checkall`` should be set to ``True``.

.. note:: If all the prompts in sequence are not received from remote host at the time connection initialization it will result in a timeout.

Playbook issues
===============

This section details issues are caused by issues with the Playbook itself.

Error: "Unable to enter configuration mode"
-------------------------------------------

**Platforms:** eos and ios

This occurs when you attempt to run a task that requires privileged mode in a user mode shell.

For example:

.. code-block:: console

  TASK [ios_system : configure name_servers] *****************************************************************************
  task path:
  fatal: [ios-csr1000v]: FAILED! => {
      "changed": false,
      "failed": true,
     "msg": "unable to enter configuration mode",
  }

Suggestions to resolve:

In Ansible prior to 2.5 :
Add ``authorize: yes`` to the task. For example:

.. code-block:: yaml

  - name: configure hostname
    ios_system:
      provider:
        hostname: foo
        authorize: yes
    register: result

If the user requires a password to go into privileged mode, this can be specified with ``auth_pass``; if ``auth_pass`` isn't set, the environment variable `ANSIBLE_NET_AUTHORIZE` will be used instead.

Add ``authorize: yes`` to the task. For example:

.. code-block:: yaml

  - name: configure hostname
    ios_system:
    provider:
      hostname: foo
      authorize: yes
      auth_pass: "{{ mypasswordvar }}"
  register: result

.. note:: Starting with Ansible 2.5 we recommend using ``connection: network_cli`` and ``become: yes``

Proxy Issues
============

 .. _network_delegate_to_vs_ProxyCommand:

delegate_to vs ProxyCommand
---------------------------

The new connection framework for Network Modules in Ansible 2.3 that uses ``cli`` transport
no longer supports the use of the ``delegate_to`` directive.
In order to use a bastion or intermediate jump host to connect to network devices over ``cli``
transport, network modules now support the use of ``ProxyCommand``.

To use ``ProxyCommand``, configure the proxy settings in the Ansible inventory
file to specify the proxy host.

.. code-block:: ini

    [nxos]
    nxos01
    nxos02

    [nxos:vars]
    ansible_ssh_common_args='-o ProxyCommand="ssh -W %h:%p -q bastion01"'

With the configuration above, simply build and run the playbook as normal with
no additional changes necessary.  The network module will now connect to the
network device by first connecting to the host specified in
``ansible_ssh_common_args``, which is ``bastion01`` in the above example.

You can also set the proxy target for all hosts by using environment variables.

.. code-block:: sh

    export ANSIBLE_SSH_ARGS='-o ProxyCommand="ssh -W %h:%p -q bastion01"'

Using bastion/jump host with netconf connection
-----------------------------------------------

Enabling jump host setting
--------------------------

Bastion/jump host with netconf connection can be enabled by:
 - Setting Ansible variable ``ansible_netconf_ssh_config`` either to ``True`` or custom ssh config file path
 - Setting environment variable ``ANSIBLE_NETCONF_SSH_CONFIG`` to ``True`` or custom ssh config file path
 - Setting ``ssh_config = 1`` or ``ssh_config = <ssh-file-path>`` under ``netconf_connection`` section

If the configuration variable is set to 1 the proxycommand and other ssh variables are read from
default ssh config file (~/.ssh/config).

If the configuration variable is set to file path the proxycommand and other ssh variables are read
from the given custom ssh file path

Example ssh config file (~/.ssh/config)
---------------------------------------

.. code-block:: ini

  Host jumphost
    HostName jumphost.domain.name.com
    User jumphost-user
    IdentityFile "/path/to/ssh-key.pem"
    Port 22

  # Note: Due to the way that Paramiko reads the SSH Config file,
  # you need to specify the NETCONF port that the host uses.
  # i.e. It does not automatically use ansible_port
  # As a result you need either:

  Host junos01
    HostName junos01
    ProxyCommand ssh -W %h:22 jumphost

  # OR

  Host junos01
    HostName junos01
    ProxyCommand ssh -W %h:830 jumphost

  # Depending on the netconf port used.

Example Ansible inventory file

.. code-block:: ini

    [junos]
    junos01

    [junos:vars]
    ansible_connection=netconf
    ansible_network_os=junos
    ansible_user=myuser
    ansible_password=!vault...

.. note:: Using ``ProxyCommand`` with passwords via variables

   By design, SSH doesn't support providing passwords via environment variables.
   This is done to prevent secrets from leaking out, for example in ``ps`` output.

   We recommend using SSH Keys, and if needed an ssh-agent, rather than passwords, where ever possible.

Miscellaneous Issues
====================

Intermittent failure while using ``network_cli`` connection type
----------------------------------------------------------------

If the command prompt received in response is not matched correctly within
the ``network_cli`` connection plugin the task might fail intermittently with truncated
response or with the error message ``operation requires privilege escalation``.
Starting in 2.7.1 a new buffer read timer is added to ensure prompts are matched properly
and a complete response is send in output. The timer default value is 0.2 seconds and
can be adjusted on a per task basis or can be set globally in seconds.

Example Per task timer setting

.. code-block:: yaml

  - name: gather ios facts
    ios_facts:
      gather_subset: all
    register: result
    vars:
      ansible_buffer_read_timeout: 2

To make this a global setting, add the following to your ``ansible.cfg`` file:

.. code-block:: ini

   [persistent_connection]
   buffer_read_timeout = 2

This timer delay per command executed on remote host can be disabled by setting the value to zero.

Task failure due to mismatched error regex within command response using ``network_cli`` connection type
--------------------------------------------------------------------------------------------------------

In Ansible 2.9 and later, the network_cli connection plugin configuration options are added
to handle the stdout and stderr regex to identify if the command execution response consist
of a normal response or an error response. These options can be set group/host variables or as
tasks variables.

Example: For mismatched error response

.. code-block:: yaml

  - name: fetch logs from remote host
    ios_command:
      commands:
        - show logging

Playbook run output:

.. code-block:: console

  TASK [first fetch logs] ********************************************************
  fatal: [ios01]: FAILED! => {
      "changed": false,
      "msg": "RF Name:\r\n\r\n <--nsip-->
             \"IPSEC-3-REPLAY_ERROR: Test log\"\r\n*Aug  1 08:36:18.483: %SYS-7-USERLOG_DEBUG:
              Message from tty578(user id: ansible): test\r\nan-ios-02#"}

Suggestions to resolve:

Modify the error regex for individual task.

.. code-block:: yaml

  - name: fetch logs from remote host
    ios_command:
      commands:
        - show logging
    vars:
      ansible_terminal_stderr_re:
        - pattern: 'connection timed out'
          flags: 're.I'

The terminal plugin regex options ``ansible_terminal_stderr_re`` and ``ansible_terminal_stdout_re`` have
``pattern`` and ``flags`` as keys. The value of the ``flags`` key should be a value that is accepted by
the ``re.compile`` python method.

Intermittent failure while using ``network_cli`` connection type due to slower network or remote target host
------------------------------------------------------------------------------------------------------------

In Ansible 2.9 and later, the ``network_cli`` connection plugin configuration option is added to control
the number of attempts to connect to a remote host. The default number of attempts is three.
After every retry attempt the delay between retries is increased by power of 2 in seconds until either the
maximum attempts are exhausted or either the ``persistent_command_timeout`` or ``persistent_connect_timeout`` timers are triggered.

To make this a global setting, add the following to your ``ansible.cfg`` file:

.. code-block:: ini

   [persistent_connection]
   network_cli_retries = 5


text:
Grafana ships with **advanced support** for Elasticsearch. You can do many types of simple or complex elasticsearch queries to visualize logs or metrics stored in Elasticsearch. You can also annotate your graphs with log events stored in Elasticsearch.

Read more about it here:

[https://grafana.com/docs/grafana/latest/features/datasources/elasticsearch/](https://grafana.com/docs/grafana/latest/features/datasources/elasticsearch/)


text:
/* SPDX-License-Identifier: BSD-2-Clause */
/*******************************************************************************
 * Copyright 2018-2019, Fraunhofer SIT sponsored by Infineon Technologies AG
 * All rights reserved.
 ******************************************************************************/

#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

#include <stdlib.h>

/** Frees a FAPI allocated return buffer.
 *
 * Fapi_Free is a helper function that is a wrapper around free().
 * This allows programs that are built using a different version
 * of the C runtime to free memory that has been allocated by the
 * esys library on Windows.
 *
 * @param[in] ptr A pointer to the object that is to be freed.
 */
void
Fapi_Free(void *ptr)
{
    if (ptr != NULL) {
        free(ptr);
    }
}


text:
package jlibs.util.logging;

import java.io.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.regex.Matcher;

/**
 * @author Santhosh Kumar T
 */
public class LogParser{
    private LogHeaderDefinition definition;
    private Condition condition;
    private LogHandler handler;

    public LogParser(LogHeaderDefinition definition){
        this.definition = definition;
    }

    public void setCondition(Condition condition){
        this.condition = condition;
    }

    public void setHandler(LogHandler handler){
        this.handler = handler;
    }

    public long[] parse(BufferedReader reader) throws IOException{
        long index = 0;
        long selected = 0;
        String line = reader.readLine();
        Matcher recordMatcher;
        StringBuilder message = new StringBuilder();
        while(true){
            message.setLength(0);
            recordMatcher = definition.pattern.matcher(line);
            if(!recordMatcher.find())
                throw new IllegalArgumentException();
            message.append(line.substring(recordMatcher.end()));

            while(true){
                line = reader.readLine();
                if(line!=null && !definition.pattern.matcher(line).find()){
                    message.append('\n');
                    message.append(line);
                }else{
                    LogRecord record = new LogRecord();
                    record.index = index++;
                    record.fields = new String[definition.groupNames.length];
                    for(int i=0; i<record.fields.length; i++)
                        record.fields[i] = recordMatcher.group(i);
                    record.message = message.toString();
                    if(condition.matches(record)){
                        selected++;
                        handler.consume(record);
                    }
                    if(line==null)
                        return new long[]{ index, selected };
                    else
                        break;
                }
            }
        }
    }

    public static void main(String[] args) throws Exception{
        List<String> files = new ArrayList<String>();
        files.addAll(Arrays.asList(args));
        boolean printIndex = files.remove("-printIndex");
        if(files.size()<3){
            System.err.println("Usage:");
            System.err.println("\tjava -jar jlibs-greplog.jar <header-file> <filter-file> [-printIndex] <log-file> ...");
            System.exit(1);
        }

        LogHeaderDefinition definition = LogHeaderDefinition.parse(new File(files.remove(0)));
        Condition condition = ConditionParser.parse(new File(files.remove(0)), definition);
        LogParser parser = new LogParser(definition);
        parser.setCondition(condition);
        parser.setHandler(new LogPrinter(printIndex));

        List<InputStream> logs = new ArrayList<InputStream>(files.size());
        for(String file: files)
            logs.add(new FileInputStream(file));
        SequenceInputStream stream = new SequenceInputStream(Collections.enumeration(logs));
        BufferedReader reader = new BufferedReader(new InputStreamReader(stream));
        long result[] = parser.parse(reader);
        reader.close();
        System.err.println("Selected "+result[1]+" from "+result[0]+" log records");
    }
}


text:
<?php
//============================================================+
// File name   : ron.php
// Begin       : 2004-03-03
// Last Update : 2010-10-26
//
// Description : Language module for TCPDF
//               (contains translated texts)
//               Romanian, Moldavian, Moldovan
//
// Author: Nicola Asuni
//
// (c) Copyright:
//               Nicola Asuni
//               Tecnick.com LTD
//               Manor Coach House, Church Hill
//               Aldershot, Hants, GU12 4RQ
//               UK
//               www.tecnick.com
//               info@tecnick.com
//============================================================+

/**
 * TCPDF language file (contains translated texts).
 * @package com.tecnick.tcpdf
 * @brief TCPDF language file: Romanian, Moldavian, Moldovan
 * @author Nicola Asuni
 * @since 2004-03-03
 */

// Romanian, Moldavian, Moldovan

global $l;
$l = Array();

// PAGE META DESCRIPTORS --------------------------------------

$l['a_meta_charset'] = 'UTF-8';
$l['a_meta_dir'] = 'ltr';
$l['a_meta_language'] = 'ro';

// TRANSLATIONS --------------------------------------
$l['w_page'] = 'pagina';

//============================================================+
// END OF FILE
//============================================================+


text:
 /****************************************************************************
 * Included Files
 ****************************************************************************/
#include <task_manager/task_manager.h>

/**
 * @ingroup Task_Manager
 * @brief User specific broadcast messages are declared at this file.
 * @{
 */

/**
 * @file task_manager/task_manager_broadcast_list.h
 */
#ifndef __TASK_MANAGER_BROADCAST_LIST_H__
#define __TASK_MANAGER_BROADCAST_LIST_H__

/**
 * @brief User specific broadcast message list
 * @details These values can be used for broadcast messages.\n
 * If user wants to add some other types of broadcast message,\n
 * user can add their own broadcast messages at here.\n
 * \n
 * User must avoid setting an arbitrary value to their broadcast message.\n
 * First user specific broadcast message would be set as (TM_BROADCAST_USER_SPECIFIC_MAX + 1).\n
 * Other user specific broadcast messages are automatically set as ascending order.\n
 * An example of a user specific broadcast message is shown below\n
 * \n
 * enum tm_user_specific_broadcast_msg {\n
 *		TM_BROADCAST_USER_SPECIFIC_MIN = TM_BROADCAST_SYSTEM_MSG_MAX,\n
 *		TM_USER_SPECIFIC_BROADCAST_MSG_1,\n
 *		TM_USER_SPECIFIC_BROADCAST_MSG_2,\n
 *		TM_BROADCAST_MSG_MAX,\n
 * };
 */

enum tm_user_specific_broadcast_msg {
	TM_BROADCAST_USER_SPECIFIC_MIN = TM_BROADCAST_SYSTEM_MSG_MAX,

/* Please Add User Specific Broadcast Message at HERE */

	TM_BROADCAST_MSG_MAX,
};
#endif
/**
 * @}
 */


text:
class CustomKeyWorker
  include Sidekiq::Worker

  sidekiq_options throttle: { threshold: 10, period: 1.minute, key: 'winning' }

  def perform(name)
    puts "#{name} is winning!"
  end
end


text:
"""A widget class, which can display information of any kind using a
stack technique.
"""

from datetime import datetime
from Container import Container
from Constants import *
from StyleInformation import StyleInformation
import base

_TIMER = 50

class StatusBar (Container):
    """StatusBar () -> StatusBar

    A widget class, which can display information using a stack.

    The StatusBar widget class can display the current date and info
    messages using a message stack.

    Info messages can be enabled or disabled using the 'tips' attribute
    or show_tips() method. If the tips are enabled, only the topmost
    (at last added) tip will be displayed.

    statusbar.tips = True
    statusbar.show_tips (False)

    The push_tip() method will put the message on the top of the stack,
    while the pop_tip() method will remove the topmost message. If there
    are several messages on the stack, pop_tip() will reveal previously
    added messages, which will be displayed then.

    statusbar.push_tip ('This is a message') # 'This is a message' is shown
    statusbar.push_tip ('Another message')   # 'Another message' is shown
    statusbar.pop_tip ()                     # 'This is a message' is shown

    To get the currently displayed message, the 'current_tip' attribute
    or get_current_tip() method can be used.

    current = statusbar.current_tip
    current = statusbar.get_current_tip ()

    The width of the area, that displays the tips can be adjusted using
    the 'tip_width' attribute or set_tip_width () method.
    If the rendered text exceeds the width of the area, it will be cut down
    to its width.

    statusbar.tip_width = 50
    statusbar.set_tip_width (50)

    Displaying the actual date can be enabled or disabled with the
    'date' attribute or show_date() method.

    statusbar.date = True
    statusbar.show_date (False)

    The display format of it can be adjusted through the 'date_format'
    attribute or set_date_format() method. The format has to be a string
    in a format, which can be understood by the strftime() method.

    statusbar.date_format = '%x'
    statusbar.set_date_format ('%H: %M')

    The current date (which can differ from the displayed one) can be
    fetched through the 'current_date' attribute. Usually the update resolution
    for the date is set to one second. Due to the internal drawing and update
    code it can happen that the the displayed and current date differ by one
    second.

    The width of the area, that displays the date can be adjusted using
    the 'date_width' attribute or set_date_width () method.
    If the rendered date exceeds the width of the area, it will be cut
    down to its width.

    statusbar.date_width = 50
    statusbar.set_date_width (50)

    Additionally you are able to place widgets on the StatusBar through
    the usual Container methods. The widgets will be placed between the
    info message text and the date.

    Note:
    The StatusBar updates itself every 500 ms. Thus you will not have a
    real time clock in the date display, which updates itself correctly
    every second.

    Default action (invoked by activate()):
    None

    Mnemonic action (invoked by activate_mnemonic()):
    None

    Attributes:
    tips         - Indicates, whether the info messages should be shown.
    current_tip  - The current tooltip to display.
    tip_width    - The width of the tip area. Default is 80.
    date         - Indicates, whether the date should be shown.
    current_date - The current date to display.
    date_format  - The display format of the date. Default is '%x %H:%M'
    date_width   - The width of the date area. Default is 90.
    """
    def __init__ (self):
        Container.__init__ (self)

        # Info values.
        self._showtips = True
        self._tips = []
        self._tipwidth = 80

        self._timer = _TIMER

        self._xoffset = 0

        # Date.
        self._showdate = True
        self._dateformat = "%x %H:%M:%S"
        self._datewidth = 90
        self._signals[SIG_TICK] = None

        # Default size.
        self.minsize = 204, 24

    def set_focus (self, focus=True):
        """S.set_focus (focus=True) -> None

        Overrides the set_focus() behaviour for the StatusBar.

        The StatusBar class is not focusable by default.
        """
        return False

    def set_tip_width (self, width):
        """S.set_tip_width (...) -> None

        Sets the width of the tip area.

        Raises a TypeError, if the passed argument is not a positive
        integer.
        """
        if (type (width) != int) or (width < 0):
            raise TypeError ("width must be a positive integer")
        self._tipwidth = width
        self.dirty = True

    def set_date_width (self, width):
        """S.set_date_width (...) -> None

        Sets the width of the date area.

        Raises a TypeError, if the passed argument is not a positive
        integer.
        """
        if (type (width) != int) or (width < 0):
            raise TypeError ("width must be a positive integer")
        self._datewidth = width
        self.dirty = True

    def show_tips (self, show):
        """S.show_tips (...) -> None

        Shows or hides the info message display of the StatusBar.
        """
        if show != self._showtips:
            self._showtips = show
            self.dirty = True

    def show_date (self, show):
        """S.show_date (...) -> None

        Shows or hides the date display of the StatusBar.
        """
        if show != self._showdate:
            self._showdate = show
            self.dirty = True

    def set_date_format (self, format):
        """S.set_date_format (...) -> None

        Sets the display format for the date.

        The passed format string has to be in a format, which can be
        understood by the strftime() method.
        """
        self._dateformat = format
        self.dirty = True

    def get_current_tip (self):
        """S.get_current_tip () -> string or unicode

        Gets the current info message to display.
        """
        length = len (self._tips)
        if length > 0:
            return self._tips[length - 1]
        return ""

    def push_tip (self, tip):
        """S.push_tip (...) -> None

        Puts a info message on the queue of the StatusBar.

        Raises a TypeError, if the passed argument is not a string or
        unicode.
        """
        if type (tip) not in (str, unicode):
            raise TypeError ("tip must be a string or unicode")
        self._tips.append (tip)
        self.dirty = True

    def pop_tip (self):
        """S.pop_tip () -> None

        Removes the last info message from the StatusBar queue.
        """
        if len (self._tips) > 0:
            self._tips.pop ()
            self.dirty = True

    def calculate_size (self):
        """S.calculate_size () -> int, int.

        Calculates the size needed by the children.

        Calculates the size needed by the children and returns the
        resulting width and height.
        """
        border = base.GlobalStyle.get_border_size \
                 (self.__class__, self.style,
                  StyleInformation.get ("STATUSBAR_BORDER"))
        width = 2 * (border + self.padding)
        height = 0
        spacing = self.spacing

        for widget in self.children:
            width += widget.width + spacing
            if widget.height > height:
                height = widget.height
        height += 2 * (border + self.padding)

        # Add width for the tips and date.
        if self.tips:
            width += self.tip_width
            if self.date:
                width += self.spacing
        if self.date:
            width += self.date_width
        if not self.tips and not self.date:
            width -= self.spacing

        return width, height

    def dispose_widgets (self):
        """S.dispose_widgets (...) -> None

        Moves the children of the StatusBar to their correct positions.
        """

        border = base.GlobalStyle.get_border_size \
                 (self.__class__, self.style,
                  StyleInformation.get ("STATUSBAR_BORDER"))
        padding = self.padding
        spacing = self.spacing
        diff = (self.height - 2 * (border + padding)) / 2

        x = self._xoffset
        addy = border + padding + diff

        for widget in self.children:
            y = border + padding + diff - widget.height / 2
            y = addy - widget.height / 2
            widget.topleft = (x, y)
            x += widget.width + spacing

    def notify (self, event):
        """S.notify (...) -> None

        Notifies the StatusBar about an event.
        """
        if event.signal == SIG_TICK:
            if self._timer == 0:
                self._timer = _TIMER
                if self.date:
                    self.dirty = True
            self._timer -= 1

    def draw_bg (self):
        """S.draw_bg () -> Surface

        Draws the background surface of the StatusBar and returns it.

        Creates the visible surface of the StatusBar and returns it to
        the caller.
        """
        return base.GlobalStyle.engine.draw_statusbar (self)

    def draw (self):
        """S.draw () -> None

        Draws the StatusBar surface and places its children on it.
        """
        Container.draw (self)

        cls = self.__class__
        style = base.GlobalStyle
        border = style.get_border_size \
                 (cls, self.style, StyleInformation.get ("STATUSBAR_BORDER"))
        blit = self.image.blit
        rect = self.image.get_rect()

        self._xoffset = self.padding + border
        # Draw the current tip.
        if self.tips:
            surface_tip = style.engine.draw_string (self.current_tip,
                                                    self.state, cls,
                                                    self.style)
            r = surface_tip.get_rect ()
            r.x = self._xoffset
            r.centery = rect.centery
            blit (surface_tip, r, (0, 0, self.tip_width, r.height))
            self._xoffset += self.tip_width + self.spacing

        # Place the children of the StatusBar and blit them.
        self.dispose_widgets ()
        for widget in self.children:
            blit (widget.image, widget.rect)

        # Draw the date.
        if self.date:
            surface_date = style.engine.draw_string (self.current_date,
                                                     self.state, cls,
                                                     self.style)
            r = surface_date.get_rect ()
            r.right = rect.right - border - self.padding
            r.centery = rect.centery
            blit (surface_date, r, (0, 0, self._datewidth, r.height))

    tips = property (lambda self: self._showtips,
                     lambda self, var: self.show_tips (var),
                     doc = "Indicates, whether the tooltips should be shown.")
    tip_width = property (lambda self: self._tipwidth,
                          lambda self, var: self.set_tip_width (var),
                          doc = "The width of the tip area.")
    date = property (lambda self: self._showdate,
                     lambda self, var: self.show_date (var),
                     doc = "Indicates, whether the date should be shown.")
    date_width = property (lambda self: self._datewidth,
                           lambda self, var: self.set_date_width (var),
                           doc = "The width of the date area.")
    current_tip = property (lambda self: self.get_current_tip (),
                            doc = "The current tooltip to display.")
    current_date = property (lambda self: datetime.now ().strftime \
                             (self._dateformat),
                             doc = "The current date to display.")
    date_format = property (lambda self: self._dateformat,
                            lambda self, var: self.set_date_format (var),
                            doc = "Sets the display format of the date.")


text:
* A project without documentation is like a project that doesn't exist
* Code should be modular, and code documention should be as modular as the code it describes.
* A lot of the documentation on READMEs is boilerplate, why repeat the work to re-write it every time?


text:
<!DOCTYPE html>

		<meta charset="utf-8" />

		<title>Master Slider Showcase2 Template</title>
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />

		<link rel="stylesheet" href="../masterslider/style/masterslider.css" />

		<link href="../masterslider/skins/default/style.css" rel='stylesheet' type='text/css'>

		<link href='style/ms-showcase2.css' rel='stylesheet' type='text/css'>


text:
// Copyright (C) 2002-2008 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine" and the "irrXML" project.
// For conditions of distribution and use, see copyright notice in irrlicht.h and irrXML.h

#ifndef __IRR_ARRAY_H_INCLUDED__
#define __IRR_ARRAY_H_INCLUDED__

#include "irrTypes.h"
#include "heapsort.h"
#include "irrAllocator.h"

namespace irr
{
namespace core
{

//! Self reallocating template array (like stl vector) with additional features.
/** Some features are: Heap sorting, binary search methods, easier debugging.
*/
template <class T, typename TAlloc = irrAllocator<T> >
class array
{

public:

	//! Default constructor for empty array.
	array()
		: data(0), allocated(0), used(0),
			free_when_destroyed(true), is_sorted(true)
	{
	}

	//! Constructs an array and allocates an initial chunk of memory.
	/** \param start_count Amount of elements to pre-allocate. */
	array(u32 start_count)
		: data(0), allocated(0), used(0),
			free_when_destroyed(true), is_sorted(true)
	{
		reallocate(start_count);
	}

	//! Copy constructor
	array(const array<T>& other)
		: data(0)
	{
		*this = other;
	}

	//! Destructor.
	/** Frees allocated memory, if set_free_when_destroyed was not set to
	false by the user before. */
	~array()
	{
		if (free_when_destroyed)
		{
			for (u32 i=0; i<used; ++i)
				allocator.destruct(&data[i]);

			allocator.deallocate(data);
		}
	}

	//! Reallocates the array, make it bigger or smaller.
	/** \param new_size New size of array. */
	void reallocate(u32 new_size)
	{
		T* old_data = data;

		data = allocator.allocate(new_size); //new T[new_size];
		allocated = new_size;

		// copy old data
		s32 end = used < new_size ? used : new_size;

		for (s32 i=0; i<end; ++i)
		{
			// data[i] = old_data[i];
			allocator.construct(&data[i], old_data[i]);
		}

		// destruct old data
		for (u32 j=0; j<used; ++j)
			allocator.destruct(&old_data[j]);

		if (allocated < used)
			used = allocated;

		allocator.deallocate(old_data); //delete [] old_data;
	}

	//! Adds an element at back of array.
	/** If the array is too small to add this new element it is made bigger.
	\param element: Element to add at the back of the array. */
	void push_back(const T& element)
	{
		if (used + 1 > allocated)
		{
			// reallocate(used * 2 +1);
			// this doesn't work if the element is in the same array. So
			// we'll copy the element first to be sure we'll get no data
			// corruption

			T e(element);
			reallocate(used * 2 +1); // increase data block

			allocator.construct(&data[used++], e); // data[used++] = e; // push_back
		}
		else
		{
			//data[used++] = element;
			// instead of using this here, we copy it the safe way:
			allocator.construct(&data[used++], element);
		}

		is_sorted = false;
	}

	//! Adds an element at the front of the array.
	/** If the array is to small to add this new element, the array is
	made bigger. Please note that this is slow, because the whole array
	needs to be copied for this.
	\param element Element to add at the back of the array. */
	void push_front(const T& element)
	{
		insert(element);
	}

	//! Insert item into array at specified position.
	/** Please use this only if you know what you are doing (possible
	performance loss). The preferred method of adding elements should be
	push_back().
	\param element: Element to be inserted
	\param index: Where position to insert the new element. */
	void insert(const T& element, u32 index=0)
	{
		_IRR_DEBUG_BREAK_IF(index>used) // access violation

		if (used + 1 > allocated)
			reallocate(used +1);

		for (u32 i=used; i>index; --i)
		{
			if (i<used)
				allocator.destruct(&data[i]);
			allocator.construct(&data[i], data[i-1]); // data[i] = data[i-1];
		}

		if (used > index)
			allocator.destruct(&data[index]);
		allocator.construct(&data[index], element); // data[index] = element;
		is_sorted = false;
		++used;
	}

	//! Clears the array and deletes all allocated memory.
	void clear()
	{
		for (u32 i=0; i<used; ++i)
			allocator.destruct(&data[i]);

		allocator.deallocate(data); // delete [] data;
		data = 0;
		used = 0;
		allocated = 0;
		is_sorted = true;
	}

	//! Sets pointer to new array, using this as new workspace.
	/** \param newPointer: Pointer to new array of elements.
	\param size: Size of the new array. */
	void set_pointer(T* newPointer, u32 size)
	{
		for (u32 i=0; i<used; ++i)
			allocator.destruct(&data[i]);

		allocator.deallocate(data); // delete [] data;
		data = newPointer;
		allocated = size;
		used = size;
		is_sorted = false;
	}

	//! Sets if the array should delete the memory it uses upon destruction.
	/** \param f If true, the array frees the allocated memory in its
	destructor, otherwise not. The default is true. */
	void set_free_when_destroyed(bool f)
	{
		free_when_destroyed = f;
	}

	//! Sets the size of the array and allocates new elements if necessary.
	/** Please note: This is only secure when using it with simple types,
	because no default constructor will be called for the added elements.
	\param usedNow Amount of elements now used. */
	void set_used(u32 usedNow)
	{
		if (allocated < usedNow)
			reallocate(usedNow);

		used = usedNow;
	}

	//! Assignment operator
	void operator=(const array<T>& other)
	{
		if (data)
		{
			for (u32 i=0; i<used; ++i)
				allocator.destruct(&data[i]);

			allocator.deallocate(data); // delete [] data;
		}

		//if (allocated < other.allocated)
		if (other.allocated == 0)
			data = 0;
		else
			data = allocator.allocate(other.allocated); // new T[other.allocated];

		used = other.used;
		free_when_destroyed = other.free_when_destroyed;
		is_sorted = other.is_sorted;
		allocated = other.allocated;

		for (u32 i=0; i<other.used; ++i)
			allocator.construct(&data[i], other.data[i]); // data[i] = other.data[i];
	}

	//! Equality operator
	bool operator == (const array<T>& other) const
	{
		if (used != other.used)
			return false;

		for (u32 i=0; i<other.used; ++i)
			if (data[i] != other[i])
				return false;
		return true;
	}

	//! Inequality operator
	bool operator != (const array<T>& other) const
	{
		return !(*this==other);
	}

	//! Direct access operator
	T& operator [](u32 index)
	{
		_IRR_DEBUG_BREAK_IF(index>=used) // access violation

		return data[index];
	}

	//! Direct const access operator
	const T& operator [](u32 index) const
	{
		_IRR_DEBUG_BREAK_IF(index>=used) // access violation

		return data[index];
	}

	//! Gets last element.
	T& getLast()
	{
		_IRR_DEBUG_BREAK_IF(!used) // access violation

		return data[used-1];
	}

	//! Gets last element
	const T& getLast() const
	{
		_IRR_DEBUG_BREAK_IF(!used) // access violation

		return data[used-1];
	}

	//! Gets a pointer to the array.
	/** \return Pointer to the array. */
	T* pointer()
	{
		return data;
	}

	//! Gets a const pointer to the array.
	/** \return Pointer to the array. */
	const T* const_pointer() const
	{
		return data;
	}

	//! Get size of array.
	/** \return Size of elements used in the array. */
	u32 size() const
	{
		return used;
	}

	//! Get amount of memory allocated.
	/** \return Amount of memory allocated. The amount of bytes
	allocated would be allocated_size() * sizeof(ElementsUsed); */
	u32 allocated_size() const
	{
		return allocated;
	}

	//! Check if array is empty.
	/** \return True if the array is empty false if not. */
	bool empty() const
	{
		return used == 0;
	}

	//! Sorts the array using heapsort.
	/** There is no additional memory waste and the algorithm performs
	O(n*log n) in worst case. */
	void sort()
	{
		if (is_sorted || used<2)
			return;

		heapsort(data, used);
		is_sorted = true;
	}

	//! Performs a binary search for an element, returns -1 if not found.
	/** The array will be sorted before the binary search if it is not
	already sorted.
	\param element Element to search for.
	\return Position of the searched element if it was found,
	otherwise -1 is returned. */
	s32 binary_search(const T& element)
	{
		sort();
		return binary_search(element, 0, used-1);
	}

	//! Performs a binary search for an element, returns -1 if not found.
	/** The array must be sorted prior
	\param element Element to search for.
	\return Position of the searched element if it was found, otherwise -1
	is returned. */
	s32 binary_search_const(const T& element) const
	{
		return binary_search(element, 0, used-1);
	}

	//! Performs a binary search for an element, returns -1 if not found.
	/** \param element: Element to search for.
	\param left First left index
	\param right Last right index.
	\return Position of the searched element if it was found, otherwise -1
	is returned. */
	s32 binary_search(const T& element, s32 left, s32 right) const
	{
		if (!used)
			return -1;

		s32 m;

		do
		{
			m = (left+right)>>1;

			if (element < data[m])
				right = m - 1;
			else
				left = m + 1;

		} while((element < data[m] || data[m] < element) && left<=right);

		// this last line equals to:
		// " while((element != array[m]) && left<=right);"
		// but we only want to use the '<' operator.
		// the same in next line, it is "(element == array[m])"

		if (!(element < data[m]) && !(data[m] < element))
			return m;

		return -1;
	}

	//! Finds an element in linear time, which is very slow.
	/** Use binary_search for faster finding. Only works if ==operator is
	implemented.
	\param element Element to search for.
	\return Position of the searched element if it was found, otherwise -1
	is returned. */
	s32 linear_search(const T& element) const
	{
		for (u32 i=0; i<used; ++i)
			if (element == data[i])
				return (s32)i;

		return -1;
	}

	//! Finds an element in linear time, which is very slow.
	/** Use binary_search for faster finding. Only works if ==operator is
	implemented.
	\param element: Element to search for.
	\return Position of the searched element if it was found, otherwise -1
	is returned. */
	s32 linear_reverse_search(const T& element) const
	{
		for (s32 i=used-1; i>=0; --i)
			if (data[i] == element)
				return i;

		return -1;
	}

	//! Erases an element from the array.
	/** May be slow, because all elements following after the erased
	element have to be copied.
	\param index: Index of element to be erased. */
	void erase(u32 index)
	{
		_IRR_DEBUG_BREAK_IF(index>=used) // access violation

		for (u32 i=index+1; i<used; ++i)
		{
			allocator.destruct(&data[i-1]);
			allocator.construct(&data[i-1], data[i]); // data[i-1] = data[i];
		}

		allocator.destruct(&data[used-1]);

		--used;
	}

	//! Erases some elements from the array.
	/** May be slow, because all elements following after the erased
	element have to be copied.
	\param index: Index of the first element to be erased.
	\param count: Amount of elements to be erased. */
	void erase(u32 index, s32 count)
	{
		_IRR_DEBUG_BREAK_IF(index>=used || count<1 || index+count>used) // access violation

		u32 i;
		for (i=index; i<index+count; ++i)
			allocator.destruct(&data[i]);

		for (i=index+count; i<used; ++i)
		{
			if (i > index+count)
				allocator.destruct(&data[i-count]);

			allocator.construct(&data[i-count], data[i]); // data[i-count] = data[i];

			if (i >= used-count)
				allocator.destruct(&data[i]);
		}

		used-= count;
	}

	//! Sets if the array is sorted
	void set_sorted(bool _is_sorted)
	{
		is_sorted = _is_sorted;
	}

	private:

		T* data;
		u32 allocated;
		u32 used;
		bool free_when_destroyed;
		bool is_sorted;
		TAlloc allocator;
};

} // end namespace core
} // end namespace irr

#endif


text:
<?php
/**
 * Created by PhpStorm.
 * User: tsp-admin
 * Date: 1/26/16
 * Time: 11:30 AM
 */

namespace QCharts\CoreBundle\Service\Directory;

use Doctrine\DBAL\DBALException;
use Doctrine\ORM\EntityRepository;
use QCharts\CoreBundle\Entity\Directory;
use QCharts\CoreBundle\Exception\DatabaseException;
use QCharts\CoreBundle\Exception\DirectoryNotEmptyException;
use QCharts\CoreBundle\Exception\NotFoundException;
use QCharts\CoreBundle\Exception\OverlappingException;
use QCharts\CoreBundle\Exception\TypeNotValidException;
use QCharts\CoreBundle\Repository\DirectoryRepository;
use QCharts\CoreBundle\Service\ServiceInterface\SerializationServiceInterface;
use Symfony\Component\Form\FormInterface;

class DirectoryService
{
    /** @var DirectoryRepository $repository */
    private $repository;
    /** @var SerializationServiceInterface $serializer */
    private $serializer;

    /**
     * DirectoryService constructor.
     * @param EntityRepository $repository
     * @param SerializationServiceInterface $serializationServiceInterface
     */
    public function __construct(
        EntityRepository $repository,
        SerializationServiceInterface $serializationServiceInterface
    ) {
        $this->repository = $repository;
        $this->serializer = $serializationServiceInterface;
    }

    /**
     * @param FormInterface $form
     * @throws DBALException
     * @throws \Exception
     */
    public function add(FormInterface $form)
    {
        /** @var Directory $directory */
        $directory = $form->getData();
        try
        {
            $this->repository->safeSave($directory);
        }
        catch (TypeNotValidException $e)
        {
            throw $e;
        }
        catch (DBALException $e)
        {
            throw $e;
        }

    }

    /**
     * @param FormInterface $form
     * @return int
     * @throws NotFoundException
     * @throws OverlappingException
     */
    public function edit(FormInterface $form)
    {
        try
        {
            /** @var Directory $dir */
            $dir = $form->getData();
            $this->repository->safeSave($dir);
            $parentId = ($dir->getParent()) ? $dir->getParent()->getId() : null;

            return $parentId;
        }
        catch(OverlappingException $e)
        {
            throw $e;
        }
    }

    /**
     * @param $directoryId
     * @return int|null
     * @throws DatabaseException
     * @throws DirectoryNotEmptyException
     * @throws NotFoundException
     */
    public function delete($directoryId)
    {
        try
        {
            $this->repository->directoryExists($directoryId);
            /** @var Directory $dir */
            $dir = $this->repository->find($directoryId);
            $parent = $dir->getParent();
            $parentId = ($parent) ? $parent->getId() : null;
            $this->repository->safeDelete($dir);
            return $parentId;
        }
        catch (NotFoundException $e)
        {
            throw $e;
        }
        catch (DirectoryNotEmptyException $e)
        {
            throw $e;
        }
        catch (DBALException $e)
        {
            $text = "Error encountered in the database: {$e->getMessage()}";
            throw new DatabaseException($text, $e->getCode(), $e);
        }
    }

    /**
     * @param $directoryId
     * @return bool
     */
    public function isDirectoryIdValid($directoryId)
    {
        $dir = $this->repository->find($directoryId);
        return !is_null($dir);
    }

    /**
     * @param $dirId
     * @return Directory
     */
    public function getDirectory($dirId)
    {
        return $this->repository->find($dirId);
    }

    /**
     * @param null $rootDirectoryId
     * @return array|mixed
     * @throws TypeNotValidException
     */
    public function getDirectories($rootDirectoryId = null)
    {
        $directories = $this->repository->getArchivesUnder($rootDirectoryId);

        $directories = [
            "directories" => $directories,
            "root" => (!is_null($rootDirectoryId)) ? $this->repository->find($rootDirectoryId) : null
        ];

        return $directories;
    }

}


text:
package org.lpw.ranch.chrome;

import org.lpw.tephra.ctrl.context.Request;
import org.lpw.tephra.ctrl.context.Response;
import org.lpw.tephra.ctrl.execute.Execute;
import org.lpw.tephra.ctrl.template.Templates;
import org.lpw.tephra.ctrl.validate.Validate;
import org.lpw.tephra.ctrl.validate.Validators;
import org.lpw.tephra.util.Coder;
import org.lpw.tephra.util.Context;
import org.lpw.tephra.util.Generator;
import org.lpw.tephra.util.Message;
import org.lpw.tephra.util.Validator;
import org.springframework.stereotype.Controller;

import javax.inject.Inject;

/**
 * @author lpw
 */
@Controller(ChromeModel.NAME + ".ctrl")
@Execute(name = "/chrome/", key = ChromeModel.NAME, code = "129")
public class ChromeCtrl {
    @Inject
    private Validator validator;
    @Inject
    private Context context;
    @Inject
    private Coder coder;
    @Inject
    private Generator generator;
    @Inject
    private Message message;
    @Inject
    private Request request;
    @Inject
    private Templates templates;
    @Inject
    private Response response;
    @Inject
    private ChromeService chromeService;

    @Execute(name = "query", validates = {
            @Validate(validator = Validators.SIGN)
    })
    public Object query() {
        return chromeService.query(request.get("key"), request.get("name"));
    }

    @Execute(name = "save", validates = {
            @Validate(validator = Validators.NOT_EMPTY, parameter = "key", failureCode = 1),
            @Validate(validator = Validators.MAX_LENGTH, number = {100}, parameter = "key", failureCode = 2),
            @Validate(validator = Validators.MAX_LENGTH, number = {100}, parameter = "name", failureCode = 3),
            @Validate(validator = Validators.MAX_LENGTH, number = {100}, parameter = "pages", failureCode = 4),
            @Validate(validator = Validators.MAX_LENGTH, number = {100}, parameter = "filename", failureCode = 5),
            @Validate(validator = Validators.SIGN)
    })
    public Object save() {
        return chromeService.save(request.setToModel(ChromeModel.class));
    }

    @Execute(name = "delete", validates = {
            @Validate(validator = Validators.SIGN)
    })
    public Object delete() {
        chromeService.delete(request.get("id"));

        return "";
    }

    @Execute(name = "pdf-async", validates = {
            @Validate(validator = Validators.NOT_EMPTY, parameter = "key", failureCode = 1),
            @Validate(validator = Validators.NOT_EMPTY, parameter = "url", failureCode = 6),
            @Validate(validator = ChromeService.VALIDATOR_KEY_EXISTS, parameter = "key", failureCode = 7)
    })
    public Object pdfAsync() {
        return chromeService.pdf(request.get("key"), request.get("url"), request.getAsInt("width"),
                request.getAsInt("height"), request.get("pages"), request.getAsInt("wait"), request.getMap());
    }

    @Execute(name = "pdf", type = Templates.STREAM, validates = {
            @Validate(validator = Validators.NOT_EMPTY, parameter = "key", failureCode = 1),
            @Validate(validator = Validators.NOT_EMPTY, parameter = "url", failureCode = 6),
            @Validate(validator = ChromeService.VALIDATOR_KEY_EXISTS, parameter = "key", failureCode = 7)
    })
    public Object pdf() {
        byte[] pdf = chromeService.pdf(request.get("key"), request.get("url"), request.getAsInt("width"),
                request.getAsInt("height"), request.get("pages"), request.getAsInt("wait"));
        if (pdf == null)
            return templates.get().failure(2911, message.get(ChromeModel.NAME + ".pdf.null"), null, null);

        String filename = request.get("filename");
        if (validator.isEmpty(filename))
            filename = chromeService.findByKey(request.get("key")).getFilename();
        if (validator.isEmpty(filename))
            filename = generator.random(32);
        response.setHeader("Content-Disposition", "attachment; filename*=" + context.getCharset(null)
                + "''" + coder.encodeUrl(filename, null) + ".pdf");
        response.setContentType("application/pdf");

        return pdf;
    }

    @Execute(name = "png", type = Templates.STREAM, validates = {
            @Validate(validator = Validators.NOT_EMPTY, parameter = "key", failureCode = 1),
            @Validate(validator = Validators.NOT_EMPTY, parameter = "url", failureCode = 6),
            @Validate(validator = ChromeService.VALIDATOR_KEY_EXISTS, parameter = "key", failureCode = 7)
    })
    public Object png() {
        byte[] png = chromeService.png(request.get("key"), request.get("url"), request.getAsInt("x"), request.getAsInt("y"),
                request.getAsInt("width"), request.getAsInt("height"), request.getAsInt("wait"));
        if (png == null)
            return templates.get().failure(2912, message.get(ChromeModel.NAME + ".png.null"), null, null);

        response.setContentType("image/png");

        return png;
    }

    @Execute(name = "jpg", type = Templates.STREAM, validates = {
            @Validate(validator = Validators.NOT_EMPTY, parameter = "key", failureCode = 1),
            @Validate(validator = Validators.NOT_EMPTY, parameter = "url", failureCode = 6),
            @Validate(validator = ChromeService.VALIDATOR_KEY_EXISTS, parameter = "key", failureCode = 7)
    })
    public Object jpg() {
        byte[] jpg = chromeService.jpg(request.get("key"), request.get("url"), request.getAsInt("x"), request.getAsInt("y"),
                request.getAsInt("width"), request.getAsInt("height"), request.getAsInt("wait"));
        if (jpg == null)
            return templates.get().failure(2913, message.get(ChromeModel.NAME + ".jpg.null"), null, null);

        response.setContentType("image/jpeg");

        return jpg;
    }
}


text:
FROM centos:6

RUN yum install -y epel-release && yum update -y
RUN yum install -y bash-completion
RUN yum install -y bison
RUN yum install -y ccache
RUN yum install -y centos-release-scl
RUN yum install -y cmake
RUN yum install -y devtoolset-4-toolchain
RUN yum install -y emacs
RUN yum install -y flex
RUN yum install -y git
RUN yum install -y htop
RUN yum install -y iftop
RUN yum install -y iotop
RUN yum install -y nasm
RUN yum install -y php-devel
RUN yum install -y redhat-lsb-core
RUN yum install -y scons
RUN yum install -y sudo
RUN yum install -y wget
RUN yum update -y

RUN printf "\n" >> "/etc/profile"
RUN printf "source /opt/rh/devtoolset-4/enable\n" >> "/etc/profile"
RUN printf "\n" >> "/etc/profile"

RUN mkdir /tmp/build
ADD bison-2.5.1.tar.gz /tmp/build
ADD install_packages.sh /tmp/build/
RUN /tmp/build/install_packages.sh
RUN rm -rf /tmp/build


text:
sudo apt-get install software-properties-common
sudo apt-add-repository ppa:ansible/ansible
sudo apt-get update
sudo apt-get install ansible aptitude

# add "--connection=local" to run it in your local desktop
ansible-playbook -v -i ansible_hosts -l local ddbox.yml $1


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

    <string name="app_name">Moments</string>
    <string name="share_subject">Watch This. It\'s Live!</string>

    <string-array name="camera_filter_names">
        <item>Normal</item>
        <item>Black & white</item>
        <item>Night Mode</item>
        <item>Chroma Key</item>
        <item>Blur</item>
        <item>Sharpen</item>
        <item>Edge detect</item>
        <item>Emboss</item>
        <item>Squeeze</item>
        <item>Twirl</item>
        <item>Tunnel</item>
        <item>Bulge</item>
        <item>Dent</item>
        <item>Fisheye</item>
        <item>Stretch</item>
        <item>Mirror</item>
    </string-array>

    <string-array name="camera_names">
        <item>Rear</item>
        <item>Front</item>
    </string-array>

    <string name="record">Record</string>
    <string name="stop">Stop</string>
    <string name="live">LIVE</string>
    <string name="share_broadcast">Share Broadcast</string>
    <string name="buffering">Buffering...</string>
    <string name="title_activity_broadcast">BroadcastActivity</string>
    <string name="action_settings">Settings</string>
    <string name="effects_chooser_title">Effects</string>
    <string name="error_no_recorderconfig">You must provide a RecorderConfig object before starting the BroadcastActivity. See Kickflip#setRecorderConfig</string>
    <string name="error_no_broadcastlistener">You must provide a BroadcastListener</string>

    <string name="action_broadcast">Broadcast</string>
    <string name="fetch_oauth_creds">Fetch OAuth Credentials</string>

    <string name="no_network">Unable to contact the server</string>
    <string name="no_broadcasts">You don\'t have any broadcasts… yet!</string>
    <string name="stream_flagged">Stream flagged</string>
    <string name="dialog_title_not_ready">One Sec...</string>
    <string name="dialog_msg_not_ready">We\'re still registering your Kickflip account. Try again in a few seconds.</string>
    <string name="dialog_ok">Ok</string>
    <string name="facebook_app_id">APP_ID</string>
    <string-array name="settingsOptions">
        <item>My friends</item>
        <item>My Moments</item>
        <item>Share</item>
        <item>Logout</item>

    </string-array>
    <string name="shareAppInformation">Check out Moments. An app for live broadcasting to your friends. Download the app for iPhone http://tinyurl.com/nw6jlzn or Android http://tinyurl.com/oqb94nd</string>
    <string name="shareAppDialogTitle">Share Moments</string>
    <string name="missedCallNotification">Missed live moments from</string>
    <string name="missedCallNotificationTitle">just broadcasted a moment</string>
    <string name="sharingLiveMoments">Sharing live moments...</string>
    <string name="buttonPass">PASS</string>
    <string name="buttonWatch">WATCH</string>
    <string name="loginWithFB">Login with Facebook</string>
    <string name="termsOfServices">By continuing you indicate to have read and agreed on the Terms of Services</string>
    <string name="notifyingFriends">Notifying friends...</string>
    <string name="watching">watching</string>
    <string name="saySomething">Say something...</string>
    <string name="postOn">Post: On</string>
    <string name="postOff">Post: Off</string>
    <string name="somewhereIn">Somewhere in</string>
    <string name="blockUser">Block friend</string>
    <string name="unblockUser">Unblock friend</string>
    <string name="blocked">Blocked</string>
    <string name="newFriend">NEW</string>
    <string name="userBlockedSuccessfully">was blocked successfully.</string>
    <string name="userUnblockedSuccessfully">was unblocked successfully.</string>
    <string name="broadcastStartedComment">Broadcast has begun.</string>
    <string name="endBroadcastConfirmation">Are you sure you want to end the moment?</string>
    <string name="yes">Yes</string>
    <string name="no">No</string>
    <string name="missingPrivilegesInformation">Your account is missing some privileges, please re-login.</string>
    <string name="startBroadcast">Start broadcast</string>
    <string name="noInternetConnection">No internet connection...</string>
    <string name="broadcastingEnded">Broadcasting ended</string>
    <string name="watcherJoined">joined</string>
    <string name="watcherLeft">left</string>
    <string name="tryingToReconnect">Trying to reconnect...</string>
    <string name="bandwidthTooLow">Bandwidth too low,\ntrying to reconnect</string>
    <string name="cancel">Cancel</string>
    <string name="ignore">Ignore</string>
    <string name="retry">Retry</string>
    <string name="replay">Replay</string>
    <string name="deleteStreamConfirmation">Are you sure you want to delete your moment?</string>
    <string name="isLiveSuffix">is LIVE</string>
    <string name="unknownError">Server error occurred</string>
</resources>


text:
<?xml version="1.0" encoding="UTF-8"?>
<spirit:component xmlns:xilinx="http://www.xilinx.com" xmlns:spirit="http://www.spiritconsortium.org/XMLSchema/SPIRIT/1685-2009" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <spirit:vendor>xilinx.com</spirit:vendor>
  <spirit:library>user</spirit:library>
  <spirit:name>vga_rgb888_pack</spirit:name>
  <spirit:version>1.0</spirit:version>
  <spirit:model>
    <spirit:views>
      <spirit:view>
        <spirit:name>xilinx_anylanguagesynthesis</spirit:name>
        <spirit:displayName>Synthesis</spirit:displayName>
        <spirit:envIdentifier>:vivado.xilinx.com:synthesis</spirit:envIdentifier>
        <spirit:language>VHDL</spirit:language>
        <spirit:modelName>vga_rgb888_pack</spirit:modelName>
        <spirit:fileSetRef>
          <spirit:localName>xilinx_anylanguagesynthesis_view_fileset</spirit:localName>
        </spirit:fileSetRef>
        <spirit:parameters>
          <spirit:parameter>
            <spirit:name>viewChecksum</spirit:name>
            <spirit:value>07c13af7</spirit:value>
          </spirit:parameter>
        </spirit:parameters>
      </spirit:view>
      <spirit:view>
        <spirit:name>xilinx_anylanguagebehavioralsimulation</spirit:name>
        <spirit:displayName>Simulation</spirit:displayName>
        <spirit:envIdentifier>:vivado.xilinx.com:simulation</spirit:envIdentifier>
        <spirit:language>VHDL</spirit:language>
        <spirit:modelName>vga_rgb888_pack</spirit:modelName>
        <spirit:fileSetRef>
          <spirit:localName>xilinx_anylanguagebehavioralsimulation_view_fileset</spirit:localName>
        </spirit:fileSetRef>
        <spirit:parameters>
          <spirit:parameter>
            <spirit:name>viewChecksum</spirit:name>
            <spirit:value>07c13af7</spirit:value>
          </spirit:parameter>
        </spirit:parameters>
      </spirit:view>
      <spirit:view>
        <spirit:name>xilinx_xpgui</spirit:name>
        <spirit:displayName>UI Layout</spirit:displayName>
        <spirit:envIdentifier>:vivado.xilinx.com:xgui.ui</spirit:envIdentifier>
        <spirit:fileSetRef>
          <spirit:localName>xilinx_xpgui_view_fileset</spirit:localName>
        </spirit:fileSetRef>
        <spirit:parameters>
          <spirit:parameter>
            <spirit:name>viewChecksum</spirit:name>
            <spirit:value>f64a5dae</spirit:value>
          </spirit:parameter>
        </spirit:parameters>
      </spirit:view>
    </spirit:views>
    <spirit:ports>
      <spirit:port>
        <spirit:name>rgb888</spirit:name>
        <spirit:wire>
          <spirit:direction>in</spirit:direction>
          <spirit:vector>
            <spirit:left spirit:format="long">23</spirit:left>
            <spirit:right spirit:format="long">0</spirit:right>
          </spirit:vector>
          <spirit:wireTypeDefs>
            <spirit:wireTypeDef>
              <spirit:typeName>std_logic_vector</spirit:typeName>
              <spirit:viewNameRef>xilinx_anylanguagesynthesis</spirit:viewNameRef>
              <spirit:viewNameRef>xilinx_anylanguagebehavioralsimulation</spirit:viewNameRef>
            </spirit:wireTypeDef>
          </spirit:wireTypeDefs>
        </spirit:wire>
      </spirit:port>
      <spirit:port>
        <spirit:name>data</spirit:name>
        <spirit:wire>
          <spirit:direction>out</spirit:direction>
          <spirit:vector>
            <spirit:left spirit:format="long">31</spirit:left>
            <spirit:right spirit:format="long">0</spirit:right>
          </spirit:vector>
          <spirit:wireTypeDefs>
            <spirit:wireTypeDef>
              <spirit:typeName>std_logic_vector</spirit:typeName>
              <spirit:viewNameRef>xilinx_anylanguagesynthesis</spirit:viewNameRef>
              <spirit:viewNameRef>xilinx_anylanguagebehavioralsimulation</spirit:viewNameRef>
            </spirit:wireTypeDef>
          </spirit:wireTypeDefs>
        </spirit:wire>
      </spirit:port>
    </spirit:ports>
  </spirit:model>
  <spirit:fileSets>
    <spirit:fileSet>
      <spirit:name>xilinx_anylanguagesynthesis_view_fileset</spirit:name>
      <spirit:file>
        <spirit:name>vga_rgb888_pack.vhd</spirit:name>
        <spirit:fileType>vhdlSource</spirit:fileType>
        <spirit:userFileType>CHECKSUM_07c13af7</spirit:userFileType>
      </spirit:file>
    </spirit:fileSet>
    <spirit:fileSet>
      <spirit:name>xilinx_anylanguagebehavioralsimulation_view_fileset</spirit:name>
      <spirit:file>
        <spirit:name>vga_rgb888_pack.vhd</spirit:name>
        <spirit:fileType>vhdlSource</spirit:fileType>
      </spirit:file>
    </spirit:fileSet>
    <spirit:fileSet>
      <spirit:name>xilinx_xpgui_view_fileset</spirit:name>
      <spirit:file>
        <spirit:name>xgui/vga_rgb888_pack_v1_0.tcl</spirit:name>
        <spirit:fileType>tclSource</spirit:fileType>
        <spirit:userFileType>CHECKSUM_f92e9879</spirit:userFileType>
        <spirit:userFileType>XGUI_VERSION_2</spirit:userFileType>
      </spirit:file>
    </spirit:fileSet>
  </spirit:fileSets>
  <spirit:description>vga_rgb888_pack_v1_0</spirit:description>
  <spirit:parameters>
    <spirit:parameter>
      <spirit:name>Component_Name</spirit:name>
      <spirit:value spirit:resolve="user" spirit:id="PARAM_VALUE.Component_Name" spirit:order="1">vga_rgb888_pack_v1_0</spirit:value>
    </spirit:parameter>
  </spirit:parameters>
  <spirit:vendorExtensions>
    <xilinx:coreExtensions>
      <xilinx:supportedFamilies>
        <xilinx:family xilinx:lifeCycle="Production">zynq</xilinx:family>
      </xilinx:supportedFamilies>
      <xilinx:taxonomies>
        <xilinx:taxonomy>/UserIP</xilinx:taxonomy>
      </xilinx:taxonomies>
      <xilinx:displayName>vga_rgb888_pack_v1_0</xilinx:displayName>
      <xilinx:definitionSource>package_project</xilinx:definitionSource>
      <xilinx:coreRevision>2</xilinx:coreRevision>
      <xilinx:coreCreationDateTime>2017-05-31T16:31:43Z</xilinx:coreCreationDateTime>
      <xilinx:tags>
        <xilinx:tag xilinx:name="xilinx.com:user:vga_rgb888_pack:1.0_ARCHIVE_LOCATION">c:/zyboip/video_ip/vga_rgb888_pack/vga_rgb888_pack.srcs/sources_1/new</xilinx:tag>
      </xilinx:tags>
    </xilinx:coreExtensions>
    <xilinx:packagingInfo>
      <xilinx:xilinxVersion>2016.4</xilinx:xilinxVersion>
      <xilinx:checksum xilinx:scope="fileGroups" xilinx:value="e52d534c"/>
      <xilinx:checksum xilinx:scope="ports" xilinx:value="5d47a4c6"/>
      <xilinx:checksum xilinx:scope="parameters" xilinx:value="5e8387e4"/>
    </xilinx:packagingInfo>
  </spirit:vendorExtensions>
</spirit:component>


text:
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member

namespace UnitTest.Rollbar.Deploys
{
    using global::Rollbar;
    using global::Rollbar.Deploys;
    using Microsoft.VisualStudio.TestTools.UnitTesting;
    using System;
    using System.Collections.Generic;
    using System.Diagnostics;
    using System.Linq;
    using System.Threading;

    [TestClass]
    [TestCategory(nameof(RollbarDeploysManagerFixture))]
    public class RollbarDeploysManagerFixture
    {
        private readonly IRollbarDeploysManager _deploysManager =
            RollbarDeploysManagerFactory.CreateRollbarDeploysManager(
                RollbarUnitTestSettings.AccessToken,
                RollbarUnitTestSettings.DeploymentsReadAccessToken
                );

        [TestInitialize]
        public void SetupFixture()
        {
            SynchronizationContext.SetSynchronizationContext(new SynchronizationContext());
        }

        [TestCleanup]
        public void TearDownFixture()
        {
        }

        private ICollection<IDeploymentDetails> GetAllDeployments()
        {
            List<IDeploymentDetails> deployments = new List<IDeploymentDetails>();

            int pageCount = 0;
            int pageItems;
            do
            {
                var task = this._deploysManager.GetDeploymentsPageAsync(RollbarUnitTestSettings.Environment, ++pageCount);
                task.Wait(TimeSpan.FromSeconds(3));
                pageItems = task.Result.Length;
                if (pageItems > 0)
                {
                    deployments.AddRange(task.Result);
                }
                Assert.IsNull(task.Exception);
                Thread.Sleep(TimeSpan.FromMilliseconds(250));
            }
            while (pageItems > 0);

            return deployments;
        }

        [TestMethod]
        public void TestRollbarDeploysManager()
        {
            var initialDeployments = this.GetAllDeployments();

            var deployment = DeploymentFactory.CreateDeployment(
                    environment: RollbarUnitTestSettings.Environment,
                    revision: "99909a3a5a3dd4363f414161f340b582bb2e4161",
                    comment: "Some new unit test deployment @ " + DateTimeOffset.Now,
                    localUserName: "UnitTestRunner",
                    rollbarUserName: "rollbar"
                    );

            var task = this._deploysManager.RegisterAsync(deployment);
            task.Wait(TimeSpan.FromSeconds(3));
            Assert.IsNull(task.Exception);
            Thread.Sleep(TimeSpan.FromMilliseconds(250));

            var deployments = this.GetAllDeployments();

            Trace.WriteLine($"Initial deployments count : {initialDeployments.Count}");
            Trace.WriteLine($"Deployments count : {deployments.Count}");
            Assert.IsTrue(initialDeployments.Count < deployments.Count);

            var latestDeployment = deployments.FirstOrDefault();
            Assert.IsNotNull(latestDeployment);

            var getDeploymentTask = this._deploysManager.GetDeploymentAsync(latestDeployment.DeployID);
            getDeploymentTask.Wait(TimeSpan.FromSeconds(3));
            Assert.IsNull(getDeploymentTask.Exception);
            var deploymentDetails = getDeploymentTask.Result;
            Assert.IsNotNull(getDeploymentTask);
            Assert.AreEqual(deploymentDetails.Comment, latestDeployment.Comment);
            Assert.AreEqual(deploymentDetails.DeployID, latestDeployment.DeployID);
            Assert.AreEqual(deploymentDetails.EndTime, latestDeployment.EndTime);
            Assert.AreEqual(deploymentDetails.Environment, latestDeployment.Environment);
            Assert.AreEqual(deploymentDetails.LocalUsername, latestDeployment.LocalUsername);
            Assert.AreEqual(deploymentDetails.ProjectID, latestDeployment.ProjectID);
            Assert.AreEqual(deploymentDetails.Revision, latestDeployment.Revision);
            Assert.AreEqual(deploymentDetails.RollbarUsername, latestDeployment.RollbarUsername);
            Assert.AreEqual(deploymentDetails.StartTime, latestDeployment.StartTime);
        }
    }
}