text:
var Paginator = function () {
    function paginatorClickHandler(event) {
        var target = Dom.getTarget(event);
        var node = Dom.findUpward(target, {
            eval: function (n) {
                return n.getAttribute && n.getAttribute("role") != null;
            }
        });

        if (!node) return;
        var role = node.getAttribute("role");

        var list = Dom.findUpward(target, {
            eval: function (n) {
                return n._p;
            }
        });

        if (!list) return;
        var paginator = list._p;

        Dom.cancelEvent(event);

        if (role == "prev" && paginator.currentPage > 0) {
            paginator.gotoPage(paginator.currentPage - 1);
        } else if (role == "next" && paginator.currentPage < paginator.totalPages - 1) {
            paginator.gotoPage(paginator.currentPage + 1);
        } else {
            try {
                var n = parseInt(role, 10);
                if (!isNaN(n) && n >= 0 && n < paginator.totalPages) {
                    console.log("Go to page: ", n);
                    paginator.gotoPage(n);
                }
            } catch (e) {}
        }
    }

    function Paginator() {
        BaseWidget.call(this);
        this.container = this.node();
        this.renderer = null;
        this.source = null;
        this.pageSize = 40;
        this.currentPage = 0;
        this.totalPages = 0;
        this.firstRender = true;

        this.selectedItems = [];
    }
    __extend(BaseWidget, Paginator);

    Paginator.prototype.setup = function (options) {
        this.options = options ? options : null;
        this.comparer = (options && options.comparer) ? options.comparer : function (a, b) {
            return a.id == b.id;
        };
    };
    Paginator.prototype.control = function (renderer) {
        this.renderer = renderer;
        this.renderer.withItemComparer(this.comparer);

        if (this.renderer.addOrderRequestListener) {
            this.renderer.addOrderRequestListener(this);
        }

        var thiz = this;

        if (this.renderer.addListener) {
            this.renderer.addListener({
                onSelectionChanged: function (table, fromUserAction) {
                    thiz.onRendererSelectionChanged(table, fromUserAction);
                    thiz.renderer.invalidateSelectionInfo(thiz);
                },
                onSelectNoneAction: function () {
                    thiz.clearSelection();
                }
            });
        }

        var showPaginator = this.options != null && this.options.showPaginator ? true : false;

        if (showPaginator) {
            if (this.renderer.markedAsPaginated) this.renderer.markedAsPaginated(true);
            return;
        }
        //console.log("add load more event " + showPaginator);
        Dom.registerEvent(this.renderer.container, "scroll", function(e){
            var position = this.scrollTop + this.offsetHeight;
            var percent = position / this.scrollHeight * 100;
            //console.log(percent);
            if (percent >= 75) {
                thiz.loadMore();
            }
        });
    };
    Paginator.prototype.clearSelection = function () {
        this.selectedItems = [];
        this.renderer.invalidateSelectionInfo(this);
        this.fireSelectionChangedEvent();
    };

    Paginator.prototype.loadMore = function() {
    	//console.log("load");
    	var thiz = this;
    	this.currentPage++;
    	this.source.loadPage(this.currentPage, this.pageSize, function (results, totalItems) {
    		if (thiz.pageSize < results.length) {
                thiz.renderer.addItems(results.slice(0, thiz.pageSize));
            } else {
                thiz.renderer.addItems(results);
            }
    	});
    };

    Paginator.prototype.onRendererSelectionChanged = function (table, fromUserAction) {
        if (!fromUserAction) return;

        var items = this.renderer.getSelectedItems();
        var all = this.renderer.items;

        if (!all) return;

        var newSelectedItems = [];
        for (var i = 0; i < this.selectedItems.length; i ++) {
            var item = this.selectedItems[i];
            if (!Util.contains(all, item, this.comparer) || Util.contains(items, item, this.comparer)) {
                newSelectedItems.push(item);
            }
        }
        for (var i = 0; i < items.length; i ++) {
            var item = items[i];
            if (!Util.contains(this.selectedItems, item, this.comparer)) {
                newSelectedItems.push(item);
            }
        }

        this.selectedItems = newSelectedItems;
        this.fireSelectionChangedEvent();
    };

    Paginator.prototype.fireSelectionChangedEvent = function (fromUserAction) {
        if (this.onSelectionChanged) this.onSelectionChanged(this, fromUserAction);
    };

    Paginator.prototype.changeOrder = function (order) {
        if (!this.source || !this.source.setOrder) return;
        this.source.setOrder(order);
        this.gotoPage(this.currentPage);
    };
    Paginator.prototype.gotoPage = function (pageIndex, silent) {
        var thiz = this;
        //this.renderer.setItems([], true);
        if (this.renderer.showBusy && !silent) this.renderer.showBusy(true);
        this.source.loadPage(pageIndex, this.pageSize, function (results, totalItems) {
            var showPaginator = thiz.options != null && thiz.options.showPaginator;
            var calculatePageSize = thiz.needCalculatePageSize() && showPaginator && pageIndex == 0 && totalItems > 0 && thiz.firstRender && thiz.renderer.getPreferredPageSize;

            if (thiz.selectedItems && thiz.selectedItems.length > 0 && results && results.length > 0) {
                var updatedItems = [];
                for (var i = 0; i < thiz.selectedItems.length; i ++) {
                    var item = thiz.selectedItems[i];
                    var other = find(results, function (a) {
                        return thiz.comparer(a, item);
                    });

                    updatedItems.push(other ? other : item);
                }

                thiz.selectedItems = updatedItems;
            }
            thiz.renderer.setItems(results, calculatePageSize);

            var count = results.length;

            if (!thiz.renderer.isSelectAll()) {
                thiz.renderer.selectItems(thiz.selectedItems);
            }

            if (calculatePageSize) { //perform calculation
                //thiz.renderer.setItems(results.slice(0, Math.min(5, results.length)));

                thiz.firstRender = false;
                var preferred = thiz.renderer.getPreferredPageSize();
                if (!isNaN(preferred) && preferred > 0) {
                    thiz.pageSize = preferred;
                }
                if (thiz.pageSize > results.length) {
                    thiz.gotoPage(0);
                    if (thiz.renderer.showBusy && !silent) thiz.renderer.showBusy(false);
                    return;
                } else {
                    var subList = results.slice(0, thiz.pageSize);
                    thiz.renderer.setItems(subList);
                    count = subList.length;

                    if (!thiz.renderer.isSelectAll()) {
                        thiz.renderer.selectItems(thiz.selectedItems);
                    }
                }
            }

            if (thiz.source.getOrder && thiz.renderer.setOrder) {
                thiz.renderer.setOrder(thiz.source.getOrder());
            }

            //calculate pages
            thiz.totalPages = Math.ceil(totalItems / thiz.pageSize);
            thiz.currentPage = pageIndex;
            thiz.totalItems = totalItems;

            if (thiz.options && thiz.options.onPageLoaded) {
                thiz.options.onPageLoaded(thiz, count);
            }

            if (showPaginator) {
            	thiz._updateUI();
            } else {
            	thiz.container.innerHTML = "";
            	thiz.invalidateRendererHeight();
            }

            thiz.renderer.multiPages = thiz.totalPages > 1;
            thiz.renderer.totalItems = thiz.totalItems;
            if (thiz.renderer.showBusy && !silent) thiz.renderer.showBusy(false);
        }, function (error) {
            if (thiz.renderer.showBusy && !silent) thiz.renderer.showBusy(false);
        });
    };

    Paginator.prototype.invalidateRendererHeight = function() {
    	if (this.renderer == null) return;

    	var calculatedHeight = this.renderer.getCalculatedHeight();

    	this.renderer.setHeight(calculatedHeight);
    }
    Paginator.prototype.needCalculatePageSize = function() {
        return true;
    }
    Paginator.prototype.setSource = function (source) {
        this.source = source;
        this._allItems = null;
        this.selectedItems = [];
        this.firstRender = true;
        if (this.renderer) {
            if (this.renderer.reset) this.renderer.reset();
            this.gotoPage(0);
        }
    };

    Paginator.prototype.refresh = function (withIndicator) {
        if (!this.source) return;
        this._allItems = null;
        this.gotoPage(this.currentPage, withIndicator ? null : "silent");
    };

    Paginator.prototype.reInit = function () {
        if (this.firstRender) {
        	this.invalidateRendererHeight();
        	this.renderer.invalidateSizing();
        	return;
        }

    	this.firstRender = true;
        //this.renderer.setItems([]);

        this.gotoPage(0, "silent");
    };

    Paginator.THRESHOLD = 2;
    Paginator.PADDING = 2;
    Paginator.prototype._generateLIs = function (from, to, enableDot) {
        var count = to - from + 1;
        if (enableDot && count - 2 * Paginator.PADDING > Paginator.THRESHOLD) {
            var html = this._generateLIs(from, from + Paginator.PADDING, false);
            html += "
...
"; //dot
            html += this._generateLIs(to - Paginator.PADDING, to, false);
            return html;
        } else {
            var html = "";
            for (var i = Math.max(0, from); i < Math.min(to, this.totalPages); i ++) {
                html += "
" + (i + 1) + "
";
            }

            return html;
        }
    };
    Paginator.prototype._generateButtons = function (from, to, enableDot) {
        var count = to - from + 1;
        if (enableDot && count - 2 * Paginator.PADDING > Paginator.THRESHOLD) {
            var html = this._generateButtons(from, from + Paginator.PADDING, false);
            html += "<button class=\"btn btn-default\" type=\"button\">...</button>"; //dot
            html += this._generateButtons(to - Paginator.PADDING, to, false);
            return html;
        } else {
            var html = "";
            for (var i = Math.max(0, from); i < Math.min(to, this.totalPages); i ++) {
                html += "<button type=\"button\" role=\"" + i + "\"";
                if (i == this.currentPage) {
                    html += " class=\"btn btn-default active\"";
                } else {
                    html += " class=\"btn btn-default\"";
                }
                html += ">" + (i + 1) + "</button>";
            }

            return html;
        }
    };
    Paginator.prototype._updateUI = function () {
        if (this.options.useButtons) {
            this._updateButtonUI();
            return;
        }
        var id = widget.random();
        var html = "";

        if (this.options && this.options.withoutStatus) {
            html = "
" +
            "
" +
            "
";
        } else {
            html = "

" + (this.options && this.options.getTotalItemText ? this.options.getTotalItemText(this.totalItems) : "") + "

" +
            "
" +
            "
";
        }

        html += "
«
";

        html += this._generateLIs(0, this.currentPage, true);
        html += this._generateLIs(this.currentPage, this.totalPages, true);

        html += "
»
";
        html += "

";
        this.container.innerHTML = html;
        this.list = document.getElementById(id);
        this.list._p = this;
        Dom.registerEvent(this.list, "click", paginatorClickHandler, false);
    };
    Paginator.prototype._updateButtonUI = function () {
        var id = widget.random();
        var html = "";

        html += "

";

        html += "<button type=\"button\" class=\"btn btn-default\" role=\"prev\"";
        if (this.currentPage == 0) {
            html += " disabled=\"true\"";
        }

        html += ">«</button>";

        html += this._generateButtons(0, this.currentPage, true);
        html += this._generateButtons(this.currentPage, this.totalPages, true);

        html += "<button type=\"button\" class=\"btn btn-default\" role=\"next\"";
        if (this.currentPage == this.totalPages - 1) {
            html += " disabled=\"true\"";
        }

        html += ">»</button>";
        html += "

";
        console.log("container:", this.container);

        this.container.innerHTML = html;
        this.list = document.getElementById(id);
        this.list._p = this;
        Dom.registerEvent(this.list, "click", paginatorClickHandler, false);
    };
    Paginator.prototype.getSelectionCount = function () {
        if (!this.renderer) return 0;
        if (!this.renderer.isSelectAll()) {
            return this.selectedItems.length;
        } else {
            return this.totalItems;
        }
    };
    Paginator.prototype.getSelectedItems = function (callback, forceSelectAll) {
    	if (!callback) {
    		return this.selectedItems;
    	}
        if ((typeof(forceSelectAll) == "undefined"
            || forceSelectAll == null)&& !this.renderer.isSelectAll()) {
            callback(this.selectedItems);
        } else {
            if (this.source == null) {
                callback([]);
                return;
            }
            if (this._allItems) {

                callback(this._allItems);
                return;
            }
            var total = this.totalItems;
            var chunk = 100;
            var items = [];
            var thiz = this;
            var index = 0;
            var next = function () {
                thiz.source.loadPage(index, chunk, function (results, totalItems) {
                    for (var i = 0; i < results.length; i ++) {
                        items.push(results[i]);
                    }
                    total = totalItems;
                    index ++;
                    if (items.length < total && results.length > 0) {
                        next();
                    } else {
                        defaultIndicator.done();
                        //console.log("Done loading " + items.length + " items.");
                        thiz._allItems = cloneObject(items);
                        callback(items);
                    }
                }, function (error) {
                    widget.Dialog.error(Messages["paginator_get_data_error_msg"]);
                    defaultIndicator.done();
                });
            };
            defaultIndicator.busy(Messages["fetching_data_list"]);
            next();
        }
    };

    return Paginator;
}();


text:
from django.views.decorators.csrf import ensure_csrf_cookie
from django.views.decorators.http import require_http_methods
from website.src.requests import GetRequestHandler, ApiRequestHandler

def get_request(func):
    @ensure_csrf_cookie
    @require_http_methods(["GET"])
    def wrapper(request, *args, **kwargs):
        g_request = GetRequestHandler(request)
        g_request.template = "website/router.html"
        try:
            g_request = func(g_request, *args, **kwargs)
        except (KeyError, AttributeError) as e:
            print(e)
        return g_request.get_response()
    return wrapper

def api_request(func):
    @require_http_methods(["GET", "POST"])
    def wrapper(request, *args, **kwargs):
        req_handler = ApiRequestHandler(request)
        try:
            req_handler = func(req_handler, *args, **kwargs)
        except (KeyError, AttributeError) as e:
            print(e)
        return req_handler.respond()
    return wrapper

redpajama_set_name: RedPajamaGithub


text:
define(['altair/facades/declare',
    './_Base'
], function (declare, _Base) {

    return declare([_Base], {

        _findEndpoint:      '/admin/orders.json',
        _getEndpoint:       '/admin/orders/{{_id}}.json',
        _keyPlural:         'orders',
        _keySingular:       'order',
        _createEndpoint:    '/admin/orders.json',
        _updateEndpoint:    '/admin/orders/{{_id}}.json'

    });

});


text:
<?php
namespace GetuiSDK\IGeTui\Core;

use GetuiSDK\IGeTui\Protobuf\PBMessage;

class SingleBatchItem extends PBMessage
{
    var $wired_type = PBMessage::WIRED_LENGTH_DELIMITED;
    public function __construct($reader=null)
    {
        parent::__construct($reader);
        $this->fields["1"] = "\\GetuiSDK\\IGeTui\\Protobuf\\Type\\PBInt";
        $this->values["1"] = "";
        $this->fields["2"] = "\\GetuiSDK\\IGeTui\\Protobuf\\Type\\PBString";
        $this->values["2"] = "";
    }
    function seqId()
    {
        return $this->_get_value("1");
    }
    function set_seqId($value)
    {
        return $this->_set_value("1", $value);
    }
    function data()
    {
        return $this->_get_value("2");
    }
    function set_data($value)
    {
        return $this->_set_value("2", $value);
    }
}


text:
classdef (TestTags = {'Unit', 'SPGR', 'qMT'}) Bloch_Test < matlab.unittest.TestCase
%% BLOCH_TEST Test class for Bloch.m
%
%   --tests--
%   test_no_pulse_mag_remains_unchanged
%       - Assert that a magnetization vector with only longitudinal values
%         remains constant for a constant pulse of 0 degree FA.
%
%   test_no_longi_mag_evol_for_transverse_initial_mag_inf_t2_t1
%       - Assert that a magnetization vector with only transverse values
%         does not accrue longitudinal magnetization for the case of
%         infinite T1 and T2 (0 deg FA).
%
%   test_magn_evols_to_equilibrium_vals
%       - Assert that an empty magnetization vector evolves to the
%         equilibrium longitudinal values (M0f and M0r) after a time
%         much greater than T1f (10x) and 0 deg FA.
%
%   test_mag_goes_to_zero_for_time_much_greater_than_t2f
%       - Assert that a magnetization vector with only transverse values
%         decays to 0 after a time much greater than T2f (x10)
%
%   test_steady_state_smaller_for_small_delta_than_big
%       - Assert that steady-state longitudinal (free) magnization is
%         smaller for the case of a small offset frequency than large
%         offset freq.
%
%   test_steady_state_larger_for_small_FA_than_big
%       - Assert that steady-state longitudinal (free) magnization is
%         larger for the case of a small flip angle (per millisec) than
%         large flip angle.
%
%   test_example_case_equals_analytical_solution
%       - Assert that the steady-state magnetization vector solved from
%         from the ODEs is equal to the analytical solution (BlochSol.m;
%         Relative tolerance of 0.01) for an example case: 10 s pulse, 1245
%         Hz off-resonance, and 56 deg FA per ms.
%

    properties
        Param = struct('M0f', 1,           ...
                       'M0r', 0.15,        ...
                       'R1f', 1.1,         ...
                       'R1r', 1,           ...
                       'R2f', 1/0.03,      ...
                       'R2r', 1/(12*10^-6),...
                       'kf',  4.0,         ...
                       'kr',  4.0/0.15);
    end

    methods (TestClassSetup)
    end

    methods (TestClassTeardown)
    end

    methods (Test)
        function test_no_pulse_mag_remains_unchanged(testCase)
            %% Prep
            %
            delta = 200; % On-resonance
            testCase.Param.G = computeG(delta,1/testCase.Param.R2f, 'SuperLorentzian');

            pulseDur = 10; % seconds
            pulseShape = 'hard';

            flipAngle = 0; % No pulse
            Pulse = GetPulse(flipAngle, delta, pulseDur, pulseShape);

            M0 = [0 0 1 0.15]'; % Initial magnetization, Xf Yf Zf Zr

            timeRange = linspace(0,10,1000); % in seconds

            [~,M]=ode23(@(t,Mevol) Bloch(t, Mevol, testCase.Param, Pulse), timeRange, M0);

            %                    Actual ,  Expected
            testCase.assertEqual(M(end,:), M0', 'AbsTol', 0.001);
        end

        function test_no_longi_mag_evol_for_transverse_initial_mag_inf_t2_t1(testCase)
            %% Prep
            %
            Param = testCase.Param;

            delta = 100; % Go to the rotating ref frame for this case
            Param.G = computeG(delta,1/Param.R2f, 'SuperLorentzian');

            pulseDur = 0.001; % seconds, near-instantaneous
            pulseShape = 'hard';

            flipAngle = 0;
            Pulse = GetPulse(flipAngle, delta, pulseDur, pulseShape);

            %***
            Param.R2f = 0.0001; % Assume very large T2f
            Param.R2r = 0.0001; % Assume very large T2r
            Param.R1f = 0.0001; % Assume very large T1f
            Param.R1r = 0.0001; % Assume very large T1r
            %***

            M0 = [1 0 0 0]'; % Initial magnetization, Xf Yf Zf Zr

            timeRange = linspace(0, 1, 1000); % in seconds

            [~,M]=ode23(@(t,Mevol) Bloch(t, Mevol, Param, Pulse), timeRange, M0);

            %                    Actual                     , Expected
            testCase.assertEqual(double([M(end,3) M(end,4)]), [M0(3) M0(4)], 'AbsTol', 0.001);
        end

        function test_magn_evols_to_equilibrium_vals(testCase)
            %% Prep
            %
            Param = testCase.Param;

            delta = 100; % Go to the rotating ref frame for this case
            Param.G = computeG(delta,1/Param.R2f, 'SuperLorentzian');

            pulseDur = 0.001; % seconds, near-instantaneous
            pulseShape = 'hard';

            flipAngle = 0;
            Pulse = GetPulse(flipAngle, delta, pulseDur, pulseShape);

            M0 = [0 0 0 0]'; % Initial magnetization, Xf Yf Zf Zr

            timeRange = linspace(0, (1/Param.R1f*10), 1000); % in seconds, 10x T1f

            [~,M]=ode23(@(t,Mevol) Bloch(t, Mevol, Param, Pulse), timeRange, M0);

            %                    Actual ,  Expected
            testCase.assertEqual(double(M(end,:)), [0 0 Param.M0f Param.M0r], 'AbsTol', 0.001);
        end

        function test_mag_goes_to_zero_for_time_much_greater_than_t2f(testCase)
            %% Prep
            %
            Param = testCase.Param;

            delta = 100; % Go to the rotating ref frame for this case
            Param.G = computeG(delta,1/Param.R2f, 'SuperLorentzian');

            pulseDur = 0.001; % seconds, near-instantaneous
            pulseShape = 'hard';

            flipAngle = 0;
            Pulse = GetPulse(flipAngle, delta, pulseDur, pulseShape);

            M0 = [1 0 0 0]'; % Initial magnetization, Xf Yf Zf Zr

            timeRange = linspace(0, (1/Param.R2f)*10, 1000); % in seconds, 10x T2f

            [~,M]=ode23(@(t,Mevol) Bloch(t, Mevol, Param, Pulse), timeRange, M0);

            %                    Actual ,  Expected
            testCase.assertEqual(double(M(end,1:2)), [0 0], 'AbsTol', 0.001);
        end

        function test_steady_state_smaller_for_small_delta_than_big(testCase)
            %% Prep
            %
            Param1 = testCase.Param;
            Param2 = testCase.Param;

            delta1 = 100;
            delta2 = 10*delta1;

            Param1.G = computeG(delta1,1/Param1.R2f, 'SuperLorentzian');
            Param2.G = computeG(delta2,1/Param2.R2f, 'SuperLorentzian');

            pulseDur = 10; % seconds
            pulseShape = 'hard';

            flipAngle = 40; % FA per millisec
            Pulse1 = GetPulse((flipAngle*1000)*pulseDur, delta1, pulseDur, pulseShape);
            Pulse2 = GetPulse((flipAngle*1000)*pulseDur, delta2, pulseDur, pulseShape);

            M0 = [0 0 testCase.Param.M0f testCase.Param.M0r]'; % Initial magnetization, Xf Yf Zf Zr

            timeRange = linspace(0, pulseDur, 1000); % in seconds, 10x T2f

            [~,M1]=ode23(@(t,Mevol) Bloch(t, Mevol, Param1, Pulse1), timeRange, M0);
            [~,M2]=ode23(@(t,Mevol) Bloch(t, Mevol, Param2, Pulse2), timeRange, M0);

            %                          Small delta, Big delta
            testCase.assertLessThan(M1(end,3)  , M2(end,3));
        end

        function test_steady_state_larger_for_small_FA_than_big(testCase)
            %% Prep
            %
            Param = testCase.Param;

            delta = 1000;

            Param.G = computeG(delta,1/Param.R2f, 'SuperLorentzian');

            pulseDur = 10; % seconds
            pulseShape = 'hard';

            flipAngle1 = 40; % FA per millisec
            flipAngle2 = 2*flipAngle1 ; % FA per millisec

            Pulse1 = GetPulse((flipAngle1*1000)*pulseDur, delta, pulseDur, pulseShape);
            Pulse2 = GetPulse((flipAngle2*1000)*pulseDur, delta, pulseDur, pulseShape);

            M0 = [0 0 testCase.Param.M0f testCase.Param.M0r]'; % Initial magnetization, Xf Yf Zf Zr

            timeRange = linspace(0, pulseDur, 1000); % in seconds, 10x T2f

            [~,M1]=ode23(@(t,Mevol) Bloch(t, Mevol, Param, Pulse1), timeRange, M0);
            [~,M2]=ode23(@(t,Mevol) Bloch(t, Mevol, Param, Pulse2), timeRange, M0);

            %                          Small FA , Big FA
            testCase.assertGreaterThan(M1(end,3), M2(end,3));
        end

        function test_example_case_equals_analytical_solution(testCase)
            %% Prep
            %
            Param = testCase.Param;

            delta = 1234; %arbitrary

            Param.G = computeG(delta,1/Param.R2f, 'SuperLorentzian');

            pulseDur = 10; % seconds
            pulseShape = 'hard';

            flipAngle = 56; % FA per millisec, arbitrary

            Pulse = GetPulse((flipAngle*1000)*pulseDur, delta, pulseDur, pulseShape);

            M0 = [0 0 testCase.Param.M0f testCase.Param.M0r]'; % Initial magnetization, Xf Yf Zf Zr

            timeRange = linspace(0, pulseDur, 1000); % in seconds, 10x T2f

            %% ODE solution
            [~,odeM]=ode23(@(t,Mevol) Bloch(t, Mevol, Param, Pulse), timeRange, M0);

            %% Analytical solution
            for ii =1:length(timeRange)
               analyticalM(ii, :) = BlochSol(timeRange(ii), M0, Param, Pulse);
            end

            %% Assertion

            %                          Small FA , Big FA
            testCase.assertEqual(double(analyticalM(end,:)), odeM(end,:), 'RelTol', 0.01);
        end
    end

end


text:
<?php

class TraitSearchQueryResult extends DatabaseSearchQueryResult {
    protected function getQuery() {
        return $this->queryNameContains(Traits::query(), $this->getSearchTermsWithoutFilters());
    }

    public function render($data) {
        return View::make('search.result.generic', $data)->with('result', $this);
    }

    protected function getInternalFilters() {
        return [
            'id' => new IntegerSearchQueryFilter('id'),
        ];
    }
}


text:
  function(ast_json_eval_null )#ast scope
    map_get(${ast}  data)
    ans(data)
    return()
  endfunction()


text:
import React, { PureComponent } from 'react';
import PropTypes from 'prop-types';
import { Provider } from 'react-redux';
import { Router } from 'react-router';

class Root extends PureComponent {
  static propTypes = {
    routes: PropTypes.object.isRequired,
    store: PropTypes.object.isRequired,
    history: PropTypes.object.isRequired,
    render: PropTypes.func.isRequired,
  };

  render() {
    const { store, history, routes, render } = this.props;

    return (
      <Provider store={store}>
        <Router history={history} render={render}>
          {routes}
        </Router>
      </Provider>
    );
  }
}

export default Root;


text:
package be.hertay.endpoint;

import be.hertay.component.UrlProcessor;
import be.hertay.model.URLEntry;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.context.request.async.DeferredResult;

import javax.inject.Inject;
import java.util.List;

/**
 * The rest controller.
 */
@RestController
public class Crawler {

    @Inject
    private UrlProcessor urlProcessor;

    /**
     * Handle the post request with the list of url to process.
     * @param entries list of url entries.
     * @return The deferred result for async process.
     */
    @RequestMapping(value = "/crawle", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE)
    public DeferredResult<String> crawle(@RequestBody List<URLEntry> entries){
        DeferredResult<String> result = new DeferredResult<>();
        urlProcessor.process(entries, new ResultHandler(entries.size(), result));
        return result;
    }
}


text:
import { DocumentParserTree, XmlNode } from "./DocumentParserTree";
import { TokenStream } from "./TokenStream";
import { equalsAnyOf } from "./util";
import { Parser_T } from "./ParserToken";
import { Lexer_T } from "./LexerToken";

export class Parser {
	private stream: TokenStream<Lexer_T.Token>;
	private ast: DocumentParserTree;

	constructor(tokens: Lexer_T.Token[]) {
		this.stream = new TokenStream(tokens);
		this.ast = new DocumentParserTree();
	}

	static makeAST(tokens: Lexer_T.Token[]) {
		return new Parser(tokens).parse();
	}

	parse() {
		const context = {
			astRoot: this.ast.root,
			indent: {
				current: 0,
				previous: 0
			},
			// TODO: Remove this concept of a line. Will make it easier to later implement multi-line stuff.
			line: {
				number: 0,
				tagName: "",
				hasTagDeclaration: false
			},
			reset() {
				// Add end tag to syntax tree.
				context.astRoot.syntaxTree.down(
					new Parser_T.Types.TagEnd(context.line.tagName).toNode()
				);

				// Reset state
				this.line.number++;

				this.indent.previous = this.indent.current;
				this.indent.current = 0;

				this.line.tagName = "";

				this.line.hasTagDeclaration = false;
			}
		};

		while (this.stream.hasNext()) {
			const currentToken = this.stream.advance()!!;

			switch (currentToken.kind) {
				case Lexer_T.TokenKind.TagDeclaration:
					context.line.hasTagDeclaration = true;

					// Add the new xml tag.
					context.astRoot.down(new XmlNode());
					context.astRoot = context.astRoot.children[0];

					if (this.stream.lookahead(1).kind !== Lexer_T.TokenKind.Text) {
						throw this.makeUserError(`A tag declaration must be followed by text!`);
					}

					const tagName = this.buildString(Lexer_T.TokenKind.Whitespace);

					if (!tagName) {
						throw this.makeUserError(
							"Could not build the tag name after a tag declaration!"
						);
					}

					// Add the tag name to the xml root node.
					context.astRoot.syntaxTree.down(new Parser_T.Types.TagStart(tagName).toNode());
					// Update context ( this value is later used to add the end tag! )
					context.line.tagName = tagName;
					break;
				case Lexer_T.TokenKind.Text:
					// Go back one token. Since otherwise we would skip this ( the "currentToken" ) value.
					this.stream.defer(this.stream.lookback(1));
					// Get the summary of the folowing text.
					const text = this.buildString(Lexer_T.TokenKind.Newline);
					// This should never happen... Hopefully. Basically just here to please the type system.
					if (!text) {
						throw this.makeUserError("Could not build text!");
					}

					// Add the text node.
					context.astRoot.syntaxTree.down(new Lexer_T.Types.Text(text).toNode());
					break;
				case Lexer_T.TokenKind.Newline:
					/**
					 * In TSML all statements are terminated by newlines.
					 * For the moment there is no way to put one tag on multiple lines.
					 *
					 * So we reset the context everytime we get a newline.
					 */
					context.reset();
					break;
				case Lexer_T.TokenKind.Whitespace:
					/**
					 * If Whitespace is on a line that already has a XML Tag declaration, like:
					 *
					 * Example:
					 * %h1 Hello
					 * ---^
					 *
					 * The Whitespace is a "seperator" since it seperates two tokens, duh.
					 * We need this information in the token-stream since we need to respect
					 * whitespace when generating strings. ( @see this.buildString )
					 *
					 * If this Whitespace is before a the tag declaration of a line, like:
					 *
					 * Example:
					 * 			%h1 Hellooo
					 * ^^^^^^^^^-----------
					 *
					 * The Whitespace are counted as indents. Indents are then used to determin the
					 * level of nesting in the xml tree.
					 */
					if (!context.line.hasTagDeclaration) {
						context.indent.current++;
					}
					break;
				case Lexer_T.TokenKind.EndOfFile:
					/**
					 * There may be cases when the context needs to be reset at the end of a file.
					 * Here these edge-cases are handled.
					 *
					 * Example:
					 * "%h1 TEXT"
					 *
					 * In the example above the context will never be reset, because there is no newline.
					 * And thus there will be no end tag.
					 *
					 * In cases like this:
					 *
					 * Example:
					 * "
					 * %h1 TEXT
					 * "
					 *
					 * Is a newline at the end of the file. And thus the context will be reset correctly at
					 * the end of the file. Like it should be.
					 *
					 * We check if the context was already reset. It is reset if the tagname equals a empty string.
					 * If not the context was not reset and we need to reset it, before the file ends.
					 */
					if (context.line.tagName !== "") {
						context.reset();
					}
					break;
				default:
					this.makeUserError(`Can not parse token: "${currentToken.kind}"`);
			}
		}

		return this.ast;
	}

	private buildString(...breakTokens: Lexer_T.TokenKind[]) {
		// Make sure we never parse past the end of the file. -> We always return a string.
		breakTokens.push(Lexer_T.TokenKind.EndOfFile);
		// Init text
		let text = "";

		do {
			const currentToken = this.stream.peek();

			if (equalsAnyOf(currentToken.kind, breakTokens)) {
				return text;
			}

			// TODO: This should be refactored.
			switch (currentToken.kind) {
				case Lexer_T.TokenKind.Text:
					const textNode = currentToken as Lexer_T.Types.Text;
					text += textNode.value;
					break;
				case Lexer_T.TokenKind.Whitespace:
					// TODO: Does not differentiate between space and tab.
					text += " ";
					break;
				case Lexer_T.TokenKind.TagDeclaration:
					text += "%";
					break;
				default:
					throw this.makeUserError(
						`Can not build string for token "${currentToken.kind}"`
					);
			}

			this.stream.advance();
		} while (this.stream.hasNext());
	}

	makeUserError(message: string): never {
		throw new Error(`PARSER :: USER_ERROR :: ${message}`);
	}
}


text:
import React from 'react'
import SourceProviders from './sourceProviders'
import HardwareProviders from './hardwareProviders'
import { Grid, Row, Col } from 'react-flexbox-grid'

export const Settings = () => (
  <Grid>
    <Row>
      <Col xs={0} sm={0} md={4} lg={2}/>
      <Col xs={12} sm={12} md={8} lg={10}>
        <SourceProviders/>
        <HardwareProviders/>
      </Col>
    </Row>
  </Grid>
)

export default Settings


text:
/* Margin and padding fixes */
html.mdldemo.dashboard > body > div > div > main > div > div.container-fluid {
  margin-top: 30px !important; }

/* Dockbar fixes */
html.mdldemo.dashboard > body div.portlet-dockbar {
  display: none; }

/* Active navigation */
html.mdldemo.dashboard > body .demo-layout .demo-navigation .mdl-navigation__link.is-active {
  color: white; }

/* Search box fixes */
html.mdldemo.dashboard > body header.demo-header form {
  margin: 0 0 0px; }


text:
import {mount} from 'enzyme';
import jasmineEnzyme from 'jasmine-enzyme';
import * as React from 'react';

import {LayoutTransitionGroup} from '../src';
import CssInterpolator from '../src/interpolators/CssInterpolator';

describe('LayoutTransitionGroup', () => {
    class MyComponent extends LayoutTransitionGroup {
        private interpolator = new CssInterpolator();

        public render() {
            return (

Foo

            );
        }

        protected getInterpolator() {
            return this.interpolator;
        }
    }

    it('should render normally', () => {
        const wrapper = mount(<MyComponent />);

        expect(wrapper.render().text()).toEqual('Foo');
    });
});


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

package org.mortbay.jetty.security;

import java.io.IOException;
import java.security.Principal;

import javax.servlet.http.HttpServletResponse;

import org.mortbay.jetty.HttpHeaders;
import org.mortbay.jetty.Request;
import org.mortbay.jetty.Response;
import org.mortbay.log.Log;
import org.mortbay.util.StringUtil;

/* ------------------------------------------------------------ */
/** BASIC authentication.
 *
 * @author Greg Wilkins (gregw)
 */
public class BasicAuthenticator implements Authenticator
{
    /* ------------------------------------------------------------ */
    /**
     * @return UserPrinciple if authenticated or null if not. If
     * Authentication fails, then the authenticator may have committed
     * the response as an auth challenge or redirect.
     * @exception IOException
     */
    public Principal authenticate(UserRealm realm,
            String pathInContext,
            Request request,
            Response response)
    throws IOException
    {
        // Get the user if we can
        Principal user=null;
        String credentials = request.getHeader(HttpHeaders.AUTHORIZATION);

        if (credentials!=null )
        {
            try
            {
                if(Log.isDebugEnabled())Log.debug("Credentials: "+credentials);
                credentials = credentials.substring(credentials.indexOf(' ')+1);
                credentials = B64Code.decode(credentials,StringUtil.__ISO_8859_1);
                int i = credentials.indexOf(':');
                String username = credentials.substring(0,i);
                String password = credentials.substring(i+1);
                user = realm.authenticate(username,password,request);

                if (user==null)
                {
                    Log.warn("AUTH FAILURE: user {}",StringUtil.printable(username));
                }
                else
                {
                    request.setAuthType(Constraint.__BASIC_AUTH);
                    request.setUserPrincipal(user);
                }
            }
            catch (Exception e)
            {
                Log.warn("AUTH FAILURE: "+e.toString());
                Log.ignore(e);
            }
        }

        // Challenge if we have no user
        if (user==null && response!=null)
            sendChallenge(realm,response);

        return user;
    }

    /* ------------------------------------------------------------ */
    public String getAuthMethod()
    {
        return Constraint.__BASIC_AUTH;
    }

    /* ------------------------------------------------------------ */
    public void sendChallenge(UserRealm realm,Response response)
        throws IOException
    {
        response.setHeader(HttpHeaders.WWW_AUTHENTICATE, "Basic realm=\""+realm.getName()+'"');
        response.sendError(HttpServletResponse.SC_UNAUTHORIZED);
    }

}


text:
package com.vsked.service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.github.pagehelper.PageHelper;
import com.vsked.common.BaseJson;
import com.vsked.common.Page;
import com.vsked.dao.SysMenuDao;

@Service
@Transactional
public class SysMenuSer extends BaseService {

	private static final Logger log = Logger.getLogger(SysMenuSer.class);

	@Autowired
	SysMenuDao sysMenuDao;

	public int getSysMenuCount(Map<String, Object> m) {
		int count = 0;
		try {
			count = sysMenuDao.getSysMenuCount(m);
		} catch (Exception e) {
			log.error(e.getMessage());
		}
		return count;
	}

	public String sysMenuList(HttpServletRequest req){
		StringBuilder sb=new StringBuilder();
		try{
		Map<String, Object> m=getMaps(req); //封装前台参数为map
		Page p=getPage(m);//提取分页参数
		int total=getSysMenuCount(m);
		p.setCount(total);
		int pageNum=p.getCurrentPage();
		int pageSize=p.getPageSize();

		sb.append("{");
		sb.append(""+getKey("total")+":"+total+",");
		sb.append(""+getKey("rows")+":"+"");

		PageHelper.startPage(pageNum, pageSize);//mybatis分页插件
		List<Map<String, Object>> dataList=sysMenuDao.getSysMenuList(m);
		String dataListJson=BaseJson.listToJson(dataList);
		sb.append(dataListJson);
		sb.append("}");
		}catch(Exception e){
			log.error(e.getMessage());
		}

		return sb.toString();
	}

	public String sysMenuList(){
		StringBuilder sb=new StringBuilder();
		try{
		Map<String, Object> m=new HashMap<String, Object>();
		List<Map<String, Object>> dataList=sysMenuDao.getSysMenuList(m);
		String dataListJson=BaseJson.listToJson(dataList);
		sb.append(dataListJson);
		}catch(Exception e){
			log.error(e.getMessage());
		}

		return sb.toString();
	}

	public String menuAddProc(HttpServletRequest req){
		String result="";
		try{
			Map<String, Object> data=getMaps(req);
			int effectLine=sysMenuDao.sysMenuAdd(data);
			if(effectLine<=0){
				result="菜单添加失败。";
			}else{
				result="菜单:"+data.get("smName")+"添加成功.";
			}
		}catch(Exception e){
			log.error(e.getMessage());
			result="菜单添加出现异常,请联系管理员.";
		}
		return result;
	}

	public String menuEditProc(HttpServletRequest req){
		String result="";
		try{
			Map<String, Object> data=getMaps(req);
			int effectLine=sysMenuDao.sysMenuEdit(data);
			if(effectLine<=0){
				result="菜单修改失败。";
			}else{
				result="菜单:"+data.get("smName")+"修改成功.";
			}
		}catch(Exception e){
			log.error(e.getMessage());
			result="菜单修改出现异常,请联系管理员.";
		}
		return result;
	}

	public String menuEditPage(HttpServletRequest req){
		String result="menuListPage";
		try{
			Map<String, Object> parMap=getMaps(req);
			if(parMap.containsKey("smId")){
			Map<String, Object> data=sysMenuDao.getSysMenuBySmId((String) parMap.get("smId"));
			getSession().setAttribute("data", data);
			result="menuEdit";
			}
		}catch(Exception e){
			log.error(e.getMessage());
		}
		return result;
	}

	/**
	 * 获取当前用户菜单列表
	 * @return
	 */
	public String getUserMenu(){
		StringBuilder sb=new StringBuilder();
		try{
			Map<String, Object> curUser=getCurrentUser();
			String suId=(String) curUser.get("SUID");
			List<Map<String, Object>> dataList=sysMenuDao.getSysUserMenuBySuId(suId);
			String dataListJson=BaseJson.listToJson(dataList);
			sb.append(dataListJson);
		}catch(Exception e){
			log.error(e.getMessage());
		}
		return sb.toString();
	}

}


text:
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: networking/v1alpha3/sidecar.proto

// `Sidecar` describes the configuration of the sidecar proxy that mediates
// inbound and outbound communication to the workload instance it is attached to. By
// default, Istio will program all sidecar proxies in the mesh with the
// necessary configuration required to reach every workload instance in the mesh, as
// well as accept traffic on all the ports associated with the
// workload. The `Sidecar` configuration provides a way to fine tune the set of
// ports, protocols that the proxy will accept when forwarding traffic to
// and from the workload. In addition, it is possible to restrict the set
// of services that the proxy can reach when forwarding outbound traffic
// from workload instances.
//
// Services and configuration in a mesh are organized into one or more
// namespaces (e.g., a Kubernetes namespace or a CF org/space). A `Sidecar`
// configuration in a namespace will apply to one or more workload instances in the same
// namespace, selected using the `workloadSelector` field. In the absence of a
// `workloadSelector`, it will apply to all workload instances in the same
// namespace. When determining the `Sidecar` configuration to be applied to a
// workload instance, preference will be given to the resource with a
// `workloadSelector` that selects this workload instance, over a `Sidecar` configuration
// without any `workloadSelector`.
//
// **NOTE 1**: *_Each namespace can have only one `Sidecar`
// configuration without any `workloadSelector`_ that specifies the
// default for all pods in that namespace*. It is recommended to use
// the name `default` for the namespace-wide sidecar. The behavior of
// the system is undefined if more than one selector-less `Sidecar`
// configurations exist in a given namespace. The behavior of the
// system is undefined if two or more `Sidecar` configurations with a
// `workloadSelector` select the same workload instance.
//
// **NOTE 2**: *_A `Sidecar` configuration in the `MeshConfig`
// [root namespace](https://istio.io/docs/reference/config/istio.mesh.v1alpha1/#MeshConfig)
// will be applied by default to all namespaces without a `Sidecar`
// configuration_*. This global default `Sidecar` configuration should not have
// any `workloadSelector`.
//
// The example below declares a global default `Sidecar` configuration
// in the root namespace called `istio-config`, that configures
// sidecars in all namespaces to allow egress traffic only to other
// workloads in the same namespace as well as to services in the
// `istio-system` namespace.
//
// {{<tabset category-name="example">}}
// {{<tab name="v1alpha3" category-value="v1alpha3">}}
// ```yaml
// apiVersion: networking.istio.io/v1alpha3
// kind: Sidecar
// metadata:
//   name: default
//   namespace: istio-config
// spec:
//   egress:
//   - hosts:
//     - "./*"
//     - "istio-system/*"
// ```
// {{</tab>}}
//
// {{<tab name="v1beta1" category-value="v1beta1">}}
// ```yaml
// apiVersion: networking.istio.io/v1beta1
// kind: Sidecar
// metadata:
//   name: default
//   namespace: istio-config
// spec:
//   egress:
//   - hosts:
//     - "./*"
//     - "istio-system/*"
// ```
// {{</tab>}}
// {{</tabset>}}
//
// The example below declares a `Sidecar` configuration in the
// `prod-us1` namespace that overrides the global default defined
// above, and configures the sidecars in the namespace to allow egress
// traffic to public services in the `prod-us1`, `prod-apis`, and the
// `istio-system` namespaces.
//
// {{<tabset category-name="example">}}
// {{<tab name="v1alpha3" category-value="v1alpha3">}}
// ```yaml
// apiVersion: networking.istio.io/v1alpha3
// kind: Sidecar
// metadata:
//   name: default
//   namespace: prod-us1
// spec:
//   egress:
//   - hosts:
//     - "prod-us1/*"
//     - "prod-apis/*"
//     - "istio-system/*"
// ```
// {{</tab>}}
//
// {{<tab name="v1beta1" category-value="v1beta1">}}
// ```yaml
// apiVersion: networking.istio.io/v1beta1
// kind: Sidecar
// metadata:
//   name: default
//   namespace: prod-us1
// spec:
//   egress:
//   - hosts:
//     - "prod-us1/*"
//     - "prod-apis/*"
//     - "istio-system/*"
// ```
// {{</tab>}}
// {{</tabset>}}
//
// The following example declares a `Sidecar` configuration in the
// `prod-us1` namespace for all pods with labels `app: ratings`
// belonging to the `ratings.prod-us1` service.  The workload accepts
// inbound HTTP traffic on port 9080. The traffic is then forwarded to
// the attached workload instance listening on a Unix domain
// socket. In the egress direction, in addition to the `istio-system`
// namespace, the sidecar proxies only HTTP traffic bound for port
// 9080 for services in the `prod-us1` namespace.
//
// {{<tabset category-name="example">}}
// {{<tab name="v1alpha3" category-value="v1alpha3">}}
// ```yaml
// apiVersion: networking.istio.io/v1alpha3
// kind: Sidecar
// metadata:
//   name: ratings
//   namespace: prod-us1
// spec:
//   workloadSelector:
//     labels:
//       app: ratings
//   ingress:
//   - port:
//       number: 9080
//       protocol: HTTP
//       name: somename
//     defaultEndpoint: unix:///var/run/someuds.sock
//   egress:
//   - port:
//       number: 9080
//       protocol: HTTP
//       name: egresshttp
//     hosts:
//     - "prod-us1/*"
//   - hosts:
//     - "istio-system/*"
// ```
// {{</tab>}}
//
// {{<tab name="v1beta1" category-value="v1beta1">}}
// ```yaml
// apiVersion: networking.istio.io/v1beta1
// kind: Sidecar
// metadata:
//   name: ratings
//   namespace: prod-us1
// spec:
//   workloadSelector:
//     labels:
//       app: ratings
//   ingress:
//   - port:
//       number: 9080
//       protocol: HTTP
//       name: somename
//     defaultEndpoint: unix:///var/run/someuds.sock
//   egress:
//   - port:
//       number: 9080
//       protocol: HTTP
//       name: egresshttp
//     hosts:
//     - "prod-us1/*"
//   - hosts:
//     - "istio-system/*"
// ```
// {{</tab>}}
// {{</tabset>}}
//
// If the workload is deployed without IPTables-based traffic capture,
// the `Sidecar` configuration is the only way to configure the ports
// on the proxy attached to the workload instance. The following
// example declares a `Sidecar` configuration in the `prod-us1`
// namespace for all pods with labels `app: productpage` belonging to
// the `productpage.prod-us1` service. Assuming that these pods are
// deployed without IPtable rules (i.e. the `istio-init` container)
// and the proxy metadata `ISTIO_META_INTERCEPTION_MODE` is set to
// `NONE`, the specification, below, allows such pods to receive HTTP
// traffic on port 9080 (wrapped inside Istio mutual TLS) and forward
// it to the application listening on `127.0.0.1:8080`. It also allows
// the application to communicate with a backing MySQL database on
// `127.0.0.1:3306`, that then gets proxied to the externally hosted
// MySQL service at `mysql.foo.com:3306`.
//
// {{<tabset category-name="example">}}
// {{<tab name="v1alpha3" category-value="v1alpha3">}}
// ```yaml
// apiVersion: networking.istio.io/v1alpha3
// kind: Sidecar
// metadata:
//   name: no-ip-tables
//   namespace: prod-us1
// spec:
//   workloadSelector:
//     labels:
//       app: productpage
//   ingress:
//   - port:
//       number: 9080 # binds to proxy_instance_ip:9080 (0.0.0.0:9080, if no unicast IP is available for the instance)
//       protocol: HTTP
//       name: somename
//     defaultEndpoint: 127.0.0.1:8080
//     captureMode: NONE # not needed if metadata is set for entire proxy
//   egress:
//   - port:
//       number: 3306
//       protocol: MYSQL
//       name: egressmysql
//     captureMode: NONE # not needed if metadata is set for entire proxy
//     bind: 127.0.0.1
//     hosts:
//     - "*/mysql.foo.com"
// ```
// {{</tab>}}
//
// {{<tab name="v1beta1" category-value="v1beta1">}}
// ```yaml
// apiVersion: networking.istio.io/v1beta1
// kind: Sidecar
// metadata:
//   name: no-ip-tables
//   namespace: prod-us1
// spec:
//   workloadSelector:
//     labels:
//       app: productpage
//   ingress:
//   - port:
//       number: 9080 # binds to proxy_instance_ip:9080 (0.0.0.0:9080, if no unicast IP is available for the instance)
//       protocol: HTTP
//       name: somename
//     defaultEndpoint: 127.0.0.1:8080
//     captureMode: NONE # not needed if metadata is set for entire proxy
//   egress:
//   - port:
//       number: 3306
//       protocol: MYSQL
//       name: egressmysql
//     captureMode: NONE # not needed if metadata is set for entire proxy
//     bind: 127.0.0.1
//     hosts:
//     - "*/mysql.foo.com"
// ```
// {{</tab>}}
// {{</tabset>}}
//
// And the associated service entry for routing to `mysql.foo.com:3306`
//
// {{<tabset category-name="example">}}
// {{<tab name="v1alpha3" category-value="v1alpha3">}}
// ```yaml
// apiVersion: networking.istio.io/v1alpha3
// kind: ServiceEntry
// metadata:
//   name: external-svc-mysql
//   namespace: ns1
// spec:
//   hosts:
//   - mysql.foo.com
//   ports:
//   - number: 3306
//     name: mysql
//     protocol: MYSQL
//   location: MESH_EXTERNAL
//   resolution: DNS
// ```
// {{</tab>}}
//
// {{<tab name="v1beta1" category-value="v1beta1">}}
// ```yaml
// apiVersion: networking.istio.io/v1beta1
// kind: ServiceEntry
// metadata:
//   name: external-svc-mysql
//   namespace: ns1
// spec:
//   hosts:
//   - mysql.foo.com
//   ports:
//   - number: 3306
//     name: mysql
//     protocol: MYSQL
//   location: MESH_EXTERNAL
//   resolution: DNS
// ```
// {{</tab>}}
// {{</tabset>}}
//
// It is also possible to mix and match traffic capture modes in a single
// proxy. For example, consider a setup where internal services are on the
// `192.168.0.0/16` subnet. So, IP tables are setup on the VM to capture all
// outbound traffic on `192.168.0.0/16` subnet. Assume that the VM has an
// additional network interface on `172.16.0.0/16` subnet for inbound
// traffic. The following `Sidecar` configuration allows the VM to expose a
// listener on `172.16.1.32:80` (the VM's IP) for traffic arriving from the
// `172.16.0.0/16` subnet.
//
// **NOTE**: The `ISTIO_META_INTERCEPTION_MODE` metadata on the
// proxy in the VM should contain `REDIRECT` or `TPROXY` as its value,
// implying that IP tables based traffic capture is active.
//
// {{<tabset category-name="example">}}
// {{<tab name="v1alpha3" category-value="v1alpha3">}}
// ```yaml
// apiVersion: networking.istio.io/v1alpha3
// kind: Sidecar
// metadata:
//   name: partial-ip-tables
//   namespace: prod-us1
// spec:
//   workloadSelector:
//     labels:
//       app: productpage
//   ingress:
//   - bind: 172.16.1.32
//     port:
//       number: 80 # binds to 172.16.1.32:80
//       protocol: HTTP
//       name: somename
//     defaultEndpoint: 127.0.0.1:8080
//     captureMode: NONE
//   egress:
//     # use the system detected defaults
//     # sets up configuration to handle outbound traffic to services
//     # in 192.168.0.0/16 subnet, based on information provided by the
//     # service registry
//   - captureMode: IPTABLES
//     hosts:
//     - "*/*"
// ```
// {{</tab>}}
//
// {{<tab name="v1beta1" category-value="v1beta1">}}
// ```yaml
// apiVersion: networking.istio.io/v1beta1
// kind: Sidecar
// metadata:
//   name: partial-ip-tables
//   namespace: prod-us1
// spec:
//   workloadSelector:
//     labels:
//       app: productpage
//   ingress:
//   - bind: 172.16.1.32
//     port:
//       number: 80 # binds to 172.16.1.32:80
//       protocol: HTTP
//       name: somename
//     defaultEndpoint: 127.0.0.1:8080
//     captureMode: NONE
//   egress:
//     # use the system detected defaults
//     # sets up configuration to handle outbound traffic to services
//     # in 192.168.0.0/16 subnet, based on information provided by the
//     # service registry
//   - captureMode: IPTABLES
//     hosts:
//     - "*/*"
// ```
// {{</tab>}}
// {{</tabset>}}
//

package v1alpha3

import (
	fmt "fmt"
	proto "github.com/gogo/protobuf/proto"
	_ "istio.io/gogo-genproto/googleapis/google/api"
	math "math"
)

// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf

// DeepCopyInto supports using Sidecar within kubernetes types, where deepcopy-gen is used.
func (in *Sidecar) DeepCopyInto(out *Sidecar) {
	p := proto.Clone(in).(*Sidecar)
	*out = *p
}


text:
<?php

namespace Karudev\AppsBundle\Form\Type;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Doctrine\ORM\EntityRepository;
class InsertTypeType extends AbstractType
{

    public function buildForm(FormBuilderInterface $builder, array $options)
    {

         $builder->add('insertTypeId', 'entity', array(
            'class' => 'KarudevAppsBundle:InsertType',
            'required' => true,
            'query_builder' => function(EntityRepository $er) {
                return $er->createQueryBuilder('i')
                        ->orderBy('i.inserttype_id', 'ASC');
            },
        ));

    }
    public function getName()
    {
        return 'inserttype';
    }
}
?>


text:
package org.watertemplate.example.mappedobject;

import org.apache.commons.lang3.text.WordUtils;
import org.watertemplate.Template;

class NewUserMail extends Template {
    public NewUserMail(final User user) {
        addMappedObject("user", user, (userMap) -> {
            userMap.add("email", user.email);
            userMap.add("username", user.username);
            userMap.addLocaleSensitiveObject("date_of_birth", user.dateOfBirth, (date, locale) -> date.toString());

            userMap.addMappedObject("name", user.name, (name, nameMap) -> {
                nameMap.add("capitalized", WordUtils.capitalizeFully(name));
            });
        });
    }

    @Override
    protected String getFilePath() {
        return "mappedobject/new_user.mail";
    }
}


text:
Mustache::render() member function - Accepts MustacheData
--SKIPIF--
<?php

if(!extension_loaded('mustache')) die('skip ');
 ?>
--FILE--
<?php
$m = new Mustache();
$data = new MustacheData(array(
  'var' => 'val',
));
$r = $m->render('{{var}}', $data);
var_dump($r);
?>
--EXPECT--
string(3) "val"


text:
namespace BizHawk.Client.EmuHawk
{
    partial class AmstradCPCNonSyncSettings
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
			System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(AmstradCPCNonSyncSettings));
			this.OkBtn = new System.Windows.Forms.Button();
			this.CancelBtn = new System.Windows.Forms.Button();
			this.label1 = new System.Windows.Forms.Label();
			this.lblOSDVerbinfo = new System.Windows.Forms.Label();
			this.label4 = new System.Windows.Forms.Label();
			this.osdMessageVerbositycomboBox1 = new System.Windows.Forms.ComboBox();
			this.SuspendLayout();
			//
			// OkBtn
			//
			this.OkBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
			this.OkBtn.Location = new System.Drawing.Point(247, 121);
			this.OkBtn.Name = "OkBtn";
			this.OkBtn.Size = new System.Drawing.Size(60, 23);
			this.OkBtn.TabIndex = 3;
			this.OkBtn.Text = "&OK";
			this.OkBtn.UseVisualStyleBackColor = true;
			this.OkBtn.Click += new System.EventHandler(this.OkBtn_Click);
			//
			// CancelBtn
			//
			this.CancelBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
			this.CancelBtn.DialogResult = System.Windows.Forms.DialogResult.Cancel;
			this.CancelBtn.Location = new System.Drawing.Point(313, 121);
			this.CancelBtn.Name = "CancelBtn";
			this.CancelBtn.Size = new System.Drawing.Size(60, 23);
			this.CancelBtn.TabIndex = 4;
			this.CancelBtn.Text = "&Cancel";
			this.CancelBtn.UseVisualStyleBackColor = true;
			this.CancelBtn.Click += new System.EventHandler(this.CancelBtn_Click);
			//
			// label1
			//
			this.label1.AutoSize = true;
			this.label1.Location = new System.Drawing.Point(12, 14);
			this.label1.Name = "label1";
			this.label1.Size = new System.Drawing.Size(185, 13);
			this.label1.TabIndex = 17;
			this.label1.Text = "ZX Spectrum Misc Non-Sync Settings";
			//
			// lblOSDVerbinfo
			//
			this.lblOSDVerbinfo.Font = new System.Drawing.Font("Courier New", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
			this.lblOSDVerbinfo.Location = new System.Drawing.Point(175, 60);
			this.lblOSDVerbinfo.Name = "lblOSDVerbinfo";
			this.lblOSDVerbinfo.Size = new System.Drawing.Size(196, 53);
			this.lblOSDVerbinfo.TabIndex = 28;
			this.lblOSDVerbinfo.Text = "null";
			this.lblOSDVerbinfo.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
			//
			// label4
			//
			this.label4.AutoSize = true;
			this.label4.Location = new System.Drawing.Point(12, 60);
			this.label4.Name = "label4";
			this.label4.Size = new System.Drawing.Size(125, 13);
			this.label4.TabIndex = 27;
			this.label4.Text = "OSD Message Verbosity:";
			//
			// osdMessageVerbositycomboBox1
			//
			this.osdMessageVerbositycomboBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
            | System.Windows.Forms.AnchorStyles.Right)));
			this.osdMessageVerbositycomboBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
			this.osdMessageVerbositycomboBox1.FormattingEnabled = true;
			this.osdMessageVerbositycomboBox1.Location = new System.Drawing.Point(12, 76);
			this.osdMessageVerbositycomboBox1.Name = "osdMessageVerbositycomboBox1";
			this.osdMessageVerbositycomboBox1.Size = new System.Drawing.Size(157, 21);
			this.osdMessageVerbositycomboBox1.TabIndex = 26;
			this.osdMessageVerbositycomboBox1.SelectionChangeCommitted += new System.EventHandler(this.OSDComboBox_SelectionChangeCommitted);
			//
			// AmstradCPCNonSyncSettings
			//
			this.AcceptButton = this.OkBtn;
			this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
			this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
			this.CancelButton = this.CancelBtn;
			this.ClientSize = new System.Drawing.Size(385, 156);
			this.Controls.Add(this.lblOSDVerbinfo);
			this.Controls.Add(this.label4);
			this.Controls.Add(this.osdMessageVerbositycomboBox1);
			this.Controls.Add(this.label1);
			this.Controls.Add(this.CancelBtn);
			this.Controls.Add(this.OkBtn);
			this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
			this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
			this.Name = "AmstradCPCNonSyncSettings";
			this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
			this.Text = "Other Non-Sync Settings";
			this.Load += new System.EventHandler(this.IntvControllerSettings_Load);
			this.ResumeLayout(false);
			this.PerformLayout();

        }

        #endregion

        private System.Windows.Forms.Button OkBtn;
        private System.Windows.Forms.Button CancelBtn;
        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.Label lblOSDVerbinfo;
        private System.Windows.Forms.Label label4;
        private System.Windows.Forms.ComboBox osdMessageVerbositycomboBox1;
    }
}


text:
package org.apache.reef.io.network.impl;

import org.apache.reef.io.network.NetworkConnectionService;
import org.apache.reef.io.network.impl.config.NetworkConnectionServiceIdFactory;
import org.apache.reef.tang.annotations.Parameter;
import org.apache.reef.task.events.TaskStop;
import org.apache.reef.wake.EventHandler;
import org.apache.reef.wake.IdentifierFactory;

import javax.inject.Inject;
/**
 * TaskStop event handler for unregistering NetworkConnectionService.
 * Users have to bind this handler into ServiceConfiguration.ON_TASK_STOP.
 */
public final class UnbindNetworkConnectionServiceFromTask implements EventHandler<TaskStop> {

  private final NetworkConnectionService ncs;
  private final IdentifierFactory idFac;

  @Inject
  public UnbindNetworkConnectionServiceFromTask(
      final NetworkConnectionService ncs,
      @Parameter(NetworkConnectionServiceIdFactory.class) final IdentifierFactory idFac) {
    this.ncs = ncs;
    this.idFac = idFac;
  }

  @Override
  public void onNext(final TaskStop task) {
    this.ncs.unregisterId(this.idFac.getNewInstance(task.getId()));
  }
}


text:
<?php

namespace Google\Service\DriveLabels;

class GoogleAppsDriveLabelsV2FieldSelectionOptionsChoice extends \Google\Model
{
  protected $appliedCapabilitiesType = GoogleAppsDriveLabelsV2FieldSelectionOptionsChoiceAppliedCapabilities::class;
  protected $appliedCapabilitiesDataType = '';
  /**
   * @var string
   */
  public $createTime;
  protected $creatorType = GoogleAppsDriveLabelsV2UserInfo::class;
  protected $creatorDataType = '';
  /**
   * @var string
   */
  public $disableTime;
  protected $disablerType = GoogleAppsDriveLabelsV2UserInfo::class;
  protected $disablerDataType = '';
  protected $displayHintsType = GoogleAppsDriveLabelsV2FieldSelectionOptionsChoiceDisplayHints::class;
  protected $displayHintsDataType = '';
  /**
   * @var string
   */
  public $id;
  protected $lifecycleType = GoogleAppsDriveLabelsV2Lifecycle::class;
  protected $lifecycleDataType = '';
  protected $lockStatusType = GoogleAppsDriveLabelsV2LockStatus::class;
  protected $lockStatusDataType = '';
  protected $propertiesType = GoogleAppsDriveLabelsV2FieldSelectionOptionsChoiceProperties::class;
  protected $propertiesDataType = '';
  /**
   * @var string
   */
  public $publishTime;
  protected $publisherType = GoogleAppsDriveLabelsV2UserInfo::class;
  protected $publisherDataType = '';
  protected $schemaCapabilitiesType = GoogleAppsDriveLabelsV2FieldSelectionOptionsChoiceSchemaCapabilities::class;
  protected $schemaCapabilitiesDataType = '';
  /**
   * @var string
   */
  public $updateTime;
  protected $updaterType = GoogleAppsDriveLabelsV2UserInfo::class;
  protected $updaterDataType = '';

  /**
   * @param GoogleAppsDriveLabelsV2FieldSelectionOptionsChoiceAppliedCapabilities
   */
  public function setAppliedCapabilities(GoogleAppsDriveLabelsV2FieldSelectionOptionsChoiceAppliedCapabilities $appliedCapabilities)
  {
    $this->appliedCapabilities = $appliedCapabilities;
  }
  /**
   * @return GoogleAppsDriveLabelsV2FieldSelectionOptionsChoiceAppliedCapabilities
   */
  public function getAppliedCapabilities()
  {
    return $this->appliedCapabilities;
  }
  /**
   * @param string
   */
  public function setCreateTime($createTime)
  {
    $this->createTime = $createTime;
  }
  /**
   * @return string
   */
  public function getCreateTime()
  {
    return $this->createTime;
  }
  /**
   * @param GoogleAppsDriveLabelsV2UserInfo
   */
  public function setCreator(GoogleAppsDriveLabelsV2UserInfo $creator)
  {
    $this->creator = $creator;
  }
  /**
   * @return GoogleAppsDriveLabelsV2UserInfo
   */
  public function getCreator()
  {
    return $this->creator;
  }
  /**
   * @param string
   */
  public function setDisableTime($disableTime)
  {
    $this->disableTime = $disableTime;
  }
  /**
   * @return string
   */
  public function getDisableTime()
  {
    return $this->disableTime;
  }
  /**
   * @param GoogleAppsDriveLabelsV2UserInfo
   */
  public function setDisabler(GoogleAppsDriveLabelsV2UserInfo $disabler)
  {
    $this->disabler = $disabler;
  }
  /**
   * @return GoogleAppsDriveLabelsV2UserInfo
   */
  public function getDisabler()
  {
    return $this->disabler;
  }
  /**
   * @param GoogleAppsDriveLabelsV2FieldSelectionOptionsChoiceDisplayHints
   */
  public function setDisplayHints(GoogleAppsDriveLabelsV2FieldSelectionOptionsChoiceDisplayHints $displayHints)
  {
    $this->displayHints = $displayHints;
  }
  /**
   * @return GoogleAppsDriveLabelsV2FieldSelectionOptionsChoiceDisplayHints
   */
  public function getDisplayHints()
  {
    return $this->displayHints;
  }
  /**
   * @param string
   */
  public function setId($id)
  {
    $this->id = $id;
  }
  /**
   * @return string
   */
  public function getId()
  {
    return $this->id;
  }
  /**
   * @param GoogleAppsDriveLabelsV2Lifecycle
   */
  public function setLifecycle(GoogleAppsDriveLabelsV2Lifecycle $lifecycle)
  {
    $this->lifecycle = $lifecycle;
  }
  /**
   * @return GoogleAppsDriveLabelsV2Lifecycle
   */
  public function getLifecycle()
  {
    return $this->lifecycle;
  }
  /**
   * @param GoogleAppsDriveLabelsV2LockStatus
   */
  public function setLockStatus(GoogleAppsDriveLabelsV2LockStatus $lockStatus)
  {
    $this->lockStatus = $lockStatus;
  }
  /**
   * @return GoogleAppsDriveLabelsV2LockStatus
   */
  public function getLockStatus()
  {
    return $this->lockStatus;
  }
  /**
   * @param GoogleAppsDriveLabelsV2FieldSelectionOptionsChoiceProperties
   */
  public function setProperties(GoogleAppsDriveLabelsV2FieldSelectionOptionsChoiceProperties $properties)
  {
    $this->properties = $properties;
  }
  /**
   * @return GoogleAppsDriveLabelsV2FieldSelectionOptionsChoiceProperties
   */
  public function getProperties()
  {
    return $this->properties;
  }
  /**
   * @param string
   */
  public function setPublishTime($publishTime)
  {
    $this->publishTime = $publishTime;
  }
  /**
   * @return string
   */
  public function getPublishTime()
  {
    return $this->publishTime;
  }
  /**
   * @param GoogleAppsDriveLabelsV2UserInfo
   */
  public function setPublisher(GoogleAppsDriveLabelsV2UserInfo $publisher)
  {
    $this->publisher = $publisher;
  }
  /**
   * @return GoogleAppsDriveLabelsV2UserInfo
   */
  public function getPublisher()
  {
    return $this->publisher;
  }
  /**
   * @param GoogleAppsDriveLabelsV2FieldSelectionOptionsChoiceSchemaCapabilities
   */
  public function setSchemaCapabilities(GoogleAppsDriveLabelsV2FieldSelectionOptionsChoiceSchemaCapabilities $schemaCapabilities)
  {
    $this->schemaCapabilities = $schemaCapabilities;
  }
  /**
   * @return GoogleAppsDriveLabelsV2FieldSelectionOptionsChoiceSchemaCapabilities
   */
  public function getSchemaCapabilities()
  {
    return $this->schemaCapabilities;
  }
  /**
   * @param string
   */
  public function setUpdateTime($updateTime)
  {
    $this->updateTime = $updateTime;
  }
  /**
   * @return string
   */
  public function getUpdateTime()
  {
    return $this->updateTime;
  }
  /**
   * @param GoogleAppsDriveLabelsV2UserInfo
   */
  public function setUpdater(GoogleAppsDriveLabelsV2UserInfo $updater)
  {
    $this->updater = $updater;
  }
  /**
   * @return GoogleAppsDriveLabelsV2UserInfo
   */
  public function getUpdater()
  {
    return $this->updater;
  }
}

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(GoogleAppsDriveLabelsV2FieldSelectionOptionsChoice::class, 'Google_Service_DriveLabels_GoogleAppsDriveLabelsV2FieldSelectionOptionsChoice');


text:
<?php
/**
 * User: Julian Scheuchenzuber <js@lvl51.de>
 * Date: 22.10.15
 * Time: 12:12
 */
if(isset($GLOBALS['_DEFAULT_ADMINS'])) {
    // Reset pointer and fetch data of first record
    reset($GLOBALS['_DEFAULT_ADMINS']);
    $email = key($GLOBALS['_DEFAULT_ADMINS']);
    $pw = $GLOBALS['_DEFAULT_ADMINS'][$email];

    // Set default admin if not exists
    if(!Security::has_default_admin())
        Security::setDefaultAdmin($email, $pw);
}


text:
// Copyright (c) 2012 Ecma International.  All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/*---
es5id: 15.3.4.5.2-4-12
description: >
    [[Construct]] - length of parameters of 'target' is 1, length of
    'boundArgs' is 1, length of 'ExtraArgs' is 0
---*/

        var func = function (x) {
            return new Boolean(arguments.length === 1 && x === 1 && arguments[0] === 1);
        };

        var NewFunc = Function.prototype.bind.call(func, {}, 1);

        var newInstance = new NewFunc();

assert.sameValue(newInstance.valueOf(), true, 'newInstance.valueOf()');


text:
package main.hashmap;

/*

https://leetcode.com/problems/group-anagrams/description/

*/

import java.util.*;

public class GroupAnagrams {

    public List<List<String>> groupAnagrams(String[] strs) {
        List<List<String>> list = new ArrayList<>();
        if (strs == null) return list;
        Map<String, List<String>> map = new HashMap<>();
        for (String s : strs) {
            char[] chars = s.toCharArray();
            Arrays.sort(chars);
            String sorted = new String(chars);
            if (map.containsKey(sorted)) {
                map.get(sorted).add(s);
            } else {
                List<String> _list = new ArrayList<>();
                _list.add(s);
                map.put(sorted, _list);
            }

        }
        list.addAll(map.values());
        return list;
    }

}


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Pestaña Fuzzer</title>

Pestaña Fuzzer

	La pestaña Fuzzer muestra las solicitudes y respuestas realizadas cuando se le hace
	fuzzing a una cadena.

 Seleccione una fila para ver las solicitudes y respuestas realizadas. También puede buscar por cadenas en los resultados del fuzzing utilizando la pestaña de búsqueda.

Resultados del Fuzzer en HTTP

	Los resultados deben ser evaluados manualmente para saber si se encontró alguna vulnerabilidad.

Menú de clic derecho

	Hacer clic derecho en una fila mostrará un menú con las mismas opciones que la pestaña de historial.

Véase también

    	Conceptos de Fuzzer


text:
import math
import sys
import os
from anneal import Annealer
import shapefile

#from numpy import random
import random

#try:
#    from numpy import random
#except:
#    import random

#-----------------------------------------------#
#-------------- Configuration ------------------#
#-----------------------------------------------#
shp = './data/huc6_4326.shp'

species = ['StlHd_m', 'Coho_m', 'Chnk_m']

targets = {
            'StlHd_m': 511000,
            'Coho_m': 521000,
            'Chnk_m': 551000
          }

penalties = {
              'StlHd_m': 300,
              'Coho_m': 200,
              'Chnk_m': 100
            }
costs = ['pcp80bdfmm', ]
uidfield = 'OBJECTID'
NUMREPS = 2
NUMITER = 30000

# Uncomment to manually define temperature schedule
#SCHEDULE = {'tmin': 10, 'tmax': 6500, 'steps': 1}

#-----------------------------------------------#

watersheds = {}

def field_by_num(fieldname, fields):
    fnames = [x[0] for x in fields]
    return fnames.index(fieldname) - 1

print "Loading data from shapefile..."
sf = shapefile.Reader(shp)
fields = sf.fields
for rec in sf.records():
    skip = False
    vals = {}
    for s in species:
        vals[s] = rec[field_by_num(s, fields)]
    # precalc costs
    total_cost = 0
    for c in costs:
        fnum = field_by_num(c, fields)
        total_cost += rec[fnum]

    vals['total_cost'] = total_cost

    if total_cost < 0.00001:
        skip = True

    if not skip:
        watersheds[int(rec[field_by_num(uidfield, fields)])] = vals

"""
    At this point, the `watersheds`variable should be
    a dictionary of watersheds
    where each watershed value is a dictionary of species and costs, eg

    {
    171003030703: {'Chnk_m': 11223.5, 'StlHd_m': 12263.7, 'Coho_m': 11359.1, 'total_cost': 1234},
    .....
    }
"""
hucs = watersheds.keys()
num_hucs = len(hucs)

def run(schedule=None):
    state = []

    def reserve_move(state):
        """
        Select random watershed
        then
        Add watershed (if not already in state) OR remove it.
        * This is the Marxan technique as well
        """
        huc = hucs[int(random.random() * num_hucs)]
        #huc = hucs[random.randint(0,num_hucs-1)]

        if huc in state:
            state.remove(huc)
        else:
            state.append(huc)

    def reserve_energy(state):
        """
        The "Objective Function"...
        Calculates the 'energy' of the reserve.
        Should incorporate costs of reserve and penalties
        for not meeting species targets.

        Note: This example is extremely simplistic compared to
        the Marxan objective function (see Appendix B in Marxan manual)
        but at least we have access to it!
        """
        # Initialize variables
        energy = 0
        totals = {}
        for fish in species:
            totals[fish] = 0

        # Get total cost and habitat in current state
        for huc in state:
            watershed = watersheds[huc]
            # Sum up total habitat for each fish
            for fish in species:
                if energy == 0:
                    # reset for new calcs ie first watershed
                    totals[fish] = watershed[fish]
                else:
                    # add for additional watersheds
                    totals[fish] += watershed[fish]

            # Incorporate Cost of including watershed
            energy += watershed['total_cost']

        # incorporate penalties for missing species targets
        for fish in species:
            pct = totals[fish] / targets[fish]
            if pct < 1.0: # if missed target, ie total < target
                if pct < 0.1:
                    # Avoid zerodivision errors
                    # Limits the final to 10x specified penalty
                    pct = 0.1
                penalty = int(penalties[fish] / pct)
                energy += penalty

        return energy

    annealer = Annealer(reserve_energy, reserve_move)
    if schedule is None:
       print '----\nAutomatically determining optimal temperature schedule'
       schedule = annealer.auto(state, minutes=6)

    try:
        schedule['steps'] = NUMITER
    except:
        pass # just keep the auto one

    print '---\nAnnealing from %.2f to %.2f over %i steps:' % (schedule['tmax'],
            schedule['tmin'], schedule['steps'])

    state, e = annealer.anneal(state, schedule['tmax'], schedule['tmin'],
                               schedule['steps'], updates=6)

    print "Reserve cost = %r" % reserve_energy(state)
    state.sort()
    for watershed in state:
        print "\t", watershed, watersheds[watershed]
    return state, reserve_energy(state), schedule

if __name__ == "__main__":
    freq = {}
    states = []
    try:
        schedule = SCHEDULE
    except:
        schedule = None
    for i in range(NUMREPS):
        state, energy, schedule = run(schedule)
        states.append((state, energy))
        for w in state:
            if freq.has_key(w):
                freq[w] += 1
            else:
                freq[w] = 1

    print
    print "States"
    for s in states:
        print s
    print
    print "Frequency of hit (max of %s reps)..." % NUMREPS
    ks = freq.keys()
    ks.sort()
    for k in ks:
        v = freq[k]
        print k, "#"*int(v), v


text:
<?php

pake_desc('initialize a new symfony project');
pake_task('init-project');
pake_alias('new', 'init-project');

pake_desc('initialize a new symfony application');
pake_task('init-app', 'project_exists');
pake_alias('app', 'init-app');

pake_desc('initialize a new symfony module');
pake_task('init-module', 'app_exists');
pake_alias('module', 'init-module');

pake_desc('initialize a new symfony batch script');
pake_task('init-batch', 'project_exists');
pake_alias('batch', 'init-batch');

pake_desc('initialize a new symfony controller script');
pake_task('init-controller', 'app_exists');
pake_alias('controller', 'init-controller');

function run_init_project($task, $args)
{
  if (file_exists('symfony'))
  {
    throw new Exception('A symfony project already exists in this directory.');
  }

  if (!count($args))
  {
    throw new Exception('You must provide a project name.');
  }

  $project_name = $args[0];

  $sf_root_dir = sfConfig::get('sf_root_dir');

  // create basic project structure
  $finder = pakeFinder::type('any')->ignore_version_control()->discard('.sf');
  pake_mirror($finder, sfConfig::get('sf_symfony_data_dir').'/skeleton/project', $sf_root_dir);

  $finder = pakeFinder::type('file')->name('properties.ini', 'apache.conf', 'propel.ini');
  pake_replace_tokens($finder, $sf_root_dir, '##', '##', array('PROJECT_NAME' => $project_name));

  $finder = pakeFinder::type('file')->name('propel.ini');
  pake_replace_tokens($finder, $sf_root_dir, '##', '##', array('PROJECT_DIR' => $sf_root_dir));

  // update config/config.php
  pake_replace_tokens('config.php', sfConfig::get('sf_config_dir'), '##', '##', array(
    'SYMFONY_LIB_DIR'  => sfConfig::get('sf_symfony_lib_dir'),
    'SYMFONY_DATA_DIR' => sfConfig::get('sf_symfony_data_dir'),
  ));

  run_fix_perms($task, $args);
}

function run_init_app($task, $args)
{
  if (!count($args))
  {
    throw new Exception('You must provide your application name.');
  }

  $app = $args[0];

  $sf_root_dir = sfConfig::get('sf_root_dir');
  $app_dir = $sf_root_dir.'/'.sfConfig::get('sf_apps_dir_name').'/'.$app;

  if (is_dir($app_dir))
  {
    throw new Exception(sprintf('The directory "%s" already exists.', $app_dir));
  }

  // create basic application structure
  $finder = pakeFinder::type('any')->ignore_version_control()->discard('.sf');
  pake_mirror($finder, sfConfig::get('sf_symfony_data_dir').'/skeleton/app/app', $app_dir);

  // create $app.php or index.php if it is our first app
  $index_name = 'index';
  $first_app = file_exists(sfConfig::get('sf_web_dir').'/index.php') ? false : true;
  if (!$first_app)
  {
    $index_name = $app;
  }

  // set no_script_name value in settings.yml for production environment
  $finder = pakeFinder::type('file')->name('settings.yml');
  pake_replace_tokens($finder, $app_dir.'/'.sfConfig::get('sf_app_config_dir_name'), '##', '##', array('NO_SCRIPT_NAME' => ($first_app ? 'on' : 'off')));

  pake_copy(sfConfig::get('sf_symfony_data_dir').'/skeleton/app/web/index.php', sfConfig::get('sf_web_dir').'/'.$index_name.'.php');
  pake_copy(sfConfig::get('sf_symfony_data_dir').'/skeleton/app/web/index_dev.php', sfConfig::get('sf_web_dir').'/'.$app.'_dev.php');

  $finder = pakeFinder::type('file')->name($index_name.'.php', $app.'_dev.php');
  pake_replace_tokens($finder, sfConfig::get('sf_web_dir'), '##', '##', array('APP_NAME' => $app));

  run_fix_perms($task, $args);

  // create test dir
  pake_mkdirs($sf_root_dir.'/test/functional/'.$app);
}

function run_init_module($task, $args)
{
  if (count($args) < 2)
  {
    throw new Exception('You must provide your module name.');
  }

  $app    = $args[0];
  $module = $args[1];
  $sf_root_dir = sfConfig::get('sf_root_dir');
  $module_dir  = $sf_root_dir.'/'.sfConfig::get('sf_apps_dir_name').'/'.$app.'/'.sfConfig::get('sf_app_module_dir_name').'/'.$module;

  if (is_dir($module_dir))
  {
    throw new Exception(sprintf('The directory "%s" already exists.', $module_dir));
  }

  try
  {
    $author_name = $task->get_property('author', 'symfony');
  }
  catch (pakeException $e)
  {
    $author_name = 'Your name here';
  }

  $constants = array(
    'PROJECT_NAME' => $task->get_property('name', 'symfony'),
    'APP_NAME'     => $app,
    'MODULE_NAME'  => $module,
    'AUTHOR_NAME'  => $author_name,
  );

  if (is_readable(sfConfig::get('sf_data_dir').'/skeleton/module'))
  {
    $sf_skeleton_dir = sfConfig::get('sf_data_dir').'/skeleton/module';
  }
  else
  {
    $sf_skeleton_dir = sfConfig::get('sf_symfony_data_dir').'/skeleton/module';
  }

  // create basic application structure
  $finder = pakeFinder::type('any')->ignore_version_control()->discard('.sf');
  pake_mirror($finder, $sf_skeleton_dir.'/module', $module_dir);

  // create basic test
  pake_copy($sf_skeleton_dir.'/test/actionsTest.php', $sf_root_dir.'/test/functional/'.$app.'/'.$module.'ActionsTest.php');

  // customize test file
  pake_replace_tokens($module.'ActionsTest.php', $sf_root_dir.'/test/functional/'.$app, '##', '##', $constants);

  // customize php and yml files
  $finder = pakeFinder::type('file')->name('*.php', '*.yml');
  pake_replace_tokens($finder, $module_dir, '##', '##', $constants);
}

function run_init_batch($task, $args)
{
  // handling two required arguments (application and batch name)
  if (count($args) < 1)
  {
    throw new Exception('You must provide the batch skeleton name');
  }

  // TODO: add finder here to locate batch skeleton locally or in symfony dirs, and send path to skeletons function
  $batch = '_batch_'.$args[0];

  if (!function_exists($batch))
  {
    throw new Exception(sprintf('The specified batch "%s" does not exist.', $args[0]));
  }

  $batch($task, $args);

  if (!file_exists(sfConfig::get('sf_symfony_data_dir').'/skeleton/batch/'.$args[0].'.php'))
  {
    throw new Exception('The skeleton you specified could not be found.');
  }
}

function _batch_default($task, $args)
{
  if (count($args) < 2)
  {
    throw new Exception('You must provide the destination script name');
  }
  if (count($args) < 3)
  {
    throw new Exception('You must provide the application name');
  }

  $batch = $args[1];
  $app   = $args[2];

  // handling two optional arguments (environment and debug)
  $env   = isset($args[3]) ? $args[3] : 'dev';
  $debug = isset($args[4]) ? $args[4] : true;

  $constants = array(
    'PROJECT_NAME' => $task->get_property('name', 'symfony'),
    'APP_NAME'     => $app,
    'BATCH_NAME'   => $batch,
    'ENV_NAME'     => $env,
    'DEBUG'        => (boolean) $debug,
  );

  $sf_bin_dir = sfConfig::get('sf_bin_dir');

  pake_copy(sfConfig::get('sf_symfony_data_dir').'/skeleton/batch/default.php', $sf_bin_dir.'/'.$batch.'.php');
  pake_replace_tokens($batch.'.php', $sf_bin_dir, '##', '##', $constants);
}

function _batch_rotate_log($task, $args)
{
  if (count($args) < 2)
  {
    throw new Exception('You must provide the application');
  }
  if (count($args) < 3)
  {
    throw new Exception('You must provide the environment');
  }

  $app = $args[1];
  $env = $args[2];
  $batch = 'rotate_log_'.$app.'_'.$env;

  // handling two optional arguments (environment and debug)
  $env   = isset($args[3]) ? $args[3] : 'dev';
  $debug = isset($args[4]) ? $args[4] : true;

  $constants = array(
    'PROJECT_NAME' => $task->get_property('name', 'symfony'),
    'APP_NAME'     => $app,
    'BATCH_NAME'   => $batch,
    'ENV_NAME'     => $env,
    'DEBUG'        => (boolean) $debug,
  );

  $sf_bin_dir = sfConfig::get('sf_bin_dir');

  pake_copy(sfConfig::get('sf_symfony_data_dir').'/skeleton/batch/rotate_log.php', $sf_bin_dir.'/'.$batch.'.php');
  pake_replace_tokens($batch.'.php', $sf_bin_dir, '##', '##', $constants);
}

function run_init_controller($task, $args)
{
  // handling two required arguments (application and batch name)
  if (count($args) < 2)
  {
    throw new Exception('You must provide the environment name');
  }

  $app = $args[0];
  $env = $args[1];

  // handling two optional arguments (environment and debug)
  $controller   = isset($args[2]) ? $args[2] : $app.'_'.$env;
  $debug        = isset($args[3]) ? $args[3] : true;

  $constants = array(
    'PROJECT_NAME'    => $task->get_property('name', 'symfony'),
    'APP_NAME'        => $app,
    'CONTROLLER_NAME' => $controller,
    'ENV_NAME'        => $env,
    'DEBUG'           => (boolean) $debug,
  );

  $sf_web_dir = sfConfig::get('sf_web_dir');

  pake_copy(sfConfig::get('sf_symfony_data_dir').'/skeleton/controller/controller.php', $sf_web_dir.'/'.$controller.'.php');
  pake_replace_tokens($controller.'.php', $sf_web_dir, '##', '##', $constants);
}


text:
#include "utils.hh"

/*CONSTRUCTOR*/
Bombs::Bombs(sf::Texture &texture) : sf::Sprite(texture) {
    sf::Sprite::setPosition(WEIGHT_S - SIZE, HEIGHT_S - SIZE*1.75);
    sf::Sprite::setScale(SIZE/float(texture.getSize().x), SIZE/float(texture.getSize().y));
    sf::Sprite::setOrigin(texture.getSize().x/2, texture.getSize().y/2);
    acc = 0;
}

bool Bombs::move(float deltaTime, const sf::IntRect &pos_house) {
    acc += deltaTime;
    if (acc >= time_to_next) {
        sf::Sprite::setRotation(sf::Sprite::getRotation() + ANGLE);
        sf::Sprite::setPosition(sf::Sprite::getPosition().x - VEL*deltaTime, sf::Sprite::getPosition().y);
        acc -= time_to_next;
    }
    return pos_house.top >= HEIGHT_S - pos_house.width*1.5 and pos_house.left + pos_house.width - pos_house.width/2 >= sf::Sprite::getPosition().x and sf::Sprite::getPosition().x >= pos_house.width/3;
}


text:
package scriptengine;

import javax.script.ScriptEngine;
import javax.script.ScriptEngineManager;
import javax.script.ScriptException;

/**
 * @Author: yoyo
 * @Description: Run Javascript from Java <link>https://javapapers.com/core-java/run-javascript-from-java/</>
 * Java 8 Features <link>https://javapapers.com/java/java-8-features/</link>
 * @Date: Created in 2019/9/4 10:38
 */
public class JavaJavaScript {
    public static void main(String[] args) throws ScriptException {
        ScriptEngineManager manager = new ScriptEngineManager();
        ScriptEngine engine = manager.getEngineByName("javascript");
        engine.eval("var x = 10;");
        engine.eval("var y = 20;");
        engine.eval("var z = x + y;");
        engine.eval("print (z);");
    }
}


text:
using Newtonsoft.Json;

namespace NTwitch
{
    public class ModifyVideoParams
    {
        [JsonProperty("title", DefaultValueHandling = DefaultValueHandling.Ignore)]
        public string Title { get; set; }
        [JsonProperty("description", DefaultValueHandling = DefaultValueHandling.Ignore)]
        public string Description { get; set; }
        [JsonProperty("game", DefaultValueHandling = DefaultValueHandling.Ignore)]
        public string Game { get; set; }
        [JsonProperty("language", DefaultValueHandling = DefaultValueHandling.Ignore)]
        public string Language { get; set; }
        [JsonProperty("tag_list", DefaultValueHandling = DefaultValueHandling.Ignore)]
        public string Tags { get; set; }
    }
}


text:
require 'spec_helper'

class FlavorSpecTester
  include KalturaFu::Entry
end

class EntryUploader
  include KalturaFu::Entry
end

describe "Actions specific to an entries flavors" do
  before(:all) do
    KalturaFuTestConfiguration.setup
  end

  before(:each) do
    @entry_id = EntryUploader.upload(KalturaFuTestConfiguration.video,:source=>:file)
  end

  after(:each) do
    EntryUploader.new.delete_entry(@entry_id)
  end

  it "should return a status of not-ready when a video uploads" do
    flavor = FlavorSpecTester.new
    flavor.check_status(@entry_id).should_not == Kaltura::Constants::FlavorAssetStatus::READY
  end

  it "should respond to original_flavor" do
    flavor = FlavorSpecTester.new

    flavor.should respond_to :original_flavor
  end

  it "should be able to get the original flavor ID without an error" do
    flavor = FlavorSpecTester.new

    lambda{flavor.original_flavor(@entry_id)}.should_not raise_error
  end

  it "should respond to original_file_extension" do
    flavor = FlavorSpecTester.new

    flavor.should respond_to :original_file_extension
  end

  it "should be able to get the original file extension without error" do
    flavor = FlavorSpecTester.new

    lambda{flavor.original_file_extension(@entry_id)}.should_not raise_error
  end

  it "should have a file extension of FLV for the test video" do
    flavor = FlavorSpecTester.new

    extension = nil
    extension = flavor.original_file_extension(@entry_id)
    extension.should == "flv"
  end

  it "should respond to original_download_url" do
    flavor = FlavorSpecTester.new

    flavor.should respond_to :original_download_url
  end

  it "shouldn't blow up when I call original_download_url" do
    flavor = FlavorSpecTester.new

    lambda {flavor.original_download_url(@entry_id)}.should_not raise_error
  end

  it "original_download_url should look like a reasonable URL" do
    flavor = FlavorSpecTester.new

    url = flavor.original_download_url(@entry_id)
    test_url = "#{KalturaFu.config[:service_url]}/p/#{KalturaFu.config[:partner_id]}/sp/#{KalturaFu.config[:subpartner_id]}/serveFlavor/flavorId/#{flavor.original_flavor(@entry_id)}/name/#{flavor.original_flavor(@entry_id)}.#{flavor.original_file_extension(@entry_id)}?novar=0"
    url.should == test_url
  end

  it "should respond to changes in service_url" do
    flavor = FlavorSpecTester.new
    old_service_url = KalturaFu.config[:service_url]
    KalturaFu.config[:service_url] = "http://www.waffles.com"

    url = flavor.original_download_url(@entry_id)
    test_url = "http://www.waffles.com/p/#{KalturaFu.config[:partner_id]}/sp/#{KalturaFu.config[:subpartner_id]}/serveFlavor/flavorId/#{flavor.original_flavor(@entry_id)}/name/#{flavor.original_flavor(@entry_id)}.#{flavor.original_file_extension(@entry_id)}?novar=0"
    KalturaFu.config[:service_url] = old_service_url
    url.should == test_url
  end
end


text:
package com.kingleung.androidhodgepodge.arch.lifecycle.room;

import android.arch.lifecycle.ViewModelProviders;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.widget.TextView;

import com.alibaba.android.arouter.facade.annotation.Route;
import com.kingleung.androidhodgepodge.R;

import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * @author kingleung
 *         Created on 2018/3/20.
 */

@Route(path = "/arch/room")
// AppCompactActivity 默认实现LifecycleOwner
public class RoomActivity extends AppCompatActivity {

    private UserViewModel mModel;

    private AppDatabase mAppDatabase;
    private UserDao mUserDao;

    @BindView(R.id.current_count)
    TextView mCurrentCount;

    @OnClick(R.id.add_count)
    void addCount() {
        List<User> users = mUserDao.getAll();
        int size = users.size();
        User user = new User();
//        user.setUid(size);
        user.setFirstName("FirstName" + size);
        user.setLastName("LastName" + size);
        mUserDao.insertAll(user);
    }

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_livedata);

        ButterKnife.bind(this);

        mAppDatabase = AppDatabase.getDefault(getApplicationContext());
        mUserDao = mAppDatabase.userDao();

        // Get the ViewModel.
        mModel = ViewModelProviders.of(this).get(UserViewModel.class);
        // may inject
        mModel.setUserDao(mUserDao);

        // Observe the LiveData, passing in this activity as the LifecycleOwner and the observer.
        mModel.getUsers().observe(this, users -> {
            // Update the UI, in this case, a TextView.
            if (users == null || users.size() == 0) {
                return;
            }
            StringBuilder sb = new StringBuilder();
            for (User user : users) {
                sb.append(user.getUid())
                        .append(" ")
                        .append(user.getFirstName())
                        .append(" ")
                        .append(user.getLastName())
                        .append("\n");
            }
            mCurrentCount.setText(sb.toString());
        });

    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        mAppDatabase.close();
    }
}


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

#ifndef _TSARMOD_H
#define _TSARMOD_H

#include <string.h>
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdarg.h>
#include <time.h>
#include <dlfcn.h>
#include <errno.h>
#include <signal.h>
#include <getopt.h>
#include <ctype.h>
#include <sys/stat.h>

#define U_64        unsigned long long

#define LEN_32      32
#define LEN_64      64
#define LEN_128     128
#define LEN_256     256
#define LEN_512     512
#define LEN_1024    1024
#define LEN_4096    4096
#define LEN_1M      1048576

#define ITEM_SPLIT      ";"
#define DATA_SPLIT      ","

struct mod_info {
    char   hdr[LEN_128];
    int    summary_bit;    /* bit set indefi summary */
    int    merge_mode;
    int    stats_opt;
};

struct module {

    char    name[LEN_32];
    char    opt_line[LEN_32];
    char    record[LEN_1M];
    char    usage[LEN_256];
    char    parameter[LEN_256];
    char    print_item[LEN_256];

    struct  mod_info *info;
    void   *lib;
    int     enable;
    int     spec;
    int     p_item;

    /* private data used by framework*/
    int     n_item;
    int     n_col;
    long    n_record;

    int     pre_flag:4;
    int     st_flag:4;

    U_64   *pre_array;
    U_64   *cur_array;
    double *st_array;
    double *max_array;
    double *mean_array;
    double *min_array;

    /* callback function of module */
    void (*data_collect) (struct module *, char *);
    void (*set_st_record) (struct module *, double *, U_64 *, U_64 *, int);

    /* mod manage */
    void (*mod_register) (struct module *);
};

void register_mod_fields(struct module *mod, const char *opt, const char *usage,
        struct mod_info *info, int n_col, void *data_collect, void *set_st_record);
void set_mod_record(struct module *mod, const char *record);

enum {
    HIDE_BIT,
    DETAIL_BIT,
    SUMMARY_BIT,
    SPEC_BIT
};

enum {
    MERGE_NULL,
    MERGE_SUM,
    MERGE_AVG
};

enum {
    STATS_NULL,
    STATS_SUB,
    STATS_SUB_INTER
};

#endif