text:
var ForgePlugins = ForgePlugins || {};

/**
 * Display somewhere on the screen a bar containing all the thumbnails from the
 * differents scenes, for quick access. The bar can be animated, with a
 * navigation if there are too much thumbnails to display.
 * @constructor
 */
ForgePlugins.ThumbnailBar = function()
{
    this._container = null;
    this._navigationContainer = null;
    this._images = [];
    this._tips = [];

    this._containerTween = null;
};

/**
 * The prototype of the ThumbnailBar.
 */
ForgePlugins.ThumbnailBar.prototype = {

    /**
     * Boot routine.
     * @method ForgePlugins.ThumbnailBar#boot
     */
    boot: function()
    {
        var scenes = this.viewer.story.scenes;

        // First is the container
        this._container = this.plugin.create.displayObjectContainer();

        // Parse from the PTP values
        var position = this.plugin.options.container.position;
        if (position === "topLeft")
        {
            this._position = "top";
            this._alignment = "left";
        }
        else if (position === "top")
        {
            this._position = "top";
            this._alignment = "center";
        }
        else if (position === "topRight")
        {
            this._position = "top";
            this._alignment = "right";
        }
        else if (position === "left")
        {
            this._position = "center";
            this._alignment = "left";
        }
        else if (position === "center")
        {
            this._position = "center";
            this._alignment = "center";
        }
        else if (position === "right")
        {
            this._position = "center";
            this._alignment = "right";
        }
        else if (position === "bottomLeft")
        {
            this._position = "bottom";
            this._alignment = "left";
        }
        else if (position === "bottom")
        {
            this._position = "bottom";
            this._alignment = "center";
        }
        else if (position === "bottomRight")
        {
            this._position = "bottom";
            this._alignment = "right";
        }
        else
        {
            // Get global position of the container
            this._position = this.plugin.options.container.position; // can be top, center or bottom
            this._alignment = this.plugin.options.container.alignment; // can be left, center or right
        }

        this._orientation = this.plugin.options.container.orientation; // can be horizontal or vertical

        if (this._position === "center")
        {
            this._container.verticalCenter = true;
        }
        else if (this._position === "top" || this._position === "bottom")
        {
            this._container[this._position] = 0;
        }

        if (this._alignment === "center")
        {
            this._container.horizontalCenter = true;
        }
        else if (this._alignment === "left" || this._alignment === "right")
        {
            this._container[this._alignment] = 0;
        }

        if (this._orientation === "horizontal")
        {
            this._container.width = "100%";
            this._container.height = this.plugin.options.thumbnail.height + this.plugin.options.thumbnail.margin * 2;
        }
        else if (this._orientation === "vertical")
        {
            this._container.width = this.plugin.options.thumbnail.width + this.plugin.options.thumbnail.margin * 2;
            this._container.height = "100%";
        }

        // Create a subcontainer, which is a clone of the container
        this._navigationContainer = this.plugin.create.displayObjectContainer();
        this._navigationContainer.left = this._container.left;
        this._navigationContainer.top = this._container.top;
        this._navigationContainer.verticalCenter = this._container.verticalCenter;
        this._navigationContainer.horizontalCenter = this._container.horizontalCenter;
        this._navigationContainer.width = this._container.width;
        this._navigationContainer.height = this._container.height;

        if (this._orientation === "horizontal")
        {
            this._navigationContainer.width = this.plugin.options.container.size;
        }
        else if (this._orientation === "vertical")
        {
            this._navigationContainer.height = this.plugin.options.container.size;
        }

        // Stylize the subcontainer
        this._navigationContainer.background = this.plugin.options.container.background;
        this._navigationContainer.borderRadius = this.plugin.options.container.borderRadius;

        this.plugin.container.addChild(this._container);
        this._container.addChild(this._navigationContainer)

        // Navigation container, not heavy at all so create it anyway
        this._thumbContainer = this.plugin.create.displayObjectContainer();
        this._thumbContainer.width = "100%";
        this._thumbContainer.height = "100%";
        this._thumbContainer.overflow = "visible";
        this._navigationContainer.addChild(this._thumbContainer);

        // Create thumbnails
        for (var i = 0, ii = scenes.length; i < ii; i++)
        {
            this._createSceneThumb(scenes[i]);
        }

        this._highlightCurrentScene();

        // Add navigation if activated
        if (this.plugin.options.navigation.enabled)
        {
            // Tween for the container
            this._thumbTween = this.plugin.create.tween(this._thumbContainer);

            // Navigation "mouse" zone (for click, press etc...)
            this._navPrev = this.plugin.create.displayObject();
            this._navNext = this.plugin.create.displayObject();
            this._navPrev.width = this.plugin.options.navigation.width + 2 * this.plugin.options.thumbnail.margin;
            this._navPrev.height = this.plugin.options.navigation.height + 2 * this.plugin.options.thumbnail.margin;
            this._navNext.width = this._navPrev.width;
            this._navNext.height = this._navPrev.height;

            if (this._orientation === "horizontal")
            {
                this._navPrev.x = this._navigationContainer.x - this._navPrev.pixelWidth;
                this._navPrev.y = (this._navigationContainer.height - this._navPrev.height) / 2;
                this._navNext.x = this._navigationContainer.pixelWidth + this._navigationContainer.x;
                this._navNext.y = this._navPrev.y;
            }
            else if (this._orientation === "vertical")
            {
                this._navPrev.x = (this._navigationContainer.width - this._navPrev.width) / 2;
                this._navPrev.y = this._navigationContainer.y - this._navPrev.pixelHeight;
                this._navNext.x = this._navPrev.x;
                this._navNext.y = this._navigationContainer.pixelHeight + this._navigationContainer.y;
            }

            var pluginUrl = this.plugin.fullUrl;
            pluginUrl += FORGE.Utils.endsWith(pluginUrl, "/") ? "" : "/";

            var arrowUrl = this.plugin.options.navigation.background.replace("{{plugin_url}}", pluginUrl);
            this._navPrev.background = arrowUrl;
            this._navNext.background = arrowUrl;

            // Rotate the background if it is an image
            this._navNext.rotation = 180;

            this._navPrev.id = "navThumbPrev";
            this._navNext.id = "navThumbNext";
            this._navPrev.pointer.enabled = true;
            this._navNext.pointer.enabled = true;
            this._navPrev.pointer.cursor = FORGE.Pointer.cursors.POINTER;
            this._navNext.pointer.cursor = FORGE.Pointer.cursors.POINTER;

            if (this.plugin.options.navigation.type === "click")
            {
                this._navPrev.pointer.onClick.add(this._navClickHandler, this);
                this._navNext.pointer.onClick.add(this._navClickHandler, this);
            }

            this._container.addChild(this._navPrev);
            this._container.addChild(this._navNext);

            // Add resize handling if the navigation is active
            this._container.onResize.add(this._onResize, this);
        }

        // Animate the subcontainer
        if (this.plugin.options.container.animation)
        {
            this._containerTween = this.plugin.create.tween(this._navigationContainer);
            this._container.pointer.enabled = true;
            this._container.pointer.onEnter.add(this._mouseEnterHandler, this);
            this._container.pointer.onLeave.add(this._mouseLeaveHandler, this);

            if (this.plugin.options.navigation)
            {
                this._navPrevTween = this.plugin.create.tween(this._navPrev);
                this._navNextTween = this.plugin.create.tween(this._navNext);
            }

            // Hide on start
            this.hide();
        }

        // Handle locale
        this.viewer.i18n.onLocaleChangeComplete.add(this._localeChangeHandler, this);
        this.viewer.story.onSceneLoadComplete.add(this._sceneLoadHandler, this);

    },

    /**
     * Handler for the mouse entering the container zone, to display the
     * container if it was hidden.
     * @method ForgePlugins.ThumbnailBar#_mouseEnterHandler
     * @private
     */
    _mouseEnterHandler: function()
    {
        this.show();
    },

    /**
     * Handler for the mouse leaving the container zone, to hide the
     * container if it was displayed.
     * @method ForgePlugins.ThumbnailBar#_mouseLeaveHandler
     * @private
     */
    _mouseLeaveHandler: function()
    {
        this.hide();
    },

    /**
     * Thumbnails creation routine.
     * @param  {FORGE.Scene} scene - the attached scene to the thumbnail
     * @method ForgePlugins.ThumbnailBar#_createSceneThumb
     * @private
     */
    _createSceneThumb: function(scene)
    {
        if (scene.thumbnails === undefined)
        {
            throw "ThumbnailBar: missing thumbnail for the scene \"" + scene.uid + "\"";
        }

        var thumbTipContainer = this.plugin.create.displayObjectContainer();
        var imageConfig = {
            key: scene.thumbnails[0].uid,
            url: scene.thumbnails[0].url
        };

        var img = this.plugin.create.image(imageConfig, false);

        // Position
        if (this._orientation === "horizontal")
        {
            thumbTipContainer.width = this.plugin.options.thumbnail.width;
            thumbTipContainer.height = this.plugin.options.thumbnail.height;
            thumbTipContainer.x = this.plugin.options.thumbnail.margin + this._images.length * (thumbTipContainer.width + this.plugin.options.thumbnail.margin);
            thumbTipContainer.y = this.plugin.options.thumbnail.margin;

            img.height = this.plugin.options.thumbnail.height;
            img.dom.style.maxWidth = this.plugin.options.thumbnail.width + "px";
        }
        else if (this._orientation === "vertical")
        {
            thumbTipContainer.width = this.plugin.options.thumbnail.width;
            thumbTipContainer.height = this.plugin.options.thumbnail.height;
            thumbTipContainer.x = this.plugin.options.thumbnail.margin;
            thumbTipContainer.y = this.plugin.options.thumbnail.margin + this._images.length * (thumbTipContainer.height + this.plugin.options.thumbnail.margin);

            img.dom.style.maxHeight = this.plugin.options.thumbnail.height + "px";
        }

        // Style
        img.borderRadius = this.plugin.options.thumbnail.borderRadius;
        img.borderColor = this.plugin.options.thumbnail.borderColorOver;

        img.data = {
            scene: scene
        };
        this._images.push(img);
        this._thumbContainer.addChild(thumbTipContainer);
        thumbTipContainer.addChild(img);

        img.pointer.enabled = true;
        img.pointer.cursor = FORGE.Pointer.cursors.POINTER;
        img.pointer.onClick.add(this._thumbClickHandler, this);
        img.pointer.onOver.add(this._thumbOverHandler, this);
        img.pointer.onOut.add(this._thumbOutHandler, this);

        // Create tooltip if enabled
        if (this.plugin.options.tooltip.enabled)
        {
            var tipConfig = {
                value: scene.name,
                color: this.plugin.options.tooltip.color,
                font: this.plugin.options.tooltip.font,
                padding: this.plugin.options.tooltip.padding
            };

            var tip = this.plugin.create.textField(tipConfig);
            this._tips.push(tip);

            thumbTipContainer.addChild(tip);

            tip.width = img.dom.style.maxWidth || img.width;
            tip[this.plugin.options.tooltip.position] = this.plugin.options.tooltip.animation ? -tip.pixelHeight : 0;
            tip.background = this.plugin.options.tooltip.background;
            tip.borderRadius = this.plugin.options.tooltip.borderRadius;

            tip.tween = this.plugin.create.tween(tip);
        }
    },

    /**
     * Handler for click on a thumbnail.
     * @param {FORGE.Event} event - the event
     * @method ForgePlugins.ThumbnailBar#_thumbClickHandler
     * @private
     */
    _thumbClickHandler: function(event)
    {
        var scene = event.emitter.data.scene;
        this.viewer.story.scene = scene;
    },

    /**
     * Handler for getting over a thumbnail. Display the border and the tooltip
     * if one.
     * @param {FORGE.Event} event - the event
     * @method ForgePlugins.ThumbnailBar#_thumbOverHandler
     * @private
     */
    _thumbOverHandler: function(event)
    {
        var img = event.emitter;

        img.borderWidth = this.plugin.options.thumbnail.borderWidth;
        img.borderColor = this.plugin.options.thumbnail.borderColorOver;

        // Show tooltip if enabled
        if (this.plugin.options.tooltip.enabled && this.plugin.options.tooltip.animation)
        {
            var tip = img.parent.children[1];
            var movement = {};

            movement[this.plugin.options.tooltip.position] = 0;
            tip.tween.to(movement, 200, this.plugin.options.tooltip.tweenFunctionIn).start();
        }
    },

    /**
     * Handler for getting over a thumbnail. Hide the border and the tooltip
     * if one.
     * @param {FORGE.Event} event - the event
     * @method ForgePlugins.ThumbnailBar#_thumbOutHandler
     * @private
     */
    _thumbOutHandler: function(event)
    {
        var img = event.emitter;

        if (img.data.scene !== this.viewer.story.scene)
        {
            img.borderWidth = 0;
        }
        else
        {
            img.borderColor = this.plugin.options.thumbnail.borderColor;
        }

        // Hide tooltip if enabled
        if (this.plugin.options.tooltip.enabled && this.plugin.options.tooltip.animation)
        {
            var tip = img.parent.children[1];
            var movement = {};

            movement[this.plugin.options.tooltip.position] = -tip.pixelHeight;
            tip.tween.to(movement, 200, this.plugin.options.tooltip.tweenFunctionOut).start();
        }
    },

    /**
     * Handler for clicking on a navigation arrow.
     * @param  {FORGE.Event} event - the event
     * @method ForgePlugins.ThumbnailBar#_navClickHandler
     * @private
     */
    _navClickHandler: function(event)
    {
        if (event.emitter.id === "navThumbPrev")
        {
            this.move(1);
        }
        else if (event.emitter.id === "navThumbNext")
        {
            this.move(-1);
        }
    },

    /**
     * Handler for the locale change.
     * @method ForgePlugins.ThumbnailBar#_localeChangeHandler
     * @private
     */
    _localeChangeHandler: function()
    {
        if (this._images !== null && this._images.length > 0)
        {
            var img;
            for (var i = 0, ii = this._images.length; i < ii; i++)
            {
                img = this._images[i];
                img.tooltip = img.data.scene.name;

                var tip = this._tips[i];
                if (typeof tip !== "undefined")
                {
                    tip.value = img.data.scene.name;
                }
            }
        }
    },

    /**
     * Handler for the scene loading.
     * @param  {FORGE.Event} event - the event
     * @method ForgePlugins.ThumbnailBar#_sceneLoadHandler
     * @private
     */
    _sceneLoadHandler: function(event)
    {
        this._highlightCurrentScene();
    },

    /**
     * Highlight the current scene in the bar.
     * @method ForgePlugins.ThumbnailBar#_highlightCurrentScene
     * @private
     */
    _highlightCurrentScene: function()
    {
        if (this._images !== null && this._images.length > 0)
        {
            var img;
            for (var i = 0, ii = this._images.length; i < ii; i++)
            {
                img = this._images[i];

                if (img.data.scene == this.viewer.story.scene)
                {
                    img.borderWidth = this.plugin.options.thumbnail.borderWidth;
                    img.borderColor = this.plugin.options.thumbnail.borderColor;
                }
                else
                {
                    img.borderWidth = 0;
                    img.borderColor = this.plugin.options.thumbnail.borderColorOver;
                }
            }
        }
    },

    /**
     * Resize handler for repositionning the navigation.
     * @method ForgePlugins.ThumbnailBar#_onResize
     * @private
     */
    _onResize: function()
    {
        if (this._orientation === "horizontal")
        {
            this._navPrev.x = this._navigationContainer.x - this._navPrev.pixelWidth;
            this._navPrev.y = (this._navigationContainer.height - this._navPrev.height) / 2;
            this._navNext.x = this._navigationContainer.pixelWidth + this._navigationContainer.x;
            this._navNext.y = this._navPrev.y;
        }
        else if (this._orientation === "vertical")
        {
            this._navPrev.x = (this._navigationContainer.width - this._navPrev.width) / 2;
            this._navPrev.y = this._navigationContainer.y - this._navPrev.pixelHeight;
            this._navNext.x = this._navPrev.x;
            this._navNext.y = this._navigationContainer.pixelHeight + this._navigationContainer.y;
        }
    },

    /**
     * Show the container when it was hidden.
     * @method ForgePlugins.ThumbnailBar#show
     */
    show: function()
    {
        var movement = {
            container: null,
            navigation: null
        };

        if (this._orientation === "horizontal")
        {
            if (this._position === "top")
            {
                movement.container = {
                    top: 0
                };
                movement.navigation = {
                    top: (this._navigationContainer.height - this._navPrev.height) / 2
                };
            }
            else if (this._position === "bottom")
            {
                movement.container = {
                    bottom: 0
                };
                movement.navigation = {
                    bottom: (this._navigationContainer.height - this._navPrev.height) / 2
                };
            }
        }
        else if (this._orientation === "vertical")
        {
            if (this._alignment === "left")
            {
                movement.container = {
                    left: 0
                };
                movement.navigation = {
                    left: (this._navigationContainer.width - this._navPrev.width) / 2
                };
            }
            else if (this._alignment === "right")
            {
                movement.container = {
                    right: 0
                };
                movement.navigation = {
                    right: (this._navigationContainer.width - this._navPrev.width) / 2
                };
            }
        }

        this._containerTween.to(movement.container, 400, this.plugin.options.container.tweenFunctionIn).start();
        this._navPrevTween.to(movement.navigation, 400, this.plugin.options.container.tweenFunctionIn).start();
        this._navNextTween.to(movement.navigation, 400, this.plugin.options.container.tweenFunctionIn).start();
    },

    /**
     * Hide the container when it was displayed.
     * @method ForgePlugins.ThumbnailBar#hide
     */
    hide: function()
    {
        var movement = {
            container: null,
            navigation: null
        };

        if (this._orientation === "horizontal")
        {
            if (this._position === "top")
            {
                movement.container = {
                    top: -this._container.pixelHeight
                };
                movement.navigation = {
                    top: -(this._navigationContainer.height + this._navPrev.height) / 2
                };
            }
            else if (this._position === "bottom")
            {
                movement.container = {
                    bottom: -this._container.pixelHeight
                };
                movement.navigation = {
                    bottom: -(this._navigationContainer.height + this._navPrev.height) / 2
                };
            }
        }
        else if (this._orientation === "vertical")
        {
            if (this._alignment === "left")
            {
                movement.container = {
                    left: -this._container.pixelWidth
                };
                movement.navigation = {
                    left: -(this._navigationContainer.width + this._navPrev.width) / 2
                };
            }
            else if (this._alignment === "right")
            {
                movement.container = {
                    right: -this._container.pixelWidth
                };
                movement.navigation = {
                    right: -(this._navigationContainer.width + this._navPrev.width) / 2
                };
            }
        }

        this._containerTween.to(movement.container, 400, this.plugin.options.container.tweenFunctionOut).start();
        this._navPrevTween.to(movement.navigation, 400, this.plugin.options.container.tweenFunctionOut).start();
        this._navNextTween.to(movement.navigation, 400, this.plugin.options.container.tweenFunctionOut).start();
    },

    /**
     * Move the thumbnails into the container, according to a direction.
     * @param {number} direction - the direction to move to, can be 1 or -1
     * @method ForgePlugins.ThumbnailBar#move
     */
    move: function(direction)
    {
        var movement;

        if (this.plugin.options.navigation.type === "click")
        {
            if (this._orientation === "horizontal")
            {
                movement = {
                    left: FORGE.Math.clamp(direction * this.plugin.options.navigation.step + this._thumbContainer.x, -this._images.length * (parseInt(this._images[0].dom.style.maxWidth) + this.plugin.options.thumbnail.margin) + this._thumbContainer.pixelWidth - this.plugin.options.thumbnail.margin, 0)
                }
            }
            else if (this._orientation === "vertical")
            {
                movement = {
                    top: FORGE.Math.clamp(direction * this.plugin.options.navigation.step + this._thumbContainer.y, -this._images.length * (parseInt(this._images[0].dom.style.maxHeight) + this.plugin.options.thumbnail.margin) + this._thumbContainer.pixelHeight - this.plugin.options.thumbnail.margin, 0)
                }
            }
        }

        this._thumbTween.to(movement, 400, this.plugin.options.navigation.tweenFunction).start();
    },

    /**
     * Destroy routine.
     * @method ForgePlugins.ThumbnailBar#destroy
     */
    destroy: function()
    {
        this._container = null;
        this._navigationContainer = null;
        this._images = null;
        this._tips = null;
        this._containerTween = null;
    }

};


text:
namespace XRoadLib.Serialization.Template;

public interface IXmlTemplate
{
    [UsedImplicitly]
    IDictionary<string, Type> ParameterTypes { get; }

    [UsedImplicitly]
    IEnumerable<IXmlTemplateNode> ParameterNodes { get; }

    IXmlTemplateNode RequestNode { get; }

    IXmlTemplateNode ResponseNode { get; }
}

redpajama_set_name: RedPajamaGithub


text:
.class public Landroid/filterfw/core/SimpleScheduler;
.super Landroid/filterfw/core/Scheduler;
.source "SimpleScheduler.java"

# direct methods
.method public constructor <init>(Landroid/filterfw/core/FilterGraph;)V
    .locals 0
    .param p1, "graph"    # Landroid/filterfw/core/FilterGraph;

    .prologue
    .line 29
    invoke-direct {p0, p1}, Landroid/filterfw/core/Scheduler;-><init>(Landroid/filterfw/core/FilterGraph;)V

    .line 28
    return-void
.end method

# virtual methods
.method public reset()V
    .locals 0

    .prologue
    .line 33
    return-void
.end method

.method public scheduleNextNode()Landroid/filterfw/core/Filter;
    .locals 3

    .prologue
    .line 38
    invoke-virtual {p0}, Landroid/filterfw/core/SimpleScheduler;->getGraph()Landroid/filterfw/core/FilterGraph;

    move-result-object v2

    invoke-virtual {v2}, Landroid/filterfw/core/FilterGraph;->getFilters()Ljava/util/Set;

    move-result-object v2

    invoke-interface {v2}, Ljava/lang/Iterable;->iterator()Ljava/util/Iterator;

    move-result-object v1

    .local v1, "filter$iterator":Ljava/util/Iterator;
    :cond_0
    invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z

    move-result v2

    if-eqz v2, :cond_1

    invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Landroid/filterfw/core/Filter;

    .line 39
    .local v0, "filter":Landroid/filterfw/core/Filter;
    invoke-virtual {v0}, Landroid/filterfw/core/Filter;->canProcess()Z

    move-result v2

    if-eqz v2, :cond_0

    .line 40
    return-object v0

    .line 42
    .end local v0    # "filter":Landroid/filterfw/core/Filter;
    :cond_1
    const/4 v2, 0x0

    return-object v2
.end method


text:
nodeTry
=======

Node.JS Server test


text:
.. _data_integrations:

============
Integrations
============

If you're new to Ray Datasets, we recommend starting with the :ref:`Ray Datasets Quick Start <datasets_getting_started>`.

This is a guide on how to run Dask, Spark, Mars or Modin on Ray.

.. toctree::
    :maxdepth: 2

    dask-on-ray
    raydp
    mars-on-ray
    modin/index


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <title>First post</title>

    <meta name="description" content="This is first post, I'm just saying hello here :)">

    <meta name="author" content="Adam Świderski">

    <meta name="google-site-verification" content="16LpcrHd_M03vADtS0inK7Nh5AcO1iTZQe6q57vCJfo"/>

    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <link href="/pl/assets/resources/bootstrap/css/bootstrap.min.css" rel="stylesheet">
    <link href="/pl/assets/resources/font-awesome/css/font-awesome.min.css" rel="stylesheet">
    <link href="/pl/assets/resources/syntax/syntax.css" rel="stylesheet">
    <link href="/pl/assets/css/style.css" rel="stylesheet">

    <link rel="apple-touch-icon" sizes="57x57" href="/pl/assets/ico/apple-icon-57x57.png">
    <link rel="apple-touch-icon" sizes="60x60" href="/pl/assets/ico/apple-icon-60x60.png">
    <link rel="apple-touch-icon" sizes="72x72" href="/pl/assets/ico/apple-icon-72x72.png">
    <link rel="apple-touch-icon" sizes="76x76" href="/pl/assets/ico/apple-icon-76x76.png">
    <link rel="apple-touch-icon" sizes="114x114" href="/pl/assets/ico/apple-icon-114x114.png">
    <link rel="apple-touch-icon" sizes="120x120" href="/pl/assets/ico/apple-icon-120x120.png">
    <link rel="apple-touch-icon" sizes="144x144" href="/pl/assets/ico/apple-icon-144x144.png">
    <link rel="apple-touch-icon" sizes="152x152" href="/pl/assets/ico/apple-icon-152x152.png">
    <link rel="apple-touch-icon" sizes="180x180" href="/pl/assets/ico/apple-icon-180x180.png">
    <link rel="icon" type="image/png" sizes="192x192" href="/pl/assets/ico/android-icon-192x192.png">
    <link rel="icon" type="image/png" sizes="32x32" href="/pl/assets/ico/favicon-32x32.png">
    <link rel="icon" type="image/png" sizes="96x96" href="/pl/assets/ico/favicon-96x96.png">
    <link rel="icon" type="image/png" sizes="16x16" href="/pl/assets/ico/favicon-16x16.png">
    <link rel="manifest" href="/pl/manifest.json">
    <meta name="msapplication-TileColor" content="#ffffff">
    <meta name="msapplication-TileImage" content="/assets/ico/ms-icon-144x144.png">
    <meta name="theme-color" content="#ffffff">

    <link rel="alternate" type="application/rss+xml" title="" href="/pl/feed.xml">
    <meta http-equiv="Content-Language" content="pl">
<link rel="alternate" hreflang="en" href="http://asvid.github.io//first-post"/>
<link rel="alternate" hreflang="pl" href="http://asvid.github.io//pl/first-post"/>

<title>First post</title>
<meta name="generator" content="Jekyll v4.2.2" />
<meta property="og:title" content="First post" />
<meta property="og:locale" content="en_US" />
<meta name="description" content="This is first post, I'm just saying hello here :)" />
<meta property="og:description" content="This is first post, I'm just saying hello here :)" />
<link rel="canonical" href="http://asvid.github.io//pl/first-post" />
<meta property="og:url" content="http://asvid.github.io//first-post" />
<meta property="og:type" content="article" />
<meta property="article:published_time" content="2016-04-16T00:00:00+00:00" />
<meta name="twitter:card" content="summary" />
<meta property="twitter:title" content="First post" />

        <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
            Toggle navigation

        </button>

Blog

O mnie

Tagi

			Siema jestem Adam

	I jestem programistą

Blog

O mnie

Tagi

First post

	   April
	   16th,

	   2016

Siema!

                    Like the post? Disagree? Let me know

                        with email.

Share Post

                    Twitter

                    Facebook

                    Google+

Adam Świderski

software engineer

← Previous

Next
                →

            © 2022 Adam Świderski with Jekyll. Theme: dbyll by dbtek.


text:
package com.atlassian.plugin.main;

import static com.atlassian.plugin.main.PluginsConfigurationBuilder.pluginsConfiguration;

import com.atlassian.plugin.test.PluginJarBuilder;

import org.apache.commons.io.FileUtils;

import java.io.File;
import java.io.IOException;
import java.io.FileOutputStream;
import java.io.BufferedOutputStream;
import java.util.zip.ZipOutputStream;
import java.util.zip.ZipEntry;
import java.util.Collections;

import junit.framework.TestCase;

public class TestAtlassianPlugins extends TestCase
{
    private File pluginDir;
    private File bundledPluginDir;
    private File bundledPluginZip;
    private AtlassianPlugins plugins;

    @Override
    public void setUp() throws IOException
    {
        final File targetDir = new File("target");
        pluginDir = new File(targetDir, "plugins");
        pluginDir.mkdirs();
        FileUtils.cleanDirectory(pluginDir);
        bundledPluginDir = new File(targetDir, "bundled-plugins");
        bundledPluginDir.mkdirs();
        bundledPluginZip = new File(targetDir, "atlassian-bundled-plugins.zip");
    }

    @Override
    public void tearDown() throws IOException
    {
        FileUtils.cleanDirectory(pluginDir);
        FileUtils.cleanDirectory(bundledPluginDir);
        bundledPluginZip.delete();
        if (plugins != null)
        {
            plugins.stop();
        }
    }

    public void testStart() throws Exception
    {
        //tests
        new PluginJarBuilder().addPluginInformation("mykey", "mykey", "1.0").build(pluginDir);
        final PluginsConfiguration config = pluginsConfiguration()
                .pluginDirectory(pluginDir)
                .packageScannerConfiguration(
                    new PackageScannerConfigurationBuilder()
                            .packagesToInclude("org.apache.*", "com.atlassian.*", "org.dom4j*")
                            .packagesVersions(Collections.singletonMap("org.apache.commons.logging", "1.1.1"))
                            .build())
                .build();
        plugins = new AtlassianPlugins(config);
        plugins.start();
        assertEquals(1, plugins.getPluginAccessor().getPlugins().size());
    }

    public void testInstalledPluginCanDependOnBundledPlugin() throws Exception
    {
        PluginJarBuilder bundledJar =  new PluginJarBuilder("bundled")
            .addFormattedResource("META-INF/MANIFEST.MF",
                                  "Export-Package: com.atlassian.test.bundled",
                                  "Bundle-SymbolicName: bundled",
                                  "Bundle-Version: 1.0.0",
                                  "Manifest-Version: 1.0",
                                  "")
            .addFormattedJava("com.atlassian.test.bundled.BundledInterface",
                              "package com.atlassian.test.bundled;",
                              "public interface BundledInterface {}");
        bundledJar.build(bundledPluginDir);

        new PluginJarBuilder("installed", bundledJar.getClassLoader())
            .addFormattedResource("atlassian-plugin.xml",
                                  "<atlassian-plugin name='Installed Plugin' key='installed' pluginsVersion='2'>",
                                  "    <plugin-info>",
                                  "        <version>1.0</version>",
                                  "    </plugin-info>",
                                  "    <component key='installed' class='com.atlassian.test.installed.InstalledClass'/>",
                                  "</atlassian-plugin>")
            .addFormattedJava("com.atlassian.test.installed.InstalledClass",
                              "package com.atlassian.test.installed;",
                              "import com.atlassian.test.bundled.BundledInterface;",
                              "public class InstalledClass implements BundledInterface {}")
            .build(pluginDir);

        zipBundledPlugins();

        final PluginsConfiguration config = pluginsConfiguration()
            .pluginDirectory(pluginDir)
            .bundledPluginUrl(bundledPluginZip.toURL())
            .bundledPluginCacheDirectory(bundledPluginDir)
            .packageScannerConfiguration(
                new PackageScannerConfigurationBuilder()
                    .packagesToInclude("com.atlassian.*", "org.slf4j", "org.apache.commons.logging")
                    .packagesVersions(Collections.singletonMap("org.apache.commons.logging", "1.1.1"))
                    .build())
            .build();
        plugins = new AtlassianPlugins(config);
        plugins.start();
        assertEquals(2, plugins.getPluginAccessor().getEnabledPlugins().size());

    }

    private void zipBundledPlugins() throws IOException
    {
        ZipOutputStream zip = new ZipOutputStream(new BufferedOutputStream(new FileOutputStream(bundledPluginZip)));
        for (File bundledPlugin : bundledPluginDir.listFiles())
        {
            zip.putNextEntry(new ZipEntry(bundledPlugin.getName()));
            zip.write(FileUtils.readFileToByteArray(bundledPlugin));
        }
        zip.close();
    }
}


text:
namespace BehaveN
{
    using System;
    using System.Text;

    /// <summary>
    /// Represents a form.
    /// </summary>
    public class Text : IBlock
    {
        private readonly StringBuilder stringBuilder;

        /// <summary>
        /// Initializes a new instance of the <see cref="Text"/> class.
        /// </summary>
        /// <param name="stringBuilder">The string builder.</param>
        public Text(StringBuilder stringBuilder)
        {
            this.stringBuilder = stringBuilder;
        }

        /// <summary>
        /// Gets the string builder.
        /// </summary>
        /// <value>The string builder.</value>
        public StringBuilder StringBuilder
        {
            get { return this.stringBuilder; }
        }

        /// <summary>
        /// Converts the block into an object.
        /// </summary>
        /// <param name="type">The type of object to convert to.</param>
        /// <returns>The new object.</returns>
        public object ConvertTo(Type type)
        {
            if (type != typeof(StringBuilder))
            {
                throw new ArgumentException();
            }

            return this.stringBuilder;
        }

        /// <summary>
        /// Formats this instance.
        /// </summary>
        /// <returns>A <c>string</c> representing the block.</returns>
        public string Format()
        {
            var lines = TextParser.GetLines(this.stringBuilder.ToString());

            var sb = new StringBuilder();

            foreach (var line in lines)
            {
                sb.AppendLine("    > " + line);
            }

            return sb.ToString();
        }

        /// <summary>
        /// Checks that all of the values are on the specified object.
        /// </summary>
        /// <param name="actual">The object to check against.</param>
        /// <returns></returns>
        public bool Check(object actual)
        {
            return this.stringBuilder.ToString() == ((StringBuilder)actual).ToString();
        }

        /// <summary>
        /// Gets the suggested type for the parameter.
        /// </summary>
        /// <returns>The type.</returns>
        public string GetSuggestedParameterType()
        {
            return "StringBuilder";
        }

        /// <summary>
        /// Gets the suggested name for the parameter.
        /// </summary>
        /// <returns>The name.</returns>
        public string GetSuggestedParameterName()
        {
            return "text";
        }

        /// <summary>
        /// Gets the suggested type definition for the parameter.
        /// </summary>
        /// <returns>The suggested type definition.</returns>
        public string GetSuggestedParameterTypeDefinition()
        {
            return null;
        }

        /// <summary>
        /// Reports to the reporter.
        /// </summary>
        /// <param name="reporter">The reporter.</param>
        public void ReportTo(Reporter reporter)
        {
            if (reporter is IBlockReporter<Text>)
            {
                ((IBlockReporter<Text>)reporter).ReportBlock(this);
            }
            else
            {
                throw new Exception(string.Format("{0} doesn't support reporting text.", reporter.GetType().FullName));
            }
        }
    }
}


text:
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
                             http://maven.apache.org/maven-v4_0_0.xsd">
    <parent>
        <artifactId>org.beamfoundry.bundles.spring-dm.iandt-bundles</artifactId>
        <groupId>org.beamfoundry.bundles.spring-dm.iandt</groupId>
        <version>1.3.0-SNAPSHOT</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>
    <groupId>org.beamfoundry.bundles.spring-dm.iandt</groupId>
    <artifactId>org.beamfoundry.bundles.spring-dm.iandt.deadlock</artifactId>
    <packaging>jar</packaging>
    <name>Spring DM Test Bundle: Deadlock bundle</name>
    <description>A test bundle which will force a deadlock in context creation</description>
</project>


text:
package org.jivesoftware.smackx.jingle.mediaimpl.jspeex;

import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

import org.jivesoftware.smackx.jingle.JingleSession;
import org.jivesoftware.smackx.jingle.SmackLogger;
import org.jivesoftware.smackx.jingle.media.JingleMediaManager;
import org.jivesoftware.smackx.jingle.media.JingleMediaSession;
import org.jivesoftware.smackx.jingle.media.PayloadType;
import org.jivesoftware.smackx.jingle.mediaimpl.JMFInit;
import org.jivesoftware.smackx.jingle.nat.JingleTransportManager;
import org.jivesoftware.smackx.jingle.nat.TransportCandidate;

/**
 * Implements a jingleMediaManager using JMF based API and JSpeex.
 * It supports Speex codec.
 * <i>This API only currently works on windows.</i>
 *
 * @author Thiago Camargo
 */
public class SpeexMediaManager extends JingleMediaManager {

	private static final SmackLogger LOGGER = SmackLogger.getLogger(SpeexMediaManager.class);

	public static final String MEDIA_NAME = "Speex";

    private List<PayloadType> payloads = new ArrayList<PayloadType>();

    public SpeexMediaManager(JingleTransportManager transportManager) {
        super(transportManager);
        setupPayloads();
        setupJMF();
    }

    /**
     * Returns a new jingleMediaSession
     *
     * @param payloadType payloadType
     * @param remote      remote Candidate
     * @param local       local Candidate
     * @return JingleMediaSession
     */
    public JingleMediaSession createMediaSession(PayloadType payloadType, final TransportCandidate remote, final TransportCandidate local, final JingleSession jingleSession) {
        return new AudioMediaSession(payloadType, remote, local, null,null);
    }

    /**
     * Setup API supported Payloads
     */
    private void setupPayloads() {
        payloads.add(new PayloadType.Audio(15, "speex"));
    }

    /**
     * Return all supported Payloads for this Manager
     *
     * @return The Payload List
     */
    public List<PayloadType> getPayloads() {
        return payloads;
    }

    /**
     * Runs JMFInit the first time the application is started so that capture
     * devices are properly detected and initialized by JMF.
     */
    public static void setupJMF() {
        // .jmf is the place where we store the jmf.properties file used
        // by JMF. if the directory does not exist or it does not contain
        // a jmf.properties file. or if the jmf.properties file has 0 length
        // then this is the first time we're running and should continue to
        // with JMFInit
        String homeDir = System.getProperty("user.home");
        File jmfDir = new File(homeDir, ".jmf");
        String classpath = System.getProperty("java.class.path");
        classpath += System.getProperty("path.separator")
                + jmfDir.getAbsolutePath();
        System.setProperty("java.class.path", classpath);

        if (!jmfDir.exists())
            jmfDir.mkdir();

        File jmfProperties = new File(jmfDir, "jmf.properties");

        if (!jmfProperties.exists()) {
            try {
                jmfProperties.createNewFile();
            }
            catch (IOException ex) {
                LOGGER.debug("Failed to create jmf.properties");
                ex.printStackTrace();
            }
        }

        // if we're running on linux checkout that libjmutil.so is where it
        // should be and put it there.
        runLinuxPreInstall();

        if (jmfProperties.length() == 0) {
            new JMFInit(null, false);
        }

    }

    private static void runLinuxPreInstall() {
        // @TODO Implement Linux Pre-Install
    }

    public String getName() {
        return MEDIA_NAME;
    }
}


text:
using System;

namespace Pidgin.Configuration;

/// <summary>
/// A default configuration for textual input.
/// </summary>
public class CharDefaultConfiguration : DefaultConfiguration<char>
{
    /// <summary>
    /// The shared global instance of <see cref="CharDefaultConfiguration"/>.
    /// </summary>
    public static new IConfiguration<char> Instance { get; } = new CharDefaultConfiguration();

    /// <summary>
    /// Handles newlines and tab stops.
    /// </summary>
    public override Func<char, SourcePosDelta> SourcePosCalculator { get; }
        = token => token == '\n'
            ? SourcePosDelta.NewLine
            : token == '\t'
                ? new SourcePosDelta(0, 4)
                : SourcePosDelta.OneCol;
}


text:
from django_summernote.admin import SummernoteModelAdmin

from django.contrib import admin

from simplesite.models import (
    Page, PageImage, SocialNetwork
)

class PageImageInline(admin.TabularInline):
    """
    Stack inline choice items to be displayed in Page Admin Panel
    """
    model = PageImage
    extra = 1

@admin.register(Page)
class PageAdmin(SummernoteModelAdmin):
    """
    Customizing Page Model representation in Django Admin
    """
    fieldsets = [
        ('SEO', {
            'fields': [
                'seo_title',
                'seo_description',
                'seo_keywords',
            ],
            'classes': [
                'collapse',
            ]
        }),
        (None, {
            'fields': [
                'title',
                'slug',
                'alternative_url',
                ('sort_order', 'is_public'),
                '_related_model',
                'content',
            ]
        })
    ]

    prepopulated_fields = {'slug': ('title',)}
    inlines = [PageImageInline]
    list_display = (
        'id',
        'title',
        'slug',
        'is_public',
        'sort_order',
        'last_modification',
    )
    list_display_links = ('id', 'title',)
    list_filter = ('is_public', 'creation_date', 'last_modification',)
    search_fields = ['title', 'pk']

@admin.register(SocialNetwork)
class SocialNetworkAdmin(SummernoteModelAdmin):
    """
    Customizing SocialNetwork representation in Django Admin
    """
    fieldsets = [
        (None, {
            'fields': [
                'title',
                'slug',
                'url',
                ('sort_order', 'is_active'),
                'image',
            ]
        }),
    ]

    prepopulated_fields = {'slug': ('title',)}
    list_display = (
        'id',
        'title',
        'slug',
        'is_active',
        'sort_order',
    )
    list_display_links = ('id', 'title',)
    list_display_filter = ('is_active',)
    search_fields = ['title', 'pk']


text:
module Revily
  module Command
    class Service < Base

      self.default_subcommand = 'list'

      # def ex
      subcommand 'list', 'list all services' do
        def execute
          super
          puts self.inspect
          logger.info "listing services"
        end
      end

    end
  end
end


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

var pkg = require('../../package.json');

var pathToRoot = path.join(__dirname, '../../');
var pathToSrc = path.join(pathToRoot, 'src/');
var pathToLib = path.join(pathToRoot, 'lib/');
var pathToImageTest = path.join(pathToRoot, 'test/image');
var pathToDist = path.join(pathToRoot, 'dist/');
var pathToBuild = path.join(pathToRoot, 'build/');

var pathToTopojsonSrc = path.join(
    path.dirname(require.resolve('sane-topojson')), 'dist/'
);

var year = (new Date()).getFullYear();

module.exports = {
    pathToRoot: pathToRoot,
    pathToSrc: pathToSrc,
    pathToLib: pathToLib,
    pathToBuild: pathToBuild,

    pathToPlotlyIndex: path.join(pathToLib, 'index.js'),
    pathToPlotlyCore: path.join(pathToSrc, 'core.js'),
    pathToPlotlyBuild: path.join(pathToBuild, 'plotly.js'),
    pathToPlotlyDist: path.join(pathToDist, 'plotly.js'),
    pathToPlotlyDistMin: path.join(pathToDist, 'plotly.min.js'),
    pathToPlotlyDistWithMeta: path.join(pathToDist, 'plotly-with-meta.js'),

    pathToTopojsonSrc: pathToTopojsonSrc,
    pathToTopojsonDist: path.join(pathToDist, 'topojson/'),
    pathToPlotlyGeoAssetsSrc: path.join(pathToSrc, 'assets/geo_assets.js'),
    pathToPlotlyGeoAssetsDist: path.join(pathToDist, 'plotly-geo-assets.js'),

    pathToFontSVG: path.join(pathToSrc, 'fonts/ploticon/ploticon.svg'),
    pathToFontSVGBuild: path.join(pathToBuild, 'ploticon.js'),

    pathToSCSS: path.join(pathToSrc, 'css/style.scss'),
    pathToCSSBuild: path.join(pathToBuild, 'plotcss.js'),

    pathToTestDashboardBundle: path.join(pathToBuild, 'test_dashboard-bundle.js'),
    pathToImageViewerBundle: path.join(pathToBuild, 'image_viewer-bundle.js'),

    pathToTestImageMocks: path.join(pathToImageTest, 'mocks/'),
    pathToTestImageBaselines: path.join(pathToImageTest, 'baselines/'),
    pathToTestImages: path.join(pathToBuild, 'test_images/'),
    pathToTestImagesDiff: path.join(pathToBuild, 'test_images_diff/'),
    pathToTestImagesDiffList: path.join(pathToBuild, 'list_of_incorrect_images.txt'),

    pathToJasmineTests: path.join(pathToRoot, 'test/jasmine/tests'),
    pathToJasmineBundleTests: path.join(pathToRoot, 'test/jasmine/bundle_tests'),

    uglifyOptions: {
        fromString: true,
        mangle: true,
        compress: {
            warnings: false,
            screw_ie8: true
        },
        output: {
            beautify: false,
            ascii_only: true
        }
    },

    licenseDist: [
        ''
    ].join('\n'),

    licenseSrc: [
        '/**',
        '* Copyright 2012-' + year + ', Plotly, Inc.',
        '* All rights reserved.',
        '*',
        '* This source code is licensed under the MIT license found in the',
        '* LICENSE file in the root directory of this source tree.',
        '*/'
    ].join('\n')
};


text:
#ifndef TCP_ADAPTOR_HPP_VIA_HTTPLIB_
#define TCP_ADAPTOR_HPP_VIA_HTTPLIB_

#pragma once

//////////////////////////////////////////////////////////////////////////////
// Copyright (c) 2013-2014 Ken Barker
// (ken dot barker at via-technology dot co dot uk)
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//////////////////////////////////////////////////////////////////////////////
/// @file tcp_adaptor.hpp
/// @brief Contains the tcp_adaptor socket adaptor class.
//////////////////////////////////////////////////////////////////////////////
#include "socket_adaptor.hpp"

namespace via
{
  namespace comms
  {
    //////////////////////////////////////////////////////////////////////////
    /// @class tcp_adaptor
    /// This class enables the connection class to use tcp sockets.
    /// This class and ssl_tcp_adaptor provide a common interface that
    /// enables connection to be configured for either tcp or ssl sockets.
    /// @see connection
    /// @see ssl::ssl_tcp_adaptor
    //////////////////////////////////////////////////////////////////////////
    class tcp_adaptor
    {
      boost::asio::io_service& io_service_; ///< The asio io_service.
      boost::asio::ip::tcp::socket socket_; ///< The asio TCP socket.
      /// The host iterator used by the resolver.
      boost::asio::ip::tcp::resolver::iterator host_iterator_;

      /// @fn resolve_host
      /// resolves the host name and port.
      /// @param host_name the host name.
      /// @param port_name the host port.
      boost::asio::ip::tcp::resolver::iterator resolve_host
          (char const* host_name, char const* port_name) const
      {
        boost::asio::ip::tcp::resolver resolver{io_service_};
        boost::asio::ip::tcp::resolver::query query{host_name, port_name};
        return resolver.resolve(query);
      }

    protected:

      /// @fn handshake
      /// Performs the SSL handshake. Since this isn't an SSL socket, it just
      /// calls the handshake_handler with a success error code.
      /// @param handshake_handler the handshake callback function.
      // @param is_server whether performing client or server handshaking,
      // not used by un-encrypted sockets.
      void handshake(ErrorHandler handshake_handler, bool /*is_server*/ = false)
      {
        boost::system::error_code ec; // Default is success
        handshake_handler(ec);
      }

      /// @fn connect_socket
      /// Attempts to connect to the given resolver iterator.
      /// @param connect_handler the connect callback function.
      /// @param host_iterator the resolver iterator.
      void connect_socket(ConnectHandler connect_handler,
                          boost::asio::ip::tcp::resolver::iterator host_iterator)
      { boost::asio::async_connect(socket_, host_iterator, connect_handler); }

      /// The tcp_adaptor constructor.
      /// @param io_service the asio io_service associted with this connection
      explicit tcp_adaptor(boost::asio::io_service& io_service) :
        io_service_(io_service),
        socket_{io_service_},
        host_iterator_{}
      {}

    public:

      /// The type of resolver iterator used by this socket.
      typedef boost::asio::ip::tcp::resolver::iterator resolver_iterator;

      /// A virtual destructor because connection inherits from this class.
      virtual ~tcp_adaptor()
      {}

      /// The default HTTP port.
      static const unsigned short DEFAULT_HTTP_PORT = 80;

      /// @fn connect
      /// Connect the tcp socket to the given host name and port.
      /// @pre To be called by "client" connections only.
      /// Server connections are accepted by the server instead.
      /// @param host_name the host to connect to.
      /// @param port_name the port to connect to.
      /// @param connectHandler the handler to call when connected.
      bool connect(const char* host_name, const char* port_name,
                   ConnectHandler connectHandler)
      {
        host_iterator_ = resolve_host(host_name, port_name);
        if (host_iterator_ == boost::asio::ip::tcp::resolver::iterator())
          return false;

        connect_socket(connectHandler, host_iterator_);
        return true;
      }

      /// @fn read
      /// The tcp socket read function.
      /// @param ptr pointer to the receive buffer.
      /// @param size the size of the receive buffer.
      /// @param read_handler the handler for received messages.
      void read(void* ptr, size_t size, CommsHandler read_handler)
      {
        socket_.async_read_some
            (boost::asio::buffer(ptr, size), read_handler);
      }

      /// @fn write
      /// The tcp socket write function.
      /// @param ptr pointer to the send buffer.
      /// @param size the size of the send buffer.
      /// @param write_handler the handler called after a message is sent.
      void write(void const* ptr, size_t size, CommsHandler write_handler)
      {
        boost::asio::async_write
            (socket_, boost::asio::buffer(ptr, size), write_handler);
      }

      /// @fn shutdown
      /// The tcp socket shutdown function.
      /// Disconnects the socket.
      void shutdown()
      {
        boost::system::error_code ignoredEc;
        socket_.shutdown (boost::asio::ip::tcp::socket::shutdown_both,
                          ignoredEc);
      }

      /// @fn close
      /// The tcp socket close function.
      /// Cancels any send, receive or connect operations and closes the socket.
      void close()
      {
        boost::system::error_code ignoredEc;
        socket_.close (ignoredEc);
      }

      /// @fn start
      /// The tcp socket start function.
      /// Signals that the socket is connected.
      /// @param handshake_handler the handshake callback function.
      void start(ErrorHandler handshake_handler)
      { handshake(handshake_handler, true); }

      /// @fn is_disconnect
      /// This function determines whether the error is a socket disconnect.
      /// @return true if a disconnect error, false otherwise.
      bool is_disconnect(boost::system::error_code const& error)
      { return (boost::asio::error::connection_reset == error); }

      /// @fn socket
      /// Accessor for the underlying tcp socket.
      /// @return a reference to the tcp socket.
      boost::asio::ip::tcp::socket& socket()
      { return socket_; }
    };

  }
}

#endif


text:
package com.sun.xml.ws.encoding;

import com.sun.xml.ws.api.SOAPVersion;
import com.sun.xml.ws.api.WSFeatureList;
import com.sun.xml.ws.api.message.Packet;
import com.sun.xml.ws.api.message.Attachment;
import com.sun.xml.ws.api.pipe.Codec;
import com.sun.xml.ws.api.pipe.ContentType;
import com.sun.xml.ws.message.MimeAttachmentSet;

import java.io.IOException;
import java.nio.channels.WritableByteChannel;
import java.util.Map;

/**
 * {@link Codec} that uses MIME/multipart as the base format.
 *
 * @author Jitendra Kotamraju
 */
public final class SwACodec extends MimeCodec {

    public SwACodec(SOAPVersion version, WSFeatureList f, Codec rootCodec) {
        super(version, f);
        this.mimeRootCodec = rootCodec;
    }

    private SwACodec(SwACodec that) {
        super(that);
        this.mimeRootCodec = that.mimeRootCodec.copy();
    }

    @Override
    protected void decode(MimeMultipartParser mpp, Packet packet) throws IOException {
        // TODO: handle attachments correctly
        Attachment root = mpp.getRootPart();
        Codec rootCodec = getMimeRootCodec(packet);
        if (rootCodec instanceof RootOnlyCodec) {
            ((RootOnlyCodec)rootCodec).decode(root.asInputStream(),root.getContentType(),packet, new MimeAttachmentSet(mpp));
        } else {
            rootCodec.decode(root.asInputStream(),root.getContentType(),packet);
            Map<String, Attachment> atts = mpp.getAttachmentParts();
            for(Map.Entry<String, Attachment> att : atts.entrySet()) {
                packet.getMessage().getAttachments().add(att.getValue());
            }
        }
    }

    @Override
    public ContentType encode(Packet packet, WritableByteChannel buffer) {
        //TODO: not yet implemented
        throw new UnsupportedOperationException();
    }

    @Override
    public SwACodec copy() {
        return new SwACodec(this);
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="GroovyCompilerProjectConfiguration">
    <option name="invokeDynamic" value="true" />
  </component>
</project>


text:
"""A syntax example with helper debugging of minimum Oslo Logging

This example requires the following package to be installed.

$ pip install oslo.log

Additional Oslo packages installed include oslo.config, oslo.context,
oslo.i18n, osli.serialization and oslo.utils.

More information about Oslo Logging can be found at:

  http://docs.openstack.org/developer/oslo.log/usage.html
"""

from oslo_config import cfg
from oslo_log import log as logging
# Use default Python logging to display running output
import logging as py_logging

LOG = py_logging.getLogger(__name__)
CONF = cfg.CONF
DOMAIN = "demo"

def prepare():
    """Prepare Oslo Logging (2 or 3 steps)

    Use of Oslo Logging involves the following:

    * logging.register_options
    * logging.set_defaults (optional)
    * logging.setup
    """

    LOG.debug("Prepare Oslo Logging")

    LOG.info("Size of configuration options before %d", len(CONF))

    # Required step to register common, logging and generic configuration
    # variables
    logging.register_options(CONF)

    LOG.info("Size of configuration options after %d", len(CONF))
    LOG.info("List of Oslo Logging configuration options and default values")
    LOG.info("=" * 80)
    for c in CONF:
        LOG.info("%s = %s" % (c, CONF[c]))
    LOG.info("=" * 80)

    # Optional step to set new defaults if necessary for
    # * logging_context_format_string
    # * default_log_levels
    #
    # These variables default to respectively:
    #
    #  import oslo_log
    #  oslo_log._options.DEFAULT_LOG_LEVELS
    #  oslo_log._options.log_opts[0].default
    #

    extra_log_level_defaults = [
        'dogpile=INFO',
        'routes=INFO'
    ]

    logging.set_defaults(default_log_levels=CONF.default_log_levels +
                         extra_log_level_defaults)
    LOG.info("New list of package log level defaults")
    LOG.info("=" * 80)
    for pair in CONF.default_log_levels:
        LOG.info(pair.partition('='))
    LOG.info("=" * 80)

    # Required setup based on configuration and domain
    logging.setup(CONF, DOMAIN)

if __name__ == '__main__':
    py_logging.basicConfig(level=py_logging.DEBUG)

    prepare()
    LOG.info("Welcome to Oslo Logging")


text:
{% if instance.use_source %}

  {% if image %}
    {% if link %}

    {% else %}

    {% endif %}
  {% endif %}

{% else %}
{% load thumbnail %}

  {% if image %}
  {% thumbnail image size crop=instance.crop upscale=instance.upscale subject_location=image.subject_location as thumbnail %}
    {% if link %}

    {% else %}

    {% endif %}
  {% endif %}

{% endif %}


text:
package org.openntf.osgiworlds.model;

import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Button.ClickListener;

import uk.co.intec.keyDatesApp.pages.KeyDateView;

/**
 * @author Paul Withers
 *
 *         Abstract class for Button links in views, to launch the relevant page
 *         with the relevant document (and potentially force edit mode).

 *

 *         Normal implementations of this will use a navigator in the main
 *         Vaadin UI class to navigate to the relevant page. Because that class
 *         name may vary across applications, and because there may potentially
 *         be different implementations, this is an abstract class that will
 *         need extending.

 *

 *         Functionality on the relevant page needs to receive and process docId
 *         and editMode parameters in the enter method. Omit handling
 *         code on receiving page to disable that functionality.

 *

 *         Of course this could be extended to pass multiple documents or more!
 *
 */
public abstract class AbstractDocLinkListener implements ClickListener {
	private static final long serialVersionUID = 1L;
	private static final String ERROR_DONT_USE_DIRECTLY = "This method should not be accessed directly from the abstract class AbstractDocLinkListener";
	private String pageName;
	private String docId;
	private boolean editMode;

	/**
	 * Constructor, passing page to redirect to and document ID to load
	 *
	 * @param pageName
	 *            String page name. Use e.g. {@link KeyDateView.VIEW_NAME}
	 * @param docId
	 *            String Note ID or UNID to load on the page
	 */
	public AbstractDocLinkListener(String pageName, String docId) {
		this(pageName, docId, false);
	}

	/**
	 * Overloaded constructor, also passing edit mode
	 *
	 * @param pageName
	 *            String page name. Use e.g. {@link KeyDateView.VIEW_NAME}
	 * @param docId
	 *            String Note ID or UNID to load on the page
	 * @param editMode
	 *            boolean edit mode
	 */
	public AbstractDocLinkListener(String pageName, String docId, boolean editMode) {
		setPageName(pageName);
		setDocId(docId);
		setEditMode(editMode);
	}

	/*
	 * (non-Javadoc)
	 *
	 * @see com.vaadin.ui.Button.ClickListener#buttonClick(com.vaadin.ui.Button.
	 * ClickEvent)
	 */
	@Override
	public void buttonClick(ClickEvent event) {
		throw new IllegalStateException(ERROR_DONT_USE_DIRECTLY);
	}

	/**
	 * Getter for page name
	 *
	 * @return String page view name to redirect to
	 */
	public String getPageName() {
		return pageName;
	}

	/**
	 * Setter for page name
	 *
	 * @param pageName
	 *            String page view name to redirect to
	 */
	public void setPageName(String pageName) {
		this.pageName = pageName;
	}

	/**
	 * Getter for docId
	 *
	 * @return String Note ID or UNID
	 */
	public String getDocId() {
		return docId;
	}

	/**
	 * Setter for docId
	 *
	 * @param docId
	 *            String Note ID or UNID
	 */
	public void setDocId(String docId) {
		this.docId = docId;
	}

	/**
	 * Getter for editMode
	 *
	 * @return boolean whether or not to launch document in edit mode
	 */
	public boolean isEditMode() {
		return editMode;
	}

	/**
	 * Setter for editMode
	 *
	 * @param editMode
	 *            boolean whether or not to launch document in edit mode
	 */
	public void setEditMode(boolean editMode) {
		this.editMode = editMode;
	}

}


text:
import { key, CustomLocale } from "../types/locale";
declare const l10n: Record<key, CustomLocale>;
export default l10n;


text:
npminstall-ci
=======

[![build status][travis-image]][travis-url]

[travis-image]: https://img.shields.io/travis/cnpm/npminstall-ci.svg?style=flat-square
[travis-url]: https://travis-ci.org/cnpm/npminstall-ci

CI Tests for [npminstall](https://npmjs.com/npminstall)

## License

[MIT](LICENSE)


text:
package org.ovirt.engine.core.bll.tasks;

import java.util.ArrayList;

import org.ovirt.engine.core.bll.context.CommandContext;
import org.ovirt.engine.core.bll.context.CompensationContext;
import org.ovirt.engine.core.bll.job.ExecutionContext;
import org.ovirt.engine.core.common.VdcObjectType;
import org.ovirt.engine.core.common.action.VdcActionParametersBase;
import org.ovirt.engine.core.common.action.VdcActionType;
import org.ovirt.engine.core.common.action.VdcReturnValueBase;
import org.ovirt.engine.core.common.asynctasks.AsyncTaskCreationInfo;
import org.ovirt.engine.core.compat.Guid;

public interface TaskHandlerCommand<T extends VdcActionParametersBase> {

    T getParameters();

    VdcActionType getActionType();

    VdcReturnValueBase getReturnValue();

    ExecutionContext getExecutionContext();

    void preventRollback();

    void setExecutionContext(ExecutionContext executionContext);

    Guid createTask(Guid taskId,
            AsyncTaskCreationInfo asyncTaskCreationInfo,
            VdcActionType parentCommand,
            VdcObjectType entityType,
            Guid... entityIds);

    Guid createTask(Guid taskId,
            AsyncTaskCreationInfo asyncTaskCreationInfo,
            VdcActionType parentCommand);

    Guid persistAsyncTaskPlaceHolder();

    Guid persistAsyncTaskPlaceHolder(String taskKey);

    Guid getAsyncTaskId(String key);

    Guid getAsyncTaskId();

    ArrayList<Guid> getTaskIdList();

    void deleteAsyncTaskPlaceHolder(String taskKey);

    CompensationContext getCompensationContext();

    CommandContext getContext();

    CommandContext cloneContextAndDetachFromParent();

    void taskEndSuccessfully();
}


text:
layout: "aws"
page_title: "AWS: aws_ssm_activation"
sidebar_current: "docs-aws-resource-ssm-activation"
description: |-
  Registers an on-premises server or virtual machine with Amazon EC2 so that it can be managed using Run Command.
---

# aws\_ssm\_activation

Registers an on-premises server or virtual machine with Amazon EC2 so that it can be managed using Run Command.

## Example Usage

```
resource "aws_iam_role" "test_role" {
  name = "test_role"

  assume_role_policy = <<EOF
  {
    "Version": "2012-10-17",
    "Statement": {
      "Effect": "Allow",
      "Principal": {"Service": "ssm.amazonaws.com"},
      "Action": "sts:AssumeRole"
    }
  }
EOF
}

resource "aws_iam_role_policy_attachment" "test_attach" {
  role       = "${aws_iam_role.test_role.name}"
  policy_arn = "arn:aws:iam::aws:policy/service-role/AmazonEC2RoleforSSM"
}

resource "aws_ssm_activation" "foo" {
  name               = "test_ssm_activation"
  description        = "Test"
  iam_role           = "${aws_iam_role.test_role.id}"
  registration_limit = "5"
  depends_on         = ["aws_iam_role_policy_attachment.test_attach"]
}
```

## Argument Reference

The following arguments are supported:

* `name` - (Optional) The default name of the registerd managed instance.
* `description` - (Optional) The description of the resource that you want to register.
* `expiration_date` - (Optional) The date by which this activation request should expire. The default value is 24 hours.
* `iam_role` - (Required) The IAM Role to attach to the managed instance.
* `registration_limit` - (Optional) The maximum number of managed instances you want to register. The default value is 1 instance.

## Attributes Reference

The following attributes are exported:

* `name` - The default name of the registerd managed instance.
* `description` - The description of the resource that was registered.
* `expired` - If the current activation has expired.
* `expiration_date` - The date by which this activation request should expire. The default value is 24 hours.
* `iam_role` - The IAM Role attached to the managed instance.
* `registration_limit` - The maximum number of managed instances you want to be registered. The default value is 1 instance.
* `registration_count` - The number of managed instances that are currently registered using this activation.


text:
<?php
/**
 * CurrentSchoolEnrolment
 *
 * PHP version 5
 *
 * @category Class
 * @package  DataExchange\SIFUK20
 * @author   DataExchange team
 * @link     https://developer.dataexchange.education
 */

/**
 * SIF (UK), v.2.0
 *
 * OpenAPI specification for the SIF (UK), v.2.0 data model. Generated by DataExchange (dataexchange.educaton) at 2017-08-13 19:14:57
 *
 * OpenAPI spec version: 1.0.0.20170813191457
 * Contact: support@dataexchange.education
 * Generated by: https://developer.dataexchange.education
 *
 */

/**
 * NOTE: This class is auto generated.
 * https://developer.dataexchange.education
 * Do not edit the class manually.
 */

namespace DataExchange\SIFUK20\Models;

use \ArrayAccess;

/**
 * CurrentSchoolEnrolment Class Doc Comment
 *
 * @category    Class
 * @package     DataExchange\SIFUK20
 * @author      DataExchange team
 * @link        https://developer.dataexchange.education
 */
class CurrentSchoolEnrolment implements ArrayAccess
{
    const DISCRIMINATOR = null;

    const IS_ARRAY = false;
    const ITEMS = null;

    /**
      * The original name of the model.
      * @var string
      */
    protected static $swaggerModelName = 'CurrentSchoolEnrolment';

    /**
      * Array of property to type mappings. Used for (de)serialization
      * @var string[]
      */
    protected static $swaggerTypes = [
        'learner_school_enrolment_ref_id' => 'string',
        'membership_type' => 'string',
        'sif_ref_id' => '\DataExchange\SIFUK20\Models\SIFRefId1',
        'la_id' => 'string',
        'establishment_id' => 'string',
        'nc_year_group' => 'string'
    ];

    /**
      * Array of property to format mappings. Used for (de)serialization
      * @var string[]
      */
    protected static $swaggerFormats = [
        'learner_school_enrolment_ref_id' => null,
        'membership_type' => null,
        'sif_ref_id' => null,
        'la_id' => null,
        'establishment_id' => null,
        'nc_year_group' => null
    ];

    public static function swaggerTypes()
    {
        return self::$swaggerTypes;
    }

    public static function swaggerFormats()
    {
        return self::$swaggerFormats;
    }

    /**
     * Array of attributes where the key is the local name, and the value is the original name
     * @var string[]
     */
    protected static $attributeMap = [
        'learner_school_enrolment_ref_id' => '@LearnerSchoolEnrolmentRefId',
        'membership_type' => '@MembershipType',
        'sif_ref_id' => 'SIF_RefId',
        'la_id' => 'LAId',
        'establishment_id' => 'EstablishmentId',
        'nc_year_group' => 'NCYearGroup'
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     * @var string[]
     */
    protected static $setters = [
        'learner_school_enrolment_ref_id' => 'setLearnerSchoolEnrolmentRefId',
        'membership_type' => 'setMembershipType',
        'sif_ref_id' => 'setSifRefId',
        'la_id' => 'setLaId',
        'establishment_id' => 'setEstablishmentId',
        'nc_year_group' => 'setNcYearGroup'
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests)
     * @var string[]
     */
    protected static $getters = [
        'learner_school_enrolment_ref_id' => 'getLearnerSchoolEnrolmentRefId',
        'membership_type' => 'getMembershipType',
        'sif_ref_id' => 'getSifRefId',
        'la_id' => 'getLaId',
        'establishment_id' => 'getEstablishmentId',
        'nc_year_group' => 'getNcYearGroup'
    ];

    public static function attributeMap()
    {
        return self::$attributeMap;
    }

    public static function setters()
    {
        return self::$setters;
    }

    public static function getters()
    {
        return self::$getters;
    }

    /**
     * Associative array for storing property values
     * @var mixed[]
     */
    protected $container = [];

    /**
     * Constructor
     * @param mixed[] $data Associated array of property values initializing the model
     */
    public function __construct(array $data = null)
    {
        $this->container['learner_school_enrolment_ref_id'] = isset($data['learner_school_enrolment_ref_id']) ? $data['learner_school_enrolment_ref_id'] : null;
        $this->container['membership_type'] = isset($data['membership_type']) ? $data['membership_type'] : null;
        $this->container['sif_ref_id'] = isset($data['sif_ref_id']) ? $data['sif_ref_id'] : null;
        $this->container['la_id'] = isset($data['la_id']) ? $data['la_id'] : null;
        $this->container['establishment_id'] = isset($data['establishment_id']) ? $data['establishment_id'] : null;
        $this->container['nc_year_group'] = isset($data['nc_year_group']) ? $data['nc_year_group'] : null;
    }

    /**
     * show all the invalid properties with reasons.
     *
     * @return array invalid properties with reasons
     */
    public function listInvalidProperties()
    {
        $invalid_properties = [];

        if ($this->container['learner_school_enrolment_ref_id'] === null) {
            $invalid_properties[] = "'learner_school_enrolment_ref_id' can't be null";
        }
        if ($this->container['la_id'] === null) {
            $invalid_properties[] = "'la_id' can't be null";
        }
        if ($this->container['establishment_id'] === null) {
            $invalid_properties[] = "'establishment_id' can't be null";
        }
        if ($this->container['nc_year_group'] === null) {
            $invalid_properties[] = "'nc_year_group' can't be null";
        }
        return $invalid_properties;
    }

    /**
     * validate all the properties in the model
     * return true if all passed
     *
     * @return bool True if all properties are valid
     */
    public function valid()
    {

        if ($this->container['learner_school_enrolment_ref_id'] === null) {
            return false;
        }
        if ($this->container['la_id'] === null) {
            return false;
        }
        if ($this->container['establishment_id'] === null) {
            return false;
        }
        if ($this->container['nc_year_group'] === null) {
            return false;
        }
        return true;
    }

    /**
     * Gets learner_school_enrolment_ref_id
     * @return string
     */
    public function getLearnerSchoolEnrolmentRefId()
    {
        return isset($this->container['learner_school_enrolment_ref_id']) ? $this->container['learner_school_enrolment_ref_id'] : null;
    }

    /**
     * Sets learner_school_enrolment_ref_id
     * @param string $learner_school_enrolment_ref_id The ID (GUID) of the LearnerSchoolEnrolment record associated with this learner that is also designated as the current or current main enrolment.
     * @return $this
     */
    public function setLearnerSchoolEnrolmentRefId($learner_school_enrolment_ref_id)
    {
        $this->container['learner_school_enrolment_ref_id'] = $learner_school_enrolment_ref_id;

        return $this;
    }

    /**
     * Gets membership_type
     * @return string
     */
    public function getMembershipType()
    {
        return isset($this->container['membership_type']) ? $this->container['membership_type'] : null;
    }

    /**
     * Sets membership_type
     * @param string $membership_type The type of this enrolment as it relates to the school identified by SchoolInfoRefId.
     * @return $this
     */
    public function setMembershipType($membership_type)
    {
        $this->container['membership_type'] = $membership_type;

        return $this;
    }

    /**
     * Gets sif_ref_id
     * @return \DataExchange\SIFUK20\Models\SIFRefId1
     */
    public function getSifRefId()
    {
        return isset($this->container['sif_ref_id']) ? $this->container['sif_ref_id'] : null;
    }

    /**
     * Sets sif_ref_id
     * @param \DataExchange\SIFUK20\Models\SIFRefId1 $sif_ref_id
     * @return $this
     */
    public function setSifRefId($sif_ref_id)
    {
        $this->container['sif_ref_id'] = $sif_ref_id;

        return $this;
    }

    /**
     * Gets la_id
     * @return string
     */
    public function getLaId()
    {
        return isset($this->container['la_id']) ? $this->container['la_id'] : null;
    }

    /**
     * Sets la_id
     * @param string $la_id
     * @return $this
     */
    public function setLaId($la_id)
    {
        $this->container['la_id'] = $la_id;

        return $this;
    }

    /**
     * Gets establishment_id
     * @return string
     */
    public function getEstablishmentId()
    {
        return isset($this->container['establishment_id']) ? $this->container['establishment_id'] : null;
    }

    /**
     * Sets establishment_id
     * @param string $establishment_id
     * @return $this
     */
    public function setEstablishmentId($establishment_id)
    {
        $this->container['establishment_id'] = $establishment_id;

        return $this;
    }

    /**
     * Gets nc_year_group
     * @return string
     */
    public function getNcYearGroup()
    {
        return isset($this->container['nc_year_group']) ? $this->container['nc_year_group'] : null;
    }

    /**
     * Sets nc_year_group
     * @param string $nc_year_group
     * @return $this
     */
    public function setNcYearGroup($nc_year_group)
    {
        $this->container['nc_year_group'] = $nc_year_group;

        return $this;
    }
    /**
     * Returns true if offset exists. False otherwise.
     * @param  integer $offset Offset
     * @return boolean
     */
    public function offsetExists($offset)
    {
        return isset($this->container[$offset]);
    }

    /**
     * Gets offset.
     * @param  integer $offset Offset
     * @return mixed
     */
    public function offsetGet($offset)
    {
        return isset($this->container[$offset]) ? $this->container[$offset] : null;
    }

    /**
     * Sets value based on offset.
     * @param  integer $offset Offset
     * @param  mixed   $value  Value to be set
     * @return void
     */
    public function offsetSet($offset, $value)
    {
        if (is_null($offset)) {
            $this->container[] = $value;
        } else {
            $this->container[$offset] = $value;
        }
    }

    /**
     * Unsets offset.
     * @param  integer $offset Offset
     * @return void
     */
    public function offsetUnset($offset)
    {
        unset($this->container[$offset]);
    }

    /**
     * Gets the string presentation of the object in JSON format
     * @return string
     */
    public function toJson()
    {
        if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
            return json_encode(\DataExchange\SIFUK20\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT);
        }

        return json_encode(\DataExchange\SIFUK20\ObjectSerializer::sanitizeForSerialization($this));
    }

    /**
     * Gets the string presentation of the object in XML format
     * @return string
     */
    public function toXml()
    {
        $dom = new \DOMDocument();

        $node = $dom->importNode($this->toXmlNode(), true);

        $dom->preserveWhiteSpace = false;
        $dom->formatOutput = true;
        $xml = $dom->saveXML($node);

        unset($node);
        unset($dom);

        return $xml;
    }

    /**
     * Gets the string presentation of the object in XML format
     * @return string
     */
    public function toXmlNode()
    {
        $dom = new \DOMDocument();
        $elem = $dom->createElement(self::$swaggerModelName);

        foreach (self::attributeMap() as $key => $property) {
            $value = $this->{$this->getters()[$key]}();

            if (is_null($value)) {
                // Do nothing
                continue;
            }

            if ($property[0] === '@') {
                $elem->setAttribute(substr($property, 1), $value);
            } else {
                if (is_scalar($value)) {
                    $elem->appendChild($dom->createElement($property, $value));
                } elseif ($value instanceof \DateTime) {
                    $format = $this->swaggerFormats()[$key];
                    $str = ($format === 'date') ? $value->format('Y-m-d') : $value->format(\DateTime::ATOM);
                    $elem->appendChild($dom->createElement($property, $str));
                } elseif (is_array($value)) {
                    if (is_scalar($value)) {
                        // TODO
                        /*
                        foreach ($value as $property => $value) {
                            $elem->appendChild($dom->createElement($property, (string) $value));
                        }
                        */
                    } else {
                        // TODO
                        /*
                        foreach ($value as $property => $value) {
                            $elem->appendChild($dom->importNode($value->toXmlNode(), true));
                            // $elem->appendChild($dom->createElement($property, (string) $value));
                        }
                        */
                    }
                } elseif (is_object($value)) {
                    $elem->appendChild($dom->importNode($value->toXmlNode(), true));
                } else {
                    $elem->appendChild($dom->createElement($property, (string) $value));
                }
            }
        }

        if (self::IS_ARRAY) {
            foreach ($this->container as $key => $item) {
                $elem->appendChild($dom->importNode($item->toXmlNode(), true));
            }
        }

        return $elem;
    }

    /**
     * Gets the string presentation of the object
     * @return string
     */
    public function __toString()
    {
        return $this->toXml();
    }
}


text:
'use strict';

angular.module('app').controller('mainCtrl', ['$scope', function($scope) {

}]);


text:
package org.togglz.spring.boot.actuate.autoconfigure;

import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.jupiter.api.Assertions.assertEquals;

import java.util.Collection;

import org.junit.jupiter.api.Test;
import org.springframework.beans.BeansException;
import org.springframework.boot.test.context.assertj.AssertableWebApplicationContext;
import org.springframework.boot.web.servlet.ServletRegistrationBean;
import org.togglz.spring.boot.actuate.BaseTest;

/**
 * Tests for Spring Boot 2 compatible {@link TogglzAutoConfiguration}.
 *
 * @author Marcel Overdijk
 * @author Rui Figueira
 */
public class TogglzManagementContextConfigurationTest extends BaseTest {

    @Test
    public void consoleWithCustomManagementContextPath() {
        // With TogglzManagementContextConfiguration responsible for creating the admin console servlet registration bean,
        // if a custom management context path is provided it should be used as prefix.
        contextRunnerWithFeatureProviderConfig()
            .withPropertyValues("management.server.base-path: /manage")
            .run((context) -> assertThat(getUrlMappings(context)).contains("/manage/togglz-console/*"));
    }

    @Test
    public void customConsolePath() {
        contextRunnerWithFeatureProviderConfig()
            .withPropertyValues("togglz.console.path: /custom")
            .run((context) -> assertThat(getUrlMappings(context)).contains("/custom/*"));
    }

    @Test
    public void customConsolePathWithTrailingSlash() {
        contextRunnerWithFeatureProviderConfig()
            .withPropertyValues("togglz.console.path: /custom/")
            .run((context) -> assertThat(getUrlMappings(context)).contains("/custom/*"));
    }

    @SuppressWarnings("unchecked")
    protected Collection<String> getUrlMappings(AssertableWebApplicationContext context) throws BeansException {
        assertEquals(1, context.getBeansOfType(ServletRegistrationBean.class).size());
        return context.getBean(ServletRegistrationBean.class).getUrlMappings();
    }
}


text:
export * from './login';
export * from './tests';
export * from './testlist';
export * from './navbar';
export * from './userlist';
export * from './resultlist';


text:
import Ember from 'ember';

let {
  run,
  RSVP,
} = Ember;

export let Run = Ember.Object.extend({
    /**
    Returns a promise that resolves the result of executing the function
    passed as parameter after X number milliseconds.

    @method later
    @param {Function} fn the function to execute
    @param {Number} delay the time to wait to execute the function
    @return {Promise} a new promise to be fulfilled after the delay
   **/
  later: function(fn, delay) {
    return new RSVP.Promise(resolve => run.later(() => resolve(fn()), delay));
  }
});

export function later(fn, delay) {
  return Run.create().later(fn, delay);
}


text:
#import "Commands.h"

Commands *commands=nil;

@implementation Commands
-(id)init {
    if((self=[super init])) {
        commands = [[NSMutableDictionary alloc] initWithCapacity:100];
    }
    return self;
}
-(void)dealloc {
    [commands release];
    [super dealloc];
}

-(void)readFirmware:(NSString*)firmware language:(NSString*) lang
{
    //RegistryKey repetierKey = Registry.CurrentUser.CreateSubKey("Software\\Repetier");

    //string basedir = (string)repetierKey.GetValue("installPath");
    NSString *defaultsyntax = [[NSBundle mainBundle] pathForResource:@"syntax" ofType:@"xml"];
    [self readFile:defaultsyntax];
/*    ReadFile(basedir + Path.DirectorySeparatorChar+"data"+Path.DirectorySeparatorChar+"default"+
             Path.DirectorySeparatorChar+"syntax_en.xml");
    if(lang.Equals("en")==false)
        ReadFile(basedir + Path.DirectorySeparatorChar+"data"+Path.DirectorySeparatorChar+"default"+
                 Path.DirectorySeparatorChar+"syntax_"+lang+".xml");
    if (firmware.Equals("default") == false)
    {
        ReadFile(basedir + Path.DirectorySeparatorChar+"data"+Path.DirectorySeparatorChar+firmware+
                 Path.DirectorySeparatorChar+"syntax_en.xml");
        if (lang.Equals("en") == false)
            ReadFile(basedir + Path.DirectorySeparatorChar+"data"+Path.DirectorySeparatorChar+firmware+
                     Path.DirectorySeparatorChar+"syntax_" + lang + ".xml");
    }*/
}
-(void)readFile:(NSString*) file
{
    NSFileManager *fm = [NSFileManager defaultManager];
    BOOL fileExists = [fm fileExistsAtPath:file] ;
    if (!fileExists) return;

    @try
    {
        NSXMLDocument *xmlDoc;
        NSError *err=nil;
        NSURL *furl = [NSURL fileURLWithPath:file];
        if (!furl) {
            NSLog(@"Can't create an URL from file %@.", file);
            return;
        }
        xmlDoc = [[NSXMLDocument alloc] initWithContentsOfURL:furl
                                                      options:(NSXMLNodePreserveWhitespace|NSXMLNodePreserveCDATA)
                                                        error:&err];
        if (xmlDoc == nil) {
            xmlDoc = [[NSXMLDocument alloc] initWithContentsOfURL:furl
                                                          options:NSXMLDocumentTidyXML
                                                            error:&err];
        }
        if (xmlDoc == nil)  {
            return;
        }
        NSArray *nodes = [xmlDoc nodesForXPath:@".//Command"
                                              error:&err];
        for (NSXMLElement * n in nodes) {
            CommandDescription *cd = [[CommandDescription alloc] initWithNode:n];
            [commands setValue:cd forKey:cd->command];
        }
    }
    @catch(NSException *e) { }
}

@end

@implementation CommandParameter
@synthesize parameter;
@synthesize desc;

-(id)initWithNode:(NSXMLElement*)n {
    if((self=[super init])) {
        optional = NO;
        [self setDesc:[n stringValue]];
        NSXMLNode *anode = [n attributeForName:@"name"];
        if(anode == nil)
            [self setParameter:@""];
        else
            [self setParameter:anode.stringValue];
        anode = [n attributeForName:@"optional"];
        if(anode!=nil)
            if ([anode.stringValue compare:@"1"]==NSOrderedSame)
                optional = YES;
    }
    return self;
}
-(NSString*)description
{
   if (optional)
       return [[[[@"[" stringByAppendingString:parameter] stringByAppendingString:@"{<it>"] stringByAppendingString:desc] stringByAppendingString:@"</it>}] "];
    return [[[parameter stringByAppendingString:@"{<it>"] stringByAppendingString:desc] stringByAppendingString:@"</it>} "];
}
-(void)dealloc {
    [desc release];
    [parameter release];
    [super dealloc];
}
@end

@implementation CommandDescription

@synthesize desc;
@synthesize command;
@synthesize title;

-(id)initWithNode:(NSXMLElement*)n {
    if((self=[super init])) {
        parameter = [RHLinkedList new];
        [self setCommand:[n attributeForName:@"name"].stringValue];
        [self setTitle:[n attributeForName:@"title"].stringValue];
            for (NSXMLNode *pn in n.children)
            {
                if (pn.kind != NSXMLElementKind) continue;
                if ([pn.name compare:@"Param"]==NSOrderedSame) {
                    CommandParameter *lastparam = [[CommandParameter alloc] initWithNode:(NSXMLElement*)pn];
                    [parameter addLast:lastparam];
                    [lastparam release];
                }
                if ([pn.name compare:@"Description"]==NSOrderedSame)
                    [self setDesc:pn.stringValue];
            }
        attr = nil;
    }
    return self;
}
-(void)dealloc {
    [attr release];
    [command release];
    [desc release];
    [title release];
    [parameter release];
    [super dealloc];
}
-(NSAttributedString*)attributedDescription {
    if(attr!=nil) return attr;
    NSMutableString *s = [[NSMutableString alloc] init];
    [s appendString:@""];
    [s appendString:command];
    [s appendString:@":"];
    [s appendString:title];
    [s appendString:@"
Syntax:"];
    [s appendString:command];
    [s appendString:@" "];
    for (CommandParameter *pa in parameter) {
      [s appendString:pa.description];
    }
    [s appendString:@"
"];
    [s appendString:desc];
    NSData *fooData = [s dataUsingEncoding: NSUTF8StringEncoding];
    NSDictionary *at = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithInt:NSUTF8StringEncoding],NSCharacterEncodingDocumentOption,nil];
    NSAttributedString *as = [[NSAttributedString alloc]
                              initWithHTML:fooData options:at documentAttributes:nil];
    attr = as; //[as retain];
    [s release];
    return attr;
}
@end


text:
.fixed-table-header-columns,
.fixed-table-body-columns {
    position: absolute;
    background-color: #fff;
    display: none;
    box-sizing: border-box;
    overflow: hidden;
}

.fixed-table-header-columns .table,
.fixed-table-body-columns .table {
    border-right: 1px solid #ddd;
}

.fixed-table-header-columns .table.table-no-bordered,
.fixed-table-body-columns .table.table-no-bordered {
    border-right: 1px solid transparent;
}

.fixed-table-body-columns table {
    position: absolute;
    animation: none;
}

.bootstrap-table .table-hover > tbody > tr.hover > td{
    background-color: #f5f5f5;
}


text:
package ec2

import (
	"context"
	"fmt"
	awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
	"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
	"github.com/aws/aws-sdk-go-v2/service/ec2/types"
	"github.com/aws/smithy-go/middleware"
	smithyhttp "github.com/aws/smithy-go/transport/http"
)

// Describes the progress of the AMI store tasks. You can describe the store tasks
// for specified AMIs. If you don't specify the AMIs, you get a paginated list of
// store tasks from the last 31 days. For each AMI task, the response indicates if
// the task is InProgress, Completed, or Failed. For tasks InProgress, the response
// shows the estimated progress as a percentage. Tasks are listed in reverse
// chronological order. Currently, only tasks from the past 31 days can be viewed.
// To use this API, you must have the required permissions. For more information,
// see Permissions for storing and restoring AMIs using S3
// (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ami-store-restore.html#ami-s3-permissions)
// in the Amazon Elastic Compute Cloud User Guide. For more information, see Store
// and restore an AMI using S3
// (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ami-store-restore.html) in
// the Amazon Elastic Compute Cloud User Guide.
func (c *Client) DescribeStoreImageTasks(ctx context.Context, params *DescribeStoreImageTasksInput, optFns ...func(*Options)) (*DescribeStoreImageTasksOutput, error) {
	if params == nil {
		params = &DescribeStoreImageTasksInput{}
	}

	result, metadata, err := c.invokeOperation(ctx, "DescribeStoreImageTasks", params, optFns, addOperationDescribeStoreImageTasksMiddlewares)
	if err != nil {
		return nil, err
	}

	out := result.(*DescribeStoreImageTasksOutput)
	out.ResultMetadata = metadata
	return out, nil
}

type DescribeStoreImageTasksInput struct {

	// Checks whether you have the required permissions for the action, without
	// actually making the request, and provides an error response. If you have the
	// required permissions, the error response is DryRunOperation. Otherwise, it is
	// UnauthorizedOperation.
	DryRun bool

	// The filters.
	//
	// * task-state - Returns tasks in a certain state (InProgress |
	// Completed | Failed)
	//
	// * bucket - Returns task information for tasks that targeted
	// a specific bucket. For the filter value, specify the bucket name.
	Filters []types.Filter

	// The AMI IDs for which to show progress. Up to 20 AMI IDs can be included in a
	// request.
	ImageIds []string

	// The maximum number of results to return in a single call. To retrieve the
	// remaining results, make another call with the returned NextToken value. This
	// value can be between 1 and 200. You cannot specify this parameter and the
	// ImageIDs parameter in the same call.
	MaxResults int32

	// The token for the next page of results.
	NextToken *string
}

type DescribeStoreImageTasksOutput struct {

	// The token to use to retrieve the next page of results. This value is null when
	// there are no more results to return.
	NextToken *string

	// The information about the AMI store tasks.
	StoreImageTaskResults []types.StoreImageTaskResult

	// Metadata pertaining to the operation's result.
	ResultMetadata middleware.Metadata
}

func addOperationDescribeStoreImageTasksMiddlewares(stack *middleware.Stack, options Options) (err error) {
	err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeStoreImageTasks{}, middleware.After)
	if err != nil {
		return err
	}
	err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeStoreImageTasks{}, middleware.After)
	if err != nil {
		return err
	}
	if err = addSetLoggerMiddleware(stack, options); err != nil {
		return err
	}
	if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
		return err
	}
	if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
		return err
	}
	if err = addResolveEndpointMiddleware(stack, options); err != nil {
		return err
	}
	if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
		return err
	}
	if err = addRetryMiddlewares(stack, options); err != nil {
		return err
	}
	if err = addHTTPSignerV4Middleware(stack, options); err != nil {
		return err
	}
	if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
		return err
	}
	if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
		return err
	}
	if err = addClientUserAgent(stack); err != nil {
		return err
	}
	if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
		return err
	}
	if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
		return err
	}
	if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeStoreImageTasks(options.Region), middleware.Before); err != nil {
		return err
	}
	if err = addRequestIDRetrieverMiddleware(stack); err != nil {
		return err
	}
	if err = addResponseErrorMiddleware(stack); err != nil {
		return err
	}
	if err = addRequestResponseLogging(stack, options); err != nil {
		return err
	}
	return nil
}

// DescribeStoreImageTasksAPIClient is a client that implements the
// DescribeStoreImageTasks operation.
type DescribeStoreImageTasksAPIClient interface {
	DescribeStoreImageTasks(context.Context, *DescribeStoreImageTasksInput, ...func(*Options)) (*DescribeStoreImageTasksOutput, error)
}

var _ DescribeStoreImageTasksAPIClient = (*Client)(nil)

// DescribeStoreImageTasksPaginatorOptions is the paginator options for
// DescribeStoreImageTasks
type DescribeStoreImageTasksPaginatorOptions struct {
	// The maximum number of results to return in a single call. To retrieve the
	// remaining results, make another call with the returned NextToken value. This
	// value can be between 1 and 200. You cannot specify this parameter and the
	// ImageIDs parameter in the same call.
	Limit int32

	// Set to true if pagination should stop if the service returns a pagination token
	// that matches the most recent token provided to the service.
	StopOnDuplicateToken bool
}

// DescribeStoreImageTasksPaginator is a paginator for DescribeStoreImageTasks
type DescribeStoreImageTasksPaginator struct {
	options   DescribeStoreImageTasksPaginatorOptions
	client    DescribeStoreImageTasksAPIClient
	params    *DescribeStoreImageTasksInput
	nextToken *string
	firstPage bool
}

// NewDescribeStoreImageTasksPaginator returns a new
// DescribeStoreImageTasksPaginator
func NewDescribeStoreImageTasksPaginator(client DescribeStoreImageTasksAPIClient, params *DescribeStoreImageTasksInput, optFns ...func(*DescribeStoreImageTasksPaginatorOptions)) *DescribeStoreImageTasksPaginator {
	if params == nil {
		params = &DescribeStoreImageTasksInput{}
	}

	options := DescribeStoreImageTasksPaginatorOptions{}
	if params.MaxResults != 0 {
		options.Limit = params.MaxResults
	}

	for _, fn := range optFns {
		fn(&options)
	}

	return &DescribeStoreImageTasksPaginator{
		options:   options,
		client:    client,
		params:    params,
		firstPage: true,
	}
}

// HasMorePages returns a boolean indicating whether more pages are available
func (p *DescribeStoreImageTasksPaginator) HasMorePages() bool {
	return p.firstPage || p.nextToken != nil
}

// NextPage retrieves the next DescribeStoreImageTasks page.
func (p *DescribeStoreImageTasksPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeStoreImageTasksOutput, error) {
	if !p.HasMorePages() {
		return nil, fmt.Errorf("no more pages available")
	}

	params := *p.params
	params.NextToken = p.nextToken

	params.MaxResults = p.options.Limit

	result, err := p.client.DescribeStoreImageTasks(ctx, &params, optFns...)
	if err != nil {
		return nil, err
	}
	p.firstPage = false

	prevToken := p.nextToken
	p.nextToken = result.NextToken

	if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken {
		p.nextToken = nil
	}

	return result, nil
}

func newServiceMetadataMiddleware_opDescribeStoreImageTasks(region string) *awsmiddleware.RegisterServiceMetadata {
	return &awsmiddleware.RegisterServiceMetadata{
		Region:        region,
		ServiceID:     ServiceID,
		SigningName:   "ec2",
		OperationName: "DescribeStoreImageTasks",
	}
}