text:
package org.apache.spark.graphx.lib

import org.apache.spark.SparkFunSuite
import org.apache.spark.graphx._
import org.apache.spark.graphx.util.GraphGenerators

object GridPageRank {
  def apply(nRows: Int, nCols: Int, nIter: Int, resetProb: Double): Seq[(VertexId, Double)] = {
    val inNbrs = Array.fill(nRows * nCols)(collection.mutable.ArrayBuffer.empty[Int])
    val outDegree = Array.fill(nRows * nCols)(0)
    // Convert row column address into vertex ids (row major order)
    def sub2ind(r: Int, c: Int): Int = r * nCols + c
    // Make the grid graph
    for (r <- 0 until nRows; c <- 0 until nCols) {
      val ind = sub2ind(r, c)
      if (r + 1 < nRows) {
        outDegree(ind) += 1
        inNbrs(sub2ind(r + 1, c)) += ind
      }
      if (c + 1 < nCols) {
        outDegree(ind) += 1
        inNbrs(sub2ind(r, c + 1)) += ind
      }
    }
    // compute the pagerank
    var pr = Array.fill(nRows * nCols)(1.0)
    for (iter <- 0 until nIter) {
      val oldPr = pr
      pr = new Array[Double](nRows * nCols)
      for (ind <- 0 until (nRows * nCols)) {
        pr(ind) = resetProb + (1.0 - resetProb) *
          inNbrs(ind).map( nbr => oldPr(nbr) / outDegree(nbr)).sum
      }
    }
    val prSum = pr.sum
    (0L until (nRows * nCols)).zip(pr.map(_ * pr.length / prSum))
  }

}

class PageRankSuite extends SparkFunSuite with LocalSparkContext {

  def compareRanks(a: VertexRDD[Double], b: VertexRDD[Double]): Double = {
    a.leftJoin(b) { case (id, a, bOpt) => (a - bOpt.getOrElse(0.0)) * (a - bOpt.getOrElse(0.0)) }
      .map { case (id, error) => error }.sum()
  }

  def convergenceIterations[VD, ED](graph: Graph[VD, ED], resetProb: Double,
                                    tol: Double, errorTol: Double): (Int, Int) = {
    val dynamicRanks = graph.ops.pageRank(tol, resetProb).vertices.cache()

    // Compute how many iterations it takes to converge
    var iter = 1
    var staticGraphRank = graph.ops.staticPageRank(iter, resetProb).vertices.cache()
    while (!(compareRanks(staticGraphRank, dynamicRanks) < errorTol)) {
      iter += 1
      staticGraphRank = graph.ops.staticPageRank(iter, resetProb).vertices.cache()
    }
    val convergenceIter = iter
    val checkPointIter = convergenceIter / 2

    // CheckPoint the graph computed at half of these iterations
    val staticGraphRankPartial = graph.ops.staticPageRank(checkPointIter, resetProb)

    // Compute how many iterations it takes to converge when a checkPoint is provided
    var iterWithCheckPoint = 1
    var staticGraphRankWithCheckPoint = graph.ops.staticPageRank(iterWithCheckPoint,
      resetProb, staticGraphRankPartial).vertices.cache()
    while (compareRanks(staticGraphRankWithCheckPoint, dynamicRanks) >= errorTol) {
      iterWithCheckPoint += 1
      staticGraphRankWithCheckPoint = graph.ops.staticPageRank(iterWithCheckPoint,
        resetProb, staticGraphRankPartial).vertices.cache()
    }

    val convergenceIterWithCheckPoint = iterWithCheckPoint

    (convergenceIterWithCheckPoint, convergenceIter)
  }

  test("Star PageRank") {
    withSpark { sc =>
      val nVertices = 100
      val starGraph = GraphGenerators.starGraph(sc, nVertices).cache()
      val resetProb = 0.15
      val tol = 0.0001
      val numIter = 2
      val errorTol = 1.0e-5

      val staticRanks = starGraph.staticPageRank(numIter, resetProb).vertices.cache()
      val staticRanks2 = starGraph.staticPageRank(numIter + 1, resetProb).vertices

      // Static PageRank should only take 2 iterations to converge
      val notMatching = staticRanks.innerZipJoin(staticRanks2) { (vid, pr1, pr2) =>
        if (pr1 != pr2) 1 else 0
      }.map { case (vid, test) => test }.sum()
      assert(notMatching === 0)

      val dynamicRanks = starGraph.pageRank(tol, resetProb).vertices.cache()
      assert(compareRanks(staticRanks, dynamicRanks) < errorTol)

      // Computed in igraph 1.0 w/ R bindings:
      // > page_rank(make_star(100, mode = "in"))
      // Alternatively in NetworkX 1.11:
      // > nx.pagerank(nx.DiGraph([(x, 0) for x in range(1,100)]))
      // We multiply by the number of vertices to account for difference in normalization
      val centerRank = 0.462394787 * nVertices
      val othersRank = 0.005430356 * nVertices
      val igraphPR = centerRank +: Seq.fill(nVertices - 1)(othersRank)
      val ranks = VertexRDD(sc.parallelize(0L until nVertices zip igraphPR))
      assert(compareRanks(staticRanks, ranks) < errorTol)
      assert(compareRanks(dynamicRanks, ranks) < errorTol)

    }
  } // end of test Star PageRank

  test("Star PersonalPageRank") {
    withSpark { sc =>
      val nVertices = 100
      val starGraph = GraphGenerators.starGraph(sc, nVertices).cache()
      val resetProb = 0.15
      val tol = 0.0001
      val numIter = 2
      val errorTol = 1.0e-5

      val staticRanks = starGraph.staticPersonalizedPageRank(0, numIter, resetProb).vertices.cache()

      val dynamicRanks = starGraph.personalizedPageRank(0, tol, resetProb).vertices.cache()
      assert(compareRanks(staticRanks, dynamicRanks) < errorTol)

      val parallelStaticRanks = starGraph
        .staticParallelPersonalizedPageRank(Array(0), numIter, resetProb).mapVertices {
          case (vertexId, vector) => vector(0)
        }.vertices.cache()
      assert(compareRanks(staticRanks, parallelStaticRanks) < errorTol)

      // Computed in igraph 1.0 w/ R bindings:
      // > page_rank(make_star(100, mode = "in"),  personalized = c(1, rep(0, 99)), algo = "arpack")
      // NOTE: We use the arpack algorithm as prpack (the default) redistributes rank to all
      // vertices uniformly instead of just to the personalization source.
      // Alternatively in NetworkX 1.11:
      // > nx.pagerank(nx.DiGraph([(x, 0) for x in range(1,100)]),
      //   personalization=dict([(x, 1 if x == 0 else 0) for x in range(0,100)]))
      // We multiply by the number of vertices to account for difference in normalization
      val igraphPR0 = 1.0 +: Seq.fill(nVertices - 1)(0.0)
      val ranks0 = VertexRDD(sc.parallelize(0L until nVertices zip igraphPR0))
      assert(compareRanks(staticRanks, ranks0) < errorTol)
      assert(compareRanks(dynamicRanks, ranks0) < errorTol)

      // We have one outbound edge from 1 to 0
      val otherStaticRanks = starGraph.staticPersonalizedPageRank(1, numIter, resetProb)
        .vertices.cache()
      val otherDynamicRanks = starGraph.personalizedPageRank(1, tol, resetProb).vertices.cache()
      val otherParallelStaticRanks = starGraph
        .staticParallelPersonalizedPageRank(Array(0, 1), numIter, resetProb).mapVertices {
          case (vertexId, vector) => vector(1)
        }.vertices.cache()
      assert(compareRanks(otherDynamicRanks, otherStaticRanks) < errorTol)
      assert(compareRanks(otherStaticRanks, otherParallelStaticRanks) < errorTol)
      assert(compareRanks(otherDynamicRanks, otherParallelStaticRanks) < errorTol)

      // Computed in igraph 1.0 w/ R bindings:
      // > page_rank(make_star(100, mode = "in"),
      //   personalized = c(0, 1, rep(0, 98)), algo = "arpack")
      // NOTE: We use the arpack algorithm as prpack (the default) redistributes rank to all
      // vertices uniformly instead of just to the personalization source.
      // Alternatively in NetworkX 1.11:
      // > nx.pagerank(nx.DiGraph([(x, 0) for x in range(1,100)]),
      //   personalization=dict([(x, 1 if x == 1 else 0) for x in range(0,100)]))
      val centerRank = 0.4594595
      val sourceRank = 0.5405405
      val igraphPR1 = centerRank +: sourceRank +: Seq.fill(nVertices - 2)(0.0)
      val ranks1 = VertexRDD(sc.parallelize(0L until nVertices zip igraphPR1))
      assert(compareRanks(otherStaticRanks, ranks1) < errorTol)
      assert(compareRanks(otherDynamicRanks, ranks1) < errorTol)
      assert(compareRanks(otherParallelStaticRanks, ranks1) < errorTol)
    }
  } // end of test Star PersonalPageRank

  test("Grid PageRank") {
    withSpark { sc =>
      val rows = 10
      val cols = 10
      val resetProb = 0.15
      val tol = 0.0001
      val numIter = 50
      val errorTol = 1.0e-5
      val gridGraph = GraphGenerators.gridGraph(sc, rows, cols).cache()

      val staticRanks = gridGraph.staticPageRank(numIter, resetProb).vertices.cache()
      val dynamicRanks = gridGraph.pageRank(tol, resetProb).vertices.cache()
      val referenceRanks = VertexRDD(
        sc.parallelize(GridPageRank(rows, cols, numIter, resetProb))).cache()

      assert(compareRanks(staticRanks, referenceRanks) < errorTol)
      assert(compareRanks(dynamicRanks, referenceRanks) < errorTol)
    }
  } // end of Grid PageRank

  test("Grid PageRank with checkpoint") {
    withSpark { sc =>
      // Check that checkPointing helps the static PageRank to converge in less iterations
      val rows = 10
      val cols = 10
      val resetProb = 0.15
      val errorTol = 1.0e-5
      val tol = 0.0001
      val gridGraph = GraphGenerators.gridGraph(sc, rows, cols).cache()

      val (iterAfterHalfCheckPoint, totalIters) =
        convergenceIterations(gridGraph, resetProb, tol, errorTol)

      // In this case checkPoint does not help much
      assert(totalIters == 19)
      assert(iterAfterHalfCheckPoint == 18)
    }
  } // end of Grid PageRank

  test("Chain PageRank") {
    withSpark { sc =>
      val chain1 = (0 until 9).map(x => (x, x + 1))
      val rawEdges = sc.parallelize(chain1, 1).map { case (s, d) => (s.toLong, d.toLong) }
      val chain = Graph.fromEdgeTuples(rawEdges, 1.0).cache()
      val resetProb = 0.15
      val tol = 0.0001
      val numIter = 10
      val errorTol = 1.0e-5

      val staticRanks = chain.staticPageRank(numIter, resetProb).vertices
      val dynamicRanks = chain.pageRank(tol, resetProb).vertices

      assert(compareRanks(staticRanks, dynamicRanks) < errorTol)
    }
  }

  test("Chain PageRank with checkpoint") {
    withSpark { sc =>
      val chain1 = (0 until 9).map(x => (x, x + 1))
      val rawEdges = sc.parallelize(chain1, 1).map { case (s, d) => (s.toLong, d.toLong) }
      val chain = Graph.fromEdgeTuples(rawEdges, 1.0).cache()
      val resetProb = 0.15
      val errorTol = 1.0e-5
      val tol = 0.0001

      val (iterAfterHalfCheckPoint, totalIters) =
        convergenceIterations(chain, resetProb, tol, errorTol)

      // In this case checkPoint does not help but it does not take more iterations
      assert(totalIters == 10)
      assert(iterAfterHalfCheckPoint == 10)
    }
  } // end of Grid PageRank

  test("Chain PersonalizedPageRank") {
    withSpark { sc =>
      // Check that implementation can handle large vertexIds, SPARK-25149
      val vertexIdOffset = Int.MaxValue.toLong + 1
      val sourceOffest = 4
      val source = vertexIdOffset + sourceOffest
      val numIter = 10
      val vertices = vertexIdOffset until vertexIdOffset + numIter
      val chain1 = vertices.zip(vertices.tail)
      val rawEdges = sc.parallelize(chain1, 1).map { case (s, d) => (s.toLong, d.toLong) }
      val chain = Graph.fromEdgeTuples(rawEdges, 1.0).cache()
      val resetProb = 0.15
      val tol = 0.0001
      val errorTol = 1.0e-1

      val a = resetProb / (1 - Math.pow(1 - resetProb, numIter - sourceOffest))
      // We expect the rank to decay as (1 - resetProb) ^ distance
      val expectedRanks = sc.parallelize(vertices).map { vid =>
        val rank = if (vid < source) {
          0.0
        } else {
          a * Math.pow(1 - resetProb, vid - source)
        }
        vid -> rank
      }
      val expected = VertexRDD(expectedRanks)

      val staticRanks = chain.staticPersonalizedPageRank(source, numIter, resetProb).vertices
      assert(compareRanks(staticRanks, expected) < errorTol)

      val dynamicRanks = chain.personalizedPageRank(source, tol, resetProb).vertices
      assert(compareRanks(dynamicRanks, expected) < errorTol)

      val parallelStaticRanks = chain
        .staticParallelPersonalizedPageRank(Array(source), numIter, resetProb).mapVertices {
          case (vertexId, vector) => vector(0)
        }.vertices.cache()
      assert(compareRanks(parallelStaticRanks, expected) < errorTol)
    }
  }

  test("Loop with source PageRank") {
    withSpark { sc =>
      val edges = sc.parallelize((1L, 2L) :: (2L, 3L) :: (3L, 4L) :: (4L, 2L) :: Nil)
      val g = Graph.fromEdgeTuples(edges, 1)
      val resetProb = 0.15
      val tol = 0.0001
      val numIter = 50
      val errorTol = 1.0e-5

      val staticRanks = g.staticPageRank(numIter, resetProb).vertices
      val dynamicRanks = g.pageRank(tol, resetProb).vertices
      assert(compareRanks(staticRanks, dynamicRanks) < errorTol)

      // Computed in igraph 1.0 w/ R bindings:
      // > page_rank(graph_from_literal( A -+ B -+ C -+ D -+ B))
      // Alternatively in NetworkX 1.11:
      // > nx.pagerank(nx.DiGraph([(1,2),(2,3),(3,4),(4,2)]))
      // We multiply by the number of vertices to account for difference in normalization
      val igraphPR = Seq(0.0375000, 0.3326045, 0.3202138, 0.3096817).map(_ * 4)
      val ranks = VertexRDD(sc.parallelize(1L to 4L zip igraphPR))
      assert(compareRanks(staticRanks, ranks) < errorTol)
      assert(compareRanks(dynamicRanks, ranks) < errorTol)
    }
  }

  test("Loop with source PageRank with checkpoint") {
    withSpark { sc =>
      val edges = sc.parallelize((1L, 2L) :: (2L, 3L) :: (3L, 4L) :: (4L, 2L) :: Nil)
      val g = Graph.fromEdgeTuples(edges, 1)
      val resetProb = 0.15
      val tol = 0.0001
      val errorTol = 1.0e-5

      val (iterAfterHalfCheckPoint, totalIters) =
        convergenceIterations(g, resetProb, tol, errorTol)

      // In this case checkPoint helps a lot
      assert(totalIters == 34)
      assert(iterAfterHalfCheckPoint == 17)
    }
  }

  test("Loop with sink PageRank") {
    withSpark { sc =>
      val edges = sc.parallelize((1L, 2L) :: (2L, 3L) :: (3L, 1L) :: (1L, 4L) :: Nil)
      val g = Graph.fromEdgeTuples(edges, 1)
      val resetProb = 0.15
      val tol = 0.0001
      val numIter = 20
      val errorTol = 1.0e-5

      val staticRanks = g.staticPageRank(numIter, resetProb).vertices.cache()
      val dynamicRanks = g.pageRank(tol, resetProb).vertices.cache()

      assert(compareRanks(staticRanks, dynamicRanks) < errorTol)

      // Computed in igraph 1.0 w/ R bindings:
      // > page_rank(graph_from_literal( A -+ B -+ C -+ A -+ D))
      // Alternatively in NetworkX 1.11:
      // > nx.pagerank(nx.DiGraph([(1,2),(2,3),(3,1),(1,4)]))
      // We multiply by the number of vertices to account for difference in normalization
      val igraphPR = Seq(0.3078534, 0.2137622, 0.2646223, 0.2137622).map(_ * 4)
      val ranks = VertexRDD(sc.parallelize(1L to 4L zip igraphPR))
      assert(compareRanks(staticRanks, ranks) < errorTol)
      assert(compareRanks(dynamicRanks, ranks) < errorTol)

      val p1staticRanks = g.staticPersonalizedPageRank(1, numIter, resetProb).vertices.cache()
      val p1dynamicRanks = g.personalizedPageRank(1, tol, resetProb).vertices.cache()
      val p1parallelDynamicRanks =
        g.staticParallelPersonalizedPageRank(Array(1, 2, 3, 4), numIter, resetProb)
        .vertices.mapValues(v => v(0)).cache()

      // Computed in igraph 1.0 w/ R bindings:
      // > page_rank(graph_from_literal( A -+ B -+ C -+ A -+ D), personalized = c(1, 0, 0, 0),
      //   algo = "arpack")
      // NOTE: We use the arpack algorithm as prpack (the default) redistributes rank to all
      // vertices uniformly instead of just to the personalization source.
      // Alternatively in NetworkX 1.11:
      // > nx.pagerank(nx.DiGraph([(1,2),(2,3),(3,1),(1,4)]), personalization={1:1, 2:0, 3:0, 4:0})
      val igraphPR2 = Seq(0.4522329, 0.1921990, 0.1633691, 0.1921990)
      val ranks2 = VertexRDD(sc.parallelize(1L to 4L zip igraphPR2))
      assert(compareRanks(p1staticRanks, ranks2) < errorTol)
      assert(compareRanks(p1dynamicRanks, ranks2) < errorTol)
      assert(compareRanks(p1parallelDynamicRanks, ranks2) < errorTol)

    }
  }

  test("Loop with sink PageRank with checkpoint") {
    withSpark { sc =>
      val edges = sc.parallelize((1L, 2L) :: (2L, 3L) :: (3L, 1L) :: (1L, 4L) :: Nil)
      val g = Graph.fromEdgeTuples(edges, 1)
      val resetProb = 0.15
      val tol = 0.0001
      val errorTol = 1.0e-5

      val (iterAfterHalfCheckPoint, totalIters) =
        convergenceIterations(g, resetProb, tol, errorTol)

      // In this case checkPoint helps a lot
      assert(totalIters == 15)
      assert(iterAfterHalfCheckPoint == 9)
    }
  }
}


text:
/* global define, module, require, exports */

(function (root, factory) {
    if (typeof define === 'function' && define.amd) {
        define(['jquery',
                'd3',
                'nf.ErrorHandler',
                'nf.Common',
                'nf.Dialog',
                'nf.Storage',
                'nf.Client',
                'nf.ProcessGroup',
                'nf.Shell',
                'nf.CanvasUtils'],
            function ($, d3, nfErrorHandler, nfCommon, nfDialog, nfStorage, nfClient, nfProcessGroup, nfShell, nfCanvasUtils) {
                return (nf.ProcessGroupConfiguration = factory($, d3, nfErrorHandler, nfCommon, nfDialog, nfStorage, nfClient, nfProcessGroup, nfShell, nfCanvasUtils));
            });
    } else if (typeof exports === 'object' && typeof module === 'object') {
        module.exports = (nf.ProcessGroupConfiguration =
            factory(require('jquery'),
                require('d3'),
                require('nf.ErrorHandler'),
                require('nf.Common'),
                require('nf.Dialog'),
                require('nf.Storage'),
                require('nf.Client'),
                require('nf.ProcessGroup'),
                require('nf.Shell'),
                require('nf.CanvasUtils')));
    } else {
        nf.ProcessGroupConfiguration = factory(root.$,
            root.d3,
            root.nf.ErrorHandler,
            root.nf.Common,
            root.nf.Dialog,
            root.nf.Storage,
            root.nf.Client,
            root.nf.ProcessGroup,
            root.nf.Shell,
            root.nf.CanvasUtils);
    }
}(this, function ($, d3, nfErrorHandler, nfCommon, nfDialog, nfStorage, nfClient, nfProcessGroup, nfShell, nfCanvasUtils) {
    'use strict';

    var nfControllerServices;
    var nfParameterContexts;

    var config = {
        urls: {
            api: '../nifi-api',
            parameterContexts: '../nifi-api/flow/parameter-contexts'
        }
    };

    /**
     * Initializes the general tab.
     */
    var initGeneral = function () {
    };

    /**
     * Gets the controller services table.
     *
     * @returns {*|jQuery|HTMLElement}
     */
    var getControllerServicesTable = function () {
        return $('#process-group-controller-services-table');
    };

    /**
     * Saves the configuration for the specified group.
     *
     * @param version
     * @param groupId
     */
    var saveConfiguration = function (version, groupId) {
        // build the entity
        var entity = {
            'revision': nfClient.getRevision({
                'revision': {
                    'version': version
                }
            }),
            'disconnectedNodeAcknowledged': nfStorage.isDisconnectionAcknowledged(),
            'component': {
                'id': groupId,
                'name': $('#process-group-name').val(),
                'comments': $('#process-group-comments').val(),
                'parameterContext': {
                    'id': $('#process-group-parameter-context-combo').combo('getSelectedOption').value
                }
            }
        };

        // update the selected component
        $.ajax({
            type: 'PUT',
            data: JSON.stringify(entity),
            url: config.urls.api + '/process-groups/' + encodeURIComponent(groupId),
            dataType: 'json',
            contentType: 'application/json'
        }).done(function (response) {
            // refresh the process group if necessary
            if (response.permissions.canRead && response.component.parentGroupId === nfCanvasUtils.getGroupId()) {
                nfProcessGroup.set(response);
            }

            // show the result dialog
            nfDialog.showOkDialog({
                headerText: 'Process Group Configuration',
                dialogContent: 'Process group configuration successfully saved.'
            });

            // update the click listener for the updated revision
            $('#process-group-configuration-save').off('click').on('click', function () {
                saveConfiguration(response.revision.version, groupId);
            });

            var controllerServicesUri = config.urls.api + '/flow/process-groups/' + encodeURIComponent(groupId) + '/controller-services';

            $.ajax({
                type: 'GET',
                url: controllerServicesUri,
                dataType: 'json'
            }).done(function (response) {
                var serviceTable = getControllerServicesTable();

                nfCommon.cleanUpTooltips(serviceTable, 'div.has-errors');

                var controllerServicesGrid = serviceTable.data('gridInstance');
                var controllerServicesData = controllerServicesGrid.getData();

                $.each(response.controllerServices, function (_, controllerServiceEntity) {
                    controllerServicesData.updateItem(controllerServiceEntity.id, controllerServiceEntity);
                });
            });

            nfCanvasUtils.reload();
        }).fail(nfErrorHandler.handleConfigurationUpdateAjaxError);
    };

    /**
     * Loads the configuration for the specified process group.
     *
     * @param {string} groupId
     */
    var loadConfiguration = function (groupId) {
        var setUnauthorizedText = function () {
            $('#read-only-process-group-name').text('Unauthorized');
            $('#read-only-process-group-comments').text('Unauthorized');
        };

        var setEditable = function (editable) {
            if (editable) {
                $('#process-group-configuration div.editable').show();
                $('#process-group-configuration div.read-only').hide();
                $('#process-group-configuration-save').show();
            } else {
                $('#process-group-configuration div.editable').hide();
                $('#process-group-configuration div.read-only').show();
                $('#process-group-configuration-save').hide();
            }
        };

        // record the group id
        $('#process-group-id').text(groupId);

        // update the click listener
        $('#process-group-configuration-refresh-button').off('click').on('click', function () {
            loadConfiguration(groupId);
        });

        // update the new controller service click listener
        $('#add-process-group-configuration-controller-service').off('click').on('click', function () {
            var selectedTab = $('#process-group-configuration-tabs li.selected-tab').text();
            if (selectedTab === 'Controller Services') {
                var controllerServicesUri = config.urls.api + '/process-groups/' + encodeURIComponent(groupId) + '/controller-services';
                nfControllerServices.promptNewControllerService(controllerServicesUri, getControllerServicesTable());
            }
        });

        var processGroup = $.Deferred(function (deferred) {
            $.ajax({
                type: 'GET',
                url: config.urls.api + '/process-groups/' + encodeURIComponent(groupId),
                dataType: 'json'
            }).done(function (response) {
                // store the process group
                $('#process-group-configuration').data('process-group', response);

                var processGroup = response.component;

                if (response.permissions.canWrite) {

                    // populate the process group settings
                    $('#process-group-name').removeClass('unset').val(processGroup.name);
                    $('#process-group-comments').removeClass('unset').val(processGroup.comments);

                    // populate the header
                    $('#process-group-configuration-header-text').text(processGroup.name + ' Configuration');

                    setEditable(true);

                    // register the click listener for the save button
                    $('#process-group-configuration-save').off('click').on('click', function () {
                        saveConfiguration(response.revision.version, response.id);
                    });
                } else {
                    if (response.permissions.canRead) {
                        // populate the process group settings
                        $('#read-only-process-group-name').text(processGroup.name);
                        $('#read-only-process-group-comments').text(processGroup.comments);

                        // populate the header
                        $('#process-group-configuration-header-text').text(processGroup.name + ' Configuration');
                    } else {
                        setUnauthorizedText();
                    }

                    setEditable(false);
                }
                deferred.resolve(response);
            }).fail(function (xhr, status, error) {
                if (xhr.status === 403) {
                    var unauthorizedGroup;
                    if (groupId === nfCanvasUtils.getGroupId()) {
                        unauthorizedGroup = {
                            'permissions': {
                                canRead: false,
                                canWrite: nfCanvasUtils.canWriteCurrentGroup()
                            }
                        };
                    } else {
                        unauthorizedGroup = nfProcessGroup.get(groupId);
                    }
                    $('#process-group-configuration').data('process-group', unauthorizedGroup);

                    setUnauthorizedText();
                    setEditable(false);
                    deferred.resolve(unauthorizedGroup);
                } else {
                    deferred.reject(xhr, status, error);
                }
            });
        }).promise();

        // load the controller services
        var controllerServicesUri = config.urls.api + '/flow/process-groups/' + encodeURIComponent(groupId) + '/controller-services';
        var controllerServices = nfControllerServices.loadControllerServices(controllerServicesUri, getControllerServicesTable());

        var parameterContexts = $.ajax({
                type: 'GET',
                url: config.urls.parameterContexts,
                dataType: 'json'
            });

        // wait for everything to complete
        return $.when(processGroup, controllerServices, parameterContexts).done(function (processGroupResult, controllerServicesResult, parameterContextsResult) {
            var controllerServicesResponse = controllerServicesResult[0];
            var parameterContextsResponse = parameterContextsResult[0];

            // update the current time
            $('#process-group-configuration-last-refreshed').text(controllerServicesResponse.currentTime);

            var parameterContexts = parameterContextsResponse.parameterContexts;
            var options = [{
                text: 'No parameter context',
                value: null
            }];

            var authorizedParameterContexts = parameterContexts.filter(function (parameterContext) {
                return parameterContext.permissions.canRead;
            });

            var unauthorizedParameterContexts = parameterContexts.filter(function (parameterContext) {
                return !parameterContext.permissions.canRead;
            });

            //sort alphabetically
            var sortedAuthorizedParameterContexts = authorizedParameterContexts.sort(function (a, b) {
                if (a.component.name < b.component.name) {
                    return -1;
                }
                if (a.component.name > b.component.name) {
                    return 1;
                }
                return 0;
            });

            //sort alphabetically
            var sortedUnauthorizedParameterContexts = unauthorizedParameterContexts.sort(function (a, b) {
                if (a.id < b.id) {
                    return -1;
                }
                if (a.id > b.id) {
                    return 1;
                }
                return 0;
            });

            var sortedParameterContexts = sortedAuthorizedParameterContexts.concat(sortedUnauthorizedParameterContexts);

            sortedParameterContexts.forEach(function (parameterContext) {
                var option;
                if (parameterContext.permissions.canRead) {
                    option = {
                        'text': parameterContext.component.name,
                        'value': parameterContext.id,
                        'description': parameterContext.component.description
                    };
                } else {
                    option = {
                        'disabled': true,
                        'text': parameterContext.id,
                        'value': parameterContext.id
                    }
                }

                options.push(option);
            });

            var createNewParameterContextOption = {
                text: 'Create new parameter context...',
                value: undefined,
                optionClass: 'unset'
            };

            if (nfCommon.canModifyParameterContexts()) {
                options.push(createNewParameterContextOption);
            }

            var comboOptions = {
                options: options,
                select: function (option) {
                    var combo = this;
                    if (typeof option.value === 'undefined') {
                        $('#parameter-context-dialog').modal('setHeaderText', 'Add Parameter Context').modal('setButtonModel', [{
                            buttonText: 'Apply',
                            color: {
                                base: '#728E9B',
                                hover: '#004849',
                                text: '#ffffff'
                            },
                            disabled: function () {
                                if ($('#parameter-context-name').val() !== '') {
                                    return false;
                                }
                                return true;
                            },
                            handler: {
                                click: function () {
                                    nfParameterContexts.addParameterContext(function (parameterContextEntity) {
                                        options.pop();
                                        var option = {
                                            'text': parameterContextEntity.component.name,
                                            'value': parameterContextEntity.component.id,
                                            'description': parameterContextEntity.component.description
                                        };
                                        options.push(option);

                                        if (nfCommon.canModifyParameterContexts()) {
                                            options.push(createNewParameterContextOption);
                                        }

                                        comboOptions.selectedOption = {
                                            value: parameterContextEntity.component.id
                                        };

                                        combo.combo('destroy').combo(comboOptions);
                                    });
                                }
                            }
                        }, {
                            buttonText: 'Cancel',
                            color: {
                                base: '#E3E8EB',
                                hover: '#C7D2D7',
                                text: '#004849'
                            },
                            handler: {
                                click: function () {
                                    $(this).modal('hide');
                                }
                            }
                        }]).modal('show');

                        // make sure the edit mode is properly set
                        if ($('#parameter-context-dialog').hasClass('read-only')) {
                            $('#parameter-context-dialog').removeClass('read-only');
                            $('#parameter-context-dialog').addClass('edit-mode');
                        }

                        // there is no id yet, make sure the id field isn't shown
                        if (!$('#parameter-context-id-setting').hasClass('hidden')) {
                            $('#parameter-context-id-setting').addClass('hidden');
                        }

                        // set the initial focus
                        $('#parameter-context-name').focus();
                    }
                }
            };

            // populate the parameter context
            if (nfCommon.isDefinedAndNotNull(processGroupResult.parameterContext)) {
                comboOptions.selectedOption = {
                    value: processGroupResult.parameterContext.id
                };
            }

            // initialize the parameter context combo
            $('#process-group-parameter-context-combo').combo('destroy').combo(comboOptions);
        }).fail(nfErrorHandler.handleAjaxError);
    };

    /**
     * Shows the process group configuration.
     */
    var showConfiguration = function () {
        // show the configuration dialog
        nfShell.showContent('#process-group-configuration').done(function () {
            reset();
        });

        //reset content to account for possible policy changes
        $('#process-group-configuration-tabs').find('.selected-tab').click();

        // adjust the table size
        nfProcessGroupConfiguration.resetTableSize();
    };

    /**
     * Resets the process group configuration dialog.
     */
    var reset = function () {
        $('#process-group-configuration').removeData('process-group');

        // reset button state
        $('#process-group-configuration-save').mouseout();

        // reset the fields
        $('#process-group-id').text('');
        $('#process-group-name').val('');
        $('#process-group-comments').val('');

        // reset the header
        $('#process-group-configuration-header-text').text('Process Group Configuration');
    };

    var nfProcessGroupConfiguration = {

        /**
         * Initialize the process group configuration.
         *
         * @param nfControllerServicesRef   The nfControllerServices module.
         * @param nfParameterContextsRef    The nfParameterContexts module.
         */
        init: function (nfControllerServicesRef, nfParameterContextsRef) {
            nfControllerServices = nfControllerServicesRef;
            nfParameterContexts = nfParameterContextsRef;

            // initialize the process group configuration tabs
            $('#process-group-configuration-tabs').tabbs({
                tabStyle: 'tab',
                selectedTabStyle: 'selected-tab',
                scrollableTabContentStyle: 'scrollable',
                tabs: [{
                    name: 'General',
                    tabContentId: 'general-process-group-configuration-tab-content'
                }, {
                    name: 'Controller Services',
                    tabContentId: 'process-group-controller-services-tab-content'
                }],
                select: function () {
                    var processGroup = $('#process-group-configuration').data('process-group');
                    var canWrite = nfCommon.isDefinedAndNotNull(processGroup) ? processGroup.permissions.canWrite : false;

                    var tab = $(this).text();
                    if (tab === 'General') {
                        $('#flow-cs-availability').hide();
                        $('#add-process-group-configuration-controller-service').hide();

                        if (canWrite) {
                            $('#process-group-configuration-save').show();
                        } else {
                            $('#process-group-configuration-save').hide();
                        }
                    } else {
                        $('#flow-cs-availability').show();
                        $('#process-group-configuration-save').hide();

                        if (canWrite) {
                            $('#add-process-group-configuration-controller-service').show();
                            $('#process-group-controller-services-tab-content').css('top', '32px');
                        } else {
                            $('#add-process-group-configuration-controller-service').hide();
                            $('#process-group-controller-services-tab-content').css('top', '0');
                        }

                        // resize the table
                        nfProcessGroupConfiguration.resetTableSize();
                    }
                }
            });

            // initialize each tab
            initGeneral();
            nfControllerServices.init(getControllerServicesTable());
        },

        /**
         * Update the size of the grid based on its container's current size.
         */
        resetTableSize: function () {
            nfControllerServices.resetTableSize(getControllerServicesTable());
        },

        /**
         * Shows the settings dialog.
         */
        showConfiguration: function (groupId) {
            return loadConfiguration(groupId).done(showConfiguration);
        },

        /**
         * Loads the configuration for the specified process group.
         *
         * @param groupId
         */
        loadConfiguration: function (groupId) {
            return loadConfiguration(groupId);
        },

        /**
         * Selects the specified controller service.
         *
         * @param {string} controllerServiceId
         */
        selectControllerService: function (controllerServiceId) {
            var controllerServiceGrid = getControllerServicesTable().data('gridInstance');
            var controllerServiceData = controllerServiceGrid.getData();

            // select the desired service
            var row = controllerServiceData.getRowById(controllerServiceId);
            controllerServiceGrid.setSelectedRows([row]);
            controllerServiceGrid.scrollRowIntoView(row);

            // select the controller services tab
            $('#process-group-configuration-tabs').find('li:eq(1)').click();
        }
    };

    return nfProcessGroupConfiguration;
}));

redpajama_set_name: RedPajamaGithub


text:
Conan package for Qt
--------------------------------------------

[![Build Status](https://travis-ci.org/osechet/conan-qt.svg?branch=testing/5.6.2)](https://travis-ci.org/osechet/conan-qt)

[![Build status](https://ci.appveyor.com/api/projects/status/gboj3x82d42eoasw?svg=true)](https://ci.appveyor.com/project/osechet/conan-qt)

Note: Travis an Appveyor builds are not working because the build of Qt is too long and exceed their time limit.

[![badge](https://img.shields.io/badge/conan.io-Qt%2F5.6.2-green.svg?logo=data:image/png;base64%2CiVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAMAAAAolt3jAAAA1VBMVEUAAABhlctjlstkl8tlmMtlmMxlmcxmmcxnmsxpnMxpnM1qnc1sn85voM91oM11oc1xotB2oc56pNF6pNJ2ptJ8ptJ8ptN9ptN8p9N5qNJ9p9N9p9R8qtOBqdSAqtOAqtR%2BrNSCrNJ/rdWDrNWCsNWCsNaJs9eLs9iRvNuVvdyVv9yXwd2Zwt6axN6dxt%2Bfx%2BChyeGiyuGjyuCjyuGly%2BGlzOKmzOGozuKoz%2BKqz%2BOq0OOv1OWw1OWw1eWx1eWy1uay1%2Baz1%2Baz1%2Bez2Oe02Oe12ee22ujUGwH3AAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxMAAAsTAQCanBgAAAAHdElNRQfgBQkREyOxFIh/AAAAiklEQVQI12NgAAMbOwY4sLZ2NtQ1coVKWNvoc/Eq8XDr2wB5Ig62ekza9vaOqpK2TpoMzOxaFtwqZua2Bm4makIM7OzMAjoaCqYuxooSUqJALjs7o4yVpbowvzSUy87KqSwmxQfnsrPISyFzWeWAXCkpMaBVIC4bmCsOdgiUKwh3JojLgAQ4ZCE0AMm2D29tZwe6AAAAAElFTkSuQmCC)](http://www.conan.io/source/Qt/5.6.2/osechet/testing)

[Conan.io](https://conan.io) package for [Qt](https://www.qt.io) library. This package includes by default the Qt Base module (Core, Gui, Widgets, Network, ...). Others modules can be added using options.

The packages generated with this **conanfile** can be found in [conan.io](http://www.conan.io/source/Qt/5.6.2/osechet/testing).

## Reuse the package

### Basic setup

```
$ conan install Qt/5.6.2@osechet/testing
```

### Project setup

If you handle multiple dependencies in your project is better to add a *conanfile.txt*
```
    [requires]
    Qt/5.6.2@osechet/testing

    [options]
    Qt:shared=true # false
    # On Windows, you can choose the opengl mode, default is 'desktop'
    Qt:opengl=desktop # dynamic

    [generators]
    txt
    cmake
```
Complete the installation of requirements for your project running:
```
    conan install .
```
Project setup installs the library (and all his dependencies) and generates the files *conanbuildinfo.txt* and *conanbuildinfo.cmake* with all the paths and variables that you need to link with your dependencies.

## Develop the package

### Build packages

    $ pip install conan_package_tools
    $ python build.py

### Upload packages to server

    $ conan upload Qt/5.6.2@osechet/testing --all


text:
<?php

/**
 * Sales report resource model
 *
 * @category    Mage
 * @package     Mage_Sales
 * @author      Magento Core Team <core@magentocommerce.com>
 */
class Mage_Sales_Model_Resource_Report extends Mage_Core_Model_Resource_Db_Abstract
{
    /**
     * Resource initialization
     *
     */
    protected function _construct()
    {

    }

    /**
     * Set main table and idField
     *
     * @param string $table
     * @param string $field
     * @return Mage_Sales_Model_Resource_Report
     */
    public function init($table, $field = 'id')
    {
        $this->_init($table, $field);
        return $this;
    }
}


text:
package com.blackboxgaming.engine.systems;

import com.badlogic.gdx.graphics.g3d.attributes.ColorAttribute;
import com.badlogic.gdx.math.Matrix4;
import com.badlogic.gdx.math.Vector2;
import com.badlogic.gdx.math.Vector3;
import com.badlogic.gdx.physics.box2d.BodyDef;
import com.badlogic.gdx.physics.box2d.Fixture;
import com.badlogic.gdx.physics.box2d.RayCastCallback;
import com.badlogic.gdx.physics.bullet.collision.ClosestRayResultCallback;
import com.badlogic.gdx.utils.Disposable;
import com.blackboxgaming.engine.Engine;
import com.blackboxgaming.engine.Entity;
import com.blackboxgaming.engine.components.Child;
import com.blackboxgaming.engine.components.Damage;
import com.blackboxgaming.engine.components.Death;
import com.blackboxgaming.engine.components.Health;
import com.blackboxgaming.engine.components.JustFire;
import com.blackboxgaming.engine.components.Model;
import com.blackboxgaming.engine.components.Physics2D;
import com.blackboxgaming.engine.components.Transform;
import com.blackboxgaming.engine.components.Velocity;
import com.blackboxgaming.engine.components.Weapon;
import com.blackboxgaming.engine.components.ai.Follow;
import com.blackboxgaming.engine.factories.CollisionShapeFactory2D;
import com.blackboxgaming.engine.factories.ModelFactory;
import static com.blackboxgaming.engine.factories.WeaponFactory.*;
import com.blackboxgaming.engine.input.PlayerKeyListener;
import com.blackboxgaming.engine.util.Global;
import com.blackboxgaming.engine.util.Randomizer;
import com.blackboxgaming.engine.util.VUtil;
import java.util.ArrayList;
import java.util.List;

/**
 *
 * @author Adrian
 */
public class WeaponSystem implements ISystem, Disposable {

    private final List<Entity> entities = new ArrayList();
    private final Vector3 from = new Vector3();
    private final Vector2 from2D = new Vector2();
    private final Vector3 to = new Vector3();
    private final Vector2 to2D = new Vector2();
    private final Vector3 hitNormal = new Vector3();
    private final Vector3 hitPoint = new Vector3();
    private final Matrix4 splashTransform = new Matrix4();
    private final Vector2 splashAngleAroundY = new Vector2();
    private ClosestRayResultCallback callback;
    private Matrix4 parentTransform;
    private Matrix4 nozzleRelativeToWeapon;
    private Matrix4 shotOriginAbsolute;
    private boolean firing;
    private final MeleeCalback2D meleeCallback2D;

    public WeaponSystem() {
        this.meleeCallback2D = new MeleeCalback2D();
        if (Engine.systemManager.has(PhysicsSystem.class)) {
            callback = new ClosestRayResultCallback(from, to);
        }
    }

    @Override
    public void add(Entity entity) {
        if (!entities.contains(entity)) {
            entities.add(entity);
        }
    }

    @Override
    public void remove(Entity entity) {
        entities.remove(entity);
    }

    @Override
    public void update(float delta) {
        firing = PlayerKeyListener.space;
        for (Entity entity : entities) {
            if (firing || entity.has(JustFire.class)) {
                if (entity.has(JustFire.class)) {
                    entity.remove(JustFire.class);
                }
                Weapon weapon = entity.get(Weapon.class);
                if (weapon.lastFired + (long) weapon.fireRate <= System.currentTimeMillis()) {
                    weapon.lastFired = System.currentTimeMillis();
                    parentTransform = entity.get(Transform.class).transform;
                    nozzleRelativeToWeapon = entity.get(Weapon.class).nozzleRelativeToWeapon;
                    shotOriginAbsolute = parentTransform.cpy().mul(nozzleRelativeToWeapon);
                    resolveShot(entity, weapon.weaponType, weapon, shotOriginAbsolute);
                }
            }
        }
    }

    private void resolveShot(Entity shooter, int type, Weapon weapon, Matrix4 origin) {
        switch (type) {
            case WEAPON_GUN:
                shootGun(origin, weapon);
                break;
            case WEAPON_LASER:
                break;
            case WEAPON_PROJECTILE:
                shootProjectile(origin);
                break;
            case WEAPON_PLASMA:
                shootPlasma(origin, weapon);
                break;
            case WEAPON_GRENADE:
                break;
            case WEAPON_MELEE:
                shootMelee(shooter, origin, weapon);
                break;
            default:
                System.out.println("Can't resolve shot");
                break;
        }
    }

    private void shootGun(Matrix4 origin, Weapon weapon) {
        // nozzle fire model
        Entity entity;
        entity = new Entity();
        entity.add(new Transform(origin.cpy().translate(0.5f, 0, 0).rotate(Vector3.X, 90).rotate(Vector3.Z, 90)));
        entity.add(weapon.nozzleFireModel);
        entity.add(new Death(50));
        Engine.entityManager.add(entity);

        // shot collision
        from.set(origin.getTranslation(from));
        to.set((origin.translate(weapon.range, 0, 0)).getTranslation(to));
        callback.setRayFromWorld(from);
        callback.setRayToWorld(to);
        callback.setCollisionObject(null);
        callback.setClosestHitFraction(1f);
        Global.getDynamicsWorld().rayTest(from, to, callback);

        // damage on hit
        if (callback.hasHit()) {
            decreaseHealth(Engine.entityManager.get(callback.getCollisionObject().getUserValue()), weapon.damage);
        }
        // hit splash
        if (callback.hasHit()) {
            callback.getHitNormalWorld(hitNormal);
            callback.getHitPointWorld(hitPoint);

            splashTransform.idt();
            splashAngleAroundY.set(hitNormal.x, hitNormal.z);
            splashTransform.rotate(Vector3.Y, -splashAngleAroundY.angle());
            splashTransform.trn(hitPoint);

            entity = new Entity();
            entity.add(new Transform(splashTransform));
            entity.add(weapon.hitSplashModel);
            entity.add(new Death(100));
            Engine.entityManager.add(entity);
        }
    }

    private void shootMelee(Entity shooter, Matrix4 origin, Weapon weapon) {
        Entity e;
        e = new Entity();
        e.add(new Transform(origin));
        e.add(weapon.nozzleFireModel);
        e.add(new Death(100));
        Engine.entityManager.add(e);
        if (shooter.has(Child.class)) {
            if (shooter.get(Child.class).parent.has(Follow.class)) {
                decreaseHealth(shooter.get(Child.class).parent.get(Follow.class).target, weapon.damage);
            }
        }

        if (Engine.systemManager.has(PhysicsSystem.class)) {
            // I have no idea what this does anymore
            // shot collision
//            from.set(origin.getTranslation(from));
//            to.set((origin.cpy().translate(weapon.range, 0, 0)).getTranslation(to));
//            callback.setRayFromWorld(from);
//            callback.setRayToWorld(to);
//            callback.setCollisionObject(null);
//            callback.setClosestHitFraction(1f);
//            Global.getDynamicsWorld().rayTest(from, to, callback);
//
//            // damage on hit
//            if (callback.hasHit() && callback.getCollisionObject().getUserValue() == Global.mainCharacter.id) {
//                // nozzle fire model
//                Entity entity;
//                entity = new Entity();
//                entity.add(new Transform(origin));
//                entity.add(weapon.nozzleFireModel);
//                entity.add(new Death(100));
//                Engine.entityManager.add(entity);
//                decreaseHealth(Engine.entityManager.get(callback.getCollisionObject().getUserValue()), weapon.damage);
//            }
        }
        if (Engine.systemManager.has(PhysicsSystem2D.class)) {
            // 2D physics
            from2D.set(VUtil.toVector2(origin.cpy().translate(-0.5f, 0, 0).getTranslation(from)));
            to2D.set(VUtil.toVector2((origin.cpy().translate(weapon.range, 0, 0)).getTranslation(to)));
            Global.getDynamicsWorld2D().rayCast(meleeCallback2D, from2D, to2D);
            if (meleeCallback2D.hasHit) {
//                if ((int) meleeCallback2D.fixture.getBody().getUserData() == Global.mainCharacter.id) {
                Entity entity;
                entity = new Entity();
                entity.add(new Transform(origin));
                entity.add(weapon.nozzleFireModel);
                entity.add(new Death(100));
                Engine.entityManager.add(entity);
                decreaseHealth(Engine.entityManager.get((int) meleeCallback2D.fixture.getBody().getUserData()), weapon.damage);
//                }
                meleeCallback2D.hasHit = false;
            }
        }
    }

    private class MeleeCalback2D implements RayCastCallback {

        public Fixture fixture;
        public boolean hasHit = false;

        @Override
        public float reportRayFixture(Fixture fixture, Vector2 vctr, Vector2 vctr1, float f) {
            this.fixture = fixture;
            hasHit = true;
            return 0;
        }

    }

    private void shootPlasma(Matrix4 origin, Weapon weapon) {
        // plasma
        Entity entity = new Entity();
        entity.add(new Transform(origin.cpy().translate(0.5f, 0, 0)));
        entity.add(new Velocity(weapon.speed, 0, 0));
        entity.add(new Model(weapon.bulletModel.modelInstance.copy().model, Randomizer.getRandomColor(), true));
//        entity.add(new Model(weapon.bulletModel.modelInstance.copy().model, ((ColorAttribute) weapon.bulletModel.modelInstance.materials.get(0).get(ColorAttribute.Diffuse)).color, true));
        entity.add(new Death(2000));
        entity.add(new Damage(weapon.damage));
//        entity.add(new Physics(CollisionShapeFactory.getSphereShape(0.5f), 0.5f, btCollisionObject.CollisionFlags.CF_CUSTOM_MATERIAL_CALLBACK, CollisionFlag.BULLET_COLLISION_FLAG, CollisionFlag.ALL_FLAG, Collision.ACTIVE_TAG));
        entity.add(new Physics2D(CollisionShapeFactory2D.getCircleShape(0.25f), BodyDef.BodyType.DynamicBody, 0.5f, entity.get(Transform.class).transform, false));
        Engine.entityManager.add(entity);
        Global.CANTACT_GROUP_PLASMA.add(entity.id);
    }

    private void shootProjectile(Matrix4 origin) {
        Entity bullet = new Entity();
        bullet.add(new Transform(origin));
        bullet.add(new Model(ModelFactory.getSphereModel(0.25f)));
        bullet.add(new Death(1000));
        Engine.entityManager.add(bullet);
    }

    private void decreaseHealth(Entity target, float damage) {
        if (target.has(Health.class)) {
            target.get(Health.class).currentHealth -= damage;
        }
    }

    @Override
    public void dispose() {
        System.out.println("Disposing " + this.getClass());
        Model model;
        for (Entity entity : entities) {
            model = entity.get(Weapon.class).nozzleFireModel;
            if (model != null) {
                model.modelInstance.model.dispose();
                model = null;
            }
        }
        entities.clear();
        callback.dispose();
    }
}


text:
namespace Apache.Ignite.Core.Tests.Cache.Store
{
    using System;
    using System.Collections;
    using System.Collections.Concurrent;
    using System.Diagnostics;
    using System.Diagnostics.CodeAnalysis;
    using System.Linq;
    using System.Threading;
    using Apache.Ignite.Core.Cache.Store;
    using Apache.Ignite.Core.Resource;

    [SuppressMessage("ReSharper", "FieldCanBeMadeReadOnly.Local")]
    public class CacheTestStore : ICacheStore
    {
        public static readonly IDictionary Map = new ConcurrentDictionary<object, object>();

        public static bool ExpCommit;

        public static bool LoadMultithreaded;

        public static bool LoadObjects;

        [InstanceResource]
        private IIgnite _grid = null;

        [StoreSessionResource]
#pragma warning disable 649
        private ICacheStoreSession _ses;
#pragma warning restore 649

        public static int intProperty;

        public static string stringProperty;

        public static void Reset()
        {
            Map.Clear();

            ExpCommit = false;
            LoadMultithreaded = false;
            LoadObjects = false;
        }

        public void LoadCache(Action<object, object> act, params object[] args)
        {
            Debug.Assert(_grid != null);

            if (LoadMultithreaded)
            {
                int cnt = 0;

                TestUtils.RunMultiThreaded(() => {
                    int i;

                    while ((i = Interlocked.Increment(ref cnt) - 1) < 1000)
                        act(i, "val_" + i);
                }, 8);
            }
            else
            {
                int start = (int)args[0];
                int cnt = (int)args[1];

                for (int i = start; i < start + cnt; i++)
                {
                    if (LoadObjects)
                        act(new Key(i), new Value(i));
                    else
                        act(i, "val_" + i);
                }
            }
        }

        public object Load(object key)
        {
            Debug.Assert(_grid != null);

            return Map[key];
        }

        public IDictionary LoadAll(ICollection keys)
        {
            Debug.Assert(_grid != null);

            return keys.OfType<object>().ToDictionary(key => key, key => "val_" + key);
        }

        public void Write(object key, object val)
        {
            Debug.Assert(_grid != null);

            Map[key] = val;
        }

        public void WriteAll(IDictionary map)
        {
            Debug.Assert(_grid != null);

            foreach (DictionaryEntry e in map)
                Map[e.Key] = e.Value;
        }

        public void Delete(object key)
        {
            Debug.Assert(_grid != null);

            Map.Remove(key);
        }

        public void DeleteAll(ICollection keys)
        {
            Debug.Assert(_grid != null);

            foreach (object key in keys)
                Map.Remove(key);
        }

        public void SessionEnd(bool commit)
        {
            Debug.Assert(_grid != null);

            Debug.Assert(_ses != null);
        }

        public int IntProperty
        {
            get { return intProperty; }
            set { intProperty = value; }
        }

        public string StringProperty
        {
            get { return stringProperty; }
            set { stringProperty = value; }
        }
    }
}


text:
SYNONYM

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Mycena 1(1): 91 (2001)

#### Original name
Polyporus caperatus Berk., 1881

### Remarks
null


text:
$(document).ready(function(){
  $('.sidenav').sidenav();
  $('.parallax').parallax();
  $('.collapsible').collapsible();
});


text:
jQuery(document).ready(function($){

  /*** Display menu children if it has some ***/
  $('li.parent>a', 'ul.menu').click(function(){
    var link = $(this);
    var obj = $(this).parent();
    var child = $('ul.child', obj);

    if ($(child).is(':visible')) {
      $(child).slideUp(400);
      $(link).removeClass('close-child');
    } else {
      $(child).slideDown(400);
      $(link).addClass('close-child');
    }

    return false;
  });

  $("html").niceScroll({cursorwidth:'10px',
    cursorborderradius: '2px',
    cursoropacitymin: '0.3'});

  /*** Close container elements ***/
  $('a', '.close-box').click(function(){
    var obj = $(this);
    var box   = $(obj).parents('.box');
    var chart = $(obj).parents('.chart');

    if ($(box).length) {
      $(box).fadeOut(400);
    } else if ($(chart).length) {
      $(chart).fadeOut(400);
    }

    return false;
  });

  /*** Responsive Menu ***/
  $('.responsive-menu>a').click(function(){
    var menu = $('ul.menu', '.sidebar');
    if ($(menu).is(':visible')) {
      $(menu).slideUp(800);
    } else {
      $(menu).slideDown(800);
    }
  });

  /*** Close container elements ***/
  $('a.close-box', '.boxed').click(function(){
    var obj = $(this);
    var box   = $(obj).parents('.boxed');
    var chart = $(obj).parents('.chart');

    if ($('.inner', box).length) {
      if ($('.inner', box).is(':visible')) {
        $('.inner', box).slideUp(400);
        $('i', obj).removeClass('fa-chevron-up').addClass('fa-chevron-down');
      } else {
        $('.inner', box).slideDown(400);
        $('i', obj).removeClass('fa-chevron-down').addClass('fa-chevron-up');
      }
    } else if ($(chart).length) {
      if ($('.inner', chart).is(':visible')) {
        $('.inner', chart).slideUp(400);
        $('i', chart).removeClass('fa-chevron-up').addClass('fa-chevron-down');
      } else {
        $('.inner', chart).slideDown(400);
        $('i', chart).removeClass('fa-chevron-down').addClass('fa-chevron-up');
      }
    }

    return false;
  });

  /*** Close container elements ***/
  $('a.remove-box', '.boxed').click(function(){
    var link = $(this);
    var icon = $('i', link);
    var parent = $(this).parent().parent().parent().parent();

    if ($(parent).length) {
      $(parent).slideUp(400);
    }

    return false;
  });

  /*** Fixed Header Bar - Fix ***/
  if ($('body.fixed-headerbar').length) {
    var width = $('.content-liquid-full').outerWidth();
    $('.header-bar', '.fixed-headerbar').width(width);
    $(window).resize(function(){
      var width = $('.content-liquid-full').outerWidth();
      $('.header-bar', '.fixed-headerbar').width(width);
    });
  }

  /*** ToolTips ***/
  $('[data-toggle="tooltip"]').each(function(i, item) {
    $(item).tooltip();
  });

  /*** PopOvers ***/
  $('[data-toggle="popover"]').each(function(i, item) {
    $(item).popover();
  });

});


text:
<?php

namespace bedezign\yii2\audit\controllers;

use bedezign\yii2\audit\components\web\Controller;
use Yii;

/**
 * DefaultController
 * @package bedezign\yii2\audit\controllers
 */
class DefaultController extends Controller
{
    /**
     * Module Default Action.
     * @return mixed
     */
    public function actionIndex()
    {
        return $this->render('index');
    }

}