text:
var Datepicker;

(function (window, $, undefined) {
    var pluginName = 'datepicker',
        autoInitSelector = '.datepicker-here',
        $body, $datepickersContainer,
        containerBuilt = false,
        baseTemplate = '' +
            '
' +
            '' +
            '' +
            '

' +
            '
',
        defaults = {
            classes: '',
            inline: false,
            language: 'ru',
            startDate: new Date(),
            firstDay: '',
            weekends: [6, 0],
            dateFormat: '',
            altField: '',
            altFieldDateFormat: '@',
            toggleSelected: true,
            keyboardNav: true,

            position: 'bottom left',
            offset: 12,

            view: 'days',
            minView: 'days',

            showOtherMonths: true,
            selectOtherMonths: true,
            moveToOtherMonthsOnSelect: true,

            showOtherYears: true,
            selectOtherYears: true,
            moveToOtherYearsOnSelect: true,

            minDate: '',
            maxDate: '',
            disableNavWhenOutOfRange: true,

            multipleDates: false, // Boolean or Number
            multipleDatesSeparator: ',',

            todayButton: false,
            clearButton: false,

            showEvent: 'focus',
            autoClose: false,

            // navigation
            monthsFiled: 'monthsShort',
            prevHtml: '<svg><path d="M 17,12 l -5,5 l 5,5"></path></svg>',
            nextHtml: '<svg><path d="M 14,12 l 5,5 l -5,5"></path></svg>',
            navTitles: {
                days: 'MM, yyyy',
                months: 'yyyy',
                years: 'yyyy1 - yyyy2'
            },

            // events
            onSelect: '',
            onChangeMonth: '',
            onChangeYear: '',
            onChangeDecade: '',
            onChangeView: '',
            onRenderCell: ''
        },
        hotKeys = {
            'ctrlRight': [17, 39],
            'ctrlUp': [17, 38],
            'ctrlLeft': [17, 37],
            'ctrlDown': [17, 40],
            'shiftRight': [16, 39],
            'shiftUp': [16, 38],
            'shiftLeft': [16, 37],
            'shiftDown': [16, 40],
            'altUp': [18, 38],
            'altRight': [18, 39],
            'altLeft': [18, 37],
            'altDown': [18, 40],
            'ctrlShiftUp': [16, 17, 38]
        };

    Datepicker  = function (el, options) {
        this.el = el;
        this.$el = $(el);

        this.opts = $.extend(true, {}, defaults, options, this.$el.data());

        if ($body == undefined) {
            $body = $('body');
        }

        if (!this.opts.startDate) {
            this.opts.startDate = new Date();
        }

        if (this.el.nodeName == 'INPUT') {
            this.elIsInput = true;
        }

        if (this.opts.altField) {
            this.$altField = typeof this.opts.altField == 'string' ? $(this.opts.altField) : this.opts.altField;
        }

        this.inited = false;
        this.visible = false;
        this.silent = false; // Need to prevent unnecessary rendering

        this.currentDate = this.opts.startDate;
        this.currentView = this.opts.view;
        this._createShortCuts();
        this.selectedDates = [];
        this.views = {};
        this.keys = [];

        this.init()
    };

    Datepicker.prototype = {
        viewIndexes: ['days', 'months', 'years'],

        init: function () {
            if (!containerBuilt && !this.opts.inline && this.elIsInput) {
                this._buildDatepickersContainer();
            }
            this._buildBaseHtml();
            this._defineLocale(this.opts.language);
            this._syncWithMinMaxDates();

            if (this.elIsInput) {
                if (!this.opts.inline) {
                    // Set extra classes for proper transitions
                    this._setPositionClasses(this.opts.position);
                    this._bindEvents()
                }
            }

            if (this.opts.classes) {
                this.$datepicker.addClass(this.opts.classes)
            }

            this.views[this.currentView] = new Datepicker.Body(this, this.currentView, this.opts);
            this.views[this.currentView].show();
            this.nav = new Datepicker.Navigation(this, this.opts);
            this.view = this.currentView;

            this.inited = true;
        },

        _createShortCuts: function () {
            this.minDate = this.opts.minDate ? this.opts.minDate : new Date(-8639999913600000);
            this.maxDate = this.opts.maxDate ? this.opts.maxDate : new Date(8639999913600000);
        },

        _bindEvents : function () {
            this.$el.on(this.opts.showEvent, this._onShowEvent.bind(this));
            this.$el.on('blur', this._onBlur.bind(this));
            this.$el.on('input', this._onInput.bind(this));
            this.$datepicker.on('mousedown', this._onMouseDownDatepicker.bind(this));
            this.$datepicker.on('mouseup', this._onMouseUpDatepicker.bind(this));
            $(window).on('resize', this._onResize.bind(this));

            if (this.opts.keyboardNav) {
                this.$el.on('keydown', this._onKeyDown.bind(this));
                this.$el.on('keyup', this._onKeyUp.bind(this));
                this.$el.on('hotKey', this._onHotKey.bind(this));
            }
        },

        isWeekend: function (day) {
            return this.opts.weekends.indexOf(day) !== -1;
        },

        _defineLocale: function (lang) {
            if (typeof lang == 'string') {
                this.loc = Datepicker.language[lang];
                if (!this.loc) {
                    console.warn('Can\'t find language "' + lang + '" in Datepicker.language, will use "ru" instead');
                    this.loc = $.extend(true, {}, Datepicker.language.ru)
                }

                this.loc = $.extend(true, {}, Datepicker.language.ru, Datepicker.language[lang])
            } else {
                this.loc = $.extend(true, {}, Datepicker.language.ru, lang)
            }

            if (this.opts.dateFormat) {
                this.loc.dateFormat = this.opts.dateFormat
            }

            if (this.opts.firstDay) {
                this.loc.firstDay = this.opts.firstDay
            }
        },

        _buildDatepickersContainer: function () {
            containerBuilt = true;
            $body.append('

');
            $datepickersContainer = $('#datepickers-container');
        },

        _buildBaseHtml: function () {
            var $appendTarget,
                $inline = $('
');

            if(this.el.nodeName == 'INPUT') {
                if (!this.opts.inline) {
                    $appendTarget = $datepickersContainer;
                } else {
                    $appendTarget = $inline.insertAfter(this.$el)
                }
            } else {
                $appendTarget = $inline.appendTo(this.$el)
            }

            this.$datepicker = $(baseTemplate).appendTo($appendTarget);
            this.$content = $('.datepicker--content', this.$datepicker);
            this.$nav = $('.datepicker--nav', this.$datepicker);
        },

        _triggerOnChange: function () {
            if (!this.selectedDates.length) {
                return this.opts.onSelect('', '', this);
            }

            var selectedDates = this.selectedDates,
                parsedSelected = Datepicker.getParsedDate(selectedDates[0]),
                formattedDates,
                _this = this,
                dates = new Date(parsedSelected.year, parsedSelected.month, parsedSelected.date);

                formattedDates = selectedDates.map(function (date) {
                    return _this.formatDate(_this.loc.dateFormat, date)
                }).join(this.opts.multipleDatesSeparator);

            // Create new dates array, to separate it from original selectedDates
            if (this.opts.multipleDates) {
                dates = selectedDates.map(function(date) {
                    var parsedDate = Datepicker.getParsedDate(date);
                    return new Date(parsedDate.year, parsedDate.month, parsedDate.date)
                })
            }

            this.opts.onSelect(formattedDates, dates, this);
        },

        next: function () {
            var d = this.parsedDate,
                o = this.opts;
            switch (this.view) {
                case 'days':
                    this.date = new Date(d.year, d.month + 1, 1);
                    if (o.onChangeMonth) o.onChangeMonth(this.parsedDate.month, this.parsedDate.year);
                    break;
                case 'months':
                    this.date = new Date(d.year + 1, d.month, 1);
                    if (o.onChangeYear) o.onChangeYear(this.parsedDate.year);
                    break;
                case 'years':
                    this.date = new Date(d.year + 10, 0, 1);
                    if (o.onChangeDecade) o.onChangeDecade(this.curDecade);
                    break;
            }
        },

        prev: function () {
            var d = this.parsedDate,
                o = this.opts;
            switch (this.view) {
                case 'days':
                    this.date = new Date(d.year, d.month - 1, 1);
                    if (o.onChangeMonth) o.onChangeMonth(this.parsedDate.month, this.parsedDate.year);
                    break;
                case 'months':
                    this.date = new Date(d.year - 1, d.month, 1);
                    if (o.onChangeYear) o.onChangeYear(this.parsedDate.year);
                    break;
                case 'years':
                    this.date = new Date(d.year - 10, 0, 1);
                    if (o.onChangeDecade) o.onChangeDecade(this.curDecade);
                    break;
            }
        },

        formatDate: function (string, date) {
            date = date || this.date;
            var result = string,
                locale = this.loc,
                decade = Datepicker.getDecade(date),
                d = Datepicker.getParsedDate(date);

            switch (true) {
                case /@/.test(result):
                    result = result.replace(/@/, date.getTime());
                case /dd/.test(result):
                    result = result.replace(/\bdd\b/, d.fullDate);
                case /d/.test(result):
                    result = result.replace(/\bd\b/, d.date);
                case /DD/.test(result):
                    result = result.replace(/\bDD\b/, locale.days[d.day]);
                case /D/.test(result):
                    result = result.replace(/\bD\b/, locale.daysShort[d.day]);
                case /mm/.test(result):
                    result = result.replace(/\bmm\b/, d.fullMonth);
                case /m/.test(result):
                    result = result.replace(/\bm\b/, d.month + 1);
                case /MM/.test(result):
                    result = result.replace(/\bMM\b/, this.loc.months[d.month]);
                case /M/.test(result):
                    result = result.replace(/\bM\b/, locale.monthsShort[d.month]);
                case /yyyy/.test(result):
                    result = result.replace(/\byyyy\b/, d.year);
                case /yyyy1/.test(result):
                    result = result.replace(/\byyyy1\b/, decade[0]);
                case /yyyy2/.test(result):
                    result = result.replace(/\byyyy2\b/, decade[1]);
                case /yy/.test(result):
                    result = result.replace(/\byy\b/, d.year.toString().slice(-2));
            }

            return result;
        },

        selectDate: function (date) {
            var d = this.parsedDate,
                newDate = '';

            if (!(date instanceof Date)) return;

            if (this.view == 'days') {
                if (date.getMonth() != d.month && this.opts.moveToOtherMonthsOnSelect) {
                    newDate = new Date(date.getFullYear(), date.getMonth(), 1);

                }
            }

            if (this.view == 'years') {
                if (date.getFullYear() != d.year && this.opts.moveToOtherYearsOnSelect) {
                    newDate = new Date(date.getFullYear(), 0, 1);
                }
            }

            if (newDate) {
                this.silent = true;
                this.date = newDate;
                this.silent = false;
                this.nav._render()
            }

            if (this.opts.multipleDates) {
                if (this.selectedDates.length === this.opts.multipleDates) return;
                if (!this._isSelected(date)) {
                    this.selectedDates.push(date);
                }
            } else {
                this.selectedDates = [date];
            }

            this._setInputValue();

            if (this.opts.onSelect) {
                this._triggerOnChange();
            }

            if (this.opts.autoClose) {
                this.hide();
            }

            this.views[this.currentView]._render()
        },

        removeDate: function (date) {
            var selected = this.selectedDates,
                _this = this;

            if (!(date instanceof Date)) return;

            return selected.some(function (curDate, i) {
                if (Datepicker.isSame(curDate, date)) {
                    selected.splice(i, 1);
                    _this.views[_this.currentView]._render();
                    _this._setInputValue();
                    if (_this.opts.onSelect) {
                        _this._triggerOnChange();
                    }
                    return true
                }
            })
        },

        today: function () {
            this.silent = true;
            this.view = this.opts.minView;
            this.silent = false;
            this.date = new Date();
        },

        clear: function () {
            this.selectedDates = [];
            this.views[this.currentView]._render();
            if (this.opts.onSelect) {
                this._triggerOnChange()
            }
        },

        /**
         * Updates datepicker options
         * @param {String|Object} param - parameter's name to update. If object then it will extend current options
         * @param {String|Number|Object} [value] - new param value
         */
        update: function (param, value) {
            var len = arguments.length;
            if (len == 2) {
                this.opts[param] = value;
            } else if (len == 1 && typeof param == 'object') {
                this.opts = $.extend(true, this.opts, param)
            }

            this._createShortCuts();
            this._syncWithMinMaxDates();
            this._defineLocale(this.opts.language);
            this.nav._addButtonsIfNeed();
            this.nav._render();
            this.views[this.currentView]._render();

            if (this.elIsInput && !this.opts.inline) {
                this._setPositionClasses(this.opts.position);
                if (this.visible) {
                    this.setPosition(this.opts.position)
                }
            }

            if (this.opts.classes) {
                this.$datepicker.addClass(this.opts.classes)
            }

            return this;
        },

        _syncWithMinMaxDates: function () {
            var curTime = this.date.getTime();
            this.silent = true;
            if (this.minTime > curTime) {
                this.date = this.minDate;
            }

            if (this.maxTime < curTime) {
                this.date = this.maxDate;
            }
            this.silent = false;
        },

        _isSelected: function (checkDate, cellType) {
            return this.selectedDates.some(function (date) {
                return Datepicker.isSame(date, checkDate, cellType)
            })
        },

        _setInputValue: function () {
            var _this = this,
                format = this.loc.dateFormat,
                altFormat = this.opts.altFieldDateFormat,
                value = this.selectedDates.map(function (date) {
                    return _this.formatDate(format, date)
                }),
                altValues;

            if (this.$altField) {
                altValues = this.selectedDates.map(function (date) {
                    return _this.formatDate(altFormat, date)
                });
                this.$altField.val(altValues);
            }

            value = value.join(this.opts.multipleDatesSeparator);

            this.$el.val(value)
        },

        /**
         * Check if date is between minDate and maxDate
         * @param date {object} - date object
         * @param type {string} - cell type
         * @returns {boolean}
         * @private
         */
        _isInRange: function (date, type) {
            var time = date.getTime(),
                d = Datepicker.getParsedDate(date),
                min = Datepicker.getParsedDate(this.minDate),
                max = Datepicker.getParsedDate(this.maxDate),
                dMinTime = new Date(d.year, d.month, min.date).getTime(),
                dMaxTime = new Date(d.year, d.month, max.date).getTime(),
                types = {
                    day: time >= this.minTime && time <= this.maxTime,
                    month: dMinTime >= this.minTime && dMaxTime <= this.maxTime,
                    year: d.year >= min.year && d.year <= max.year
                };
            return type ? types[type] : types.day
        },

        _getDimensions: function ($el) {
            var offset = $el.offset();

            return {
                width: $el.outerWidth(),
                height: $el.outerHeight(),
                left: offset.left,
                top: offset.top
            }
        },

        _setPositionClasses: function (pos) {
            pos = pos.split(' ');
            var main = pos[0],
                sec = pos[1],
                classes = 'datepicker -' + main + '-' + sec + '- -from-' + main + '-';

            if (this.visible) classes += ' active';

            this.$datepicker
                .removeAttr('class')
                .addClass(classes);
        },

        setPosition: function (position) {
            position = position || this.opts.position;

            var dims = this._getDimensions(this.$el),
                selfDims = this._getDimensions(this.$datepicker),
                pos = position.split(' '),
                top, left,
                offset = this.opts.offset,
                main = pos[0],
                secondary = pos[1];

            switch (main) {
                case 'top':
                    top = dims.top - selfDims.height - offset;
                    break;
                case 'right':
                    left = dims.left + dims.width + offset;
                    break;
                case 'bottom':
                    top = dims.top + dims.height + offset;
                    break;
                case 'left':
                    left = dims.left - selfDims.width - offset;
                    break;
            }

            switch(secondary) {
                case 'top':
                    top = dims.top;
                    break;
                case 'right':
                    left = dims.left + dims.width - selfDims.width;
                    break;
                case 'bottom':
                    top = dims.top + dims.height - selfDims.height;
                    break;
                case 'left':
                    left = dims.left;
                    break;
                case 'center':
                    if (/left|right/.test(main)) {
                        top = dims.top + dims.height/2 - selfDims.height/2;
                    } else {
                        left = dims.left + dims.width/2 - selfDims.width/2;
                    }
            }

            this.$datepicker
                .css({
                    left: left,
                    top: top
                })
        },

        show: function () {
            this.setPosition(this.opts.position);
            this.$datepicker.addClass('active');
            this.visible = true;
        },

        hide: function () {
            this.$datepicker
                .removeClass('active')
                .css({
                    left: '-100000px'
                });

            this.focused = '';
            this.keys = [];

            this.inFocus = false;
            this.visible = false;
            this.$el.blur();
        },

        down: function (date) {
            this._changeView(date, 'down');
        },

        up: function (date) {
            this._changeView(date, 'up');
        },

        _changeView: function (date, dir) {
            date = date || this.focused || this.date;

            var nextView = dir == 'up' ? this.viewIndex + 1 : this.viewIndex - 1;
            if (nextView > 2) nextView = 2;
            if (nextView < 0) nextView = 0;

            this.silent = true;
            this.date = new Date(date.getFullYear(), date.getMonth(), 1);
            this.silent = false;
            this.view = this.viewIndexes[nextView];

        },

        _handleHotKey: function (key) {
            var date = Datepicker.getParsedDate(this._getFocusedDate()),
                focusedParsed,
                o = this.opts,
                newDate,
                totalDaysInNextMonth,
                monthChanged = false,
                yearChanged = false,
                decadeChanged = false,
                y = date.year,
                m = date.month,
                d = date.date;

            switch (key) {
                case 'ctrlRight':
                case 'ctrlUp':
                    m += 1;
                    monthChanged = true;
                    break;
                case 'ctrlLeft':
                case 'ctrlDown':
                    m -= 1;
                    monthChanged = true;
                    break;
                case 'shiftRight':
                case 'shiftUp':
                    yearChanged = true;
                    y += 1;
                    break;
                case 'shiftLeft':
                case 'shiftDown':
                    yearChanged = true;
                    y -= 1;
                    break;
                case 'altRight':
                case 'altUp':
                    decadeChanged = true;
                    y += 10;
                    break;
                case 'altLeft':
                case 'altDown':
                    decadeChanged = true;
                    y -= 10;
                    break;
                case 'ctrlShiftUp':
                    this.up();
                    break;
            }

            totalDaysInNextMonth = Datepicker.getDaysCount(new Date(y,m));
            newDate = new Date(y,m,d);

            // If next month has less days than current, set date to total days in that month
            if (totalDaysInNextMonth < d) d = totalDaysInNextMonth;

            // Check if newDate is in valid range
            if (newDate.getTime() < this.minTime) {
                newDate = this.minDate;
            } else if (newDate.getTime() > this.maxTime) {
                newDate = this.maxDate;
            }

            this.focused = newDate;

            focusedParsed = Datepicker.getParsedDate(newDate);
            if (monthChanged && o.onChangeMonth) {
                o.onChangeMonth(focusedParsed.month, focusedParsed.year)
            }
            if (yearChanged && o.onChangeYear) {
                o.onChangeYear(focusedParsed.year)
            }
            if (decadeChanged && o.onChangeDecade) {
                o.onChangeDecade(this.curDecade)
            }
        },

        _registerKey: function (key) {
            var exists = this.keys.some(function (curKey) {
                return curKey == key;
            });

            if (!exists) {
                this.keys.push(key)
            }
        },

        _unRegisterKey: function (key) {
            var index = this.keys.indexOf(key);

            this.keys.splice(index, 1);
        },

        _isHotKeyPressed: function () {
            var currentHotKey,
                found = false,
                _this = this,
                pressedKeys = this.keys.sort();

            for (var hotKey in hotKeys) {
                currentHotKey = hotKeys[hotKey];
                if (pressedKeys.length != currentHotKey.length) continue;

                if (currentHotKey.every(function (key, i) { return key == pressedKeys[i]})) {
                    _this._trigger('hotKey', hotKey);
                    found = true;
                }
            }

            return found;
        },

        _trigger: function (event, args) {
            this.$el.trigger(event, args)
        },

        _focusNextCell: function (keyCode, type) {
            type = type || this.cellType;

            var date = Datepicker.getParsedDate(this._getFocusedDate()),
                y = date.year,
                m = date.month,
                d = date.date;

            if (this._isHotKeyPressed()){
                return;
            }

            switch(keyCode) {
                case 37: // left
                    type == 'day' ? (d -= 1) : '';
                    type == 'month' ? (m -= 1) : '';
                    type == 'year' ? (y -= 1) : '';
                    break;
                case 38: // up
                    type == 'day' ? (d -= 7) : '';
                    type == 'month' ? (m -= 3) : '';
                    type == 'year' ? (y -= 4) : '';
                    break;
                case 39: // right
                    type == 'day' ? (d += 1) : '';
                    type == 'month' ? (m += 1) : '';
                    type == 'year' ? (y += 1) : '';
                    break;
                case 40: // down
                    type == 'day' ? (d += 7) : '';
                    type == 'month' ? (m += 3) : '';
                    type == 'year' ? (y += 4) : '';
                    break;
            }

            var nd = new Date(y,m,d);
            if (nd.getTime() < this.minTime) {
                nd = this.minDate;
            } else if (nd.getTime() > this.maxTime) {
                nd = this.maxDate;
            }

            this.focused = nd;

        },

        _getFocusedDate: function () {
            var focused  = this.focused || this.selectedDates[this.selectedDates.length - 1],
                d = this.parsedDate;

            if (!focused) {
                switch (this.view) {
                    case 'days':
                        focused = new Date(d.year, d.month, new Date().getDate());
                        break;
                    case 'months':
                        focused = new Date(d.year, d.month, 1);
                        break;
                    case 'years':
                        focused = new Date(d.year, 0, 1);
                        break;
                }
            }

            return focused;
        },

        _getCell: function (date, type) {
            type = type || this.cellType;

            var d = Datepicker.getParsedDate(date),
                selector = '.datepicker--cell[data-year="' + d.year + '"]',
                $cell;

            switch (type) {
                case 'month':
                    selector = '[data-month="' + d.month + '"]';
                    break;
                case 'day':
                    selector += '[data-month="' + d.month + '"][data-date="' + d.date + '"]';
                    break;
            }
            $cell = this.views[this.currentView].$el.find(selector);

            return $cell.length ? $cell : '';
        },

        _onShowEvent: function () {
            if (!this.visible) {
                this.show();
            }
        },

        _onBlur: function () {
            if (!this.inFocus && this.visible) {
                this.hide();
            }
        },

        _onMouseDownDatepicker: function (e) {
            this.inFocus = true;
        },

        _onMouseUpDatepicker: function (e) {
            this.inFocus = false;
            this.$el.focus()
        },

        _onInput: function () {
            var val = this.$el.val();

            if (!val) {
                this.clear();
            }
        },

        _onResize: function () {
            if (this.visible) {
                this.setPosition();
            }
        },

        _onKeyDown: function (e) {
            var code = e.which;

            this._registerKey(code);

            // Arrows
            if (code >= 37 && code <= 40) {
                e.preventDefault();
                this._focusNextCell(code);
            }

            // Enter
            if (code == 13) {
                if (this.focused) {
                    if (this._getCell(this.focused).hasClass('-disabled-')) return;
                    if (this.view != this.opts.minView) {
                        this.down()
                    } else {
                        var alreadySelected = this._isSelected(this.focused, this.cellType);

                        if (!alreadySelected) {
                            this.selectDate(this.focused);
                        } else if (alreadySelected && this.opts.toggleSelected){
                            this.removeDate(this.focused);
                        }
                    }
                }
            }

            // Esc
            if (code == 27) {
                this.hide();
            }
        },

        _onKeyUp: function (e) {
            var code = e.which;
            this._unRegisterKey(code);
        },

        _onHotKey: function (e, hotKey) {
            this._handleHotKey(hotKey);
        },

        set focused(val) {
            if (!val && this.focused) {
                var $cell = this._getCell(this.focused);

                if ($cell.length) {
                    $cell.removeClass('-focus-')
                }
            }
            this._focused = val;
            this.date = val;
        },

        get focused() {
            return this._focused;
        },

        get parsedDate() {
            return Datepicker.getParsedDate(this.date);
        },

        set date (val) {
            if (!(val instanceof Date)) return;

            this.currentDate = val;

            if (this.inited && !this.silent) {
                this.views[this.view]._render();
                this.nav._render();
                if (this.visible && this.elIsInput) {
                    this.setPosition();
                }
            }

            return val;
        },

        get date () {
            return this.currentDate
        },

        set view (val) {
            this.viewIndex = this.viewIndexes.indexOf(val);

            if (this.viewIndex < 0) {
                return;
            }

            this.prevView = this.currentView;
            this.currentView = val;

            if (this.inited) {
                if (!this.views[val]) {
                    this.views[val] = new Datepicker.Body(this, val, this.opts)
                } else {
                    this.views[val]._render();
                }

                this.views[this.prevView].hide();
                this.views[val].show();
                this.nav._render();

                if (this.opts.onChangeView) {
                    this.opts.onChangeView(val)
                }
                if (this.elIsInput && this.visible) this.setPosition();
            }

            return val
        },

        get view() {
            return this.currentView;
        },

        get cellType() {
            return this.view.substring(0, this.view.length - 1)
        },

        get minTime() {
            var min = Datepicker.getParsedDate(this.minDate);
            return new Date(min.year, min.month, min.date).getTime()
        },

        get maxTime() {
            var max = Datepicker.getParsedDate(this.maxDate);
            return new Date(max.year, max.month, max.date).getTime()
        },

        get curDecade() {
            return Datepicker.getDecade(this.date)
        }
    };

    //  Utils
    // -------------------------------------------------

    Datepicker.getDaysCount = function (date) {
        return new Date(date.getFullYear(), date.getMonth() + 1, 0).getDate();
    };

    Datepicker.getParsedDate = function (date) {
        return {
            year: date.getFullYear(),
            month: date.getMonth(),
            fullMonth: (date.getMonth() + 1) < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1, // One based
            date: date.getDate(),
            fullDate: date.getDate() < 10 ? '0' + date.getDate() : date.getDate(),
            day: date.getDay()
        }
    };

    Datepicker.getDecade = function (date) {
        var firstYear = Math.floor(date.getFullYear() / 10) * 10;

        return [firstYear, firstYear + 9];
    };

    Datepicker.template = function (str, data) {
        return str.replace(/#\{([\w]+)\}/g, function (source, match) {
            if (data[match] || data[match] === 0) {
                return data[match]
            }
        });
    };

    Datepicker.isSame = function (date1, date2, type) {
        var d1 = Datepicker.getParsedDate(date1),
            d2 = Datepicker.getParsedDate(date2),
            _type = type ? type : 'day',

            conditions = {
                day: d1.date == d2.date && d1.month == d2.month && d1.year == d2.year,
                month: d1.month == d2.month && d1.year == d2.year,
                year: d1.year == d2.year
            };

        return conditions[_type];
    };

    Datepicker.language = {
        ru: {
            days: ['Воскресенье', 'Понедельник', 'Вторник', 'Среда', 'Четверг', 'Пятница', 'Суббота'],
            daysShort: ['Вос','Пон','Вто','Сре','Чет','Пят','Суб'],
            daysMin: ['Вс','Пн','Вт','Ср','Чт','Пт','Сб'],
            months: ['Январь', 'Февраль', 'Март', 'Апрель', 'Май', 'Июнь', 'Июль', 'Август', 'Сентябрь', 'Октябрь', 'Ноябрь', 'Декабрь'],
            monthsShort: ['Янв', 'Фев', 'Мар', 'Апр', 'Май', 'Июн', 'Июл', 'Авг', 'Сен', 'Окт', 'Ноя', 'Дек'],
            today: 'Сегодня',
            clear: 'Очистить',
            dateFormat: 'dd.mm.yyyy',
            firstDay: 1
        }
    };

    $.fn[pluginName] = function ( options ) {
        if (Datepicker.prototype[options]) {
            Datepicker.prototype[options].apply(this.data(pluginName), Array.prototype.slice.call(arguments, 1));
        } else {
            return this.each(function () {
                if (!$.data(this, pluginName)) {
                    $.data(this,  pluginName,
                        new Datepicker( this, options ));
                } else {
                    var _this = $.data(this, pluginName);

                    _this.opts = $.extend(true, _this.opts, options);
                    _this.update();
                }
            });
        }
    };

    $(function () {
        $(autoInitSelector).datepicker();
    })

})(window, jQuery);
;(function () {
    var templates = {
        days:'' +
        '
' +
        '

' +
        '

' +
        '
',
        months: '' +
        '
' +
        '

' +
        '
',
        years: '' +
        '
' +
        '

' +
        '
'
        },
        D = Datepicker;

    D.Body = function (d, type, opts) {
        this.d = d;
        this.type = type;
        this.opts = opts;

        this.init();
    };

    D.Body.prototype = {
        init: function () {
            this._buildBaseHtml();
            this._render();

            this._bindEvents();
        },

        _bindEvents: function () {
            this.$el.on('click', '.datepicker--cell', $.proxy(this._onClickCell, this));
        },

        _buildBaseHtml: function () {
            this.$el = $(templates[this.type]).appendTo(this.d.$content);
            this.$names = $('.datepicker--days-names', this.$el);
            this.$cells = $('.datepicker--cells', this.$el);
        },

        _getDayNamesHtml: function (firstDay, curDay, html, i) {
            curDay = curDay != undefined ? curDay : firstDay;
            html = html ? html : '';
            i = i != undefined ? i : 0;

            if (i > 7) return html;
            if (curDay == 7) return this._getDayNamesHtml(firstDay, 0, html, ++i);

            html += '
' + this.d.loc.daysMin[curDay] + '
';

            return this._getDayNamesHtml(firstDay, ++curDay, html, ++i);
        },

        /**
         * Calculates days number to render. Generates days html and returns it.
         * @param {object} date - Date object
         * @returns {string}
         * @private
         */
        _getDaysHtml: function (date) {
            var totalMonthDays = D.getDaysCount(date),
                firstMonthDay = new Date(date.getFullYear(), date.getMonth(), 1).getDay(),
                lastMonthDay = new Date(date.getFullYear(), date.getMonth(), totalMonthDays).getDay(),
                daysFromPevMonth = firstMonthDay - this.d.loc.firstDay,
                daysFromNextMonth = 6 - lastMonthDay + this.d.loc.firstDay;

            daysFromPevMonth = daysFromPevMonth < 0 ? daysFromPevMonth + 7 : daysFromPevMonth;
            daysFromNextMonth = daysFromNextMonth > 6 ? daysFromNextMonth - 7 : daysFromNextMonth;

            var startDayIndex = -daysFromPevMonth + 1,
                m, y,
                html = '';

            for (var i = startDayIndex, max = totalMonthDays + daysFromNextMonth; i <= max; i++) {
                y = date.getFullYear();
                m = date.getMonth();

                html += this._getDayHtml(new Date(y, m, i))
            }

            return html;
        },

        _getDayHtml: function (date) {
            var _class = "datepicker--cell datepicker--cell-day",
                currentDate = new Date(),
                d = D.getParsedDate(date),
                render = {},
                html = d.date;

            if (this.opts.onRenderCell) {
                render = this.opts.onRenderCell(date, 'day') || {};
                html = render.html ? render.html : html;
                _class += render.classes ? ' ' + render.classes : '';
            }

            if (this.d.isWeekend(d.day)) _class += " -weekend-";
            if (D.isSame(currentDate, date)) _class += ' -current-';
            if (this.d.focused && D.isSame(date, this.d.focused)) _class += ' -focus-';
            if (this.d._isSelected(date, 'day')) _class += ' -selected-';
            if (!this.d._isInRange(date) || render.disabled) _class += ' -disabled-';
            if (d.month != this.d.parsedDate.month) {
                _class += " -other-month-";

                if (!this.opts.selectOtherMonths) {
                    _class += " -disabled-";
                }

                if (!this.opts.showOtherMonths) html = '';
            }

            return '
' + html + '
';
        },

        /**
         * Generates months html
         * @param {object} date - date instance
         * @returns {string}
         * @private
         */
        _getMonthsHtml: function (date) {
            var html = '',
                d = D.getParsedDate(date),
                i = 0;

            while(i < 12) {
                html += this._getMonthHtml(new Date(d.year, i));
                i++
            }

            return html;
        },

        _getMonthHtml: function (date) {
            var _class = "datepicker--cell datepicker--cell-month",
                d = D.getParsedDate(date),
                currentDate = new Date(),
                loc = this.d.loc,
                html = loc[this.opts.monthsFiled][d.month],
                render = {};

            if (this.opts.onRenderCell) {
                render = this.opts.onRenderCell(date, 'month') || {};
                html = render.html ? render.html : html;
                _class += render.classes ? ' ' + render.classes : '';
            }

            if (D.isSame(currentDate, date, 'month')) _class += ' -current-';
            if (this.d._isSelected(date, 'month')) _class += ' -selected-';
            if (this.d.focused && D.isSame(date, this.d.focused, 'month')) _class += ' -focus-';
            if (!this.d._isInRange(date, 'month') || render.disabled) _class += ' -disabled-';

            return '
' + html + '
'
        },

        _getYearsHtml: function (date) {
            var d = D.getParsedDate(date),
                decade = D.getDecade(date),
                firstYear = decade[0] - 1,
                html = '',
                i = firstYear;

            for (i; i <= decade[1] + 1; i++) {
                html += this._getYearHtml(new Date(i , 0));
            }

            return html;
        },

        _getYearHtml: function (date) {
            var _class = "datepicker--cell datepicker--cell-year",
                decade = D.getDecade(this.d.date),
                currentDate = new Date(),
                d = D.getParsedDate(date),
                html = d.year,
                render = {};

            if (this.opts.onRenderCell) {
                render = this.opts.onRenderCell(date, 'year') || {};
                html = render.html ? render.html : html;
                _class += render.classes ? ' ' + render.classes : '';
            }

            if (d.year < decade[0] || d.year > decade[1]) {
                _class += ' -other-decade-';

                if (!this.opts.selectOtherYears) {
                    _class += " -disabled-";
                }

                if (!this.opts.showOtherYears) html = '';
            }

            if (D.isSame(currentDate, date, 'year')) _class += ' -current-';
            if (this.d._isSelected(date, 'year')) _class += ' -selected-';
            if (this.d.focused && D.isSame(date, this.d.focused, 'year')) _class += ' -focus-';
            if (!this.d._isInRange(date, 'year') || render.disabled) _class += ' -disabled-';

            return '
' + html + '
'
        },

        _renderTypes: {
            days: function () {
                var dayNames = this._getDayNamesHtml(this.d.loc.firstDay),
                    days = this._getDaysHtml(this.d.currentDate);

                this.$cells.html(days);
                this.$names.html(dayNames)
            },
            months: function () {
                var html = this._getMonthsHtml(this.d.currentDate);

                this.$cells.html(html)
            },
            years: function () {
                var html = this._getYearsHtml(this.d.currentDate);

                this.$cells.html(html)
            }
        },

        _render: function () {
            this._renderTypes[this.type].bind(this)();
        },

        show: function () {
            this.$el.addClass('active');
            this.acitve = true;
        },

        hide: function () {
            this.$el.removeClass('active');
            this.active = false;
        },

        //  Events
        // -------------------------------------------------

        _handleClick: function (el) {
            var date = el.data('date') || 1,
                month = el.data('month') || 0,
                year = el.data('year') || this.d.parsedDate.year;

            // Change view if min view does not reach yet
            if (this.d.view != this.opts.minView) {
                this.d.down(new Date(year, month, date));
                return;
            }

            // Select date if min view is reached
            var selectedDate = new Date(year, month, date),
                alreadySelected = this.d._isSelected(selectedDate, this.d.cellType);

            if (!alreadySelected) {
                this.d.selectDate(selectedDate);
            } else if (alreadySelected && this.opts.toggleSelected){
                this.d.removeDate(selectedDate);
            }

        },

        _onClickCell: function (e) {
            var $el = $(e.target).closest('.datepicker--cell');

            if ($el.hasClass('-disabled-')) return;

            this._handleClick.bind(this)($el);
        }
    };
})();

;(function () {
    var template = '' +
        '
#{prevHtml}
' +
        '
#{title}
' +
        '
#{nextHtml}
',
        buttonsContainerTemplate = '

',
        button = '#{label}';

    Datepicker.Navigation = function (d, opts) {
        this.d = d;
        this.opts = opts;

        this.$buttonsContainer = '';

        this.init();
    };

    Datepicker.Navigation.prototype = {
        init: function () {
            this._buildBaseHtml();
            this._bindEvents();
        },

        _bindEvents: function () {
            this.d.$nav.on('click', '.datepicker--nav-action', $.proxy(this._onClickNavButton, this));
            this.d.$nav.on('click', '.datepicker--nav-title', $.proxy(this._onClickNavTitle, this));
            this.d.$datepicker.on('click', '.datepicker--button', $.proxy(this._onClickNavButton, this));
        },

        _buildBaseHtml: function () {
            this._render();
            this._addButtonsIfNeed();
        },

        _addButtonsIfNeed: function () {
            if (this.opts.todayButton) {
                this._addButton('today')
            }
            if (this.opts.clearButton) {
                this._addButton('clear')
            }
        },

        _render: function () {
            var title = this._getTitle(this.d.currentDate),
                html = Datepicker.template(template, $.extend({title: title}, this.opts));

            this.d.$nav.html(html);
            if (this.d.view == 'years') {
                $('.datepicker--nav-title', this.d.$nav).addClass('-disabled-');
            }
            this.setNavStatus();
        },

        _getTitle: function (date) {
            return this.d.formatDate(this.opts.navTitles[this.d.view], date)
        },

        _addButton: function (type) {
            if (!this.$buttonsContainer.length) {
                this._addButtonsContainer();
            }

            var data = {
                    action: type,
                    label: this.d.loc[type]
                },
                html = Datepicker.template(button, data);

            this.$buttonsContainer.append(html);
        },

        _addButtonsContainer: function () {
            this.d.$datepicker.append(buttonsContainerTemplate);
            this.$buttonsContainer = $('.datepicker--buttons', this.d.$datepicker);
        },

        setNavStatus: function () {
            if (!(this.opts.minDate || this.opts.maxDate) || !this.opts.disableNavWhenOutOfRange) return;

            var date = this.d.parsedDate,
                m = date.month,
                y = date.year,
                d = date.date;

            switch (this.d.view) {
                case 'days':
                    if (!this.d._isInRange(new Date(y, m-1, d), 'month')) {
                        this._disableNav('prev')
                    }
                    if (!this.d._isInRange(new Date(y, m+1, d), 'month')) {
                        this._disableNav('next')
                    }
                    break;
                case 'months':
                    if (!this.d._isInRange(new Date(y-1, m, d), 'year')) {
                        this._disableNav('prev')
                    }
                    if (!this.d._isInRange(new Date(y+1, m, d), 'year')) {
                        this._disableNav('next')
                    }
                    break;
                case 'years':
                    if (!this.d._isInRange(new Date(y-10, m, d), 'year')) {
                        this._disableNav('prev')
                    }
                    if (!this.d._isInRange(new Date(y+10, m, d), 'year')) {
                        this._disableNav('next')
                    }
                    break;
            }
        },

        _disableNav: function (nav) {
            $('[data-action="' + nav + '"]', this.d.$nav).addClass('-disabled-')
        },

        _activateNav: function (nav) {
            $('[data-action="' + nav + '"]', this.d.$nav).removeClass('-disabled-')
        },

        _onClickNavButton: function (e) {
            var $el = $(e.target).closest('[data-action]'),
                action = $el.data('action');

            this.d[action]();
        },

        _onClickNavTitle: function (e) {
            if ($(e.target).hasClass('-disabled-')) return;

            if (this.d.view == 'days') {
                return this.d.view = 'months'
            }

            this.d.view = 'years';
        }
    }

})();


text:
from django.core.exceptions import PermissionDenied
from django.http import HttpResponse
import xlwt

def export_as_xls(modeladmin, request, queryset):
    """
    Generic xls export admin action.
    """
    if not request.user.is_staff:
        raise PermissionDenied
    opts = modeladmin.model._meta

    book = xlwt.Workbook(encoding='utf8')
    sheet = book.add_sheet('export')

    col = 0
    field_names = []
    # write header row
    for field in opts.fields:
        sheet.write(0, col, field.name)
        field_names.append(field.name)
        col = col + 1

    row = 1
    # Write data rows
    for obj in queryset:
        col = 0
        for field in field_names:
            val = unicode(getattr(obj, field)).strip()
            sheet.write(row, col, val)
            col = col + 1
        row = row + 1

    response = HttpResponse(mimetype='application/vnd.ms-excel')
    response['Content-Disposition'] = 'attachment; filename=admin_export.xls'
    book.save(response)
    return response

export_as_xls.short_description = "Export selected objects to XLS"

redpajama_set_name: RedPajamaGithub


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<title>R: The R Base Package</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="R.css">

 The R Base Package

Documentation for package ‘base’ version 2.15.3

DESCRIPTION file.

Code demos.  Use demo() to run them.

Help Pages

A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Z
misc

base-package
The R Base Package

-- A --

abbreviate
Abbreviate Strings

abs
Miscellaneous Mathematical Functions

acos
Trigonometric Functions

acosh
Hyperbolic Functions

addNA
Factors

addTaskCallback
Add or Remove a Top-Level Task Callback

agrep
Approximate String Matching (Fuzzy Matching)

alist
Lists - Generic and Dotted Pairs

all
Are All Values True?

all.equal
Test if Two Objects are (Nearly) Equal

all.equal.POSIXct
Date-Time Classes

all.names
Find All Names in an Expression

all.vars
Find All Names in an Expression

any
Are Some Values True?

anyDuplicated
Determine Duplicate Elements

aperm
Array Transposition

append
Vector Merging

apply
Apply Functions Over Array Margins

Arg
Complex Vectors

args
Argument List of a Function

Arithmetic
Arithmetic Operators

array
Multi-way Arrays

arrayInd
Which indices are TRUE?

as.array
Multi-way Arrays

as.call
Function Calls

as.character
Character Vectors

as.character.condition
Condition Handling and Recovery

as.character.Date
Date Conversion Functions to and from Character

as.character.hexmode
Display Numbers in Hexadecimal

as.character.numeric_version
Numeric Versions

as.character.octmode
Display Numbers in Octal

as.character.POSIXt
Date-time Conversion Functions to and from Character

as.character.srcref
References to source files

as.complex
Complex Vectors

as.data.frame
Coerce to a Data Frame

as.data.frame.AsIs
Coerce to a Data Frame

as.data.frame.Date
Date Class

as.data.frame.numeric_version
Numeric Versions

as.data.frame.POSIXct
Date-Time Classes

as.data.frame.table
Cross Tabulation and Table Creation

as.Date
Date Conversion Functions to and from Character

as.difftime
Time Intervals

as.double
Double-Precision Vectors

as.double.difftime
Time Intervals

as.double.POSIXlt
Date-time Conversion Functions

as.environment
Coerce to an Environment Object

as.expression
Unevaluated Expressions

as.factor
Factors

as.function
Convert Object to Function

as.hexmode
Display Numbers in Hexadecimal

as.integer
Integer Vectors

as.list
Lists - Generic and Dotted Pairs

as.list.Date
Date Class

as.list.numeric_version
Numeric Versions

as.list.POSIXct
Date-Time Classes

as.logical
Logical Vectors

as.matrix
Matrices

as.matrix.noquote
Class for 'no quote' Printing of Character Strings

as.matrix.POSIXlt
Date-Time Classes

as.name
Names and Symbols

as.null
The Null Object

as.numeric
Numeric Vectors

as.numeric_version
Numeric Versions

as.octmode
Display Numbers in Octal

as.ordered
Factors

as.package_version
Numeric Versions

as.pairlist
Lists - Generic and Dotted Pairs

as.POSIXct
Date-time Conversion Functions

as.POSIXlt
Date-time Conversion Functions

as.qr
The QR Decomposition of a Matrix

as.raw
Raw Vectors

as.single
Double-Precision Vectors

as.symbol
Names and Symbols

as.table
Cross Tabulation and Table Creation

as.vector
Vectors

asin
Trigonometric Functions

asinh
Hyperbolic Functions

AsIs
Inhibit Interpretation/Conversion of Objects

asS3
Test for an S4 object

asS4
Test for an S4 object

assign
Assign a Value to a Name

assignOps
Assignment Operators

atan
Trigonometric Functions

atan2
Trigonometric Functions

atanh
Hyperbolic Functions

atomic
Vectors

attach
Attach Set of R Objects to Search Path

attachNamespace
Loading and Unloading Namespaces

attr
Object Attributes

attr.all.equal
Test if Two Objects are (Nearly) Equal

attributes
Object Attribute Lists

autoload
On-demand Loading of Packages

autoloader
On-demand Loading of Packages

Autoloads
On-demand Loading of Packages

-- B --

backquote
Quotes

backsolve
Solve an Upper or Lower Triangular System

backtick
Quotes

base
The R Base Package

baseenv
Environment Access

basename
Manipulate File Paths

Bessel
Bessel Functions

bessel
Bessel Functions

besselI
Bessel Functions

besselJ
Bessel Functions

besselK
Bessel Functions

besselY
Bessel Functions

beta
Special Functions of Mathematics

bindenv
Binding and Environment Adjustments

bindingIsActive
Binding and Environment Adjustments

bindingIsLocked
Binding and Environment Adjustments

bindtextdomain
Translate Text Messages

body
Access to and Manipulation of the Body of a Function

bquote
Partial substitution in expressions

break
Control Flow

browser
Environment Browser

browserCondition
Functions to Retrieve Values Supplied by Calls to the Browser

browserSetDebug
Functions to Retrieve Values Supplied by Calls to the Browser

browserText
Functions to Retrieve Values Supplied by Calls to the Browser

builtins
Returns the Names of All Built-in Objects

by
Apply a Function to a Data Frame Split by Factors

bzfile
Functions to Manipulate Connections

-- C --

c
Combine Values into a Vector or List

c.Date
Date Class

c.noquote
Class for 'no quote' Printing of Character Strings

c.numeric_version
Numeric Versions

c.POSIXct
Date-Time Classes

call
Function Calls

callCC
Call With Current Continuation

capabilities
Report Capabilities of this Build of R

casefold
Character Translation and Casefolding

cat
Concatenate and Print

cbind
Combine R Objects by Rows or Columns

cbind.data.frame
Combine R Objects by Rows or Columns

ceiling
Rounding of Numbers

char.expand
Expand a String with Respect to a Target Table

character
Character Vectors

charmatch
Partial String Matching

charToRaw
Convert to or from Raw Vectors

chartr
Character Translation and Casefolding

check_tzones
Date-Time Classes

chol
The Choleski Decomposition

chol2inv
Inverse from Choleski (or QR) Decomposition

choose
Special Functions of Mathematics

class
Object Classes

clipboard
Functions to Manipulate Connections

close
Functions to Manipulate Connections

close.srcfile
References to source files

close.srcfilealias
References to source files

closeAllConnections
Display Connections

closure
Function Definition

col
Column Indexes

collation
Relational Operators

colMeans
Form Row and Column Sums and Means

colnames
Row and Column Names

colon
Colon Operator

colSums
Form Row and Column Sums and Means

commandArgs
Extract Command Line Arguments

comment
Query or Set a '"comment"' Attribute

Comparison
Relational Operators

Complex
S3 Group Generic Functions

complex
Complex Vectors

computeRestarts
Condition Handling and Recovery

condition
Condition Handling and Recovery

conditionCall
Condition Handling and Recovery

conditionCall.condition
Condition Handling and Recovery

conditionMessage
Condition Handling and Recovery

conditionMessage.condition
Condition Handling and Recovery

conditions
Condition Handling and Recovery

conflicts
Search for Masked Objects on the Search Path

Conj
Complex Vectors

connection
Functions to Manipulate Connections

connections
Functions to Manipulate Connections

Constants
Built-in Constants

contributors
R Project Contributors

Control
Control Flow

copyright
Copyrights of Files Used to Build R

copyrights
Copyrights of Files Used to Build R

cos
Trigonometric Functions

cosh
Hyperbolic Functions

crossprod
Matrix Crossproduct

Cstack_info
Report Information on C Stack Size and Usage

cummax
Cumulative Sums, Products, and Extremes

cummin
Cumulative Sums, Products, and Extremes

cumprod
Cumulative Sums, Products, and Extremes

cumsum
Cumulative Sums, Products, and Extremes

cut
Convert Numeric to Factor

cut.POSIXt
Convert a Date or Date-Time Object to a Factor

-- D --

data.class
Object Classes

data.frame
Data Frames

data.matrix
Convert a Data Frame to a Numeric Matrix

Date
Date Class

date
System Date and Time

date-time
Date-Time Classes

Dates
Date Class

DateTimeClasses
Date-Time Classes

debug
Debug a Function

debugonce
Debug a Function

default.stringsAsFactors
Data Frames

Defunct
Marking Objects as Defunct

defunct
Marking Objects as Defunct

delayedAssign
Delay Evaluation

deparse
Expression Deparsing

Deprecated
Marking Objects as Deprecated

deprecated
Marking Objects as Deprecated

det
Calculate the Determinant of a Matrix

detach
Detach Objects from the Search Path

determinant
Calculate the Determinant of a Matrix

dget
Write an Object to a File or Recreate it

diag
Matrix Diagonals

diff
Lagged Differences

difftime
Time Intervals

digamma
Special Functions of Mathematics

dim
Dimensions of an Object

dimnames
Dimnames of an Object

dir
List the Files in a Directory/Folder

dir.create
Manipulaton of Directories and File Permissions

dirname
Manipulate File Paths

DLLInfo
Get DLLs Loaded in Current Session

DLLInfoList
Get DLLs Loaded in Current Session

DLLpath
Foreign Function Interface

do.call
Execute a Function Call

double
Double-Precision Vectors

dput
Write an Object to a File or Recreate it

dQuote
Quote Text

drop
Drop Redundant Extent Information

droplevels
droplevels

dump
Text Representations of R Objects

duplicated
Determine Duplicate Elements

duplicated.numeric_version
Numeric Versions

duplicated.POSIXlt
Date-Time Classes

dyn.load
Foreign Function Interface

dyn.unload
Foreign Function Interface

-- E --

eapply
Apply a Function Over Values in an Environment

eigen
Spectral Decomposition of a Matrix

else
Control Flow

emptyenv
Environment Access

enc2native
Read or Set the Declared Encodings for a Character Vector

enc2utf8
Read or Set the Declared Encodings for a Character Vector

enclosure
Environment Access

encodeString
Encode Character Vector as for Printing

Encoding
Read or Set the Declared Encodings for a Character Vector

enquote
Substituting and Quoting Expressions

env.profile
Environment Access

environment
Environment Access

environment variables
Environment Variables

environmentIsLocked
Binding and Environment Adjustments

environmentName
Environment Access

eval
Evaluate an (Unevaluated) Expression

eval.parent
Evaluate an (Unevaluated) Expression

evalq
Evaluate an (Unevaluated) Expression

exists
Is an Object Defined?

exp
Logarithms and Exponentials

expand.grid
Create a Data Frame from All Combinations of Factors

expm1
Logarithms and Exponentials

expression
Unevaluated Expressions

Extract
Extract or Replace Parts of an Object

-- F --

F
Logical Vectors

factor
Factors

factorial
Special Functions of Mathematics

FALSE
Logical Vectors

fifo
Functions to Manipulate Connections

file
Functions to Manipulate Connections

file.access
Ascertain File Accessibility

file.append
File Manipulation

file.choose
Choose a File Interactively

file.copy
File Manipulation

file.create
File Manipulation

file.exists
File Manipulation

file.info
Extract File Information

file.link
File Manipulation

file.path
Construct Path to File

file.remove
File Manipulation

file.rename
File Manipulation

file.show
Display One or More Files

file.symlink
File Manipulation

files
File Manipulation

Filter
Common Higher-Order Functions in Functional Programming Languages

Find
Common Higher-Order Functions in Functional Programming Languages

find.package
Find Packages

findInterval
Find Interval Numbers or Indices

findRestart
Condition Handling and Recovery

finite
Finite, Infinite and NaN Numbers

floor
Rounding of Numbers

flush
Functions to Manipulate Connections

for
Control Flow

force
Force Evaluation of an Argument

Foreign
Foreign Function Interface

formals
Access to and Manipulation of the Formal Arguments

format
Encode in a Common Format

format.Date
Date Conversion Functions to and from Character

format.difftime
Time Intervals

format.hexmode
Display Numbers in Hexadecimal

format.info
format(.) Information

format.libraryIQR
Loading and Listing of Packages

format.numeric_version
Numeric Versions

format.octmode
Display Numbers in Octal

format.packageInfo
Loading and Listing of Packages

format.POSIXct
Date-time Conversion Functions to and from Character

format.pval
Format P Values

format.summaryDefault
Object Summaries

formatC
Formatting Using C-style Formats

formatDL
Format Description Lists

forwardsolve
Solve an Upper or Lower Triangular System

function
Function Definition

fuzzy matching
Approximate String Matching (Fuzzy Matching)

-- G --

gamma
Special Functions of Mathematics

gc
Garbage Collection

gc.time
Report Time Spent in Garbage Collection

gcinfo
Garbage Collection

gctorture
Torture Garbage Collector

gctorture2
Torture Garbage Collector

get
Return the Value of a Named Object

getAllConnections
Display Connections

getCConverterDescriptions
Management of .C argument conversion list

getCConverterStatus
Management of .C argument conversion list

getConnection
Display Connections

getDLLRegisteredRoutines
Reflectance Information for C/Fortran routines in a DLL

getElement
Extract or Replace Parts of an Object

geterrmessage
Stop Function Execution

getHook
Functions to Get and Set Hooks for Load, Attach, Detach and Unload

getLoadedDLLs
Get DLLs Loaded in Current Session

getNativeSymbolInfo
Obtain a Description of one or more Native (C/Fortran) Symbols

getNumCConverters
Management of .C argument conversion list

getOption
Options Settings

getRversion
Numeric Versions

getSrcLines
References to source files

getTaskCallbackNames
Query the Names of the Current Internal Top-Level Task Callbacks

gettext
Translate Text Messages

gettextf
Use C-style String Formatting Commands

getwd
Get or Set Working Directory

gl
Generate Factor Levels

globalenv
Environment Access

gregexpr
Pattern Matching and Replacement

grep
Pattern Matching and Replacement

grepl
Pattern Matching and Replacement

grepRaw
Pattern Matching for Raw Vectors

group generic
S3 Group Generic Functions

groupGeneric
S3 Group Generic Functions

GSC
Environment Variables

gsub
Pattern Matching and Replacement

gzcon
(De)compress I/O Through Connections

gzfile
Functions to Manipulate Connections

-- H --

hexmode
Display Numbers in Hexadecimal

HOME
Environment Variables

-- I --

I
Inhibit Interpretation/Conversion of Objects

iconv
Convert Character Vector between Encodings

iconvlist
Convert Character Vector between Encodings

icuSetCollate
Setup Collation by ICU

identical
Test Objects for Exact Equality

identity
Identity Function

if
Control Flow

ifelse
Conditional Element Selection

Im
Complex Vectors

in
Control Flow

Inf
Finite, Infinite and NaN Numbers

inherits
Object Classes

integer
Integer Vectors

interaction
Compute Factor Interactions

interactive
Is R Running Interactively?

internal generic
Internal Generic Functions

InternalGenerics
Internal Generic Functions

InternalMethods
Internal Generic Functions

intersect
Set Operations

intersection
Set Operations

intToBits
Convert to or from Raw Vectors

intToUtf8
Convert to or from UTF-8-encoded Character Vectors

inverse.rle
Run Length Encoding

invisible
Change the Print Mode to Invisible

invokeRestart
Condition Handling and Recovery

invokeRestartInteractively
Condition Handling and Recovery

is.array
Multi-way Arrays

is.atomic
Is an Object Atomic or Recursive?

is.call
Function Calls

is.character
Character Vectors

is.complex
Complex Vectors

is.data.frame
Coerce to a Data Frame

is.double
Double-Precision Vectors

is.element
Set Operations

is.environment
Environment Access

is.expression
Unevaluated Expressions

is.factor
Factors

is.finite
Finite, Infinite and NaN Numbers

is.function
Is an Object of Type (Primitive) Function?

is.infinite
Finite, Infinite and NaN Numbers

is.integer
Integer Vectors

is.language
Is an Object a Language Object?

is.list
Lists - Generic and Dotted Pairs

is.loaded
Foreign Function Interface

is.logical
Logical Vectors

is.matrix
Matrices

is.na
'Not Available' / Missing Values

is.na.numeric_version
Numeric Versions

is.na.POSIXlt
Date-Time Classes

is.name
Names and Symbols

is.nan
Finite, Infinite and NaN Numbers

is.null
The Null Object

is.numeric
Numeric Vectors

is.numeric.difftime
Time Intervals

is.numeric_version
Numeric Versions

is.object
Is an Object 'internally classed'?

is.ordered
Factors

is.package_version
Numeric Versions

is.pairlist
Lists - Generic and Dotted Pairs

is.primitive
Is an Object of Type (Primitive) Function?

is.qr
The QR Decomposition of a Matrix

is.R
Are we using R, rather than S?

is.raw
Raw Vectors

is.recursive
Is an Object Atomic or Recursive?

is.single
Is an Object of Single Precision Type?

is.symbol
Names and Symbols

is.table
Cross Tabulation and Table Creation

is.unsorted
Test if an Object is Not Sorted

is.vector
Vectors

isatty
Display Connections

isdebugged
Debug a Function

isIncomplete
Functions to Manipulate Connections

ISOdate
Date-time Conversion Functions from Numeric Representations

ISOdatetime
Date-time Conversion Functions from Numeric Representations

isOpen
Functions to Manipulate Connections

isRestart
Condition Handling and Recovery

isS4
Test for an S4 object

isSeekable
Functions to Reposition Connections

isSymmetric
Test if a Matrix or other Object is Symmetric

isTRUE
Logical Operators

-- J --

jitter
'Jitter' (Add Noise) to Numbers

julian
Extract Parts of a POSIXt or Date Object

-- K --

kappa
Compute or Estimate the Condition Number of a Matrix

kronecker
Kronecker Products on Arrays

-- L --

l10n_info
Localization Information

La.svd
Singular Value Decomposition of a Matrix

labels
Find Labels from Object

LANGUAGE
Environment Variables

lapply
Apply a Function over a List or Vector

last.warning
Print Warning Messages

lbeta
Special Functions of Mathematics

lchoose
Special Functions of Mathematics

LC_ALL
Query or Set Aspects of the Locale

LC_COLLATE
Query or Set Aspects of the Locale

LC_CTYPE
Query or Set Aspects of the Locale

LC_MONETARY
Query or Set Aspects of the Locale

LC_NUMERIC
Query or Set Aspects of the Locale

LC_TIME
Query or Set Aspects of the Locale

length
Length of an Object

length.POSIXlt
Date-Time Classes

LETTERS
Built-in Constants

letters
Built-in Constants

levels
Levels Attributes

lfactorial
Special Functions of Mathematics

lgamma
Special Functions of Mathematics

library
Loading and Listing of Packages

library.dynam
Loading DLLs from Packages

library.dynam.unload
Loading DLLs from Packages

licence
The R License Terms

license
The R License Terms

list
Lists - Generic and Dotted Pairs

list.dirs
List the Files in a Directory/Folder

list.files
List the Files in a Directory/Folder

list2env
From A List, Build or Add To an Environment

load
Reload Saved Datasets

loadedNamespaces
Loading and Unloading Namespaces

loadNamespace
Loading and Unloading Namespaces

local
Evaluate an (Unevaluated) Expression

localeconv
Find Details of the Numerical and Monetary Representations in the Current Locale

locales
Query or Set Aspects of the Locale

lockBinding
Binding and Environment Adjustments

lockEnvironment
Binding and Environment Adjustments

log
Logarithms and Exponentials

log10
Logarithms and Exponentials

log1p
Logarithms and Exponentials

log2
Logarithms and Exponentials

logb
Logarithms and Exponentials

Logic
Logical Operators

logical
Logical Vectors

lower.tri
Lower and Upper Triangular Part of a Matrix

ls
List Objects

-- M --

make.names
Make Syntactically Valid Names

make.unique
Make Character Strings Unique

makeActiveBinding
Binding and Environment Adjustments

MAKEINDEX
Environment Variables

Map
Common Higher-Order Functions in Functional Programming Languages

mapply
Apply a Function to Multiple List or Vector Arguments

margin.table
Compute table margin

mat.or.vec
Create a Matrix or a Vector

match
Value Matching

match.arg
Argument Verification Using Partial Matching

match.call
Argument Matching

match.fun
Extract a Function Specified by Name

Math
S3 Group Generic Functions

Math.Date
Date Class

Math.difftime
Time Intervals

Math.factor
Factors

Math.POSIXlt
Date-Time Classes

Math.POSIXt
Date-Time Classes

matmult
Matrix Multiplication

matrix
Matrices

max
Maxima and Minima

max.col
Find Maximum Position in Matrix

mean
Arithmetic Mean

mean.Date
Date Class

mean.difftime
Time Intervals

mean.POSIXct
Date-Time Classes

memCompress
In-memory Compression and Decompression

memDecompress
In-memory Compression and Decompression

Memory
Memory Available for Data Storage

Memory-limits
Memory Limits in R

memory.profile
Profile the Usage of Cons Cells

merge
Merge Two Data Frames

message
Diagnostic Messages

mget
Return the Value of a Named Object

min
Maxima and Minima

missing
Does a Formal Argument have a Value?

Mod
Complex Vectors

mode
The (Storage) Mode of an Object

month.abb
Built-in Constants

months
Extract Parts of a POSIXt or Date Object

-- N --

NA
'Not Available' / Missing Values

name
Names and Symbols

names
The Names of an Object

names.POSIXlt
Date-Time Classes

NaN
Finite, Infinite and NaN Numbers

nargs
The Number of Arguments to a Function

NativeSymbol
Obtain a Description of one or more Native (C/Fortran) Symbols

NativeSymbolInfo
Obtain a Description of one or more Native (C/Fortran) Symbols

NA_character_
'Not Available' / Missing Values

NA_complex_
'Not Available' / Missing Values

NA_integer_
'Not Available' / Missing Values

NA_real_
'Not Available' / Missing Values

nchar
Count the Number of Characters (or Bytes or Width)

NCOL
The Number of Rows/Columns of an Array

ncol
The Number of Rows/Columns of an Array

Negate
Common Higher-Order Functions in Functional Programming Languages

new.env
Environment Access

next
Control Flow

NextMethod
Class Methods

ngettext
Translate Text Messages

nlevels
The Number of Levels of a Factor

noquote
Class for 'no quote' Printing of Character Strings

norm
Compute the Norm of a Matrix

normalizePath
Express File Paths in Canonical Form

NotYetImplemented
Not Yet Implemented Functions and Unused Arguments

NotYetUsed
Not Yet Implemented Functions and Unused Arguments

NROW
The Number of Rows/Columns of an Array

nrow
The Number of Rows/Columns of an Array

NULL
The Null Object

numeric
Numeric Vectors

NumericConstants
Numeric Constants

numeric_version
Numeric Versions

nzchar
Count the Number of Characters (or Bytes or Width)

-- O --

objects
List Objects

octmode
Display Numbers in Octal

oldClass
Object Classes

on.exit
Function Exit Code

open
Functions to Manipulate Connections

open.srcfile
References to source files

open.srcfilealias
References to source files

Ops
S3 Group Generic Functions

Ops.Date
Operators on the Date Class

Ops.difftime
Time Intervals

Ops.factor
Factors

Ops.numeric_version
Numeric Versions

Ops.ordered
Factors

Ops.POSIXt
Date-Time Classes

option
Options Settings

options
Options Settings

order
Ordering Permutation

ordered
Factors

outer
Outer Product of Arrays

-- P --

packageEvent
Functions to Get and Set Hooks for Load, Attach, Detach and Unload

packageStartupMessage
Diagnostic Messages

package_version
Numeric Versions

packBits
Convert to or from Raw Vectors

pairlist
Lists - Generic and Dotted Pairs

Paren
Parentheses and Braces

parent.env
Environment Access

parent.frame
Functions to Access the Function Call Stack

parse
Parse Expressions

paste
Concatenate Strings

paste0
Concatenate Strings

path.expand
Expand File Paths

path.package
Find Packages

pi
Built-in Constants

pipe
Functions to Manipulate Connections

pmatch
Partial String Matching

pmax
Maxima and Minima

pmax.int
Maxima and Minima

pmin
Maxima and Minima

pmin.int
Maxima and Minima

polyroot
Find Zeros of a Real or Complex Polynomial

pos.to.env
Convert Positions in the Search Path to Environments

Position
Common Higher-Order Functions in Functional Programming Languages

POSIXct
Date-Time Classes

POSIXlt
Date-Time Classes

POSIXt
Date-Time Classes

pretty
Pretty Breakpoints

prettyNum
Formatting Using C-style Formats

primitive
Look Up a Primitive Function

print
Print Values

print.AsIs
Inhibit Interpretation/Conversion of Objects

print.by
Apply a Function to a Data Frame Split by Factors

print.condition
Condition Handling and Recovery

print.connection
Functions to Manipulate Connections

print.data.frame
Printing Data Frames

print.Date
Date Class

print.default
Default Printing

print.difftime
Time Intervals

print.DLLInfo
Get DLLs Loaded in Current Session

print.hexmode
Display Numbers in Hexadecimal

print.libraryIQR
Loading and Listing of Packages

print.NativeRoutineList
Reflectance Information for C/Fortran routines in a DLL

print.noquote
Class for 'no quote' Printing of Character Strings

print.numeric_version
Numeric Versions

print.octmode
Display Numbers in Octal

print.packageInfo
Loading and Listing of Packages

print.POSIXct
Date-Time Classes

print.proc_time
Running Time of R

print.rle
Run Length Encoding

print.simple.list
Print Values

print.srcfile
References to source files

print.srcref
References to source files

print.summary.table
Cross Tabulation and Table Creation

print.summaryDefault
Object Summaries

print.table
Print Values

print.warnings
Print Warning Messages

prmatrix
Print Matrices, Old-style

proc.time
Running Time of R

prod
Product of Vector Elements

promise
Delay Evaluation

promises
Delay Evaluation

prop.table
Express Table Entries as Fraction of Marginal Table

psigamma
Special Functions of Mathematics

pushBack
Push Text Back on to a Connection

pushBackLength
Push Text Back on to a Connection

-- Q --

q
Terminate an R Session

qr
The QR Decomposition of a Matrix

qr.coef
The QR Decomposition of a Matrix

qr.default
The QR Decomposition of a Matrix

qr.fitted
The QR Decomposition of a Matrix

qr.Q
Reconstruct the Q, R, or X Matrices from a QR Object

qr.qty
The QR Decomposition of a Matrix

qr.qy
The QR Decomposition of a Matrix

qr.R
Reconstruct the Q, R, or X Matrices from a QR Object

qr.resid
The QR Decomposition of a Matrix

qr.solve
The QR Decomposition of a Matrix

qr.X
Reconstruct the Q, R, or X Matrices from a QR Object

quarters
Extract Parts of a POSIXt or Date Object

quit
Terminate an R Session

quote
Substituting and Quoting Expressions

Quotes
Quotes

-- R --

R.home
Return the R Home Directory

R.Version
Version Information

R.version.string
Version Information

Random
Random Number Generation

Random.user
User-supplied Random Number Generation

range
Range of Values

rank
Sample Ranks

rapply
Recursively Apply a Function to a List

raw
Raw Vectors

rawConnection
Raw Connections

rawConnectionValue
Raw Connections

rawShift
Convert to or from Raw Vectors

rawToBits
Convert to or from Raw Vectors

rawToChar
Convert to or from Raw Vectors

rbind
Combine R Objects by Rows or Columns

rbind.data.frame
Combine R Objects by Rows or Columns

rcond
Compute or Estimate the Condition Number of a Matrix

Rd2pdf
Utilities for Processing Rd Files

Rdconv
Utilities for Processing Rd Files

Re
Complex Vectors

read.dcf
Read and Write Data in DCF Format

readBin
Transfer Binary Data To and From Connections

readChar
Transfer Character Strings To and From Connections

readline
Read a Line from the Terminal

readLines
Read Text Lines from a Connection

readRDS
Serialization Interface for Single Objects

readRenviron
Set Environment Variables from a File

Recall
Recursive Calling

Reduce
Common Higher-Order Functions in Functional Programming Languages

reg.finalizer
Finalization of Objects

regex
Regular Expressions as used in R

regexec
Pattern Matching and Replacement

regexp
Regular Expressions as used in R

regexpr
Pattern Matching and Replacement

RegisteredNativeSymbol
Obtain a Description of one or more Native (C/Fortran) Symbols

regmatches
Extract or Replace Matched Substrings

regular expression
Regular Expressions as used in R

remove
Remove Objects from a Specified Environment

removeCConverter
Management of .C argument conversion list

removeTaskCallback
Add or Remove a Top-Level Task Callback

Renviron
Initialization at Start of an R Session

rep
Replicate Elements of Vectors and Lists

rep.numeric_version
Numeric Versions

repeat
Control Flow

replace
Replace Values in a Vector

replicate
Apply a Function over a List or Vector

require
Loading and Listing of Packages

requireNamespace
Loading and Unloading Namespaces

Reserved
Reserved Words in R

reserved
Reserved Words in R

restartDescription
Condition Handling and Recovery

restartFormals
Condition Handling and Recovery

retracemem
Trace Copying of Objects

return
Function Definition

rev
Reverse Elements

rle
Run Length Encoding

rm
Remove Objects from a Specified Environment

RNG
Random Number Generation

RNGkind
Random Number Generation

RNGversion
Random Number Generation

round
Rounding of Numbers

round.Date
Round / Truncate Data-Time Objects

round.POSIXt
Round / Truncate Data-Time Objects

row
Row Indexes

row.names
Get and Set Row Names for Data Frames

rowMeans
Form Row and Column Sums and Means

rownames
Row and Column Names

rowsum
Give Column Sums of a Matrix or Data Frame, Based on a Grouping Variable

rowSums
Form Row and Column Sums and Means

Rprofile
Initialization at Start of an R Session

Rprofile.site
Initialization at Start of an R Session

R_BATCH
Environment Variables

R_BROWSER
Environment Variables

R_COMPLETION
Environment Variables

R_DEFAULT_PACKAGES
Initialization at Start of an R Session

R_DOC_DIR
Environment Variables

R_ENVIRON
Initialization at Start of an R Session

R_ENVIRON_USER
Initialization at Start of an R Session

R_GSCMD
Environment Variables

R_HISTFILE
Environment Variables

R_HISTSIZE
Environment Variables

R_HOME
Return the R Home Directory

R_INCLUDE_DIR
Environment Variables

R_LIBS
Search Paths for Packages

R_LIBS_SITE
Search Paths for Packages

R_LIBS_USER
Search Paths for Packages

R_PAPERSIZE
Environment Variables

R_PDFVIEWER
Environment Variables

R_PLATFORM
Environment Variables

R_PROFILE
Initialization at Start of an R Session

R_PROFILE_USER
Initialization at Start of an R Session

R_RD4PDF
Environment Variables

R_SHARE_DIR
Environment Variables

R_system_version
Numeric Versions

R_TEXI2DVICMD
Environment Variables

R_UNZIPCMD
Environment Variables

R_USER
Environment Variables

R_ZIPCMD
Environment Variables

-- S --

S3groupGeneric
S3 Group Generic Functions

S3Methods
Class Methods

S4
Test for an S4 object

sample
Random Samples and Permutations

sapply
Apply a Function over a List or Vector

save
Save R Objects

saveRDS
Serialization Interface for Single Objects

scale
Scaling and Centering of Matrix-like Objects

scan
Read Data Values

search
Give Search Path for R Objects

searchpaths
Give Search Path for R Objects

seek
Functions to Reposition Connections

seq
Sequence Generation

seq.Date
Generate Regular Sequences of Dates

seq.POSIXt
Generate Regular Sequences of Times

sequence
Create A Vector of Sequences

seq_along
Sequence Generation

seq_len
Sequence Generation

serialize
Simple Serialization Interface

set.seed
Random Number Generation

setCConverterStatus
Management of .C argument conversion list

setdiff
Set Operations

setequal
Set Operations

setHook
Functions to Get and Set Hooks for Load, Attach, Detach and Unload

setSessionTimeLimit
Set CPU and/or Elapsed Time Limits

setTimeLimit
Set CPU and/or Elapsed Time Limits

setwd
Get or Set Working Directory

shell
Invoke a System Command, using a Shell

shell.exec
Open a File or URL using Windows File Associations

showConnections
Display Connections

shQuote
Quote Strings for Use in OS Shells

sign
Sign Function

signalCondition
Condition Handling and Recovery

signif
Rounding of Numbers

simpleCondition
Condition Handling and Recovery

simpleError
Condition Handling and Recovery

simpleMessage
Condition Handling and Recovery

simpleWarning
Condition Handling and Recovery

simplify2array
Apply a Function over a List or Vector

sin
Trigonometric Functions

single
Double-Precision Vectors

sinh
Hyperbolic Functions

sink
Send R Output to a File

slice.index
Slice Indexes in an Array

socketConnection
Functions to Manipulate Connections

socketSelect
Wait on Socket Connections

solve
Solve a System of Equations

solve.qr
The QR Decomposition of a Matrix

sort
Sorting or Ordering Vectors

sort.list
Ordering Permutation

source
Read R Code from a File or a Connection

Special
Special Functions of Mathematics

split
Divide into Groups and Reassemble

split.Date
Date Class

split.POSIXct
Date-Time Classes

sprintf
Use C-style String Formatting Commands

sqrt
Miscellaneous Mathematical Functions

sQuote
Quote Text

srcfile
References to source files

srcfile-class
References to source files

srcfilealias
References to source files

srcfilealias-class
References to source files

srcfilecopy
References to source files

srcfilecopy-class
References to source files

srcref
References to source files

srcref-class
References to source files

Startup
Initialization at Start of an R Session

stderr
Display Connections

stdin
Display Connections

stdout
Display Connections

stop
Stop Function Execution

stopifnot
Ensure the Truth of R Expressions

storage.mode
The (Storage) Mode of an Object

str.POSIXt
Date-Time Classes

strftime
Date-time Conversion Functions to and from Character

strptime
Date-time Conversion Functions to and from Character

strsplit
Split the Elements of a Character Vector

strtoi
Convert Strings to Integers

strtrim
Trim Character Strings to Specified Display Widths

structure
Attribute Specification

strwrap
Wrap Character Strings to Format Paragraphs

sub
Pattern Matching and Replacement

Subscript
Extract or Replace Parts of an Object

subset
Subsetting Vectors, Matrices and Data Frames

substitute
Substituting and Quoting Expressions

substr
Substrings of a Character Vector

substring
Substrings of a Character Vector

sum
Sum of Vector Elements

Summary
S3 Group Generic Functions

summary
Object Summaries

summary.connection
Functions to Manipulate Connections

Summary.Date
Date Class

summary.Date
Date Class

Summary.difftime
Time Intervals

Summary.factor
Factors

Summary.numeric_version
Numeric Versions

Summary.ordered
Factors

Summary.POSIXct
Date-Time Classes

summary.POSIXct
Date-Time Classes

Summary.POSIXlt
Date-Time Classes

summary.srcfile
References to source files

summary.srcref
References to source files

summary.table
Cross Tabulation and Table Creation

suppressMessages
Diagnostic Messages

suppressPackageStartupMessages
Diagnostic Messages

suppressWarnings
Warning Messages

svd
Singular Value Decomposition of a Matrix

sweep
Sweep out Array Summaries

switch
Select One of a List of Alternatives

Syntax
Operator Syntax and Precedence

Sys.chmod
Manipulaton of Directories and File Permissions

Sys.Date
Get Current Date and Time

Sys.getenv
Get Environment Variables

Sys.getlocale
Query or Set Aspects of the Locale

Sys.getpid
Get the Process ID of the R Session

Sys.glob
Wildcard Expansion on File Paths

Sys.info
Extract System and User Information

Sys.junction
File Manipulation

Sys.localeconv
Find Details of the Numerical and Monetary Representations in the Current Locale

sys.on.exit
Functions to Access the Function Call Stack

sys.parent
Functions to Access the Function Call Stack

Sys.readlink
Read File Symbolic Links

Sys.setenv
Set or Unset Environment Variables

Sys.setFileTime
Set File Time

Sys.setlocale
Query or Set Aspects of the Locale

Sys.sleep
Suspend Execution for a Time Interval

sys.source
Parse and Evaluate Expressions from a File

sys.status
Functions to Access the Function Call Stack

Sys.time
Get Current Date and Time

Sys.timezone
Time Zones

Sys.umask
Manipulaton of Directories and File Permissions

Sys.unsetenv
Set or Unset Environment Variables

Sys.which
Find Full Paths to Executables

system
Invoke a System Command

system.file
Find Names of R System Files

system.time
CPU Time Used

system2
Invoke a System Command

-- T --

T
Logical Vectors

t
Matrix Transpose

table
Cross Tabulation and Table Creation

tabulate
Tabulation for Vectors

tan
Trigonometric Functions

tanh
Hyperbolic Functions

tapply
Apply a Function Over a Ragged Array

taskCallbackManager
Create an R-level Task Callback Manager

tcrossprod
Matrix Crossproduct

tempdir
Create Names for Temporary Files

tempfile
Create Names for Temporary Files

textConnection
Text Connections

textConnectionValue
Text Connections

tilde
Tilde Operator

tilde expansion
Expand File Paths

time interval
Time Intervals

time zone
Time Zones

time zones
Time Zones

timezone
Time Zones

TMPDIR
Environment Variables

tolower
Character Translation and Casefolding

topenv
Top Level Environment

toString
Convert an R Object to a Character String

toupper
Character Translation and Casefolding

trace
Interactive Tracing and Debugging of Calls to a Function or Method

traceback
Print Call Stacks

tracemem
Trace Copying of Objects

tracingState
Interactive Tracing and Debugging of Calls to a Function or Method

transform
Transform an Object, for Example a Data Frame

Trig
Trigonometric Functions

trigamma
Special Functions of Mathematics

TRUE
Logical Vectors

trunc
Rounding of Numbers

trunc.Date
Round / Truncate Data-Time Objects

trunc.POSIXt
Round / Truncate Data-Time Objects

truncate
Functions to Reposition Connections

try
Try an Expression Allowing Error Recovery

tryCatch
Condition Handling and Recovery

type
The Type of an Object

typeof
The Type of an Object

TZ
Time Zones

TZDIR
Time Zones

-- U --

umask
Manipulaton of Directories and File Permissions

unclass
Object Classes

undebug
Debug a Function

union
Set Operations

unique
Extract Unique Elements

unique.numeric_version
Numeric Versions

unique.POSIXlt
Date-Time Classes

units
Time Intervals

units.difftime
Time Intervals

unix.time
CPU Time Used

unlink
Delete Files and Directories

unlist
Flatten Lists

unloadNamespace
Loading and Unloading Namespaces

unlockBinding
Binding and Environment Adjustments

unname
Remove 'names' or 'dimnames'

unserialize
Simple Serialization Interface

unsplit
Divide into Groups and Reassemble

untrace
Interactive Tracing and Debugging of Calls to a Function or Method

untracemem
Trace Copying of Objects

unz
Functions to Manipulate Connections

upper.tri
Lower and Upper Triangular Part of a Matrix

url
Functions to Manipulate Connections

UseMethod
Class Methods

utf8ToInt
Convert to or from UTF-8-encoded Character Vectors

-- V --

vapply
Apply a Function over a List or Vector

vector
Vectors

Vectorize
Vectorize a Scalar Function

version
Version Information

-- W --

warning
Warning Messages

warnings
Print Warning Messages

weekdays
Extract Parts of a POSIXt or Date Object

which
Which indices are TRUE?

which.max
Where is the Min() or Max() ?

which.min
Where is the Min() or Max() ?

while
Control Flow

with
Evaluate an Expression in a Data Environment

withCallingHandlers
Condition Handling and Recovery

within
Evaluate an Expression in a Data Environment

withRestarts
Condition Handling and Recovery

withVisible
Return both a value and its visibility

write
Write Data to a File

write.dcf
Read and Write Data in DCF Format

writeBin
Transfer Binary Data To and From Connections

writeChar
Transfer Character Strings To and From Connections

writeLines
Write Lines to a Connection

-- X --

xor
Logical Operators

xor.hexmode
Display Numbers in Hexadecimal

xor.octmode
Display Numbers in Octal

xtfrm
Auxiliary Function for Sorting and Ranking

xtfrm.numeric_version
Numeric Versions

xzfile
Functions to Manipulate Connections

-- Z --

zapsmall
Rounding of Numbers

-- misc --

!
Logical Operators

!.hexmode
Display Numbers in Hexadecimal

!.octmode
Display Numbers in Octal

!=
Relational Operators

"
Quotes

$
Extract or Replace Parts of an Object

$.DLLInfo
Get DLLs Loaded in Current Session

$.package_version
Numeric Versions

$<-
Extract or Replace Parts of an Object

$<-.data.frame
Extract or Replace Parts of a Data Frame

%%
Arithmetic Operators

%*%
Matrix Multiplication

%/%
Arithmetic Operators

%in%
Value Matching

%o%
Outer Product of Arrays

%x%
Kronecker Products on Arrays

&
Logical Operators

&&
Logical Operators

&.hexmode
Display Numbers in Hexadecimal

&.octmode
Display Numbers in Octal

'
Quotes

(
Parentheses and Braces

*
Arithmetic Operators

**
Arithmetic Operators

*.difftime
Time Intervals

+
Arithmetic Operators

+.Date
Operators on the Date Class

+.POSIXt
Date-Time Classes

-
Arithmetic Operators

-.Date
Operators on the Date Class

-.POSIXt
Date-Time Classes

->
Assignment Operators

->>
Assignment Operators

.amatch_bounds
Approximate String Matching (Fuzzy Matching)

.amatch_costs
Approximate String Matching (Fuzzy Matching)

.Autoloaded
On-demand Loading of Packages

.AutoloadEnv
On-demand Loading of Packages

.BaseNamespaceEnv
Environment Access

.bincode
Bin a Numeric Vector

.C
Foreign Function Interface

.Call
Modern Interfaces to C/C++ code

.Class
Class Methods

.colMeans
Form Row and Column Sums and Means

.colSums
Form Row and Column Sums and Means

.conflicts.OK
Attach Set of R Objects to Search Path

.decode_numeric_version
Numeric Versions

.Defunct
Marking Objects as Defunct

.deparseOpts
Options for Expression Deparsing

.Deprecated
Marking Objects as Deprecated

.Device
Lists of Open/Active Graphics Devices

.Devices
Lists of Open/Active Graphics Devices

.doTrace
Interactive Tracing and Debugging of Calls to a Function or Method

.dynLibs
Loading DLLs from Packages

.encode_numeric_version
Numeric Versions

.expand_R_libs_env_var
Search Paths for Packages

.External
Modern Interfaces to C/C++ code

.find.package
Find Packages

.First
Initialization at Start of an R Session

.First.sys
Initialization at Start of an R Session

.Fortran
Foreign Function Interface

.Generic
Class Methods

.GlobalEnv
Environment Access

.Group
S3 Group Generic Functions

.handleSimpleError
Condition Handling and Recovery

.Internal
Call an Internal Function

.isOpen
References to source files

.kappa_tri
Compute or Estimate the Condition Number of a Matrix

.kronecker
Kronecker Products on Arrays

.Last
Terminate an R Session

.Last.lib
Hooks for Namespace Events

.Last.sys
Terminate an R Session

.Last.value
Value of Last Evaluated Expression

.leap.seconds
Date-Time Classes

.libPaths
Search Paths for Packages

.Library
Search Paths for Packages

.Library.site
Search Paths for Packages

.Machine
Numerical Characteristics of the Machine

.makeMessage
Diagnostic Messages

.make_numeric_version
Numeric Versions

.Method
Class Methods

.noGenerics
Loading and Listing of Packages

.NotYetImplemented
Not Yet Implemented Functions and Unused Arguments

.NotYetUsed
Not Yet Implemented Functions and Unused Arguments

.onAttach
Hooks for Namespace Events

.onLoad
Hooks for Namespace Events

.onUnload
Hooks for Namespace Events

.Options
Options Settings

.OptRequireMethods
Initialization at Start of an R Session

.packages
Listing of Packages

.packageStartupMessage
Diagnostic Messages

.path.package
Find Packages

.Platform
Platform Specific Variables

.Primitive
Look Up a Primitive Function

.Random.seed
Random Number Generation

.Renviron
Initialization at Start of an R Session

.rowMeans
Form Row and Column Sums and Means

.rowSums
Form Row and Column Sums and Means

.Rprofile
Initialization at Start of an R Session

.S3PrimitiveGenerics
Internal Generic Functions

.signalSimpleWarning
Condition Handling and Recovery

.standard_regexps
Miscellaneous Internal/Programming Utilities

.Traceback
Print Call Stacks

.userHooksEnv
Functions to Get and Set Hooks for Load, Attach, Detach and Unload

.__H__.cbind
Combine R Objects by Rows or Columns

.__H__.rbind
Combine R Objects by Rows or Columns

/
Arithmetic Operators

/.difftime
Time Intervals

0x1
Numeric Constants

1i
Numeric Constants

1L
Numeric Constants

:
Colon Operator

::
Double Colon and Triple Colon Operators

:::
Double Colon and Triple Colon Operators

<
Relational Operators

<-
Assignment Operators

<<-
Assignment Operators

<=
Relational Operators

=
Assignment Operators

==
Relational Operators

>
Relational Operators

>=
Relational Operators

@
Extract Slots

[
Extract or Replace Parts of an Object

[.AsIs
Inhibit Interpretation/Conversion of Objects

[.data.frame
Extract or Replace Parts of a Data Frame

[.Date
Date Class

[.difftime
Time Intervals

[.factor
Extract or Replace Parts of a Factor

[.hexmode
Display Numbers in Hexadecimal

[.listof
Extract or Replace Parts of an Object

[.noquote
Class for 'no quote' Printing of Character Strings

[.numeric_version
Numeric Versions

[.octmode
Display Numbers in Octal

[.POSIXct
Date-Time Classes

[.POSIXlt
Date-Time Classes

[.simple.list
Extract or Replace Parts of an Object

[<-
Extract or Replace Parts of an Object

[<-.data.frame
Extract or Replace Parts of a Data Frame

[<-.Date
Date Class

[<-.factor
Extract or Replace Parts of a Factor

[<-.POSIXct
Date-Time Classes

[<-.POSIXlt
Date-Time Classes

[[
Extract or Replace Parts of an Object

[[.data.frame
Extract or Replace Parts of a Data Frame

[[.Date
Date Class

[[.factor
Extract or Replace Parts of a Factor

[[.numeric_version
Numeric Versions

[[.POSIXct
Date-Time Classes

^
Arithmetic Operators

`
Quotes

{
Parentheses and Braces

|
Logical Operators

|.hexmode
Display Numbers in Hexadecimal

|.octmode
Display Numbers in Octal

||
Logical Operators

~
Tilde Operator


text:
package soundsystem;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;

import org.junit.Rule;
import org.junit.Test;
import org.junit.contrib.java.lang.system.StandardOutputStreamLog;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = "classpath:META-INF/spring/soundsystem.xml")
public class CDPlayerXMLConfigTest {
	@Rule
	public final StandardOutputStreamLog log = new StandardOutputStreamLog();
	@Autowired
	private MediaPlayer player;
	@Autowired
	private CompactDisc cd;

	@Test
	public void cdShouldNotBeNull() {
		assertNotNull(cd);
	}

	@Test
	public void play() {
		player.play();
		assertEquals(
				"Playing Sgt. Pepper's Lonely Hearts Club Band by The Beatles\n",
				log.getLog());
	}
}