text:
/*!
 * angular-formly-material JavaScript Library v0.13.0
 *
 * @license MIT (http://license.angular-formly.com)
 *
 * built with ♥ by Kamil Kisiela <mys.sterowiec@gmail.com>
 */
(function webpackUniversalModuleDefinition(root, factory) {
	if(typeof exports === 'object' && typeof module === 'object')
		module.exports = factory(require("angular"));
	else if(typeof define === 'function' && define.amd)
		define(["angular"], factory);
	else if(typeof exports === 'object')
		exports["ngFormlyMaterial"] = factory(require("angular"));
	else
		root["ngFormlyMaterial"] = factory(root["angular"]);
})(this, function(__WEBPACK_EXTERNAL_MODULE_1__) {
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] = {
/******/ 			exports: {},
/******/ 			id: moduleId,
/******/ 			loaded: false
/******/ 		};

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

/******/ 		// Flag the module as loaded
/******/ 		module.loaded = 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;

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

/******/ 	// Load entry module and return exports
/******/ 	return __webpack_require__(0);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ function(module, exports, __webpack_require__) {

	'use strict';

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

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

	var _angular = __webpack_require__(1);

	var _angular2 = _interopRequireDefault(_angular);

	var _runs = __webpack_require__(2);

	var _runs2 = _interopRequireDefault(_runs);

	var _wrappers = __webpack_require__(6);

	var _wrappers2 = _interopRequireDefault(_wrappers);

	var _types = __webpack_require__(15);

	var _types2 = _interopRequireDefault(_types);

	var ngModuleName = 'formlyMaterial';

	_angular2['default'].module(ngModuleName, ['ngMessages', 'ngMaterial', 'formly']).config(['formlyConfigProvider', function (formlyConfigProvider) {
	  var configs = [_runs2['default'], _wrappers2['default'], _types2['default']];

	  configs.forEach(function (config) {
	    var i = 0;
	    for (; i < config.length; i++) {
	      config[i](formlyConfigProvider);
	    }
	  });
	}]);

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

/***/ },
/* 1 */
/***/ function(module, exports) {

	module.exports = __WEBPACK_EXTERNAL_MODULE_1__;

/***/ },
/* 2 */
/***/ function(module, exports, __webpack_require__) {

	'use strict';

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

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

	var _className = __webpack_require__(3);

	var _className2 = _interopRequireDefault(_className);

	var _theme = __webpack_require__(5);

	var _theme2 = _interopRequireDefault(_theme);

	exports['default'] = [_className2['default'], _theme2['default']];
	module.exports = exports['default'];

/***/ },
/* 3 */
/***/ function(module, exports, __webpack_require__) {

	'use strict';

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

	var _helpersIndexJs = __webpack_require__(4);

	exports['default'] = function (formlyConfigProvider) {
	  // add only step attribute because min and max are both built-in
	  formlyConfigProvider.extras.fieldTransform.push(function (fields) {
	    return (0, _helpersIndexJs.ngModelAttrsTransformer)(fields, function (field) {
	      return field.templateOptions && typeof field.templateOptions.className !== 'undefined';
	    }, 'className', {
	      bound: 'ng-class'
	    });
	  });
	};

	module.exports = exports['default'];

/***/ },
/* 4 */
/***/ function(module, exports, __webpack_require__) {

	'use strict';

	Object.defineProperty(exports, '__esModule', {
	  value: true
	});
	exports.ngModelAttrsManipulator = ngModelAttrsManipulator;
	exports.ngModelAttrsTransformer = ngModelAttrsTransformer;

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

	var _angular = __webpack_require__(1);

	var _angular2 = _interopRequireDefault(_angular);

	/**
	 * Sets attribute with optional value.
	 * Does not owerwrite.
	 * @param {Array} nodes nodes
	 * @param {String} attr  attribute name
	 * @param {String} val   atrtibute value
	 */
	function addIfNotPresent(nodes, attr, val) {
	  _angular2['default'].forEach(nodes, function (node) {
	    if (!node.getAttribute(attr)) {
	      node.setAttribute(attr, val);
	    }
	  });
	}

	/**
	 * Gets all ngModels from node
	 */
	function getNgModelNodes(node) {
	  var query = '[ng-model], [data-ng-model]';

	  return node.querySelectorAll(query);
	}

	/**
	 * Adds attribute with optional value to all elements using ngModel directive.
	 * Handles extras.skipNgModelAttrsManipulator
	 * And does not overwrite attriutes
	 *
	 * @param  {String} template  Template provided by formly template manipulator
	 * @param  {Object} options   Options provided by formly template manipulator
	 * @param  {String} attrName  Attribute's name
	 * @param  {String|undefined} Attribute's value (optional)
	 * @return {String} result
	 */

	function ngModelAttrsManipulator(template, options, attrName, attrValue) {
	  var node = document.createElement('div');
	  var skip = options.extras && options.extras.skipNgModelAttrsManipulator;

	  if (skip === true) {
	    return template;
	  }
	  node.innerHTML = template;
	  var modelNodes = getNgModelNodes(node);

	  if (!modelNodes || !modelNodes.length) {
	    return template;
	  }

	  addIfNotPresent(modelNodes, attrName, attrValue);

	  return node.innerHTML;
	}

	/**
	 * Adds ngModelAttr to the field when specified condition is true.
	 * @param  {Array} fields    fields provided by formly's fieldTranform
	 * @param  {Funcion} condition with field as only parameter
	 * @param  {String} name      ngModelAttr's name
	 * @param  {Object} settings  ngModelAttr's settings
	 * @return {Array}           returns fields
	 */

	function ngModelAttrsTransformer(fields, condition, name, settings) {
	  (fields || []).forEach(function (field) {
	    if (condition(field) === true) {
	      if (!field.ngModelAttrs) {
	        field.ngModelAttrs = {};
	      }

	      if (typeof field.templateOptions[name] !== 'undefined') {
	        field.ngModelAttrs[name] = settings;
	      }
	    }
	  });

	  return fields;
	}

/***/ },
/* 5 */
/***/ function(module, exports, __webpack_require__) {

	'use strict';

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

	var _helpersIndexJs = __webpack_require__(4);

	exports['default'] = function (formlyConfigProvider) {
	  formlyConfigProvider.templateManipulators.preWrapper.push(function (template, options) {
	    // adds md-theme only when:
	    // templateOptions.theme is defined
	    if (typeof options.templateOptions.theme !== 'undefined') {
	      return (0, _helpersIndexJs.ngModelAttrsManipulator)(template, options, 'md-theme', options.templateOptions.theme);
	    }
	    return template;
	  });
	};

	module.exports = exports['default'];

/***/ },
/* 6 */
/***/ function(module, exports, __webpack_require__) {

	'use strict';

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

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

	var _inputContainerInputContainer = __webpack_require__(7);

	var _inputContainerInputContainer2 = _interopRequireDefault(_inputContainerInputContainer);

	var _labelLabel = __webpack_require__(9);

	var _labelLabel2 = _interopRequireDefault(_labelLabel);

	var _messagesMessages = __webpack_require__(11);

	var _messagesMessages2 = _interopRequireDefault(_messagesMessages);

	var _dividerDivider = __webpack_require__(13);

	var _dividerDivider2 = _interopRequireDefault(_dividerDivider);

	exports['default'] = [_inputContainerInputContainer2['default'], _labelLabel2['default'], _messagesMessages2['default'], _dividerDivider2['default']];
	module.exports = exports['default'];

/***/ },
/* 7 */
/***/ function(module, exports, __webpack_require__) {

	'use strict';

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

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

	var _inputContainerHtml = __webpack_require__(8);

	var _inputContainerHtml2 = _interopRequireDefault(_inputContainerHtml);

	exports['default'] = function (formlyConfigProvider) {
	  formlyConfigProvider.setWrapper({
	    template: _inputContainerHtml2['default'],
	    name: 'inputContainer'
	  });
	};

	module.exports = exports['default'];

/***/ },
/* 8 */
/***/ function(module, exports) {

	module.exports = "<md-input-container>\r\n    <formly-transclude></formly-transclude>\r\n</md-input-container>";

/***/ },
/* 9 */
/***/ function(module, exports, __webpack_require__) {

	'use strict';

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

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

	var _labelHtml = __webpack_require__(10);

	var _labelHtml2 = _interopRequireDefault(_labelHtml);

	exports['default'] = function (formlyConfigProvider) {
	  formlyConfigProvider.setWrapper({
	    template: _labelHtml2['default'],
	    name: 'label',
	    apiCheck: function apiCheck(check) {
	      return {
	        templateOptions: {
	          label: check.string
	        }
	      };
	    }
	  });
	};

	module.exports = exports['default'];

/***/ },
/* 10 */
/***/ function(module, exports) {

	module.exports = "\n  {{to.label}}\n\n<formly-transclude></formly-transclude>\n";

/***/ },
/* 11 */
/***/ function(module, exports, __webpack_require__) {

	'use strict';

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

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

	var _messagesHtml = __webpack_require__(12);

	var _messagesHtml2 = _interopRequireDefault(_messagesHtml);

	exports['default'] = function (formlyConfigProvider) {
	  formlyConfigProvider.setWrapper({
	    template: _messagesHtml2['default'],
	    name: 'messages'
	  });
	};

	module.exports = exports['default'];

/***/ },
/* 12 */
/***/ function(module, exports) {

	module.exports = "<formly-transclude></formly-transclude>\r\n
\r\n
\r\n        {{message(fc.$viewValue, fc.$modelValue, this)}}\r\n
\r\n
\r\n";

/***/ },
/* 13 */
/***/ function(module, exports, __webpack_require__) {

	'use strict';

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

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

	var _dividerHtml = __webpack_require__(14);

	var _dividerHtml2 = _interopRequireDefault(_dividerHtml);

	exports['default'] = function (formlyConfigProvider) {
	  formlyConfigProvider.setWrapper({
	    template: _dividerHtml2['default'],
	    name: 'divider',
	    apiCheck: function apiCheck(check) {
	      return {
	        templateOptions: {
	          divider: check.oneOf(['before', 'after']).optional
	        }
	      };
	    }
	  });
	};

	module.exports = exports['default'];

/***/ },
/* 14 */
/***/ function(module, exports) {

	module.exports = "<md-divider ng-if=\"to.divider === 'before'\"></md-divider>\r\n<formly-transclude></formly-transclude>\r\n<md-divider ng-if=\"to.divider !== 'before'\"></md-divider>\r\n";

/***/ },
/* 15 */
/***/ function(module, exports, __webpack_require__) {

	'use strict';

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

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

	var _checkboxCheckbox = __webpack_require__(16);

	var _checkboxCheckbox2 = _interopRequireDefault(_checkboxCheckbox);

	var _chipsChips = __webpack_require__(18);

	var _chipsChips2 = _interopRequireDefault(_chipsChips);

	var _datepickerDatepicker = __webpack_require__(20);

	var _datepickerDatepicker2 = _interopRequireDefault(_datepickerDatepicker);

	var _inputInput = __webpack_require__(22);

	var _inputInput2 = _interopRequireDefault(_inputInput);

	var _radioRadio = __webpack_require__(24);

	var _radioRadio2 = _interopRequireDefault(_radioRadio);

	var _selectSelect = __webpack_require__(26);

	var _selectSelect2 = _interopRequireDefault(_selectSelect);

	var _sliderSlider = __webpack_require__(28);

	var _sliderSlider2 = _interopRequireDefault(_sliderSlider);

	var _switchSwitch = __webpack_require__(30);

	var _switchSwitch2 = _interopRequireDefault(_switchSwitch);

	var _textareaTextarea = __webpack_require__(32);

	var _textareaTextarea2 = _interopRequireDefault(_textareaTextarea);

	exports['default'] = [_checkboxCheckbox2['default'], _chipsChips2['default'], _datepickerDatepicker2['default'], _inputInput2['default'], _radioRadio2['default'], _selectSelect2['default'], _sliderSlider2['default'], _switchSwitch2['default'], _textareaTextarea2['default']];
	module.exports = exports['default'];

/***/ },
/* 16 */
/***/ function(module, exports, __webpack_require__) {

	'use strict';

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

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

	var _checkboxHtml = __webpack_require__(17);

	var _checkboxHtml2 = _interopRequireDefault(_checkboxHtml);

	exports['default'] = function (formlyConfigProvider) {
	  formlyConfigProvider.setType({
	    template: _checkboxHtml2['default'],
	    name: 'checkbox',
	    defaultOptions: {
	      ngModelAttrs: {
	        disabled: {
	          bound: 'ng-disabled'
	        }
	      }
	    },
	    apiCheck: function apiCheck(check) {
	      return {
	        templateOptions: {
	          disabled: check.bool.optional
	        }
	      };
	    }
	  });
	};

	module.exports = exports['default'];

/***/ },
/* 17 */
/***/ function(module, exports) {

	module.exports = "
\r\n    <md-checkbox ng-model=\"model[options.key]\">\r\n        {{to.label}}\r\n    </md-checkbox>\r\n
";

/***/ },
/* 18 */
/***/ function(module, exports, __webpack_require__) {

	'use strict';

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

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

	var _chipsHtml = __webpack_require__(19);

	var _chipsHtml2 = _interopRequireDefault(_chipsHtml);

	exports['default'] = function (formlyConfigProvider) {
	  formlyConfigProvider.setType({
	    template: _chipsHtml2['default'],
	    name: 'chips',
	    wrapper: ['label'],
	    defaultOptions: {
	      defaultValue: [],
	      ngModelAttrs: {
	        placeholder: {
	          attribute: 'placeholder'
	        },
	        secondaryPlaceholder: {
	          attribute: 'secondary-placeholder'
	        },
	        deleteButtonLabel: {
	          attribute: 'delete-button-label'
	        },
	        deleteHint: {
	          attribute: 'delete-hint'
	        },
	        onAdd: {
	          bound: 'md-on-add'
	        },
	        onRemove: {
	          bound: 'md-on-remove'
	        },
	        onSelect: {
	          bound: 'md-on-select'
	        }
	      }
	    },
	    apiCheck: function apiCheck(check) {
	      return {
	        templateOptions: {
	          placeholder: check.string.optional,
	          secondaryPlaceholder: check.string.optional,
	          deleteButtonLabel: check.string.optional,
	          deleteHint: check.string.optional,
	          onAdd: check.func.optional,
	          onRemove: check.func.optional,
	          onSelect: check.func.optional
	        }
	      };
	    }
	  });
	};

	module.exports = exports['default'];

/***/ },
/* 19 */
/***/ function(module, exports) {

	module.exports = "<md-chips ng-model=\"model[options.key]\" readonly=\"to.disabled\"></md-chips>\r\n";

/***/ },
/* 20 */
/***/ function(module, exports, __webpack_require__) {

	'use strict';

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

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

	var _datepickerHtml = __webpack_require__(21);

	var _datepickerHtml2 = _interopRequireDefault(_datepickerHtml);

	exports['default'] = function (formlyConfigProvider) {
	  formlyConfigProvider.setType({
	    template: _datepickerHtml2['default'],
	    name: 'datepicker',
	    wrapper: ['label', 'messages'],
	    defaultOptions: {
	      templateOptions: {
	        disabled: false
	      },
	      ngModelAttrs: {
	        disabled: {
	          bound: 'ng-disabled'
	        },
	        placeholder: {
	          attribute: 'md-placeholder'
	        },
	        minDate: {
	          bound: 'md-min-date'
	        },
	        maxDate: {
	          bound: 'md-max-date'
	        },
	        filterDate: {
	          bound: 'md-date-filter'
	        }
	      }
	    },
	    apiCheck: function apiCheck(check) {
	      return {
	        templateOptions: {
	          disabled: check.bool.optional,
	          placeholder: check.string.optional,
	          minDate: check.instanceOf(Date).optional,
	          maxDate: check.instanceOf(Date).optional,
	          filterDate: check.func.optional
	        }
	      };
	    }
	  });
	};

	module.exports = exports['default'];

/***/ },
/* 21 */
/***/ function(module, exports) {

	module.exports = "
\r\n    <md-datepicker ng-model=\"model[options.key]\"></md-datepicker>\r\n
";

/***/ },
/* 22 */
/***/ function(module, exports, __webpack_require__) {

	'use strict';

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

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

	var _inputHtml = __webpack_require__(23);

	var _inputHtml2 = _interopRequireDefault(_inputHtml);

	var _helpers = __webpack_require__(4);

	exports['default'] = function (formlyConfigProvider) {
	  formlyConfigProvider.setType({
	    template: _inputHtml2['default'],
	    name: 'input',
	    wrapper: ['label', 'messages', 'inputContainer'],
	    defaultOptions: {
	      templateOptions: {
	        type: 'text',
	        disabled: false
	      },
	      ngModelAttrs: {
	        mdMaxlength: {
	          bound: 'md-maxlength'
	        },
	        disabled: {
	          bound: 'ng-disabled'
	        },
	        pattern: {
	          bound: 'ng-pattern'
	        }
	      }
	    },
	    apiCheck: function apiCheck(check) {
	      return {
	        templateOptions: {
	          disabled: check.bool.optional,
	          type: check.string,
	          step: check.number.optional,
	          pattern: check.oneOfType([check.string, check.instanceOf(RegExp)]).optional
	        }
	      };
	    }
	  });

	  // add only step attribute because min and max are both built-in
	  formlyConfigProvider.extras.fieldTransform.push(function (fields) {
	    return (0, _helpers.ngModelAttrsTransformer)(fields, function (field) {
	      return field.type === 'input' && field.templateOptions.type === 'number';
	    }, 'step', {
	      attribute: 'step'
	    });
	  });
	};

	module.exports = exports['default'];

/***/ },
/* 23 */
/***/ function(module, exports) {

	module.exports = "<input ng-model=\"model[options.key]\">";

/***/ },
/* 24 */
/***/ function(module, exports, __webpack_require__) {

	'use strict';

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

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

	var _radioHtml = __webpack_require__(25);

	var _radioHtml2 = _interopRequireDefault(_radioHtml);

	exports['default'] = function (formlyConfigProvider) {
	  formlyConfigProvider.setType({
	    template: _radioHtml2['default'],
	    name: 'radio',
	    wrapper: ['label'],
	    apiCheck: function apiCheck(check) {
	      return {
	        templateOptions: {
	          options: check.arrayOf(check.object),
	          labelProp: check.string.optional,
	          valueProp: check.string.optional
	        }
	      };
	    }
	  });
	};

	module.exports = exports['default'];

/***/ },
/* 25 */
/***/ function(module, exports) {

	module.exports = "<md-radio-group ng-model=\"model[options.key]\">\r\n    <md-radio-button\r\n            ng-repeat=\"option in to.options\"\r\n            ng-disabled=\"to.disabled\"\r\n            ng-value=\"option[to.valueProp || 'value']\">\r\n            {{option[to.labelProp || 'name']}}\r\n    </md-radio-button>\r\n</md-radio-group>\r\n";

/***/ },
/* 26 */
/***/ function(module, exports, __webpack_require__) {

	'use strict';

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

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

	var _selectHtml = __webpack_require__(27);

	var _selectHtml2 = _interopRequireDefault(_selectHtml);

	exports['default'] = function (formlyConfigProvider) {
	  formlyConfigProvider.setType({
	    template: _selectHtml2['default'],
	    name: 'select',
	    wrapper: ['label', 'messages', 'inputContainer'],
	    defaultOptions: {
	      templateOptions: {
	        disabled: false
	      },
	      ngModelAttrs: {
	        disabled: {
	          bound: 'ng-disabled'
	        },
	        multiple: {
	          bound: 'multiple'
	        },
	        onClose: {
	          bound: 'md-on-close'
	        },
	        onOpen: {
	          bound: 'md-on-open'
	        }
	      }
	    },
	    apiCheck: function apiCheck(check) {
	      return {
	        templateOptions: {
	          disabled: check.bool.optional,
	          options: check.arrayOf(check.object),
	          multiple: check.bool.optional,
	          labelProp: check.string.optional,
	          valueProp: check.string.optional,
	          onClose: check.func.optional,
	          onOpen: check.func.optional
	        }
	      };
	    }
	  });
	};

	module.exports = exports['default'];

/***/ },
/* 27 */
/***/ function(module, exports) {

	module.exports = "<md-select ng-model=\"model[options.key]\">\r\n    <md-option ng-repeat=\"option in to.options\" ng-value=\"option[to.valueProp || 'value']\">\r\n        {{ option[to.labelProp || 'name'] }}\r\n    </md-option>\r\n</md-select>";

/***/ },
/* 28 */
/***/ function(module, exports, __webpack_require__) {

	'use strict';

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

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

	var _sliderHtml = __webpack_require__(29);

	var _sliderHtml2 = _interopRequireDefault(_sliderHtml);

	exports['default'] = function (formlyConfigProvider) {
	  formlyConfigProvider.setType({
	    template: _sliderHtml2['default'],
	    name: 'slider',
	    wrapper: ['label'],
	    defaultOptions: {
	      templateOptions: {
	        disabled: false
	      },
	      ngModelAttrs: {
	        disabled: {
	          bound: 'ng-disabled'
	        },
	        min: {
	          attribute: 'min'
	        },
	        max: {
	          attribute: 'max'
	        },
	        step: {
	          attribute: 'step'
	        },
	        discrete: {
	          bound: 'md-discrete'
	        }
	      }
	    },
	    apiCheck: function apiCheck(check) {
	      return {
	        templateOptions: {
	          disabled: check.bool.optional,
	          min: check.number.optional,
	          max: check.number.optional,
	          step: check.number.optional,
	          discrete: check.bool.optional
	        }
	      };
	    }
	  });
	};

	module.exports = exports['default'];

/***/ },
/* 29 */
/***/ function(module, exports) {

	module.exports = "<md-slider ng-model=\"model[options.key]\"></md-slider>";

/***/ },
/* 30 */
/***/ function(module, exports, __webpack_require__) {

	'use strict';

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

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

	var _switchHtml = __webpack_require__(31);

	var _switchHtml2 = _interopRequireDefault(_switchHtml);

	exports['default'] = function (formlyConfigProvider) {
	  formlyConfigProvider.setType({
	    template: _switchHtml2['default'],
	    name: 'switch',
	    defaultOptions: {
	      templateOptions: {
	        disabled: false
	      },
	      ngModelAttrs: {
	        disabled: {
	          bound: 'ng-disabled'
	        }
	      }
	    },
	    apiCheck: function apiCheck(check) {
	      return {
	        templateOptions: {
	          disabled: check.bool.optional
	        }
	      };
	    }
	  });
	};

	module.exports = exports['default'];

/***/ },
/* 31 */
/***/ function(module, exports) {

	module.exports = "<md-switch ng-model=\"model[options.key]\">\r\n    {{to.label}}\r\n</md-switch>";

/***/ },
/* 32 */
/***/ function(module, exports, __webpack_require__) {

	'use strict';

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

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

	var _textareaHtml = __webpack_require__(33);

	var _textareaHtml2 = _interopRequireDefault(_textareaHtml);

	var _helpers = __webpack_require__(4);

	exports['default'] = function (formlyConfigProvider) {
	  formlyConfigProvider.setType({
	    template: _textareaHtml2['default'],
	    name: 'textarea',
	    wrapper: ['label', 'messages', 'inputContainer'],
	    defaultOptions: {
	      ngModelAttrs: {
	        disabled: {
	          bound: 'ng-disabled'
	        },
	        rows: {
	          attribute: 'rows'
	        },
	        cols: {
	          attribute: 'cols'
	        }
	      },
	      templateOptions: {
	        grow: true
	      }
	    },
	    apiCheck: function apiCheck(check) {
	      return {
	        templateOptions: {
	          disabled: check.bool.optional,
	          rows: check.number.optional,
	          cols: check.number.optional,
	          grow: check.bool.optional
	        }
	      };
	    }
	  });

	  formlyConfigProvider.extras.fieldTransform.push(function (fields) {
	    return (0, _helpers.ngModelAttrsTransformer)(fields, function (field) {
	      return field.type === 'textarea' && field.templateOptions.grow === false;
	    }, 'grow', {
	      attribute: 'md-no-autogrow'
	    });
	  });
	};

	module.exports = exports['default'];

/***/ },
/* 33 */
/***/ function(module, exports) {

	module.exports = "<textarea ng-model=\"model[options.key]\"></textarea>";

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


text:
var PubSub = require('../models/pubsub');

module.exports = function(app, passport) {
  //authenticate with facebook
  app.get('/facebook', passport.authenticate('facebook', { scope : 'email' }));
  app.get('/facebook/callback', passport.authenticate('facebook', {
    successRedirect : '/#/purgatory',
    failureRedirect : '/#/login'
  }));

  //authenticate with local strategy
  app.post('/login', passport.authenticate('local-login'), function(req, res){
        res.json(req.user);
      });
  app.post('/signup', passport.authenticate('local-signup'), function(req,res){
        res.json(req.user);
      });

  //connect jawbone
  app.get('/jawbone', passport.authorize('jawbone', { scope : ['basic_read','extended_read','friends_read','move_read','sleep_read','meal_read'] }));
  app.get('/jawbone/callback', passport.authorize('jawbone'), function(req, res){
    res.redirect('/#/purgatory');
  });

  app.post('/jawbone/pubsub', function(req,res){
    var info = req.body;

    var pubSub = new PubSub();
    pubSub.data = req.body;
    pubSub.save(function(err) {
              if (err)
                  throw err;
              });

    console.log('body', info);
    console.log('url', req.url);
    res.send('success');
  });
};

// function hasGoal (req, res) {
//   var user = req.userData;
//   if (user.goals.length)
//     goalHandler(req, res);
//   makeGoalHandler(req, res);
// }

redpajama_set_name: RedPajamaGithub


text:
#ifndef StorageTrackerClient_h
#define StorageTrackerClient_h

#include <wtf/Forward.h>

namespace WebCore {

class StorageTrackerClient {
public:
    virtual ~StorageTrackerClient() { }
    virtual void dispatchDidModifyOrigin(const String& originIdentifier) = 0;
};

} // namespace WebCore

#endif // StorageTrackerClient_h


text:
/**
 * Created by Administrator on 2017/3/20.
 */
import lazyLoading from './lazyLoading'
export default {
  meta: {
    label: 'Dashboard',
    icon: 'fa-rss-square',
    expanded: false
  },

  children: [
    {
      name: 'ZUI Dashboard',
      path: '/dashboard',
      meta: {
        link: 'dashboard/dashboard.vue'
      },
      component: lazyLoading('dashboard/dashboard')
    }
  ]
}


text:
import sys, os, itertools, re

################################################################
## directory with export directory from pipeline
## This should be a directory in the build directory - you can
## link from here to a directory outside the build tree, though.
exportdir = os.path.abspath('export')

datadir = os.path.abspath("..")

################################################################
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
sys.path = [os.path.abspath('.'), os.path.abspath('python')]  + sys.path

sphinxreport_cachedir=os.path.abspath("_cache")

# add warnings into the document
sphinxreport_show_errors = True

# database backend. Possible values are mysql, psql and sqlite
sphinxreport_sql_backend="sqlite:///%s/csvdb" % os.path.abspath("..")

sphinxreport_urls=("data", "rst", "code")

# http port to use for serve.py
http_port=8080

# derived sets. This is a dictionary associating
# a slice with a track
trackers_derived_slices = {}

# default slices to plot
trackers_default_slices = ["all"]

# images to plot
# Note that adding pdfs slows down the pipeline for complicated
# plots and should only be created as a last step and when
# latex is to be generated
renderer_images = None

# static images to create for each plot
# a tuple of (id, format, dpi).
sphinxreport_images=( ( "hires", "hires.png", 200),
                      ( "eps", "eps", 50 ), )

# -- General configuration -----------------------------------------------------

# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.doctest', 'sphinx.ext.coverage',
              'sphinx.ext.pngmath', 'sphinx.ext.ifconfig',
              'CGATReport.only_directives',
              'CGATReport.report_directive', 'CGATReport.inheritance_diagram',
              'CGATReport.errors_directive',
              'CGATReport.roles' ]

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

# The suffix of source filenames.
source_suffix = '.rst'

# The encoding of source files.
#source_encoding = 'utf-8'

# The master toctree document.
master_doc = 'contents'

# General information about the project.
project = 'RNASeq pipeline'
copyright = '2011, Andreas Heger'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = '1.0'
# The full version, including alpha/beta/rc tags.
release = '1'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#language = None

# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
#today = ''
# Else, today_fmt is used as the format for a strftime call.
#today_fmt = '%B %d, %Y'

# List of documents that shouldn't be included in the build.
#unused_docs = []

# List of directories, relative to source directory, that shouldn't be searched
# for source files.
exclude_trees = ['_build']

# The reST default role (used for this markup: `text`) to use for all documents.
#default_role = None

# If true, '()' will be appended to :func: etc. cross-reference text.
#add_function_parentheses = True

# If true, the current module name will be prepended to all description
# unit titles (such as .. function::).
#add_module_names = True

# If true, sectionauthor and moduleauthor directives will be shown in the
# output. They are ignored by default.
#show_authors = False

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'

# A list of ignored prefixes for module index sorting.
#modindex_common_prefix = []

# -- Options for HTML output ---------------------------------------------------

# The theme to use for HTML and HTML Help pages.  Major themes that come with
# Sphinx are currently 'default' and 'sphinxdoc'.
html_theme = 'default'

# Theme options are theme-specific and customize the look and feel of a theme
# further.  For a list of options available for each theme, see the
# documentation
#html_theme_options = {}

# Add any paths that contain custom themes here, relative to this directory.
html_theme_path = ["."]

# The name for this set of Sphinx documents.  If None, it defaults to
# "<project> v<release> documentation".
#html_title = None

# A shorter title for the navigation bar.  Default is the same as html_title.
#html_short_title = None

# The name of an image file (relative to this directory) to place at the top
# of the sidebar.
#html_logo = None

# The name of an image file (within the static path) to use as favicon of the
# docs.  This file should be a Windows icon file (.ico) being 16x16 or 32x32
# pixels large.
#html_favicon = None

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']

# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format.
#html_last_updated_fmt = '%b %d, %Y'

# If true, SmartyPants will be used to convert quotes and dashes to
# typographically correct entities.
#html_use_smartypants = True

# Custom sidebar templates, maps document names to template names.
#html_sidebars = {}

# Additional templates that should be rendered to pages, maps page names to
# template names.
# html_additional_pages = {}

# If false, no module index is generated.
#html_use_modindex = True

# If false, no index is generated.
#html_use_index = True

# If true, the index is split into individual pages for each letter.
#html_split_index = False

# If true, links to the reST sources are added to the pages.
#html_show_sourcelink = True

# If true, an OpenSearch description file will be output, and all pages will
# contain a <link> tag referring to it.  The value of this option must be the
# base URL from which the finished HTML is served.
#html_use_opensearch = ''

# If nonempty, this is the file name suffix for HTML files (e.g. ".xhtml").
#html_file_suffix = ''

# Output file base name for HTML help builder.
htmlhelp_basename = 'Testdoc'

# -- Options for LaTeX output --------------------------------------------------

# The paper size ('letter' or 'a4').
#latex_paper_size = 'letter'

# The font size ('10pt', '11pt' or '12pt').
#latex_font_size = '10pt'

# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, documentclass [howto/manual]).
latex_documents = [
  ('contents', 'Test.tex', r'Test Documentation',
   r'Andreas Heger', 'manual'),
]

# The name of an image file (relative to this directory) to place at the top of
# the title page.
#latex_logo = None

# For "manual" documents, if this is true, then toplevel headings are parts,
# not chapters.
#latex_use_parts = False

# Additional stuff for the LaTeX preamble.
latex_preamble = """
   \\usepackage{amsmath}
   \\usepackage{amsfonts}
   \\usepackage{amssymb}
   \\usepackage{txfonts}
"""

# Documents to append as an appendix to all manuals.
#latex_appendices = []

# If false, no module index is generated.
#latex_use_modindex = True


text:
<?xml version="1.0"?>
<!--

-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
    <module name="Magento_BundleSampleData" setup_version="2.0.0">
        <sequence>
            <module name="Magento_Catalog"/>
            <module name="Magento_Bundle"/>
            <module name="Magento_SampleData"/>
            <module name="Magento_CatalogSampleData"/>
        </sequence>
    </module>
</config>


text:
ACCEPTED

#### According to
International Plant Names Index

#### Published in
Guihaia 11:6. 1991

#### Original name
null

### Remarks
null


text:
goog.require('goog.testing.asserts');
goog.require('goog.testing.jsunit');

function testAddition_realityHasntFallenApart() {
  assertEquals(2, 1 + 1);
}


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

    <!-- Card -->
    <bool name="card_use_compat_padding">true</bool>

</resources>


text:
<?php
namespace Caffeinated\Modules\Console;

use Illuminate\Console\Command;
use Symfony\Component\Console\Input\InputArgument;

class ModuleDisableCommand extends Command
{
	/**
	 * @var string $name The console command name.
	 */
	protected $name = 'module:disable';

	/**
	 * @var string $description The console command description.
	 */
	protected $description = 'Disable a module';

	/**
	 * Create a new command instance.
	 */
	public function __construct()
	{
		parent::__construct();
	}

	/**
	 * Execute the console command.
	 *
	 * @return mixed
	 */
	public function fire()
	{
		$module = $this->argument('module');

		if ($this->laravel['modules']->isEnabled($this->argument('module'))) {
			$this->laravel['modules']->disable($module);

			$this->info("Module [{$module}] was disabled successfully.");
		} else {
			$this->comment("Module [{$module}] is already disabled.");
		}
	}

	/**
	 * Get the console command arguments.
	 *
	 * @return array
	 */
	protected function getArguments()
	{
		return [
			['module', InputArgument::REQUIRED, 'Module slug.']
		];
	}
}


text:
google.load('visualization', '1', { packages : ['controls'] } );

function drawChart(arrayIN) {

	// create data
	var dataArr = [];
	for(var i = 0; i < arrayIN[0].length-1; i++)
	{
		dataArr[i] = new google.visualization.DataTable();
	}

	// convert back to date
	for(var i = 1; i < arrayIN.length; i++)
	{
		arrayIN[i][0] = new Date(arrayIN[i][0])
	}

	// add date to all graphs
	for(var i = 0; i < arrayIN[0].length-1; i++)
	{
		dataArr[i].addColumn('datetime', 'Time');
	}

	// create individual graph legends and add data
	for(var i = 0; i < arrayIN[0].length-1; i++)
	{
		dataArr[i].addColumn('number', arrayIN[0][i+1]);

		for(var j = 1; j < arrayIN.length; j++)
		{
			dataArr[i].addRow([arrayIN[j][0],arrayIN[j][i+1]])
		}
	}

	// add all charts arrayIN[0].length-1
	for(var i = 0; i < arrayIN[0].length-1; i++) {

		var dash_container = document.getElementById('dashboard' + i),
		myDashboard = new google.visualization.Dashboard(dash_container);

		var myDateSlider = new google.visualization.ControlWrapper({
			'controlType': 'ChartRangeFilter',
			'containerId': 'control' + i,
			'options': {
				'filterColumnLabel': 'Time'
			}
		});

		var chart = new google.visualization.ChartWrapper({
			'chartType': 'LineChart',
			'containerId': 'chart' + i,
		});

		myDashboard.bind(myDateSlider, chart)

		//var chart = new google.charts.Line(document.getElementById('chart' + i));
		myDashboard.draw(dataArr[i]);
	}
}


text:
using ContainerExpressions.Containers;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;

namespace Tests.ContainerExpressions.Containers
{
    [TestClass]
    public class EitherTests
    {
        [TestMethod]
        [ExpectedException(typeof(InvalidOperationException))]
        public void DefaultConstructor_ThrowsError()
        {
            var either = new Either<Guid, int>();

            var result = either.Match(x => x.ToString(), x => x.ToString());
        }

        [TestMethod]
        public void CanAssignToDifferentVars()
        {
            var number = 42;
            Either<Guid, int> either1 = number;
            Either<Guid, int> either2 = either1;

            var result = either2.Match(x => x.ToString(), x => x.ToString());

            Assert.AreEqual(number, int.Parse(result));
        }

        #region T1

        [TestMethod]
        public void T1ValueSet_T1ValueRead()
        {
            var guid = Guid.NewGuid();
            var either = new Either<Guid, int>(guid);

            var result = either.Match(x => x.ToString(), x => x.ToString());

            Assert.AreEqual(guid, Guid.Parse(result));
        }

        [TestMethod]
        public void T1ValueSet_T1ValueRead_WithImplicitOperator()
        {
            var guid = Guid.NewGuid();
            Either<Guid, int> either = guid;

            var result = either.Match(x => x.ToString(), x => x.ToString());

            Assert.AreEqual(guid, Guid.Parse(result));
        }

        #endregion

        #region T2

        [TestMethod]
        public void T2ValueSet_T2ValueRead()
        {
            var number = 42;
            var either = new Either<Guid, int>(number);

            var result = either.Match(x => x.ToString(), x => x.ToString());

            Assert.AreEqual(number, int.Parse(result));
        }

        [TestMethod]
        public void T2ValueSet_T2ValueRead_WithImplicitOperator()
        {
            var number = 42;
            Either<Guid, int> either = number;

            var result = either.Match(x => x.ToString(), x => x.ToString());

            Assert.AreEqual(number, int.Parse(result));
        }

        #endregion
    }
}


text:
<?php

namespace Witebs\UserBundle\Form\Type;

use Symfony\Component\Form\FormBuilderInterface;
use FOS\UserBundle\Form\Type\ProfileFormType as BaseType;
use Witebs\UserBundle\Entity\UserActiviteType;
use Witebs\UserBundle\Form\UserActiviteType\ActiviteTypeUserType;

//use Witebs\UserBundle\Form\UserActiviteTypeType\ActiviteTypeUserType;

class EditingFormType extends BaseType {

    public function buildForm(FormBuilderInterface $builder, array $options) {
        parent::buildForm($builder, $options);
        $builder->add('prenom', 'text', array('label' => 'Prénom'));
        $builder->add('nom', 'text', array('label' => 'Nom de famille'));
        $builder->add('adresse', 'textarea', array('required' => false,));
        $builder->add('dateNaissance', 'date', array('label' => 'Date de naissance', 'required' => false, 'empty_value' => 'Choix', 'years' => range(\date('Y'), \date('Y') - 100)));
        $builder->add('telFixe', 'text', array('label' => 'Téléphone fixe', 'required' => false,));
        $builder->add('telMobile', 'text', array('label' => 'Mobile', 'required' => false,));
        $builder->add('userActiviteTypes', 'collection', array(
            'type' => new ActiviteTypeUserType(),
            'allow_add' => true,
            'allow_delete' => true,
            'by_reference' => false,
            'label' => "Activité d'intérret",
            'required' => true,
            //'options' => array('data_class' => 'Witebs\UserBundle\Entity\UserActiviteType'),
        ));

        $builder->add('submit', 'submit', array('label' => 'Valider', 'attr' => array('class' => 'btn btn-primary')));
    }

    public function getName() {
        return 'witebs_user_editing';
    }

}

?>


text:
namespace lua = ebuilder::lua;

namespace erespacker
{

void MeshToLuaString::Pack(const PackMesh* mesh, ebuilder::CodeGenerator& gen)
{
	gen.line("{");
	gen.tab();

	lua::comments(gen, "file: " + mesh->GetFilepath());

	lua::assign_with_end(gen, "type", "\"mesh\"");
	lua::assign_with_end(gen, "id", ee::StringHelper::ToString(mesh->GetSprID()));
	if (!mesh->export_name.empty()) {
		lua::assign_with_end(gen, "export", "\"" + mesh->export_name + "\"");
	}

	lua::connect(gen, 1,
		lua::assign("base_id", mesh->base->GetSprID()));

	PackVertices(mesh->tri_texcoords, gen, "texcoords", false, 0xffff);
	PackVertices(mesh->tri_vertices, gen, "vertices");

	gen.detab();
	gen.line("},");
}

}


text:
<?php
require_once('gui_index.php');

class PageActions extends DekiFormatter
{
	protected $contentType = 'application/json';
	protected $requireXmlHttpRequest = true;

	private $Request;

	public function format()
	{
		$this->Request = DekiRequest::getInstance();

		$action = $this->Request->getVal( 'action' );

		switch ( $action )
		{
			case 'setrestrictions':
				$success = $this->setPageRestrictions();
				$result = array(
					'success' => $success
				);
				break;

			case 'delete':
				$result = $this->deletePage();
				break;

			case 'setalerts':
				$result = $this->setPageAlerts();
				break;

			default:
				header('HTTP/1.0 404 Not Found');
				exit(' '); // flush the headers
		}

		echo json_encode($result);
	}

	private function setPageRestrictions()
	{
		global $wgDekiPlug, $wgUser, $wgDefaultRestrictRole;

		$pageId = $this->Request->getVal( 'titleid' );
		$restrictType = $this->Request->getVal( 'protecttype' );
		$listIds = $this->Request->getVal( 'userids' );
		$cascade = $this->Request->getVal( 'cascade' );

		$listIds = empty($listIds) ? array(): explode(',', $listIds);

		$users = array();
		$groups = array();

		foreach ($listIds as $id)
		{
			if (strncmp($id, 'u', 1) == 0)
			{
				$users[] = substr($id, 1);
			}
			if (strncmp($id, 'g', 1) == 0)
			{
				$groups[] = substr($id, 1);
			}
		}

		//can't lock yourself out of the page!
		if (empty($users) && empty($groups))
		{
			$users[] = $wgUser->getId();
		}

		$grants = array();
		$groups = array_unique($groups);
		$users = array_unique($users);

		foreach ($users as $userId)
		{
			$grants[] = array('permissions' => array('role' => $wgDefaultRestrictRole), 'user' => array('@id' => $userId));
		}
		foreach ($groups as $groupId)
		{
			$grants[] = array('permissions' => array('role' => $wgDefaultRestrictRole), 'group' => array('@id' => $groupId));
		}

		//generate the XML document to PUT for grant list
		$xml = array(
			'security' => array(
				'permissions.page' => array('restriction' => $restrictType),
				'grants' => array('@restriction' => $restrictType, array('grant' => $grants))
			)
		);

		$Plug = $wgDekiPlug->At('pages', $pageId, 'security');

		if ($cascade == 'true')
		{
			$Plug = $Plug->With('cascade', 'delta');
		}

		$Plug = $Plug->Put($xml);

		if (MTMessage::HandleFromDream($Plug))
		{
			wfMessagePush('general', wfMsg('Article.Common.permissions-updated'), 'success');
		}

		return true;
	}

	private function deletePage()
	{
		$titleId = $this->Request->getVal( 'titleid' );
		$includeChildren = $this->Request->getBool( 'cascade' );

		$title = Title::newFromID($titleId);

	    if (!$title)
	    {
	        return array(
	        	'success' => false,
	        	'message' => 'Topic already deleted'
	        );
	    }

	    $article = new Article($title);

	    if (!$article->userCanDelete())
	    {
	        return array(
	        	'success' => false,
	        	'message' => 'Topic cannot be deleted'
	        );
	    }

	    $error = $article->doDelete($redirectTitle, $includeChildren);

	    return array(
	    	'success' => true,
	    	'redirectTo' => $redirectTitle
	    );
	}

	private function setPageAlerts()
	{
		$pageId = $this->Request->getVal('pageId');
		// status should be an integer status from DekiPageAlert
		$status = $this->Request->getInt('status');

		$Title = Title::newFromId($pageId);
		if (is_null($Title))
		{
			// invalid page id specified
			return array(
				'success' => false,
				'message' => 'Invalid page specified'
			);
		}

		$Article = new Article($Title);
		$parentIds = $Article->getParentIds();

		$Alert = new DekiPageAlert($pageId, $parentIds);
		$currentStatus = $Alert->getStatus();

		if ($currentStatus == DekiPageAlert::STATUS_PARENT)
		{
			return array(
				'success' => false,
				'message' => 'A parent page is already subscribed'
			);
		}
		else if ($currentStatus == $status)
		{
			// no change
			$isSubscribed = $Alert->isSubscribed();
			return array(
				'success' => true,
				'subscribed' => $isSubscribed,
				'message' => $isSubscribed ? wfMsg('Page.PageAlerts.status.on') : wfMsg('Page.PageAlerts.status.off')
			);
		}
		else
		{
			// perform the status change
			$Result = $Alert->setStatus($status);
			if ($Result->isSuccess())
			{
				$isSubscribed = $Alert->isSubscribed();
				return array(
					'success' => true,
					'subscribed' => $isSubscribed,
					'message' => $isSubscribed ? wfMsg('Page.PageAlerts.status.on') : wfMsg('Page.PageAlerts.status.off')
				);
			}
			else
			{
				// some error occurred
				$isSubscribed = $Alert->isSubscribed();
				return array(
					'success' => false,
					'subscribed' => false,
					'message' => $Result->getError()
				);
			}

		}
	}
}

new PageActions();


text:
using OpenSage.Data.Ini;

namespace OpenSage.Lod
{
    public sealed class LodPreset : BaseAsset
    {
        internal static LodPreset Parse(IniParser parser)
        {
            var result = new LodPreset
            {
                Level = parser.ParseEnum<LodType>(),
                CpuType = parser.ParseEnum<CpuType>(),
                MHz = parser.ParseInteger(),
                GpuType = parser.ParseEnum<GpuType>(),
                GpuMemory = parser.ParseInteger()
            };

            result.SetNameAndInstanceId("LODPreset", result.Level.ToString());

            if (parser.SageGame >= SageGame.Bfme)
            {
                result.Unknown = parser.ParseInteger();
                result.ResolutionWidth = parser.ParseInteger();
                result.ResolutionHeight = parser.ParseInteger();
            }
            return result;
        }

        public LodType Level { get; private set; }
        public CpuType CpuType { get; private set; }
        public int MHz { get; private set; }
        public GpuType GpuType { get; private set; }
        public int GpuMemory { get; private set; }

        [AddedIn(SageGame.Bfme)]
        public int Unknown {get; private set; }

        [AddedIn(SageGame.Bfme)]
        public int ResolutionWidth { get; private set; }

        [AddedIn(SageGame.Bfme)]
        public int ResolutionHeight { get; private set; }
    }

    public enum GpuType
    {
        [IniEnum("V2")]
        V2,

        [IniEnum("V3")]
        V3,

        [IniEnum("V4")]
        V4,

        [IniEnum("V5")]
        V5,

        [IniEnum("TNT")]
        TNT,

        [IniEnum("TNT2")]
        TNT2,

        [IniEnum("GF2")]
        GF2,

        [IniEnum("R100")]
        R100,

        [IniEnum("PS11")]
        PS11,

        [IniEnum("GF3")]
        GF3,

        [IniEnum("GF4")]
        GF4,

        [IniEnum("PS14")]
        PS14,

        [IniEnum("R200")]
        R200,

        [IniEnum("PS20")]
        PS20,

        [IniEnum("R300")]
        R300,

        [IniEnum("RADEON_9800"), AddedIn(SageGame.Bfme2)]
        Radeon9800,

        [IniEnum("_MINIMUM_FOR_LOW_LOD"), AddedIn(SageGame.Bfme2)]
        MinimumForLowLod,

        [IniEnum("_MINIMUM_FOR_MEDIUM_LOD"), AddedIn(SageGame.Bfme2)]
        MinimumForMediumLod,

        [IniEnum("_MINIMUM_FOR_HIGH_LOD"), AddedIn(SageGame.Bfme2)]
        MinimumForHighLod,

        [IniEnum("_MINIMUM_FOR_ULTRA_HIGH_LOD"), AddedIn(SageGame.Bfme2)]
        MinimumForUltraHighLod,
    }
}


text:
package net.shift
package common

object Path {

  private def string2Path(s: String): Path = {
    s.split(":").toList match {
      case parts :: Nil => new PathObj(None, pathToList(parts))
      case scheme :: parts :: Nil => pathToList(parts) match {
        case "" :: rest => new PathObj(Some(scheme), pathToList(parts))
        case _          => EmptyPath
      }
      case _ => EmptyPath
    }
  }

  private def pathToList(path: String) = {
    val l = (path split "/").toList
    if (path.endsWith("/"))
      l ::: List("")
    else
      l
  }

  def apply(p: String): Path = if (p == null || p.isEmpty) EmptyPath else string2Path(p)

  def apply(l: Traversable[String]): Path = if (l == null || l.isEmpty) EmptyPath else new PathObj(None, l.toList)

  def unapply(p: Path): Option[(Option[String], List[String])] = Some((p.scheme, p.parts))

}

trait Path {
  def scheme: Option[String]
  def parts: List[String]

  def startsWith(p: Path) = if (this.scheme != p.scheme) false else parts.startsWith(p.parts, 0)

  def headingSlash = parts match {
    case Nil        => false
    case "" :: rest => true
    case l          => false
  }

  def trailingSlash = parts match {
    case Nil => false
    case l   => l.last == ""
  }

  def subPath(start: Int): Path = {
    if (start > 0 && start < parts.size)
      new PathObj(None, parts.slice(start, parts.size))
    else EmptyPath
  }

  def subPath(start: Int, end: Int): Path = {
    if (start > 0 && start < parts.size && end > start && end <= parts.size)
      new PathObj(None, parts.slice(start, end))
    else EmptyPath
  }

  def head: Option[String] = parts match {
    case h :: _ => Some(h)
    case _      => None
  }

  def tail: Path = parts match {
    case Nil       => EmptyPath
    case h :: Nil  => EmptyPath
    case h :: rest => Path(rest)
  }

  def dropLast = Path(parts.dropRight(1))

  def +(part: String): Path

  def ++(other: Path): Path

}

case class PathObj(schemePart: Option[String], partsList: List[String]) extends Path {

  def scheme: Option[String] = schemePart
  def parts: List[String] = partsList

  def +(part: String) = new PathObj(scheme, parts ::: List(part))

  def ++(other: Path) = new PathObj(scheme, parts ::: other.parts)

  override def equals(o: Any) = o match {
    case o: Path => parts == o.parts
    case _       => false
  }

  override def toString = scheme match {
    case None      => parts.mkString("/")
    case Some(sch) => sch + ":" + parts.mkString("/")
  }
}

case object EmptyPath extends Path {
  def scheme = None
  def parts = Nil
  def +(part: String) = EmptyPath
  def ++(other: Path) = EmptyPath
}


text:
La facon la plus rapide d'installer Frappe sur un système Unix est d'utiliser frappe-bench. Lisez les instructions détaillées sur
comment installer et utiliser Frappe Bench.

> [https://github.com/frappe/bench](https://github.com/frappe/bench)

Avec Frappe Bench vous pourrez configurer et héberger de multiples applications et sites. Frappe Bench configure aussi un Virtualenv
Python donc vos applications seront isolées les unes des autres (et vous n'aurez pas de conflits avce d'autres environnements de developpement).

La commande `bench` sera installé et vous aidera aidera dans le développement et la gestion des vos applications.

{suite}


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>Bottle: Python Web Framework — Pythonista Documentation</title>
    <link rel="stylesheet" href="../../_static/pythonista.css" type="text/css" />
    <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />

    <link rel="search" type="application/opensearchdescription+xml"
          title="Search within Pythonista Documentation"
          href="../../_static/opensearch.xml"/>
    <link rel="author" title="About these documents" href="../../about.html" />
    <link rel="copyright" title="Copyright" href="../../copyright.html" />
    <link rel="top" title="Pythonista Documentation" href="../../index.html" />
    <link rel="shortcut icon" type="image/png" href="../../_static/py.png" />
    <meta name = "viewport" content = "width=device-width,initial-scale=1.0,user-scalable=no;">

Navigation

          index

          modules |

Pythonista Documentation »

Bottle: Python Web Framework¶

Bottle is a fast, simple and lightweight WSGI micro web-framework for Python. It is distributed as a single file module and has no dependencies other than the Python Standard Library.

Routing: Requests to function-call mapping with support for clean and  dynamic URLs.

Templates: Fast and pythonic built-in template engine and support for mako, jinja2 and cheetah templates.

Utilities: Convenient access to form data, file uploads, cookies, headers and other HTTP-related metadata.

Server: Built-in HTTP development server and support for paste, fapws3, bjoern, gae, cherrypy or any other WSGI capable HTTP server.

Example: “Hello World” in a bottle

from bottle import route, run, template

@route('/hello/<name>')
def index(name):
    return template('<b>Hello {{name}}</b>!', name=name)

run(host='localhost', port=8080)

Run this script or paste it into a Python console, then point your browser to http://localhost:8080/hello/world. That’s it.

Download and Install

Install the latest stable release with <tt class="docutils literal">pip install bottle</tt>, <tt class="docutils literal">easy_install -U bottle</tt> or download bottle.py (unstable) into your project directory. There are no hard [1] dependencies other than the Python standard library. Bottle runs with Python 2.5+ and 3.x.

User’s Guide¶

Start here if you want to learn how to use the bottle framework for web development. If you have any questions not answered here, feel free to ask the mailing list.

Tutorial

Installation

Quickstart: “Hello World”

Request Routing

Generating content

Request Data

Templates

Plugins

Development

Deployment

Glossary

Configuration (DRAFT)

Configuration Basics

Naming Convention

Loading Configuration from a File

Loading Configuration from a nested <tt class="docutils literal">dict</tt>

Listening to configuration changes

Filters and other Meta Data

API Documentation

Request Routing

Rule Syntax

Wildcard Filters

Legacy Syntax

Explicit routing configuration

SimpleTemplate Engine

<tt class="docutils literal">SimpleTemplate</tt> Syntax

Template Functions

<tt class="docutils literal">SimpleTemplate</tt> API

Deployment

Server Options

Switching the Server Backend

Good old CGI

API Reference

Module Contents

The <tt class="docutils literal">Bottle</tt> Class

The <tt class="docutils literal">Request</tt> Object

The <tt class="docutils literal">Response</tt> Object

Templates

List of available Plugins

Knowledge Base¶

A collection of articles, guides and HOWTOs.

Tutorial: Todo-List Application

Goals

Before We Start...

Using Bottle for a Web-Based ToDo List

Server Setup

Final Words

Complete Example Listing

Primer to Asynchronous Applications

The Limits of Synchronous WSGI

Greenlets to the rescue

Event Callbacks

Finally: WebSockets

Recipes

Keeping track of Sessions

Debugging with Style: Debugging Middleware

Unit-Testing Bottle Applications

Functional Testing Bottle Applications

Embedding other WSGI Apps

Ignore trailing slashes

Keep-alive requests

Gzip Compression in Bottle

Using the hooks plugin

Using Bottle with Heroku

Frequently Asked Questions

About Bottle

Common Problems and Pitfalls

Development and Contribution¶

These chapters are intended for developers interested in the bottle development and release workflow.

Release Notes and Changelog

Release 0.13

Release 0.12

Release 0.11

Release 0.10

Release 0.9

Release 0.8

Contributors

Developer Notes

Get involved

Get the Sources

Releases and Updates

Repository Structure

Submitting Patches

Building the Documentation

GIT Workflow Examples

Plugin Development Guide

How Plugins Work: The Basics

Plugin API

The Route Context

Runtime optimizations

Plugin Example: SQLitePlugin

License¶

Code and documentation are available according to the MIT License:

The Bottle logo however is NOT covered by that license. It is allowed to
use the logo as a link to the bottle homepage or in direct context with
the unmodified library. In all other cases please ask first.

Footnotes

<colgroup><col class="label" /><col /></colgroup>

[1]	Usage of the template or server adapter classes of course requires the corresponding template or server modules.

    © Copyright 1990-2016, Python Software Foundation.

    The Python Software Foundation is a non-profit corporation.
    Please donate.

    Last updated on Jun 10, 2016.
    Found a bug?

    Created using Sphinx 1.0.7.


text:
.. _bluetooth_mesh_cfg:

Runtime Configuration
#####################

The runtime configuration API allows applications to change their runtime
configuration directly, without going through the Configuration models.

Bluetooth mesh nodes should generally be configured by a central network
configurator device with a :ref:`bluetooth_mesh_models_cfg_cli` model. Each
mesh node instantiates a :ref:`bluetooth_mesh_models_cfg_srv` model that the
Configuration Client can communicate with to change the node configuration. In some
cases, the mesh node can't rely on the Configuration Client to detect or determine
local constraints, such as low battery power or changes in topology. For these
scenarios, this API can be used to change the configuration locally.

API reference
*************

.. doxygengroup:: bt_mesh_cfg


text:
package de.eightbitboy.hijacr.net;

import com.crashlytics.android.Crashlytics;

import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.select.Elements;

import java.io.IOException;

public class ComicFetchTask extends AbstractFetchTask {

	private String targetUrl;
	private String imageQuery;
	private String previousQuery;
	private String nextQuery;
	private String randomQuery;

	private String previousUrl;
	private String nextUrl;
	private String randomUrl;

	public ComicFetchTask(String targetUrl, String imageQuery, String previousQuery,
			String nextQuery, String randomQuery, FetchTaskListener listener) {
		this.targetUrl = targetUrl;
		this.imageQuery = imageQuery;
		this.previousQuery = previousQuery;
		this.nextQuery = nextQuery;
		this.randomQuery = randomQuery;
		this.listener = listener;
	}

	@Override
	protected String doInBackground(Void... voids) {
		try {
			Crashlytics.setString("targetUrl", targetUrl);
			Document page = Jsoup.connect(targetUrl).get();

			if (randomQuery != null) {
				Elements random = page.select(randomQuery);
				randomUrl = random.attr("abs:href");
				targetUrl = randomUrl;
			}

			Elements previous = page.select(previousQuery);
			previousUrl = previous.attr("abs:href");

			Elements next = page.select(nextQuery);
			nextUrl = next.attr("abs:href");

			Elements image = page.select(imageQuery);
			return image.attr("abs:src");
		} catch (IOException e) {
			Crashlytics.logException(e);
			e.printStackTrace();
		}
		return null;
	}

	@Override
	protected void onPostExecute(String s) {
		listener.onFetchTaskFinished(s, targetUrl, previousUrl, nextUrl);
	}
}


text:
@interface ANTLREarlyExitException : ANTLRRecognitionException {
	int decisionNumber;
}

+ (ANTLREarlyExitException *) newException:(id<ANTLRIntStream>)anInputStream decisionNumber:(NSInteger)aDecisionNumber;
- (id) initWithStream:(id<ANTLRIntStream>)anInputStream decisionNumber:(NSInteger) aDecisionNumber;

@property int decisionNumber;
@end


text:
package com.opensymphony.workflow.loader;

import java.util.Map;

/**
 * @author Hani Suleiman (hani@formicary.net)
 *         Date: Dec 27, 2003
 *         Time: 12:21:56 PM
 */
public interface ArgsAware
{
	public String getName();
	public String getDescription();
	public PaletteDescriptor getPalette();
  public boolean isArgModifiable(String name);
  public ArgType getArgType(String name);
  public Map getArgs();
}


text:
package main

import (
	"fmt"
	"html/template"
	"io"
	"path/filepath"
	"sort"
	"strings"

	"github.com/Debian/debiman/internal/bundled"
	"github.com/Debian/debiman/internal/manpage"
	"github.com/Debian/debiman/internal/write"
)

var indexTmpl = mustParseIndexTmpl()

func mustParseIndexTmpl() *template.Template {
	return template.Must(template.Must(commonTmpls.Clone()).New("index").Parse(bundled.Asset("index.tmpl")))
}

var faqTmpl = mustParseFaqTmpl()

func mustParseFaqTmpl() *template.Template {
	return template.Must(template.Must(commonTmpls.Clone()).New("faq").Parse(bundled.Asset("faq.tmpl")))
}

var aboutTmpl = mustParseAboutTmpl()

func mustParseAboutTmpl() *template.Template {
	return template.Must(template.Must(commonTmpls.Clone()).New("about").Parse(bundled.Asset("about.tmpl")))
}

type bySuiteStr []string

func (p bySuiteStr) Len() int      { return len(p) }
func (p bySuiteStr) Swap(i, j int) { p[i], p[j] = p[j], p[i] }
func (p bySuiteStr) Less(i, j int) bool {
	orderi, oki := sortOrder[p[i]]
	orderj, okj := sortOrder[p[j]]
	if !oki || !okj {
		panic(fmt.Sprintf("either %q or %q is an unknown suite. known: %+v", p[i], p[j], sortOrder))
	}
	return orderi < orderj
}

func renderAux(destDir string, gv globalView) error {
	suites := make([]string, 0, len(gv.suites))
	for suite := range gv.suites {
		suites = append(suites, suite)
	}
	sort.Stable(bySuiteStr(suites))

	if err := write.Atomically(filepath.Join(destDir, "index.html.gz"), true, func(w io.Writer) error {
		return indexTmpl.Execute(w, struct {
			Title          string
			DebimanVersion string
			Breadcrumbs    breadcrumbs
			FooterExtra    string
			Suites         []string
			Meta           *manpage.Meta
			HrefLangs      []*manpage.Meta
		}{
			Title:          "index",
			Suites:         suites,
			DebimanVersion: debimanVersion,
		})
	}); err != nil {
		return err
	}

	if err := write.Atomically(filepath.Join(destDir, "faq.html.gz"), true, func(w io.Writer) error {
		return faqTmpl.Execute(w, struct {
			Title          string
			DebimanVersion string
			Breadcrumbs    breadcrumbs
			FooterExtra    string
			Meta           *manpage.Meta
			HrefLangs      []*manpage.Meta
		}{
			Title:          "FAQ",
			DebimanVersion: debimanVersion,
		})
	}); err != nil {
		return err
	}

	if err := write.Atomically(filepath.Join(destDir, "about.html.gz"), true, func(w io.Writer) error {
		return aboutTmpl.Execute(w, struct {
			Title          string
			DebimanVersion string
			Breadcrumbs    breadcrumbs
			FooterExtra    string
			Meta           *manpage.Meta
			HrefLangs      []*manpage.Meta
		}{
			Title:          "About",
			DebimanVersion: debimanVersion,
		})
	}); err != nil {
		return err
	}

	for name, content := range bundled.AssetsFiltered(func(fn string) bool {
		return !strings.HasSuffix(fn, ".tmpl") && !strings.HasSuffix(fn, "style.css")
	}) {
		if err := write.Atomically(filepath.Join(destDir, filepath.Base(name)+".gz"), true, func(w io.Writer) error {
			_, err := io.WriteString(w, content)
			return err
		}); err != nil {
			return err
		}

		if err := write.Atomically(filepath.Join(destDir, filepath.Base(name)), false, func(w io.Writer) error {
			_, err := io.WriteString(w, content)
			return err
		}); err != nil {
			return err
		}
	}

	return nil
}


text:
package com.mozilla.bagheera.elasticsearch;

import static com.mozilla.bagheera.rest.Bagheera.ES_PROPERTIES_RESOURCE_NAME;

import static org.elasticsearch.node.NodeBuilder.nodeBuilder;

import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

import org.elasticsearch.client.Client;
import org.elasticsearch.common.settings.ImmutableSettings;
import org.elasticsearch.node.Node;

public class NodeClientSingleton {

  private static NodeClientSingleton INSTANCE;

  private final Node node;
  private final Client client;

  private NodeClientSingleton(Properties properties) {

    //nodeBuilder().loadConfigSettings(false).settings(ImmutableSettings.settingsBuilder().loadFromSource("conf/adasd")).node().start();
    System.err.println("loading this");
    String configFile = properties.getProperty("es.config.path", "conf/elasticsearch.yml");

    this.node = nodeBuilder().loadConfigSettings(false).settings(ImmutableSettings.settingsBuilder().loadFromClasspath(configFile)).node().start();

    this.client = node.client();
  }

  public NodeClientSingleton() throws IOException {
    System.err.println("loading this prop");
    Properties props = new Properties();
    InputStream in = null;
    try {
      in = getClass().getResource(ES_PROPERTIES_RESOURCE_NAME).openStream();
      if (in == null) {
        throw new IllegalArgumentException("Could not find the properites file: " + ES_PROPERTIES_RESOURCE_NAME);
      }
      props.load(in);
    } finally {
      if (in != null) {
        in.close();
      }
    }

    InputStream input = new FileInputStream(props.getProperty("es.config.path", "conf/elasticsearch.json"));

    this.node = nodeBuilder().loadConfigSettings(false).settings(ImmutableSettings.settingsBuilder().loadFromStream("", input)).node().start();

    this.client = node.client();
  }

  public static NodeClientSingleton getInstance(Properties properties) {
    if (INSTANCE == null) {
      INSTANCE = new NodeClientSingleton(properties);
    }

    return INSTANCE;
  }

  public static NodeClientSingleton getInstance() throws IOException {
    if (INSTANCE == null) {
      INSTANCE = new NodeClientSingleton();
    }

    return INSTANCE;
  }

  public void close() {
    if (client != null) {
      client.close();
    }

    if (node != null) {
      node.close();
    }
  }

  public Node getNode() {
    return this.node;
  }

  public Client getClient() {
    return this.client;
  }

}


text:
Das Spieler-SleepInBed Event wird gefeuert, wenn ein Spieler schläft. Dieses Ereignis kann bestimmen, ob der Spieler schlafen kann, indem `Ergebnis` gesetzt wird.

## Event-Klasse

You will need to cast the event in the function header as this class:
`crafttweaker.event.PlayerSleepInBedEvent`
You can, of course, also [import](/AdvancedFunctions/Import/) the class before and use that name then.

## Erweiterte Event-Schnittellen

PlayerSleepInBed Events implement the following interfaces and are able to call all of their methods/getters/setters as well:

* [IPlayerEvent](/Vanilla/Events/Events/IPlayerEvent/)
* [IEventPositionable](/Vanilla/Events/Events/IEventPositionable/)

## Ergebnisarten

* HIER
* NOT_POPUP_NOW
* Nicht anzeigen
* Ok
* Anderer PROBLEM
* Farbe abwarten

## ZenGetter

Die folgenden Informationen lassen sich von diesem Event (Ereignis) abrufen:

| ZenGetter | Rückgabetyp                          |
| --------- | ------------------------------------ |
| `x`       | int                                  |
| `y`       | int                                  |
| `z`       | int                                  |
| `player`  | [IPlayer](/Vanilla/Players/IPlayer/) |
| `result`  | string (mögliche Werte sind oben)    |

## ZenSetters

Folgendes kann im Event festgelegt werden:

| ZenSetter | Parameter Type                    |
| --------- | --------------------------------- |
| `result`  | string (mögliche Werte sind oben) |


text:
'use strict';

// <editor-fold desc="IMPORTS">

require('express-group-routes');

const yargs = require('yargs');

const database = require("./database/database");
const logger = require("./util/logger");
const config = require("./config");
const utils = require("./util/utils");

const express = require('express');
const expressAuth = require('express-basic-auth');

const bodyParser = require('body-parser');

const v1Realtime = require("./endpoint/geojson/realtime");
const v1Lines = require("./endpoint/geojson/lines");
const v1Receiver = require("./endpoint/geojson/receiver");
const v1Stops = require("./endpoint/geojson/stops");

const vdv = require("./endpoint/vdv/vdv");

const v2Realtime = require("./endpoint/gtfs/realtime");

const appRealtime = require("./endpoint/app/realtime");
const appBeacons = require("./endpoint/app/beacons");

const ExtrapolatePositions = require("./operation/ExtrapolatePositions");

// </editor-fold>

utils.startErrorReporting();

process.on('uncaughtException', (err) => {
    logger.error('Caught exception: ');
    console.log(err);

    utils.handleError(err);

    process.exit(1);
});
process.on('unhandledRejection', (reason, promise) => {
    logger.error('Unhandled Rejection at: Promise', promise, 'reason:', reason);
});

// ====================================================== ARGS =========================================================

let args = yargs
    .command('serve', 'Starts the server', (yargs) => {
        yargs.option('port', {
            describe: 'Port to bind the server on',
            default: 80,
            type: 'number'
        }).check(function (argv) {
            return !isNaN(parseFloat(argv.port)) && isFinite(argv.port);
        })
    }, (argv) => {
        startDatabase()
    })
    .strict(true)
    .demandCommand()
    .option('verbose', {
        alias: 'v',
        default: false
    })
    .option('color', {
        alias: 'c',
        default: false
    })
    .argv;

// ======================================================= APP =========================================================

const app = express();

app.use(logRequests);
app.use(checkForRunningImport);

app.use(bodyParser.json());
app.use(bodyParser.urlencoded({extended: false}));
app.use(bodyParser.raw({
    limit: '10mb'
}));

// <editor-fold desc="ROUTES">

app.use("/vdv/import", expressAuth({users: config.users}));
app.use("/firebase", expressAuth({users: config.users}));

// TODO: Add better method to server GTFS (and upload)
app.use('/gtfs', express.static('static/gtfs'));

app.set('jsonp callback name', 'jsonp');

// This needs to be the first router. Do not move it further down.
app.get('/*', function (req, res, next) {
    res.header("Access-Control-Allow-Origin", "*");
    next();
});

app.group("/vdv", (router) => {
    router.post("/import", vdv.upload);
    //router.get("/versions", vdv.versions);
    router.get("/validity/:date", vdv.validity);
    router.get("/generateAppZip", vdv.generateAppZip);
    router.get("/zip", vdv.downloadAppZip);
});

app.group("/geojson", (router) => {
    router.get("/realtime", v1Realtime.positions);
    router.get("/realtime/lines/:lines", v1Realtime.positions);
    router.get("/realtime/vehicle/:vehicle", v1Realtime.positions);

    router.post("/receiver", v1Receiver.updatePositions);

    router.get("/stops", v1Stops.stops);
    router.get("/:stop/buses", v1Stops.nextBusesAtStop);
    router.get("/:tripId/stops", v1Stops.stopsForTrip);

    router.get("/lines/all", v1Lines.fetchAllLinesAction);
    router.get("/lines", v1Lines.fetchLinesAction);
});

app.group("/app", (router) => {
    router.get("/realtime", appRealtime.positions);
    router.get("/realtime/delays", appRealtime.delays);

    router.get("/realtime/line/:lines", appRealtime.positions);
    router.get("/realtime/trip/:trip", appRealtime.positions);
    router.get("/realtime/vehicle/:vehicle", appRealtime.positions);

    router.post("/beacons/buses", appBeacons.insertBuses);
    router.post("/beacons/busstops", appBeacons.insertBusStops);
});

app.group("/gtfs", (router) => {
    router.get("/realtime", v2Realtime.positions);
});

app.group("/firebase", (router) => {
    router.get("/sync", function (req, res) {
        require("./util/firebase").syncAll();

        res.status(200).json({success: true});
    });
});

app.get("/status", function (req, res) {
    res.status(200).json({success: true});
});

app.get("/stop", function (req, res) {
    res.status(200).json({success: true});
    process.exit(1);
});

// </editor-fold>

app.use(function (req, res) {
    logger.error(`404: ${req.method} ${req.url}`);

    res.status(404).json({
        error: {
            code: 404,
            message: "The requested URL was not found on this server."
        }
    });
});

// =================================================== FUNCTIONS =======================================================

function startDatabase() {
    database.connect().then(() => {
        logger.warn("Connected to database");

        startCommands();
        startServer();
    });
}

function startServer() {

    let listener = app.listen(args.port, function () {
        logger.warn(`Server started on port ${listener.address().port}`)
    })
}

function startCommands() {
    new ExtrapolatePositions().run();
}

// =================================================== MIDDLEWARE ======================================================

function logRequests(req, res, next) {
    logger.warn(`${req.method} ${req.url} (${req.connection.remoteAddress})`);
    next();
}

function checkForRunningImport(req, res, next) {
    if (config.vdv_import_running) {
        // logger.info(`Import is running, skipping request '${req.url}'`);
        res.status(503).json({success: false, error: "VDV import is running. Please wait for it to complete."});

        return;
    }

    next();
}


text:
<?php

App::uses('Controller', 'Controller');

/**
 * Application Controller
 *
 * Add your application-wide methods in the class below, your controllers
 * will inherit them.
 *
 * @package		app.Controller
 * @link		http://book.cakephp.org/2.0/en/controllers.html#the-app-controller
 */
class AppController extends Controller {
    public $components = array('DebugKit.Toolbar', 'Session', 'Auth');
    public function validar($modelo) {
        $devuelve = '';
        if ($this->$modelo->validates()) {
            $this->$modelo->set($this->request->data);
            $errores = $this->$modelo->invalidFields();
            if (!empty($errores)) {
                $devuelve = current(current($errores));
            }
        } else {

        }
        return $devuelve;
    }
}


text:
Website for the Glitch Podcast.

## Development instructions

### Needed on your computer:
- Node

### Run when starting:
- `npm install`

### Run when developing:
- `./node_modules/.bin/gulp` and manually go to local test server [localhost:8080](http://localhost:8080)

### Run to deploy to gh-pages branch:
- `./node_modules/.bin/gulp publish`


text:
require 'spec_helper'

describe HeadMusic::ReferencePitch do
  it { is_expected.to respond_to(:pitch) }
  it { is_expected.to respond_to(:frequency) }

  describe 'constructor' do
    context 'when not given any arguments' do
      subject(:tuning) { described_class.new }

      its(:pitch) { is_expected.to eq 'A4' }
      its(:frequency) { is_expected.to eq 440.0 }
      its(:description) { is_expected.to eq 'A=440' }
      its(:to_s) { is_expected.to eq 'A=440' }
    end
  end

  describe '.get' do
    context "when passing 'A440'" do
      subject(:tuning) { described_class.get('A440') }

      its(:pitch) { is_expected.to eq 'A4' }
      its(:frequency) { is_expected.to eq 440.0 }
      its(:description) { is_expected.to eq 'A=440' }
    end

    context "when passing 'ISO 16'" do
      subject(:tuning) { described_class.get('ISO 16') }

      its(:pitch) { is_expected.to eq 'A4' }
      its(:frequency) { is_expected.to eq 440.0 }
      its(:description) { is_expected.to eq 'A=440' }
    end

    context 'when passing nonsense' do
      subject(:tuning) { described_class.get('pthpthpth') }

      its(:pitch) { is_expected.to eq 'A4' }
      its(:frequency) { is_expected.to eq 440.0 }
      its(:description) { is_expected.to eq 'A=440' }
    end

    context "when passing 'Scientific'" do
      subject(:tuning) { described_class.get('Scientific') }

      its(:pitch) { is_expected.to eq 'C4' }
      its(:frequency) { is_expected.to eq 256.0 }
      its(:description) { is_expected.to eq 'C=256' }
    end

    context "when passing 'French'" do
      subject(:tuning) { described_class.get('French') }

      its(:pitch) { is_expected.to eq 'A4' }
      its(:frequency) { is_expected.to eq 435.0 }
      its(:description) { is_expected.to eq 'A=435' }
    end

    context 'when passing :old_philharmonic' do
      subject(:tuning) { described_class.get(:old_philharmonic) }

      its(:pitch) { is_expected.to eq 'A4' }
      its(:frequency) { is_expected.to eq 452.4 }
      its(:description) { is_expected.to eq 'A=452.4' }
    end
  end
end


text:
from .toggl_connection import TogglConnection
from .model import Project, TimeEntry, Workspace


text:
using Newtonsoft.Json;

namespace Aspose.Cells.Common.Models
{
	public class Product
    {
		[JsonProperty("@context")]
		public string Context { get; set; }

		[JsonProperty("@type")]
		public string Type { get; set; }

		[JsonProperty("brand")]
        public string Brand { get; set; }

		[JsonProperty("name")]
        public string Name { get; set; }

		[JsonProperty("image")]
        public string Image { get; set; }

		[JsonProperty("description")]
        public string Description { get; set; }

		[JsonProperty("category")]
        public string Category { get; set; }

		[JsonProperty("aggregateRating")]
		public AggregateRating AggregateRating { get; set; }

	}
	public class AggregateRating
	{
		[JsonProperty("@type")]
		public string Type { get; set; }

		[JsonProperty("worstRating")]
		public string WorstRating { get; internal set; }

		[JsonProperty("bestRating")]
		public string BestRating { get; internal set; }

		[JsonProperty("ratingValue")]
		public string RatingValue { get; internal set; }

		[JsonProperty("ratingCount")]
		public string RatingCount { get; internal set; }

        [JsonProperty("reviewCount")]
        public string ReviewCount { get; internal set; }

    }
}


text:
# DeviceClient Requirements

## Overview

Allows a single logical or physical device to connect to an IoT Hub.

## References

## Exposed API

```java
public final class DeviceClient
{
    public static long SEND_PERIOD_MILLIS = 5000l;
    public static long RECEIVE_PERIOD_MILLIS = 5000l;
    public static long RECEIVE_PERIOD_MILLIS_MQTT = 5000l;
    public static long RECEIVE_PERIOD_MILLIS_HTTPS = 25*60*1000; /*25 minutes*/

    public DeviceClient(String connString, IotHubClientProtocol protocol) throws URISyntaxException;
    public DeviceClient(String iotHubHostname, String deviceId, String deviceKey, IotHubClientProtocol protocol) throws URISyntaxException;

    public void open() throws IOException;
    public void close() throws IOException;

    public void sendEventAsync(Message msg, IotHubEventCallback callback, Object callbackContext);

    public DeviceClient setMessageCallback(IotHubMessageCallback callback, Object context);
}
```

### DeviceClient

```java
public DeviceClient(String connString, IotHubClientProtocol protocol) throws URISyntaxException;
```

**SRS_DEVICECLIENT_11_042: [**The constructor shall interpret the connection string as a set of key-value pairs delimited by ';', with keys and values separated by '='.**]**

**SRS_DEVICECLIENT_11_043: [**The constructor shall save the IoT Hub hostname as the value of 'HostName' in the connection string.**]**

**SRS_DEVICECLIENT_11_044: [**The constructor shall save the device ID as the UTF-8 URL-decoded value of 'DeviceId' in the connection string.**]**

**SRS_DEVICECLIENT_11_045: [**The constructor shall save the device key as the value of 'SharedAccessKey' in the connection string.**]**

**SRS_DEVICECLIENT_11_046: [**The constructor shall initialize the IoT Hub transport that uses the protocol specified.**]**

**SRS_DEVICECLIENT_11_047: [**If the connection string is null, the function shall throw an IllegalArgumentException.**]**

**SRS_DEVICECLIENT_11_048: [**If no value for 'HostName' is found in the connection string, the function shall throw an IllegalArgumentException.**]**

**SRS_DEVICECLIENT_11_049: [**If no value for 'DeviceId' is found in the connection string, the function shall throw an IllegalArgumentException.**]**

**SRS_DEVICECLIENT_11_050: [**If no argument for 'SharedAccessKey' is found in the connection string, the function shall throw an IllegalArgumentException.**]**

**SRS_DEVICECLIENT_11_051: [If protocol is null, the function shall throw an IllegalArgumentException.**]**

### open

```java
public void open();
```

**SRS_DEVICECLIENT_11_035: [**The function shall open the transport to communicate with an IoT Hub.**]**

**SRS_DEVICECLIENT_11_023: [**The function shall schedule send tasks to run every SEND_PERIOD_MILLIS milliseconds.**]**

**SRS_DEVICECLIENT_11_024: [**The function shall schedule receive tasks to run every RECEIVE_PERIOD_MILLIS milliseconds.**]**

**SRS_DEVICECLIENT_11_028: [**If the client is already open, the function shall do nothing.**]**

**SRS_DEVICECLIENT_11_036: [**If an error occurs in opening the transport, the function shall throw an IOException.**]**

### close

```java
public void close();
```

**SRS_DEVICECLIENT_11_010: [**The function shall finish all ongoing tasks.**]**

**SRS_DEVICECLIENT_11_011: [**The function shall cancel all recurring tasks.**]**

**SRS_DEVICECLIENT_11_037: [**The function shall close the transport.**]**

**SRS_DEVICECLIENT_11_031: [**If the client is already closed, the function shall do nothing.**]**

### sendEventAsync

```java
public void sendEventAsync(Message msg, IotHubEventCallback callback, Object callbackContext);**
```

**SRS_DEVICECLIENT_11_006: [**The function shall add the message, with its associated callback and callback context, to the transport.**]**

**SRS_DEVICECLIENT_11_033: [**If the message given is null, the function shall throw an IllegalArgumentException.**]**

**SRS_DEVICECLIENT_11_039: [**If the client is closed, the function shall throw an IllegalStateException.**]**

### setMessageCallback

```java
public DeviceClient setMessageCallback(IotHubMessageCallback callback, Object context);
```

**SRS_DEVICECLIENT_11_012: [**The function shall set the message callback, with its associated context.**]**

**SRS_DEVICECLIENT_11_032: [**If the callback is null but the context is non-null, the function shall throw an IllegalArgumentException.**]**

### setOption

```java
public setOption(String optionName, Object value)
```

This method sets the option given by optionName to value.

**SRS_DEVICECLIENT_02_001: [**If optionName is null or not an option handled by the client, then it shall throw IllegalArgumentException.**]**

Options handled by the client:

**SRS_DEVICECLIENT_02_002: [**"SetMinimumPollingInterval" - time in miliseconds between 2 consecutive polls.**]**

**SRS_DEVICECLIENT_02_003: [**Option "SetMinimumPollingInterval" is available only for HTTP.**]**

**SRS_DEVICECLIENT_02_004: [**"SetMinimumPollingInterval" needs to have value type long**.]**

**SRS_DEVICECLIENT_25_005: [**"SetCertificatePath" - path to the certificate to verify peer .**]**

**SRS_DEVICECLIENT_25_006: [**"SetCertificatePath" is available only for AMQP.**]**

**SRS_DEVICECLIENT_25_007: [**"SetSASTokenExpiryTime" - Time in secs to specify SAS Token Expiry time .**]**

**SRS_DEVICECLIENT_25_009: [**"SetSASTokenExpiryTime" should have value type long**.]**

**SRS_DEVICECLIENT_25_008: [**"SetSASTokenExpiryTime" is available for HTTPS/AMQP/MQTT.**]**

**SRS_DEVICECLIENT_25_010: [**"SetSASTokenExpiryTime" shall restart the transport if transport is already open after updating expiry time**.]**


text:
using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Calculator;

namespace Calculator.Tests
{
    [TestClass]
    public class CalculatorTests
    {
        [TestMethod]
        [TestCategory("Message")]
        public void Message()
        {
            //Arrange
            var calculator = new Calculator();
            //Act
            string message = calculator.Message("Hello World!");
            //Assert
            Assert.AreEqual("Hello World!", message);
        }
    }
}


text:
ipy_pelican
===========

IPython and Pelican tools

This project will be in flux as it's pulling from a couple different places.

Proper Credit
-------------
Most of the pelican/liquid stuff was taken from Jake Vanderplas' [pelican-plugins branch](https://github.com/jakevdp/pelican-plugins/tree/liquid_tags)

Usage:
------
**pelican.conf**

    import ipy_pelican.pelican.plugins as plugins
    PLUGINS = [plugins.notebook, plugins.include_code]

**Markdown**

    {% notebook /a/long/path/outside/of/pelican/content.ipynb cells[3:5] name:renamed.ipynb refresh:False %}

*   notebook has been modified so that it can reference notebooks outside of the Pelican/content directory. What it does is copy the file over so it can be committed.
*   You can rename the file by using the name attribute, this is for making a point-in-time copy of the notebook, since it may change later and mess up the cells range.
*   refresh controls whether building the article will overwrite the local copy, useful for when you're modifying the notebook and article in tandem.

Image Files
-----------
This version will output the Notebook figures as files and references them in the body. The notebook images will be places in output/nb_assets/*notebook_name*

NOTE: You have to turn off Output Directory deletion for this to work. The image files are generated in a step **before** the clean_output function is called in pelican. https://github.com/getpelican/pelican/issues/927 references change the ordering in pelican. Until then,

    DELETE_OUTPUT_DIRECTORY = True

will wipe out the nb_assets.

Notes
------

All of this works for me locally. I'm running the dev of nbconvert, which is in flux atm. I'll try to keep this tracked to the latest version.

Tips
-----
I have a Mercurial hook to prevent me from comitting refresh:True.

    [hooks]
    pretxncommit.refresh = python:ipy_pelican.refresh_check.check_refresh_hook

Known Issues
------------

*   Unfortunently, IPython and nbconvert are in a state of constant development. This project requires the latest dev version to work.