text:
package org.apache.sis.internal.metadata;

import java.net.URL;
import java.util.Locale;
import java.util.MissingResourceException;
import org.opengis.util.InternationalString;
import org.apache.sis.util.resources.KeyConstants;
import org.apache.sis.util.resources.IndexedResourceBundle;
import org.apache.sis.util.resources.ResourceInternationalString;

/**
 * Warning and error messages that are specific to the {@code sis-metadata} module.
 * Resources in this file should not be used by any other module. For resources shared by
 * all modules in the Apache SIS project, see {@link org.apache.sis.util.resources} package.
 *
 * @author  Martin Desruisseaux (Geomatys)
 * @version 1.0
 * @since   1.0
 * @module
 */
public final class Resources extends IndexedResourceBundle {
    /**
     * Resource keys. This class is used when compiling sources, but no dependencies to
     * {@code Keys} should appear in any resulting class files. Since the Java compiler
     * inlines final integer values, using long identifiers will not bloat the constant
     * pools of compiled classes.
     *
     * @author  Martin Desruisseaux (Geomatys)
     * @since   1.0
     * @module
     */
    public static final class Keys extends KeyConstants {
        /**
         * The unique instance of key constants handler.
         */
        static final Keys INSTANCE = new Keys();

        /**
         * For {@link #INSTANCE} creation only.
         */
        private Keys() {
        }

        /**
         * Bounding box crosses the antimeridian.
         */
        public static final short BoxCrossesAntiMeridian = 3;

        /**
         * Connection to "{0}" database is already initialized.
         */
        public static final short ConnectionAlreadyInitialized_1 = 6;

        /**
         * This metadata element is already initialized with value "{0}".
         */
        public static final short ElementAlreadyInitialized_1 = 2;

        /**
         * … {0} elements omitted …
         */
        public static final short ElementsOmitted_1 = 4;

        /**
         * Illegal class `{1}`. Specify the `{0}` interface instead.
         */
        public static final short ExpectedInterface_2 = 5;

        /**
         * This metadata is not modifiable.
         */
        public static final short UnmodifiableMetadata = 1;
    }

    /**
     * Constructs a new resource bundle loading data from the given UTF file.
     *
     * @param resources  the path of the binary file containing resources, or {@code null} if
     *        there are no resources. The resources may be a file or an entry in a JAR file.
     */
    public Resources(final URL resources) {
        super(resources);
    }

    /**
     * Returns the handle for the {@code Keys} constants.
     *
     * @return a handler for the constants declared in the inner {@code Keys} class.
     */
    @Override
    protected KeyConstants getKeyConstants() {
        return Keys.INSTANCE;
    }

    /**
     * Returns resources in the given locale.
     *
     * @param  locale  the locale, or {@code null} for the default locale.
     * @return resources in the given locale.
     * @throws MissingResourceException if resources cannot be found.
     */
    public static Resources forLocale(final Locale locale) throws MissingResourceException {
        return getBundle(Resources.class, locale);
    }

    /**
     * Gets a string for the given key from this resource bundle or one of its parents.
     *
     * @param  key  the key for the desired string.
     * @return the string for the given key.
     * @throws MissingResourceException if no object for the given key can be found.
     */
    public static String format(final short key) throws MissingResourceException {
        return forLocale(null).getString(key);
    }

    /**
     * Gets a string for the given key and replaces all occurrence of "{0}"
     * with value of {@code arg0}.
     *
     * @param  key   the key for the desired string.
     * @param  arg0  value to substitute to "{0}".
     * @return the formatted string for the given key.
     * @throws MissingResourceException if no object for the given key can be found.
     */
    public static String format(final short  key,
                                final Object arg0) throws MissingResourceException
    {
        return forLocale(null).getString(key, arg0);
    }

    /**
     * Gets a string for the given key and replaces all occurrences of "{0}",
     * "{1}", with values of {@code arg0}, {@code arg1}, etc.
     *
     * @param  key   the key for the desired string.
     * @param  arg0  value to substitute to "{0}".
     * @param  arg1  value to substitute to "{1}".
     * @return the formatted string for the given key.
     * @throws MissingResourceException if no object for the given key can be found.
     */
    public static String format(final short  key,
                                final Object arg0,
                                final Object arg1) throws MissingResourceException
    {
        return forLocale(null).getString(key, arg0, arg1);
    }

    /**
     * The international string to be returned by {@link formatInternational}.
     */
    private static final class International extends ResourceInternationalString {
        private static final long serialVersionUID = 7465539282825054584L;

        International(short key)                           {super(key);}
        International(short key, Object args)              {super(key, args);}
        @Override protected KeyConstants getKeyConstants() {return Resources.Keys.INSTANCE;}
        @Override protected IndexedResourceBundle getBundle(final Locale locale) {
            return forLocale(locale);
        }
    }

    /**
     * Gets an international string for the given key. This method does not check for the key
     * validity. If the key is invalid, then a {@link MissingResourceException} may be thrown
     * when a {@link InternationalString#toString(Locale)} method is invoked.
     *
     * @param  key  the key for the desired string.
     * @return an international string for the given key.
     */
    public static InternationalString formatInternational(final short key) {
        return new International(key);
    }
}


text:
#ifndef ARM_COMPUTE_ACL_VERSION_H_
#define ARM_COMPUTE_ACL_VERSION_H_

#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */

/** Semantic versioning information */
typedef struct AclVersion
{
    int         major;      /**< Major version, is increased on API incompatible changes */
    int         minor;      /**< Minor version, is increased on adding back-ward compatible functionality */
    int         patch;      /**< Patch version, is increased when doing backward compatible fixes */
    const char *build_info; /**< Build related information */
} AclVersion;

/**< Major version, is increased on API incompatible changes */
#define ARM_COMPUTE_LIBRARY_VERSION_MAJOR 0
/**< Minor version, is increased on adding back-ward compatible functionality */
#define ARM_COMPUTE_LIBRARY_VERSION_MINOR 1
/**< Patch version, is increased when doing backward compatible fixes */
#define ARM_COMPUTE_LIBRARY_VERSION_PATCH 0

/** Get library's version meta-data
 *
 * @return Version information
 */
const AclVersion *AclVersionInfo();

#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* ARM_COMPUTE_ACL_VERSION_H_ */

redpajama_set_name: RedPajamaGithub


text:
function cvx_optval = norm_largest( x, k )

%NORM_LARGEST Sum of the k largest magnitudes of a vector.
%   NORM_LARGEST( X, k ) computes the 'largest-k' norm; that is, it computes
%   the sum of the magnitudes of the k largest elements in X. X must
%   be a vector, and k must be a real scalar.
%
%   Disciplined convex programming information:
%       NORM_LARGEST is convex and nonmonotonic of X, though it is monotonic for
%       positive values of X. So when used in CVX expressions, X must be affine,
%       monomial, or posynomial. k must be a real scalar constant.

narginchk(2,2);
if ~any( size( x ) ~= 1 ),
    error( 'The first argument must be a vector.' );
elseif ~isnumeric( k ) || ~isreal( k ) || length( k ) ~= 1,
    error( 'Third argument must be a scalar.' );
else
    cvx_optval = sum_largest( abs( x ), k );
end

% Copyright 2005-2016 CVX Research, Inc.
% See the file LICENSE.txt for full copyright information.
% The command 'cvx_where' will show where this file is located.


text:
using System;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Azure.Management.Sql;
using Microsoft.Azure.Management.Sql.Models;

namespace Microsoft.Azure.Management.Sql
{
    /// <summary>
    /// The Windows Azure SQL Database management API provides a RESTful set of
    /// web services that interact with Windows Azure SQL Database services to
    /// manage your databases. The API enables users to create, retrieve,
    /// update, and delete databases and servers.
    /// </summary>
    public static partial class DatabaseRecommendedActionOperationsExtensions
    {
        /// <summary>
        /// Returns details of a recommended action.
        /// </summary>
        /// <param name='operations'>
        /// Reference to the
        /// Microsoft.Azure.Management.Sql.IDatabaseRecommendedActionOperations.
        /// </param>
        /// <param name='resourceGroupName'>
        /// Required. The name of the Resource Group.
        /// </param>
        /// <param name='serverName'>
        /// Required. The name of the Azure SQL server.
        /// </param>
        /// <param name='databaseName'>
        /// Required. The name of the Azure SQL database.
        /// </param>
        /// <param name='advisorName'>
        /// Required. The name of the Azure SQL database advisor.
        /// </param>
        /// <param name='recommendedActionName'>
        /// Required. The name of the Azure SQL database recommended action.
        /// </param>
        /// <returns>
        /// Represents the response to a get recommended action request.
        /// </returns>
        public static RecommendedActionGetResponse Get(this IDatabaseRecommendedActionOperations operations, string resourceGroupName, string serverName, string databaseName, string advisorName, string recommendedActionName)
        {
            return Task.Factory.StartNew((object s) =>
            {
                return ((IDatabaseRecommendedActionOperations)s).GetAsync(resourceGroupName, serverName, databaseName, advisorName, recommendedActionName);
            }
            , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
        }

        /// <summary>
        /// Returns details of a recommended action.
        /// </summary>
        /// <param name='operations'>
        /// Reference to the
        /// Microsoft.Azure.Management.Sql.IDatabaseRecommendedActionOperations.
        /// </param>
        /// <param name='resourceGroupName'>
        /// Required. The name of the Resource Group.
        /// </param>
        /// <param name='serverName'>
        /// Required. The name of the Azure SQL server.
        /// </param>
        /// <param name='databaseName'>
        /// Required. The name of the Azure SQL database.
        /// </param>
        /// <param name='advisorName'>
        /// Required. The name of the Azure SQL database advisor.
        /// </param>
        /// <param name='recommendedActionName'>
        /// Required. The name of the Azure SQL database recommended action.
        /// </param>
        /// <returns>
        /// Represents the response to a get recommended action request.
        /// </returns>
        public static Task<RecommendedActionGetResponse> GetAsync(this IDatabaseRecommendedActionOperations operations, string resourceGroupName, string serverName, string databaseName, string advisorName, string recommendedActionName)
        {
            return operations.GetAsync(resourceGroupName, serverName, databaseName, advisorName, recommendedActionName, CancellationToken.None);
        }

        /// <summary>
        /// Returns list of recommended actions for this advisor.
        /// </summary>
        /// <param name='operations'>
        /// Reference to the
        /// Microsoft.Azure.Management.Sql.IDatabaseRecommendedActionOperations.
        /// </param>
        /// <param name='resourceGroupName'>
        /// Required. The name of the Resource Group.
        /// </param>
        /// <param name='serverName'>
        /// Required. The name of the Azure SQL server.
        /// </param>
        /// <param name='databaseName'>
        /// Required. The name of the Azure SQL database.
        /// </param>
        /// <param name='advisorName'>
        /// Required. The name of the Azure SQL database advisor.
        /// </param>
        /// <returns>
        /// Represents the response to a list recommended actions request.
        /// </returns>
        public static RecommendedActionListResponse List(this IDatabaseRecommendedActionOperations operations, string resourceGroupName, string serverName, string databaseName, string advisorName)
        {
            return Task.Factory.StartNew((object s) =>
            {
                return ((IDatabaseRecommendedActionOperations)s).ListAsync(resourceGroupName, serverName, databaseName, advisorName);
            }
            , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
        }

        /// <summary>
        /// Returns list of recommended actions for this advisor.
        /// </summary>
        /// <param name='operations'>
        /// Reference to the
        /// Microsoft.Azure.Management.Sql.IDatabaseRecommendedActionOperations.
        /// </param>
        /// <param name='resourceGroupName'>
        /// Required. The name of the Resource Group.
        /// </param>
        /// <param name='serverName'>
        /// Required. The name of the Azure SQL server.
        /// </param>
        /// <param name='databaseName'>
        /// Required. The name of the Azure SQL database.
        /// </param>
        /// <param name='advisorName'>
        /// Required. The name of the Azure SQL database advisor.
        /// </param>
        /// <returns>
        /// Represents the response to a list recommended actions request.
        /// </returns>
        public static Task<RecommendedActionListResponse> ListAsync(this IDatabaseRecommendedActionOperations operations, string resourceGroupName, string serverName, string databaseName, string advisorName)
        {
            return operations.ListAsync(resourceGroupName, serverName, databaseName, advisorName, CancellationToken.None);
        }

        /// <summary>
        /// Updates recommended action state.
        /// </summary>
        /// <param name='operations'>
        /// Reference to the
        /// Microsoft.Azure.Management.Sql.IDatabaseRecommendedActionOperations.
        /// </param>
        /// <param name='resourceGroupName'>
        /// Required. The name of the Resource Group.
        /// </param>
        /// <param name='serverName'>
        /// Required. The name of the Azure SQL server.
        /// </param>
        /// <param name='databaseName'>
        /// Required. The name of the Azure SQL database.
        /// </param>
        /// <param name='advisorName'>
        /// Required. The name of the Azure SQL database advisor.
        /// </param>
        /// <param name='recommendedActionName'>
        /// Required. The name of the Azure SQL database recommended action.
        /// </param>
        /// <param name='parameters'>
        /// Required. The required parameters for updating recommended action
        /// state.
        /// </param>
        /// <returns>
        /// Represents the response to an update recommended action request.
        /// </returns>
        public static RecommendedActionUpdateResponse Update(this IDatabaseRecommendedActionOperations operations, string resourceGroupName, string serverName, string databaseName, string advisorName, string recommendedActionName, RecommendedActionUpdateParameters parameters)
        {
            return Task.Factory.StartNew((object s) =>
            {
                return ((IDatabaseRecommendedActionOperations)s).UpdateAsync(resourceGroupName, serverName, databaseName, advisorName, recommendedActionName, parameters);
            }
            , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
        }

        /// <summary>
        /// Updates recommended action state.
        /// </summary>
        /// <param name='operations'>
        /// Reference to the
        /// Microsoft.Azure.Management.Sql.IDatabaseRecommendedActionOperations.
        /// </param>
        /// <param name='resourceGroupName'>
        /// Required. The name of the Resource Group.
        /// </param>
        /// <param name='serverName'>
        /// Required. The name of the Azure SQL server.
        /// </param>
        /// <param name='databaseName'>
        /// Required. The name of the Azure SQL database.
        /// </param>
        /// <param name='advisorName'>
        /// Required. The name of the Azure SQL database advisor.
        /// </param>
        /// <param name='recommendedActionName'>
        /// Required. The name of the Azure SQL database recommended action.
        /// </param>
        /// <param name='parameters'>
        /// Required. The required parameters for updating recommended action
        /// state.
        /// </param>
        /// <returns>
        /// Represents the response to an update recommended action request.
        /// </returns>
        public static Task<RecommendedActionUpdateResponse> UpdateAsync(this IDatabaseRecommendedActionOperations operations, string resourceGroupName, string serverName, string databaseName, string advisorName, string recommendedActionName, RecommendedActionUpdateParameters parameters)
        {
            return operations.UpdateAsync(resourceGroupName, serverName, databaseName, advisorName, recommendedActionName, parameters, CancellationToken.None);
        }
    }
}


text:
usage: openaps-import [-h] [--list] [input]

 openaps-import - import openaps configuration
  Import configuration.

positional arguments:
  input       Read from stdin

optional arguments:
  -h, --help  show this help message and exit
  --list, -l  Just list types

Example workflow:

openaps -C /path/to/another/openaps.ini device show --json ns-upload | openaps import -


text:
package sune.etc.faso;

import java.util.List;

import sune.etc.faso.util.ArrayItems;

public class Serials extends ArrayItems<Serial> {

	public Serials(Serial... serials) {
		super(serials);
	}

	public Serials(List<Serial> serials) {
		super(serials.toArray(new Serial[serials.size()]));
	}

	public static Serials get() {
		return get(false);
	}

	public static Serials get(boolean loadFully) {
		return FASO.getSerials(loadFully);
	}
}


text:
package com.networknt.light.rule.dependency;

/**
 * Created by steve on 3/9/2015.
 */
public class GetDependencyRule {
}


text:
/**
 * @constructor
 * @extends {WebInspector.Panel}
 */
WebInspector.ElementsPanel = function()
{
    WebInspector.Panel.call(this, "elements");
    this.registerRequiredCSS("elementsPanel.css");
    this.registerRequiredCSS("textPrompt.css");
    this.setHideOnDetach();

    const initialSidebarWidth = 325;
    const minimalContentWidthPercent = 34;
    this.createSplitView(this.element, WebInspector.SplitView.SidebarPosition.Right, initialSidebarWidth);
    this.splitView.minimalSidebarWidth = Preferences.minElementsSidebarWidth;
    this.splitView.minimalMainWidthPercent = minimalContentWidthPercent;

    this.contentElement = this.splitView.mainElement;
    this.contentElement.id = "elements-content";
    this.contentElement.addStyleClass("outline-disclosure");
    this.contentElement.addStyleClass("source-code");
    if (!WebInspector.settings.domWordWrap.get())
        this.contentElement.classList.add("nowrap");
    WebInspector.settings.domWordWrap.addChangeListener(this._domWordWrapSettingChanged.bind(this));

    this.contentElement.addEventListener("contextmenu", this._contextMenuEventFired.bind(this), true);

    this.treeOutline = new WebInspector.ElementsTreeOutline(true, true, false, this._populateContextMenu.bind(this), this._setPseudoClassForNodeId.bind(this));
    this.treeOutline.wireToDomAgent();

    this.treeOutline.addEventListener(WebInspector.ElementsTreeOutline.Events.SelectedNodeChanged, this._selectedNodeChanged, this);

    this.crumbsElement = document.createElement("div");
    this.crumbsElement.className = "crumbs";
    this.crumbsElement.addEventListener("mousemove", this._mouseMovedInCrumbs.bind(this), false);
    this.crumbsElement.addEventListener("mouseout", this._mouseMovedOutOfCrumbs.bind(this), false);

    this.sidebarPanes = {};
    this.sidebarPanes.computedStyle = new WebInspector.ComputedStyleSidebarPane();
    this.sidebarPanes.styles = new WebInspector.StylesSidebarPane(this.sidebarPanes.computedStyle, this._setPseudoClassForNodeId.bind(this));
    this.sidebarPanes.metrics = new WebInspector.MetricsSidebarPane();
    this.sidebarPanes.properties = new WebInspector.PropertiesSidebarPane();
    this.sidebarPanes.domBreakpoints = WebInspector.domBreakpointsSidebarPane;
    this.sidebarPanes.eventListeners = new WebInspector.EventListenersSidebarPane();

    this.sidebarPanes.styles.onexpand = this.updateStyles.bind(this);
    this.sidebarPanes.metrics.onexpand = this.updateMetrics.bind(this);
    this.sidebarPanes.properties.onexpand = this.updateProperties.bind(this);
    this.sidebarPanes.eventListeners.onexpand = this.updateEventListeners.bind(this);

    this.sidebarPanes.styles.expanded = true;

    this.sidebarPanes.styles.addEventListener("style edited", this._stylesPaneEdited, this);
    this.sidebarPanes.styles.addEventListener("style property toggled", this._stylesPaneEdited, this);
    this.sidebarPanes.metrics.addEventListener("metrics edited", this._metricsPaneEdited, this);

    for (var pane in this.sidebarPanes) {
        this.sidebarElement.appendChild(this.sidebarPanes[pane].element);
        if (this.sidebarPanes[pane].onattach)
            this.sidebarPanes[pane].onattach();
    }

    this._registerShortcuts();

    this._popoverHelper = new WebInspector.PopoverHelper(document.body, this._getPopoverAnchor.bind(this), this._showPopover.bind(this));
    this._popoverHelper.setTimeout(0);

    WebInspector.domAgent.addEventListener(WebInspector.DOMAgent.Events.NodeRemoved, this._nodeRemoved, this);
    WebInspector.domAgent.addEventListener(WebInspector.DOMAgent.Events.DocumentUpdated, this._documentUpdatedEvent, this);
    WebInspector.domAgent.addEventListener(WebInspector.DOMAgent.Events.InspectElementRequested, this._inspectElementRequested, this);

    if (WebInspector.domAgent.existingDocument())
        this._documentUpdated(WebInspector.domAgent.existingDocument());
}

WebInspector.ElementsPanel.prototype = {
    get statusBarItems()
    {
        return [this.crumbsElement];
    },

    defaultFocusedElement: function()
    {
        return this.treeOutline.element;
    },

    statusBarResized: function()
    {
        this.updateBreadcrumbSizes();
    },

    wasShown: function()
    {
        // Attach heavy component lazily
        if (this.treeOutline.element.parentElement !== this.contentElement)
            this.contentElement.appendChild(this.treeOutline.element);

        WebInspector.Panel.prototype.wasShown.call(this);

        this.updateBreadcrumb();
        this.treeOutline.updateSelection();
        this.treeOutline.setVisible(true);

        if (!this.treeOutline.rootDOMNode)
            WebInspector.domAgent.requestDocument();

        this.sidebarElement.insertBefore(this.sidebarPanes.domBreakpoints.element, this.sidebarPanes.eventListeners.element);
    },

    willHide: function()
    {
        WebInspector.domAgent.hideDOMNodeHighlight();
        this.treeOutline.setVisible(false);
        this._popoverHelper.hidePopover();

        // Detach heavy component on hide
        this.contentElement.removeChild(this.treeOutline.element);

        for (var pane in this.sidebarPanes) {
            if (this.sidebarPanes[pane].willHide)
                this.sidebarPanes[pane].willHide();
        }

        WebInspector.Panel.prototype.willHide.call(this);
    },

    onResize: function()
    {
        this.treeOutline.updateSelection();
        this.updateBreadcrumbSizes();
    },

    /**
     * @param {DOMAgent.NodeId} nodeId
     * @param {string} pseudoClass
     * @param {boolean} enable
     */
    _setPseudoClassForNodeId: function(nodeId, pseudoClass, enable)
    {
        var node = WebInspector.domAgent.nodeForId(nodeId);
        if (!node)
            return;

        var pseudoClasses = node.getUserProperty(WebInspector.ElementsTreeOutline.PseudoStateDecorator.PropertyName);
        if (enable) {
            pseudoClasses = pseudoClasses || [];
            if (pseudoClasses.indexOf(pseudoClass) >= 0)
                return;
            pseudoClasses.push(pseudoClass);
            node.setUserProperty(WebInspector.ElementsTreeOutline.PseudoStateDecorator.PropertyName, pseudoClasses);
        } else {
            if (!pseudoClasses || pseudoClasses.indexOf(pseudoClass) < 0)
                return;
            pseudoClasses.remove(pseudoClass);
            if (!pseudoClasses.length)
                node.removeUserProperty(WebInspector.ElementsTreeOutline.PseudoStateDecorator.PropertyName);
        }

        this.treeOutline.updateOpenCloseTags(node);
        WebInspector.cssModel.forcePseudoState(node.id, node.getUserProperty(WebInspector.ElementsTreeOutline.PseudoStateDecorator.PropertyName));
        this._metricsPaneEdited();
        this._stylesPaneEdited();
    },

    _selectedNodeChanged: function()
    {
        var selectedNode = this.selectedDOMNode();
        if (!selectedNode && this._lastValidSelectedNode)
            this._selectedPathOnReset = this._lastValidSelectedNode.path();

        this.updateBreadcrumb(false);

        this._updateSidebars();

        if (selectedNode) {
            ConsoleAgent.addInspectedNode(selectedNode.id);
            this._lastValidSelectedNode = selectedNode;
        }
    },

    _updateSidebars: function()
    {
        for (var pane in this.sidebarPanes)
           this.sidebarPanes[pane].needsUpdate = true;

        this.updateStyles(true);
        this.updateMetrics();
        this.updateProperties();
        this.updateEventListeners();
    },

    _reset: function()
    {
        delete this.currentQuery;
    },

    _documentUpdatedEvent: function(event)
    {
        this._documentUpdated(event.data);
    },

    _documentUpdated: function(inspectedRootDocument)
    {
        this._reset();
        this.searchCanceled();

        this.treeOutline.rootDOMNode = inspectedRootDocument;

        if (!inspectedRootDocument) {
            if (this.isShowing())
                WebInspector.domAgent.requestDocument();
            return;
        }

        this.sidebarPanes.domBreakpoints.restoreBreakpoints();

        /**
         * @this {WebInspector.ElementsPanel}
         * @param {WebInspector.DOMNode=} candidateFocusNode
         */
        function selectNode(candidateFocusNode)
        {
            if (!candidateFocusNode)
                candidateFocusNode = inspectedRootDocument.body || inspectedRootDocument.documentElement;

            if (!candidateFocusNode)
                return;

            this.selectDOMNode(candidateFocusNode);
            if (this.treeOutline.selectedTreeElement)
                this.treeOutline.selectedTreeElement.expand();
        }

        function selectLastSelectedNode(nodeId)
        {
            if (this.selectedDOMNode()) {
                // Focused node has been explicitly set while reaching out for the last selected node.
                return;
            }
            var node = nodeId ? WebInspector.domAgent.nodeForId(nodeId) : null;
            selectNode.call(this, node);
        }

        if (this._selectedPathOnReset)
            WebInspector.domAgent.pushNodeByPathToFrontend(this._selectedPathOnReset, selectLastSelectedNode.bind(this));
        else
            selectNode.call(this);
        delete this._selectedPathOnReset;
    },

    searchCanceled: function()
    {
        delete this._searchQuery;
        this._hideSearchHighlights();

        WebInspector.searchController.updateSearchMatchesCount(0, this);

        delete this._currentSearchResultIndex;
        delete this._searchResults;
        WebInspector.domAgent.cancelSearch();
    },

    /**
     * @param {string} query
     */
    performSearch: function(query)
    {
        // Call searchCanceled since it will reset everything we need before doing a new search.
        this.searchCanceled();

        const whitespaceTrimmedQuery = query.trim();
        if (!whitespaceTrimmedQuery.length)
            return;

        this._searchQuery = query;

        /**
         * @param {number} resultCount
         */
        function resultCountCallback(resultCount)
        {
            WebInspector.searchController.updateSearchMatchesCount(resultCount, this);
            if (!resultCount)
                return;

            this._searchResults = new Array(resultCount);
            this._currentSearchResultIndex = -1;
            this.jumpToNextSearchResult();
        }
        WebInspector.domAgent.performSearch(whitespaceTrimmedQuery, resultCountCallback.bind(this));
    },

    _contextMenuEventFired: function(event)
    {
        function toggleWordWrap()
        {
            WebInspector.settings.domWordWrap.set(!WebInspector.settings.domWordWrap.get());
        }

        var contextMenu = new WebInspector.ContextMenu();
        var populated = this.treeOutline.populateContextMenu(contextMenu, event);
        if (populated)
            contextMenu.appendSeparator();
        contextMenu.appendCheckboxItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "Word wrap" : "Word Wrap"), toggleWordWrap.bind(this), WebInspector.settings.domWordWrap.get());

        contextMenu.show(event);
    },

    _domWordWrapSettingChanged: function(event)
    {
        if (event.data)
            this.contentElement.removeStyleClass("nowrap");
        else
            this.contentElement.addStyleClass("nowrap");

        var selectedNode = this.selectedDOMNode();
        if (!selectedNode)
            return;

        var treeElement = this.treeOutline.findTreeElement(selectedNode);
        if (treeElement)
            treeElement.updateSelection(); // Recalculate selection highlight dimensions.
    },

    switchToAndFocus: function(node)
    {
        // Reset search restore.
        WebInspector.searchController.cancelSearch();
        WebInspector.inspectorView.setCurrentPanel(this);
        this.selectDOMNode(node, true);
    },

    _populateContextMenu: function(contextMenu, node)
    {
        // Add debbuging-related actions
        contextMenu.appendSeparator();
        var pane = this.sidebarPanes.domBreakpoints;
        pane.populateNodeContextMenu(node, contextMenu);
    },

    _getPopoverAnchor: function(element)
    {
        var anchor = element.enclosingNodeOrSelfWithClass("webkit-html-resource-link");
        if (anchor) {
            if (!anchor.href)
                return null;

            var resource = WebInspector.resourceTreeModel.resourceForURL(anchor.href);
            if (!resource || resource.type !== WebInspector.resourceTypes.Image)
                return null;

            anchor.removeAttribute("title");
        }
        return anchor;
    },

    _loadDimensionsForNode: function(treeElement, callback)
    {
        // We get here for CSS properties, too, so bail out early for non-DOM treeElements.
        if (treeElement.treeOutline !== this.treeOutline) {
            callback();
            return;
        }

        var node = /** @type {WebInspector.DOMNode} */ treeElement.representedObject;

        if (!node.nodeName() || node.nodeName().toLowerCase() !== "img") {
            callback();
            return;
        }

        WebInspector.RemoteObject.resolveNode(node, "", resolvedNode);

        function resolvedNode(object)
        {
            if (!object) {
                callback();
                return;
            }

            object.callFunctionJSON(dimensions, undefined, callback);
            object.release();

            function dimensions()
            {
                return { offsetWidth: this.offsetWidth, offsetHeight: this.offsetHeight, naturalWidth: this.naturalWidth, naturalHeight: this.naturalHeight };
            }
        }
    },

    /**
     * @param {Element} anchor
     * @param {WebInspector.Popover} popover
     */
    _showPopover: function(anchor, popover)
    {
        var listItem = anchor.enclosingNodeOrSelfWithNodeNameInArray(["li"]);
        if (listItem && listItem.treeElement)
            this._loadDimensionsForNode(listItem.treeElement, dimensionsCallback);
        else
            dimensionsCallback();

        /**
         * @param {Object=} dimensions
         */
        function dimensionsCallback(dimensions)
        {
            var imageElement = document.createElement("img");
            imageElement.addEventListener("load", showPopover.bind(null, imageElement, dimensions), false);
            var resource = WebInspector.resourceTreeModel.resourceForURL(anchor.href);
            if (!resource)
                return;

            resource.populateImageSource(imageElement);
        }

        /**
         * @param {Object=} dimensions
         */
        function showPopover(imageElement, dimensions)
        {
            var contents = buildPopoverContents(imageElement, dimensions);
            popover.setCanShrink(false);
            popover.show(contents, anchor);
        }

        /**
         * @param {Object=} nodeDimensions
         */
        function buildPopoverContents(imageElement, nodeDimensions)
        {
            const maxImageWidth = 100;
            const maxImageHeight = 100;
            var container = document.createElement("table");
            container.className = "image-preview-container";
            var naturalWidth = nodeDimensions ? nodeDimensions.naturalWidth : imageElement.naturalWidth;
            var naturalHeight = nodeDimensions ? nodeDimensions.naturalHeight : imageElement.naturalHeight;
            var offsetWidth = nodeDimensions ? nodeDimensions.offsetWidth : naturalWidth;
            var offsetHeight = nodeDimensions ? nodeDimensions.offsetHeight : naturalHeight;
            var description;
            if (offsetHeight === naturalHeight && offsetWidth === naturalWidth)
                description = WebInspector.UIString("%d \xd7 %d pixels", offsetWidth, offsetHeight);
            else
                description = WebInspector.UIString("%d \xd7 %d pixels (Natural: %d \xd7 %d pixels)", offsetWidth, offsetHeight, naturalWidth, naturalHeight);

            if (naturalWidth > naturalHeight) {
                if (naturalWidth > maxImageWidth) {
                    imageElement.style.width = maxImageWidth + "px";
                    imageElement.style.height = (naturalHeight * maxImageWidth / naturalWidth) + "px";
                }
            } else {
                if (naturalHeight > maxImageHeight) {
                    imageElement.style.width = (naturalWidth * maxImageHeight / naturalHeight) + "px";
                    imageElement.style.height = maxImageHeight + "px";
                }
            }
            container.createChild("tr").createChild("td", "image-container").appendChild(imageElement);
            container.createChild("tr").createChild("td").createChild("span", "description").textContent = description;
            return container;
        }
    },

    jumpToNextSearchResult: function()
    {
        if (!this._searchResults)
            return;

        this._hideSearchHighlights();
        if (++this._currentSearchResultIndex >= this._searchResults.length)
            this._currentSearchResultIndex = 0;

        this._highlightCurrentSearchResult();
    },

    jumpToPreviousSearchResult: function()
    {
        if (!this._searchResults)
            return;

        this._hideSearchHighlights();
        if (--this._currentSearchResultIndex < 0)
            this._currentSearchResultIndex = (this._searchResults.length - 1);

        this._highlightCurrentSearchResult();
        return true;
    },

    _highlightCurrentSearchResult: function()
    {
        var index = this._currentSearchResultIndex;
        var searchResults = this._searchResults;
        var searchResult = searchResults[index];

        if (searchResult === null) {
            WebInspector.searchController.updateCurrentMatchIndex(index, this);
            return;
        }

        if (typeof searchResult === "undefined") {
            // No data for slot, request it.
            function callback(node)
            {
                searchResults[index] = node || null;
                this._highlightCurrentSearchResult();
            }
            WebInspector.domAgent.searchResult(index, callback.bind(this));
            return;
        }

        WebInspector.searchController.updateCurrentMatchIndex(index, this);

        var treeElement = this.treeOutline.findTreeElement(searchResult);
        if (treeElement) {
            treeElement.highlightSearchResults(this._searchQuery);
            treeElement.reveal();
        }
    },

    _hideSearchHighlights: function()
    {
        if (!this._searchResults)
            return;
        var searchResult = this._searchResults[this._currentSearchResultIndex];
        if (!searchResult)
            return;
        var treeElement = this.treeOutline.findTreeElement(searchResult);
        if (treeElement)
            treeElement.hideSearchHighlights();
    },

    selectedDOMNode: function()
    {
        return this.treeOutline.selectedDOMNode();
    },

    /**
     * @param {boolean=} focus
     */
    selectDOMNode: function(node, focus)
    {
        this.treeOutline.selectDOMNode(node, focus);
    },

    _nodeRemoved: function(event)
    {
        if (!this.isShowing())
            return;

        var crumbs = this.crumbsElement;
        for (var crumb = crumbs.firstChild; crumb; crumb = crumb.nextSibling) {
            if (crumb.representedObject === event.data.node) {
                this.updateBreadcrumb(true);
                return;
            }
        }
    },

    _stylesPaneEdited: function()
    {
        // Once styles are edited, the Metrics pane should be updated.
        this.sidebarPanes.metrics.needsUpdate = true;
        this.updateMetrics();
    },

    _metricsPaneEdited: function()
    {
        // Once metrics are edited, the Styles pane should be updated.
        this.sidebarPanes.styles.needsUpdate = true;
        this.updateStyles(true);
    },

    _mouseMovedInCrumbs: function(event)
    {
        var nodeUnderMouse = document.elementFromPoint(event.pageX, event.pageY);
        var crumbElement = nodeUnderMouse.enclosingNodeOrSelfWithClass("crumb");

        WebInspector.domAgent.highlightDOMNode(crumbElement ? crumbElement.representedObject.id : 0);

        if ("_mouseOutOfCrumbsTimeout" in this) {
            clearTimeout(this._mouseOutOfCrumbsTimeout);
            delete this._mouseOutOfCrumbsTimeout;
        }
    },

    _mouseMovedOutOfCrumbs: function(event)
    {
        var nodeUnderMouse = document.elementFromPoint(event.pageX, event.pageY);
        if (nodeUnderMouse && nodeUnderMouse.isDescendant(this.crumbsElement))
            return;

        WebInspector.domAgent.hideDOMNodeHighlight();

        this._mouseOutOfCrumbsTimeout = setTimeout(this.updateBreadcrumbSizes.bind(this), 1000);
    },

    /**
     * @param {boolean=} forceUpdate
     */
    updateBreadcrumb: function(forceUpdate)
    {
        if (!this.isShowing())
            return;

        var crumbs = this.crumbsElement;

        var handled = false;
        var foundRoot = false;
        var crumb = crumbs.firstChild;
        while (crumb) {
            if (crumb.representedObject === this.treeOutline.rootDOMNode)
                foundRoot = true;

            if (foundRoot)
                crumb.addStyleClass("dimmed");
            else
                crumb.removeStyleClass("dimmed");

            if (crumb.representedObject === this.selectedDOMNode()) {
                crumb.addStyleClass("selected");
                handled = true;
            } else {
                crumb.removeStyleClass("selected");
            }

            crumb = crumb.nextSibling;
        }

        if (handled && !forceUpdate) {
            // We don't need to rebuild the crumbs, but we need to adjust sizes
            // to reflect the new focused or root node.
            this.updateBreadcrumbSizes();
            return;
        }

        crumbs.removeChildren();

        var panel = this;

        function selectCrumbFunction(event)
        {
            var crumb = event.currentTarget;
            if (crumb.hasStyleClass("collapsed")) {
                // Clicking a collapsed crumb will expose the hidden crumbs.
                if (crumb === panel.crumbsElement.firstChild) {
                    // If the focused crumb is the first child, pick the farthest crumb
                    // that is still hidden. This allows the user to expose every crumb.
                    var currentCrumb = crumb;
                    while (currentCrumb) {
                        var hidden = currentCrumb.hasStyleClass("hidden");
                        var collapsed = currentCrumb.hasStyleClass("collapsed");
                        if (!hidden && !collapsed)
                            break;
                        crumb = currentCrumb;
                        currentCrumb = currentCrumb.nextSibling;
                    }
                }

                panel.updateBreadcrumbSizes(crumb);
            } else
                panel.selectDOMNode(crumb.representedObject, true);

            event.preventDefault();
        }

        foundRoot = false;
        for (var current = this.selectedDOMNode(); current; current = current.parentNode) {
            if (current.nodeType() === Node.DOCUMENT_NODE)
                continue;

            if (current === this.treeOutline.rootDOMNode)
                foundRoot = true;

            crumb = document.createElement("span");
            crumb.className = "crumb";
            crumb.representedObject = current;
            crumb.addEventListener("mousedown", selectCrumbFunction, false);

            var crumbTitle;
            switch (current.nodeType()) {
                case Node.ELEMENT_NODE:
                    WebInspector.DOMPresentationUtils.decorateNodeLabel(current, crumb);
                    break;

                case Node.TEXT_NODE:
                    crumbTitle = WebInspector.UIString("(text)");
                    break

                case Node.COMMENT_NODE:
                    crumbTitle = "<!-->";
                    break;

                case Node.DOCUMENT_TYPE_NODE:
                    crumbTitle = "<!DOCTYPE>";
                    break;

                default:
                    crumbTitle = current.nodeNameInCorrectCase();
            }

            if (!crumb.childNodes.length) {
                var nameElement = document.createElement("span");
                nameElement.textContent = crumbTitle;
                crumb.appendChild(nameElement);
                crumb.title = crumbTitle;
            }

            if (foundRoot)
                crumb.addStyleClass("dimmed");
            if (current === this.selectedDOMNode())
                crumb.addStyleClass("selected");
            if (!crumbs.childNodes.length)
                crumb.addStyleClass("end");

            crumbs.appendChild(crumb);
        }

        if (crumbs.hasChildNodes())
            crumbs.lastChild.addStyleClass("start");

        this.updateBreadcrumbSizes();
    },

    /**
     * @param {Element=} focusedCrumb
     */
    updateBreadcrumbSizes: function(focusedCrumb)
    {
        if (!this.isShowing())
            return;

        if (document.body.offsetWidth <= 0) {
            // The stylesheet hasn't loaded yet or the window is closed,
            // so we can't calculate what is need. Return early.
            return;
        }

        var crumbs = this.crumbsElement;
        if (!crumbs.childNodes.length || crumbs.offsetWidth <= 0)
            return; // No crumbs, do nothing.

        // A Zero index is the right most child crumb in the breadcrumb.
        var selectedIndex = 0;
        var focusedIndex = 0;
        var selectedCrumb;

        var i = 0;
        var crumb = crumbs.firstChild;
        while (crumb) {
            // Find the selected crumb and index.
            if (!selectedCrumb && crumb.hasStyleClass("selected")) {
                selectedCrumb = crumb;
                selectedIndex = i;
            }

            // Find the focused crumb index.
            if (crumb === focusedCrumb)
                focusedIndex = i;

            // Remove any styles that affect size before
            // deciding to shorten any crumbs.
            if (crumb !== crumbs.lastChild)
                crumb.removeStyleClass("start");
            if (crumb !== crumbs.firstChild)
                crumb.removeStyleClass("end");

            crumb.removeStyleClass("compact");
            crumb.removeStyleClass("collapsed");
            crumb.removeStyleClass("hidden");

            crumb = crumb.nextSibling;
            ++i;
        }

        // Restore the start and end crumb classes in case they got removed in coalesceCollapsedCrumbs().
        // The order of the crumbs in the document is opposite of the visual order.
        crumbs.firstChild.addStyleClass("end");
        crumbs.lastChild.addStyleClass("start");

        function crumbsAreSmallerThanContainer()
        {
            var rightPadding = 20;
            var errorWarningElement = document.getElementById("error-warning-count");
            if (!WebInspector.drawer.visible && errorWarningElement)
                rightPadding += errorWarningElement.offsetWidth;
            return ((crumbs.totalOffsetLeft() + crumbs.offsetWidth + rightPadding) < window.innerWidth);
        }

        if (crumbsAreSmallerThanContainer())
            return; // No need to compact the crumbs, they all fit at full size.

        var BothSides = 0;
        var AncestorSide = -1;
        var ChildSide = 1;

        /**
         * @param {boolean=} significantCrumb
         */
        function makeCrumbsSmaller(shrinkingFunction, direction, significantCrumb)
        {
            if (!significantCrumb)
                significantCrumb = (focusedCrumb || selectedCrumb);

            if (significantCrumb === selectedCrumb)
                var significantIndex = selectedIndex;
            else if (significantCrumb === focusedCrumb)
                var significantIndex = focusedIndex;
            else {
                var significantIndex = 0;
                for (var i = 0; i < crumbs.childNodes.length; ++i) {
                    if (crumbs.childNodes[i] === significantCrumb) {
                        significantIndex = i;
                        break;
                    }
                }
            }

            function shrinkCrumbAtIndex(index)
            {
                var shrinkCrumb = crumbs.childNodes[index];
                if (shrinkCrumb && shrinkCrumb !== significantCrumb)
                    shrinkingFunction(shrinkCrumb);
                if (crumbsAreSmallerThanContainer())
                    return true; // No need to compact the crumbs more.
                return false;
            }

            // Shrink crumbs one at a time by applying the shrinkingFunction until the crumbs
            // fit in the container or we run out of crumbs to shrink.
            if (direction) {
                // Crumbs are shrunk on only one side (based on direction) of the signifcant crumb.
                var index = (direction > 0 ? 0 : crumbs.childNodes.length - 1);
                while (index !== significantIndex) {
                    if (shrinkCrumbAtIndex(index))
                        return true;
                    index += (direction > 0 ? 1 : -1);
                }
            } else {
                // Crumbs are shrunk in order of descending distance from the signifcant crumb,
                // with a tie going to child crumbs.
                var startIndex = 0;
                var endIndex = crumbs.childNodes.length - 1;
                while (startIndex != significantIndex || endIndex != significantIndex) {
                    var startDistance = significantIndex - startIndex;
                    var endDistance = endIndex - significantIndex;
                    if (startDistance >= endDistance)
                        var index = startIndex++;
                    else
                        var index = endIndex--;
                    if (shrinkCrumbAtIndex(index))
                        return true;
                }
            }

            // We are not small enough yet, return false so the caller knows.
            return false;
        }

        function coalesceCollapsedCrumbs()
        {
            var crumb = crumbs.firstChild;
            var collapsedRun = false;
            var newStartNeeded = false;
            var newEndNeeded = false;
            while (crumb) {
                var hidden = crumb.hasStyleClass("hidden");
                if (!hidden) {
                    var collapsed = crumb.hasStyleClass("collapsed");
                    if (collapsedRun && collapsed) {
                        crumb.addStyleClass("hidden");
                        crumb.removeStyleClass("compact");
                        crumb.removeStyleClass("collapsed");

                        if (crumb.hasStyleClass("start")) {
                            crumb.removeStyleClass("start");
                            newStartNeeded = true;
                        }

                        if (crumb.hasStyleClass("end")) {
                            crumb.removeStyleClass("end");
                            newEndNeeded = true;
                        }

                        continue;
                    }

                    collapsedRun = collapsed;

                    if (newEndNeeded) {
                        newEndNeeded = false;
                        crumb.addStyleClass("end");
                    }
                } else
                    collapsedRun = true;
                crumb = crumb.nextSibling;
            }

            if (newStartNeeded) {
                crumb = crumbs.lastChild;
                while (crumb) {
                    if (!crumb.hasStyleClass("hidden")) {
                        crumb.addStyleClass("start");
                        break;
                    }
                    crumb = crumb.previousSibling;
                }
            }
        }

        function compact(crumb)
        {
            if (crumb.hasStyleClass("hidden"))
                return;
            crumb.addStyleClass("compact");
        }

        function collapse(crumb, dontCoalesce)
        {
            if (crumb.hasStyleClass("hidden"))
                return;
            crumb.addStyleClass("collapsed");
            crumb.removeStyleClass("compact");
            if (!dontCoalesce)
                coalesceCollapsedCrumbs();
        }

        function compactDimmed(crumb)
        {
            if (crumb.hasStyleClass("dimmed"))
                compact(crumb);
        }

        function collapseDimmed(crumb)
        {
            if (crumb.hasStyleClass("dimmed"))
                collapse(crumb, false);
        }

        if (!focusedCrumb) {
            // When not focused on a crumb we can be biased and collapse less important
            // crumbs that the user might not care much about.

            // Compact child crumbs.
            if (makeCrumbsSmaller(compact, ChildSide))
                return;

            // Collapse child crumbs.
            if (makeCrumbsSmaller(collapse, ChildSide))
                return;

            // Compact dimmed ancestor crumbs.
            if (makeCrumbsSmaller(compactDimmed, AncestorSide))
                return;

            // Collapse dimmed ancestor crumbs.
            if (makeCrumbsSmaller(collapseDimmed, AncestorSide))
                return;
        }

        // Compact ancestor crumbs, or from both sides if focused.
        if (makeCrumbsSmaller(compact, (focusedCrumb ? BothSides : AncestorSide)))
            return;

        // Collapse ancestor crumbs, or from both sides if focused.
        if (makeCrumbsSmaller(collapse, (focusedCrumb ? BothSides : AncestorSide)))
            return;

        if (!selectedCrumb)
            return;

        // Compact the selected crumb.
        compact(selectedCrumb);
        if (crumbsAreSmallerThanContainer())
            return;

        // Collapse the selected crumb as a last resort. Pass true to prevent coalescing.
        collapse(selectedCrumb, true);
    },

    updateStyles: function(forceUpdate)
    {
        var stylesSidebarPane = this.sidebarPanes.styles;
        var computedStylePane = this.sidebarPanes.computedStyle;
        if ((!stylesSidebarPane.expanded && !computedStylePane.expanded) || !stylesSidebarPane.needsUpdate)
            return;

        stylesSidebarPane.update(this.selectedDOMNode(), forceUpdate);
        stylesSidebarPane.needsUpdate = false;
    },

    updateMetrics: function()
    {
        var metricsSidebarPane = this.sidebarPanes.metrics;
        if (!metricsSidebarPane.expanded || !metricsSidebarPane.needsUpdate)
            return;

        metricsSidebarPane.update(this.selectedDOMNode());
        metricsSidebarPane.needsUpdate = false;
    },

    updateProperties: function()
    {
        var propertiesSidebarPane = this.sidebarPanes.properties;
        if (!propertiesSidebarPane.expanded || !propertiesSidebarPane.needsUpdate)
            return;

        propertiesSidebarPane.update(this.selectedDOMNode());
        propertiesSidebarPane.needsUpdate = false;
    },

    updateEventListeners: function()
    {
        var eventListenersSidebarPane = this.sidebarPanes.eventListeners;
        if (!eventListenersSidebarPane.expanded || !eventListenersSidebarPane.needsUpdate)
            return;

        eventListenersSidebarPane.update(this.selectedDOMNode());
        eventListenersSidebarPane.needsUpdate = false;
    },

    _registerShortcuts: function()
    {
        var shortcut = WebInspector.KeyboardShortcut;
        var section = WebInspector.shortcutsScreen.section(WebInspector.UIString("Elements Panel"));
        var keys = [
            shortcut.shortcutToString(shortcut.Keys.Up),
            shortcut.shortcutToString(shortcut.Keys.Down)
        ];
        section.addRelatedKeys(keys, WebInspector.UIString("Navigate elements"));

        keys = [
            shortcut.shortcutToString(shortcut.Keys.Right),
            shortcut.shortcutToString(shortcut.Keys.Left)
        ];
        section.addRelatedKeys(keys, WebInspector.UIString("Expand/collapse"));
        section.addKey(shortcut.shortcutToString(shortcut.Keys.Enter), WebInspector.UIString("Edit attribute"));
        section.addKey(shortcut.shortcutToString(shortcut.Keys.F2), WebInspector.UIString("Toggle edit as HTML"));

        this.sidebarPanes.styles.registerShortcuts();
    },

    handleShortcut: function(event)
    {
        if (WebInspector.KeyboardShortcut.eventHasCtrlOrMeta(event) && !event.shiftKey && event.keyIdentifier === "U+005A") { // Z key
            WebInspector.domAgent.undo(this._updateSidebars.bind(this));
            event.handled = true;
            return;
        }

        var isRedoKey = WebInspector.isMac() ? event.metaKey && event.shiftKey && event.keyIdentifier === "U+005A" : // Z key
                                               event.ctrlKey && event.keyIdentifier === "U+0059"; // Y key
        if (isRedoKey) {
            DOMAgent.redo(this._updateSidebars.bind(this));
            event.handled = true;
            return;
        }

        this.treeOutline.handleShortcut(event);
    },

    handleCopyEvent: function(event)
    {
        // Don't prevent the normal copy if the user has a selection.
        if (!window.getSelection().isCollapsed)
            return;
        event.clipboardData.clearData();
        event.preventDefault();
        this.selectedDOMNode().copyNode();
    },

    sidebarResized: function(event)
    {
        this.treeOutline.updateSelection();
    },

    _inspectElementRequested: function(event)
    {
        var node = event.data;
        this.revealAndSelectNode(node.id);
    },

    revealAndSelectNode: function(nodeId)
    {
        WebInspector.inspectorView.setCurrentPanel(this);

        var node = WebInspector.domAgent.nodeForId(nodeId);
        if (!node)
            return;

        WebInspector.domAgent.highlightDOMNodeForTwoSeconds(nodeId);
        this.selectDOMNode(node, true);
    }
}

WebInspector.ElementsPanel.prototype.__proto__ = WebInspector.Panel.prototype;


text:
#include "Include/Process.h"

Process *Process::This = 0;

Process::Process(int socket, int argc, char *argv[]) : EventQueue(socket), argc(argc), argv(argv) {
  connectSignals();
}

Process::Process(int socket) : EventQueue(socket) {
  connectSignals();
}

void Process::run(bool asRelay) {
  EventQueue::start(asRelay);
}

void Process::stop() {
  EventQueue::stop();
}

// Tell the dispatcher that we were killed.
void Process::cleanup() {
  Event *ev = new Event();
  ev->set_type(Event_EventType_ET_KILLED);
  ev->set_sender_name(process_name);
  ev->set_sender_pid(getpid());
  EventQueue::sendDirect(ev);
}

void Process::onSignal(int sig) {
  //This->stop();
  This->cleanup();
  exit(sig);
}

// Get rid of zombies
void Process::onSigChld(int) {
  int stat;
  while(waitpid(-1, &stat, WNOHANG) > 0);
}

void Process::connectSignals() {
  signal(SIGABRT, &Process::onSignal);
  signal(SIGTERM, &Process::onSignal);
  signal(SIGINT,  &Process::onSignal);
  signal(SIGSEGV, &Process::onSignal);
  signal(SIGCHLD, &Process::onSigChld);
  Process::This = this;
}


text:
<?php

class Google_Service_CloudBuild_Build extends Google_Collection
{
  protected $collection_key = 'tags';
  protected $artifactsType = 'Google_Service_CloudBuild_Artifacts';
  protected $artifactsDataType = '';
  public $buildTriggerId;
  public $createTime;
  public $finishTime;
  public $id;
  public $images;
  public $logUrl;
  public $logsBucket;
  public $name;
  protected $optionsType = 'Google_Service_CloudBuild_BuildOptions';
  protected $optionsDataType = '';
  public $projectId;
  public $queueTtl;
  protected $resultsType = 'Google_Service_CloudBuild_Results';
  protected $resultsDataType = '';
  protected $secretsType = 'Google_Service_CloudBuild_Secret';
  protected $secretsDataType = 'array';
  public $serviceAccount;
  protected $sourceType = 'Google_Service_CloudBuild_Source';
  protected $sourceDataType = '';
  protected $sourceProvenanceType = 'Google_Service_CloudBuild_SourceProvenance';
  protected $sourceProvenanceDataType = '';
  public $startTime;
  public $status;
  public $statusDetail;
  protected $stepsType = 'Google_Service_CloudBuild_BuildStep';
  protected $stepsDataType = 'array';
  public $substitutions;
  public $tags;
  public $timeout;
  protected $timingType = 'Google_Service_CloudBuild_TimeSpan';
  protected $timingDataType = 'map';

  /**
   * @param Google_Service_CloudBuild_Artifacts
   */
  public function setArtifacts(Google_Service_CloudBuild_Artifacts $artifacts)
  {
    $this->artifacts = $artifacts;
  }
  /**
   * @return Google_Service_CloudBuild_Artifacts
   */
  public function getArtifacts()
  {
    return $this->artifacts;
  }
  public function setBuildTriggerId($buildTriggerId)
  {
    $this->buildTriggerId = $buildTriggerId;
  }
  public function getBuildTriggerId()
  {
    return $this->buildTriggerId;
  }
  public function setCreateTime($createTime)
  {
    $this->createTime = $createTime;
  }
  public function getCreateTime()
  {
    return $this->createTime;
  }
  public function setFinishTime($finishTime)
  {
    $this->finishTime = $finishTime;
  }
  public function getFinishTime()
  {
    return $this->finishTime;
  }
  public function setId($id)
  {
    $this->id = $id;
  }
  public function getId()
  {
    return $this->id;
  }
  public function setImages($images)
  {
    $this->images = $images;
  }
  public function getImages()
  {
    return $this->images;
  }
  public function setLogUrl($logUrl)
  {
    $this->logUrl = $logUrl;
  }
  public function getLogUrl()
  {
    return $this->logUrl;
  }
  public function setLogsBucket($logsBucket)
  {
    $this->logsBucket = $logsBucket;
  }
  public function getLogsBucket()
  {
    return $this->logsBucket;
  }
  public function setName($name)
  {
    $this->name = $name;
  }
  public function getName()
  {
    return $this->name;
  }
  /**
   * @param Google_Service_CloudBuild_BuildOptions
   */
  public function setOptions(Google_Service_CloudBuild_BuildOptions $options)
  {
    $this->options = $options;
  }
  /**
   * @return Google_Service_CloudBuild_BuildOptions
   */
  public function getOptions()
  {
    return $this->options;
  }
  public function setProjectId($projectId)
  {
    $this->projectId = $projectId;
  }
  public function getProjectId()
  {
    return $this->projectId;
  }
  public function setQueueTtl($queueTtl)
  {
    $this->queueTtl = $queueTtl;
  }
  public function getQueueTtl()
  {
    return $this->queueTtl;
  }
  /**
   * @param Google_Service_CloudBuild_Results
   */
  public function setResults(Google_Service_CloudBuild_Results $results)
  {
    $this->results = $results;
  }
  /**
   * @return Google_Service_CloudBuild_Results
   */
  public function getResults()
  {
    return $this->results;
  }
  /**
   * @param Google_Service_CloudBuild_Secret[]
   */
  public function setSecrets($secrets)
  {
    $this->secrets = $secrets;
  }
  /**
   * @return Google_Service_CloudBuild_Secret[]
   */
  public function getSecrets()
  {
    return $this->secrets;
  }
  public function setServiceAccount($serviceAccount)
  {
    $this->serviceAccount = $serviceAccount;
  }
  public function getServiceAccount()
  {
    return $this->serviceAccount;
  }
  /**
   * @param Google_Service_CloudBuild_Source
   */
  public function setSource(Google_Service_CloudBuild_Source $source)
  {
    $this->source = $source;
  }
  /**
   * @return Google_Service_CloudBuild_Source
   */
  public function getSource()
  {
    return $this->source;
  }
  /**
   * @param Google_Service_CloudBuild_SourceProvenance
   */
  public function setSourceProvenance(Google_Service_CloudBuild_SourceProvenance $sourceProvenance)
  {
    $this->sourceProvenance = $sourceProvenance;
  }
  /**
   * @return Google_Service_CloudBuild_SourceProvenance
   */
  public function getSourceProvenance()
  {
    return $this->sourceProvenance;
  }
  public function setStartTime($startTime)
  {
    $this->startTime = $startTime;
  }
  public function getStartTime()
  {
    return $this->startTime;
  }
  public function setStatus($status)
  {
    $this->status = $status;
  }
  public function getStatus()
  {
    return $this->status;
  }
  public function setStatusDetail($statusDetail)
  {
    $this->statusDetail = $statusDetail;
  }
  public function getStatusDetail()
  {
    return $this->statusDetail;
  }
  /**
   * @param Google_Service_CloudBuild_BuildStep[]
   */
  public function setSteps($steps)
  {
    $this->steps = $steps;
  }
  /**
   * @return Google_Service_CloudBuild_BuildStep[]
   */
  public function getSteps()
  {
    return $this->steps;
  }
  public function setSubstitutions($substitutions)
  {
    $this->substitutions = $substitutions;
  }
  public function getSubstitutions()
  {
    return $this->substitutions;
  }
  public function setTags($tags)
  {
    $this->tags = $tags;
  }
  public function getTags()
  {
    return $this->tags;
  }
  public function setTimeout($timeout)
  {
    $this->timeout = $timeout;
  }
  public function getTimeout()
  {
    return $this->timeout;
  }
  /**
   * @param Google_Service_CloudBuild_TimeSpan[]
   */
  public function setTiming($timing)
  {
    $this->timing = $timing;
  }
  /**
   * @return Google_Service_CloudBuild_TimeSpan[]
   */
  public function getTiming()
  {
    return $this->timing;
  }
}


text:
package org.spongepowered.common.world.teleport;

import net.minecraft.core.Registry;
import net.minecraft.resources.ResourceLocation;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.spongepowered.api.ResourceKey;
import org.spongepowered.api.block.BlockState;
import org.spongepowered.api.block.BlockType;
import org.spongepowered.api.state.StateContainer;
import org.spongepowered.api.world.teleport.TeleportHelperFilter;
import org.spongepowered.common.applaunch.config.common.TeleportHelperCategory;
import org.spongepowered.common.applaunch.config.core.SpongeConfigs;

import java.util.List;
import java.util.Locale;
import java.util.Objects;
import java.util.stream.Collectors;

public final class ConfigTeleportHelperFilter implements TeleportHelperFilter {

    // We try to cache this in case of big mod blacklists, we don't want to parse this
    // all the time.
    private static @Nullable List<BlockType> floorBlockTypes = null;
    private static @Nullable List<BlockState> floorBlockStates = null;
    private static @Nullable List<BlockType> bodyBlockTypes = null;
    private static @Nullable List<BlockState> bodyBlockStates = null;

    public static void invalidateCache() {
        ConfigTeleportHelperFilter.floorBlockTypes = null;
        ConfigTeleportHelperFilter.floorBlockStates = null;
        ConfigTeleportHelperFilter.bodyBlockStates = null;
        ConfigTeleportHelperFilter.bodyBlockTypes = null;
    }

    private static void updateCacheIfNecessary() {
        if (ConfigTeleportHelperFilter.floorBlockTypes == null) {
            final TeleportHelperCategory teleportHelperCat = SpongeConfigs.getCommon().get().teleportHelper;
            ConfigTeleportHelperFilter.floorBlockTypes = teleportHelperCat.unsafeFloorBlocks.stream()
                    .map(x -> ResourceKey.resolve(x.toLowerCase(Locale.ENGLISH)))
                    .map(x -> (BlockType) Registry.BLOCK.get((ResourceLocation) (Object) x))
                    .filter(Objects::nonNull)
                    .collect(Collectors.toList());

            ConfigTeleportHelperFilter.floorBlockStates = teleportHelperCat.unsafeFloorBlocks.stream()
                    .map(x -> ResourceKey.resolve(x.toLowerCase(Locale.ENGLISH)))
                    .map(x -> Registry.BLOCK.getOptional((ResourceLocation) (Object) x).map(b -> (BlockType) b)
                            .map(StateContainer::defaultState).orElse(null))
                    .filter(Objects::nonNull)
                    .collect(Collectors.toList());

            ConfigTeleportHelperFilter.bodyBlockTypes = teleportHelperCat.unsafeBlockBlocks.stream()
                    .map(x -> ResourceKey.resolve(x.toLowerCase(Locale.ENGLISH)))
                    .map(x -> (BlockType) Registry.BLOCK.get((ResourceLocation) (Object) x))
                    .filter(Objects::nonNull)
                    .collect(Collectors.toList());

            ConfigTeleportHelperFilter.bodyBlockStates = teleportHelperCat.unsafeBlockBlocks.stream()
                    .map(x -> ResourceKey.resolve(x.toLowerCase(Locale.ENGLISH)))
                    .map(x -> Registry.BLOCK.getOptional((ResourceLocation) (Object) x).map(b -> (BlockType) b)
                            .map(StateContainer::defaultState).orElse(null))
                    .filter(Objects::nonNull)
                    .collect(Collectors.toList());
        }
    }

    @Override
    public boolean isSafeFloorMaterial(final @NonNull BlockState blockState) {
        ConfigTeleportHelperFilter.updateCacheIfNecessary();
        return !ConfigTeleportHelperFilter.floorBlockStates.contains(blockState) && !ConfigTeleportHelperFilter.floorBlockTypes.contains(blockState.type());
    }

    @Override
    public boolean isSafeBodyMaterial(final @NonNull BlockState blockState) {
        ConfigTeleportHelperFilter.updateCacheIfNecessary();
        return !ConfigTeleportHelperFilter.bodyBlockStates.contains(blockState) && !ConfigTeleportHelperFilter.bodyBlockTypes.contains(blockState.type());
    }
}


text:
/*alias for the engine*/
module.exports = require('../../../../');


text:
! { dg-do run }
! PR 27980 - We used to allocate negative amounts of memory
!            for functions returning arrays if lbound > ubound-1.
!            Based on a test case by beliavsky@aol.com posted to
!            comp.lang.fortran.
program xint_func
  implicit none
  integer, parameter :: n=3,ii(n)=(/2,0,-1/)
  integer            :: i
  character(len=80)  :: line
  do i=1,n
     write (line,'(10I5)') int_func(ii(i))
  end do
contains
  function int_func(n) result(ivec)
    integer, intent(in) :: n
    integer             :: ivec(n)
    integer             :: i
    if (n > 0) then
       forall (i=1:n) ivec(i) = i
    end if
  end function int_func
end program xint_func


text:
<?php

/**
 *
 * Handler "diaporama" pour YesWiki.
 * Florian Schmitt <florian@outils-reseaux.org>.
 * Licence GPL.
 *
 *
**/

// Verification de securite
if (!defined("WIKINI_VERSION")) {
    die("accès direct interdit");
}

// on recupere les entetes html mais pas ce qu'il y a dans le body
$header =  explode('<body', $this->Header());
echo str_replace('<html', '<html class="slideshow-html"', $header[0])."<body class=\"slideshow-body\">\n";

// on regarde si un template est passe en parametre GET, on passe celui par defaut sinon
if (isset($_GET['template']) && file_exists(realpath('tools/templates/presentation/templates/'.$_GET['template']))) {
    $template = basename(realpath('tools/templates/presentation/templates/'.$_GET['template']));
} else {
    $template = 'diaporama_slides.tpl.html';
}

// fonction de generation du diaporama (teste les droits et l'existence de la page)
echo print_diaporama($this->tag, $template);

// on recupere juste les javascripts et la fin des balises body et html
$footer =  preg_replace('/^.+<script/Us', "\n".'<script', $this->Footer());

echo $footer;


text:
import { ICommand } from './ICommand';
import { Parameters } from '../run/Parameters';
import { ValidationResult } from '../validate/ValidationResult';
export interface ICommandIntercepter {
    getName(command: ICommand): string;
    execute(correlationId: string, command: ICommand, args: Parameters, callback: (err: any, result: any) => void): void;
    validate(command: ICommand, args: Parameters): ValidationResult[];
}


text:
<template name="afTextarea_semanticUI">
  <textarea {{this.atts}}>{{this.value}}</textarea>
</template>


text:
class CreateMembers < ActiveRecord::Migration
  def self.up
    create_table :members do |t|
      t.string :last_name
      t.string :first_name
      t.integer :district
      t.string :house, :limit => 1
      t.string :party, :limit => 1
      t.text :seat, :limit => 4
      t.string :vote_id_string
    end
  end

  def self.down
    drop_table :members
  end
end


text:
package com.epimorphics.registry.commands;

import static com.epimorphics.registry.webapi.Parameters.FIRST_PAGE;
import static com.epimorphics.registry.webapi.Parameters.PAGE_NUMBER;
import static com.epimorphics.registry.webapi.Parameters.VIEW;
import static com.epimorphics.registry.webapi.Parameters.WITH_METADATA;

import java.util.ArrayList;
import java.util.List;

import javax.ws.rs.core.MultivaluedMap;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.Response.Status;

import com.epimorphics.appbase.webapi.WebApiException;
import com.epimorphics.registry.core.Command;
import com.epimorphics.registry.core.RegisterItem;
import com.epimorphics.registry.core.Registry;
import com.epimorphics.registry.store.SearchRequest;
import com.epimorphics.registry.util.Prefixes;
import com.epimorphics.registry.webapi.Parameters;
import com.epimorphics.vocabs.API;
import org.apache.jena.rdf.model.Model;
import org.apache.jena.rdf.model.ModelFactory;
import org.apache.jena.rdf.model.RDFNode;
import org.apache.jena.rdf.model.Resource;
import org.apache.jena.vocabulary.RDFS;
import org.glassfish.jersey.internal.util.collection.MultivaluedStringMap;

public class CommandSearch extends Command {
    static int MAX_LEN = 1000;

    boolean withMetadata;

    public void init(Operation operation, String target,
            MultivaluedMap<String, String> parameters, Registry registry) {
        super.init(operation, target, parameters, registry);
        if (length == -1) {
            length = MAX_LEN;
        }
        withMetadata = hasParamValue(VIEW, WITH_METADATA);
        if (!paged) {
            this.parameters = new MultivaluedStringMap( parameters );
            this.parameters.put(FIRST_PAGE, new ArrayList<String>());
            paged = true;
            length = MAX_LEN;
        }
    }

    @Override
    public Response doExecute() {
        List<String> uris = store.search( extractSearchSpec() );
        Model result = ModelFactory.createDefaultModel();
        String resultURI = target + "?" + makeParamString(parameters, FIRST_PAGE, PAGE_NUMBER);
        Resource root = result.createResource( resultURI );
        RDFNode[] members = new RDFNode[uris.size()];
        int i = 0;
        for (String uri: uris) {
            RegisterItem ri = store.getItem(uri, true);
            Resource entity = ri.getEntity();
            if (entity == null) {
                throw new WebApiException(Status.INTERNAL_SERVER_ERROR, "No entity found for search result " + ri.getRoot());
            }
            result.add( entity.getModel() );
            if (withMetadata) {
                result.add( ri.getRoot().getModel() );
            }
            root.addProperty(RDFS.member, entity);
            members[i++] = entity;
        }
        Resource page = injectPagingInformation(result, root, uris.size() == length);
        page.addProperty(API.items, result.createList(members));

        return returnModel(result, resultURI);
    }

    protected SearchRequest extractSearchSpec() {
        SearchRequest request = new SearchRequest( parameters.getFirst(Parameters.QUERY) );
        request.setLimit(length).setOffset(pagenum * length);
        for (String key : parameters.keySet()) {
            if (key.equals(Parameters.QUERY) || key.startsWith("_")) continue;
            String value = parameters.getFirst(key);
            if (value != null && !value.isEmpty()) {
                if (key.equals(Parameters.STATUS)) {
                    request.setStatus(value);
                } else {
                    request.addFilter( Prefixes.getDefault().expandPrefix(key), value);
                }
            }
        }
        return request;
    }

}


text:
<?php
declare(strict_types=1);

namespace Cake\Database\Expression;

use Cake\Database\ExpressionInterface;
use Cake\Database\ValueBinder;
use Closure;
use RuntimeException;

/**
 * An expression that represents a common table expression definition.
 */
class CommonTableExpression implements ExpressionInterface
{
    /**
     * The CTE name.
     *
     * @var \Cake\Database\Expression\IdentifierExpression
     */
    protected $name;

    /**
     * The field names to use for the CTE.
     *
     * @var array<\Cake\Database\Expression\IdentifierExpression>
     */
    protected $fields = [];

    /**
     * The CTE query definition.
     *
     * @var \Cake\Database\ExpressionInterface|null
     */
    protected $query;

    /**
     * Whether the CTE is materialized or not materialized.
     *
     * @var string|null
     */
    protected $materialized = null;

    /**
     * Whether the CTE is recursive.
     *
     * @var bool
     */
    protected $recursive = false;

    /**
     * Constructor.
     *
     * @param string $name The CTE name.
     * @param \Cake\Database\ExpressionInterface|\Closure $query CTE query
     */
    public function __construct(string $name = '', $query = null)
    {
        $this->name = new IdentifierExpression($name);
        if ($query) {
            $this->query($query);
        }
    }

    /**
     * Sets the name of this CTE.
     *
     * This is the named you used to reference the expression
     * in select, insert, etc queries.
     *
     * @param string $name The CTE name.
     * @return $this
     */
    public function name(string $name)
    {
        $this->name = new IdentifierExpression($name);

        return $this;
    }

    /**
     * Sets the query for this CTE.
     *
     * @param \Cake\Database\ExpressionInterface|\Closure $query CTE query
     * @return $this
     */
    public function query($query)
    {
        if ($query instanceof Closure) {
            $query = $query();
            if (!($query instanceof ExpressionInterface)) {
                throw new RuntimeException(
                    'You must return an `ExpressionInterface` from a Closure passed to `query()`.'
                );
            }
        }
        $this->query = $query;

        return $this;
    }

    /**
     * Adds one or more fields (arguments) to the CTE.
     *
     * @param \Cake\Database\Expression\IdentifierExpression|array<\Cake\Database\Expression\IdentifierExpression>|array<string>|string $fields Field names
     * @return $this
     */
    public function field($fields)
    {
        $fields = (array)$fields;
        foreach ($fields as &$field) {
            if (!($field instanceof IdentifierExpression)) {
                $field = new IdentifierExpression($field);
            }
        }
        $this->fields = array_merge($this->fields, $fields);

        return $this;
    }

    /**
     * Sets this CTE as materialized.
     *
     * @return $this
     */
    public function materialized()
    {
        $this->materialized = 'MATERIALIZED';

        return $this;
    }

    /**
     * Sets this CTE as not materialized.
     *
     * @return $this
     */
    public function notMaterialized()
    {
        $this->materialized = 'NOT MATERIALIZED';

        return $this;
    }

    /**
     * Gets whether this CTE is recursive.
     *
     * @return bool
     */
    public function isRecursive(): bool
    {
        return $this->recursive;
    }

    /**
     * Sets this CTE as recursive.
     *
     * @return $this
     */
    public function recursive()
    {
        $this->recursive = true;

        return $this;
    }

    /**
     * @inheritDoc
     */
    public function sql(ValueBinder $binder): string
    {
        $fields = '';
        if ($this->fields) {
            $expressions = array_map(function (IdentifierExpression $e) use ($binder) {
                return $e->sql($binder);
            }, $this->fields);
            $fields = sprintf('(%s)', implode(', ', $expressions));
        }

        $suffix = $this->materialized ? $this->materialized . ' ' : '';

        return sprintf(
            '%s%s AS %s(%s)',
            $this->name->sql($binder),
            $fields,
            $suffix,
            $this->query ? $this->query->sql($binder) : ''
        );
    }

    /**
     * @inheritDoc
     */
    public function traverse(Closure $callback)
    {
        $callback($this->name);
        foreach ($this->fields as $field) {
            $callback($field);
            $field->traverse($callback);
        }

        if ($this->query) {
            $callback($this->query);
            $this->query->traverse($callback);
        }

        return $this;
    }

    /**
     * Clones the inner expression objects.
     *
     * @return void
     */
    public function __clone()
    {
        $this->name = clone $this->name;
        if ($this->query) {
            $this->query = clone $this->query;
        }

        foreach ($this->fields as $key => $field) {
            $this->fields[$key] = clone $field;
        }
    }
}


text:
<?php

namespace Symfony\Bundle\FrameworkBundle\Routing;

use Symfony\Component\Routing\Loader\AnnotationClassLoader;
use Symfony\Component\Routing\Route;

/**
 * AnnotatedRouteControllerLoader is an implementation of AnnotationClassLoader
 * that sets the '_controller' default based on the class and method names.
 *
 * @author Fabien Potencier <fabien@symfony.com>
 */
class AnnotatedRouteControllerLoader extends AnnotationClassLoader
{
    /**
     * Configures the _controller default parameter of a given Route instance.
     */
    protected function configureRoute(Route $route, \ReflectionClass $class, \ReflectionMethod $method, object $annot)
    {
        if ('__invoke' === $method->getName()) {
            $route->setDefault('_controller', $class->getName());
        } else {
            $route->setDefault('_controller', $class->getName().'::'.$method->getName());
        }
    }

    /**
     * Makes the default route name more sane by removing common keywords.
     *
     * @return string
     */
    protected function getDefaultRouteName(\ReflectionClass $class, \ReflectionMethod $method)
    {
        $name = preg_replace('/(bundle|controller)_/', '_', parent::getDefaultRouteName($class, $method));

        if (str_ends_with($method->name, 'Action') || str_ends_with($method->name, '_action')) {
            $name = preg_replace('/action(_\d+)?$/', '\\1', $name);
        }

        return str_replace('__', '_', $name);
    }
}


text:
#import <IDEKit/IDEAlertViewController.h>

#import "NSOpenSavePanelDelegate.h"

@class NSMutableArray, NSPopUpButton, NSString;

@interface IDERunScriptAlertViewController : IDEAlertViewController <NSOpenSavePanelDelegate>
{
    NSPopUpButton *_scriptPopUpButton;
    NSMutableArray *_recentScripts;
}

- (void).cxx_destruct;
- (id)_stringForPath:(id)arg1;
- (void)addPathToRecentScripts:(id)arg1;
- (void)awakeFromNib;
- (void)chooseScript:(id)arg1;
- (BOOL)panel:(id)arg1 shouldEnableURL:(id)arg2;
- (void)populatePopUpButton;
@property(retain) NSPopUpButton *scriptPopUpButton; // @synthesize scriptPopUpButton=_scriptPopUpButton;
- (void)selectScript:(id)arg1;
- (void)setAlert:(id)arg1;

// Remaining properties
@property(readonly, copy) NSString *debugDescription;
@property(readonly, copy) NSString *description;
@property(readonly) unsigned long long hash;
@property(readonly) Class superclass;

@end


text:
from django.db import migrations

class Migration(migrations.Migration):

    dependencies = [
        ('museum_site', '0054_auto_20210524_2216'),
    ]

    operations = [
        migrations.RenameField(
            model_name='profile',
            old_name='activation',
            new_name='activation_token',
        ),
    ]


text:
package net.runelite.client.input;

import java.awt.event.MouseWheelEvent;

public interface MouseWheelListener
{
	MouseWheelEvent mouseWheelMoved(MouseWheelEvent event);
}


text:
package org.apache.ignite.cache.store;

import org.apache.ignite.*;
import org.apache.ignite.cache.*;
import org.apache.ignite.configuration.*;
import org.apache.ignite.internal.processors.cache.*;
import org.apache.ignite.lang.*;
import org.jetbrains.annotations.*;

import javax.cache.*;
import javax.cache.expiry.*;
import javax.cache.integration.*;
import java.util.*;

import static java.util.concurrent.TimeUnit.*;
import static org.apache.ignite.cache.CacheMode.*;

/**
 * Test check that cache values removes from cache on expiry.
 */
public class IgniteCacheExpiryStoreLoadSelfTest extends GridCacheAbstractSelfTest {
    /** Expected time to live in milliseconds. */
    private static final int TIME_TO_LIVE = 1000;

    /** Additional time to wait expiry process in milliseconds. */
    private static final int WAIT_TIME = 500;

    /** {@inheritDoc} */
    @Override protected int gridCount() {
        return 3;
    }

    /** {@inheritDoc} */
    @Override protected CacheMode cacheMode() {
        return PARTITIONED;
    }

    /** {@inheritDoc} */
    @SuppressWarnings("unchecked")
    @Override protected CacheConfiguration cacheConfiguration(String gridName) throws Exception {
        CacheConfiguration cfg = super.cacheConfiguration(gridName);

        cfg.setCacheStoreFactory(singletonFactory(new TestStore()));
        cfg.setReadThrough(true);
        cfg.setWriteThrough(true);
        cfg.setLoadPreviousValue(true);

        return cfg;
    }

    /**
     * @throws Exception If failed.
     */
    public void testLoadCacheWithExpiry() throws Exception {
        checkLoad(false);
    }

    /**
     * @throws Exception If failed.
     */
    public void testLoadCacheWithExpiryAsync() throws Exception {
        checkLoad(true);
    }

    /**
     * @param async If {@code true} uses asynchronous method.
     * @throws Exception If failed.
     */
    private void checkLoad(boolean async) throws Exception {
        IgniteCache<String, Integer> cache = jcache(0)
           .withExpiryPolicy(new CreatedExpiryPolicy(new Duration(MILLISECONDS, TIME_TO_LIVE)));

         List<Integer> keys = new ArrayList<>();

        keys.add(primaryKey(jcache(0)));
        keys.add(primaryKey(jcache(1)));
        keys.add(primaryKey(jcache(2)));

        if (async) {
            IgniteCache<String, Integer> asyncCache = cache.withAsync();

            asyncCache.loadCache(null, keys.toArray(new Integer[3]));

            asyncCache.future().get();
        }
        else
            cache.loadCache(null, keys.toArray(new Integer[3]));

        assertEquals(3, cache.size(CachePeekMode.PRIMARY));

        Thread.sleep(TIME_TO_LIVE + WAIT_TIME);

        assertEquals(0, cache.size());
    }

    /**
     * @throws Exception If failed.
     */
    public void testLocalLoadCacheWithExpiry() throws Exception {
        checkLocalLoad(false);
    }

    /**
     * @throws Exception If failed.
     */
    public void testLocalLoadCacheWithExpiryAsync() throws Exception {
        checkLocalLoad(true);
    }

    /**
     * @param async If {@code true} uses asynchronous method.
     * @throws Exception If failed.
     */
    private void checkLocalLoad(boolean async) throws Exception {
        IgniteCache<String, Integer> cache = jcache(0)
            .withExpiryPolicy(new CreatedExpiryPolicy(new Duration(MILLISECONDS, TIME_TO_LIVE)));

        List<Integer> keys = primaryKeys(cache, 3);

        if (async) {
            IgniteCache<String, Integer> asyncCache = cache.withAsync();

            asyncCache.localLoadCache(null, keys.toArray(new Integer[3]));

            asyncCache.future().get();
        }
        else
            cache.localLoadCache(null, keys.toArray(new Integer[3]));

        assertEquals(3, cache.localSize());

        Thread.sleep(TIME_TO_LIVE + WAIT_TIME);

        assertEquals(0, cache.localSize());
    }

    /**
     * @throws Exception If failed.
     */
    public void testLoadAllWithExpiry() throws Exception {
        IgniteCache<Integer, Integer> cache = ignite(0).<Integer, Integer>cache(null)
            .withExpiryPolicy(new CreatedExpiryPolicy(new Duration(MILLISECONDS, TIME_TO_LIVE)));

        Set<Integer> keys = new HashSet<>();

        keys.add(primaryKey(jcache(0)));
        keys.add(primaryKey(jcache(1)));
        keys.add(primaryKey(jcache(2)));

        CompletionListenerFuture fut = new CompletionListenerFuture();

        cache.loadAll(keys, false, fut);

        fut.get();

        assertEquals(3, cache.size(CachePeekMode.PRIMARY));

        Thread.sleep(TIME_TO_LIVE + WAIT_TIME);

        assertEquals(0, cache.size());
    }

    /**
     * Test cache store.
     */
    private static class TestStore implements CacheStore<Integer, Integer> {
        /** {@inheritDoc} */
        @Override public void loadCache(IgniteBiInClosure<Integer, Integer> clo,
            @Nullable Object... args) throws CacheLoaderException {
            assertNotNull(args);
            assertTrue(args.length > 0);

            for (Object arg : args) {
                Integer k = (Integer)arg;

                clo.apply(k, k);
            }
        }

        /** {@inheritDoc} */
        @Override public void sessionEnd(boolean commit) throws CacheWriterException {
            // No-op.
        }

        /** {@inheritDoc} */
        @Override public Integer load(Integer key) throws CacheLoaderException {
            return key;
        }

        /** {@inheritDoc} */
        @Override public Map<Integer, Integer> loadAll(Iterable<? extends Integer> keys) {
            Map<Integer, Integer> map = new HashMap<>();

            for (Integer key : keys)
                map.put(key, key);

            return map;
        }

        /** {@inheritDoc} */
        @Override public void write(Cache.Entry<? extends Integer, ? extends Integer> entry) {
            // No-op.
        }

        /** {@inheritDoc} */
        @Override public void writeAll(Collection<Cache.Entry<? extends Integer, ? extends Integer>> entries) {
            // No-op.
        }

        /** {@inheritDoc} */
        @Override public void delete(Object key) {
            // No-op.
        }

        /** {@inheritDoc} */
        @Override public void deleteAll(Collection<?> keys) {
            // No-op.
        }
    }
}


text:
using System;
using System.Collections.Generic;
using NUnit.Framework;
using osu.Framework.Allocation;
using osu.Game.Rulesets.Osu;
using osu.Game.Screens.Edit.Screens.Compose;
using osu.Game.Tests.Beatmaps;

namespace osu.Game.Tests.Visual
{
    [TestFixture]
    public class TestCaseEditorCompose : EditorClockTestCase
    {
        public override IReadOnlyList<Type> RequiredTypes => new[] { typeof(Compose) };

        [BackgroundDependencyLoader]
        private void load(OsuGameBase osuGame)
        {
            osuGame.Beatmap.Value = new TestWorkingBeatmap(new OsuRuleset().RulesetInfo);

            var compose = new Compose();
            compose.Beatmap.BindTo(osuGame.Beatmap);

            Child = compose;
        }
    }
}


text:
dromelvan-persistence
=====================

Persistance layer for D11 Java application.


text:
<?php
/**
 * Created by phpNT.
 * User: phpNT
 * Date: 01.03.2016
 * Time: 11:12
 */

namespace common\models;

use frontend\modules\terminals\models\TTerminal;
use Yii;
use yii\base\Model;
use yii\data\ActiveDataProvider;

class TTerminalSearch  extends TTerminal
{
    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['is_feature'], 'integer'],
        ];
    }

    /**
     * @inheritdoc
     */
    public function scenarios()
    {
        // bypass scenarios() implementation in the parent class
        return Model::scenarios();
    }

    /**
     * Creates data provider instance with search query applied
     *
     * @param array $params
     *
     * @return ActiveDataProvider
     */
    public function search($params)
    {
        $query = TTerminal::find()
            ->where(['is_feature' => true])
            ->orderBy([
                'id_terminal' => SORT_DESC]);;

        $dataProvider = new ActiveDataProvider([
            'query' => $query,
            'pagination' => [
                'pageSize' => 9,
            ],
            /*'sort' => [
                'defaultOrder' => [
                    'created_at' => SORT_DESC,
                    'title' => SORT_ASC,
                ]
            ],*/
        ]);

        $this->load($params);

        if (!$this->validate()) {
            // uncomment the following line if you do not want to return any records when validation fails
            // $query->where('0=1');
            return $dataProvider;
        }

        /*$query->andFilterWhere([
            'is' => $this->id,
        ]);*/

        return $dataProvider;
    }
}