text:
/**
 * @license Highcharts JS v8.1.2 (2020-06-16)
 *
 * (c) 2009-2019 Sebastian Bochan, Rafal Sebestjanski
 *
 * License: www.highcharts.com/license
 */
'use strict';
(function (factory) {
    if (typeof module === 'object' && module.exports) {
        factory['default'] = factory;
        module.exports = factory;
    } else if (typeof define === 'function' && define.amd) {
        define('highcharts/modules/dumbbell', ['highcharts'], function (Highcharts) {
            factory(Highcharts);
            factory.Highcharts = Highcharts;
            return factory;
        });
    } else {
        factory(typeof Highcharts !== 'undefined' ? Highcharts : undefined);
    }
}(function (Highcharts) {
    var _modules = Highcharts ? Highcharts._modules : {};
    function _registerModule(obj, path, args, fn) {
        if (!obj.hasOwnProperty(path)) {
            obj[path] = fn.apply(null, args);
        }
    }
    _registerModule(_modules, 'modules/dumbbell.src.js', [_modules['parts/Globals.js'], _modules['parts/Utilities.js']], function (H, U) {
        /* *
         *
         *  (c) 2010-2020 Sebastian Bochan, Rafal Sebestjanski
         *
         *  License: www.highcharts.com/license
         *
         *  !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
         *
         * */
        var SVGRenderer = H.SVGRenderer;
        var extend = U.extend,
            pick = U.pick,
            seriesType = U.seriesType;
        var seriesTypes = H.seriesTypes,
            seriesProto = H.Series.prototype,
            areaRangeProto = seriesTypes.arearange.prototype,
            columnRangeProto = seriesTypes.columnrange.prototype,
            colProto = seriesTypes.column.prototype,
            areaRangePointProto = areaRangeProto.pointClass.prototype;
        /**
         * The dumbbell series is a cartesian series with higher and lower values for
         * each point along an X axis, connected with a line between the values.
         * Requires `highcharts-more.js` and `modules/dumbbell.js`.
         *
         * @sample {highcharts} highcharts/demo/dumbbell/
         *         Dumbbell chart
         * @sample {highcharts} highcharts/series-dumbbell/styled-mode-dumbbell/
         *         Styled mode
         *
         * @extends      plotOptions.arearange
         * @product      highcharts highstock
         * @excluding    fillColor, fillOpacity, lineWidth, stack, stacking,
         *               stickyTracking, trackByArea
         * @since 8.0.0
         * @optionparent plotOptions.dumbbell
         */
        seriesType('dumbbell', 'arearange', {
            /** @ignore-option */
            trackByArea: false,
            /** @ignore-option */
            fillColor: 'none',
            /** @ignore-option */
            lineWidth: 0,
            pointRange: 1,
            /**
             * Pixel width of the line that connects the dumbbell point's values.
             *
             * @since 8.0.0
             * @product   highcharts highstock
             */
            connectorWidth: 1,
            /** @ignore-option */
            stickyTracking: false,
            groupPadding: 0.2,
            crisp: false,
            pointPadding: 0.1,
            /**
             * Color of the start markers in a dumbbell graph.
             *
             * @type      {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}
             * @since 8.0.0
             * @product   highcharts highstock
             */
            lowColor: '#333333',
            /**
             * Color of the line that connects the dumbbell point's values.
             * By default it is the series' color.
             *
             * @type      {string}
             * @product   highcharts highstock
             * @since 8.0.0
             * @apioption plotOptions.dumbbell.connectorColor
             */
            states: {
                hover: {
                    /** @ignore-option */
                    lineWidthPlus: 0,
                    /**
                     * The additional connector line width for a hovered point.
                     *
                     * @since 8.0.0
                     * @product   highcharts highstock
                     */
                    connectorWidthPlus: 1,
                    /** @ignore-option */
                    halo: false
                }
            }
        }, {
            trackerGroups: ['group', 'markerGroup', 'dataLabelsGroup'],
            drawTracker: H.TrackerMixin.drawTrackerPoint,
            drawGraph: H.noop,
            crispCol: colProto.crispCol,
            /**
             * Get connector line path and styles that connects dumbbell point's low and
             * high values.
             * @private
             *
             * @param {Highcharts.Series} this The series of points.
             * @param {Highcharts.Point} point The point to inspect.
             *
             * @return {Highcharts.SVGAttributes} attribs The path and styles.
             */
            getConnectorAttribs: function (point) {
                var series = this,
                    chart = series.chart,
                    pointOptions = point.options,
                    seriesOptions = series.options,
                    xAxis = series.xAxis,
                    yAxis = series.yAxis,
                    connectorWidth = pick(pointOptions.connectorWidth,
                    seriesOptions.connectorWidth),
                    connectorColor = pick(pointOptions.connectorColor,
                    seriesOptions.connectorColor,
                    pointOptions.color,
                    point.zone ? point.zone.color : void 0,
                    point.color),
                    connectorWidthPlus = pick(seriesOptions.states &&
                        seriesOptions.states.hover &&
                        seriesOptions.states.hover.connectorWidthPlus, 1),
                    dashStyle = pick(pointOptions.dashStyle,
                    seriesOptions.dashStyle),
                    pointTop = pick(point.plotLow,
                    point.plotY),
                    pxThreshold = yAxis.toPixels(seriesOptions.threshold || 0,
                    true),
                    pointHeight = chart.inverted ?
                        yAxis.len - pxThreshold : pxThreshold,
                    pointBottom = pick(point.plotHigh,
                    pointHeight),
                    attribs,
                    origProps;
                if (point.state) {
                    connectorWidth = connectorWidth + connectorWidthPlus;
                }
                if (pointTop < 0) {
                    pointTop = 0;
                }
                else if (pointTop >= yAxis.len) {
                    pointTop = yAxis.len;
                }
                if (pointBottom < 0) {
                    pointBottom = 0;
                }
                else if (pointBottom >= yAxis.len) {
                    pointBottom = yAxis.len;
                }
                if (point.plotX < 0 || point.plotX > xAxis.len) {
                    connectorWidth = 0;
                }
                // Connector should reflect upper marker's zone color
                if (point.upperGraphic) {
                    origProps = {
                        y: point.y,
                        zone: point.zone
                    };
                    point.y = point.high;
                    point.zone = point.zone ? point.getZone() : void 0;
                    connectorColor = pick(pointOptions.connectorColor, seriesOptions.connectorColor, pointOptions.color, point.zone ? point.zone.color : void 0, point.color);
                    extend(point, origProps);
                }
                attribs = {
                    d: SVGRenderer.prototype.crispLine([[
                            'M',
                            point.plotX,
                            pointTop
                        ], [
                            'L',
                            point.plotX,
                            pointBottom
                        ]], connectorWidth, 'ceil')
                };
                if (!chart.styledMode) {
                    attribs.stroke = connectorColor;
                    attribs['stroke-width'] = connectorWidth;
                    if (dashStyle) {
                        attribs.dashstyle = dashStyle;
                    }
                }
                return attribs;
            },
            /**
             * Draw connector line that connects dumbbell point's low and high values.
             * @private
             *
             * @param {Highcharts.Series} this The series of points.
             * @param {Highcharts.Point} point The point to inspect.
             *
             * @return {void}
             */
            drawConnector: function (point) {
                var series = this,
                    animationLimit = pick(series.options.animationLimit, 250),
                    verb = point.connector && series.chart.pointCount < animationLimit ?
                        'animate' : 'attr';
                if (!point.connector) {
                    point.connector = series.chart.renderer.path()
                        .addClass('highcharts-lollipop-stem')
                        .attr({
                        zIndex: -1
                    })
                        .add(series.markerGroup);
                }
                point.connector[verb](this.getConnectorAttribs(point));
            },
            /**
             * Return the width and x offset of the dumbbell adjusted for grouping,
             * groupPadding, pointPadding, pointWidth etc.
             *
             * @private
             *
             * @function Highcharts.seriesTypes.column#getColumnMetrics
             *
             * @param {Highcharts.Series} this The series of points.
             *
             * @return {Highcharts.ColumnMetricsObject} metrics shapeArgs
             *
             */
            getColumnMetrics: function () {
                var metrics = colProto.getColumnMetrics.apply(this,
                    arguments);
                metrics.offset += metrics.width / 2;
                return metrics;
            },
            translatePoint: areaRangeProto.translate,
            setShapeArgs: columnRangeProto.translate,
            /**
             * Translate each point to the plot area coordinate system and find
             * shape positions
             *
             * @private
             *
             * @function Highcharts.seriesTypes.dumbbell#translate
             *
             * @param {Highcharts.Series} this The series of points.
             *
             * @return {void}
             */
            translate: function () {
                // Calculate shapeargs
                this.setShapeArgs.apply(this);
                // Calculate point low / high values
                this.translatePoint.apply(this, arguments);
                // Correct x position
                this.points.forEach(function (point) {
                    var shapeArgs = point.shapeArgs,
                        pointWidth = point.pointWidth;
                    point.plotX = shapeArgs.x;
                    shapeArgs.x = point.plotX - pointWidth / 2;
                    point.tooltipPos = null;
                });
                this.columnMetrics.offset -= this.columnMetrics.width / 2;
            },
            seriesDrawPoints: areaRangeProto.drawPoints,
            /**
             * Extend the arearange series' drawPoints method by applying a connector
             * and coloring markers.
             * @private
             *
             * @function Highcharts.Series#drawPoints
             *
             * @param {Highcharts.Series} this The series of points.
             *
             * @return {void}
             */
            drawPoints: function () {
                var series = this,
                    chart = series.chart,
                    pointLength = series.points.length,
                    seriesLowColor = series.lowColor = series.options.lowColor,
                    i = 0,
                    lowerGraphicColor,
                    point,
                    zoneColor;
                this.seriesDrawPoints.apply(series, arguments);
                // Draw connectors and color upper markers
                while (i < pointLength) {
                    point = series.points[i];
                    series.drawConnector(point);
                    if (point.upperGraphic) {
                        point.upperGraphic.element.point = point;
                        point.upperGraphic.addClass('highcharts-lollipop-high');
                    }
                    point.connector.element.point = point;
                    if (point.lowerGraphic) {
                        zoneColor = point.zone && point.zone.color;
                        lowerGraphicColor = pick(point.options.lowColor, seriesLowColor, point.options.color, zoneColor, point.color, series.color);
                        if (!chart.styledMode) {
                            point.lowerGraphic.attr({
                                fill: lowerGraphicColor
                            });
                        }
                        point.lowerGraphic.addClass('highcharts-lollipop-low');
                    }
                    i++;
                }
            },
            /**
             * Get non-presentational attributes for a point. Used internally for
             * both styled mode and classic. Set correct position in link with connector
             * line.
             *
             * @see Series#pointAttribs
             *
             * @function Highcharts.Series#markerAttribs
             *
             * @param {Highcharts.Series} this The series of points.
             *
             * @return {Highcharts.SVGAttributes}
             *         A hash containing those attributes that are not settable from
             *         CSS.
             */
            markerAttribs: function () {
                var ret = areaRangeProto.markerAttribs.apply(this,
                    arguments);
                ret.x = Math.floor(ret.x);
                ret.y = Math.floor(ret.y);
                return ret;
            },
            /**
             * Get presentational attributes
             *
             * @private
             * @function Highcharts.seriesTypes.column#pointAttribs
             *
             * @param {Highcharts.Series} this The series of points.
             * @param {Highcharts.Point} point The point to inspect.
             * @param {string} state current state of point (normal, hover, select)
             *
             * @return {Highcharts.SVGAttributes} pointAttribs SVGAttributes
             */
            pointAttribs: function (point, state) {
                var pointAttribs;
                pointAttribs = seriesProto.pointAttribs.apply(this, arguments);
                if (state === 'hover') {
                    delete pointAttribs.fill;
                }
                return pointAttribs;
            }
        }, {
            // seriesTypes doesn't inherit from arearange point proto so put below
            // methods rigidly.
            destroyElements: areaRangePointProto.destroyElements,
            isValid: areaRangePointProto.isValid,
            pointSetState: areaRangePointProto.setState,
            /**
             * Set the point's state extended by have influence on the connector
             * (between low and high value).
             *
             * @private
             * @param {Highcharts.Point} this The point to inspect.
             *
             * @return {void}
             */
            setState: function () {
                var point = this,
                    series = point.series,
                    chart = series.chart,
                    seriesLowColor = series.options.lowColor,
                    seriesMarker = series.options.marker,
                    pointOptions = point.options,
                    pointLowColor = pointOptions.lowColor,
                    zoneColor = point.zone && point.zone.color,
                    lowerGraphicColor = pick(pointLowColor,
                    seriesLowColor,
                    pointOptions.color,
                    zoneColor,
                    point.color,
                    series.color),
                    verb = 'attr',
                    upperGraphicColor,
                    origProps;
                this.pointSetState.apply(this, arguments);
                if (!point.state) {
                    verb = 'animate';
                    if (point.lowerGraphic && !chart.styledMode) {
                        point.lowerGraphic.attr({
                            fill: lowerGraphicColor
                        });
                        if (point.upperGraphic) {
                            origProps = {
                                y: point.y,
                                zone: point.zone
                            };
                            point.y = point.high;
                            point.zone = point.zone ? point.getZone() : void 0;
                            upperGraphicColor = pick(point.marker ? point.marker.fillColor : void 0, seriesMarker ? seriesMarker.fillColor : void 0, pointOptions.color, point.zone ? point.zone.color : void 0, point.color);
                            point.upperGraphic.attr({
                                fill: upperGraphicColor
                            });
                            extend(point, origProps);
                        }
                    }
                }
                point.connector[verb](series.getConnectorAttribs(point));
            }
        });
        /**
         * The `dumbbell` series. If the [type](#series.dumbbell.type) option is
         * not specified, it is inherited from [chart.type](#chart.type).
         *
         * @extends   series,plotOptions.dumbbell
         * @product   highcharts highstock
         * @requires  highcharts-more
         * @requires  modules/dumbbell
         * @apioption series.dumbbell
         */
        /**
         * An array of data points for the series. For the `dumbbell` series
         * type, points can be given in the following ways:
         *
         * 1. An array of arrays with 3 or 2 values. In this case, the values correspond
         *    to `x,low,high`. If the first value is a string, it is applied as the name
         *    of the point, and the `x` value is inferred. The `x` value can also be
         *    omitted, in which case the inner arrays should be of length 2\. Then the
         *    `x` value is automatically calculated, either starting at 0 and
         *    incremented by 1, or from `pointStart` and `pointInterval` given in the
         *    series options.
         *    ```js
         *    data: [
         *        [0, 4, 2],
         *        [1, 2, 1],
         *        [2, 9, 10]
         *    ]
         *    ```
         *
         * 2. An array of objects with named values. The following snippet shows only a
         *    few settings, see the complete options set below. If the total number of
         *    data points exceeds the series'
         *    [turboThreshold](#series.dumbbell.turboThreshold), this option is not
         *    available.
         *    ```js
         *    data: [{
         *        x: 1,
         *        low: 0,
         *        high: 4,
         *        name: "Point2",
         *        color: "#00FF00",
         *        lowColor: "#00FFFF",
         *        connectorWidth: 3,
         *        connectorColor: "#FF00FF"
         *    }, {
         *        x: 1,
         *        low: 5,
         *        high: 3,
         *        name: "Point1",
         *        color: "#FF00FF"
         *    }]
         *    ```
         *
         * @sample {highcharts} highcharts/series/data-array-of-arrays/
         *         Arrays of numeric x and y
         * @sample {highcharts} highcharts/series/data-array-of-arrays-datetime/
         *         Arrays of datetime x and y
         * @sample {highcharts} highcharts/series/data-array-of-name-value/
         *         Arrays of point.name and y
         * @sample {highcharts} highcharts/series/data-array-of-objects/
         *         Config objects
         *
         * @type      {Array<Array<(number|string),number>|Array<(number|string),number,number>|*>}
         * @extends   series.arearange.data
         * @product   highcharts highstock
         * @apioption series.dumbbell.data
         */
        /**
         * Color of the line that connects the dumbbell point's values.
         * By default it is the series' color.
         *
         * @type        {string}
         * @since       8.0.0
         * @product     highcharts highstock
         * @apioption   series.dumbbell.data.connectorColor
         */
        /**
         * Pixel width of the line that connects the dumbbell point's values.
         *
         * @type        {number}
         * @since       8.0.0
         * @default     1
         * @product     highcharts highstock
         * @apioption   series.dumbbell.data.connectorWidth
         */
        /**
         * Color of the start markers in a dumbbell graph.
         *
         * @type        {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}
         * @since       8.0.0
         * @default     #333333
         * @product     highcharts highstock
         * @apioption   series.dumbbell.data.lowColor
         */
        ''; // adds doclets above to transpiled file

    });
    _registerModule(_modules, 'masters/modules/dumbbell.src.js', [], function () {

    });
}));


text:
using System;
using System.Net;
using System.Text;
using System.Net.Sockets;
using OpenSource.UPnP;

namespace UPnPSniffer
{
    /// <summary>
    /// Summary description for UPnPMulticastSniffer.
    /// </summary>
    public class UPnPMulticastSniffer
    {
        public delegate void PacketHandler(object sender, string Packet, IPEndPoint Local, IPEndPoint From);
        public event PacketHandler OnPacket;
        private UdpClient client = null;

        public UPnPMulticastSniffer(IPEndPoint local)
        {
            client = new UdpClient(local.AddressFamily);
            try { client.ExclusiveAddressUse = false; } catch (SocketException) { }
            try { client.Client.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, true); } catch (SocketException) { }
            try { client.Client.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ExclusiveAddressUse, false); } catch (SocketException) { }
            try { client.EnableBroadcast = true; } catch (SocketException) { }
            if (!Utils.IsMono())
            {
                client.Client.Bind(local);
            }
            else
            {
                if (local.AddressFamily == AddressFamily.InterNetwork) client.Client.Bind(new IPEndPoint(IPAddress.Any, local.Port));
                if (local.AddressFamily == AddressFamily.InterNetworkV6) client.Client.Bind(new IPEndPoint(IPAddress.IPv6Any, local.Port));
            }
            if (local.AddressFamily == AddressFamily.InterNetwork) client.JoinMulticastGroup(IPAddress.Parse("239.255.255.250"), local.Address);
            if (local.AddressFamily == AddressFamily.InterNetworkV6)
            {
                if (local.Address.IsIPv6LinkLocal) client.JoinMulticastGroup((int)local.Address.ScopeId, IPAddress.Parse("FF02::C"));
                else client.JoinMulticastGroup((int)local.Address.ScopeId, IPAddress.Parse("FF05::C"));
            }
            client.BeginReceive(new AsyncCallback(OnReceiveSink), local);
        }

        public void OnReceiveSink(IAsyncResult ar)
        {
            IPEndPoint ep = null;
            IPEndPoint local = (IPEndPoint)ar.AsyncState;
            byte[] buf = null;
            try { buf = client.EndReceive(ar, ref ep); } catch (Exception) { }
            if (buf != null && buf.Length > 0 && OnPacket != null)
            {
                if (!Utils.IsMono())
                {
                    if (client.Client.LocalEndPoint != null & ep != null) OnPacket(this, UTF8Encoding.UTF8.GetString(buf, 0, buf.Length), (IPEndPoint)client.Client.LocalEndPoint, ep);
                }
                else
                {
                    if (local != null && ep != null) OnPacket(this, UTF8Encoding.UTF8.GetString(buf, 0, buf.Length), local, ep);
                }
            }
            try { client.BeginReceive(new AsyncCallback(OnReceiveSink), local); }
            catch (Exception) { }
        }

        public void Dispose()
        {
            if (client == null) return;
            client.Close();
            client = null;
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
import datetime
import time
from urlparse import urlparse

import requests

from requests.exceptions import RequestException

# Needs to be run in a Stackstorm virtualenv
from st2actions.runners.pythonrunner import Action

class PollStatus(Action):
    """
    Polls a give micro service URL for current status of some long running process.

    Will check the HTTP server's response to determine whether or not the process has finished
    processing. It expects a JSON field called "state", and will continue to poll the URL
    as long as "state" equals "started". If e.g. "done", "error", or "none" is received an
    error is generated and the polling stops.
    """

    def query(self, url, verify_ssl_cert):
        try:
            resp = requests.get(url, verify=verify_ssl_cert)
            return resp
        except RequestException as err:
            self.logger.error("An error was encountered when "
                              "querying url: {0},  {1}".format(url, err))
            raise err

    def post_to_endpoint(self, endpoint, body, irma_mode, verify_ssl_cert):

        def _rewrite_link(link):
            endpoint_parsed = urlparse(endpoint)
            # Gets the first non-empty element from the path, this lets it account
            # for multiple slashes
            first_part_of_path = filter(None, endpoint_parsed.path.split('/'))[0]
            link_parsed = urlparse(link)
            return "{}://{}/{}{}?{}".format(endpoint_parsed.scheme,
                                            endpoint_parsed.netloc,
                                            first_part_of_path,
                                            link_parsed.path,
                                            endpoint_parsed.query)

        try:
            response = requests.post(endpoint, json=body, verify=verify_ssl_cert)
            response_json = response.json()

            if irma_mode:
                modified_link = _rewrite_link(response_json['link'])
                self.logger.info("In irma mode, will rewrite link to: {}".format(modified_link))
                return {"response": response_json, "url": modified_link}
            else:
                return {"response": response_json, "url": response_json['link']}
        except RequestException as err:
            self.logger.error("An error was encountered when trying to "
                                "post to url: {0}, {1}".format(endpoint, err))
            raise err
        except KeyError as err:
            self.logger.error("Could not find correct key in response json: {}".format(response_json))
            raise err
        except ValueError as err:
            self.logger.error("Error decoding response as json. Got status: {} and response: {}".format(
                response.status_code,
                response.content))
            raise err

    def check_status(self, url, sleep, ignore_result, verify_ssl_cert, max_retries):
        """
        Query the url end-point. Can be called directly from StackStorm, or via the script cli
        :param url: to call
        :param sleep: minutes to sleep between attempts
        :param ignore_result: return 0 exit status even if polling failed (for known errors).
        :param verify_ssl_cert: Set to False to skip verifying the ssl cert when making requests
        :param max_retries: maximum number of retries
        :return: None
        """
        retry_attempts = 0
        state = "started"

        while state == "started" or state == "pending" or not state:
            current_time = datetime.datetime.now()

            resp = self.query(url, verify_ssl_cert)
            json_resp = resp.json()
            state = json_resp["state"]

            if state == "started" or state == "pending":
                self.logger.info("{0} -- {1} returned state {2}. Sleeping {3}m until retrying again...".format(current_time,
                                                                                url,
                                                                                state,
                                                                                sleep))
                time.sleep(sleep * 60)
            elif state == "done":
                self.logger.info("{0} -- {1} returned state {2}. Will now stop polling the status.".format(current_time,
                                                                                url,
                                                                                state))

                return True, json_resp
            elif state in ["error", "none", "cancelled"]:
                self.logger.warning("{0} -- {1} returned state {2}. Will now stop polling the status.".format(current_time,
                                                                                url,
                                                                                state))

                if ignore_result:
                    self.logger.warning("Ignoring the failed result because of override flag.")
                    return True, json_resp
                else:
                    return False, json_resp

            elif not state and retry_attempts < max_retries:
                retry_attempts += 1
                self.logger.warning("{0} -- {1} did not report state. "
                                    "Probably due to a connection error, "
                                    "will retry. Attempt {2} of {3}.".format(current_time,
                                                                             url,
                                                                             retry_attempts,
                                                                             max_retries))
                time.sleep(sleep * 60)
            else:
                self.logger.error("{0} -- {1} returned state unknown state {2}. "
                                  "Will now stop polling the status.".format(current_time, url, state))
                return False, json_resp

    def run(self, url, body, sleep, ignore_result, irma_mode, verify_ssl_cert, max_retries=3):
        start_response = self.post_to_endpoint(url, body, irma_mode, verify_ssl_cert)
        status_link = start_response['url']
        status_val, status_response = self.check_status(status_link, sleep, ignore_result, verify_ssl_cert, max_retries)
        return status_val, { "response_from_start": start_response, "response_from_last_status_check": status_response }


text:
<?php

defined('SYSPATH') or die('No direct script access.');

class Aurora_Property extends Aurora_Aurora_Property
{

}


text:
namespace Machete.Formatters
{
    using System.Reflection;
    using Internals.Reflection;

    public class ValueListEntityPropertyFormatter<TEntity, TValue> :
        IEntityPropertyFormatter<TEntity>
        where TEntity : Entity
    {
        readonly ReadOnlyProperty<TEntity, ValueList<TValue>> _property;
        readonly IValueFormatter<TValue> _formatter;

        public ValueListEntityPropertyFormatter(PropertyInfo propertyInfo, IValueFormatter<TValue> formatter)
        {
            _formatter = formatter;
            _property = new ReadOnlyProperty<TEntity, ValueList<TValue>>(propertyInfo);
        }

        public void Format(FormatEntityContext<TEntity> context)
        {
            var value = _property.GetProperty(context.Entity);
            if (value.HasValue)
            {
                for (int i = 0;; i++)
                {
                    Value<TValue> currentValue;
                    if (!value.TryGetValue(i, out currentValue) || !value.IsPresent)
                        break;

                    if (value.HasValue)
                        _formatter.Format(context.CreateValueContext(currentValue));
                }
            }
        }
    }
}


text: Directory for non-application-specific modules.


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

<title>infodynamics.measures.continuous.gaussian Class Hierarchy</title>
<meta name="date" content="2015-07-20">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Hierarchy For Package infodynamics.measures.continuous.gaussian

Package Hierarchies:

All Packages

Class Hierarchy

java.lang.Object

infodynamics.measures.continuous.ActiveInfoStorageCalculatorViaMutualInfo (implements infodynamics.measures.continuous.ActiveInfoStorageCalculator)

infodynamics.measures.continuous.gaussian.ActiveInfoStorageCalculatorGaussian

infodynamics.measures.continuous.ConditionalMutualInfoMultiVariateCommon (implements infodynamics.measures.continuous.ConditionalMutualInfoCalculatorMultiVariate)

infodynamics.measures.continuous.gaussian.ConditionalMutualInfoCalculatorMultiVariateGaussian (implements infodynamics.utils.AnalyticNullDistributionComputer, java.lang.Cloneable, infodynamics.measures.continuous.ConditionalMutualInfoCalculatorMultiVariate)

infodynamics.measures.continuous.ConditionalTransferEntropyCalculatorViaCondMutualInfo (implements infodynamics.measures.continuous.ConditionalTransferEntropyCalculator)

infodynamics.measures.continuous.gaussian.ConditionalTransferEntropyCalculatorGaussian (implements infodynamics.utils.AnalyticNullDistributionComputer)

infodynamics.measures.continuous.gaussian.EntropyCalculatorGaussian (implements infodynamics.measures.continuous.EntropyCalculator)

infodynamics.measures.continuous.gaussian.EntropyCalculatorMultiVariateGaussian (implements java.lang.Cloneable, infodynamics.measures.continuous.EntropyCalculatorMultiVariate)

infodynamics.measures.continuous.MutualInfoMultiVariateCommon (implements infodynamics.measures.continuous.MutualInfoCalculatorMultiVariate)

infodynamics.measures.continuous.gaussian.MutualInfoCalculatorMultiVariateGaussian (implements infodynamics.utils.AnalyticNullDistributionComputer, java.lang.Cloneable, infodynamics.measures.continuous.MutualInfoCalculatorMultiVariate)

infodynamics.measures.continuous.PredictiveInfoCalculatorViaMutualInfo (implements infodynamics.measures.continuous.PredictiveInfoCalculator)

infodynamics.measures.continuous.gaussian.PredictiveInfoCalculatorGaussian

infodynamics.measures.continuous.TransferEntropyCalculatorViaCondMutualInfo (implements infodynamics.measures.continuous.TransferEntropyCalculator)

infodynamics.measures.continuous.gaussian.TransferEntropyCalculatorGaussian (implements infodynamics.utils.AnalyticNullDistributionComputer)

infodynamics.measures.continuous.TransferEntropyCalculatorMultiVariateViaCondMutualInfo (implements infodynamics.measures.continuous.TransferEntropyCalculatorMultiVariate)

infodynamics.measures.continuous.gaussian.TransferEntropyCalculatorMultiVariateGaussian (implements infodynamics.utils.AnalyticNullDistributionComputer)

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CordSharpCore;
using CordSharpCore.Document;

namespace  $rootnamespace$
{
    public partial class $safeitemname$ :  HtmlControlBase
    {
         //GeneratedCode
        //Declares
        private HtmlElement container;
        private void InitializeComponent()
        {
            //Initialize
            container= FindElement("container");
        }
    }
}


text:
cask 'webcatalog' do
  version '6.2.0'
  sha256 '1acad43afb616dbab03fee24f3e28902ec902fea3907c59243a7f0c65002917f'

  # github.com/webcatalog/desktop/releases/download/ was verified as official when first introduced to the cask
  url "https://github.com/webcatalog/desktop/releases/download/v#{version}/WebCatalog-#{version}.dmg"
  appcast 'https://github.com/webcatalog/desktop/releases.atom',
          checkpoint: 'f7d29f47ffe516e84f7d49f5923d298f6f13ca8b869acec16bae792cd03d0b9c'
  name 'WebCatalog'
  homepage 'https://webcatalog.io/download/mac'

  app 'WebCatalog.app'

  zap delete: [
                '~/Library/Application Support/WebCatalog',
                '~/Library/Cookies/com.webcatalog.app.binarycookies',
                '~/Library/Preferences/WebCatalog_Alt.plist',
                '~/Library/Preferences/com.webcatalog.app.helper.plist',
                '~/Library/Preferences/com.webcatalog.app.plist',
                '~/Library/Saved Application State/com.webcatalog.app.savedState',
              ]
end


text:
@interface NTESTextSettingCell : UITableViewCell<NTESCommonTableViewCell>

//textField的placeholder为NTESCommonTableRow.title
//textField的text为NTESCommonTableRow.extraData

@property (nonatomic ,strong) UITextField *textField;

@end


text:
(function(){

	angular
	.module('studyApp')
	.controller('signupController', signupController);

	signupController.$inject = ['$http']

	function signupController($http){
		var vm = this;
		vm.title = "SignUp";

		vm.createNewUser = function(){

		}

	}

})();


text:
import React, { Component, PropTypes } from 'react'
import { connect } from 'react-redux'
import { routeActions } from 'react-router-redux'

function mapDispatchToProps (dispatch) {
  return {
    navigate: (route) => dispatch(routeActions.push(route))
  }
}

class App extends Component {
  render () {
    const { props } = this
    return (

Hello, meet rj

          {props.children}

    )
  }
}

App.propTypes = {
  location: PropTypes.object.isRequired,
  navigate: PropTypes.func.isRequired
}

export default connect(
  mapDispatchToProps
)(App)


text:
package main

import (
	"fmt"
	"log"
	"net/http"
	"strconv"

	"github.com/ardaxi/gitscan/database"
	"github.com/ardaxi/gitscan/providers"
	"github.com/gorilla/mux"
)

var db *database.DB
var baseURL string

func serve(mydb *database.DB, mybaseurl string) {
	db = mydb
	baseURL = mybaseurl
	r := mux.NewRouter()
	r.HandleFunc("/", homeHandler).Methods("GET")
	r.HandleFunc("/projects/index", indexHandler).Methods("GET").Queries("token", "{token}")
	r.HandleFunc("/projects/{id:[0-9]+}.html", projectHandler).Methods("GET").Queries("token", "{token}")
	log.Println("Starting server...")
	log.Fatal(http.ListenAndServe(":8000", r))
}

func homeHandler(w http.ResponseWriter, r *http.Request) {
	w.Write([]byte(`<title>GitScan</title>
	<form action="/projects/index" method="get">Token:</token>
	<input type="text" id="token" name="token"><button type="submit">Login</button>
	</form>`))
}

func indexHandler(w http.ResponseWriter, r *http.Request) {
	fmt.Fprintln(w, "<title>GitScan report</title>Logging in...
")
	vars := mux.Vars(r)
	token := vars["token"]
	provider, err := providers.Providers["gitlab"](&providers.Options{
		Token: token,
		URL:   baseURL,
	})
	if err != nil {
		log.Printf("Error occurred logging into Gitlab: %s", err)
		w.WriteHeader(http.StatusBadRequest)
		w.Write([]byte("Failed to login to GitLab"))
		return
	}

	fmt.Fprintf(w, "Logged in as %s

", provider.Username())
	flush(w)

	projects := provider.ListAllProjects()
	for project := range projects {
		count, _ := db.ResultCount(project.ID())
		log.Printf("%s: %d", project.Name(), count)
		if count == 0 {
			continue
		}

		fmt.Fprintf(w, `<a href="/projects/%d.html?token=%s">%s</a> (%d results)<br>`, project.ID(), token, project.Name(), count)
		flush(w)
	}

	fmt.Fprintln(w, "")
}

func projectHandler(w http.ResponseWriter, r *http.Request) {
	fmt.Fprintln(w, "<title>GitScan report</title>Logging in...
")
	vars := mux.Vars(r)
	token := vars["token"]
	provider, err := providers.Providers["gitlab"](&providers.Options{
		Token: token,
		URL:   baseURL,
	})

	if err != nil {
		log.Printf("Error occurred logging into Gitlab: %s", err)
		w.WriteHeader(http.StatusBadRequest)
		w.Write([]byte("Failed to login to GitLab"))
		return
	}

	fmt.Fprintf(w, "Logged in as %s

", provider.Username())
	flush(w)

	id, _ := strconv.Atoi(vars["id"])
	project, err := provider.GetProject(id)
	if err != nil {
		log.Printf("Error occurred getting project (%s): %s", vars["id"], err)
		w.WriteHeader(http.StatusBadRequest)
		w.Write([]byte("Failed to get project."))
		return
	}

	results, err := db.GetResults(project.ID())
	if err != nil {
		log.Printf("Error occurred getting results for project (%s): %s", vars["id"], err)
		w.WriteHeader(http.StatusBadRequest)
		w.Write([]byte("Failed to get results."))
		return
	}

	fmt.Fprintf(w, "
%s - GitScan Report

", project.Name())
	for result := range results {
		fmt.Fprintf(w, `<li><a href="%s/blob/%s/%s">%s</a><br>%s<br>%s</li>`,
			project.URL(),
			result.Commit,
			result.Path,
			result.Path,
			result.Caption,
			result.Description,
		)
		flush(w)
	}

	fmt.Fprintln(w, "
")
}

func flush(w http.ResponseWriter) {
	if flusher, ok := w.(http.Flusher); ok {
		flusher.Flush()
	}
}


text:
'''
Created on 2016年3月25日

@author: chensi
'''
import argparse
import logging
import threading

import requests
from lxml import html
from sqlalchemy import create_engine
from sqlalchemy.orm.scoping import scoped_session
from sqlalchemy.orm.session import sessionmaker
from threadpool import ThreadPool, makeRequests

from one_analyse.lib.db.ormtables import Base
from one_analyse.lib.db.ormtables import OneORM, Period, User
from one_analyse.lib.http.get_records import RecordsParser

DBSession = sessionmaker()
DBScopedSession = scoped_session(
    DBSession
)
list_periods = []
periods_mutex = threading.Lock()
list_records = []
list_mutex = threading.Lock()
list_users = []

record_url_f = "http://1.163.com/record/getDuobaoRecord.do?pageNum=%d&pageSize=%d&totalCnt=0&gid=424&period=%s&token=29abd5f7-0872-465b-9868-fe701f34496d&t=1461049459688"
# url to access details of goods
good_detail_url = "http://1.163.com/detail/%d-%d.html"
user_detail_url = "http://1.163.com/user/duobao.do?cid=%d#join"

def request_records(request_url, period, period_i, period_count, page_num, total_page):
    global list_records, list_users
    logging.info("Getting period(%d/%d) records. Page %d, total page:%d", period_i, period_count, page_num, total_page)
    record_parser = RecordsParser(request_url)
    list_records_2, list_users_2, total_count = record_parser.get_response(period.pid)
    session = DBScopedSession()
    try:

        for user in list_users_2:
            db2.add_user(user, session)
        for record in list_records_2:
            db2.add_period_record(record, session)
    except:
        raise
    finally:
        DBScopedSession.remove()

# session.close()

def request_single_period_html(gid, pid):
    global good_detail_url, list_periods, periods_mutex

    try:
        # request period detail page
        url = good_detail_url % (gid, pid)
        response = requests.get(url)
        doc = html.fromstring(response.text)
        # parse html to get period
        luck_code = doc.cssselect(".code")[0].text
        # nick_name = doc.cssselect(".bd > a")[0]
        user_id = int(doc.cssselect("div.user-id > span:last-of-type")[0].text.split("(")[0])
        num = int(doc.cssselect("div.user-buyTimes > span:last-of-type")[0].text.split("人次")[0])
        calc_time = doc.cssselect("div.published-time > span.bd")[0].text
        buy_time = doc.cssselect("div.buy-time > span.bd")[0].text
        logging.info("period id : %d, luck code : %s, user id : %d, \tnum : %d", pid, luck_code, user_id, num)
        # request user's page
        url = user_detail_url % user_id
        response = requests.get(url)
        doc = html.fromstring(response.text)
        # parse html to get user nick name
        nick_name = doc.cssselect("div.m-user-comm-infoBox-cont > ul > li > span.txt")[0].text
        logging.info("user id : %d, nick name : %s", user_id, nick_name)
        user = User(cid=user_id, nick_name=nick_name)
        period = Period(pid, calc_time, num, buy_time, luck_code, user, gid)

        session = DBScopedSession()
        db2.add_user(user, session)
        db2.add_period(period, session)
        periods_mutex.acquire()
        session.expunge_all()
        list_periods.append(period)
        periods_mutex.release()

        return True
    except IndexError:
        # print("Invalid gid or pid!")
        pass
    except requests.exceptions.ConnectionError:
        pass
    finally:
        DBScopedSession.remove()

def request_period_html(gid, begin_pid, section):

    pid = begin_pid
    step = -1
    while pid > (begin_pid + section):
        logging.info("Requesting period id : %d", pid)
        res = request_single_period_html(gid, pid)
        if res:
            # Interval between adjacent period code is larger than 50.
            step = -50
        else:
            step = -1
        pid += step

if __name__ == '__main__':
    parser = argparse.ArgumentParser(description='Configure run mode.', prog='TestArgumentParse')
    parser.add_argument('-p', '--getperiodfrom', metavar='xxx', choices=['webpage', 'database'], required=True, default='webpage',
                        help='webpage: scraping from web page or database: fetching periods from database')
    parser.add_argument('--tps', dest='tps', default=50, type=int, help='the size of thread pool')
    parser.add_argument('--dbps', dest='dbps', default=50, type=int, help='the size of database thread pool')
    parser.add_argument('--version', action='version', version='%(prog)s 0.1')
    args = vars(parser.parse_args())
    getperiodfrom = args['getperiodfrom']
    thread_pool_size = args['tps']
    db_pool_size = args['dbps']

    one_engine = create_engine('mysql+mysqlconnector://one:83796737@127.0.0.1/one_db', pool_size=db_pool_size, max_overflow=100)
    DBSession.configure(bind=one_engine)
    DBScopedSession.configure(bind=one_engine)

    Base.metadata.create_all(one_engine)

    # Configure logging
    logging.basicConfig(filename="one_analyse.log", level=logging.DEBUG, format='%(asctime)s %(message)s')

    db2 = OneORM(one_engine)
    db2.InitDB()

    # Initialize thread pool
    tp = ThreadPool(thread_pool_size)

    if getperiodfrom == 'webpage':
        # Get periods from web pages.

        # one_url = "http://1.163.com"
        # period_dir_f = "/win/getList.do?pageNum=%d&pageSize=%d&totalCnt=0&gid=424"
        # period_dir = period_dir_f % (1, 1000)
        # periods_parser = PeriodsParser(one_url+period_dir)
        # list_periods, list_owners = periods_parser.get_response()

        # good is Apple MacBook Air
        gid = 424
        data = []
        pid = first_pid = 302201602
        last_pid = 300001602
        group_count = 0
        step = -2000
        sections = list(range(first_pid, last_pid, step))
        # while pid > last_pid:
        #     data.append(([gid, pid], []))
        #     pid -= 1
        #     group_count += 1
        #     if group_count == 25:
        #         thread_requests = makeRequests(request_period_html, data)
        #         [tp.putRequest(req) for req in thread_requests]
        #         group_count = 0
        #         data.clear()
        logging.info("Generating period id section...")
        for pid in sections:
            data.append(([gid, pid, step], []))
            thread_requests = makeRequests(request_period_html, data)
        thread_requests = makeRequests(request_period_html, data)
        [tp.putRequest(req) for req in thread_requests]
        logging.info("Scraping details of periods...")
        tp.wait()
    elif getperiodfrom == 'database':
        # Get periods from database
        logging.info("Obtaining periods from database...")
        session = DBScopedSession()
        list_periods = session.query(Period).filter(Period.pid < 302201602).all()
        session.expunge_all()

    #     print(len(list_periods))
    #     print(len(list_owners))

    #     session = DBSession()
    #     session = DBScopedSession()

    #     session.begin(subtransactions=True)
    #     try:
    #         for user in list_owners:
    #             db2.add_user(user, session)
    #
    # #         session.commit()
    #
    #         for period in list_periods:
    #     #         db.insert_period(period)
    #             db2.add_period(period, session)
    #
    # #         session.commit()
    #     except:
    # #         session.rollback()
    #         raise

    #     session.close()

    # get period records
    period_count = len(list_periods)
    period_i = 0
    for period in list_periods:
        period_i += 1
        page_num = 1
        page_size = 50
        record_url = record_url_f % (page_num, page_size, period.pid)
        record_parser = RecordsParser(record_url)
        # get total count to cal total pages
        list_records, list_users, total_count = record_parser.get_response(period.pid)
        total_page = int(total_count / page_size) + 1

        #         page_threads = []
        #
        #         while page_num <= total_page:
        #             record_url = record_url_f % (page_num, page_size, pid.pid)
        #             t = MyThread(request_records,
        #                          (record_url, period, period_i,period_count, page_num, total_page))
        #             page_threads.append(t)
        #             page_num = page_num + 1
        #
        #         for t in page_threads:
        #             t.start()

        # Use thread pool
        data = []
        while page_num <= total_page:
            record_url = record_url_f % (page_num, page_size, period.pid)
            param_list = [record_url, period, period_i, period_count, page_num, total_page]
            param_kw = []
            data.append((param_list, param_kw))
            page_num += 1
        requests = makeRequests(request_records, data)
        [tp.putRequest(req) for req in requests]
    #         tp.wait()

    #         for t in page_threads:
    #             t.join()

    #         while page_num <= total_page:
    #             print("Getting perioad(%d/%d) records. Page %d, total page:%d"%(period_i, period_count, page_num, total_page))
    #             record_url = record_url_f % (page_num, page_size, pid.pid)
    #             record_parser = RecordsParser(record_url)
    #             list_records_2, list_users_2, total_count = record_parser.get_response(pid.pid)
    #             # append list
    #             list_records = list_records + list_records_2
    #             list_users = list_users + list_users_2
    #             page_num = page_num + 1

    # add to DB
    #         for user in list_users:
    #             db2.add_user(user, session)
    #
    #         for record in list_records:
    #             db2.add_period_record(record, session)

    #         session.commit()

    tp.wait()

    DBScopedSession.remove()
# session.close()
#     session.remove()

#     print(db.select_period())
#     periods = db2.get_periods()
#     for pid in periods:
#         print(pid)


text:
using System.IO;
using System.Web;

namespace Nop.Services.Media
{
    /// <summary>
    /// Extensions
    /// </summary>
    public static class Extensions
    {
        /// <summary>
        /// Gets the download binary array
        /// </summary>
        /// <param name="postedFile">Posted file</param>
        /// <returns>Download binary array</returns>
        public static byte[] GetDownloadBits(this HttpPostedFileBase postedFile)
        {
            Stream fs = postedFile.InputStream;
            int size = postedFile.ContentLength;
            byte[] binary = new byte[size];
            fs.Read(binary, 0, size);
            return binary;
        }

        /// <summary>
        /// Gets the picture binary array
        /// </summary>
        /// <param name="postedFile">Posted file</param>
        /// <returns>Picture binary array</returns>
        public static byte[] GetPictureBits(this HttpPostedFileBase postedFile)
        {
            Stream fs = postedFile.InputStream;
            int size = postedFile.ContentLength;
            byte[] img = new byte[size];
            fs.Read(img, 0, size);
            return img;
        }
    }
}


text:
<?php defined('BX_DOL') or die('hack attempt');

class BxBaseStudioFormsSearchFields extends BxDolStudioFormsSearchFields
{
    protected $sUrlPage;

    function __construct($aOptions, $oTemplate = false)
    {
        parent::__construct($aOptions, $oTemplate);

        $this->_aOptions['actions_single']['edit']['attr']['title'] = _t('_adm_form_btn_search_forms_fields_edit');

        $this->sUrlPage = BX_DOL_URL_STUDIO . 'builder_forms.php?page=search_fields';
    }

    public function performActionEdit()
    {
        $sAction = 'edit';

        $aIds = bx_get('ids');
        if(!$aIds || !is_array($aIds)) {
            $iId = (int)bx_get('id');
            if(!$iId) {
                echoJson(array());
                exit;
            }

            $aIds = array($iId);
        }

        $iId = $aIds[0];

        $aField = array();
        $this->oDb->getSearchFields(array('type' => 'by_id', 'id' => (int)$iId), $aField, false);
        if(empty($aField) || !is_array($aField)) {
            echoJson(array());
            exit;
        }

        bx_import('BxTemplStudioFormView');

        $aForm = array(
            'form_attrs' => array(
                'id' => 'adm-form-search-field-edit',
                'action' => bx_append_url_params(BX_DOL_URL_ROOT . 'grid.php', array(
                	'o' => $this->_sObject,
                	'a' => $sAction,
                    'module' => $this->sModule,
                    'form' => $this->sForm
                )),
                'method' => BX_DOL_STUDIO_METHOD_DEFAULT
            ),
            'params' => array (
                'db' => array(
                    'table' => 'sys_search_extended_fields',
                    'key' => 'id',
                    'uri' => '',
                    'uri_title' => '',
                    'submit_name' => 'do_submit'
                ),
            ),
            'inputs' => array (
                'id' => array(
                    'type' => 'hidden',
                    'name' => 'id',
                    'value' => $iId,
                    'db' => array (
                        'pass' => 'Int',
                    ),
                ),
                'caption' => array(
                    'type' => 'text_translatable',
                    'name' => 'caption',
                    'caption' => _t('_adm_form_txt_search_forms_fields_caption'),
                    'value' => $aField['caption'],
                    'required' => '0',
                    'db' => array (
                        'pass' => 'Xss',
                    ),
                ),
                'info' => array(
                    'type' => 'text_translatable',
                    'name' => 'info',
                    'caption' => _t('_adm_form_txt_search_forms_fields_info'),
                    'value' => $aField['info'],
                    'required' => '0',
                    'db' => array (
                        'pass' => 'Xss',
                    ),
                ),
                'controls' => array(
                    'name' => 'controls',
                    'type' => 'input_set',
                    array(
                        'type' => 'submit',
                        'name' => 'do_submit',
                        'value' => _t('_adm_form_btn_search_forms_save'),
                    ),
                    array (
                        'type' => 'reset',
                        'name' => 'close',
                        'value' => _t('_adm_form_btn_search_forms_cancel'),
                        'attrs' => array(
                            'onclick' => "$('.bx-popup-applied:visible').dolPopupHide()",
                            'class' => 'bx-def-margin-sec-left',
                        ),
                    )
                )
            )
        );

        $aSearchTypes = BxDolSearchExtended::$TYPE_TO_TYPE_SEARCH[$aField['type']];
        if(is_array($aSearchTypes) && count($aSearchTypes) >= 2) {
            $aForm['inputs'] = bx_array_insert_before(array(
            	'search_type' => array(
                    'type' => 'select',
                    'name' => 'search_type',
                    'caption' => _t('_adm_form_txt_search_forms_fields_search_type'),
                    'info' => _t('_adm_form_dsc_search_forms_fields_search_type'),
                    'values' => array(),
                    'value' => $aField['search_type'],
                    'required' => '1',
                    'db' => array (
                        'pass' => 'Xss',
                    ),
                    'checker' => array (
                        'func' => 'Avail',
                        'params' => array(),
                        'error' => _t('_adm_form_err_search_forms_essential'),
                    ),
                )), $aForm['inputs'], 'controls');

            foreach($aSearchTypes as $sType)
                $aForm['inputs']['search_type']['values'][] = array('key' => $sType, 'value' => _t('_adm_form_txt_field_type_' . $sType));
        }

        $oForm = new BxTemplStudioFormView($aForm);
        $oForm->initChecker();

        if($oForm->isSubmittedAndValid()) {
            if($oForm->update($iId) !== false)
                $aRes = array('grid' => $this->getCode(false), 'blink' => $iId);
            else
                $aRes = array('msg' => _t('_adm_form_err_search_forms_fields_edit'));

            echoJson($aRes);
        }
        else {
            $sContent = BxTemplStudioFunctions::getInstance()->popupBox('adm-form-search-forms-fields-edit-popup', _t('_adm_form_txt_search_forms_fields_edit_popup', _t($aField['caption'])), $this->_oTemplate->parseHtmlByName('form_add_search_field.html', array(
                'form_id' => $aForm['form_attrs']['id'],
                'form' => $oForm->getCode(true),
                'object' => $this->_sObject,
                'action' => $sAction
            )));

            echoJson(array('popup' => array('html' => $sContent, 'options' => array('closeOnOuterClick' => false))));
        }
    }

    public function performActionReset()
    {
        $mixedResult = BxDolSearchExtended::getObjectInstance($this->sForm)->reset();
        if($mixedResult === false)
            return echoJson(array('msg' => _t('_adm_from_err_search_forms_fields_reset')));

        echoJson(array('grid' => $this->getCode(false)));
    }

    function getJsObject()
    {
        return 'oBxDolStudioFormsSearchFields';
    }

    function getFormsSelector($sModule = '')
    {
        $oForm = new BxTemplStudioFormView(array());

        $aInputForms = array(
            'type' => 'select',
            'name' => 'form',
            'attrs' => array(
                'id' => 'bx-grid-form-' . $this->_sObject,
                'onChange' => 'javascript:' . $this->getJsObject() . '.onChangeForm()'
            ),
            'value' => $this->sForm,
            'values' => array(
                '' => _t('_adm_form_txt_search_forms_fields_select_object'),
            )
        );

        if(!empty($sModule)) {
            $aForms = array();
            $this->oDb->getSearchForms(array('type' => 'by_module', 'module' => $sModule), $aForms, false);

            foreach($aForms as $aForm)
                 $aInputForms['values'][] = array(
                 	'key' => $aForm['object'],
                 	'value' => _t($aForm['title'])
                 );
        }
        else
            $aInputForms['attrs']['disabled'] = 'disabled';

        return $oForm->genRow($aInputForms);
    }

    function getCode($isDisplayHeader = true)
    {
        return $this->_oTemplate->parseHtmlByName('forms_search_fields.html', array(
            'content' => parent::getCode($isDisplayHeader),
            'js_object' => $this->getJsObject(),
            'page_url' => $this->sUrlPage,
            'grid_object' => $this->_sObject,
            'params_divider' => $this->sParamsDivider
        ));
    }

    protected function _addJsCss()
    {
        parent::_addJsCss();
        $this->_oTemplate->addCss(array('menu.css'));
        $this->_oTemplate->addJs(array('jquery.form.min.js', 'forms_search_fields.js'));

        $oForm = new BxTemplStudioFormView(array());
        $oForm->addCssJs();
    }

    protected function _getCellSwitcher ($mixedValue, $sKey, $aField, $aRow)
    {
        if(!$this->_isEditable($aRow))
            return parent::_getCellDefault('', $sKey, $aField, $aRow);

        return parent::_getCellSwitcher($mixedValue, $sKey, $aField, $aRow);
    }

    protected function _getCellType ($mixedValue, $sKey, $aField, $aRow)
    {
        $mixedValue = $this->_oTemplate->getIcon('ui-' . $aRow['type'] . '.png', array('alt' => _t('_adm_form_txt_field_type_' . $aRow['type'])));

        return parent::_getCellDefault($mixedValue, $sKey, $aField, $aRow);
    }

    protected function _getCellSearchType ($mixedValue, $sKey, $aField, $aRow)
    {
        $mixedValue = $this->_oTemplate->getIcon('ui-' . $aRow['search_type'] . '.png', array('alt' => _t('_adm_form_txt_field_type_' . $aRow['search_type'])));

        return parent::_getCellDefault($mixedValue, $sKey, $aField, $aRow);
    }

    protected function _getActionReset ($sType, $sKey, $a, $isSmall = false, $isDisabled = false, $aRow = array())
    {
        if(!$this->_isResetable($aRow))
            return '';

        if($this->sForm == '')
            $isDisabled = true;

        return  parent::_getActionDefault($sType, $sKey, $a, false, $isDisabled, $aRow);
    }

    protected function _getFilterControls ()
    {
        parent::_getFilterControls();

        $sContent = $this->getModulesSelectOne('getSearchForms') . $this->getFormsSelector($this->sModule);

        $oForm = new BxTemplStudioFormView(array());

        $aInputSearch = array(
            'type' => 'text',
            'name' => 'keyword',
            'attrs' => array(
                'id' => 'bx-grid-search-' . $this->_sObject,
            ),
            'tr_attrs' => array(
                'style' => empty($this->sModule) || empty($this->sForm) ? 'display:none;' : ''
            )
        );
        $sContent .= $oForm->genRow($aInputSearch);

        return  $sContent;
    }

    protected function _isEditable(&$aRow)
    {
    	return true;
    }

    protected function _isResetable(&$aRow)
    {
    	return true;
    }
}

/** @} */


text:
<!DOCTYPE html>

    <meta charset="utf-8" />

    <title>User agent detail - Mozilla/5.0 (compatible; Abonti/0.92 - http://www.abonti.com)</title>

    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.3/css/materialize.min.css">
    <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
    <link href="../circle.css" rel="stylesheet">

User agent detail

            Mozilla/5.0 (compatible; Abonti/0.92 - http://www.abonti.com)

	General	Device	Bot

Provider	Browser	Engine	OS	Brand	Model	Type	Is mobile	Is touch	Is bot	Name	Type	Parse time	Actions

Test suite

Browscap
6014
vendor/browscap/browscap/tests/fixtures/issues/issue-418.php	 	 	 						yes	Abonti WebSearch	Bot/Crawler	0

Detail

Browscap result detail

Array
(
    [Comment] => Abonti WebSearch
    [Browser] => Abonti WebSearch
    [Browser_Type] => Bot/Crawler
    [Browser_Bits] => 0
    [Browser_Maker] => abonti.com
    [Browser_Modus] => unknown
    [Version] => 0.92
    [MajorVer] => 0
    [MinorVer] => 92
    [Platform] => unknown
    [Platform_Version] => unknown
    [Platform_Description] => unknown
    [Platform_Bits] => 0
    [Platform_Maker] => unknown
    [Alpha] =>
    [Beta] =>
    [Win16] =>
    [Win32] =>
    [Win64] =>
    [Frames] =>
    [IFrames] =>
    [Tables] =>
    [Cookies] =>
    [BackgroundSounds] =>
    [JavaScript] =>
    [VBScript] =>
    [JavaApplets] =>
    [ActiveXControls] =>
    [isMobileDevice] =>
    [isTablet] =>
    [isSyndicationReader] =>
    [Crawler] => 1
    [isFake] =>
    [isAnonymized] =>
    [isModified] =>
    [CssVersion] => 0
    [AolVersion] => 0
    [Device_Name] => unknown
    [Device_Maker] => unknown
    [Device_Type] => unknown
    [Device_Pointing_Method] => unknown
    [Device_Code_Name] => unknown
    [Device_Brand_Name] => unknown
    [RenderingEngine_Name] => unknown
    [RenderingEngine_Version] => unknown
    [RenderingEngine_Maker] => unknown
)

        close

Providers

BrowscapFull
6014
	 	 	 						yes	Abonti WebSearch	Bot/Crawler	0.032

Detail

BrowscapFull result detail

stdClass Object
(
    [browser_name_regex] => /^mozilla\/5\.0 \(compatible; abonti\/0\.92.*$/
    [browser_name_pattern] => mozilla/5.0 (compatible; abonti/0.92*
    [parent] => Abonti WebSearch
    [comment] => Abonti WebSearch
    [browser] => Abonti WebSearch
    [browser_type] => Bot/Crawler
    [browser_bits] => 0
    [browser_maker] => abonti.com
    [browser_modus] => unknown
    [version] => 0.92
    [majorver] => 0
    [minorver] => 92
    [platform] => unknown
    [platform_version] => unknown
    [platform_description] => unknown
    [platform_bits] => 0
    [platform_maker] => unknown
    [alpha] =>
    [beta] =>
    [win16] =>
    [win32] =>
    [win64] =>
    [frames] =>
    [iframes] =>
    [tables] =>
    [cookies] =>
    [backgroundsounds] =>
    [javascript] =>
    [vbscript] =>
    [javaapplets] =>
    [activexcontrols] =>
    [ismobiledevice] =>
    [istablet] =>
    [issyndicationreader] =>
    [crawler] => 1
    [isfake] =>
    [isanonymized] =>
    [ismodified] =>
    [cssversion] => 0
    [aolversion] => 0
    [device_name] => unknown
    [device_maker] => unknown
    [device_type] => unknown
    [device_pointing_method] => unknown
    [device_code_name] => unknown
    [device_brand_name] => unknown
    [renderingengine_name] => unknown
    [renderingengine_version] => unknown
    [renderingengine_description] => unknown
    [renderingengine_maker] => unknown
)

        close

BrowscapLite
6014

                        No result found

BrowscapPhp
6014
	 	close	 	close	close				yes	Abonti WebSearch	close	0.026

Detail

BrowscapPhp result detail

stdClass Object
(
    [browser_name_regex] => /^mozilla\/5\.0 \(compatible; abonti\/0\.92.*$/
    [browser_name_pattern] => mozilla/5.0 (compatible; abonti/0.92*
    [parent] => Abonti WebSearch
    [comment] => Abonti WebSearch
    [browser] => Abonti WebSearch
    [browser_type] => unknown
    [browser_bits] => 0
    [browser_maker] => abonti.com
    [browser_modus] => unknown
    [version] => 0.92
    [majorver] => 0
    [minorver] => 92
    [platform] => unknown
    [platform_version] => unknown
    [platform_description] => unknown
    [platform_bits] => 0
    [platform_maker] => unknown
    [alpha] => false
    [beta] => false
    [win16] => false
    [win32] => false
    [win64] => false
    [frames] => false
    [iframes] => false
    [tables] => false
    [cookies] => false
    [backgroundsounds] => false
    [javascript] => false
    [vbscript] => false
    [javaapplets] => false
    [activexcontrols] => false
    [ismobiledevice] =>
    [istablet] =>
    [issyndicationreader] => false
    [crawler] => 1
    [isfake] => false
    [isanonymized] => false
    [ismodified] => false
    [cssversion] => 0
    [aolversion] => 0
    [device_name] => unknown
    [device_maker] => unknown
    [device_type] => unknown
    [device_pointing_method] => unknown
    [device_code_name] => unknown
    [device_brand_name] => unknown
    [renderingengine_name] => unknown
    [renderingengine_version] => unknown
    [renderingengine_description] => unknown
    [renderingengine_maker] => unknown
)

        close

DonatjUAParser
v0.5.1

                        No result found

JenssegersAgent
v2.3.3
	Mozilla 	close	 	close	close	close		close			close	0.005

Detail

JenssegersAgent result detail

Array
(
    [browserName] => Mozilla
    [browserVersion] =>
    [osName] =>
    [osVersion] =>
    [deviceModel] =>
    [isMobile] =>
    [isRobot] =>
    [botName] =>
)

        close

NeutrinoApiCom

                        No result found

PiwikDeviceDetector
3.6.1

                        No result found

SinergiBrowserDetector
6.0.1
	Mozilla 5.0	close	 	close		close		close		close	close	0

Detail

SinergiBrowserDetector result detail

Array
(
    [browser] => Sinergi\BrowserDetector\Browser Object
        (
            [userAgent:Sinergi\BrowserDetector\Browser:private] => Sinergi\BrowserDetector\UserAgent Object
                (
                    [userAgentString:Sinergi\BrowserDetector\UserAgent:private] => Mozilla/5.0 (compatible; Abonti/0.92 - http://www.abonti.com)
                )

            [name:Sinergi\BrowserDetector\Browser:private] => Mozilla
            [version:Sinergi\BrowserDetector\Browser:private] => 5.0
            [isRobot:Sinergi\BrowserDetector\Browser:private] =>
            [isChromeFrame:Sinergi\BrowserDetector\Browser:private] =>
            [isFacebookWebView:Sinergi\BrowserDetector\Browser:private] =>
            [isCompatibilityMode:Sinergi\BrowserDetector\Browser:private] =>
        )

    [operatingSystem] => Sinergi\BrowserDetector\Os Object
        (
            [name:Sinergi\BrowserDetector\Os:private] => unknown
            [version:Sinergi\BrowserDetector\Os:private] => unknown
            [isMobile:Sinergi\BrowserDetector\Os:private] =>
            [userAgent:Sinergi\BrowserDetector\Os:private] => Sinergi\BrowserDetector\UserAgent Object
                (
                    [userAgentString:Sinergi\BrowserDetector\UserAgent:private] => Mozilla/5.0 (compatible; Abonti/0.92 - http://www.abonti.com)
                )

        )

    [device] => Sinergi\BrowserDetector\Device Object
        (
            [name:Sinergi\BrowserDetector\Device:private] => unknown
            [userAgent:Sinergi\BrowserDetector\Device:private] => Sinergi\BrowserDetector\UserAgent Object
                (
                    [userAgentString:Sinergi\BrowserDetector\UserAgent:private] => Mozilla/5.0 (compatible; Abonti/0.92 - http://www.abonti.com)
                )

        )

)

        close

UAParser
v3.4.5

                        No result found

UserAgentApiCom

                        No result found

UserAgentStringCom

                        No result found

WhatIsMyBrowserCom

	Mozilla 5.0	 	 			close	close	close	close	close	close	0.23401

Detail

WhatIsMyBrowserCom result detail

stdClass Object
(
    [operating_system_name] =>
    [simple_sub_description_string] =>
    [simple_browser_string] => Mozilla 5
    [browser_version] => 5
    [extra_info] => Array
        (
        )

    [operating_platform] =>
    [extra_info_table] => Array
        (
        )

    [layout_engine_name] =>
    [detected_addons] => Array
        (
        )

    [operating_system_flavour_code] =>
    [hardware_architecture] =>
    [operating_system_flavour] =>
    [operating_system_frameworks] => Array
        (
        )

    [browser_name_code] => mozilla
    [operating_system_version] =>
    [simple_operating_platform_string] =>
    [is_abusive] =>
    [layout_engine_version] =>
    [browser_capabilities] => Array
        (
        )

    [operating_platform_vendor_name] =>
    [operating_system] =>
    [operating_system_version_full] =>
    [operating_platform_code] =>
    [browser_name] => Mozilla
    [operating_system_name_code] =>
    [user_agent] => Mozilla/5.0 (compatible; Abonti/0.92 - http://www.abonti.com)
    [browser_version_full] => 5.0
    [browser] => Mozilla 5
)

        close

WhichBrowser
v2.0.18

                        No result found

Woothee
v1.2.0

                        No result found

Wurfl
1.7.1.0

                        No result found

Zsxsoft
1.3

                        No result found

About this comparison

                The primary goal of this project is simple

                I wanted to know which user agent parser is the most accurate in each part - device detection, bot detection and so on...

                The secondary goal is to provide a source for all user agent parsers to improve their detection based on this results.

                You can also improve this further, by suggesting ideas at ThaDafinser/UserAgentParserComparison

                The comparison is based on the abstraction by ThaDafinser/UserAgentParser

			Comparison created 2016-05-10 08:10:19 | by
            ThaDafinser


text:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace dp2rms
{
    public partial class IsbnHyphenDlg : Form
    {
        public MainForm MainForm = null;

        public IsbnHyphenDlg()
        {
            InitializeComponent();
        }

        private void button_addHyphen_Click(object sender, EventArgs e)
        {
            string strError = "";

            if (String.IsNullOrEmpty(this.textBox_isbn.Text) == true)
            {
                strError = "尚未输入待加工的ISBN号";
                goto ERROR1;
            }

            int nRet = MainForm.LoadIsbnSplitter(true, out strError);
            if (nRet == -1)
                goto ERROR1;

            string strResult = "";

            nRet = MainForm.IsbnSplitter.IsbnInsertHyphen(this.textBox_isbn.Text,
                "auto",
                out strResult,
                out strError);
            if (nRet == -1)
                goto ERROR1;

            this.textBox_isbn.Text = strResult;

            return;

        ERROR1:
            MessageBox.Show(this, strError);
        }
    }
}


text:
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE chapter SYSTEM "chapter.dtd">

<chapter>

    <copyright>
      <year>2000</year><year>2016</year>
      <holder>Ericsson AB. All Rights Reserved.</holder>
    </copyright>
    <legalnotice>
      Licensed under the Apache License, Version 2.0 (the "License");
      you may not use this file except in compliance with the License.
      You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

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

    </legalnotice>

    <title>Installing cosNotification</title>
    <prepared>Niclas Eklund</prepared>
    <docno></docno>
    <date>2000-01-31</date>
    <rev></rev>
    <file>ch-install.xml</file>

    <title>Installation Process </title>

This chapter describes how to install <seealso marker="cosNotificationApp">cosNotificationApp</seealso>
      in an Erlang Environment.

      <title>Preparation</title>

Before starting the installation process for cosNotification,
        the application Orber must be running.

      <title>Configuration</title>

When using the Notification Service the <c>cosNotification</c> application
        first must be installed using <c>cosNotificationApp:install()</c> or
        <c>cosNotificationApp:install(Seconds)</c>, followed by <c>cosNotificationApp:start()</c>.

Then the <seealso marker="CosNotifyChannelAdmin_EventChannelFactory">Event Channel Factory</seealso>
        must be started:

      <list type="bulleted">
        <item><c>cosNotificationApp:start_global_factory()</c> - starts and returns a reference to a factory using default configuration parameters.
         This operation should be used for a multi-node Orber.</item>
        <item><c>cosNotificationApp:start_global_factory(Options)</c> - starts and returns a reference to a factory using given configuration parameters.
         This operation should be used for a multi-node Orber.</item>
        <item><c>cosNotificationApp:start_factory()</c> - starts and returns a reference to a factory using default configuration parameters.</item>
        <item><c>cosNotificationApp:start_factory(Options)</c> - starts and returns a reference to a factory using given configuration parameters.</item>
      </list>

The following options exist:

      <list type="bulleted">
        <item><c>{pullInterval, Seconds}</c> - determine how often Proxy Pull
         Consumers will check for new events with the client application. The
         default value is 20 seconds.</item>
        <item><c>{filterOp, OperationType}</c> - determine which type of Administrator
         objects should be started, i.e., <c>'OR_OP'</c> or <c>'AND_OP'</c>.
         The default value is <c>'OR_OP'</c>.</item>
        <item><c>{timeService, TimeServiceObj | 'undefined'}</c> - to be able to use
         Start and/or Stop QoS this option must be used. See the function <c>start_time_service/2</c>
         in the <c>cosTime</c> application. The default value is <c>'undefined'</c>.</item>
        <item><c>{filterOp, OperationType}</c> - determine which type of Administrator
         objects should be started, i.e., <c>'OR_OP'</c> or <c>'AND_OP'</c>.
         The default value is <c>'OR_OP'</c>.</item>
        <item><c>{gcTime, Seconds}</c> - this option determines how often, for example, proxies
         will garbage collect expired events. The default value is 60.</item>
        <item><c>{gcLimit, Amount}</c> - determines how many events will be stored before, for
         example, proxies will garbage collect expired events. The default value is 50. This
         option is tightly coupled with the QoS property <c>MaxEventsPerConsumer</c>, i.e.,
         the <c>gcLimit</c> should be less than <c>MaxEventsPerConsumer</c> and greater than 0.</item>
      </list>

It is possible to define a set of global configuration parameters:

        <row>
          <cell align="center" valign="middle">Key</cell>
          <cell align="center" valign="middle">Range</cell>
          <cell align="center" valign="middle">Default</cell>
        </row>
        <row>
          <cell align="left" valign="middle">type_check</cell>
          <cell align="left" valign="middle">true | false</cell>
          <cell align="left" valign="middle">true</cell>
        </row>
        <row>
          <cell align="left" valign="middle">notify</cell>
          <cell align="left" valign="middle">atom() | false</cell>
          <cell align="left" valign="middle">false</cell>
        </row>
        <row>
          <cell align="left" valign="middle">max_events</cell>
          <cell align="left" valign="middle">integer() > 0</cell>
          <cell align="left" valign="middle">50</cell>
        </row>
        <row>
          <cell align="left" valign="middle">interval_events</cell>
          <cell align="left" valign="middle">integer() > 0</cell>
          <cell align="left" valign="middle">10000 milliseconds</cell>
        </row>
        <row>
          <cell align="left" valign="middle">timeout_events</cell>
          <cell align="left" valign="middle">integer() > interval_events</cell>
          <cell align="left" valign="middle">3000000 milliseconds</cell>
        </row>
        <tcaption>Global Configuration Parameters</tcaption>

Comments on the table 'Global Configuration Parameters':

      <taglist>
        <tag>type_check</tag>
        <item>Determine if supplied IOR:s shall be type checked, i.e. invoking
         corba_object:is_a/2, or not.</item>
        <tag>notify</tag>
        <item>The given value shall point to an existing module exporting
         a function (arity 1) called terminated. This operation
         is invoked when a proxy terminates and the argument is a list
         containing <c>{proxy, IOR}</c>, <c>{client, IOR}</c> and
        <c>{reason, term()}</c>. The return value is ignored.</item>
        <tag>max_events</tag>
        <item>If a supplier proxy has not been able to push events to a
         consumer and the queue exceeds this limit, then the proxy will
         terminate. For this option to have any effect, the
        <c>EventReliability</c> and <c>ConnectionReliability</c> QoS
         parameters must be set to <c>Persistent</c>. For more information,
         see also the <seealso marker="ch_QoS">QoS</seealso> chapter.</item>
        <tag>interval_events</tag>
        <item>The same requirements as for <c>max_events</c>. When a supplier
         proxy detects problems when trying to push events, this parameter
         determines how often it should try to call the consumer.</item>
        <tag>timeout_events</tag>
        <item>The same requirements as for <c>max_events</c>. If the
         proxy has not been able to contact the consumer and this
         time-limit is reached, then the proxy will terminate.</item>
      </taglist>

The Factory is now ready to use. For a more detailed description see
        <seealso marker="ch_example">Examples</seealso>.

</chapter>


text:
"use strict";

const Promise = require("bluebird");
const _ = require("lodash");

function callHook(hook, service, ctx, res) {
	if (_.isFunction(hook)) {
		return hook.call(service, ctx, res);
	} else if (Array.isArray(hook)) {
		return hook.reduce((p, fn) => p.then(res => fn.call(service, ctx, res)), Promise.resolve(res));
	}
}

function callErrorHook(hook, service, ctx, err) {
	if (_.isFunction(hook)) {
		return hook.call(service, ctx, err);
	} else if (Array.isArray(hook)) {
		return hook.reduce((p, fn) => p.catch(err => fn.call(service, ctx, err)), Promise.reject(err));
	}
}

/**
 * Sanitize hooks. If the hook is a string, convert it to Service method calling.
 *
 * @param {Function|String|Array<any>} hooks
 * @param {Service?} service
 * @returns
 */
function sanitizeHooks(hooks, service) {
	if (_.isString(hooks))
		return service && _.isFunction(service[hooks]) ? service[hooks] : null;

	if (Array.isArray(hooks)) {
		return _.compact(hooks.map(h => {
			if (_.isString(h))
				return service && _.isFunction(service[h]) ? service[h] : null;

			return h;
		}));
	}

	return hooks;
}

function wrapActionHookMiddleware(handler, action) {
	const name = action.rawName || action.name;
	const hooks = action.service && action.service.schema ? action.service.schema.hooks : null;
	if (hooks) {
		const beforeAllHook = hooks.before ? sanitizeHooks(hooks.before["*"], action.service) : null;
		const afterAllHook = hooks.after ? sanitizeHooks(hooks.after["*"], action.service) : null;
		const errorAllHook = hooks.error ? sanitizeHooks(hooks.error["*"], action.service) : null;

		const beforeHook = hooks.before ? sanitizeHooks(hooks.before[name], action.service) : null;
		const afterHook = hooks.after ? sanitizeHooks(hooks.after[name], action.service) : null;
		const errorHook = hooks.error ? sanitizeHooks(hooks.error[name], action.service) : null;

		if (beforeAllHook || beforeHook || afterAllHook || afterHook || errorAllHook || errorHook) {
			return function actionHookMiddleware(ctx) {
				let p = Promise.resolve();

				// Before all
				if (beforeAllHook)
					p = p.then(() => callHook(beforeAllHook, ctx.service, ctx));

				// Before
				if (beforeHook)
					p = p.then(() => callHook(beforeHook, ctx.service, ctx));

				// Action handler
				p = p.then(() => handler(ctx));

				// After
				if (afterHook)
					p = p.then(res => callHook(afterHook, ctx.service, ctx, res));

				// After all
				if (afterAllHook)
					p = p.then(res => callHook(afterAllHook, ctx.service, ctx, res));

				// Error
				if (errorHook)
					p = p.catch(err => callErrorHook(errorHook, ctx.service, ctx, err));

				// Error all
				if (errorAllHook)
					p = p.catch(err => callErrorHook(errorAllHook, ctx.service, ctx, err));

				return p;
			};
		}
	}

	return handler;
}

module.exports = function actionHookMiddleware() {
	return {
		localAction: wrapActionHookMiddleware
	};
};


text:
/// <reference path="~/GeneratedArtifacts/viewModel.js" />

myapp.CartView.deleteEntity_execute = function (screen) {
    deleteEntity(screen, "Cart");
};

myapp.CartView.checkoutCart_execute = function (screen) {
    var message = "Sure you want to checkout?";
    var title = "Checkout Cart";

    var order = myapp.activeDataWorkspace.CoreData.Orders.addNew();

    order.Tid = "00000000-0000-0000-0000-000000000000";
    order.Id = 0;
    order.CreatedBy = "USER";
    order.ModifiedBy = "USER";
    order.Parameters = '{}';
    order.Created = new Date();
    order.Modified = new Date();

    order.Name = "DefaultOrder";

    msls.showMessageBox(
        message,
        {
            title: title,
            buttons: msls.MessageBoxButtons.yesNo
        }
    ).then(function (result) {
        if (result == msls.MessageBoxResult.yes) {
            myapp.activeDataWorkspace.CoreData.saveChanges().then(function() {
                    msls.showMessageBox(
                        "Order has been placed",
                        {
                            title: "Order",
                            buttons: msls.MessageBoxButtons.ok
                        }
                    );
                },
                function fail(e) {
                    msls.showMessageBox(e.message,
                    {
                        title: "Order has been placed",
                        buttons: msls.MessageBoxButtons.ok
                    }).then(
                        function(result) {
                            myapp.cancelChanges();
                            //throw e;
                            myapp.showHome(msls.BoundaryOption, null);
                        }
                    );
                });
        }
    });

    //myapp.activeDataWorkspace.CoreData.saveChanges().then(function () {
    //    msls.showMessageBox(
    //        "Order has been placed",
    //        {
    //            title: "Order",
    //            buttons: msls.MessageBoxButtons.ok
    //        }
    //    );
    //}
    //,
    //function fail(e) {
    //    msls.showMessageBox(e.message,
    //    {
    //        title: "Order has been placed",
    //        buttons: msls.MessageBoxButtons.ok
    //    }).then(
    //            function (result)
    //            {
    //                myapp.cancelChanges();
    //                //throw e;
    //                myapp.showHome(msls.BoundaryOption, null);
    //            }
    //        );
    //});
};


text:
Once the hosts is online you can connect via ssh with the username ```harbor```.
The following ports are required for interconnectivity between nodes:

 * 22/tcp <-- SSH
 * 443/tcp <-- All apis and Web UI
 * 80/tcp <-- Insecure HTTP assets
 * 9090/tcp <-- Management Console
 * 4001/tcp <-- Public(insecure) etcd
 * 6640/tcp <-- OpenvSwitch db(s)
 * 6642/tcp <-- OVN Southbound db
 * 6081/udp <-- Geneve

By default the master node will store the access credentials automcaticly generated during the node setup for the IPA server at ```/etc/harbor/harbor-auth.conf``` this file should **not** be left on the node for a production deployment once the environment has been bootstrapped.

Harbor makes extensive use of SNI for external access, all http access requires your dns to resolve the following domains to your instances ip(s) where ```${DOMAIN}``` should be replaced with the appropriate domain.

```
freeipa.${DOMAIN}
ipsilon.${DOMAIN}
keystone.${DOMAIN}
api.${DOMAIN}
```


text:
package org.terasology.rendering.dag.nodes;

import org.terasology.entitySystem.entity.EntityManager;
import org.terasology.entitySystem.entity.EntityRef;
import org.terasology.logic.location.LocationComponent;
import org.terasology.math.geom.Vector3f;
import org.terasology.monitoring.PerformanceMonitor;
import org.terasology.registry.In;
import org.terasology.rendering.assets.material.Material;
import org.terasology.rendering.dag.AbstractNode;
import org.terasology.rendering.logic.LightComponent;
import org.terasology.rendering.opengl.FBO;
import org.terasology.rendering.opengl.FrameBuffersManager;
import org.terasology.rendering.world.WorldRenderer;
import static org.lwjgl.opengl.GL11.GL_BACK;
import static org.lwjgl.opengl.GL11.GL_BLEND;
import static org.lwjgl.opengl.GL11.GL_CULL_FACE;
import static org.lwjgl.opengl.GL11.GL_DEPTH_TEST;
import static org.lwjgl.opengl.GL11.GL_FRONT;
import static org.lwjgl.opengl.GL11.GL_NOTEQUAL;
import static org.lwjgl.opengl.GL11.GL_ONE;
import static org.lwjgl.opengl.GL11.GL_ONE_MINUS_SRC_COLOR;
import static org.lwjgl.opengl.GL11.GL_STENCIL_TEST;
import static org.lwjgl.opengl.GL11.glBlendFunc;
import static org.lwjgl.opengl.GL11.glCullFace;
import static org.lwjgl.opengl.GL11.glDepthMask;
import static org.lwjgl.opengl.GL11.glDisable;
import static org.lwjgl.opengl.GL11.glEnable;
import static org.lwjgl.opengl.GL11.glStencilFunc;
import static org.terasology.rendering.opengl.OpenGLUtils.bindDisplay;
import static org.terasology.rendering.opengl.OpenGLUtils.setRenderBufferMask;

/**
 * TODO: Diagram of this node
 */
public class LightGeometryNode extends AbstractNode {

    @In
    private FrameBuffersManager frameBuffersManager;

    @In
    private WorldRenderer worldRenderer;

    @In
    private EntityManager entityManager;

    private Material lightGeometryShader;
    private FBO sceneOpaque;

    @Override
    public void initialise() {
        lightGeometryShader = worldRenderer.getMaterial("engine:prog.lightGeometryPass");
    }

    @Override
    public void process() {
        PerformanceMonitor.startActivity("rendering/lightGeometry");
        // DISABLED UNTIL WE CAN FIND WHY IT's BROKEN. SEE ISSUE #1486
        /*
        graphicState.preRenderSetupLightGeometryStencil();

        simple.enable();
        simple.setCamera(playerCamera);
        EntityManager entityManager = context.get(EntityManager.class);
        for (EntityRef entity : entityManager.getEntitiesWith(LightComponent.class, LocationComponent.class)) {
            LocationComponent locationComponent = entity.getComponent(LocationComponent.class);
            LightComponent lightComponent = entity.getComponent(LightComponent.class);

            final Vector3f worldPosition = locationComponent.getWorldPosition();
            renderLightComponent(lightComponent, worldPosition, simple, true);
        }

        graphicState.postRenderCleanupLightGeometryStencil();
        */

        sceneOpaque = frameBuffersManager.getFBO("sceneOpaque");
        // LightGeometry requires a cleanup
        cleanupSceneOpaque();
        preRenderSetupLightGeometry();

        for (EntityRef entity : entityManager.getEntitiesWith(LightComponent.class, LocationComponent.class)) {
            LocationComponent locationComponent = entity.getComponent(LocationComponent.class);
            LightComponent lightComponent = entity.getComponent(LightComponent.class);

            final Vector3f worldPosition = locationComponent.getWorldPosition();
            // TODO: find a more elegant way
            worldRenderer.renderLightComponent(lightComponent, worldPosition, lightGeometryShader, false);
        }
        postRenderCleanupLightGeometry();
        PerformanceMonitor.endActivity();

    }

    // TODO: figure how lighting works and what this does
    private void postRenderCleanupLightGeometry() {
        glDisable(GL_STENCIL_TEST);
        glCullFace(GL_BACK);

        bindDisplay();
    }

    // TODO: figure how lighting works and what this does
    private void preRenderSetupLightGeometry() {
        sceneOpaque.bind();

        // Only write to the light buffer
        setRenderBufferMask(sceneOpaque, false, false, true);

        glStencilFunc(GL_NOTEQUAL, 0, 0xFF);

        glDepthMask(true);
        glDisable(GL_DEPTH_TEST);

        glEnable(GL_BLEND);
        glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_COLOR);

        glEnable(GL_CULL_FACE);
        glCullFace(GL_FRONT);
    }

    /**
     * Resets the state after the rendering of the Opaque scene.
     */
    private void cleanupSceneOpaque() {
        sceneOpaque = frameBuffersManager.getFBO("sceneOpaque");
        setRenderBufferMask(sceneOpaque, true, true, true); // TODO: probably redundant - verify
        bindDisplay();
    }
}


text:
module HandlerHelper
end


text:
package com.prizmj.display.simulation.events;
/*
 * com.prizmj.display.simulation.events.ColorEvent in PrizmJPortable
 * Created by Tyler Crowe on 12/9/2016.
 * Website: https://loneboat.com
 * GitHub: https://github.com/Dubpubber
 * Machine Time: 5:14 AM
 */

import com.badlogic.gdx.graphics.Color;
import com.prizmj.display.models.IModel;

public class ColorChangeEvent extends Event {

    private Color color;

    public ColorChangeEvent(IModel model, float eventPriority, Color color) {
        super(model, eventPriority);
        this.color = color;
    }

    @Override
    public void execute() {
        getModel().changeColor(color);
    }
}