text:
(function webpackUniversalModuleDefinition(root, factory) {
	if(typeof exports === 'object' && typeof module === 'object')
		module.exports = factory(require("vue"));
	else if(typeof define === 'function' && define.amd)
		define(["vue"], factory);
	else if(typeof exports === 'object')
		exports["VueMaterial"] = factory(require("vue"));
	else
		root["VueMaterial"] = factory(root["Vue"]);
})(this, (function(__WEBPACK_EXTERNAL_MODULE_395__) {
return /******/ (function(modules) { // webpackBootstrap
/******/ 	// The module cache
/******/ 	var installedModules = {};

/******/ 	// The require function
/******/ 	function __webpack_require__(moduleId) {

/******/ 		// Check if module is in cache
/******/ 		if(installedModules[moduleId])
/******/ 			return installedModules[moduleId].exports;

/******/ 		// Create a new module (and put it into the cache)
/******/ 		var module = installedModules[moduleId] = {
/******/ 			i: moduleId,
/******/ 			l: false,
/******/ 			exports: {}
/******/ 		};

/******/ 		// Execute the module function
/******/ 		modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);

/******/ 		// Flag the module as loaded
/******/ 		module.l = true;

/******/ 		// Return the exports of the module
/******/ 		return module.exports;
/******/ 	}

/******/ 	// expose the modules object (__webpack_modules__)
/******/ 	__webpack_require__.m = modules;

/******/ 	// expose the module cache
/******/ 	__webpack_require__.c = installedModules;

/******/ 	// identity function for calling harmony imports with the correct context
/******/ 	__webpack_require__.i = function(value) { return value; };

/******/ 	// define getter function for harmony exports
/******/ 	__webpack_require__.d = function(exports, name, getter) {
/******/ 		if(!__webpack_require__.o(exports, name)) {
/******/ 			Object.defineProperty(exports, name, {
/******/ 				configurable: false,
/******/ 				enumerable: true,
/******/ 				get: getter
/******/ 			});
/******/ 		}
/******/ 	};

/******/ 	// getDefaultExport function for compatibility with non-harmony modules
/******/ 	__webpack_require__.n = function(module) {
/******/ 		var getter = module && module.__esModule ?
/******/ 			function getDefault() { return module['default']; } :
/******/ 			function getModuleExports() { return module; };
/******/ 		__webpack_require__.d(getter, 'a', getter);
/******/ 		return getter;
/******/ 	};

/******/ 	// Object.prototype.hasOwnProperty.call
/******/ 	__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };

/******/ 	// __webpack_public_path__
/******/ 	__webpack_require__.p = "/";

/******/ 	// Load entry module and return exports
/******/ 	return __webpack_require__(__webpack_require__.s = 419);
/******/ })
/************************************************************************/
/******/ ({

/***/ 0:
/***/ (function(module, exports) {

module.exports = function normalizeComponent (
  rawScriptExports,
  compiledTemplate,
  scopeId,
  cssModules
) {
  var esModule
  var scriptExports = rawScriptExports = rawScriptExports || {}

  // ES6 modules interop
  var type = typeof rawScriptExports.default
  if (type === 'object' || type === 'function') {
    esModule = rawScriptExports
    scriptExports = rawScriptExports.default
  }

  // Vue.extend constructor export interop
  var options = typeof scriptExports === 'function'
    ? scriptExports.options
    : scriptExports

  // render functions
  if (compiledTemplate) {
    options.render = compiledTemplate.render
    options.staticRenderFns = compiledTemplate.staticRenderFns
  }

  // scopedId
  if (scopeId) {
    options._scopeId = scopeId
  }

  // inject cssModules
  if (cssModules) {
    var computed = options.computed || (options.computed = {})
    Object.keys(cssModules).forEach((function (key) {
      var module = cssModules[key]
      computed[key] = function () { return module }
    }))
  }

  return {
    esModule: esModule,
    exports: scriptExports,
    options: options
  }
}

/***/ }),

/***/ 1:
/***/ (function(module, exports, __webpack_require__) {

"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = {
  props: {
    mdTheme: String
  },
  data: function data() {
    return {
      closestThemedParent: false
    };
  },
  methods: {
    getClosestThemedParent: function getClosestThemedParent($parent) {
      if (!$parent || !$parent.$el || $parent._uid === 0) {
        return false;
      }

      if ($parent.mdTheme || $parent.mdName) {
        return $parent;
      }

      return this.getClosestThemedParent($parent.$parent);
    }
  },
  computed: {
    themeClass: function themeClass() {
      if (this.mdTheme) {
        return 'md-theme-' + this.mdTheme;
      }

      var theme = this.closestThemedParent.mdTheme;

      if (!theme) {
        if (this.closestThemedParent) {
          theme = this.closestThemedParent.mdName;
        } else {
          theme = this.$material.currentTheme;
        }
      }

      return 'md-theme-' + theme;
    }
  },
  mounted: function mounted() {
    this.closestThemedParent = this.getClosestThemedParent(this.$parent);

    if (!this.$material.currentTheme) {
      this.$material.setCurrentTheme('default');
    }
  }
};
module.exports = exports['default'];

/***/ }),

/***/ 111:
/***/ (function(module, exports, __webpack_require__) {

"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = install;

var _mdSnackbar = __webpack_require__(309);

var _mdSnackbar2 = _interopRequireDefault(_mdSnackbar);

var _mdSnackbar3 = __webpack_require__(251);

var _mdSnackbar4 = _interopRequireDefault(_mdSnackbar3);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function install(Vue) {
  Vue.component('md-snackbar', _mdSnackbar2.default);

  Vue.material.styles.push(_mdSnackbar4.default);
}
module.exports = exports['default'];

/***/ }),

/***/ 124:
/***/ (function(module, exports, __webpack_require__) {

"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});

var _vue = __webpack_require__(395);

var _vue2 = _interopRequireDefault(_vue);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var manager = new _vue2.default({
  data: function data() {
    return {
      current: null
    };
  }
});

exports.default = manager;
module.exports = exports['default'];

/***/ }),

/***/ 171:
/***/ (function(module, exports, __webpack_require__) {

"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});

var _uniqueId = __webpack_require__(48);

var _uniqueId2 = _interopRequireDefault(_uniqueId);

var _transitionEndEventName = __webpack_require__(39);

var _transitionEndEventName2 = _interopRequireDefault(_transitionEndEventName);

var _mixin = __webpack_require__(1);

var _mixin2 = _interopRequireDefault(_mixin);

var _manager = __webpack_require__(124);

var _manager2 = _interopRequireDefault(_manager);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

//
//
//
//
//
//
//
//
//
//
//
//

exports.default = {
  props: {
    id: [String, Number],
    mdPosition: {
      type: String,
      default: 'bottom center'
    },
    mdDuration: {
      type: [String, Number],
      default: 4000
    }
  },
  mixins: [_mixin2.default],
  data: function data() {
    return {
      snackbarId: this.id || 'snackbar-' + (0, _uniqueId2.default)(),
      active: false,
      rootElement: {},
      snackbarElement: {},
      directionClass: null,
      closeTimeout: null
    };
  },

  computed: {
    classes: function classes() {
      var cssClasses = {
        'md-active': this.active
      };

      this.directionClass = this.mdPosition.replace(/ /g, '-');

      cssClasses['md-position-' + this.directionClass] = true;

      return cssClasses;
    }
  },
  watch: {
    active: function active(_active) {
      var directionClass = 'md-has-toast-' + this.directionClass;
      var toastClass = 'md-has-toast';

      if (_active) {
        document.body.classList.add(directionClass);
        document.body.classList.add(toastClass);
      } else {
        document.body.classList.remove(directionClass);
        document.body.classList.remove(toastClass);
      }
    }
  },
  methods: {
    removeElement: function removeElement() {
      if (document.body.contains(this.snackbarElement)) {
        var activeRipple = this.snackbarElement.querySelector('.md-ripple.md-active');

        if (activeRipple) {
          activeRipple.classList.remove('md-active');
        }

        document.body.removeChild(this.snackbarElement);
      }
    },
    open: function open() {
      if (_manager2.default.current) {
        _manager2.default.current.close();
      }

      _manager2.default.current = this;
      document.body.appendChild(this.snackbarElement);
      window.getComputedStyle(this.$refs.container).backgroundColor;
      this.active = true;
      this.$emit('open');
      this.closeTimeout = window.setTimeout(this.close, this.mdDuration);
      this.timeoutStartedAt = Date.now();
    },
    close: function close() {
      var _this = this;

      if (this.$refs.container) {
        (function () {
          var removeElement = function removeElement() {
            _this.$refs.container.removeEventListener(_transitionEndEventName2.default, removeElement);
            _this.removeElement();
          };

          _manager2.default.current = null;
          _this.active = false;
          _this.$emit('close');
          _this.$refs.container.removeEventListener(_transitionEndEventName2.default, removeElement);
          _this.$refs.container.addEventListener(_transitionEndEventName2.default, removeElement);
          window.clearTimeout(_this.closeTimeout);
          _this.pendingDuration = _this.mdDuration;
        })();
      }
    },
    pauseTimeout: function pauseTimeout() {
      this.pendingDuration = this.pendingDuration - (Date.now() - this.timeoutStartedAt);
      this.timeoutStartedAt = 0;
      window.clearTimeout(this.closeTimeout);
    },
    resumeTimeout: function resumeTimeout() {
      this.timeoutStartedAt = Date.now();
      this.closeTimeout = window.setTimeout(this.close, this.pendingDuration);
    }
  },
  mounted: function mounted() {
    var _this2 = this;

    this.$nextTick((function () {
      _this2.snackbarElement = _this2.$el;
      _this2.snackbarElement.parentNode.removeChild(_this2.snackbarElement);
      _this2.timeoutStartedAt = 0;
      _this2.pendingDuration = _this2.mdDuration;
    }));
  },
  beforeDestroy: function beforeDestroy() {
    window.clearTimeout(this.closeTimeout);
    this.removeElement();
  }
};
module.exports = exports['default'];

/***/ }),

/***/ 230:
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),

/***/ 251:
/***/ (function(module, exports) {

module.exports = ".THEME_NAME .md-snackbar .md-ink-ripple, .THEME_NAME.md-snackbar .md-ink-ripple {\n  color: #fff; }\n"

/***/ }),

/***/ 309:
/***/ (function(module, exports, __webpack_require__) {

/* styles */
__webpack_require__(230)

var Component = __webpack_require__(0)(
  /* script */
  __webpack_require__(171),
  /* template */
  __webpack_require__(390),
  /* scopeId */
  null,
  /* cssModules */
  null
)
Component.options.__file = "/Users/marcosmoura/Projects/github/vue-material/src/components/mdSnackbar/mdSnackbar.vue"
if (Component.esModule && Object.keys(Component.esModule).some((function (key) {return key !== "default" && key !== "__esModule"}))) {console.error("named exports are not supported in *.vue files.")}
if (Component.options.functional) {console.error("[vue-loader] mdSnackbar.vue: functional components are not supported with templates, they should use render functions.")}

/* hot reload */
if (false) {(function () {
  var hotAPI = require("vue-hot-reload-api")
  hotAPI.install(require("vue"), false)
  if (!hotAPI.compatible) return
  module.hot.accept()
  if (!module.hot.data) {
    hotAPI.createRecord("data-v-b6cb8878", Component.options)
  } else {
    hotAPI.reload("data-v-b6cb8878", Component.options)
  }
})()}

module.exports = Component.exports

/***/ }),

/***/ 39:
/***/ (function(module, exports, __webpack_require__) {

"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
function transitionEndEventName() {
  var el = document.createElement('span');
  var transitions = {
    transition: 'transitionend',
    OTransition: 'oTransitionEnd',
    MozTransition: 'transitionend',
    WebkitTransition: 'webkitTransitionEnd'
  };

  for (var transition in transitions) {
    if (el.style[transition] !== undefined) {
      return transitions[transition];
    }
  }
}

exports.default = transitionEndEventName();
module.exports = exports['default'];

/***/ }),

/***/ 390:
/***/ (function(module, exports, __webpack_require__) {

module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
  return _c('div', {
    staticClass: "md-snackbar",
    class: [_vm.themeClass, _vm.classes],
    attrs: {
      "id": _vm.snackbarId
    },
    on: {
      "mouseenter": _vm.pauseTimeout,
      "mouseleave": _vm.resumeTimeout
    }
  }, [_c('div', {
    ref: "container",
    staticClass: "md-snackbar-container"
  }, [_c('div', {
    staticClass: "md-snackbar-content"
  }, [_vm._t("default")], 2)])])
},staticRenderFns: []}
module.exports.render._withStripped = true
if (false) {
  module.hot.accept()
  if (module.hot.data) {
     require("vue-hot-reload-api").rerender("data-v-b6cb8878", module.exports)
  }
}

/***/ }),

/***/ 395:
/***/ (function(module, exports) {

module.exports = __WEBPACK_EXTERNAL_MODULE_395__;

/***/ }),

/***/ 419:
/***/ (function(module, exports, __webpack_require__) {

module.exports = __webpack_require__(111);

/***/ }),

/***/ 48:
/***/ (function(module, exports, __webpack_require__) {

"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
var uniqueId = function uniqueId() {
  return Math.random().toString(36).slice(4);
};

exports.default = uniqueId;
module.exports = exports["default"];

/***/ })

/******/ });
}));


text:
<!doctype html>

		<meta charset="utf-8" />
	<meta name="viewport" content="width=device-width, initial-scale=1.0" />
	<title>The Parables of Jesus</title>
	<link rel="stylesheet" type="text/css" href="http://vacsf.org/assets/css/styles_feeling_responsive.css" />

  <meta name="google-site-verification" content="" />
	<meta name="msvalidate.01" content="" />
	<meta name="description" content="10When he was alone, those around him with the twelve asked him about the parables. 11He said to them, "The secret of the kingdom of God has been given to you. But to those outside, everything is in parables, 12so that although they look they may look but not see, and although they hear they may hear but not understand, so they may not repent and be forgiven (Mark 4:10-12)."" />

	<link rel="author" href=""/>

	<link rel="icon" sizes="32x32" href="http://vacsf.org/assets/img/favicon-32x32.png" />

	<link rel="icon" sizes="192x192" href="http://vacsf.org/assets/img/touch-icon-192x192.png" />

	<link rel="apple-touch-icon-precomposed" sizes="180x180" href="http://vacsf.org/assets/img/apple-touch-icon-180x180-precomposed.png" />

	<link rel="apple-touch-icon-precomposed" sizes="152x152" href="http://vacsf.org/assets/img/apple-touch-icon-152x152-precomposed.png" />

	<link rel="apple-touch-icon-precomposed" sizes="144x144" href="http://vacsf.org/assets/img/apple-touch-icon-144x144-precomposed.png" />

	<link rel="apple-touch-icon-precomposed" sizes="120x120" href="http://vacsf.org/assets/img/apple-touch-icon-120x120-precomposed.png" />

	<link rel="apple-touch-icon-precomposed" sizes="114x114" href="http://vacsf.org/assets/img/apple-touch-icon-114x114-precomposed.png" />

	<link rel="apple-touch-icon-precomposed" sizes="76x76" href="http://vacsf.org/assets/img/apple-touch-icon-76x76-precomposed.png" />

	<link rel="apple-touch-icon-precomposed" sizes="72x72" href="http://vacsf.org/assets/img/apple-touch-icon-72x72-precomposed.png" />

	<link rel="apple-touch-icon-precomposed" href="http://vacsf.org/assets/img/apple-touch-icon-precomposed.png" />

	<meta name="msapplication-TileImage" content="http://vacsf.org/assets/img/msapplication_tileimage.png" />

	<meta name="msapplication-TileColor" content="#fabb00" />

	<meta property="og:locale" content="en_EN" />
	<meta property="og:type" content="website" />
	<meta property="og:title" content="The Parables of Jesus" />
	<meta property="og:description" content="Know with certainty your salvation. To please and bear fruit to God. Learn how to walk by faith. Rest for your soul. Peace with God. Abundant life." />
	<meta property="og:url" content="http://vacsf.org//bible-topics/parables/" />
	<meta property="og:site_name" content="The Whole Bible is About Jesus!" />

	<link type="text/plain" rel="author" href="http://vacsf.org/humans.txt" />

 The Whole Bible is About Jesus!

Navigation

HOME

                BIBLE STUDY

Parables

Meditations

Galatians

Romans

                Blog

Blog Archive

About

 Start

        bible topics

        The Parables of Jesus

Bible Study

The Parables of Jesus

				10When he was alone, those around him with the twelve asked him about the parables. 11He said to them, "The secret of the kingdom of God has been given to you. But to those outside, everything is in parables, 12so that although they look they may look but not see, and although they hear they may hear but not understand, so they may not repent and be forgiven (Mark 4:10-12)."

(Bấm vào đây để đọc tiếng Việt)

Parable of the sower - Matthew 13:1-23

A proper understanding of this parable will relieve the believers of the confusion of which type of soil they belong to. Conventional interpretation of this parable leaves many to wonder if they're saved at all, let alone being fruitful.</>

Parable of the talents - Matthew 25:14-30
Do you know exactly where you stand in terms of meeting the talent production quota? This writing will show you exactly how you can meet your quota.

Parable of the evil steward - Luke 16:1-8
This parable is not about money, but it is a mockery of those who think they can buy God's kingdom with their wealth.

Parable of the net - Luke 16:1-8
This parable is about the ushering in of a new era: the new covenant between God and Man.

        

About This Site

              Know with certainty your salvation. To please and bear fruit to God. Learn how to walk by faith. Rest for your soul. Peace with God. Abundant life.
              More ›

Contact

                    Contact

JOHN 3:16

                  For God so loved the world that he gave his one and only Son, that whoever believes in him shall not perish but have eternal life.

              Created with ♥
              by Nghi Nguyen
              with Jekyll
              based on Feeling Responsive - Thank You.

<link type="text/css" rel="stylesheet" href="https://labs.bible.org/api/NETBibleTagger/v2/netbibletagger.css" media="screen">

redpajama_set_name: RedPajamaGithub


text:
require('../../src/dev/test/init');

const assert = require('assert');

const imagemin = require('../../cli/imagemin');

describe('cli/imagemin', function() {

  it('should run', () => {
    imagemin();
  });

});


text:
@interface HACollectionViewCell : UICollectionViewCell
/// 图片
@property (nonatomic, strong) UIImageView *imageView;

@end


text:
layout: post
title:  "Faerie Fire"
date:   2014-08-24
source: PHB.239
tags: [elf (drow), bard, cleric (light), druid, warlock (fae), level1, evocation]
---

**1st-level evocation**

**Casting Time**: 1 action

**Range**: 60 feet

**Components**: V

**Duration**: Concentration, up to 1 minute

Each object in a 20-foot cube within range is outlined in blue, green, or violet light (your choice). Any creature in the area when the spell is cast is also outlined in light if it fails a Dexterity saving throw. For the duration, objects and affected creatures shed dim light in a 10-foot radius.

Any attack roll against an affected creature or object has advantage if the attacker can see it, and the affected creature or object can't benefit from being invisible.


text:
This optional setting provides a way to specify one or more hosts where the connection should not be proxied.
Similar settings are available in many applications. Unfortunately, there is no standard specification across the different implementations.
Each one defines its own syntax and supported capabilities.

Remoting provides an implementation that is similar to a number of other applications and systems. Its simple rules provide
sufficient power and flexibility for many needs.

Rules:
1. Environment variable may be named `NO_PROXY` or `no_proxy`.
1. Different specification pieces may be separated by a comma (`,`) or a pipe (`|`).
1. Each piece may specify an IP address, a network, or a host / domain.
1. An IP address may be IPv4 or IPv6.
1. An IPv6 address may be expressed in full or compressed form.
1. A network is expressed in CIDR notation, for example, `192.168.17.0/24`.
1. Localhost and loopback addresses are not proxied by default.
1. All subdomains matching a domain or host are not proxied.
1. A `NO_PROXY` setting of `jenkins.io` matches `repo.jenkins.io`, `sub.sub.jenkins.io`, and `jenkins.io`. It also matches `myjenkins.io`.
1. The following forms are identical: `jenkins.io`, `.jenkins.io`, and `*.jenkins.io`.
1. All other notations are ignored.

## History

The exact implementation has changed in different remoting versions. The 3.28 release of Remoting clarified and expanded a
number of these capabilities. All specifications that worked prior to 3.28 should still work. Enhancements added at 3.28
include environment variable capitalization, pipe separation, compressed
IPv6 form, networks, and simple hostnames or root domains. The [Changelog](../CHANGELOG.md) provides information on some of the prior changes.


text:
package gobblin.data.management.copy.hive;

import java.io.IOException;

import org.testng.Assert;
import org.testng.annotations.Test;

import com.google.common.collect.ImmutableMap;
import com.typesafe.config.Config;
import com.typesafe.config.ConfigFactory;

import gobblin.data.management.retention.version.HiveDatasetVersionCleaner;

public class HiveDatasetTest {

  private static String DUMMY_CONFIG_KEY_WITH_DB_TOKEN = "dummyConfig.withDB";
  private static String DUMMY_CONFIG_KEY_WITH_TABLE_TOKEN = "dummyConfig.withTable";
  private static Config config = ConfigFactory.parseMap(ImmutableMap.<String, String> of(
      HiveDatasetVersionCleaner.REPLACEMENT_HIVE_DB_NAME_KEY, "resPrefix_$LOGICAL_DB_resPostfix",
      HiveDatasetVersionCleaner.REPLACEMENT_HIVE_TABLE_NAME_KEY, "resPrefix_$LOGICAL_TABLE_resPostfix",
      DUMMY_CONFIG_KEY_WITH_DB_TOKEN, "resPrefix_$DB_resPostfix",
      DUMMY_CONFIG_KEY_WITH_TABLE_TOKEN, "resPrefix_$TABLE_resPostfix"));

  @Test
  public void testParseLogicalDbAndTable() throws IOException {

    String datasetNamePattern;
    HiveDatasetFinder.DbAndTable logicalDbAndTable;

    // Happy Path
    datasetNamePattern = "dbPrefix_$LOGICAL_DB_dbPostfix.tablePrefix_$LOGICAL_TABLE_tablePostfix";
    logicalDbAndTable = HiveDataset.parseLogicalDbAndTable(datasetNamePattern,
        new HiveDatasetFinder.DbAndTable("dbPrefix_myDB_dbPostfix", "tablePrefix_myTable_tablePostfix"),
        HiveDataset.LOGICAL_DB_TOKEN, HiveDataset.LOGICAL_TABLE_TOKEN);
    Assert.assertEquals(logicalDbAndTable.getDb(), "myDB", "DB name not parsed correctly");
    Assert.assertEquals(logicalDbAndTable.getTable(), "myTable", "Table name not parsed correctly");

    // Happy Path - without prefix in DB and Table names
    datasetNamePattern = "$LOGICAL_DB_dbPostfix.$LOGICAL_TABLE_tablePostfix";
    logicalDbAndTable = HiveDataset.parseLogicalDbAndTable(datasetNamePattern,
        new HiveDatasetFinder.DbAndTable("myDB_dbPostfix", "myTable_tablePostfix"),
        HiveDataset.LOGICAL_DB_TOKEN, HiveDataset.LOGICAL_TABLE_TOKEN);
    Assert.assertEquals(logicalDbAndTable.getDb(), "myDB", "DB name not parsed correctly");
    Assert.assertEquals(logicalDbAndTable.getTable(), "myTable", "Table name not parsed correctly");

    // Happy Path - without postfix in DB and Table names
    datasetNamePattern = "dbPrefix_$LOGICAL_DB.tablePrefix_$LOGICAL_TABLE";
    logicalDbAndTable = HiveDataset.parseLogicalDbAndTable(datasetNamePattern,
        new HiveDatasetFinder.DbAndTable("dbPrefix_myDB", "tablePrefix_myTable"),
        HiveDataset.LOGICAL_DB_TOKEN, HiveDataset.LOGICAL_TABLE_TOKEN);
    Assert.assertEquals(logicalDbAndTable.getDb(), "myDB", "DB name not parsed correctly");
    Assert.assertEquals(logicalDbAndTable.getTable(), "myTable", "Table name not parsed correctly");

    // Happy Path - without any prefix and postfix in DB and Table names
    datasetNamePattern = "$LOGICAL_DB.$LOGICAL_TABLE";
    logicalDbAndTable = HiveDataset.parseLogicalDbAndTable(datasetNamePattern,
        new HiveDatasetFinder.DbAndTable("myDB", "myTable"),
        HiveDataset.LOGICAL_DB_TOKEN, HiveDataset.LOGICAL_TABLE_TOKEN);
    Assert.assertEquals(logicalDbAndTable.getDb(), "myDB", "DB name not parsed correctly");
    Assert.assertEquals(logicalDbAndTable.getTable(), "myTable", "Table name not parsed correctly");

    // Dataset name pattern missing
    datasetNamePattern = "";
    try {
      logicalDbAndTable = HiveDataset.parseLogicalDbAndTable(datasetNamePattern,
          new HiveDatasetFinder.DbAndTable("dbPrefix_myDB_dbPostfix", "tablePrefix_myTable_tablePostfix"),
          HiveDataset.LOGICAL_DB_TOKEN, HiveDataset.LOGICAL_TABLE_TOKEN);
      Assert.fail("Dataset name pattern is missing, code should have thrown exception");
    } catch (IllegalArgumentException e) {
      // Ignore exception, it was expected
    }

    // Malformed Dataset name pattern
    datasetNamePattern = "dbPrefix_$LOGICAL_DB_dbPostfixtablePrefix_$LOGICAL_TABLE_tablePostfix";
    try {
      logicalDbAndTable = HiveDataset.parseLogicalDbAndTable(datasetNamePattern,
          new HiveDatasetFinder.DbAndTable("dbPrefix_myDB_dbPostfix", "tablePrefix_myTable_tablePostfix"),
          HiveDataset.LOGICAL_DB_TOKEN, HiveDataset.LOGICAL_TABLE_TOKEN);
      Assert.fail("Dataset name pattern is missing, code should have thrown exception");
    } catch (IllegalArgumentException e) {
      // Ignore exception, it was expected
    }
  }

  @Test
  public void testExtractTokenValueFromEntity() throws IOException {

    String tokenValue;

    // Happy Path
    tokenValue = HiveDataset.extractTokenValueFromEntity("dbPrefix_myDB_dbPostfix", "dbPrefix_$LOGICAL_DB_dbPostfix",
        HiveDataset.LOGICAL_DB_TOKEN);
    Assert.assertEquals(tokenValue, "myDB", "DB name not extracted correctly");

    // Happy Path - without prefix
    tokenValue = HiveDataset.extractTokenValueFromEntity("myDB_dbPostfix", "$LOGICAL_DB_dbPostfix",
        HiveDataset.LOGICAL_DB_TOKEN);
    Assert.assertEquals(tokenValue, "myDB", "DB name not extracted correctly");

    // Happy Path - without postfix
    tokenValue = HiveDataset.extractTokenValueFromEntity("dbPrefix_myDB", "dbPrefix_$LOGICAL_DB",
        HiveDataset.LOGICAL_DB_TOKEN);
    Assert.assertEquals(tokenValue, "myDB", "DB name not extracted correctly");

    // Missing token in template
    try {
      tokenValue = HiveDataset.extractTokenValueFromEntity("dbPrefix_myDB_dbPostfix", "dbPrefix_$LOGICAL_TABLE_dbPostfix",
          HiveDataset.LOGICAL_DB_TOKEN);
      Assert.fail("Token is missing in template, code should have thrown exception");
    } catch (IllegalArgumentException e) {
      // Ignore exception, it was expected
    }

    // Missing source entity
    try {
      tokenValue = HiveDataset.extractTokenValueFromEntity("", "dbPrefix_$LOGICAL_DB_dbPostfix",
          HiveDataset.LOGICAL_DB_TOKEN);
      Assert.fail("Source entity is missing, code should have thrown exception");
    } catch (IllegalArgumentException e) {
      // Ignore exception, it was expected
    }

    // Missing template
    try {
      tokenValue = HiveDataset.extractTokenValueFromEntity("dbPrefix_myDB_dbPostfix", "",
          HiveDataset.LOGICAL_DB_TOKEN);
      Assert.fail("Template is missing, code should have thrown exception");
    } catch (IllegalArgumentException e) {
      // Ignore exception, it was expected
    }
  }

  @Test
  public void testResolveConfig() throws IOException {
    HiveDatasetFinder.DbAndTable realDbAndTable = new HiveDatasetFinder.DbAndTable("realDb", "realTable");
    HiveDatasetFinder.DbAndTable logicalDbAndTable = new HiveDatasetFinder.DbAndTable("logicalDb", "logicalTable");
    Config resolvedConfig = HiveDataset.resolveConfig(config, realDbAndTable, logicalDbAndTable);

    Assert.assertEquals(resolvedConfig.getString(DUMMY_CONFIG_KEY_WITH_DB_TOKEN),
        "resPrefix_realDb_resPostfix", "Real DB not resolved correctly");
    Assert.assertEquals(resolvedConfig.getString(DUMMY_CONFIG_KEY_WITH_TABLE_TOKEN),
        "resPrefix_realTable_resPostfix", "Real Table not resolved correctly");

    Assert.assertEquals(resolvedConfig.getString(HiveDatasetVersionCleaner.REPLACEMENT_HIVE_DB_NAME_KEY),
        "resPrefix_logicalDb_resPostfix", "Logical DB not resolved correctly");
    Assert.assertEquals(resolvedConfig.getString(HiveDatasetVersionCleaner.REPLACEMENT_HIVE_TABLE_NAME_KEY),
        "resPrefix_logicalTable_resPostfix", "Logical Table not resolved correctly");
  }
}


text:
<?php

namespace Ten\Four;

class User {

    public function say() {
        return __FILE__;
    }

}


text:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

	<title>EditArea documentation</title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<link href="doc_style.css" rel="stylesheet" type="text/css" />

Customization - Creating a plugin

Creating your own plugins

			Creating you own plugins for EditArea is fairly easy if you know the basics of HTML, CSS and Javascript.
			The most easy way is to copy the "test" directory and work from there. The "test"
			directory is a tutorial plugin that shows how to create a plugin. After you copy the template you need to
			change the red sections marked below to the name of your plugin this is needed so that plugins don't
			overlap in other words it gives the plugin a unique name. Notice that when you write a new plugin,
			you have to end each javascript	instructions by ";", even if it's optionnal in javascript.

If you want you may add plugin specific options/settings but remember to namespace them in the
			following format "<your plugin>_<option>" for example "yourplugin_someoption".

Specific callback functions that you don't need or doesn't do anything can be removed.

If you want you can try the test plugin by adding the following parameters to the EditAreaLoader.init command.

end_toolbar: "*,test_but, |,test_select",
plugins: "test",

Plugin directory structure

			File/Directory
			Description

css	Plugin specific CSS files

images	Plugin specific images

langs	Plugin specific language files

<your_plugin>.js	Main plugin file

Plugin example source

		The example below shows a simple empty plugin and all possible callbacks.

/**
 * Plugin designed for test prupose. It add a button (that manage an alert) and a select (that allow to insert tags) in the toolbar.
 * This plugin also disable the "f" key in the editarea, and load a CSS and a JS file
 */
var EditArea_test= {
	/**
	 * Get called once this file is loaded (editArea still not initialized)
	 *
	 * @return nothing
	 */
	init: function(){
		//	alert("test init: "+ this._someInternalFunction(2, 3));
		editArea.load_css(this.baseURL+"css/test.css");
		editArea.load_script(this.baseURL+"test2.js");
	}
	/**
	 * Returns the HTML code for a specific control string or false if this plugin doesn't have that control.
	 * A control can be a button, select list or any other HTML item to present in the EditArea user interface.
	 * Language variables such as {$lang_somekey} will also be replaced with contents from
	 * the language packs.
	 *
	 * @param {string} ctrl_name: the name of the control to add
	 * @return HTML code for a specific control or false.
	 * @type string	or boolean
	 */
	,get_control_html: function(ctrl_name){
		switch(ctrl_name){
			case "test_but":
				// Control id, button img, isFileSpecific, command
				return parent.editAreaLoader.get_button_html('test_but', 'test.gif', 'test_cmd', false, this.baseURL);
			case "test_select":
				html= "<select id='test_select' onchange='javascript:editArea.execCommand(\"test_select_change\")'>"
					+"			<option value='-1'>{$test_select}</option>"
					+"			<option value='h1'>h1</option>"
					+"			<option value='h2'>h2</option>"
					+"			<option value='h3'>h3</option>"
					+"			<option value='h4'>h4</option>"
					+"			<option value='h5'>h5</option>"
					+"			<option value='h6'>h6</option>"
					+"		</select>";
				return html;
		}
		return false;
	}
	/**
	 * Get called once EditArea is fully loaded and initialised
	 *
	 * @return nothing
	 */
	,onload: function(){
		alert("test load");
	}

	/**
	 * Is called each time the user touch a keyboard key.
	 *
	 * @param (event) e: the keydown event
	 * @return true - pass to next handler in chain, false - stop chain execution
	 * @type boolean
	 */
	,onkeydown: function(e){
		var str= String.fromCharCode(e.keyCode);
		// desactivate the "f" character
		if(str.toLowerCase()=="f"){
			return true;
		}
		return false;
	}

	/**
	 * Executes a specific command, this function handles plugin commands.
	 *
	 * @param {string} cmd: the name of the command being executed
	 * @param {unknown} param: the parameter of the command
	 * @return true - pass to next handler in chain, false - stop chain execution
	 * @type boolean
	 */
	,execCommand: function(cmd, param){
		// Handle commands
		switch(cmd){
			case "test_select_change":
				var val= document.getElementById("test_select").value;
				if(val!=-1)
					parent.editAreaLoader.insertTags(editArea.id, "<"+val+">", "</"+val+">");
				document.getElementById("test_select").options[0].selected=true;
				return false;
			case "test_cmd":
				alert("user clicked on test_cmd");
				return false;
		}
		// Pass to next handler in chain
		return true;
	}

	/**
	 * This is just an internal plugin method, prefix all internal methods with a _ character.
	 * The prefix is needed so they doesn't collide with future EditArea callback functions.
	 *
	 * @param {string} a Some arg1.
	 * @param {string} b Some arg2.
	 * @return Some return.
	 * @type unknown
	 */
	,_someInternalFunction : function(a, b) {
		return a+b;
	}
};

// Adds the plugin class to the list of available EditArea plugins
editArea.add_plugin("test", EditArea_test);

Index

EditArea - © Christophe Dolivet 2007-2010


text:
import { bindable, containerless } from 'aurelia-framework';

@containerless
export class EmBlogCommentFooter {

    @bindable comment;

    name;

    loginUser = nsCtx.loginUser;

    attached() {
        $([this.addTagRef])
            .popup({
                inline: true,
                hoverable: true,
                delay: {
                    show: 500,
                    hide: 300
                }
            });
    }

    addHandler() {

        this.toggleHandler({ name: this.name, creator: this.loginUser.username });
    }

    toggleHandler(tag) {

        if (!_.trim(tag.name)) return;

        let has = _.some(this.comment.labels, { name: tag.name, creator: this.loginUser.username });

        if (has && (tag.creator != this.loginUser.username)) { // 标签已经存在,但是点击的不是自己的
            return;
        }

        $.post('/admin/blog/comment/label/toggle', {
            cid: this.comment.id,
            name: _.trim(tag.name)
        }, (data, textStatus, xhr) => {
            if (data.success) {
                this.name = '';
                this.comment.labels = data.data.labels;
            } else {
                toastr.error(data.data);
            }
        });
    }

}


text:
package com.github.maven_nar;

import java.util.List;

import org.apache.maven.artifact.Artifact;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;
import org.apache.maven.plugins.annotations.ResolutionScope;
import org.apache.maven.shared.artifact.filter.collection.ScopeFilter;

/**
 * Unpacks NAR files needed for compilation. Unpacking happens in the project
 * target folder, and also sets flags on
 * binaries and corrects static libraries.
 *
 * @author Mark Donszelmann
 */
@Mojo(name = "nar-unpack", defaultPhase = LifecyclePhase.GENERATE_SOURCES, requiresProject = true,
  requiresDependencyResolution = ResolutionScope.COMPILE)
public class NarUnpackMojo extends AbstractDependencyMojo {

  /**
   * List of tests to create
   */
  @Parameter
  private List tests;

  /**
   * List the dependencies needed for compilation.
   */
  @Override
  protected ScopeFilter getArtifactScopeFilter() {
    return new ScopeFilter( Artifact.SCOPE_COMPILE, null );
  }

  @Override
  public final void narExecute() throws MojoExecutionException, MojoFailureException {
    final List<AttachedNarArtifact> attachedNarArtifacts = getAttachedNarArtifacts(libraries);
    unpackAttachedNars(attachedNarArtifacts);
  }
}


text:
package org.bosphorus.core.expression.aggregate.factory;

import org.bosphorus.core.expression.aggregate.executor.IAggregateExecutor;

public interface IAggregateExecutorFactory<TInput, TOutput> {

	IAggregateExecutor<TInput, TOutput> create();

}


text:
#include <aws/worklink/model/ListDevicesRequest.h>
#include <aws/core/utils/json/JsonSerializer.h>

#include <utility>

using namespace Aws::WorkLink::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;

ListDevicesRequest::ListDevicesRequest() :
    m_fleetArnHasBeenSet(false),
    m_nextTokenHasBeenSet(false),
    m_maxResults(0),
    m_maxResultsHasBeenSet(false)
{
}

Aws::String ListDevicesRequest::SerializePayload() const
{
  JsonValue payload;

  if(m_fleetArnHasBeenSet)
  {
   payload.WithString("FleetArn", m_fleetArn);

  }

  if(m_nextTokenHasBeenSet)
  {
   payload.WithString("NextToken", m_nextToken);

  }

  if(m_maxResultsHasBeenSet)
  {
   payload.WithInteger("MaxResults", m_maxResults);

  }

  return payload.View().WriteReadable();
}


text:
package interfaces

import "github.com/off-sync/platform-proxy/domain/acme"

// ACMERegistrar provides the functionality to register new accounts
// with an ACME provider.
type ACMERegistrar interface {
	Register(endpoint, email string) (*acme.Account, error)
}

// ACMESaver provides a method to save an ACME account.
type ACMESaver interface {
	Save(account *acme.Account) error
}

// ACMELoader provides a method to load an ACME account based on the
// provided endpoint and email address.
// It returns a nil account if it does not exist.
type ACMELoader interface {
	Load(endpoint, email string) (*acme.Account, error)
}


text:
'use strict';

exports.__esModule = true;
exports.default = void 0;

var _AnimatedValue = _interopRequireDefault(require("./AnimatedValue"));

var _AnimatedWithChildren2 = _interopRequireDefault(require("./AnimatedWithChildren"));

var _invariant = _interopRequireDefault(require("fbjs/lib/invariant"));

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }

var _uniqueId = 1;
/**
 * 2D Value for driving 2D animations, such as pan gestures. Almost identical
 * API to normal `Animated.Value`, but multiplexed.
 *
 * See http://facebook.github.io/react-native/docs/animatedvaluexy.html
 */

var AnimatedValueXY =
/*#__PURE__*/
function (_AnimatedWithChildren) {
  _inheritsLoose(AnimatedValueXY, _AnimatedWithChildren);

  // $FlowFixMe
  function AnimatedValueXY(valueIn) {
    var _this;

    _this = _AnimatedWithChildren.call(this) || this;
    var value = valueIn || {
      x: 0,
      y: 0
    }; // fixme: shouldn't need `: any`

    if (typeof value.x === 'number' && typeof value.y === 'number') {
      _this.x = new _AnimatedValue.default(value.x);
      _this.y = new _AnimatedValue.default(value.y);
    } else {
      (0, _invariant.default)(value.x instanceof _AnimatedValue.default && value.y instanceof _AnimatedValue.default, 'AnimatedValueXY must be initialized with an object of numbers or ' + 'AnimatedValues.');
      _this.x = value.x;
      _this.y = value.y;
    }

    _this._listeners = {};
    return _this;
  }
  /**
   * Directly set the value. This will stop any animations running on the value
   * and update all the bound properties.
   *
   * See http://facebook.github.io/react-native/docs/animatedvaluexy.html#setvalue
   */

  var _proto = AnimatedValueXY.prototype;

  _proto.setValue = function setValue(value) {
    this.x.setValue(value.x);
    this.y.setValue(value.y);
  }
  /**
   * Sets an offset that is applied on top of whatever value is set, whether
   * via `setValue`, an animation, or `Animated.event`. Useful for compensating
   * things like the start of a pan gesture.
   *
   * See http://facebook.github.io/react-native/docs/animatedvaluexy.html#setoffset
   */
  ;

  _proto.setOffset = function setOffset(offset) {
    this.x.setOffset(offset.x);
    this.y.setOffset(offset.y);
  }
  /**
   * Merges the offset value into the base value and resets the offset to zero.
   * The final output of the value is unchanged.
   *
   * See http://facebook.github.io/react-native/docs/animatedvaluexy.html#flattenoffset
   */
  ;

  _proto.flattenOffset = function flattenOffset() {
    this.x.flattenOffset();
    this.y.flattenOffset();
  }
  /**
   * Sets the offset value to the base value, and resets the base value to
   * zero. The final output of the value is unchanged.
   *
   * See http://facebook.github.io/react-native/docs/animatedvaluexy.html#extractoffset
   */
  ;

  _proto.extractOffset = function extractOffset() {
    this.x.extractOffset();
    this.y.extractOffset();
  };

  _proto.__getValue = function __getValue() {
    return {
      x: this.x.__getValue(),
      y: this.y.__getValue()
    };
  }
  /**
   * Stops any animation and resets the value to its original.
   *
   * See http://facebook.github.io/react-native/docs/animatedvaluexy.html#resetanimation
   */
  ;

  _proto.resetAnimation = function resetAnimation(callback) {
    this.x.resetAnimation();
    this.y.resetAnimation();
    callback && callback(this.__getValue());
  }
  /**
   * Stops any running animation or tracking. `callback` is invoked with the
   * final value after stopping the animation, which is useful for updating
   * state to match the animation position with layout.
   *
   * See http://facebook.github.io/react-native/docs/animatedvaluexy.html#stopanimation
   */
  ;

  _proto.stopAnimation = function stopAnimation(callback) {
    this.x.stopAnimation();
    this.y.stopAnimation();
    callback && callback(this.__getValue());
  }
  /**
   * Adds an asynchronous listener to the value so you can observe updates from
   * animations.  This is useful because there is no way to synchronously read
   * the value because it might be driven natively.
   *
   * Returns a string that serves as an identifier for the listener.
   *
   * See http://facebook.github.io/react-native/docs/animatedvaluexy.html#addlistener
   */
  // $FlowFixMe
  ;

  _proto.addListener = function addListener(callback) {
    var _this2 = this;

    var id = String(_uniqueId++);

    var jointCallback = function jointCallback(_ref) {
      var number = _ref.value;
      callback(_this2.__getValue());
    };

    this._listeners[id] = {
      x: this.x.addListener(jointCallback),
      y: this.y.addListener(jointCallback)
    };
    return id;
  }
  /**
   * Unregister a listener. The `id` param shall match the identifier
   * previously returned by `addListener()`.
   *
   * See http://facebook.github.io/react-native/docs/animatedvaluexy.html#removelistener
   */
  ;

  _proto.removeListener = function removeListener(id) {
    this.x.removeListener(this._listeners[id].x);
    this.y.removeListener(this._listeners[id].y);
    delete this._listeners[id];
  }
  /**
   * Remove all registered listeners.
   *
   * See http://facebook.github.io/react-native/docs/animatedvaluexy.html#removealllisteners
   */
  ;

  _proto.removeAllListeners = function removeAllListeners() {
    this.x.removeAllListeners();
    this.y.removeAllListeners();
    this._listeners = {};
  }
  /**
   * Converts `{x, y}` into `{left, top}` for use in style.
   *
   * See http://facebook.github.io/react-native/docs/animatedvaluexy.html#getlayout
   */
  ;

  _proto.getLayout = function getLayout() {
    return {
      left: this.x,
      top: this.y
    };
  }
  /**
   * Converts `{x, y}` into a useable translation transform.
   *
   * See http://facebook.github.io/react-native/docs/animatedvaluexy.html#gettranslatetransform
   */
  ;

  _proto.getTranslateTransform = function getTranslateTransform() {
    return [{
      translateX: this.x
    }, {
      translateY: this.y
    }];
  };

  return AnimatedValueXY;
}(_AnimatedWithChildren2.default);

var _default = AnimatedValueXY;
exports.default = _default;
module.exports = exports.default;


text:
API Pathfinder is essentially a clickable version of [JSON Pretty Print](http://jsonprettyprint.com/). This web application parses an API's JSON/XML object and generates the key path for any specific attribute. By displaying an object in an easy to read format as well as generating the key path for any element you click, this app is a easy beginner's tool when working with large API packages.

[Link to Deployed App](http://apipathfinder.herokuapp.com/)

## How to Use
API Pathfinder is an extremely easy to use application. Whenever you are working with an API endpoint and are expecting some sort of data package, you can simply place that URL into the search bar. It will then display its contents, indented by its level of nesting. You can then click on any element and it will display in a separate box, the key path you can simply copy and paste in your code.

![](/app/assets/images/api-unparsed.png)
![](/app/assets/images/api-parsed.png)
![](/app/assets/images/api-clicked.png)

## How it Works
It essentially parses an API response and transforms it into one large html string. Each element is wrapped in html code and tagged with the key path within an html's data-tag.

The application relies on a recursive method that identifies each element as either a collection (array or object) or as a single element (string, integer, etc.). So long as it runs into another collection, it will call itself on that collection. The recursive method's base case is when it hits a single element, which it turns into a string and returns. The end result will be every element wrapped in html tags and concatenated into one html string which it displays on the page.

jQuery was used to make each element clickable, generating the key path without reloading the page. This was necessary because this program does not use a database, thus refreshing the page will simply erase whatever was displayed.

## Obstacles
### Overflowing the Browser Stack
As the size and level of nesting for an API's JSON/XML object is unknown, I believed a recursive method would be the best way to address the issue. However, it overwhelmed the browser's stack (chrome, firefox). However, with a bit of refactoring and moving it to the controller fixed the issue.

### Storing the Key Path without a Database
I avoided using a database for this application because of how potentially large the database would have to be, growing with each API request. I decided to use HTML's data attribute to store the key path and use jQuery to retrieve and display the path without refreshing the page.

## Origin
I originally built an even simpler version of API Pathfinder during a project I was working on with my classmates. For this project, we worked with large JSON packages riddled with nested within nested objects and arrays. Although we used 'awesome print,' we still hit road-bumps when we slightly misread the key path within an element. To quickly mitigate this problem, I wrote this program in my free time to use and smooth out my workflow.

## Feedback
The API Pathfinder's functionality pales in comparison to other programs like Postman, but if you are a beginner or you do not want to deal with learning/installing Postman, I hope this is a good alternative. However, as it is a simple and small application, please feel free to email me feedback or angry hate mail. I would love to implement your feedback to make this a more useful tool.

## License
MIT License

<tt>rake doc:app</tt>.


text:
import { describe, it } from '@ephox/bedrock-client';
import { TinyHooks, TinyUiActions } from '@ephox/wrap-mcagar';

import Editor from 'tinymce/core/api/Editor';
import Plugin from 'tinymce/plugins/image/Plugin';

import { assertCleanHtml, fillActiveDialog } from '../../module/Helpers';

describe('browser.tinymce.plugins.image.plugin.DimensionsFalseTest', () => {
  const hook = TinyHooks.bddSetupLight<Editor>({
    plugins: 'image',
    indent: false,
    base_url: '/project/tinymce/js/tinymce',
    image_dimensions: false
  }, [ Plugin ]);

  it('TBA: image dialog image_dimensions: false', async () => {
    const editor = hook.editor();
    editor.execCommand('mceImage');
    await TinyUiActions.pWaitForDialog(editor);

    fillActiveDialog({
      src: {
        value: 'src'
      },
      alt: 'alt'
    });
    TinyUiActions.submitDialog(editor);
    assertCleanHtml('Checking output', editor, '

');
  });
});


text:
import java.io;
import java.util;
import org.apache.HTTP.*;
import android.os.Parcelable.Creator.*;
import org.postgresql.Connection;

public class NotifyMe ( extends Create) {
	NotificationManagerService

	.writeBooleanArray(boolean[]), readBooleanArray(boolean[]), createBooleanArray()

 	.createFromParcel( *source)

}


text:
class SceneRenderState;
class BaseMatInstance;

/// Abstract base class for a zone space that contains only a single zone.
///
/// Simple zones are required to be convex.
class SceneSimpleZone : public SceneZoneSpace
{
   public:

      typedef SceneZoneSpace Parent;

   protected:

      enum
      {
         AmbientMask   = Parent::NextFreeMask << 0,   ///< Ambient light color setting has changed.
         NextFreeMask  = Parent::NextFreeMask << 1,
      };

      /// @name Ambient Lighting
      /// @{

      /// If this is true, then the zone defines its own ambient
      /// light color in #mAmbientColor.
      bool mUseAmbientLightColor;

      /// Ambient light color in this zone.
      ColorF mAmbientLightColor;

      /// @}

      /// @name Transforms
      /// @{

      /// Whether the zone has been rotated.  This is used to fasttrack overlap
      /// tests to avoid doing an OBB/AABB intersection test when we can simply
      /// use a much quicker AABB/AABB intersection test on the world boxes of
      /// both objects.
      bool mIsRotated;

      /// The OBB for the zone.
      OrientedBox3F mOrientedWorldBox;

      /// @}

      /// Return the oriented bounding box for the zone.
      const OrientedBox3F& _getOrientedWorldBox() const { return mOrientedWorldBox; }

      /// Update the OBB for the zone.
      virtual void _updateOrientedWorldBox() { mOrientedWorldBox.set( getTransform(), getScale() ); }

      // SceneObject.
      virtual bool onSceneAdd();

   public:

      SceneSimpleZone();

      /// @name Ambient Lighting
      /// @{

      /// Return true if the zone defines its own ambient light color.
      bool useAmbientLightColor() const { return mUseAmbientLightColor; }

      /// Set whether a custom ambient light color is active in this zone.
      void setUseAmbientLightColor( bool value );

      /// Return the ambient light color for this zone.
      ColorF getAmbientLightColor() const { return mAmbientLightColor; }

      /// Set the ambient light color for the zone.
      /// @note This only takes effect if useAmbientLightColor() return true.
      /// @see setUseAmbientLightColor
      void setAmbientLightColor( const ColorF& color );

      /// @}

      /// @name Inherited
      /// @{

      // SimObject.
      virtual String describeSelf() const;

      static void initPersistFields();

      // NetObject
      virtual U32 packUpdate( NetConnection *conn, U32 mask, BitStream *stream );
      virtual void unpackUpdate( NetConnection *conn, BitStream *stream );

      // SceneObject
      virtual void prepRenderImage( SceneRenderState* state );
      virtual void setTransform( const MatrixF& mat );

      // SceneZoneSpace.
      virtual U32 getPointZone( const Point3F &p );
      virtual bool getOverlappingZones( const Box3F& aabb, U32* outZones, U32& outNumZones );
      virtual void traverseZones( SceneTraversalState* state );
      virtual bool getZoneAmbientLightColor( U32 zone, ColorF& outColor ) const;
      virtual void traverseZones( SceneTraversalState* state, U32 startZoneId );

      /// @}

   private:

      static bool _setUseAmbientLightColor( void* object, const char* index, const char* data );
      static bool _setAmbientLightColor( void* object, const char* index, const char* data );
};

#endif // !_SCENESIMPLEZONE_H_


text:
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"

source "${DIR}/apollo_base.sh"

# run function from apollo_base.sh
# run command_name module_name
run_module planning "$@"


text:
module.exports = angular.module('heremaps-routes-module', [])
                    .service('HereMapsRoutesService', require('./routes.service.js'));


text:
==================
ml2_conf_sriov.ini
==================

The ``plugins/ml2/ml2_conf_sriov.ini`` file contains configuration for the
ML2 plug-in specific to SR-IOV.

.. literalinclude:: ../../samples/neutron/ml2_conf_sriov.ini.sample
   :language: ini


text:
/*
 * Forked from https://github.com/codahale/metrics
 */

package org.apache.solr.util.stats;

import org.apache.solr.util.stats.Histogram.SampleType;

import java.util.concurrent.Callable;
import java.util.concurrent.TimeUnit;

/**
 * A timer metric which aggregates timing durations and provides duration statistics, plus
 * throughput statistics via {@link Meter}.
 */
public class Timer {

  private final TimeUnit durationUnit, rateUnit;
  private final Meter meter;
  private final Histogram histogram = new Histogram(SampleType.BIASED);
  private final Clock clock;

  public Timer() {
    this(TimeUnit.MILLISECONDS, TimeUnit.SECONDS, Clock.defaultClock());
  }

  /**
   * Creates a new {@link Timer}.
   *
   * @param durationUnit the scale unit for this timer's duration metrics
   * @param rateUnit     the scale unit for this timer's rate metrics
   * @param clock        the clock used to calculate duration
   */
  public Timer(TimeUnit durationUnit, TimeUnit rateUnit, Clock clock) {
    this.durationUnit = durationUnit;
    this.rateUnit = rateUnit;
    this.meter = new Meter("calls", rateUnit, clock);
    this.clock = clock;
    clear();
  }

  /**
   * Returns the timer's duration scale unit.
   *
   * @return the timer's duration scale unit
   */
  public TimeUnit getDurationUnit() {
    return durationUnit;
  }

  public TimeUnit getRateUnit() {
    return rateUnit;
  }

  /**
   * Clears all recorded durations.
   */
  public void clear() {
    histogram.clear();
  }

  /**
   * Adds a recorded duration.
   *
   * @param duration the length of the duration
   * @param unit     the scale unit of {@code duration}
   */
  public void update(long duration, TimeUnit unit) {
    update(unit.toNanos(duration));
  }

  /**
   * Times and records the duration of event.
   *
   * @param event a {@link Callable} whose {@link Callable#call()} method implements a process
   *              whose duration should be timed
   * @param <T>   the type of the value returned by {@code event}
   * @return the value returned by {@code event}
   * @throws Exception if {@code event} throws an {@link Exception}
   */
  public <T> T time(Callable<T> event) throws Exception {
    final long startTime = clock.getTick();
    try {
      return event.call();
    } finally {
      update(clock.getTick() - startTime);
    }
  }

  /**
   * Returns a timing {@link TimerContext}, which measures an elapsed time in nanoseconds.
   *
   * @return a new {@link TimerContext}
   */
  public TimerContext time() {
    return new TimerContext(this, clock);
  }

  public long getCount() {
    return histogram.getCount();
  }

  public double getFifteenMinuteRate() {
    return meter.getFifteenMinuteRate();
  }

  public double getFiveMinuteRate() {
    return meter.getFiveMinuteRate();
  }

  public double getMeanRate() {
    return meter.getMeanRate();
  }

  public double getOneMinuteRate() {
    return meter.getOneMinuteRate();
  }

  /**
   * Returns the longest recorded duration.
   *
   * @return the longest recorded duration
   */
  public double getMax() {
    return convertFromNS(histogram.getMax());
  }

  /**
   * Returns the shortest recorded duration.
   *
   * @return the shortest recorded duration
   */
  public double getMin() {
    return convertFromNS(histogram.getMin());
  }

  /**
   * Returns the arithmetic mean of all recorded durations.
   *
   * @return the arithmetic mean of all recorded durations
   */
  public double getMean() {
    return convertFromNS(histogram.getMean());
  }

  /**
   * Returns the standard deviation of all recorded durations.
   *
   * @return the standard deviation of all recorded durations
   */
  public double getStdDev() {
    return convertFromNS(histogram.getStdDev());
  }

  /**
   * Returns the sum of all recorded durations.
   *
   * @return the sum of all recorded durations
   */
  public double getSum() {
    return convertFromNS(histogram.getSum());
  }

  public Snapshot getSnapshot() {
    final double[] values = histogram.getSnapshot().getValues();
    final double[] converted = new double[values.length];
    for (int i = 0; i < values.length; i++) {
      converted[i] = convertFromNS(values[i]);
    }
    return new Snapshot(converted);
  }

  public String getEventType() {
    return meter.getEventType();
  }

  private void update(long duration) {
    if (duration >= 0) {
      histogram.update(duration);
      meter.mark();
    }
  }

  private double convertFromNS(double ns) {
    return ns / TimeUnit.NANOSECONDS.convert(1, durationUnit);
  }
}


text:
/// <reference types="node" />

import { EventEmitter } from 'events';

import { Transport, TransportOptions } from '..';

import * as shared from './shared';

import Mail = require('./mailer');
import MailMessage = require('./mailer/mail-message');
import MimeNode = require('./mime-node');

declare namespace JSONTransport {
    type MailOptions = Mail.Options;

    interface Options extends MailOptions, TransportOptions {
        jsonTransport: true;
        skipEncoding?: boolean;
    }

    interface SentMessageInfo {
        /** an envelope object {from:'address', to:['address']} */
        envelope: MimeNode.Envelope;
        /** the Message-ID header value */
        messageId: string;
        /** JSON string */
        message: string;
    }
}

declare class JSONTransport implements Transport<JSONTransport.SentMessageInfo> {
    options: JSONTransport.Options;

    logger: shared.Logger;
    mailer: Mail<JSONTransport.SentMessageInfo>;

    name: string;
    version: string;

    constructor(options: JSONTransport.Options);

    /** Compiles a mailcomposer message and forwards it to handler that sends it */
    send(mail: MailMessage<JSONTransport.SentMessageInfo>, callback: (err: Error | null, info: JSONTransport.SentMessageInfo) => void): void;
}

export = JSONTransport;


text:
//
// Copyright 2019 Google LLC.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

// To enable the linter recognize this be an Objective-C file.
@class NSString;

FOUNDATION_EXPORT NSErrorDomain const EDOServiceErrorDomain;

NS_ERROR_ENUM(EDOServiceErrorDomain){
    EDOServiceErrorCannotConnect = -1000,
    EDOServiceErrorConnectTimeout,
    EDOServiceErrorRequestNotHandled,
    EDOServiceErrorNamingServiceUnavailable,
};

/** Key in userInfo, the value is an NSString describing the request being sent. */
FOUNDATION_EXPORT NSErrorUserInfoKey const EDOErrorRequestKey;

/** Key in userInfo, the value is an NSString describing the response that's received. */
FOUNDATION_EXPORT NSErrorUserInfoKey const EDOErrorResponseKey;

/** Key in userInfo, the value is an EDOHostPort describing the remote service's port. */
FOUNDATION_EXPORT NSErrorUserInfoKey const EDOErrorPortKey;

/** Key in userInfo, the value is an NSNumber describing the attemp to connect to the service. */
FOUNDATION_EXPORT NSErrorUserInfoKey const EDOErrorConnectAttemptKey;

/** Key in userInfo, the value is an NSString describing the reason of the type encoding error. */
FOUNDATION_EXPORT NSErrorUserInfoKey const EDOErrorEncodingFailureReasonKey;

NS_ASSUME_NONNULL_END


text:
'''Example StatefulWordCountTopology'''
import sys

import heronpy.api.api_constants as constants
from heronpy.api.topology import TopologyBuilder
from heronpy.api.stream import Grouping
from examples.src.python.spout import StatefulWordSpout
from examples.src.python.bolt import StatefulCountBolt

# Topology is defined using a topology builder
# Refer to multi_stream_topology for defining a topology by subclassing Topology
# pylint: disable=superfluous-parens
if __name__ == '__main__':
  if len(sys.argv) != 2:
    print("Topology's name is not specified")
    sys.exit(1)

  builder = TopologyBuilder(name=sys.argv[1])

  word_spout = builder.add_spout("word_spout", StatefulWordSpout, par=2)
  count_bolt = builder.add_bolt("count_bolt", StatefulCountBolt, par=2,
                                inputs={word_spout: Grouping.fields('word')},
                                config={constants.TOPOLOGY_TICK_TUPLE_FREQ_SECS: 10})

  topology_config = {constants.TOPOLOGY_RELIABILITY_MODE:
                         constants.TopologyReliabilityMode.EFFECTIVELY_ONCE,
                     constants.TOPOLOGY_STATEFUL_CHECKPOINT_INTERVAL_SECONDS: 30}
  builder.set_config(topology_config)

  builder.build_and_submit()


text:
@interface PodsDummy_Pods_OutputFaceBookData : NSObject
@end
@implementation PodsDummy_Pods_OutputFaceBookData
@end


text:
package com.phloc.commons.io.streams;

import static org.junit.Assert.assertEquals;

import java.io.File;
import java.io.IOException;

import org.junit.Test;

import com.phloc.commons.mock.PhlocTestUtils;

/**
 * Test class for class {@link CountingFileInputStream}.
 *
 * @author Philip Helger
 */
public final class CountingFileInputStreamTest
{
  @Test
  public void testAll () throws IOException
  {
    CountingFileInputStream aCIS = new CountingFileInputStream ("pom.xml");
    try
    {
      aCIS.read ();
      assertEquals (1, aCIS.read (new byte [5], 1, 1));
      StreamUtils.copyInputStreamToOutputStream (aCIS, new NonBlockingByteArrayOutputStream ());
      PhlocTestUtils.testToStringImplementation (aCIS);
    }
    finally
    {
      StreamUtils.close (aCIS);
    }

    aCIS = new CountingFileInputStream (new File ("pom.xml"));
    try
    {
      aCIS.read ();
      assertEquals (1, aCIS.read (new byte [5], 1, 1));
      StreamUtils.copyInputStreamToOutputStream (aCIS, new NonBlockingByteArrayOutputStream ());
      PhlocTestUtils.testToStringImplementation (aCIS);
    }
    finally
    {
      StreamUtils.close (aCIS);
    }
  }
}


text:
module Cogi
  class EventBus
    def initialize
    end

    def step
      queue = _queue.dup
      _queue.clear

      queue.each { |event_name, args|
        _process_event(event_name, args)
      }
    end

    def subscribe_to(event_name, &block)
      _subscriptions[event_name.to_sym] << block
    end

    def fire(event_name, *args)
      _queue << [event_name.to_sym, args]
    end

    private

    def _process_event(event_name, args)
      _subscriptions[event_name].each { |sub|
        sub.call(*args)
      }
    end

    def _subscriptions
      @__subscriptions ||= Hash.new([])
    end

    def _queue
      @__queue ||= []
    end
  end # EventBus
end # Cogi


text:
<?php

namespace Tempo\Bundle\UserBundle\Model;

abstract class Notification implements NotificationInterface
{
    protected $id;
    protected $user;
    protected $createdAt;
    protected $state;
    protected $link;
    protected $message;

    const STATE_UNREAD = 0;
    const STATE_READ = 1;
    const STATE_DELETED = 2;

    public function __construct()
    {
        $this->createdAt = new \DateTime();
        $this->state = self::STATE_UNREAD;
    }

    /**
     * {@inheritdoc}
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * {@inheritdoc}
     */
    public function setUser($user)
    {
        $this->user = $user;

        return $this;
    }

    /**
     * {@inheritdoc}
     */
    public function getUser()
    {
        return $this->user;
    }

    /**
     * {@inheritdoc}
     */
    public function setCreatedAt(\DateTime $datetime)
    {
        $this->createdAt = $datetime;

        return $this;
    }

    /**
     * {@inheritdoc}
     */
    public function getCreatedAt()
    {
        return $this->createdAt;
    }

    /**
     * {@inheritdoc}
     */
    public function setState($state)
    {
        $this->state = $state;

        return $this;
    }

    /**
     * {@inheritdoc}
     */
    public function getState()
    {
        return $this->state;
    }

    /**
     * {@inheritdoc}
     */
    public function setLink($link)
    {
        $this->link = $link;

        return $this;
    }

    /**
     * {@inheritdoc}
     */
    public function getLink()
    {
        return $this->link;
    }

    /**
     * {@inheritdoc}
     */
    public function setMessage($message)
    {
        $this->message = $message;

        return $this;
    }

    /**
     * {@inheritdoc}
     */
    public function getMessage()
    {
        return $this->message;
    }
}


text:
layout: blog
title: Suggestions, Tips, and Inside Info
permalink: /suggestions/thank-you/
---

Thank you for your suggestion!

        We really appreciate it.


text:
package maniotrix.xblunt.transporter.util;

import java.net.Authenticator;
import java.net.PasswordAuthentication;

public class Proxy {
	public static String http_Host = "1";
	public static String http_Port = "s";
	public static String http_Username = "f";
	public static String http_Password = "s";
	public static String https_Host = "";
	public static String https_Port = "";
	public static String https_Username = "";
	public static String https_Password = "";
	public static String socksHost = "";
	public static String socksPort = "";
	public static String socksUsername = "";
	public static String socksPassword = "";

	public static void setHttp(String host, String port, String pass,
			String user) {
		System.out.println("Using Http proxy: " + host + ":" + port
				+ " username= " + user + " password= " + pass);
		System.setProperty("http.proxyHost", host);
		System.setProperty("http.proxyPort", port);
		System.setProperty("http.nonProxyHosts", "localhost|127.0.0.1");
		final String username = user;
		final String password = pass;
		if (password != "" && username != "") {
			Authenticator.setDefault(new Authenticator() {
				public PasswordAuthentication getPasswordAuthentication() {
					return new PasswordAuthentication(username, password
							.toCharArray());
				}
			});

			System.setProperty("http.proxyUser", username);
			System.setProperty("http.proxyPassword", password);
		}

	}

	public static void setHttps(String host, String port,
			final String pass, final String user) {
		System.out.println("Using Https proxy: " + host + ":" + port
				+ " username= " + user + " password= " + pass);
		System.setProperty("https.proxyHost", host);
		System.setProperty("https.proxyPort", port);
		System.setProperty("https.nonProxyHosts", "localhost|127.0.0.1");
		final String username = user;
		final String password = pass;
		if (password != "" && username != "") {
			Authenticator.setDefault(new Authenticator() {
				public PasswordAuthentication getPasswordAuthentication() {
					return new PasswordAuthentication(username, password
							.toCharArray());
				}
			});

			System.setProperty("https.proxyUser", username);
			System.setProperty("https.proxyPassword", password);
		}

	}

	public static void setProxySocks_v5(String host, String port,
			final String pass, final String user) {

		System.out.println("Using Socks proxy: " + host + ":" + port
				+ " username= " + user + " password= " + pass);
		System.setProperty("socksProxyVersion", "5");
		System.setProperty("socksProxyHost", host);
		System.setProperty("socksProxyPort", port);
		final String username = user;
		final String password = pass;
		System.setProperty("socks.nonProxyHosts", "localhost|127.0.0.1");
		if (password != "" && username != "") {
			Authenticator.setDefault(new Authenticator() {
				public PasswordAuthentication getPasswordAuthentication() {
					return new PasswordAuthentication(username, password
							.toCharArray());
				}
			});
			System.setProperty("java.net.socks.username", username);
			System.setProperty("java.net.socks.password", password);
		}
	}

	public static void setProxySocks_v4(String host, String port,
			final String password, final String username) {

		System.out.println("Using Socks proxy: " + host + ":" + port
				+ " username= " + username + " password= " + password);
		System.setProperty("socksProxyVersion", "4");
		System.setProperty("socksProxyHost", host);
		System.setProperty("socksProxyPort", port);
		// final String username=user;
		System.setProperty("socks.nonProxyHosts", "localhost|127.0.0.1");
		if (password != "" && username != "") {
			Authenticator.setDefault(new Authenticator() {
				public PasswordAuthentication getPasswordAuthentication() {
					return new PasswordAuthentication(username, password
							.toCharArray());
				}
			});
			System.setProperty("java.net.socks.username", username);
			System.setProperty("java.net.socks.password", password);
		}
	}

	public static void removeProxy() {
		System.clearProperty("http.proxyHost");
		System.clearProperty("http.proxyPort");
		System.clearProperty("http.proxyUser");
		System.clearProperty("http.proxyPassword");

		System.clearProperty("https.proxyHost");
		System.clearProperty("https.proxyPort");
		System.clearProperty("https.proxyUser");
		System.clearProperty("https.proxyPassword");

		System.clearProperty("socksProxyVersion");
		System.clearProperty("socksProxyHost");
		System.clearProperty("socksProxyPort");

		System.clearProperty("java.net.socks.username");
		System.clearProperty("java.net.socks.password");

		System.clearProperty("java.net.useSystemProxies");

		System.setProperty("http.nonProxyHosts", "localhost|127.0.0.1");
		System.setProperty("https.nonProxyHosts", "localhost|127.0.0.1");
		System.setProperty("socks.nonProxyHosts", "localhost|127.0.0.1");
	}

	public static void useProxyhttps() {

		String host = "10.1.1.19";
		String port = "80";
		System.out.println("Using proxy: " + host + ":" + port);
		System.setProperty("https.proxyHost", host);
		System.setProperty("https.proxyPort", port);
		System.setProperty("https.nonProxyHosts", "localhost|127.0.0.1");
		final String authUser = "506.13135079";
		final String authPassword = "iitcc2013";
		Authenticator.setDefault(new Authenticator() {
			public PasswordAuthentication getPasswordAuthentication() {
				return new PasswordAuthentication(authUser, authPassword
						.toCharArray());
			}
		});

		System.setProperty("https.proxyUser", authUser);
		System.setProperty("https.proxyPassword", authPassword);
	}

	public static void useProxyhttp() {

		String host = "10.1.1.19";
		String port = "80";
		System.out.println("Using proxy: " + host + ":" + port);
		System.setProperty("http.proxyHost", host);
		System.setProperty("http.proxyPort", port);
		System.setProperty("http.nonProxyHosts", "localhost|127.0.0.1");
		final String authUser = "506.13135079";
		final String authPassword = "iitcc2013";
		Authenticator.setDefault(new Authenticator() {
			public PasswordAuthentication getPasswordAuthentication() {
				return new PasswordAuthentication(authUser, authPassword
						.toCharArray());
			}
		});

		System.setProperty("http.proxyUser", authUser);
		System.setProperty("http.proxyPassword", authPassword);
	}

	public static void useProxyhttps16() {

		String host = "10.1.1.16";
		String port = "80";
		System.out.println("Using proxy: " + host + ":" + port);
		System.setProperty("https.proxyHost", host);
		System.setProperty("https.proxyPort", port);
		System.setProperty("https.nonProxyHosts", "localhost|127.0.0.1");
		final String authUser = "067.9721097213";
		final String authPassword = "kshitizkmr091";
		Authenticator.setDefault(new Authenticator() {
			public PasswordAuthentication getPasswordAuthentication() {
				return new PasswordAuthentication(authUser, authPassword
						.toCharArray());
			}
		});

		System.setProperty("https.proxyUser", authUser);
		System.setProperty("https.proxyPassword", authPassword);
	}

	public static void useProxyhttp16() {

		String host = "10.1.1.16";
		String port = "80";
		System.out.println("Using proxy: " + host + ":" + port);
		System.setProperty("http.proxyHost", host);
		System.setProperty("http.proxyPort", port);
		System.setProperty("http.nonProxyHosts", "localhost|127.0.0.1");
		final String authUser = "067.9721097213";
		final String authPassword = "kshitizkmr091";
		Authenticator.setDefault(new Authenticator() {
			public PasswordAuthentication getPasswordAuthentication() {
				return new PasswordAuthentication(authUser, authPassword
						.toCharArray());
			}
		});

		System.setProperty("http.proxyUser", authUser);
		System.setProperty("http.proxyPassword", authPassword);
	}

}


text:
package io.cattle.platform.servicediscovery.deployment.lookups;

import io.cattle.platform.core.model.Instance;

import java.util.Arrays;
import java.util.Collection;

public class InstanceDeploymentUnitLookup implements DeploymentUnitLookup {

    @Override
    public Collection<Long> getDeploymentUnits(Object obj) {
        if (obj instanceof Instance) {
            return Arrays.asList(((Instance) obj).getDeploymentUnitId());
        }
        return null;
    }

}


text:
import { combineEpics } from 'redux-observable';
import { from, of } from 'rxjs';
import {
  map,
  mergeMap,
  tap,
  pluck,
  ignoreElements,
  filter,
  take
} from 'rxjs/operators';
import { find } from 'kernelspecs';
import { launchSpec } from 'spawnteract';
import { createMainChannel } from 'enchannel-zmq-backend';
import { isNil } from 'lodash';
import { kernelInfoRequest, executeRequest } from '@nteract/messaging';
import { toast } from 'react-toastify';
import { execute, awaitOkMessage } from '../utils/jupyter/pipes';
import { getWorkspaceDir } from '../utils/filesystem/storage';
import {
  LAUNCH_KERNEL,
  REQUEST_KERNEL_INFO,
  LOAD_EPOCHS,
  LOAD_CLEANED_EPOCHS,
  LOAD_PSD,
  LOAD_ERP,
  LOAD_TOPO,
  CLEAN_EPOCHS,
  CLOSE_KERNEL,
  loadTopo,
  loadERP
} from '../actions/jupyterActions';
import {
  imports,
  utils,
  loadCSV,
  loadCleanedEpochs,
  filterIIR,
  epochEvents,
  requestEpochsInfo,
  requestChannelInfo,
  cleanEpochsPlot,
  plotPSD,
  plotERP,
  plotTopoMap,
  saveEpochs
} from '../utils/jupyter/cells';
import {
  EMOTIV_CHANNELS,
  EVENTS,
  DEVICES,
  MUSE_CHANNELS,
  JUPYTER_VARIABLE_NAMES
} from '../constants/constants';
import {
  parseSingleQuoteJSON,
  parseKernelStatus,
  debugParseMessage
} from '../utils/jupyter/functions';

export const GET_EPOCHS_INFO = 'GET_EPOCHS_INFO';
export const GET_CHANNEL_INFO = 'GET_CHANNEL_INFO';
export const SET_KERNEL = 'SET_KERNEL';
export const SET_KERNEL_STATUS = 'SET_KERNEL_STATUS';
export const SET_KERNEL_INFO = 'SET_KERNEL_INFO';
export const SET_MAIN_CHANNEL = 'SET_MAIN_CHANNEL';
export const SET_EPOCH_INFO = 'SET_EPOCH_INFO';
export const SET_CHANNEL_INFO = 'SET_CHANNEL_INFO';
export const SET_PSD_PLOT = 'SET_PSD_PLOT';
export const SET_ERP_PLOT = 'SET_ERP_PLOT';
export const SET_TOPO_PLOT = 'SET_TOPO_PLOT';
export const RECEIVE_EXECUTE_REPLY = 'RECEIVE_EXECUTE_REPLY';
export const RECEIVE_EXECUTE_RESULT = 'RECEIVE_EXECUTE_RESULT';
export const RECEIVE_STREAM = 'RECEIVE_STREAM';
export const RECEIVE_DISPLAY_DATA = 'RECEIVE_DISPLAY_DATA';

// -------------------------------------------------------------------------
// Action Creators

const getEpochsInfo = payload => ({ payload, type: GET_EPOCHS_INFO });

const getChannelInfo = () => ({ type: GET_CHANNEL_INFO });

const setKernel = payload => ({
  payload,
  type: SET_KERNEL
});

const setKernelStatus = payload => ({
  payload,
  type: SET_KERNEL_STATUS
});

const setKernelInfo = payload => ({
  payload,
  type: SET_KERNEL_INFO
});

const setMainChannel = payload => ({
  payload,
  type: SET_MAIN_CHANNEL
});

const setEpochInfo = payload => ({
  payload,
  type: SET_EPOCH_INFO
});

const setChannelInfo = payload => ({
  payload,
  type: SET_CHANNEL_INFO
});

const setPSDPlot = payload => ({
  payload,
  type: SET_PSD_PLOT
});

const setTopoPlot = payload => ({
  payload,
  type: SET_TOPO_PLOT
});

const setERPPlot = payload => ({
  payload,
  type: SET_ERP_PLOT
});

const receiveExecuteReply = payload => ({
  payload,
  type: RECEIVE_EXECUTE_REPLY
});

const receiveExecuteResult = payload => ({
  payload,
  type: RECEIVE_EXECUTE_RESULT
});

const receiveDisplayData = payload => ({
  payload,
  type: RECEIVE_DISPLAY_DATA
});

const receiveStream = payload => ({
  payload,
  type: RECEIVE_STREAM
});

// -------------------------------------------------------------------------
// Epics

const launchEpic = action$ =>
  action$.ofType(LAUNCH_KERNEL).pipe(
    mergeMap(() => from(find('brainwaves'))),
    tap(kernelInfo => {
      if (isNil(kernelInfo)) {
        toast.error(
          "Could not find 'brainwaves' jupyter kernel. Have you installed Python?"
        );
      }
    }),
    filter(kernelInfo => !isNil(kernelInfo)),
    mergeMap(kernelInfo =>
      from(
        launchSpec(kernelInfo.spec, {
          // No STDIN, opt in to STDOUT and STDERR as node streams
          stdio: ['ignore', 'pipe', 'pipe']
        })
      )
    ),
    tap(kernel => {
      // Route everything that we won't get in messages to our own stdout
      kernel.spawn.stdout.on('data', data => {
        const text = data.toString();
        console.log('KERNEL STDOUT: ', text);
      });
      kernel.spawn.stderr.on('data', data => {
        const text = data.toString();
        console.log('KERNEL STDERR: ', text);
        toast.error('Jupyter: ', text);
      });

      kernel.spawn.on('close', () => {
        console.log('Kernel closed');
      });
    }),
    map(setKernel)
  );

const setUpChannelEpic = action$ =>
  action$.ofType(SET_KERNEL).pipe(
    pluck('payload'),
    mergeMap(kernel => from(createMainChannel(kernel.config))),
    tap(mainChannel => mainChannel.next(executeRequest(imports()))),
    tap(mainChannel => mainChannel.next(executeRequest(utils()))),
    map(setMainChannel)
  );

const receiveChannelMessageEpic = (action$, state$) =>
  action$.ofType(SET_MAIN_CHANNEL).pipe(
    mergeMap(() =>
      state$.value.jupyter.mainChannel.pipe(
        map(msg => {
          console.log(debugParseMessage(msg));
          switch (msg['header']['msg_type']) {
            case 'kernel_info_reply':
              return setKernelInfo(msg);
            case 'status':
              return setKernelStatus(parseKernelStatus(msg));
            case 'stream':
              return receiveStream(msg);
            case 'execute_reply':
              return receiveExecuteReply(msg);
            case 'execute_result':
              return receiveExecuteResult(msg);
            case 'display_data':
              return receiveDisplayData(msg);
            default:
          }
        }),
        filter(action => !isNil(action))
      )
    )
  );

const requestKernelInfoEpic = (action$, state$) =>
  action$.ofType(REQUEST_KERNEL_INFO).pipe(
    filter(() => state$.value.jupyter.mainChannel),
    map(() => state$.value.jupyter.mainChannel.next(kernelInfoRequest())),
    ignoreElements()
  );

const loadEpochsEpic = (action$, state$) =>
  action$.ofType(LOAD_EPOCHS).pipe(
    pluck('payload'),
    filter(filePathsArray => filePathsArray.length >= 1),
    map(filePathsArray =>
      state$.value.jupyter.mainChannel.next(
        executeRequest(loadCSV(filePathsArray))
      )
    ),
    awaitOkMessage(action$),
    execute(filterIIR(1, 30), state$),
    awaitOkMessage(action$),
    map(() =>
      epochEvents(
        {
          [state$.value.experiment.params.stimulus1.title]: EVENTS.STIMULUS_1,
          [state$.value.experiment.params.stimulus2.title]: EVENTS.STIMULUS_2
        },
        -0.1,
        0.8
      )
    ),
    map(epochEventsCommand =>
      state$.value.jupyter.mainChannel.next(executeRequest(epochEventsCommand))
    ),
    awaitOkMessage(action$),
    map(() => getEpochsInfo(JUPYTER_VARIABLE_NAMES.RAW_EPOCHS))
  );

const loadCleanedEpochsEpic = (action$, state$) =>
  action$.ofType(LOAD_CLEANED_EPOCHS).pipe(
    pluck('payload'),
    filter(filePathsArray => filePathsArray.length >= 1),
    map(filePathsArray =>
      state$.value.jupyter.mainChannel.next(
        executeRequest(loadCleanedEpochs(filePathsArray))
      )
    ),
    awaitOkMessage(action$),
    mergeMap(() =>
      of(
        getEpochsInfo(JUPYTER_VARIABLE_NAMES.CLEAN_EPOCHS),
        getChannelInfo(),
        loadTopo()
      )
    )
  );

const cleanEpochsEpic = (action$, state$) =>
  action$.ofType(CLEAN_EPOCHS).pipe(
    execute(cleanEpochsPlot(), state$),
    mergeMap(() =>
      action$.ofType(RECEIVE_STREAM).pipe(
        pluck('payload'),
        filter(
          msg =>
            msg.channel === 'iopub' &&
            msg.content.text.includes('Channels marked as bad')
        ),
        take(1)
      )
    ),
    map(() =>
      state$.value.jupyter.mainChannel.next(
        executeRequest(
          saveEpochs(
            getWorkspaceDir(state$.value.experiment.title),
            state$.value.experiment.subject
          )
        )
      )
    ),
    awaitOkMessage(action$),
    map(() => getEpochsInfo(JUPYTER_VARIABLE_NAMES.RAW_EPOCHS))
  );

const getEpochsInfoEpic = (action$, state$) =>
  action$.ofType(GET_EPOCHS_INFO).pipe(
    pluck('payload'),
    map(variableName =>
      state$.value.jupyter.mainChannel.next(
        executeRequest(requestEpochsInfo(variableName))
      )
    ),
    mergeMap(() =>
      action$.ofType(RECEIVE_EXECUTE_RESULT).pipe(
        pluck('payload'),
        filter(msg => msg.channel === 'iopub' && !isNil(msg.content.data)),
        pluck('content', 'data', 'text/plain'),
        filter(msg => msg.includes('Drop Percentage')),
        take(1)
      )
    ),
    map(epochInfoString =>
      parseSingleQuoteJSON(epochInfoString).map(infoObj => ({
        name: Object.keys(infoObj)[0],
        value: infoObj[Object.keys(infoObj)[0]]
      }))
    ),
    map(setEpochInfo)
  );

const getChannelInfoEpic = (action$, state$) =>
  action$.ofType(GET_CHANNEL_INFO).pipe(
    execute(requestChannelInfo(), state$),
    mergeMap(() =>
      action$.ofType(RECEIVE_EXECUTE_RESULT).pipe(
        pluck('payload'),
        filter(msg => msg.channel === 'iopub' && !isNil(msg.content.data)),
        pluck('content', 'data', 'text/plain'),
        // Filter to prevent this from reading requestEpochsInfo returns
        filter(msg => !msg.includes('Drop Percentage')),
        take(1)
      )
    ),
    map(channelInfoString =>
      setChannelInfo(parseSingleQuoteJSON(channelInfoString))
    )
  );

const loadPSDEpic = (action$, state$) =>
  action$.ofType(LOAD_PSD).pipe(
    execute(plotPSD(), state$),
    mergeMap(() =>
      action$.ofType(RECEIVE_DISPLAY_DATA).pipe(
        pluck('payload'),
        // PSD graphs should have two axes
        filter(msg => msg.content.data['text/plain'].includes('2 Axes')),
        pluck('content', 'data'),
        take(1)
      )
    ),
    map(setPSDPlot)
  );

const loadTopoEpic = (action$, state$) =>
  action$.ofType(LOAD_TOPO).pipe(
    execute(plotTopoMap(), state$),
    mergeMap(() =>
      action$.ofType(RECEIVE_DISPLAY_DATA).pipe(
        pluck('payload'),
        pluck('content', 'data'),
        take(1)
      )
    ),
    mergeMap(topoPlot =>
      of(
        setTopoPlot(topoPlot),
        loadERP(
          state$.value.device.deviceType === DEVICES.EMOTIV
            ? EMOTIV_CHANNELS[0]
            : MUSE_CHANNELS[0]
        )
      )
    )
  );

const loadERPEpic = (action$, state$) =>
  action$.ofType(LOAD_ERP).pipe(
    pluck('payload'),
    map(channelName => {
      if (MUSE_CHANNELS.includes(channelName)) {
        return MUSE_CHANNELS.indexOf(channelName);
      } else if (EMOTIV_CHANNELS.includes(channelName)) {
        return EMOTIV_CHANNELS.indexOf(channelName);
      }
      console.warn(
        'channel name supplied to loadERPEpic does not belong to either device'
      );
      return EMOTIV_CHANNELS[0];
    }),
    map(channelIndex =>
      state$.value.jupyter.mainChannel.next(
        executeRequest(plotERP(channelIndex))
      )
    ),
    mergeMap(() =>
      action$.ofType(RECEIVE_DISPLAY_DATA).pipe(
        pluck('payload'),
        // ERP graphs should have 1 axis according to MNE
        filter(msg => msg.content.data['text/plain'].includes('1 Axes')),
        pluck('content', 'data'),
        take(1)
      )
    ),
    map(setERPPlot)
  );

const closeKernelEpic = (action$, state$) =>
  action$.ofType(CLOSE_KERNEL).pipe(
    map(() => {
      state$.value.jupyter.kernel.spawn.kill();
      state$.value.jupyter.mainChannel.complete();
    }),
    ignoreElements()
  );

export default combineEpics(
  launchEpic,
  setUpChannelEpic,
  requestKernelInfoEpic,
  receiveChannelMessageEpic,
  loadEpochsEpic,
  loadCleanedEpochsEpic,
  cleanEpochsEpic,
  getEpochsInfoEpic,
  getChannelInfoEpic,
  loadPSDEpic,
  loadTopoEpic,
  loadERPEpic,
  closeKernelEpic
);


text:
package infermedica

import (
	"encoding/json"
	"net/http"
	"time"

	"github.com/pkg/errors"
)

// SuggestReq is a struct to request suggestions
type SuggestReq struct {
	Sex       Sex        `json:"sex"`
	Age       int        `json:"age"`
	Evidences []Evidence `json:"evidence"`
}

// SuggestRes is a response struct for suggest
type SuggestRes struct {
	ID         string `json:"id"`
	Name       string `json:"name"`
	CommonName string `json:"common_name"`
}

// Suggest is a func to request suggestions
func (a *App) Suggest(sr SuggestReq) (*[]SuggestRes, error) {
	if !sr.Sex.IsValid() {
		return nil, errors.New("Unexpected value for Sex")
	}
	req, err := a.prepareRequest("POST", "suggest", sr)
	if err != nil {
		return nil, err
	}
	client := &http.Client{
		Timeout: time.Second * 5,
	}
	res, err := client.Do(req)
	if err != nil {
		return nil, err
	}
	defer res.Body.Close()
	r := []SuggestRes{}
	err = json.NewDecoder(res.Body).Decode(&r)
	if err != nil {
		return nil, err
	}
	return &r, nil
}


text:
test_name "general collection should get all exported resources except the host's" do
  step "clear puppetdb database" do
    clear_and_restart_puppetdb(database)
  end

  names = hosts.map(&:hostname)

  manifest = names.map do |name|
    <<-PIECE
node "#{name}" {
  @@notify { "Hello from #{name}": }
  notify { "#{name} only": }
}
    PIECE
  end.join("\n")

  manifest << "\nNotify <<| |>>"

  manifest_path = create_remote_site_pp(master, manifest)
  with_puppet_running_on master, {
    'master' => {
      'autosign' => 'true',
    },
    'main' => {
      'environmentpath' => manifest_path
    }
  } do

    step "Run agent once to populate database" do
      run_agent_on hosts, "--test --server #{master}", :acceptable_exit_codes => [0,2]
    end

    # Wait until all the commands have been processed
    sleep_until_queue_empty database

    step "Run agent to collect resources" do

      run_agent_on hosts, "--test --server #{master}", :acceptable_exit_codes => [0,2] do
        hostname = result.host

        names.each do |name|
          assert_match(/Hello from #{CGI.escape(name)}/, result.output, "#{hostname} failed to collect from #{name}")
        end
      end
    end
  end

  step "attempt export with undef array elements" do
    manifest = <<-MANIFEST
    @@notify { "test":
            tag => [undef, "a", "b"],
            }
    MANIFEST

    manifest_path = create_remote_site_pp(master, manifest)
    with_puppet_running_on master, {
      'master' => {
        'autosign' => 'true',
    },
    'main' => {
      'environmentpath' => manifest_path
    }
    } do

      step "run agent on master to ensure no failure" do
        run_agent_on master, "--test --server #{master}", :acceptable_exit_codes => [0,2]
      end
    end
  end
end