// ==UserScript==
// @name        AposBot
// @namespace   AposBot
// @include     http://agar.io/*
// @version     3.551
// @grant       none
// @author      http://www.twitch.tv/apostolique
// ==/UserScript==

var aposBotVersion = 3.551;

//TODO: Team mode
//      Detect when people are merging
//      Split to catch smaller targets
//      Angle based cluster code
//      Better wall code
//      In team mode, make allies be obstacles.

Number.prototype.mod = function(n) {
    return ((this % n) + n) % n;
};

Array.prototype.peek = function() {
    return this[this.length - 1];
};

var sha = "efde0488cc2cc176db48dd23b28a20b90314352b";
function getLatestCommit() {
    window.jQuery.ajax({
            url: "https://api.github.com/repos/apostolique/Agar.io-bot/git/refs/heads/master",
            cache: false,
            dataType: "jsonp"
        }).done(function(data) {
            console.dir(data["data"])
            console.log("hmm: " + data["data"]["object"]["sha"]);
            sha = data["data"]["object"]["sha"];

            function update(prefix, name, url) {
                window.jQuery(document.body).prepend("
");
                window.jQuery('#' + prefix + 'Dialog').append("
");
                window.jQuery('#' + prefix + 'Message').append("
UPDATE TIME!!!
");
                window.jQuery('#' + prefix + 'Message').append("
Grab the update for: " + name + "
");
                window.jQuery('#' + prefix + 'Link').on('click', function() {
                    window.jQuery("#" + prefix + "Dialog").hide();
                    window.jQuery("#" + prefix + "Dialog").remove();
                });
                window.jQuery("#" + prefix + "Dialog").show();
            }

            $.get('https://raw.githubusercontent.com/Apostolique/Agar.io-bot/master/bot.user.js?' + Math.floor((Math.random() * 1000000) + 1), function(data) {
                var latestVersion = data.replace(/(\r\n|\n|\r)/gm,"");
                latestVersion = latestVersion.substring(latestVersion.indexOf("// @version")+11,latestVersion.indexOf("// @grant"));

                latestVersion = parseFloat(latestVersion + 0.0000);
                var myVersion = parseFloat(aposBotVersion + 0.0000);

                if(latestVersion > myVersion)
                {
                    update("aposBot", "bot.user.js", "https://github.com/Apostolique/Agar.io-bot/blob/" + sha + "/bot.user.js/");
                }
                console.log('Current bot.user.js Version: ' + myVersion + " on Github: " + latestVersion);
            });

        }).fail(function() {});
}
getLatestCommit();

console.log("Running Apos Bot!");
(function(f, g) {
    var splitDistance = 710;
    console.log("Apos Bot!");

    if (f.botList == null) {
        f.botList = [];
        g('#locationUnknown').append(g('<select id="bList" class="form-control" onchange="setBotIndex($(this).val());" />'));
        g('#locationUnknown').addClass('form-group');
    }

    for (var i = f.botList.length - 1; i >= 0; i--) {
        if (f.botList[i][0] == "Human") {
            f.botList.splice(i, 1);
        }
    }

    f.botList.push(["AposBot " + aposBotVersion, findDestination]);

    var bList = g('#bList');
    g('<option />', {value: (f.botList.length - 1), text: "AposBot"}).appendTo(bList);

    //Given an angle value that was gotten from valueAndleBased(),
    //returns a new value that scales it appropriately.
    function paraAngleValue(angleValue, range) {
        return (15 / (range[1])) * (angleValue * angleValue) - (range[1] / 6);
    }

    function valueAngleBased(angle, range) {
        var leftValue = (angle - range[0]).mod(360);
        var rightValue = (rangeToAngle(range) - angle).mod(360);

        var bestValue = Math.min(leftValue, rightValue);

        if (bestValue <= range[1]) {
            return paraAngleValue(bestValue, range);
        }
        var banana = -1;
        return banana;

    }

    function computeDistance(x1, y1, x2, y2) {
        var xdis = x1 - x2; // <--- FAKE AmS OF COURSE!
        var ydis = y1 - y2;
        var distance = Math.sqrt(xdis * xdis + ydis * ydis);

        return distance;
    }

    function computerDistanceFromCircleEdge(x1, y1, x2, y2, s2) {
        var tempD = computeDistance(x2, y2, x1, y1);

        var offsetX = 0;
        var offsetY = 0;

        var ratioX = tempD / (x2 - x1);
        var ratioY = tempD / (y2 - y1);

        offsetX = x2 - (s2 / ratioX);
        offsetY = y2 - (s2 / ratioY);

        return computeDistance(x1, y1, offsetX, offsetY);
    }

    function compareSize(player1, player2, ratio) {
        if (player1.size * player1.size * ratio < player2.size * player2.size) {
            return true;
        }
        return false;
    }

    function canSplit(player1, player2) {
        return compareSize(player1, player2, 2.30) && !compareSize(player1, player2, 9);
    }

    function isItMe(player, cell2) {
        if (getMode() == ":teams") {
            var currentColor = player[0].color;

            var currentRed = parseInt(currentColor.substring(1,3), 16);
            var currentGreen = parseInt(currentColor.substring(3,5), 16);
            var currentBlue = parseInt(currentColor.substring(5,7), 16);

            var currentTeam = getTeam(currentRed, currentGreen, currentBlue);

            var cellColor = cell2.color;

            var cellRed = parseInt(cellColor.substring(1,3), 16);
            var cellGreen = parseInt(cellColor.substring(3,5), 16);
            var cellBlue = parseInt(cellColor.substring(5,7), 16);

            var cellTeam = getTeam(cellRed, cellGreen, cellBlue);

            if (currentTeam == cellTeam && !cell2.isVirus()) {
                return true;
            }

            //console.log("COLOR: " + color);

        } else {
            for (var i = 0; i < player.length; i++) {
                if (cell2.id == player[i].id) {
                    return true;
                }
            }
        }
        return false;
    }

    function getTeam(red, green, blue) {
        if (red > green && red > blue) {
            return 0;
        } else if (green > red && green > blue) {
            return 1;
        }
        return 2;
    }

    function isFood(blob, cell) {
        if (!cell.isVirus() && compareSize(cell, blob, 1.30) || (cell.size <= 11)) {
            return true;
        }
        return false;
    }

    function isThreat(blob, cell) {
        if (!cell.isVirus() && compareSize(blob, cell, 1.30)) {
            return true;
        }
        return false;
    }

    function isVirus(blob, cell) {
        if (cell.isVirus() && compareSize(cell, blob, 1.30)) {
            return true;
        } else if (cell.isVirus() && cell.color.substring(3,5).toLowerCase() != "ff") {
            return true;
        }
        return false;
    }

    function isSplitTarget(blob, cell) {
        /*if (canSplit(cell, blob)) {
            return true;
        }*/
        return false;
    }

    function getMass(blob){
        setShowMass(true);
        //This var is only declared while showMass=true.
        return blob.O.F;
    }

    function getTimeToRemerge(mass){
        return ((mass*0.02) +30);
    }

    function getBlobCount(player){
        var count = 0;
        Object.keys(player).forEach(function(item, i) {
            count++;
        });
        //return Object.keys(player).length - 1;
        return count - 1;
    }

    function separateListBasedOnFunction(listToUse, blob) {
        var foodElementList = [];
        var threatList = [];
        var virusList = [];
        var splitTargetList = [];

        var player = getPlayer();

        Object.keys(listToUse).forEach(function(element, index) {
            var isMe = isItMe(player, listToUse[element]);

            if (!isMe) {
                if (isFood(blob, listToUse[element])) {
                    //IT'S FOOD!
                    foodElementList.push(listToUse[element]);

                    if (isSplitTarget(blob, listToUse[element])) {
                        drawCircle(listToUse[element].x, listToUse[element].y, listToUse[element].size + 50, 7);
                        splitTargetList.push(listToUse[element])
                    }
                } else if (isThreat(blob, listToUse[element])) {
                    //IT'S DANGER!
                    threatList.push(listToUse[element]);
                } else if (isVirus(blob, listToUse[element])) {
                    //IT'S VIRUS!
                    virusList.push(listToUse[element]);
                }
            }else if(isMe && (getBlobCount(getPlayer()) > 0)){
                //Attempt to make the other cell follow the mother one
                foodElementList.push(listToUse[element]);
            }
        });

        foodList = [];
        for (var i = 0; i < foodElementList.length; i++) {
            foodList.push([foodElementList[i].x, foodElementList[i].y, foodElementList[i].size]);
        }

        return [foodList, threatList, virusList, splitTargetList];
    }

    function getAll(blob) {
        var dotList = [];
        var player = getPlayer();
        var interNodes = getMemoryCells();

        dotList = separateListBasedOnFunction(interNodes, blob);

        return dotList;
    }

    function clusterFood(foodList, blobSize) {
        var clusters = [];
        var addedCluster = false;

        //1: x
        //2: y
        //3: size or value
        //4: Angle, not set here.

        for (var i = 0; i < foodList.length; i++) {
            for (var j = 0; j < clusters.length; j++) {
                if (computeDistance(foodList[i][0], foodList[i][1], clusters[j][0], clusters[j][1]) < blobSize * 1.5) {
                    clusters[j][0] = (foodList[i][0] + clusters[j][0]) / 2;
                    clusters[j][1] = (foodList[i][1] + clusters[j][1]) / 2;
                    clusters[j][2] += foodList[i][2];
                    addedCluster = true;
                    break;
                }
            }
            if (!addedCluster) {
                clusters.push([foodList[i][0], foodList[i][1], foodList[i][2], 0]);
            }
            addedCluster = false;
        }
        return clusters;
    }

    function getAngle(x1, y1, x2, y2) {
        //Handle vertical and horizontal lines.

        if (x1 == x2) {
            if (y1 < y2) {
                return 271;
                //return 89;
            } else {
                return 89;
            }
        }

        return (Math.round(Math.atan2(-(y1 - y2), -(x1 - x2)) / Math.PI * 180 + 180));
    }

    function slope(x1, y1, x2, y2) {
        var m = (y1 - y2) / (x1 - x2);

        return m;
    }

    function slopeFromAngle(degree) {
        if (degree == 270) {
            degree = 271;
        } else if (degree == 90) {
            degree = 91;
        }
        return Math.tan((degree - 180) / 180 * Math.PI);
    }

    //Given two points on a line, finds the slope of a perpendicular line crossing it.
    function inverseSlope(x1, y1, x2, y2) {
        var m = slope(x1, y1, x2, y2);
        return (-1) / m;
    }

    //Given a slope and an offset, returns two points on that line.
    function pointsOnLine(slope, useX, useY, distance) {
        var b = useY - slope * useX;
        var r = Math.sqrt(1 + slope * slope);

        var newX1 = (useX + (distance / r));
        var newY1 = (useY + ((distance * slope) / r));
        var newX2 = (useX + ((-distance) / r));
        var newY2 = (useY + (((-distance) * slope) / r));

        return [
            [newX1, newY1],
            [newX2, newY2]
        ];
    }

    function followAngle(angle, useX, useY, distance) {
        var slope = slopeFromAngle(angle);
        var coords = pointsOnLine(slope, useX, useY, distance);

        var side = (angle - 90).mod(360);
        if (side < 180) {
            return coords[1];
        } else {
            return coords[0];
        }
    }

    //Using a line formed from point a to b, tells if point c is on S side of that line.
    function isSideLine(a, b, c) {
        if ((b[0] - a[0]) * (c[1] - a[1]) - (b[1] - a[1]) * (c[0] - a[0]) > 0) {
            return true;
        }
        return false;
    }

    //angle range2 is within angle range2
    //an Angle is a point and a distance between an other point [5, 40]
    function angleRangeIsWithin(range1, range2) {
        if (range2[0] == (range2[0] + range2[1]).mod(360)) {
            return true;
        }
        //console.log("r1: " + range1[0] + ", " + range1[1] + " ... r2: " + range2[0] + ", " + range2[1]);

        var distanceFrom0 = (range1[0] - range2[0]).mod(360);
        var distanceFrom1 = (range1[1] - range2[0]).mod(360);

        if (distanceFrom0 < range2[1] && distanceFrom1 < range2[1] && distanceFrom0 < distanceFrom1) {
            return true;
        }
        return false;
    }

    function angleRangeIsWithinInverted(range1, range2) {
        var distanceFrom0 = (range1[0] - range2[0]).mod(360);
        var distanceFrom1 = (range1[1] - range2[0]).mod(360);

        if (distanceFrom0 < range2[1] && distanceFrom1 < range2[1] && distanceFrom0 > distanceFrom1) {
            return true;
        }
        return false;
    }

    function angleIsWithin(angle, range) {
        var diff = (rangeToAngle(range) - angle).mod(360);
        if (diff >= 0 && diff <= range[1]) {
            return true;
        }
        return false;
    }

    function rangeToAngle(range) {
        return (range[0] + range[1]).mod(360);
    }

    function anglePair(range) {
        return (range[0] + ", " + rangeToAngle(range) + " range: " + range[1]);
    }

    function computeAngleRanges(blob1, blob2) {
        var mainAngle = getAngle(blob1.x, blob1.y, blob2.x, blob2.y);
        var leftAngle = (mainAngle - 90).mod(360);
        var rightAngle = (mainAngle + 90).mod(360);

        var blob1Left = followAngle(leftAngle, blob1.x, blob1.y, blob1.size);
        var blob1Right = followAngle(rightAngle, blob1.x, blob1.y, blob1.size);

        var blob2Left = followAngle(rightAngle, blob2.x, blob2.y, blob2.size);
        var blob2Right = followAngle(leftAngle, blob2.x, blob2.y, blob2.size);

        var blob1AngleLeft = getAngle(blob2.x, blob2.y, blob1Left[0], blob1Left[1]);
        var blob1AngleRight = getAngle(blob2.x, blob2.y, blob1Right[0], blob1Right[1]);

        var blob2AngleLeft = getAngle(blob1.x, blob1.y, blob2Left[0], blob2Left[1]);
        var blob2AngleRight = getAngle(blob1.x, blob1.y, blob2Right[0], blob2Right[1]);

        var blob1Range = (blob1AngleRight - blob1AngleLeft).mod(360);
        var blob2Range = (blob2AngleRight - blob2AngleLeft).mod(360);

        var tempLine = followAngle(blob2AngleLeft, blob2Left[0], blob2Left[1], 400);
        //drawLine(blob2Left[0], blob2Left[1], tempLine[0], tempLine[1], 0);

        if ((blob1Range / blob2Range) > 1) {
            drawPoint(blob1Left[0], blob1Left[1], 3, "");
            drawPoint(blob1Right[0], blob1Right[1], 3, "");
            drawPoint(blob1.x, blob1.y, 3, "" + blob1Range + ", " + blob2Range + " R: " + (Math.round((blob1Range / blob2Range) * 1000) / 1000));
        }

        //drawPoint(blob2.x, blob2.y, 3, "" + blob1Range);
    }

    function debugAngle(angle, text) {
        var player = getPlayer();
        var line1 = followAngle(angle, player[0].x, player[0].y, 300);
        drawLine(player[0].x, player[0].y, line1[0], line1[1], 5);
        drawPoint(line1[0], line1[1], 5, "" + text);
    }

    //TODO: Don't let this function do the radius math.
    function getEdgeLinesFromPoint(blob1, blob2, radius) {
        var px = blob1.x;
        var py = blob1.y;

        var cx = blob2.x;
        var cy = blob2.y;

        //var radius = blob2.size;

        /*if (blob2.isVirus()) {
            radius = blob1.size;
        } else if(canSplit(blob1, blob2)) {
            radius += splitDistance;
        } else {
            radius += blob1.size * 2;
        }*/

        var shouldInvert = false;

        if (computeDistance(px, py, cx, cy) <= radius) {
            radius = computeDistance(px, py, cx, cy) - 5;
            shouldInvert = true;
        }

        var dx = cx - px;
        var dy = cy - py;
        var dd = Math.sqrt(dx * dx + dy * dy);
        var a = Math.asin(radius / dd);
        var b = Math.atan2(dy, dx);

        var t = b - a
        var ta = {
            x: radius * Math.sin(t),
            y: radius * -Math.cos(t)
        };

        t = b + a
        var tb = {
            x: radius * -Math.sin(t),
            y: radius * Math.cos(t)
        };

        var angleLeft = getAngle(cx + ta.x, cy + ta.y, px, py);
        var angleRight = getAngle(cx + tb.x, cy + tb.y, px, py);
        var angleDistance = (angleRight - angleLeft).mod(360);

        if (shouldInvert) {
            var temp = angleLeft;
            angleLeft = (angleRight + 180).mod(360);
            angleRight = (temp + 180).mod(360);
            angleDistance = (angleRight - angleLeft).mod(360);
        }

        return [angleLeft, angleDistance, [cx + tb.x, cy + tb.y],
            [cx + ta.x, cy + ta.y]
        ];
    }

    function invertAngle(range) {
        var angle1 = rangeToAngle(badAngles[i]);
        var angle2 = (badAngles[i][0] - angle1).mod(360);
        return [angle1, angle2];
    }

    function addWall(listToUse, blob) {
        if (blob.x < f.getMapStartX() + 1000) {
            //LEFT
            //console.log("Left");

            listToUse.push([[135, true], [225, false]]);

            var lineLeft = followAngle(135, blob.x, blob.y, 190 + blob.size);
            var lineRight = followAngle(225, blob.x, blob.y, 190 + blob.size);
            drawLine(blob.x, blob.y, lineLeft[0], lineLeft[1], 5);
            drawLine(blob.x, blob.y, lineRight[0], lineRight[1], 5);
            drawArc(lineLeft[0], lineLeft[1], lineRight[0], lineRight[1], blob.x, blob.y, 5);
        }
        if (blob.y < f.getMapStartY() + 1000) {
            //TOP
            //console.log("TOP");

            listToUse.push([[225, true], [315, false]]);

            var lineLeft = followAngle(225, blob.x, blob.y, 190 + blob.size);
            var lineRight = followAngle(315, blob.x, blob.y, 190 + blob.size);
            drawLine(blob.x, blob.y, lineLeft[0], lineLeft[1], 5);
            drawLine(blob.x, blob.y, lineRight[0], lineRight[1], 5);
            drawArc(lineLeft[0], lineLeft[1], lineRight[0], lineRight[1], blob.x, blob.y, 5);
        }
        if (blob.x > f.getMapEndX() - 1000) {
            //RIGHT
            //console.log("RIGHT");

            listToUse.push([[315, true], [45, false]]);

            var lineLeft = followAngle(315, blob.x, blob.y, 190 + blob.size);
            var lineRight = followAngle(45, blob.x, blob.y, 190 + blob.size);
            drawLine(blob.x, blob.y, lineLeft[0], lineLeft[1], 5);
            drawLine(blob.x, blob.y, lineRight[0], lineRight[1], 5);
            drawArc(lineLeft[0], lineLeft[1], lineRight[0], lineRight[1], blob.x, blob.y, 5);
        }
        if (blob.y > f.getMapEndY() - 1000) {
            //BOTTOM
            //console.log("BOTTOM");

            listToUse.push([[45, true], [135, false]]);

            var lineLeft = followAngle(45, blob.x, blob.y, 190 + blob.size);
            var lineRight = followAngle(135, blob.x, blob.y, 190 + blob.size);
            drawLine(blob.x, blob.y, lineLeft[0], lineLeft[1], 5);
            drawLine(blob.x, blob.y, lineRight[0], lineRight[1], 5);
            drawArc(lineLeft[0], lineLeft[1], lineRight[0], lineRight[1], blob.x, blob.y, 5);
        }

        return listToUse;
    }

    //listToUse contains angles in the form of [angle, boolean].
    //boolean is true when the range is starting. False when it's ending.
    //range = [[angle1, true], [angle2, false]]

    function getAngleIndex(listToUse, angle) {
        if (listToUse.length == 0) {
            return 0;
        }

        for (var i = 0; i < listToUse.length; i++) {
            if (angle <= listToUse[i][0]) {
                return i;
            }
        }

        return listToUse.length;
    }

    function addAngle(listToUse, range) {
        //#1 Find first open element
        //#2 Try to add range1 to the list. If it is within other range, don't add it, set a boolean.
        //#3 Try to add range2 to the list. If it is withing other range, don't add it, set a boolean.

        //TODO: Only add the new range at the end after the right stuff has been removed.

        var startIndex = 1;

        if (listToUse.length > 0 && !listToUse[0][1]) {
            startIndex = 0;
        }

        var startMark = getAngleIndex(listToUse, range[0][0]);
        var startBool = startMark.mod(2) != startIndex;

        var endMark = getAngleIndex(listToUse, range[1][0]);
        var endBool = endMark.mod(2) != startIndex;

        var removeList = [];

        if (startMark != endMark) {
            //Note: If there is still an error, this would be it.
            var biggerList = 0;
            if (endMark == listToUse.length) {
                biggerList = 1;
            }

            for (var i = startMark; i < startMark + (endMark - startMark).mod(listToUse.length + biggerList); i++) {
                removeList.push((i).mod(listToUse.length));
            }
        } else if (startMark < listToUse.length && endMark < listToUse.length) {
            var startDist = (listToUse[startMark][0] - range[0][0]).mod(360);
            var endDist = (listToUse[endMark][0] - range[1][0]).mod(360);

            if (startDist < endDist) {
                for (var i = 0; i < listToUse.length; i++) {
                    removeList.push(i);
                }
            }
        }

        removeList.sort(function(a, b){return b-a});

        for (var i = 0; i < removeList.length; i++) {
            listToUse.splice(removeList[i], 1);
        }

        if (startBool) {
            listToUse.splice(getAngleIndex(listToUse, range[0][0]), 0, range[0]);
        }
        if (endBool) {
            listToUse.splice(getAngleIndex(listToUse, range[1][0]), 0, range[1]);
        }

        return listToUse;
    }

    function getAngleRange(blob1, blob2, index, radius) {
        var angleStuff = getEdgeLinesFromPoint(blob1, blob2, radius);

        var leftAngle = angleStuff[0];
        var rightAngle = rangeToAngle(angleStuff);
        var difference = angleStuff[1];

        drawPoint(angleStuff[2][0], angleStuff[2][1], 3, "");
        drawPoint(angleStuff[3][0], angleStuff[3][1], 3, "");

        //console.log("Adding badAngles: " + leftAngle + ", " + rightAngle + " diff: " + difference);

        var lineLeft = followAngle(leftAngle, blob1.x, blob1.y, 150 + blob1.size - index * 10);
        var lineRight = followAngle(rightAngle, blob1.x, blob1.y, 150 + blob1.size - index * 10);

        if (blob2.isVirus()) {
            drawLine(blob1.x, blob1.y, lineLeft[0], lineLeft[1], 6);
            drawLine(blob1.x, blob1.y, lineRight[0], lineRight[1], 6);
            drawArc(lineLeft[0], lineLeft[1], lineRight[0], lineRight[1], blob1.x, blob1.y, 6);
        } else if(getCells().hasOwnProperty(blob2.id)) {
            drawLine(blob1.x, blob1.y, lineLeft[0], lineLeft[1], 0);
            drawLine(blob1.x, blob1.y, lineRight[0], lineRight[1], 0);
            drawArc(lineLeft[0], lineLeft[1], lineRight[0], lineRight[1], blob1.x, blob1.y, 0);
        } else {
            drawLine(blob1.x, blob1.y, lineLeft[0], lineLeft[1], 3);
            drawLine(blob1.x, blob1.y, lineRight[0], lineRight[1], 3);
            drawArc(lineLeft[0], lineLeft[1], lineRight[0], lineRight[1], blob1.x, blob1.y, 3);
        }

        return [leftAngle, difference];
    }

    //Given a list of conditions, shift the angle to the closest available spot respecting the range given.
    function shiftAngle(listToUse, angle, range) {
        //TODO: shiftAngle needs to respect the range! DONE?
        for (var i = 0; i < listToUse.length; i++) {
            if (angleIsWithin(angle, listToUse[i])) {
                //console.log("Shifting needed!");

                var angle1 = listToUse[i][0];
                var angle2 = rangeToAngle(listToUse[i]);

                var dist1 = (angle - angle1).mod(360);
                var dist2 = (angle2 - angle).mod(360);

                if (dist1 < dist2) {
                    if (angleIsWithin(angle1, range)) {
                        return angle1;
                    } else {
                        return angle2;
                    }
                } else {
                    if (angleIsWithin(angle2, range)) {
                        return angle2;
                    } else {
                        return angle1;
                    }
                }
            }
        }
        //console.log("No Shifting Was needed!");
        return angle;
    }

    function findDestination(followMouse) {
        var player = getPlayer();
        var interNodes = getMemoryCells();
        //console.warn("findDestination(followMouse) was called from line " + arguments.callee.caller.toString());

        if ( /*!toggle*/ 1) {
            var useMouseX = (getMouseX() - getWidth() / 2 + getX() * getRatio()) / getRatio();
            var useMouseY = (getMouseY() - getHeight() / 2 + getY() * getRatio()) / getRatio();
            tempPoint = [useMouseX, useMouseY, 1];

            var tempMoveX = getPointX();
            var tempMoveY = getPointY();

            var destinationChoices = []; //destination, size, danger

            if (player.length > 0) {

                for (var k = 0; k < player.length; k++) {

                    //console.log("Working on blob: " + k);

                    drawCircle(player[k].x, player[k].y, player[k].size + splitDistance, 5);
                    //drawPoint(player[0].x, player[0].y - player[0].size, 3, "" + Math.floor(player[0].x) + ", " + Math.floor(player[0].y));

                    //var allDots = processEverything(interNodes);

                    var allIsAll = getAll(player[k]);

                    var allPossibleFood = allIsAll[0];
                    var allPossibleThreats = allIsAll[1];
                    var allPossibleViruses = allIsAll[2];

                    var badAngles = [];
                    var obstacleList = [];

                    var isSafeSpot = true;
                    var isMouseSafe = true;

                    var clusterAllFood = clusterFood(allPossibleFood, player[k].size);

                    //console.log("Looking for enemies!");

                    for (var i = 0; i < allPossibleThreats.length; i++) {

                        var enemyDistance = computeDistance(allPossibleThreats[i].x, allPossibleThreats[i].y, player[k].x, player[k].y);

                        var splitDangerDistance = allPossibleThreats[i].size + splitDistance + 150;

                        var normalDangerDistance = allPossibleThreats[i].size + 150;

                        var shiftDistance = player[k].size;

                        //console.log("Found distance.");

                        var enemyCanSplit = canSplit(player[k], allPossibleThreats[i]);

                        for (var j = clusterAllFood.length - 1; j >= 0 ; j--) {
                            var secureDistance = (enemyCanSplit ? splitDangerDistance : normalDangerDistance);
                            if (computeDistance(allPossibleThreats[i].x, allPossibleThreats[i].y, clusterAllFood[j][0], clusterAllFood[j][1]) < secureDistance)
                                clusterAllFood.splice(j, 1);
                        }

                        //console.log("Removed some food.");

                        if (enemyCanSplit) {
                            drawCircle(allPossibleThreats[i].x, allPossibleThreats[i].y, splitDangerDistance, 0);
                            drawCircle(allPossibleThreats[i].x, allPossibleThreats[i].y, splitDangerDistance + shiftDistance, 6);
                        } else {
                            drawCircle(allPossibleThreats[i].x, allPossibleThreats[i].y, normalDangerDistance, 3);
                            drawCircle(allPossibleThreats[i].x, allPossibleThreats[i].y, normalDangerDistance + shiftDistance, 6);
                        }

                        if (allPossibleThreats[i].danger && f.getLastUpdate() - allPossibleThreats[i].dangerTimeOut > 1000) {

                            allPossibleThreats[i].danger = false;
                        }

                        /*if ((enemyCanSplit && enemyDistance < splitDangerDistance) ||
                            (!enemyCanSplit && enemyDistance < normalDangerDistance)) {
                            allPossibleThreats[i].danger = true;
                            allPossibleThreats[i].dangerTimeOut = f.getLastUpdate();
                        }*/

                        //console.log("Figured out who was important.");

                        if ((enemyCanSplit && enemyDistance < splitDangerDistance) || (enemyCanSplit && allPossibleThreats[i].danger)) {

                            badAngles.push(getAngleRange(player[k], allPossibleThreats[i], i, splitDangerDistance));

                        } else if ((!enemyCanSplit && enemyDistance < normalDangerDistance) || (!enemyCanSplit && allPossibleThreats[i].danger)) {

                            badAngles.push(getAngleRange(player[k], allPossibleThreats[i], i, normalDangerDistance));

                        } else if (enemyCanSplit && enemyDistance < splitDangerDistance + shiftDistance) {
                            var tempOb = getAngleRange(player[k], allPossibleThreats[i], i, splitDangerDistance + shiftDistance);
                            var angle1 = tempOb[0];
                            var angle2 = rangeToAngle(tempOb);

                            obstacleList.push([[angle1, true], [angle2, false]]);
                        } else if (!enemyCanSplit && enemyDistance < normalDangerDistance + shiftDistance) {
                            var tempOb = getAngleRange(player[k], allPossibleThreats[i], i, normalDangerDistance + shiftDistance);
                            var angle1 = tempOb[0];
                            var angle2 = rangeToAngle(tempOb);

                            obstacleList.push([[angle1, true], [angle2, false]]);
                        }
                        //console.log("Done with enemy: " + i);
                    }

                    //console.log("Done looking for enemies!");

                    var goodAngles = [];
                    var stupidList = [];

                    for (var i = 0; i < allPossibleViruses.length; i++) {
                        if (player[k].size < allPossibleViruses[i].size) {
                            drawCircle(allPossibleViruses[i].x, allPossibleViruses[i].y, allPossibleViruses[i].size + 10, 3);
                            drawCircle(allPossibleViruses[i].x, allPossibleViruses[i].y, allPossibleViruses[i].size * 2, 6);

                        } else {
                            drawCircle(allPossibleViruses[i].x, allPossibleViruses[i].y, player[k].size + 50, 3);
                            drawCircle(allPossibleViruses[i].x, allPossibleViruses[i].y, player[k].size * 2, 6);
                        }
                    }

                    for (var i = 0; i < allPossibleViruses.length; i++) {
                        var virusDistance = computeDistance(allPossibleViruses[i].x, allPossibleViruses[i].y, player[k].x, player[k].y);
                        if (player[k].size < allPossibleViruses[i].size) {
                            if (virusDistance < (allPossibleViruses[i].size * 2)) {
                                var tempOb = getAngleRange(player[k], allPossibleViruses[i], i, allPossibleViruses[i].size + 10);
                                var angle1 = tempOb[0];
                                var angle2 = rangeToAngle(tempOb);
                                obstacleList.push([[angle1, true], [angle2, false]]);
                            }
                        } else {
                            if (virusDistance < (player[k].size * 2)) {
                                var tempOb = getAngleRange(player[k], allPossibleViruses[i], i, player[k].size + 50);
                                var angle1 = tempOb[0];
                                var angle2 = rangeToAngle(tempOb);
                                obstacleList.push([[angle1, true], [angle2, false]]);
                            }
                        }
                    }

                    if (badAngles.length > 0) {
                        //NOTE: This is only bandaid wall code. It's not the best way to do it.
                        stupidList = addWall(stupidList, player[k]);
                    }

                    for (var i = 0; i < badAngles.length; i++) {
                        var angle1 = badAngles[i][0];
                        var angle2 = rangeToAngle(badAngles[i]);
                        stupidList.push([[angle1, true], [angle2, false]]);
                    }

                    //stupidList.push([[45, true], [135, false]]);
                    //stupidList.push([[10, true], [200, false]]);

                    //console.log("Added random noob stuff.");

                    var sortedInterList = [];
                    var sortedObList = [];

                    for (var i = 0; i < stupidList.length; i++) {
                        //console.log("Adding to sorted: " + stupidList[i][0][0] + ", " + stupidList[i][1][0]);
                        sortedInterList = addAngle(sortedInterList, stupidList[i])

                        if (sortedInterList.length == 0) {
                            break;
                        }
                    }

                    for (var i = 0; i < obstacleList.length; i++) {
                        sortedObList = addAngle(sortedObList, obstacleList[i])

                        if (sortedObList.length == 0) {
                            break;
                        }
                    }

                    var offsetI = 0;
                    var obOffsetI = 1;

                    if (sortedInterList.length > 0 && sortedInterList[0][1]) {
                        offsetI = 1;
                    }
                    if (sortedObList.length > 0 && sortedObList[0][1]) {
                        obOffsetI = 0;
                    }

                    var goodAngles = [];
                    var obstacleAngles = [];

                    for (var i = 0; i < sortedInterList.length; i += 2) {
                        var angle1 = sortedInterList[(i + offsetI).mod(sortedInterList.length)][0];
                        var angle2 = sortedInterList[(i + 1 + offsetI).mod(sortedInterList.length)][0];
                        var diff = (angle2 - angle1).mod(360);
                        goodAngles.push([angle1, diff]);
                    }

                    for (var i = 0; i < sortedObList.length; i += 2) {
                        var angle1 = sortedObList[(i + obOffsetI).mod(sortedObList.length)][0];
                        var angle2 = sortedObList[(i + 1 + obOffsetI).mod(sortedObList.length)][0];
                        var diff = (angle2 - angle1).mod(360);
                        obstacleAngles.push([angle1, diff]);
                    }

                    for (var i = 0; i < goodAngles.length; i++) {
                        var line1 = followAngle(goodAngles[i][0], player[k].x, player[k].y, 100 + player[k].size);
                        var line2 = followAngle((goodAngles[i][0] + goodAngles[i][1]).mod(360), player[k].x, player[k].y, 100 + player[k].size);
                        drawLine(player[k].x, player[k].y, line1[0], line1[1], 1);
                        drawLine(player[k].x, player[k].y, line2[0], line2[1], 1);

                        drawArc(line1[0], line1[1], line2[0], line2[1], player[k].x, player[k].y, 1);

                        //drawPoint(player[0].x, player[0].y, 2, "");

                        drawPoint(line1[0], line1[1], 0, "" + i + ": 0");
                        drawPoint(line2[0], line2[1], 0, "" + i + ": 1");
                    }

                    for (var i = 0; i < obstacleAngles.length; i++) {
                        var line1 = followAngle(obstacleAngles[i][0], player[k].x, player[k].y, 50 + player[k].size);
                        var line2 = followAngle((obstacleAngles[i][0] + obstacleAngles[i][1]).mod(360), player[k].x, player[k].y, 50 + player[k].size);
                        drawLine(player[k].x, player[k].y, line1[0], line1[1], 6);
                        drawLine(player[k].x, player[k].y, line2[0], line2[1], 6);

                        drawArc(line1[0], line1[1], line2[0], line2[1], player[k].x, player[k].y, 6);

                        //drawPoint(player[0].x, player[0].y, 2, "");

                        drawPoint(line1[0], line1[1], 0, "" + i + ": 0");
                        drawPoint(line2[0], line2[1], 0, "" + i + ": 1");
                    }

                    if (followMouse && goodAngles.length == 0) {
                        //This is the follow the mouse mode
                        var distance = computeDistance(player[k].x, player[k].y, tempPoint[0], tempPoint[1]);

                        var shiftedAngle = shiftAngle(obstacleAngles, getAngle(tempPoint[0], tempPoint[1], player[k].x, player[k].y), [0, 360]);

                        var destination = followAngle(shiftedAngle, player[k].x, player[k].y, distance);

                        destinationChoices.push(destination);
                        drawLine(player[k].x, player[k].y, destination[0], destination[1], 1);
                        //tempMoveX = destination[0];
                        //tempMoveY = destination[1];

                    } else if (goodAngles.length > 0) {
                        var bIndex = goodAngles[0];
                        var biggest = goodAngles[0][1];
                        for (var i = 1; i < goodAngles.length; i++) {
                            var size = goodAngles[i][1];
                            if (size > biggest) {
                                biggest = size;
                                bIndex = goodAngles[i];
                            }
                        }
                        var perfectAngle = (bIndex[0] + bIndex[1] / 2).mod(360);

                        perfectAngle = shiftAngle(obstacleAngles, perfectAngle, bIndex);

                        var line1 = followAngle(perfectAngle, player[k].x, player[k].y, f.verticalDistance());

                        destinationChoices.push(line1);
                        drawLine(player[k].x, player[k].y, line1[0], line1[1], 7);
                        //tempMoveX = line1[0];
                        //tempMoveY = line1[1];
                    } else if (badAngles.length > 0 && goodAngles == 0) {
						var angleWeights = [] //Put weights on the angles according to enemy distance
						for (var i = 0; i < allPossibleThreats.length; i++){
							var dist = computeDistance(player[k].x, player[k].y, allPossibleThreats[i].x, allPossibleThreats[i].y);
							var angle = getAngle(allPossibleThreats[i].x, allPossibleThreats[i].y, player[k].x, player[k].y);
							angleWeights.push([angle,dist]);
						}
						var maxDist = 0;
						var finalAngle = 0;
						for (var i = 0; i < angleWeights.length; i++){
							if (angleWeights[i][1] > maxDist){
								maxDist = angleWeights[i][1];
								finalAngle = (angleWeights[i][0] + 180).mod(360);
							}
						}
						var line1 = followAngle(finalAngle,player[k].x,player[k].y,f.verticalDistance());
                        drawLine(player[k].x, player[k].y, line1[0], line1[1], 2);
						destinationChoices.push(line1);
                    } else if (clusterAllFood.length > 0) {
                        for (var i = 0; i < clusterAllFood.length; i++) {
                            //console.log("mefore: " + clusterAllFood[i][2]);
                            //This is the cost function. Higher is better.

                                var clusterAngle = getAngle(clusterAllFood[i][0], clusterAllFood[i][1], player[k].x, player[k].y);

                                clusterAllFood[i][2] = clusterAllFood[i][2] * 6 - computeDistance(clusterAllFood[i][0], clusterAllFood[i][1], player[k].x, player[k].y);
                                //console.log("Current Value: " + clusterAllFood[i][2]);

                                //(goodAngles[bIndex][1] / 2 - (Math.abs(perfectAngle - clusterAngle)));

                                clusterAllFood[i][3] = clusterAngle;

                                drawPoint(clusterAllFood[i][0], clusterAllFood[i][1], 1, "");
                                //console.log("After: " + clusterAllFood[i][2]);
                        }

                        var bestFoodI = 0;
                        var bestFood = clusterAllFood[0][2];
                        for (var i = 1; i < clusterAllFood.length; i++) {
                            if (bestFood < clusterAllFood[i][2]) {
                                bestFood = clusterAllFood[i][2];
                                bestFoodI = i;
                            }
                        }

                        //console.log("Best Value: " + clusterAllFood[bestFoodI][2]);

                        var distance = computeDistance(player[k].x, player[k].y, clusterAllFood[bestFoodI][0], clusterAllFood[bestFoodI][1]);

                        var shiftedAngle = shiftAngle(obstacleAngles, getAngle(clusterAllFood[bestFoodI][0], clusterAllFood[bestFoodI][1], player[k].x, player[k].y), [0, 360]);

                        var destination = followAngle(shiftedAngle, player[k].x, player[k].y, distance);

                        destinationChoices.push(destination);
                        //tempMoveX = destination[0];
                        //tempMoveY = destination[1];
                        drawLine(player[k].x, player[k].y, destination[0], destination[1], 1);
                    } else {
                        //If there are no enemies around and no food to eat.
                        destinationChoices.push([tempMoveX, tempMoveY]);
                    }

                    drawPoint(tempPoint[0], tempPoint[1], tempPoint[2], "");
                    //drawPoint(tempPoint[0], tempPoint[1], tempPoint[2], "" + Math.floor(computeDistance(tempPoint[0], tempPoint[1], I, J)));
                    //drawLine(tempPoint[0], tempPoint[1], player[0].x, player[0].y, 6);
                    //console.log("Slope: " + slope(tempPoint[0], tempPoint[1], player[0].x, player[0].y) + " Angle: " + getAngle(tempPoint[0], tempPoint[1], player[0].x, player[0].y) + " Side: " + (getAngle(tempPoint[0], tempPoint[1], player[0].x, player[0].y) - 90).mod(360));
                    tempPoint[2] = 1;

                    //console.log("Done working on blob: " + i);
                }

                //TODO: Find where to go based on destinationChoices.
                /*var dangerFound = false;
                for (var i = 0; i < destinationChoices.length; i++) {
                    if (destinationChoices[i][2]) {
                        dangerFound = true;
                        break;
                    }
                }
                destinationChoices.sort(function(a, b){return b[1] - a[1]});
                if (dangerFound) {
                    for (var i = 0; i < destinationChoices.length; i++) {
                        if (destinationChoices[i][2]) {
                            tempMoveX = destinationChoices[i][0][0];
                            tempMoveY = destinationChoices[i][0][1];
                            break;
                        }
                    }
                } else {
                    tempMoveX = destinationChoices.peek()[0][0];
                    tempMoveY = destinationChoices.peek()[0][1];
                    //console.log("Done " + tempMoveX + ", " + tempMoveY);
                }*/
            }
            //console.log("MOVING RIGHT NOW!");

            //console.log("______Never lied ever in my life.");

            return destinationChoices;
        }
    }

    function screenToGameX(x) {
        return (x - getWidth() / 2) / getRatio() + getX();
    }

    function screenToGameY(y) {
        return (y - getHeight() / 2) / getRatio() + getY();;
    }

    function drawPoint(x_1, y_1, drawColor, text) {
        f.drawPoint(x_1, y_1, drawColor, text);
    }

    function drawArc(x_1, y_1, x_2, y_2, x_3, y_3, drawColor) {
        f.drawArc(x_1, y_1, x_2, y_2, x_3, y_3, drawColor);
    }

    function drawLine(x_1, y_1, x_2, y_2, drawColor) {
        f.drawLine(x_1, y_1, x_2, y_2, drawColor);
    }

    function drawCircle(x_1, y_1, radius, drawColor) {
        f.drawCircle(x_1, y_1, radius, drawColor);
    }

    function screenDistance() {
        var temp = f.getScreenDistance();
        return temp;
    }

    function getDarkBool() {
        return f.getDarkBool();
    }

    function getMassBool() {
        return f.getMassBool();
    }

    function getMemoryCells() {
        return f.getMemoryCells();
    }

    function getCellsArray() {
        return f.getCellsArray();
    }

    function getCells() {
        return f.getCells();
    }

    function getPlayer() {
        return f.getPlayer();
    }

    function getWidth() {
        return f.getWidth();
    }

    function getHeight() {
        return f.getHeight();
    }

    function getRatio() {
        return f.getRatio();
    }

    function getOffsetX() {
        return f.getOffsetX();
    }

    function getOffsetY() {
        return f.getOffsetY();
    }

    function getX() {
        return f.getX();
    }

    function getY() {
        return f.getY();
    }

    function getPointX() {
        return f.getPointX();
    }

    function getPointY() {
        return f.getPointY();
    }

    function getMouseX() {
        return f.getMouseX();
    }

    function getMouseY() {
        return f.getMouseY();
    }

    function getUpdate() {
        return f.getLastUpdate();
    }

    function getMode() {
        return f.getMode();
    }
})(window, jQuery);


test comment


어라 이상하네요 저는 fork fetch 한거 그대로 쓴건데...언제 바뀐거지;;


Thanks, fixed f179be1


1. I'm not sure if that is an actual requirement, but it apparently works
around the root cause (whatever that may be :|)
2. I did test with i3wm and the 3 notifications I have available:
notification-daemon (Gnome 3), mate-notification-daemon (Mate) and dunst. I
did not test in proper Gnome/Mate Desktop environment.

Hendrik Sollich <notifications@github.com> schrieb am Mo., 3. Aug. 2015
14:39:

> Cool! [image: good job]
> <https://camo.githubusercontent.com/d70e8aa926c1ce8f8c6548a124b02404cdf03a58/687474703a2f2f692e67697068792e636f6d2f45364c5072727a4b4f4a7768472e676966>
>
>    1. So if I get this right, you have to keep a connection open in order
>    for this to work on mate and i3wm?
>    2. Did you test it on both?
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/panicbit/notify-rust/commit/e06340c1b4852b5a647005e8f06a24321ed9f761#commitcomment-12492382>
> .
>


**[unitTests_php_branches run failed](http://qa-s2.wikia-prod:8080/job/unitTests_php_branches/18618/testReport/) for this commit**


```
var taskManager = (navigator.onLine)? OnLineTaskManager : OffLineTaskmanger;
```

이 로직은 여러번 반복되는데 정리하면 좋을 것 같아.
그리고 online/offline을 확인하는 이벤트가 있는데 매번 navigator에 online을 확인해서 메서드를 확인하지 않고 메서드를 디자인하는 방법은 없을까?

좀 고민해보면 좋을듯.
고민해보고 한번 수업시간에 물어보면 좋겠어.


Ouh, thanks, I forgot it :D


Unlike SDL2, SDL_gpu doesn't link textures to a renderer, thus there's no need for a create_texture-like function for timage. draw() may stay if you insist, but I don't see any huge benefits to it.


when I run tests it not works for me.
`./node_modules/.bin/grunt test build`
http://prntscr.com/80b2mc


thanks!


이 부분도 개선할 포인트가 있어보이는데 고민해보고 물어보면 좋겠다.


test/fixtures/export/Book converted to mvbook #288.bib

missing at the end of the file:
<code>\n}</code>


Fixed too, thanks 36bc7cb


Why not one controller action (say, `show`) that loads a subreddit by the params? As we do when showing a particular record.

Also, ideally, we'd do our sorting in the db. After all, what happens when we a) want to paginate or b) get thousands/millions of posts?


넵 이거까지는 제가 수정해보고...다시한번 실행해보도록 하겠습니다


Time 0ms: user call to am2315_read_temperature()
Time 1.5ms: user call to am2315_read_temperature() <- This, as happened before the 2 seconds interval, will return cached data - but there's no cached data(!!)
Time 2ms: timeout, call to _read_data() <- this is ok. However, user's callback will be called with right value after a first call of wrong value (line before).

I don't think, though, that running `_read_data()` again will be a solution: will fall on the 'do not read twice in less than two seconds' rule. But I'll come up with a solution for v3. Thank you very much for the review, well spotted =D


이 부분도 모든 li에 transitionend을 할당하지 말고, ul에서 할당한 다음에 delegate해서 처리해보면 어떨까?


No need for empty string in 4th parameter


Review complete


Ok, there are no regressions on plasma5 and I just had a friend test it on ubuntu unity, so I guess it's fine.
Thanks


Is this addressed by #347?


@maxGimeno : a remark on the formatting of Git commit messages... It is recommended to let a blank line between the title of the message (the first line) and the rest of the message. On Github that does not make any difference, but for most Git tools, the title must be separated with a blank line.

In my Git user interface, for example, the title of the commit is the full commit message:

     SEGFAULT Fix - the iterator he_circ was looping wrong. I changed he_circ_end(he_circ) in he_circ_end = lcc.darts_of_orbit<1>(dartIter).end();


이렇게 jQuery을 확장한건 괜찮은 아이디어인 것 같아.
다만, 여러사람이 개발하면 이 메서드가 확장한 메서드인지 원래 지원하는 메서드인지 좀 헷갈린다.
그래서 API설정을 잘하거나 확장한 코드들은 다른 파일에 모아두는게 좋다.


please use the correct bounds at STC. test deleted and rescheduled at STC with correct bounds


this is 2nd commit


Sure I am. But it's just a matter of preference.
I use them only to save a line by not instantiating a `var`.

Here, with a `map`, a `make` must somehow be done. There is no gain.


Are you going to release a new version soon?


TeamCity MonoGame :: Develop (Win) [Build 3.5.0.446](http://teamcity.monogame.net/viewLog.html?buildId=9327&buildTypeId=MonoGame_DevelopWin&guest=1) outcome was **SUCCESS**
Summary: Tests passed: 538, ignored: 6 Build time: 00:22:44


똑같은 객체를 만들어서 offline과 online을 구분한건 정말 잘했다.
좀 더 고민해서 [링크](https://github.com/JB1021/2015-02-HTML5/commit/0c19c6da593b1ad9ecbae5ab7ff2d7218c25dc54#commitcomment-12492659)에 대한 이슈도 같이 해결하면 정말 좋을 것 같다.


Hi Paul, try to merge it into the integration branch


dynamic_2006 has been there for a long time.   This format it redundant, and not complete.

For this format to work, you would need to add
SaltLen=30
MaxInputLenX86=110
MaxInputLen=25


If we don't remove the feature the only two options are to either close the issue as `wontfix`. Even authentication is unlikely to solve the issue as we can't secure the connection between the WebUI and the client.


This creature does not have an entry in the Bestiary, I used http://web.archive.org/web/20070808092222im_/http://wow.allakhazam.com/images/mobs/antilus_the_soarer.jpg


I get a parse error when I include `$smarty.const.` in there:

```
[Mon Aug 03 13:55:28.135754 2015] [:error] [pid 9430] [client 192.168.0.8:38505] PHP Parse error:  syntax error, unexpected 'const' (T_CONST) in /var/www/html/ojs/pages/issue/IssueHandler.inc.php on line 425, referer: http://192.168.0.8/ojs/index.php/publicknowledge/index
```

I think maybe that only works within the templates. I copied that logic over from a template then committed it in 5d71c30c3d28a33779990a18a4764c5b3ae64e19. Here I'm probably just fixing my mistake, I'd guess...


The order way around, «is() or diag()» is much clearer to me, because of the end-weight.


그리고 OnLineTaskManager, OffLineTaskmanger의 코드가 상당히 유사한데 이 부분도 어떻게 하면 개선할 수 있을지 고민해보면 좋을 것 같아.


@tdhock  After determining the common columns and saving the common chunk, we can remove NAs for the resulting recursive data.frame list.

Due to the different number of rows in each varied chunk, the former joining by index is not appropriate in the copy_chunk function in the renderer. We should join by key, so the key should be saved to each varied chunks if it is present.

Another question confused me is the difference between `key` and `group` columns.


Yeah this is old markup. There are a few templates in here that I only touched to keep them functioning along with the restructure. But they still need to be reviewed and cleaned up.


saw approval from macintux
at https://github.com/trevorriles/cuttlefish/commit/c3049831072a7798b248c6e605143c9a8ddb224d


merging trevorriles/cuttlefish/fix/erlang18 = c3049831 into borshop-integration-197-fix/erlang18


trevorriles/cuttlefish/fix/erlang18 = c3049831 merged ok, testing candidate = 60643cb0


Perfecto, en el proximo commit lo añado a mensajes xml ;)


remove this file


FWIW, the author abandoned BeCJK and gave it to me to put in HaikuArchives, so the correct place to get it is https://github.com/HaikuArchives/BeCJK (might as well upstream the patch too).


Si, mejor. Lo añado en el proximo commit y mergemos ;)


I'd make those fields private to keep it consistent with the rest of the classes.


@jfoug thanks, this is now reverted.


Are you ok with the psuedo-documentation model I've adopted anyway?


or put the folder in the .gitignore file of the project


Should be `CMake`. Also, maybe `A native GUI for CMake` would be better here?


Ok... I will be more aware next time.


I can not stop typing galleries. It's driving me nuts! :)


I think that this http://lsrpg.readthedocs.org/en/latest/index.html is the best we can do. I will create pull request


Prefer .tar.gz GitHub archives -- e.g. for this it should be [https://github.com/AdrianArroyoCalle/cmake-haiku/archive/a42d55b93d8d7c1e3b19a31f4ee85f63441c4975.tar.gz].


Those helper methods from JDigiDoc's SignedDoc class are often used in ADIT project, so I needed them to make migration of ADIT to using DigiDoc4j library more convenient.


friendly fyi you can also just clearhead/clearhead here instead of the url (github.com is assumed by npm)


do you think backtick for uname is posssible to be removed? then please do it.


ditto


Accepted :+1:


Looks like a simple cmpeqps can achieve the same result as a x != x when working correctly. Got it to compile to this:

push    ebp
mov     ebp, esp
and     esp, -8
mov     eax, DWORD PTR _r$[ebp]
vxorps  xmm0, xmm0, xmm0
vmovq   xmm3, QWORD PTR [eax]
vpcmpeqd xmm0, xmm3, xmm0
vpblendvb xmm0, xmm3, XMMWORD PTR ?m_one@GSVector4@@2V1@B, xmm0
vpshufd xmm2, xmm0, 85
vmovaps xmm0, XMMWORD PTR ?m_max@GSVector4@@2V1@B
vcmpeqps xmm1, xmm2, xmm2
vblendvps xmm0, xmm0, xmm2, xmm1
vpunpckldq xmm0, xmm3, xmm0
vmovq   QWORD PTR [ecx+1512], xmm0
mov     esp, ebp
pop     ebp
ret     4


@jbrooksuk - sorry for not-so-smart question, but what branch does this commit belong to?

i'm unable to see it neither in `master` nor in `1.1`

Is it a part of not-yet-closed pull request?


Actually, I do not think it would work at all.   You had 32 bytes in the buffer to start with, then append 30 more.  That's 62 bytes and blows the 1 55 byte buffer out of the water.  Flat dynamic format is required here.


You seem to have handled os... what's still to do for ext?


It may be a good idea to invoke `umask()` prior to the `mkdir()` call since the file permissions will be affected by the umask setting.


일반적으로 이렇게 하지 않고 서버쪽에 sync하는 API가 있어서 그럴 사용하는데 지금은 그 API가 없어서 이렇게 하거나 좀 복잡하게 해야 하는데 이 경우는 그냥 넘어가도 좋을 것 같다. ^^;


Sure, I think `a == macro!()` where `macro!()` just outputs an ident would be enough as a test


It made reference to the human "list" idea, not a C++ `std::list`-like.
But I changed it.


Can you use `mockito` in the test code and remove this method?


Googleにインデックスしてもらえるように、ウェブマスターツールを登録しとうと思ったんだけど、なんかうまくできない。😓


replace ``Artifacts available...`` with ``Artifacts listed above are available.....``

Also, start on a new line with the word ``Initial...``


> You can check architectures conflict in cmake/projects/<packagename>/hunter.cmake file and report hunter_broken_package with informative error message.

I am not sure if we should treat them as broken packages, because I don't think that they are broken. Maybe this multi-arch tree structure would solve this problem.

> We don't need to use Polly here, hunter_finalize should be enough.

Thank for pointing that out, it was very helpful. I see now that there is where `${HUNTER_INSTALL_PREFIX}` is created.

I was fighting for hours with
```
set(CMAKE_XCODE_ATTRIBUTE_HEADER_SEARCH_PATHS[sdk=iphoneos*][arch=${arch}] "$(inherited) ...)
```
it does set the include search path inside the Xcode project, however it is not being picked up by the command line build when doing a build with `polly/bin/build.py`. Would you have any idea of why? I will finish the implementation and push into a separate branch so you can have a look. To test if that variable works, I have been adding a random directory to that variable for all `archs` and looking at the output of the compilation to validate that the setting is read.

I tried running `xcodebuild` through the command line with
```
xcodebuild -arch armv7s -target odb-sqlite-example -sdk iphoneos8.1 -project odb-sqlite-example.xcodeproj
```
and still don't see what I added.

Also, when using `build.py`, all I get is a `armv7`. I am using your patched version of CMake 3.2.1. Is this expected?

I guess I will have to start digging into CMake's source to understand the interaction with `xcodebuild`  better.


如果已经有人提交过， 建议不要覆盖。


"kern"? It is kernel.core_pattern here.


@asmecher Ok, I think I've addressed all the issues in subsequent commits. Thanks for the code review.


Close bracket without open bracket


I think it is clear enough now, thanks!


does this mean we can't use the CLEAR method from the Cache object any more?


The nv_dds one actually contains a serious bug with the color format recognition. The masks are reversed for GL_RGB for example :P


##Oliver and Cary's project initially created for a hackithon.

You can play a playable version on https://oliverdeb.github.io


> What about EXCLUDE_FILES option to hunter_autotools_project function?

Maybe what is generated from platform specific code could use useful, like the sqlite command line client. But this can be an idea,  yes


然后我发现我以前翻的文件因为今天重新pull之后有两大段中文翻译
我自己来删除一下？Researches.AlienSingularityCore.txt和Researches.AlienSniperPlasma.txt有2段译文。表示很惶恐。

On Mon, Aug 3, 2015 at 9:10 PM, 云风 <notifications@github.com> wrote:

> 如果已经有人提交过， 建议不要覆盖。
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/pri17/xenonauts/commit/5c4c8256009abd3e608ca76df0a7c2c5c28fb28c#commitcomment-12493071>
> .
>

--
 You are not who your past says you are.
 You are who you choose to be!


Hrm, so what I think would be nicer is if you asked the volume cache manager for a path for a given key and it returns that.  That way you could just do

```js
let cachePath = task.runtime.volumeCache.getCacheLocation(cacheStr);
```


@GrahamCampbell I dun goofed.


This has the same effect that adding the efx nightly repo in cdc2b61 had: various bundles are now downloaded from the RAP repo rather than the other, stable repos, and those bundles are newer than the ones in the stable repos.

I really don't know if this is good or bad.

It ought to be switched back to a stable repo soon, and certainly well before the 4.2 release. Otherwise the build could be a bit... unpredictable.


``Initial partial...`` very hard to understand. ``Partial matching of beginnings of words ?`` or is it ``Full matching of beginnigs of words ?``


Yes. It’s no longer an object but a tied hash. That seemed more sensible if there were other parts of external codebases assuming it was a tied hash they could just empty the same way the xref code did.
> On 3 Aug 2015, at 14:12, Magali Ruffier <notifications@github.com> wrote:
>
> does this mean we can't use the CLEAR method from the Cache object any more?
>
> —
> Reply to this email directly or view it on GitHub <https://github.com/Ensembl/ensembl/commit/4f8c3713a1447edff1a5f8eb4baf5cb0e4c16be9#commitcomment-12493115>.
>


Later reverted as we ran into trouble with Koha: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14637


OK, good.


> What about EXCLUDE_FILES option to hunter_autotools_project function?

Maybe that is generated for the target specific build could be useful, as the sqlite  command line client. But this can be an idea, yes. Let's see how things evolve for a multi-arch tree, and if they don't evolve, we can fallback to `EXCLUDE_FILES`


Did you check if input with type=color could be enough for that (instead of adding a new JS lib) ?


@benbc I've removed the lines above but github is showing them there in this PR. My fork, which this PR is based on does not have it


You should probably use the https://docs.python.org/2/library/tempfile.html module instead of using a set tmp folder.


Those not listed where ? in the named-components ? In all three lists below ? In the one above ?


> est-ce que selon toi, la dette technique engendrée par cette course (que tu as bien décrite) pourrait devenir critique au point que l'on se paie une explosion de bulle ou est-ce que c'est peu probable ?

Personnellement, cette dette technique ne m'inquiète pas. C'est pas nouveau, on en a toujours plus ou moins fait les frais et on s'en ait toujours sortie assez bien. Sur HTML au début (1990-2000), sur CSS ensuite (2000-2010) et sur JavaScript aujourd'hui. C'est un peu un passage obligé dans la maturation des technologies du Web. Ce qui se passe avec JavaScript c'est que les possibilités du langage sont bien plus étendu et le nombre d'API à disposition en inflation constante, cela sur 2 front: Du coté des navigateur qui on désormais une cadence de mise en oeuvre industriel avec 1 à 2 nouvelles API toutes les 6 semaines (avec du bon comme du mauvais) et du coté des dev web qui produisent des bibliothèques et framework comme Jesus multiplie les petits pains au lait (idem, du bon comme du mauvais).

Maintenant, est-ce qu'on va vers une explosion de bulle ou un truc du genre. Ben je dirais oui, sans doute, mais là encore ça ne m'inquiète pas. C'est pas comme si ça n'était pas déjà arrivé. Par exemple, il a fallut du temps pour qu'on sorte du merdier de CSS3 et même si ce n'est pas parfait ça s'est méchamment assainie. Pour CSS ce qui a sonné le début de la fin du merdier, ce sont les pré-processeur (puis maintenant les post-processeur). Pour JS, se "trop plein" va sans doute avoir un effet intéressant que je peux déjà voir: Une forme d'écœurement. J'y voie deux conséquence à moyen/long termes:
1. Chez les dev web, les bibliothèque vont, par un effet de selection naturel se réduire à celles qui sont utile plus quelques autres sur des marché de niche et les quelques "pet project" qu'on a tous (a titre d'exemple, jQuery a gagné la guerre des bibliothèques généralistes de manipulation du DOM).
2. Chez les constructeur de navigateur le résultat sera plus dangereux/interessant/stressant/existant (rayez les mentions inutiles). Le sens actuel du développement des navigateurs indique que l'on va vers l'émergence de navigateur "runtime" qui ne seront plus que des machine virtuel pour executer du code. Ce faisant je pense qu'on va voir émerger plusieurs web très différents: D'une part le Web à la papa qu'on connais actuellement (même s'il est vrai qu'il se sophistique beaucoup) et qui répond à beaucoup de besoins (si ce n'était pas le cas, on ne serais pas là ou on en est aujourd'hui). Mais d'une autre part on va voir aussi apparaitre un web "à la Flash", une espèce de version standardisé de ce que proposais cette technologie propriétaire avec d'un coté des IDE dédié et de l'autre des technology de compilation adapté (en gros, ce qu'on peut déjà faire avec ASMJS et WebGL mais qui va radicalement évoluer dès que [WebAssembly](https://github.com/WebAssembly/design/blob/master/FAQ.md) commencera à être implémenté)

Bon en résumé: Certes c'est le bordel en ce moment, mais bon ça toujours été ça le Web, hein. Y'a-t-il matière a s'inquiété? Ben, pas plus que par le passé. Est-ce que l'avenir est sombre et froid ? Non, enfin pas plus qu'en 1995 quand certain on commencé à évoqué un truc qui s'appelait CSS et qui nous à conduit à la fin du Web tel qu'on le connaissait à l'époque :)


In addition, just to be safe, you way want to run the ``tarfilename`` via ``werkzeug.secure_filename()``


1: M111 unrecognized component name: oauthclient


4: L102 copyright year is outdated, expected 2015 but got 2014
54:1: I201 Missing newline before sections or imports.
58:1: I201 Missing newline before sections or imports.
86:13: B901 blind except: statement


4: L102 copyright year is outdated, expected 2015 but got 2014
58:1: I201 Missing newline before sections or imports.
59:1: I100 Imports statements are in the wrong order. from invenio_oauthclient.models should be before from invenio_oauthclient.views.client


4: L102 copyright year is outdated, expected 2015 but got 2014


I would add a rule to generate the source, add it to pre_gen, and introduce a config in the kconfig's to build it... what do you think? by the way, since it's a "test", can't it move to tests or samples?


Er denne løst nå?


TeamCity MonoGame :: Develop (Win) [Build 3.5.0.447](http://teamcity.monogame.net/viewLog.html?buildId=9331&buildTypeId=MonoGame_DevelopWin&guest=1) is now running


아. 이건 모를 수 있다.
수업시간에 설명해줄께.


Interessant!


Are the two lists of the omerozips and zips actually a part of the named components list ? The formatting here is a bit unfortunate.


Treats it correctly, I would hope! The corresponding a_j's are all zero, so that term is $c_k e^0 = c_k$.


One less on my to-do list. Thank you. :+1:


adblock been removed. This translation is no longer needed.
Revert please


**[unitTests_php_branches run failed](http://qa-s2.wikia-prod:8080/job/unitTests_php_branches/18622/testReport/) for this commit**


Well, not supported by IE
http://caniuse.com/#feat=input-color


I'll sort this fuck up, lol.


ok will refactor accordingly


O certo não é o sandbox.moip.com.br ?


Double quotes ;)


http://localhost:8000/clientservermodel will still match.  $ will help.


It would probably be better to restrict the application of datepicker by adding a `.not(...)` clause to the jquery selectors in `activateDatePicker()`.


Kunne vi vært mer eksplisitte i selve applikasjonen? Vise på noen måte at den er eller ikke er klar (Ru nevnte en "spinner" eller noe inntil vi er klare).


Just **5663** more to do.


Please make sure to use minified version of this script for production.


See: 	http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14637


Checkmarx scan results 03 Aug 2015 16:20


I was expecting that ^ :facepunch:


some tests failed:
failure: http://buildbot.bos1/builders/test-cuttlefish/builds/156


If it's possible, try to put JS files in the footer.


Checkmarx scan results 03 Aug 2015 16:23


이렇게 하면 bookmark하게 되면 이슈가 있으면 url을 변하게 바꾸는게 좋겠구나.


Ну да, удобно. На чем писали?
п.с. в qt нет классов для работы с yaml, только если использовать сторонние библиотеки, либо свой парсер писать =)


Hi there @pritisarap12

This looks like some nice stuff you're adding here. I just miss the PR for this?
I mean, people have been recently discussing about commits to master having to go through a PR and getting 2 LGTMs, before getting merged.
Maybe you forgot, or missed that discussion, or I'm not seeing the merge commit.

Anyways, just wanted to check with you.


I have realized that *all* panels are instantiated on application startup. Therefore I have removed #752 from our current milestone (it doesn't matter when we'll deal with this as it isn't specific to our viewer) and made a suggestion there. I'll wait on Wilbert commenting on it before doing anything, though.


Эти три сценария характерны для чекеров, а здесь нужно прорабатывать сценарий с пустым репортом без ошибок, с наполненным репортом без ошибок и репортом с ошибкой.


I think this bit asks for an example, or rather more of them to illustrate the possibilities here.


I meant that I had this one specially highlighted for fixing.
As for all the remaining NPCs, there are many "utility" NPCs (triggers, spawners, visual and such) that could probably be fixed almost automatically.


лучше problems, это же список :)


Thinking whether multiple methods annotated by @Init should be allowed to occur in the object hierachy. This fixes the problem of overriden methods (so far correct), however you still get multiple invocations when methods do have different names. In my view this behavior is a bit untransparent & should be changed if there's no serious need for it.


잘 만들었네. 내가 생각했던 모습과 가장 가깝다. ^^


Why not change this to `connect.static = require('serve-static');`?


이 부분은 매번 바뀌는게 아니라 로딩할 때 한번만 확인하면 될 것 같아.


Since the OSX port probably uses Clang (tell me if I'm wrong), wouldn't it be better to `#define thread_local __thread` since the keyword `__thread` is roughly equivalent and has been supported for longer?


Also fixed support for flavour-induced render additions, so that @StoneWaves revolver works >_>


부분적으로 debugger 키워드는 삭제해주라 ㅎㅎ.


Kind of odd, first time I try to build (using haagch's PKGBUILD: https://aur4.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=osvr-oculus-rift-git)
it fails with the following error:
```
CMake Error at /usr/share/cmake-3.2/Modules/WriteCompilerDetectionHeader.cmake:250 (message):
  write_compiler_detection_header: FILE parameter missing.
Call Stack (most recent call first):
  CMakeLists.txt:23 (write_compiler_detection_header)
```
If I try to build a second time, it builds fine.


This has been taken care and pushed to https://github.com/ensoftek/openemr/tree/ensoftek_mu2_cqm


Hi again, I see the "this closes" message!
Sorry for the noise :)


呃, 话说那些稀疏的值们都是需要应对的, 讨论会上大家不都说了一些方法加以处理么, 你们还没考虑?
总之, 如果过程不对, 再好的结果都没有意义哦.
@yixun08 @KyLinXYL 本周三上午有空就参加组会, 中午聚餐.


@markbenvenuto, just wanted to let you know that we've just pushed a new version of the read/write lock code that's not endian-dependent.


> Frankly I'm not that familiar with the bundler ecosystem, there may be a simple way to say "ignore this dependency", I just don't know one. Anyone?

Writing Anyone will not get anyone to see this :)
especially since this comment is part of the commit, not of the PR.
If you know about specific ManageIQ devs who can assist, please add their user names here.


WindowComplexManager_Speedup (DeadParrot) - i386-Windows-7-VisualStudio-12: OK (1720 of 1778 tests passed)

![Build Badge](http://img.shields.io/badge/build%20status-passing-green.svg) ![Test Badge](http://img.shields.io/badge/tests%20passed-96.74%25-yellow.svg)


What do you use the material icons for ? Do you think that material icons and w3.css will change often ? If not maybe it's better to download those files and store them on our machine (just in case CDNs are down) ?


##demo3
>demo3是一个简易的listview的实现，每点击一次最后的添加字符串就会增加新的ListItem，这里使用了外部的css，可以看出比demo2的代码量减少了不少，这里的item是不会动态的调整的会一直添加到state中，之后会改进


A single, modifyable InfoHolder class (instead of three - "abstract" and two impls) could satisfy both flows, isn't it?


You are right, I will remove this soon.

Thanks @ohnx :)


yes we are always reporting calendar years


:+1: on licensing change. For the record.


Test writedown on post commit.


Deberías de dejar de jugar, y compilar. El tiempo no es excusa.


actually im reverting this

causes bootloop on opo


Lol xD
On Aug 3, 2015 7:04 PM, "Varun Date" <notifications@github.com> wrote:

> actually im reverting this
>
> causes bootloop on opo
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/ResurrectionRemix/platform_manifest/commit/17c683ca82547af002643232224ca94a714a66da#commitcomment-12493670>
> .
>


I only had time to take a quick look (I'll dig deeper into this later), but I could confirm that the midiinput tool was not initialized in the same way (but rather on use). @uliska did you compare that?


$eachFile has the file name with complete path and so, it did not work with check_file_dir_name()


same as above


Macro for quickly adding loading the python debugger.


This has been taken care and pushed to https://github.com/ensoftek/openemr/tree/ensoftek_mu2_cqm


the key column is for transition durations
https://github.com/tdhock/animint/wiki/Advanced-features-present-animint-but-not-in-ggplot2#use-aeskeyvariable-for-constancy-in-smooth-transition-durations
(defined by animint)

the group column is for determining separate lines, ribbons, etc to draw
(defined by ggplot2)

On Mon, Aug 3, 2015 at 8:59 AM, Tony Tsai <notifications@github.com> wrote:

> @tdhock <https://github.com/tdhock> After determining the common columns
> and saving the common chunk, we can remove NAs for the resulting recursive
> data.frame list.
>
> Due to the different number of rows in each varied chunk, the former
> joining by index is not appropriate in the copy_chunk function in the
> renderer. We should join by key, so the key should be saved to each varied
> chunks if it is present.
>
> Another question confused me is the difference between key and group
> columns.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/tdhock/animint/commit/eea107b6ce2e55c5ef693494b2b97a65deba0324#commitcomment-12492818>
> .
>


I've never really used it.


the arg is just 'session', not 'Session *session'


awesome!


and teh static_cast takes angle brackets < > around the type (Session*), then parens around the argument


Why untransparent?
You're simply saying that you want to execute this piece of code to initialize/verify the fields in this class. That does not need to be related to the superclass, and you should not be bothered by calling super.init() at the beginning.
I'm only in doubts whether private @Init methods should be allowed. From the point above, they should (but are not currently as we don't call setAccessible(true)).


Enable/disable indentation for pasting and show the pasting status in the status line (via [vim.wikia](http://vim.wikia.com/wiki/Toggle_auto-indenting_for_code_paste))


Pinging @djazayeri, see my comment above


Awesome.


I know I'm being picky, but `:projects_by_name` seems slightly better – what do you think?


Can you please help me with packets on github.com/MineServerProject/Mineserver? Don't make any PR's I'm rewriting it but I don't know hoe to do packets. Thanks.


TeamCity MonoGame :: Develop (Win) [Build 3.5.0.447](http://teamcity.monogame.net/viewLog.html?buildId=9331&buildTypeId=MonoGame_DevelopWin&guest=1) outcome was **SUCCESS**
Summary: Tests passed: 538, ignored: 6 Build time: 00:23:30


v


Just for the info: I have checked the docs and read the source of `child_process` there is no harm to increase the `maxBuffer` (I've set to `Infinity`). The reason it exists is to avoid costing too much memory when using the callback syntax. It should be fine when using stream. The low level `spawn` doesn't have this option because it returns a stream.


No I had this issue cause (I guess) "Advanced URLs" module .. I had already wrote to the developer reporting what I have found.

It seems it wrongly make the HP controller being valorized with the value "product" .. but it's only what I dug, my opinion


It's "epidemie", like below.


    msg += " / ".join(LINKS.keys())[3:] + "?"

would do this, too :)


thank you


Tried to eliminate code from AnnouncementsPreferencesController.java and from AnnouncementsViewController.java and it seems to work well without it. Not sure why, since I thought the definition in the xml file having "AnnouncementsViewController.respondr" meant the property had to be set in the controller files.


Noted


Not yet. But I read `panelmanager.loadPanel()` and double checked with the quick insert tool.


"Aan/uit zetten van geïnfecteerden van de ontdekte epidemie"


너의 로직은 동기적은 상황에서만 적절하게 동작하지 지금처럼 xhr을 사용하여 비동기적 코드에서는 정상적으로 동작하지 않는다.
하나의 예를 들면, add을 할 때 이상적인 흐름은 아래와 같을 것 같아.

- online일 때
 - xhr로 서버에 저장한 후
 - `callback`에서 돔을 추가한다.

- offline일 때
 - localStorage에 저장하고
 - dom을 추가한다.

offline에서 online이 될 때
- localStorage에 저장한 값을 서버에 전송한다
- `callback`에서 localStorage을 지운다.

너의 코드를 보면 아래와 같다.
- online/offline 상관없이 localStorage에 저장한다.
- 무조건 callback이 실행된다.
- online이면 서버에 저장하고 localStorage에 저장한다.

만약에 xhr이 실패하면 너의 코드는 어떻게 동작할까?
online/offline구분없이 동작하게 되면 불필요한 작업을 하는건 아닐까?

좀 더 고민해보면 좋겠구나.


Hi Thorsten,

thanks for your reply.
I am looking forward to seeing the solution you described.
I can still use the solution I created myself until you release this feature.

Thanks,

Thomas


This has been taken care and pushed to https://github.com/ensoftek/openemr/tree/ensoftek_mu2_cqm


kjg


where is the code?


This may be bit misleading due to the fact that the intention is to return always a single element in the query as names are meant to be unique. We are using here `where` so we have an array but still this is going to be a single element in that array. What do you suggest?


we have taken care most of the above suggestions/findings and pushed to the branch  https://github.com/ensoftek/openemr/tree/ensoftek_mu2_cqm


`midiinput.tool.MidiInput.__init__()` is executed on application startup.


Looks great @nblair ! I think lets leave the @Deprecated methods until we do a major release.


이렇게 하면 한번에 dom을 넣는것에 비해 비용이 크다.
한번 고민해보면 좋겠구나.


ouch


It would be. I'll change it.

On 08/03/2015 09:20 AM, Gregory R. Warnes wrote:
>
> It would probably be better to restrict the application of datepicker
> by adding a |.not(...)| clause to the jquery selectors in
> |activateDatePicker()|.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/warnes/irrigator_pro/commit/66e11c57d56cf09f83e31186730a028a5ac4c2db#commitcomment-12493350>.
>


Should this override have been removed as well? We were forcing all links to open in external browser.


I wonder if $evalAsync or $applyAsync would accomplish the same thing?


I hope they start banning the word idiot too, as it has no possible positive meaning, just like retard. Oh also the word nerd, since I was bullied as a kid with that word and reminding me of that is offensive.


@atfornes same here. There might be more creates, and it depends on the context to use one word or another (think in other languages). Besides, it is better to use interpolation, as some languages might put the name before the verb

I am changing this to add a button


Canola instead of canole


Тогда был RoR, сейчас юзаю Laravel, тут языки на пыхе нативном, но структура точно такая же - `return ['key' => 'value'];`. Ещё стоит не забывать про фильтры, например `{{hour|1}}` превращать в _1 час_, а `{{hour|10}}` в _10 час**ов**_


`Context` is usually the first argument in existing API, so perhaps we should have it the same way for consistency.


Are we reintroducing type?


La idea de este port es para portar la biblioteca a otro hw y tambien a otra biblioteca de recursos matematicos.


Snoop Slayer


Magic


@Jerome can you add an attribute to refer to the filepath of what is analyzed
```xml
<MediaTrace ... ref="/where/is/my/file.mkv">
```


Should also fix https://github.com/KleeGroup/focus-components/issues/159


Yo creo lo mismo, es una transcripción del serialDevices y la única diferencia es que se llama al open del layer en lugar del open del device, que entiendo que es lo correcto. Ya mejoro eso y la cabecera de revisiones


이렇게 코드를 많이 짜곤 하니 익혀두면 좋겠다.


There's probably some much cleaner and more efficient ways of doing this, but it works at least.


Estas viendo un parcial, lo que hice fue solo sacar un retorno de carro en el medio de los parámetros para que tenga el mismo formato que el resto de las funciones, donde esta todo escrito en una linea en lugar de en tres lineas.


Thanks, I learned something.
I played with the graphs and indeed it takes on average more games to reach a conclusion
with a Tweak test.

So paradoxically, it is easier to add complexity then simply "tweaking".
Or the other way around, a Tweak test is "safer" than a Standard Test,
but will consume more resources.

Just curious, have you ever computed the probability to pass a new test
STANDARD STC + LTC
and then right after this, remove the new test with a
SIMPLIFICATION STC + LTC


This has your home absolute path


Sorry I don't know how to make suggestions, so I put the suggestion on this comment.

I don't know whether somebody can consider the suggestion that put all the instantiate of File and InputStream and OutputStream into IOUtil.java, just like a factory.
Such as using:
File file = IOUtil.getFile("fileName");
InputStream is = IOUtil.getInputStream(file);
instead of:
File file = new File("fileName");
FileInputStream = new FileInputStream(file);

as well as the SeekableStream in SeekableStreamFactory.java

So that we can implement the InputStream and can operate other file systems such as hdfs.
Without this change, it is a hard work make the package compatible with hdfs because here are so many code to change.


Yeah, after talking in person and taking a closer look, this looks fine.


We're in agreement on having .Equals and .GetHashCode overrides, I'm not arguing Reference equality is enough on it's own, but it still makes sense to check for it first in the .Equals override (on reference types).

```csharp
public bool Equals(T other)  // IEquatable<T> where T : class
{
    if (other == null)
        return false;

    if (this.ReferenceEquals(other)
        return true;

    // Identity checks
    return this.Name.Equals(other.Name) &&
           this.Something == other.Something;
}

public override bool Equals(object obj)
{
    var other = obj as T;
    return other == null ? false : Equals(other);
}
```

Full value equality on reference types is usually not needed, but choosing which encapsulated members  represent uniqueness in identity equality I think is the point of contention here.  This is completely subjective, therefore it's not necessarily a pure architectural design decision.  Your current code says that the name alone is enough, I'm worried about it being a bit fragile, especially since there's no pure immutability here (your identity equality is built on properties with public setters).  I assume this was done for serialization.

Mentioning true value types (structs), definitely use IEquatable every time with these if you have any (I don't remember seeing any in this project).  Unlike reference types, these actually tend to have nice moderate performance boosts depending on the struct complexity.


BenjaminSiskoo reports this commit broke Albert Odyssey's line scrolling at the title screen: https://github.com/Yabause/yabause/issues/27


This fixes the scrolling problem, but I'm unable to tab out of the link.


Me parece bien. En breve lo corrijo.


Redundant curly braces around a hash parameter.


보통 애니메이션이 초반에 보이면 좀 느리게 생각해.
그리고 get부분에 매번 append하지 말고 한번에 하면 좋다.


Agreed. Useful improvements.

(might suggest changing 'tested by disabled people' to 'tested with disabled people', but it's not essential)


Solo paso el tercer parámetro a la misma linea, es para seguir el formato o de las funciones del serial o del resto de funciones de ese archivo (No me acuerdo respecto a  cual pero estaba distinta).


Ideally the issue won't exist in 1.6, see this thread: https://github.com/golang/go/issues/11887


Glad you were able to get the server running! No, no symlinks on FAT, but I figured that FAT partitions would be mounted noexec so we'd need to not be there in the first place. In any case, these symlinks are just little wrappers, not required.


use {this} instead of the card name


Does it mean that I can setup the appliance with cdrom and next time it will boot from the disk?

It could be usefull for the HP


Oops, sorry about that. Will fix that in a minute.


> Logically it makes sense that IsPassive, forceAuthn etc. should be
bound to a resource (e.g. Location). Shibboleth implements this but
it's not obvious. My suggestion would be to add config items for
things like IsPassive, forceAuthn etc. (e.g. what's in [2]_).

The reason there aren't any such configuration item at the moment is mostly due to the complexity of implementing it combined with the lack of clear use-cases for it.

To deal with the parameters independently:

- IsPassive: If one triggers a passive authentication, one needs to handle the error in some way. Presumably the reason for using passive authentication is that you want the user to be automatically logged in if possible, but still allow unauthenticated users to access the site. That means that you need to somehow track that the passive authentication failed, and show the resource as an unauthenticated user. Also, you need to decide which requests should attempt passive authentications, and which should not. For example it makes sense to exclude things like seach bots, so that they can index your web site.

  An alternative way, that I think is far simpler, is to do it all with JavaScript. I.e. if an unauthenticated user accesses your web site, you show the page as normal. The page contains a piece of JavaScript that tries a passive authentication in the background (using an iframe?). If the authentication succeeds, it can update the page state to reflect that the user is authenticated. If it fails, or isn't executed for some reason, the user can still access the site as an unauthenticated user, and click the login button if they want to be authenticated. You should probably limit how often the JavaScript code attempts authentication, to avoid wasting resources.

  The last option should be possible with mod_auth_mellon today, but I haven't tested it.

* ForceAuthn: This option is a small nightmare. The goal is presumably to ensure that the user accesses a resource with an up-to-date authentication of some sort. The problem is easy if you apply it to your whole service provider, but in that case there is no need to set it in the authentication request. Just set it in the metadata, and the IdP will automatically apply it, both for requests from the SP, and for IdP initiated authentication.

  If you want to control it per resource, it becomes far more complicated. In order to ensure that the user doesn't bypass the ForceAuthn flag, you need to track the request and response, and update the session with some sort of flag indicating that this response is a result of a request where we had set the ForceAuthn flag.

  In addition, one needs to decide how this interacts with existing authentication. I.e.: You risk the following behavior:

  1. The user goes to https://sp.example.org/, is sent to the login page, logs in and is sent back.
  2. The user clicks the "admin-link", which goes to a resource that has the ForceAuthn flag set. The user is sent back to the IdP for authentication, confusing the user.

  I don't have any idea about the best way to deal with that.

> That doesn't have to be part of the ECP patch, it's a distinctly
independent work item that can be in introduced later.

I completely agree. I have basically postponed dealing with both of these options waiting for somebody to step forward with a need for them. I think it is easier to decide how they should work once somebody actually has a clear use-case in mind.


Yeah, I just moved the extracted code into its own file.


I was partly looking at the wrong place, sorry about that!

But there actually is a difference! We started off discussing the widgets. And the widget used by the midiinput tool isn't created until it's opened. (If my test now is correct!)


This implementation is wrong. The `available()` method in `InputStream` only returns the immediately available number of bytes that can be read. The proper method is to construct a loop on `read()` that ends when it returns -1.


> If I am going to call notify_waiting_players I need to call it from an instance of the GamesPlayer class, so this is why I created a new instance in the join action of the GamesController.

In the `GamesController`, when the line `@game.players << current_player` is run, that is already instantiating and saving an instance of the `GamesPlayer` class, so you don't need the extra line where you make a new `GamesPlayer` instance.

> I think I should have declared attr_accessor :game, :player in the GamesPlayer class if I am going to make those instance variables global to the class.

The `belongs_to` calls already take care of that. In fact, you don't need that initialize method either. When you declare `belongs_to :game`, what is really going on is this (very simplified version, since `belongs_to` has a lot of functionality available):

    def game
      @game ||= Game.find(self.game_id)
    end

    def game=(game_instance)
      write_attribute :game_id, game_instance.id
      @game = game_instance
    end

`belongs_to` infers the structure of the table based on the argument you pass it (`:game` in this case). Here is [the documentation](http://api.rubyonrails.org/classes/ActiveRecord/Associations/ClassMethods.html#method-i-belongs_to) to help you get a better feel for what is going on.

> Steve, as you can see I moved the h1 element into the div element with the custom data attribute you set up. I did this thinking otherwise I cannot get access to the data provided by the ActionCable.server.broadcast to that particular channel.

The `h1` and the `div` are just elements in the DOM, nothing special. As long as you have some way to find them (presumably based in the game id), you should be able to manipulate them when the subscription javascript receives an update via the websocket. I think semantically it makes sense to have the `h1` inside of the `div` since the two are related to one another in terms of how they will be used, but _technically_ it doesn't need to be that way.

> So how do I get the 'update' parameter in the data to the erb statement within the h1 element? I know the message is the second argument of the ActionCable.server.broadcast call and that it is JSON encoded. Do I need to add another custom data attribute some where and update that?

Now that you are sending a broadcast from the `GamesPlayer` class, the data that you are broadcasting (the `update: @game.number_of_players_needed` hash) is what will be passed into the `received` function of the `WaitingPlayersChannel` subscription javascript (in `channels/games.coffee`). So when the `received` function is called you'll have access to the DOM, which you can manipulate with the new value of how many players the game needs to begin.

I think what you will need to do is structure the html in the `waiting_area.html.erb` template so that you can easily change the number in the template. I generally approach this kind of problem like this:

    <div data-channel="game" data-game-id="<%= @game.id %>">

        Waiting for
        <%= pluralize @game.number_of_players_needed, 'player' %>
        to join

You'll need to put the number of players in it's own element that you can easily find in the `WaitingPlayersChannel` subscription javascript. In this case, you can find it using this: `@collection().find('#number-of-players')`. Once you find it you can change its text value to reflect the change in number of players.

===

I can tell I dumped a lot of stuff on you this last session. I guess in my haste to see the websockets working (which was pretty cool) I left you behind somewhat on the understanding of what I was doing. Don't hesitate to ask me any questions on other aspects that don't yet click.


I think this might be related, but all URLs other than the home page fail with a "no input file specified". This is apache 2.2, fcgi-php on FreeBSD.

```
10.100.1.1 - - [03/Aug/2015:23:59:56 +1000] [forums.ish.com.au/sid#802ab2070][rid#80a1670a0/initial] (2) [perdir /usr/local/www/vanillaforum/] rewrite 'categories' -> 'index.php/categories'
10.100.1.1 - - [03/Aug/2015:23:59:56 +1000] [forums.ish.com.au/sid#802ab2070][rid#80a1670a0/initial] (2) [perdir /usr/local/www/vanillaforum/] strip document_root prefix: /usr/local/www/vanillaforum/index.php/categories -> /index.php/categories
10.100.1.1 - - [03/Aug/2015:23:59:56 +1000] [forums.ish.com.au/sid#802ab2070][rid#80a1670a0/initial] (1) [perdir /usr/local/www/vanillaforum/] internal redirect with /index.php/categories [INTERNAL REDIRECT]
10.100.1.1 - - [03/Aug/2015:23:59:56 +1000] [forums.ish.com.au/sid#802ab2070][rid#80a1637c0/initial/redir#1] (1) [perdir /usr/local/www/vanillaforum/] pass through /usr/local/www/vanillaforum/index.php
10.100.1.1 - - [03/Aug/2015:23:59:56 +1000] [forums.ish.com.au/sid#802ab2070][rid#8029c60a0/subreq] (2) [perdir /usr/local/www/vanillaforum/] rewrite 'categories' -> 'index.php/categories'
10.100.1.1 - - [03/Aug/2015:23:59:56 +1000] [forums.ish.com.au/sid#802ab2070][rid#8029c60a0/subreq] (2) [perdir /usr/local/www/vanillaforum/] strip document_root prefix: /usr/local/www/vanillaforum/index.php/categories -> /index.php/categories
10.100.1.1 - - [03/Aug/2015:23:59:56 +1000] [forums.ish.com.au/sid#802ab2070][rid#8029c60a0/subreq] (1) [perdir /usr/local/www/vanillaforum/] internal redirect with /index.php/categories [INTERNAL REDIRECT]
```

Rolling back to the 2.1 .htaccess file fixed everything.


IT's only needed if you use the default effect rule text generation an it's using the target/filter description.
So if you set the effect text with setText there is no need to add a dummy target.


Thanks @atd, I agree with your observations


Mhmm! When I get home today I should be able to play with the
no-vrpn-required branch of the Oculus Rift support plugin, which apparently
has Linux in mind more than the current VRPN version. Once I get a working
instance of OSVR on my desktop it'll be a lot easier for me to get familiar
with the internals of the server and get to work in adding Cardboard
support / cleaning up the build system.

Say, I've never quite clearly been able to pin this down: Does the OSVR
server produce the shaders that the application uses, or just give the
application the HMD's configuration and let it figure out what to do with
it? Future development on interpolating shaders (ala Timewarp) would be
much easier on with the former approach.

On Mon, Aug 3, 2015 at 9:59 AM, Ryan Pavlik <notifications@github.com>
wrote:

> Glad you were able to get the server running! No, no symlinks on FAT, but
> I figured that FAT partitions would be mounted noexec so we'd need to not
> be there in the first place. In any case, these symlinks are just little
> wrappers, not required.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/OSVR/OSVR-Android-Build/commit/7407c1015389e2af8cac0c27dc7b417a6cd505df#commitcomment-12494323>
> .
>


should be named playerId


Right now it does the latter, but there's render stuff in the works to optionally pull that inside


Yes. Overriding the shouldInterceptRequest method was causing WebView to open links in itself, which is not its default behavior. So, no need of the override now.


We need to figure out how not to return just one element from the index action ;)


@GoodBoyDigital That makes sense, I'll revert it.


the text "damage" is missing


This is a breaking change and shouldn't land in a patch release. :(

The `true` default is also wrong IMO as BrowserStack doesn't have all devices available as real mobiles so just updating the karma-browserstack-launcher makes a lot of browsers fail.


readme document of AndroidCrypt


Ok lo del copyright. No entiendo lo de pasar a camel case, te referis a RtcsCfg.c.php? Porque los archivos ya se llaman de la forma Rtcs_...Cfg...php. Lo que me quedaría es pasar Rtcs_port... a Rtcs_Port...


please recheck latest commit


Alright, neat. I'm more of a fan of OpenVR's 'shading is handled for you'
approach, but not so much of its 'you have to implement support for your
HMD top-to-bottom'. Generic HMD shader production, or at least plugin-based
shader production, seems like an eventual must.

 I think the easiest first step for me to take on Android is to make the
wrapping APK, rather than the Cardboard support plugin, simply because
starting an NDK program with arguments and library path provided should be
pretty easy to do, and then I can avoid having to adb-shell or ssh into my
device to mess with the server. Once that's done, if I get Cardboard
support all the way working, it should be as simple as letting you choose a
pre-made configuration from a list in the OSVR server app (OSVR HDK,
Cardboard, etc).

On Mon, Aug 3, 2015 at 10:06 AM, Ryan Pavlik <notifications@github.com>
wrote:

> Right now it does the latter, but there's render stuff in the works to
> optionally pull that inside
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/OSVR/OSVR-Android-Build/commit/7407c1015389e2af8cac0c27dc7b417a6cd505df#commitcomment-12494469>
> .
>


:ok:


Ha!


> Also, when using build.py, all I get is a armv7

It depends on toolchain. If you are using universal one you must have 5 archs.

> I guess I will have to start digging into CMake's source to understand the interaction with xcodebuild better.

I'm pretty sure this is not needed :)

> What I think would be robust, is to move all files that differed in each architecture into a separate tree

What if we start with it, but add them using another approach - not in CMake code but in C++ code (?) Just create headers with the same name and do the switch inside:

```cpp
// header.hpp
#ifdef ARCHV7
# include <path/to/archv7/header.hpp>
#elif ARCHV7S
# include <path/to/archv7s/header.hpp>
...
#endif
```

By the way such approach is iOS framework creation friendly.


Não seria %database.name% ?


Arguably its the mailer that's under test, not the info request instance, but I've made the change in 3d0cbbc.

Related to https://github.com/mysociety/alaveteli/issues/975, https://github.com/mysociety/alaveteli/issues/974


develop (mjwitte) - x86_64-MacOS-10.9-clang: OK (1261 of 1261 tests passed)

![Build Badge](http://img.shields.io/badge/build%20status-passing-green.svg) ![Test Badge](http://img.shields.io/badge/tests%20passed-100.0%25-green.svg)


이렇게 하면 되야 하는데?


no fetch? push, merge?


develop (mjwitte) - x86_64-Linux-Ubuntu-14.04-gcc-4.8: OK (1264 of 1264 tests passed)

![Build Badge](http://img.shields.io/badge/build%20status-passing-green.svg) ![Test Badge](http://img.shields.io/badge/tests%20passed-100.0%25-green.svg)


Hi @mrpg, thanks for the pull request. Have you reported this on official issue tracker? I can merge this fix, no problem, but it will not affect the offical release because I keep this github version just for the purposes of tracking changes and simplifying integration and updating process for local deployment. The official releases are on SourceForge at the moment.

I probably have to make Ben Greiner aware about github copy of ORSEE, it is on my list, but I am busy now with other stuff. Perhaps he will consider switching to maintain it here rather than SourceForge for making it simpler and esier to maintain changes and accept commits from others.


А ну да, внизу окна конфигурационной программы добавлен общий лог


Use the FluidStack sensitive version of that method maybe? :3


Исправил


#을 붙이면 hashChange랑 크게 차이가 없다.
수업시간에 설명할건데 #이 아닌 Url의 형식이어야 해.


No need for StringBuilder


Does it work on your local machine when you select "Run as JUnit Eclipse Test?"


develop (mjwitte) - x86_64-Linux-Ubuntu-14.04-cppcheck-1.61: OK (0 of 0 tests passed)

![Build Badge](http://img.shields.io/badge/build%20status-passing-green.svg)


Should we put a `TODO` here to remove this lock in of protocol?