text:
package net.iaeste.iws.core.monitors;

import static net.iaeste.iws.common.utils.StringUtils.toLower;

import net.iaeste.iws.api.constants.IWSConstants;
import net.iaeste.iws.api.constants.IWSErrors;
import net.iaeste.iws.common.configuration.Settings;
import net.iaeste.iws.core.exceptions.SessionException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;

/**
 * This class serves as a safe-guard against too many login attempts. If more
 * than n attempts were made within a timeframe of x seconds, then the account
 * is locked for y minutes. Meaning, that until such time as the account is
 * again accessible, no further attempts can be made. Any attempt made will be
 * logged with a high log level to emphasize that this may be a potential
 * threat.

 *   This class is made as a Singleton, since all threads should be able to read
 * the same information out. It would make little sense to allow a user to make
 * multiple attempts, if we didn't share the information between the threads.
 *
 * @author  Kim Jensen / last $Author:$
 * @version $Revision:$ / $Date:$
 * @since   IWS 1.0
 */
public final class LoginRetries {

    private static final Logger LOG = LoggerFactory.getLogger(LoginRetries.class);

    // Singleton Instance Object & Lock Object
    private static final Object INSTANCE_LOCK = new Object();
    private static LoginRetries instance = null;

    // Data Map & Lock
    private final Object lock;
    private final Map<String, Retries> users;

    // Control Variables
    private final int maxRetries;
    private final long blockedPeriod;

    // =========================================================================
    // Object Instantiation Methods
    // =========================================================================

    /**
     * Private Constructor, this is a Singleton class.
     *
     * @param settings System Settings
     */
    private LoginRetries(final Settings settings) {
        this.lock = new Object();
        this.users = new HashMap<>(16);

        maxRetries = settings.getMaxLoginRetries();
        blockedPeriod = settings.getLoginBlockedTime();
    }

    /**
     * Prepares and returns the instance for this Singleton.
     *
     * @param settings System Settings
     * @return Singleton instance of this class
     */
    public static LoginRetries getInstance(final Settings settings) {
        synchronized (INSTANCE_LOCK) {
            if (instance == null) {
                instance = new LoginRetries(settings);
            }

            return instance;
        }
    }

    // =========================================================================
    // Public Methods
    // =========================================================================

    /**
     * Register User login attempt, if the User is already registered, then the
     * attempt will be registered and the first attempt will be marked. If the
     * User is already registered, then the registration will be updated.

     *   If the User have exceeded the maximum allowed retries and the the cool
     * down period is not over, then an Exception is thrown. If the cool down
     * period is over, the registration is reset.
     *
     * @param user User to register
     */
    public void registerUser(final String user) {
        LOG.debug("Registering User {} in the Login Retry Monitor.", user);
        final DateFormat format = new SimpleDateFormat(IWSConstants.DATE_TIME_FORMAT, IWSConstants.DEFAULT_LOCALE);
        final Date when = new Date(new Date().getTime() - blockedPeriod);
        final String key = toLower(user);

        synchronized (lock) {
            if (users.containsKey(key)) {
                final Retries retries = users.get(key);

                // If we have exceeded the max allowed number of login attempts
                if (retries.getAttempts() >= maxRetries) {
                    // then check if our calculated "when" is before the first
                    // login attempt
                    if (retries.getFirstAttempt().before(when)) {
                        // The login attempt is made after the cool down period
                        // is over, hence we'll reset the attempt and allow the
                        // User to try again
                        users.put(key, new Retries());
                    } else {
                        // User have exceeded allowed number of login attempts,
                        // and we're still within the cool down period... User
                        // is blocked!
                        final Date time = new Date(retries.getFirstAttempt().getTime() + blockedPeriod);
                        throw new SessionException(IWSErrors.EXCEEDED_LOGIN_ATTEMPTS,
                                "User have attempted to login too many times unsuccessfully. " +
                                "The account is being Blocked until " + format.format(time));
                    }
                } else {
                    // User has not exceeded the amount of Login attempts
                    retries.registerAttempt();
                }
            } else {
                users.put(key, new Retries());
            }
        }
    }

    /**
     * Get the time when the User Login attempts were first registered.
     *
     * @param user User to check
     * @return Timestamp for First Attempt
     */
    public Date getFirstAttempt(final String user) {
        final Date firstAttempt;

        synchronized (lock) {
            if (users.containsKey(user)) {
                firstAttempt = users.get(user).getFirstAttempt();
            } else {
                firstAttempt = null;
            }
        }

        return firstAttempt;
    }

    /**
     * Get the time when the time of the Last Login Attempt for the User.
     *
     * @param user User to check
     * @return Timedstamp for Last Attempt
     */
    public Date getLastAttempt(final String user) {
        final Date lastAttempt;

        synchronized (lock) {
            if (users.containsKey(user)) {
                lastAttempt = users.get(user).getLastAttempt();
            } else {
                lastAttempt = null;
            }
        }

        return lastAttempt;
    }

    /**
     * Retrieve the number of Retries for a given User. If the user is not
     * registered, then 0 (zero) is returned.
     *
     * @param user User to check
     * @return Number of retries or zero if unknown
     */
    public int getRetries(final String user) {
        final int retries;

        synchronized (lock) {
            if (users.containsKey(user)) {
                retries = users.get(user).getAttempts();
            } else {
                retries = 0;
            }
        }

        return retries;
    }

    /**
     * Removes a user that has been successfully logged in (Authenticated).
     *
     * @param user User to remove
     */
    public void removeAuthenticatedUser(final String user) {
        LOG.debug("Removing User {} from the Login Retry Monitor.", user);
        synchronized (lock) {
            users.remove(user);
        }
    }

    /**
     * Internal Class to hold the information we need to handle login retries.
     */
    private static final class Retries {

        // First attempt cannot be altered
        private final Date firstAttempt = new Date();
        private Date lastAttempt = new Date();
        private int attempts = 1;

        public void registerAttempt() {
            this.lastAttempt = new Date();
            attempts++;
        }

        public Date getFirstAttempt() {
            return firstAttempt;
        }

        public Date getLastAttempt() {
            return lastAttempt;
        }

        public int getAttempts() {
            return attempts;
        }
    }
}


text:
import swal from "bootstrap-sweetalert";

import Screen from "./screen.js";
import { startTimer, showElement } from "../util.js";
import { getDrawingCanvas } from "../canvas.js";
import { HIDDEN, DRAWING, WORD, FIRST_WORD } from "../../shared/enums.js";

/* global $, ga */

class Game extends Screen {
    constructor(onWait) {
        super();

        this.id = "#game";
        this.onWait = onWait;

        this.wordInput = $("#game-word-in");
        this.timerDisplay = $("#game-timer");

        this.neighboringPlayers = $("#neighboring-players-container");
        this.leftPlayer = $("#previous-player");
        this.youPlayer = $("#you-player");
        this.rightPlayer = $("#next-player");

        this.canvas;

        this.submitTimer;

        window.addEventListener("resize", this.resizeCanvas.bind(this), false);
    }

    initialize(props) {
        super.initialize(props);
        const doneButton = $("#game-send");

        //bind clear canvas to clear drawing button

        //if user touches the canvas, it not blank no more
        $("#game-drawing").on("mousedown touchstart", () => {
            //if this is their first mark
            if (
                this.canvas.isBlank &&
                this.timeLimit > 0 &&
                !this.submitTimer
            ) {
                //start the timer
                this.displayTimerInterval = startTimer(
                    this.timeLimit,
                    (timeLeft) => {
                        this.timerDisplay.text(
                            `${timeLeft} left to finish your drawing`
                        );
                    }
                );
                this.submitTimer = window.setTimeout(() => {
                    //when the time runs out...
                    //we don't care if it is blank
                    this.canvas.isBlank = false;
                    //submit
                    this.onDone();
                    ga(
                        "send",
                        "event",
                        "Drawing",
                        "timer forced submit",
                        this.timeLimit
                    );
                }, this.timeLimit * 1000);
            }
            this.canvas.isBlank = false;
        });

        doneButton.click(() => {
            this.onDone();
        });

        //run done when enter key is pressed in word input
        $("#game-word-in").keypress(({ which }) => {
            const key = which;
            if (key === 13) {
                this.onDone();
            }
        });
    }

    show() {
        super.show();

        if (this.rocketcrabMode) {
            this.setSubtitle("🚀🦀");
        } else {
            this.setSubtitle(`Game code: ${Screen.getGameCodeHTML()}`);
        }

        //allow touch events on the canvas
        $("#game-drawing").css("pointer-events", "auto");
        this.done = false;
    }

    showDrawing(disallowChanges) {
        if (!disallowChanges) {
            this.canvas = getDrawingCanvas();
        }

        let shouldShowUndoButtons;

        showElement("#game-drawing");
        this.show();

        if (this.timeLimit > 0) {
            this.timerDisplay.text("Begin drawing to start the timer.");

            if (this.timeLimit <= 5) {
                //if the time limit is less than 5 seconds
                //	don't show the undo button
                //because players don't really have enough time to try drawing again
                //	when they only have 5 seconds
                shouldShowUndoButtons = false;
            } else {
                shouldShowUndoButtons = true;
            }
        } else {
            this.timerDisplay.text("No time limit to draw.");
            shouldShowUndoButtons = true;
        }

        if (disallowChanges) {
            //lock the canvas so the user can't make any changes
            $("#game-drawing").css("pointer-events", "none");
            shouldShowUndoButtons = false;
        }

        this.showButtons(shouldShowUndoButtons);
    }

    showWord() {
        showElement("#game-word");
        this.showButtons(false);
        this.show();
    }

    showButtons(showClearButton) {
        if (showClearButton) {
            showElement("#game-drawing-redo");
            showElement("#game-drawing-undo");
            $("#game-drawing-redo").addClass("disabled");
            $("#game-drawing-undo").addClass("disabled");

            showElement("#game-draw-buttons");
        } else {
            $("#game-drawing-redo").addClass(HIDDEN);
            $("#game-drawing-undo").addClass(HIDDEN);
        }
        showElement("#game-buttons");
    }

    hideBoth() {
        $("#game-drawing").addClass(HIDDEN);
        $("#game-word").addClass(HIDDEN);
        $("#game-buttons").addClass(HIDDEN);
        $("#game-draw-buttons").addClass(HIDDEN);
    }

    newLink({ data }) {
        const lastLink = data.link;
        const lastLinkType = lastLink.type;
        const count = data.count;
        const finalCount = data.finalCount;

        const showNeighbors = data.showNeighbors;
        const playerList = data.players;
        const thisPlayer = data.thisPlayer;

        const newLinkType =
            lastLinkType === DRAWING || lastLinkType === FIRST_WORD
                ? WORD
                : DRAWING;
        this.timeLimit = data.timeLimit;

        if (lastLinkType === DRAWING) {
            //show the previous drawing
            $("#game-word-drawingtoname").attr("src", lastLink.data);

            this.setTitle("What is this a drawing of?");

            //show the word creator
            this.showWord();
        } else if (lastLinkType === WORD) {
            this.setTitle(
                `<span class="avoidwrap">Please draw: </span><span class="avoidwrap">${lastLink.data}</span>`
            );

            //show drawing creator
            this.showDrawing();

            //calculate size of canvas dynamically
            this.resizeCanvas();
        } else if (lastLinkType === FIRST_WORD) {
            $("#game-word-drawingtoname").removeAttr("src");
            this.setTitle("What should be drawn?");

            //show the word creator
            this.showWord();
        }

        this.setSubtitle(
            `${this.subtitle}   -   ${count}/${finalCount}`
        );

        this.showNeighbors(
            showNeighbors,
            playerList,
            thisPlayer,
            count,
            finalCount
        );

        //this will be ran when the done button is clicked, or
        //  the enter key is pressed in the word input
        this.onDone = function () {
            this.checkIfDone(newLinkType);
        };
        this.waitingForResponse(false);
    }

    checkIfDone(newLinkType) {
        this.done = true;

        //disable the submit timer to prevent duplicate sends
        clearTimeout(this.submitTimer);
        clearInterval(this.displayTimerInterval);
        this.submitTimer = undefined;
        this.displayTimerInterval = undefined;

        //hide the drawing
        this.hideBoth();

        let newLink;
        if (newLinkType === DRAWING) {
            if (this.canvas.isBlank) {
                showElement("#game-drawing");
                showElement("#game-buttons");
                showElement("#game-draw-buttons");
                swal(
                    "Your picture is blank!",
                    "Please draw a picture, then try again.",
                    "info"
                );
            } else {
                // convert canvas to an SVG string, encode it in base64, and send it as a dataurl
                newLink = `data:image/svg+xml;base64,${btoa(
                    this.canvas.toSVG()
                )}`;

                this.canvas.remove();
                this.sendLink(newLinkType, newLink);
            }
        } else if (newLinkType === WORD) {
            newLink = $("#game-word-in").val().trim();
            //check if it is blank
            if (newLink === "") {
                this.showWord();
                swal(
                    "Your guess is blank!",
                    "Please enter a guess, then try again.",
                    "info"
                );
            } else {
                //clear the input
                $("#game-word-in").val("");
                this.sendLink(newLinkType, newLink);
            }
        }
    }

    sendLink(type, data) {
        this.setTitle("Sending...");

        this.socket.emit("finishedLink", {
            link: {
                type,
                data,
            },
        });
        ga("send", "event", "Link", "submit", type);
        this.onWait();
    }

    resizeCanvas() {
        const container = $("#game-drawing");
        if (this.canvas) {
            this.canvas.setHeight(container.width());
            this.canvas.setWidth(container.width());
            this.canvas.renderAll();
        }
    }

    setTimer() {
        if (this.timeLimit && !this.timeLimit === 0) {
            window.setTimeout();
        }
    }

    showNeighbors(showNeighbors, playerList, thisPlayer, count, finalCount) {
        if (!showNeighbors) {
            this.neighboringPlayers.addClass(HIDDEN);
            return;
        }

        this.neighboringPlayers.removeClass(HIDDEN);

        let playerIdx;
        const numPlayers = playerList.length;
        for (playerIdx = 0; playerIdx < numPlayers; playerIdx++) {
            if (playerList[playerIdx].id === thisPlayer.id) {
                break;
            }
        }
        this.leftPlayer.text(playerList[(playerIdx + 1) % numPlayers].name);
        this.youPlayer.text(thisPlayer.name);
        this.rightPlayer.text(
            playerList[(playerIdx - 1 + numPlayers) % numPlayers].name
        );

        if (count > 1) {
            showElement("#previous-player-container");
            showElement("#previous-player-arrow");
        }

        if (count === finalCount) {
            $("#next-player-container").addClass(HIDDEN);
            $("#next-player-arrow").addClass(HIDDEN);
        }
    }
}

export default Game;

redpajama_set_name: RedPajamaGithub


text:
require "test_helper"

module Cogy
  class JsonResponseTest < ActionDispatch::IntegrationTest
    include Engine.routes.url_helpers

    def test_json_output_and_default_template
      cmd :simple_json

      expected = "COG_TEMPLATE: simple_json\n" \
                 "JSON\n" \
                 '{"a":3,"b":4}'

      assert_equal expected, response.body
    end

    def test_custom_template
      cmd :custom_template

      expected = "COG_TEMPLATE: foo\n" \
                 "JSON\n" \
                 '{"a":3}'

      assert_equal expected, response.body
    end
  end
end


text:
[ $# -eq 1 ] || ( echo "$0 <WEAVE_SCOPE_SERVICE_TOKEN>" ; exit 1 )
## Launch Scope probe in head nodes to monitor master and etcd (`kube-{1,2,3,4}`)
for m in 'kube-1' 'kube-2' 'kube-3' 'kube-4' ; do
  docker $(docker-machine config ${m}) run --detach \
    --name="weavescope" \
    --privileged="true" --net="host" --pid="host" \
    --volume="/var/run/docker.sock:/var/run/docker.sock" \
      weaveworks/scope:0.13.1 \
        --no-app --probe.docker="true" --probe.docker.bridge="docker0" \
        --service-token="${1}"
done
## And Scope addon
curl --silent --location https://gist.github.com/errordeveloper/3f13301adb276e26bfee/raw/scope-ds.yaml \
  | sed "s/%%WEAVE_SCOPE_SERVICE_TOKEN%%/${1}/" \
  | docker-machine ssh 'kube-4' docker --host="unix:///var/run/weave/weave.sock" run \
      --volumes-from="kube-toolbox-pki" \
      --interactive \
        weaveworks/kubernetes-anywhere:toolbox-v1.2 \
          kubectl create --validate="false" -f -


text:
'use strict';

function Person(lastName, firstName) {
  this.lastName = lastName;
  this.firstName = firstName;

  this.displayName = function() {
    var display = '';
    if (this.firstName) {
      display += this.firstName.trim();
    }

    if (this.lastName) {
      if (display && display.length) {
        display += ' ';
      }

      display += this.lastName.trim();
    }

    return display;
  };
}

module.exports = Person;


text:
var gulp = require('gulp');
var sass = require('gulp-sass');
var connect = require('gulp-connect');

gulp.task('connect', function(){
  connect.server({
    root: 'public',
    livereload: true
  });
});

// keeps gulp from crashing for scss errors
gulp.task('sass', function () {
  return gulp.src('./sass/*.scss')
      .pipe(sass({ errLogToConsole: true }))
      .pipe(gulp.dest('./public/css'));
});

gulp.task('livereload', function (){
  gulp.src('./public/**/*')
  .pipe(connect.reload());
});

gulp.task('watch', function () {
  gulp.watch('./sass/**/*.scss', ['sass']);
  gulp.watch('./public/**/*', ['livereload']);
});

gulp.task('default', ['connect', 'watch', 'sass']);


text:
<!DOCTYPE html>
<html ng-app="ngMap">
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<script src="script-tags-for-development.js"></script>
<script>
// Normalizes the coords that tiles repeat across the x axis (horizontally)
// like the standard Google map tiles.
function getNormalizedCoord(coord, zoom) {
  var y = coord.y;
  var x = coord.x;

  // tile range in one direction range is dependent on zoom level
  // 0 = 1 tile, 1 = 2 tiles, 2 = 4 tiles, 3 = 8 tiles, etc
  var tileRange = 1 << zoom;

  // don't repeat across y-axis (vertically)
  if (y < 0 || y >= tileRange) {
    return null;
  }

  // repeat across x-axis
  if (x < 0 || x >= tileRange) {
    x = (x % tileRange + tileRange) % tileRange;
  }

  return {
    x: x,
    y: y
  };
}
var moonTypeOptions = {
  getTileUrl: function(coord, zoom) {
      var normalizedCoord = getNormalizedCoord(coord, zoom);
      if (!normalizedCoord) {
        return null;
      }
      var bound = Math.pow(2, zoom);
      return 'https://mw1.google.com/mw-planetary/lunar/lunarmaps_v1/clem_bw' +
          '/' + zoom + '/' + normalizedCoord.x + '/' +
          (bound - normalizedCoord.y - 1) + '.jpg';
  },
  tileSize: new google.maps.Size(256, 256),
  maxZoom: 9,
  minZoom: 0,
  radius: 1738000,
  name: 'Moon'
};

var moonMapType = new google.maps.ImageMapType(moonTypeOptions);
  angular.module('ngMap').run(function($rootScope) {
    $rootScope.moonMapType = moonMapType;
  });
</script>
</head>
<body>
  <ng-map zoom="1" center="0,0"
    street-view-control="false"
    map-type-id="moon"
    map-type-control-options="{
      mapTypeIds: ['moon']
    }">
    <map-type name="moon" object="moonMapType">
    </map-type>
  </ng-map>
</body>
</html>


text:
module RelaxDB

  class Paginator

    attr_reader :paginate_params

    def initialize(paginate_params, page_params)
      @paginate_params = paginate_params
      @orig_paginate_params = @paginate_params.clone

      @page_params = page_params.is_a?(String) ? JSON.parse(page_params).to_mash : page_params
      # Where the magic happens - the original params are updated with the page specific params
      @paginate_params.update(@page_params)
    end

    def add_q_next_and_prev docs, view_name, view_keys
      if docs.empty?
        next_exists = prev_exists = false
      else
        next_exists = docs.size >= @paginate_params.limit
        next_params = next_exists ? create_next(docs.last, view_keys) : false

        prev_exists = !@page_params.empty?
        prev_params = prev_exists ? create_prev(docs.first, view_keys) : false
      end

      add_next_and_prev_meths docs, next_params, prev_params
    end

    def total_doc_count(view_name)
      RelaxDB.view view_name, :startkey => @orig_paginate_params.startkey, :endkey => @orig_paginate_params.endkey,
        :descending => @orig_paginate_params.descending, :reduce => true
    end

    #
    # view_keys are used to determine the params for the prev and next links. If a view_key is a symbol
    # the key value will be the result of invoking the method named by the symbol on the first / last
    # element in the result set. If a view_key is not a symbol, its value will be used directly.
    #
    def add_next_and_prev(docs, view_name, view_keys)
      unless docs.empty?
        no_docs = docs.size
        offset = docs.offset
        orig_offset = orig_offset(view_name)
        total_doc_count = total_doc_count(view_name)

        next_exists = !@paginate_params.order_inverted? ? (offset - orig_offset + no_docs < total_doc_count) : true
        next_params = next_exists ? create_next(docs.last, view_keys) : false

        prev_exists = @paginate_params.order_inverted? ? (offset - orig_offset + no_docs < total_doc_count) :
          (offset - orig_offset == 0 ? false : true)
        prev_params = prev_exists ? create_prev(docs.first, view_keys) : false
      else
        next_exists = prev_exists = false
      end

      add_next_and_prev_meths docs, next_params, prev_params
    end

    def create_next(doc, view_keys)
      next_key = view_keys_to_vals doc, view_keys
      next_key = next_key.length == 1 ? next_key[0] : next_key
      next_key_docid = doc._id
      { :startkey => next_key, :startkey_docid => next_key_docid, :descending => @orig_paginate_params.descending }
    end

    def create_prev(doc, view_keys)
      prev_key = view_keys_to_vals doc, view_keys
      prev_key = prev_key.length == 1 ? prev_key[0] : prev_key
      prev_key_docid = doc._id
      prev_params = { :startkey => prev_key, :startkey_docid => prev_key_docid, :descending => !@orig_paginate_params.descending }
    end

    def view_keys_to_vals doc, view_keys
      view_keys.map do |k|
        if k.is_a?(Symbol) then doc.send(k)
        elsif k.is_a?(Proc) then k.call(doc)
        else k
        end
      end
    end

    def orig_offset(view_name)
      if @paginate_params.order_inverted?
        params = {:startkey => @orig_paginate_params.endkey, :descending => !@orig_paginate_params.descending}
      else
        params = {:startkey => @orig_paginate_params.startkey, :descending => @orig_paginate_params.descending}
      end
      params[:limit] = 1

      RelaxDB.rf_view(view_name, params).offset
    end

    def add_next_and_prev_meths docs, next_params, prev_params
      docs.meta_class.instance_eval do
        define_method(:next_params) { next_params }
        define_method(:next_query) { next_params ? "page_params=#{::CGI::escape(next_params.to_json)}" : false }

        define_method(:prev_params) { prev_params }
        define_method(:prev_query) { prev_params ? "page_params=#{::CGI::escape(prev_params.to_json)}" : false }
      end
    end

  end

end


text:
package io.zbus.mq;

import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;

import io.zbus.transport.Message;

public class Pub {

	public static MqClient buildInproClient() {
		MqServer server = new MqServer(new MqServerConfig());
		return new MqClient(server);
	}

	@SuppressWarnings("resource")
	public static void main(String[] args) throws Exception {
		MqClient client = new MqClient("wss://111.230.136.74");

		//MqClient client = buildInproClient();

		client.heartbeat(30, TimeUnit.SECONDS);
		final String mq = "MyMQ", mqType = Protocol.MEMORY;

		//1) Create MQ if necessary
		Message req = new Message();
		req.setHeader("cmd", "create");  //Create
		req.setHeader("mq", mq);
		req.setHeader("mqType", mqType); //disk|memory|db

		client.invoke(req);

		AtomicInteger count = new AtomicInteger(0);
		for (int i = 0; i < 100; i++) {
			//2) Publish Message
			Message msg = new Message();
			msg.setHeader("cmd", "pub");  //Publish
			msg.setHeader("mq", mq);
			msg.setBody(i);    //set business data in body

			client.invoke(msg, res->{ //async call
				if(count.getAndIncrement() % 10000 == 0) {
					System.out.println(res);
				}
			});
		}
	}
}


text:
package com.faforever.api.data.domain;

public enum VictoryCondition {
  // Order is crucial
  DEMORALIZATION,
  DOMINATION,
  ERADICATION,
  SANDBOX;
}


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

/**
 * A simple interface that can build, lookup or otherwise return a value V for a
 * key K.
 *
 * @param <K> the key used to get a value
 * @param <V> the value returned for the given key
 */
public interface Factory<K, V> {
	public V get(K key);
}


text:
<?php

use Symfony\Component\DependencyInjection\Argument\RewindableGenerator;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\DependencyInjection\Container;
use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
use Symfony\Component\DependencyInjection\Exception\LogicException;
use Symfony\Component\DependencyInjection\Exception\RuntimeException;
use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag;

/**
 * This class has been auto-generated
 * by the Symfony Dependency Injection Component.
 *
 * @final since Symfony 3.3
 */
class Symfony_DI_PhpDumper_Test_Almost_Circular_Public extends Container
{
    private $parameters;
    private $targetDirs = array();

    /**
     * @internal but protected for BC on cache:clear
     */
    protected $privates = array();

    public function __construct()
    {
        $this->services = $this->privates = array();
        $this->methodMap = array(
            'bar' => 'getBarService',
            'bar3' => 'getBar3Service',
            'bar5' => 'getBar5Service',
            'foo' => 'getFooService',
            'foo2' => 'getFoo2Service',
            'foo4' => 'getFoo4Service',
            'foo5' => 'getFoo5Service',
            'foobar' => 'getFoobarService',
            'foobar2' => 'getFoobar2Service',
            'foobar3' => 'getFoobar3Service',
            'foobar4' => 'getFoobar4Service',
        );

        $this->aliases = array();
    }

    public function reset()
    {
        $this->privates = array();
        parent::reset();
    }

    public function compile()
    {
        throw new LogicException('You cannot compile a dumped container that was already compiled.');
    }

    public function isCompiled()
    {
        return true;
    }

    public function getRemovedIds()
    {
        return array(
            'Psr\\Container\\ContainerInterface' => true,
            'Symfony\\Component\\DependencyInjection\\ContainerInterface' => true,
            'bar2' => true,
        );
    }

    /**
     * Gets the public 'bar' shared service.
     *
     * @return \BarCircular
     */
    protected function getBarService()
    {
        $this->services['bar'] = $instance = new \BarCircular();

        $instance->addFoobar(($this->services['foobar'] ?? $this->getFoobarService()));

        return $instance;
    }

    /**
     * Gets the public 'bar3' shared service.
     *
     * @return \BarCircular
     */
    protected function getBar3Service()
    {
        $this->services['bar3'] = $instance = new \BarCircular();

        $a = ($this->services['foobar3'] ?? $this->services['foobar3'] = new \FoobarCircular());

        $instance->addFoobar($a, $a);

        return $instance;
    }

    /**
     * Gets the public 'bar5' shared service.
     *
     * @return \stdClass
     */
    protected function getBar5Service()
    {
        $a = ($this->services['foo5'] ?? $this->getFoo5Service());

        if (isset($this->services['bar5'])) {
            return $this->services['bar5'];
        }

        $this->services['bar5'] = $instance = new \stdClass($a);

        $instance->foo = $a;

        return $instance;
    }

    /**
     * Gets the public 'foo' shared service.
     *
     * @return \FooCircular
     */
    protected function getFooService()
    {
        $a = ($this->services['bar'] ?? $this->getBarService());

        if (isset($this->services['foo'])) {
            return $this->services['foo'];
        }

        return $this->services['foo'] = new \FooCircular($a);
    }

    /**
     * Gets the public 'foo2' shared service.
     *
     * @return \FooCircular
     */
    protected function getFoo2Service()
    {
        $a = new \BarCircular();

        $this->services['foo2'] = $instance = new \FooCircular($a);

        $a->addFoobar(($this->services['foobar2'] ?? $this->getFoobar2Service()));

        return $instance;
    }

    /**
     * Gets the public 'foo4' service.
     *
     * @return \stdClass
     */
    protected function getFoo4Service()
    {
        $instance = new \stdClass();

        $instance->foobar = ($this->services['foobar4'] ?? $this->getFoobar4Service());

        return $instance;
    }

    /**
     * Gets the public 'foo5' shared service.
     *
     * @return \stdClass
     */
    protected function getFoo5Service()
    {
        $this->services['foo5'] = $instance = new \stdClass();

        $instance->bar = ($this->services['bar5'] ?? $this->getBar5Service());

        return $instance;
    }

    /**
     * Gets the public 'foobar' shared service.
     *
     * @return \FoobarCircular
     */
    protected function getFoobarService()
    {
        $a = ($this->services['foo'] ?? $this->getFooService());

        if (isset($this->services['foobar'])) {
            return $this->services['foobar'];
        }

        return $this->services['foobar'] = new \FoobarCircular($a);
    }

    /**
     * Gets the public 'foobar2' shared service.
     *
     * @return \FoobarCircular
     */
    protected function getFoobar2Service()
    {
        $a = ($this->services['foo2'] ?? $this->getFoo2Service());

        if (isset($this->services['foobar2'])) {
            return $this->services['foobar2'];
        }

        return $this->services['foobar2'] = new \FoobarCircular($a);
    }

    /**
     * Gets the public 'foobar3' shared service.
     *
     * @return \FoobarCircular
     */
    protected function getFoobar3Service()
    {
        return $this->services['foobar3'] = new \FoobarCircular();
    }

    /**
     * Gets the public 'foobar4' shared service.
     *
     * @return \stdClass
     */
    protected function getFoobar4Service()
    {
        $a = new \stdClass();

        $this->services['foobar4'] = $instance = new \stdClass($a);

        $a->foobar = $instance;

        return $instance;
    }
}


text:
<?php

namespace ChurchCRM;

use ChurchCRM\Base\FamilyCustomMasterQuery as BaseFamilyCustomMasterQuery;

/**
 * Skeleton subclass for performing query and update operations on the 'family_custom_master' table.
 *
 *
 *
 * You should add additional methods to this class to meet the
 * application requirements.  This class will only be generated as
 * long as it does not already exist in the output directory.
 */
class FamilyCustomMasterQuery extends BaseFamilyCustomMasterQuery
{
}


text:
package io.arivera.oss.embedded.rabbitmq.extract;

import io.arivera.oss.embedded.rabbitmq.EmbeddedRabbitMqConfig;

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

import static org.junit.Assert.assertTrue;

public class ExtractorFactoryTest {

  private EmbeddedRabbitMqConfig.Builder builder;

  @Before
  public void setUp() throws Exception {
    builder = new EmbeddedRabbitMqConfig.Builder();
  }

  @Test
  public void withoutCaching() throws Exception {
    builder.useCachedDownload(false);
    Extractor extractor = new ExtractorFactory(builder.build()).getNewInstance();

    assertTrue(extractor.getClass().equals(BasicExtractor.class));
  }

  @Test
  public void withCaching() throws Exception {
    builder.useCachedDownload(true);
    Extractor extractor = new ExtractorFactory(builder.build()).getNewInstance();

    assertTrue(extractor.getClass().equals(CachedExtractor.class));
  }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<IKTaskSet name="gait2354_IK">
	<objects>
		<IKMarkerTask name="Sternum">
			<!--Whether or not this task will be used during inverse kinematics solve.-->
			<apply> true </apply>
			<!--Weight given to a marker or coordinate for solving inverse kinematics
			    problems.-->
			<weight>       1.00000000 </weight>
		</IKMarkerTask>
		<IKMarkerTask name="R.Acromium">
			<!--Whether or not this task will be used during inverse kinematics solve.-->
			<apply> true </apply>
			<!--Weight given to a marker or coordinate for solving inverse kinematics
			    problems.-->
			<weight>       1.00000000 </weight>
		</IKMarkerTask>
		<IKMarkerTask name="L.Acromium">
			<!--Whether or not this task will be used during inverse kinematics solve.-->
			<apply> true </apply>
			<!--Weight given to a marker or coordinate for solving inverse kinematics
			    problems.-->
			<weight>       1.00000000 </weight>
		</IKMarkerTask>
		<IKMarkerTask name="Top.Head">
			<!--Whether or not this task will be used during inverse kinematics solve.-->
			<apply> true </apply>
			<!--Weight given to a marker or coordinate for solving inverse kinematics
			    problems.-->
			<weight>       1.00000000 </weight>
		</IKMarkerTask>
		<IKMarkerTask name="R.ASIS">
			<!--Whether or not this task will be used during inverse kinematics solve.-->
			<apply> true </apply>
			<!--Weight given to a marker or coordinate for solving inverse kinematics
			    problems.-->
			<weight>      1.00000000 </weight>
		</IKMarkerTask>
		<IKMarkerTask name="L.ASIS">
			<!--Whether or not this task will be used during inverse kinematics solve.-->
			<apply> true </apply>
			<!--Weight given to a marker or coordinate for solving inverse kinematics
			    problems.-->
			<weight>      1.00000000 </weight>
		</IKMarkerTask>
		<IKMarkerTask name="V.Sacral">
			<!--Whether or not this task will be used during inverse kinematics solve.-->
			<apply> true </apply>
			<!--Weight given to a marker or coordinate for solving inverse kinematics
			    problems.-->
			<weight>      1.00000000 </weight>
		</IKMarkerTask>
		<IKMarkerTask name="R.Thigh.Upper">
			<!--Whether or not this task will be used during inverse kinematics solve.-->
			<apply> true </apply>
			<!--Weight given to a marker or coordinate for solving inverse kinematics
			    problems.-->
			<weight>      1.00000000 </weight>
		</IKMarkerTask>
		<IKMarkerTask name="R.Thigh.Front">
			<!--Whether or not this task will be used during inverse kinematics solve.-->
			<apply> true </apply>
			<!--Weight given to a marker or coordinate for solving inverse kinematics
			    problems.-->
			<weight>       1.00000000 </weight>
		</IKMarkerTask>
		<IKMarkerTask name="R.Thigh.Rear">
			<!--Whether or not this task will be used during inverse kinematics solve.-->
			<apply> true </apply>
			<!--Weight given to a marker or coordinate for solving inverse kinematics
			    problems.-->
			<weight>       1.00000000 </weight>
		</IKMarkerTask>
		<IKMarkerTask name="R.Shank.Upper">
			<!--Whether or not this task will be used during inverse kinematics solve.-->
			<apply> true </apply>
			<!--Weight given to a marker or coordinate for solving inverse kinematics
			    problems.-->
			<weight>       1.00000000 </weight>
		</IKMarkerTask>
		<IKMarkerTask name="R.Shank.Front">
			<!--Whether or not this task will be used during inverse kinematics solve.-->
			<apply> true </apply>
			<!--Weight given to a marker or coordinate for solving inverse kinematics
			    problems.-->
			<weight>       1.00000000 </weight>
		</IKMarkerTask>
		<IKMarkerTask name="R.Shank.Rear">
			<!--Whether or not this task will be used during inverse kinematics solve.-->
			<apply> true </apply>
			<!--Weight given to a marker or coordinate for solving inverse kinematics
			    problems.-->
			<weight>       1.00000000 </weight>
		</IKMarkerTask>
		<IKMarkerTask name="R.Heel">
			<!--Whether or not this task will be used during inverse kinematics solve.-->
			<apply> true </apply>
			<!--Weight given to a marker or coordinate for solving inverse kinematics
			    problems.-->
			<weight>      1.00000000 </weight>
		</IKMarkerTask>
		<IKMarkerTask name="R.Midfoot.Sup">
			<!--Whether or not this task will be used during inverse kinematics solve.-->
			<apply> true </apply>
			<!--Weight given to a marker or coordinate for solving inverse kinematics
			    problems.-->
			<weight>       1.00000000 </weight>
		</IKMarkerTask>
		<IKMarkerTask name="R.Midfoot.Lat">
			<!--Whether or not this task will be used during inverse kinematics solve.-->
			<apply> true </apply>
			<!--Weight given to a marker or coordinate for solving inverse kinematics
			    problems.-->
			<weight>       1.00000000 </weight>
		</IKMarkerTask>
		<IKMarkerTask name="R.Toe.Lat">
			<!--Whether or not this task will be used during inverse kinematics solve.-->
			<apply> true </apply>
			<!--Weight given to a marker or coordinate for solving inverse kinematics
			    problems.-->
			<weight>       1.00000000 </weight>
		</IKMarkerTask>
		<IKMarkerTask name="R.Toe.Med">
			<!--Whether or not this task will be used during inverse kinematics solve.-->
			<apply> true </apply>
			<!--Weight given to a marker or coordinate for solving inverse kinematics
			    problems.-->
			<weight>       1.00000000 </weight>
		</IKMarkerTask>
		<IKMarkerTask name="R.Toe.Tip">
			<!--Whether or not this task will be used during inverse kinematics solve.-->
			<apply> true </apply>
			<!--Weight given to a marker or coordinate for solving inverse kinematics
			    problems.-->
			<weight>      1.00000000 </weight>
		</IKMarkerTask>
		<IKMarkerTask name="L.Thigh.Upper">
			<!--Whether or not this task will be used during inverse kinematics solve.-->
			<apply> true </apply>
			<!--Weight given to a marker or coordinate for solving inverse kinematics
			    problems.-->
			<weight>       1.00000000 </weight>
		</IKMarkerTask>
		<IKMarkerTask name="L.Thigh.Front">
			<!--Whether or not this task will be used during inverse kinematics solve.-->
			<apply> true </apply>
			<!--Weight given to a marker or coordinate for solving inverse kinematics
			    problems.-->
			<weight>       1.00000000 </weight>
		</IKMarkerTask>
		<IKMarkerTask name="L.Thigh.Rear">
			<!--Whether or not this task will be used during inverse kinematics solve.-->
			<apply> true </apply>
			<!--Weight given to a marker or coordinate for solving inverse kinematics
			    problems.-->
			<weight>       1.00000000 </weight>
		</IKMarkerTask>
		<IKMarkerTask name="L.Shank.Upper">
			<!--Whether or not this task will be used during inverse kinematics solve.-->
			<apply> true </apply>
			<!--Weight given to a marker or coordinate for solving inverse kinematics
			    problems.-->
			<weight>       1.00000000 </weight>
		</IKMarkerTask>
		<IKMarkerTask name="L.Shank.Front">
			<!--Whether or not this task will be used during inverse kinematics solve.-->
			<apply> true </apply>
			<!--Weight given to a marker or coordinate for solving inverse kinematics
			    problems.-->
			<weight>       1.00000000 </weight>
		</IKMarkerTask>
		<IKMarkerTask name="L.Shank.Rear">
			<!--Whether or not this task will be used during inverse kinematics solve.-->
			<apply> true </apply>
			<!--Weight given to a marker or coordinate for solving inverse kinematics
			    problems.-->
			<weight>       1.00000000 </weight>
		</IKMarkerTask>
		<IKMarkerTask name="L.Heel">
			<!--Whether or not this task will be used during inverse kinematics solve.-->
			<apply> true </apply>
			<!--Weight given to a marker or coordinate for solving inverse kinematics
			    problems.-->
			<weight>      1.00000000 </weight>
		</IKMarkerTask>
		<IKMarkerTask name="L.Midfoot.Sup">
			<!--Whether or not this task will be used during inverse kinematics solve.-->
			<apply> true </apply>
			<!--Weight given to a marker or coordinate for solving inverse kinematics
			    problems.-->
			<weight>       1.00000000 </weight>
		</IKMarkerTask>
		<IKMarkerTask name="L.Midfoot.Lat">
			<!--Whether or not this task will be used during inverse kinematics solve.-->
			<apply> true </apply>
			<!--Weight given to a marker or coordinate for solving inverse kinematics
			    problems.-->
			<weight>       1.00000000 </weight>
		</IKMarkerTask>
		<IKMarkerTask name="L.Toe.Lat">
			<!--Whether or not this task will be used during inverse kinematics solve.-->
			<apply> true </apply>
			<!--Weight given to a marker or coordinate for solving inverse kinematics
			    problems.-->
			<weight>       1.00000000 </weight>
		</IKMarkerTask>
		<IKMarkerTask name="L.Toe.Med">
			<!--Whether or not this task will be used during inverse kinematics solve.-->
			<apply> true </apply>
			<!--Weight given to a marker or coordinate for solving inverse kinematics
			    problems.-->
			<weight>       1.00000000 </weight>
		</IKMarkerTask>
		<IKMarkerTask name="L.Toe.Tip">
			<!--Whether or not this task will be used during inverse kinematics solve.-->
			<apply> true </apply>
			<!--Weight given to a marker or coordinate for solving inverse kinematics
			    problems.-->
			<weight>      1.00000000 </weight>
		</IKMarkerTask>
	</objects>
</IKTaskSet>


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

/**
 * ThirdPartyDataDeclaration.java
 *
 * This file was auto-generated from WSDL
 * by the Apache Axis 1.4 Mar 02, 2009 (07:08:06 PST) WSDL2Java emitter.
 */

package com.google.api.ads.admanager.axis.v202205;

/**
 * Represents a set of declarations about what (if any) third party
 * companies are
 *             associated with a given creative.
 *
 *             <p>This can be set at the network level, as a default
 * for all creatives, or overridden for a
 *             particular creative.
 */
public class ThirdPartyDataDeclaration  implements java.io.Serializable {
    private com.google.api.ads.admanager.axis.v202205.DeclarationType declarationType;

    private long[] thirdPartyCompanyIds;

    public ThirdPartyDataDeclaration() {
    }

    public ThirdPartyDataDeclaration(
           com.google.api.ads.admanager.axis.v202205.DeclarationType declarationType,
           long[] thirdPartyCompanyIds) {
           this.declarationType = declarationType;
           this.thirdPartyCompanyIds = thirdPartyCompanyIds;
    }

    @Override
    public String toString() {
        return com.google.common.base.MoreObjects.toStringHelper(this.getClass())
            .omitNullValues()
            .add("declarationType", getDeclarationType())
            .add("thirdPartyCompanyIds", getThirdPartyCompanyIds())
            .toString();
    }

    /**
     * Gets the declarationType value for this ThirdPartyDataDeclaration.
     *
     * @return declarationType
     */
    public com.google.api.ads.admanager.axis.v202205.DeclarationType getDeclarationType() {
        return declarationType;
    }

    /**
     * Sets the declarationType value for this ThirdPartyDataDeclaration.
     *
     * @param declarationType
     */
    public void setDeclarationType(com.google.api.ads.admanager.axis.v202205.DeclarationType declarationType) {
        this.declarationType = declarationType;
    }

    /**
     * Gets the thirdPartyCompanyIds value for this ThirdPartyDataDeclaration.
     *
     * @return thirdPartyCompanyIds
     */
    public long[] getThirdPartyCompanyIds() {
        return thirdPartyCompanyIds;
    }

    /**
     * Sets the thirdPartyCompanyIds value for this ThirdPartyDataDeclaration.
     *
     * @param thirdPartyCompanyIds
     */
    public void setThirdPartyCompanyIds(long[] thirdPartyCompanyIds) {
        this.thirdPartyCompanyIds = thirdPartyCompanyIds;
    }

    public long getThirdPartyCompanyIds(int i) {
        return this.thirdPartyCompanyIds[i];
    }

    public void setThirdPartyCompanyIds(int i, long _value) {
        this.thirdPartyCompanyIds[i] = _value;
    }

    private java.lang.Object __equalsCalc = null;
    public synchronized boolean equals(java.lang.Object obj) {
        if (!(obj instanceof ThirdPartyDataDeclaration)) return false;
        ThirdPartyDataDeclaration other = (ThirdPartyDataDeclaration) obj;
        if (obj == null) return false;
        if (this == obj) return true;
        if (__equalsCalc != null) {
            return (__equalsCalc == obj);
        }
        __equalsCalc = obj;
        boolean _equals;
        _equals = true &&
            ((this.declarationType==null && other.getDeclarationType()==null) ||
             (this.declarationType!=null &&
              this.declarationType.equals(other.getDeclarationType()))) &&
            ((this.thirdPartyCompanyIds==null && other.getThirdPartyCompanyIds()==null) ||
             (this.thirdPartyCompanyIds!=null &&
              java.util.Arrays.equals(this.thirdPartyCompanyIds, other.getThirdPartyCompanyIds())));
        __equalsCalc = null;
        return _equals;
    }

    private boolean __hashCodeCalc = false;
    public synchronized int hashCode() {
        if (__hashCodeCalc) {
            return 0;
        }
        __hashCodeCalc = true;
        int _hashCode = 1;
        if (getDeclarationType() != null) {
            _hashCode += getDeclarationType().hashCode();
        }
        if (getThirdPartyCompanyIds() != null) {
            for (int i=0;
                 i<java.lang.reflect.Array.getLength(getThirdPartyCompanyIds());
                 i++) {
                java.lang.Object obj = java.lang.reflect.Array.get(getThirdPartyCompanyIds(), i);
                if (obj != null &&
                    !obj.getClass().isArray()) {
                    _hashCode += obj.hashCode();
                }
            }
        }
        __hashCodeCalc = false;
        return _hashCode;
    }

    // Type metadata
    private static org.apache.axis.description.TypeDesc typeDesc =
        new org.apache.axis.description.TypeDesc(ThirdPartyDataDeclaration.class, true);

    static {
        typeDesc.setXmlType(new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202205", "ThirdPartyDataDeclaration"));
        org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc();
        elemField.setFieldName("declarationType");
        elemField.setXmlName(new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202205", "declarationType"));
        elemField.setXmlType(new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202205", "DeclarationType"));
        elemField.setMinOccurs(0);
        elemField.setNillable(false);
        typeDesc.addFieldDesc(elemField);
        elemField = new org.apache.axis.description.ElementDesc();
        elemField.setFieldName("thirdPartyCompanyIds");
        elemField.setXmlName(new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202205", "thirdPartyCompanyIds"));
        elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "long"));
        elemField.setMinOccurs(0);
        elemField.setNillable(false);
        elemField.setMaxOccursUnbounded(true);
        typeDesc.addFieldDesc(elemField);
    }

    /**
     * Return type metadata object
     */
    public static org.apache.axis.description.TypeDesc getTypeDesc() {
        return typeDesc;
    }

    /**
     * Get Custom Serializer
     */
    public static org.apache.axis.encoding.Serializer getSerializer(
           java.lang.String mechType,
           java.lang.Class _javaType,
           javax.xml.namespace.QName _xmlType) {
        return
          new  org.apache.axis.encoding.ser.BeanSerializer(
            _javaType, _xmlType, typeDesc);
    }

    /**
     * Get Custom Deserializer
     */
    public static org.apache.axis.encoding.Deserializer getDeserializer(
           java.lang.String mechType,
           java.lang.Class _javaType,
           javax.xml.namespace.QName _xmlType) {
        return
          new  org.apache.axis.encoding.ser.BeanDeserializer(
            _javaType, _xmlType, typeDesc);
    }

}


text:
Assets
======

Assets are managed with gulp which require nodejs/npm and a global gulp install.

* stylesheets are generated from .scss files located in ``/Resources/assets_src/src/scss``
* javascripts are generated from files located in ``/Resources/assets_src/src/js``

.. warning::

   Do not edit directly files located in the ``/Resources/public`` folder,
   if you want to contribute, you should edit files in the ``/Resources/assets_src/src`` folder.

Compiling Sources
-----------------

If you made some modifications in the sources,
you can generate the public ones with the following command:

.. code-block:: bash

   make assets


text:
package build.bazel.dashboard.github.issuecomment;

import build.bazel.dashboard.github.issue.GithubIssue;
import com.fasterxml.jackson.databind.PropertyNamingStrategy;
import com.fasterxml.jackson.databind.annotation.JsonNaming;
import lombok.Builder;
import lombok.Value;

@Builder
@Value
@JsonNaming(PropertyNamingStrategy.SnakeCaseStrategy.class)
public class GithubComment {
  long id;
  String body;
  GithubIssue.User user;
}


text:
package controllers

import java.util.concurrent.TimeUnit

import javax.inject._
import org.pac4j.core.config.Config
import org.pac4j.core.profile.{CommonProfile, ProfileManager}
import org.pac4j.play.scala.{Security, SecurityComponents}
import org.pac4j.play.store.PlaySessionStore
import play.api._
import play.api.mvc._
import play.libs.concurrent.HttpExecutionContext
import javax.inject._
import javax.inject._
import play.api.routing._
import _root_.controllers.support.RequireAccess
import _root_.controllers.support.Consented
import dao.user.UserDAO
import models.{Non, OrganizationId}
import org.pac4j.play.PlayWebContext

@Singleton
class ApplicationController @Inject()(/*override val config: Config, override val playSessionStore: PlaySessionStore, override val ec: HttpExecutionContext,*/ val controllerComponents: SecurityComponents, userDAO: UserDAO) extends BaseController with Security[CommonProfile]  {

  def index = Action { implicit request =>
    Ok(views.html.index())
  }

//  def secure = RequireAccess(Non, to=OrganizationId(0)) { Secure("RedirectUnauthenticatedClient", "Access").async{ authenticatedRequest => Consented(authenticatedRequest, userDAO) { implicit user => Action { implicit request =>
//    val webContext = new PlayWebContext(request, playSessionStore)
//    val profileManager = new ProfileManager[CommonProfile](webContext)
//    val profile = profileManager.get(true)
//
//    Ok(views.html.secure())
//  } } } }

  def javascriptRoutes = Action { implicit request =>
    Ok(
      JavaScriptReverseRouter("jsRoutes")(
        _root_.controllers.library.routes.javascript.LibraryController.viewQuestion,
        _root_.controllers.library.routes.javascript.LibraryController.createQuestionCopyView,
        _root_.controllers.library.routes.javascript.LibraryController.questionListAjax,
        _root_.controllers.quiz.routes.javascript.QuizController.attachAjax,
        _root_.controllers.quiz.routes.javascript.QuestionController.view,
        _root_.controllers.quiz.routes.javascript.QuestionController.removeAjax,
        _root_.controllers.organization.routes.javascript.CourseController.studentSelfQuestion
      )
    ).as("text/javascript")
  }

}


text:
// .NAME vtkPistonDataObject - A GPU resident data set.
//
// .SECTION Description
// vtkPistonDataObject is a basic data structure for storing datasets on
// GPU. This class provides the infrastructure for the VTK pipeline to
// work with the data as it does the rest of the vtkDataObjects.
// The GPU side structures are managed through the internal
// vtkPistonReference instance to keep the GPU/CPU code conceptually
// distinct.
//
// .SECTION See Also
// vtkPistonReference

#ifndef vtkPistonDataObject_h
#define vtkPistonDataObject_h

#include "vtkAcceleratorsPistonModule.h" // For export macro
#include "vtkDataObject.h"

class vtkInformation;
class vtkInformationVector;
class vtkPistonReference;
class vtkTimeStamp;

class VTKACCELERATORSPISTON_EXPORT vtkPistonDataObject : public vtkDataObject
{
public:
  static vtkPistonDataObject* New();
  vtkTypeMacro(vtkPistonDataObject, vtkDataObject);
  void PrintSelf(ostream &os, vtkIndent indent);

  // Description:
  // From vtkType.h, a handle on what type of vtkDataObject this is.
  int GetDataObjectType() {return VTK_PISTON_DATA_OBJECT;}

  // Description:
  // A convenience handle to get type of what is stored in the reference.
  int GetReferredType();

  // Description:
  // A convenience handle to get whatever is actually stored in the reference.
  void * GetReferredData();

//BTX
  // Description:
  // GPU level representation and storage this manages.
  vtkPistonReference *GetReference() { return this->Reference; };
//ETX
  // Description:
  // Shallow/deep copy the data from src into this object.
  virtual void ShallowCopy(vtkDataObject* src);
  virtual void DeepCopy(vtkDataObject* src);

  // Description:
  // Compute the data bounding box.
  virtual void ComputeBounds();

  // Description:
  // Return a pointer to the geometry bounding box in the form
  // (xmin,xmax, ymin,ymax, zmin,zmax).
  double *GetBounds();
  void GetBounds(double bounds[6]);
  void SetBounds(const double bounds[6]);

  // Description:
  double *GetOrigin();
  void GetOrigin(double origin[3]);
  void SetOrigin(const double origin[3]);

  // Description:
  double *GetSpacing();
  void GetSpacing(double spacing[3]);
  void SetSpacing(double spacing[3]);

  // Description:
  // Get scalars array name
  vtkGetStringMacro(ScalarsArrayName);
  // Set scalars array name
  vtkSetStringMacro(ScalarsArrayName);

  // Description:
  // Get scalars range
  // \NOTE: For now only one scalar is supported in Piston
  double* GetScalarsRange();
  void GetScalarsRange(double range[2]);
  // Description:
  // Set scalars range.
  void SetScalarsRange(double range[2]);

  //BTX
  // Description:
  // Retrieve an instance of this class from an information object.
  static vtkPistonDataObject* GetData(vtkInformation* info);
  static vtkPistonDataObject* GetData(vtkInformationVector* v, int i=0);
  //ETX

protected:
  vtkPistonDataObject();
  ~vtkPistonDataObject();

  vtkPistonReference *Reference;
  bool OwnReference;
  double Bounds[6];
  double Origin[3];
  double Spacing[3];

  char *ScalarsArrayName;
  double ScalarsRange[2];
  vtkTimeStamp ComputeTime; // Time at which bounds, center, etc. computed

private:
  vtkPistonDataObject(const vtkPistonDataObject&); // Not implemented
  void operator=(const vtkPistonDataObject&); // Not implemented
};

#endif


text:
<!DOCTYPE html>

  <meta charset="utf-8">
  <title>Orderpath Loadstates Test Suite</title>

  <link rel="stylesheet" href="../libs/qunit/qunit.css" media="screen">

    lame test markup
    normal test markup
    awesome test markup
	<form>
		<select id="countries" data-country="US">
			<option value="US">US</option>
			<option value="CA">Canada</option>
		</select>
		<select id="states" data-state="WA">
		</select>
	</form>


text:
<?php
namespace Application\Domain\Company;

/**
 *
 * @author Nguyen Mau Tri - ngmautri@gmail.com
 *
 */
final class CompanyVO
{

    private $id;

    private $companyCode;

    private $companyName;

    private $defaultLogoId;

    private $status;

    private $createdOn;

    private $isDefault;

    private $token;

    private $lastChangeOn;

    private $revisionNo;

    private $uuid;

    private $defaultLocale;

    private $defaultLanguage;

    private $defaultFormat;

    private $defaultWarehouseCode;

    private $defaultCurrencyIso;

    private $defaultCurrency;

    private $createdBy;

    private $country;

    private $defaultAddress;

    private $lastChangeBy;

    private $defaultWarehouse;

    /**
     *
     * @return mixed
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     *
     * @return mixed
     */
    public function getCompanyCode()
    {
        return $this->companyCode;
    }

    /**
     *
     * @return mixed
     */
    public function getCompanyName()
    {
        return $this->companyName;
    }

    /**
     *
     * @return mixed
     */
    public function getDefaultLogoId()
    {
        return $this->defaultLogoId;
    }

    /**
     *
     * @return mixed
     */
    public function getStatus()
    {
        return $this->status;
    }

    /**
     *
     * @return mixed
     */
    public function getCreatedOn()
    {
        return $this->createdOn;
    }

    /**
     *
     * @return mixed
     */
    public function getIsDefault()
    {
        return $this->isDefault;
    }

    /**
     *
     * @return mixed
     */
    public function getToken()
    {
        return $this->token;
    }

    /**
     *
     * @return mixed
     */
    public function getLastChangeOn()
    {
        return $this->lastChangeOn;
    }

    /**
     *
     * @return mixed
     */
    public function getRevisionNo()
    {
        return $this->revisionNo;
    }

    /**
     *
     * @return mixed
     */
    public function getUuid()
    {
        return $this->uuid;
    }

    /**
     *
     * @return mixed
     */
    public function getDefaultLocale()
    {
        return $this->defaultLocale;
    }

    /**
     *
     * @return mixed
     */
    public function getDefaultLanguage()
    {
        return $this->defaultLanguage;
    }

    /**
     *
     * @return mixed
     */
    public function getDefaultFormat()
    {
        return $this->defaultFormat;
    }

    /**
     *
     * @return mixed
     */
    public function getDefaultWarehouseCode()
    {
        return $this->defaultWarehouseCode;
    }

    /**
     *
     * @return mixed
     */
    public function getDefaultCurrencyIso()
    {
        return $this->defaultCurrencyIso;
    }

    /**
     *
     * @return mixed
     */
    public function getDefaultCurrency()
    {
        return $this->defaultCurrency;
    }

    /**
     *
     * @return mixed
     */
    public function getCreatedBy()
    {
        return $this->createdBy;
    }

    /**
     *
     * @return mixed
     */
    public function getCountry()
    {
        return $this->country;
    }

    /**
     *
     * @return mixed
     */
    public function getDefaultAddress()
    {
        return $this->defaultAddress;
    }

    /**
     *
     * @return mixed
     */
    public function getLastChangeBy()
    {
        return $this->lastChangeBy;
    }

    /**
     *
     * @return mixed
     */
    public function getDefaultWarehouse()
    {
        return $this->defaultWarehouse;
    }
}


text:
package com.intellij.util;

import com.intellij.openapi.util.Condition;
import com.intellij.util.containers.Convertor;
import org.jetbrains.annotations.Contract;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

/**
 * @author peter
 */
public class ObjectUtils {
  private ObjectUtils() {
  }

  public static final Object NULL = new Object();

  @NotNull
  public static <T> T assertNotNull(@Nullable T t) {
    return notNull(t);
  }

  public static <T> void assertAllElementsNotNull(@NotNull T[] array) {
    for (int i = 0; i < array.length; i++) {
      T t = array[i];
      if (t == null) {
        throw new NullPointerException("Element [" + i + "] is null");
      }
    }
  }

  @Contract("null, null -> null")
  public static <T> T chooseNotNull(@Nullable T t1, @Nullable T t2) {
    return t1 == null? t2 : t1;
  }

  @Contract("null,null->null")
  public static <T> T coalesce(@Nullable T t1, @Nullable T t2) {
    return chooseNotNull(t1, t2);
  }

  @Contract("null,null,null->null")
  public static <T> T coalesce(@Nullable T t1, @Nullable T t2, @Nullable T t3) {
    return t1 != null ? t1 : t2 != null ? t2 : t3;
  }

  @Nullable
  public static <T> T coalesce(@Nullable Iterable<T> o) {
    if (o == null) return null;
    for (T t : o) {
      if (t != null) return t;
    }
    return null;
  }

  @NotNull
  public static <T> T notNull(@Nullable T value) {
    //noinspection ConstantConditions
    return notNull(value, value);
  }

  @NotNull
  public static <T> T notNull(@Nullable T value, @NotNull T defaultValue) {
    return value == null ? defaultValue : value;
  }

  @Contract("null, _ -> null")
  @Nullable
  public static <T> T tryCast(@Nullable Object obj, @NotNull Class<T> clazz) {
    if (clazz.isInstance(obj)) {
      return clazz.cast(obj);
    }
    return null;
  }

  @Nullable
  public static <T, S> S doIfCast(@Nullable Object obj, @NotNull Class<T> clazz, final Convertor<T, S> convertor) {
    if (clazz.isInstance(obj)) {
      //noinspection unchecked
      return convertor.convert((T)obj);
    }
    return null;
  }

  @SuppressWarnings("unchecked")
  public static <T> void consumeIfCast(@Nullable Object obj, @NotNull Class<T> clazz, final Consumer<T> consumer) {
    if (clazz.isInstance(obj)) consumer.consume((T)obj);
  }

  @Nullable
  public static <T> T nullizeByCondition(@Nullable final T obj, @NotNull final Condition<T> condition) {
    if (condition.value(obj)) {
      return null;
    }
    return obj;
  }
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CSharpGL;

namespace c08d01_PickPoint
{
    class PointsModel : IBufferSource
    {
        private vec3[] positions;
        private vec3[] colors;

        private vec3 size;
        public vec3 GetSize()
        {
            return this.size;
        }

        public PointsModel(int width, int height, int depth)
        {
            if (width < 1 || height < 1 || depth < 1) { throw new ArgumentOutOfRangeException(); }

            {
                var positions = new vec3[width * height * depth];
                int index = 0;
                for (int w = 0; w < width; w++)
                {
                    for (int h = 0; h < height; h++)
                    {
                        for (int d = 0; d < depth; d++)
                        {
                            positions[index++] = new vec3(w, h, d);
                        }
                    }
                }
                BoundingBox box = positions.Move2Center();
                this.size = box.MaxPosition - box.MinPosition;
                this.positions = positions;
            }
            {
                var random = new Random();
                var colors = new vec3[width * height * depth];
                for (int i = 0; i < colors.Length; i++)
                {
                    colors[i] = new vec3((float)random.NextDouble(), (float)random.NextDouble(), (float)random.NextDouble());
                }
                this.colors = colors;
            }
        }
        public const string strPosition = "position";
        private VertexBuffer positionBuffer;
        public const string strColor = "color";
        private VertexBuffer colorBuffer;

        private IDrawCommand drawCmd;

        #region IBufferSource 成员

        public IEnumerable<VertexBuffer> GetVertexAttribute(string bufferName)
        {
            if (strPosition == bufferName)
            {
                if (this.positionBuffer == null)
                {
                    this.positionBuffer = this.positions.GenVertexBuffer(VBOConfig.Vec3, BufferUsage.StaticDraw);
                }

                yield return this.positionBuffer;
            }
            else if (strColor == bufferName)
            {
                if (this.colorBuffer == null)
                {
                    this.colorBuffer = this.colors.GenVertexBuffer(VBOConfig.Vec3, BufferUsage.StaticDraw);
                }

                yield return this.colorBuffer;
            }
            else
            {
                throw new ArgumentException();
            }
        }

        public IEnumerable<IDrawCommand> GetDrawCommand()
        {
            if (this.drawCmd == null)
            {
                this.drawCmd = new DrawArraysCmd(DrawMode.Points, this.positions.Length);
            }

            yield return this.drawCmd;
        }

        #endregion

    }
}


text:
package org.apache.skywalking.oal.rt.parser;

import lombok.Getter;
import lombok.Setter;
import org.apache.skywalking.oal.rt.util.ClassMethodUtil;

@Getter
@Setter
public class PersistenceField {
    private String fieldName;
    private String setter;
    private String getter;
    private String fieldType;

    public PersistenceField(String fieldName, String fieldType) {
        this.fieldName = fieldName;
        this.setter = ClassMethodUtil.toSetMethod(fieldName);
        this.getter = ClassMethodUtil.toGetMethod(fieldName);
        this.fieldType = fieldType;
    }
}


text:
package lib.hudson;

import static org.junit.Assert.assertNotNull;

import hudson.model.InvisibleAction;
import hudson.model.RootAction;
import org.junit.Rule;
import org.junit.Test;
import org.jvnet.hudson.test.JenkinsRule;
import org.jvnet.hudson.test.TestExtension;

/**
 * @author Kohsuke Kawaguchi
 */
public class ActionsTest {

    @Rule
    public JenkinsRule j = new JenkinsRule();

    @Test
    public void override() throws Exception {
        assertNotNull(j.createWebClient().goTo("").getElementById("bravo"));
    }

    @TestExtension
    public static class RootActionImpl extends InvisibleAction implements RootAction {
    }
}


text:
package gx.realtime;

public class TextDeletedEvent extends RevertableEvent
{

    private int index;
    private String text;

    /**
     * Event fired when text is removed from a string.
     *
     * @param target    The target object that generated the event.
     * @param sessionId The id of the session that initiated the event.
     * @param userId    The user id of the user that initiated the event.
     * @param local     Whether this event originated in the local session.
     * @param index     The index of the change.
     * @param text      The deleted text.
     */
    public TextDeletedEvent(CollaborativeString target, String sessionId, String userId, boolean local, int index, String text)
    {
        super(EventType.TEXT_DELETED, target, sessionId, userId, local, false);
        this.index = index;
        this.text = text;
    }

    /**
     * @return The index.
     */
    public int getIndex()
    {
        return index;
    }

    /**
     * Set the index
     *
     * @param index The index.
     */
    public void setIndex(int index)
    {
        this.index = index;
    }

    /**
     * @return The text that was deleted.
     */
    public String getText()
    {
        return text;
    }

    /**
     * Set the text that is deleted.
     *
     * @param text The text that is deleted.
     */
    public void setText(String text)
    {
        this.text = text;
    }

    @Override
    public RevertableEvent getReverseEvent()
    {
        return new TextInsertedEvent((CollaborativeString) target, sessionId, userId, isLocal, index, text);
    }
}


text:
package net.nemerosa.ontrack.service;

import net.nemerosa.ontrack.model.buildfilter.BuildFilterForm;
import net.nemerosa.ontrack.model.buildfilter.BuildFilterProvider;
import net.nemerosa.ontrack.model.form.Form;
import net.nemerosa.ontrack.model.structure.ID;

import static net.nemerosa.ontrack.model.form.Form.defaultNameField;

public abstract class AbstractBuildFilterProvider<T> implements BuildFilterProvider<T> {

    @Override
    public BuildFilterForm newFilterForm(ID branchId) {
        return new BuildFilterForm(
                getClass(),
                getName(),
                isPredefined(),
                rootForm().append(blankForm(branchId))
        );
    }

    @Override
    public BuildFilterForm getFilterForm(ID branchId, T data) {
        return new BuildFilterForm(
                getClass(),
                getName(),
                isPredefined(),
                fill(rootForm().append(blankForm(branchId)), data)
        );
    }

    protected abstract Form fill(Form form, T data);

    private Form rootForm() {
        return Form.create().with(defaultNameField().optional());
    }

    protected abstract Form blankForm(ID branchId);
}


text:
from .. import syntax
from ..ndtypes import ArrayT, SliceT, ScalarT, TupleT, Int64, StructT, ClosureT, IntT, NoneT
from ..syntax import Attribute, TupleProj, Var, ClosureElt
from ..shape_inference import shape_env, shape
from ..transforms import Transform

class Counter(object):
  """
  Auto-incrementing counter
  """
  def __init__(self):
    self.n = 0

  def get(self):
    n = self.n
    self.n += 1
    return n

class ShapeElimination(Transform):

  def pre_apply(self, fn):
    self.shape_env = shape_env(fn)
    # map from shape vars to expressions
    self.shape_vars = {}
    self.shape_var_counter = Counter()
    input_vars = [Var(arg_name, type = arg_type)
                  for arg_name, arg_type in zip(fn.arg_names, fn.input_types)]
    self.fill_shape_vars_list(input_vars)

  def fill_shape_vars(self, expr):
    t = expr.type
    c = t.__class__
    if c is TupleT:
      elts = [TupleProj(expr,i,type=elt_t)
              for i, elt_t in enumerate(t.elt_types)]
      self.fill_shape_vars_list(elts)
    elif c is ClosureT:
      elts = [ClosureElt(expr,i,type=elt_t)
              for i, elt_t in enumerate(t.arg_types)]
      self.fill_shape_vars_list(elts)
    elif c is ArrayT:
      shape = Attribute(expr, 'shape', t.shape_t)
      dims = [TupleProj(shape,i,type=Int64) for i in xrange(t.rank)]
      self.fill_shape_vars_list(dims)
    elif c is StructT:
      fields = [Attribute(expr, field_name, type = field_type)
                for field_name, field_type in zip(t.field_names, t.field_types)]
      self.fill_shape_vars_list(fields)
    elif c is SliceT:
      fields = []
      start_t = expr.type.start_type
      if start_t != NoneT: fields.append(Attribute(expr, 'start', type = start_t))
      stop_t = expr.type.stop_type
      if stop_t != NoneT: fields.append(Attribute(expr, 'stop', type = stop_t))
      step_t = expr.type.step_type
      if step_t != NoneT: fields.append(Attribute(expr, 'step', type = step_t))
      self.fill_shape_vars_list(fields)
    elif isinstance(t, ScalarT):
      self.shape_vars[self.shape_var_counter.get()] = expr

  def fill_shape_vars_list(self, arg_exprs):
    for e in arg_exprs:
      self.fill_shape_vars(e)

  def transform_Var(self, expr):
    #print expr, self.shape_env.get(expr.name)
    if expr.name in self.shape_env:
      v = self.shape_env[expr.name]
      # don't trust shape propagation to correctly handle floating point errors
      if v.__class__ is shape.Const and isinstance(expr.type, IntT):
        return syntax.Const(value = v.value, type = expr.type)
      elif v.__class__ is shape.Var:
        new_expr = self.shape_vars[v.num]

        if new_expr != expr:
          return self.cast(self.shape_vars[v.num], expr.type)
    return expr

  def transform_lhs(self, lhs):
    return lhs


text:
<?php

$design['contenu']='
Nos partenaires d\'affiliation

 Interpari

 « Vous voulez parier sur le foot ? Tentez votre chance, le premier pari perdu est remboursé ! »

Plateforme SMS

		L\'envoie des SMS vers la France et l\'étranger pour un prix trés faible est assuré par la plateforme sms :
TMB SMS Online

	Autres partenaires

	The Million Dollar Homepage

	OVH pour l\'hébergement et le nom de domaine

	Mon-Look.com : Site de rencontre

	Sms gratuits par YoTsumi

';
?>


text:
CREATE SCHEMA IF NOT EXISTS `mysqlgt`;

-- Setup a user for internal use only with an unknown random password
-- CREATE USER `mysqlgt`@`*internal-only*`;
-- UPDATE mysql.`user` SET `Password` = PASSWORD(MD5(RAND())) WHERE `user` = 'mysqlgt' AND `Host` = "*internal-only*";

-- Setup mysqlgt tables and procedures
CREATE TABLE IF NOT EXISTS `mysqlgt`.`db_grant` (
    `Host` char(60) COLLATE utf8_bin NOT NULL DEFAULT '',
    `Db` char(64) COLLATE utf8_bin NOT NULL DEFAULT '',
    `User` char(16) COLLATE utf8_bin NOT NULL DEFAULT '',
    `Table_priv` set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter','Create View','Show view','Trigger') CHARACTER SET utf8 NOT NULL DEFAULT '',
    PRIMARY KEY (`Host`,`Db`,`User`),
    KEY `User` (`User`)
)
ENGINE=InnoDB
DEFAULT CHARSET=utf8
COLLATE=utf8_bin;

CREATE TABLE IF NOT EXISTS `mysqlgt`.`log` (
    `idlog` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
	`timestamp` TIMESTAMP,
	`user` char(77), # 16 + 1 + 60
	`destination` char(194), # 64 + 1 + 64 + 1 + 64
    `log` TEXT,
    PRIMARY KEY (`idlog`)
)
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8
COLLATE = utf8_general_ci;

DROP PROCEDURE IF EXISTS `mysqlgt`.`gtSIMPLIFY_DATA`;
DELIMITER //
CREATE DEFINER = `mysqlgt`@`*internal-only*`
PROCEDURE `mysqlgt`.`gtSIMPLIFY_DATA` (
    IN tbl_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter','Create View','Show view','Trigger','All'),
    IN new_db_dot_table_dot_column char(194),  # 64 + 1 + 64 + 1 + 64
    IN new_user_at_host char(77), # 16 + 1 + 60
    OUT new_table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter','Create View','Show view','Trigger'),
    OUT new_db char(64),
    OUT new_table_name char(64),
    OUT new_column_name char(64),
    OUT new_user char(16),
    OUT new_host char(60),
    OUT invoker_user char(16),
    OUT invoker_host char(60),
    OUT allowed_operations set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter','Create View','Show view','Trigger')
)
SQL SECURITY DEFINER
BEGIN
    DECLARE grant_s_priv, grant_u_priv, grant_d_priv, grant_i_priv TEXT;

    #break user@host to user and host
    SET new_user = replace(substring(substring_index(new_user_at_host, '@', 1), length(substring_index(new_user_at_host, '@', 1 - 1)) + 1), '@', '');
    SET new_host = replace(substring(substring_index(new_user_at_host, '@', 2), length(substring_index(new_user_at_host, '@', 2 - 1)) + 1), '@', '');

    #break db.tablename.columnname to db, tablename and columnname
    SET new_db = replace(substring(substring_index(new_db_dot_table_dot_column, '.', 1), length(substring_index(new_db_dot_table_dot_column, '.', 1 - 1)) + 1), '.', '');
    SET new_table_name = replace(substring(substring_index(new_db_dot_table_dot_column, '.', 2), length(substring_index(new_db_dot_table_dot_column, '.', 2 - 1)) + 1), '.', '');
    SET new_column_name = replace(substring(substring_index(new_db_dot_table_dot_column, '.', 3), length(substring_index(new_db_dot_table_dot_column, '.', 3 - 1)) + 1), '.', '');

    IF (new_db = '') OR (new_table_name = '') THEN
        DROP TABLE `Parameter_not_in_expected_format_db.table_column`;
    END IF;

    #get invoker_user and invoker_host
    SET invoker_user = replace(substring(substring_index(USER(), '@', 1), length(substring_index(USER(), '@', 1 - 1)) + 1), '@', '');
    SET invoker_host = replace(substring(substring_index(USER(), '@', 2), length(substring_index(USER(), '@', 2 - 1)) + 1), '@', '');

    #read allowed operations
    SELECT '' INTO allowed_operations;
    SELECT `Table_priv` INTO allowed_operations FROM mysqlgt.db_grant WHERE (`User`=invoker_user OR `User`='') AND (`Host`=invoker_host OR `Host`='%') AND (`Db`=new_db);

    #if requested grant is 'all', set it to all grants (no point of this now, however could come handy in the future)
    IF find_in_set('all', tbl_priv) THEN
        SET new_table_priv = 'Select,Insert,Update,Delete,Create,Drop,References,Index,Alter,Create View,Show view,Trigger';
    ELSE
        SET new_table_priv = tbl_priv;
    END IF;

END //
DELIMITER ;

DROP PROCEDURE IF EXISTS `mysqlgt`.`gtGRANT`;
DELIMITER //
CREATE DEFINER = `mysqlgt`@`*internal-only*`
PROCEDURE `mysqlgt`.`gtGRANT` (
    IN new_table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter','Create View','Show view','Trigger','All'),
    IN new_db_dot_table_dot_column char(194),  # 64 + 1 + 64 + 1 + 64
    IN new_user_at_host char(77) # 16 + 1 + 60
)
MODIFIES SQL DATA
SQL SECURITY DEFINER
BEGIN

    DECLARE error_message TEXT;
    DECLARE error_message_128 VARCHAR(128);
    DECLARE allowed INT;
    DECLARE allowed_operations_table, new_table_priv_processed set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter','Create View','Show view','Trigger');
    DECLARE operation_temp, allowed_operations_column, new_column_priv_processed, current_column_priv set('Select','Insert','Update','References');

    CALL `mysqlgt`.`gtSIMPLIFY_DATA`(
        new_table_priv, new_db_dot_table_dot_column, new_user_at_host,
        @new_priv_processed, @new_db, @new_table_name, @new_column_name,
        @new_user, @new_host, @invoker_user, @invoker_host, @allowed_operations
    );

    SELECT '' INTO new_table_priv_processed;
    SELECT '' INTO new_column_priv_processed;
    SELECT '' INTO allowed_operations_table;
    SELECT '' INTO allowed_operations_column;
    SELECT '' INTO current_column_priv;

    SELECT `Column_priv` INTO current_column_priv FROM `mysql`.`tables_priv` WHERE `Host`=@new_host AND `Db`=@new_db AND `User`=@new_user AND `Table_name`=@new_table_name;

    IF @new_column_name = '' THEN
        SELECT @allowed_operations INTO allowed_operations_table;
        SELECT @new_priv_processed INTO new_table_priv_processed;
        SELECT ((allowed_operations_table & new_table_priv_processed) = new_table_priv_processed) INTO allowed;
    ELSE
        IF find_in_set('Select', @allowed_operations) THEN
            SELECT 'Select' INTO operation_temp;
            SELECT operation_temp | allowed_operations_column INTO allowed_operations_column;
        END IF;
        IF find_in_set('Insert', @allowed_operations) THEN
            SELECT 'Insert' INTO operation_temp;
            SELECT operation_temp | allowed_operations_column INTO allowed_operations_column;
        END IF;
        IF find_in_set('Update', @allowed_operations) THEN
            SELECT 'Update' INTO operation_temp;
            SELECT operation_temp | allowed_operations_column INTO allowed_operations_column;
        END IF;
        IF find_in_set('References', @allowed_operations) THEN
            SELECT 'References' INTO operation_temp;
            SELECT operation_temp | allowed_operations_column INTO allowed_operations_column;
        END IF;

        SELECT @new_priv_processed INTO new_column_priv_processed;
        SELECT ((allowed_operations_column & new_column_priv_processed) = new_column_priv_processed) INTO allowed;
    END IF;

    #if allowed, insert to mysql internal table and log
    IF allowed = 1 THEN
        INSERT INTO `mysql`.`tables_priv` VALUES(@new_host,@new_db,@new_user,@new_table_name,CURRENT_USER(),CURRENT_TIMESTAMP(),new_table_priv_processed,new_column_priv_processed)
            ON DUPLICATE KEY UPDATE `Table_priv` = (`Table_priv` | new_table_priv_processed), `Column_priv` = (current_column_priv | new_column_priv_processed), `Timestamp` = CURRENT_TIMESTAMP(), `Grantor` = CURRENT_USER();
        IF @new_column_name != '' THEN
            INSERT INTO `mysql`.`columns_priv` VALUES(@new_host,@new_db,@new_user,@new_table_name,@new_column_name,CURRENT_TIMESTAMP(),new_column_priv_processed)
                ON DUPLICATE KEY UPDATE `Column_priv` = (`Column_priv` | new_column_priv_processed), `Timestamp` = CURRENT_TIMESTAMP();
        END IF;
        INSERT INTO `mysqlgt`.`log` VALUES(NULL,CURRENT_TIMESTAMP(),CONCAT(@invoker_user,'@',@invoker_host),new_db_dot_table_dot_column,CONCAT('user granted ', new_table_priv_processed, ' to ', @new_user, '@', @new_host, ' on  ', new_db_dot_table_dot_column));
    ELSE
        SET error_message = CONCAT(@invoker_user,'@',@invoker_host,' is not allowed to grant ', new_table_priv_processed, ', only allowed to grant ', @allowed_operations);
        INSERT INTO `mysqlgt`.`log` VALUES(NULL,CURRENT_TIMESTAMP(),CONCAT(@invoker_user,'@',@invoker_host),new_db_dot_table_dot_column,error_message);
		DROP TABLE `Error_see_mysqlgt_log`;
    END IF;

END //
DELIMITER ;

DROP PROCEDURE IF EXISTS `mysqlgt`.`gtREVOKE`;
DELIMITER //
CREATE DEFINER = `mysqlgt`@`*internal-only*`
PROCEDURE `mysqlgt`.`gtREVOKE` (
    IN unset_table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter','Create View','Show view','Trigger','All'),
    IN new_db_dot_table_dot_column char(194),  # 64 + 1 + 64 + 1 + 64
    IN new_user_at_host char(77) # 16 + 1 + 60
)
MODIFIES SQL DATA
SQL SECURITY DEFINER
BEGIN

    DECLARE val INT;
    DECLARE error_message TEXT;
    DECLARE error_message_128 VARCHAR(128);
    DECLARE current_table_priv, new_table_priv, revoked_priv, allowed_operations_table set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter','Create View','Show view','Trigger');
    DECLARE allowed INT;
    DECLARE revoked_column_priv, operation_temp, new_column_priv_column, new_column_priv_table, allowed_operations_column, current_column_priv_column, current_column_priv_table set('Select','Insert','Update','References');

    CALL `mysqlgt`.`gtSIMPLIFY_DATA`(
        unset_table_priv, new_db_dot_table_dot_column, new_user_at_host,
        @unset_priv_processed, @new_db, @new_table_name, @new_column_name,
        @new_user, @new_host, @invoker_user, @invoker_host, @allowed_operations
    );

    SELECT '' INTO current_table_priv;
    SELECT '' INTO current_column_priv_column;
    SELECT '' INTO current_column_priv_table;
    SELECT '' INTO allowed_operations_column;
    SELECT '' INTO revoked_column_priv;
    SELECT '' INTO revoked_priv;

    SELECT `Table_priv` INTO current_table_priv FROM `mysql`.`tables_priv` WHERE `Host`=@new_host AND `Db`=@new_db AND `User`=@new_user AND `Table_name`=@new_table_name;
    SELECT `Column_priv` INTO current_column_priv_column FROM `mysql`.`columns_priv` WHERE `Host`=@new_host AND `Db`=@new_db AND `User`=@new_user AND `Table_name`=@new_table_name AND `Column_name`=@new_column_name;
    SELECT `Column_priv` INTO current_column_priv_table FROM `mysql`.`tables_priv` WHERE `Host`=@new_host AND `Db`=@new_db AND `User`=@new_user AND `Table_name`=@new_table_name;

    IF @new_column_name = '' THEN
        SELECT current_column_priv_table INTO new_column_priv_table;

        SELECT @unset_priv_processed INTO new_table_priv;
        SELECT (current_table_priv & ~new_table_priv) INTO new_table_priv;
        SELECT (current_table_priv & ~new_table_priv) INTO revoked_priv;

        SELECT @allowed_operations INTO allowed_operations_table;
        SELECT ((revoked_priv & allowed_operations_table) = revoked_priv) INTO allowed;
    ELSE
        SELECT current_table_priv INTO new_table_priv;

        IF find_in_set('Select', @allowed_operations) THEN
            SELECT 'Select' INTO operation_temp;
            SELECT operation_temp | allowed_operations_column INTO allowed_operations_column;
        END IF;
        IF find_in_set('Insert', @allowed_operations) THEN
            SELECT 'Insert' INTO operation_temp;
            SELECT operation_temp | allowed_operations_column INTO allowed_operations_column;
        END IF;
        IF find_in_set('Update', @allowed_operations) THEN
            SELECT 'Update' INTO operation_temp;
            SELECT operation_temp | allowed_operations_column INTO allowed_operations_column;
        END IF;
        IF find_in_set('References', @allowed_operations) THEN
            SELECT 'References' INTO operation_temp;
            SELECT operation_temp | allowed_operations_column INTO allowed_operations_column;
        END IF;

        SELECT @unset_priv_processed INTO new_column_priv_column;
        SELECT (current_column_priv_column & ~new_column_priv_column) INTO new_column_priv_column;
        SELECT (current_column_priv_column & ~new_column_priv_column) INTO revoked_column_priv;

        SELECT @unset_priv_processed INTO new_column_priv_table;
        SELECT (current_column_priv_table & ~new_column_priv_table) INTO new_column_priv_table;

        SELECT ((revoked_column_priv & allowed_operations_column) = revoked_column_priv) INTO allowed;

    END IF;

    #if allowed, insert to mysql internal table and log
    IF allowed = 1 THEN
        IF new_table_priv = 0 AND new_column_priv_table = 0 THEN
            #if it is deleted and column is not blank, it automatically seems to set the Table_priv to '' while not deleting the row
            #so this works fine, however this needs to be tested with older version of MySQL
            DELETE FROM `mysql`.`tables_priv` WHERE `Host`=@new_host AND `Db`=@new_db AND `User`=@new_user AND `Table_name`=@new_table_name;
        ELSE
            INSERT INTO `mysql`.`tables_priv` VALUES(@new_host, @new_db, @new_user, @new_table_name, CURRENT_USER(), CURRENT_TIMESTAMP(), new_table_priv, new_column_priv_table)
                ON DUPLICATE KEY UPDATE `Table_priv` = new_table_priv, `Column_priv` = new_column_priv_table, `Timestamp` = CURRENT_TIMESTAMP(), `Grantor` = CURRENT_USER();
        END IF;

        IF @new_column_name != '' THEN
            IF new_column_priv_column = 0 THEN
                DELETE FROM `mysql`.`columns_priv` WHERE `Host`=@new_host and `Db`=@new_db and `User`=@new_user and `Table_name`=@new_table_name AND `Column_name`=@new_column_name;
            ELSE
                INSERT INTO `mysql`.`columns_priv` VALUES(@new_host,@new_db,@new_user,@new_table_name,@new_column_name,CURRENT_TIMESTAMP(),new_column_priv_column)
                    ON DUPLICATE KEY UPDATE `Column_priv` = new_column_priv_column, `Timestamp` = CURRENT_TIMESTAMP();
            END IF;
        END IF;

        INSERT INTO `mysqlgt`.`log` VALUES(NULL,CURRENT_TIMESTAMP(),CONCAT(@invoker_user,'@',@invoker_host),new_db_dot_table_dot_column,CONCAT('user revoked ', @unset_priv_processed, ' from ', @new_user, '@', @new_host, ' on ', new_db_dot_table_dot_column));
    ELSE
        SET error_message = CONCAT(@invoker_user, '@', @invoker_host, ' is not allowed to revoke ', revoked_priv, ', only allowed to revoke ', @allowed_operations);
        INSERT INTO `mysqlgt`.`log` VALUES(NULL,CURRENT_TIMESTAMP(),CONCAT(@invoker_user,'@',@invoker_host),new_db_dot_table_dot_column,error_message);
		DROP TABLE `Error_see_mysqlgt_log`;
    END IF;

END //
DELIMITER ;

-- Setup grants for the internal user so he can check permissions , insert to log and execute the procedures
GRANT INSERT ON `mysqlgt`.`log` TO `mysqlgt`@`*internal-only*`;
GRANT SELECT ON `mysqlgt`.`db_grant` TO `mysqlgt`@`*internal-only*`;
GRANT SELECT,INSERT,UPDATE,DELETE ON `mysql`.`tables_priv` TO `mysqlgt`@`*internal-only*`;
GRANT SELECT,INSERT,UPDATE,DELETE ON `mysql`.`columns_priv` TO `mysqlgt`@`*internal-only*`;
GRANT EXECUTE ON PROCEDURE `mysqlgt`.`gtSIMPLIFY_DATA` TO `mysqlgt`@`*internal-only*`;
GRANT EXECUTE ON PROCEDURE `mysqlgt`.`gtGRANT` TO `mysqlgt`@`*internal-only*`;
GRANT EXECUTE ON PROCEDURE `mysqlgt`.`gtREVOKE` TO `mysqlgt`@`*internal-only*`;


text:
require 'spec_helper'

describe 'netbeans::cpp' do
  it do
    should contain_class('netbeans::cpp')
    should contain_package('netbeans').with({
      :provider => 'pkgdmg',
      :source   => 'http://download.netbeans.org/netbeans/7.3.1/final/bundles/netbeans-7.3.1-cpp-macosx.dmg'
    })
  end
end


text:
package io.reactivesw.authentication.application.service;

import io.reactivesw.authentication.application.model.LoginResult;
import io.reactivesw.authentication.infrastructure.util.JwtUtil;
import io.reactivesw.customer.customer.application.model.Customer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Created by umasuo on 17/1/23.
 */
@Service
public class SignupApplication {

  /**
   * logger.
   */
  private final static Logger LOG = LoggerFactory.getLogger(SignupApplication.class);

  /**
   * login Rest client.
   */
  @Autowired
  private transient RestClient restClient;

  /**
   * jwt tool for generate token.
   */
  @Autowired
  private transient JwtUtil jwtUtil;

  /**
   * signup with email.
   *
   * @param email    email
   * @param password password
   * @return Customer
   */
  public LoginResult signupWithEmail(String email, String password) {
    LOG.debug("enter: email: {}", email);

    Customer customer = restClient.createCustomerByEmail(email, password);

    String token = jwtUtil.generateToken(customer);

    LoginResult loginResult = new LoginResult(customer, token);

    return loginResult;
  }
}


text:
class AddCustomvhostToEndpoints < ActiveRecord::Migration
  def change
    add_column :endpoints, :customvhost, :string, default: '', limit: 4096
  end
end


text:
#pragma once

#include <QtCore/QObject>
#include <QtCore/QString>
#include <QtCore/QHash>
#include <QtCore/QFile>
#include "trikKernelDeclSpec.h"

namespace trikKernel {

/// Simple trikrc file parser.
class TRIKKERNEL_EXPORT RcReader : public QObject
{
	Q_OBJECT

public:
	/// Constructor.
	/// @param rcFilePath - trikrc file path.
	/// @param parent - parent of this object in Qt object hierarchy.
	explicit RcReader(const QString &rcFilePath, QObject *parent = 0);

	/// Clears data from previous trikrc reading and reads it again.
	void read();

	/// Get value of variable in trikrc.
	/// @param name - variable name.
	/// @return value if variable is found and empty string otherwise.
	QString value(const QString &name) const;

private:
	QHash<QString, QString> mVariables;
	QFile mRcFile;
};

}


text:
#ifndef GRPC_CORE_TSI_ALTS_FRAME_PROTECTOR_ALTS_COUNTER_H
#define GRPC_CORE_TSI_ALTS_FRAME_PROTECTOR_ALTS_COUNTER_H

#include <grpc/support/port_platform.h>

#include <stdbool.h>
#include <stdlib.h>

#include <grpc/grpc.h>

/* Main struct for a crypter counter managed within seal/unseal operations. */
typedef struct alts_counter {
  size_t size;
  size_t overflow_size;
  unsigned char* counter;
} alts_counter;

/**
 * This method creates and initializes an alts_counter instance.
 *
 * - is_client: a flag indicating if the alts_counter instance will be used
 *   at client (is_client = true) or server (is_client = false) side.
 * - counter_size: size of buffer holding the counter value.
 * - overflow_size: overflow size in bytes. The counter instance can be used
 *   to produce at most 2^(overflow_size*8) frames.
 * - crypter_counter: an alts_counter instance to be returned from the method.
 * - error_details: a buffer containing an error message if the method does not
 *   function correctly. It is legal to pass nullptr into error_details and
 *   otherwise, the parameter should be freed with gpr_free.
 *
 * On success, the method returns GRPC_STATUS_OK. Otherwise,
 * it returns an error status code along with its details specified in
 * error_details (if error_details is not nullptr).
 */
grpc_status_code alts_counter_create(bool is_client, size_t counter_size,
                                     size_t overflow_size,
                                     alts_counter** crypter_counter,
                                     char** error_details);

/**
 * This method increments the internal counter.
 *
 * - crypter_counter: an alts_counter instance.
 * - is_overflow: after incrementing the internal counter, if an overflow
 *   occurs, is_overflow is set to true, and no further calls to
 *   alts_counter_increment() should be made. Otherwise, is_overflow is set to
 *   false.
 * - error_details: a buffer containing an error message if the method does not
 *   function correctly. It is legal to pass nullptr into error_details and
 *   otherwise, the parameter should be freed with gpr_free.
 *
 * On success, the method returns GRPC_STATUS_OK. Otherwise,
 * it returns an error status code along with its details specified in
 * error_details (if error_details is not nullptr).
 */
grpc_status_code alts_counter_increment(alts_counter* crypter_counter,
                                        bool* is_overflow,
                                        char** error_details);

/**
 * This method returns the size of counter buffer.
 *
 * - crypter_counter: an alts_counter instance.
 */
size_t alts_counter_get_size(alts_counter* crypter_counter);

/**
 * This method returns the counter buffer.
 *
 * - crypter_counter: an alts_counter instance.
 */
unsigned char* alts_counter_get_counter(alts_counter* crypter_counter);

/**
 * This method de-allocates all memory allocated to an alts_coutner instance.
 * - crypter_counter: an alts_counter instance.
 */
void alts_counter_destroy(alts_counter* crypter_counter);

#endif /* GRPC_CORE_TSI_ALTS_FRAME_PROTECTOR_ALTS_COUNTER_H */


text: My template c# script for unity3d