text:
import time
import json
import boto3
import logging
from datetime import timedelta, datetime
from botocore.exceptions import BotoCoreError, ClientError

from cfn_sphere.exceptions import CfnStackActionFailedException
from cfn_sphere.util import with_boto_retry, get_logger, timed, get_pretty_stack_outputs, \
    get_pretty_parameters_string, get_cfn_api_server_time
from cfn_sphere.exceptions import CfnSphereBotoError

logging.getLogger('boto').setLevel(logging.FATAL)

class CloudFormationStack(object):
    def __init__(self, template, parameters, name, region, timeout=600, tags=None, service_role=None,
                 stack_policy=None, failure_action=None, disable_rollback=False, termination_protection=False):
        self.template = template
        self.parameters = parameters
        self.tags = {} if tags is None else tags
        self.name = name
        self.region = region
        self.timeout = timeout
        self.service_role = service_role
        self.stack_policy = stack_policy
        self.failure_action = failure_action
        self.disable_rollback = disable_rollback
        self.termination_protection = termination_protection

    def __str__(self):
        return str(vars(self))

    def get_parameters_list(self):
        return [{"ParameterKey": str(key), "ParameterValue": str(value)} for key, value in self.parameters.items()]

    def get_tags_list(self):
        return [{"Key": key, "Value": value} for key, value in self.tags.items()]

class CloudFormation(object):
    @with_boto_retry()
    def __init__(self, region="eu-west-1"):
        self.logger = get_logger()
        self.client = boto3.client('cloudformation', region_name=region)
        self.resource = boto3.resource('cloudformation', region_name=region)

    def get_stack(self, stack_name):
        """
        Get stack resource representation for a given stack_name
        This doesn't actually call the AWS API but only creates a stack stub lazy loading it's content
        :param stack_name: str:
        :return: boto3.resources.factory.cloudformation.Stack
        :raise CfnSphereBotoError:
        """
        return self.resource.Stack(stack_name)

    @timed
    @with_boto_retry()
    def get_stacks(self):
        """
        Get all stacks
        :return: List(boto3.resources.factory.cloudformation.Stack)
        :raise CfnSphereBotoError:
        """
        try:
            return list(self.resource.stacks.all())
        except (BotoCoreError, ClientError) as e:
            raise CfnSphereBotoError(e)

    @timed
    @with_boto_retry()
    def get_stack_description(self, stack_name):
        """
        Get a stacks descriptions
        :param stack_name: string
        :return dict
        :raise CfnSphereBotoError:
        """
        try:
            return self.client.describe_stacks(StackName=stack_name)["Stacks"][0]
        except (BotoCoreError, ClientError) as e:
            raise CfnSphereBotoError(e)

    @timed
    @with_boto_retry()
    def get_stack_descriptions(self):
        """
        Get all stacks stack descriptions
        :return List(dict)
        :raise CfnSphereBotoError:
        """
        try:
            stacks = []
            for page in self.client.get_paginator('describe_stacks').paginate():
                stacks += page["Stacks"]
            return stacks
        except (BotoCoreError, ClientError) as e:
            raise CfnSphereBotoError(e)

    @with_boto_retry()
    def stack_exists(self, stack_name):
        """
        Check if a stack exists for given stack_name

        :param stack_name: str
        :return: bool
        """
        try:
            if self.get_stack(stack_name).stack_status:
                return True
            else:
                return False
        except (BotoCoreError, ClientError) as e:
            if self.is_boto_stack_does_not_exist_exception(e):
                return False
            else:
                raise CfnSphereBotoError(e)

    @with_boto_retry()
    def get_stack_events(self, stack_name):
        """
        Get recent stack events for a given stack_name
        :param stack_name: str
        :return: list(dict)
        """
        try:
            paginator = self.client.get_paginator('describe_stack_events')
            pages = paginator.paginate(StackName=stack_name, PaginationConfig={'MaxItems': 100})
            return next(iter(pages))["StackEvents"]
        except (BotoCoreError, ClientError) as e:
            raise CfnSphereBotoError(e)

    @timed
    @with_boto_retry()
    def get_stack_names(self):
        """
        Get a list of stack names
        :return: list(str)
        """
        return [stack.stack_name for stack in self.get_stacks()]

    @timed
    def get_stacks_dict(self):
        """
        Get a dict containing all stacks with their name as key and {parameters, outputs} as value
        :return: dict
        """
        stacks_dict = {}
        for stack in self.get_stack_descriptions():
            stacks_dict[stack["StackName"]] = {"parameters": stack.get("Parameters", []),
                                               "outputs": stack.get("Outputs", [])}
        return stacks_dict

    def get_stack_outputs(self, stack):
        """
        Get outputs for a specific stack
        :param stack: cfn_sphere.aws.cfn.CloudFormationStack
        :return: list(dict)
        """
        return self.get_stack_description(stack.name).get("Outputs", [])

    def get_stacks_outputs(self):
        """
        Get a dict of all available stack outputs
        :return: dict(dict(output-key, output-value))
        """
        stack_outputs = {}
        stack_descriptions = self.get_stack_descriptions()

        for stack_description in stack_descriptions:

            if stack_description.get("Outputs"):
                stack_name = stack_description["StackName"]
                outputs = {}

                for output in stack_description["Outputs"]:
                    key = output["OutputKey"]
                    value = output["OutputValue"]
                    outputs[key] = value

                stack_outputs[stack_name] = outputs

        return stack_outputs

    @with_boto_retry()
    def validate_stack_is_ready_for_action(self, stack):
        """
        Check if a stack is in a state capable for modification actions

        :param stack: cfn_sphere.aws.cfn.CloudFormationStack
        :raise CfnStackActionFailedException: if the stack is in an invalid state
        """
        cfn_stack = self.get_stack(stack.name)

        valid_states = ["CREATE_COMPLETE", "UPDATE_COMPLETE", "IMPORT_COMPLETE", "ROLLBACK_COMPLETE", "UPDATE_ROLLBACK_COMPLETE"]

        if cfn_stack.stack_status not in valid_states:
            raise CfnStackActionFailedException(
                "Stack {0} is in '{1}' state.".format(cfn_stack.stack_name, cfn_stack.stack_status))

    @with_boto_retry()
    def get_stack_state(self, stack_name):
        """
        Get stack status
        :param stack_name: str
        :return: str: stack status
        :raise CfnSphereBotoError:
        """
        return self.get_stack(stack_name).stack_status

    @with_boto_retry()
    def get_stack_parameters_dict(self, stack_name):
        """
        Get a stacks parameters
        :param stack_name: str
        :return: dict
        """
        parameters = {}
        stack = self.get_stack(stack_name)

        for parameter in stack.parameters:
            parameters[parameter["ParameterKey"]] = parameter["ParameterValue"]

        return parameters

    @staticmethod
    def is_boto_no_update_required_exception(exception):
        """
        Return true if the given exception means that a stack doesn't require an update
        :param exception: Exception
        :return: bool
        """
        if isinstance(exception, ClientError):
            if exception.response["Error"]["Message"] == "No updates are to be performed.":
                return True
            else:
                return False
        else:
            return False

    @staticmethod
    def is_boto_stack_does_not_exist_exception(exception):
        """
        Return true if the given exception means that a stack does not exist
        :param exception: Exception
        :return: bool
        """
        if isinstance(exception, ClientError):
            message = exception.response["Error"]["Message"]
            if message.startswith("Stack") and message.endswith("does not exist"):
                return True
            else:
                return False
        else:
            return False

    @with_boto_retry()
    def _set_stack_policy(self, stack):
        """
        Set cloudformation stack policy
        :param stack: cfn_sphere.aws.cfn.CloudFormationStack
        """
        kwargs = {"StackName": stack.name}

        if stack.stack_policy:
            kwargs["StackPolicyBody"] = json.dumps(stack.stack_policy)

        self.client.set_stack_policy(**kwargs)

    @with_boto_retry()
    def _create_stack(self, stack):
        """
        Create cloudformation stack
        :param stack: cfn_sphere.aws.cfn.CloudFormationStack
        """
        kwargs = {
            "StackName": stack.name,
            "TemplateBody": stack.template.get_template_json(),
            "Parameters": stack.get_parameters_list(),
            "Capabilities": [
                'CAPABILITY_IAM',
                'CAPABILITY_NAMED_IAM'
            ],
            "Tags": stack.get_tags_list()
        }

        if stack.service_role:
            kwargs["RoleARN"] = stack.service_role
        if stack.stack_policy:
            kwargs["StackPolicyBody"] = json.dumps(stack.stack_policy)
        if stack.failure_action:
            kwargs["OnFailure"] = stack.failure_action
        if stack.disable_rollback:
            kwargs["DisableRollback"] = bool(stack.disable_rollback)
        if stack.termination_protection:
            kwargs["EnableTerminationProtection"] = bool(stack.termination_protection)

        self.client.create_stack(**kwargs)

    @with_boto_retry()
    def _update_stack(self, stack):
        """
        Update cloudformation stack
        :param stack: cfn_sphere.aws.cfn.CloudFormationStack
        """
        kwargs = {
            "StackName": stack.name,
            "TemplateBody": stack.template.get_template_json(),
            "Parameters": stack.get_parameters_list(),
            "Capabilities": [
                'CAPABILITY_IAM',
                'CAPABILITY_NAMED_IAM'
            ],
            "Tags": stack.get_tags_list()
        }

        if stack.service_role:
            kwargs["RoleARN"] = stack.service_role
        if stack.stack_policy:
            stack_policy = json.dumps(stack.stack_policy)
            kwargs["StackPolicyBody"] = stack_policy
            kwargs["StackPolicyDuringUpdateBody"] = stack_policy

        self.client.update_stack(**kwargs)

    @with_boto_retry()
    def _delete_stack(self, stack):
        """
        Delete cloudformation stack
        :param stack: cfn_sphere.aws.cfn.CloudFormationStack
        """
        kwargs = {
            "StackName": stack.name
        }

        if stack.service_role:
            kwargs["RoleARN"] = stack.service_role

        self.client.delete_stack(**kwargs)

    def create_stack(self, stack):
        self.logger.debug("Creating stack: {0}".format(stack))
        assert isinstance(stack, CloudFormationStack)

        try:
            stack_parameters_string = get_pretty_parameters_string(stack)

            self.logger.info(
                "Creating stack {0} ({1}) with parameters:\n{2}".format(stack.name,
                                                                        stack.template.name,
                                                                        stack_parameters_string))
            self._create_stack(stack)

            self.wait_for_stack_action_to_complete(stack.name, "create", stack.timeout)

            stack_outputs = get_pretty_stack_outputs(self.get_stack_outputs(stack))
            if stack_outputs:
                self.logger.info("Create completed for {0} with outputs: \n{1}".format(stack.name, stack_outputs))
            else:
                self.logger.info("Create completed for {0}".format(stack.name))
        except (BotoCoreError, ClientError, CfnSphereBotoError) as e:
            raise CfnStackActionFailedException("Could not create {0}: {1}".format(stack.name, e))

    def update_stack(self, stack):
        self.logger.debug("Updating stack: {0}".format(stack))
        assert isinstance(stack, CloudFormationStack)

        try:
            stack_parameters_string = get_pretty_parameters_string(stack)

            try:
                self._update_stack(stack)
            except ClientError as e:

                if self.is_boto_no_update_required_exception(e):
                    self.logger.info("Stack {0} does not need an update".format(stack.name))
                    return
                else:
                    self.logger.info(
                        "Updating stack {0} ({1}) with parameters:\n{2}".format(stack.name,
                                                                                stack.template.name,
                                                                                stack_parameters_string))
                    raise

            self.logger.info(
                "Updating stack {0} ({1}) with parameters:\n{2}".format(stack.name,
                                                                        stack.template.name,
                                                                        stack_parameters_string))

            self.wait_for_stack_action_to_complete(stack.name, "update", stack.timeout)

            stack_outputs = get_pretty_stack_outputs(self.get_stack_outputs(stack))
            if stack_outputs:
                self.logger.info("Update completed for {0} with outputs: \n{1}".format(stack.name, stack_outputs))
            else:
                self.logger.info("Update completed for {0}".format(stack.name))
        except (BotoCoreError, ClientError, CfnSphereBotoError) as e:
            raise CfnStackActionFailedException("Could not update {0}: {1}".format(stack.name, e))

    def delete_stack(self, stack):
        self.logger.debug("Deleting stack: {0}".format(stack))
        assert isinstance(stack, CloudFormationStack)

        try:
            self.logger.info("Deleting stack {0}".format(stack.name))
            self._delete_stack(stack)

            try:
                self.wait_for_stack_action_to_complete(stack.name, "delete", stack.timeout)
            except CfnSphereBotoError as e:
                if self.is_boto_stack_does_not_exist_exception(e.boto_exception):
                    pass
                else:
                    raise

            self.logger.info("Deletion completed for {0}".format(stack.name))
        except (BotoCoreError, ClientError, CfnSphereBotoError) as e:
            raise CfnStackActionFailedException("Could not delete {0}: {1}".format(stack.name, e))

    def wait_for_stack_action_to_complete(self, stack_name, action, timeout):
        allowed_actions = ["create", "update", "delete"]
        assert action.lower() in allowed_actions, "action argument must be one of {0}".format(allowed_actions)

        time_jitter_window = timedelta(seconds=10)
        minimum_event_timestamp = get_cfn_api_server_time() - time_jitter_window
        expected_start_event_state = action.upper() + "_IN_PROGRESS"

        start_event = self.wait_for_stack_event(stack_name,
                                                expected_start_event_state,
                                                minimum_event_timestamp,
                                                timeout=120)

        self.logger.info("Stack {0} started".format(action))

        minimum_event_timestamp = start_event["Timestamp"]
        expected_complete_event_state = action.upper() + "_COMPLETE"

        end_event = self.wait_for_stack_event(stack_name,
                                              expected_complete_event_state,
                                              minimum_event_timestamp,
                                              timeout)

        elapsed = end_event["Timestamp"] - start_event["Timestamp"]
        self.logger.info("Stack {0} completed after {1}s".format(action, elapsed.seconds))

    def wait_for_stack_event(self, stack_name, expected_event_status, valid_from_timestamp, timeout):
        """
        Wait for a new stack event. Return it if it has the expected status
        :param stack_name: str
        :param expected_event_status: str
        :param valid_from_timestamp: timestamp
        :param timeout: int
        :return: boto3 stack event
        :raise CfnStackActionFailedException:
        """
        self.logger.debug("Waiting for {0} events, newer than {1}".format(expected_event_status,
                                                                          valid_from_timestamp))

        seen_event_ids = []
        start = datetime.now()
        while datetime.now() < (start + timedelta(seconds=int(timeout))):

            events = self.get_stack_events(stack_name)
            events.reverse()

            for event in events:
                if event["EventId"] not in seen_event_ids:
                    seen_event_ids.append(event["EventId"])
                    event = self.handle_stack_event(event, valid_from_timestamp, expected_event_status, stack_name)

                    if event:
                        return event

            time.sleep(10)
        raise CfnStackActionFailedException(
            "Timeout occurred waiting for '{0}' on stack {1}".format(expected_event_status, stack_name))

    def handle_stack_event(self, event, valid_from_timestamp, expected_stack_event_status, stack_name):
        """
        Handle stack event. Return it if it has the expected status
        :param event: raw event
        :param valid_from_timestamp: earliest timestamp from which the event is considered relevant
        :param expected_stack_event_status:
        :param stack_name: the relevant stacks name
        :return: boto3 stack event if it has expected status | None
        :raise CfnStackActionFailedException:
        """
        if event["Timestamp"] > valid_from_timestamp:

            if event["ResourceType"] == "AWS::CloudFormation::Stack" and event["LogicalResourceId"] == stack_name:
                self.logger.debug("Raw event: {0}".format(event))

                if event["ResourceStatus"] == expected_stack_event_status:
                    return event

                if event["ResourceStatus"].endswith("_FAILED"):
                    raise CfnStackActionFailedException("Stack is in {0} state".format(event["ResourceStatus"]))

                if event["ResourceStatus"].endswith("ROLLBACK_IN_PROGRESS"):
                    self.logger.error("Failed to create stack (Reason: {0})".format(event["ResourceStatusReason"]))
                    return None

                if event["ResourceStatus"].endswith("ROLLBACK_COMPLETE"):
                    raise CfnStackActionFailedException("Rollback occured")
            else:
                if event["ResourceStatus"].endswith("_FAILED"):
                    self.logger.error("Failed to create {0} (Reason: {1})".format(event["LogicalResourceId"],
                                                                                event["ResourceStatusReason"]))
                    return None
                else:
                    status_reason = event.get("ResourceStatusReason", None)
                    status_reason_string = " ({0})".format(status_reason) if status_reason else ""
                    event_string = "{0} {1}: {2}{3}".format(event["StackName"],
                                                            event["LogicalResourceId"],
                                                            event["ResourceStatus"],
                                                            status_reason_string)

                    self.logger.info(event_string)
                    return None

    def validate_template(self, template):
        """
        Validate template
        :param template: CloudFormationTemplate
        :return: boolean (true if valid)
        """
        try:
            self.client.validate_template(TemplateBody=template.get_template_json())
            return True
        except (BotoCoreError, ClientError) as e:
            raise CfnSphereBotoError(e)

if __name__ == "__main__":
    cfn = CloudFormation()
    cfn.logger.setLevel(logging.DEBUG)
    stack = CloudFormationStack(None, {}, "pulse-report", "eu-west-1")
    print(cfn.get_stack_outputs(stack))


text:
Either add the `@CLWindmillBundle/Resources/config/routing.yml` to your `app/config/routing.yml` file, or create your
own `GameController` by looking at how [the original](https://github.com/cleentfaar/CLWindmillBundle/tree/master/Controller/GameController.php)
was made.

Then, if you used the default controller, just navigate to `/windmill/game/new/` to start a new game of chess.

## Playing chess through the CLI (Symfony Console)

Check out the documentation on [Commands](https://github.com/cleentfaar/CLWindmillBundle/tree/master/Resources/doc/commands.md).

redpajama_set_name: RedPajamaGithub


text:
(function() {

    "use strict";

    var that    = module.exports;

    var fs      = require('fs');
    var http    = require('http');
    var https   = require('https');

    var _       = require('underscore');
    var Promise = require('promise');
    var request = require('request');

    var path    = require('path');

    var wsdl    = require('../wsdl.js');

    function _getProtocol(opts) {

        opts = opts || {};
        return (opts.secure === void 0 ||
                opts.secure === true) ? 'https://' : 'http://';
    }

    function _getRequestEnvelope(callParams, namespaces, opts) {

        callParams.soap = callParams.soap || {};

        return new Promise(function(resolve, reject) {

            var namespacePromises = [];

            if (namespaces.indexOf("tns") === -1) {
                namespacePromises.push(wsdl.getNamespaceByNs("tns", callParams, opts));
            }

            _.each(namespaces, function(namespace) {
                namespacePromises.push(wsdl.getNamespaceByNs(namespace, callParams, opts));
            });

            Promise.all(namespacePromises)
                .done(function(namespaceData) {

                    if (callParams.header !== void 0) {
                        _.each(callParams.header, function(headerItem, index) {
                            namespaceData.push({
                                short : 'cns' + index,
                                full  : headerItem.namespace
                            });
                        });
                    }

                    resolve({
                        soap_env    : callParams.soap.soap_env      || 'http://schemas.xmlsoap.org/soap/envelope/',
                        xml_schema  : callParams.soap.xml_schema    || 'http://www.w3.org/2001/XMLSchema',
                        namespaces  : namespaceData
                    });

                }, function(err) { console.log(err); });
        });
    }

    function _getRequestHead(callParams, namespaces, opts) {

        callParams = callParams || {};

        return new Promise(function(resolve, reject) {

            if (callParams.header === void 0 ||
                Object.keys(callParams.header).length === 0) {
                resolve(null);
                return;
            }

            var headerParts = [];
            _.each(callParams.header, function(headerItem, index) {

                var item = '<cns' + index + ':' + headerItem.name + '>';
                    item += headerItem.value;
                    item += '</cns' + index + ':' + headerItem.name + '>';

                headerParts.push(item);
            });

            resolve(headerParts);
        });
    }

    function _getTemplateParams(callParams, methodParams, opts) {

        var namespaces = [];

        var requestParamsFunc = function(name, params) {

            if (_.isArray(params) && _.isObject(params)) {

                var returnValue = null;
                _.each(params, function(param) {
                    if (returnValue === null) {
                        returnValue = requestParamsFunc(name, param);
                    }
                });

                return returnValue;
            }

            if (name === params.name) {
                return params;
            }

            if (params.params === void 0) {
                return null;
            }

            return requestParamsFunc(name, params.params);
        };

        var requestItems = function(cParams, mParams, namespace) {

            namespace  = namespace || null;

            if (namespaces.indexOf(mParams.namespace) === -1) {
                if (mParams.namespace !== null) {
                    namespaces.push(mParams.namespace);
                }
            }

            var item = '';
            _.each(cParams, function(cParam, cParamName) {

                var methodItem = requestParamsFunc(cParamName, mParams);

                if (namespace === null &&
                    methodItem !== void 0 &&
                    methodItem !== null) {
                    namespace = methodItem.namespace;
                }

                if (namespaces.indexOf(namespace) === -1) {
                    if (namespace !== null) {
                        namespaces.push(namespace);
                    }
                }

                var namespace_string = '';
                if (namespace !== null && namespace !== 'xsd') {
                    namespace_string = namespace + ':';
                }

                var attributes = '';
                if (_.isObject(cParam) && cParam._attributes) {
                    _.each(cParam._attributes, function(attrVal, attrKey) {
                        attributes += ' ' + attrKey + '="' + attrVal + '"';
                    });

                    cParam = cParam._value || null;
                }

                if (cParam === null) {
                    item += '<' + namespace_string + cParamName + attributes + ' />';
                }
                else {

                    if (_.isObject(cParam)) {

                        if (_.isArray(cParam)) {

                            _.each(cParam, function(cParamValue) {
                                item += '<' + namespace_string + cParamName + '>';
                                item += cParamValue;
                                item += '</' + namespace_string + cParamName + '>';
                            });
                        }
                        else {
                            item += '<' + namespace_string + cParamName + attributes + '>';
                            item += requestItems(cParam, mParams, namespace);
                            item += '</' + namespace_string + cParamName + '>';
                        }
                    }
                    else {
                        item += '<' + namespace_string + cParamName + attributes + '>';
                        item += cParam;
                        item += '</' + namespace_string + cParamName + '>';
                    }
                }
            });

            return item;
        };

        var requestParamString = requestItems(callParams.params, methodParams.request);

        return new Promise(function(resolve, reject) {

            _getRequestEnvelope(callParams, namespaces, opts)
                .done(function(requestEnvelope) {

                    _getRequestHead(callParams, namespaces, opts)
                        .done(function(requestHead) {
                            resolve([
                                requestEnvelope,
                                requestHead,
                                requestParamString
                            ]);
                        });
                });
        });
    }

    that._template = _.template(fs.readFileSync(__dirname + path.sep + 'request.tpl', 'utf-8'));

    //do a get request
    that.get = function(params, opts) {

        params  = params || {};
        opts    = opts   || {};

        if (params.host === void 0 ||
            params.path === void 0) {
            throw new Error('insufficient arguments for get');
        }

        if (params.rejectUnauthorized === void 0) {
            params.rejectUnauthorized = true;
        }

        return new Promise(function (resolve, reject) {

            request({
                url                 : _getProtocol(opts) + params.host + params.path,
                headers             : params.headers || {},
                rejectUnauthorized  : params.rejectUnauthorized
            }, function(error, response, body) {

                if (error) { reject(error); }
                else {
                    resolve({
                        'body'      : body,
                        'response'  : response,
                        'header'    : response.headers
                    });
                }
            });
        });
    };

    //do a soap call
    that.soapCall = function(params, opts) {

        params  = params    || {};
        opts    = opts      || {};

        var that = this;

        if (params.rejectUnauthorized === void 0) {
            params.rejectUnauthorized = true;
        }

        return new Promise(function(resolve, reject) {

            wsdl.getMethodParams(params, opts)
                .done(function(methodParams) {

                    _getTemplateParams(params, methodParams, opts)
                        .done(function(data) {

                            request({
                                url                 : _getProtocol(opts) + params.host + params.path,
                                body                : that._template({
                                    'envelope'  : data[0],
                                    'head'      : data[1],
                                    'body'      : {
                                        'method'    : params.method,
                                        'params'    : data[2],
                                        'namespace' : methodParams.request.namespace
                                    }
                                }),
                                headers             : _.extend({}, params.headers),
                                rejectUnauthorized  : params.rejectUnauthorized,
                                method              : 'POST'
                            }, function(error, response, body) {

                                if (error) { reject(error); }
                                else {
                                    resolve({
                                        'body'      : body,
                                        'response'  : response,
                                        'header'    : response.headers
                                    });
                                }
                            });
                        });

                }, function(err) {
                    reject(err);
                });
        });
    };

})();


text:
#include "sofam.h"

int iauJd2cal(double dj1, double dj2,
              int *iy, int *im, int *id, double *fd)

{
/* Minimum and maximum allowed JD */
   static const double djmin = -68569.5;
   static const double djmax = 1e9;

   long jd, l, n, i, k;
   double dj, d1, d2, f1, f2, f, d;

/* Verify date is acceptable. */
   dj = dj1 + dj2;
   if (dj < djmin || dj > djmax) return -1;

/* Copy the date, big then small, and re-align to midnight. */
   if (dj1 >= dj2) {
      d1 = dj1;
      d2 = dj2;
   } else {
      d1 = dj2;
      d2 = dj1;
   }
   d2 -= 0.5;

/* Separate day and fraction. */
   f1 = fmod(d1, 1.0);
   f2 = fmod(d2, 1.0);
   f = fmod(f1 + f2, 1.0);
   if (f < 0.0) f += 1.0;
   d = floor(d1 - f1) + floor(d2 - f2) + floor(f1 + f2 - f);
   jd = (long) floor(d) + 1L;

/* Express day in Gregorian calendar. */
   l = jd + 68569L;
   n = (4L * l) / 146097L;
   l -= (146097L * n + 3L) / 4L;
   i = (4000L * (l + 1L)) / 1461001L;
   l -= (1461L * i) / 4L - 31L;
   k = (80L * l) / 2447L;
   *id = (int) (l - (2447L * k) / 80L);
   l = k / 11L;
   *im = (int) (k + 2L - 12L * l);
   *iy = (int) (100L * (n - 49L) + i + l);
   *fd = f;

   return 0;

/*----------------------------------------------------------------------
**
**  Celes is a wrapper of the SOFA Library for Ruby.
**
**  This file is redistributed and relicensed in accordance with
**  the SOFA Software License (http://www.iausofa.org/tandc.html).
**
**  The original library is available from IAU Standards of
**  Fundamental Astronomy (http://www.iausofa.org/).
**
**
**
**
**
**  Copyright (C) 2013, Naoki Arita
**  All rights reserved.
**
**  Redistribution and use in source and binary forms, with or without
**  modification, are permitted provided that the following conditions
**  are met:
**
**  1 Redistributions of source code must retain the above copyright
**    notice, this list of conditions and the following disclaimer.
**
**  2 Redistributions in binary form must reproduce the above copyright
**    notice, this list of conditions and the following disclaimer in
**    the documentation and/or other materials provided with the
**    distribution.
**
**  3 Neither the name of the Standards Of Fundamental Astronomy Board,
**    the International Astronomical Union nor the names of its
**    contributors may be used to endorse or promote products derived
**    from this software without specific prior written permission.
**
**  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
**  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
**  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
**  FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE
**  COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
**  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
**  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
**  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
**  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
**  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
**  ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
**  POSSIBILITY OF SUCH DAMAGE.
**
**--------------------------------------------------------------------*/
}


text:
require 'spec_helper'

describe "Documents" do
  describe "GET /documents" do
  # TODO rework this to include project id
#    it "works! (now write some real specs)" do
#      # Run the generator again with the --webrat flag if you want to use webrat methods/matchers
#      get documents_path
#      response.status.should be(200)
#    end
  end
end


text:
from ..functions import authenticate_call_and_method

def test_authenticate_call_and_method_search_GET_with_index_read():
    """ The index_read permission authenticates _search with GET.
    """
    call = '_search'
    method = 'GET'

    test_policies = [
        {
            'resources': {
                'indices': ['joes_index', ],
            },
            'users': ['joe'],
            'permissions': ['index_read']
        },
    ]
    granted = authenticate_call_and_method(
        test_policies, call, method
    )

    assert granted

def test_authenticate_call_and_method_search_POST_mismatch_with_index_read():
    """ The index_read permission denies authentication for _search with POST.
    """
    call = '_search'
    method = 'POST'

    test_policies = [
        {
            'resources': {
                'indices': ['joes_index', ],
            },
            'users': ['joe'],
            'permissions': ['index_read']
        },
    ]
    granted = authenticate_call_and_method(
        test_policies, call, method
    )

    assert not granted

def test_authenticate_call_and_method_search_POST_mismatch_with_index_write():
    """ The index_read permission denies authentication for _search with POST.
    """
    call = '_search'
    method = 'GET'

    test_policies = [
        {
            'resources': {
                'indices': ['joes_index', ],
            },
            'users': ['joe'],
            'permissions': ['index_write']
        },
    ]
    granted = authenticate_call_and_method(
        test_policies, call, method
    )

    assert not granted


text:
/* scripts for planets interfaces */

/* on this variable is SvgPlanet.js asking, when is clicked on the planet */
var openedPlanetContext = '';

$('#contextPanel').on('click', '.contextBtn', function () {
	$('#contextPanel .contextBtn').removeClass('active');
	$(this).addClass('active');
	openedPlanetContext = $(this).attr('id');
});


text:
namespace clangbuilder {
struct VSInstance {
  std::wstring InstanceId;
  std::wstring DisplayName;
  std::wstring VSInstallLocation;
  std::wstring Version;
  std::wstring VCToolsetVersion;
  uint64_t ullVersion = 0;
  uint64_t ullMainVersion = 0;
  bool IsWin10SDKInstalled = false;
  bool IsWin81SDKInstalled = false;
  bool IsEnterpriseWDK = false;
  bool IsPrerelease = false;
  // Newest version compare, so >
  bool operator<(const VSInstance &r) {
    if (ullMainVersion == r.ullMainVersion) {
      // MainVersion equal
      if (IsPrerelease == r.IsPrerelease) {
        return ullVersion < r.ullVersion;
      }
      return IsPrerelease;
    }
    return ullMainVersion < r.ullMainVersion;
  }
};

} // namespace clangbuilder

#endif


text:
extern pwr_measurement_dev_t g_pwr_measurement_dev;

static pac193x_cfg_t s_udb_power_measurement_cfg;

#define UDB_POWER_MEASUREMENT_MAINBOARD_USB_RESISTOR_VALUE    (15)
#define UDB_POWER_MEASUREMENT_ADAPTER_USB_RESISTOR_VALUE      (15)
#define UDB_POWER_MEASUREMENT_DENOMINATOR                     PAC193X_UNIPOLAR_DENOMINATOR

static const uint32_t k_udb_power_measurement_full_scale_current_uamp[] =
{
    [UDB_POWER_MEASUREMENT_TARGET_MAINBOARD_USB]   = PAC193X_FULL_SCALE_RANGE_MV * 1000000 / UDB_POWER_MEASUREMENT_MAINBOARD_USB_RESISTOR_VALUE,
    [UDB_POWER_MEASUREMENT_TARGET_ADAPTER_USB]     = PAC193X_FULL_SCALE_RANGE_MV * 1000000 / UDB_POWER_MEASUREMENT_ADAPTER_USB_RESISTOR_VALUE,
    // For DUT0 and DUT1, we can not measure the current for lack of sense resistors.
};

static const char* k_udb_power_measurement_target_name[] =
{
    [UDB_POWER_MEASUREMENT_TARGET_MAINBOARD_USB]  = "Mainboard USB",
    [UDB_POWER_MEASUREMENT_TARGET_ADAPTER_USB]    = "Adapter USB",
    [UDB_POWER_MEASUREMENT_TARGET_DUT0]           = "DUT0",
    [UDB_POWER_MEASUREMENT_TARGET_DUT1]           = "DUT1",
};

int udb_power_measurement_init(void)
{
    s_udb_power_measurement_cfg.ctrl_cfg.val      = PAC193X_CTRL_POR_VALUE;
    s_udb_power_measurement_cfg.chan_dis_cfg.val  = PAC1934_CHANNEL_DIS_POR_VALUE;
    s_udb_power_measurement_cfg.neg_pwr_cfg.val   = PAC193X_NEG_PWR_POR_VALUE;
    s_udb_power_measurement_cfg.slow_cfg.val      = PAC193X_SLOW_POR_VALUE;

    return pac193x_init(&s_udb_power_measurement_cfg);
}

int udb_power_measurement_measure(void)
{
    int ret = pac193x_send_command(PAC193X_COMMAND_REFRESH);
    if (ret == UDB_SUCCESS)
    {
        HAL_Delay(PAC193X_REFRESH_STABLIZATION_TIME_MS);
    }

    return ret;
}

int udb_power_measurement_read_voltage_mV(udb_power_measurement_target_t target, uint16_t *voltage_mV)
{
    util_assert(target < UDB_POWER_MEASUREMENT_TARGET_COUNT);

    int ret;
    uint8_t vbus_reg[PAC193X_VBUSN_REG_SIZE];

    ret = pac193x_read_reg(g_pwr_measurement_dev.voltage_reg[target], PAC193X_VBUSN_REG_SIZE, vbus_reg);
    if (ret == UDB_SUCCESS)
    {

        uint32_t vbus = 0;
        for (uint8_t i = 0; i < PAC193X_VBUSN_REG_SIZE; ++i)
        {
            vbus = (vbus << 8) + vbus_reg[i];
        }

        // can not divide the denominator first, both FSV and vbus are smaller than the denominator
        *voltage_mV = (uint16_t)(PAC193X_FULL_SCALE_VOLTAGE_MV * vbus / UDB_POWER_MEASUREMENT_DENOMINATOR);
    }

    return ret;
}

int udb_power_measurement_read_current_uA(udb_power_measurement_target_t target, uint32_t *current_uA)
{
    util_assert(target < UDB_POWER_MEASUREMENT_TARGET_COUNT);

    int ret;
    uint8_t vsense_reg[PAC193X_VSENSEN_REG_SIZE];

    ret = pac193x_read_reg(g_pwr_measurement_dev.current_reg[target], PAC193X_VSENSEN_REG_SIZE, vsense_reg);

    if (ret == UDB_SUCCESS)
    {
        uint32_t vsense = 0;
        for (uint8_t i = 0; i < PAC193X_VSENSEN_REG_SIZE; ++i)
        {
            vsense = (vsense << 8) + vsense_reg[i];
        }

        // divide the denominator first to avoid overflow in the computation
        *current_uA = (k_udb_power_measurement_full_scale_current_uamp[target] / UDB_POWER_MEASUREMENT_DENOMINATOR) * vsense;
    }

    return ret;
}

const char* udb_power_measurement_get_target_name(udb_power_measurement_target_t target)
{
    util_assert(target < UDB_POWER_MEASUREMENT_TARGET_COUNT);

    return k_udb_power_measurement_target_name[target];
}

bool udb_power_measurement_can_measure_voltage(udb_power_measurement_target_t target)
{
    util_assert(target < UDB_POWER_MEASUREMENT_TARGET_COUNT);

    return (g_pwr_measurement_dev.voltage_reg[target] != PAC193X_INVALID_REG);
}

bool udb_power_measurement_can_measure_current(udb_power_measurement_target_t target)
{
    util_assert(target < UDB_POWER_MEASUREMENT_TARGET_COUNT);

    return (g_pwr_measurement_dev.current_reg[target] != PAC193X_INVALID_REG);
}

bool udb_power_measurement_can_measure_target(udb_power_measurement_target_t target)
{
    return (udb_power_measurement_can_measure_voltage(target) || udb_power_measurement_can_measure_current(target));
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Beih. Nova Hedwigia 38: 106 (1971)

#### Original name
Caloplaca cataschista Zahlbr.

### Remarks
null


text:
<?xml version="1.0" encoding="utf-8"?>
<View xmlns:android="http://schemas.android.com/apk/res/android"
    	android:layout_width="fill_parent"
    	android:layout_height="1dp"
    	android:background="@color/grey"
    	android:layout_below="@+id/options"
    	android:layout_alignParentRight="true"
    	android:layout_alignParentLeft="true"/>


text:
using System.Text;

namespace PrtgAPI.Tests.UnitTests.Support.TestResponses
{
    //Replace  with ""

    public class ExeFileTargetResponse : BaseTargetResponse
    {
        protected override string GetResponseText()
        {
            var builder = new StringBuilder();

            builder.Append("<!DOCTYPE html>\n");
            builder.Append("\n");
            builder.Append("\n");
            builder.Append("  <link rel=\"manifest\" href=\"/public/manifest.json.htm\">\n");
            builder.Append("  <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge,chrome=1\">\n");
            builder.Append("  <meta charset=\"utf-8\">\n");
            builder.Append("  <meta name=\"viewport\" content=\"width=device-width,initial-scale=1\">\n");
            builder.Append("  <link id=\"prtgfavicon\" rel=\"shortcut icon\" type=\"image/png\" href=\"/icons/favicon_red.png\" />\n");
            builder.Append("  <title>Add Sensor (Step 2 of 2) | PRTG Continuous Integration</title>\n");
            builder.Append("  <link rel=\"stylesheet\" href=\"/css/prtg0.css?prtgversion=17.4.35.3441&language=en\">\n");
            builder.Append("  <link rel=\"stylesheet\" type=\"text/css\" href=\"/css/print.css?version=17.4.35.3441\" media=\"print\"  />\n");
            builder.Append("\n");
            builder.Append("\n");
            builder.Append("\n");
            builder.Append("
\n");
            builder.Append("        <button class=\"header_menu-icon js-menuIcon glyph-menu5\"></button>\n");
            builder.Append("
\n");
            builder.Append("            \n");
            builder.Append("
\n");
            builder.Append("    \n");
            builder.Append("        New Alarms\n");
            builder.Append("        ...\n");
            builder.Append("    \n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("    \n");
            builder.Append("        New Log Entries\n");
            builder.Append("        ...\n");
            builder.Append("    \n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("    \n");
            builder.Append("        Updated Tickets\n");
            builder.Append("        ...\n");
            builder.Append("    \n");
            builder.Append("
\n");
            builder.Append("

\n");
            builder.Append("
\n");
            builder.Append("    \n");
            builder.Append("        \n");
            builder.Append("        1\n");
            builder.Append("    \n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("    \n");
            builder.Append("        \n");
            builder.Append("        \n");
            builder.Append("    \n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("    \n");
            builder.Append("        \n");
            builder.Append("        1\n");
            builder.Append("    \n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("    \n");
            builder.Append("        \n");
            builder.Append("        1\n");
            builder.Append("    \n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("    \n");
            builder.Append("        \n");
            builder.Append("        22\n");
            builder.Append("    \n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("    \n");
            builder.Append("        \n");
            builder.Append("        3\n");
            builder.Append("    \n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("    \n");
            builder.Append("        \n");
            builder.Append("        \n");
            builder.Append("    \n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("    \n");
            builder.Append("        \n");
            builder.Append("        1\n");
            builder.Append("    \n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("            <form class=\"header_searchForm\" onsubmit=\"_Prtg.Hjax.loadLink('/search.htm?searchtext='+encodeURIComponent($(this).find('#searchtext').val())); return false;\" method=\"get\"\n");
            builder.Append("                id=\"searchform\">\n");
            builder.Append("                <input tabindex=\"1\" id=\"searchtext\" class=\"searchstring\" data-trigger=\"manual\" type=\"text\" placeholder=\"Search...\" name=\"searchtext\">\n");
            builder.Append("                \n");
            builder.Append("            </form>\n");
            builder.Append("
\n");
            builder.Append("                \n");
            builder.Append("

\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("        \n");
            builder.Append("            \n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("    Home\n");
            builder.Append("
\n");
            builder.Append("      \n");
            builder.Append("
\n");
            builder.Append("        Switch Cluster Node\n");
            builder.Append("          \n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("        Welcome to PRTG\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("        Make This My Homepage\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
Devices\n");
            builder.Append("

All
\n");
            builder.Append("
Favorite Devices
\n");
            builder.Append("
Device List
\n");
            builder.Append("
Dependencies
\n");
            builder.Append("
Add Group
\n");
            builder.Append("
Add Auto-Discovery Group
\n");
            builder.Append("
Add Device
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
Libraries\n");
            builder.Append("

All
\n");
            builder.Append("
Add Library
\n");
            builder.Append("
Select Library \n");
            builder.Append("

All bandwidth sensors
\n");
            builder.Append("
All CPU load sensors
\n");
            builder.Append("
All diskspace sensors
\n");
            builder.Append("
All memory sensors
\n");
            builder.Append("
All sensors grouped by state
\n");
            builder.Append("
All VMware sensors
\n");
            builder.Append("
Sensors grouped by priority
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
Sensors\n");
            builder.Append("

All
\n");
            builder.Append("
Add Sensor
\n");
            builder.Append("
Favorite Sensors
\n");
            builder.Append("
Top 10 Lists  \n");
            builder.Append("

All Sensors
\n");
            builder.Append("
Local Probe\n");
            builder.Append("

Servers\n");
            builder.Append("

Group\n");
            builder.Append("

NestedGroup
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
By Current Value  \n");
            builder.Append("

Fastest  \n");
            builder.Append("

Ping
\n");
            builder.Append("
Port
\n");
            builder.Append("
Webpages
\n");
            builder.Append("
IMAP/POP3/SMTP
\n");
            builder.Append("
FTP
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
Slowest  \n");
            builder.Append("

Ping
\n");
            builder.Append("
Port
\n");
            builder.Append("
Webpages
\n");
            builder.Append("
IMAP/POP3/SMTP
\n");
            builder.Append("
FTP
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
Most Used  \n");
            builder.Append("

Bandwidth Sensors
\n");
            builder.Append("
CPUs
\n");
            builder.Append("
Disks
\n");
            builder.Append("
Memory
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
Least Used \n");
            builder.Append("

Bandwidth Sensors
\n");
            builder.Append("
CPUs
\n");
            builder.Append("
Disks
\n");
            builder.Append("
Memory
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
By Current Status \n");
            builder.Append("

Up
\n");
            builder.Append("
Warning
\n");
            builder.Append("
Down
\n");
            builder.Append("
Down (Acknowledged)
\n");
            builder.Append("
Unusual
\n");
            builder.Append("
Paused
\n");
            builder.Append("
Unknown
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
By Uptime/Downtime \n");
            builder.Append("

Best Uptime (%)
\n");
            builder.Append("
Highest Uptime (Time)
\n");
            builder.Append("
Worst Downtime (%)
\n");
            builder.Append("
Highest Downtime (Time)
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
By Type \n");
            builder.Append("

C… \n");
            builder.Append("

Core Health
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
E… \n");
            builder.Append("

EXE/Script
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
H… \n");
            builder.Append("

HTTP
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
N… \n");
            builder.Append("

NetFlow V9
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
P… \n");
            builder.Append("

Ping
\n");
            builder.Append("
Probe Health
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
R… \n");
            builder.Append("

RDP (Remote Desktop)
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
S… \n");
            builder.Append("

Sensor Factory
\n");
            builder.Append("
SNMP Custom
\n");
            builder.Append("
SSL Security Check
\n");
            builder.Append("
System Health
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
W… \n");
            builder.Append("

Windows CPU Load
\n");
            builder.Append("
Windows Network Card
\n");
            builder.Append("
Windows Pagefile
\n");
            builder.Append("
Windows Physical Disk I/O BETA
\n");
            builder.Append("
Windows System Uptime
\n");
            builder.Append("
WMI Free Disk Space (Multi Disk)
\n");
            builder.Append("
WMI Logical Disk I/O BETA
\n");
            builder.Append("
WMI Memory
\n");
            builder.Append("
WMI Remote Ping
\n");
            builder.Append("
WMI Service
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
By Tag \n");
            builder.Append("

B… \n");
            builder.Append("

bandwidthsensor
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
C… \n");
            builder.Append("

C_OS_VMware
\n");
            builder.Append("
corehealthsensor
\n");
            builder.Append("
cpuloadsensor
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
D… \n");
            builder.Append("

diskspacesensor
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
E… \n");
            builder.Append("

exesensor
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
F… \n");
            builder.Append("

factorysensor
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
H… \n");
            builder.Append("

httpsensor
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
M… \n");
            builder.Append("

memorysensor
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
N… \n");
            builder.Append("

netflowsensor
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
P… \n");
            builder.Append("

pagefilesensor
\n");
            builder.Append("
pingsensor
\n");
            builder.Append("
probehealthsensor
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
R… \n");
            builder.Append("

rdpsensor
\n");
            builder.Append("
remotepingsensor
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
S… \n");
            builder.Append("

servicesensor
\n");
            builder.Append("
snmpcustomsensor
\n");
            builder.Append("
sslsensor
\n");
            builder.Append("
systemhealthsensor
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
T… \n");
            builder.Append("

TestGroup
\n");
            builder.Append("
TestProbe
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
W… \n");
            builder.Append("

wmibandwidthsensor
\n");
            builder.Append("
wmicpuloadsensor
\n");
            builder.Append("
wmidiskspacesensor
\n");
            builder.Append("
wmilogicalsensor
\n");
            builder.Append("
wmimemorysensor
\n");
            builder.Append("
wmipagefilesensor
\n");
            builder.Append("
wmiphysicaldisksensor
\n");
            builder.Append("
wmipingsensor
\n");
            builder.Append("
wmisensor
\n");
            builder.Append("
wmiservicesensor
\n");
            builder.Append("
wmiuptimesensor
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
Cross Reference \n");
            builder.Append("

All Sensors
\n");
            builder.Append("
By Type \n");
            builder.Append("

C… \n");
            builder.Append("

Core Health
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
E… \n");
            builder.Append("

EXE/Script
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
H… \n");
            builder.Append("

HTTP
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
N… \n");
            builder.Append("

NetFlow V9
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
P… \n");
            builder.Append("

Ping
\n");
            builder.Append("
Probe Health
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
R… \n");
            builder.Append("

RDP (Remote Desktop)
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
S… \n");
            builder.Append("

Sensor Factory
\n");
            builder.Append("
SNMP Custom
\n");
            builder.Append("
SSL Security Check
\n");
            builder.Append("
System Health
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
W… \n");
            builder.Append("

Windows CPU Load
\n");
            builder.Append("
Windows Network Card
\n");
            builder.Append("
Windows Pagefile
\n");
            builder.Append("
Windows Physical Disk I/O BETA
\n");
            builder.Append("
Windows System Uptime
\n");
            builder.Append("
WMI Free Disk Space (Multi Disk)
\n");
            builder.Append("
WMI Logical Disk I/O BETA
\n");
            builder.Append("
WMI Memory
\n");
            builder.Append("
WMI Remote Ping
\n");
            builder.Append("
WMI Service
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
By Tag \n");
            builder.Append("

B… \n");
            builder.Append("

bandwidthsensor
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
C… \n");
            builder.Append("

C_OS_VMware
\n");
            builder.Append("
corehealthsensor
\n");
            builder.Append("
cpuloadsensor
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
D… \n");
            builder.Append("

diskspacesensor
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
E… \n");
            builder.Append("

exesensor
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
F… \n");
            builder.Append("

factorysensor
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
H… \n");
            builder.Append("

httpsensor
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
M… \n");
            builder.Append("

memorysensor
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
N… \n");
            builder.Append("

netflowsensor
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
P… \n");
            builder.Append("

pagefilesensor
\n");
            builder.Append("
pingsensor
\n");
            builder.Append("
probehealthsensor
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
R… \n");
            builder.Append("

rdpsensor
\n");
            builder.Append("
remotepingsensor
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
S… \n");
            builder.Append("

servicesensor
\n");
            builder.Append("
snmpcustomsensor
\n");
            builder.Append("
sslsensor
\n");
            builder.Append("
systemhealthsensor
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
T… \n");
            builder.Append("

TestGroup
\n");
            builder.Append("
TestProbe
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
W… \n");
            builder.Append("

wmibandwidthsensor
\n");
            builder.Append("
wmicpuloadsensor
\n");
            builder.Append("
wmidiskspacesensor
\n");
            builder.Append("
wmilogicalsensor
\n");
            builder.Append("
wmimemorysensor
\n");
            builder.Append("
wmipagefilesensor
\n");
            builder.Append("
wmiphysicaldisksensor
\n");
            builder.Append("
wmipingsensor
\n");
            builder.Append("
wmisensor
\n");
            builder.Append("
wmiservicesensor
\n");
            builder.Append("
wmiuptimesensor
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
View Historic Data
\n");
            builder.Append("
Similar Sensors Overview
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
Alarms\n");
            builder.Append("

All
\n");
            builder.Append("
Show as Gauges
\n");
            builder.Append("
Errors Only
\n");
            builder.Append("
Warnings Only
\n");
            builder.Append("
Unusuals Only
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
Maps\n");
            builder.Append("

All
\n");
            builder.Append("
Add Map
\n");
            builder.Append("
Select Map \n");
            builder.Append("

Magic Map
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
Reports\n");
            builder.Append("

All
\n");
            builder.Append("
Add Report
\n");
            builder.Append("
Select Report \n");
            builder.Append("

Summary report for all sensors
\n");
            builder.Append("
Top 100 Busy/Idle Processor Sensors
\n");
            builder.Append("
Top 100 Fastest/Slowest HTTP Sensors
\n");
            builder.Append("
Top 100 Fastest/Slowest PING Sensors
\n");
            builder.Append("
Top 100 Free/Full Disk Space Sensors
\n");
            builder.Append("
Top 100 Most/Least Used Bandwidth Sensors
\n");
            builder.Append("
Top 100 Most/Least Used Memory Sensors
\n");
            builder.Append("
Top 100 Uptime/Downtime Report
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
Configuration Reports \n");
            builder.Append("

Maps
\n");
            builder.Append("
Reports
\n");
            builder.Append("
Users & User Groups
\n");
            builder.Append("
System Configuration
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
Logs\n");
            builder.Append("

All
\n");
            builder.Append("
Status Changes \n");
            builder.Append("

Up & Down
\n");
            builder.Append("
Down
\n");
            builder.Append("
Warning
\n");
            builder.Append("
Unusual
\n");
            builder.Append("
Up
\n");
            builder.Append("
Paused/Resumed
\n");
            builder.Append("
Acknowledged Alarms
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
System Events \n");
            builder.Append("

Probe Related
\n");
            builder.Append("
Auto-Discovery
\n");
            builder.Append("
Notifications
\n");
            builder.Append("
Status Messages
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
Object History
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
Tickets\n");
            builder.Append("

All
\n");
            builder.Append("
My Tickets \n");
            builder.Append("

Open
\n");
            builder.Append("
Resolved
\n");
            builder.Append("
Closed
\n");
            builder.Append("
All
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
All Tickets \n");
            builder.Append("

Open
\n");
            builder.Append("
Resolved
\n");
            builder.Append("
Closed
\n");
            builder.Append("
All
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
ToDo Tickets \n");
            builder.Append("

Open \n");
            builder.Append("

All
\n");
            builder.Append("
Report Related
\n");
            builder.Append("
Auto-Discovery Related
\n");
            builder.Append("
Probe Related
\n");
            builder.Append("
System Errors
\n");
            builder.Append("
New Software Version
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
Resolved
\n");
            builder.Append("
Closed
\n");
            builder.Append("
All
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
Open Ticket
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("    Setup\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("        Overview\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("        Account Settings\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("            My Account\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("            Notifications\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("            Notification Contacts\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("            Schedules\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("        System Administration\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("            Manage Subscription\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("            User Interface\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("            Monitoring\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("            Notification Delivery\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("            Core & Probes\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("            User Accounts\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("            User Groups\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("            Administrative Tools\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("            Cluster\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("        PRTG Status\n");
            builder.Append("
\n");
            builder.Append("          PRTG Status\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("              System Status\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("              Cluster Status\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("          License\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("          Auto-Update\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("              Status\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("              Settings\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("          Downloads\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("              Client Apps for Mobile Devices\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("              Client App for Windows (Enterprise Console)\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("              Remote Probe Installer\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("              PRTG Tools\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("              Desktop Notifications\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("          PRTG API\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("          Enter License Key\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("          Contact Support\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("        \n");
            builder.Append("
\n");
            builder.Append("\n");
            builder.Append("
\n");
            builder.Append("

Devices

Add Sensor (Step 2 of 2)

\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("

Devices

Local Probe
Servers

ci-prtg-1

Add Sensor (Step 2 of 2)

\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("        <text>Add Sensor  to Device</text> ci-prtg-1 [ci-prtg-1]\n");
            builder.Append("         (Step 2 of 2)\n");
            builder.Append("
\n");
            builder.Append("

\n");
            builder.Append("
\n");
            builder.Append("        Cancel\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("      <form id=\"addobjectdialogform\" action=\"addsensor5.htm\" method=\"POST\" enctype=\"multipart/form-data\" class=\"prtg-form prtg-plugin formchanged\" data-plugin=\"prtg-form\" data-ajaxsubmit=\"true\">\n");
            builder.Append("          <fieldset>\n");
            builder.Append("<legend class=\"prtg-header\">Basic Sensor Settings</legend>
\n");
            builder.Append("Sensor Name\n");
            builder.Append("<div class=\"controls \" data-placement=\"right\" data-helptext=\"Enter a meaningful name to identify the sensor. By default, PRTG shows this name in the device tree, in alarms, logs, notifications, reports, maps, libraries, and tickets.
Further Help (Manual)
\">\n");
            builder.Append("<input class=\"text\"  data-rule-required=\"true\" type=\"text\" name=\"name_\" id=\"name_\" autocomplete=\"off\" value=\"XML Custom EXE/Script Sensor\" >
\n");
            builder.Append("Parent Tags\n");
            builder.Append("<div class=\"controls \" data-placement=\"right\" data-helptext=\"This field shows all tags that this object inherits from objects that are at a higher level in the hierarchy, like its parent device, its group and probe.

 Note: The inheritance of tags cannot be disabled.
Further Help (Manual)
\">\n");
            builder.Append("<input class=\"text\"  type=\"text\" name=\"parenttags_\" id=\"parenttags_\" autocomplete=\"off\" value=\"C_OS_VMware TestGroup TestProbe\" data-readonly=\"true\">
\n");
            builder.Append("Tags\n");
            builder.Append("<div class=\"controls \" data-placement=\"right\" data-helptext=\"Enter a list of tags (not case sensitive) for filtering purposes (for example, the top 10 lists use these tags). Use spaces or commas as separators.

 Note: Plus (+) or minus (-) are not allowed as first characters.
Further Help (Manual)
\">\n");
            builder.Append("<input class=\"text\"  type=\"text\" name=\"tags_\" id=\"tags_\" autocomplete=\"off\" value=\"xmlexesensor\" >
\n");
            builder.Append("Priority\n");
            builder.Append("<div class=\"controls \" data-placement=\"right\" data-helptext=\"Define the priority status of this object. PRTG can sort this object in lists according to its priority, for example.
Further Help (Manual)
\">\n");
            builder.Append("<select name=\"priority_\" class=\"combo\" id=\"priority_\" >\n");
            builder.Append("<option  value=\"5\" id=\"priority5\">***** (highest)</option>\n");
            builder.Append("<option  value=\"4\" id=\"priority4\">****</option>\n");
            builder.Append("<option  value=\"3\" selected=\"selected\"  id=\"priority3\">***</option>\n");
            builder.Append("<option  value=\"2\" id=\"priority2\">**</option>\n");
            builder.Append("<option  value=\"1\" id=\"priority1\">* (lowest)</option></select>
\n");
            builder.Append("
</fieldset><fieldset>\n");
            builder.Append("<legend class=\"prtg-header\">Sensor Settings</legend>
\n");
            builder.Append("

Important: The EXE file has to run on the computer where the parent probe is installed, not on the parent device. The working directory for \"exe\" files is the probe directory, \"vbs,ps1\" or other script files may use different working directories.

\n");
            builder.Append("EXE/Script\n");
            builder.Append("<div class=\"controls \" data-placement=\"right\" data-helptext=\"Select the executable or script file from the drop-down menu. Only files located in the Custom Sensors\\EXEXML sub-directory of the probe machine are listed.
Further Help (Manual)
\">\n");
            builder.Append("<select name=\"exefile_\" id=\"exefile_\" >\n");
            builder.Append("<option value=\"Demo Batchfile - Returns static values in four channels.bat|Demo Batchfile - Returns static values in four channels.bat||\" selected=\"selected\" >Demo Batchfile - Returns static values in four channels.bat</option>\n");
            builder.Append("<option value=\"testScript.bat|testScript.bat||\">testScript.bat</option></select>
\n");
            builder.Append("
<input type=\"hidden\" name=\"exefilelabel\" value=\"\">
\n");
            builder.Append("Parameters\n");
            builder.Append("<div class=\"controls \" data-placement=\"right\" data-helptext=\"Enter command line parameters that the sensor will pass to the EXE/script file.

Note: Use quotation marks to escape the parameters correctly, for example, if the values contain blanks. With PowerShell scripts use single quotation marks, with all other scripts use double quotation marks.
Further Help (Manual)
\">\n");
            builder.Append("<input class=\"text\"  type=\"text\" name=\"exeparams_\" id=\"exeparams_\" autocomplete=\"off\" value=\"\" >
\n");
            builder.Append("Environment\n");
            builder.Append("<div class=\"controls \" data-placement=\"right\" data-helptext=\"Define if commandline parameters of PRTG will be also available as environment parameters. Use this option carefully, there can be security issues with this option.
Further Help (Manual)
\">\n");
            builder.Append("
\n");
            builder.Append("<input type=\"radio\" class=\"hidden radio \" name=\"environment_\" value=\"0\" checked  id=\"environment0\" >\n");
            builder.Append("\n");
            builder.Append("\n");
            builder.Append("Default Environment\n");
            builder.Append("\n");
            builder.Append("<input type=\"radio\" class=\"hidden radio \" name=\"environment_\" value=\"1\" id=\"environment1\" >\n");
            builder.Append("\n");
            builder.Append("\n");
            builder.Append("Set placeholders as environment values\n");
            builder.Append("\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("Security Context\n");
            builder.Append("<div class=\"controls \" data-placement=\"right\" data-helptext=\"Choose a security context to run the EXE/script file.
Further Help (Manual)
\">\n");
            builder.Append("
\n");
            builder.Append("<input type=\"radio\" class=\"hidden radio \" name=\"usewindowsauthentication_\" value=\"0\" checked  id=\"usewindowsauthentication0\" >\n");
            builder.Append("\n");
            builder.Append("\n");
            builder.Append("Use security context of probe service\n");
            builder.Append("\n");
            builder.Append("<input type=\"radio\" class=\"hidden radio \" name=\"usewindowsauthentication_\" value=\"1\" id=\"usewindowsauthentication1\" >\n");
            builder.Append("\n");
            builder.Append("\n");
            builder.Append("Use Windows credentials of parent device\n");
            builder.Append("\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("Mutex Name\n");
            builder.Append("<div class=\"controls \" data-placement=\"right\" data-helptext=\"Enter a mutex. All EXE/Script sensors that have the same mutex name will be executed serially (not simultaneously). This is useful if you have a lot of sensors and want to avoid high resource usage caused by processes running simultaneously.
Further Help (Manual)
\">\n");
            builder.Append("<input class=\"text\"  type=\"text\" name=\"mutexname_\" id=\"mutexname_\" autocomplete=\"off\" value=\"\" >
\n");
            builder.Append("Timeout (Sec.)\n");
            builder.Append("<div class=\"controls \" data-placement=\"right\" data-helptext=\"Define a timeout. The external process will be killed if it does not return a result in this time.
Further Help (Manual)
\">\n");
            builder.Append("<input class=\"text\"  data-rule-number=\"true\" data-rule-max=\"900\" data-rule-min=\"1\" data-rule-required=\"true\" type=\"text\" name=\"timeout_\" id=\"timeout_\" autocomplete=\"off\" value=\"60\" >
\n");
            builder.Append("EXE Result\n");
            builder.Append("<div class=\"controls \" data-placement=\"right\" data-helptext=\"Define if the EXE result will be stored (Filename: 'Result of Sensor [ID].txt'). If enabled, a text file with the last response will be stored in the Logs (Sensors) directory (on the computer running the probe).
Further Help (Manual)
\">\n");
            builder.Append("
\n");
            builder.Append("<input type=\"radio\" class=\"hidden radio \" name=\"writeresult_\" value=\"0\" checked  id=\"writeresult0\" >\n");
            builder.Append("\n");
            builder.Append("\n");
            builder.Append("Discard EXE result\n");
            builder.Append("\n");
            builder.Append("<input type=\"radio\" class=\"hidden radio \" name=\"writeresult_\" value=\"1\" id=\"writeresult1\" >\n");
            builder.Append("\n");
            builder.Append("\n");
            builder.Append("Write EXE result to disk\n");
            builder.Append("\n");
            builder.Append("<input type=\"radio\" class=\"hidden radio \" name=\"writeresult_\" value=\"2\" id=\"writeresult2\" >\n");
            builder.Append("\n");
            builder.Append("\n");
            builder.Append("Write EXE result to disk in case of error\n");
            builder.Append("\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
</fieldset><fieldset class=\"collapsed\">\n");
            builder.Append("<legend class=\"prtg-header\">Scanning Interval\n");
            builder.Append("\n");
            builder.Append("<input name=\"intervalgroup\" type=\"hidden\" value=\"0\"><input class=\"toggleFieldset GroupShowHide checkbox\" name=\"intervalgroup\" type=\"checkbox\" value=\"1\" id=\"Inheritintervalgroup\"  checked=\"checked\" ><label for=\"Inheritintervalgroup\"data-placement=\"right\" data-helptext=\"Clicking inherit from breaks the inheritance and allows you to make your own settings. Clicking it again reverts back to the inheritance and overrides your settings.\"\">inherit from ci-prtg-1 \n");
            builder.Append(" (Scanning Interval: 60 seconds, Set sensor to ...)\n");
            builder.Append("</legend>
\n");
            builder.Append("Scanning Interval\n");
            builder.Append("<div class=\"controls \" data-placement=\"right\" data-helptext=\"Select the period of time between two scans.
Further Help (Manual)
\">\n");
            builder.Append("<select name=\"interval_\" id=\"interval_\" >\n");
            builder.Append("<option value=\"5|5 seconds (Not officially supported)\">5 seconds (Not officially supported)</option>\n");
            builder.Append("<option value=\"10|10 seconds\">10 seconds</option>\n");
            builder.Append("<option value=\"30|30 seconds\">30 seconds</option>\n");
            builder.Append("<option value=\"60|60 seconds\" selected=\"selected\" >60 seconds</option>\n");
            builder.Append("<option value=\"300|5 minutes\">5 minutes</option>\n");
            builder.Append("<option value=\"600|10 minutes\">10 minutes</option>\n");
            builder.Append("<option value=\"900|15 minutes\">15 minutes</option>\n");
            builder.Append("<option value=\"1800|30 minutes\">30 minutes</option>\n");
            builder.Append("<option value=\"3600|1 hour\">1 hour</option>\n");
            builder.Append("<option value=\"14400|4 hours\">4 hours</option>\n");
            builder.Append("<option value=\"21600|6 hours\">6 hours</option>\n");
            builder.Append("<option value=\"43200|12 hours\">12 hours</option>\n");
            builder.Append("<option value=\"86400|24 hours\">24 hours</option></select>
\n");
            builder.Append("If a Sensor Query Fails\n");
            builder.Append("<div class=\"controls \" data-placement=\"right\" data-helptext=\"If a sensor query fails, for example, because the monitored device is unreachable, PRTG can try to reach and check the device again within the next scanning interval before the sensor is shown as 'down'. This can avoid false alarms if your device has temporary issues only.

Note: WMI sensors always use at least 1 interval. Channel error limits and channels using lookups will always set the sensor to 'down' immediately.
Further Help (Manual)
\">\n");
            builder.Append("<select name=\"errorintervalsdown_\" class=\"combo\" id=\"errorintervalsdown_\" >\n");
            builder.Append("<option  value=\"0\" id=\"errorintervalsdown0\">Set sensor to "down" immediately</option>\n");
            builder.Append("<option  value=\"1\" selected=\"selected\"  id=\"errorintervalsdown1\">Set sensor to warning for 1 interval, then set to "down" (recommended)</option>\n");
            builder.Append("<option  value=\"2\" id=\"errorintervalsdown2\">Set sensor to warning for 2 intervals, then set to "down"</option>\n");
            builder.Append("<option  value=\"3\" id=\"errorintervalsdown3\">Set sensor to warning for 3 intervals, then set to "down"</option>\n");
            builder.Append("<option  value=\"4\" id=\"errorintervalsdown4\">Set sensor to warning for 4 intervals, then set to "down"</option>\n");
            builder.Append("<option  value=\"5\" id=\"errorintervalsdown5\">Set sensor to warning for 5 intervals, then set to "down"</option></select>
\n");
            builder.Append("
<input type=\"hidden\" name=\"inherittriggers\" value=\"1\">
\n");
            builder.Append("
</fieldset><input type=\"hidden\" name=\"id\" value=\"2055\"> <input type=\"hidden\" name=\"sensortype\" value=\"exexml\">\n");
            builder.Append("          <input type=\"hidden\" id=\"tmpid\" name=\"tmpid\" value=\"2\">\n");
            builder.Append("
\n");
            builder.Append("              <button style='' class=\"submit btngrey button quick-action-button force-visible\" type=\"submit\">Continue</button>\n");
            builder.Append("              <button style='' type=\"submit\" class='ui-icon quick-action-badge continue-badge'></button>\n");
            builder.Append("
\n");
            builder.Append("      </form>\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("  \n");
            builder.Append("  \n");
            builder.Append("  \n");
            builder.Append("  \n");
            builder.Append("  \n");
            builder.Append("  \n");
            builder.Append("  \n");
            builder.Append("  \n");
            builder.Append("

Specifying sensor settings

Please specify the settings for the new sensor. Help: Sensor Settings

\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("<tct\n");
            builder.Append("  data-role=\"action\"\n");
            builder.Append("  data-page=\"facelift-update\">\n");
            builder.Append("
\n");
            builder.Append("
Major UI Improvements
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("                Welcome to the all-new web interface of PRTG! We have tidied up PRTG and given it a cleaner look so you can find what you need more easily.\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("                \n");
            builder.Append("                    This PRTG version includes many improvements to the look and feel of the UI. For example, Add buttons in the device tree have been bundled into one central location for ease of use.\n");
            builder.Append("                    Click  to open the new Add menu.\n");
            builder.Append("                \n");
            builder.Append("                New Add Sensor Buttons in the Device Tree\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("                \n");
            builder.Append("                        \n");
            builder.Append("                        Editing in Table Lists with Multi-Edit\n");
            builder.Append("                \n");
            builder.Append("                \n");
            builder.Append("                    The Edit function in table lists now always works like the former Multi-Edit function. Select the object/s you want to edit and the menu appears to the right.\n");
            builder.Append("                \n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("                \n");
            builder.Append("                        \n");
            builder.Append("                        New Floating Save Button in Forms\n");
            builder.Append("                \n");
            builder.Append("                \n");
            builder.Append("                    Forms now have a floating Save button in the bottom right corner. The button turns blue once you have made changes and you can save at any time.\n");
            builder.Append("                \n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("                \n");
            builder.Append("                        \n");
            builder.Append("                        New Show/Hide Filters Function\n");
            builder.Append("                \n");
            builder.Append("                \n");
            builder.Append("                    Table lists now have separate filters that you can hide or show.\n");
            builder.Append("                \n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("                \n");
            builder.Append("                        \n");
            builder.Append("                        New Object Selector for Device Tree Object Submenus\n");
            builder.Append("                \n");
            builder.Append("                \n");
            builder.Append("                 The submenus for device tree objects in the main menu bar have been removed and the respective pages now have a new object selector.\n");
            builder.Append("                \n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("                    These are just a few of the improvements we have made.
 For more information, please see the manual or our\n");
            builder.Append("                    blog.
 Enjoy!\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("</tct>\n");
            builder.Append("    \n");
            builder.Append("

\n");
            builder.Append("

\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("                    \n");
            builder.Append("                    Help\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("                        Get more help in the Help Center!\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("            \n");
            builder.Append("            17.4.35.3441  \n");
            builder.Append("            PRTG System Administrator\n");
            builder.Append("            \n");
            builder.Append("                \n");
            builder.Append("                4:19:01 PM\n");
            builder.Append("            \n");
            builder.Append("            \n");
            builder.Append("                \n");
            builder.Append("                Refresh in\n");
            builder.Append("                30\n");
            builder.Append("                sec\n");
            builder.Append("                Refreshing...\n");
            builder.Append("            \n");
            builder.Append("
\n");
            builder.Append("
\n");
            builder.Append("            \n");
            builder.Append("            \n");
            builder.Append("                 Update Available\n");
            builder.Append("            \n");
            builder.Append("             Live Chat\n");
            builder.Append("            \n");
            builder.Append("                Contact Support\n");
            builder.Append("            \n");
            builder.Append("            \n");
            builder.Append("                \n");
            builder.Append("                    Help\n");
            builder.Append("                \n");
            builder.Append("            \n");
            builder.Append("
\n");
            builder.Append("    \n");
            builder.Append("\n");
            builder.Append("

\n");
            builder.Append("
\n");
            builder.Append("    Sorry, the AJAX Web Interface of PRTG can not work properly without Javascript.

Javascript seems to be disabled or this browser does not support Javascript.

Please enable Javascript\n");
            builder.Append("
\n");
            builder.Append("\n");
            builder.Append("\n");
            builder.Append("\n");
            builder.Append("\n");

            return builder.ToString();
        }
    }
}


text:
<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateItemsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('items', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('invoice_id')->unsigned()->index();
            $table->string('description');
            $table->double('value', 15, 2);
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('items');
    }
}