text:
/*!
 * angular-datatables - v0.3.0
 * https://github.com/l-lin/angular-datatables
 * License: MIT
 */
(function (window, document, $, angular) {
  /*!
 * angular-datatables - v0.3.0
 * https://github.com/l-lin/angular-datatables
 * License: MIT
 */
  /*jshint camelcase: false */
  'use strict';
  angular.module('datatables.bootstrap.tabletools', [
    'datatables.bootstrap.options',
    'datatables.util'
  ]).service('DTBootstrapTableTools', [
    'DTPropertyUtil',
    'DTBootstrapDefaultOptions',
    function (DTPropertyUtil, DTBootstrapDefaultOptions) {
      var _initializedTableTools = false, _savedFn = {}, _saveFnToBeOverrided = function () {
          if ($.fn.DataTable.TableTools) {
            _savedFn.TableTools = {
              classes: angular.copy($.fn.DataTable.TableTools.classes),
              oTags: angular.copy($.fn.DataTable.TableTools.DEFAULTS.oTags)
            };
          }
        };
      this.integrate = function (bootstrapOptions) {
        if (!_initializedTableTools) {
          _saveFnToBeOverrided();
          /*
             * TableTools Bootstrap compatibility
             * Required TableTools 2.1+
             */
          if ($.fn.DataTable.TableTools) {
            var tableToolsOptions = DTPropertyUtil.overrideProperties(DTBootstrapDefaultOptions.getOptions().TableTools, bootstrapOptions ? bootstrapOptions.TableTools : null);
            // Set the classes that TableTools uses to something suitable for Bootstrap
            $.extend(true, $.fn.DataTable.TableTools.classes, tableToolsOptions.classes);
            // Have the collection use a bootstrap compatible dropdown
            $.extend(true, $.fn.DataTable.TableTools.DEFAULTS.oTags, tableToolsOptions.DEFAULTS.oTags);
          }
          _initializedTableTools = true;
        }
      };
      this.deIntegrate = function () {
        if (_initializedTableTools && $.fn.DataTable.TableTools && _savedFn.TableTools) {
          $.extend(true, $.fn.DataTable.TableTools.classes, _savedFn.TableTools.classes);
          $.extend(true, $.fn.DataTable.TableTools.DEFAULTS.oTags, _savedFn.TableTools.oTags);
          _initializedTableTools = false;
        }
      };
    }
  ]);
  angular.module('datatables.bootstrap.colvis', [
    'datatables.bootstrap.options',
    'datatables.util'
  ]).service('DTBootstrapColVis', [
    'DTPropertyUtil',
    'DTBootstrapDefaultOptions',
    function (DTPropertyUtil, DTBootstrapDefaultOptions) {
      var _initializedColVis = false;
      this.integrate = function (addDrawCallbackFunction, bootstrapOptions) {
        if (!_initializedColVis) {
          var colVisProperties = DTPropertyUtil.overrideProperties(DTBootstrapDefaultOptions.getOptions().ColVis, bootstrapOptions ? bootstrapOptions.ColVis : null);
          /* ColVis Bootstrap compatibility */
          if ($.fn.DataTable.ColVis) {
            addDrawCallbackFunction(function () {
              $('.ColVis_MasterButton').attr('class', 'ColVis_MasterButton ' + colVisProperties.classes.masterButton);
              $('.ColVis_Button').removeClass('ColVis_Button');
            });
          }
          _initializedColVis = true;
        }
      };
      this.deIntegrate = function () {
        if (_initializedColVis && $.fn.DataTable.ColVis) {
          _initializedColVis = false;
        }
      };
    }
  ]);
  /**
 * Source: https://editor.datatables.net/release/DataTables/extras/Editor/examples/bootstrap.html
 */
  angular.module('datatables.bootstrap', [
    'datatables.bootstrap.options',
    'datatables.bootstrap.tabletools',
    'datatables.bootstrap.colvis'
  ]).service('DTBootstrap', [
    'DTBootstrapTableTools',
    'DTBootstrapColVis',
    'DTBootstrapDefaultOptions',
    function (DTBootstrapTableTools, DTBootstrapColVis, DTBootstrapDefaultOptions) {
      var _initialized = false, _drawCallbackFunctionList = [], _savedFn = {};
      var _saveFnToBeOverrided = function () {
          _savedFn.oStdClasses = angular.copy($.fn.dataTableExt.oStdClasses);
          _savedFn.fnPagingInfo = $.fn.dataTableExt.oApi.fnPagingInfo;
          _savedFn.renderer = angular.copy($.fn.DataTable.ext.renderer);
          if ($.fn.DataTable.TableTools) {
            _savedFn.TableTools = {
              classes: angular.copy($.fn.DataTable.TableTools.classes),
              oTags: angular.copy($.fn.DataTable.TableTools.DEFAULTS.oTags)
            };
          }
        }, _revertToDTFn = function () {
          $.extend($.fn.dataTableExt.oStdClasses, _savedFn.oStdClasses);
          $.fn.dataTableExt.oApi.fnPagingInfo = _savedFn.fnPagingInfo;
          $.extend(true, $.fn.DataTable.ext.renderer, _savedFn.renderer);
        };
      var _overrideClasses = function () {
        /* Default class modification */
        $.extend($.fn.dataTableExt.oStdClasses, {
          'sWrapper': 'dataTables_wrapper form-inline',
          'sFilterInput': 'form-control input-sm',
          'sLengthSelect': 'form-control input-sm',
          'sFilter': 'dataTables_filter',
          'sLength': 'dataTables_length'
        });
      };
      var _overridePagingInfo = function () {
        /* API method to get paging information */
        $.fn.dataTableExt.oApi.fnPagingInfo = function (oSettings) {
          return {
            'iStart': oSettings._iDisplayStart,
            'iEnd': oSettings.fnDisplayEnd(),
            'iLength': oSettings._iDisplayLength,
            'iTotal': oSettings.fnRecordsTotal(),
            'iFilteredTotal': oSettings.fnRecordsDisplay(),
            'iPage': oSettings._iDisplayLength === -1 ? 0 : Math.ceil(oSettings._iDisplayStart / oSettings._iDisplayLength),
            'iTotalPages': oSettings._iDisplayLength === -1 ? 0 : Math.ceil(oSettings.fnRecordsDisplay() / oSettings._iDisplayLength)
          };
        };
      };
      var _overridePagination = function () {
        // Note: Copy paste with some changes from DataTables v1.10.1 source code
        $.extend(true, $.fn.DataTable.ext.renderer, {
          pageButton: {
            _: function (settings, host, idx, buttons, page, pages) {
              var classes = settings.oClasses;
              var lang = settings.oLanguage.oPaginate;
              var btnDisplay, btnClass, counter = 0;
              var $paginationContainer = $('

', { 'class': 'pagination' });
              var attach = function (container, buttons) {
                var i, ien, node, button;
                var clickHandler = function (e) {
                  e.preventDefault();
                  // IMPORTANT: Reference to internal functions of DT. It might change between versions
                  $.fn.DataTable.ext.internal._fnPageChange(settings, e.data.action, true);
                };
                for (i = 0, ien = buttons.length; i < ien; i++) {
                  button = buttons[i];
                  if ($.isArray(button)) {
                    // Override DT element
                    button.DT_el = 'li';
                    var inner = $('<' + (button.DT_el || 'div') + '/>').appendTo($paginationContainer);
                    attach(inner, button);
                  } else {
                    btnDisplay = '';
                    btnClass = '';
                    var $paginationBtn = $('

'), isDisabled;
                    switch (button) {
                    case 'ellipsis':
                      $paginationContainer.append('
…
');
                      break;
                    case 'first':
                      btnDisplay = lang.sFirst;
                      btnClass = button;
                      if (page <= 0) {
                        $paginationBtn.addClass(classes.sPageButtonDisabled);
                        isDisabled = true;
                      }
                      break;
                    case 'previous':
                      btnDisplay = lang.sPrevious;
                      btnClass = button;
                      if (page <= 0) {
                        $paginationBtn.addClass(classes.sPageButtonDisabled);
                        isDisabled = true;
                      }
                      break;
                    case 'next':
                      btnDisplay = lang.sNext;
                      btnClass = button;
                      if (page >= pages - 1) {
                        $paginationBtn.addClass(classes.sPageButtonDisabled);
                        isDisabled = true;
                      }
                      break;
                    case 'last':
                      btnDisplay = lang.sLast;
                      btnClass = button;
                      if (page >= pages - 1) {
                        $paginationBtn.addClass(classes.sPageButtonDisabled);
                        isDisabled = true;
                      }
                      break;
                    default:
                      btnDisplay = button + 1;
                      btnClass = '';
                      if (page === button) {
                        $paginationBtn.addClass(classes.sPageButtonActive);
                      }
                      break;
                    }
                    if (btnDisplay) {
                      $paginationBtn.appendTo($paginationContainer);
                      node = $('', {
                        'href': '#',
                        'class': btnClass,
                        'aria-controls': settings.sTableId,
                        'data-dt-idx': counter,
                        'tabindex': settings.iTabIndex,
                        'id': idx === 0 && typeof button === 'string' ? settings.sTableId + '_' + button : null
                      }).html(btnDisplay).appendTo($paginationBtn);
                      // IMPORTANT: Reference to internal functions of DT. It might change between versions
                      $.fn.DataTable.ext.internal._fnBindAction(node, { action: button }, clickHandler);
                      counter++;
                    }
                  }
                }
              };
              // IE9 throws an 'unknown error' if document.activeElement is used
              // inside an iframe or frame. Try / catch the error. Not good for
              // accessibility, but neither are frames.
              try {
                // Because this approach is destroying and recreating the paging
                // elements, focus is lost on the select button which is bad for
                // accessibility. So we want to restore focus once the draw has
                // completed
                var activeEl = $(document.activeElement).data('dt-idx');
                // Add
 to the pagination
                var container = $(host).empty();
                $paginationContainer.appendTo(container);
                attach(container, buttons);
                if (activeEl !== null) {
                  $(host).find('[data-dt-idx=' + activeEl + ']').focus();
                }
              } catch (e) {
              }
            }
          }
        });
      };
      var _addDrawCallbackFunction = function (fn) {
        if (angular.isFunction(fn)) {
          _drawCallbackFunctionList.push(fn);
        }
      };
      var _init = function () {
          if (!_initialized) {
            _saveFnToBeOverrided();
            _overrideClasses();
            _overridePagingInfo();
            _overridePagination();
            _addDrawCallbackFunction(function () {
              $('div.dataTables_filter').find('input').addClass('form-control');
              $('div.dataTables_length').find('select').addClass('form-control');
            });
            _initialized = true;
          }
        }, _setDom = function (options) {
          if (!options.hasOverrideDom) {
            var sDom = DTBootstrapDefaultOptions.getOptions().dom;
            if (options.hasColReorder) {
              sDom = 'R' + sDom;
            }
            if (options.hasColVis) {
              sDom = 'C' + sDom;
            }
            if (options.hasTableTools) {
              sDom = 'T' + sDom;
            }
            return sDom;
          }
          return options.sDom;
        };
      /**
     * Integrate Bootstrap
     * @param options the datatables options
     */
      this.integrate = function (options) {
        _init();
        DTBootstrapTableTools.integrate(options.bootstrap);
        DTBootstrapColVis.integrate(_addDrawCallbackFunction, options.bootstrap);
        options.sDom = _setDom(options);
        if (angular.isUndefined(options.fnDrawCallback)) {
          // Call every drawcallback functions
          options.fnDrawCallback = function () {
            for (var index = 0; index < _drawCallbackFunctionList.length; index++) {
              _drawCallbackFunctionList[index]();
            }
          };
        }
      };
      this.deIntegrate = function () {
        if (_initialized) {
          _revertToDTFn();
          DTBootstrapTableTools.deIntegrate();
          DTBootstrapColVis.deIntegrate();
          _initialized = false;
        }
      };
    }
  ]);
  'use strict';
  angular.module('datatables.bootstrap.options', [
    'datatables.options',
    'datatables.util'
  ]).constant('DT_BOOTSTRAP_DEFAULT_OPTIONS', {
    TableTools: {
      classes: {
        container: 'DTTT btn-group',
        buttons: {
          normal: 'btn btn-default',
          disabled: 'disabled'
        },
        collection: {
          container: 'DTTT_dropdown dropdown-menu',
          buttons: {
            normal: '',
            disabled: 'disabled'
          }
        },
        print: { info: 'DTTT_print_info modal' },
        select: { row: 'active' }
      },
      DEFAULTS: {
        oTags: {
          collection: {
            container: 'ul',
            button: 'li',
            liner: 'a'
          }
        }
      }
    },
    ColVis: { classes: { masterButton: 'btn btn-default' } },
    dom: '<\'row\'<\'col-xs-6\'l><\'col-xs-6\'f>r>t<\'row\'<\'col-xs-6\'i><\'col-xs-6\'p>>'
  }).service('DTBootstrapDefaultOptions', [
    'DTDefaultOptions',
    'DTPropertyUtil',
    'DT_BOOTSTRAP_DEFAULT_OPTIONS',
    function (DTDefaultOptions, DTPropertyUtil, DT_BOOTSTRAP_DEFAULT_OPTIONS) {
      /**
     * Get the default options for bootstrap integration
     * @returns {*} the bootstrap default options
     */
      this.getOptions = function () {
        return DTPropertyUtil.overrideProperties(DT_BOOTSTRAP_DEFAULT_OPTIONS, DTDefaultOptions.bootstrapOptions);
      };
    }
  ]);
  'use strict';
  angular.module('datatables.directive', [
    'datatables.renderer',
    'datatables.options',
    'datatables.util'
  ]).directive('datatable', [
    '$q',
    'DT_DEFAULT_OPTIONS',
    'DTBootstrap',
    'DTRendererFactory',
    'DTRendererService',
    'DTPropertyUtil',
    function ($q, DT_DEFAULT_OPTIONS, DTBootstrap, DTRendererFactory, DTRendererService, DTPropertyUtil) {
      return {
        restrict: 'A',
        scope: {
          dtOptions: '=',
          dtColumns: '=',
          dtColumnDefs: '=',
          datatable: '@'
        },
        compile: function (tElm) {
          var _staticHTML = tElm[0].innerHTML;
          return function postLink($scope, $elem, iAttrs, ctrl) {
            $scope.$watch('[dtOptions, dtColumns, dtColumnDefs]', function (newVal, oldVal) {
              if (newVal !== oldVal) {
                var newDTOptions = newVal[0], oldDTOptions = oldVal[0];
                // Do not rerender if we want to reload. There are already
                // some watchers in the renderers.
                if (!newDTOptions.reload || newDTOptions.sAjaxSource !== oldDTOptions.sAjaxSource) {
                  ctrl.render($elem, ctrl.buildOptionsPromise(), _staticHTML);
                } else {
                  // The reload attribute is set to false here in order
                  // to recall this watcher again
                  newDTOptions.reload = false;
                }
              }
            }, true);
            ctrl.showLoading($elem);
            ctrl.render($elem, ctrl.buildOptionsPromise(), _staticHTML);
          };
        },
        controller: [
          '$scope',
          function ($scope) {
            var _renderer;
            this.showLoading = function ($elem) {
              DTRendererService.showLoading($elem);
            };
            this.buildOptionsPromise = function () {
              var defer = $q.defer();
              // Build options
              $q.all([
                $q.when($scope.dtOptions),
                $q.when($scope.dtColumns),
                $q.when($scope.dtColumnDefs)
              ]).then(function (results) {
                var dtOptions = results[0], dtColumns = results[1], dtColumnDefs = results[2];
                // Since Angular 1.3, the promise throws a "Maximum call stack size exceeded" when cloning
                // See https://github.com/l-lin/angular-datatables/issues/110
                DTPropertyUtil.deleteProperty(dtOptions, '$promise');
                DTPropertyUtil.deleteProperty(dtColumns, '$promise');
                DTPropertyUtil.deleteProperty(dtColumnDefs, '$promise');
                var options;
                if (angular.isDefined($scope.dtOptions)) {
                  options = {};
                  angular.extend(options, dtOptions);
                  // Set the columns
                  if (angular.isArray(dtColumns)) {
                    options.aoColumns = dtColumns;
                  }
                  // Set the column defs
                  if (angular.isArray(dtColumnDefs)) {
                    options.aoColumnDefs = dtColumnDefs;
                  }
                  // Integrate bootstrap (or not)
                  if (options.integrateBootstrap) {
                    DTBootstrap.integrate(options);
                  } else {
                    DTBootstrap.deIntegrate();
                  }
                }
                defer.resolve(options);
              });
              return defer.promise;
            };
            this.render = function ($elem, optionsPromise, staticHTML) {
              optionsPromise.then(function (options) {
                var isNgDisplay = $scope.datatable && $scope.datatable === 'ng';
                // Render dataTable
                if (_renderer) {
                  _renderer.withOptions(options).render($scope, $elem, staticHTML);
                } else {
                  _renderer = DTRendererFactory.fromOptions(options, isNgDisplay).render($scope, $elem, staticHTML);
                }
              });
            };
          }
        ]
      };
    }
  ]);
  'use strict';
  angular.module('datatables.factory', [
    'datatables.bootstrap',
    'datatables.options'
  ]).factory('DTOptionsBuilder', [
    'DT_DEFAULT_OPTIONS',
    function (DT_DEFAULT_OPTIONS) {
      /**
     * Optional class to handle undefined or null
     * @param obj the object to wrap
     */
      var Optional = {
          isPresent: function () {
            return angular.isDefined(this.obj) && this.obj !== null;
          },
          orEmptyObj: function () {
            if (this.isPresent()) {
              return this.obj;
            }
            return {};
          },
          or: function (secondChoice) {
            if (this.isPresent()) {
              return this.obj;
            }
            return secondChoice;
          }
        };
      /**
     * Wrap the given objec
     * @param obj the object to wrap
     * @returns {Optional} the optional of the wrapped object
     */
      var fromNullable = function (obj) {
        var optional = Object.create(Optional);
        optional.obj = obj;
        return optional;
      };
      /**
     * The wrapped datatables options class
     * @param sAjaxSource the ajax source to fetch the data
     * @param fnPromise the function that returns a promise to fetch the data
     */
      var DTOptions = {
          integrateBootstrap: false,
          hasColVis: false,
          hasColReorder: false,
          hasTableTools: false,
          hasOverrideDom: false,
          reloadData: function () {
            this.reload = true;
            return this;
          },
          withOption: function (key, value) {
            if (angular.isString(key)) {
              this[key] = value;
            }
            return this;
          },
          withSource: function (sAjaxSource) {
            this.sAjaxSource = sAjaxSource;
            return this;
          },
          withDataProp: function (sAjaxDataProp) {
            this.sAjaxDataProp = sAjaxDataProp;
            return this;
          },
          withFnServerData: function (fn) {
            if (!angular.isFunction(fn)) {
              throw new Error('The parameter must be a function');
            }
            this.fnServerData = fn;
            return this;
          },
          withPaginationType: function (sPaginationType) {
            if (angular.isString(sPaginationType)) {
              this.sPaginationType = sPaginationType;
            } else {
              throw new Error('The pagination type must be provided');
            }
            return this;
          },
          withLanguage: function (oLanguage) {
            this.oLanguage = oLanguage;
            return this;
          },
          withLanguageSource: function (sLanguageSource) {
            return this.withLanguage({ sUrl: sLanguageSource });
          },
          withDisplayLength: function (iDisplayLength) {
            this.iDisplayLength = iDisplayLength;
            return this;
          },
          withFnPromise: function (fnPromise) {
            this.fnPromise = fnPromise;
            return this;
          },
          withDOM: function (sDom) {
            this.sDom = sDom;
            this.hasOverrideDom = true;
            return this;
          },
          withBootstrap: function () {
            this.integrateBootstrap = true;
            // Override page button active CSS class
            if (angular.isObject(this.oClasses)) {
              this.oClasses.sPageButtonActive = 'active';
            } else {
              this.oClasses = { sPageButtonActive: 'active' };
            }
            return this;
          },
          withBootstrapOptions: function (bootstrapOptions) {
            this.bootstrap = bootstrapOptions;
            return this;
          },
          withColReorderOption: function (key, value) {
            if (angular.isString(key)) {
              this.oColReorder = fromNullable(this.oColReorder).orEmptyObj();
              this.oColReorder[key] = value;
            }
            return this;
          },
          withColReorder: function () {
            var colReorderPrefix = 'R';
            this.sDom = colReorderPrefix + fromNullable(this.sDom).or(DT_DEFAULT_OPTIONS.dom);
            this.hasColReorder = true;
            return this;
          },
          withColReorderOrder: function (aiOrder) {
            if (angular.isArray(aiOrder)) {
              this.withColReorderOption('aiOrder', aiOrder);
            }
            return this;
          },
          withColReorderCallback: function (fnReorderCallback) {
            if (angular.isFunction(fnReorderCallback)) {
              this.withColReorderOption('fnReorderCallback', fnReorderCallback);
            } else {
              throw new Error('The reorder callback must be a function');
            }
            return this;
          },
          withColVisOption: function (key, value) {
            if (angular.isString(key)) {
              this.oColVis = fromNullable(this.oColVis).orEmptyObj();
              this.oColVis[key] = value;
            }
            return this;
          },
          withColVis: function () {
            var colVisPrefix = 'C';
            this.sDom = colVisPrefix + fromNullable(this.sDom).or(DT_DEFAULT_OPTIONS.dom);
            this.hasColVis = true;
            return this;
          },
          withColVisStateChange: function (fnStateChange) {
            if (angular.isFunction(fnStateChange)) {
              this.withColVisOption('fnStateChange', fnStateChange);
            } else {
              throw new Error('The state change must be a function');
            }
            return this;
          },
          withTableToolsOption: function (key, value) {
            if (angular.isString(key)) {
              this.oTableTools = fromNullable(this.oTableTools).orEmptyObj();
              this.oTableTools[key] = value;
            }
            return this;
          },
          withTableTools: function (sSwfPath) {
            var tableToolsPrefix = 'T';
            this.sDom = tableToolsPrefix + fromNullable(this.sDom).or(DT_DEFAULT_OPTIONS.dom);
            this.hasTableTools = true;
            if (angular.isString(sSwfPath)) {
              this.withTableToolsOption('sSwfPath', sSwfPath);
            }
            return this;
          },
          withTableToolsButtons: function (aButtons) {
            if (angular.isArray(aButtons)) {
              this.withTableToolsOption('aButtons', aButtons);
            }
            return this;
          },
          withScroller: function () {
            var scrollerSuffix = 'S';
            this.sDom = fromNullable(this.sDom).or(DT_DEFAULT_OPTIONS.dom) + scrollerSuffix;
            return this;
          }
        };
      return {
        newOptions: function () {
          return Object.create(DTOptions);
        },
        fromSource: function (sAjaxSource) {
          var options = Object.create(DTOptions);
          options.sAjaxSource = sAjaxSource;
          return options;
        },
        fromFnPromise: function (fnPromise) {
          var options = Object.create(DTOptions);
          options.fnPromise = fnPromise;
          return options;
        }
      };
    }
  ]).factory('DTColumnBuilder', function () {
    /**
     * The wrapped datatables column
     * @param mData the data to display of the column
     * @param sTitle the sTitle of the column title to display in the DOM
     */
    var DTColumn = {
        withOption: function (key, value) {
          if (angular.isString(key)) {
            this[key] = value;
          }
          return this;
        },
        withTitle: function (sTitle) {
          this.sTitle = sTitle;
          return this;
        },
        withClass: function (sClass) {
          this.sClass = sClass;
          return this;
        },
        notVisible: function () {
          this.bVisible = false;
          return this;
        },
        notSortable: function () {
          this.bSortable = false;
          return this;
        },
        renderWith: function (mRender) {
          this.mRender = mRender;
          return this;
        }
      };
    return {
      newColumn: function (mData, sTitle) {
        if (angular.isUndefined(mData)) {
          throw new Error('The parameter "mData" is not defined!');
        }
        var column = Object.create(DTColumn);
        column.mData = mData;
        column.sTitle = sTitle || '';
        return column;
      },
      DTColumn: DTColumn
    };
  }).factory('DTColumnDefBuilder', [
    'DTColumnBuilder',
    function (DTColumnBuilder) {
      return {
        newColumnDef: function (targets) {
          if (angular.isUndefined(targets)) {
            throw new Error('The parameter "targets" must be defined! See https://datatables.net/reference/option/columnDefs.targets');
          }
          var column = Object.create(DTColumnBuilder.DTColumn);
          if (angular.isArray(targets)) {
            column.aTargets = targets;
          } else {
            column.aTargets = [targets];
          }
          return column;
        }
      };
    }
  ]).factory('DTLoadingTemplate', function () {
    return { html: '
Loading...
' };
  });
  'use strict';
  angular.module('datatables', [
    'datatables.directive',
    'datatables.factory',
    'datatables.bootstrap'
  ]).run([
    '$log',
    function ($log) {
      if ($.fn.DataTable.Api) {
        /**
         * Register an API to destroy a DataTable without detaching the tbody so that we can add new data
         * when rendering with the "Angular way".
         */
        $.fn.DataTable.Api.register('ngDestroy()', function (remove) {
          remove = remove || false;
          return this.iterator('table', function (settings) {
            var orig = settings.nTableWrapper.parentNode;
            var classes = settings.oClasses;
            var table = settings.nTable;
            var tbody = settings.nTBody;
            var thead = settings.nTHead;
            var tfoot = settings.nTFoot;
            var jqTable = $(table);
            var jqTbody = $(tbody);
            var jqWrapper = $(settings.nTableWrapper);
            var rows = $.map(settings.aoData, function (r) {
                return r.nTr;
              });
            var ien;
            // Flag to note that the table is currently being destroyed - no action
            // should be taken
            settings.bDestroying = true;
            // Fire off the destroy callbacks for plug-ins etc
            $.fn.DataTable.ext.internal._fnCallbackFire(settings, 'aoDestroyCallback', 'destroy', [settings]);
            // If not being removed from the document, make all columns visible
            if (!remove) {
              new $.fn.DataTable.Api(settings).columns().visible(true);
            }
            // Blitz all `DT` namespaced events (these are internal events, the
            // lowercase, `dt` events are user subscribed and they are responsible
            // for removing them
            jqWrapper.unbind('.DT').find(':not(tbody *)').unbind('.DT');
            $(window).unbind('.DT-' + settings.sInstance);
            // When scrolling we had to break the table up - restore it
            if (table !== thead.parentNode) {
              jqTable.children('thead').detach();
              jqTable.append(thead);
            }
            if (tfoot && table !== tfoot.parentNode) {
              jqTable.children('tfoot').detach();
              jqTable.append(tfoot);
            }
            // Remove the DataTables generated nodes, events and classes
            jqTable.detach();
            jqWrapper.detach();
            settings.aaSorting = [];
            settings.aaSortingFixed = [];
            $.fn.DataTable.ext.internal._fnSortingClasses(settings);
            $(rows).removeClass(settings.asStripeClasses.join(' '));
            $('th, td', thead).removeClass(classes.sSortable + ' ' + classes.sSortableAsc + ' ' + classes.sSortableDesc + ' ' + classes.sSortableNone);
            if (settings.bJUI) {
              $('th span.' + classes.sSortIcon + ', td span.' + classes.sSortIcon, thead).detach();
              $('th, td', thead).each(function () {
                var wrapper = $('div.' + classes.sSortJUIWrapper, this);
                $(this).append(wrapper.contents());
                wrapper.detach();
              });
            }
            // -------------------------------------------------------------------------
            // This is the only change with the "destroy()" API (with DT v1.10.1)
            // -------------------------------------------------------------------------
            if (!remove && orig) {
              // insertBefore acts like appendChild if !arg[1]
              try {
                orig.insertBefore(table, settings.nTableReinsertBefore);
              } catch (ex) {
                $log.warn(ex);
                orig.appendChild(table);
              }
            }
            // Add the TR elements back into the table in their original order
            // jqTbody.children().detach();
            // jqTbody.append( rows );
            // -------------------------------------------------------------------------
            // Restore the width of the original table - was read from the style property,
            // so we can restore directly to that
            jqTable.css('width', settings.sDestroyWidth).removeClass(classes.sTable);
            // If the were originally stripe classes - then we add them back here.
            // Note this is not fool proof (for example if not all rows had stripe
            // classes - but it's a good effort without getting carried away
            ien = settings.asDestroyStripes.length;
            if (ien) {
              jqTbody.children().each(function (i) {
                $(this).addClass(settings.asDestroyStripes[i % ien]);
              });
            }
            /* Remove the settings object from the settings array */
            var idx = $.inArray(settings, $.fn.DataTable.settings);
            if (idx !== -1) {
              $.fn.DataTable.settings.splice(idx, 1);
            }
          });
        });
      }
    }
  ]);
  'use strict';
  angular.module('datatables.options', []).constant('DT_DEFAULT_OPTIONS', {
    dom: 'lfrtip',
    sAjaxDataProp: '',
    aoColumns: []
  }).service('DTDefaultOptions', function () {
    this.bootstrapOptions = {};
    /**
     * Set the default language source for all datatables
     * @param sLanguageSource the language source
     * @returns {DTDefaultOptions} the default option config
     */
    this.setLanguageSource = function (sLanguageSource) {
      $.extend($.fn.dataTable.defaults, { oLanguage: { sUrl: sLanguageSource } });
      return this;
    };
    /**
     * Set the language for all datatables
     * @param oLanguage the language
     * @returns {DTDefaultOptions} the default option config
     */
    this.setLanguage = function (oLanguage) {
      $.extend(true, $.fn.dataTable.defaults, { oLanguage: oLanguage });
      return this;
    };
    /**
     * Set the default number of items to display for all datatables
     * @param iDisplayLength the number of items to display
     * @returns {DTDefaultOptions} the default option config
     */
    this.setDisplayLength = function (iDisplayLength) {
      $.extend($.fn.dataTable.defaults, { iDisplayLength: iDisplayLength });
      return this;
    };
    /**
     * Set the default options to be use for Bootstrap integration.
     * See https://github.com/l-lin/angular-datatables/blob/dev/src/angular-datatables.bootstrap.options.js to check
     * what default options Angular DataTables is using.
     * @param oBootstrapOptions an object containing the default options for Bootstreap integration
     * @returns {DTDefaultOptions} the default option config
     */
    this.setBootstrapOptions = function (oBootstrapOptions) {
      this.bootstrapOptions = oBootstrapOptions;
      return this;
    };
  });
  'use strict';
  angular.module('datatables.renderer', [
    'datatables.factory',
    'datatables.options'
  ]).factory('DTRendererService', [
    'DTLoadingTemplate',
    function (DTLoadingTemplate) {
      var $loading = angular.element(DTLoadingTemplate.html);
      return {
        getLoadingElem: function () {
          return $loading;
        },
        showLoading: function ($elem) {
          $elem.after($loading);
          $elem.hide();
          $loading.show();
        },
        hideLoading: function ($elem) {
          $elem.show();
          $loading.hide();
        },
        renderDataTableAndEmitEvent: function ($elem, options, $scope) {
          var dtId = '#' + $elem.attr('id');
          if ($.fn.dataTable.isDataTable(dtId)) {
            options.destroy = true;
          }
          var oTable = $elem.DataTable(options);
          // See http://datatables.net/manual/api#Accessing-the-API to understand the difference between DataTable and dataTable
          $scope.$emit('event:dataTableLoaded', {
            id: $elem.attr('id'),
            DataTable: oTable,
            dataTable: $elem.dataTable()
          });
          return oTable;
        },
        doRenderDataTable: function ($elem, options, $scope) {
          this.hideLoading($elem);
          return this.renderDataTableAndEmitEvent($elem, options, $scope);
        }
      };
    }
  ]).factory('DTRenderer', function () {
    return {
      withOptions: function (options) {
        this.options = options;
        return this;
      }
    };
  }).factory('DTDefaultRenderer', [
    '$timeout',
    'DTRenderer',
    'DTRendererService',
    function ($timeout, DTRenderer, DTRendererService) {
      /**
     * Default renderer without any server call
     * @constructor
     */
      return {
        create: function (options) {
          var renderer = Object.create(DTRenderer);
          renderer.name = 'DTDefaultRenderer';
          renderer.options = options;
          renderer.render = function ($scope, $elem) {
            var _this = this;
            // Add $timeout to be sure that angular has finished rendering before calling datatables
            $timeout(function () {
              DTRendererService.doRenderDataTable($elem, _this.options, $scope);
            }, 0, false);
            return _this;
          };
          return renderer;
        }
      };
    }
  ]).factory('DTNGRenderer', [
    '$compile',
    '$timeout',
    'DTRenderer',
    'DTRendererService',
    function ($compile, $timeout, DTRenderer, DTRendererService) {
      /**
     * Renderer for displaying the Angular way
     * @param options
     * @returns {{options: *}} the renderer
     * @constructor
     */
      return {
        create: function (options) {
          var renderer = Object.create(DTRenderer);
          renderer.name = 'DTNGRenderer';
          renderer.options = options;
          renderer.render = function ($scope, $elem, staticHTML) {
            var _this = this, expression = $elem.find('tbody').html(),
              // Find the resources from the comment  displayed by angular in the DOM
              // This regexp is inspired by the one used in the "ngRepeat" directive
              match = expression.match(/^\s*.+?\s+in\s+(\S*)\s*/), ngRepeatAttr = match[1];
            if (!match) {
              throw new Error('Expected expression in form of "_item_ in _collection_[ track by _id_]" but got "{0}".', expression);
            }
            var oTable, alreadyRendered = false, parentScope = $scope.$parent;
            parentScope.$watchCollection(ngRepeatAttr, function () {
              if (oTable && alreadyRendered) {
                oTable.ngDestroy();
                // Re-compile because we lost the angular binding to the existing data
                $elem.html(staticHTML);
                $compile($elem.contents())(parentScope);
              }
              $timeout(function () {
                alreadyRendered = true;
                oTable = DTRendererService.doRenderDataTable($elem, _this.options, $scope);
              }, 0, false);
            }, true);
            return _this;
          };
          return renderer;
        }
      };
    }
  ]).factory('DTPromiseRenderer', [
    '$timeout',
    'DTRenderer',
    'DTRendererService',
    function ($timeout, DTRenderer, DTRendererService) {
      /**
     * Renderer for displaying with a promise
     * @param options the options
     * @returns {{options: *}} the renderer
     * @constructor
     */
      return {
        create: function (options) {
          var oTable,
            // Reloading data call the "render()" function again, so it
            // might $watch again. So this flag is here to prevent that!
            _watcherInitialized = false, _render = function (options, $elem, data, $scope) {
              // Since Angular 1.3, the promise renderer is throwing "Maximum call stack size exceeded"
              // By removing the $promise attribute, we avoid an infinite loop when jquery is cloning the data
              // See https://github.com/l-lin/angular-datatables/issues/110
              delete data.$promise;
              options.aaData = data;
              // Add $timeout to be sure that angular has finished rendering before calling datatables
              $timeout(function () {
                DTRendererService.hideLoading($elem);
                // Set it to true in order to be able to redraw the dataTable
                options.bDestroy = true;
                // Condition to refresh the dataTable
                if (oTable) {
                  oTable.clear();
                  oTable.rows.add(options.aaData).draw();
                } else {
                  oTable = DTRendererService.renderDataTableAndEmitEvent($elem, options, $scope);
                }
              }, 0, false);
            };
          var renderer = Object.create(DTRenderer);
          renderer.name = 'DTPromiseRenderer';
          renderer.options = options;
          renderer.render = function ($scope, $elem) {
            var _this = this, _loadedPromise = null, _whenLoaded = function (result) {
                var data = result;
                // In case the data is nested in an object
                if (_this.options.sAjaxDataProp) {
                  data = result[_this.options.sAjaxDataProp];
                }
                _render(_this.options, $elem, data, $scope);
                _loadedPromise = null;
              }, _startLoading = function (fnPromise) {
                if (angular.isFunction(fnPromise)) {
                  _loadedPromise = fnPromise();
                } else {
                  _loadedPromise = fnPromise;
                }
                _loadedPromise.then(_whenLoaded);
              }, _reload = function (fnPromise) {
                if (angular.isDefined(fnPromise)) {
                  if (_loadedPromise) {
                    _loadedPromise.then(function () {
                      _startLoading(fnPromise);
                    });
                  } else {
                    _startLoading(fnPromise);
                  }
                } else {
                  throw new Error('You must provide a promise or a function that returns a promise!');
                }
              };
            if (!_watcherInitialized) {
              $scope.$watch('dtOptions.fnPromise', function (fnPromise, oldPromise) {
                if (fnPromise !== oldPromise) {
                  _reload(fnPromise);
                }
              });
              _watcherInitialized = true;
            }
            _reload($scope.dtOptions.fnPromise);
            return _this;
          };
          return renderer;
        }
      };
    }
  ]).factory('DTAjaxRenderer', [
    '$timeout',
    'DTRenderer',
    'DTRendererService',
    'DT_DEFAULT_OPTIONS',
    function ($timeout, DTRenderer, DTRendererService, DT_DEFAULT_OPTIONS) {
      /**
     * Renderer for displaying with Ajax
     * @param options the options
     * @returns {{options: *}} the renderer
     * @constructor
     */
      return {
        create: function (options) {
          var oTable, _setOptionsAndRender = function (options, sAjaxSource, $elem, $scope) {
              if (angular.isDefined(sAjaxSource)) {
                options.sAjaxSource = sAjaxSource;
                if (angular.isDefined(options.ajax)) {
                  if (angular.isObject(options.ajax)) {
                    options.ajax.url = sAjaxSource;
                  } else {
                    options.ajax = { url: sAjaxSource };
                  }
                }
              }
              _render(options, $elem, $scope);
            }, _render = function (options, $elem, $scope) {
              // Set it to true in order to be able to redraw the dataTable
              options.bDestroy = true;
              // Add $timeout to be sure that angular has finished rendering before calling datatables
              $timeout(function () {
                DTRendererService.hideLoading($elem);
                // Condition to refresh the dataTable
                if (oTable) {
                  var ajaxUrl = options.sAjaxSource || options.ajax.url || options.ajax;
                  oTable.ajax.url(ajaxUrl).load();
                } else {
                  oTable = DTRendererService.renderDataTableAndEmitEvent($elem, options, $scope);
                }
              }, 0, false);
            };
          var renderer = Object.create(DTRenderer);
          renderer.name = 'DTAjaxRenderer';
          renderer.options = options;
          renderer.render = function ($scope, $elem) {
            var _this = this;
            // Define default values in case it is an ajax datatables
            if (angular.isUndefined(_this.options.sAjaxDataProp)) {
              _this.options.sAjaxDataProp = DT_DEFAULT_OPTIONS.sAjaxDataProp;
            }
            if (angular.isUndefined(_this.options.aoColumns)) {
              _this.options.aoColumns = DT_DEFAULT_OPTIONS.aoColumns;
            }
            _setOptionsAndRender(_this.options, _this.options.sAjaxSource, $elem, $scope);
            return this;
          };
          return renderer;
        }
      };
    }
  ]).factory('DTRendererFactory', [
    'DTDefaultRenderer',
    'DTNGRenderer',
    'DTPromiseRenderer',
    'DTAjaxRenderer',
    function (DTDefaultRenderer, DTNGRenderer, DTPromiseRenderer, DTAjaxRenderer) {
      return {
        fromOptions: function (options, isNgDisplay) {
          if (isNgDisplay) {
            return DTNGRenderer.create(options);
          }
          if (angular.isDefined(options)) {
            if (angular.isDefined(options.fnPromise) && options.fnPromise !== null) {
              return DTPromiseRenderer.create(options);
            }
            if (angular.isDefined(options.sAjaxSource) && options.sAjaxSource !== null || angular.isDefined(options.ajax) && options.ajax !== null) {
              return DTAjaxRenderer.create(options);
            }
            return DTDefaultRenderer.create(options);
          }
          return DTDefaultRenderer.create();
        }
      };
    }
  ]);
  'use strict';
  angular.module('datatables.util', []).factory('DTPropertyUtil', function () {
    return {
      overrideProperties: function (source, target) {
        var result = angular.copy(source);
        if (angular.isUndefined(result) || result === null) {
          result = {};
        }
        if (angular.isUndefined(target) || target === null) {
          return result;
        }
        if (angular.isObject(target)) {
          for (var prop in target) {
            if (target.hasOwnProperty(prop)) {
              result[prop] = this.overrideProperties(result[prop], target[prop]);
            }
          }
        } else {
          result = angular.copy(target);
        }
        return result;
      },
      deleteProperty: function (obj, propertyName) {
        if (angular.isObject(obj)) {
          delete obj[propertyName];
        }
      }
    };
  });
}(window, document, jQuery, angular));


text:
@class Lens;

@interface NSDictionary (Lenses)
+ (Lens*)lensToKey:(id<NSCopying>)key;
@end

redpajama_set_name: RedPajamaGithub


text:
module HdocHandler
  # maybe I should make these class methods so that specific scrapes can call them as well
  # saving docs locally to speed things up
  def get_hdoc(url, agent)
    if !File.exists? 'pages'
      File.makedirs 'pages'
    end
    filename = 'pages/' + url_to_file_name(url)
    if !File.exists? filename
      puts "Downloading #{url}"
      hdoc = download_hdoc(url, agent)
      write_hdoc(filename, hdoc)
    end
    File.open(filename) do |f|
      Hpricot(f.read)
    end
  end

  def download_hdoc(url, agent)
    begin
      hdoc = agent.get(url)
    rescue OpenURI::HTTPError => m
      puts "Could not download: #{m}"
      sleep 10
      return Hpricot("")
    rescue WWW::Mechanize::ResponseCodeError => m
      puts "Could not download: #{m}"
      sleep 10
      return Hpricot("")
    end
    hdoc
  end

  def write_hdoc(filename, hdoc)
    File.open(filename, 'w+') do |f|
      f.puts hdoc.parser.to_html
    end
  end

  def url_to_file_name(url)
    url.strip.gsub(/[^-a-zA-Z0-9_]/, '_')
  end
end

module UrlHandler
  def full_url_from_current_path(path, current_path = nil)
    p = if path =~ /http:\/\//
      path
    elsif path =~ /^\// #absolute path, only need to join path to domain
      File.join(self.domain, path)
    elsif path =~ /^\.\//
      # path = path[2..-1]
      File.join(current_path.to_s, path)
    else #a relative url
      if current_path #have to check for this because index pages won't specify a current path
        File.join(File.dirname(current_path), path.to_s)
      else
        File.join(self.domain, path)
      end
    end
    p.clean_url
  end

  #validation
  def check_url(url)
    http_getter = Net::HTTP
    uri = URI.parse(url.gsub(/\s/, "%20"))
    response = http_getter.start(uri.host, uri.port) {|http|
      path = [uri.path, uri.query].compact.join("?")
      puts "---#{path}"
      begin
        http.get(path)
      rescue Timeout::Error
        return false
      end
    }
  end
end


text:
<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wikidot="http://www.wikidot.com/rss-namespace">

	<channel>
		<title>Comments for page "Easy Money Tournament"</title>
		<link>http://bvs.wikidot.com/forum/t-226214/easy-money-tournament</link>
		<description>Posts in the discussion thread "Easy Money Tournament"</description>
				<copyright></copyright>
		<lastBuildDate>Sun, 10 Jul 2022 03:57:23 +0000</lastBuildDate>

				</channel>
</rss>


text:
package net.sf.txt2srt;

import static org.fest.assertions.Assertions.assertThat;

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

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

public class ConverterTest {

	private static final int DURATION = 0;
	private static final int FRAMERATE = 25;
	private static final String ENCODING_CP1250 = "cp1250";
	private static final String INPUT_SAMPLE_SUBTITLE_MPL2 = "src/test/resources/sample.txt";
	private static final String CONVERTED_SAMPLE_SUBTITLE_SRT = "src/test/resources/sample.srt";
	private static final String CONVERTED_SAMPLE_SUBTITLE_SRT_TARGET = "target/sample.srt";

	Converter conv;

	private File resultFile;

	@Before
	public void setup() {
		resultFile = new File(CONVERTED_SAMPLE_SUBTITLE_SRT);
		cleanup();
		assertThat(resultFile.isFile()).isFalse();
		conv = new Converter();
	}

	@After
	public void cleanup() {
		if (resultFile != null && resultFile.exists()) {
			resultFile.delete();
		}
	}

	@Test
	public void shouldReadTypeFromSpecifiedSubtitleFile()
			throws FileNotFoundException, IOException {
		Subtitles subtitles = conv.readSubtitle(INPUT_SAMPLE_SUBTITLE_MPL2,
				ENCODING_CP1250, FRAMERATE, DURATION);

		assertThat(subtitles.getSourceFormat()).isNotEmpty();
		assertThat(subtitles.getSourceFormat()).isEqualTo("mpl2");

	}

	public void shouldWriteSubtitle() throws FileNotFoundException, IOException {

		Subtitles subtitles = conv.readSubtitle(INPUT_SAMPLE_SUBTITLE_MPL2,
				ENCODING_CP1250, FRAMERATE, DURATION);

		String result = conv.writeSubtitle(subtitles);

		assertThat(result).isEqualTo(resultFile.getPath());
		assertThat(resultFile.exists() && resultFile.isFile()).isTrue();

	}

	@Test
	public void shouldCreateSrtSubtitle() throws IOException {

		conv.convert(INPUT_SAMPLE_SUBTITLE_MPL2,
				CONVERTED_SAMPLE_SUBTITLE_SRT_TARGET, ENCODING_CP1250,
				FRAMERATE, 0);

		resultFile = new File(CONVERTED_SAMPLE_SUBTITLE_SRT_TARGET);

		assertThat(resultFile.exists() && resultFile.isFile()).isTrue();
	}

	@Test
	public void shouldCreateSrtSubtitleInThisSameDir() throws IOException {

		conv = new Converter();

		String result = conv.convert(INPUT_SAMPLE_SUBTITLE_MPL2,
				ENCODING_CP1250, FRAMERATE, 0);

		System.out.println("Result is " + result);
		assertThat(result).isEqualTo(resultFile.getPath());
		assertThat(resultFile.exists() && resultFile.isFile()).isTrue();

	}
}


text:
import os
import shutil
import urllib.parse

from geekcms.protocol import BasePlugin
from geekcms.protocol import PluginController as pcl
from geekcms.utils import PathResolver, ShareData

from .assets import (Page, ArticlePage, TimeLinePage,
                     ArchivePage, AboutPage, IndexPage,
                     StaticFile)
from .utils import template_env

class OutputCleaner(BasePlugin):

    plugin = 'clean'

    def run(self, resources):
        for name in os.listdir(PathResolver.outputs()):
            if name.startswith('.'):
                continue

            path = os.path.join(
                PathResolver.outputs(),
                name,
            )
            if os.path.isfile(path):
                os.remove(path)
            elif os.path.isdir(path):
                shutil.rmtree(path)

class _TargetAbsPath:

    def _get_tgt_abs_path(self, tgt_rel_path):
        path = os.path.join(
            PathResolver.outputs(),
            tgt_rel_path,
        )
        return path

    def _make_sure_dir_exist(self, tgt_abs_path):
        dir_path, _ = os.path.split(tgt_abs_path)
        if not os.path.exists(dir_path):
            os.makedirs(dir_path)

class StaticWriter(BasePlugin, _TargetAbsPath):

    """
    1. Write static files of inputs.
    2. Write static files of themes.
    """

    plugin = 'write_static'

    @pcl.accept_parameters(
        (pcl.RESOURCES, StaticFile),
    )
    def run(self, static_files):
        for static_file in static_files:
            tgt_abs_path = self._get_tgt_abs_path(static_file.rel_path)
            self._make_sure_dir_exist(tgt_abs_path)
            shutil.copyfile(
                static_file.abs_path,
                tgt_abs_path,
            )

class PageWriter(BasePlugin, _TargetAbsPath):

    plugin = 'write_page'

    @pcl.accept_parameters(
        (pcl.PRODUCTS, Page),
    )
    def run(self, pages):
        for page in pages:
            tgt_abs_path = self._get_tgt_abs_path(page.rel_path)
            self._make_sure_dir_exist(tgt_abs_path)
            with open(tgt_abs_path, 'w') as f:
                f.write(page.text)

class CNAMEWriter(BasePlugin):

    plugin = 'cname'

    def run(self):
        domain = ShareData.get('global.domain')
        tgt_abs_path = os.path.join(
            PathResolver.outputs(),
            'CNAME',
        )
        with open(tgt_abs_path, 'w') as f:
            f.write(domain)

class SitemapGenerator(BasePlugin):

    plugin = 'sitemap'

    @pcl.accept_parameters(
        (pcl.PRODUCTS, Page),
    )
    def run(self, pages):
        # domain would not be escaped.
        http_domain = 'http://{}'.format(ShareData.get('global.domain'))

        # generate sitemap.
        urls = []
        for page in pages:
            url = urllib.parse.urljoin(
                http_domain,
                # escape page url.
                urllib.parse.quote(page.url),
            )
            urls.append(url)

        xml_template = template_env.get_template('simple_xml.xml')
        # url of sitemap would not be escaped.
        sitemap_abs_path = os.path.join(
            PathResolver.outputs(),
            'sitemap.xml',
        )
        with open(sitemap_abs_path, 'w') as f:
            xml_text = xml_template.render(urls=urls)
            f.write(xml_text)

        # add sitemap to robots.txt.
        robots_abs_path = os.path.join(
            PathResolver.outputs(),
            'robots.txt',
        )
        sitemap_url = urllib.parse.urljoin(
            http_domain,
            'sitemap.xml',
        )
        with open(robots_abs_path, 'a') as f:
            f.write('Sitemap: {}'.format(sitemap_url))


text:
Shortener::Application.routes.draw do
  devise_for :users

  root :to => "home#index"

  resources :home, only: [:index]

  resources :urls, only: [:new, :create, :show ] do
    collection do
      get 'popular'
    end
  end
end


text:
package mntent

import (
	"fmt"
	"io/ioutil"
	"os"
	"reflect"
	"strings"
	"testing"
)

func setup(lines []string, t *testing.T) (string, error) {
	file, err := ioutil.TempFile(os.TempDir(), "mntent_test")
	if err != nil {
		return "", err
	}
	defer file.Close()

	tempFileName := file.Name()

	_, err = file.Seek(0, 0)
	if err != nil {
		return "", err
	}

	err = file.Truncate(0)
	if err != nil {
		return "", err
	}

	for _, line := range lines {
		_, err := file.WriteString(line)
		if err != nil {
			return "", err
		}
		_, err = file.WriteString("\n")
		if err != nil {
			return "", err
		}
	}

	return tempFileName, nil
}

func teardown(filename string) {
	os.Remove(filename)
}

func TestFstab(t *testing.T) {
	data := []string{
		"# /etc/fstab: static file system information.",
		"#",
		"# Use 'blkid' to print the universally unique identifier for a",
		"# device; this may be used with UUID= as a more robust way to name devices",
		"# that works even if disks are added and removed. See fstab(5).",
		"#",
		"# <file system>                         <mount point>   <type>  <options>                           <dump>  <pass>",
		"/dev/mapper/vgssd-root                  /               ext4    noatime,discard,errors=remount-ro   0       1",
		"/dev/mapper/vg1-data                    /data           xfs     noatime,nodev,nosuid,noexec         0       2",
		"/dev/mapper/vg--raid1-home              /home           xfs     defaults                            0       2",
		"/dev/mapper/vg--raid1-var               /var            ext4    defaults                            0       2",
		"",
		"/dev/mapper/swap1			none            swap    sw                                  0       0",
		"/dev/mapper/swap2			none            swap    sw                                  0       0",
		"",
		"/dev/sr0                                /media/cdrom0   udf,iso9660 user,noauto                     0       0",
		"",
		"cgroup                                  /sys/fs/cgroup  cgroup  defaults                            0       0",
	}
	tabFileName, err := setup(data, t)
	if err != nil {
		t.Fatal(err)
		return
	}
	defer teardown(tabFileName)

	entries, err := Parse(tabFileName)
	if err != nil {
		t.Fatalf("Can't parse %s: %s", tabFileName, err)
	}

	expected := []Entry{
		Entry{
			Name:          "/dev/mapper/vgssd-root",
			Directory:     "/",
			Types:         []string{"ext4"},
			Options:       []string{"noatime", "discard", "errors=remount-ro"},
			DumpFrequency: 0,
			PassNumber:    1,
		},
		Entry{
			Name:          "/dev/mapper/vg1-data",
			Directory:     "/data",
			Types:         []string{"xfs"},
			Options:       []string{"noatime", "nodev", "nosuid", "noexec"},
			DumpFrequency: 0,
			PassNumber:    2,
		},
		Entry{
			Name:          "/dev/mapper/vg--raid1-home",
			Directory:     "/home",
			Types:         []string{"xfs"},
			Options:       []string{"defaults"},
			DumpFrequency: 0,
			PassNumber:    2,
		},
		Entry{
			Name:          "/dev/mapper/vg--raid1-var",
			Directory:     "/var",
			Types:         []string{"ext4"},
			Options:       []string{"defaults"},
			DumpFrequency: 0,
			PassNumber:    2,
		},
		Entry{
			Name:          "/dev/mapper/swap1",
			Directory:     "none",
			Types:         []string{"swap"},
			Options:       []string{"sw"},
			DumpFrequency: 0,
			PassNumber:    0,
		},
		Entry{
			Name:          "/dev/mapper/swap2",
			Directory:     "none",
			Types:         []string{"swap"},
			Options:       []string{"sw"},
			DumpFrequency: 0,
			PassNumber:    0,
		},
		Entry{
			Name:          "/dev/sr0",
			Directory:     "/media/cdrom0",
			Types:         []string{"udf", "iso9660"},
			Options:       []string{"user", "noauto"},
			DumpFrequency: 0,
			PassNumber:    0,
		},
		Entry{
			Name:          "cgroup",
			Directory:     "/sys/fs/cgroup",
			Types:         []string{"cgroup"},
			Options:       []string{"defaults"},
			DumpFrequency: 0,
			PassNumber:    0,
		},
	}

	if len(entries) != len(expected) {
		t.Fatalf("Expected %d filesystems but got %d", len(expected), len(entries))
	}

	for i, exp := range expected {
		t.Logf("Compare data for %q filesystem.", exp.Name)
		if entries[i].Name != exp.Name {
			t.Errorf("Expected %q filesystem but got %q", exp.Name, entries[i].Name)
		}
		if entries[i].Directory != exp.Directory {
			t.Errorf("Expected %q directory but got %q", exp.Directory, entries[i].Directory)
		}
		if !reflect.DeepEqual(entries[i].Types, exp.Types) {
			t.Errorf("Expected %v filesystem type but got %v", exp.Types, entries[i].Types)
		}
		if !reflect.DeepEqual(entries[i].Options, exp.Options) {
			t.Errorf("Expected %v filesystem options but got %v", exp.Options, entries[i].Options)
		}
		if entries[i].DumpFrequency != exp.DumpFrequency {
			t.Errorf("Expected %d dump frequency but got %d", exp.DumpFrequency, entries[i].DumpFrequency)
		}
		if entries[i].PassNumber != exp.PassNumber {
			t.Errorf("Expected %d pass number but got %d", exp.PassNumber, entries[i].PassNumber)
		}
	}

}

func ExampleFstab() {
	entries, err := Parse("/etc/fstab")
	if err != nil {
		fmt.Fprintf(os.Stderr, "Can't open /etc/fstab: %s\n", err)
		os.Exit(1)
	}

	for _, ent := range entries {
		fmt.Printf("FS name: %s\n", ent.Name)
		fmt.Printf("\tDir: %s\n", ent.Directory)
		fmt.Printf("\tTypes: %v\n", ent.Types)
		fmt.Printf("\tOptions: %s\n", strings.Join(ent.Options, ","))
		fmt.Printf("\tDump frequency: %d\n", ent.DumpFrequency)
		fmt.Printf("\tFSCK pass number: %d\n", ent.PassNumber)
	}
}


text:
/*
* Interval.h
*
*  Created on: 02-04-2015
*  Author: Jakub Kuderski
*/

#pragma once

#include <ostream>

#include "IntervalArithmetic.h"
#include "ErrorCode.h"

namespace ean
{
	class Interval final
	{
	public:
		static const char DivisionByZeroCode = 3;

		Interval() = default;
		Interval(long double left, long double right)
			: m_value({left, right})
		{}

		Interval(const std::string& value);

		long double getLeft() const { return m_value.a;  }
		std::string getLeftAsString() const;
		long double getRight() const { return m_value.b; }
		std::string getRightAsString() const;
		long double getWidth() const;

		Interval& operator+=(const Interval& rhs);
		Interval operator+(const Interval& rhs) const;

		Interval& operator-=(const Interval& rhs);
		Interval operator-(const Interval& rhs) const;

		Interval& operator*=(const Interval& rhs);
		Interval operator*(const Interval& rhs) const;

		Interval& operator/=(const Interval& rhs);
		Interval operator/(const Interval& rhs) const;

		bool operator==(const Interval& rhs) const;

		Interval& opposite();
		Interval getOpposite() const;
		Interval& invert();
		Interval getInverse() const;

		ErrorCode<Interval> sin() const;
		ErrorCode<Interval> cos() const;
		ErrorCode<Interval> exp() const;
		ErrorCode<Interval> sqr() const;

		static Interval sqrt2() { return {IntervalArithmetic::ISqr2()}; }
		static Interval sqrt3() { return {IntervalArithmetic::ISqr3()}; }
		static Interval pi() { return {IntervalArithmetic::IPi()}; }

		std::string to_string() const;

	private:
		Interval(IntervalArithmetic::interval interval);

		IntervalArithmetic::interval m_value = {0.0, 0.0};
	};

	inline std::ostream& operator<<(std::ostream& os, const Interval& value)
	{
		return os << value.to_string();
	}

} // namespace ean


text:
Download mpegts samples from:

http://dveo.com/downloads/TS-sample-files/San_Diego_Clip.ts

http://dveo.com/downloads/TS-sample-files/

http://www.dododge.net/roku/ts-samples.html

http://www.w6rz.net/


text:
$modulePath = Join-Path -Path (Split-Path -Path (Split-Path -Path $PSScriptRoot -Parent) -Parent) -ChildPath 'Modules'

# Import the ComputerManagementDsc Common Modules
Import-Module -Name (Join-Path -Path $modulePath `
        -ChildPath (Join-Path -Path 'ComputerManagementDsc.Common' `
            -ChildPath 'ComputerManagementDsc.Common.psm1'))

# Import the ComputerManagementDsc Resource Helper Module
Import-Module -Name (Join-Path -Path $modulePath `
        -ChildPath (Join-Path -Path 'ComputerManagementDsc.ResourceHelper' `
            -ChildPath 'ComputerManagementDsc.ResourceHelper.psm1'))

# Import Localization Strings
$script:localizedData = Get-LocalizedData `
    -ResourceName 'MSFT_WindowsEventLog' `
    -ResourcePath (Split-Path -Parent $Script:MyInvocation.MyCommand.Path)

<#
    .SYNOPSIS
        Gets the current state of the Windows Event Log.

    .PARAMETER LogName
        Specifies the given name of a Windows Event Log.
#>
function Get-TargetResource
{
    [CmdletBinding()]
    [OutputType([System.Collections.Hashtable])]
    param
    (
        [Parameter(Mandatory = $true)]
        [System.String]
        $LogName,

        [Parameter()]
        [System.Boolean]
        $IsEnabled
    )

    $log = Get-WindowsEventLog -LogName $LogName

    $LogRetentionDays = (Get-EventLog -List | Where-Object -Property Log -eq $LogName).minimumRetentionDays

    $returnValue = @{
        LogName            = [System.String] $LogName
        LogFilePath        = [system.String] $log.LogFilePath
        MaximumSizeInBytes = [System.Int64] $log.MaximumSizeInBytes
        IsEnabled          = [System.Boolean] $log.IsEnabled
        LogMode            = [System.String] $log.LogMode
        SecurityDescriptor = [System.String] $log.SecurityDescriptor
        LogRetentionDays   = [System.Int32] $logRetentionDays
    }

    Write-Verbose -Message ($localizedData.GettingEventlogName -f $LogName)
    return $returnValue
}

<#
    .SYNOPSIS
        Sets the current state of the Windows Event Log.

    .PARAMETER LogName
        Specifies the given name of a Windows Event Log.

    .PARAMETER MaximumSizeInBytes
        Specifies the given maximum size in bytes for a specified Windows Event Log.

    .PARAMETER LogMode
        Specifies the given LogMode for a specified Windows Event Log.

    .PARAMETER LogRetentionDays
        Specifies the given LogRetentionDays for the Logmode 'AutoBackup'.

    .PARAMETER SecurityDescriptor
        Specifies the given SecurityDescriptor for a specified Windows Event Log.

    .PARAMETER IsEnabled
        Specifies the given state of a Windows Event Log.

    .PARAMETER LogFilePath
        Specifies the given LogFile path of a Windows Event Log.
#>
function Set-TargetResource
{
    [CmdletBinding()]
    param
    (
        [Parameter(Mandatory = $true)]
        [System.String]
        $LogName,

        [Parameter()]
        [System.Boolean]
        $IsEnabled,

        [Parameter()]
        [System.Int64]
        $MaximumSizeInBytes,

        [Parameter()]
        [ValidateSet('AutoBackup', 'Circular', 'Retain')]
        [System.String]
        $LogMode,

        [Parameter()]
        [System.Int32]
        $LogRetentionDays,

        [Parameter()]
        [System.String]
        $SecurityDescriptor,

        [Parameter()]
        [System.String]
        $LogFilePath
    )

    $log = Get-WindowsEventLog -LogName $LogName

    if ($null -eq $log)
    {
        return
    }

    $shouldSaveLogFile = $false

    Write-Verbose -Message ($localizedData.GettingEventlogName -f $LogName)

    if ($IsEnabled -eq $true)
    {
        if ($PSBoundParameters.ContainsKey('IsEnabled') -and $IsEnabled -ne $log.IsEnabled)
        {
            Write-Verbose -Message ($localizedData.SettingEventlogIsEnabled -f $LogName, $IsEnabled)
            $log.IsEnabled = $IsEnabled
            $shouldSaveLogFile = $true
        }

        if ($PSBoundParameters.ContainsKey('MaximumSizeInBytes') -and $MaximumSizeInBytes -ne $log.MaximumSizeInBytes)
        {
            Write-Verbose -Message ($localizedData.SettingEventlogLogSize -f $LogName, $MaximumSizeInBytes)
            $log.MaximumSizeInBytes = $MaximumSizeInBytes
            $shouldSaveLogFile = $true
        }

        if ($PSBoundParameters.ContainsKey('LogMode') -and $LogMode -ne $log.LogMode)
        {
            Write-Verbose -Message ($localizedData.SettingEventlogLogMode -f $LogName, $LogMode)
            $log.LogMode = $LogMode
            $shouldSaveLogFile = $true
        }

        if ($PSBoundParameters.ContainsKey('SecurityDescriptor') -and $SecurityDescriptor -ne $log.SecurityDescriptor)
        {
            Write-Verbose -Message ($localizedData.SettingEventlogSecurityDescriptor -f $LogName, $SecurityDescriptor)
            $log.SecurityDescriptor = $SecurityDescriptor
            $shouldSaveLogFile = $true
        }

        if ($PSBoundParameters.ContainsKey('LogFilePath') -and $LogFilePath -ne $log.LogFilePath)
        {
            Write-Verbose -Message ($localizedData.SettingEventlogLogFilePath -f $LogName, $LogFilePath)
            $log.LogFilePath = $LogFilePath
            $shouldSaveLogFile = $true
        }
    }
    else
    {
        Write-Verbose -Message ($localizedData.SettingEventlogIsEnabled -f $LogName, $IsEnabled)
        $log.IsEnabled = $IsEnabled
        $shouldSaveLogFile = $true
    }

    if ($shouldSaveLogFile -eq $true)
    {
        Save-LogFile -Log $log
    }

    if ($PSBoundParameters.ContainsKey('LogRetentionDays'))
    {

        if ($LogMode -eq 'AutoBackup' -and (Get-EventLog -List | Where-Object {$_.Log -like $LogName}))
        {
            $matchingEventLog = Get-EventLog -List | Where-Object -FilterScript {
                $_.Log -eq $LogName
            }

            $minimumRetentionDaysForLog = $matchingEventLog.minimumRetentionDays

            if ($LogRetentionDays -ne $minimumRetentionDaysForLog)
            {
                Set-LogRetentionDays -LogName $LogName -LogRetentionDays $LogRetentionDays
            }
        }
        else
        {
            Write-Verbose -Message ($localizedData.EventlogLogRetentionDaysWrongMode -f $LogName)
        }
    }
}

<#
    .SYNOPSIS
        Tests if the the current state of the Windows Event Log is in the desired state.

    .PARAMETER LogName
        Specifies the given name of a Windows Event Log.

    .PARAMETER MaximumSizeInBytes
        Specifies the given maximum size in bytes for a specified Windows Event Log.

    .PARAMETER LogMode
        Specifies the given LogMode for a specified evWindows Event Logentlog.

    .PARAMETER LogRetentionDays
        Specifies the given LogRetentionDays for the Logmode 'AutoBackup'.

    .PARAMETER SecurityDescriptor
        Specifies the given SecurityDescriptor for a specified Windows Event Log.

    .PARAMETER IsEnabled
        Specifies the given state of a Windows Event Log.

    .PARAMETER LogFilePath
        Specifies the given LogFile path of a Windows Event Log.
#>
function Test-TargetResource
{
    [CmdletBinding()]
    [OutputType([System.Boolean])]
    param
    (
        [Parameter(Mandatory = $true)]
        [System.String]
        $LogName,

        [Parameter()]
        [System.Boolean]
        $IsEnabled,

        [Parameter()]
        [ValidateRange(1028kb, 18014398509481983kb)]
        [System.Int64]
        $MaximumSizeInBytes,

        [Parameter()]
        [ValidateSet('AutoBackup', 'Circular', 'Retain')]
        [System.String]
        $LogMode,

        [Parameter()]
        [ValidateRange(1, 365)]
        [System.Int32]
        $LogRetentionDays,

        [Parameter()]
        [System.String]
        $SecurityDescriptor,

        [Parameter()]
        [System.String]
        $LogFilePath
    )

    $log = Get-WindowsEventLog -LogName $LogName

    if ($null -eq $log)
    {
        return
    }

    $desiredState = $true

    if ($IsEnabled -eq $true)
    {

        if ($PSBoundParameters.ContainsKey('IsEnabled') -and $log.IsEnabled -ne $IsEnabled)
        {
            Write-Verbose -Message ($localizedData.TestingEventlogIsEnabled -f $LogName, $IsEnabled)
            $desiredState = $false
        }
        else
        {
            Write-Verbose -Message ($localizedData.SetResourceIsInDesiredState -f $LogName, 'IsEnabled')
        }

        if ($PSBoundParameters.ContainsKey('MaximumSizeInBytes') -and $log.MaximumSizeInBytes -ne $MaximumSizeInBytes)
        {
            Write-Verbose -Message ($localizedData.TestingEventlogMaximumSizeInBytes -f $LogName, $MaximumSizeInBytes)
            $desiredState = $false
        }
        else
        {
            Write-Verbose -Message ($localizedData.SetResourceIsInDesiredState -f $LogName, 'MaximumSizeInBytes')
        }

        if ($PSBoundParameters.ContainsKey('LogMode') -and $log.LogMode -ne $LogMode)
        {
            Write-Verbose -Message ($localizedData.TestingEventlogLogMode -f $LogName, $LogMode)
            $desiredState = $false
        }
        else
        {
            Write-Verbose -Message ($localizedData.SetResourceIsInDesiredState -f $LogName, 'LogMode')
        }

        if ($PSBoundParameters.ContainsKey('LogRetentionDays'))
        {

            if ($LogMode -eq 'AutoBackup')
            {
                $minimumRetentionDays = Get-EventLog -List | Where-Object -FilterScript { $_.Log -eq $LogName }

                if ($LogRetentionDays -ne $minimumRetentionDays.minimumRetentionDays)
                {
                    Write-Verbose -Message ($localizedData.TestingEventlogLogRetentionDays -f $LogName, $LogRetentionDays)
                    $desiredState = $false
                }
                else
                {
                    Write-Verbose -Message ($localizedData.SetResourceIsInDesiredState -f $LogName, 'LogRetentionDays')
                }
            }
            else
            {
                Write-Verbose -Message ($localizedData.EventlogLogRetentionDaysWrongMode -f $LogName)
                $desiredState = $false
            }
        }

        if ($PSBoundParameters.ContainsKey('LogFilePath') -and $log.LogFilePath -ne $LogFilePath)
        {
            Write-Verbose -Message ($localizedData.TestingWindowsEventlogLogFilePath -f $LogName, $LogFilePath)
            $desiredState = $false
        }
        else
        {
            Write-Verbose -Message ($localizedData.SetResourceIsInDesiredState -f $LogName, 'LogFilePath')
        }

        if ($PSBoundParameters.ContainsKey('SecurityDescriptor') -and $log.SecurityDescriptor -ne $SecurityDescriptor)
        {
            Write-Verbose -Message ($localizedData.TestingWindowsEventlogSecurityDescriptor -f $LogName, $SecurityDescriptor)
            $desiredState = $false
        }
        else
        {
            Write-Verbose -Message ($localizedData.SetResourceIsInDesiredState -f $LogName, 'SecurityDescriptor')
        }
    }
    else
    {
        if ($PSBoundParameters.ContainsKey('IsEnabled') -and $log.IsEnabled -ne $IsEnabled)
        {
            Write-Verbose -Message ($localizedData.TestingEventlogIsEnabled -f $LogName, $IsEnabled)
            $desiredState = $false
        }
        else
        {
            Write-Verbose -Message ($localizedData.SetResourceIsInDesiredState -f $LogName, 'IsEnabled')
        }
    }
    return $desiredState
}

<#
    .SYNOPSIS
        Helper function for the Windows Event Log.

    .PARAMETER Log
        Gets the specified Windows Event Log properties.
#>
Function Get-WindowsEventLog
{
    [CmdletBinding()]
    param
    (
        [Parameter(Mandatory = $true)]
        [System.String]
        $LogName
    )

    $log = Get-WinEvent -ListLog $LogName

    if (!$log)
    {
        Write-Warning `
            -Message ($script:localizedData.WindowsEventLogNotFound -f $LogName)
    }
    else
    {
        Write-Verbose -Message ($localizedData.WindowsEventLogFound -f $LogName)
        return $log
    }
}

<#
    .SYNOPSIS
        Save the Windows Event Log properties.

    .PARAMETER Log
        Specifies the given object of a Windows Event Log.
#>
Function Save-LogFile
{
    [CmdletBinding()]
    param
    (
        [Parameter(Mandatory = $true)]
        [System.Object]
        $Log
    )

    try
    {
        $Log.SaveChanges()
        Write-Verbose -Message ($localizedData.SaveWindowsEventlogSuccess)
    }
    catch
    {
        Write-Verbose -Message ($localizedData.SaveWindowsEventlogFailure)
    }
}

<#
    .SYNOPSIS
        Set the Log Retention for a Windows Event Log.

    .PARAMETER LogName
        Specifies the given name of a Windows Event Log.

    .PARAMETER Retention
        Specifies the given RetentionDays for LogMode Autobackup.
#>
Function Set-LogRetentionDays
{
    [CmdletBinding()]
    param
    (
        [Parameter(Mandatory = $true)]
        [System.String]
        $LogName,

        [Parameter(Mandatory = $true)]
        [System.Int32]
        $LogRetentionDays
    )

    Write-Verbose -Message ($localizedData.SettingEventlogLogRetentionDays -f $LogName, $LogRetentionDays)

    try
    {
        Limit-Eventlog -LogName $LogName -OverflowAction 'OverwriteOlder' -RetentionDays $LogRetentionDays
        Write-Verbose -Message ($localizedData.SettingWindowsEventlogRetentionDaysSuccess -f $LogName, $LogRetentionDays)
    }
    catch
    {
        Write-Verbose -Message ($localizedData.SettingWindowsEventlogRetentionDaysFailed -f $LogName, $LogRetentionDays)
    }
}

Export-ModuleMember -Function *-TargetResource


text:
_FUNCTION_
void wssl_buffer_printf
(
  _WSSL_MODIFY_       wssl_buffer_t* buffer,
  _WSSL_IN_     const char*          format,
                      ...
)
{
  va_list arguments;
  va_start(arguments, format);
  buffer->end = vsnprintf
  (
    (char*)&buffer->data[buffer->begin],
    (size_t)buffer->size,
    format,
    arguments
  );
  va_end(arguments);
}


text:
package org.eclipse.emf.cdo.eresource;

import org.eclipse.emf.cdo.common.lob.CDOBlob;

import java.io.InputStream;

/**
 *  A representation of the model object 'CDO Binary Resource'.
 *
 * @since 4.1
 * @noextend This interface is not intended to be extended by clients.
 * @noimplement This interface is not intended to be implemented by clients.
 *

 *              The following features are supported:
 *

 *
{@link org.eclipse.emf.cdo.eresource.CDOBinaryResource#getContents Contents}

 *

 *

 * @see org.eclipse.emf.cdo.eresource.EresourcePackage#getCDOBinaryResource()
 * @model
 * @generated
 */
public interface CDOBinaryResource extends CDOFileResource<InputStream>
{
  /**
   * Returns the value of the 'Contents' attribute.
   *

   * If the meaning of the 'Contents' attribute isn't clear, there really should be more of a description
   * here...
   *

   *
   *
   * @return the value of the 'Contents' attribute.
   * @see #setContents(CDOBlob)
   * @see org.eclipse.emf.cdo.eresource.EresourcePackage#getCDOBinaryResource_Contents()
   * @model dataType="org.eclipse.emf.cdo.etypes.Blob" required="true"
   * @generated
   */
  CDOBlob getContents();

  /**
   * Sets the value of the '{@link org.eclipse.emf.cdo.eresource.CDOBinaryResource#getContents Contents}'
   * attribute.
   *
   * @param value
   *          the new value of the 'Contents' attribute.
   * @see #getContents()
   * @generated
   */
  void setContents(CDOBlob value);

} // CDOBinaryResource


text:
'use strict';

/**
 * The result of a request to list container registries.
 */
class RegistryListResult extends Array {
  /**
   * Create a RegistryListResult.
   * @property {string} [nextLink] The URI that can be used to request the next
   * list of container registries.
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of RegistryListResult
   *
   * @returns {object} metadata of RegistryListResult
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'RegistryListResult',
      type: {
        name: 'Composite',
        className: 'RegistryListResult',
        modelProperties: {
          value: {
            required: false,
            serializedName: '',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'RegistryElementType',
                  type: {
                    name: 'Composite',
                    className: 'Registry'
                  }
              }
            }
          },
          nextLink: {
            required: false,
            serializedName: 'nextLink',
            type: {
              name: 'String'
            }
          }
        }
      }
    };
  }
}

module.exports = RegistryListResult;


text:
/**********************************
* SCAENA FRAMEWORK
* Author: Marco Andrés Lotto
* License: MIT - 2016
**********************************/

#include "UINumericInput.h"
#include <sstream>

#define BACKSPACE_KEY 8
#define DIRECTION_UP_KEY -101
#define DIRECTION_DOWN_KEY -103

#define VALUE_INCREMENT 0.1f

string modifyFloatValueUsingString(string in, float increment){
	float value = atof(in.c_str());
	value += increment;
	std::stringstream buff;
	buff << value;
	return buff.str();
}

void UINumericInput::setValue(float value){
	std::stringstream buff;
	buff << value;
	this->setText(buff.str());
}
void UINumericInput::setValue(int value){
	std::stringstream buff;
	buff << value;
	this->setText(buff.str());
}

void UINumericInput::onKeyDown(int key){
	//Verifico si se apreto backspace
	if(this->evaluateBackspacePress(key)){
		return;
	}

	//Verifico si se movio el cursor
	if(this->evaluateCursorMove(key)){
		return;
	}

	//Si se presionan las teclas de direccion se modifica el valor del input
	if(key == DIRECTION_UP_KEY){
		string stringValue = modifyFloatValueUsingString(this->getText(), VALUE_INCREMENT);
		stringValue = this->applyPadding(stringValue);
		this->setText(stringValue);
		return;
	}
	if(key == DIRECTION_DOWN_KEY){
		string stringValue = modifyFloatValueUsingString(this->getText(), -VALUE_INCREMENT);
		stringValue = this->applyPadding(stringValue);
		this->setText(stringValue);
		return;
	}

	//Verifico no superar el largo maximo
	string actualText = this->getText();
	if(actualText.length() >= this->getMaxSize()) return;

	//Verifico que sea un numero o un punto
	if(((key >= 48)&&(key <= 57)) || (key == 46)){
		//Append del numero
		this->addLetterInCursorPosition(key);
	}
}

string UINumericInput::applyPadding(string stringToPad){
	if(stringToPad.length() < this->getDisplaySize()){
		// Voy a buscar si el numero ya tiene punto
		unsigned int pointPosition = stringToPad.find(".");

		// Si se encontro un punto y hay algun caracter despues, termine
		if((pointPosition == string::npos) && (pointPosition + 1 < stringToPad.length() - 1)){
			return stringToPad;
		}

		// Si no encontro un punto, agrego el punto y un cero
		if(pointPosition == string::npos){
			stringToPad += ".0";
		}
	}
	return stringToPad;
}


text:
<?php

class Twig_Node_Expression_Test extends Twig_Node_Expression_Call
{
    public function __construct(Twig_Node $node, $name, Twig_Node $arguments = null, $lineno)
    {
        $nodes = ['node' => $node];
        if (null !== $arguments) {
            $nodes['arguments'] = $arguments;
        }

        parent::__construct($nodes, ['name' => $name], $lineno);
    }

    public function compile(Twig_Compiler $compiler)
    {
        $name = $this->getAttribute('name');
        $test = $compiler->getEnvironment()->getTest($name);

        $this->setAttribute('name', $name);
        $this->setAttribute('type', 'test');
        $this->setAttribute('arguments', $test->getArguments());
        $this->setAttribute('callable', $test->getCallable());
        $this->setAttribute('is_variadic', $test->isVariadic());

        $this->compileCallable($compiler);
    }
}

class_alias('Twig_Node_Expression_Test', 'Twig\Node\Expression\TestExpression', false);


text:
module Configspec
  module Helper
    module Type
      types = %w( base package dockerfile file )

      types.each {|type| require "configspec/type/#{type}" }

      types.each do |type|
        define_method type do |*args|
          name = args.first
          self.class.const_get('Configspec').const_get('Type').const_get(camelize(type)).new(name)
        end
      end

      def camelize(string)
        string.split("_").each {|s| s.capitalize! }.join("")
      end
    end
  end
end


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

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.camunda.bpm.engine.ProcessEngine;

/**
 * A provider to handle the authentication of {@link HttpServletRequest}s.
 * May implement a specific authentication scheme.
 *
 * @author Thorben Lindhauer
 */
public interface AuthenticationProvider {

  /**
   * Checks the request for authentication. May not return null, but always an {@link AuthenticationResult} that indicates, whether
   * authentication was successful, and, if true, always provides the authenticated user.
   *
   * @param request the request to authenticate
   * @param engine the process engine the request addresses. May be used to authenticate against the engine's identity service.
   */
  AuthenticationResult extractAuthenticatedUser(HttpServletRequest request, ProcessEngine engine);

  /**
   *

   * Callback to add an authentication challenge to the response to the client. Called in case of unsuccessful authentication.
   *

   *
   *

   * For example, a Http Basic auth implementation may set the WWW-Authenticate header to Basic realm="engine name".
   *

   *
   * @param request the response to augment
   * @param engine the process engine the request addressed. May be considered as an authentication realm to create a specific authentication
   * challenge
   */
  void augmentResponseByAuthenticationChallenge(HttpServletResponse response, ProcessEngine engine);
}


text:
<?php

require_once __DIR__ . '/components/RChars.php';
require_once __DIR__ . '/components/RAnyChar.php';
require_once __DIR__ . '/components/RGroup.php';
require_once __DIR__ . '/components/RSingleLineExpression.php';
require_once __DIR__ . '/components/RMultiLineExpression.php';
require_once __DIR__ . '/components/RLookAhead.php';
require_once __DIR__ . '/components/RLookBehind.php';

/**
 * Factory class for several R objects.
 *
 * @author Patrick van Bergen
 */
class R
{
	/**
	 * @return RSingleLineExpression
	 */
	public static function expression()
	{
		return new RSingleLineExpression();
	}

	/**
	 * @return RMultiLineExpression
	 */
	public static function multiLineExpression()
	{
		return new RMultiLineExpression();
	}

	/**
	 * @param string $name
	 * @return RGroup
	 */
	public static function group($name = null)
	{
		return new RGroup($name);
	}

	/**
	 * @return RLookAhead
	 */
	public static function lookAhead()
	{
		return new RLookAhead();
	}

	/**
	 * @return RLookBehind
	 */
	public static function lookBehind()
	{
		return new RLookBehind();
	}

	/**
	 * @return RAnyChar
	 */
	public static function anyChar()
	{
		return new RAnyChar();
	}

	/**
	 * @param string $chars
	 * @return RChars
	 */
	public static function chars($chars = '')
	{
		return new RChars($chars);
	}

}