text:
function initialize_LayerTreeTests()
{
    // FIXME: remove once out of experimental.
    InspectorTest.registerModule("layers");
    var extensions = runtime.extensions(WebInspector.Panel).forEach(function(extension) {
        if (extension.module().name() === "layers")
            WebInspector.inspectorView.addPanel(new WebInspector.RuntimeExtensionPanelDescriptor(extension));
    });
    InspectorTest.layerTreeModel = WebInspector.inspectorView.panel("layers")._model;
    InspectorTest.layers3DView = WebInspector.inspectorView.panel("layers")._layers3DView;

    InspectorTest.labelForLayer = function(layer)
    {
        var node = layer.nodeForSelfOrAncestor();
        var label = node ? WebInspector.DOMPresentationUtils.fullQualifiedSelector(node, false) : "<invalid node id>";
        var height = layer.height();
        var width = layer.width();
        if (height <= 200 && width <= 200)
            label += " " + height + "x" + width;
        if (typeof layer.__extraData !== "undefined")
            label += " (" + layer.__extraData + ")";
        return label;
    }

    InspectorTest.dumpLayerTree = function(prefix, root)
    {
        if (!prefix)
            prefix = "";
        if (!root) {
            root = InspectorTest.layerTreeModel.layerTree().contentRoot();
            if (!root) {
                InspectorTest.addResult("No layer root, perhaps not in the composited mode! ");
                InspectorTest.completeTest();
                return;
            }
        }
        InspectorTest.addResult(prefix + InspectorTest.labelForLayer(root));
        root.children().forEach(InspectorTest.dumpLayerTree.bind(InspectorTest, prefix + "    "));
    }

    InspectorTest.dumpLayerTreeOutline = function(prefix, root)
    {
        if (!prefix)
            prefix = "";
        if (!root)
            root = WebInspector.inspectorView.panel("layers")._layerTree._treeOutline;
        if (root.representedObject)
            InspectorTest.addResult(prefix + InspectorTest.labelForLayer(root.representedObject));
        root.children.forEach(InspectorTest.dumpLayerTreeOutline.bind(InspectorTest, prefix + "    "));
    }

    InspectorTest.dumpLayers3DView = function(prefix, root)
    {
        if (!prefix)
            prefix = "";
        if (!root)
            root = InspectorTest.layers3DView._rotatingContainerElement;
        if (root.__layer)
            InspectorTest.addResult(prefix + InspectorTest.labelForLayer(root.__layer));
        for (var element = root.firstElementChild; element; element = element.nextSibling)
            InspectorTest.dumpLayers3DView(prefix + "    ", element);
    }

    InspectorTest.evaluateAndRunWhenTreeChanges = function(expression, callback)
    {
        function eventHandler()
        {
            InspectorTest.layerTreeModel.removeEventListener(WebInspector.LayerTreeModel.Events.LayerTreeChanged, eventHandler);
            callback();
        }
        InspectorTest.evaluateInPage(expression, function() {
            InspectorTest.layerTreeModel.addEventListener(WebInspector.LayerTreeModel.Events.LayerTreeChanged, eventHandler);
        });
    }

    InspectorTest.findLayerByNodeIdAttribute = function(nodeIdAttribute)
    {
        var result;
        function testLayer(layer)
        {
            var node = layer.node();
            if (!node)
                return false;
            if (!node || node.getAttribute("id") !== nodeIdAttribute)
                return false;
            result = layer;
            return true;
        }
        InspectorTest.layerTreeModel.layerTree().forEachLayer(testLayer);
        if (!result)
            InspectorTest.addResult("ERROR: No layer for " + nodeIdAttribute);
        return result;
    }

    InspectorTest.requestLayers = function(callback)
    {
        InspectorTest.layerTreeModel.addEventListener(WebInspector.LayerTreeModel.Events.LayerTreeChanged, onLayerTreeChanged);
        InspectorTest.layerTreeModel.enable();
        function onLayerTreeChanged()
        {
            InspectorTest.layerTreeModel.removeEventListener(WebInspector.LayerTreeModel.Events.LayerTreeChanged, onLayerTreeChanged);
            callback();
        }
    }

    InspectorTest.dumpModelScrollRects = function()
    {
        function dumpScrollRectsForLayer(layer)
        {
            if (layer._scrollRects.length > 0)
                InspectorTest.addObject(layer._scrollRects);
        }

        InspectorTest.addResult("Model elements dump");
        InspectorTest.layerTreeModel.layerTree().forEachLayer(dumpScrollRectsForLayer.bind(this));
    }

    InspectorTest.dispatchMouseEvent = function(eventType, button, element, offsetX, offsetY)
    {
        var totalOffset = element.totalOffset();
        var scrollOffset = element.scrollOffset();
        var eventArguments = {
            bubbles: true,
            cancelable: true,
            view: window,
            screenX: totalOffset.left - scrollOffset.left + offsetX,
            screenY: totalOffset.top - scrollOffset.top + offsetY,
            clientX: totalOffset.left + offsetX,
            clientY: totalOffset.top + offsetY,
            button: button
        };
        if (eventType === "mouseout") {
            eventArguments.screenX = 0;
            eventArguments.screenY = 0;
            eventArguments.clientX = 0;
            eventArguments.clientY = 0;
        }
        element.dispatchEvent(new MouseEvent(eventType, eventArguments));
    }
}


text:
[npm history][1]

[1]: https://www.npmjs.com/package/@google-cloud/profiler?activeTab=versions

## [5.0.3](https://github.com/googleapis/cloud-profiler-nodejs/compare/v5.0.2...v5.0.3) (2022-09-09)

### Bug Fixes

* **deps:** Update dependency protobufjs to ~7.1.0 ([#854](https://github.com/googleapis/cloud-profiler-nodejs/issues/854)) ([e8e725d](https://github.com/googleapis/cloud-profiler-nodejs/commit/e8e725d74d7e9578ac0fac0fb94774e833ae1979))
* Remove pip install statements ([#1546](https://github.com/googleapis/cloud-profiler-nodejs/issues/1546)) ([#852](https://github.com/googleapis/cloud-profiler-nodejs/issues/852)) ([85ddb0f](https://github.com/googleapis/cloud-profiler-nodejs/commit/85ddb0f07cb40dab1e6284b80d5a921a596b2b9f))

## [5.0.2](https://github.com/googleapis/cloud-profiler-nodejs/compare/v5.0.1...v5.0.2) (2022-07-25)

### Bug Fixes

* **deps:** update dependency protobufjs to v7 ([#849](https://github.com/googleapis/cloud-profiler-nodejs/issues/849)) ([5536eac](https://github.com/googleapis/cloud-profiler-nodejs/commit/5536eac0ac661d54fab58a236d561b259b2fe04f))

## [5.0.1](https://github.com/googleapis/cloud-profiler-nodejs/compare/v5.0.0...v5.0.1) (2022-07-08)

### Bug Fixes

* fix build so it includes expected files (and modify test to catch this) ([6d9a5ca](https://github.com/googleapis/cloud-profiler-nodejs/commit/6d9a5caa276a7d41f6f3b0e9da8d576e261f3f3f))

## [5.0.0](https://github.com/googleapis/cloud-profiler-nodejs/compare/v4.2.0...v5.0.0) (2022-06-20)

### ⚠ BREAKING CHANGES

* update library to use Node 12 (#835)

### Bug Fixes

* **deps:** update dependency @google-cloud/common to v4 ([#843](https://github.com/googleapis/cloud-profiler-nodejs/issues/843)) ([1af6b0f](https://github.com/googleapis/cloud-profiler-nodejs/commit/1af6b0f18aec665b042a27ea90158b99d7435d4e))
* **deps:** update dependency @google-cloud/logging-min to v10 ([#838](https://github.com/googleapis/cloud-profiler-nodejs/issues/838)) ([1120298](https://github.com/googleapis/cloud-profiler-nodejs/commit/11202986b7d4501637e7c30c5e9787789e98ccba))

### Build System

* update library to use Node 12 ([#835](https://github.com/googleapis/cloud-profiler-nodejs/issues/835)) ([07221ef](https://github.com/googleapis/cloud-profiler-nodejs/commit/07221ef0503c25311834a50b987b70d51393420c))

## [4.2.0](https://github.com/googleapis/cloud-profiler-nodejs/compare/v4.1.7...v4.2.0) (2022-05-13)

### Bug Fixes

* initial module in golint presubmit check ([#818](https://github.com/googleapis/cloud-profiler-nodejs/issues/818)) ([df1f28a](https://github.com/googleapis/cloud-profiler-nodejs/commit/df1f28a6e0e74f9d5ee6751a203fe5610866b584))
* library should released as 4.2.0 ([#833](https://github.com/googleapis/cloud-profiler-nodejs/issues/833)) ([8d722aa](https://github.com/googleapis/cloud-profiler-nodejs/commit/8d722aa0e5a3f03ea729db0a4d98b2a8c7717bcf))
* relax service name requirements to allow starting with numbers ([#828](https://github.com/googleapis/cloud-profiler-nodejs/issues/828)) ([fe0f1cc](https://github.com/googleapis/cloud-profiler-nodejs/commit/fe0f1ccd14c2a091f1778142083f49813d724dcf))

### [4.1.7](https://www.github.com/googleapis/cloud-profiler-nodejs/compare/v4.1.6...v4.1.7) (2021-12-20)

### Bug Fixes

* remove certification expiration workaround ([#781](https://www.github.com/googleapis/cloud-profiler-nodejs/issues/781)) ([44af460](https://www.github.com/googleapis/cloud-profiler-nodejs/commit/44af4604f0553ef917e48abf51fa3f52950ed6b7))

### [4.1.6](https://www.github.com/googleapis/cloud-profiler-nodejs/compare/v4.1.5...v4.1.6) (2021-12-20)

### Bug Fixes

* log to console using structured logging ([#780](https://www.github.com/googleapis/cloud-profiler-nodejs/issues/780)) ([6b96e00](https://www.github.com/googleapis/cloud-profiler-nodejs/commit/6b96e007418bd6074c2bf9de64df0742e6a6d4ae))

### [4.1.5](https://www.github.com/googleapis/cloud-profiler-nodejs/compare/v4.1.4...v4.1.5) (2021-10-06)

### Bug Fixes

* workaround certificate expiration issue in integration tests ([#773](https://www.github.com/googleapis/cloud-profiler-nodejs/issues/773)) ([9d4908b](https://www.github.com/googleapis/cloud-profiler-nodejs/commit/9d4908b7161e0aade0915d2d88a43b0a6bfc9791))

### [4.1.4](https://www.github.com/googleapis/cloud-profiler-nodejs/compare/v4.1.3...v4.1.4) (2021-09-14)

### Bug Fixes

* **build:** migrate to using main branch ([#760](https://www.github.com/googleapis/cloud-profiler-nodejs/issues/760)) ([1649406](https://www.github.com/googleapis/cloud-profiler-nodejs/commit/164940698d7f4da0b2b6ea9e3b059e553fcfaa42))

### [4.1.3](https://www.github.com/googleapis/cloud-profiler-nodejs/compare/v4.1.2...v4.1.3) (2021-07-20)

### Bug Fixes

* **deps:** update dependency pprof to v3.2.0 ([#754](https://www.github.com/googleapis/cloud-profiler-nodejs/issues/754)) ([fc48f9a](https://www.github.com/googleapis/cloud-profiler-nodejs/commit/fc48f9aee74a3638d98086e0b404e299ae31b592))

### [4.1.2](https://www.github.com/googleapis/cloud-profiler-nodejs/compare/v4.1.1...v4.1.2) (2021-05-05)

### Bug Fixes

* **deps:** update dependency pprof to v3.1.0 ([#731](https://www.github.com/googleapis/cloud-profiler-nodejs/issues/731)) ([ba96e49](https://www.github.com/googleapis/cloud-profiler-nodejs/commit/ba96e49a2d254d713d55f16bedbf6a5268500801))
* **deps:** update dependency protobufjs to ~6.11.0 ([#733](https://www.github.com/googleapis/cloud-profiler-nodejs/issues/733)) ([33abbeb](https://www.github.com/googleapis/cloud-profiler-nodejs/commit/33abbebe1e6424658a66cdb728b93875d4edadd3))

### [4.1.1](https://www.github.com/googleapis/cloud-profiler-nodejs/compare/v4.1.0...v4.1.1) (2021-03-16)

### Bug Fixes

* **deps:** update dependency delay to v5 ([#722](https://www.github.com/googleapis/cloud-profiler-nodejs/issues/722)) ([98d43e1](https://www.github.com/googleapis/cloud-profiler-nodejs/commit/98d43e12b2d19f7d8b70618b6d3ec5de6e8d702c))
* **deps:** update dependency parse-duration to v1 ([#725](https://www.github.com/googleapis/cloud-profiler-nodejs/issues/725)) ([fcd1239](https://www.github.com/googleapis/cloud-profiler-nodejs/commit/fcd12391782ad9363cffae0c3b507512fc8dfbc8))

## [4.1.0](https://www.github.com/googleapis/cloud-profiler-nodejs/compare/v4.0.3...v4.1.0) (2020-11-02)

### Features

* add support for Node 14 ([#709](https://www.github.com/googleapis/cloud-profiler-nodejs/issues/709)) ([3b8f4ad](https://www.github.com/googleapis/cloud-profiler-nodejs/commit/3b8f4adbb069c163864ba4e61e7980e78c057713))

### Bug Fixes

* Update engines to prevent agent from being used with versions of Node.js where v8 profilers have memory leaks ([#699](https://www.github.com/googleapis/cloud-profiler-nodejs/issues/699)) ([160d1f6](https://www.github.com/googleapis/cloud-profiler-nodejs/commit/160d1f68c657f6ce18b8cea921470d1b4482619f))

### Reverts

* Revert "fix: Update engines to prevent agent from getting used when it will cause memory leak." (#706) ([9141c2f](https://www.github.com/googleapis/cloud-profiler-nodejs/commit/9141c2fc9373a8a8b26a577165a23a21835db779)), closes [#706](https://www.github.com/googleapis/cloud-profiler-nodejs/issues/706) [#699](https://www.github.com/googleapis/cloud-profiler-nodejs/issues/699)

### [4.0.3](https://www.github.com/googleapis/cloud-profiler-nodejs/compare/v4.0.2...v4.0.3) (2020-09-12)

### Bug Fixes

* move gitattributes files to node templates ([#679](https://www.github.com/googleapis/cloud-profiler-nodejs/issues/679)) ([521e418](https://www.github.com/googleapis/cloud-profiler-nodejs/commit/521e4180f825299907ad374412d81d65bb674596))
* **deps:** update dependency parse-duration to 0.4.4 ([#668](https://www.github.com/googleapis/cloud-profiler-nodejs/issues/668)) ([2757231](https://www.github.com/googleapis/cloud-profiler-nodejs/commit/2757231e07492bc38bf25fe3add1274b36d2bdca))

### [4.0.2](https://www.github.com/googleapis/cloud-profiler-nodejs/compare/v4.0.1...v4.0.2) (2020-07-14)

### Bug Fixes

* **deps:** update dependency protobufjs to ~6.10.0 ([#665](https://www.github.com/googleapis/cloud-profiler-nodejs/issues/665)) ([dc4ed5c](https://www.github.com/googleapis/cloud-profiler-nodejs/commit/dc4ed5c57e675b0a87e193b0ba012d5d22b85951))

### [4.0.1](https://www.github.com/googleapis/cloud-profiler-nodejs/compare/v4.0.0...v4.0.1) (2020-07-09)

### Bug Fixes

* **deps:** update dependency pretty-ms to v7 ([#642](https://www.github.com/googleapis/cloud-profiler-nodejs/issues/642)) ([f69c7a7](https://www.github.com/googleapis/cloud-profiler-nodejs/commit/f69c7a73b17c150c2b523412e430b5d1ac03e12a))
* **deps:** update dependency protobufjs to ~6.9.0 ([#634](https://www.github.com/googleapis/cloud-profiler-nodejs/issues/634)) ([a90149c](https://www.github.com/googleapis/cloud-profiler-nodejs/commit/a90149c4f91630d75bb41fab145713637736d21c))
* malformed tsconfig causing broken tests [#640](https://www.github.com/googleapis/cloud-profiler-nodejs/issues/640) ([#647](https://www.github.com/googleapis/cloud-profiler-nodejs/issues/647)) ([09c19c8](https://www.github.com/googleapis/cloud-profiler-nodejs/commit/09c19c88a0ca137b7970c386730b145b66b77ec3))
* **deps:** update dependency teeny-request to v7 ([#652](https://www.github.com/googleapis/cloud-profiler-nodejs/issues/652)) ([b46eb4f](https://www.github.com/googleapis/cloud-profiler-nodejs/commit/b46eb4f2552871f405579100e4e916dbde5c60d8))
* typeo in nodejs .gitattribute ([#661](https://www.github.com/googleapis/cloud-profiler-nodejs/issues/661)) ([92f46ac](https://www.github.com/googleapis/cloud-profiler-nodejs/commit/92f46ac22a510c7bab05549b83779dd4f60096b7))

## [4.0.0](https://www.github.com/googleapis/cloud-profiler-nodejs/compare/v3.0.1...v4.0.0) (2020-04-17)

### ⚠ BREAKING CHANGES

* require node.js 10.x and up (#623)
* `start({...}) ` now throws an error when the profiling agent cannot be set up because required fields are not set in the config and cannot be determined based on metadata or environment variables.

### Features

* add support for Node 12 ([#580](https://www.github.com/googleapis/cloud-profiler-nodejs/issues/580)) ([e7cb85e](https://www.github.com/googleapis/cloud-profiler-nodejs/commit/e7cb85efafb72f3f50acb48cafcc99e00cdd4616))
* package is now GA ([#627](https://www.github.com/googleapis/cloud-profiler-nodejs/issues/627)) ([1327ece](https://www.github.com/googleapis/cloud-profiler-nodejs/commit/1327ece67da31c2fc5ab1e20f6481cfa8d207e63))
* require the project ID to be set before starting the profiling agent ([#516](https://www.github.com/googleapis/cloud-profiler-nodejs/issues/516)) ([5b46b66](https://www.github.com/googleapis/cloud-profiler-nodejs/commit/5b46b66db3354bff611e2b34d51d40fc4e4befa5))

### Bug Fixes

* **deps:** TypeScript 3.7.0 causes breaking change in typings ([#564](https://www.github.com/googleapis/cloud-profiler-nodejs/issues/564)) ([3ac08e5](https://www.github.com/googleapis/cloud-profiler-nodejs/commit/3ac08e52a8f9dbb87aaa70324c2f5bc69f805b7c))
* apache license URL ([#468](https://www.github.com/googleapis/cloud-profiler-nodejs/issues/468)) ([#618](https://www.github.com/googleapis/cloud-profiler-nodejs/issues/618)) ([1ae39be](https://www.github.com/googleapis/cloud-profiler-nodejs/commit/1ae39bef02389451ecf5b120770c6b6c914e96b8))
* **deps:** update dependency @google-cloud/common to v3 ([#613](https://www.github.com/googleapis/cloud-profiler-nodejs/issues/613)) ([356dfa6](https://www.github.com/googleapis/cloud-profiler-nodejs/commit/356dfa6d461be219d9937c3ca1430b6b0891bee1))
* **deps:** update dependency @types/semver to v7 ([#587](https://www.github.com/googleapis/cloud-profiler-nodejs/issues/587)) ([1400fda](https://www.github.com/googleapis/cloud-profiler-nodejs/commit/1400fda2018331ceb41df9434f307b8046fdde89))
* **deps:** update dependency gcp-metadata to v4 ([#609](https://www.github.com/googleapis/cloud-profiler-nodejs/issues/609)) ([66875dd](https://www.github.com/googleapis/cloud-profiler-nodejs/commit/66875dd259adcab7e18068bee1d76afa7dc641e9))
* **deps:** update dependency pprof to v1.3.0 ([#595](https://www.github.com/googleapis/cloud-profiler-nodejs/issues/595)) ([7ba1423](https://www.github.com/googleapis/cloud-profiler-nodejs/commit/7ba14239d5096811c30148fa1f405765cc13f0d2))
* **deps:** update dependency pprof to v2 ([#619](https://www.github.com/googleapis/cloud-profiler-nodejs/issues/619)) ([37c7655](https://www.github.com/googleapis/cloud-profiler-nodejs/commit/37c7655b227676af7a400e379d7b172f41f2592e))
* **deps:** update dependency pretty-ms to v6 ([#596](https://www.github.com/googleapis/cloud-profiler-nodejs/issues/596)) ([bed6c20](https://www.github.com/googleapis/cloud-profiler-nodejs/commit/bed6c2007bd7224b827c3f8dcf8369c4d9b8ba8c))
* **deps:** update dependency semver to v7 ([#567](https://www.github.com/googleapis/cloud-profiler-nodejs/issues/567)) ([b6f80f6](https://www.github.com/googleapis/cloud-profiler-nodejs/commit/b6f80f6819e6fc42b767ecc17594a933e4ff8316))
* **docs:** snippets are now replaced in jsdoc comments ([#560](https://www.github.com/googleapis/cloud-profiler-nodejs/issues/560)) ([07164f3](https://www.github.com/googleapis/cloud-profiler-nodejs/commit/07164f372913255a0b84754668ea2216cc2a6944))

### Build System

* require node.js 10.x and up ([#623](https://www.github.com/googleapis/cloud-profiler-nodejs/issues/623)) ([90d20bb](https://www.github.com/googleapis/cloud-profiler-nodejs/commit/90d20bb566ed54237074af85dedb249653a06657))

### [3.0.1](https://www.github.com/googleapis/cloud-profiler-nodejs/compare/v3.0.0...v3.0.1) (2019-10-30)

### Bug Fixes

* remove @google-cloud/common retries for CreateProfile and UpdateProfile requests ([#555](https://www.github.com/googleapis/cloud-profiler-nodejs/issues/555)) ([09ef74d](https://www.github.com/googleapis/cloud-profiler-nodejs/commit/09ef74d9a9a84d4c3a04edd9f93013cf8c56425b))
* **deps:** update dependency pprof to v1.2.0 ([#557](https://www.github.com/googleapis/cloud-profiler-nodejs/issues/557)) ([664bf0e](https://www.github.com/googleapis/cloud-profiler-nodejs/commit/664bf0e948cfb898702a2c4198e8d30f0699862c))

## v3.0.0

09-17-2019 10:42 PDT

### New Features
- feat(breaking!): support API endpoint override ([#509](https://github.com/googleapis/cloud-profiler-nodejs/pull/509))
- chore: message to log agent version should be consistent with other agents ([#531](https://github.com/googleapis/cloud-profiler-nodejs/pull/531))
- chore: log the agent's version on start-up ([#530](https://github.com/googleapis/cloud-profiler-nodejs/pull/530))
- chore: log the agent's version on start-up ([#530](https://github.com/googleapis/cloud-profiler-nodejs/pull/530))

### Dependencies
- fix(deps): update dependency gcp-metadata to v3 ([#541](https://github.com/googleapis/cloud-profiler-nodejs/pull/541))
- chore(deps): pin pprof module ([#539](https://github.com/googleapis/cloud-profiler-nodejs/pull/539))
- chore(deps): update dependency nock to v11 ([#538](https://github.com/googleapis/cloud-profiler-nodejs/pull/538))
- chore(deps): update dependency source-map to ^0.7.0 ([#537](https://github.com/googleapis/cloud-profiler-nodejs/pull/537))
- Revert "chore(deps): update dependency nock to v11 ([#534](https://github.com/googleapis/cloud-profiler-nodejs/pull/534))" ([#535](https://github.com/googleapis/cloud-profiler-nodejs/pull/535))
- chore(deps): update dependency nock to v11 ([#534](https://github.com/googleapis/cloud-profiler-nodejs/pull/534))
- chore(deps): update dependency typescript to ~3.6.0 ([#532](https://github.com/googleapis/cloud-profiler-nodejs/pull/532))
- fix(dep): update to be compatible with @google-cloud/common 2.1.X ([#529](https://github.com/googleapis/cloud-profiler-nodejs/pull/529))
- fix(deps): use the latest extend ([#523](https://github.com/googleapis/cloud-profiler-nodejs/pull/523))

### Documentation
- docs: use the jsdoc-fresh theme ([#519](https://github.com/googleapis/cloud-profiler-nodejs/pull/519))
- docs: note support for Node 12 in documentation ([#540](https://github.com/googleapis/cloud-profiler-nodejs/pull/540))

### Internal / Testing Changes
- build: add Node 12 remove Node 11 ([#520](https://github.com/googleapis/cloud-profiler-nodejs/pull/520))
- update .nycrc ignore rules ([#536](https://github.com/googleapis/cloud-profiler-nodejs/pull/536))
- chore: confirm zone is set in e2e test ([#518](https://github.com/googleapis/cloud-profiler-nodejs/pull/518))
- build: use config file for linkinator ([#517](https://github.com/googleapis/cloud-profiler-nodejs/pull/517))

## v2.0.2

06-26-2019 08:59 PDT

### Dependencies
- chore(deps): update dependency typescript to ~3.5.0 ([#498](https://github.com/googleapis/cloud-profiler-nodejs/pull/498))
- chore(deps): update dependency js-green-licenses to v1 ([#503](https://github.com/googleapis/cloud-profiler-nodejs/pull/503))
- chore(deps): update sinon and @types/sinon ([#504](https://github.com/googleapis/cloud-profiler-nodejs/pull/504))
- fix(deps): update dependency pprof to v1 ([#487](https://github.com/googleapis/cloud-profiler-nodejs/pull/487))

### Documentation
- fix(docs): make anchors work in jsdoc ([#513](https://github.com/googleapis/cloud-profiler-nodejs/pull/513))
- docs: add repo-metadata for docs ([#511](https://github.com/googleapis/cloud-profiler-nodejs/pull/511))

### Internal / Testing Changes
- build: switch to GitHub magic proxy ([#510](https://github.com/googleapis/cloud-profiler-nodejs/pull/510))
- build: set correct src path for template ([#508](https://github.com/googleapis/cloud-profiler-nodejs/pull/508))
- build: use standard kokoro configuration ([#502](https://github.com/googleapis/cloud-profiler-nodejs/pull/502))
- chore: run gts fix ([#506](https://github.com/googleapis/cloud-profiler-nodejs/pull/506))
- build: share some code for E2E tests ([#505](https://github.com/googleapis/cloud-profiler-nodejs/pull/505))
- build: don't run test scripts in verbose mode ([#501](https://github.com/googleapis/cloud-profiler-nodejs/pull/501))
- build: ignore proto files in test coverage ([#497](https://github.com/googleapis/cloud-profiler-nodejs/pull/497))

## v2.0.1

05-23-2019 13:08 PDT

### Implementation Changes
- fix: agent should correctly set zone in GCP ([#489](https://github.com/googleapis/cloud-profiler-nodejs/pull/489))

### Dependencies
- fix(deps): remove unused dependencies ([#494](https://github.com/googleapis/cloud-profiler-nodejs/pull/494))
- refactor: drop dependency on pify ([#493](https://github.com/googleapis/cloud-profiler-nodejs/pull/493))

### Documentation
- doc: remove reference to Node 6 from documentation ([#485](https://github.com/googleapis/cloud-profiler-nodejs/pull/485))

### Internal / Testing Changes
- chore: retry npm install in system test when the command hangs  ([#491](https://github.com/googleapis/cloud-profiler-nodejs/pull/491))
- chore: remove unused third_party directory ([#486](https://github.com/googleapis/cloud-profiler-nodejs/pull/486))

## v2.0.0

05-14-2019 13:21 PDT

### Implementation Changes
- build: remove support for node 6 ([#472](https://github.com/googleapis/cloud-profiler-nodejs/pull/472))

### Dependencies
- fix(deps): update dependency gcp-metadata to v2 ([#481](https://github.com/googleapis/cloud-profiler-nodejs/pull/481))
- fix(deps): update dependency @google-cloud/common to v1 ([#482](https://github.com/googleapis/cloud-profiler-nodejs/pull/482))
- fix(deps): update dependency pretty-ms to v5 ([#464](https://github.com/googleapis/cloud-profiler-nodejs/pull/464))
- chore(deps): update dependency gts to v1 ([#474](https://github.com/googleapis/cloud-profiler-nodejs/pull/474))
- fix(deps): update dependency gaxios to v2 ([#469](https://github.com/googleapis/cloud-profiler-nodejs/pull/469))
- chore(deps): update dependency @types/nock to v10 ([#470](https://github.com/googleapis/cloud-profiler-nodejs/pull/470))
- chore(dep): update mocha to 6.1 ([#461](https://github.com/googleapis/cloud-profiler-nodejs/pull/461))

### Documentation
- Specify default logging level ([#483](https://github.com/googleapis/cloud-profiler-nodejs/pull/483))

### Internal / Testing Changes
- build: allow Node 10 to push to codecov ([#480](https://github.com/googleapis/cloud-profiler-nodejs/pull/480))
- build: patch Windows container, fixing Node 10 ([#479](https://github.com/googleapis/cloud-profiler-nodejs/pull/479))
- Revert "build!: upgrade engines field to >=8.10.0 ([#476](https://github.com/googleapis/cloud-profiler-nodejs/pull/476))" ([#477](https://github.com/googleapis/cloud-profiler-nodejs/pull/477))
- build!: upgrade engines field to >=8.10.0 ([#476](https://github.com/googleapis/cloud-profiler-nodejs/pull/476))
- chore: update to .nycrc with --all enabled ([#473](https://github.com/googleapis/cloud-profiler-nodejs/pull/473))
- fix: update dependencies for npm audit ([#468](https://github.com/googleapis/cloud-profiler-nodejs/pull/468))
- fix:  add es2015 as target for tsconfig.json ([#466](https://github.com/googleapis/cloud-profiler-nodejs/pull/466))
- chore: remove old kokoro configs ([#458](https://github.com/googleapis/cloud-profiler-nodejs/pull/458))

## v1.1.2

04-04-2019 13:05 PDT

No changes since last release.

Confirming that we can use [releasetool](https://github.com/googleapis/releasetool) to release the agent going forward.

redpajama_set_name: RedPajamaGithub


text:
package com.sun.jna;

/** Define conversion from a native type to the appropriate Java type. */
public interface FromNativeConverter {
    /** Convert the given native object into its Java representation using
     * the given context.
     */
    Object fromNative(Object nativeValue, FromNativeContext context);
    /** Indicate the native type used by this converter. */
    Class<?> nativeType();
}


text:
zfs create -V 10G -b $(getconf PAGESIZE) -o compression=zle \
      -o logbias=throughput -o sync=always \
      -o primarycache=metadata -o secondarycache=none \
      -o com.sun:auto-snapshot=false turtle/swap

mkswap -f /dev/turtle/swap
swapon /dev/turtle/swap


text:
<?xml version="1.0" encoding="utf-8"?>

<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
    <PreferenceCategory>
        <EditTextPreference android:passwo<caret>/>
    </PreferenceCategory>
</PreferenceScreen>


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Utility.Core
{
    interface IFilter
    {

    }
}


text:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="test.application.domainobjects.Item" table="item" mutable="true">
<id name ="id" type="int" column="id"> <generator class="assigned"/></id>
<property name="name" column="name" not-null="false" access="field"/>
<property name="manufacturer" column="manufacturer" not-null="false" access="field"/>
<property name="price" column="price" not-null="false" access="field"/>
<property name="customerid" column="customer_id" not-null="false" access="field"/>

</class>
</hibernate-mapping>


text:
package ttrpc

import (
	"context"
	"sync"
)

type streamID uint32

type streamMessage struct {
	header  messageHeader
	payload []byte
}

type stream struct {
	id     streamID
	sender sender
	recv   chan *streamMessage

	closeOnce sync.Once
	recvErr   error
}

func newStream(id streamID, send sender) *stream {
	return &stream{
		id:     id,
		sender: send,
		recv:   make(chan *streamMessage, 1),
	}
}

func (s *stream) closeWithError(err error) error {
	s.closeOnce.Do(func() {
		if s.recv != nil {
			close(s.recv)
			if err != nil {
				s.recvErr = err
			} else {
				s.recvErr = ErrClosed
			}

		}
	})
	return nil
}

func (s *stream) send(mt messageType, flags uint8, b []byte) error {
	return s.sender.send(uint32(s.id), mt, flags, b)
}

func (s *stream) receive(ctx context.Context, msg *streamMessage) error {
	if s.recvErr != nil {
		return s.recvErr
	}
	select {
	case s.recv <- msg:
		return nil
	case <-ctx.Done():
		return ctx.Err()
	}
}

type sender interface {
	send(uint32, messageType, uint8, []byte) error
}


text:
define([ "jquery" ], function($) {

  "use strict";

  var defaults = {
    selector: ".js-read-more",
    wrapper: ".js-read-more-wrapper",
    text: [ "Read more", "Read less" ],
    toggleIcons: [ "icon--chevron-down--before", "icon--chevron-up--before" ],
    toggleStyle: "btn btn--clear btn--small btn--icon js-handler",
    maxHeight: 2500,
    tolerance: 0
  };

  function ReadMore(args) {
    this.config = $.extend({}, defaults, args);
    this.$el = $(this.config.selector);
    this.$wrapper = this.$el.find(this.config.wrapper);

    this.$el.length && this._init();
  }

  ReadMore.prototype._init = function() {
    this.totalHeight = this.getFullHeight();

    this.states = {
      closed: {
        height: this.config.maxHeight,
        text: this.config.text[0],
        icon: this.config.toggleIcons[0]
      },
      open: {
        height: this.totalHeight,
        text: this.config.text[1],
        icon: this.config.toggleIcons[1]
      }
    };

    if (this.totalHeight > (this.config.maxHeight + this.config.tolerance)) {
      this.addToggle();
      this.setWrapperState("closed");
    } else {
      this.setWrapperState("open");
    }
  };

  ReadMore.prototype.getFullHeight = function() {
    var i, len,
       height = 0,
       $children = this.$wrapper.children();

    for (i = 0, len = $children.length; i < len; i++) {
      height += $children.eq(i).outerHeight(true);
    }

    return height;
  };

  ReadMore.prototype.addToggle = function() {
    this.$toggle = $("<button />")
      .attr("type", "button")
      .addClass(this.config.toggleStyle)
      .on("click", this.clickToggle.bind(this));

    this.$wrapper.append(this.$toggle);

    if (this.config.shadow) {
      this.$toggle.wrap("<div class='read-more__handler' />");
    }
  };

  ReadMore.prototype.clickToggle = function() {
    this.setWrapperState(this.status === "closed" ? "open" : "closed");
    this.onUpdate();
  };

  ReadMore.prototype.setWrapperState = function(state) {
    var lastStatus = this.status || (state === "closed" ? "open" : "closed");

    this.$el.removeClass("is-" + lastStatus).addClass("is-" + state);

    if (this.$toggle) {
      this.$toggle
        .removeClass(this.states[lastStatus].icon)
        .addClass(this.states[state].icon)
        .text(this.states[state].text);
    }

    this.$wrapper.css("max-height", this.states[state].height);

    this.status = state;
  };

  ReadMore.prototype.onUpdate = function() {
    if (this.config.delegate && this.config.delegate.onUpdate) {
      this.config.delegate.onUpdate.call(this, this.status, this.config.selector);
    }
  };

  return ReadMore;

});


text:
We renamed this module to [@webex/react-container-message-composer](https://www.npmjs.com/package/@webex/react-container-message-composer). Please install it instead.

## License

© 2016-2020 Cisco and/or its affiliates. All Rights Reserved.


text:
-- MySQL dump 10.13  Distrib 5.6.24, for Win64 (x86_64)
--
-- Host: 192.168.64.128    Database: yiidb
-- ------------------------------------------------------
-- Server version	5.5.49-0ubuntu0.14.04.1

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;

--
-- Table structure for table `authorisiertenummern`
--

DROP TABLE IF EXISTS `authorisiertenummern`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `authorisiertenummern` (
  `nummer` varchar(255) CHARACTER SET utf8 NOT NULL,
  `name` varchar(255) CHARACTER SET utf8 NOT NULL,
  PRIMARY KEY (`nummer`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `authorisiertenummern`
--

LOCK TABLES `authorisiertenummern` WRITE;
/*!40000 ALTER TABLE `authorisiertenummern` DISABLE KEYS */;
/*!40000 ALTER TABLE `authorisiertenummern` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

-- Dump completed on 2016-05-11 11:55:40


text:
package com.yahoo.glimmer.indexing.generator;

import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;

import org.apache.hadoop.io.RawComparator;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.io.WritableComparable;
import org.apache.hadoop.io.WritableComparator;
import org.apache.hadoop.io.WritableUtils;
import org.apache.hadoop.mapreduce.lib.partition.HashPartitioner;

/**
 *
 * @author pmika
 *
 */
public class TermKey implements WritableComparable<TermKey> {
    // The term is set to this when the values Type is DOC_SIZE.
    public static final String DOC_SIZE_TERM = "";
    private int index;
    private String term;
    // We want hadoop to sort our values too. So the initial sort includes the
    // value in the key. The FirstGroupingComparator is then used to group all
    // values for each index/term pair.
    private TermValue value = new TermValue();

    /*
     * Required for Hadoop
     */
    public TermKey() {
    }

    public TermKey(String term, int index, TermValue value) {
	this.index = index;
	this.term = term;
	this.value = value;
    }

    public String getTerm() {
	return term;
    }

    public int getIndex() {
	return index;
    }

    public TermValue getValue() {
	return value;
    }

    public void readFields(DataInput in) throws IOException {
	value.readFields(in);
	index = in.readInt();
	term = Text.readString(in);
    }

    public void write(DataOutput out) throws IOException {
	value.write(out);
	out.writeInt(index);
	Text.writeString(out, term);
    }

    public int compareTo(TermKey top) {
	if (!term.equals(top.term)) {
	    return term.compareTo(top.term);
	} else if (index != top.index) {
	    return ((Integer) index).compareTo(top.index);
	} else {
	    return value.compareTo(top.value);
	}
    }

    @Override
    public int hashCode() {
	int hash = 31 * value.hashCode() + index;
	return 31 * hash + term.hashCode();
    }

    @Override
    public boolean equals(Object right) {
	if (right instanceof TermKey) {
	    TermKey r = (TermKey) right;
	    return term.equals(r.term) && index == r.index && (value == null ? r.value == null : value.equals(r.value));
	} else {
	    return false;
	}
    }

    public String toString() {
	return Integer.toString(index) + ":" + term + ":" + (value == null ? "null" : value.toString());
    }

    private static final int TYPE_BYTE_OFFSET = 0;
    private static final int V1_BYTE_OFFSET = Integer.SIZE / 8;
    private static final int V2_BYTE_OFFSET = V1_BYTE_OFFSET + Long.SIZE / 8;
    private static final int INDEX_BYTE_OFFSET = V2_BYTE_OFFSET + Integer.SIZE / 8;
    private static final int TERM_BYTE_OFFSET = INDEX_BYTE_OFFSET + Integer.SIZE / 8;

    /** A Comparator that compares serialized TermKey objects. */
    public static class Comparator extends WritableComparator {
	public Comparator() {
	    super(TermKey.class, true);
	}

	public int compare(byte[] b1, int s1, int l1, byte[] b2, int s2, int l2) {
	    // Compare the index
	    int index1 = WritableComparator.readInt(b1, s1 + INDEX_BYTE_OFFSET);
	    int index2 = WritableComparator.readInt(b2, s2 + INDEX_BYTE_OFFSET);
	    int d = index1 - index2;
	    if (d == 0) {
		// Compare the term

		// first byte of string encodes the length of the size
		// length1 & 2 are the byte length of the serialized strings
		// length
		int length1 = WritableUtils.decodeVIntSize(b1[s1 + TERM_BYTE_OFFSET]);
		int length2 = WritableUtils.decodeVIntSize(b2[s2 + TERM_BYTE_OFFSET]);
		d = compareBytes(b1, s1 + TERM_BYTE_OFFSET + length1, l1 - TERM_BYTE_OFFSET - length1, b2, s2 + TERM_BYTE_OFFSET + length2, l2
			- TERM_BYTE_OFFSET - length2);

		if (d == 0) {
		    // Compare the values types
		    int type1 = WritableComparator.readInt(b1, s1 + TYPE_BYTE_OFFSET);
		    int type2 = WritableComparator.readInt(b2, s2 + TYPE_BYTE_OFFSET);
		    d = type1 - type2;
		    if (d == 0) {
			// Compare the values v1s
			long v11 = WritableComparator.readLong(b1, s1 + V1_BYTE_OFFSET);
			long v12 = WritableComparator.readLong(b2, s2 + V1_BYTE_OFFSET);
			long dl = v11 - v12;
			if (dl != 0) {
			    d = dl > 0 ? 1 : -1;
			} else {
			    // Compare the values v2s
			    int v21 = WritableComparator.readInt(b1, s1 + V2_BYTE_OFFSET);
			    int v22 = WritableComparator.readInt(b2, s2 + V2_BYTE_OFFSET);
			    d = v21 - v22;
			}
		    }
		}
	    }

	    return d;
	}
    }

    /**
     * Compare only the term and index of the pair, so that reduce is called
     * once for each value of the first part.
     *
     * NOTE: first part (i.e. index and term) are serialized first
     */
    public static class FirstGroupingComparator implements RawComparator<TermKey> {

	public int compare(byte[] b1, int s1, int l1, byte[] b2, int s2, int l2) {
	    // Compare the index
	    int index1 = WritableComparator.readInt(b1, s1 + INDEX_BYTE_OFFSET);
	    int index2 = WritableComparator.readInt(b2, s2 + INDEX_BYTE_OFFSET);
	    int d = index1 - index2;
	    if (d == 0) {
		// Compare the term

		// first byte of string encodes the length of the size
		// length1 & 2 are the byte length of the serialized strings
		// length
		int length1 = WritableUtils.decodeVIntSize(b1[s1 + TERM_BYTE_OFFSET]);
		int length2 = WritableUtils.decodeVIntSize(b2[s2 + TERM_BYTE_OFFSET]);
		d = WritableComparator.compareBytes(b1, s1 + TERM_BYTE_OFFSET + length1, l1 - TERM_BYTE_OFFSET - length1, b2, s2 + TERM_BYTE_OFFSET + length2,
			l2 - TERM_BYTE_OFFSET - length2);
	    }
	    return d;
	}

	public int compare(TermKey o1, TermKey o2) {
	    if (!o1.getTerm().equals(o2.getTerm())) {
		return o1.getTerm().compareTo(o2.getTerm());
	    } else if (o1.getIndex() != o2.getIndex()) {
		return ((Integer) o1.getIndex()).compareTo(o2.getIndex());
	    }
	    return 0;
	}
    }

    /**
     * Partition based only on the term. All occurrences of a term are processed
     * by the same reducer instance.
     */
    public static class FirstPartitioner extends HashPartitioner<TermKey, TermValue> {
	@Override
	public int getPartition(TermKey key, TermValue value, int numPartitions) {
	    return (int)(Math.abs(key.getTerm().hashCode() * 127l) % numPartitions);
	}
    }
}


text:
.ui.grid.media-thumbnails {
    margin-right: -.3rem;
    margin-left: -.3rem;
}
.ui.grid.media-thumbnails>.column {
    padding-left: .3rem;
    padding-right: .3rem;
}


text:
/*jshint esversion: 6 */
/*global window, document, console, media*/
(function () {
	var commands = {
		'play intro': {
			description: 'Plays the introduction of Doctor Who for this game',
			run: function () {
				return new Promise((resolve, reject) => {
					console.clear();
					$('game/chapters/introduction/title.htm').then((title) => {
						console.clear();
						document.body.innerHTML = title;
						media.playMusic('media/music/intro.mp3', false);
					});
					setTimeout(() => {
						reject();
					}, 15000);
				});
			}
		},
		'play intro long': {
			description: 'Plays a longer version of the introduction (Audio only)',
			run: function () {
				media.playMusic('media/music/intro-long.mp3');
				return Promise.reject();
			}
		},
		'play intro fast': {
			description: 'Plays a faster version of the introduction (Audio only)',
			run: function () {
				media.playMusic('media/music/intro-long-fast.mp3');
				return Promise.reject();
			}
		},
		'play dooms': {
			description: 'Play a MIDI interpretation of Doomsday (Murray Gold)',
			run: function () {
				media.playMusic('media/music/dooms.mp3', false);
				return Promise.reject();
			}
		},
		'play wors': {
			description: 'Play a MIDI interpretation of Wedding of River Song (Murray Gold)',
			run: function () {
				media.playMusic('media/music/wors.mp3', false);
				return Promise.reject();
			}
		},
		'play tls': {
			description: 'Play a MIDI interpretation of The Long Song (Murray Gold)',
			run: function () {
				media.playMusic('media/music/tls.mp3', false);
				return Promise.reject();
			}
		},
		'play iatd': {
			description: 'Play a MIDI interpretation of I am The Doctor (Murray Gold)',
			run: function () {
				media.playMusic('media/music/iatd.mp3', false);
				return Promise.reject();
			}
		},
		'setcolor commandline': {
			description: 'Set the color of the terminal to gray',
			run: function () {
				document.body.setAttribute('class', 'commandline');
				return Promise.reject();
			}
		},
		'setcolor terminal': {
			description: 'Set the color of the terminal to (lime) green',
			run: function () {
				document.body.setAttribute('class', 'terminal');
				return Promise.reject();
			}
		},
		'setcolor doctorwho': {
			description: 'Set the color of the terminal to blue',
			run: function () {
				document.body.setAttribute('class', 'doctorwho');
				return Promise.reject();
			}
		},
		'show changelog': {
			description: 'Shows the changelog between Ludum Dare #39 and now.',
			run: function () {
				return new Promise((resolve, reject) => {
					$('game/chapters/introduction/changelog.txt').then((changelog) => {
						console.type(changelog, 1.5, true, false).then(() => {
							reject();
						});
					});
				});
			}
		},
		'test typewriter': {
			description: 'Types out a random quote of The Bible as part of a typing test',
			run: function () {
				return new Promise((resolve, reject) => {
					console.clear();
					var background = document.createElement('div');
					background.innerHTML = `

`;
					background.style.display = 'none';
					document.body.appendChild(background);
					console.debug('Typewriter test using quotes from The Bible');
					$('game/random/quotes.json').then((quotes) => {
						var skip = document.createElement('pre');
						skip.innerText = 'Press Ctrl-C to stop after current quote';
						skip.style.position = 'absolute';
						skip.style.top = '0px';
						skip.style.right = '0px';
						skip.style.display = 'inline-block';
						skip.style.background = 'rgba(0, 0, 0, 0.5)';
						skip.style.padding = '10px';
						skip.style.margin = '0';
						skip.setAttribute('class', 'commandline');

						var exit = false;
						window.onkeydown = function(e) {
							if (e.key.toLowerCase() === 'c' && e.ctrlKey) {
								window.onkeydown = null;
								exit = true;
							}
						};

						var endless = function() {
							//console.clear();
							document.body.appendChild(skip);
							console.type(quotes[randInt(0, quotes.length - 1)], 1, false).then((p) => {
								setTimeout(() => {
									if (exit) {
										console.clear();
										reject();
									} else {
										p.remove();
										endless();
									}
								}, 2500);
							});
						}
						endless();

					});

				});
			}
		}
	};
	commands['play'] = {
		description: 'Play the game',
		run: function () {
			return new Promise(function (resolve, reject) {
				console.type('Let\'s roll...', 1, true, true).then(function() {
					console.clear();
					$('game/chapters/introduction/introduction.txt').then(function (intro) {
						//media.playMusic('media/music/iatd.mp3');
						console.type(intro).then(() => {
							intro = undefined;
							commands['play intro'].run().catch(() => {
								$('game/chapters/1/main.js');
							});
						});
					});
				});
			})
		}
	};
	commands['help'] = {
		description: 'Shows helpful information on the commands available',
		run: function () {
			return new Promise(function (resolve, reject) {
				var keys = Object.keys(commands).sort();
				var str = '';
				for (var i = 0; i < keys.length; i++) {
					var cmd = commands[keys[i]];

					str += keys[i] + ' - ' + cmd.description + '\n';
				}
				console.print(str).then(() => {
					reject();
				})
			});
		}
	};
	return commands;
}());


text:
namespace OJS.Common.Tests.StringExtensions
{
    using NUnit.Framework;

    using OJS.Common.Extensions;

    [TestFixture]
    public class GetFileExtensionTests
    {
        [Test]
        public void GetFileExtensionShouldReturnEmptyStringWhenEmptyStringIsPassed()
        {
            string expected = string.Empty;
            string value = string.Empty;
            string actual = value.GetFileExtension();

            Assert.AreEqual(expected, actual);
        }

        [Test]
        public void GetFileExtensionShouldReturnEmptyStringWhenNullIsPassed()
        {
            string expected = string.Empty;
            string actual = ((string)null).GetFileExtension();
            Assert.AreEqual(expected, actual);
        }

        [Test]
        public void GetFileExtensionShouldReturnJpgWhenValidImageIsPassed()
        {
            string expected = "jpg";
            string value = "pic.jpg";
            string actual = value.GetFileExtension();
            Assert.AreEqual(expected, actual);
        }

        [Test]
        public void GetFileExtensionShouldReturnPngWhenValidImageWithManyDotsIsPassed()
        {
            string expected = "png";
            string value = "pic.test.value.jpg.png";
            string actual = value.GetFileExtension();
            Assert.AreEqual(expected, actual);
        }

        [Test]
        public void GetFileExtensionShouldReturnEmptyStringWhenFileDoesNotHaveExtension()
        {
            string expected = string.Empty;
            string value = "testing";
            string actual = value.GetFileExtension();
            Assert.AreEqual(expected, actual);
        }

        [Test]
        public void GetFileExtensionShouldReturnEmptyStringWhenFileEndsInADot()
        {
            string expected = string.Empty;
            string value = "testing.";
            string actual = value.GetFileExtension();
            Assert.AreEqual(expected, actual);
        }

        [Test]
        public void GetFileExtensionShouldReturnEmptyStringWhenFileContainsManyDotsAndEndsInADot()
        {
            string expected = string.Empty;
            string value = "testing.jpg.value.gosho.";
            string actual = value.GetFileExtension();
            Assert.AreEqual(expected, actual);
        }
    }
}


text:
<?php

declare (strict_types=1);
namespace Rector\DeadCode\Comparator\Parameter;

use PhpParser\Node\Expr\StaticCall;
use PhpParser\Node\Stmt\ClassMethod;
use Rector\NodeCollector\Reflection\MethodReflectionProvider;
final class ParameterTypeComparator
{
    /**
     * @var \Rector\NodeCollector\Reflection\MethodReflectionProvider
     */
    private $methodReflectionProvider;
    public function __construct(\Rector\NodeCollector\Reflection\MethodReflectionProvider $methodReflectionProvider)
    {
        $this->methodReflectionProvider = $methodReflectionProvider;
    }
    public function compareCurrentClassMethodAndParentStaticCall(\PhpParser\Node\Stmt\ClassMethod $classMethod, \PhpParser\Node\Expr\StaticCall $staticCall) : bool
    {
        $currentParameterTypes = $this->methodReflectionProvider->provideParameterTypesByClassMethod($classMethod);
        $parentParameterTypes = $this->methodReflectionProvider->provideParameterTypesByStaticCall($staticCall);
        foreach ($currentParameterTypes as $key => $currentParameterType) {
            if (!isset($parentParameterTypes[$key])) {
                continue;
            }
            $parentParameterType = $parentParameterTypes[$key];
            if (!$currentParameterType->equals($parentParameterType)) {
                return \false;
            }
        }
        return \true;
    }
}


text:
'use strict';

angular.module('myApp.historicalData', ['ngRoute'])

.config(['$routeProvider', function($routeProvider) {
  $routeProvider.when('/historicalData', {
    templateUrl: 'historicalData/historicalData.html',
    controller: 'HistoricalDataCtrl'
  });
}])

.controller('HistoricalDataCtrl', ['$scope', 'MotionSensorDataService', '$sce', function($scope, MotionSensorDataService, $sce) {

  MotionSensorDataService.getRawData().then(function(response) {
    $scope.trustedRawData = $sce.trustAsHtml(response.data);
  });

}]);


text:
package ru.job4j.search;

import org.junit.Test;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;

import static org.hamcrest.core.Is.is;
import static org.junit.Assert.assertThat;

public class UserConvertTest {
    @Test
    public void whenAddUsersToListAndConvertToMap() {
        User user1 = new User(1, "Grubby", "Amsterdam");
        User user2 = new User(2, "Tod", "Paris");
        User user3 = new User(3, "Moon", "Seoul");

        List<User> list = new ArrayList<>(Arrays.asList(user1, user2, user3));
        UserConvert userConvert = new UserConvert();
        HashMap<Integer, User> confirm = new HashMap<>();
        confirm.put(1, user1);
        confirm.put(2, user2);
        confirm.put(3, user3);
        assertThat(confirm.get(2).city, is(userConvert.process(list).get(2).city));
    }
}


text:
<title>Setting Derby properties for a project</title>

Setting Derby properties for a project

Properties relating to Apache Derby can be specified for any project
which has had the Apache Derby nature added to it.  The two categories
of properties available to change are the Network Server and Derby System
properties.

Network Server Properties

By starting the Derby Network Server using the default values the
server runs on the localhost, which is the host running Eclipse,
on port 1527.

The value used for the Network Server host name impacts the ability of
remote hosts to connect to the Network Server.  If the Network Server
Host value in the Apache Derby Properties for the project is set to
localhost, only clients running on the host where Eclipse is
running can connect to the network server.  If an ip address or hostname
(other than the name 'localhost')
is used, client applications running on other hosts can connect to the
Derby Network Server.  For additional information about starting the Derby
Network Server see the Derby Server and Administration Guide.
The section called Starting the Network Server explains the effect
of setting the value for the hostname differently.

If connections from other hosts is allowed, it is recommended to run
under the Java security manager and enable user authentication prior to
starting the Derby Network Server.

Network Server Settings

Network Server Port - default value of 1527

Valid values for this field are:

Any port number not currently used by another process to listen on

Network Server Host - default value of localhost

Valid values for this field are:

localhost

The ip address of the host running Eclipse

The host name of the host running Eclipse

The ip address of 0.0.0.0 (to listen on all interfaces)

Derby System Properties

gemfirexd.system.home refers to the file system directory where the
Derby database system will look for databases when Derby is started.
Setting this property allows for ease of use when specifiying a JDBC
connection URL to a Derby database which is not in the current directory.
For additional information on gemfirexd.system.home refer to the Tuning Derby guide.

Derby System Property values

gemfirexd.system.home - default value of '.', the current project directory

Valid values for this field are:

A directory path on the local host. Either an existing directory or a new
one which has not yet been created.

Changing the default Apache Derby properties for a project

With the Java project active in the Package Explorer or Navigator
view, select the menu item Project, Properties.

The list of properties available to modify for the project appears.  Select
the Apache Derby item in the list.

Make any of the desired changes to the Apache Derby settings.


text:
source ../testsupport.sh

run test.txt

exists hello.txt

exists hello.there.txt fubar.csv

grep -q there fubar.csv && err "Found 'there' in output file indicating wrong input used in stage world"

true


text:
class SetupProteinFamilyRelation < ActiveRecord::Migration
  def change
    change_table :protein_relationships do |t|
      t.column :feature_id, :integer
      t.column :related_feature_id, :integer
    end
  end
end


text:
namespace marisa_alpha {

Trie::Trie()
    : louds_(), labels_(), terminal_flags_(), link_flags_(), links_(),
      trie_(), tail_(), num_first_branches_(0), num_keys_(0) {}

void Trie::mmap(Mapper *mapper, const char *filename,
    long offset, int whence) {
  MARISA_ALPHA_THROW_IF(mapper == NULL, MARISA_ALPHA_PARAM_ERROR);
  Mapper temp_mapper;
  temp_mapper.open(filename, offset, whence);
  map(temp_mapper);
  temp_mapper.swap(mapper);
}

void Trie::map(const void *ptr, std::size_t size) {
  Mapper mapper(ptr, size);
  map(mapper);
}

void Trie::map(Mapper &mapper) {
  Trie temp;
  temp.louds_.map(mapper);
  temp.labels_.map(mapper);
  temp.terminal_flags_.map(mapper);
  temp.link_flags_.map(mapper);
  temp.links_.map(mapper);
  temp.tail_.map(mapper);
  mapper.map(&temp.num_first_branches_);
  mapper.map(&temp.num_keys_);

  if (temp.has_link() && !temp.has_tail()) {
    temp.trie_.reset(new (std::nothrow) Trie);
    MARISA_ALPHA_THROW_IF(!temp.has_trie(), MARISA_ALPHA_MEMORY_ERROR);
    temp.trie_->map(mapper);
  }
  temp.swap(this);
}

void Trie::load(const char *filename,
    long offset, int whence) {
  Reader reader;
  reader.open(filename, offset, whence);
  read(reader);
}

void Trie::fread(std::FILE *file) {
  Reader reader(file);
  read(reader);
}

void Trie::read(int fd) {
  Reader reader(fd);
  read(reader);
}

void Trie::read(std::istream &stream) {
  Reader reader(&stream);
  read(reader);
}

void Trie::read(Reader &reader) {
  Trie temp;
  temp.louds_.read(reader);
  temp.labels_.read(reader);
  temp.terminal_flags_.read(reader);
  temp.link_flags_.read(reader);
  temp.links_.read(reader);
  temp.tail_.read(reader);
  reader.read(&temp.num_first_branches_);
  reader.read(&temp.num_keys_);

  if (temp.has_link() && !temp.has_tail()) {
    temp.trie_.reset(new (std::nothrow) Trie);
    MARISA_ALPHA_THROW_IF(!temp.has_trie(), MARISA_ALPHA_MEMORY_ERROR);
    temp.trie_->read(reader);
  }
  temp.swap(this);
}

void Trie::save(const char *filename, bool trunc_flag,
    long offset, int whence) const {
  Writer writer;
  writer.open(filename, trunc_flag, offset, whence);
  write(writer);
}

void Trie::fwrite(std::FILE *file) const {
  Writer writer(file);
  write(writer);
}

void Trie::write(int fd) const {
  Writer writer(fd);
  write(writer);
}

void Trie::write(std::ostream &stream) const {
  Writer writer(&stream);
  write(writer);
}

void Trie::write(Writer &writer) const {
  louds_.write(writer);
  labels_.write(writer);
  terminal_flags_.write(writer);
  link_flags_.write(writer);
  links_.write(writer);
  tail_.write(writer);
  writer.write(num_first_branches_);
  writer.write(num_keys_);
  if (has_trie()) {
    trie_->write(writer);
  }
}

std::size_t Trie::num_tries() const {
  return has_trie() ? (trie_->num_tries() + 1) : (louds_.empty() ? 0 : 1);
}

std::size_t Trie::num_nodes() const {
  if (louds_.empty()) {
    return 0;
  }
  std::size_t num_nodes = (louds_.size() / 2) - 1;
  if (has_trie()) {
    num_nodes += trie_->num_nodes();
  }
  return num_nodes;
}

std::size_t Trie::total_size() const {
  return louds_.total_size() + labels_.total_size()
      + terminal_flags_.total_size() + link_flags_.total_size()
      + links_.total_size() + (has_trie() ? trie_->total_size() : 0)
      + tail_.total_size() + sizeof(num_first_branches_) + sizeof(num_keys_);
}

void Trie::clear() {
  Trie().swap(this);
}

void Trie::swap(Trie *rhs) {
  MARISA_ALPHA_THROW_IF(rhs == NULL, MARISA_ALPHA_PARAM_ERROR);
  louds_.swap(&rhs->louds_);
  labels_.swap(&rhs->labels_);
  terminal_flags_.swap(&rhs->terminal_flags_);
  link_flags_.swap(&rhs->link_flags_);
  links_.swap(&rhs->links_);
  Swap(&trie_, &rhs->trie_);
  tail_.swap(&rhs->tail_);
  Swap(&num_first_branches_, &rhs->num_first_branches_);
  Swap(&num_keys_, &rhs->num_keys_);
}

}  // namespace marisa_alpha


text:
With git-tfs, you could manage TFS shelvesets.

If you began to use git-tfs to move away of TFS, perhaps you want to import into git some existing shelvesets.
Let's see how to do it!

# Listing existing shelvesets

The first thing to do to use an existing shelveset is to find it among your shelvesets or the ones of the other users.
To do that, you should them with the `shelve-list` command.

## List your shelvesets.

If you want to list your shelvesets, just do:

    git tfs shelve-list

The output of this command looks like that:

	SND\vtccds_cp          feature, find the good client
	SND\vtccds_cp          better solution

For each changeset, you've first the user login and then, what we need, the name of the shelveset!

Note :
* use the `--full` option to get more informations
* Shelvesets are sorted by date by default

## List the shelvesets of all the TFS users.

If you want to include in the list the shelvesets of all the users, just do:

    git tfs shelve-list -u=all

# Unshelve a shelveset

Once you've found the name of the shelveset, you could use the `unshelve` command to fetch the shelveset in your repository.

## Unshelve one of your shelveset

When you want to unshelve a shelveset, the changeset defined by the shelveset is automatically created in a new branch.
You only have to specify the name of the shelveset and the name of the branch that will be created.

    git tfs unshelve "better solution" MyShelvesetBranch

Note: - the branch is automatically created on the parent commit of the changeset

## Unshelve a shelveset of another user

To do that, you should specify the login of the user in addition to the shelveset name:

    git tfs unshelve -u=loginUser "paul solution" MyBranch

# Create a shelveset

Perhaps, for a reason of another, you should want to create a shelveset to exchange code with user still using TFS ( :( for them )
A shelveset is created with the changes of the commits done in the current branch since the last commit fetch from TFS.
To create the shelveset, just do:

    git tfs shelve "try to solve bug234"


text:
var Aria = require("../../Aria");
var ariaUtilsType = require("../Type");
var ariaUtilsValidatorsValidator = require("./Validator");

/**
 * Validator for the object type.
 */
module.exports = Aria.classDefinition({
    $classpath : "aria.utils.validators.Object",
    $extends : ariaUtilsValidatorsValidator,
    $prototype : {

        /**
         * validate will always fail by default.
         * @param {String} value
         * @return {Object}
         */
        validate : function (value) {
            if (value === null || ariaUtilsType.isObject(value)) {
                return this._validationSucceeded();
            }
            return this._validationFailed();
        }
    }
});


text:
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: google/cloud/aiplatform/v1/env_var.proto

package com.google.cloud.aiplatform.v1;

public final class EnvVarProto {
  private EnvVarProto() {}

  public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {}

  public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) {
    registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry);
  }

  static final com.google.protobuf.Descriptors.Descriptor
      internal_static_google_cloud_aiplatform_v1_EnvVar_descriptor;
  static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internal_static_google_cloud_aiplatform_v1_EnvVar_fieldAccessorTable;

  public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
    return descriptor;
  }

  private static com.google.protobuf.Descriptors.FileDescriptor descriptor;

  static {
    java.lang.String[] descriptorData = {
      "\n(google/cloud/aiplatform/v1/env_var.pro"
          + "to\022\032google.cloud.aiplatform.v1\032\037google/a"
          + "pi/field_behavior.proto\"/\n\006EnvVar\022\021\n\004nam"
          + "e\030\001 \001(\tB\003\340A\002\022\022\n\005value\030\002 \001(\tB\003\340A\002B\317\001\n\036com"
          + ".google.cloud.aiplatform.v1B\013EnvVarProto"
          + "P\001ZDgoogle.golang.org/genproto/googleapi"
          + "s/cloud/aiplatform/v1;aiplatform\252\002\032Googl"
          + "e.Cloud.AIPlatform.V1\312\002\032Google\\Cloud\\AIP"
          + "latform\\V1\352\002\035Google::Cloud::AIPlatform::"
          + "V1b\006proto3"
    };
    descriptor =
        com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom(
            descriptorData,
            new com.google.protobuf.Descriptors.FileDescriptor[] {
              com.google.api.FieldBehaviorProto.getDescriptor(),
            });
    internal_static_google_cloud_aiplatform_v1_EnvVar_descriptor =
        getDescriptor().getMessageTypes().get(0);
    internal_static_google_cloud_aiplatform_v1_EnvVar_fieldAccessorTable =
        new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
            internal_static_google_cloud_aiplatform_v1_EnvVar_descriptor,
            new java.lang.String[] {
              "Name", "Value",
            });
    com.google.protobuf.ExtensionRegistry registry =
        com.google.protobuf.ExtensionRegistry.newInstance();
    registry.add(com.google.api.FieldBehaviorProto.fieldBehavior);
    com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor(
        descriptor, registry);
    com.google.api.FieldBehaviorProto.getDescriptor();
  }

  // @@protoc_insertion_point(outer_class_scope)
}


text:
            <md-icon md-font-icon="icon-folder" class="icon s24"></md-icon>

        File Manager

John Doe

        <md-select class="account-selection simplified" ng-model="vm.selectedAccount" placeholder="Select Account">
            <md-option ng-repeat="(provider, address) in vm.accounts" value="{{provider}}">{{address}}</md-option>
        </md-select>

        <md-button class="item" aria-label="inbox">

                <md-icon md-font-icon="icon-folder" class="s16"></md-icon>

My Files

        </md-button>

        <md-button class="item" aria-label="starred">

                <md-icon md-font-icon="icon-star" class="s16"></md-icon>

Starred

        </md-button>

        <md-button class="item" aria-label="starred">

                <md-icon md-font-icon="icon-folder-account" class="s16"></md-icon>

Sharred with me

        </md-button>

        <md-button class="item" aria-label="starred">

                <md-icon md-font-icon="icon-clock" class="s16"></md-icon>

Recent

        </md-button>

        <md-button class="item" aria-label="starred">

                <md-icon md-font-icon="icon-checkbox-marked-circle" class="s16"></md-icon>

Offline

        </md-button>


text:
//-----------------------------------------------------------------------
// <copyright file="CustomEventFilter.cs" company="Akka.NET Project">
//     Copyright (C) 2009-2015 Typesafe Inc. <http://www.typesafe.com>
//     Copyright (C) 2013-2015 Akka.NET project <https://github.com/akkadotnet/akka.net>
// </copyright>
//-----------------------------------------------------------------------

using System;
using Akka.Event;

namespace Akka.TestKit.Internal
{
    /// <summary>
    /// <remarks>Note! Part of internal API. Breaking changes may occur without notice. Use at own risk.</remarks>
    /// </summary>
    public class CustomEventFilter : EventFilterBase
    {
        private readonly Predicate<LogEvent> _predicate;

        public CustomEventFilter(Predicate<LogEvent> predicate)
            : base(null, null)
        {
            _predicate = predicate;
        }

        protected override bool IsMatch(LogEvent evt)
        {
            return _predicate(evt);
        }

        protected override string FilterDescriptiveName { get { return "Custom"; } }
    }
}


text:
package com.navercorp.pinpoint.web.filter;

import com.navercorp.pinpoint.common.server.bo.AnnotationBo;
import com.navercorp.pinpoint.common.server.bo.SpanBo;
import com.navercorp.pinpoint.common.server.bo.SpanEventBo;
import com.navercorp.pinpoint.common.service.AnnotationKeyRegistryService;
import com.navercorp.pinpoint.common.service.ServiceTypeRegistryService;
import com.navercorp.pinpoint.common.trace.AnnotationKey;
import com.navercorp.pinpoint.common.trace.ServiceType;
import org.apache.commons.codec.binary.Base64;
import org.springframework.util.AntPathMatcher;

import java.nio.charset.Charset;
import java.util.List;

/**
 * @author emeroad
 */
// TODO development class
public class RpcURLPatternFilter implements URLPatternFilter {

    private static final Charset UTF8 = Charset.forName("UTF-8");
    private final String urlPattern;
    private final AntPathMatcher matcher = new AntPathMatcher();
    private final ServiceTypeRegistryService serviceTypeRegistryService;
    private final AnnotationKeyRegistryService annotationKeyRegistryService;

    // TODO remove. hard coded annotation for compatibility
    @Deprecated
    private final AnnotationKey npcUrl;

    public RpcURLPatternFilter(String urlPattern, ServiceTypeRegistryService serviceTypeRegistryService, AnnotationKeyRegistryService annotationKeyRegistryService) {
        if (urlPattern == null) {
            throw new NullPointerException("urlPattern must not be null");
        }
        // TODO remove decode
        this.urlPattern = new String(Base64.decodeBase64(urlPattern), UTF8);
        // TODO serviceType rpctype

        this.serviceTypeRegistryService = serviceTypeRegistryService;
        this.annotationKeyRegistryService = annotationKeyRegistryService;
        this.npcUrl = this.annotationKeyRegistryService.findAnnotationKeyByName("npc.url");
    }

    @Override
    public boolean accept(List<SpanBo> fromSpanList) {
        for (SpanBo spanBo : fromSpanList) {
            List<SpanEventBo> spanEventBoList = spanBo.getSpanEventBoList();
            if (spanEventBoList == null) {
                return REJECT;
            }

            for (SpanEventBo event : spanEventBoList) {
                final ServiceType eventServiceType = serviceTypeRegistryService.findServiceType(event.getServiceType());
                if (!eventServiceType.isRpcClient()) {
                    continue;
                }
                if (!eventServiceType.isRecordStatistics()) {
                    continue;
                }
//                http://api.domain.com/test/ArticleList.do
//                slice url ->/test/ArticleList.do
                final List<AnnotationBo> annotationBoList = event.getAnnotationBoList();
                if (annotationBoList == null) {
                    continue;
                }
                for (AnnotationBo annotationBo : annotationBoList) {
//                    TODO ?? url format & annotation type detect
                    int key = annotationBo.getKey();
                    if (isURL(key)) {
                        String url = (String) annotationBo.getValue();
                        String path = getPath(url);
                        final boolean match = matcher.match(urlPattern, path);
                        if (match) {
                            return ACCEPT;
                        }
                    }
                }

            }
        }

        return REJECT;
    }

    private boolean isURL(int key) {
        return key == AnnotationKey.HTTP_URL.getCode() || key == npcUrl.getCode();
    }

    private String getPath(String endPoint) {
        if (endPoint == null) {
            return  null;
        }
        // is URI format
        final int authorityIndex = endPoint.indexOf("://");
        if (authorityIndex == -1) {
            return endPoint;
        }
        final int pathIndex = endPoint.indexOf('/', authorityIndex + 1);
        if (pathIndex == -1) {
//            ???
            return endPoint;
        }
        return endPoint.substring(pathIndex+1);
    }
}


text:
<?php

namespace Maladie\Controller;

use Zend\Mvc\Controller\AbstractActionController;
use Zend\View\Model\ViewModel;
use Maladie\Form\ArticleForm;
use Zend\Json\Json;

class MaladieController extends AbstractActionController
{
	protected $articleTable;

	public function getArticleTable()
	{
		if (!$this->articleTable) {
			$sm = $this->getServiceLocator();
			$this->articleTable = $sm->get('Maladie\Model\ArticleTable');
		}
		return $this->articleTable;
	}

    /**** MENU Maladie ****/
    /**** MENU Maladie ****/
    public function maladieAction()
    {
    	//@todo - Implement indexAction
    	$layout = $this->layout();
    	$layout->setTemplate('layout/maladielayout');

    	$listeArticle = $this->getArticleTable()->getListeArticleAuteur();

    	$outilsutilisateurs = new ViewModel();
    	$outilsutilisateurs->setTemplate('layout/outilsutilisateurslayout');

    	$blogrightsidebar = new ViewModel();
    	$blogrightsidebar->setTemplate('layout/blogrightsidebarlayout');

    	$recherche = new ViewModel();
    	$recherche->setTemplate('layout/recherchelayout');
    	$motscles = new ViewModel();
    	$motscles->setTemplate('layout/motscleslayout');
    	$textwidget = new ViewModel();
    	$textwidget->setTemplate('layout/textwidgetlayout');
    	$pub = new ViewModel();
    	$pub->setTemplate('layout/publayout');
    	$horloge = new ViewModel();
    	$horloge->setTemplate('layout/horlogelayout');

    	$blogrightsidebar->addChild($recherche, 'recherche');
    	$blogrightsidebar->addChild($motscles, 'motscles');
    	$blogrightsidebar->addChild($textwidget, 'textwidget');
    	$blogrightsidebar->addChild($pub, 'pub');
    	$blogrightsidebar->addChild($horloge, 'horloge');

    	$blogfooter = new ViewModel();
    	$blogfooter->setTemplate('layout/blogfooterlayout');

    	$archive = new ViewModel();
    	$archive->setTemplate('layout/archivelayout');

    	$categorie = new ViewModel();
    	$categorie->setTemplate('layout/categoriemaladielayout');

    	$contact = new ViewModel();
    	$contact->setTemplate('layout/contactlayout');

    	$blogfooter->addChild($archive, 'archive');
    	$blogfooter->addChild($categorie, 'categorie');
    	$blogfooter->addChild($contact, 'contact');

    	//BARRE MENU ---- BARRE MENU ---- BARRE MENU
    	$layout->addChild($outilsutilisateurs, 'outilsutilisateurs');
    	$layout->addChild($blogrightsidebar, 'blogrightsidebar');
    	$layout->addChild($blogfooter, 'blogfooter');

    	return new ViewModel(array('listeArticle' => $listeArticle));
    }

    public function getListeArticlesMaladiesAction()
    {
    	$output = $this->getArticleTable() ->getListeArticlesMaladiesAjax();
    	return $this->getResponse ()->setContent ( Json::encode ( $output, array (
    			'enableJsonExprFinder' => true
    	) ) );
    }

    public function redactionArticleAction()
    {
    	$form = new ArticleForm();

    	//@todo - Implement indexAction
    	$layout = $this->layout();
    	$layout->setTemplate('layout/maladielayout');

    	$outilsutilisateurs = new ViewModel();
    	$outilsutilisateurs->setTemplate('layout/outilsutilisateurslayout');

    	$blogrightsidebar = new ViewModel();
    	$blogrightsidebar->setTemplate('layout/blogrightsidebarlayout');

    	$recherche = new ViewModel();
    	$recherche->setTemplate('layout/recherchelayout');
    	$motscles = new ViewModel();
    	$motscles->setTemplate('layout/motscleslayout');
    	$textwidget = new ViewModel();
    	$textwidget->setTemplate('layout/textwidgetlayout');
    	$pub = new ViewModel();
    	$pub->setTemplate('layout/publayout');
    	$horloge = new ViewModel();
    	$horloge->setTemplate('layout/horlogelayout');

    	$blogrightsidebar->addChild($recherche, 'recherche');
    	$blogrightsidebar->addChild($motscles, 'motscles');
    	$blogrightsidebar->addChild($textwidget, 'textwidget');
    	$blogrightsidebar->addChild($pub, 'pub');
    	$blogrightsidebar->addChild($horloge, 'horloge');

    	$blogfooter = new ViewModel();
    	$blogfooter->setTemplate('layout/blogfooterlayout');

    	$archive = new ViewModel();
    	$archive->setTemplate('layout/archivelayout');

    	$categorie = new ViewModel();
    	$categorie->setTemplate('layout/categoriemaladielayout');

    	$contact = new ViewModel();
    	$contact->setTemplate('layout/contactlayout');

    	$blogfooter->addChild($archive, 'archive');
    	$blogfooter->addChild($categorie, 'categorie');
    	$blogfooter->addChild($contact, 'contact');

    	//BARRE MENU ---- BARRE MENU ---- BARRE MENU
    	$layout->addChild($outilsutilisateurs, 'outilsutilisateurs');
    	$layout->addChild($blogrightsidebar, 'blogrightsidebar');
    	$layout->addChild($blogfooter, 'blogfooter');

		return new ViewModel(array('form' => $form, 'headtitle' => 'Système d\'Information MEdical National pour le Sénégal (SIMENS)'));
    }

    public function enregistrerArticleAction()
    {
    	$id_personne = $this->layout()->user['id'];
    	$request = $this->getRequest();

    	if ($request->isPost()) {
    		$data = $request->getPost();
    		if ($data) {

    			$today = new \DateTime ( 'now' );
    			$nomImg = 'img_art_'.$today->format ( 'dmy_His' ).'.jpg';

    			$fileBase64 = $data->fichier_tmp; $fileBase64 = substr ( $fileBase64, 23 );
    			if($fileBase64){ $img = imagecreatefromstring(base64_decode($fileBase64)); } else { $img = false; $nomImg="";}

    			if ($img != false) {
    				imagejpeg ( $img, 'C:\wamp\www\www-simens-sn\public\img\images_articles\\' . $nomImg );
    			}

    			//Enregistrer l'article
    			$this->getArticleTable()->addArticle($data, $id_personne, $nomImg);
    		}
    		return $this->redirect()->toRoute('maladie' , array('action' => 'liste-article'));
    	}
    }

    public function listeArticleAction()
    {

    	//@todo - Implement indexAction
    	$layout = $this->layout();
    	$layout->setTemplate('layout/maladielayout');

    	$outilsutilisateurs = new ViewModel();
    	$outilsutilisateurs->setTemplate('layout/outilsutilisateurslayout');

    	$blogrightsidebar = new ViewModel();
    	$blogrightsidebar->setTemplate('layout/blogrightsidebarlayout');

    	$recherche = new ViewModel();
    	$recherche->setTemplate('layout/recherchelayout');
    	$motscles = new ViewModel();
    	$motscles->setTemplate('layout/motscleslayout');
    	$textwidget = new ViewModel();
    	$textwidget->setTemplate('layout/textwidgetlayout');
    	$pub = new ViewModel();
    	$pub->setTemplate('layout/publayout');

    	$blogrightsidebar->addChild($recherche, 'recherche');
    	$blogrightsidebar->addChild($motscles, 'motscles');
    	$blogrightsidebar->addChild($textwidget, 'textwidget');
    	$blogrightsidebar->addChild($pub, 'pub');

    	$blogfooter = new ViewModel();
    	$blogfooter->setTemplate('layout/blogfooterlayout');

    	$archive = new ViewModel();
    	$archive->setTemplate('layout/archivelayout');

    	$categorie = new ViewModel();
    	$categorie->setTemplate('layout/categoriemaladielayout');

    	$contact = new ViewModel();
    	$contact->setTemplate('layout/contactlayout');

    	$blogfooter->addChild($archive, 'archive');
    	$blogfooter->addChild($categorie, 'categorie');
    	$blogfooter->addChild($contact, 'contact');

    	//BARRE MENU ---- BARRE MENU ---- BARRE MENU
    	$layout->addChild($outilsutilisateurs, 'outilsutilisateurs');
    	$layout->addChild($blogrightsidebar, 'blogrightsidebar');
    	$layout->addChild($blogfooter, 'blogfooter');

    	return new ViewModel(array( 'headtitle' => 'Système d\'Information MEdical National pour le Sénégal (SIMENS)'));
    }

    //LISTE DES ARTICLES DU REDACTEUR
    //LISTE DES ARTICLES DU REDACTEUR
    //LISTE DES ARTICLES DU REDACTEUR
    public function getListeArticleAction()
    {
    	$role = $this->layout()->user['role_personne'];
    	$id_personne = $this->layout()->user['id'];
    	$output = $this->getArticleTable() ->getListeArticleAjax($role, $id_personne);
    	return $this->getResponse ()->setContent ( Json::encode ( $output, array (
    			'enableJsonExprFinder' => true
    	) ) );
    }

    public function modificationArticleAction()
    {
    	$form = new ArticleForm();

    	$id = (int)$this->params ()->fromRoute ( 'val', 0 );

    	$article = $this->getArticleTable()->getArticle($id);
    	$donnees = array(
    			'id' =>$article->code_article,
    			'titre' =>$article->titre_article,
    			'source' =>$article->source_article,
    			'categorie' =>$article->code_sous_categorie,
    			'description' =>$article->description_article,
    			'article' =>$article->contenu_article,
    	);
    	//var_dump($article->image_article); exit();
    	$form->populateValues( $donnees );

    	//@todo - Implement indexAction
    	$layout = $this->layout();
    	$layout->setTemplate('layout/maladielayout');

    	$outilsutilisateurs = new ViewModel();
    	$outilsutilisateurs->setTemplate('layout/outilsutilisateurslayout');

    	$blogrightsidebar = new ViewModel();
    	$blogrightsidebar->setTemplate('layout/blogrightsidebarlayout');

    	$recherche = new ViewModel();
    	$recherche->setTemplate('layout/recherchelayout');
    	$motscles = new ViewModel();
    	$motscles->setTemplate('layout/motscleslayout');
    	$textwidget = new ViewModel();
    	$textwidget->setTemplate('layout/textwidgetlayout');
    	$pub = new ViewModel();
    	$pub->setTemplate('layout/publayout');

    	$blogrightsidebar->addChild($recherche, 'recherche');
    	$blogrightsidebar->addChild($motscles, 'motscles');
    	$blogrightsidebar->addChild($textwidget, 'textwidget');
    	$blogrightsidebar->addChild($pub, 'pub');

    	$blogfooter = new ViewModel();
    	$blogfooter->setTemplate('layout/blogfooterlayout');

    	$archive = new ViewModel();
    	$archive->setTemplate('layout/archivelayout');

    	$categorie = new ViewModel();
    	$categorie->setTemplate('layout/categoriemaladielayout');

    	$contact = new ViewModel();
    	$contact->setTemplate('layout/contactlayout');

    	$blogfooter->addChild($archive, 'archive');
    	$blogfooter->addChild($categorie, 'categorie');
    	$blogfooter->addChild($contact, 'contact');

    	//BARRE MENU ---- BARRE MENU ---- BARRE MENU
    	$layout->addChild($outilsutilisateurs, 'outilsutilisateurs');
    	$layout->addChild($blogrightsidebar, 'blogrightsidebar');
    	$layout->addChild($blogfooter, 'blogfooter');

    	return new ViewModel(array('form' => $form, 'image' => $article->image_article, 'headtitle' => 'Système d\'Information MEdical National pour le Sénégal (SIMENS)'));
    }

    public function enregistrerModificationArticleAction()
    {
    	$id_personne = $this->layout()->user['id'];
    	$role = $this->layout()->user['role_personne'];
    	$request = $this->getRequest();

    	$today = new \DateTime ( 'now' );
    	$nomImg = 'img_art_'.$today->format ( 'dmy_His' ).'.jpg';

    	if ($request->isPost()) {
    		$data = $request->getPost();
    		if ($data) {

    			$fileBase64 = $data->fichier_tmp; $fileBase64 = substr ( $fileBase64, 23 );
    			if($fileBase64){ $img = imagecreatefromstring(base64_decode($fileBase64)); } else { $img = false; }

    			if ($img != false) {
    				$article = $this->getArticleTable()->getArticle( $data->id );
    				$ancienneImage = $article->image_article;
    				if($ancienneImage) {
    					unlink ( 'C:\wamp\www\www-simens-sn\public\img\images_articles\\' . $ancienneImage );
    				}
    				imagejpeg ( $img, 'C:\wamp\www\www-simens-sn\public\img\images_articles\\' . $nomImg );
    				//Mise à jour de l'article
    				$this->getArticleTable()->updateArticleImg($data, $nomImg, $id_personne, $role);

    			} else {
    				//Mise à jour de l'article
    				$this->getArticleTable()->updateArticle($data, $id_personne, $role);
    			}

    		}

    		if($role == 'redacteur'){
    			return $this->redirect()->toRoute('maladie' , array('action' => 'liste-article'));
    		}else if($role == 'moderateur' ){
    			return $this->redirect()->toRoute('maladie' , array('action' => 'liste-article-soumis'));
    		}

    	}
    }

    public function soumissionArticleAction(){
    	$id = (int)$this->params()->fromPost ('id');
    	$this->getArticleTable()->soumissionArticle($id);

    	$this->getResponse ()->getHeaders ()->addHeaderLine ( 'Content-Type', 'application/html; charset=utf-8' );
    	return $this->getResponse()->setContent(Json::encode());
    }

    //LISTE DES ARTICLES DU MODERATEUR
    //LISTE DES ARTICLES DU MODERATEUR
    //LISTE DES ARTICLES DU MODERATEUR
    public function getListeArticleSoumisAction()
    {
    	$role = $this->layout()->user['role_personne'];
    	$output = $this->getArticleTable() ->getListeArticleSoumisAjax($role);
    	return $this->getResponse ()->setContent ( Json::encode ( $output, array (
    			'enableJsonExprFinder' => true
    	) ) );
    }

    public function listeArticleSoumisAction()
    {

    	//@todo - Implement indexAction
    	$layout = $this->layout();
    	$layout->setTemplate('layout/maladielayout');

    	$outilsutilisateurs = new ViewModel();
    	$outilsutilisateurs->setTemplate('layout/outilsutilisateurslayout');

    	$blogrightsidebar = new ViewModel();
    	$blogrightsidebar->setTemplate('layout/blogrightsidebarlayout');

    	$recherche = new ViewModel();
    	$recherche->setTemplate('layout/recherchelayout');
    	$motscles = new ViewModel();
    	$motscles->setTemplate('layout/motscleslayout');
    	$textwidget = new ViewModel();
    	$textwidget->setTemplate('layout/textwidgetlayout');
    	$pub = new ViewModel();
    	$pub->setTemplate('layout/publayout');

    	$blogrightsidebar->addChild($recherche, 'recherche');
    	$blogrightsidebar->addChild($motscles, 'motscles');
    	$blogrightsidebar->addChild($textwidget, 'textwidget');
    	$blogrightsidebar->addChild($pub, 'pub');

    	$blogfooter = new ViewModel();
    	$blogfooter->setTemplate('layout/blogfooterlayout');

    	$archive = new ViewModel();
    	$archive->setTemplate('layout/archivelayout');

    	$categorie = new ViewModel();
    	$categorie->setTemplate('layout/categoriemaladielayout');

    	$contact = new ViewModel();
    	$contact->setTemplate('layout/contactlayout');

    	$blogfooter->addChild($archive, 'archive');
    	$blogfooter->addChild($categorie, 'categorie');
    	$blogfooter->addChild($contact, 'contact');

    	//BARRE MENU ---- BARRE MENU ---- BARRE MENU
    	$layout->addChild($outilsutilisateurs, 'outilsutilisateurs');
    	$layout->addChild($blogrightsidebar, 'blogrightsidebar');
    	$layout->addChild($blogfooter, 'blogfooter');

    	return new ViewModel(array( 'headtitle' => 'Système d\'Information MEdical National pour le Sénégal (SIMENS)'));
    }

    public function  publicationArticleAction()
    {
    	$id_personne = $this->layout()->user['id'];
    	$id = (int)$this->params()->fromPost ('id');
    	$this->getArticleTable()->publicationArticle($id_personne, $id);

    	$this->getResponse ()->getHeaders ()->addHeaderLine ( 'Content-Type', 'application/html; charset=utf-8' );
    	return $this->getResponse()->setContent(Json::encode());
    }

    public function  depublicationArticleAction()
    {
    	$id_personne = $this->layout()->user['id'];
    	$id = (int)$this->params()->fromPost ('id');
    	$this->getArticleTable()->depublicationArticle($id_personne, $id);

    	$this->getResponse ()->getHeaders ()->addHeaderLine ( 'Content-Type', 'application/html; charset=utf-8' );
    	return $this->getResponse()->setContent(Json::encode());
    }

    public function dessoumissionArticleAction(){
    	$id = (int)$this->params()->fromPost ('id');
    	$this->getArticleTable()->dessoumissionArticle($id);

    	$this->getResponse ()->getHeaders ()->addHeaderLine ( 'Content-Type', 'application/html; charset=utf-8' );
    	return $this->getResponse()->setContent(Json::encode());
    }

    public function zoomerImageListeAction()
    {
    	$chemin = $this->getServiceLocator()->get('Request')->getBasePath();
    	$id = ( int ) $this->params ()->fromPost ( 'id', 0 );

    	$article = $this->getArticleTable()->getArticle($id);

    	$html ='';

    	$this->getResponse ()->getHeaders ()->addHeaderLine ( 'Content-Type', 'application/html; charset=utf-8' );
    	return $this->getResponse ()->setContent ( Json::encode ( $html ) );
    }

}


text:
class VTK_EXPORT vtkGeoReferencedImageReader : public vtkPolyDataAlgorithm
{
public:
  static vtkGeoReferencedImageReader* New();
  vtkTypeRevisionMacro(vtkGeoReferencedImageReader,vtkPolyDataAlgorithm);
  void PrintSelf(ostream& os, vtkIndent indent);

	vtkSetStringMacro(FileName);  // SetFileName();
	vtkGetStringMacro(FileName); //GetFileName()

	vtkSetMacro(NorthernHemisphere, int);
	vtkGetMacro(NorthernHemisphere, int);

protected:
  vtkGeoReferencedImageReader();
  ~vtkGeoReferencedImageReader();

	int RequestInformation(vtkInformation* request,
                  vtkInformationVector** inputVector,
                  vtkInformationVector* outputVector);

  int RequestData(vtkInformation* request,
                  vtkInformationVector** inputVector,
                  vtkInformationVector* outputVector);

	void ParseTFW( double adfCoeff[6], bool &YInversion );

	void FindFileInfo();

	bool Flip;

private:
	vtkStdString FileExt;
  vtkStdString FileShortName;
  vtkStdString FilePath;

	int NorthernHemisphere;

	bool TFWFound;

	char* FileName; //name of file (full path), useful for obtaining object names

	vtkGeoReferencedImageReader(const vtkGeoReferencedImageReader&);  // Not implemented.
  void operator=(const vtkGeoReferencedImageReader&);  // Not implemented.

};

#endif


text:
package org.apache.cassandra.utils;

import java.nio.ByteBuffer;

import org.github.jamm.MemoryLayoutSpecification;
import org.github.jamm.MemoryMeter;

/**
 * A convenience class for wrapping access to MemoryMeter
 */
public class ObjectSizes
{
    private static final MemoryMeter meter = new MemoryMeter()
                                             .omitSharedBufferOverhead()
                                             .withGuessing(MemoryMeter.Guess.FALLBACK_UNSAFE)
                                             .ignoreKnownSingletons();

    private static final long BUFFER_EMPTY_SIZE = measure(ByteBufferUtil.EMPTY_BYTE_BUFFER);
    private static final long STRING_EMPTY_SIZE = measure("");

    /**
     * Memory a byte array consumes
     * @param bytes byte array to get memory size
     * @return heap-size of the array
     */
    public static long sizeOfArray(byte[] bytes)
    {
        return sizeOfArray(bytes.length, 1);
    }

    /**
     * Memory a long array consumes
     * @param longs byte array to get memory size
     * @return heap-size of the array
     */
    public static long sizeOfArray(long[] longs)
    {
        return sizeOfArray(longs.length, 8);
    }

    /**
     * Memory an int array consumes
     * @param ints byte array to get memory size
     * @return heap-size of the array
     */
    public static long sizeOfArray(int[] ints)
    {
        return sizeOfArray(ints.length, 4);
    }

    /**
     * Memory a reference array consumes
     * @param length the length of the reference array
     * @return heap-size of the array
     */
    public static long sizeOfReferenceArray(int length)
    {
        return sizeOfArray(length, MemoryLayoutSpecification.SPEC.getReferenceSize());
    }

    /**
     * Memory a reference array consumes itself only
     * @param objects the array to size
     * @return heap-size of the array (excluding memory retained by referenced objects)
     */
    public static long sizeOfArray(Object[] objects)
    {
        return sizeOfReferenceArray(objects.length);
    }

    private static long sizeOfArray(int length, long elementSize)
    {
        return MemoryLayoutSpecification.sizeOfArray(length, elementSize);
    }

    /**
     * Memory a ByteBuffer array consumes.
     */
    public static long sizeOnHeapOf(ByteBuffer[] array)
    {
        long allElementsSize = 0;
        for (int i = 0; i < array.length; i++)
            if (array[i] != null)
                allElementsSize += sizeOnHeapOf(array[i]);

        return allElementsSize + sizeOfArray(array);
    }

    public static long sizeOnHeapExcludingData(ByteBuffer[] array)
    {
        return BUFFER_EMPTY_SIZE * array.length + sizeOfArray(array);
    }

    /**
     * Memory a byte buffer consumes
     * @param buffer ByteBuffer to calculate in memory size
     * @return Total in-memory size of the byte buffer
     */
    public static long sizeOnHeapOf(ByteBuffer buffer)
    {
        if (buffer.isDirect())
            return BUFFER_EMPTY_SIZE;
        // if we're only referencing a sub-portion of the ByteBuffer, don't count the array overhead (assume it's slab
        // allocated, so amortized over all the allocations the overhead is negligible and better to undercount than over)
        if (buffer.capacity() > buffer.remaining())
            return buffer.remaining();
        return BUFFER_EMPTY_SIZE + sizeOfArray(buffer.capacity(), 1);
    }

    public static long sizeOnHeapExcludingData(ByteBuffer buffer)
    {
        return BUFFER_EMPTY_SIZE;
    }

    /**
     * Memory a String consumes
     * @param str String to calculate memory size of
     * @return Total in-memory size of the String
     */
    public static long sizeOf(String str)
    {
        return STRING_EMPTY_SIZE + sizeOfArray(str.length(), 2);
    }

    /**
     * @param pojo the object to measure
     * @return the size on the heap of the instance and all retained heap referenced by it, excluding portions of
     * ByteBuffer that are not directly referenced by it but including any other referenced that may also be retained
     * by other objects.
     */
    public static long measureDeep(Object pojo)
    {
        return meter.measureDeep(pojo);
    }

    /**
     * @param pojo the object to measure
     * @return the size on the heap of the instance only, excluding any referenced objects
     */
    public static long measure(Object pojo)
    {
        return meter.measure(pojo);
    }
}


text:
(function() {
  requirejs.config({
    paths: {
      text: "../../bower_components/requirejs-text/text",
      knockout: "../../bower_components/knockout/dist/knockout.debug",
      knockout_amd: "../../bower_components/knockout-amd-helpers/build/knockout-amd-helpers",
      jquery: "../../bower_components/jquery/dist/jquery",
      bootstrap: "../../bower_components/bootstrap/dist/js/bootstrap",
      lawnchair: "../../bower_components/kox_lawnchair/lawnchair",
      lawnchair_sqlite: "../../bower_components/kox_lawnchair/adapters/webkit-sqlite",
      kox_lawnchair: "../../bower_components/kox_lawnchair/kox_lawnchair"
    },
    baseUrl: '/code/js',
    shim: {
      'bootstrap': {
        deps: ['jquery'],
        exports: 'jQuery'
      },
      'lawnchair': {
        exports: 'Lawnchair'
      },
      'lawnchair_sqlite': {
        deps: ['lawnchair'],
        exports: 'Lawnchair'
      }
    }
  });

  define(['knockout', 'knockout_amd', 'bootstrap'], function(ko, amd, bootstrap) {
    ko.amdTemplateEngine.defaultPath = "/ko_templates";
    ko.amdTemplateEngine.defaultSuffix = ".html";
    ko.amdTemplateEngine.defaultRequireTextPluginName = "text";
    $(document).ready(function() {
      console.log("jQuery Ready");
      return ko.applyBindings();
    });
  });

}).call(this);