text:
(function webpackUniversalModuleDefinition(root, factory) {
	if(typeof exports === 'object' && typeof module === 'object')
		module.exports = factory(require("./foundation.core"), require("./foundation.util.keyboard"), require("./foundation.util.nest"), require("jquery"));
	else if(typeof define === 'function' && define.amd)
		define(["./foundation.core", "./foundation.util.keyboard", "./foundation.util.nest", "jquery"], factory);
	else if(typeof exports === 'object')
		exports["foundation.accordionMenu"] = factory(require("./foundation.core"), require("./foundation.util.keyboard"), require("./foundation.util.nest"), require("jquery"));
	else
		root["__FOUNDATION_EXTERNAL__"] = root["__FOUNDATION_EXTERNAL__"] || {}, root["__FOUNDATION_EXTERNAL__"]["foundation.accordionMenu"] = factory(root["__FOUNDATION_EXTERNAL__"]["foundation.core"], root["__FOUNDATION_EXTERNAL__"]["foundation.util.keyboard"], root["__FOUNDATION_EXTERNAL__"]["foundation.util.nest"], root["jQuery"]);
})(window, function(__WEBPACK_EXTERNAL_MODULE__foundation_core__, __WEBPACK_EXTERNAL_MODULE__foundation_util_keyboard__, __WEBPACK_EXTERNAL_MODULE__foundation_util_nest__, __WEBPACK_EXTERNAL_MODULE_jquery__) {
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;
/******/
/******/ 	// define getter function for harmony exports
/******/ 	__webpack_require__.d = function(exports, name, getter) {
/******/ 		if(!__webpack_require__.o(exports, name)) {
/******/ 			Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ 		}
/******/ 	};
/******/
/******/ 	// define __esModule on exports
/******/ 	__webpack_require__.r = function(exports) {
/******/ 		if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ 			Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ 		}
/******/ 		Object.defineProperty(exports, '__esModule', { value: true });
/******/ 	};
/******/
/******/ 	// create a fake namespace object
/******/ 	// mode & 1: value is a module id, require it
/******/ 	// mode & 2: merge all properties of value into the ns
/******/ 	// mode & 4: return value when already ns object
/******/ 	// mode & 8|1: behave like require
/******/ 	__webpack_require__.t = function(value, mode) {
/******/ 		if(mode & 1) value = __webpack_require__(value);
/******/ 		if(mode & 8) return value;
/******/ 		if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ 		var ns = Object.create(null);
/******/ 		__webpack_require__.r(ns);
/******/ 		Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ 		if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ 		return ns;
/******/ 	};
/******/
/******/ 	// 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 = 2);
/******/ })
/************************************************************************/
/******/ ({

/***/ "./foundation.core":
/*!****************************************************************************************************************************************************************!*\
  !*** external {"root":["__FOUNDATION_EXTERNAL__","foundation.core"],"amd":"./foundation.core","commonjs":"./foundation.core","commonjs2":"./foundation.core"} ***!
  \****************************************************************************************************************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {

module.exports = __WEBPACK_EXTERNAL_MODULE__foundation_core__;

/***/ }),

/***/ "./foundation.util.keyboard":
/*!****************************************************************************************************************************************************************************************************!*\
  !*** external {"root":["__FOUNDATION_EXTERNAL__","foundation.util.keyboard"],"amd":"./foundation.util.keyboard","commonjs":"./foundation.util.keyboard","commonjs2":"./foundation.util.keyboard"} ***!
  \****************************************************************************************************************************************************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {

module.exports = __WEBPACK_EXTERNAL_MODULE__foundation_util_keyboard__;

/***/ }),

/***/ "./foundation.util.nest":
/*!************************************************************************************************************************************************************************************!*\
  !*** external {"root":["__FOUNDATION_EXTERNAL__","foundation.util.nest"],"amd":"./foundation.util.nest","commonjs":"./foundation.util.nest","commonjs2":"./foundation.util.nest"} ***!
  \************************************************************************************************************************************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {

module.exports = __WEBPACK_EXTERNAL_MODULE__foundation_util_nest__;

/***/ }),

/***/ "./js/entries/plugins/foundation.accordionMenu.js":
/*!********************************************************!*\
  !*** ./js/entries/plugins/foundation.accordionMenu.js ***!
  \********************************************************/
/*! exports provided: Foundation, AccordionMenu */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _foundation_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./foundation.core */ "./foundation.core");
/* harmony import */ var _foundation_core__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_foundation_core__WEBPACK_IMPORTED_MODULE_0__);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Foundation", function() { return _foundation_core__WEBPACK_IMPORTED_MODULE_0__["Foundation"]; });

/* harmony import */ var _foundation_accordionMenu__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../foundation.accordionMenu */ "./js/foundation.accordionMenu.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AccordionMenu", function() { return _foundation_accordionMenu__WEBPACK_IMPORTED_MODULE_1__["AccordionMenu"]; });

_foundation_core__WEBPACK_IMPORTED_MODULE_0__["Foundation"].plugin(_foundation_accordionMenu__WEBPACK_IMPORTED_MODULE_1__["AccordionMenu"], 'AccordionMenu');

/***/ }),

/***/ "./js/foundation.accordionMenu.js":
/*!****************************************!*\
  !*** ./js/foundation.accordionMenu.js ***!
  \****************************************/
/*! exports provided: AccordionMenu */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AccordionMenu", function() { return AccordionMenu; });
/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery");
/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.util.keyboard */ "./foundation.util.keyboard");
/* harmony import */ var _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _foundation_util_nest__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.util.nest */ "./foundation.util.nest");
/* harmony import */ var _foundation_util_nest__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_foundation_util_nest__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./foundation.core.utils */ "./foundation.core");
/* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__);

function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }

function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }

function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }

function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }

function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }

function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }

function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }

/**
 * AccordionMenu module.
 * @module foundation.accordionMenu
 * @requires foundation.util.keyboard
 * @requires foundation.util.nest
 */

var AccordionMenu =
/*#__PURE__*/
function (_Plugin) {
  _inherits(AccordionMenu, _Plugin);

  function AccordionMenu() {
    _classCallCheck(this, AccordionMenu);

    return _possibleConstructorReturn(this, _getPrototypeOf(AccordionMenu).apply(this, arguments));
  }

  _createClass(AccordionMenu, [{
    key: "_setup",

    /**
     * Creates a new instance of an accordion menu.
     * @class
     * @name AccordionMenu
     * @fires AccordionMenu#init
     * @param {jQuery} element - jQuery object to make into an accordion menu.
     * @param {Object} options - Overrides to the default plugin settings.
     */
    value: function _setup(element, options) {
      this.$element = element;
      this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, AccordionMenu.defaults, this.$element.data(), options);
      this.className = 'AccordionMenu'; // ie9 back compat

      this._init();

      _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__["Keyboard"].register('AccordionMenu', {
        'ENTER': 'toggle',
        'SPACE': 'toggle',
        'ARROW_RIGHT': 'open',
        'ARROW_UP': 'up',
        'ARROW_DOWN': 'down',
        'ARROW_LEFT': 'close',
        'ESCAPE': 'closeAll'
      });
    }
    /**
     * Initializes the accordion menu by hiding all nested menus.
     * @private
     */

  }, {
    key: "_init",
    value: function _init() {
      _foundation_util_nest__WEBPACK_IMPORTED_MODULE_2__["Nest"].Feather(this.$element, 'accordion');

      var _this = this;

      this.$element.find('[data-submenu]').not('.is-active').slideUp(0); //.find('a').css('padding-left', '1rem');

      this.$element.attr({
        'role': 'tree',
        'aria-multiselectable': this.options.multiOpen
      });
      this.$menuLinks = this.$element.find('.is-accordion-submenu-parent');
      this.$menuLinks.each(function () {
        var linkId = this.id || Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__["GetYoDigits"])(6, 'acc-menu-link'),
            $elem = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this),
            $sub = $elem.children('[data-submenu]'),
            subId = $sub[0].id || Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__["GetYoDigits"])(6, 'acc-menu'),
            isActive = $sub.hasClass('is-active');

        if (_this.options.parentLink) {
          var $anchor = $elem.children('a');
          $anchor.clone().prependTo($sub).wrap('

');
        }

        if (_this.options.submenuToggle) {
          $elem.addClass('has-submenu-toggle');
          $elem.children('a').after('<button id="' + linkId + '" class="submenu-toggle" aria-controls="' + subId + '" aria-expanded="' + isActive + '" title="' + _this.options.submenuToggleText + '">' + _this.options.submenuToggleText + '</button>');
        } else {
          $elem.attr({
            'aria-controls': subId,
            'aria-expanded': isActive,
            'id': linkId
          });
        }

        $sub.attr({
          'aria-labelledby': linkId,
          'aria-hidden': !isActive,
          'role': 'group',
          'id': subId
        });
      });
      this.$element.find('li').attr({
        'role': 'treeitem'
      });
      var initPanes = this.$element.find('.is-active');

      if (initPanes.length) {
        var _this = this;

        initPanes.each(function () {
          _this.down(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this));
        });
      }

      this._events();
    }
    /**
     * Adds event handlers for items within the menu.
     * @private
     */

  }, {
    key: "_events",
    value: function _events() {
      var _this = this;

      this.$element.find('li').each(function () {
        var $submenu = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).children('[data-submenu]');

        if ($submenu.length) {
          if (_this.options.submenuToggle) {
            jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).children('.submenu-toggle').off('click.zf.accordionMenu').on('click.zf.accordionMenu', function (e) {
              _this.toggle($submenu);
            });
          } else {
            jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).children('a').off('click.zf.accordionMenu').on('click.zf.accordionMenu', function (e) {
              e.preventDefault();

              _this.toggle($submenu);
            });
          }
        }
      }).on('keydown.zf.accordionmenu', function (e) {
        var $element = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this),
            $elements = $element.parent('ul').children('li'),
            $prevElement,
            $nextElement,
            $target = $element.children('[data-submenu]');
        $elements.each(function (i) {
          if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).is($element)) {
            $prevElement = $elements.eq(Math.max(0, i - 1)).find('a').first();
            $nextElement = $elements.eq(Math.min(i + 1, $elements.length - 1)).find('a').first();

            if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).children('[data-submenu]:visible').length) {
              // has open sub menu
              $nextElement = $element.find('li:first-child').find('a').first();
            }

            if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).is(':first-child')) {
              // is first element of sub menu
              $prevElement = $element.parents('li').first().find('a').first();
            } else if ($prevElement.parents('li').first().children('[data-submenu]:visible').length) {
              // if previous element has open sub menu
              $prevElement = $prevElement.parents('li').find('li:last-child').find('a').first();
            }

            if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).is(':last-child')) {
              // is last element of sub menu
              $nextElement = $element.parents('li').first().next('li').find('a').first();
            }

            return;
          }
        });
        _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__["Keyboard"].handleKey(e, 'AccordionMenu', {
          open: function open() {
            if ($target.is(':hidden')) {
              _this.down($target);

              $target.find('li').first().find('a').first().focus();
            }
          },
          close: function close() {
            if ($target.length && !$target.is(':hidden')) {
              // close active sub of this item
              _this.up($target);
            } else if ($element.parent('[data-submenu]').length) {
              // close currently open sub
              _this.up($element.parent('[data-submenu]'));

              $element.parents('li').first().find('a').first().focus();
            }
          },
          up: function up() {
            $prevElement.focus();
            return true;
          },
          down: function down() {
            $nextElement.focus();
            return true;
          },
          toggle: function toggle() {
            if (_this.options.submenuToggle) {
              return false;
            }

            if ($element.children('[data-submenu]').length) {
              _this.toggle($element.children('[data-submenu]'));

              return true;
            }
          },
          closeAll: function closeAll() {
            _this.hideAll();
          },
          handled: function handled(preventDefault) {
            if (preventDefault) {
              e.preventDefault();
            }

            e.stopImmediatePropagation();
          }
        });
      }); //.attr('tabindex', 0);
    }
    /**
     * Closes all panes of the menu.
     * @function
     */

  }, {
    key: "hideAll",
    value: function hideAll() {
      this.up(this.$element.find('[data-submenu]'));
    }
    /**
     * Opens all panes of the menu.
     * @function
     */

  }, {
    key: "showAll",
    value: function showAll() {
      this.down(this.$element.find('[data-submenu]'));
    }
    /**
     * Toggles the open/close state of a submenu.
     * @function
     * @param {jQuery} $target - the submenu to toggle
     */

  }, {
    key: "toggle",
    value: function toggle($target) {
      if (!$target.is(':animated')) {
        if (!$target.is(':hidden')) {
          this.up($target);
        } else {
          this.down($target);
        }
      }
    }
    /**
     * Opens the sub-menu defined by `$target`.
     * @param {jQuery} $target - Sub-menu to open.
     * @fires AccordionMenu#down
     */

  }, {
    key: "down",
    value: function down($target) {
      var _this2 = this;

      // If having multiple submenus active is disabled, close all the submenus
      // that are not parents or children of the targeted submenu.
      if (!this.options.multiOpen) {
        // The "branch" of the targetted submenu, from the component root to
        // the active submenus nested in it.
        var $targetBranch = $target.parentsUntil(this.$element).add($target).add($target.find('.is-active')); // All the active submenus that are not in the branch.

        var $othersActiveSubmenus = this.$element.find('.is-active').not($targetBranch);
        this.up($othersActiveSubmenus);
      }

      $target.addClass('is-active').attr({
        'aria-hidden': false
      });

      if (this.options.submenuToggle) {
        $target.prev('.submenu-toggle').attr({
          'aria-expanded': true
        });
      } else {
        $target.parent('.is-accordion-submenu-parent').attr({
          'aria-expanded': true
        });
      }

      $target.slideDown(this.options.slideSpeed, function () {
        /**
         * Fires when the menu is done opening.
         * @event AccordionMenu#down
         */
        _this2.$element.trigger('down.zf.accordionMenu', [$target]);
      });
    }
    /**
     * Closes the sub-menu defined by `$target`. All sub-menus inside the target will be closed as well.
     * @param {jQuery} $target - Sub-menu to close.
     * @fires AccordionMenu#up
     */

  }, {
    key: "up",
    value: function up($target) {
      var _this3 = this;

      var $submenus = $target.find('[data-submenu]');
      var $allmenus = $target.add($submenus);
      $submenus.slideUp(0);
      $allmenus.removeClass('is-active').attr('aria-hidden', true);

      if (this.options.submenuToggle) {
        $allmenus.prev('.submenu-toggle').attr('aria-expanded', false);
      } else {
        $allmenus.parent('.is-accordion-submenu-parent').attr('aria-expanded', false);
      }

      $target.slideUp(this.options.slideSpeed, function () {
        /**
         * Fires when the menu is done collapsing up.
         * @event AccordionMenu#up
         */
        _this3.$element.trigger('up.zf.accordionMenu', [$target]);
      });
    }
    /**
     * Destroys an instance of accordion menu.
     * @fires AccordionMenu#destroyed
     */

  }, {
    key: "_destroy",
    value: function _destroy() {
      this.$element.find('[data-submenu]').slideDown(0).css('display', '');
      this.$element.find('a').off('click.zf.accordionMenu');
      this.$element.find('[data-is-parent-link]').detach();

      if (this.options.submenuToggle) {
        this.$element.find('.has-submenu-toggle').removeClass('has-submenu-toggle');
        this.$element.find('.submenu-toggle').remove();
      }

      _foundation_util_nest__WEBPACK_IMPORTED_MODULE_2__["Nest"].Burn(this.$element, 'accordion');
    }
  }]);

  return AccordionMenu;
}(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__["Plugin"]);

AccordionMenu.defaults = {
  /**
   * Adds the parent link to the submenu.
   * @option
   * @type {boolean}
   * @default false
   */
  parentLink: false,

  /**
   * Amount of time to animate the opening of a submenu in ms.
   * @option
   * @type {number}
   * @default 250
   */
  slideSpeed: 250,

  /**
   * Adds a separate submenu toggle button. This allows the parent item to have a link.
   * @option
   * @example true
   */
  submenuToggle: false,

  /**
   * The text used for the submenu toggle if enabled. This is used for screen readers only.
   * @option
   * @example true
   */
  submenuToggleText: 'Toggle menu',

  /**
   * Allow the menu to have multiple open panes.
   * @option
   * @type {boolean}
   * @default true
   */
  multiOpen: true
};

/***/ }),

/***/ 2:
/*!**************************************************************!*\
  !*** multi ./js/entries/plugins/foundation.accordionMenu.js ***!
  \**************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {

module.exports = __webpack_require__(/*! /Volumes/Data/Development/Foundation/foundation-sites/js/entries/plugins/foundation.accordionMenu.js */"./js/entries/plugins/foundation.accordionMenu.js");

/***/ }),

/***/ "jquery":
/*!********************************************************************************************!*\
  !*** external {"root":["jQuery"],"amd":"jquery","commonjs":"jquery","commonjs2":"jquery"} ***!
  \********************************************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {

module.exports = __WEBPACK_EXTERNAL_MODULE_jquery__;

/***/ })

/******/ });
});
//# sourceMappingURL=foundation.accordionMenu.js.map


text:
require 'spec_helper'
require 'rack'

def dummy_rack_app
  lambda{|env| [200, {"Content-Type" => "text/html"}, ["dummy_rack_app body"]] }
end

describe Dragonfly::Middleware do

  def make_request(app, url)
    Rack::MockRequest.new(app).get(url)
  end

  describe "using the default app" do
    before(:each) do
      @stack = Rack::Builder.new do
        use Dragonfly::Middleware
        run dummy_rack_app
      end
    end

    it "should pass through if the app returns X-Cascade: pass" do
      Dragonfly.app.should_receive(:call).and_return(
        [404, {"Content-Type" => 'text/plain', 'X-Cascade' => 'pass'}, ['Not found']]
      )
      response = make_request(@stack, '/media/hello.png?howare=you')
      response.body.should == 'dummy_rack_app body'
      response.status.should == 200
    end

    it "should return a 404 if the app returns a 404" do
      Dragonfly.app.should_receive(:call).and_return(
        [404, {"Content-Type" => 'text/plain'}, ['Not found']]
      )
      response = make_request(@stack, '/media/hello.png?howare=you')
      response.status.should == 404
    end

    it "should return as per the dragonfly app if the app returns a 200" do
      Dragonfly.app.should_receive(:call).and_return(
        [200, {"Content-Type" => 'text/plain'}, ['ABCD']]
      )
      response = make_request(@stack, '/media/hello.png?howare=you')
      response.status.should == 200
      response.body.should == 'ABCD'
    end
  end

  describe "using a custom app" do
    before(:each) do
      @stack = Rack::Builder.new do
        use Dragonfly::Middleware, :images
        run dummy_rack_app
      end
    end

    it "should use the specified dragonfly app" do
      Dragonfly.app.should_not_receive(:call)
      Dragonfly.app(:images).should_receive(:call).and_return([
        200, {"Content-Type" => 'text/plain'}, ['booboo']
      ])
      response = make_request(@stack, '/media/hello.png?howare=you')
      response.body.should == 'booboo'
    end
  end

end

redpajama_set_name: RedPajamaGithub


text:
/**
 * @author Intel, Konstantin M. Anisimov, Igor V. Chebykin
 *
 */

#include "IpfCodeSelector.h"
#include "IpfOpndManager.h"
#include "IpfIrPrinter.h"

namespace Jitrino {
namespace IPF {

//========================================================================================//
// IpfMethodCodeSelector
//========================================================================================//

IpfMethodCodeSelector::IpfMethodCodeSelector(Cfg                  &cfg,
                                             CompilationInterface &compilationInterface) :
    mm(cfg.getMM()),
    cfg(cfg),
    compilationInterface(compilationInterface),
    methodDesc(NULL),
    opnds(mm),
    nodes(mm) {
}

//----------------------------------------------------------------------------------------//

void IpfMethodCodeSelector::genVars(U_32 numVars, VarCodeSelector &varCodeSelector) {

    IPF_LOG << endl << "  Select variables" << endl;
    IpfVarCodeSelector ipfVarCodeSelector(cfg, opnds);
    varCodeSelector.genCode(ipfVarCodeSelector);
}

//----------------------------------------------------------------------------------------//

void IpfMethodCodeSelector::setMethodDesc(MethodDesc *methodDesc_) {
    methodDesc = methodDesc_;
}

//----------------------------------------------------------------------------------------//

void IpfMethodCodeSelector::genCFG(U_32           numNodes,
                                   CFGCodeSelector &codeSelector,
                                   bool             useProfile) {

    IPF_LOG << endl << "  Select CFG" << endl;
    IpfCfgCodeSelector cfgCodeSelector(cfg, nodes, opnds, compilationInterface);
    codeSelector.genCode(cfgCodeSelector);
}

//----------------------------------------------------------------------------------------//

MethodDesc *IpfMethodCodeSelector::getMethodDesc() { return methodDesc; }

//========================================================================================//
// IpfVarCodeSelector
//========================================================================================//

IpfVarCodeSelector::IpfVarCodeSelector(Cfg &cfg, OpndVector &opnds) :
    mm(cfg.getMM()),
    cfg(cfg),
    opnds(opnds) {

    opndManager = cfg.getOpndManager();
}

//----------------------------------------------------------------------------------------//

U_32 IpfVarCodeSelector::defVar(Type *varType, bool isAddressTaken, bool isPinned) {

    OpndKind  opndKind = IpfInstCodeSelector::toOpndKind(varType->tag);
    DataKind  dataKind = IpfInstCodeSelector::toDataKind(varType->tag);
    RegOpnd  *var      = NULL;

    if (Type::isTau(varType->tag)) var = opndManager->getTau();
    else                           var = opndManager->newRegOpnd(opndKind, dataKind);

    opnds.push_back(var);

    IPF_LOG << "    Define local variable"
        << "; varType=" << Type::tag2str(varType->tag)
        << ", isPinned=" << isPinned
        << "; var='" << IrPrinter::toString(var) << "'" << endl;

    return opnds.size()-1;      // It is going to be varId
}

//----------------------------------------------------------------------------------------//

void IpfVarCodeSelector::setManagedPointerBase(U_32 managedPtrVarNum, U_32 baseVarNum) {}

//========================================================================================//
// IpfCfgCodeSelector
//========================================================================================//

IpfCfgCodeSelector::IpfCfgCodeSelector(Cfg                  &cfg,
                                       NodeVector           &nodes,
                                       OpndVector           &opnds,
                                       CompilationInterface &compilationInterface) :
    mm(cfg.getMM()),
    cfg(cfg),
    nodes(nodes),
    opnds(opnds),
    compilationInterface(compilationInterface),
    opndManager(cfg.getOpndManager()) {
}

//----------------------------------------------------------------------------------------//

U_32 IpfCfgCodeSelector::genDispatchNode(U_32 numInEdges,
                                           U_32 numOutEdges,
                                           const StlVector<MethodDesc*>& inlineInfo,
                                           double cnt) {

    Node *node = new(mm) Node(mm, opndManager->getNextNodeId(), (U_32) cnt, NODE_DISPATCH);
    nodes.push_back(node);

    IPF_LOG << endl << "    Generate Dispatch node" << node->getId() << endl;
    return nodes.size()-1;
}

//----------------------------------------------------------------------------------------//

U_32 IpfCfgCodeSelector::genBlock(U_32            numInEdges,
                                    U_32            numOutEdges,
                                    BlockKind         blockKind,
                                    BlockCodeSelector &codeSelector,
                                    double            cnt) {

    BbNode *node = new(mm) BbNode(mm, opndManager->getNextNodeId(), (U_32)cnt);

    nodes.push_back(node);
    if(blockKind == Prolog) cfg.setEnterNode(node);

    IPF_LOG << endl << "    Generate BB node" << node->getId() << endl;
    IpfInstCodeSelector ipfInstCodeSelector(cfg, *node, opnds, compilationInterface);
    codeSelector.genCode(ipfInstCodeSelector);

    return nodes.size()-1;
}

//----------------------------------------------------------------------------------------//

U_32  IpfCfgCodeSelector::genUnwindNode(U_32 numInEdges,
                                          U_32 numOutEdges,
                                          double cnt) {

    Node *node = new(mm) Node(mm, opndManager->getNextNodeId(), (U_32) cnt, NODE_UNWIND);
    nodes.push_back(node);

    IPF_LOG << endl << "    Generate Unwind node" << node->getId() << endl;
    return nodes.size()-1;
}

//----------------------------------------------------------------------------------------//

U_32 IpfCfgCodeSelector::genExitNode(U_32 numInEdges, double cnt) {

    BbNode *node = new(mm) BbNode(mm, opndManager->getNextNodeId(), (U_32) cnt);
    nodes.push_back(node);
    cfg.setExitNode(node);

    IPF_LOG << endl << "    Generate Exit node" << node->getId() << endl << endl;
    return nodes.size()-1;
}

//----------------------------------------------------------------------------------------//

void IpfCfgCodeSelector::genUnconditionalEdge(U_32 tailNodeId,
                                              U_32 headNodeId,
                                              double prob) {

    IPF_LOG << "    Generate Unconditional edge node" << nodes[tailNodeId]->getId();
    IPF_LOG << " -> node" << nodes[headNodeId]->getId() << endl;

    Edge *edge = new(mm) Edge(nodes[tailNodeId], nodes[headNodeId], prob, EDGE_THROUGH);
    edge->insert();
}

//----------------------------------------------------------------------------------------//

void IpfCfgCodeSelector::genTrueEdge(U_32 tailNodeId, U_32 headNodeId, double prob) {

    IPF_LOG << "    Generate True          edge node" << nodes[tailNodeId]->getId();
    IPF_LOG << " -> node" << nodes[headNodeId]->getId() << endl;

    Edge *edge = new(mm) Edge(nodes[tailNodeId], nodes[headNodeId], prob, EDGE_BRANCH);
    edge->insert();
}

//----------------------------------------------------------------------------------------//

void IpfCfgCodeSelector::genFalseEdge(U_32 tailNodeId, U_32 headNodeId, double prob) {

    IPF_LOG << "    Generate False         edge node" << nodes[tailNodeId]->getId();
    IPF_LOG << " -> node" << nodes[headNodeId]->getId() << endl;

    Edge *edge = new(mm) Edge(nodes[tailNodeId], nodes[headNodeId], prob, EDGE_THROUGH);
    edge->insert();
}

//----------------------------------------------------------------------------------------//

void IpfCfgCodeSelector::genSwitchEdges(U_32  tailNodeId,
                                        U_32  numTargets,
                                        U_32 *targets,
                                        double *probs,
                                        U_32  defaultTarget) {

    BbNode         *tailNode       = (BbNode *)nodes[tailNodeId];
    InstVector     &insts          = tailNode->getInsts();
    Inst           *switchInst     = insts.back();
    Opnd           *defTargetImm   =                   switchInst->getOpnd(POS_SWITCH_DEFAULT);
    ConstantRef    *constantRef    = (ConstantRef *)   switchInst->getOpnd(POS_SWITCH_TABLE);
    SwitchConstant *switchConstant = (SwitchConstant *)constantRef->getConstant();
    Edge           *defedge        = NULL;
    Edge           *edge           = NULL;

    bool   defadded = false;
    U_32 i        = 0;

    IPF_LOG << "    Generate Switch     tailNodeId=" << tailNodeId
        << "; defaultTarget=" << defaultTarget << endl;

    defedge = new(mm) Edge(nodes[tailNodeId], nodes[defaultTarget], probs[defaultTarget], EDGE_BRANCH);
    defedge->insert();

    for(i=0; i<numTargets; i++) {
        if(targets[i] == defaultTarget) {
            defTargetImm->setValue(i);
            switchConstant->addEdge(defedge);
            defadded = true;
            IPF_LOG << "        default: " << i << endl;
            continue;
        }
        IPF_LOG << "        case " << i << ": " << targets[i] << endl;
        edge = new(mm) Edge(nodes[tailNodeId], nodes[targets[i]], probs[i], EDGE_BRANCH);
        edge->insert();
        switchConstant->addEdge(edge);
    }

    if (!defadded) {
        defTargetImm->setValue(i);
        switchConstant->addEdge(defedge);
        defadded = true;
        IPF_LOG << "        default: " << i << endl;
    }
}

//--------------------------------------------------------------------------------//
// edge from try region to dispatch node

void IpfCfgCodeSelector::genExceptionEdge(U_32 tailNodeId,
                                          U_32 headNodeId,
                                          double prob) {

    Node *tailNode = nodes[tailNodeId];
    Node *headNode = nodes[headNodeId];

    IPF_LOG << "    Generate Exception     edge node" << tailNode->getId();
    IPF_LOG << " -> node" << headNode->getId() << endl;
    Edge *edge = new(mm) Edge(tailNode, headNode, prob, EDGE_DISPATCH);
    edge->insert();
}

//----------------------------------------------------------------------------------------//
// edge from dispatch node to exception handler

void IpfCfgCodeSelector::genCatchEdge(U_32  tailNodeId,
                                      U_32  headNodeId,
                                      U_32  priority,
                                      Type   *exceptionType,
                                      double  prob) {

    Node *tailNode = nodes[tailNodeId];
    Node *headNode = nodes[headNodeId];

    IPF_LOG << "    Generate Catch         edge node" << tailNode->getId();
    IPF_LOG << " -> node" << headNode->getId() << endl;

    ExceptionEdge *edge = new(mm) ExceptionEdge(tailNode, headNode, prob, exceptionType, priority);
    edge->insert();
}

//----------------------------------------------------------------------------------------//

void IpfCfgCodeSelector::genExitEdge(U_32 tailNodeId,
                                     U_32 headNodeId,
                                     double prob) {

    Node *tailNode=nodes[tailNodeId];
    Node *headNode=nodes[headNodeId];

    IPF_LOG << "    Generate Exit          edge node" << tailNode->getId();
    IPF_LOG << " -> node" << headNode->getId() << endl;

    Edge *edge = new(mm) Edge(tailNode, headNode, prob, EDGE_THROUGH);
    edge->insert();
}

//----------------------------------------------------------------------------------------//

void IpfCfgCodeSelector::setLoopInfo(U_32 nodeId,
                                     bool   isLoopHeader,
                                     bool   hasContainingLoopHeader,
                                     U_32 headerId) {

    if (hasContainingLoopHeader == false) return;

    Node *node   = nodes[nodeId];
    Node *header = nodes[headerId];

    node->setLoopHeader(header);
}

//----------------------------------------------------------------------------------------//

void IpfCfgCodeSelector::setPersistentId(U_32 nodeId, U_32 persistentId) {}

} //namespace IPF
} //namespace Jitrino


text:
console.log(process.pid);
process.stdout.write('hello world!\n');

process.stdin.resume();
process.stdin.setEncoding('utf8');

process.stdin.on('data', function(text) {
  process.stdout.write(text.toUpperCase());
});


text:
namespace Binance.Net.Enums
{
    /// <summary>
    /// Filter type
    /// </summary>
    public enum SymbolFilterType
    {
        /// <summary>
        /// Unknown filter type
        /// </summary>
        Unknown,
        /// <summary>
        /// Price filter
        /// </summary>
        Price,
        /// <summary>
        /// Price percent filter
        /// </summary>
        PricePercent,
        /// <summary>
        /// Lot size filter
        /// </summary>
        LotSize,
        /// <summary>
        /// Market lot size filter
        /// </summary>
        MarketLotSize,
        /// <summary>
        /// Min notional filter
        /// </summary>
        MinNotional,
        /// <summary>
        /// Max orders filter
        /// </summary>
        MaxNumberOrders,
        /// <summary>
        /// Max algo orders filter
        /// </summary>
        MaxNumberAlgorithmicOrders,
        /// <summary>
        /// Max iceberg parts filter
        /// </summary>
        IcebergParts,
        /// <summary>
        /// Max position filter
        /// </summary>
        MaxPosition,
        /// <summary>
        /// Price filter by side
        /// </summary>
        PercentagePriceBySide,
        /// <summary>
        /// Trailing delta filter
        /// </summary>,
        TrailingDelta,
        /// <summary>
        /// Notional filter
        /// </summary>
        Notional
    }
}


text:
package fi.laverca.etsi;

import java.util.List;

import fi.laverca.ClientBase;
import fi.laverca.jaxb.mss.AdditionalServiceType;
import fi.laverca.jaxb.mss.MSSSignatureReq;
import fi.laverca.jaxb.mss.MSSSignatureResp;
import fi.laverca.jaxb.mss.MSSStatusResp;
import fi.laverca.jaxb.mss.MessagingModeType;
import fi.laverca.mss.MssConf;
import fi.laverca.util.DTBS;

/**
 * An asynchronous client for standard ETSI TS 102 204 signature requests.
 */
public class EtsiClient extends ClientBase<EtsiRequest, EtsiResponse> {

    /**
     * Preferred form of initialize a EtsiClient
     *
     * @param conf Configuration data collection
     */
    public EtsiClient(MssConf conf) {
        super(conf);
    }

    /**
     * Initialize an EtsiClient
     *
     * @param apId Your identifier; MessageAbstractType/AP_Info/AP_ID. Not null.
     * @param apPwd Your password; MessageAbstractType/AP_Info/AP_PWD. Not null.
     * @param msspSignatureUrl    Connection URL to the AE for signature requests.
     * @param msspStatusUrl       Connection URL to the AE for status query requests.
     * @param msspReceiptUrl      Connection URL to the AE for receipt requests.
     *
     * @throws IllegalArgumentException if AP ID or AP PWD is missing or invalid.
     */
    public EtsiClient(final String apId,             // AP settings
                      final String apPwd,
                      final String msspSignatureUrl, // AE connection settings
                      final String msspStatusUrl,
                      final String msspReceiptUrl)
        throws IllegalArgumentException
    {
        super(apId, apPwd, msspSignatureUrl, msspStatusUrl, msspReceiptUrl);
    }

    /**
     * Initialize an EtsiClient
     *
     * @param apId Your identifier; MessageAbstractType/AP_Info/AP_ID. Not null.
     * @param apPwd Your password; MessageAbstractType/AP_Info/AP_PWD. Not null.
     * @param msspSignatureUrl    Connection URL to the AE for signature requests.
     * @param msspStatusUrl       Connection URL to the AE for status query requests.
     * @param msspReceiptUrl      Connection URL to the AE for receipt requests.
     * @param msspRegistrationUrl Connection URL to the AE for registration requests.
     * @param msspProfileUrl      Connection URL to the AE for profile query requests.
     * @param msspHandshakeUrl    Connection URL to the AE for handshake requests.
     *
     * @throws IllegalArgumentException if AP ID or AP PWD is missing or invalid.
     */
    public EtsiClient(final String apId,             // AP settings
                      final String apPwd,
                      final String msspSignatureUrl, // AE connection settings
                      final String msspStatusUrl,
                      final String msspReceiptUrl,
                      final String msspRegistrationUrl,
                      final String msspProfileUrl,
                      final String msspHandshakeUrl)
        throws IllegalArgumentException
    {
        super(apId, apPwd, msspSignatureUrl, msspStatusUrl, msspReceiptUrl, msspRegistrationUrl, msspProfileUrl, msspHandshakeUrl);
    }

    /**
     * Create an EtsiRequest instance
     * @param apTransId AP Transaction ID
     * @param dtbd Data to be displayed
     * @param dtbs Data to be signed
     * @param msisdn MSISDN of the target user
     * @param additionalServices List of FiCom additionalservices to add to the request
     * @param signatureProfile Signature profile to use
     * @param mssFormat MSS Format to use.
     * @param messagingMode Messaging mode to use
     * @return Created request
     */
    public EtsiRequest createRequest(final String apTransId,
                                     final String msisdn,
                                     final DTBS   dtbs,
                                     final String dtbd,
                                     final List<AdditionalServiceType> additionalServices,
                                     final String signatureProfile,
                                     final String mssFormat,
                                     final MessagingModeType messagingMode) {

        final EtsiRequest req = new EtsiRequest();

        final MSSSignatureReq sigReq = this.mssClient.createSignatureRequest(apTransId,
                                                                             msisdn,
                                                                             dtbs,
                                                                             dtbd,
                                                                             signatureProfile,
                                                                             mssFormat,
                                                                             messagingMode);
        req.sigReq = sigReq;

        final List<AdditionalServiceType> as = sigReq.getAdditionalServices().getServices();

        if (additionalServices != null) {
            for (AdditionalServiceType s : additionalServices) {
                if (s != null) {
                    as.add(s);
                }
            }
        }

        return req;
    }

    @Override
    protected EtsiResponse createResp(final MSSSignatureReq sigReq,
                                      final MSSSignatureResp sigResp,
                                      final MSSStatusResp statResp) {
        return new EtsiResponse(sigReq, sigResp, statResp);
    }

}


text:
<?php
/**
 *
 * @category    Collinsharper
 * @package     Collinsharper_Canpost
 * @author      Maxim Nulman
 *
 * @deprecated
 */
class Collinsharper_Canpost_Helper_Service extends Mage_Core_Helper_Abstract
{
    /**
     * @deprecated
     */
    public function ajustRates($services)
    {

        //foreach ($services as $service) {
        //
        //    $info = Mage::helper('chcanpost2module/rest_service')->getInfo($service_code, $country_code);
        //
        //}

    }

}


text:
require 'yaml'

module Fifthgear
  class Configuration
    attr_accessor :api_root, :api_version, :username, :password,
                  :content_type, :company_id, :debug, :raise_errors,
                  :timeout, :open_timeout

    def initialize
      defaults = load_defaults
      @api_root = defaults[:api_root]
      @api_version = defaults[:api_version]
      @content_type = defaults[:content_type]
      @raise_errors = defaults[:raise_errors]
      @timeout = defaults[:timeout]
      @open_timeout = defaults[:open_timeout]
      @debug = false
    end

    private

    def load_defaults
      YAML.load_file(File.join(File.dirname(__FILE__),'..','config','defaults.yml'))
    end
  end
end


text:
#include "config.h"
#include "modules/notifications/Notification.h"

#include "bindings/core/v8/ScriptWrappable.h"
#include "core/dom/Document.h"
#include "core/dom/ExecutionContext.h"
#include "core/dom/ExecutionContextTask.h"
#include "core/dom/ScopedWindowFocusAllowedIndicator.h"
#include "core/events/Event.h"
#include "core/frame/UseCounter.h"
#include "modules/notifications/NotificationOptions.h"
#include "modules/notifications/NotificationPermissionClient.h"
#include "platform/RuntimeEnabledFeatures.h"
#include "platform/UserGestureIndicator.h"
#include "public/platform/Platform.h"
#include "public/platform/WebSerializedOrigin.h"
#include "public/platform/modules/notifications/WebNotificationData.h"
#include "public/platform/modules/notifications/WebNotificationManager.h"

namespace blink {
namespace {

WebNotificationManager* notificationManager()
{
    return Platform::current()->notificationManager();
}

} // namespace

Notification* Notification::create(ExecutionContext* context, const String& title, const NotificationOptions& options, ExceptionState& exceptionState)
{
    // The Web Notification constructor may be disabled through a runtime feature. The
    // behavior of the constructor is changing, but not completely agreed upon yet.
    if (!RuntimeEnabledFeatures::notificationConstructorEnabled()) {
        exceptionState.throwTypeError("Illegal constructor. Use ServiceWorkerRegistration.showNotification() instead.");
        return nullptr;
    }

    // The Web Notification constructor may not be used in Service Worker contexts.
    if (context->isServiceWorkerGlobalScope()) {
        exceptionState.throwTypeError("Illegal constructor.");
        return nullptr;
    }

    Notification* notification = new Notification(title, context);

    notification->setBody(options.body());
    notification->setTag(options.tag());
    notification->setLang(options.lang());
    notification->setDir(options.dir());
    if (options.hasIcon()) {
        KURL iconUrl = options.icon().isEmpty() ? KURL() : context->completeURL(options.icon());
        if (!iconUrl.isEmpty() && iconUrl.isValid())
            notification->setIconUrl(iconUrl);
    }

    String insecureOriginMessage;
    UseCounter::Feature feature = context->securityOrigin()->canAccessFeatureRequiringSecureOrigin(insecureOriginMessage)
        ? UseCounter::NotificationSecureOrigin : UseCounter::NotificationInsecureOrigin;
    UseCounter::count(context, feature);

    notification->scheduleShow();
    notification->suspendIfNeeded();
    return notification;
}

Notification* Notification::create(ExecutionContext* context, const String& persistentId, const WebNotificationData& data)
{
    Notification* notification = new Notification(data.title, context);

    notification->setPersistentId(persistentId);
    notification->setDir(data.direction == WebNotificationData::DirectionLeftToRight ? "ltr" : "rtl");
    notification->setLang(data.lang);
    notification->setBody(data.body);
    notification->setTag(data.tag);

    if (!data.icon.isEmpty())
        notification->setIconUrl(data.icon);

    notification->setState(NotificationStateShowing);
    notification->suspendIfNeeded();
    return notification;
}

Notification::Notification(const String& title, ExecutionContext* context)
    : ActiveDOMObject(context)
    , m_title(title)
    , m_dir("auto")
    , m_state(NotificationStateIdle)
    , m_asyncRunner(this, &Notification::show)
{
    ASSERT(notificationManager());
}

Notification::~Notification()
{
}

void Notification::scheduleShow()
{
    ASSERT(m_state == NotificationStateIdle);
    ASSERT(!m_asyncRunner.isActive());

    m_asyncRunner.runAsync();
}

void Notification::show()
{
    ASSERT(m_state == NotificationStateIdle);
    if (Notification::checkPermission(executionContext()) != WebNotificationPermissionAllowed) {
        dispatchErrorEvent();
        return;
    }

    SecurityOrigin* origin = executionContext()->securityOrigin();
    ASSERT(origin);

    // FIXME: Associate the appropriate text direction with the notification.
    // FIXME: Do CSP checks on the associated notification icon.
    WebNotificationData notificationData(m_title, WebNotificationData::DirectionLeftToRight, m_lang, m_body, m_tag, m_iconUrl);
    notificationManager()->show(WebSerializedOrigin(*origin), notificationData, this);

    m_state = NotificationStateShowing;
}

void Notification::close()
{
    if (m_state != NotificationStateShowing)
        return;

    if (m_persistentId.isEmpty()) {
        // Fire the close event asynchronously.
        executionContext()->postTask(createSameThreadTask(&Notification::dispatchCloseEvent, this));

        m_state = NotificationStateClosing;
        notificationManager()->close(this);
    } else {
        m_state = NotificationStateClosed;
        notificationManager()->closePersistent(m_persistentId);
    }
}

void Notification::dispatchShowEvent()
{
    dispatchEvent(Event::create(EventTypeNames::show));
}

void Notification::dispatchClickEvent()
{
    UserGestureIndicator gestureIndicator(DefinitelyProcessingNewUserGesture);
    ScopedWindowFocusAllowedIndicator windowFocusAllowed(executionContext());
    dispatchEvent(Event::create(EventTypeNames::click));
}

void Notification::dispatchErrorEvent()
{
    dispatchEvent(Event::create(EventTypeNames::error));
}

void Notification::dispatchCloseEvent()
{
    // The notification will be showing when the user initiated the close, or it will be
    // closing if the developer initiated the close.
    if (m_state != NotificationStateShowing && m_state != NotificationStateClosing)
        return;

    m_state = NotificationStateClosed;
    dispatchEvent(Event::create(EventTypeNames::close));
}

TextDirection Notification::direction() const
{
    // FIXME: Resolve dir()=="auto" against the document.
    return dir() == "rtl" ? RTL : LTR;
}

String Notification::permissionString(WebNotificationPermission permission)
{
    switch (permission) {
    case WebNotificationPermissionAllowed:
        return "granted";
    case WebNotificationPermissionDenied:
        return "denied";
    case WebNotificationPermissionDefault:
        return "default";
    }

    ASSERT_NOT_REACHED();
    return "denied";
}

String Notification::permission(ExecutionContext* context)
{
    return permissionString(checkPermission(context));
}

WebNotificationPermission Notification::checkPermission(ExecutionContext* context)
{
    SecurityOrigin* origin = context->securityOrigin();
    ASSERT(origin);

    return notificationManager()->checkPermission(WebSerializedOrigin(*origin));
}

void Notification::requestPermission(ExecutionContext* context, NotificationPermissionCallback* callback)
{
    // FIXME: Assert that this code-path will only be reached for Document environments
    // when Blink supports [Exposed] annotations on class members in IDL definitions.
    if (NotificationPermissionClient* permissionClient = NotificationPermissionClient::from(context))
        permissionClient->requestPermission(context, callback);
}

bool Notification::dispatchEvent(PassRefPtrWillBeRawPtr<Event> event)
{
    ASSERT(executionContext()->isContextThread());
    return EventTarget::dispatchEvent(event);
}

const AtomicString& Notification::interfaceName() const
{
    return EventTargetNames::Notification;
}

void Notification::stop()
{
    notificationManager()->notifyDelegateDestroyed(this);

    m_state = NotificationStateClosed;

    m_asyncRunner.stop();
}

bool Notification::hasPendingActivity() const
{
    return m_state == NotificationStateShowing || m_asyncRunner.isActive();
}

DEFINE_TRACE(Notification)
{
    RefCountedGarbageCollectedEventTargetWithInlineData<Notification>::trace(visitor);
    ActiveDOMObject::trace(visitor);
}

} // namespace blink


text:
package aws

import (
	"os"
	"testing"
	"time"

	"github.com/stretchr/testify/assert"
)

func TestValidateCredentialsHandler(t *testing.T) {
	os.Clearenv()
	svc := NewService(&Config{
		Credentials: DetectCreds("AKID", "SECRET", ""),
	})
	svc.Handlers.Clear()
	svc.Handlers.Validate.PushBack(ValidateCredentialsHandler)

	req := NewRequest(svc, &Operation{Name: "Operation"}, nil, nil)
	err := req.Build()

	assert.NoError(t, err)
}

func TestValidateCredentialsHandlerError(t *testing.T) {
	os.Clearenv()
	creds, _ := ProfileCreds("example.ini", "missing", 10*time.Minute)

	svc := NewService(&Config{Credentials: creds})
	svc.Handlers.Clear()
	svc.Handlers.Validate.PushBack(ValidateCredentialsHandler)

	req := NewRequest(svc, &Operation{Name: "Operation"}, nil, nil)
	err := req.Build()

	assert.Error(t, err)
	assert.Equal(t, ErrMissingCredentials, err)

	// Now try without any credentials object at all
	svc = NewService(nil)
	svc.Handlers.Clear()
	svc.Handlers.Validate.PushBack(ValidateCredentialsHandler)

	req = NewRequest(svc, &Operation{Name: "Operation"}, nil, nil)
	err = req.Build()

	assert.Error(t, err)
	assert.Equal(t, ErrMissingCredentials, err)
}

func TestValidateEndpointHandler(t *testing.T) {
	os.Clearenv()
	svc := NewService(&Config{Region: "us-west-2"})
	svc.Handlers.Clear()
	svc.Handlers.Validate.PushBack(ValidateEndpointHandler)

	req := NewRequest(svc, &Operation{Name: "Operation"}, nil, nil)
	err := req.Build()

	assert.NoError(t, err)
}

func TestValidateEndpointHandlerError(t *testing.T) {
	os.Clearenv()
	svc := NewService(nil)
	svc.Handlers.Clear()
	svc.Handlers.Validate.PushBack(ValidateEndpointHandler)

	req := NewRequest(svc, &Operation{Name: "Operation"}, nil, nil)
	err := req.Build()

	assert.Error(t, err)
	assert.Equal(t, ErrMissingRegion, err)
}


text:
back-to-101
===========

Let's get smarter and have fun!

## Presentation
https://docs.google.com/presentation/d/1983l-sYKwXhoo8N5KyjEdAANNjB2DOdF8QcdJUB4uGk/edit#slide=id.g331c280b0_0188

## Graphs
https://docs.google.com/spreadsheets/d/1vQ2_fw5t503U9C0Xk4xNmy8qYqmvff7LRdGxiP1yqFE/edit?usp=sharing

## Other performance benchmark
* [Java Collection Performance](http://java.dzone.com/articles/java-collection-performance)
* [Dynamic Array](http://en.wikipedia.org/wiki/Dynamic_array)


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Threading.Tasks;
using Microsoft.Identity.Client;
using Microsoft.Identity.Test.Common.Core.Mocks;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Microsoft.Identity.Test.Unit
{
    [TestClass]
    public class WwwAuthenticateParametersTests
    {
        private const string WwwAuthenticateHeaderName = "WWW-Authenticate";
        private const string ClientIdKey = "client_id";
        private const string ResourceIdKey = "resource_id";
        private const string ResourceKey = "resource";
        private const string GraphGuid = "00000003-0000-0000-c000-000000000000";
        private const string AuthorizationUriKey = "authorization_uri";
        private const string AuthorizationKey = "authorization";
        private const string AuthorityKey = "authority";
        private const string AuthorizationValue = "https://login.microsoftonline.com/common/oauth2/authorize";
        private const string Realm = "realm";
        private const string EncodedClaims = "eyJpZF90b2tlbiI6eyJhdXRoX3RpbWUiOnsiZXNzZW50aWFsIjp0cnVlfSwiYWNyIjp7InZhbHVlcyI6WyJ1cm46bWFjZTppbmNvbW1vbjppYXA6c2lsdmVyIl19fX0=";
        private const string DecodedClaims = "{\"id_token\":{\"auth_time\":{\"essential\":true},\"acr\":{\"values\":[\"urn:mace:incommon:iap:silver\"]}}}";
        private const string DecodedClaimsHeader = "{\\\"id_token\\\":{\\\"auth_time\\\":{\\\"essential\\\":true},\\\"acr\\\":{\\\"values\\\":[\\\"urn:mace:incommon:iap:silver\\\"]}}}";
        private const string SomeClaims = "some_claims";
        private const string ClaimsKey = "claims";
        private const string ErrorKey = "error";

        [TestMethod]
        [DataRow("client_id=00000003-0000-0000-c000-000000000000", "authorization_uri=\"https://login.microsoftonline.com/common/oauth2/authorize\"")]
        [DataRow("client_id=00000003-0000-0000-c000-000000000000", "authorization=\"https://login.microsoftonline.com/common/oauth2/authorize\"")]
        [DataRow("client_id=00000003-0000-0000-c000-000000000000", "authority=\"https://login.microsoftonline.com/common/\"")]
        [DataRow("client_id=00000003-0000-0000-c000-000000000000", "authority=\"https://login.microsoftonline.com/common\"")]
        [DataRow("resource_id=00000003-0000-0000-c000-000000000000", "authorization=\"https://login.microsoftonline.com/common/oauth2/authorize\"")]
        [DataRow("resource=00000003-0000-0000-c000-000000000000", "authorization=\"https://login.microsoftonline.com/common/oauth2/authorize\"")]
        public void CreateWwwAuthenticateResponse(string resource, string authorizationUri)
        {
            // Arrange
            HttpResponseMessage httpResponse = new HttpResponseMessage(HttpStatusCode.Unauthorized);
            httpResponse.Headers.Add(WwwAuthenticateHeaderName, $"Bearer realm=\"\", {resource}, {authorizationUri}");

            // Act
            var authParams = WwwAuthenticateParameters.CreateFromResponseHeaders(httpResponse.Headers);

            // Assert
            Assert.AreEqual(TestConstants.AuthorityCommonTenant.TrimEnd('/'), authParams.Authority);
            Assert.AreEqual(3, authParams.RawParameters.Count);
            Assert.IsNull(authParams.Claims);
            Assert.IsNull(authParams.Error);
        }

        [TestMethod]
        [DataRow(ClientIdKey, AuthorizationUriKey)]
        [DataRow(ClientIdKey, AuthorizationKey)]
        [DataRow(ClientIdKey, AuthorityKey)]
        [DataRow(ResourceIdKey, AuthorizationUriKey)]
        [DataRow(ResourceIdKey, AuthorizationKey)]
        [DataRow(ResourceIdKey, AuthorityKey)]
        [DataRow(ResourceKey, AuthorizationUriKey)]
        [DataRow(ResourceKey, AuthorizationKey)]
        [DataRow(ResourceKey, AuthorityKey)]
        public void CreateRawParameters(string resourceHeaderKey, string authorizationUriHeaderKey)
        {
            // Arrange
            HttpResponseMessage httpResponse = CreateGraphHttpResponse(resourceHeaderKey, authorizationUriHeaderKey);

            // Act
            var authParams = WwwAuthenticateParameters.CreateFromResponseHeaders(httpResponse.Headers);

            // Assert
            Assert.IsTrue(authParams.RawParameters.ContainsKey(resourceHeaderKey));
            Assert.IsTrue(authParams.RawParameters.ContainsKey(authorizationUriHeaderKey));
            Assert.IsTrue(authParams.RawParameters.ContainsKey(Realm));
            Assert.AreEqual(string.Empty, authParams[Realm]);
            Assert.AreEqual(GraphGuid, authParams[resourceHeaderKey]);
            Assert.ThrowsException<KeyNotFoundException>(
                () => authParams[ErrorKey]);
            Assert.ThrowsException<KeyNotFoundException>(
                () => authParams[ClaimsKey]);
        }

        [TestMethod]
        [DataRow(DecodedClaimsHeader)]
        [DataRow(EncodedClaims)]
        [DataRow(SomeClaims)]
        public void CreateRawParameters_ClaimsAndErrorReturned(string claims)
        {
            // Arrange
            HttpResponseMessage httpResponse = CreateClaimsHttpResponse(claims);

            // Act
            var authParams = WwwAuthenticateParameters.CreateFromResponseHeaders(httpResponse.Headers);

            // Assert
            const string errorValue = "insufficient_claims";
            Assert.IsTrue(authParams.RawParameters.TryGetValue(AuthorizationUriKey, out string authorizationUri));
            Assert.AreEqual(AuthorizationValue, authorizationUri);
            Assert.AreEqual(AuthorizationValue, authParams[AuthorizationUriKey]);
            Assert.IsTrue(authParams.RawParameters.ContainsKey(Realm));
            Assert.IsTrue(authParams.RawParameters.TryGetValue(Realm, out string realmValue));
            Assert.AreEqual(string.Empty, realmValue);
            Assert.AreEqual(string.Empty, authParams[Realm]);
            Assert.IsTrue(authParams.RawParameters.TryGetValue(ClaimsKey, out string claimsValue));
            Assert.AreEqual(claims, claimsValue);
            Assert.AreEqual(claimsValue, authParams[ClaimsKey]);
            Assert.IsTrue(authParams.RawParameters.TryGetValue(ErrorKey, out string errorValueParam));
            Assert.AreEqual(errorValue, errorValueParam);
            Assert.AreEqual(errorValue, authParams[ErrorKey]);
        }

        [TestMethod]
        [DataRow("client_id=00000003-0000-0000-c000-000000000000", "authorization_uri=\"https://login.microsoftonline.com/common/oauth2/authorize\"")]
        [DataRow("client_id=00000003-0000-0000-c000-000000000000", "authorization=\"https://login.microsoftonline.com/common/oauth2/authorize\"")]
        [DataRow("client_id=00000003-0000-0000-c000-000000000000", "authority=\"https://login.microsoftonline.com/common/\"")]
        [DataRow("client_id=00000003-0000-0000-c000-000000000000", "authority=\"https://login.microsoftonline.com/common\"")]
        [DataRow("resource_id=00000003-0000-0000-c000-000000000000", "authorization=\"https://login.microsoftonline.com/common/oauth2/authorize\"")]
        [DataRow("resource=00000003-0000-0000-c000-000000000000", "authorization=\"https://login.microsoftonline.com/common/oauth2/authorize\"")]
        public void CreateWwwAuthenticateParamsFromWwwAuthenticateHeader(string clientId, string authorizationUri)
        {
            // Arrange
            HttpResponseMessage httpResponse = new HttpResponseMessage(HttpStatusCode.Unauthorized);
            httpResponse.Headers.Add(WwwAuthenticateHeaderName, $"Bearer realm=\"\", {clientId}, {authorizationUri}");

            var wwwAuthenticateResponse = httpResponse.Headers.WwwAuthenticate.First().Parameter;

            // Act
            var authParams = WwwAuthenticateParameters.CreateFromWwwAuthenticateHeaderValue(wwwAuthenticateResponse);

            // Assert
            Assert.AreEqual(TestConstants.AuthorityCommonTenant.TrimEnd('/'), authParams.Authority);
            Assert.AreEqual(3, authParams.RawParameters.Count);
            Assert.IsNull(authParams.Claims);
            Assert.IsNull(authParams.Error);
        }

        [TestMethod]
        public async Task CreateFromResourceResponseAsync_HttpClient_Arm_GetTenantId_Async()
        {
            const string resourceUri = "https://example.com/";
            string tenantId = Guid.NewGuid().ToString();

            var handler = new MockHttpMessageHandler
            {
                ExpectedMethod = HttpMethod.Get,
                ExpectedUrl = resourceUri,
                ResponseMessage = CreateInvalidTokenHttpErrorResponse(tenantId)
            };
            var httpClient = new HttpClient(handler);
            var authParams = await WwwAuthenticateParameters.CreateFromResourceResponseAsync(httpClient, resourceUri).ConfigureAwait(false);

            Assert.AreEqual(authParams.GetTenantId(), tenantId);
        }

        [TestMethod]
        public async Task CreateFromResourceResponseAsync_HttpClient_B2C_GetTenantId_Async()
        {
            const string resourceUri = "https://example.com/";
            const string tenantId = "tenant";

            var handler = new MockHttpMessageHandler
            {
                ExpectedMethod = HttpMethod.Get,
                ExpectedUrl = resourceUri,
                ResponseMessage = CreateInvalidTokenHttpErrorResponse(authority: TestConstants.B2CAuthority)
            };
            var httpClient = new HttpClient(handler);
            var authParams = await WwwAuthenticateParameters.CreateFromResourceResponseAsync(httpClient, resourceUri).ConfigureAwait(false);

            Assert.AreEqual(authParams.GetTenantId(), tenantId);
        }

        [TestMethod]
        [DataRow(TestConstants.ADFSAuthority)]
        [DataRow(TestConstants.ADFSAuthority2)]
        public async Task CreateFromResourceResponseAsync_HttpClient_ADFS_GetTenantId_Null_Async(string authority)
        {
            const string resourceUri = "https://example.com/";
            string tenantId = Guid.NewGuid().ToString();

            var handler = new MockHttpMessageHandler
            {
                ExpectedMethod = HttpMethod.Get,
                ExpectedUrl = resourceUri,
                ResponseMessage = CreateInvalidTokenHttpErrorResponse(tenantId, authority)
            };
            var httpClient = new HttpClient(handler);
            var authParams = await WwwAuthenticateParameters.CreateFromResourceResponseAsync(httpClient, resourceUri).ConfigureAwait(false);

            Assert.IsNull(authParams.GetTenantId());
        }

        [DataRow(null)]
        [TestMethod]
        public async Task CreateFromResourceResponseAsync_HttpClient_Null_Async(HttpClient httpClient)
        {
            const string resourceUri = "https://example.com/";

            Func<Task> action = () => WwwAuthenticateParameters.CreateFromResourceResponseAsync(httpClient, resourceUri);

            await Assert.ThrowsExceptionAsync<ArgumentNullException>(action).ConfigureAwait(false);
        }

        [TestMethod]
        [DataRow(null)]
        [DataRow("")]
        public async Task CreateFromResourceResponseAsync_Incorrect_ResourceUri_Async(string resourceUri)
        {
            Func<Task> action = () => WwwAuthenticateParameters.CreateFromResourceResponseAsync(resourceUri);

            await Assert.ThrowsExceptionAsync<ArgumentNullException>(action).ConfigureAwait(false);
        }

        [TestMethod]
        public void ExtractClaimChallengeFromHeader()
        {
            // Arrange
            HttpResponseMessage httpResponse = CreateClaimsHttpResponse(DecodedClaimsHeader);

            // Act
            string extractedClaims = WwwAuthenticateParameters.GetClaimChallengeFromResponseHeaders(httpResponse.Headers);

            // Assert
            Assert.AreEqual(DecodedClaimsHeader, extractedClaims);
        }

        [TestMethod]
        public void ExtractEncodedClaimChallengeFromHeader()
        {
            // Arrange
            HttpResponseMessage httpResponse = CreateClaimsHttpResponse(EncodedClaims);

            // Act
            string extractedClaims = WwwAuthenticateParameters.GetClaimChallengeFromResponseHeaders(httpResponse.Headers);

            // Assert
            Assert.AreEqual(DecodedClaims, extractedClaims);
        }

        [TestMethod]
        public void ExtractClaimChallengeFromHeader_IncorrectError_ReturnNull()
        {
            // Arrange
            HttpResponseMessage httpResponse = CreateClaimsHttpErrorResponse();

            // Act & Assert
            Assert.IsNull(WwwAuthenticateParameters.GetClaimChallengeFromResponseHeaders(httpResponse.Headers));
        }

        private static HttpResponseMessage CreateClaimsHttpResponse(string claims)
        {
            HttpResponseMessage httpResponse = new HttpResponseMessage(HttpStatusCode.Unauthorized);
            httpResponse.Headers.Add(WwwAuthenticateHeaderName, $"Bearer realm=\"\", client_id=\"00000003-0000-0000-c000-000000000000\", authorization_uri=\"https://login.microsoftonline.com/common/oauth2/authorize\", error=\"insufficient_claims\", claims=\"{claims}\"");
            return httpResponse;
        }

        private static HttpResponseMessage CreateClaimsHttpErrorResponse()
        {
            return new HttpResponseMessage(HttpStatusCode.Unauthorized)
            {
                Headers =
                {
                    { WwwAuthenticateHeaderName, $"Bearer realm=\"\", client_id=\"00000003-0000-0000-c000-000000000000\", authorization_uri=\"https://login.microsoftonline.com/common/oauth2/authorize\", error=\"some_error\", claims=\"{DecodedClaimsHeader}\"" }
                }
            };
        }

        private static HttpResponseMessage CreateGraphHttpResponse(string resourceHeaderKey, string authorizationUriHeaderKey)
        {
            return new HttpResponseMessage(HttpStatusCode.Unauthorized)
            {
                Headers =
                {
                    { WwwAuthenticateHeaderName, $"Bearer realm=\"\", {resourceHeaderKey}=\"{GraphGuid}\", {authorizationUriHeaderKey}=\"{AuthorizationValue}\"" }
                }
            };
        }

        private static HttpResponseMessage CreateInvalidTokenHttpErrorResponse(string tenantId = "", string authority = "https://login.windows.net")
        {
            return new HttpResponseMessage(HttpStatusCode.Unauthorized)
            {
                Headers =
                {
                    { WwwAuthenticateHeaderName, $"Bearer authorization_uri=\"{authority}/{tenantId}\", error=\"invalid_token\", error_description=\"The authentication failed because of missing 'Authorization' header.\"" }
                }
            };
        }
    }
}


text:
[![Covalent CI](https://github.com/teradata/covalent/actions/workflows/ci.yml/badge.svg)](https://github.com/teradata/covalent/actions/workflows/ci.yml)
[![npm](https://img.shields.io/npm/v/%40covalent/core.svg)](https://www.npmjs.com/package/@covalent/core)
[![npm](https://img.shields.io/npm/v/%40covalent/core/next.svg)](https://www.npmjs.com/package/@covalent/core/v/next)
[![Join the chat at https://gitter.im/Teradata/covalent](https://badges.gitter.im/Teradata/covalent.svg)](https://gitter.im/Teradata/covalent?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

[![npm](https://img.shields.io/npm/l/@covalent/core.svg)](LICENSE)

<img alt="Covalent" src="https://raw.githubusercontent.com/Teradata/covalent/main/apps/docs-app/src/assets/icons/covalent.svg" width="150">

Covalent is a reusable UI platform from Teradata for building web applications with common standards and tooling. It is based on Angular and Material Design.

**Vision: To build an atomic, reusable component platform for Teradata to consume, while collaborating in an open source model.**

## Setup

- Ensure you have Node 12.20.x+ and NPM 6+ installed.
- Install Angular CLI `npm i -g @angular/cli`
- Install Typescript `npm i -g typescript`
- Install Node packages `npm ci`
- Run local build `npm run start`

---

- [Getting Started](docs/GETTING_STARTED.md)
- [Contributing Guidelines](docs/CONTRIBUTING.md)
- [Developer Guide](docs/DEVELOPER_GUIDE.md)
- [Upgrading](docs/UPGRADE.md)
- [Releasing](docs/RELEASE.md)
- [Changelog](docs/CHANGELOG.md)
- [StackBlitz Template](https://stackblitz.com/edit/covalent)
- [Plunker Template](http://plnkr.co/edit/XhSrUWBw2RhCkXPoE4fn)

---

## Angular Support

Certain covalent version are meant for certain angular versions, and here is the matrix:

|     Covalent     |      Angular      |
| :--------------: | :---------------: |
|       2.X        |        8.X        |
|       3.X        | 9.X / 10.X / 11.x |
|       4.X        |    12.X / 13.X    |
| Future / Nightly |       13.X        |

## Browser Support

Covalent is built on a CSS Flexbox layout and all layouts and components heavily rely up that support, so the current browsers are supported in order or recommendation:

#### Current version - 1 for the following:

|               | Chrome | Firefox | Safari | Edge | Mobile Chrome | Mobile Safari |
| ------------- | :----: | :-----: | :----: | :--: | :-----------: | :-----------: |
| **Supported** |   ✓    |    ✓    |   ✓    |  ✓   |       ~       |       ~       |

~ Indicates limited testing & lower priority

## Running Chromatic

`npx chromatic --project-token=${CHROMATIC_PROJECT_TOKEN}`


text:
package core

import (
	"fmt"
	"log"
	"os/exec"
)

func notify(title, message string) error {
	log.Printf("%s: %s\n", title, message)
	s := fmt.Sprintf(`display notification "%s" with title "%s" sound name "Submarine"`, message, title)
	cmd := exec.Command("osascript", "-e", s)
	return cmd.Run()
}


text:
package com.lonepulse.icklebot.injector.explicit;

import java.lang.reflect.Field;
import java.util.Set;

import android.app.Activity;
import android.content.Context;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;

import com.lonepulse.icklebot.annotation.inject.Layout;
import com.lonepulse.icklebot.injector.Injector;
import com.lonepulse.icklebot.injector.resolver.InjectionCategory;
import com.lonepulse.icklebot.util.ContextUtils;
import com.lonepulse.icklebot.util.TypeUtils;

/**
 *
An implementation of {@link Injector} which is responsible
 * for injecting the layout of an {@link Activity} using
 * the {@link Layout} metadata.

 *
 *
The layout resource id or root {@link View} should
 * be marked for injection via {@link Layout}.

 *
 * @version 1.0.0
 *

 * @author Lahiru Sahan Jayasinghe
 */
class ExplicitLayoutInjector implements Injector {

	/**
	 * {@inheritDoc}
	 */
	@Override
	public void inject(Configuration config) {

		Object context = config.getContext();

		if(ContextUtils.isActivity(context)) {

			Layout layout = TypeUtils.getAnnotation(context, Layout.class);

			if(layout != null)
				ContextUtils.asActivity(context).setContentView(layout.value());
		}

		Set<Field> fields = config.getInjectionTargets(InjectionCategory.LAYOUT);
		Context baseContext = ContextUtils.discover(context);

		for (Field field : fields) {

			try {

				if(!field.isAccessible()) field.setAccessible(true);

				int id = field.getAnnotation(Layout.class).value();
				View layoutView = LayoutInflater.from(baseContext).inflate(id, null);

				field.set(context, layoutView);
			}
			catch (Exception e) {

				Log.e(getClass().getName(), "Layout Injection Failed!", e);
			}
		}
	}
}


text:
package io.hops.util;

import io.hops.leader_election.node.ActiveNode;
import io.hops.leader_election.node.ActiveNodePBImpl;
import io.hops.leader_election.node.SortedActiveNodeList;
import io.hops.leader_election.node.SortedActiveNodeListPBImpl;
import io.hops.leader_election.proto.ActiveNodeProtos;
import io.hops.util.impl.ActiveRMPBImpl;

import java.net.InetSocketAddress;
import java.util.List;
import java.util.Random;

public class SortedActiveRMList {

  private SortedActiveNodeList activeNodes;
  Random random = new Random();

  public SortedActiveRMList(ActiveNodeProtos.SortedActiveNodeListProto proto) {
    activeNodes = new SortedActiveNodeListPBImpl(proto);
  }

  public SortedActiveRMList(List<ActiveNode> listActiveRM) {
    if (listActiveRM == null) {
      throw new NullPointerException("List of active namenodes was null");
    }
    activeNodes = new SortedActiveNodeListPBImpl(listActiveRM);
  }

  public ActiveNodeProtos.SortedActiveNodeListProto getProto() {
    return ((SortedActiveNodeListPBImpl) activeNodes).getProto();
  }

  public List<ActiveNode> getActiveNodes() {
    return activeNodes.getActiveNodes();
  }

  public ActiveNode getActiveNode(InetSocketAddress address) {
    return activeNodes.getActiveNode(address);
  }

  public ActiveNode getLeader() {
    return activeNodes.getLeader();
  }

  public ActiveNode getLeastLoaded() {
    List<ActiveNode> rms = activeNodes.getActiveNodes();
    ActiveNode leader = activeNodes.getLeader();
    ActiveRM result = null;
    if (rms.size() > 1) {
      for (ActiveNode node : rms) {
        ActiveRM rm = new ActiveRMPBImpl(((ActiveNodePBImpl) node).getProto());
        if (!rm.getHostname().equals(leader.getHostname())) {
          if (result == null) {
            result = rm;
          } else if (rm.getLoad() < result.getLoad() || (rm.getLoad() == result.
                  getLoad() && random.nextBoolean())) {
            result = rm;
          }
        }
      }
    } else {
      result = new ActiveRMPBImpl(((ActiveNodePBImpl) rms.get(0)).getProto());
    }
    return result;
  }

  public boolean isEmpty() {
    return activeNodes.isEmpty();
  }
}


text:
<?php

namespace backend\models;

use Yii;
use yii\base\Model;
use yii\data\ActiveDataProvider;
use backend\models\Order;

/**
 * OrderSearch represents the model behind the search form about `backend\models\Order`.
 */
class OrderSearch extends Order
{
    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['id', 'created_at', 'updated_at'], 'integer'],
            [['first_name', 'last_name', 'city', 'phone', 'department',
                'note', 'created_at_date', 'updated_at_date', 'status'], 'safe'],
        ];
    }

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

    /**
     * Creates data provider instance with search query applied
     *
     * @param array $params
     *
     * @return ActiveDataProvider
     */
    public function search($params)
    {
        $query = Order::find();

        $dataProvider = new ActiveDataProvider([
            'query' => $query,
        ]);

        $this->load($params);

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

        $query->andFilterWhere([
            'id' => $this->id,
            'status' => $this->status ? array_search(mb_convert_case(mb_strtolower($this->status), MB_CASE_TITLE),
                Order::getStatuses()) : $this->status,
            'created_at' => $this->created_at,
            'updated_at' => $this->updated_at,
            'created_at_date' => $this->created_at_date,
            'updated_at_date' => $this->updated_at_date,
        ]);

        $query->andFilterWhere(['like', 'first_name', $this->first_name])
            ->andFilterWhere(['like', 'last_name', $this->last_name])
            ->andFilterWhere(['like', 'city', $this->city])
            ->andFilterWhere(['like', 'phone', $this->phone])
            ->andFilterWhere(['like', 'department', $this->department])
            ->andFilterWhere(['like', 'note', $this->note]);

        return $dataProvider;
    }
}


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>pymatgen.util.serialization module — pymatgen 2017.12.30 documentation</title>
    <link rel="stylesheet" href="_static/proBlue.css" type="text/css" />
    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />

    <link rel="shortcut icon" href="_static/favicon.ico"/>
    <link rel="index" title="Index" href="genindex.html" />
    <link rel="search" title="Search" href="search.html" />

Navigation

          index

          modules |

pymatgen 2017.12.30 documentation »

pymatgen.util.serialization module¶

class PmgPickler[source]¶

Bases: _pickle.Pickler

Persistence of External Objects as described in section 12.1.5.1 of
https://docs.python.org/3/library/pickle.html

persistent_id(obj)[source]¶

Instead of pickling as a regular class instance, we emit a
persistent ID.

class PmgUnpickler[source]¶

Bases: _pickle.Unpickler

Persistence of External Objects as described in section 12.1.5.1 of
https://docs.python.org/3/library/pickle.html

persistent_load(pid)[source]¶

This method is invoked whenever a persistent ID is encountered.
Here, pid is the tuple returned by PmgPickler.

class SlotPickleMixin[source]¶

Bases: object

This mixin makes it possible to pickle/unpickle objects with __slots__
defined.

json_pretty_dump(obj, filename)[source]¶

Serialize obj as a JSON formatted stream to the given filename (
pretty printing version)

pmg_pickle_dump(obj, filobj, **kwargs)[source]¶

Dump an object to a pickle file using PmgPickler.

<col class="field-name" />
<col class="field-body" />

Parameters:

obj (object) – Object to dump.

fileobj – File-like object

**kwargs – Any of the keyword arguments supported by PmgPickler

pmg_pickle_load(filobj, **kwargs)[source]¶

Loads a pickle file and deserialize it with PmgUnpickler.

<col class="field-name" />
<col class="field-body" />

Parameters:

filobj – File-like object

**kwargs – Any of the keyword arguments supported by PmgUnpickler

Returns:
Deserialized object.

pmg_serialize(method)[source]¶

Decorator for methods that add MSON serializations keys
to the dictionary. See documentation of MSON for more details

This Page

Show Source

Quick search

    <form class="search" action="search.html" method="get">

<input type="text" name="q" />

<input type="submit" value="Go" />

      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>

Navigation

          index

          modules |

pymatgen 2017.12.30 documentation »

        © Copyright 2011, Pymatgen Development Team.
      Created using Sphinx 1.6.5.

This page uses
Google Analytics to collect statistics. You can disable it by blocking
the JavaScript coming from www.google-analytics.com.


text:
{{ dmPreviousNextPagination({
  "previousPage": {
    "url": url_for('.suppliers_list_by_prefix', **prev_link),
    "title": "Previous page"
  } if prev_link,
  "nextPage": {
    "url": url_for('.suppliers_list_by_prefix', **next_link),
    "title": "Next page"
  } if next_link
})}}


text:
package DDG::Goodie::IsAwesome::gokul1794;
# ABSTRACT: gokul1794's first goodie

use DDG::Goodie;
use strict;

zci answer_type => "is_awesome_gokul1794";
zci is_cached   => 1;

triggers start => "duckduckhack gokul1794";

handle remainder => sub {
    return if $_;
    return "gokul1794 is awesome and has successfully completed the DuckDuckHack Goodie tutorial!";
};

1;


text:
import uuid

import sqlalchemy

from conveyor.db.sqlalchemy.types import Json

def upgrade(migrate_engine):
    meta = sqlalchemy.MetaData()
    meta.bind = migrate_engine

    _build_gw_tables(meta)

def _build_gw_tables(meta):

    alarm = sqlalchemy.Table(
        'gw_alarm', meta,
        sqlalchemy.Column('id', sqlalchemy.String(36),
                          primary_key=True, nullable=False,
                          default=lambda: str(uuid.uuid4())),
        sqlalchemy.Column('resource_id', sqlalchemy.String(36)),
        sqlalchemy.Column('created_at', sqlalchemy.DateTime),
        sqlalchemy.Column('updated_at', sqlalchemy.DateTime),
        sqlalchemy.Column('group_id', sqlalchemy.String(36),
                          index=True, nullable=True),
        sqlalchemy.Column('meter_name', sqlalchemy.String(255),
                          nullable=False),
        sqlalchemy.Column('data', Json),
        sqlalchemy.Column('actions', Json),
        sqlalchemy.Column('tenant', sqlalchemy.String(64), nullable=False),
        sqlalchemy.Column('user', sqlalchemy.String(64), nullable=False),
        mysql_engine='InnoDB',
        mysql_charset='utf8'
    )

    group = sqlalchemy.Table(
        'gw_group', meta,
        sqlalchemy.Column('id', sqlalchemy.String(36),
                          primary_key=True, nullable=False,
                          default=lambda: str(uuid.uuid4())),
        sqlalchemy.Column('created_at', sqlalchemy.DateTime),
        sqlalchemy.Column('updated_at', sqlalchemy.DateTime),
        sqlalchemy.Column('name', sqlalchemy.String(255), nullable=False),
        sqlalchemy.Column('type', sqlalchemy.String(255), nullable=True),
        sqlalchemy.Column('data', Json),
        sqlalchemy.Column('tenant', sqlalchemy.String(64), nullable=False),
        sqlalchemy.Column('user', sqlalchemy.String(64), nullable=False),
        mysql_engine='InnoDB',
        mysql_charset='utf8'
    )

    member = sqlalchemy.Table(
        'gw_member', meta,
        sqlalchemy.Column('id', sqlalchemy.String(36),
                          primary_key=True, nullable=False,
                          default=lambda: str(uuid.uuid4())),
        sqlalchemy.Column('name', sqlalchemy.String(255), nullable=True),
        sqlalchemy.Column('created_at', sqlalchemy.DateTime),
        sqlalchemy.Column('updated_at', sqlalchemy.DateTime),
        sqlalchemy.Column('group_id', sqlalchemy.String(36),
                          sqlalchemy.ForeignKey('gw_group.id'),
                          nullable=True),
        mysql_engine='InnoDB',
        mysql_charset='utf8'
    )

    tables = (
        group,
        alarm,
        member,
    )

    for index, table in enumerate(tables):
        try:
            table.create(checkfirst=True)
        except Exception:
            # If an error occurs, just raise the exception
            raise


text:
'use strict';

const util = require('util');

require('colors');

let logs = [];

function capture(level, args) {
    if (exports.capture) {
        logs.push(level + ": " + util.format.apply(null, args));
        return true;
    }
    return false;
}

function timestamp() {
    if (exports.enabled.timestamps) {
        return ('[' + new Date().toISOString() + '] ').grey.bold;
    } else {
        return '';
    }
}

exports.enabled = {
    debug: false,
    info: true,
    timestamps: false
};

/**
 * Enabling capture will disable sending logs to console and instead store them in memory so that they can be polled.
 *
 * @type {boolean}
 */
exports.capture = false;

/**
 * Empty the currently queued up logs and return them in an array. All log messages will have the error level prefixed.
 *
 * @returns {Array}
 */
exports.pollCapturedLogs = () => {
    let chunk = logs;
    logs = [];
    return chunk;
};

/**
 * All arguments are passed on to util format to log the message in red.
 *
 */
exports.error = (...args) => !capture("ERROR", args) && console.log(timestamp() + util.format(...args).red);

/**
 * All arguments are passed on to util format to log the message.
 *
 */
exports.info = (...args) => !capture("INFO", args) && exports.enabled.info && console.log(timestamp() + util.format(...args));

/**
 * All arguments are passed on to util format to log the message in grey.
 *
 */
exports.debug = (...args) => !capture("DEBUG", args) && exports.enabled.debug && console.log(timestamp() + util.format(...args).grey);

exports.statusMaxLength = 0;

exports.returnCtrl = /^win/.test(process.platform) ? "\x1B[0G" : "\r";

/**
 * Prints a line without a trailing new line character end returns the carriage to the beginning so that this message
 * can be overwritten by the next output.
 */
exports.status = (...args) => {
    if (!capture("STATUS", args) && exports.enabled.info) {
        let message = timestamp() + util.format(...args);
        exports.statusMaxLength = Math.max(exports.statusMaxLength, message.length);
        process.stdout.write(message + exports.returnCtrl);
    }
};

/**
 * Removes all characters that have been left over by any previous status calls.
 */
exports.clearStatus = () => {
    let message = new Array(exports.statusMaxLength + 1).join(' ');
    process.stdout.write(message + exports.returnCtrl);
};

/**
 * End the process with a given status code and spit out one last message. Some of the messages are predefined
 * depending on the given status code and will be printed if no message has been given with the respective status code.
 *
 * @param {number} [status]     The status code with which the process will exit
 * @param {string} [message]    The message that will be printed
 */
exports.die = (status, message) => {
    if (exports.capture) {
        message && logs.push("ERROR: " + message);
        throw new Error(message);
    }
    if (!message) {
        switch(status) {
            case 1: message = "No documents found to export"; break;
            case 2: message = "Uncaught Exception"; break;
            case 4: message = "driver is passing on an error"; break;
            case 10: message = "driver interface is not implemented properly"; break;
            case 11: message = "driver doesn't exist"; break;
            case 12: message = "driver threw unknown error"; break;
            case 13: message = "driver option map is invalid"; break;
        }
    }
    message && console.log(timestamp() + ("Exit code " + status + ": " + message).red);
    process.exit(status);
};


text:
using System.Linq;

namespace UninstallTools.Factory.InfoAdders
{
    public class FileIconGetter : IMissingInfoAdder
    {
        public string[] RequiredValueNames { get; } = {
            nameof(ApplicationUninstallerEntry.UninstallerFullFilename),
            nameof(ApplicationUninstallerEntry.SortedExecutables)
        };

        public bool RequiresAllValues { get; } = false;
        public bool AlwaysRun { get; } = false;

        public string[] CanProduceValueNames { get; } = {
            nameof(ApplicationUninstallerEntry.DisplayIcon),
            nameof(ApplicationUninstallerEntry.IconBitmap)
        };
        public InfoAdderPriority Priority { get; } = InfoAdderPriority.RunLast;

        /// <summary>
        ///     Run after DisplayIcon, DisplayName, UninstallerKind, InstallLocation, UninstallString have been initialized.
        /// </summary>
        public void AddMissingInformation(ApplicationUninstallerEntry entry)
        {
            if (entry.IconBitmap != null)
                return;

            // SdbInst uninstallers do not have any executables to check
            if (entry.UninstallerKind == UninstallerType.SdbInst)
                return;

            // Try getting an icon from the app's executables
            if (entry.SortedExecutables != null)
            {
                foreach (var executablePath in entry.SortedExecutables.Take(2))
                {
                    var exeIcon = UninstallToolsGlobalConfig.TryExtractAssociatedIcon(executablePath);
                    if (exeIcon != null)
                    {
                        entry.DisplayIcon = executablePath;
                        entry.IconBitmap = exeIcon;
                        return;
                    }
                }
            }

            var uninsIcon = UninstallToolsGlobalConfig.TryExtractAssociatedIcon(entry.UninstallerFullFilename);
            if (uninsIcon != null)
            {
                entry.DisplayIcon = entry.UninstallerFullFilename;
                entry.IconBitmap = uninsIcon;
            }
        }
    }
}


text:
@interface TBBTimeLineBottomPointModel : NSObject
@property (nonatomic, assign) CGFloat xPosition;
@property (nonatomic, assign) CGFloat yPosition;
+(TBBTimeLineBottomPointModel *)initPositon:(CGFloat)xPositon yPosition:(CGFloat)yPosition;
@end


text:
<?php

namespace Application\Most\Adapter;

use Application\Most;
use Exception;
use Laminas\Db\Sql;
use Laminas\Db\TableGateway\TableGateway;

use function method_exists;
use function ucfirst;

abstract class AbstractAdapter
{
    protected Most $most;

    protected TableGateway $attributeTable;

    protected TableGateway $itemTable;

    public function __construct(array $options)
    {
        $this->setOptions($options);
    }

    public function setAttributeTable(TableGateway $table): void
    {
        $this->attributeTable = $table;
    }

    public function setItemTable(TableGateway $itemTable): void
    {
        $this->itemTable = $itemTable;
    }

    public function setMost(Most $most): self
    {
        $this->most = $most;

        return $this;
    }

    public function setOptions(array $options): self
    {
        foreach ($options as $key => $value) {
            $normalized = ucfirst($key);

            $method = 'set' . $normalized;
            if (method_exists($this, $method)) {
                $this->$method($value);
            } else {
                throw new Exception("Option '$key' not found");
            }
        }

        return $this;
    }

    abstract public function getCars(Sql\Select $select, string $language): array;
}


text:
/* UI Option styles for Full page without preview */

body {
    max-width: 960px;
    min-width: 900px;
}

/* Category separator */
.fl-prefsEditor-fullNoPreview .fl-prefsEditor-category {
    border-top: 2px solid #dddddd;
    clear:both;
}

/* Section header icons */
.fl-prefsEditor-fullNoPreview .fl-prefsEditor-category h2 img {
    padding-top: 10px;
    margin-bottom: -4px;
}

/* Save, reset, cancel buttons */
.fl-prefsEditor-fullNoPreview .fl-prefsEditor-buttons {
    text-align: right;
}

/* Controls */
.fl-prefsEditor-fullNoPreview .fl-col-flex {
    padding-top: 15px;
}

.fl-prefsEditor-fullNoPreview ul {
    float:left;
}

.fl-prefsEditor-fullNoPreview ul li {
    clear: left;
}

.fl-prefsEditor-fullNoPreview label,
.fl-prefsEditor-fullNoPreview .fl-inputs  {
    margin-bottom: 15px;        /* adds space between label, inputs when browser window is narrow */
}


text:
class cBlockFlowerHandler :
	public cBlockHandler
{
public:
	cBlockFlowerHandler(BLOCKTYPE a_BlockType)
		: cBlockHandler(a_BlockType)
	{
	}

	virtual void ConvertToPickups(cItems & a_Pickups, NIBBLETYPE a_BlockMeta) override
	{
		// Reset meta to 0
		a_Pickups.push_back(cItem(m_BlockType, 1, 0));
	}

	virtual bool CanBeAt(cChunkInterface & a_ChunkInterface, int a_RelX, int a_RelY, int a_RelZ, const cChunk & a_Chunk) override
	{
		return (a_RelY > 0) && IsBlockTypeOfDirt(a_Chunk.GetBlock(a_RelX, a_RelY - 1, a_RelZ));
	}

	virtual const char * GetStepSound(void) override
	{
		return "step.grass";
	}
} ;


text:
const assert = require('assert')
const memoizeFs = require('./index')

const memoizer = memoizeFs({ cachePath: './some-cache' })

console.log(memoizer)
// => {
//   fn: [Function: fn],
//   getCacheFilePath: [Function: getCacheFilePathBound],
//   invalidate: [Function: invalidateCache]
// }

async function main () {
  let idx = 0
  const func = function foo (a, b) {
    idx += a + b
    return idx
  }

  const memoizedFn = await memoizer.fn(func)
  const resultOne = await memoizedFn(1, 2)

  assert.strictEqual(resultOne, 3)
  assert.strictEqual(idx, 3)

  const resultTwo = await memoizedFn(1, 2) // cache hit
  assert.strictEqual(resultTwo, 3)
  assert.strictEqual(idx, 3)
}

main().catch(console.error)


text:
<?php
namespace frontend\models;

use frontend\models\User;
use yii\base\Model;
use Yii;

/**
 * Signup form
 */
class UserValidatePasswordForm extends Model
{
    /**
     * @var
     */
    public $originalPassword;

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['originalPassword'], 'required', 'message' => '不能为空'],
            [['originalPassword'], 'string', 'min' => 6, 'max' => 40, 'tooShort' => '密码长度不得小于6', 'tooLong' => '密码长度不得大于40'],
            ['originalPassword', 'validateOriginalPassword'],

        ];
    }

    /**
     * @return array
     */
    public function attributeLabels()
    {
        return [
            'password' => Yii::t('app', '请输入新密码'),
            'passwordRepeat' => Yii::t('app', '请确认新密码'),
        ];
    }

    /**
     * @param $attribute
     * @param $params
     * @return bool
     */
     public function validateOriginalPassword($attribute, $params)
     {
         $user = User::findModelByUsername();
         //var_dump($user->setPassword($this->$attribute));echo '<br/><pre>';var_dump($user);die;
         if (!empty($user) && $user->setPassword($this->$attribute) == $user->password) {
             return true;
         }
         $this->addError($attribute, '密码错误!');
     }

    /**
     * @return bool
     * @throws NotFoundHttpException
     */
    public function validatePassword()
    {
        if ($this->validate()) {
            return true;
        }

        return false;
    }

}