text:
package org.dbpedia.spotlight.web.rest.resources;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.dbpedia.spotlight.model.SpotlightConfiguration;
import org.dbpedia.spotlight.web.rest.Server;
import org.dbpedia.spotlight.web.rest.ServerUtils;
import org.dbpedia.spotlight.web.rest.SpotlightInterface;

import javax.servlet.http.HttpServletRequest;
import javax.ws.rs.*;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.UriInfo;

/**
 * REST Web Service for annotation: spotting, candidate selection, disambiguation, linking
 *
 * @author pablomendes
 * @author Paul Houle (patch for POST)
 * @author Marcus Nitzschke
 */

@ApplicationPath(Server.APPLICATION_PATH)
@Path("/annotate")
@Consumes("text/plain")
public class Annotate {

    Log LOG = LogFactory.getLog(this.getClass());

    @Context
    private UriInfo context;

    // Annotation interface
    private static SpotlightInterface annotationInterface =  new SpotlightInterface("/annotate");

    @GET
    @Produces(MediaType.TEXT_HTML)
    public Response getHTML(@DefaultValue(SpotlightConfiguration.DEFAULT_TEXT) @QueryParam("text") String text,
                            @DefaultValue(SpotlightConfiguration.DEFAULT_URL) @QueryParam("url") String inUrl,
                            @DefaultValue(SpotlightConfiguration.DEFAULT_CONFIDENCE) @QueryParam("confidence") Double confidence,
                            @DefaultValue(SpotlightConfiguration.DEFAULT_SUPPORT) @QueryParam("support") int support,
                            @DefaultValue(SpotlightConfiguration.DEFAULT_TYPES) @QueryParam("types") String dbpediaTypes,
                            @DefaultValue(SpotlightConfiguration.DEFAULT_SPARQL) @QueryParam("sparql") String sparqlQuery,
                            @DefaultValue(SpotlightConfiguration.DEFAULT_POLICY) @QueryParam("policy") String policy,
                            @DefaultValue(SpotlightConfiguration.DEFAULT_COREFERENCE_RESOLUTION) @QueryParam("coreferenceResolution") boolean coreferenceResolution,
                            @DefaultValue("Default") @QueryParam("spotter") String spotterName,
                            @DefaultValue("Default") @QueryParam("disambiguator") String disambiguatorName,
                            @Context HttpServletRequest request) {

        String clientIp = request.getRemoteAddr();

        try {
            String response = annotationInterface.getHTML(text, inUrl, confidence, support, dbpediaTypes, sparqlQuery, policy, coreferenceResolution, clientIp, spotterName,  disambiguatorName);
            return ServerUtils.ok(response);
        } catch (Exception e) {
            e.printStackTrace();
            throw new WebApplicationException(Response.status(Response.Status.BAD_REQUEST). entity(ServerUtils.print(e)).type(MediaType.TEXT_HTML).build());
        }
    }

    @GET
    @Produces(MediaType.APPLICATION_XHTML_XML)
    public Response getRDFa(@DefaultValue(SpotlightConfiguration.DEFAULT_TEXT) @QueryParam("text") String text,
                            @DefaultValue(SpotlightConfiguration.DEFAULT_URL) @QueryParam("url") String inUrl,
                            @DefaultValue(SpotlightConfiguration.DEFAULT_CONFIDENCE) @QueryParam("confidence") Double confidence,
                          @DefaultValue(SpotlightConfiguration.DEFAULT_SUPPORT) @QueryParam("support") int support,
                          @DefaultValue(SpotlightConfiguration.DEFAULT_TYPES) @QueryParam("types") String dbpediaTypes,
                          @DefaultValue(SpotlightConfiguration.DEFAULT_SPARQL) @QueryParam("sparql") String sparqlQuery,
                          @DefaultValue(SpotlightConfiguration.DEFAULT_POLICY) @QueryParam("policy") String policy,
                          @DefaultValue(SpotlightConfiguration.DEFAULT_COREFERENCE_RESOLUTION) @QueryParam("coreferenceResolution") boolean coreferenceResolution,
                          @DefaultValue("Default") @QueryParam("spotter") String spotterName,
                          @DefaultValue("Default") @QueryParam("disambiguator") String disambiguatorName,
                          @Context HttpServletRequest request) {
        String clientIp = request.getRemoteAddr();

        try {
            return ServerUtils.ok(annotationInterface.getRDFa(text, inUrl, confidence, support, dbpediaTypes, sparqlQuery, policy, coreferenceResolution, clientIp, spotterName, disambiguatorName));
        } catch (Exception e) {
            throw new WebApplicationException(Response.status(Response.Status.BAD_REQUEST). entity(ServerUtils.print(e)).type(MediaType.APPLICATION_XHTML_XML).build());
        }
    }

    @GET
    @Produces({MediaType.TEXT_XML,MediaType.APPLICATION_XML})
    public Response getXML(@DefaultValue(SpotlightConfiguration.DEFAULT_TEXT) @QueryParam("text") String text,
                           @DefaultValue(SpotlightConfiguration.DEFAULT_URL) @QueryParam("url") String inUrl,
                         @DefaultValue(SpotlightConfiguration.DEFAULT_CONFIDENCE) @QueryParam("confidence") Double confidence,
                         @DefaultValue(SpotlightConfiguration.DEFAULT_SUPPORT) @QueryParam("support") int support,
                         @DefaultValue(SpotlightConfiguration.DEFAULT_TYPES) @QueryParam("types") String dbpediaTypes,
                         @DefaultValue(SpotlightConfiguration.DEFAULT_SPARQL) @QueryParam("sparql") String sparqlQuery,
                         @DefaultValue(SpotlightConfiguration.DEFAULT_POLICY) @QueryParam("policy") String policy,
                         @DefaultValue(SpotlightConfiguration.DEFAULT_COREFERENCE_RESOLUTION) @QueryParam("coreferenceResolution") boolean coreferenceResolution,
                         @DefaultValue("Default") @QueryParam("spotter") String spotterName,
                         @DefaultValue("Default") @QueryParam("disambiguator") String disambiguatorName,
                          @Context HttpServletRequest request) {
        String clientIp = request.getRemoteAddr();

        try {
	    return ServerUtils.ok(annotationInterface.getXML(text, inUrl, confidence, support, dbpediaTypes, sparqlQuery, policy, coreferenceResolution, clientIp, spotterName, disambiguatorName));
       } catch (Exception e) {
            throw new WebApplicationException(Response.status(Response.Status.BAD_REQUEST). entity(ServerUtils.print(e)).type(MediaType.TEXT_XML).build());
        }
    }

    @GET
    @Produces({"application/ld+json", "application/n-triples", "application/rdf+xml", "text/plain", "text/turtle"})
    public Response getNIF(@DefaultValue(SpotlightConfiguration.DEFAULT_TEXT) @QueryParam("text") String text,
			   @DefaultValue(SpotlightConfiguration.DEFAULT_URL) @QueryParam("url") String inUrl,
			   @DefaultValue(SpotlightConfiguration.DEFAULT_CONFIDENCE) @QueryParam("confidence") Double confidence,
			   @DefaultValue(SpotlightConfiguration.DEFAULT_SUPPORT) @QueryParam("support") int support,
			   @DefaultValue(SpotlightConfiguration.DEFAULT_TYPES) @QueryParam("types") String dbpediaTypes,
			   @DefaultValue(SpotlightConfiguration.DEFAULT_SPARQL) @QueryParam("sparql") String sparqlQuery,
			   @DefaultValue(SpotlightConfiguration.DEFAULT_POLICY) @QueryParam("policy") String policy,
			   @DefaultValue(SpotlightConfiguration.DEFAULT_COREFERENCE_RESOLUTION) @QueryParam("coreferenceResolution") boolean coreferenceResolution,
			   @DefaultValue("Default") @QueryParam("spotter") String spotterName,
			   @DefaultValue("Default") @QueryParam("disambiguator") String disambiguatorName,
			   @QueryParam("prefix") String prefix,
			   @Context HttpServletRequest request) {
        String clientIp = request.getRemoteAddr();

	String format = "turtle";
	String accept = request.getHeader("accept");
	if (accept.equalsIgnoreCase("text/turtle"))
	    format = "text/turtle";//format = "turtle";
	else if (accept.equalsIgnoreCase("text/plain"))
	    format = "text/plain";//format = "ntriples";
    else if (accept.equalsIgnoreCase("application/n-triples"))
        format = "application/n-triples";
	else if (accept.equalsIgnoreCase("application/rdf+xml"))
	    format = "application/rdf+xml";//format = "rdfxml";
	else if (accept.equalsIgnoreCase("application/ld+json"))
	    format = "application/ld+json";//format = "ld+json";

	try {
	    return ServerUtils.ok(annotationInterface.getNIF(text, inUrl, confidence, support, dbpediaTypes, sparqlQuery, policy, coreferenceResolution, clientIp, spotterName, disambiguatorName, format, prefix, request.getRequestURL().toString()));
       } catch (Exception e) {
            throw new WebApplicationException(Response.status(Response.Status.BAD_REQUEST). entity(ServerUtils.print(e)).type(accept).build());
        }
    }

    @GET
    @Produces(MediaType.APPLICATION_JSON)
    public Response getJSON(@DefaultValue(SpotlightConfiguration.DEFAULT_TEXT) @QueryParam("text") String text,
                            @DefaultValue(SpotlightConfiguration.DEFAULT_URL) @QueryParam("url") String inUrl,
                          @DefaultValue(SpotlightConfiguration.DEFAULT_CONFIDENCE) @QueryParam("confidence") Double confidence,
                          @DefaultValue(SpotlightConfiguration.DEFAULT_SUPPORT) @QueryParam("support") int support,
                          @DefaultValue(SpotlightConfiguration.DEFAULT_TYPES) @QueryParam("types") String dbpediaTypes,
                          @DefaultValue(SpotlightConfiguration.DEFAULT_SPARQL) @QueryParam("sparql") String sparqlQuery,
                          @DefaultValue(SpotlightConfiguration.DEFAULT_POLICY) @QueryParam("policy") String policy,
                          @DefaultValue(SpotlightConfiguration.DEFAULT_COREFERENCE_RESOLUTION) @QueryParam("coreferenceResolution") boolean coreferenceResolution,
                          @DefaultValue("Default") @QueryParam("spotter") String spotterName,
                          @DefaultValue("Default") @QueryParam("disambiguator") String disambiguatorName,
                          @Context HttpServletRequest request) {
        String clientIp = request.getRemoteAddr();

        try {
            return ServerUtils.ok(annotationInterface.getJSON(text, inUrl, confidence, support, dbpediaTypes, sparqlQuery, policy, coreferenceResolution, clientIp, spotterName, disambiguatorName));
       } catch (Exception e) {
            throw new WebApplicationException(Response.status(Response.Status.BAD_REQUEST). entity(ServerUtils.print(e)).type(MediaType.APPLICATION_JSON).build());
        }
    }

    //Patch provided by Paul Houle

    @POST
    @Consumes(MediaType.APPLICATION_FORM_URLENCODED)
    @Produces(MediaType.TEXT_HTML)
    public Response postHTML(
      @DefaultValue(SpotlightConfiguration.DEFAULT_TEXT) @FormParam("text") String text,
      @DefaultValue(SpotlightConfiguration.DEFAULT_URL) @FormParam("url") String inUrl,
      @DefaultValue(SpotlightConfiguration.DEFAULT_CONFIDENCE) @FormParam("confidence") Double confidence,
      @DefaultValue(SpotlightConfiguration.DEFAULT_SUPPORT) @FormParam("support") int support,
      @DefaultValue(SpotlightConfiguration.DEFAULT_TYPES) @FormParam("types") String dbpediaTypes,
      @DefaultValue(SpotlightConfiguration.DEFAULT_SPARQL) @FormParam("sparql") String sparqlQuery,
      @DefaultValue(SpotlightConfiguration.DEFAULT_POLICY) @FormParam("policy") String policy,
      @DefaultValue(SpotlightConfiguration.DEFAULT_COREFERENCE_RESOLUTION) @FormParam("coreferenceResolution") boolean coreferenceResolution,
      @DefaultValue("Default") @FormParam("spotter") String spotterName,
      @DefaultValue("Default") @FormParam("disambiguator") String disambiguatorName,
      @Context HttpServletRequest request
      ) {
        return getHTML(text,inUrl,confidence,support,dbpediaTypes,sparqlQuery,policy,coreferenceResolution,spotterName,disambiguatorName,request);
    }

    @POST
    @Consumes(MediaType.APPLICATION_FORM_URLENCODED)
    @Produces(MediaType.APPLICATION_XHTML_XML)
    public Response postRDFa(
      @DefaultValue(SpotlightConfiguration.DEFAULT_TEXT) @FormParam("text") String text,
      @DefaultValue(SpotlightConfiguration.DEFAULT_URL) @FormParam("url") String inUrl,
      @DefaultValue(SpotlightConfiguration.DEFAULT_CONFIDENCE) @FormParam("confidence") Double confidence,
      @DefaultValue(SpotlightConfiguration.DEFAULT_SUPPORT) @FormParam("support") int support,
      @DefaultValue(SpotlightConfiguration.DEFAULT_TYPES) @FormParam("types") String dbpediaTypes,
      @DefaultValue(SpotlightConfiguration.DEFAULT_SPARQL) @FormParam("sparql") String sparqlQuery,
      @DefaultValue(SpotlightConfiguration.DEFAULT_POLICY) @FormParam("policy") String policy,
      @DefaultValue(SpotlightConfiguration.DEFAULT_COREFERENCE_RESOLUTION) @FormParam("coreferenceResolution") boolean coreferenceResolution,
      @DefaultValue("Default") @FormParam("spotter") String spotter,
      @DefaultValue("Default") @FormParam("disambiguator") String disambiguatorName,
      @Context HttpServletRequest request
      ) {
        return getRDFa(text,inUrl,confidence,support,dbpediaTypes,sparqlQuery,policy,coreferenceResolution,spotter,disambiguatorName,request);
    }

    @POST
    @Consumes(MediaType.APPLICATION_FORM_URLENCODED)
    @Produces(MediaType.TEXT_XML)
    public Response postXML(
      @DefaultValue(SpotlightConfiguration.DEFAULT_TEXT) @FormParam("text") String text,
      @DefaultValue(SpotlightConfiguration.DEFAULT_URL) @FormParam("url") String inUrl,
      @DefaultValue(SpotlightConfiguration.DEFAULT_CONFIDENCE) @FormParam("confidence") Double confidence,
      @DefaultValue(SpotlightConfiguration.DEFAULT_SUPPORT) @FormParam("support") int support,
      @DefaultValue(SpotlightConfiguration.DEFAULT_TYPES) @FormParam("types") String dbpediaTypes,
      @DefaultValue(SpotlightConfiguration.DEFAULT_SPARQL) @FormParam("sparql") String sparqlQuery,
      @DefaultValue(SpotlightConfiguration.DEFAULT_POLICY) @FormParam("policy") String policy,
      @DefaultValue(SpotlightConfiguration.DEFAULT_COREFERENCE_RESOLUTION) @FormParam("coreferenceResolution") boolean coreferenceResolution,
      @DefaultValue("Default") @FormParam("spotter") String spotter,
      @DefaultValue("Default") @FormParam("disambiguator") String disambiguatorName,
      @Context HttpServletRequest request
      ) {
        return getXML(text,inUrl,confidence,support,dbpediaTypes,sparqlQuery,policy,coreferenceResolution,spotter,disambiguatorName,request);
    }

    @POST
    @Consumes(MediaType.APPLICATION_FORM_URLENCODED)
    @Produces({"text/turtle", "text/plain", "application/rdf+xml", "application/n-triples", "application/ld+json"})
    public Response postNIF(
      @DefaultValue(SpotlightConfiguration.DEFAULT_TEXT) @FormParam("text") String text,
      @DefaultValue(SpotlightConfiguration.DEFAULT_URL) @FormParam("url") String inUrl,
      @DefaultValue(SpotlightConfiguration.DEFAULT_CONFIDENCE) @FormParam("confidence") Double confidence,
      @DefaultValue(SpotlightConfiguration.DEFAULT_SUPPORT) @FormParam("support") int support,
      @DefaultValue(SpotlightConfiguration.DEFAULT_TYPES) @FormParam("types") String dbpediaTypes,
      @DefaultValue(SpotlightConfiguration.DEFAULT_SPARQL) @FormParam("sparql") String sparqlQuery,
      @DefaultValue(SpotlightConfiguration.DEFAULT_POLICY) @FormParam("policy") String policy,
      @DefaultValue(SpotlightConfiguration.DEFAULT_COREFERENCE_RESOLUTION) @FormParam("coreferenceResolution") boolean coreferenceResolution,
      @DefaultValue("Default") @FormParam("spotter") String spotter,
      @DefaultValue("Default") @FormParam("disambiguator") String disambiguatorName,
      @FormParam("prefix") String prefix,
      @DefaultValue("offset") @FormParam("urirecipe") String recipe,
      @DefaultValue("10") @FormParam("context-length") int ctxLength,
      @Context HttpServletRequest request
      ) {
	return getNIF(text,inUrl,confidence,support,dbpediaTypes,sparqlQuery,policy,coreferenceResolution,spotter,disambiguatorName,prefix,request);
    }

    @POST
    @Consumes(MediaType.APPLICATION_FORM_URLENCODED)
    @Produces(MediaType.APPLICATION_JSON)
    public Response postJSON(
      @DefaultValue(SpotlightConfiguration.DEFAULT_TEXT) @FormParam("text") String text,
      @DefaultValue(SpotlightConfiguration.DEFAULT_URL) @FormParam("url") String inUrl,
      @DefaultValue(SpotlightConfiguration.DEFAULT_CONFIDENCE) @FormParam("confidence") Double confidence,
      @DefaultValue(SpotlightConfiguration.DEFAULT_SUPPORT) @FormParam("support") int support,
      @DefaultValue(SpotlightConfiguration.DEFAULT_TYPES) @FormParam("types") String dbpediaTypes,
      @DefaultValue(SpotlightConfiguration.DEFAULT_SPARQL) @FormParam("sparql") String sparqlQuery,
      @DefaultValue(SpotlightConfiguration.DEFAULT_POLICY) @FormParam("policy") String policy,
      @DefaultValue(SpotlightConfiguration.DEFAULT_COREFERENCE_RESOLUTION) @FormParam("coreferenceResolution") boolean coreferenceResolution,
      @DefaultValue("Default") @FormParam("spotter") String spotter,
      @DefaultValue("Default") @FormParam("disambiguator") String disambiguatorName,
      @Context HttpServletRequest request
      ) {
        return getJSON(text,inUrl,confidence,support,dbpediaTypes,sparqlQuery,policy,coreferenceResolution,spotter,disambiguatorName,request);
      }

}


text:
'use strict';

var mongoose = require('mongoose'),
	Schema = mongoose.Schema,
	ObjectId = Schema.ObjectId;

var userprivilegeSchema = new Schema({
	id: ObjectId,
	userprivilegeid: {
		type: Number,
		unique: true
	},
	title: String,
	name: {
		type: String,
		unique: true
	},
	author: {
		type: ObjectId,
		ref: 'User'
	},
	description: String,
	extensionattributes: Schema.Types.Mixed,
	random: Number
});

userprivilegeSchema.pre('save', function (next, done) {
	// var badname = new RegExp(/\badmin\b|\bconfig\b|\bprofile\b|\bindex\b|\bcreate\b|\bdelete\b|\bdestroy\b|\bedit\b|\btrue\b|\bfalse\b|\bupdate\b|\blogin\b|\blogut\b|\bdestroy\b|\bwelcome\b|\bdashboard\b/i);
	if (this.name !== undefined && this.name.length < 4) {
		done(new Error('User privilege title is too short'));
	}
	// else if(this.name !== undefined && badname.test(this.name) ){
	//     done(new Error('User privilege title('+this.name+') is a reserved word invalid'));
	// }
	else {
		next();
	}
});

module.exports = userprivilegeSchema;

redpajama_set_name: RedPajamaGithub


text:
set -e

#Some housekeeping variables

red=`tput setaf 1`
green=`tput setaf 2`
yellow=`tput setaf 3`
blue=`tput setaf 4`
reset=`tput sgr0`
UL=$(tput cuu1)
EL=$(tput el)
curdir=$(pwd)

#welcome screen

clear
echo "${green}"
echo "	|-------------------------------------------------------------------|"
echo "	|	Welcome to the GoldenEye:Source server installer by ${red}DEATH${green}   |"
echo "	|	This Script will install all the required prerequisites     |"
echo "	|	including steamcmd, server files, library files, ect.       |"
echo "	|-------------------------------------------------------------------|"
echo "${reset}"

if [ $(id -u) != "0" ]; then
    echo "You must be the superuser to run this script" >&2
    echo ""
    exit 1
fi

if [ -x $(command -v apt-get >/dev/null) ];then
	echo ""
else
	echo "You dont have apt-get... it is required"
	echo ""
	exit 1
fi

#Install file locations

checkiftrue()
{
	case "$1" in
	    [yY]|[yY][eE][sS])
	        return 0 ;;
	    [nN]|[nN][oO])
	        return 1 ;;
	esac
}

checkiffalse()
{
	case "$1" in
	    [yY]|[yY][eE][sS])
	        return 1 ;;
	    [nN]|[nN][oO])
	        return 0 ;;
	esac
}

serververname='GoldenEye: Source v5.0.6 Server'
steamdl='https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz'
steamdlname='steamcmd_linux.tar.gz'
serverfilesdl='https://getsio.net/ext/geshl2.com/Server/GoldenEye_Source_v5.0.6_full_server.7z'
serverfilesdlname='GoldenEye_Source_v5.0.6_full_server.7z'
serversmdl='https://sm.alliedmods.net/smdrop/1.8/sourcemod-1.8.0-git6028-linux.tar.gz'
serversmdlname='sourcemod-1.8.0-git6028-linux.tar.gz'
servermmdl='https://mms.alliedmods.net/mmsdrop/1.10/mmsource-1.10.7-git959-linux.tar.gz'
servermmdlname='mmsource-1.10.7-git959-linux.tar.gz'
logfile='/var/log/install_ges.log'
prerequisites="gcc-4.9 g++-4.9 p7zip-full sudo wget nano lib32gcc1 lib32stdc++6 lib32z1 gdb"

if [ "$1" == "-h" ] || [ "$1" == "--h" ] || [ "$1" == "-help" ] || [ "$1" == "--help" ];then
	echo ''
	echo 'For automated install, '
	echo 'ex. ./install_ges.sh -a steam STEAM:0:0:12345'
	echo 'or  ./install_ges.sh -a steam STEAM:0:0:12345 "-game ./gesource/ -console +maxplayers 16 +map ge_archives +exec server.cfg"'
	echo ''
	echo 'Second option is be specific for what to install.'
	echo 'in this order, '
fi

if [ "$1" == "-a" ] || [ "$1" == "-A" ] && [ "$2" != "" ] && [ "$3" != "" ] && [ "$4" == "" ];then

	installsm=Y
	doinstallsm=Y
	installservice=Y
	doinstallservice=Y
	useraccount=$2
	steamid=$3
	automated=Y
	usrstop=0

fi
if [ "$1" == "-a" ] || [ "$1" == "-A" ] && [ "$2" != "" ] && [ "$3" != "" ] && [ "$4" != "" ];then

	installsm=Y
	doinstallsm=Y
	installservice=Y
	doinstallservice=Y
	useraccount=$2
	steamid=$3
	serviceprams=$4
	automated=Y
	usrstop=0

fi
if [ ! -f $logfile ];then
	touch $logfile
fi
installlocationlog=$(head -n 1 /var/log/install_ges.log)

if [ "$1" == "-uninstall" ];then
		if [ "$installlocationlog" != "" ];then
			read -p '	Are you sure you want to uninstall the server from '${green}${installlocation}${reset}'? [y/n]: ' douninstall
			if checkiftrue $douninstall;then
				rm -d -r /home/$installlocation/Steam
				rm -d -r /home/$installlocation/steamcmd
				rm -d -r /home/$installlocation/ges_server
				rm -d -r /home/$installlocation/ges_downloads
				rm -d -r install_ges.sh
				rm -d -r run_ges.sh
				rm -d -r update_ges.sh
				exit 0
			fi
			exit 0
		else
			echo "No record of previous installation"
			exit 0
		fi
fi

if checkiffalse $automated;then
		if [ "$installlocationlog" != "" ];then
			echo "	SERVER ALREADY INSTALLED"
			read -p "	Are you sure you want to continue? [${green}y/n${reset}]" alreadyinstallcont
			if checkiftrue $alreadyinstallcont;then
				echo ""
			else
				exit 1
			fi

		fi
fi

#install the required prerequisites for server, start task in the background

{
apt-get upgrade -y -qq > /dev/null 2>&1
apt-get update -y -qq > /dev/null 2>&1
apt-get install -y -qq software-properties-common > /dev/null 2>&1
add-apt-repository -y ppa:ubuntu-toolchain-r/test > /dev/null 2>&1
apt-get update -y -qq > /dev/null 2>&1
apt-get install -y -qq $prerequisites > /dev/null 2>&1
} &
pid1=$!

if checkiffalse $automated;then

	echo "	${green}Please specify a user account to create for the server, do not use root"
	echo "	The account specified will be created and the home dir used for the server"
	echo "	It is highly suggested to use a new account for this."
	echo "	${reset}"
	useraccount=steam
	#require non root user account with warning for using an already existing user account
	read -p '	Username ['${green}${useraccount}${reset}']: ' useraccount
	if [ "$useraccount" == "" ];then
		useraccount=steam
	fi
	op=":"
	while :
		do
			if [ "$useraccount" == "root" ] || [ "$useraccount" == "" ]; then
				echo '	You cannot use root or blank, please specify an account to create: '
			elif [ "$(sudo grep -c $useraccount$op /etc/passwd)" == "1" ]; then
				echo	""
				echo 	"	${green}${useraccount}${red} already exists, are you sure you want to use this account"
				echo 	"	this script will write the server files to ${green}/home/${useraccount}/"
				echo	"${reset}"
				read -p '	Use this account? ['${green}'y/n'${reset}']: ' usetheaccount
				if checkiffalse $usetheaccount; then
					read -p '	specify a new account: ' useraccount
					read -p '	Use account? ['${green}${useraccount}${reset}'] [y/n]: ' useusr
				fi
				if checkiftrue $usetheaccount; then
					useusr="y"
				fi
			elif checkiffalse $useusr;then
				echo
				read -p '	Use account? ['${green}${useraccount}${reset}'] [y/n]: ' useusr
			fi
			if checkiftrue $useusr;then
				break
			fi
	done
fi
echo

installlocation='/home/'$useraccount'/ges_server'

#add the user from the command above, with no output
echo $useraccount > /var/log/install_ges.log
set +e
adduser --disabled-password --gecos "" $useraccount > /dev/null 2>&1
set -e
#ask user if the server should be installed as a service
if checkiffalse $automated;then
	read -p '	Install server as a service? ['${green}'y/n'${reset}']: ' installservice
	while :
	do
		if checkiftrue $installservice || checkiffalse $installservice;then
			break
		fi
		read -p '	Install server as a service? ['${green}'y/n'${reset}']: ' installservice
	done
fi
#if the user says yes to install as a service, setup the server file for creation
servername=$serververname
servermaxplayers=16
serverpassword=""
serverregion=0
if checkiffalse $automated;then
	echo ""
	echo "	Lets setup some server variables"
	echo ""
	read -p "	Server Name? [${green}${servername}${reset}]: " servername
	read -p "	Max Players? [${green}${servermaxplayers}${reset}](please stay at 16 or under): " servermaxplayers
	read -p "	If you want your server to be private, fill in a password [${green}NONE${reset}]: " serverpassword
	read -p "	Enter a rcon password [${green}(required)${reset}] : " serverrcon
	while :
		do
			if [ "$serverrcon" != "" ];then
				break
			fi
			read -p "	Enter a rcon password [${red}(required)${reset}]  : " serverrcon
		done
	echo ""
	echo "	0=US East coast"
	echo "	1=US West coast"
	echo "	2=South America"
	echo "	3=Europe"
	echo "	4=Asia"
	echo "	5=Australia"
	echo "	6=Middle East"
	echo "	7=Africa"
	echo "	255=world"
	read -p "	Set server region [${green}${serverregion}${reset}]: " serverregion
fi
if checkiftrue $installservice; then

		doinstallservice="Y"
		serviceuser="SRCDS_USER='$useraccount'"
		servicedir="DIR='/home/$useraccount/ges_server/'"
		serviceprams='-game ./gesource/ -console +maxplayers '$servermaxplayers' -norestart +map ge_archives +exec server.cfg'

		if checkiffalse $automated;then
			echo "${green}"
			echo "	server launch parameters?"
			echo "${yellow} ${serviceprams}${green}"
			echo '	Enter custom launch prameters or press enter for default: '
			echo "${reset}"
			read -p '	['${green}'PRAMS'${reset}']: ' praminput
			echo ""
		fi
		if [ "$praminput" != "" ];then
			serviceprams=$praminput
		fi
		servicelaunch="PARAMS='$serviceprams'"
else
	doinstallservice="N"
fi

#ask the user if they want source mod installed(admin mod).

if checkiffalse $automated;then
read -p '	Install Source Mod?(Admin mod, mute,kick,ban,ect.) ['${green}'y/n'${reset}']: ' installsm

	while :
	do
		if checkiftrue $installsm || checkiffalse $installsm;then
			break
		fi
		read -p '	Install Source Mod? ['${green}'y/n'${reset}']: ' installsm
	done
fi
echo

#if the user says yes to installing source mod, set to doinsall as a simple variable to avoid checking for all yes inputs

if checkiftrue $installsm; then
	doinstallsm="Y"
else
	doinstallsm="N"
fi

#if the user said yes to installing source mod, ask for their steam id to add them as the first admin

if checkiftrue $doinstallsm && checkiffalse $automated; then
	echo "${green}		To get your current steam ID, open a source based game"
	echo "		join a server and type status in console"
	echo "		your steamid will look like ${yellow}"STEAM_0:0:12345"${green}"
	echo "		leave blank if you don't want the script to add your id as admin${reset}"
	echo "${reset}"
	read -p "	What is your steam id? [ex. '${green}'STEAM_0:0:123456'${reset}']: " steam_id
	echo ""
fi

#here we wait to make sure that apt-get commands are finished as they were running in the background during the questions

echo -n "	${green}Waiting for prerequisites to finish installing.. ${reset}"

if [ ! -d "/home/$useraccount/" ]; then
	cp install_ges.sh /home/$useraccount/
fi

cd /home/$useraccount/

while [ -e /proc/${pid1} ];
do
echo -n "."
sleep 0.5
done
echo ''

#start folder creation in the background

set +e
mkdir -p /home/$useraccount/ges_downloads
mkdir -p /home/$useraccount/steamcmd
mkdir -p $installlocation
mkdir -p $installlocation/gesource
mkdir -p $installlocation/gesource/bin
chown -R $useraccount:$useraccount /home/$useraccount
echo &
pid9=$!

set -e
cd /home/$useraccount/ges_downloads

#start the download for the required files, each task spawned in the background so they download the same time

su $useraccount -c 'wget -c -q '${steamdl}' --no-check-certificate' &
pid3=$!

su $useraccount -c 'wget -c -q '${serverfilesdl}'' &
pid4=$!

#if user said yes to install source mod, download required files and install them

{
if checkiftrue $doinstallsm; then
	su $useraccount -c 'wget -nc -q '${servermmdl}' -O '${servermmdlname}''
	su $useraccount -c 'wget -nc -q '${serversmdl}' -O '${serversmdlname}''
	su $useraccount -c 'tar -xf '${servermmdlname}' -C '$installlocation'/gesource/ > /dev/null'
	su $useraccount -c 'tar -xf '${serversmdlname}' -C '$installlocation'/gesource/ > /dev/null'
	echo " addons/sourcemod/bin/sourcemod_mm" >> $installlocation/gesource/addons/metamod/metaplugins.ini
	if [ "${steam_id}" != "" ]; then
		 echo "'${steam_id}' 'z'" >> $installlocation/gesource/addons/sourcemod/configs/admins_simple.ini
 	fi
fi
} &
pid5=$!

#start the extraction for the downloads, all wait on their downloads to finish before extracting

{
while [ -e /proc/${pid3} ]; do sleep 0.25; done
su $useraccount -c 'tar -xf '${steamdlname}' -C /home/'${useraccount}'/steamcmd > /dev/null'
} &
pid11=$!

{
while [ -e /proc/${pid4} ]; do sleep 0.25; done
su $useraccount -c '7z x -y -o'$installlocation'/ '$serverfilesdlname' > /dev/null'
if [ "$servername" != $serververname ];then sed -i '/hostname "Gold/c\""/g' $installlocation/gesource/cfg/server.cfg;fi
if [ "$serverrcon" != "" ];then sed -i '/rcon_password "/c\""/g' $installlocation/gesource/cfg/server.cfg;fi
if [ "$serverpassword" != "" ];then sed -i '/sv_password "/c\""/g' $installlocation/gesource/cfg/server.cfg;fi
if [ "$serverregion" != "0" ];then sed -i '/sv_region/c\""/g' $installlocation/gesource/cfg/server.cfg;fi
echo "" >> $installlocation/gesource/cfg/server.cfg
if [ "$servername" != $serververname ];then echo 'hostname="'${servername}'"' >> $installlocation/gesource/cfg/server.cfg;fi
if [ "$serverrcon" != "" ];then echo 'rcon_password="'${serverrcon}'"' >> $installlocation/gesource/cfg/server.cfg;fi
if [ "$serverpassword" != "" ];then echo 'sv_password="'${serverpassword}'"' >> $installlocation/gesource/cfg/server.cfg;fi
if [ "$serverregion" != "0" ];then echo 'sv_region="'${serverregion}'"' >> $installlocation/gesource/cfg/server.cfg;fi
} &
pid6=$!

cd /home/$useraccount/steamcmd

{
while [ -e /proc/${pid11} ]; do sleep 0.25; done
chown -R $useraccount:$useraccount /home/$useraccount/*
chown -R $useraccount:$useraccount /home/$useraccount/steamcmd
su $useraccount -c '/home/'${useraccount}'/steamcmd/steamcmd.sh +logon anonymous +force_install_dir '$installlocation' +app_update 310 +quit > /dev/null'
} &
pid8=$!

cd /home/$useraccount/

{
while [ -e /proc/${pid8} ]; do sleep 0.25; done
su $useraccount -c './update_ges.sh > /dev/null'
} &
pid12=$!

#generate update_ges.sh and run_ges.sh files for the user
if [ "$servermaxplayers" == "" ];then
	servermaxplayers=16
fi
echo "" > /home/$useraccount/run_ges.sh
echo 'MALLOC_CHECK_=0 ./srcds_run -game ./gesource -console +maxplayers '$servermaxplayers' +map ge_archives +exec server.cfg' | cat - /home/$useraccount/run_ges.sh > temp && mv temp /home/$useraccount/run_ges.sh
echo 'cd ges_server' | cat - /home/$useraccount/run_ges.sh > temp && mv temp /home/$useraccount/run_ges.sh

echo "" > /home/$useraccount/update_ges.sh
echo './steamcmd.sh +logon anonymous +force_install_dir '$installlocation' +app_update 310 validate +quit' | cat - /home/$useraccount/update_ges.sh > temp && mv temp /home/$useraccount/update_ges.sh
echo 'cd steamcmd' | cat - /home/$useraccount/update_ges.sh > temp && mv temp /home/$useraccount/update_ges.sh

#installing the server service

if checkiftrue $doinstallservice; then
{
	cat > /etc/init.d/ges_server <<- "EOF5"

		PATH=/bin:/usr/bin:/sbin:/usr/sbin
		DESC="GoldenEye Source Dedicated Server"
		NAME=ges_server
		PIDFILE=/var/run/$NAME.pid
		SCRIPTNAME=/etc/init.d/$NAME

		export MALLOC_CHECK_=0

		[ -x "$DAEMON" ] || exit 0

		DAEMON_ARGS="-steam_dir $DIR -steamcmd_script $DIR/steamcmd.sh -pidfile $PIDFILE $ARGS $CVARS"

		. /lib/init/vars.sh
		. /lib/lsb/init-functions

		do_start() {
			# Help srcds out by making the PID file and
			# chowning it seeing as it doesnt like doing that itself
			export MALLOC_CHECK_=0
			touch $PIDFILE
			chown $USER $PIDFILE
			# Check to see its running first
			start-stop-daemon --start --quiet --pidfile $PIDFILE --chuid $USER:$GROUP --chdir $CHDIR --exec $DAEMON --test > /dev/null || return 1
			# Start the SRCDS running
			start-stop-daemon --start --pidfile $PIDFILE --background --chuid $USER --chdir $CHDIR --exec $DAEMON -- $DAEMON_ARGS || return 2
		}
		do_stop() {
			start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --user $USER
			RETVAL="$?"
			[ "$RETVAL" = 2 ] && return 2
			start-stop-daemon --stop --quiet --oknodo --retry=TERM/30/KILL/5 --exec $DAEMON
			[ "$?" = 2 ] && return 2
			# Delete the PID file
			rm -f $PIDFILE
			return "$RETVAL"
		}
		case "$1" in
			start)
				[ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
				do_start
				case "$?" in
					0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
					2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
				esac
				;;
			stop)
				[ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
				do_stop
				case "$?" in
					0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
					2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
				esac
				;;
			status)
				status_of_proc -p $PIDFILE "$DAEMON" "$NAME" && exit 0 || exit $?
				;;
			restart)
				log_daemon_msg "Restarting $DESC" "$NAME"
				do_stop
				case "$?" in
					0|1)
						do_start
						case "$?" in
							0) log_end_msg 0 ;;
							1) log_end_msg 1 ;; # old process still running
							*) log_end_msg 1 ;; # Failed to start
						esac
						;;
					*)
						# Failed to stop
						log_end_msg 1
						;;
				esac
				;;
			*)
				echo "Usage: $SCRIPTNAME {start|stop|restart|status}" >&2
				exit 3
				;;
		esac
	exit 0

	EOF5
		echo 'ARGS="'${serviceprams}'"' | cat - /etc/init.d/ges_server > temp && mv temp /etc/init.d/ges_server
		echo 'CHDIR='${installlocation}'' | cat - /etc/init.d/ges_server > temp && mv temp /etc/init.d/ges_server
		echo 'DIR=/home/'${useraccount}'/steamcmd' | cat - /etc/init.d/ges_server > temp && mv temp /etc/init.d/ges_server
		echo 'DAEMON='${installlocation}'/srcds_run' | cat - /etc/init.d/ges_server > temp && mv temp /etc/init.d/ges_server
		echo 'USER="'${useraccount}'"' | cat - /etc/init.d/ges_server > temp && mv temp /etc/init.d/ges_server
		echo 'GROUP="'${useraccount}'"' | cat - /etc/init.d/ges_server > temp && mv temp /etc/init.d/ges_server
		echo "#!/bin/bash" | cat - /etc/init.d/ges_server > temp && mv temp /etc/init.d/ges_server
		chmod 755 /etc/init.d/ges_server
		systemctl daemon-reload

	} &
	pid10=$!
fi

#make the created files executable

chmod +x run_ges.sh
chmod +x update_ges.sh

#setup the three different status effects, waiting, running, and done.

piddownloading="${blue}DOWNLOADING${reset}"
pidverifying="${yellow}VERIFYING${reset}"
pidwaiting="${red}WAITING${reset}"
pidinstalling="${blue}INSTALLING${reset}"
pidrunning="${yellow}RUNNING${reset}"
piddone="${green}DONE${reset}"

#move into a while loop that wipes previous lines so it looks like the status is updating in spot

frn=1
while :
do
	if [ -e /proc/$pid9 ];then
			dirstrpro=$pidrunning
		else
			dirstrpro=$piddone
	fi
		if [ -e /proc/$pid3 ];then
			cmddlpro=$piddownloading
		else
			cmddlpro=$piddone
	fi
		if [ -e /proc/$pid4 ];then
			gessvrdl=$piddownloading
		else
			gessvrdl=$piddone
	fi
		if [ -e /proc/$pid5 ] && [ "$doinstallsm" == "Y" ];then
			smipro=$pidrunning
		elif [ "$doinstallsm" == "Y" ];then
			smipro=$piddone
	fi
		if [ -e /proc/$pid10 ];then
			svsinpro=$pidrunning
		else
			svsinpro=$piddone
	fi
		if [ -e /proc/$pid3 ];then
			cmdextpro=$pidwaiting
		elif [ -e /proc/$pid11 ];then
			cmdextpro=$pidrunning
		else
			cmdextpro=$piddone
	fi
		if [ -e /proc/$pid4 ];then
			gessvrext=$pidwaiting
		elif [ -e /proc/$pid6 ];then
			gessvrext=$pidrunning
		else
			gessvrext=$piddone
	fi
		if [ -e /proc/$pid11 ];then
			dedsvrext=$pidwaiting
		elif [ -e /proc/$pid8 ];then
			dedsvrext=$pidinstalling
		elif [ -e /proc/$pid12 ];then
			dedsvrext=$pidverifying
		else
			dedsvrext=$piddone
	fi
		if [ -e /proc/$pid1 ] || [ -e /proc/$pid3 ] || [ -e /proc/$pid4 ] || [ -e /proc/$pid5 ] || [ -e /proc/$pid6 ] || [ -e /proc/$pid8 ] || [ -e /proc/$pid9 ] || [ -e /proc/$pid10 ] || [ -e /proc/$pid11 ];then
			if [ "$frn" == "0" ];then
			echo -e "$UL$EL$UL$EL$UL$EL$UL$EL$UL$EL$UL$EL$UL$EL$UL$EL\c"
			fi
			frn=0
			echo "	${green}Create Directory Structure${reset} [ ${dirstrpro} ]"
			echo "	${green}Steamcmd Download${reset} [ ${cmddlpro} ]"
			echo "	${green}GoldenEye:Source Server Files Download${reset} [ ${gessvrdl} ]"
			echo "	${green}Source Mod Install${reset} [ ${smipro} ]"
			echo "	${green}Service installation${reset} [ ${svsinpro} ]"
			echo "	${green}Extracting steamcmd${reset} [ ${cmdextpro} ]"
			echo "	${green}Extracting GoldenEye:Source Server files${reset} [ ${gessvrext} ]"
			echo "	${green}Source 2007 Dedicated Server Install${reset} [ ${dedsvrext} ]"
			sleep 1
		else
			echo -e "$UL$EL$UL$EL$UL$EL$UL$EL$UL$EL$UL$EL$UL$EL$UL$EL\c"
			echo "	${green}Create Directory Structure${reset} [ ${dirstrpro} ]"
			echo "	${green}Steamcmd Download${reset} [ ${cmddlpro} ]"
			echo "	${green}GoldenEye:Source Server Files Download${reset} [ ${gessvrdl} ]"
			echo "	${green}Source Mod Install${reset} [ ${smipro} ]"
			echo "	${green}Service installation${reset} [ ${svsinpro} ]"
			echo "	${green}Extracting steamcmd${reset} [ ${cmdextpro} ]"
			echo "	${green}Extracting GoldenEye:Source Server files${reset} [ ${gessvrext} ]"
			echo "	${green}Source 2007 Dedicated Server Install${reset} [ ${dedsvrext} ]"
			break
		fi
done

cd /home/$useraccount/
echo
echo "${green}	Finishing up...."

chown -R $useraccount:$useraccount /home/$useraccount/*

#run the update_ges.sh this has the validate command attached to ensure the server files downloaded properly

if [ "$doinstallservice" == "N" ];then
echo
echo  "		DONE! open ${yellow}run_ges.sh${green} with ${yellow}nano run_ges.sh"
echo  "		${green}and edit the launch options to your liking!"
echo  "		to update the server run ${yellow}./update_ges.sh${green}"
echo
echo  "		now start your server with ${yellow}"screen ./run_ges.sh"${green} !!!"
echo  "		you can exit that screen and leave the server running with ${yellow}CTRL+A then d${green}"
echo  "		To edit server config file ${yellow}nano $installlocation$/gesource/cfg/server.cfg{green}"
else
echo
echo  "		DONE!"
echo  "		You choose to install GoldenEye Source Server as a service"
echo  "		you can operate the server with ${yellow}sudo service ges_server start${green}"
echo  "		Other ges_server commands are: start, stop, restart, status"
echo  ""
echo  "		To edit the server launch options: ${yellow}nano /etc/defult/ges_server${green}"
echo  "		To edit server config file ${yellow}nano $installlocation$/gesource/cfg/server.cfg{green}"
echo
echo "${reset}"
fi

#switch to the specified user account

exit 0


text:
<?xml version="1.0" encoding="UTF-8"?>
<configuration debug="false">
	<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
		<encoder>
			<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
		</encoder>
	</appender>
	<appender name="FILE" class="ch.qos.logback.core.FileAppender">
    	<file>Seletest.log</file>
    		<append>true</append>
    	<encoder>
      		<pattern>%-4relative [%thread] %-5level %logger{35} - %msg%n</pattern>
    	</encoder>
  </appender>

	<root level="info">
		<appender-ref ref="STDOUT" />
		<appender-ref ref="FILE" />
	</root>

	<logger name="com.automation.seletest.core">
		<level value="INFO" />
	</logger>

</configuration>


text:
./manage.py clean_expired
#This command shouldn't be run as a cronjob. This is only for emergency situations when some permissions are not correctly set for users. For example when userena get's implemented in an already existing project. Run by
./manage.py check_permissions
#A management command will wipe out all logged data
python manage.py silk_clear_request_log


text:
<!DOCTYPE html>

The blue squares on the left and right should be surrounded by three green squares.

        X

        X
X

      X

      X
X


text:
import smtplib
import sys
from email.mime.text import MIMEText
from conf import *

def send_mail(username,sub,content):
    msg = MIMEText(content,_subtype='plain',_charset='gb2312')
    msg['Subject'] = sub
    msg['From'] = 'tv-v-no@zabbix.com'
    msg['To'] = username
    try:
        server = smtplib.SMTP()
        server.connect('localhost')
        server.sendmail('tv-v-no@zabbix.com', username, msg.as_string())
        server.close()
    except Exception, e:
        print str(e)
        return False

def main(data):
    for x in ff_conf:
        if data[x[0]] > x[2]:
            sub = "%s waring" %x[0]
            content = "The %s is used more than %s" %(x[0],x[2])
            send_mail(x[3],sub,content)


text:
using System.Linq;
using Content.Server.Administration;
using Content.Server.Body.Systems;
using Content.Shared.Administration;
using Content.Shared.Body.Components;
using Content.Shared.Body.Part;
using Robust.Server.Player;
using Robust.Shared.Console;

namespace Content.Server.Body.Commands
{
    [AdminCommand(AdminFlags.Fun)]
    public sealed class AttachBodyPartCommand : IConsoleCommand
    {
        public string Command => "attachbodypart";
        public string Description => "Attaches a body part to you or someone else.";
        public string Help => $"{Command} <partEntityUid> / {Command} <entityUid> <partEntityUid>";

        public void Execute(IConsoleShell shell, string argStr, string[] args)
        {
            var player = shell.Player as IPlayerSession;
            var entityManager = IoCManager.Resolve<IEntityManager>();

            EntityUid bodyId;
            EntityUid partUid;

            switch (args.Length)
            {
                case 1:
                    if (player == null)
                    {
                        shell.WriteLine($"You need to specify an entity to attach the part to if you aren't a player.\n{Help}");
                        return;
                    }

                    if (player.AttachedEntity == null)
                    {
                        shell.WriteLine($"You need to specify an entity to attach the part to if you aren't attached to an entity.\n{Help}");
                        return;
                    }

                    if (!EntityUid.TryParse(args[0], out partUid))
                    {
                        shell.WriteLine($"{args[0]} is not a valid entity uid.");
                        return;
                    }

                    bodyId = player.AttachedEntity.Value;

                    break;
                case 2:
                    if (!EntityUid.TryParse(args[0], out var entityUid))
                    {
                        shell.WriteLine($"{args[0]} is not a valid entity uid.");
                        return;
                    }

                    if (!EntityUid.TryParse(args[1], out partUid))
                    {
                        shell.WriteLine($"{args[1]} is not a valid entity uid.");
                        return;
                    }

                    if (!entityManager.EntityExists(entityUid))
                    {
                        shell.WriteLine($"{entityUid} is not a valid entity.");
                        return;
                    }

                    bodyId = entityUid;
                    break;
                default:
                    shell.WriteLine(Help);
                    return;
            }

            if (!entityManager.TryGetComponent(bodyId, out BodyComponent? body))
            {
                shell.WriteLine($"Entity {entityManager.GetComponent<MetaDataComponent>(bodyId).EntityName} with uid {bodyId} does not have a {nameof(BodyComponent)}.");
                return;
            }

            if (!entityManager.EntityExists(partUid))
            {
                shell.WriteLine($"{partUid} is not a valid entity.");
                return;
            }

            if (!entityManager.TryGetComponent(partUid, out BodyPartComponent? part))
            {
                shell.WriteLine($"Entity {entityManager.GetComponent<MetaDataComponent>(partUid).EntityName} with uid {args[0]} does not have a {nameof(BodyPartComponent)}.");
                return;
            }

            var bodySystem = entityManager.System<BodySystem>();
            if (bodySystem.BodyHasChild(bodyId, partUid, body, part))
            {
                shell.WriteLine($"Body part {entityManager.GetComponent<MetaDataComponent>(partUid).EntityName} with uid {partUid} is already attached to entity {entityManager.GetComponent<MetaDataComponent>(bodyId).EntityName} with uid {bodyId}");
                return;
            }

            var slotId = $"AttachBodyPartVerb-{partUid}";

            // ReSharper disable once ConditionIsAlwaysTrueOrFalseAccordingToNullableAPIContract
            if (bodySystem.TryCreateBodyRootSlot(bodyId, slotId, out var rootSlot, body))
            {
                bodySystem.DropPart(partUid, part);
                bodySystem.AttachPart(partUid, rootSlot, part);
            }
            else
            {
                var attachAt = bodySystem.GetBodyChildren(bodyId, body).First();

                if (!bodySystem.TryCreatePartSlotAndAttach(attachAt.Id, slotId, partUid, attachAt.Component, part))
                {
                    shell.WriteError($"Could not create slot {slotId} on entity {entityManager.ToPrettyString(bodyId)}");
                    return;
                }
            }

            shell.WriteLine($"Attached part {entityManager.ToPrettyString(partUid)} to {entityManager.ToPrettyString(bodyId)}");
        }
    }
}


text:
package org.redkale.util;

import java.lang.reflect.Modifier;
import java.util.Map;
import java.util.function.*;
import static org.redkale.asm.Opcodes.*;
import org.redkale.asm.*;
import static org.redkale.asm.ClassWriter.COMPUTE_FRAMES;

/**
 * JavaBean类对象的拷贝,相同的字段名会被拷贝

 *
 *

 * 详情见: https://redkale.org
 *
 * @author zhangjx
 * @param <D> 目标对象的数据类型
 * @param <S> 源对象的数据类型
 */
public interface Reproduce<D, S> extends BiFunction<D, S, D> {

    @Override
    public D apply(D dest, S src);

    public static <D, S> Reproduce<D, S> create(final Class<D> destClass, final Class<S> srcClass) {
        return create(destClass, srcClass, (BiPredicate) null, (Map<String, String>) null);
    }

    public static <D, S> Reproduce<D, S> create(final Class<D> destClass, final Class<S> srcClass, final Map<String, String> names) {
        return create(destClass, srcClass, (BiPredicate) null, names);
    }

    @SuppressWarnings("unchecked")
    public static <D, S> Reproduce<D, S> create(final Class<D> destClass, final Class<S> srcClass, final Predicate<String> srcColumnPredicate) {
        return create(destClass, srcClass, (sc, m) -> srcColumnPredicate.test(m), (Map<String, String>) null);
    }

    @SuppressWarnings("unchecked")
    public static <D, S> Reproduce<D, S> create(final Class<D> destClass, final Class<S> srcClass, final Predicate<String> srcColumnPredicate, final Map<String, String> names) {
        return create(destClass, srcClass, (sc, m) -> srcColumnPredicate.test(m), names);
    }

    @SuppressWarnings("unchecked")
    public static <D, S> Reproduce<D, S> create(final Class<D> destClass, final Class<S> srcClass, final BiPredicate<java.lang.reflect.AccessibleObject, String> srcColumnPredicate) {
        return create(destClass, srcClass, srcColumnPredicate, (Map<String, String>) null);
    }

    @SuppressWarnings("unchecked")
    public static <D, S> Reproduce<D, S> create(final Class<D> destClass, final Class<S> srcClass, final BiPredicate<java.lang.reflect.AccessibleObject, String> srcColumnPredicate, final Map<String, String> names) {
        // ------------------------------------------------------------------------------
        final String supDynName = Reproduce.class.getName().replace('.', '/');
        final String destClassName = destClass.getName().replace('.', '/');
        final String srcClassName = srcClass.getName().replace('.', '/');
        final String destDesc = Type.getDescriptor(destClass);
        final String srcDesc = Type.getDescriptor(srcClass);
        String newDynName = supDynName + "Dyn_" + destClass.getSimpleName() + "_" + srcClass.getSimpleName();
        ClassLoader loader = Thread.currentThread().getContextClassLoader();
        if (String.class.getClassLoader() != destClass.getClassLoader()) {
            loader = destClass.getClassLoader();
            newDynName = destClassName + "_Dyn" + Reproduce.class.getSimpleName() + "_" + srcClass.getSimpleName();
        }
        try {
            return (Reproduce) loader.loadClass(newDynName.replace('/', '.')).getDeclaredConstructor().newInstance();
        } catch (Throwable ex) {
        }
        // ------------------------------------------------------------------------------
        ClassWriter cw = new ClassWriter(COMPUTE_FRAMES);
        FieldVisitor fv;
        MethodVisitor mv;
        AnnotationVisitor av0;

        cw.visit(V1_8, ACC_PUBLIC + ACC_FINAL + ACC_SUPER, newDynName, "Ljava/lang/Object;L" + supDynName + "<" + destDesc + srcDesc + ">;", "java/lang/Object", new String[]{supDynName});

        { // 构造函数
            mv = (cw.visitMethod(ACC_PUBLIC, "<init>", "()V", null, null));
            //mv.setDebug(true);
            mv.visitVarInsn(ALOAD, 0);
            mv.visitMethodInsn(INVOKESPECIAL, "java/lang/Object", "<init>", "()V", false);
            mv.visitInsn(RETURN);
            mv.visitMaxs(1, 1);
            mv.visitEnd();
        }
        {
            mv = (cw.visitMethod(ACC_PUBLIC, "apply", "(" + destDesc + srcDesc + ")" + destDesc, null, null));
            //mv.setDebug(true);

            for (java.lang.reflect.Field field : srcClass.getFields()) {
                if (Modifier.isStatic(field.getModifiers())) continue;
                if (Modifier.isFinal(field.getModifiers())) continue;
                if (!Modifier.isPublic(field.getModifiers())) continue;
                final String sfname = field.getName();
                if (srcColumnPredicate != null && !srcColumnPredicate.test(field, sfname)) continue;

                final String dfname = names == null ? sfname : names.getOrDefault(sfname, sfname);
                java.lang.reflect.Method setter = null;
                try {
                    if (!field.getType().equals(destClass.getField(dfname).getType())) continue;
                } catch (Exception e) {
                    try {
                        char[] cs = dfname.toCharArray();
                        cs[0] = Character.toUpperCase(cs[0]);
                        String dfname2 = new String(cs);
                        setter = destClass.getMethod("set" + dfname2, field.getType());
                    } catch (Exception e2) {
                        continue;
                    }
                }
                mv.visitVarInsn(ALOAD, 1);
                mv.visitVarInsn(ALOAD, 2);
                String td = Type.getDescriptor(field.getType());
                mv.visitFieldInsn(GETFIELD, srcClassName, sfname, td);
                if (setter == null) {
                    mv.visitFieldInsn(PUTFIELD, destClassName, dfname, td);
                } else {
                    mv.visitMethodInsn(INVOKEVIRTUAL, destClassName, setter.getName(), Type.getMethodDescriptor(setter), false);
                }
            }

            for (java.lang.reflect.Method getter : srcClass.getMethods()) {
                if (Modifier.isStatic(getter.getModifiers())) continue;
                if (getter.getParameterTypes().length > 0) continue;
                if ("getClass".equals(getter.getName())) continue;
                if (!getter.getName().startsWith("get") && !getter.getName().startsWith("is")) continue;
                final boolean is = getter.getName().startsWith("is");
                String sfname = getter.getName().substring(is ? 2 : 3);
                if (sfname.length() < 2 || Character.isLowerCase(sfname.charAt(1))) {
                    char[] cs = sfname.toCharArray();
                    cs[0] = Character.toLowerCase(cs[0]);
                    sfname = new String(cs);
                }
                if (srcColumnPredicate != null && !srcColumnPredicate.test(getter, sfname)) continue;

                final String dfname = names == null ? sfname : names.getOrDefault(sfname, sfname);
                java.lang.reflect.Method setter = null;
                java.lang.reflect.Field srcField = null;
                char[] cs = dfname.toCharArray();
                cs[0] = Character.toUpperCase(cs[0]);
                String dfname2 = new String(cs);
                try {
                    setter = destClass.getMethod("set" + dfname2, getter.getReturnType());
                } catch (Exception e) {
                    try {
                        srcField = destClass.getField(dfname);
                        if (!getter.getReturnType().equals(srcField.getType())) continue;
                    } catch (Exception e2) {
                        continue;
                    }
                }
                mv.visitVarInsn(ALOAD, 1);
                mv.visitVarInsn(ALOAD, 2);
                mv.visitMethodInsn(INVOKEVIRTUAL, srcClassName, getter.getName(), Type.getMethodDescriptor(getter), false);
                if (srcField == null) {
                    mv.visitMethodInsn(INVOKEVIRTUAL, destClassName, setter.getName(), Type.getMethodDescriptor(setter), false);
                } else {
                    mv.visitFieldInsn(PUTFIELD, destClassName, dfname, Type.getDescriptor(getter.getReturnType()));
                }
            }
            mv.visitVarInsn(ALOAD, 1);
            mv.visitInsn(ARETURN);
            mv.visitMaxs(3, 3);
            mv.visitEnd();
        }
        {
            mv = (cw.visitMethod(ACC_PUBLIC + ACC_BRIDGE + ACC_SYNTHETIC, "apply", "(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;", null, null));
            //mv.setDebug(true);
            mv.visitVarInsn(ALOAD, 0);
            mv.visitVarInsn(ALOAD, 1);
            mv.visitTypeInsn(CHECKCAST, destClassName);
            mv.visitVarInsn(ALOAD, 2);
            mv.visitTypeInsn(CHECKCAST, srcClassName);
            mv.visitMethodInsn(INVOKEVIRTUAL, newDynName, "apply", "(" + destDesc + srcDesc + ")" + destDesc, false);
            mv.visitInsn(ARETURN);
            mv.visitMaxs(3, 3);
            mv.visitEnd();
        }
        cw.visitEnd();
        // ------------------------------------------------------------------------------
        byte[] bytes = cw.toByteArray();
        Class<?> creatorClazz = new ClassLoader(loader) {
            public final Class<?> loadClass(String name, byte[] b) {
                return defineClass(name, b, 0, b.length);
            }
        }.loadClass(newDynName.replace('/', '.'), bytes);
        try {
            return (Reproduce) creatorClazz.getDeclaredConstructor().newInstance();
        } catch (Exception ex) {
            throw new RuntimeException(ex);
        }
    }

}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using CorvEngine;

namespace Corvus.Interface.Controls
{
    /// <summary>
    /// A focusable control with text.
    /// </summary>
    public class LinkButton : BaseControl
    {
        private string _Text = "";
        private Color _FocusedColor = Color.Red;

        /// <summary>
        /// Gets or sets the text to display.
        /// </summary>
        public string Text
        {
            get { return _Text; }
            set
            {
                if (_Text != value)
                {
                    _Text = value;
                    Size = SpriteFont.MeasureString(_Text);
                }
            }
        }

        /// <summary>
        /// Gets or sets the color of the text when this control is focused.
        /// </summary>
        public Color FocusedColor
        {
            get { return _FocusedColor; }
            set { _FocusedColor = value; }
        }

        public LinkButton(SpriteFont font)
            : base(font)
        {
            this.TabStop = true;
            this.HasFocus = false;
        }

        public override void Update(GameTime gameTime)
        {

        }

        public override void Draw(GameTime gameTime)
        {
            if (this.HasFocus)
                this.SpriteBatch.DrawString(SpriteFont, Text, Position, FocusedColor, 0f, new Vector2(), Scale, SpriteEffects.None, 0f);
            else
                this.SpriteBatch.DrawString(SpriteFont, Text, Position, Color, 0f, new Vector2(), Scale, SpriteEffects.None, 0f);
        }
    }
}


text:
package com.cyborgJenn.cyborgUtils.module.machine.fluids;

public class SodiumHydroxide {

}


text:
namespace extensions {
class ExtensionRegistry;
}  // namespace extensions

namespace user_prefs {
class PrefRegistrySyncable;
}  // namespace user_prefs

namespace ash {
namespace file_system_provider {

class ProvidedFileSystemInfo;
class ProvidedFileSystemInterface;
class RegistryInterface;
struct MountOptions;

// Registers preferences to remember registered file systems between reboots.
void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry);

// Manages and registers the file system provider service. Maintains provided
// file systems.
class Service : public KeyedService,
                public extensions::ExtensionRegistryObserver,
                public ProvidedFileSystemObserver {
 public:
  typedef std::map<ProviderId, std::unique_ptr<ProviderInterface>> ProviderMap;

  // Reason for unmounting. In case of UNMOUNT_REASON_SHUTDOWN, the file system
  // will be remounted automatically after a reboot. In case of
  // UNMOUNT_REASON_USER it will be permanently unmounted.
  enum UnmountReason { UNMOUNT_REASON_USER, UNMOUNT_REASON_SHUTDOWN };

  Service(Profile* profile, extensions::ExtensionRegistry* extension_registry);

  Service(const Service&) = delete;
  Service& operator=(const Service&) = delete;

  ~Service() override;

  // Gets the singleton instance for the |context|.
  static Service* Get(content::BrowserContext* context);

  // KeyedService:
  void Shutdown() override;

  // Sets a custom Registry implementation. Used by unit tests.
  void SetRegistryForTesting(std::unique_ptr<RegistryInterface> registry);

  // Mounts a file system provided by a provider with the |provider_id|. If
  // |writable| is set to true, then the file system is mounted in a R/W mode.
  // Otherwise, only read-only operations are supported. If change notification
  // tags are supported, then |supports_notify_tag| must be true. Note, that
  // it is required in order to enable the internal cache. For success, returns
  // base::File::FILE_OK, otherwise an error code.
  base::File::Error MountFileSystem(const ProviderId& provider_id,
                                    const MountOptions& options);

  // Unmounts a file system with the specified |file_system_id| for the
  // |provider_id|. For success returns base::File::FILE_OK, otherwise an error
  // code.
  base::File::Error UnmountFileSystem(const ProviderId& provider_id,
                                      const std::string& file_system_id,
                                      UnmountReason reason);

  // Requests unmounting of the file system. Returns false if the request could
  // not been created, true otherwise.
  bool RequestUnmount(const ProviderId& provider_id,
                      const std::string& file_system_id);

  // Requests mounting a new file system by the providing extension with
  // |provider_id|. Returns false if the request could not been created, true
  // otherwise.
  bool RequestMount(const ProviderId& provider_id);

  // Returns a list of information of all currently provided file systems. All
  // items are copied.
  std::vector<ProvidedFileSystemInfo> GetProvidedFileSystemInfoList();

  // Returns a list of information of the currently provided file systems for
  // |provider_id|. All items are copied.
  std::vector<ProvidedFileSystemInfo> GetProvidedFileSystemInfoList(
      const ProviderId& provider_id);

  // Returns an immutable map of all registered providers.
  const ProviderMap& GetProviders() const;

  // Returns a provided file system with |file_system_id|, handled by
  // the extension with |provider_id|. If not found, then returns NULL.
  ProvidedFileSystemInterface* GetProvidedFileSystem(
      const ProviderId& provider_id,
      const std::string& file_system_id);

  // Returns a provided file system attached to the the passed
  // |mount_point_name|. If not found, then returns NULL.
  ProvidedFileSystemInterface* GetProvidedFileSystem(
      const std::string& mount_point_name);

  // Adds and removes observers.
  void AddObserver(Observer* observer);
  void RemoveObserver(Observer* observer);

  // extensions::ExtensionRegistryObserver overrides.
  void OnExtensionUnloaded(content::BrowserContext* browser_context,
                           const extensions::Extension* extension,
                           extensions::UnloadedExtensionReason reason) override;
  void OnExtensionLoaded(content::BrowserContext* browser_context,
                         const extensions::Extension* extension) override;

  // ProvidedFileSystemInterface::Observer overrides.
  void OnWatcherChanged(const ProvidedFileSystemInfo& file_system_info,
                        const Watcher& watcher,
                        storage::WatcherManager::ChangeType change_type,
                        const ProvidedFileSystemObserver::Changes& changes,
                        base::OnceClosure callback) override;
  void OnWatcherTagUpdated(const ProvidedFileSystemInfo& file_system_info,
                           const Watcher& watcher) override;
  void OnWatcherListChanged(const ProvidedFileSystemInfo& file_system_info,
                            const Watchers& watchers) override;

  // Registers a provider. Restores all remembered mounts.
  void RegisterProvider(std::unique_ptr<ProviderInterface> provider);

  // Unregisters a provider. Unmounts all currently mounted file systems.
  // If the reason is UNMOUNT_REASON_USER then they will not be automatically
  // restored on the next registration.
  void UnregisterProvider(const ProviderId& provider_id, UnmountReason reason);

 private:
  FRIEND_TEST_ALL_PREFIXES(FileSystemProviderServiceTest, RememberFileSystem);

  // Key is a pair of an extension id and file system id, which makes it
  // unique among the entire service instance.
  using FileSystemKey = std::pair<std::string, std::string>;

  // Mounts the file system in the specified context. See MountFileSystem() for
  // more information.
  base::File::Error MountFileSystemInternal(const ProviderId& provider_id,
                                            const MountOptions& options,
                                            MountContext context);

  // Called when the providing extension accepts or refuses a unmount request.
  // If |error| is equal to FILE_OK, then the request is accepted.
  void OnRequestUnmountStatus(const ProvidedFileSystemInfo& file_system_info,
                              base::File::Error error);

  // Remembers the file system in preferences, in order to remount after a
  // reboot.
  void RememberFileSystem(const ProvidedFileSystemInfo& file_system_info,
                          const Watchers& watchers);

  // Removes the file system from preferences, so it is not remounted anymore
  // after a reboot.
  void ForgetFileSystem(const ProviderId& provider_id,
                        const std::string& file_system_id);

  // Restores from preferences file systems mounted previously by the
  // |provider_id| provided file system.
  void RestoreFileSystems(const ProviderId& provider_id);

  // Unmounts all currently mounted file systems for this provider. If
  // reason is UNMOUNT_REASON_USER then the file systems will not be remembered
  // for automagical remount in the future.
  void UnmountFileSystems(const ProviderId& provider_id, UnmountReason reason);

  // Returns a file system provider for the passed |provider_id|. If not found
  // then returns nullptr.
  ProviderInterface* GetProvider(const ProviderId& provider_id);

  raw_ptr<Profile> profile_;
  raw_ptr<extensions::ExtensionRegistry> extension_registry_;  // Not owned.
  base::ObserverList<Observer>::Unchecked observers_;
  std::map<FileSystemKey, std::unique_ptr<ProvidedFileSystemInterface>>
      file_system_map_;
  std::map<std::string, FileSystemKey> mount_point_name_to_key_map_;
  std::unique_ptr<RegistryInterface> registry_;
  base::ThreadChecker thread_checker_;
  ProviderMap provider_map_;

  base::WeakPtrFactory<Service> weak_ptr_factory_{this};
};

}  // namespace file_system_provider
}  // namespace ash

// TODO(https://crbug.com/1164001): remove when ChromeOS code migration is done.
namespace chromeos {
namespace file_system_provider {
using ::ash::file_system_provider::Service;
}  // namespace file_system_provider
}  // namespace chromeos

#endif  // CHROME_BROWSER_ASH_FILE_SYSTEM_PROVIDER_SERVICE_H_


text:
#import <Foundation/Foundation.h>

@class RTCStatsReport;

/** Class used to accumulate stats information into a single displayable string.
 */
@interface ARDStatsBuilder : NSObject

/** String that represents the accumulated stats reports passed into this
 *  class.
 */
@property(nonatomic, readonly) NSString *statsString;

/** Parses the information in the stats report into an appropriate internal
 *  format used to generate the stats string.
 */
- (void)parseStatsReport:(RTCStatsReport *)statsReport;

@end


text:
<?php

namespace Statamic\Addons\Protect\Protectors;

class IpProtector extends AbstractProtector
{
    /**
     * Whether or not this provides protection.
     *
     * @return bool
     */
    public function providesProtection()
    {
        return ! empty($this->getAllowedIps());
    }

    /**
     * Provide protection
     *
     * @return void
     */
    public function protect()
    {
        if (! in_array(request()->ip(), $this->getAllowedIps())) {
            $this->deny();
        }
    }

    protected function getAllowedIps()
    {
        return array_get($this->scheme, 'allowed', []);
    }
}


text: require 'dm-do-adapter/adapter'


text:
package flex.messaging.util;

/**
 * Code to read and write Base64-encoded text.
 * Fairly special-purpose, not quite ready for
 * general streaming as they don't let you
 * drain less than everything that is currently
 * available.
 *
 * @exclude
 */
public class Hex
{
    private static final char digits[] =
            {
                '0', '1', '2', '3', '4', '5', '6', '7',
                '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'
            };

    public static class Decoder
    {
        private int filled = 0;
        private byte data[];
        private int work[] = {0, 0};

        public Decoder()
        {
            data = new byte[256];
        }

        public void decode(String encoded)
        {

            int estimate = 1 + encoded.length() / 2;

            if (filled + estimate > data.length)
            {
                int length = data.length * 2;
                while (length < filled + estimate)
                {
                    length *= 2;
                }
                byte[] newdata = new byte[length];

                System.arraycopy(data, 0, newdata, 0, filled);
                data = newdata;
            }

            for (int i = 0; i < encoded.length(); ++i)
            {
                work[0] = Character.digit(encoded.charAt(i), 16);
                i++;
                work[1] = Character.digit(encoded.charAt(i), 16);
                data[filled++] = (byte) (((work[0] << 4) | (work[1])) & 0xff);
            }
        }

        public byte[] drain()
        {
            byte[] r = new byte[filled];
            System.arraycopy(data, 0, r, 0, filled);
            filled = 0;
            return r;
        }

        public byte[] flush() throws IllegalStateException
        {
            return drain();
        }

        public void reset()
        {
            filled = 0;
        }

    }

    public static class Encoder
    {
        private StringBuffer output;

        public Encoder(int size)
        {
            output = new StringBuffer(size * 2);
        }

        private void encodeBlock(byte work)
        {
            output.append(digits[(work & 0xF0) >>> 4]);
            output.append(digits[(work & 0x0F)]);
        }

        public void encode(byte[] data)
        {
            encode(data, 0, data.length);
        }

        public void encode(byte[] data, int offset, int length)
        {
            int plainIndex = offset;

            while (plainIndex < (offset + length))
            {
                encodeBlock(data[plainIndex]);
                plainIndex++;
            }
        }

        public String drain()
        {
            String r = output.toString();
            output.setLength(0);
            return r;
        }

        public String flush()
        {
            return drain();
        }
    }

    public static void main(String[] args)
    {
        boolean printData = false;
        int randomLimit = 500;

        for (int myCount = 0; myCount < 10000; myCount++)
        {
        byte raw [] = new byte[(int)(Math.random() * randomLimit)];

        for (int i = 0; i < raw.length; ++i)
        {
            if ((i % 1024) < 256)
                raw[i] = (byte)(i % 1024);
            else
                raw[i] = (byte)((int)(Math.random() * 255) - 128);
        }
        Hex.Encoder encoder = new Hex.Encoder(100);
        encoder.encode(raw);

        String encoded = encoder.drain();

        Hex.Decoder decoder = new Hex.Decoder();
        decoder.decode(encoded);
        byte check[] = decoder.flush();

        String mesg = "Success!";
        if (check.length != raw.length)
        {
            mesg = "***** length mismatch!";
        }
        else
        {
            for (int i = 0; i < check.length; ++i)
            {
                if (check[i] != raw[i])
                {
                    mesg = "***** data mismatch!";
                    break;
                }
            }
        }
        if (mesg.indexOf("Success") == -1)
        {
            System.out.println(mesg + myCount);
            break;
        }

        if (printData)
        {
            System.out.println("Decoded: " + new String(raw));
            System.out.println("Encoded: " + encoded);
            System.out.println("Decoded: " + new String(check));
        }
        }
    }
}


text:
package com.haulmont.cuba.core.sys.jpql.pointer;

import com.haulmont.cuba.core.sys.jpql.DomainModel;
import com.haulmont.cuba.core.sys.jpql.model.Attribute;
import com.haulmont.cuba.core.sys.jpql.model.JpqlEntityModel;

public class SimpleAttributePointer implements Pointer {
    private JpqlEntityModel entity;
    private Attribute attribute;

    protected SimpleAttributePointer(JpqlEntityModel entity, Attribute attribute) {
        this.entity = entity;
        this.attribute = attribute;
    }

    @Override
    public Pointer next(DomainModel model, String field) {
        return NoPointer.instance();
    }

    public Attribute getAttribute() {
        return attribute;
    }

    public JpqlEntityModel getEntity() {
        return entity;
    }
}


text:
    #include "wx/utils.h"
#endif // WX_PRECOMP

#include "wx/unix/private/execute.h"
#include "wx/evtloop.h"

// ============================================================================
// implementation
// ============================================================================

int wxGUIAppTraits::WaitForChild(wxExecuteData& execData)
{
    // prepare to wait for the child termination: show to the user that we're
    // busy and refuse all input unless explicitly told otherwise
    wxBusyCursor bc;
    wxWindowDisabler wd(!(execData.m_flags & wxEXEC_NODISABLE));

    // Allocate an event loop that will be used to wait for the process
    // to terminate, will handle stdout, stderr, and any other events and pass
    // it to the common (to console and GUI) code which will run it.
    wxGUIEventLoop loop;
    return RunLoopUntilChildExit(execData, loop);
}


text:
package market.gui;

import interfaces.GuiPanel;

import java.awt.Color;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Image;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.geom.AffineTransform;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.swing.JPanel;
import javax.swing.Timer;

import market.data.MarketData;
import MarketEmployee.MarketCustomerRole;
import MarketEmployee.MarketEmployeeRole;
import MarketEmployee.MarketManagerRole;
import Person.Role.Role;
import Transportation.DeliveryTruckAgent;
import building.BuildingList;
import building.Market;

public class MarketAnimationPanel extends JPanel implements ActionListener,GuiPanel {

	private final static int WINDOWX = 800;//
	private final static int WINDOWY = 400;
	final static int storeCounterX = 0;//TABLEX and TABLEY describe where the table appears in the panel
	final static int storeCounterY = 200;
	final static int storeCounterLeftWIDTH= 700;
	final static int storeCounterRightWIDTH= 50;
	final static int storeCounterXHEIGHT = 30;
	private MarketData marketData;
	final static int TIMERCOUNTmilliseconds = 1;
	private Image bufferImage;
	private Dimension bufferSize;
	private String marketName;
	private Map<Role,Gui> guis = new HashMap<Role,Gui>();

	public MarketAnimationPanel(String marketName1) {
		setSize(WINDOWX, WINDOWY);
		setVisible(true);

		bufferSize = this.getSize();
		this.marketName=marketName1;

		Timer timer = new Timer(TIMERCOUNTmilliseconds, this );
		timer.start();
	}

	@Override
	public void actionPerformed(ActionEvent e) {
		repaint();  //Will have paintComponent called
		for(Gui gui : guis.values()) {
			if (gui.isPresent()) {
				gui.updatePosition();
			}
		}

		clearRemovedGuis();
	}

	@Override
	public void paintComponent(Graphics g) {
		Graphics2D g2 = (Graphics2D)g;

		//Clear the screen by painting a rectangle the size of the frame
		g2.setColor(getBackground());
		g2.fillRect(0, 0, WINDOWX, WINDOWY );

		g2.setColor(Color.ORANGE);

		g2.fillRect(storeCounterX, storeCounterY, storeCounterLeftWIDTH, storeCounterXHEIGHT);//store counter
		g2.fillRect(750, storeCounterY, storeCounterRightWIDTH, storeCounterXHEIGHT);//store counter
		g2.fillRect(0,100,200,20);//top manager office wall
		g2.fillRect(200,100,20,40);//manager office top half right wall
		g2.fillRect(200,170,20,30);//manager office bottom half left wall
		g2.fillRect(400, 0, 30, 125);//shelve #1 from left
		g2.fillRect(500, 0, 30, 125);//shelve #2 from left
		g2.fillRect(600, 0, 30, 125);//shelve #3 from left
		g2.fillRect(700, 0, 30, 125);//shelve #4 from left

		g2.setColor(Color.BLACK);//sets text color...or anything following this line
		g2.setFont(new Font("Serif", Font.PLAIN, 15));
		g2.fillRect(350, 200, 10, 30);//dividers between counter windows
		g2.drawString("Window #1", 370, 220);
		g2.fillRect(450, 200, 10, 30);
		g2.drawString("Window #2", 470, 220);
		g2.fillRect(550, 200, 10, 30);
		g2.drawString("Window #3", 570, 220);
		g2.fillRect(650, 200, 10, 30);
		g2.drawString("Entrance", 380, 395);

		g2.drawString("Manager's Office", 60, 115);
		g2.drawString("Store Shelves Area", 510, 20);
		g2.drawString("Delivery Truck", 10, 20);

		int degrees = -90; // rotate text counter-clockwise
		AffineTransform at = AffineTransform.getRotateInstance(Math.toRadians(degrees));

		Font f = new Font("Serif", Font.PLAIN, 15);
		g2.setFont(f.deriveFont(at));
		g2.drawString("Steak", 420,100);
		g2.drawString("Chicken", 520, 100);
		g2.drawString("Burger", 620, 100);

		for(Gui gui : guis.values()) {
			if (gui.isPresent()) {
				gui.draw(g2);
			}
		}
	}

//	public void addGui(MarketEmployeeGui gui) {
//		guis.add(gui);
//	}
//
//	public void addGui(MarketManagerGui gui) {
//		guis.add(gui);
//	}
//	public void addGui(MarketCustomerGui gui) {
//		guis.add(gui);
//
//	}

	@Override
	public void addGuiForRole(Role r) {
		marketData=((Market) (BuildingList.findBuildingWithName(marketName))).getMarketData();
		if(r instanceof MarketCustomerRole){

			MarketCustomerRole marketCustomerRole = (MarketCustomerRole) r;
			if (marketData.getNumberOfCustomersInALine(0)==marketData.getNumberOfCustomersInALine(1) && marketData.getNumberOfCustomersInALine(0)==marketData.getNumberOfCustomersInALine(2)){
				MarketCustomerGui gui = new MarketCustomerGui(marketCustomerRole, 0);
				marketCustomerRole.setGui(gui);
				marketData.incrementNumerOfCustomersInALine(0);
				marketCustomerRole.setCounter(0);
				marketCustomerRole.setMarketData(marketData);
				guis.put(r, gui);
			}
			else if (marketData.getNumberOfCustomersInALine(0)>marketData.getNumberOfCustomersInALine(1) && marketData.getNumberOfCustomersInALine(1)==marketData.getNumberOfCustomersInALine(2)){
				MarketCustomerGui gui = new MarketCustomerGui(marketCustomerRole, 1);
				marketCustomerRole.setGui(gui);
				marketData.incrementNumerOfCustomersInALine(1);
				marketCustomerRole.setCounter(1);
				marketCustomerRole.setMarketData(marketData);
				guis.put(r, gui);
			}
			else if (marketData.getNumberOfCustomersInALine(0)==marketData.getNumberOfCustomersInALine(1)){
				MarketCustomerGui gui = new MarketCustomerGui(marketCustomerRole, 2);
				marketCustomerRole.setGui(gui);
				marketData.incrementNumerOfCustomersInALine(2);
				marketCustomerRole.setCounter(2);
				marketCustomerRole.setMarketData(marketData);
				guis.put(r, gui);
			}

		}
		if(r instanceof MarketEmployeeRole){
			MarketEmployeeRole marketEmployeeRole = (MarketEmployeeRole) r;
			MarketEmployeeGui gui = new MarketEmployeeGui(marketEmployeeRole);
			marketEmployeeRole.setGui(gui);
			marketEmployeeRole.setMarketData(marketData);
			guis.put(r, gui);

		}
		if(r instanceof MarketManagerRole){
			MarketManagerRole marketManagerRole = (MarketManagerRole) r;
			MarketManagerGui gui = new MarketManagerGui(marketManagerRole);
			marketManagerRole.setGui(gui);
			marketManagerRole.setDeliveryTruck(new DeliveryTruckAgent("Delivery Truck", marketName));
			marketData.setMarketManager(marketManagerRole);
			marketManagerRole.setMarketData(marketData);
			guis.put(r, gui);

		}
	}

	private List<Role> removalList = new ArrayList<Role>();

	private void clearRemovedGuis(){
		for(int i = removalList.size()-1; i >= 0; i--){
			guis.remove(removalList.get(i));
			removalList.remove(i);
		}
	}

	@Override
	public void removeGuiForRole(Role r) {

		removalList.add(r);
	}

}


text:
import gzip
from tempfile import mkdtemp
import os

import numpy as np

from astropy.io import fits

def _make_file_for_testing(file_name='', **kwd):
    img = np.uint16(np.arange(100))

    hdu = fits.PrimaryHDU(img)

    for k, v in kwd.items():
        hdu.header[k] = v

    hdu.writeto(file_name)

def directory_for_testing():
    """
    Set up directory with these contents:

    One file with imagetyp BIAS. It has an the keyword EXPOSURE in
    the header, but no others beyond IMAGETYP and the bare minimum
    created with the FITS file.

    File name(s)
    ------------

    no_filter_no_object_bias.fit

    Five (5) files with imagetyp LIGHT, including two compressed
    files.

    + One file for each compression type, currently .gz and .fz.
    + ALL of the files will have the keyword EXPOSURE
      in the header.
    + Only ONE of them will have the value EXPOSURE=15.0.
    + All of the files EXCEPT ONE will have the keyword
      FILTER with the value 'R'.
    + NONE of the files have the keyword OBJECT

    File names
    ----------

    test.fits.fz
    filter_no_object_light.fit
    filter_object_light.fit.gz
    filter_object_light.fit
    no_filter_no_object_light.fit    <---- this one has no filter
    """
    n_test = {
        'files': 6,
        'missing_filter_value': 1,
        'bias': 1,
        'compressed': 2,
        'light': 5
    }

    test_dir = mkdtemp()

    # Directory is reset on teardown.
    original_dir = os.getcwd()
    os.chdir(test_dir)

    _make_file_for_testing(file_name='no_filter_no_object_bias.fit',
                           imagetyp='BIAS',
                           EXPOSURE=0.0)

    _make_file_for_testing(file_name='no_filter_no_object_light.fit',
                           imagetyp='LIGHT',
                           EXPOSURE=1.0)

    _make_file_for_testing(file_name='filter_no_object_light.fit',
                           imagetyp='LIGHT',
                           EXPOSURE=1.0,
                           filter='R')

    _make_file_for_testing(file_name='filter_object_light.fit',
                           imagetyp='LIGHT',
                           EXPOSURE=1.0,
                           filter='R')

    with open('filter_object_light.fit', 'rb') as f_in:
        with gzip.open('filter_object_light.fit.gz', 'wb') as f_out:
            f_out.write(f_in.read())

    # filter_object.writeto('filter_object_RA_keyword_light.fit')

    _make_file_for_testing(file_name='test.fits.fz',
                           imagetyp='LIGHT',
                           EXPOSURE=15.0,
                           filter='R')

    os.chdir(original_dir)

    return n_test, test_dir

def sample_directory_with_files():
    """
    Returns the path to the small sample directory used
    in the tests of ``ImageFileCollection``. Primarily intended
    for use in the doctests.
    """

    n_test, tmpdir = directory_for_testing()
    return tmpdir


text:
```bash
cd /home/git/gitlab
sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production
```

## 1. Stop server

```bash
sudo service gitlab stop
````

## 2. Get latest code

```bash
cd /home/git/gitlab
sudo -u git -H git fetch --all
sudo -u git -H git checkout 6-4-stable
# For GitLab Enterprise Edition: sudo -u git -H git checkout 6-4-stable-ee
```

## 3. Update gitlab-shell (and its config)

```bash
cd /home/git/gitlab-shell
sudo -u git -H git fetch
sudo -u git -H git checkout v1.8.0
```

## 4. Install libs, migrations, etc.

```bash
cd /home/git/gitlab

# MySQL
sudo -u git -H bundle install --without development test postgres --deployment

# PostgreSQL
sudo -u git -H bundle install --without development test mysql --deployment

# Run database migrations
sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production

# Clean up assets and cache
sudo -u git -H bundle exec rake assets:clean assets:precompile cache:clear RAILS_ENV=production

# Update init.d script
sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab
```

## 5. Start application

```bash
sudo service gitlab start
sudo service nginx restart
```

## 6. Check application status

Check if GitLab and its environment are configured correctly:

```bash
sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production
```

To make sure you didn't miss anything run a more thorough check with:

```bash
sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production
```

If all items are green, then congratulations upgrade complete!

## Things went south? Revert to previous version (6.3)

### 1. Revert the code to the previous version

Follow the [`upgrade guide from 6.2 to 6.3`](6.2-to-6.3.md), except for the database migration (the backup is already migrated to the previous version).

### 2. Restore from the backup:

```bash
cd /home/git/gitlab
sudo -u git -H bundle exec rake gitlab:backup:restore RAILS_ENV=production
```


text:
<?php

include 'bootstrap.php';

print 'DBSIZE = '.$client->dbsize()."\n";

$keys = $client->keys('*');
took('retrieve all the keys');

sort($keys);
took('sort all the keys');

// add the keys to sorted set
foreach ($keys as $position => $key) {
    $client->zadd('keys.sorted', $position, $key);
}
took('to add all the keys to a sorted set');

/*
key
  ttl
  type

ordered by key alphabetically

loop through to find by type


text:
package jenkins.install;

import java.util.List;

import javax.inject.Provider;

import hudson.ExtensionList;
import hudson.ExtensionPoint;

/**
 * Allows plugging in to the lifecycle when determining InstallState
 * from {@link InstallUtil#getNextInstallState(InstallState)}
 */
public abstract class InstallStateFilter implements ExtensionPoint {
    /**
     * Determine the current or next install state, proceed with `return proceed.next()`
     */
    public abstract InstallState getNextInstallState(InstallState current, Provider<InstallState> proceed);

    /**
     * Get all the InstallStateFilters, in extension order
     */
    public static List<InstallStateFilter> all() {
        return ExtensionList.lookup(InstallStateFilter.class);
    }
}


text:
""" Utility Helper Objects """

import datetime
import logging

LOGGING_LEVELS = dict(debug=logging.DEBUG, info=logging.INFO, warning=logging.WARNING,
                  error=logging.ERROR, critical=logging.CRITICAL)

LOGGER_NAME = "OpenWestDemo" # default logger name
LOGGER_LEVEL = logging.INFO # default logger level
LOGGER_FORMAT = '%(asctime)s %(name)s: %(message)s'
LOGGER_DATE_FORMAT ='%Y%m%d_%H%M%S.%f'

class SpecialFormatter(logging.Formatter):
    """ Special formatter to allow using microseconds in log format.
        Uses datetime object instead of ctime struct so %f works in strftime
    """
    converter= datetime.datetime.fromtimestamp

    def formatTime(self, record, datefmt=None):
        ct = self.converter(record.created)
        if datefmt:
            s = ct.strftime(datefmt)
        else:
            t = ct.strftime("%Y-%m-%d %H:%M:%S")
            s = "%s,%03d" % (t, record.msecs)
        return s

LOGGER_FORMATTER = SpecialFormatter(LOGGER_FORMAT, datefmt=LOGGER_DATE_FORMAT)
LOGGER_HANDLER = logging.StreamHandler()
LOGGER_HANDLER.setFormatter(LOGGER_FORMATTER)

def getLogger(name=LOGGER_NAME, level=LOGGER_LEVEL):
    """ Utility fuction for creating logger with predefined configuration
        Call getLogger() with the same name to get the same logger object

    """
    logger = logging.getLogger(name)
    logger.addHandler(LOGGER_HANDLER)
    logger.propagate = False
    logger.setLevel(level)
    return logger


text:
@interface NSString (SimpleGeo)

- (NSString *)URLEncodedString;
- (NSString *)MinimalURLEncodedString;
- (NSString *)URLDecodedString;

@end


text:
require 'pathname'

Puppet::Type.newtype(:dsc_xwaitforaddomain) do
  require Pathname.new(__FILE__).dirname + '../../' + 'puppet/type/base_dsc'
  require Pathname.new(__FILE__).dirname + '../../puppet_x/puppetlabs/dsc_type_helpers'

  @doc = %q{
    The DSC xWaitForADDomain resource type.
    Automatically generated from
    'xActiveDirectory/DSCResources/MSFT_xWaitForADDomain/MSFT_xWaitForADDomain.schema.mof'

    To learn more about PowerShell Desired State Configuration, please
    visit https://technet.microsoft.com/en-us/library/dn249912.aspx.

    For more information about built-in DSC Resources, please visit
    https://technet.microsoft.com/en-us/library/dn249921.aspx.

    For more information about xDsc Resources, please visit
    https://github.com/PowerShell/DscResources.
  }

  validate do
      fail('dsc_domainname is a required attribute') if self[:dsc_domainname].nil?
    end

  def dscmeta_resource_friendly_name; 'xWaitForADDomain' end
  def dscmeta_resource_name; 'MSFT_xWaitForADDomain' end
  def dscmeta_module_name; 'xActiveDirectory' end
  def dscmeta_module_version; '2.14.0.0' end

  newparam(:name, :namevar => true ) do
  end

  ensurable do
    newvalue(:exists?) { provider.exists? }
    newvalue(:present) { provider.create }
    defaultto { :present }
  end

  # Name:         PsDscRunAsCredential
  # Type:         MSFT_Credential
  # IsMandatory:  False
  # Values:       None
  newparam(:dsc_psdscrunascredential) do
    def mof_type; 'MSFT_Credential' end
    def mof_is_embedded?; true end
    desc "PsDscRunAsCredential"
    validate do |value|
      unless value.kind_of?(Hash)
        fail("Invalid value '#{value}'. Should be a hash")
      end
      PuppetX::Dsc::TypeHelpers.validate_MSFT_Credential("Credential", value)
    end
  end

  # Name:         DomainName
  # Type:         string
  # IsMandatory:  True
  # Values:       None
  newparam(:dsc_domainname) do
    def mof_type; 'string' end
    def mof_is_embedded?; false end
    desc "DomainName"
    isrequired
    validate do |value|
      unless value.kind_of?(String)
        fail("Invalid value '#{value}'. Should be a string")
      end
    end
  end

  # Name:         DomainUserCredential
  # Type:         MSFT_Credential
  # IsMandatory:  False
  # Values:       None
  newparam(:dsc_domainusercredential) do
    def mof_type; 'MSFT_Credential' end
    def mof_is_embedded?; true end
    desc "DomainUserCredential"
    validate do |value|
      unless value.kind_of?(Hash)
        fail("Invalid value '#{value}'. Should be a hash")
      end
      PuppetX::Dsc::TypeHelpers.validate_MSFT_Credential("DomainUserCredential", value)
    end
  end

  # Name:         RetryIntervalSec
  # Type:         uint64
  # IsMandatory:  False
  # Values:       None
  newparam(:dsc_retryintervalsec) do
    def mof_type; 'uint64' end
    def mof_is_embedded?; false end
    desc "RetryIntervalSec"
    validate do |value|
      unless (value.kind_of?(Numeric) && value >= 0) || (value.to_i.to_s == value && value.to_i >= 0)
          fail("Invalid value #{value}. Should be a unsigned Integer")
      end
    end
    munge do |value|
      PuppetX::Dsc::TypeHelpers.munge_integer(value)
    end
  end

  # Name:         RetryCount
  # Type:         uint32
  # IsMandatory:  False
  # Values:       None
  newparam(:dsc_retrycount) do
    def mof_type; 'uint32' end
    def mof_is_embedded?; false end
    desc "RetryCount"
    validate do |value|
      unless (value.kind_of?(Numeric) && value >= 0) || (value.to_i.to_s == value && value.to_i >= 0)
          fail("Invalid value #{value}. Should be a unsigned Integer")
      end
    end
    munge do |value|
      PuppetX::Dsc::TypeHelpers.munge_integer(value)
    end
  end

  # Name:         RebootRetryCount
  # Type:         uint32
  # IsMandatory:  False
  # Values:       None
  newparam(:dsc_rebootretrycount) do
    def mof_type; 'uint32' end
    def mof_is_embedded?; false end
    desc "RebootRetryCount"
    validate do |value|
      unless (value.kind_of?(Numeric) && value >= 0) || (value.to_i.to_s == value && value.to_i >= 0)
          fail("Invalid value #{value}. Should be a unsigned Integer")
      end
    end
    munge do |value|
      PuppetX::Dsc::TypeHelpers.munge_integer(value)
    end
  end

  def builddepends
    pending_relations = super()
    PuppetX::Dsc::TypeHelpers.ensure_reboot_relationship(self, pending_relations)
  end
end

Puppet::Type.type(:dsc_xwaitforaddomain).provide :powershell, :parent => Puppet::Type.type(:base_dsc).provider(:powershell) do
  confine :true => (Gem::Version.new(Facter.value(:powershell_version)) >= Gem::Version.new('5.0.10240.16384'))
  defaultfor :operatingsystem => :windows

  mk_resource_methods
end


text:
<!DOCTYPE html>

  <title>Get all ad units.</title>

Ad units list:

    <button id="authorize-button" style="visibility: hidden">Authorize</button>


text:
license: >
    Licensed to the Apache Software Foundation (ASF) under one
    or more contributor license agreements.  See the NOTICE file
    distributed with this work for additional information
    regarding copyright ownership.  The ASF licenses this file
    to you 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.

title: Coordinates
---

Coordinates
===========

位置情報で使用される座標を格納します。

プロパティー
----------

* __latitude__: 緯度を数値で表します _(Number)_
* __longitude__: 経度を数値で表します _(Number)_
* __altitude__: 海抜からの高度をメートル単位で表します _(Number)_
* __accuracy__: 位置の精度をメートル単位で表します _(Number)_
* __altitudeAccuracy__: 高度の精度をメートル単位で表します _(Number)_
* __heading__: 北から時計回りでのデバイスの方位を角度で表します _(Number)_
* __speed__: 現在のデバイスのスピードをメートル/秒で表します _(Number)_

概要
-----------

`Coordinates` オブジェクトは `[Position](../Position/position.html)` オブジェクトのプロパティーとして作成されます。 `[Position](../Position/position.html)` オブジェクトはコールバック関数を通してユーザーに返されます。

サポートされているプラットフォーム
-------------------

- Android
- BlackBerry WebWorks (OS 5.0 以上)
- iOS
- Windows Phone 7 (Mango)
- Bada 1.2 & 2.x
- webOS

[使用例](../../storage/storage.opendatabase.html)
-------------

    // 成功時のコールバック関数
    //
    var onSuccess = function(position) {
        alert('緯度: '              + position.coords.latitude          + '\n' +
              '経度: '              + position.coords.longitude         + '\n' +
              '高度: '              + position.coords.altitude          + '\n' +
              '位置精度: '          + position.coords.accuracy          + '\n' +
              '高度精度: '          + position.coords.altitudeAccuracy  + '\n' +
              '方位: '              + position.coords.heading           + '\n' +
              '速度: '              + position.coords.speed             + '\n' +
              'タイムスタンプ: '    + position.timestamp                + '\n');
    };

    // エラー時のコールバック関数
    //
    var onError = function() {
        alert('エラーが発生しました。');
    };

    navigator.geolocation.getCurrentPosition(onSuccess, onError);

詳細な使用例
------------

    <!DOCTYPE html>

        <title>位置情報の使用例</title>

Android に関する注意点
-------------

このプロパティーは Android ではサポートされておらず、常に null を返します。


text:
@extends('admin::layout.main')

@section('title')
	New Picture Category
@endsection

@section('page_title')
	 New Picture Category
@endsection

@section('breadcrumbs')
	@parent

		 Picture Categories

 New Category

@endsection

@section('sidebar')
	@parent
	@include('admin::picture_categories.sidebar')
@endsection

@section('content')
	<form method="post" action="{{route('admin-picture_categories-add')}}" role="form" accept-charset="UTF-8" enctype="multipart/form-data">

has('title') ? ' has-error':'' !!}">
					Title
					<input type="text" class="form-control" id="title" name="title" placeholder="Enter title"{!! ((old('title')) ? ' value="'.old('title').'"' : '') !!}>
					{!! $errors->has('title') ? ''.$errors->first('title').'' : '' !!}

has('description') ? ' has-error':'' !!}">
					Description
					<input type="text" class="form-control" id="description" name="description" placeholder="Enter description"{!! ((old('description')) ? ' value="'.old('description').'"' : '') !!}>
					{!! $errors->has('description') ? ''.$errors->first('description').'' : '' !!}

has('file_extensions') ? ' has-error':'' !!}">
					File Extensions
					<input type="text" class="form-control" id="file_extensions" name="file_extensions" placeholder="Enter file extensions"{!! ((old('file_extensions')) ? ' value="'.old('file_extensions').'"' : ' value="jpeg,jpg,gif,png,bmp"') !!}>
					{!! $errors->has('file_extensions') ? ''.$errors->first('file_extensions').'' : '' !!}

has('max_file_size') ? ' has-error':'' !!}">
					Max File Size
					<input type="text" class="form-control" id="max_file_size" name="max_file_size" placeholder="Enter max file size"{!! ((old('max_file_size')) ? ' value="'.old('max_file_size').'"' : ' value="50"') !!}>
					{!! $errors->has('max_file_size') ? ''.$errors->first('max_file_size').'' : '' !!}

has('min_height') ? ' has-error':'' !!}">
					Min Height
					<input type="text" class="form-control" id="min_height" name="min_height" placeholder="Enter min height"{!! ((old('min_height')) ? ' value="'.old('min_height').'"' : ' value="240"') !!}>
					{!! $errors->has('min_height') ? ''.$errors->first('min_height').'' : '' !!}

has('min_width') ? ' has-error':'' !!}">
					Min Width
					<input type="text" class="form-control" id="min_width" name="min_width" placeholder="Enter min width"{!! ((old('min_width')) ? ' value="'.old('min_width').'"' : ' value="320"') !!}>
					{!! $errors->has('min_width') ? ''.$errors->first('min_width').'' : '' !!}

has('max_height') ? ' has-error':'' !!}">
					Max Height
					<input type="text" class="form-control" id="max_height" name="max_height" placeholder="Enter max height"{!! ((old('max_height')) ? ' value="'.old('max_height').'"' : ' value="960"') !!}>
					{!! $errors->has('max_height') ? ''.$errors->first('max_height').'' : '' !!}

has('max_width') ? ' has-error':'' !!}">
					Max Width
					<input type="text" class="form-control" id="max_width" name="max_width" placeholder="Enter max width"{!! ((old('max_width')) ? ' value="'.old('max_width').'"' : ' value="1280"') !!}>
					{!! $errors->has('max_width') ? ''.$errors->first('max_width').'' : '' !!}

		<input type="hidden" name="_token" value="{{ csrf_token() }}">
		<button type="submit" class="btn btn-primary">
			 Save
		</button>
	</form>
@endsection

@section('styles')

@endsection
@section('scripts_top')

@endsection

@section('scripts_bottom')

@endsection