text:
var user = {};
user.loadingTrello = true;
user.creatingExport = false;
user.onlyMe = false;
//user.commentMatch = /^\(\+?(\d+)(?:\s+(0?[1-9]|[1-2][0-9]|3[01])\/(0?[1-9]|1[0-2])\/((?:19|20)?\d{2}))?\)/;
user.dateRe = '(0?[1-9]|[1-2]\\d|3[01])\\/(0?[1-9]|1[0-2])\\/((?:19|20)?\\d{2})';
user.commentMatch = new RegExp('^\\(\\+?(\\d+)(?:\\)\\s+(?:\\['+user.dateRe+'\\]|\\('+user.dateRe+'\\))|\\s+'+user.dateRe+'\\)|\\))');

var app = {
    initialize: function() {
        app.Log("Authenticating with Trello");
        app.UpdateButton("btnExport", true, 'btnRed');
        $(".datepicker").datepicker({ dateFormat: "dd/mm/yy" }).attr('readonly','readonly');
        app.UpdateButton("btnOptions", true, 'btnGreen');
        $(document).ajaxStop(function () {
            $("#status").html("Status:  Data Loading Complete");
            if (user.loadingTrello === true){
                user.loadingTrello = false;
                app.optionsEntered();
            }

            if (user.creatingExport === true){
                $("#status").html("Status:  Generating View");
                app.generateView();
                user.creatingExport = false;
                $("#status").html("Status:  View Finished Loading");
            }
        });
        $("#status").html("Status:  Authenticating with Trello");
        app.AuthenticateTrello();
    },
    optionsEntered: function(sender) {
        var enabled = false,
            startDate = $("#startDate"),
            endDate = $("#endDate"),
            dDate,
            sDate,
            temp,
            dEndDate = null,
            dStartDate = null;
        if (startDate.val() !== ""){
            dDate = startDate.val().split("/");
            dStartDate = new Date(dDate[2], dDate[1]-1, dDate[0]);
        }
        if (endDate.val() !== ""){
            dDate = endDate.val().split("/");
            dEndDate = new Date(dDate[2], dDate[1]-1, dDate[0]);
        }
        if ((dStartDate !== null) && (dEndDate === null)){
            //dDate = new Date(dDate[2], dDate[1]-1, dDate[0]);
            //dDate = dStartDate
            dDate = new Date(dStartDate.getTime());
            dDate.setDate(dDate.getDate() + 7);
            sDate = dDate.getDate() < 10 ? "0" + dDate.getDate() : dDate.getDate();
            temp = dDate.getMonth()+1;
            sDate += "/";
            sDate += temp < 10 ? "0" + temp : temp;
            sDate += "/" + dDate.getFullYear();
            $("#endDate").val(sDate);
        }
        if (endDate.val() !== ""){
            dDate = endDate.val().split("/");
            dEndDate = new Date(dDate[2], dDate[1]-1, dDate[0]);
        }

        enabled = ((user.loadingTrello === false) && (startDate.val() !== "") && (endDate.val() !== "") &&
                     (dStartDate !== null) && (dEndDate !== null) && (dStartDate <= dEndDate));
        app.UpdateButton("btnOptions", !enabled, 'btnGreen');
        user.startDate = dStartDate;
        user.endDate = dEndDate;
        user.dateRange = null;
        if ((dStartDate !== null) && (dEndDate !== null)) {
            $("#daterange").html("");
            sDate = dStartDate.getDate() < 10 ? "0" + dStartDate.getDate() : dStartDate.getDate();
            temp = dStartDate.getMonth()+1;
            sDate += "/";
            sDate += temp < 10 ? "0" + temp : temp;
            sDate += "/" + dStartDate.getFullYear();

            sDate += " - ";

            sDate += dEndDate.getDate() < 10 ? "0" + dEndDate.getDate() : dEndDate.getDate();
            temp = dEndDate.getMonth()+1;
            sDate += "/";
            sDate += temp < 10 ? "0" + temp : temp;
            sDate += "/" + dEndDate.getFullYear();
            user.dateRange = sDate;
            $("#daterange").html("Date range: " + sDate);
        }

    },
    AuthenticateTrello: function() {
        var authOpts = [];
        authOpts["type"] = "redirect";
        authOpts["name"] = "Time Export";
        authOpts["persist"] = "true";
        authOpts["interactive"] = "true";
        authOpts["scope"] = {read:"allowRead", write:"allowWrite", account:"allowAccount"};
        authOpts["expiration"] = "never";
        authOpts["success"] = app.AuthSuccess;
        authOpts["error"] = function(){ app.Failed("Denied Access"); };
        app.Log("Calling Trello Auth");
        Trello.authorize(authOpts);
    },
    AuthSuccess: function() {
        app.Log("Authenticated");
        app.Log("Getting User Data");
        $("#status").html("Status:  Getting User Data");
        $( ".tabs" ).tabs();
        $( "#tabs" ).tabs( "disable" );
        $('#assignedToMe').on('change', function(){
            user.onlyMe = ($(this).is(':checked'));
        });
        app.GerUserData();
    },
    Failed: function(msg) {
        app.Log("Failure Occured: " + msg);
    },
    CheckforParams: function(){

    },
    GerUserData: function() {
        $( "#tabs" ).tabs( "enable" );
        $( "#tabs" ).tabs( "option", "disabled", [ 1, 2, 3 ] );
        app.CheckforParams();

        Trello.rest("GET", "members/me", {},
            function(data){
                user.id = data.id;
                user.username = data.username;
                user.fullname = data.fullName;
                user.email = data.email;
                user.url = data.url;
                user.status = data.status;
                user.avatar = data.avatarHash;
                user.boards = {};
                $("#status").html("Status:  Fetching Board Information");
                $.each(data.idBoards, function (index, value){
                    app.GetBoardInformation(index, value);
                });
            },
            function(){ app.Failed("Couldn't return 'Me'"); });
    },
    GetBoardInformation: function(index, boardid){
        app.UpdateFromBoard();
        if (boardid){
            Trello.rest("GET", "board/" + boardid, {},
                function(data){
                    if (data.idOrganization){
                        user.boards[boardid] = {};
                        user.boards[boardid].id = boardid;
                        user.boards[boardid].color = app.changeColour(index, data);
                        user.boards[boardid].textColor = app.getTextColor(user.boards[boardid].color);
                        user.boards[boardid].name = data.name;
                        user.boards[boardid].url = data.shortUrl;
                        user.boards[boardid].labels = {};
                        $.each(data.labelNames, function(index, value){
                            user.boards[boardid].labels[index] = value;
                        });
                        $("#BoardsCheckboxes").prepend('<input type="checkbox" id="cb' + boardid + '" value="' + boardid + '" onclick="app.UpdateFromBoard(\'' + boardid + '\')" > ' + data.name +"
");
                        app.GetBoardLists(user.boards[boardid]);
                    }
                },
                function(){
                    app.Failed("Couldn't get board " + boardid);
                }
            );
        }
    },
    GetBoardLists: function (board){
        if (board.id){
            Trello.rest("GET", "board/" + board.id + "/lists/all", {},
                function(data){
                    board.lists = {};
                    $.each(data, function(index, value){
                        board.lists[value.id] = {};
                        board.lists[value.id] = value;
                        board.lists[value.id].cards = {};
                    });
                },
                function(){
                    app.Failed("Couldn't get board " + board.id);
                }
            );
        }
    },
    UpdateFromBoard: function(boardid){
        $("#ListsCheckboxes").empty();
        var boards = $("#BoardsCheckboxes input[type=checkbox]");
        app.UpdateButton("btnBoard", true, 'btnGreen');
        app.UpdateButton("btnList", true, 'btnGreen');
        app.UpdateButton("btnRun", true, 'btnGreen');
        var canProgress = false;
        var allSelected = true;
        var counter = 0;
        $.each(boards, function(index, cb){
            counter++;
            if (cb.checked === true){
                canProgress = true;
                if ((user.boards[cb.value]) && (user.boards[cb.value].lists)) {
                    $.each(user.boards[cb.value].lists, function (index, value){
                        $("#ListsCheckboxes").prepend('<input type="checkbox" id="cb' + user.boards[cb.value].lists[index].id +
                                '" value="' + user.boards[cb.value].lists[index].id +
                                '" onclick="app.UpdateFromList(\'' + index + '\')" > ' +
                                user.boards[cb.value].name + " - " + user.boards[cb.value].lists[index].name +"
");
                    });
                }
            } else {
                allSelected = false;
            }
        });
        app.UpdateButton("btnBoard", !canProgress, 'btnGreen');
        app.updateAllSelected("selectAllBoards", allSelected, counter);
    },
    UpdateFromList: function(listid){
        var lists = $("#ListsCheckboxes input[type=checkbox]");
        app.UpdateButton("btnList", true, 'btnGreen');
        app.UpdateButton("btnRun", true, 'btnGreen');
        var canProgress = false;
        var allSelected = true;
        var counter = 0;
        $.each(lists, function(index, cb){
            counter++;
            if (cb.checked === true){
                canProgress = true;
            } else {
                allSelected = false;
            }
        });
        app.UpdateButton("btnList", !canProgress, 'btnGreen');
        app.UpdateButton("btnRun", !canProgress, 'btnGreen');
        app.updateAllSelected("selectAllLists", allSelected, counter);
    },
    MoveTab: function (activateIndex, disableIndexs){
        $("#colorLegend").empty();
        $("#colors").hide("fast");
        $("#calendar").empty();
        $("#tabs").tabs("enable", activateIndex );
        $("#tabs").tabs("option", "active", activateIndex);
        $("#tabs").tabs("option", "disabled", disableIndexs );

        $("#tabs").tabs("option", "active", activateIndex);
    },
    UpdateButton: function(elementId, disabled, className){
        if (disabled === true){
            $("#" + elementId).attr('disabled','disabled');
            $("#" + elementId).removeClass(className);
        } else {
            $("#" + elementId).removeAttr('disabled');
            $("#" + elementId).addClass(className);
        }
    },
    selectAllBoards: function() {
        var cbSelect = $("#selectAllBoards")[0];
        var selectedValue = cbSelect.checked;
        var boards = $("#BoardsCheckboxes input[type=checkbox]");
        $.each(boards, function(index, cb){
            cb.checked = selectedValue;
        });
        app.UpdateFromBoard();
    },
    selectAllLists: function() {
        var cbSelect = $("#selectAllLists")[0];
        var selectedValue = cbSelect.checked;
        var lists = $("#ListsCheckboxes input[type=checkbox]");
        $.each(lists, function(index, cb){
            cb.checked = selectedValue;
        });
        app.UpdateFromList();
    },
    updateAllSelected: function (selector, checkedValue, counter){
        $("#" + selector)[0].checked = ((checkedValue === true) && (counter > 0));
    },
    convertDateTime: function(dateStr){
        var dateObj = new Date(dateStr);
        dateObj.setMonth(dateObj.getMonth() + 1);
        return dateObj;
    },
    Log: function(msg) {
        console.log(msg);
    },
    changeColour: function(count, board){
        if (board.prefs.backgroundColor != "#205C7E") {
            RGB = app.HextoRGB(board.prefs.backgroundColor);
            return app.RGB(RGB.r, RGB.g, RGB.b);
        } else {
            var freqr = 1.666 * count;
            var freqg = 2.666 * count;
            var freqb = 3.666 * count;
            return app.makeColorGradient(freqr, freqg, freqb, 0, 0, 0, 128, 127);
        }
    },
    getTextColor: function(backgroundColor){
        var rgb = backgroundColor.replace(/^rgba?\(|\s+|\)$/g,'').split(',');
        return app.idealTextColor(rgb[0], rgb[1], rgb[2]);
    },
    RGB: function (r,g,b)
    {
        return 'rgb(' + Math.floor(r) + ',' + Math.floor(g) + ',' + Math.floor(b) + ')';
    },
    makeColorGradient: function (frequency1, frequency2, frequency3, phase1, phase2, phase3, center, width, len)
    {
        if (len === undefined)      len = 50;
        if (center === undefined)   center = 128;
        if (width === undefined)    width = 127;

        var red = Math.sin(frequency1 + phase1) * width + center;
        var grn = Math.sin(frequency2 + phase2) * width + center;
        var blu = Math.sin(frequency3 + phase3) * width + center;
        return app.RGB(red,grn,blu);
    },
    idealTextColor: function(r,g,b) {
        //var nThreshold = 105;
        var nThreshold = 105;
        var components = app.getRGBComponents(r,g,b);
        var bgDelta = (components.R * 0.299) + (components.G * 0.587) + (components.B * 0.114);
        var val = 255 - bgDelta;
        return (val < nThreshold) ? "rgb(0,0,0)" : "rgb(255,255,255)";
        //return ((val > 65 || val <50) && (val < 105)) ? "rgb(0,0,0)" : "rgb(255,255,255)" ;
    },
    getRGBComponents: function(r,g,b) {
        return {
           R: r,
           G: g,
           B: b
        };
    },
    HextoRGB: function (hex) {
        var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
        return result ? {
            r: parseInt(result[1], 16),
            g: parseInt(result[2], 16),
            b: parseInt(result[3], 16)
        } : null;
    },
    openLink: function (url){
        window.open(url);
    },
    run: function() {
        $("#times").fadeOut("fast");
        app.CheckforParams();
        user.creatingExport = true;
        app.UpdateButton("btnRun", true, 'btnGreen');
        app.UpdateButton("btnRunPrev", true, 'btnBlue');
        app.UpdateButton("btnExport", true, 'btnRed');
        $("#status").html("Status:  Fetching Trello Data");
        $("#times").empty();
        var lists = $("#ListsCheckboxes input[type=checkbox]");
        $.each(lists, function(index, cb){
            if (cb.checked === true){
                Trello.rest("GET", "lists/" + cb.value + "/cards", {},
                    function(data){
                        $.each(data, function(index, card){
                            user.boards[card.idBoard].lists[card.idList].cards[card.id] = card;
                            user.boards[card.idBoard].lists[card.idList].cards[card.id].comments = {};
                            app.getComments(user.boards[card.idBoard].lists[card.idList].cards[card.id], card.id);
                        });
                    },
                    function(){
                        app.Failed("Couldn't cards from list " + cb.value);
                    }
                );
            }
        });
    },
    getComments: function(objCard, cardid){
        Trello.rest("GET", "cards/" + cardid + "/actions", {},
            function(data){
                $.each(data, function(index, action){
                    if (action.type.toUpperCase() == "COMMENTCARD"){
                        objCard.comments[action.id] = {};
                        objCard.comments[action.id] = action;
                        app.addMember(action);
                        app.getCommentText(objCard, action.id);
                    }
                });
            },
            function(){
                app.Failed("Couldn't comments from card " + cardid);
            }
        );
    },
    addMember: function (commentData){
        if (typeof user.members == "undefined"){
            user.members = {};
        }
        if (typeof user.members[commentData.idMemberCreator] == "undefined"){
            user.members[commentData.idMemberCreator] = {};
        }
        user.members[commentData.idMemberCreator] = commentData.memberCreator;
    },
    getCommentText: function (objCard, commentId){
        Trello.rest("GET", "actions/" + commentId, {},
            function(data){
                objCard.comments[commentId].commentText = data.data.text;
            },
            function(){
                app.Failed("Couldn't comment text from comment id " + cardid);
            }
        );
    },
    generateView: function(){
        app.Log("Loading View");
        var commentList = [];
        var curBoard,
            curList,
            curCard;
        $.each(user.boards, function(index, board){
            curBoard = user.boards[index];
            curBoard.totalTime = 0;
            $.each(board.lists, function(index, list){
                curList = curBoard.lists[index];
                curList.totalTime = 0;
                $.each(list.cards, function(index, card){
                    curCard = curList.cards[index];
                    curCard.totalTime = 0;
                    $.each(card.comments, function(index, comment){
                        var com = curCard.comments[comment.id];
                        com.show = false;
                        var matches = user.commentMatch.exec(comment.commentText);
                        if ((matches) && (matches[1] !== undefined)) {
                            var temp = comment.date.split("-");
                            var dateVal = temp[2].split("T")[0];
                            var commentDate = new Date();
                            commentDate.setFullYear(temp[0], temp[1]-1, dateVal);
                            if ((matches.length >= 11) && ((matches[4] !== undefined) || (matches[7] !== undefined) || (matches[10] !== undefined))) {
                                //date is in the comment
                                commentDate = app.getCommentDate(matches);
                            }
                            //if ((commentDate >= user.startDate) && (commentDate <= user.endDate)){
                            if (app.checkDates(commentDate, com.id) === true) {
                                if (((user.onlyMe === true) && (user.id == comment.idMemberCreator)) || (user.onlyMe === false)){
                                    com.time = matches[1];
                                    com.actualDate = commentDate;
                                    com.show = true;
                                    curCard.totalTime = curCard.totalTime + parseInt(com.time, 10);
                                    curList.totalTime = curList.totalTime + parseInt(com.time, 10);
                                    curBoard.totalTime = curBoard.totalTime + parseInt(com.time, 10);
                                }
                            }
                        }
                    });
                });
            });
        });
        app.displayTimes();
    },
    checkDates: function (commentDate, id){
        // Have to strip the time section off the comment date before comparing against the start/end date
        // comment date = date time
        // start/end = date
        //
        // Comment = 26/11/2013 16:36:10
        // Start = 1/11/2013 (00:00:00)
        // End = 26/11/2013 (00:00:00)
        //
        // Shows if
        // ((commentDate >= startDate) && (commentDate <= endDate))
        //
        // Comment wouldn't show
        if (typeof commentDate != "undefined"){
            var c = new Date(commentDate.getFullYear(), commentDate.getMonth(), commentDate.getDate()).setHours(0,0,0,0);
            return ((c >= user.startDate) && (c <= user.endDate));
        }
        return false;

    },
    getCommentDate: function(m){
        var date;
        if (m[4] !== undefined){
            date = new Date();
            date.setFullYear(m[4], m[3]-1, m[2]);
        } else if (m[7] !== undefined) {
            date = new Date();
            date.setFullYear(m[7], m[6]-1, m[5]);
        } else if (m[10] !== undefined) {
            date = new Date();
            date.setFullYear(m[10], m[9]-1, m[8]);
        } else {
            date = undefined; //shouldn't get here!
        }
        return date;
    },
    displayTimes: function(){
        var table = "
";
        //table += app.tableRow("Board	List	Card	Comment Date	Comment Time	Comment Text	")

        var curBoard,
            curList,
            curCard;
        $.each(user.boards, function(index, board){
            curBoard = user.boards[index];
            if (curBoard.totalTime !== 0){
                table += app.tableRow("" +
                                      "" + curBoard.name + "" +
                                      "	" + curBoard.totalTime + "	");
                $.each(board.lists, function(index, list){
                    curList = curBoard.lists[index];
                    if (curList.totalTime !== 0){
                        table += app.tableRow(app.tableCell("List:" + curList.name, "list", 4) + app.tableCell(curList.totalTime, "timeTotal listTime"));
                        $.each(list.cards, function(index, card){
                            curCard = curList.cards[index];
                            if (curCard.totalTime !== 0){
                                table += app.tableRow(app.tableCell("" + curCard.name + "", "card", 4) + app.tableCell(curCard.totalTime, "timeTotal cardTime"));
                                $.each(card.comments, function(index, comment){
                                    var com = curCard.comments[index];
                                    if (com.show === true){
                                         table += app.tableRow(
                                            app.tableCell(app.getMemberName(com.idMemberCreator), "commentName") +
                                            app.tableCell(app.formatDisplayDate(com.actualDate), "commentDate") +
                                            app.tableCell(com.commentText, "", 2) +
                                            app.tableCell(com.time, "commentTime")
                                        );
                                    }
                                });
                            }
                        });
                    }
                });
            }
        });
        $("#times").html(table);
        setTimeout(function(){
            $("#times").fadeIn("slow");
            app.UpdateButton("btnExport", false, 'btnRed');
            app.UpdateButton("btnRun", false, 'btnGreen');
            app.UpdateButton("btnRunPrev", false, 'btnBlue');
        }, 500);
    },
    tableCell: function (data, className, colspan){
        var cell = " 1){
            cell += " colspan=\"" + colspan + "\"";
        }
        cell += ">" + data + "	";
        return cell;
    },
    tableRow: function (data){
        return "
" + data + "
";
    },
    getMemberName: function(memberId){
        return user.members[memberId].fullName;
    },
    lpad: function(s, l, p) {
        s += "";
        if (typeof p != 'string')
            p += ' ';
        p = p.length > 0 ? p[0] : ' ';
        while (s.length<l) {
            s = p + s;
        }
        return s;
    },
    formatDisplayDate: function(commentDate){
        var d = new Date(commentDate);
        var dispDate = "";
        dispDate += this.lpad(d.getDate(), 2, '0'); //d.getDate() < 10 ? "0" + d.getDate() : d.getDate();
        dispDate += "/" + this.lpad(d.getMonth()+1, 2, '0'); // (d.getMonth()+1 < 10 ? "0" + d.getMonth()+1 : d.getMonth()+1);
        dispDate += "/" + d.getFullYear();
        return dispDate;
    },
    exportTable: function(){
        tableToExcel('timesTable', 'Trello Times', 'Trello Times (' + user.dateRange + ')');
    }
};

var tableToExcel = (function () {
        var uri = 'data:application/vnd.ms-excel;base64,',
            template = '
{table}
',
            base64 = function (s) { return window.btoa(unescape(encodeURIComponent(s))); },
            format = function (s, c) { return s.replace(/{(\w+)}/g, function (m, p) { return c[p]; }); };
        return function (table, name, filename) {
            if (!table.nodeType) table = document.getElementById(table);
            var ctx = { worksheet: name || 'Worksheet', table: table.innerHTML };

            document.getElementById("dlink").href = uri + base64(format(template, ctx));

            d = new Date();
            df = ""+d.getFullYear()+(d.getMonth()+1)+d.getDate()+d.getHours();
            if (d.getMinutes() < 10) {
                df = df + "0" + d.getMinutes();
            } else {
                df = df + d.getMinutes();
            }

            document.getElementById("dlink").download = filename + ".xls";//filename + "-" + df + ".xls";
            document.getElementById("dlink").click();

        };
    })();


text:
<?php

namespace Composer\Test\Repository\Vcs;

use Composer\Repository\Vcs\HgDriver;
use Composer\TestCase;
use Composer\Util\Filesystem;
use Composer\Config;

class HgDriverTest extends TestCase
{
    /** @type \Composer\IO\IOInterface|\PHPUnit_Framework_MockObject_MockObject */
    private $io;
    /** @type Config */
    private $config;
    /** @type string */
    private $home;

    public function setUp()
    {
        $this->io = $this->getMock('Composer\IO\IOInterface');
        $this->home = $this->getUniqueTmpDirectory();
        $this->config = new Config();
        $this->config->merge(array(
            'config' => array(
                'home' => $this->home,
            ),
        ));
    }

    public function tearDown()
    {
        $fs = new Filesystem;
        $fs->removeDirectory($this->home);
    }

    /**
     * @dataProvider supportsDataProvider
     */
    public function testSupports($repositoryUrl)
    {
        $this->assertTrue(
            HgDriver::supports($this->io, $this->config, $repositoryUrl)
        );
    }

    public function supportsDataProvider()
    {
        return array(
            array('ssh://bitbucket.org/user/repo'),
            array('ssh://hg@bitbucket.org/user/repo'),
            array('ssh://user@bitbucket.org/user/repo'),
            array('https://bitbucket.org/user/repo'),
            array('https://user@bitbucket.org/user/repo'),
        );
    }
}

redpajama_set_name: RedPajamaGithub


text:
using System;
using System.Collections.Generic;
using System.IO;
using System.Xml;
using NUnit.Common;
using NUnit.ConsoleRunner.Utilities;
using NUnit.Engine;
using NUnit.Engine.Extensibility;
using System.Runtime.InteropServices;

namespace NUnit.ConsoleRunner
{
    /// <summary>
    /// ConsoleRunner provides the nunit3-console text-based
    /// user interface, running the tests and reporting the results.
    /// </summary>
    public class ConsoleRunner
    {
        #region Console Runner Return Codes

        public static readonly int OK = 0;
        public static readonly int INVALID_ARG = -1;
        public static readonly int INVALID_ASSEMBLY = -2;
        public static readonly int FIXTURE_NOT_FOUND = -3;
        public static readonly int UNEXPECTED_ERROR = -100;

        #endregion

        #region Instance Fields

        private ITestEngine _engine;
        private ConsoleOptions _options;
        private IResultService _resultService;
        private ITestFilterService _filterService;

        private ExtendedTextWriter _outWriter;
        private TextWriter _errorWriter = Console.Error;

        private string _workDirectory;

        #endregion

        #region Constructor

        public ConsoleRunner(ITestEngine engine, ConsoleOptions options, ExtendedTextWriter writer)
        {
            _engine = engine;
            _options = options;
            _outWriter = writer;

            _workDirectory = options.WorkDirectory;

            if (_workDirectory == null)
                _workDirectory = Environment.CurrentDirectory;
            else if (!Directory.Exists(_workDirectory))
                Directory.CreateDirectory(_workDirectory);

            _resultService = _engine.Services.GetService<IResultService>();
            _filterService = _engine.Services.GetService<ITestFilterService>();
        }

        #endregion

        #region Execute Method

        /// <summary>
        /// Executes tests according to the provided commandline options.
        /// </summary>
        /// <returns></returns>
        public int Execute()
        {
            DisplayRuntimeEnvironment(_outWriter);

            DisplayTestFiles();

            TestPackage package = MakeTestPackage(_options);

            // We display the filters at this point so  that any exception message
            // thrown by CreateTestFilter will be understandable.
            DisplayTestFilters();

            TestFilter filter = CreateTestFilter(_options);

            if (_options.Explore)
                return ExploreTests(package, filter);
            else
                return RunTests(package, filter);
        }

        private void DisplayTestFiles()
        {
            _outWriter.WriteLine(ColorStyle.SectionHeader, "Test Files");
            foreach (string file in _options.InputFiles)
                _outWriter.WriteLine(ColorStyle.Default, "    " + file);
            _outWriter.WriteLine();
        }

        #endregion

        #region Helper Methods

        private int ExploreTests(TestPackage package, TestFilter filter)
        {
            XmlNode result;

            using (var runner = _engine.GetRunner(package))
                result = runner.Explore(filter);

            if (_options.ExploreOutputSpecifications.Count == 0)
            {
                _resultService.GetResultWriter("cases", null).WriteResultFile(result, Console.Out);
            }
            else
            {
                foreach (OutputSpecification spec in _options.ExploreOutputSpecifications)
                {
                    _resultService.GetResultWriter(spec.Format, new object[] {spec.Transform}).WriteResultFile(result, spec.OutputPath);
                    _outWriter.WriteLine("Results ({0}) saved as {1}", spec.Format, spec.OutputPath);
                }
            }

            return ConsoleRunner.OK;
        }

        private int RunTests(TestPackage package, TestFilter filter)
        {
            foreach (var spec in _options.ResultOutputSpecifications)
            {
                var outputPath = Path.Combine(_workDirectory, spec.OutputPath);
                GetResultWriter(spec).CheckWritability(outputPath);
            }

            // TODO: Incorporate this in EventCollector?
            RedirectErrorOutputAsRequested();

            var labels = _options.DisplayTestLabels != null
                ? _options.DisplayTestLabels.ToUpperInvariant()
                : "ON";

            XmlNode result;

            try
            {
                using (new SaveConsoleOutput())
                using (new ColorConsole(ColorStyle.Output))
                using (ITestRunner runner = _engine.GetRunner(package))
                using (var output = CreateOutputWriter())
                {
                    var eventHandler = new TestEventHandler(output, labels, _options.TeamCity);

                    result = runner.Run(eventHandler, filter);
                }
            }
            finally
            {
                RestoreErrorOutput();
            }

            var writer = new ColorConsoleWriter(!_options.NoColor);
            var reporter = new ResultReporter(result, writer, _options);
            reporter.ReportResults();

            foreach (var spec in _options.ResultOutputSpecifications)
            {
                var outputPath = Path.Combine(_workDirectory, spec.OutputPath);
                GetResultWriter(spec).WriteResultFile(result, outputPath);
                _outWriter.WriteLine("Results ({0}) saved as {1}", spec.Format, spec.OutputPath);
            }

            if (reporter.Summary.UnexpectedError)
                return ConsoleRunner.UNEXPECTED_ERROR;

            return reporter.Summary.InvalidAssemblies > 0
                    ? ConsoleRunner.INVALID_ASSEMBLY
                    : reporter.Summary.FailureCount + reporter.Summary.ErrorCount + reporter.Summary.InvalidCount;

        }

        private void DisplayRuntimeEnvironment(ExtendedTextWriter OutWriter)
        {
            OutWriter.WriteLine(ColorStyle.SectionHeader, "Runtime Environment");
            OutWriter.WriteLabelLine("   OS Version: ", GetOSVersion());
            OutWriter.WriteLabelLine("  CLR Version: ", Environment.Version.ToString());
            OutWriter.WriteLine();
        }

        private static string GetOSVersion()
        {
            OperatingSystem os = Environment.OSVersion;
            string osString = os.ToString();
            if (os.Platform == PlatformID.Unix)
            {
                IntPtr buf = Marshal.AllocHGlobal(8192);
                if (uname(buf) == 0)
                {
                    var unixVariant = Marshal.PtrToStringAnsi(buf);
                    if (unixVariant.Equals("Darwin"))
                        unixVariant = "MacOSX";

                    osString = string.Format("{0} {1} {2}", unixVariant, os.Version, os.ServicePack);
                }
                Marshal.FreeHGlobal(buf);
            }
            return osString;
        }

        [DllImport("libc")]
        static extern int uname(IntPtr buf);

        private void DisplayTestFilters()
        {
            if (_options.TestList.Count > 0 || _options.WhereClauseSpecified)
            {
                _outWriter.WriteLine(ColorStyle.SectionHeader, "Test Filters");

                if (_options.TestList.Count > 0)
                    foreach (string testName in _options.TestList)
                        _outWriter.WriteLabelLine("    Test: ", testName);

                if (_options.WhereClauseSpecified)
                    _outWriter.WriteLabelLine("    Where: ", _options.WhereClause.Trim());

                _outWriter.WriteLine();
            }
        }

        private void RedirectErrorOutputAsRequested()
        {
            if (_options.ErrFileSpecified)
            {
                var errorStreamWriter = new StreamWriter(Path.Combine(_workDirectory, _options.ErrFile));
                errorStreamWriter.AutoFlush = true;
                _errorWriter = errorStreamWriter;
            }
        }

        private ExtendedTextWriter CreateOutputWriter()
        {
            if (_options.OutFileSpecified)
            {
                var outStreamWriter = new StreamWriter(Path.Combine(_workDirectory, _options.OutFile));
                outStreamWriter.AutoFlush = true;

                return new ExtendedTextWrapper(outStreamWriter);
            }

            return _outWriter;
        }

        private void RestoreErrorOutput()
        {
            _errorWriter.Flush();
            if (_options.ErrFileSpecified)
                _errorWriter.Close();
        }

        private IResultWriter GetResultWriter(OutputSpecification spec)
        {
            return _resultService.GetResultWriter(spec.Format, new object[] {spec.Transform});
        }

        // This is public static for ease of testing
        public static TestPackage MakeTestPackage(ConsoleOptions options)
        {
            TestPackage package = new TestPackage(options.InputFiles);

            if (options.ProcessModelSpecified)
                package.AddSetting(PackageSettings.ProcessModel, options.ProcessModel);

            if (options.DomainUsageSpecified)
                package.AddSetting(PackageSettings.DomainUsage, options.DomainUsage);

            if (options.FrameworkSpecified)
                package.AddSetting(PackageSettings.RuntimeFramework, options.Framework);

            if (options.RunAsX86)
                package.AddSetting(PackageSettings.RunAsX86, true);

            if (options.DisposeRunners)
                package.AddSetting(PackageSettings.DisposeRunners, true);

            if (options.ShadowCopyFiles)
                package.AddSetting(PackageSettings.ShadowCopyFiles, true);

            if (options.DefaultTimeout >= 0)
                package.AddSetting(PackageSettings.DefaultTimeout, options.DefaultTimeout);

            if (options.InternalTraceLevelSpecified)
                package.AddSetting(PackageSettings.InternalTraceLevel, options.InternalTraceLevel);

            if (options.ActiveConfigSpecified)
                package.AddSetting(PackageSettings.ActiveConfig, options.ActiveConfig);

            // Always add work directory, in case current directory is changed
            var workDirectory = options.WorkDirectory ?? Environment.CurrentDirectory;
            package.AddSetting(PackageSettings.WorkDirectory, workDirectory);

            if (options.StopOnError)
                package.AddSetting(PackageSettings.StopOnError, true);

            if (options.MaxAgentsSpecified)
                package.AddSetting(PackageSettings.MaxAgents, options.MaxAgents);

            if (options.NumberOfTestWorkersSpecified)
                package.AddSetting(PackageSettings.NumberOfTestWorkers, options.NumberOfTestWorkers);

            if (options.RandomSeedSpecified)
                package.AddSetting(PackageSettings.RandomSeed, options.RandomSeed);

            if (options.Verbose)
                package.AddSetting("Verbose", true);

            if (options.DebugTests)
            {
                package.AddSetting(PackageSettings.DebugTests, true);

                if (!options.NumberOfTestWorkersSpecified)
                    package.AddSetting(PackageSettings.NumberOfTestWorkers, 0);
            }

            if (options.PauseBeforeRun)
                package.AddSetting(PackageSettings.PauseBeforeRun, true);

#if DEBUG
            if (options.DebugAgent)
                package.AddSetting(PackageSettings.DebugAgent, true);

            //foreach (KeyValuePair<string, object> entry in package.Settings)
            //    if (!(entry.Value is string || entry.Value is int || entry.Value is bool))
            //        throw new Exception(string.Format("Package setting {0} is not a valid type", entry.Key));
#endif

            return package;
        }

        private TestFilter CreateTestFilter(ConsoleOptions options)
        {
            ITestFilterBuilder builder = _filterService.GetTestFilterBuilder();

            foreach (string testName in options.TestList)
                builder.AddTest(testName);

            if (options.WhereClauseSpecified)
                builder.SelectWhere(options.WhereClause);

            return builder.GetFilter();
        }

        #endregion

    }
}


text:
// Copyright (c) Google LLC 2019
//
// Use of this source code is governed by an MIT-style
// license that can be found in the LICENSE file or at
// https://opensource.org/licenses/MIT.

/* Internal encoder state and workflow methods declaration. */

#ifndef BRUNSLI_ENC_STATE_H_
#define BRUNSLI_ENC_STATE_H_

#include <array>
#include <memory>
#include <vector>

#include "../common/distributions.h"
#include <brunsli/jpeg_data.h>
#include "../common/platform.h"
#include <brunsli/types.h>
#include "./ans_encode.h"
#include "./write_bits.h"

namespace brunsli {
namespace internal {
namespace enc {

typedef std::array<int32_t, kDCTBlockSize> BlockI32;

struct ComponentMeta {
  size_t context_offset;
  size_t approx_total_nonzeros;
  int32_t h_samp;
  int32_t v_samp;
  int32_t context_bits;
  int32_t ac_stride;
  int32_t dc_stride;
  int32_t b_stride;
  int32_t width_in_blocks;
  int32_t height_in_blocks;
  const coeff_t* ac_coeffs;
  coeff_t* dc_prediction_errors;
  // TODO: investigate bit fields.
  uint8_t* block_state;
  BlockI32 num_zeros;
  BlockI32 quant;
};

struct Histogram {
  Histogram();
  void Clear();
  void AddHistogram(const Histogram& other);
  void Add(int val);
  void Merge(const Histogram& other);

  int data_[ANS_MAX_SYMBOLS];
  int total_count_;
  double bit_cost_;
};

class EntropyCodes {
 public:
  EntropyCodes(const std::vector<Histogram>& histograms, int num_bands,
               const std::vector<int>& offsets);
  // GCC declares it won't apply RVO, even if it actually does.
  //EntropyCodes(const EntropyCodes&) = delete;
  void EncodeContextMap(Storage* storage) const;
  void BuildAndStoreEntropyCodes(Storage* storage);
  const ANSTable* GetANSTable(int context) const;

 private:
  static const int kMaxNumberOfHistograms = 256;

  std::vector<Histogram> clustered_;
  std::vector<uint32_t> context_map_;
  std::vector<ANSTable> ans_tables_;
};

// Manages building of the histograms of an entropy source.
class EntropySource {
 public:
  EntropySource() : num_bands_(0) {}
  void Resize(int num_bands);
  void AddCode(int code, int histo_ix);
  void Merge(const EntropySource& other);
  EntropyCodes Finish(const std::vector<int>& offsets);

 private:
  int num_bands_;
  std::vector<Histogram> histograms_;
};

// Manages the multiplexing of the ANS-coded and arithmetic coded bits.
class DataStream {
 public:
  DataStream();
  void Resize(int max_num_code_words);
  void ResizeForBlock();
  void AddCode(int code, int band, int context, EntropySource* s);
  void AddBits(int nbits, int bits);
  void FlushArithmeticCoder();
  void FlushBitWriter();
  // Encodes the next bit to the bit stream, based on the 8-bit precision
  // probability, i.e. P(bit = 0) = prob / 256. Statistics are updated in 'p'.
  void AddBit(Prob* const p, int bit);
  void EncodeCodeWords(EntropyCodes* s, Storage* storage);

 private:
  struct CodeWord {
    // Add a constructor that does nothing (unlike the default one) to avoid
    // initializing to values that are unused anyway.
    CodeWord() {}
    uint32_t context;
    uint16_t value;
    uint8_t code;
    uint8_t nbits;
  };

  static const size_t kSlackForOneBlock = 1024;

  int pos_;
  int bw_pos_;
  int ac_pos0_;
  int ac_pos1_;
  uint32_t low_;
  uint32_t high_;
  uint32_t bw_val_;
  int bw_bitpos_;
  std::vector<CodeWord> code_words_;
};

struct State {
  EntropySource entropy_source;
  EntropyCodes* entropy_codes;
  DataStream data_stream_dc;
  DataStream data_stream_ac;

  std::vector<ComponentMeta> meta;
  size_t num_contexts;

  bool use_brotli;
};

// Encoder workflow:
bool CalculateMeta(const JPEGData& jpg, State* state);
size_t SampleNumNonZeros(ComponentMeta* m);
int SelectContextBits(size_t num_symbols);
bool PredictDCCoeffs(State* state);
void EncodeDC(State* state);
void EncodeAC(State* state);
EntropyCodes PrepareEntropyCodes(State* state);
bool BrunsliSerialize(State* state, const JPEGData& jpg, uint32_t skip_sections,
                      uint8_t* data, size_t* len);

}  // namespace enc
}  // namespace internal
}  // namespace brunsli

#endif  // BRUNSLI_ENC_STATE_H_


text:
- Added a new command: **gra-analytical-features-entity-value**.

#### Incident Fields
- Added the **GRA Case Risk Score** incident field.
- Added the **GRA Case Weblink** incident field.
- **Breaking changes**: Updated the **GRA Case Open Date** incident field.
- **Breaking changes**: Updated the **GRA Case Risk Date** incident field.
- **Breaking changes**: Updated the **GRA Case Status** incident field.
- **Breaking changes**: Updated the **GRA Case Entity Type Id** incident field.
- **Breaking changes**: Updated the **GRA Case Owner Id** incident field.
- **Breaking changes**: Updated the **GRA Case Anomaly Details** incident field.
- **Breaking changes**: Updated the **GRA Case Entity Id** incident field.
- **Breaking changes**: Updated the **GRA Case Entity** incident field.
- **Breaking changes**: Updated the **GRA Case Owner Name** incident field.
- **Breaking changes**: Updated the **GRA Case Owner Type** incident field.
- **Breaking changes**: removed the **GRA Case Id** incident field.
- **Breaking changes**: removed the **GRA Anomaly Status** incident field.
- **Breaking changes**: removed the **GRA Anomaly Assignee** incident field.
- **Breaking changes**: removed the **GRA Anomaly Name** incident field.
- **Breaking changes**: removed the **GRA Anomaly Resource Name** incident field.
- **Breaking changes**: removed the **GRA Anomaly Risk Score** incident field.
- **Breaking changes**: removed the **GRA Anomaly Risk Accepted Date** incident field.
- **Breaking changes**: removed the **GRA Anomaly Assignee Type** incident field.

#### Classifiers
##### The renamed classifiers
  - **Breaking changes**: Renamed the **GRACase_5_9_9** classifier to.
  - **Breaking changes**: Renamed the **GRACase** classifier.
  - **Breaking changes**: removed the **GRAHighRiskUser** classifier.
  - **Breaking changes**: removed the **RAHighRiskUser_5_9_9** classifier.
  - **Breaking changes**: removed the **GRAHighRiskUser** classifier.

#### Mappers
##### The renamed incoming mapper
  - Renamed the **Gurucul-GRACases** mapper to **GRACase-mapper**.
  - **Breaking changes**: removed the **Gurucul-HighRiskUsers** mapper.

#### Incident Fields
  - **Breaking changes**: removed the **graanomalyname** incident field.
  - **Breaking changes**: removed the **graanomalyresourcename** incident field.
  - **Breaking changes**: removed the **graanomalyriskscore** incident field.
  - **Breaking changes**: removed the **graassigneetype** incident field.
  - **Breaking changes**: removed the **graentitytypeid** incident field.
  - **Breaking changes**: removed the **graownername** incident field.
  - **Breaking changes**: removed the **graownertype** incident field.
  - **Breaking changes**: removed the **grariskdate** incident field.
  - **Breaking changes**: removed the **XXXXXXX** incident field.
  - **Breaking changes**: removed the **XXXXXXX** incident field.
  - **Breaking changes**: removed the **XXXXXXX** incident field.
  - **Breaking changes**: removed the **XXXXXXX** incident field.
  - **Breaking changes**: removed the **XXXXXXX** incident field.
  - **Breaking changes**: removed the **XXXXXXX** incident field.
  - **Breaking changes**: removed the **XXXXXXX** incident field.
  - **Breaking changes**: removed the **XXXXXXX** incident field.
  - **Breaking changes**: removed the **XXXXXXX** incident field.

#### Incident Types
- Renamed the **GraHighRiskUser** incident type to **GRACase**.
- Removed the **GraCase** incident type.

#### Layouts
##### New: GRACaseLayout
- Added new layout for GRACase incident type

#### Scripts
##### New: GRAUpdateCaseStatus
- GRA Update Case Status (Available from Cortex XSOAR 5.5.0).
##### New: GRAAnalyticalFeatureDisplay
- Display GRA analytical feature on the layout (Available from Cortex XSOAR 5.5.0).

#### Integrations
##### Gurucul-GRA
- **Bug Fixes**:
  -  Fixed an issue with fetch incidents.
- **Breaking Change**:
  -  Drop-down ***Fetch Incident Command*** is removed in ***Add instance***.
  -  Drop-down ***Fetch Incident Cases*** is removed in ***Add instance***.

#### Playbooks
#### playbook is renamed
  - GRACase
#### playbook is removed
  - GRAHighRiskUser


text:
from django.utils.html import escape

from wagtail.admin.rich_text.converters import editor_html
from wagtail.documents.models import get_document_model

# hallo.js / editor-html conversion

class DocumentLinkHandler:
    @staticmethod
    def get_db_attributes(tag):
        return {'id': tag['data-id']}

    @staticmethod
    def expand_db_attributes(attrs):
        Document = get_document_model()
        try:
            doc = Document.objects.get(id=attrs['id'])
            return '' % (doc.id, escape(doc.url))
        except Document.DoesNotExist:
            # Preserve the ID attribute for troubleshooting purposes, even though it
            # points to a missing document
            return '' % attrs['id']
        except KeyError:
            return ''

EditorHTMLDocumentLinkConversionRule = [
    editor_html.LinkTypeRule('document', DocumentLinkHandler),
]


text:
package pipeline.outoforder;

import java.io.FileWriter;
import java.io.IOException;

import pipeline.ExecutionEngine;
import config.EnergyConfig;
import config.SimulationConfig;
import generic.Core;
import generic.Event;
import generic.EventQueue;
import generic.GlobalClock;
import generic.Operand;
import generic.OperandType;
import generic.OperationType;
import generic.PortType;
import generic.SimulationElement;

public class WriteBackLogic extends SimulationElement {

	Core core;
	OutOrderExecutionEngine execEngine;
	ReorderBuffer ROB;

	public WriteBackLogic(Core core, OutOrderExecutionEngine execEngine)
	{
		super(PortType.Unlimited, -1, -1, -1, -1);
		this.core = core;
		this.execEngine = execEngine;
		ROB = execEngine.getReorderBuffer();
	}

	@Override
	public void handleEvent(EventQueue eventQ, Event event) {

	}

	public void performWriteBack()
	{
		if(execEngine.isToStall5() == true /*pipeline stalled due to branch mis-prediction*/
				|| ROB.head == -1 /*ROB empty*/)
		{
			return;
		}

		int i = ROB.head;
		int noWritten = 0;

		ReorderBufferEntry[] buffer = ROB.getROB();
		do
		{
			noWritten++;

			if(buffer[i].getExecuted() == true &&
					buffer[i].isWriteBackDone() == false)
			{
				buffer[i].setWriteBackDone1(true);
				buffer[i].setWriteBackDone2(true);

				/*
				 * aiding decoded instructions that are not yet in the IW.
				 * (see WakeUpLogic.java for detailed explanation)
				 * the below code is part of the solution, the remainder is at the wake-up stage
				 */
				if(buffer[i].getInstruction().getOperationType() == OperationType.load)
				{
					WakeUpLogic.wakeUpLogic(core, buffer[i].getInstruction().getDestinationOperand().getOperandType(), buffer[i].getPhysicalDestinationRegister(), buffer[i].getThreadID(), (buffer[i].pos + 1)%ROB.MaxROBSize);
				}

				//set value valid in register file, and
				//add destination register to list of available physical registers
				if(buffer[i].getInstruction().getDestinationOperand() != null)
				{
					writeToRFAndAddToAvailableList(buffer[i].getInstruction().getDestinationOperand(),
													buffer[i].getPhysicalDestinationRegister());
				}
				else if(buffer[i].getInstruction().getOperationType() == OperationType.xchg)
				{
					writeToRFAndAddToAvailableList(buffer[i].getInstruction().getSourceOperand1(),
													buffer[i].getOperand1PhyReg1());

					if(buffer[i].getInstruction().getSourceOperand1().getOperandType() != buffer[i].getInstruction().getSourceOperand2().getOperandType() ||
							buffer[i].getOperand1PhyReg1() != buffer[i].getOperand2PhyReg1())
					{
						writeToRFAndAddToAvailableList(buffer[i].getInstruction().getSourceOperand2(),
													buffer[i].getOperand2PhyReg1());
					}
				}

				if(SimulationConfig.debugMode)
				{
					System.out.println("writeback : " + GlobalClock.getCurrentTime()/core.getStepSize() + " : " + buffer[i].getInstruction());
				}
			}

			i = (i+1)%ROB.getMaxROBSize();

		}while(i != ROB.tail && noWritten < core.getRetireWidth());
	}

	//set value valid in register file, and
	//add destination register to list of available physical registers
	private void writeToRFAndAddToAvailableList(Operand destOpnd,
												int physicalRegister)
	{
		RenameTable tempRN = null;
		if(destOpnd != null)
		{
			if(destOpnd.isIntegerRegisterOperand())
			{
				tempRN = execEngine.getIntegerRenameTable();
				if(tempRN.getMappingValid(physicalRegister) == false)
				{
					tempRN.addToAvailableList(physicalRegister);
				}
				tempRN.setValueValid(true, physicalRegister);
				execEngine.getIntegerRegisterFile().setValueValid(true, physicalRegister);
			}
			else if(destOpnd.isFloatRegisterOperand())
			{
				tempRN = execEngine.getFloatingPointRenameTable();
				if(tempRN.getMappingValid(physicalRegister) == false)
				{
					tempRN.addToAvailableList(physicalRegister);
				}
				tempRN.setValueValid(true, physicalRegister);
				execEngine.getFloatingPointRegisterFile().setValueValid(true, physicalRegister);
			}
		}
	}

}


text:
package com.sc2geeks.commons.web;

import javax.xml.namespace.NamespaceContext;
import java.util.*;

/**
 * Created by IntelliJ IDEA.
 * User: robert
 * Date: 8/22/11
 * Time: 11:35 PM
 * To change this template use File | Settings | File Templates.
 */
public class MutableNamespaceContext implements NamespaceContext
{
  private Map<String, String> map;

  public MutableNamespaceContext() {
    map = new HashMap();
  }

  public void setNamespace(String prefix, String namespaceURI) {
    map.put(prefix, namespaceURI);
  }

  public String getNamespaceURI(String prefix) {
    return map.get(prefix);
  }

  public String getPrefix(String namespaceURI) {
    for (String prefix : map.keySet()) {
      if (map.get(prefix).equals(namespaceURI)) {
        return prefix;
      }
    }
    return null;
  }

  public Iterator getPrefixes(String namespaceURI) {
    List prefixes = new ArrayList();
    for (String prefix : map.keySet()) {
      if (map.get(prefix).equals(namespaceURI)) {
        prefixes.add(prefix);
      }
    }
    return prefixes.iterator();
  }
}


text:
import Relay from 'react-relay/classic';

class EmailResendVerification extends Relay.Mutation {
  getMutation() {
    return Relay.QL`
      mutation {
        emailResendVerification
      }
    `;
  }

  getFatQuery() {
    return Relay.QL`
      fragment on EmailResendVerificationPayload {
        email
      }
    `;
  }

  getConfigs() {
    return [{
      type: 'FIELDS_CHANGE',
      fieldIDs: {
        email: this.props.email.id
      }
    }];
  }

  getVariables() {
    return { id: this.props.email.id };
  }
}

export default EmailResendVerification;


text:
<!DOCTYPE html>

	<meta charset="utf-8">
	<title>Phaser Class: Stage</title>

	<link type="text/css" rel="stylesheet" href="styles/default.css">

	<link type="text/css" rel="stylesheet" href="styles/sunlight.default.css">

	<link type="text/css" rel="stylesheet" href="styles/site.cerulean.css">

			Phaser API

					Namespaces

							Phaser

							KeyCode

							PIXI

					Classes

							Animation

							AnimationManager

							AnimationParser

							ArraySet

							ArrayUtils

							AudioSprite

							BitmapData

							BitmapText

							Button

							Cache

							Camera

							Canvas

							Circle

							Color

							Angle

							Animation

							AutoCull

							Bounds

							BringToTop

							Core

							Crop

							Delta

							Destroy

							FixedToCamera

							Health

							InCamera

							InputEnabled

							InWorld

							LifeSpan

							LoadTexture

							Overlap

							PhysicsBody

							Reset

							ScaleMinMax

							Smoothed

							Create

							Creature

							Device

							DeviceButton

							DOM

							Easing

							Back

							Bounce

							Circular

							Cubic

							Elastic

							Exponential

							Linear

							Quadratic

							Quartic

							Quintic

							Sinusoidal

							Ellipse

							Events

							Filter

							FlexGrid

							FlexLayer

							Frame

							FrameData

							Game

							GameObjectCreator

							GameObjectFactory

							Gamepad

							Graphics

							Group

							Image

							ImageCollection

							Input

							InputHandler

							Key

							Keyboard

							Line

							LinkedList

							Loader

							LoaderParser

							Math

							Matrix

							Mouse

							MSPointer

							Net

							Particle

							Particles

							Arcade

							Emitter

							Physics

							Arcade

							Body

							TilemapCollision

							Ninja

							AABB

							Body

							Circle

							Tile

							P2

							Body

							BodyDebug

							CollisionGroup

							ContactMaterial

							DistanceConstraint

							FixtureList

							GearConstraint

							InversePointProxy

							LockConstraint

							Material

							PointProxy

							PrismaticConstraint

							RevoluteConstraint

							RotationalSpring

							Spring

							Plugin

							PluginManager

							Point

							Pointer

							PointerMode

							Polygon

							QuadTree

							RandomDataGenerator

							Rectangle

							RenderTexture

							RequestAnimationFrame

							RetroFont

							Rope

							RoundedRectangle

							ScaleManager

							Signal

							SignalBinding

							SinglePad

							Sound

							SoundManager

							Sprite

							SpriteBatch

							Stage

							State

							StateManager

							Text

							Tile

							Tilemap

							TilemapLayer

							TilemapParser

							Tileset

							TileSprite

							Time

							Timer

							TimerEvent

							Touch

							Tween

							TweenData

							TweenManager

							Utils

							Debug

							Video

							World

							AbstractFilter

							BaseTexture

							CanvasBuffer

							CanvasGraphics

							CanvasMaskManager

							CanvasPool

							CanvasRenderer

							CanvasTinter

							ComplexPrimitiveShader

							DisplayObject

							DisplayObjectContainer

							EarCut

							Event

							EventTarget

							FilterTexture

							Graphics

							GraphicsData

							PIXI

							PixiFastShader

							PixiShader

							PolyK

							PrimitiveShader

							RenderTexture

							Rope

							Sprite

							SpriteBatch

							Strip

							StripShader

							Texture

							TilingSprite

							WebGLBlendModeManager

							WebGLFastSpriteBatch

							WebGLFilterManager

							WebGLRenderer

					Global

							AUTO

							BITMAPDATA

							BITMAPTEXT

							blendModes

							BUTTON

							CANVAS

							CANVAS_FILTER

							CIRCLE

							CREATURE

							DOWN

							ELLIPSE

							EMITTER

							GAMES

							GRAPHICS

							GROUP

							HEADLESS

							IMAGE

							LEFT

							LINE

							MATRIX

							NONE

							PENDING_ATLAS

							POINT

							POINTER

							POLYGON

							RECTANGLE

							RENDERTEXTURE

							RETROFONT

							RIGHT

							ROPE

							ROUNDEDRECTANGLE

							scaleModes

							SPRITE

							SPRITEBATCH

							TEXT

							TILEMAP

							TILEMAPLAYER

							TILESPRITE

							UP

							VERSION

							VIDEO

							WEBGL

							WEBGL_FILTER

					Core

Game

Group

World

Loader

Cache

Time

Camera

State Manager

Tween Manager

Sound Manager

Input Manager

Scale Manager

					Game Objects

Factory (game.add)

Creator (game.make)

Sprite

Image

Sound

Video

Particle Emitter

Particle

Text

Tween

BitmapText

Tilemap

BitmapData

RetroFont

Button

Animation

Graphics

RenderTexture

TileSprite

					Geometry

Circle

Ellipse

Line

Matrix

Point

Polygon

Rectangle

Rounded Rectangle

					Physics

Arcade Physics

Body

P2 Physics

Body

Spring

CollisionGroup

ContactMaterial

Ninja Physics

Body

					Input

Input Handler

Pointer

Device Button

Mouse

Keyboard

Key

Gamepad

					Community

Phaser Web Site

Phaser Github

Phaser Examples

Phaser Plugins

Forum

Stack Overflow

Tutorials

Newsletter

Twitter

IRC

Texture Packer

        Phaser.

    Stage

new Stage(game)

The Stage controls root level display objects upon which everything is displayed.
It also handles browser visibility handling and the pausing due to loss of focus.

Parameters:

		Name

		Type

		Description

                game

Phaser.Game

Game reference to the currently running game.

Source -
    core/Stage.js, line 16

Extends

PIXI.DisplayObjectContainer

Members

alpha :Number

The opacity of the object.

Inherited From:

        PIXI.DisplayObject#alpha

Source -
    pixi/display/DisplayObject.js, line 46

backgroundColor :number|string

Gets and sets the background color of the stage. The color can be given as a number: 0xff0000 or a hex string: '#ff0000'

Type:

number
|

string

Source -
    core/Stage.js, line 374

cacheAsBitmap :Boolean

Set if this display object is cached as a bitmap.
This basically takes a snap shot of the display object as it is at that moment. It can provide a performance benefit for complex static displayObjects.
To remove simply set this property to 'null'

Inherited From:

        PIXI.DisplayObject#cacheAsBitmap

Source -
    pixi/display/DisplayObject.js, line 355

<readonly> children :Array.<DisplayObject>

[read-only] The array of children of this container.

Type:

Array.<DisplayObject>

Inherited From:

        PIXI.DisplayObjectContainer#children

Source -
    pixi/display/DisplayObjectContainer.js, line 17

currentRenderOrderID :number

Reset each frame, keeps a count of the total number of objects updated.

Source -
    core/Stage.js, line 65

disableVisibilityChange :boolean

By default if the browser tab loses focus the game will pause.
You can stop that behavior by setting this property to true.
Note that the browser can still elect to pause your game if it wishes to do so,
for example swapping to another browser tab. This will cause the RAF callback to halt,
effectively pausing your game, even though no in-game pause event is triggered if you enable this property.

Source -
    core/Stage.js, line 40

exists :boolean

If exists is true the Stage and all children are updated, otherwise it is skipped.

Default Value:

true

Source -
    core/Stage.js, line 46

filterArea :Rectangle

The area the filter is applied to like the hitArea this is used as more of an optimisation
rather than figuring out the dimensions of the displayObject each frame you can set this rectangle

Inherited From:

        PIXI.DisplayObject#filterArea

Source -
    pixi/display/DisplayObject.js, line 164

filters :Array.<Filter>

Sets the filters for the displayObject.
IMPORTANT: This is a webGL only feature and will be ignored by the Canvas renderer.

To remove filters simply set this property to 'null'.

You cannot have a filter and a multiply blend mode active at the same time. Setting a filter will reset
this objects blend mode to NORMAL.

Type:

Array.<Filter>

Inherited From:

        PIXI.DisplayObject#filters

Source -
    pixi/display/DisplayObject.js, line 307

game :Phaser.Game

A reference to the currently running Game.

Source -
    core/Stage.js, line 21

height :Number

The height of the displayObjectContainer, setting this will actually modify the scale to achieve the value set

Inherited From:

        PIXI.DisplayObjectContainer#height

Source -
    pixi/display/DisplayObjectContainer.js, line 61

hitArea :Rectangle|Circle|Ellipse|Polygon

This is the defined area that will pick up mouse / touch events. It is null by default.
Setting it is a neat way of optimising the hitTest function that the interactionManager will use (as it will not need to hit test all the children)

Type:

Rectangle
|

Circle
|

Ellipse
|

Polygon

Inherited From:

        PIXI.DisplayObject#hitArea

Source -
    pixi/display/DisplayObject.js, line 62

mask :PIXI.Graphics

Sets a mask for the displayObject. A mask is an object that limits the visibility of an object to the shape of the mask applied to it.
In PIXI a regular mask must be a PIXI.Graphics object. This allows for much faster masking in canvas as it utilises shape clipping.
To remove a mask, set this property to null.

Inherited From:

        PIXI.DisplayObject#mask

Source -
    pixi/display/DisplayObject.js, line 282

name :string

The name of this object.

Default Value:

_stage_root

Source -
    core/Stage.js, line 29

<readonly> parent :PIXI.DisplayObjectContainer

[read-only] The display object container that contains this display object.

Inherited From:

        PIXI.DisplayObject#parent

Source -
    pixi/display/DisplayObject.js, line 79

pivot :Point

The pivot point of the displayObject that it rotates around

Inherited From:

        PIXI.DisplayObject#pivot

Source -
    pixi/display/DisplayObject.js, line 30

position :Point

The coordinate of the object relative to the local coordinates of the parent.

Inherited From:

        PIXI.DisplayObject#position

Source -
    pixi/display/DisplayObject.js, line 14

renderable :Boolean

Can this object be rendered

Inherited From:

        PIXI.DisplayObject#renderable

Source -
    pixi/display/DisplayObject.js, line 71

rotation :Number

The rotation of the object in radians.

Inherited From:

        PIXI.DisplayObject#rotation

Source -
    pixi/display/DisplayObject.js, line 38

scale :Point

The scale factor of the object.

Inherited From:

        PIXI.DisplayObject#scale

Source -
    pixi/display/DisplayObject.js, line 22

smoothed :boolean

Enable or disable texture smoothing for all objects on this Stage. Only works for bitmap/image textures. Smoothing is enabled by default. Set to true to smooth all sprites rendered on this Stage, or false to disable smoothing (great for pixel art)

Source -
    core/Stage.js, line 394

visible :Boolean

The visibility of the object.

Inherited From:

        PIXI.DisplayObject#visible

Source -
    pixi/display/DisplayObject.js, line 54

width :Number

The width of the displayObjectContainer, setting this will actually modify the scale to achieve the value set

Inherited From:

        PIXI.DisplayObjectContainer#width

Source -
    pixi/display/DisplayObjectContainer.js, line 32

<readonly> worldAlpha :Number

[read-only] The multiplied alpha of the displayObject

Inherited From:

        PIXI.DisplayObject#worldAlpha

Source -
    pixi/display/DisplayObject.js, line 97

<readonly> worldPosition :Point

The position of the Display Object based on the world transform.
This value is updated at the end of updateTransform and takes all parent transforms into account.

Inherited From:

        PIXI.DisplayObject#worldPosition

Source -
    pixi/display/DisplayObject.js, line 116

<readonly> worldRotation :Number

The rotation of the Display Object, in radians, based on the world transform.
This value is updated at the end of updateTransform and takes all parent transforms into account.

Inherited From:

        PIXI.DisplayObject#worldRotation

Source -
    pixi/display/DisplayObject.js, line 136

<readonly> worldScale :Point

The scale of the Display Object based on the world transform.
This value is updated at the end of updateTransform and takes all parent transforms into account.

Inherited From:

        PIXI.DisplayObject#worldScale

Source -
    pixi/display/DisplayObject.js, line 126

worldVisible :Boolean

[read-only] Indicates if the sprite is globally visible.

Inherited From:

        PIXI.DisplayObject#worldVisible

Source -
    pixi/display/DisplayObject.js, line 258

x :Number

The position of the displayObject on the x axis relative to the local coordinates of the parent.

Inherited From:

        PIXI.DisplayObject#x

Source -
    pixi/display/DisplayObject.js, line 723

y :Number

The position of the displayObject on the y axis relative to the local coordinates of the parent.

Inherited From:

        PIXI.DisplayObject#y

Source -
    pixi/display/DisplayObject.js, line 741

Methods

addChild(child) → {PIXI.DisplayObject}

Adds a child to the container.

Parameters:

		Name

		Type

		Description

                child

PIXI.DisplayObject

The DisplayObject to add to the container

Returns:

PIXI.DisplayObject

 -

The child that was added.

Inherited From:

        PIXI.DisplayObjectContainer#addChild

Source -
    pixi/display/DisplayObjectContainer.js, line 91

addChildAt(child, index) → {PIXI.DisplayObject}

Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

Parameters:

		Name

		Type

		Description

                child

PIXI.DisplayObject

The child to add

                index

Number

The index to place the child in

Returns:

PIXI.DisplayObject

 -

The child that was added.

Inherited From:

        PIXI.DisplayObjectContainer#addChildAt

Source -
    pixi/display/DisplayObjectContainer.js, line 103

checkVisibility()

Starts a page visibility event listener running, or window.onpagehide/onpageshow if not supported by the browser.
Also listens for window.onblur and window.onfocus.

Source -
    core/Stage.js, line 229

destroy()

Destroys the Stage and removes event listeners.

Source -
    core/Stage.js, line 354

generateTexture(resolution, scaleMode, renderer) → {PIXI.Texture}

Useful function that returns a texture of the displayObject object that can then be used to create sprites
This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times.

Parameters:

		Name

		Type

		Description

                resolution

Number

The resolution of the texture being generated

                scaleMode

Number

See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values

                renderer

PIXI.CanvasRenderer
|

PIXI.WebGLRenderer

The renderer used to generate the texture.

Returns:

PIXI.Texture

 -

a texture of the graphics object

Inherited From:

        PIXI.DisplayObject#generateTexture

Source -
    pixi/display/DisplayObject.js, line 542

getBounds() → {Rectangle}

Retrieves the bounds of the displayObjectContainer as a rectangle. The bounds calculation takes all visible children into consideration.

Returns:

Rectangle

 -

The rectangular bounding area

Inherited From:

        PIXI.DisplayObjectContainer#getBounds

Source -
    pixi/display/DisplayObjectContainer.js, line 307

getChildAt(index) → {PIXI.DisplayObject}

Returns the child at the specified index

Parameters:

		Name

		Type

		Description

                index

Number

The index to get the child from

Returns:

PIXI.DisplayObject

 -

The child at the given index, if any.

Inherited From:

        PIXI.DisplayObjectContainer#getChildAt

Source -
    pixi/display/DisplayObjectContainer.js, line 194

getChildIndex(child) → {Number}

Returns the index position of a child DisplayObject instance

Parameters:

		Name

		Type

		Description

                child

PIXI.DisplayObject

The DisplayObject instance to identify

Returns:

Number

 -

The index position of the child display object to identify

Inherited From:

        PIXI.DisplayObjectContainer#getChildIndex

Source -
    pixi/display/DisplayObjectContainer.js, line 159

getLocalBounds() → {Rectangle}

Retrieves the non-global local bounds of the displayObjectContainer as a rectangle. The calculation takes all visible children into consideration.

Returns:

Rectangle

 -

The rectangular bounding area

Inherited From:

        PIXI.DisplayObjectContainer#getLocalBounds

Source -
    pixi/display/DisplayObjectContainer.js, line 367

<internal> parseConfig(config)

Parses a Game configuration object.

Parameters:

		Name

		Type

		Description

                config

object

The configuration object to parse.

Internal:

This member is internal (protected) and may be modified or removed in the future.

Source -
    core/Stage.js, line 101

postUpdate()

This is called automatically before the renderer runs and after the plugins have updated.
In postUpdate this is where all the final physics calculatations and object positioning happens.
The objects are processed in the order of the display list.
The only exception to this is if the camera is following an object, in which case that is updated first.

Source -
    core/Stage.js, line 172

preUpdate()

This is called automatically after the plugins preUpdate and before the State.update.
Most objects have preUpdate methods and it's where initial movement and positioning is done.

Source -
    core/Stage.js, line 138

removeChild(child) → {PIXI.DisplayObject}

Removes a child from the container.

Parameters:

		Name

		Type

		Description

                child

PIXI.DisplayObject

The DisplayObject to remove

Returns:

PIXI.DisplayObject

 -

The child that was removed.

Inherited From:

        PIXI.DisplayObjectContainer#removeChild

Source -
    pixi/display/DisplayObjectContainer.js, line 211

removeChildAt(index) → {PIXI.DisplayObject}

Removes a child from the specified index position.

Parameters:

		Name

		Type

		Description

                index

Number

The index to get the child from

Returns:

PIXI.DisplayObject

 -

The child that was removed.

Inherited From:

        PIXI.DisplayObjectContainer#removeChildAt

Source -
    pixi/display/DisplayObjectContainer.js, line 226

removeChildren(beginIndex, endIndex)

Removes all children from this container that are within the begin and end indexes.

Parameters:

		Name

		Type

		Description

                beginIndex

Number

The beginning position. Default value is 0.

                endIndex

Number

The ending position. Default value is size of the container.

Inherited From:

        PIXI.DisplayObjectContainer#removeChildren

Source -
    pixi/display/DisplayObjectContainer.js, line 244

removeStageReference()

Removes the current stage reference from the container and all of its children.

Inherited From:

        PIXI.DisplayObjectContainer#removeStageReference

Source -
    pixi/display/DisplayObjectContainer.js, line 407

setBackgroundColor(color)

Sets the background color for the Stage.

The color can be given as a hex string ('#RRGGBB'), a CSS color string ('rgb(r,g,b)'), or a numeric value (0xRRGGBB).

An alpha channel is not supported and will be ignored.

If you've set your game to be transparent then calls to setBackgroundColor are ignored.

Parameters:

		Name

		Type

		Description

                color

number
|

string

The color of the background.

Source -
    core/Stage.js, line 327

setChildIndex(child, index)

Changes the position of an existing child in the display object container

Parameters:

		Name

		Type

		Description

                child

PIXI.DisplayObject

The child DisplayObject instance for which you want to change the index number

                index

Number

The resulting index number for the child display object

Inherited From:

        PIXI.DisplayObjectContainer#setChildIndex

Source -
    pixi/display/DisplayObjectContainer.js, line 176

setStageReference(stage)

Sets the containers Stage reference. This is the Stage that this object, and all of its children, is connected to.

Parameters:

		Name

		Type

		Description

                stage

Stage

the stage that the container will have as its current stage reference

Inherited From:

        PIXI.DisplayObjectContainer#setStageReference

Source -
    pixi/display/DisplayObjectContainer.js, line 391

swapChildren(child, child2)

Swaps the position of 2 Display Objects within this container.

Parameters:

		Name

		Type

		Description

                child

PIXI.DisplayObject

-

                child2

PIXI.DisplayObject

-

Inherited From:

        PIXI.DisplayObjectContainer#swapChildren

Source -
    pixi/display/DisplayObjectContainer.js, line 134

toGlobal(position) → {Point}

Calculates the global position of the display object

Parameters:

		Name

		Type

		Description

                position

Point

The world origin to calculate from

Returns:

Point

 -

A point object representing the position of this object

Inherited From:

        PIXI.DisplayObject#toGlobal

Source -
    pixi/display/DisplayObject.js, line 576

toLocal(position, from) → {Point}

Calculates the local position of the display object relative to another point

Parameters:

		Name

		Type

		Argument

		Description

                position

Point

The world origin to calculate from

                from

PIXI.DisplayObject

                    <optional>

The DisplayObject to calculate the global position from

Returns:

Point

 -

A point object representing the position of this object

Inherited From:

        PIXI.DisplayObject#toLocal

Source -
    pixi/display/DisplayObject.js, line 590

update()

This is called automatically after the State.update, but before particles or plugins update.

Source -
    core/Stage.js, line 156

updateCache()

Generates and updates the cached sprite for this object.

Inherited From:

        PIXI.DisplayObject#updateCache

Source -
    pixi/display/DisplayObject.js, line 566

updateTransform()

Updates the transforms for all objects on the display list.
This overrides the Pixi default as we don't need the interactionManager, but do need the game property check.

Source -
    core/Stage.js, line 212

visibilityChange(event)

This method is called when the document visibility is changed.

Parameters:

		Name

		Type

		Description

                event

Event

Its type will be used to decide whether the game should be paused or not.

Source -
    core/Stage.js, line 289

		Phaser Copyright © 2012-2015 Photon Storm Ltd.

		Documentation generated by JSDoc 3.3.2
		on Thu Feb 18 2016 14:41:07 GMT+0000 (GMT Standard Time) using the DocStrap template.


text:
namespace dukat
{
	// Required definitions
	constexpr int Renderer3::fbo_size;

	Renderer3::Renderer3(Window* window, ShaderCache* shader_cache, TextureCache* textures)
		: Renderer(window, shader_cache), effects_enabled(false)
	{
		// Enable transparency
		set_blending(true);
		glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
		// Enable depth buffer
		glEnable(GL_DEPTH_TEST);
		glDepthFunc(GL_LEQUAL);

#if OPENGL_CORE >= 31
		// Enable primitive restart - only available in OpenGL >= 3.1
		glEnable(GL_PRIMITIVE_RESTART);
		glPrimitiveRestartIndex(primitive_restart);
#elif OPENGL_ES >= 30
		// Enable primitive restart using -1 as fixed index.
		// More specifically, the restart index will be:
		// GL_UNSIGNED_BYTE (2^8-1), GL_UNSIGNED_SHORT (2^16-1), GL_UNSIGNED_INT (2^32-1)
		glEnable(GL_PRIMITIVE_RESTART_FIXED_INDEX);
#endif

#if OPENGL_VERSION >= 30
		fb0 = std::make_unique<FrameBuffer>(window->get_width(), window->get_height(), true, true);
		fb1 = std::make_unique<FrameBuffer>(fbo_size, fbo_size, true, false);
		fb2 = std::make_unique<FrameBuffer>(fbo_size, fbo_size, true, false);
		MeshBuilder2 builder;
		quad = builder.build_textured_quad();
		composite_program = shader_cache->get_program("fx_default.vsh", "fx_composite.fsh");
#endif

		gl_check_error();
		init_lights();
	}

	void Renderer3::init_lights(void)
	{
		for (int i = 0; i < num_lights; i++)
		{
			lights[i].position = Vector3{ 0.0f, 0.0f, 0.0f };
			lights[i].ambient = Color{ 0.0f, 0.0f, 0.0f, 0.0f };
			lights[i].diffuse = Color{ 0.0f, 0.0f, 0.0f, 0.0f };
			lights[i].specular = Color{ 0.0f, 0.0f, 0.0f, 0.0f };
			lights[i].k0 = 1.0f;
			lights[i].k1 = 0.0f;
			lights[i].k2 = 0.0f;
		}
	}

	void Renderer3::switch_fbo(void)
	{
		// set input texture
		glActiveTexture(GL_TEXTURE0);
		glBindTexture(GL_TEXTURE_2D, frame_buffer->texture->id);

		if (frame_buffer == fb1.get())
		{
			fb2->bind();
			frame_buffer = fb2.get();
		}
		else
		{
			fb1->bind();
			frame_buffer = fb1.get();
		}

		glClear(GL_COLOR_BUFFER_BIT);
	}

	void Renderer3::resize_window(int w, int h)
	{
		Renderer::resize_window(w, h);
		if (camera)
			camera->resize(w, h);
	}

	void Renderer3::render(const std::vector<Mesh*>& meshes)
	{
#if OPENGL_VERSION >= 30
		// Update uniform buffers once per frame.
		update_uniforms();

		if (effects_enabled)
		{
			fb0->bind();
			frame_buffer = fb0.get();
		}
#endif

		clear();
#ifdef OPENGL_CORE
		if (show_wireframe)
			glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
#endif
		// Scene pass
		glEnable(GL_DEPTH_TEST);

		for (auto& it : meshes)
		{
			if (it->visible && it->stage == RenderStage::Scene)
			{
				it->render(this);
			}
		}

#ifdef OPENGL_CORE
		if (show_wireframe)
			glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
#endif

		// Effects pass
		glDisable(GL_DEPTH_TEST);

#if OPENGL_VERSION >= 30
		if (effects_enabled)
		{
			// TODO: review how useful this is - effects passes are currently using fixed
			// size texture
			// Effects passes
			for (auto it = effects.begin(); it != effects.end(); ++it)
			{
				switch_fbo();
				switch_shader(it->program);
				glUniform1i(it->program->attr(Renderer::uf_tex0), 0);
				for (auto it2 : it->parameters)
				{
					switch (it2.second.count)
					{
					case 1:
						glUniform1fv(it->program->attr(it2.first), 1, it2.second.values);
						break;
					case 2:
						glUniform2fv(it->program->attr(it2.first), 1, it2.second.values);
						break;
					case 3:
						glUniform3fv(it->program->attr(it2.first), 1, it2.second.values);
						break;
					case 4:
						glUniform4fv(it->program->attr(it2.first), 1, it2.second.values);
						break;
					}
				}
				quad->render(it->program);
			}

			// Composite pass
			glBindFramebuffer(GL_FRAMEBUFFER, 0);
			reset_viewport();
			glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

			glActiveTexture(GL_TEXTURE0);
			glBindTexture(GL_TEXTURE_2D, fb0->texture->id);
			glActiveTexture(GL_TEXTURE1);
			glBindTexture(GL_TEXTURE_2D, frame_buffer->texture->id);

			switch_shader(composite_program);
			glUniform1i(composite_program->attr(Renderer::uf_tex0), 0);
			glUniform1i(composite_program->attr(Renderer::uf_tex1), 1);
			glUniform1f(composite_program->attr("u_scale"), 0.0f);

			quad->render(composite_program);

			// reset texture units
			glActiveTexture(GL_TEXTURE0);
		}
#endif

		// Overlay pass
		for (auto& it : meshes)
		{
			if (it->visible && it->stage == RenderStage::Overlay)
			{
				it->render(this);
			}
		}

        window->present();

#if OPENGL_VERSION < 30
		// invalidate active program to force uniforms rebind during
		// next frame
		active_program = 0;
#endif
	}

	void Renderer3::update_uniforms(void)
	{
#if OPENGL_VERSION >= 30
		// Update uniform buffers
		glBindBufferBase(GL_UNIFORM_BUFFER, static_cast<GLuint>(UniformBuffer::Camera), uniform_buffers->buffers[static_cast<int>(UniformBuffer::Camera)]);
		glBufferData(GL_UNIFORM_BUFFER, sizeof(CameraTransform3), &camera->transform, GL_STREAM_DRAW);
		glBindBufferBase(GL_UNIFORM_BUFFER, static_cast<GLuint>(UniformBuffer::Light), uniform_buffers->buffers[static_cast<int>(UniformBuffer::Light)]);
		glBufferData(GL_UNIFORM_BUFFER, num_lights * sizeof(Light3), &lights, GL_STREAM_DRAW);
#else
		// Update individual uniforms.
		glUniformMatrix4fv(active_program->attr(Renderer3::u_cam_proj_pers), 1, false, camera->transform.mat_proj_pers.m);
		glUniformMatrix4fv(active_program->attr(Renderer3::u_cam_proj_orth), 1, false, camera->transform.mat_proj_orth.m);
		glUniformMatrix4fv(active_program->attr(Renderer3::u_cam_view), 1, false, camera->transform.mat_view.m);
		glUniformMatrix4fv(active_program->attr(Renderer3::u_cam_view_inv), 1, false, camera->transform.mat_view.m);
		glUniform4fv(active_program->attr(Renderer3::u_cam_position), 1, (GLfloat*)(&camera->transform.position));
		glUniform4fv(active_program->attr(Renderer3::u_cam_dir), 1, (GLfloat*)(&camera->transform.dir));
		glUniform4fv(active_program->attr(Renderer3::u_cam_up), 1, (GLfloat*)(&camera->transform.up));
		glUniform4fv(active_program->attr(Renderer3::u_cam_left), 1, (GLfloat*)(&camera->transform.right));
		// Bind light information
		for (auto i = 0; i < num_lights; i++)
		{
			const auto& light = lights[i];
			const auto light_index = GL_LIGHT0 + i;
			glLightfv(light_index, GL_POSITION, (GLfloat*)(&light.position));
			glLightfv(light_index, GL_AMBIENT, (GLfloat*)(&light.ambient));
			glLightfv(light_index, GL_DIFFUSE, (GLfloat*)(&light.diffuse));
			glLightfv(light_index, GL_SPECULAR, (GLfloat*)(&light.specular));
			glLightf(light_index, GL_CONSTANT_ATTENUATION, light.k0);
			glLightf(light_index, GL_LINEAR_ATTENUATION, light.k1);
			glLightf(light_index, GL_QUADRATIC_ATTENUATION, light.k2);
		}
#endif
	}

	void Renderer3::add_effect(int index, const Effect3& effect)
	{
		int i = 0;
		for (auto it = effects.begin(); it != effects.end(); ++it, i++)
		{
			if (i == index)
			{
				effects.insert(it, effect);
				return;
			}
		}
		effects.push_back(effect);
	}
}


text:
package org.apache.hadoop.fs.ozone;

import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.ozone.OzoneConsts;
import org.junit.Assert;
import org.junit.Test;

import java.io.IOException;

/**
 * Ozone file system tests that are not covered by contract tests.
 */
public class TestOzoneFileSystem {

  @Test
  public void testOzoneFsServiceLoader() throws IOException {
    Assert.assertEquals(
        FileSystem.getFileSystemClass(OzoneConsts.OZONE_URI_SCHEME, null),
        OzoneFileSystem.class);
  }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.gooday.mapper.student.StudentMapper">
  <resultMap id="BaseResultMap" type="com.gooday.model.student.Student">
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="name" jdbcType="VARCHAR" property="name" />
    <result column="sex" jdbcType="BIT" property="sex" />
    <result column="birthday" jdbcType="INTEGER" property="birthday" />
    <result column="enrollment_date" jdbcType="INTEGER" property="enrollmentDate" />
    <result column="gmt_create" jdbcType="INTEGER" property="gmtCreate" />
    <result column="gmt_modified" jdbcType="INTEGER" property="gmtModified" />
    <result column="create_by" jdbcType="VARCHAR" property="createBy" />
    <result column="modified_by" jdbcType="VARCHAR" property="modifiedBy" />
  </resultMap>
  <sql id="Base_Column_List">
    id, name, sex, birthday, enrollment_date, gmt_create, gmt_modified, create_by, modified_by
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
    select
    <include refid="Base_Column_List" />
    from student
    where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    delete from student
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <insert id="insert" parameterType="com.gooday.model.student.Student">
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into student (name, sex, birthday,
      enrollment_date, gmt_create, gmt_modified,
      create_by, modified_by)
    values (#{name,jdbcType=VARCHAR}, #{sex,jdbcType=BIT}, #{birthday,jdbcType=INTEGER},
      #{enrollmentDate,jdbcType=INTEGER}, #{gmtCreate,jdbcType=INTEGER}, #{gmtModified,jdbcType=INTEGER},
      #{createBy,jdbcType=VARCHAR}, #{modifiedBy,jdbcType=VARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="com.gooday.model.student.Student">
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into student
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="name != null">
        name,
      </if>
      <if test="sex != null">
        sex,
      </if>
      <if test="birthday != null">
        birthday,
      </if>
      <if test="enrollmentDate != null">
        enrollment_date,
      </if>
      <if test="gmtCreate != null">
        gmt_create,
      </if>
      <if test="gmtModified != null">
        gmt_modified,
      </if>
      <if test="createBy != null">
        create_by,
      </if>
      <if test="modifiedBy != null">
        modified_by,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="name != null">
        #{name,jdbcType=VARCHAR},
      </if>
      <if test="sex != null">
        #{sex,jdbcType=BIT},
      </if>
      <if test="birthday != null">
        #{birthday,jdbcType=INTEGER},
      </if>
      <if test="enrollmentDate != null">
        #{enrollmentDate,jdbcType=INTEGER},
      </if>
      <if test="gmtCreate != null">
        #{gmtCreate,jdbcType=INTEGER},
      </if>
      <if test="gmtModified != null">
        #{gmtModified,jdbcType=INTEGER},
      </if>
      <if test="createBy != null">
        #{createBy,jdbcType=VARCHAR},
      </if>
      <if test="modifiedBy != null">
        #{modifiedBy,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.gooday.model.student.Student">
    update student
    <set>
      <if test="name != null">
        name = #{name,jdbcType=VARCHAR},
      </if>
      <if test="sex != null">
        sex = #{sex,jdbcType=BIT},
      </if>
      <if test="birthday != null">
        birthday = #{birthday,jdbcType=INTEGER},
      </if>
      <if test="enrollmentDate != null">
        enrollment_date = #{enrollmentDate,jdbcType=INTEGER},
      </if>
      <if test="gmtCreate != null">
        gmt_create = #{gmtCreate,jdbcType=INTEGER},
      </if>
      <if test="gmtModified != null">
        gmt_modified = #{gmtModified,jdbcType=INTEGER},
      </if>
      <if test="createBy != null">
        create_by = #{createBy,jdbcType=VARCHAR},
      </if>
      <if test="modifiedBy != null">
        modified_by = #{modifiedBy,jdbcType=VARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.gooday.model.student.Student">
    update student
    set name = #{name,jdbcType=VARCHAR},
      sex = #{sex,jdbcType=BIT},
      birthday = #{birthday,jdbcType=INTEGER},
      enrollment_date = #{enrollmentDate,jdbcType=INTEGER},
      gmt_create = #{gmtCreate,jdbcType=INTEGER},
      gmt_modified = #{gmtModified,jdbcType=INTEGER},
      create_by = #{createBy,jdbcType=VARCHAR},
      modified_by = #{modifiedBy,jdbcType=VARCHAR}
    where id = #{id,jdbcType=BIGINT}
  </update>
</mapper>


text:
module Basher
  module UI
    class BaseView < Curtis::View

      attr_accessor :should_redraw

      def initialize
        self.should_redraw = false
        super
      end

      def will_resize!
        self.should_redraw = true
      end

      def resize_and_reposition
        reposition
        resize
        self.should_redraw = false
      end

      def clear(also_thread = true)
        clear_thread! if also_thread
        window.clear
      end
    end
  end
end


text:
namespace nacl {
class DescWrapper;
class DescWrapperFactory;
}  // namespace nacl

namespace pp {
class CompletionCallback;
class URLLoader;
class URLUtil_Dev;
}

namespace plugin {

class ErrorInfo;
class Manifest;

int32_t ConvertFileDescriptor(PP_FileHandle handle);

const PP_NaClFileInfo kInvalidNaClFileInfo = {
  PP_kInvalidFileHandle,
  0,  // token_lo
  0,  // token_hi
};

class Plugin : public pp::Instance {
 public:
  explicit Plugin(PP_Instance instance);

  // ----- Methods inherited from pp::Instance:

  // Initializes this plugin with <embed/object ...> tag attribute count |argc|,
  // names |argn| and values |argn|. Returns false on failure.
  // Gets called by the browser right after New().
  virtual bool Init(uint32_t argc, const char* argn[], const char* argv[]);

  // Handles document load, when the plugin is a MIME type handler.
  virtual bool HandleDocumentLoad(const pp::URLLoader& url_loader);

  // Load support.
  //
  // Starts NaCl module but does not wait until low-level
  // initialization (e.g. ld.so dynamic loading of manifest files) is
  // done.  The module will become ready later, asynchronously.  Other
  // event handlers should block until the module is ready before
  // trying to communicate with it, i.e., until nacl_ready_state is
  // DONE.
  //
  // NB: currently we do not time out, so if the untrusted code
  // does not signal that it is ready, then we will deadlock the main
  // thread of the renderer on this subsequent event delivery.  We
  // should include a time-out at which point we declare the
  // nacl_ready_state to be done, and let the normal crash detection
  // mechanism(s) take over.
  void LoadNaClModule(PP_NaClFileInfo file_info,
                      bool uses_nonsfi_mode,
                      bool enable_dyncode_syscalls,
                      bool enable_exception_handling,
                      bool enable_crash_throttling,
                      const pp::CompletionCallback& init_done_cb,
                      const pp::CompletionCallback& crash_cb);

  // Finish hooking interfaces up, after low-level initialization is
  // complete.
  bool LoadNaClModuleContinuationIntern();

  // Continuation for starting SRPC/JSProxy services as appropriate.
  // This is invoked as a callback when the NaCl module makes the
  // init_done reverse RPC to tell us that low-level initialization
  // such as ld.so processing is done.  That initialization requires
  // that the main thread be free in order to do Pepper
  // main-thread-only operations such as file processing.
  bool LoadNaClModuleContinuation(int32_t pp_error);

  // Load support.
  // A helper SRPC NaCl module can be loaded given a PP_NaClFileInfo.
  // Blocks until the helper module signals initialization is done.
  // Does not update nacl_module_origin().
  // Returns NULL or the NaClSubprocess of the new helper NaCl module.
  NaClSubprocess* LoadHelperNaClModule(const nacl::string& helper_url,
                                       PP_NaClFileInfo file_info,
                                       ErrorInfo* error_info);

  // Report an error that was encountered while loading a module.
  void ReportLoadError(const ErrorInfo& error_info);

  nacl::DescWrapperFactory* wrapper_factory() const { return wrapper_factory_; }

  // A helper function that indicates if |url| can be requested by the document
  // under the same-origin policy. Strictly speaking, it may be possible for the
  // document to request the URL using CORS even if this function returns false.
  bool DocumentCanRequest(const std::string& url);

  // set_exit_status may be called off the main thread.
  void set_exit_status(int exit_status);

  const PPB_NaCl_Private* nacl_interface() const { return nacl_interface_; }
  pp::UMAPrivate& uma_interface() { return uma_interface_; }

 private:
  NACL_DISALLOW_COPY_AND_ASSIGN(Plugin);
  // The browser will invoke the destructor via the pp::Instance
  // pointer to this object, not from base's Delete().
  ~Plugin();

  // Shuts down socket connection, service runtime, and receive thread,
  // in this order, for the main nacl subprocess.
  void ShutDownSubprocesses();

  // Histogram helper functions, internal to Plugin so they can use
  // uma_interface_ normally.
  void HistogramTimeSmall(const std::string& name, int64_t ms);

  // Load a nacl module from the file specified in file_info.
  // Only to be used from a background (non-main) thread for the PNaCl
  // translator. This will fully initialize the |subprocess| if the load was
  // successful.
  bool LoadHelperNaClModule(PP_NaClFileInfo file_info,
                            NaClSubprocess* subprocess,
                            const SelLdrStartParams& params);

  // Start sel_ldr from the main thread, given the start params.
  // |pp_error| is set by CallOnMainThread (should be PP_OK).
  void StartSelLdrOnMainThread(int32_t pp_error,
                               ServiceRuntime* service_runtime,
                               const SelLdrStartParams& params,
                               pp::CompletionCallback callback);

  // Signals that StartSelLdr has finished.
  // This is invoked on the main thread.
  void SignalStartSelLdrDone(int32_t pp_error,
                             bool* started,
                             ServiceRuntime* service_runtime);

  // This is invoked on the main thread.
  void LoadNexeAndStart(int32_t pp_error,
                        ServiceRuntime* service_runtime,
                        PP_NaClFileInfo file_info);

  // Callback used when getting the URL for the .nexe file.  If the URL loading
  // is successful, the file descriptor is opened and can be passed to sel_ldr
  // with the sandbox on.
  void NexeFileDidOpen(int32_t pp_error);
  void NexeFileDidOpenContinuation(int32_t pp_error);

  // Callback used when the reverse channel closes.  This is an
  // asynchronous event that might turn into a JavaScript error or
  // crash event -- this is controlled by the two state variables
  // nacl_ready_state_ and nexe_error_reported_: If an error or crash
  // had already been reported, no additional crash event is
  // generated.  If no error has been reported but nacl_ready_state_
  // is not DONE, then the loadend event has not been reported, and we
  // enqueue an error event followed by loadend.  If nacl_ready_state_
  // is DONE, then we are in the post-loadend (we need temporal
  // predicate symbols), and we enqueue a crash event.
  void NexeDidCrash(int32_t pp_error);

  // Callback used when a .nexe is translated from bitcode.  If the translation
  // is successful, the file descriptor is opened and can be passed to sel_ldr
  // with the sandbox on.
  void BitcodeDidTranslate(int32_t pp_error);
  void BitcodeDidTranslateContinuation(int32_t pp_error);

  // NaCl ISA selection manifest file support.  The manifest file is specified
  // using the "nacl" attribute in the <embed> tag.  First, the manifest URL (or
  // data: URI) is fetched, then the JSON is parsed.  Once a valid .nexe is
  // chosen for the sandbox ISA, any current service runtime is shut down, the
  // .nexe is loaded and run.

  // Callback used when getting the manifest file as a local file descriptor.
  void NaClManifestFileDidOpen(int32_t pp_error);

  // Processes the JSON manifest string and starts loading the nexe.
  void ProcessNaClManifest(const nacl::string& manifest_json);

  void SetExitStatusOnMainThread(int32_t pp_error, int exit_status);

  // Keep track of the NaCl module subprocess that was spun up in the plugin.
  NaClSubprocess main_subprocess_;

  bool uses_nonsfi_mode_;

  nacl::DescWrapperFactory* wrapper_factory_;

  pp::CompletionCallbackFactory<Plugin> callback_factory_;

  nacl::scoped_ptr<PnaclCoordinator> pnacl_coordinator_;

  int exit_status_;

  PP_NaClFileInfo nexe_file_info_;

  const PPB_NaCl_Private* nacl_interface_;
  pp::UMAPrivate uma_interface_;
};

}  // namespace plugin

#endif  // NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_PLUGIN_H_