text:
using UnityEngine;
using System.Collections;

public class DungenMusic : MonoBehaviour
{

		RoomGenerator rg;
		bool containsTarget = false;

		// Use this for initialization
		void Start ()
		{
				rg = GetComponent<RoomGenerator> ();

		}

		// Update is called once per frame
		void Update ()
		{
				bool containsNow = rg.totalBounds.Contains (Camera.main.transform.position);
				if (MusicManager.mm != null) {
						if (containsNow && !containsTarget) {
								MusicManager.mm.PlayTrack (rg.roomStyle.musicName);
						} else if (containsTarget && !containsNow) {
								MusicManager.mm.StopTrackIfPlaying (rg.roomStyle.musicName);
						}
				}
				containsTarget = containsNow;
		}
}


text:
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
	version="2.0">

	<persistence-unit name="contas-mysql">
		<provider>org.hibernate.ejb.HibernatePersistence</provider>
		<class>br.com.caelum.financas.modelo.Conta</class>
		<class>br.com.caelum.financas.modelo.Movimentacao</class>
		<properties>
			<property name="javax.persistence.jdbc.driver" value="com.mysql.jdbc.Driver" />
			<property name="javax.persistence.jdbc.url" value="jdbc:mysql://localhost/contas" />
			<property name="javax.persistence.jdbc.user" value="root" />
			<property name="javax.persistence.jdbc.password" value="1234abc@" />

			<property name="hibernate.dialect" value="org.hibernate.dialect.MySQL5InnoDBDialect" />
			<property name="hibernate.hbm2ddl.auto" value="update" />
			<property name="hibernate.show_sql" value="true" />
			<property name="hibernate.format_sql" value="true" />
		</properties>
	</persistence-unit>

	<persistence-unit name="contas-hsqldb">
		<provider>org.hibernate.ejb.HibernatePersistence</provider>
		<class>br.com.caelum.financas.modelo.Conta</class>
		<class>br.com.caelum.financas.modelo.Movimentacao</class>
		<properties>
			<property name="javax.persistence.jdbc.driver" value="org.hsqldb.jdbcDriver" />
			<property name="javax.persistence.jdbc.url" value="jdbc:hsqldb:contas" />
			<property name="javax.persistence.jdbc.user" value="sa" />
			<property name="javax.persistence.jdbc.password" value="" />

			<property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect" />
			<!-- Opções: - validate: valida mas não altera; - update: cria/atualiza
				o esquema do banco preservando os dados; - create: cria o esquema destruindo
				os dados; - create-drop: cria e remove no final da sessão. -->
			<property name="hibernate.hbm2ddl.auto" value="update" />
			<property name="hibernate.show_sql" value="true" />
			<property name="hibernate.format_sql" value="true" />
		</properties>
	</persistence-unit>

</persistence>

redpajama_set_name: RedPajamaGithub


text:
USING_NS_CC;

DialogLayer::DialogLayer() :
		mMenu(NULL), mMenuItemArray(NULL), mTouchedMenu(false) {
}

DialogLayer::~DialogLayer() {
}

bool DialogLayer::init() {
	bool bRet = false;

	do {
		CC_BREAK_IF(!CCLayerColor::initWithColor(ccc4(0, 0, 0, 125)));

		onInitDialog();
		initMenu();

		bRet = true;
	} while (0);

	return bRet;
}

void DialogLayer::pushMenu(CCMenuItem *pMenuItem) {
	if (!mMenuItemArray) {
		mMenuItemArray = CCArray::create();
	}

	mMenuItemArray->addObject(pMenuItem);
}

bool DialogLayer::initMenu() {
	if (mMenuItemArray && mMenuItemArray->count() > 0) {
		if (!mMenu) {
			mMenu = CCMenu::createWithArray(mMenuItemArray);
			mMenu->setPosition(CCPointZero);
			addChild(mMenu);
		}
	}
	return true;
}

void DialogLayer::onEnter() {
	CCLayerColor::onEnter();

	// 屏蔽所有priority比自己大的消息
	CCDirector::sharedDirector()->getTouchDispatcher()->addTargetedDelegate(
			this, kCCMenuHandlerPriority - 1, true);
}

void DialogLayer::onExit() {
	CCLayerColor::onExit();
	CCDirector::sharedDirector()->getTouchDispatcher()->removeDelegate(this);
}

bool DialogLayer::ccTouchBegan(cocos2d::CCTouch *pTouch,
		cocos2d::CCEvent *pEvent) {
	// 因为拦截了所有消息(包括按钮) 所以需要将消息手动传给模态对话框上的按钮
	if (mMenu) {
		mTouchedMenu = mMenu->ccTouchBegan(pTouch, pEvent);
	}

	return true;
}

void DialogLayer::ccTouchMoved(cocos2d::CCTouch *pTouch,
		cocos2d::CCEvent *pEvent) {
	if (mTouchedMenu) {
		if (mMenu) {
			mMenu->ccTouchMoved(pTouch, pEvent);
		}
	}
}

void DialogLayer::ccTouchEnded(cocos2d::CCTouch *pTouch,
		cocos2d::CCEvent *pEvent) {
	if (mTouchedMenu) {
		if (mMenu) {
			mMenu->ccTouchEnded(pTouch, pEvent);
		}
		mTouchedMenu = false;
	}
}

void DialogLayer::ccTouchCancelled(cocos2d::CCTouch *pTouch,
		cocos2d::CCEvent *pEvent) {
	if (mTouchedMenu) {
		if (mMenu) {
			mMenu->ccTouchEnded(pTouch, pEvent);
		}
		mTouchedMenu = false;
	}
}


text:
import os
import requests
import sys
from google.cloud import firestore
from googleapiclient.discovery import build
from google.cloud import secretmanager

# Add our library utils to the path
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))

from lib.constants import ISSUES_API_URL
from lib.error_logger import ErrorLogger

class GithubIssueHandler(ErrorLogger):
    """ Handles posting issues to github using the personal access token stored in SecretsManager. """

    def __init__(self, gcs_project_name):
        self._username = "automation"  # This is ignored because we use an access token.
        self._gcs_project_name = gcs_project_name
        self._password = self._get_github_token()

    def _error_group_to_github_issue(self, error_group):
        title = "Automated error report"
        body = error_group["representative"]["message"]
        return {"title": title, "body": body}

    def _get_github_token(self):
        client = secretmanager.SecretManagerServiceClient()
        name = client.secret_version_path(self._gcs_project_name, "github-token", "latest")
        response = client.access_secret_version(name)
        return response.payload.data

    def post_error_to_github(self, error_group):
        """ Returns the issue url if successfully posted, else raises a ConnectionError exception """
        session = requests.Session()
        session.auth = (self._username, self._password)
        response = session.post(ISSUES_API_URL, json=self._error_group_to_github_issue(error_group))
        if response.status_code != 201:
            self.log_error("Could not create github issue.", status_code=response.status_code)
            raise ConnectionError()
        return response.json()["html_url"]

def register_new_errors(gcs_project_name):
    """ If new error groups are reported, log an issue on github with the details """
    service = build("clouderrorreporting", "v1beta1")
    errors_past_day = (
        service.projects()
        .groupStats()
        .list(projectName="projects/{}".format(gcs_project_name), timeRange_period="PERIOD_1_DAY")
        .execute()
    )
    gh_issue_handler = GithubIssueHandler(gcs_project_name)
    db = firestore.Client()
    errors_db = db.collection("errors")
    for error_group in errors_past_day["errorGroupStats"]:
        group_id = error_group["group"]["groupId"]
        if int(error_group["count"]) < 2:
            # Don't add one-off errors to the db
            continue
        doc = errors_db.document(group_id)
        if not doc.get().exists and error_group["group"]["resolutionStatus"] == "OPEN":
            try:
                error_group["group"]["trackingIssues"] = [
                    {"url": gh_issue_handler.post_error_to_github(error_group)}
                ]
                error_group["group"]["resolutionStatus"] = "ACKNOWLEDGED"
            except ConnectionError:
                # Could not create an issue
                # Don't add it to our known errors db, we can retry on the next scheduled job.
                continue
            # Now set it to acknowledged and link to the issue in Cloud Error Reporting.
            service.projects().groups().update(
                name=error_group["group"]["name"], body=error_group["group"]
            ).execute()
        doc.set(error_group)

if __name__ == "__main__":
    import os

    register_new_errors(os.getenv("GOOGLE_CLOUD_PROJECT"))


text:
export * from '../interfaces/chord.interface';
export * from '../interfaces/chordOrScalePrimitiveInterface';
export * from '../interfaces/instrument.interface';
export * from '../interfaces/scale.interface';
export * from '../interfaces/searchRequest.interface';
export * from '../interfaces/searchResponse.interface';


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<TITLE>
A-Index
</TITLE>

<META NAME="date" CONTENT="2012-07-04">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../stylesheet.css" TITLE="Style">

      Overview
      Package
      Class
      Use
      Tree
      Deprecated
    Index
      Help

 PREV LETTER
 NEXT LETTER

  FRAMES
 NO FRAMES

  All Classes

A B C D E F G H I K L M N O P Q R S T U V W

A

about -
Variable in class gui.MenuBar

actionPerformed(ActionEvent) -
Method in class gui.ButtonListener

actionPerformed(ActionEvent) -
Method in class gui.ComboListener

actionPerformed(ActionEvent) -
Method in class gui.MenuBar

actionPerformed(ActionEvent) -
Method in class gui.PartnerListener

Actor - Class in object.actor
Questa è la superclasse attore, o personaggio giocante.
Actor(String, String, Location) -
Constructor for class object.actor.Actor

Questo è il costruttore che verrà usato dal parser.

Actor(String, String, Location, ArrayList<Event>) -
Constructor for class object.actor.Actor

Questo costruttore, oltre ai campi standard, permette di aggiungere una "memoria" precostruita per il personaggio.

Actor(String, String, Location, ArrayList<Event>, Event) -
Constructor for class object.actor.Actor

Questo è il costruttore più completo, permette di aggiungere una "memoria" e un informazione "contenuta" dal personaggio.

actorCombo -
Variable in class gui.TopPanel

actorList -
Variable in class object.location.Location

addActor(Actor) -
Method in class object.location.Location

Questo metodo aggiunge un personaggio alla stanza, e crea i rispettivi eventi, aggiungendoli alla lista di tutti i personaggi già presenti nella stanza.

addButtonListener(ButtonListener) -
Method in class gui.ButtonPanel

Questo metodo aggiunge il listener ad ogni bottone.

addComboListener(ComboListener) -
Method in class gui.TopPanel

Questo metodo aggiunge il listener alle combobox standard, è stato aggiunto qui in modo
 da poter aggiungere gli oggetti alle Combobox senza generare fastidiosi eventi.

addContent(Utils) -
Method in class object.thing.Container

Aggiunte un oggetto al contenitore

addEvent(Event) -
Method in class object.actor.Actor

Questo metodo invece aggiunge un evento alla lista eventi del giocatore.

addInventory(Utils) -
Method in class object.actor.Actor

Questo metodo è di facciata, è stato aggiunto per poter essere utilizzato dal parser senza generare eventi di volta in volta.

addObject(Thing) -
Method in class object.location.Location

Questo metodo aggiunge un oggetto alla lista di oggetti della stanza

addQuantita(int) -
Method in class object.thing.Denaro

Questo metodo aggiunge una quantità in input a quella già data.

addThrough(Through) -
Method in class object.location.Location

Questo metodo aggiunge un'apertura alla stanza

AlreadyInStateException - Exception in object.thing
Questa è l'eccezione che verrà lanciata quando si proverà ad eseguire un azione su un oggetto già in un determinato stato,
 ad esempio aprire una porta già aperta, accendere un computer già acceso, ecc..
AlreadyInStateException() -
Constructor for exception object.thing.AlreadyInStateException

Il costruttore non prende alcun argomento in input, ma chiama il super() con il messaggio:
 "L'azione non è stata eseguita perchè non necessaria o impossibile."

aperto -
Variable in class object.thing.Container

aperture -
Variable in class io.CreateObjects

aperture -
Variable in class io.LoadStartingFile

apri(Openable) -
Method in class object.actor.Actor

Il metodo apri prende in input un oggetto di tipo apribile, e lo apre.

apri(Cassaforte, String) -
Method in class object.actor.Actor

Questo è il metodo apri per la cassaforte.

apri() -
Method in class object.thing.Cassaforte

apri() -
Method in class object.thing.Container

apri() -
Method in interface object.thing.Openable

Questo metodo permette di aprire l'oggetto.

apri() -
Method in class object.thing.Tappeto

apri() -
Method in class object.thing.Through

askButton -
Variable in class gui.ButtonPanel

atobject -
Variable in class object.actor.Event

author -
Variable in class object.thing.Libro

      Overview
      Package
      Class
      Use
      Tree
      Deprecated
    Index
      Help

 PREV LETTER
 NEXT LETTER

  FRAMES
 NO FRAMES

  All Classes

A B C D E F G H I K L M N O P Q R S T U V W


text:
package org.mvel2.util;

import java.io.Serializable;

public interface Stack extends Serializable {
  public boolean isEmpty();

  public Object peek();

  public Object peek2();

  public void add(Object obj);

  public void push(Object obj);

  public Object pushAndPeek(Object obj);

  public void push(Object obj1, Object obj2);

  public void push(Object obj1, Object obj2, Object obj3);

  public Object pop();

  public Object pop2();

  public void discard();

  public void clear();

  public int size();

  public void showStack();
}


text:
{% extends "imagersite/layout.html" %}
{% block content %}

Register for a new account here.

    <form action="." method="post">
        {% csrf_token %}
        {{ form.as_p }}
        <input type="submit" value="register">
    </form>
{% endblock %}


text:
'use strict';

import { TPromise } from 'vs/base/common/winjs.base';
import paths = require('vs/base/common/paths');
import URI from 'vs/base/common/uri';
import { IModeService } from 'vs/editor/common/services/modeService';
import pfs = require('vs/base/node/pfs');
import { CommandsRegistry } from 'vs/platform/commands/common/commands';
import { IInstantiationService, ServicesAccessor } from 'vs/platform/instantiation/common/instantiation';
import { IWorkbenchThemeService, IColorTheme } from 'vs/workbench/services/themes/common/workbenchThemeService';
import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService';
import { toResource } from 'vs/workbench/common/editor';
import { ITextMateService } from 'vs/editor/node/textMate/textMateService';
import { IGrammar, StackElement } from 'vscode-textmate';
import { TokenizationRegistry } from 'vs/editor/common/modes';
import { TokenMetadata } from 'vs/editor/common/model/tokensBinaryEncoding';
import { ThemeRule, findMatchingThemeRule } from 'vs/editor/electron-browser/textMate/TMHelper';
import { Color } from 'vs/base/common/color';

interface IToken {
	c: string;
	t: string;
	r: { [themeName: string]: string; };
}

interface IThemedToken {
	text: string;
	color: Color;
}

interface IThemesResult {
	[themeName: string]: {
		document: ThemeDocument;
		tokens: IThemedToken[];
	};
}

class ThemeDocument {
	private readonly _theme: IColorTheme;
	private readonly _cache: { [scopes: string]: ThemeRule; };
	private readonly _defaultColor: string;

	constructor(theme: IColorTheme) {
		this._theme = theme;
		this._cache = Object.create(null);
		this._defaultColor = '#000000';
		for (let i = 0, len = this._theme.tokenColors.length; i < len; i++) {
			let rule = this._theme.tokenColors[i];
			if (!rule.scope) {
				this._defaultColor = rule.settings.foreground;
			}
		}
	}

	private _generateExplanation(selector: string, color: Color): string {
		return `${selector}: ${color.toRGBAHex(true).toUpperCase()}`;
	}

	public explainTokenColor(scopes: string, color: Color): string {

		let matchingRule = this._findMatchingThemeRule(scopes);
		if (!matchingRule) {
			let expected = Color.fromHex(this._defaultColor);
			// No matching rule
			if (!color.equals(expected)) {
				throw new Error(`[${this._theme.label}]: Unexpected color ${color.toRGBAHex()} for ${scopes}. Expected default ${expected.toRGBAHex()}`);
			}
			return this._generateExplanation('default', color);
		}

		let expected = Color.fromHex(matchingRule.settings.foreground);
		if (!color.equals(expected)) {
			throw new Error(`[${this._theme.label}]: Unexpected color ${color.toRGBAHex()} for ${scopes}. Expected ${expected.toRGBAHex()} coming in from ${matchingRule.rawSelector}`);
		}
		return this._generateExplanation(matchingRule.rawSelector, color);
	}

	private _findMatchingThemeRule(scopes: string): ThemeRule {
		if (!this._cache[scopes]) {
			this._cache[scopes] = findMatchingThemeRule(this._theme, scopes.split(' '));
		}
		return this._cache[scopes];
	}
}

class Snapper {

	constructor(
		@IModeService private modeService: IModeService,
		@IWorkbenchThemeService private themeService: IWorkbenchThemeService,
		@ITextMateService private textMateService: ITextMateService
	) {
	}

	private _themedTokenize(grammar: IGrammar, lines: string[]): IThemedToken[] {
		let colorMap = TokenizationRegistry.getColorMap();
		let state: StackElement = null;
		let result: IThemedToken[] = [], resultLen = 0;
		for (let i = 0, len = lines.length; i < len; i++) {
			let line = lines[i];

			let tokenizationResult = grammar.tokenizeLine2(line, state);

			for (let j = 0, lenJ = tokenizationResult.tokens.length >>> 1; j < lenJ; j++) {
				let startOffset = tokenizationResult.tokens[(j << 1)];
				let metadata = tokenizationResult.tokens[(j << 1) + 1];
				let endOffset = j + 1 < lenJ ? tokenizationResult.tokens[((j + 1) << 1)] : line.length;
				let tokenText = line.substring(startOffset, endOffset);

				let color = TokenMetadata.getForeground(metadata);

				result[resultLen++] = {
					text: tokenText,
					color: colorMap[color]
				};
			}

			state = tokenizationResult.ruleStack;
		}

		return result;
	}

	private _tokenize(grammar: IGrammar, lines: string[]): IToken[] {
		let state: StackElement = null;
		let result: IToken[] = [], resultLen = 0;
		for (let i = 0, len = lines.length; i < len; i++) {
			let line = lines[i];

			let tokenizationResult = grammar.tokenizeLine(line, state);
			let lastScopes: string = null;

			for (let j = 0, lenJ = tokenizationResult.tokens.length; j < lenJ; j++) {
				let token = tokenizationResult.tokens[j];
				let tokenText = line.substring(token.startIndex, token.endIndex);
				let tokenScopes = token.scopes.join(' ');

				if (lastScopes === tokenScopes) {
					result[resultLen - 1].c += tokenText;
				} else {
					lastScopes = tokenScopes;
					result[resultLen++] = {
						c: tokenText,
						t: tokenScopes,
						r: {
							dark_plus: null,
							light_plus: null,
							dark_vs: null,
							light_vs: null,
							hc_black: null,
						}
					};
				}
			}

			state = tokenizationResult.ruleStack;
		}
		return result;
	}

	private _getThemesResult(grammar: IGrammar, lines: string[]): TPromise<IThemesResult> {
		let currentTheme = this.themeService.getColorTheme();

		let getThemeName = (id: string) => {
			let part = 'vscode-theme-defaults-themes-';
			let startIdx = id.indexOf(part);
			if (startIdx !== -1) {
				return id.substring(startIdx + part.length, id.length - 5);
			}
			return void 0;
		};

		let result: IThemesResult = {};

		return this.themeService.getColorThemes().then(themeDatas => {
			let defaultThemes = themeDatas.filter(themeData => !!getThemeName(themeData.id));
			return TPromise.join(defaultThemes.map(defaultTheme => {
				let themeId = defaultTheme.id;
				return this.themeService.setColorTheme(themeId, null).then(success => {
					if (success) {
						let themeName = getThemeName(themeId);
						result[themeName] = {
							document: new ThemeDocument(this.themeService.getColorTheme()),
							tokens: this._themedTokenize(grammar, lines)
						};
					}
				});
			}));
		}).then(_ => {
			return this.themeService.setColorTheme(currentTheme.id, null).then(_ => {
				return result;
			});
		});
	}

	private _enrichResult(result: IToken[], themesResult: IThemesResult): void {
		let index: { [themeName: string]: number; } = {};
		let themeNames = Object.keys(themesResult);
		for (let t = 0; t < themeNames.length; t++) {
			let themeName = themeNames[t];
			index[themeName] = 0;
		}

		for (let i = 0, len = result.length; i < len; i++) {
			let token = result[i];

			for (let t = 0; t < themeNames.length; t++) {
				let themeName = themeNames[t];
				let themedToken = themesResult[themeName].tokens[index[themeName]];

				themedToken.text = themedToken.text.substr(token.c.length);
				token.r[themeName] = themesResult[themeName].document.explainTokenColor(token.t, themedToken.color);
				if (themedToken.text.length === 0) {
					index[themeName]++;
				}
			}
		}
	}

	public captureSyntaxTokens(fileName: string, content: string): TPromise<IToken[]> {
		return this.modeService.getOrCreateModeByFilenameOrFirstLine(fileName).then(mode => {
			return this.textMateService.createGrammar(mode.getId()).then((grammar) => {
				let lines = content.split(/\r\n|\r|\n/);

				let result = this._tokenize(grammar, lines);
				return this._getThemesResult(grammar, lines).then((themesResult) => {
					this._enrichResult(result, themesResult);
					return result.filter(t => t.c.length > 0);
				});
			});
		});
	}
}

CommandsRegistry.registerCommand('_workbench.captureSyntaxTokens', function (accessor: ServicesAccessor, resource: URI) {

	let process = (resource: URI) => {
		let filePath = resource.fsPath;
		let fileName = paths.basename(filePath);
		let snapper = accessor.get(IInstantiationService).createInstance(Snapper);

		return pfs.readFile(filePath).then(content => {
			return snapper.captureSyntaxTokens(fileName, content.toString());
		});
	};

	if (!resource) {
		let editorService = accessor.get(IWorkbenchEditorService);
		let file = toResource(editorService.getActiveEditorInput(), { filter: 'file' });
		if (file) {
			process(file).then(result => {
				console.log(result);
			});
		} else {
			console.log('No file editor active');
		}
	} else {
		return process(resource);
	}
	return undefined;
});


text:
package com.hultron.lifehelper.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

import com.hultron.lifehelper.R;
import com.hultron.lifehelper.entity.CourierData;

import java.util.List;

/*
 * 快递查询适配器
 */

public class CourierAdapter extends BaseAdapter {

    private Context mContext;
    private List<CourierData> mList;
    private CourierData mData;
    //布局加载器
    private LayoutInflater mInflater;

    public CourierAdapter(Context context, List<CourierData> list) {
        mContext = context;
        mList = list;
        //获取系统服务
        mInflater = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    }

    @Override
    public int getCount() {
        return mList.size();
    }

    @Override
    public Object getItem(int position) {
        return mList.get(position);
    }

    @Override
    public long getItemId(int position) {
        return position;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        ViewHolder holder;
        //第一次加载
        if (convertView == null) {
            holder = new ViewHolder();
            convertView = mInflater.inflate(R.layout.courier_item, parent, false);
            holder.mRemark = (TextView) convertView.findViewById(R.id.remark);
            holder.mZone = (TextView) convertView.findViewById(R.id.zone);
            holder.mDatetime = (TextView) convertView.findViewById(R.id.datetime);
            //设置缓存
            convertView.setTag(holder);
        } else {
            holder = (ViewHolder) convertView.getTag();
        }

        //设置数据
        mData = mList.get(position);
        holder.mRemark.setText(mData.getRemark());
        holder.mZone.setText(mData.getZone());
        holder.mDatetime.setText(mData.getDatetime());
        return convertView;
    }

    private class ViewHolder {
        private TextView mRemark;
        private TextView mZone;
        private TextView mDatetime;

    }
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data.SqlClient;
using System.IO;
using System.Reflection;

namespace Provisioning.Common.Utilities
{
    public class ExceptionUtils
    {
        public static string FormatExceptionSimple(Exception ex)
        {
            if (ex == null)
                return String.Empty;
            var sb = new StringBuilder();
            try
            {
                sb.AppendFormat("\r\n-----------\r\n{0}", ex.ToString());
            }
            catch (Exception ex0)
            {
                sb.AppendFormat("Warning; Could not format exception {0}", ex0.ToString());
            }
            return sb.ToString();
        }

        /// <summary>
        /// By default return Exception.ToString()
        /// </summary>
        private static readonly Func<Exception, string> defaultFormatter =
            (ex) => (ex == null) ? String.Empty : ex.ToString();

        #region "Specialized Formatters"
        /// <summary>
        /// Keep a map of specialized formatters for types with extra embedded
        /// information
        /// </summary>
        private static readonly IDictionary<Type, Func<Exception, string>>
            FormatExceptionMap = new Dictionary<Type, Func<Exception, string>>()
            {
                { typeof(SqlException), (ex) => FormatSqlException(ex) }
            };

        private static string FormatSqlException(Exception ex)
        {
            var sqlEx = ex as SqlException;
            if (sqlEx == null)
                return String.Empty;
            var sb = new StringBuilder();

            sb.AppendLine(ex.ToString());
            for (int i = 0; i < sqlEx.Errors.Count; i++)
            {
                var sqlErr = sqlEx.Errors[i];
                sb.AppendFormat("[#{0}] Message: {0}, LineNumber: {1}, Source: {2}, Procedure: {3}\r\n",
                    sqlErr.Number, sqlErr.Message, sqlErr.LineNumber, sqlErr.Source, sqlErr.Procedure);
            }
            return sb.ToString();
        }
        #endregion

        public static string FormatException(Exception ex,
            bool includeStackTrace = true,
            bool includeContext = false,
            int maxInnerExceptionDepth = 5)
        {
            if (ex == null)
                return String.Empty;
            var sb = new StringBuilder();
            try
            {
                // Whether or not to include the application and machine context
                if (includeContext)
                    AppendContext(sb);

                AppendExceptionInfo(sb, ex, 0);
            }
            catch (Exception ex0)
            {
                sb.AppendFormat("Warning; Could not format exception {0}", ex0.ToString());
            }

            return sb.ToString();
        }

        private static void AppendExceptionInfo(StringBuilder sb,
            Exception exception, int depth)
        {
            Func<Exception, string> formatter = defaultFormatter;
            if (FormatExceptionMap.ContainsKey(exception.GetType()))
                formatter = FormatExceptionMap[exception.GetType()];

            sb.AppendFormat("\r\n------------------------------\r\n{0}",
                formatter(exception));
        }

        private static void AppendContext(StringBuilder sb)
        {
            var currentAssembly = Assembly.GetEntryAssembly() ?? Assembly.GetCallingAssembly();
            var lastWritten = File.GetLastWriteTime(currentAssembly.Location);

            sb.AppendFormat("[Context] assembly={0},version={1},buildTime={2},appDomain={3},basePath={4}",
                currentAssembly.FullName,
                currentAssembly.GetName().Version.ToString(),
                lastWritten,
                AppDomain.CurrentDomain.FriendlyName,
                AppDomain.CurrentDomain.SetupInformation.ApplicationBase);
        }
    }
}


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

package com.google.api.ads.adwords.axis.v201509.cm;

/**
 * Represents an upgrade operation to upgrade Ad.url.
 */
public class AdUrlUpgrade  implements java.io.Serializable {
    /* ID of ad to upgrade.
     *                 This field is required
     * and should not be {@code null}. */
    private java.lang.Long adId;

    /* Final url of the ad. This is required for all Ad types, except
     * for DynamicSearchAd and
     *                 ProductAd. */
    private java.lang.String finalUrl;

    /* Mobile final url of the ad. This field is optional. */
    private java.lang.String finalMobileUrl;

    /* Tracking url template of the Ad. */
    private java.lang.String trackingUrlTemplate;

    public AdUrlUpgrade() {
    }

    public AdUrlUpgrade(
           java.lang.Long adId,
           java.lang.String finalUrl,
           java.lang.String finalMobileUrl,
           java.lang.String trackingUrlTemplate) {
           this.adId = adId;
           this.finalUrl = finalUrl;
           this.finalMobileUrl = finalMobileUrl;
           this.trackingUrlTemplate = trackingUrlTemplate;
    }

    /**
     * Gets the adId value for this AdUrlUpgrade.
     *
     * @return adId   * ID of ad to upgrade.
     *                 This field is required
     * and should not be {@code null}.
     */
    public java.lang.Long getAdId() {
        return adId;
    }

    /**
     * Sets the adId value for this AdUrlUpgrade.
     *
     * @param adId   * ID of ad to upgrade.
     *                 This field is required
     * and should not be {@code null}.
     */
    public void setAdId(java.lang.Long adId) {
        this.adId = adId;
    }

    /**
     * Gets the finalUrl value for this AdUrlUpgrade.
     *
     * @return finalUrl   * Final url of the ad. This is required for all Ad types, except
     * for DynamicSearchAd and
     *                 ProductAd.
     */
    public java.lang.String getFinalUrl() {
        return finalUrl;
    }

    /**
     * Sets the finalUrl value for this AdUrlUpgrade.
     *
     * @param finalUrl   * Final url of the ad. This is required for all Ad types, except
     * for DynamicSearchAd and
     *                 ProductAd.
     */
    public void setFinalUrl(java.lang.String finalUrl) {
        this.finalUrl = finalUrl;
    }

    /**
     * Gets the finalMobileUrl value for this AdUrlUpgrade.
     *
     * @return finalMobileUrl   * Mobile final url of the ad. This field is optional.
     */
    public java.lang.String getFinalMobileUrl() {
        return finalMobileUrl;
    }

    /**
     * Sets the finalMobileUrl value for this AdUrlUpgrade.
     *
     * @param finalMobileUrl   * Mobile final url of the ad. This field is optional.
     */
    public void setFinalMobileUrl(java.lang.String finalMobileUrl) {
        this.finalMobileUrl = finalMobileUrl;
    }

    /**
     * Gets the trackingUrlTemplate value for this AdUrlUpgrade.
     *
     * @return trackingUrlTemplate   * Tracking url template of the Ad.
     */
    public java.lang.String getTrackingUrlTemplate() {
        return trackingUrlTemplate;
    }

    /**
     * Sets the trackingUrlTemplate value for this AdUrlUpgrade.
     *
     * @param trackingUrlTemplate   * Tracking url template of the Ad.
     */
    public void setTrackingUrlTemplate(java.lang.String trackingUrlTemplate) {
        this.trackingUrlTemplate = trackingUrlTemplate;
    }

    private java.lang.Object __equalsCalc = null;
    public synchronized boolean equals(java.lang.Object obj) {
        if (!(obj instanceof AdUrlUpgrade)) return false;
        AdUrlUpgrade other = (AdUrlUpgrade) obj;
        if (obj == null) return false;
        if (this == obj) return true;
        if (__equalsCalc != null) {
            return (__equalsCalc == obj);
        }
        __equalsCalc = obj;
        boolean _equals;
        _equals = true &&
            ((this.adId==null && other.getAdId()==null) ||
             (this.adId!=null &&
              this.adId.equals(other.getAdId()))) &&
            ((this.finalUrl==null && other.getFinalUrl()==null) ||
             (this.finalUrl!=null &&
              this.finalUrl.equals(other.getFinalUrl()))) &&
            ((this.finalMobileUrl==null && other.getFinalMobileUrl()==null) ||
             (this.finalMobileUrl!=null &&
              this.finalMobileUrl.equals(other.getFinalMobileUrl()))) &&
            ((this.trackingUrlTemplate==null && other.getTrackingUrlTemplate()==null) ||
             (this.trackingUrlTemplate!=null &&
              this.trackingUrlTemplate.equals(other.getTrackingUrlTemplate())));
        __equalsCalc = null;
        return _equals;
    }

    private boolean __hashCodeCalc = false;
    public synchronized int hashCode() {
        if (__hashCodeCalc) {
            return 0;
        }
        __hashCodeCalc = true;
        int _hashCode = 1;
        if (getAdId() != null) {
            _hashCode += getAdId().hashCode();
        }
        if (getFinalUrl() != null) {
            _hashCode += getFinalUrl().hashCode();
        }
        if (getFinalMobileUrl() != null) {
            _hashCode += getFinalMobileUrl().hashCode();
        }
        if (getTrackingUrlTemplate() != null) {
            _hashCode += getTrackingUrlTemplate().hashCode();
        }
        __hashCodeCalc = false;
        return _hashCode;
    }

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

    static {
        typeDesc.setXmlType(new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201509", "AdUrlUpgrade"));
        org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc();
        elemField.setFieldName("adId");
        elemField.setXmlName(new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201509", "adId"));
        elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "long"));
        elemField.setMinOccurs(0);
        elemField.setNillable(false);
        typeDesc.addFieldDesc(elemField);
        elemField = new org.apache.axis.description.ElementDesc();
        elemField.setFieldName("finalUrl");
        elemField.setXmlName(new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201509", "finalUrl"));
        elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"));
        elemField.setMinOccurs(0);
        elemField.setNillable(false);
        typeDesc.addFieldDesc(elemField);
        elemField = new org.apache.axis.description.ElementDesc();
        elemField.setFieldName("finalMobileUrl");
        elemField.setXmlName(new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201509", "finalMobileUrl"));
        elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"));
        elemField.setMinOccurs(0);
        elemField.setNillable(false);
        typeDesc.addFieldDesc(elemField);
        elemField = new org.apache.axis.description.ElementDesc();
        elemField.setFieldName("trackingUrlTemplate");
        elemField.setXmlName(new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201509", "trackingUrlTemplate"));
        elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"));
        elemField.setMinOccurs(0);
        elemField.setNillable(false);
        typeDesc.addFieldDesc(elemField);
    }

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

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

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

}


text:
<?php

namespace Symfony\Component\HttpFoundation\Tests;

use PHPUnit\Framework\SkippedTestSuiteError;
use PHPUnit\Framework\TestCase;

class ResponseFunctionalTest extends TestCase
{
    private static $server;

    public static function setUpBeforeClass(): void
    {
        $spec = [
            1 => ['file', '/dev/null', 'w'],
            2 => ['file', '/dev/null', 'w'],
        ];
        if (!self::$server = @proc_open('exec '.\PHP_BINARY.' -S localhost:8054', $spec, $pipes, __DIR__.'/Fixtures/response-functional')) {
            throw new SkippedTestSuiteError('PHP server unable to start.');
        }
        sleep(1);
    }

    public static function tearDownAfterClass(): void
    {
        if (self::$server) {
            proc_terminate(self::$server);
            proc_close(self::$server);
        }
    }

    /**
     * @dataProvider provideCookie
     */
    public function testCookie($fixture)
    {
        if (\PHP_VERSION_ID >= 80000 && 'cookie_max_age' === $fixture) {
            $this->markTestSkipped('This fixture produces a fatal error on PHP 8.');
        }

        $result = file_get_contents(sprintf('http://localhost:8054/%s.php', $fixture));
        $result = preg_replace_callback('/expires=[^;]++/', function ($m) { return str_replace('-', ' ', $m[0]); }, $result);
        $this->assertStringMatchesFormatFile(__DIR__.sprintf('/Fixtures/response-functional/%s.expected', $fixture), $result);
    }

    public function provideCookie()
    {
        foreach (glob(__DIR__.'/Fixtures/response-functional/*.php') as $file) {
            yield [pathinfo($file, \PATHINFO_FILENAME)];
        }
    }
}


text:
.class Landroid/view/textservice/SpellCheckerSession$1;
.super Landroid/os/Handler;
.source "SpellCheckerSession.java"

# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Landroid/view/textservice/SpellCheckerSession;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = null
.end annotation

# instance fields
.field final synthetic this$0:Landroid/view/textservice/SpellCheckerSession;

# direct methods
.method constructor <init>(Landroid/view/textservice/SpellCheckerSession;)V
    .locals 0

    iput-object p1, p0, Landroid/view/textservice/SpellCheckerSession$1;->this$0:Landroid/view/textservice/SpellCheckerSession;

    invoke-direct {p0}, Landroid/os/Handler;-><init>()V

    return-void
.end method

# virtual methods
.method public handleMessage(Landroid/os/Message;)V
    .locals 2

    iget v0, p1, Landroid/os/Message;->what:I

    packed-switch v0, :pswitch_data_0

    :goto_0
    return-void

    :pswitch_0
    iget-object v1, p0, Landroid/view/textservice/SpellCheckerSession$1;->this$0:Landroid/view/textservice/SpellCheckerSession;

    iget-object v0, p1, Landroid/os/Message;->obj:Ljava/lang/Object;

    check-cast v0, [Landroid/view/textservice/SuggestionsInfo;

    invoke-static {v1, v0}, Landroid/view/textservice/SpellCheckerSession;->-wrap1(Landroid/view/textservice/SpellCheckerSession;[Landroid/view/textservice/SuggestionsInfo;)V

    goto :goto_0

    :pswitch_1
    iget-object v1, p0, Landroid/view/textservice/SpellCheckerSession$1;->this$0:Landroid/view/textservice/SpellCheckerSession;

    iget-object v0, p1, Landroid/os/Message;->obj:Ljava/lang/Object;

    check-cast v0, [Landroid/view/textservice/SentenceSuggestionsInfo;

    invoke-static {v1, v0}, Landroid/view/textservice/SpellCheckerSession;->-wrap0(Landroid/view/textservice/SpellCheckerSession;[Landroid/view/textservice/SentenceSuggestionsInfo;)V

    goto :goto_0

    :pswitch_data_0
    .packed-switch 0x1
        :pswitch_0
        :pswitch_1
    .end packed-switch
.end method


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

import com.facebook.presto.jdbc.PrestoResultSet;
import com.google.common.collect.ImmutableMap;
import io.prestodb.benchto.driver.execution.QueryExecutionResult.QueryExecutionResultBuilder;
import io.prestodb.benchto.driver.loader.SqlStatementGenerator;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.List;
import java.util.Map;
import java.util.StringJoiner;

import static com.google.common.base.Preconditions.checkState;

public class QueryExecutionDriver
{
    private static final Logger LOG = LoggerFactory.getLogger(QueryExecutionDriver.class);
    private static final int LOGGED_ROWS = 10;

    @Autowired
    private SqlStatementGenerator sqlStatementGenerator;

    public QueryExecutionResult execute(QueryExecution queryExecution, Connection connection)
            throws SQLException
    {
        QueryExecutionResultBuilder queryExecutionResultBuilder = new QueryExecutionResultBuilder(queryExecution)
                .startTimer();

        String sqlStatement = generateQuerySqlStatement(queryExecution);

        if (isSelectQuery(sqlStatement)) {
            return executeSelectQuery(connection, queryExecutionResultBuilder, sqlStatement);
        }
        else {
            return executeUpdateQuery(connection, queryExecutionResultBuilder, sqlStatement);
        }
    }

    private boolean isSelectQuery(String sql)
    {
        sql = sql.trim().toLowerCase();
        return sql.startsWith("select") || sql.startsWith("show") || sql.startsWith("with");
    }

    private QueryExecutionResult executeSelectQuery(Connection connection, QueryExecutionResultBuilder queryExecutionResultBuilder, String sqlStatement)
            throws SQLException
    {
        try (Statement statement = connection.createStatement();
                ResultSet resultSet = statement.executeQuery(sqlStatement)) {
            LOG.info("First {} rows for query: {}", LOGGED_ROWS, sqlStatement);

            int rowsCount = 0;
            while (resultSet.next()) {
                if (rowsCount < LOGGED_ROWS) {
                    logRow(rowsCount + 1, resultSet);
                }
                else if (rowsCount == LOGGED_ROWS) {
                    LOG.info("There are more unlogged rows");
                }
                rowsCount++;
            }

            try {
                if (resultSet.isWrapperFor(PrestoResultSet.class)) {
                    PrestoResultSet prestoResultSet = resultSet.unwrap(PrestoResultSet.class);
                    queryExecutionResultBuilder.setPrestoQueryId(prestoResultSet.getQueryId());
                }
            }
            catch (AbstractMethodError | Exception e) {
                // this error is caught by the compiler, but some drivers (hsqldb, hive, ...?) sucks
                LOG.warn("Driver ({}) does not support isWrapperFor/unwrap method", connection.toString());
            }

            return queryExecutionResultBuilder
                    .setRowsCount(rowsCount)
                    .endTimer()
                    .build();
        }
    }

    private QueryExecutionResult executeUpdateQuery(Connection connection, QueryExecutionResultBuilder queryExecutionResultBuilder, String sqlStatement)
            throws SQLException
    {
        try (Statement statement = connection.createStatement()) {
            int rowCount = statement.executeUpdate(sqlStatement);
            return queryExecutionResultBuilder
                    .setRowsCount(rowCount)
                    .endTimer()
                    .build();
        }
    }

    private String generateQuerySqlStatement(QueryExecution queryExecution)
    {
        Map<String, String> variables = ImmutableMap.<String, String>builder()
                .put("execution_sequence_id", "" + queryExecution.getRun())
                .putAll(queryExecution.getBenchmark().getNonReservedKeywordVariables())
                .build();
        List<String> sqlQueries = sqlStatementGenerator.generateQuerySqlStatement(queryExecution.getQuery(), variables);
        checkState(sqlQueries.size() == 1, "Multiple statements in one query file are not supported");
        return sqlQueries.get(0);
    }

    private void logRow(int rowNumber, ResultSet resultSet)
            throws SQLException
    {
        ResultSetMetaData resultSetMetaData = resultSet.getMetaData();
        StringJoiner joiner = new StringJoiner("; ", "[", "]");
        for (int i = 1; i <= resultSetMetaData.getColumnCount(); ++i) {
            joiner.add(resultSetMetaData.getColumnName(i) + ": " + resultSet.getObject(i));
        }

        LOG.info("Row: " + rowNumber + ", column values: " + joiner.toString());
    }
}


text:
from django.utils.safestring import mark_safe

from bootstrap3.utils import add_css_class, render_tag

from .text import text_value

def render_icon(icon, **kwargs):
    """Render a Bootstrap glyphicon icon."""
    attrs = {"class": add_css_class("glyphicon glyphicon-{icon}".format(icon=icon), kwargs.get("extra_classes", ""))}
    title = kwargs.get("title")
    if title:
        attrs["title"] = title
    return render_tag("span", attrs=attrs)

def render_alert(content, alert_type=None, dismissable=True):
    """Render a Bootstrap alert."""
    button = ""
    if not alert_type:
        alert_type = "info"
    css_classes = ["alert", "alert-" + text_value(alert_type)]
    if dismissable:
        css_classes.append("alert-dismissable")
        button = '<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>'
    button_placeholder = "__BUTTON__"
    return mark_safe(
        render_tag(
            "div", attrs={"class": " ".join(css_classes)}, content=button_placeholder + text_value(content)
        ).replace(button_placeholder, button)
    )


text:
package ru.job4j.tracker.models;

import org.junit.Test;

import java.util.ArrayList;

import static org.hamcrest.core.Is.is;
import static org.hamcrest.number.IsCloseTo.closeTo;
import static org.junit.Assert.assertThat;
/**
 * Test class Item.
 *
 * @author ayuzyak
 * @version 1.
 * @since 07.02.2017.
 */
 public class ItemTest {

	 /**
	 * Test method for checking getName().
	 */
	@Test
	public void whenItemNameIsItem() {
		Item item = new Item("Item", "Description");
		String resultName = item.getName();
		String checkName = "Item";
		assertThat(resultName, is(checkName));
	}

	/**
	 * Test method for checking getDescription().
	 */
	@Test
	public void whenItemDescriptionIsDescription() {
		Item item = new Item("Item", "Description");
		String resultDescription = item.getDescription();
		String checkDescription = "Description";
		assertThat(resultDescription, is(checkDescription));
	}

	/**
	 * Test method for checking getCreate().
	 */
	@Test
	public void whenItemCraeteIsCurrentTime() {
		Item item = new Item("Item", "Description");
		long resultTime = item.getCreate();
		long checkTime = System.currentTimeMillis();
		final long error = 100L;
		assertThat((double) resultTime, is(closeTo(checkTime, error)));
	}

	/**
	 * Test method for checking setId() and getID().
	 */
	@Test
	public void whenItemIdIsN123() {
		Item item = new Item("Item", "Description");
		item.setId("N123");
		String resultId = item.getId();
		String checkId = "N123";
		assertThat(resultId, is(checkId));
	}

	/**
	 * Test method for checking getComments().
	 */
	@Test
	public void whenGetComments() {
		Item item = new Item("Item", "Description");
		ArrayList<String> refComments = item.getComments();
		refComments.add("Test");
		refComments.add("Comment");
		ArrayList<String> resultComments = item.getComments();
		ArrayList<String> checkComments = new ArrayList<>();
		checkComments.add("Test");
		checkComments.add("Comment");
		assertThat(resultComments, is(checkComments));
	}
 }


text:
<?php
/**
 * @author Evgeny Shpilevsky <evgeny@shpilevsky.com>
 */

namespace EnliteMonolog\Service;

use Laminas\Stdlib\AbstractOptions;

class MonologOptions extends AbstractOptions
{

    /**
     * Logger name
     *
     * @var string
     */
    protected $name = 'EnliteMonolog';

    /**
     * Handlers
     *
     * @var array
     */
    protected $handlers = [];

    /**
     * @var array
     */
    protected $processors = [];

    public function setName(string $name): void
    {
        $this->name = $name;
    }

    public function getName(): string
    {
        return $this->name;
    }

    public function setHandlers(array $handlers): void
    {
        $this->handlers = $handlers;
    }

    public function getHandlers(): array
    {
        return $this->handlers;
    }

    public function setProcessors(array $processors = []): void
    {
        $this->processors = $processors;
    }

    public function getProcessors(): array
    {
        return $this->processors;
    }
}


text:
package aQute.bnd.build;

import java.io.File;
import java.io.InputStream;
import java.net.URL;
import java.net.URLClassLoader;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.IdentityHashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import java.util.concurrent.TimeUnit;
import java.util.jar.Manifest;
import java.util.regex.Pattern;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import aQute.bnd.header.Attrs;
import aQute.bnd.header.OSGiHeader;
import aQute.bnd.header.Parameters;
import aQute.bnd.osgi.Constants;
import aQute.bnd.osgi.Jar;
import aQute.bnd.osgi.Processor;
import aQute.bnd.service.Strategy;
import aQute.libg.command.Command;
import aQute.libg.generics.Create;

/**
 * A Project Launcher is a base class to be extended by launchers. Launchers are
 * JARs that launch a framework and install a number of bundles and then run the
 * framework. A launcher jar must specify a Launcher-Class manifest header. This
 * class is instantiated and cast to a LauncherPlugin. This plug in is then
 * asked to provide a ProjectLauncher. This project launcher is then used by the
 * project to run the code. Launchers must extend this class.
 */
public abstract class ProjectLauncher extends Processor {
	private final static Logger					logger				= LoggerFactory.getLogger(ProjectLauncher.class);
	private final Project						project;
	private long								timeout				= 0;
	private final List<String>					classpath			= new ArrayList<>();
	private List<String>						runbundles			= Create.list();
	private final List<String>					runvm				= new ArrayList<>();
	private final List<String>					runprogramargs		= new ArrayList<>();
	private Map<String,String>					runproperties;
	private Command								java;
	private Parameters							runsystempackages;
	private Parameters							runsystemcapabilities;
	private final List<String>					activators			= Create.list();
	private File								storageDir;

	private boolean								trace;
	private boolean								keep;
	private int									framework;
	private File								cwd;
	private Collection<String>					agents				= new ArrayList<>();
	private Set<NotificationListener>	listeners			= Collections.newSetFromMap(new IdentityHashMap<>());

	protected Appendable						out					= System.out;
	protected Appendable						err					= System.err;
	protected InputStream						in					= System.in;

	public final static int						SERVICES			= 10111;
	public final static int						NONE				= 20123;

	// MUST BE ALIGNED WITH LAUNCHER
	public final static int						OK					= 0;
	public final static int						WARNING				= -1;
	public final static int						ERROR				= -2;
	public final static int						TIMEDOUT			= -3;
	public final static int						UPDATE_NEEDED		= -4;
	public final static int						CANCELED			= -5;
	public final static int						DUPLICATE_BUNDLE	= -6;
	public final static int						RESOLVE_ERROR		= -7;
	public final static int						ACTIVATOR_ERROR		= -8;
	public final static int						CUSTOM_LAUNCHER		= -128;

	public final static String					EMBEDDED_ACTIVATOR	= "Embedded-Activator";

	public ProjectLauncher(Project project) throws Exception {
		this.project = project;

		updateFromProject();
	}

	/**
	 * Collect all the aspect from the project and set the local fields from
	 * them. Should be called
	 *
	 * @throws Exception
	 */
	protected void updateFromProject() throws Exception {
		setCwd(project.getBase());

		// pkr: could not use this because this is killing the runtests.
		// project.refresh();
		runbundles.clear();
		Collection<Container> run = project.getRunbundles();

		for (Container container : run) {
			File file = container.getFile();
			if (file != null && (file.isFile() || file.isDirectory())) {
				runbundles.add(file.getAbsolutePath());
			} else {
				project.error("Bundle file \"%s\" does not exist, given error is %s", file, container.getError());
			}
		}

		if (project.getRunBuilds()) {
			File[] builds = project.getBuildFiles(true);
			if (builds != null)
				for (File file : builds)
					runbundles.add(file.getAbsolutePath());
		}

		Collection<Container> runpath = project.getRunpath();
		runsystempackages = new Parameters(project.mergeProperties(Constants.RUNSYSTEMPACKAGES), project);
		runsystemcapabilities = new Parameters(project.mergeProperties(Constants.RUNSYSTEMCAPABILITIES), project);
		framework = getRunframework(project.getProperty(Constants.RUNFRAMEWORK));

		timeout = Processor.getDuration(project.getProperty(Constants.RUNTIMEOUT), 0);
		trace = Processor.isTrue(project.getProperty(Constants.RUNTRACE));

		runpath.addAll(project.getRunFw());

		for (Container c : runpath) {
			addClasspath(c);
		}

		runvm.addAll(project.getRunVM());
		runprogramargs.addAll(project.getRunProgramArgs());
		runproperties = project.getRunProperties();

		storageDir = project.getRunStorage();

		setKeep(project.getRunKeep());
	}

	private int getRunframework(String property) {
		if (Constants.RUNFRAMEWORK_NONE.equalsIgnoreCase(property))
			return NONE;
		else if (Constants.RUNFRAMEWORK_SERVICES.equalsIgnoreCase(property))
			return SERVICES;

		return SERVICES;
	}

	public void addClasspath(Container container) throws Exception {
		if (container.getError() != null) {
			project.error("Cannot launch because %s has reported %s", container.getProject(), container.getError());
		} else {
			Collection<Container> members = container.getMembers();
			for (Container m : members) {
				String path = m.getFile().getAbsolutePath();
				if (!classpath.contains(path)) {

					Manifest manifest = m.getManifest();

					if (manifest != null) {

						// We are looking for any agents, used if
						// -javaagent=true is set
						String agentClassName = manifest.getMainAttributes().getValue("Premain-Class");
						if (agentClassName != null) {
							String agent = path;
							if (container.getAttributes().get("agent") != null) {
								agent += "=" + container.getAttributes().get("agent");
							}
							agents.add(path);
						}

						Parameters exports = project
								.parseHeader(manifest.getMainAttributes().getValue(Constants.EXPORT_PACKAGE));
						for (Entry<String,Attrs> e : exports.entrySet()) {
							if (!runsystempackages.containsKey(e.getKey()))
								runsystempackages.put(e.getKey(), e.getValue());
						}

						// Allow activators on the runpath. They are called
						// after
						// the framework is completely initialized wit the
						// system
						// context.
						String activator = manifest.getMainAttributes().getValue(EMBEDDED_ACTIVATOR);
						if (activator != null)
							activators.add(activator);
					}
					classpath.add(path);
				}
			}
		}
	}

	protected void addClasspath(Collection<Container> path) throws Exception {
		for (Container c : Container.flatten(path)) {
			addClasspath(c);
		}
	}

	public void addRunBundle(String f) {
		runbundles.add(f);
	}

	public Collection<String> getRunBundles() {
		return runbundles;
	}

	public void addRunVM(String arg) {
		runvm.add(arg);
	}

	public void addRunProgramArgs(String arg) {
		runprogramargs.add(arg);
	}

	public List<String> getRunpath() {
		return classpath;
	}

	public Collection<String> getClasspath() {
		return classpath;
	}

	public Collection<String> getRunVM() {
		return runvm;
	}

	@Deprecated
	public Collection<String> getArguments() {
		return getRunProgramArgs();
	}

	public Collection<String> getRunProgramArgs() {
		return runprogramargs;
	}

	public Map<String,String> getRunProperties() {
		return runproperties;
	}

	public File getStorageDir() {
		return storageDir;
	}

	public abstract String getMainTypeName();

	public abstract void update() throws Exception;

	public int launch() throws Exception {
		prepare();
		java = new Command();

		//
		// Handle the environment
		//

		Map<String,String> env = getRunEnv();
		for (Map.Entry<String,String> e : env.entrySet()) {
			java.var(e.getKey(), e.getValue());
		}

		java.add(project.getProperty("java", getJavaExecutable()));
		String javaagent = project.getProperty(Constants.JAVAAGENT);
		if (Processor.isTrue(javaagent)) {
			for (String agent : agents) {
				java.add("-javaagent:" + agent);
			}
		}

		String jdb = getRunJdb();
		if (jdb != null) {
			int port = 1044;
			try {
				port = Integer.parseInt(project.getProperty(Constants.RUNJDB));
			} catch (Exception e) {
				// ok, value can also be ok, or on, or true
			}
			String suspend = port > 0 ? "y" : "n";

			java.add("-Xrunjdwp:server=y,transport=dt_socket,address=" + Math.abs(port) + ",suspend=" + suspend);
		}

		java.add("-cp");
		java.add(Processor.join(getClasspath(), File.pathSeparator));
		java.addAll(getRunVM());
		java.add(getMainTypeName());
		java.addAll(getRunProgramArgs());
		if (timeout != 0)
			java.setTimeout(timeout + 1000, TimeUnit.MILLISECONDS);

		File cwd = getCwd();
		if (cwd != null)
			java.setCwd(cwd);

		logger.debug("cmd line {}", java);
		try {
			int result = java.execute(in, out, err);
			if (result == Integer.MIN_VALUE)
				return TIMEDOUT;
			reportResult(result);
			return result;
		} finally {
			cleanup();
			listeners.clear();
		}
	}

	private String getJavaExecutable() {
		String javaHome = System.getProperty("java.home");
		if (javaHome == null) {
			return "java";
		}
		File java = new File(javaHome, "bin/java");
		return java.getAbsolutePath();
	}

	/**
	 * launch a framework internally. I.e. do not start a separate process.
	 *
	 */
	static Pattern IGNORE = Pattern.compile("org(/|\\.)osgi(/|\\.).resource.*");

	public int start(ClassLoader parent) throws Exception {

		prepare();

		//
		// Intermediate class loader to not load osgi framework packages
		// from bnd's loader. Unfortunately, bnd uses some osgi classes
		// itself that would unnecessarily constrain the framework.
		//

		ClassLoader fcl = new ClassLoader(parent) {
			protected Class< ? > loadClass(String name, boolean resolve) throws ClassNotFoundException {
				if (IGNORE.matcher(name).matches())
					throw new ClassNotFoundException();

				return super.loadClass(name, resolve);
			}
		};

		//
		// Load the class that would have gone to the class path
		// i.e. the framework etc.
		//

		List<URL> cp = new ArrayList<>();
		for (String path : getClasspath()) {
			cp.add(new File(path).toURI().toURL());
		}
		@SuppressWarnings("resource")
		URLClassLoader cl = new URLClassLoader(cp.toArray(new URL[0]), fcl);

		String[] args = getRunProgramArgs().toArray(new String[0]);

		Class< ? > main = cl.loadClass(getMainTypeName());
		return invoke(main, args);
	}

	protected int invoke(Class< ? > main, String args[]) throws Exception {
		throw new UnsupportedOperationException();
	}

	/**
	 * Is called after the process exists. Can you be used to cleanup the
	 * properties file.
	 */

	public void cleanup() {
		// do nothing by default
	}

	protected void reportResult(int result) {
		switch (result) {
			case OK :
				logger.debug("Command terminated normal {}", java);
				break;
			case TIMEDOUT :
				project.error("Launch timedout: %s", java);
				break;

			case ERROR :
				project.error("Launch errored: %s", java);
				break;

			case WARNING :
				project.warning("Launch had a warning %s", java);
				break;
			default :
				project.error("Exit code remote process %d: %s", result, java);
				break;
		}
	}

	public void setTimeout(long timeout, TimeUnit unit) {
		this.timeout = unit.convert(timeout, TimeUnit.MILLISECONDS);
	}

	public long getTimeout() {
		return this.timeout;
	}

	public void cancel() throws Exception {
		java.cancel();
	}

	public Map<String, ? extends Map<String,String>> getSystemPackages() {
		return runsystempackages.asMapMap();
	}

	public String getSystemCapabilities() {
		return runsystemcapabilities.isEmpty() ? null : runsystemcapabilities.toString();
	}

	public Parameters getSystemCapabilitiesParameters() {
		return runsystemcapabilities;
	}

	public void setKeep(boolean keep) {
		this.keep = keep;
	}

	public boolean isKeep() {
		return keep;
	}

	public void setTrace(boolean level) {
		this.trace = level;
	}

	public boolean getTrace() {
		return this.trace;
	}

	/**
	 * Should be called when all the changes to the launchers are set. Will
	 * calculate whatever is necessary for the launcher.
	 *
	 * @throws Exception
	 */
	public abstract void prepare() throws Exception;

	public Project getProject() {
		return project;
	}

	public boolean addActivator(String e) {
		return activators.add(e);
	}

	public Collection<String> getActivators() {
		return Collections.unmodifiableCollection(activators);
	}

	/**
	 * Either NONE or SERVICES to indicate how the remote end launches. NONE
	 * means it should not use the classpath to run a framework. This likely
	 * requires some dummy framework support. SERVICES means it should load the
	 * framework from the claspath.
	 *
	 */
	public int getRunFramework() {
		return framework;
	}

	public void setRunFramework(int n) {
		assert n == NONE || n == SERVICES;
		this.framework = n;
	}

	/**
	 * Add the specification for a set of bundles the runpath if it does not
	 * already is included. This can be used by subclasses to ensure the proper
	 * jars are on the classpath.
	 *
	 * @param defaultSpec The default spec for default jars
	 */
	public void addDefault(String defaultSpec) throws Exception {
		Collection<Container> deflts = project.getBundles(Strategy.HIGHEST, defaultSpec, null);
		for (Container c : deflts)
			addClasspath(c);
	}

	/**
	 * Create a self executable.
	 */

	public Jar executable() throws Exception {
		throw new UnsupportedOperationException();
	}

	public File getCwd() {
		return cwd;
	}

	public void setCwd(File cwd) {
		this.cwd = cwd;
	}

	public String getRunJdb() {
		return project.getProperty(Constants.RUNJDB);
	}

	public Map<String,String> getRunEnv() {
		String runenv = project.getProperty(Constants.RUNENV);
		if (runenv != null) {
			return OSGiHeader.parseProperties(runenv);
		}
		return Collections.emptyMap();
	}

	public static interface NotificationListener {
		void notify(NotificationType type, String notification);
	}

	public static enum NotificationType {
		ERROR, WARNING, INFO;
	}

	public void registerForNotifications(NotificationListener listener) {
		listeners.add(listener);
	}

	public Set<NotificationListener> getNotificationListeners() {
		return Collections.unmodifiableSet(listeners);
	}

	/**
	 * Set the stderr and stdout streams for the output process. The debugged
	 * process must append its output (i.e. write operation in the process under
	 * debug) to the given appendables.
	 *
	 * @param out std out
	 * @param err std err
	 */
	public void setStreams(Appendable out, Appendable err) {
		this.out = out;
		this.err = err;
	}

	/**
	 * Write text to the debugged process as if it came from stdin.
	 *
	 * @param text the text to write
	 * @throws Exception
	 */
	public void write(String text) throws Exception {

	}

	/**
	 * Get the run sessions. If this return null, then launch on this object
	 * should be used, otherwise each returned object provides a remote session.
	 *
	 * @throws Exception
	 */

	public List< ? extends RunSession> getRunSessions() throws Exception {
		return null;
	}

	/**
	 * Utility to calculate the final framework properties from settings
	 */
	/**
	 * This method should go to the ProjectLauncher
	 *
	 * @throws Exception
	 */

	public void calculatedProperties(Map<String,Object> properties) throws Exception {

		if (!keep)
			properties.put(org.osgi.framework.Constants.FRAMEWORK_STORAGE_CLEAN,
					org.osgi.framework.Constants.FRAMEWORK_STORAGE_CLEAN_ONFIRSTINIT);

		if (!runsystemcapabilities.isEmpty())
			properties.put(org.osgi.framework.Constants.FRAMEWORK_SYSTEMCAPABILITIES_EXTRA,
					runsystemcapabilities.toString());

		if (!runsystempackages.isEmpty())
			properties.put(org.osgi.framework.Constants.FRAMEWORK_SYSTEMPACKAGES_EXTRA, runsystempackages.toString());

	}

}


text:
  Name
  <input autocorrect="none" autocapitalize="none" spellcheck="false" aria-describedby="edit-name--description" type="text" name="name" value="" size="60" maxlength="60" class="form-item__textfield form-item__textfield--required" required="required" aria-required="true" placeholder="First, Middle, Last">

  Password
  <input aria-describedby="edit-pass--description" type="password" name="pass" size="60" maxlength="128" class="form-item__textfield form-item__textfield--password form-item__textfield--required" required="required" aria-required="true">

    Enter the password that accompanies your username.

<form>
  <fieldset class="form-fieldset">
  <legend class="heading-2 with-icon">Web and Email Address (fieldset example)</legend>

       Web Address
       <input type="url" class="form-item__textfield" placeholder="http://yoursite.com">

       Email Address
       <input type="email" class="form-item__textfield" placeholder="name@email.com">

  </fieldset>
 </form>

   Number Input
   <input type="number" class="form-item__textfield" placeholder="Enter a Number" pattern="[0-9]*">

   Textarea
   <textarea class="form-item__textfield form-item__textarea"  rows="8" cols="48" placeholder="Enter your message here"></textarea>


text:
package org.apache.ignite.internal.processors.cache.persistence.tree.io;

import org.apache.ignite.IgniteCheckedException;

/** */
public interface PageIoResolver {
    /** */
    public static final PageIoResolver DEFAULT_PAGE_IO_RESOLVER = PageIO::getPageIO;

    /** */
    PageIO resolve(long pageAddr) throws IgniteCheckedException;
}


text:
Test for bug #49898: SoapClient::__getCookies() implementation
--CREDITS--
Boro Sitnikovski <buritomath@yahoo.com>
--SKIPIF--
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
$client = new SoapClient(null, array('uri' => 'mo:http://www.w3.org/', 'location' => 'http://some.url'));
$client->__setCookie("CookieTest", "HelloWorld");
var_dump($client->__getCookies()['CookieTest'][0]);
?>
--EXPECT--
string(10) "HelloWorld"


text:
Welcome to the Gymnasium App

Find this text in partial one


text:
#ifndef _LINUX_VMALLOC_H
#define _LINUX_VMALLOC_H

#include <linux/spinlock.h>
#include <asm/page.h>

struct vm_area_struct;

#define VM_IOREMAP 0x00000001
#define VM_ALLOC 0x00000002
#define VM_MAP 0x00000004
#define VM_USERMAP 0x00000008
#define VM_VPAGES 0x00000010

#ifndef IOREMAP_MAX_ORDER
#define IOREMAP_MAX_ORDER (7 + PAGE_SHIFT)
#endif

struct vm_struct {
 void *addr;
 unsigned long size;
 unsigned long flags;
 struct page **pages;
 unsigned int nr_pages;
 unsigned long phys_addr;
 struct vm_struct *next;
};

#endif


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Bacidia crocynoides A.L. Sm.

### Remarks
null


text:
package com.amazonaws.services.licensemanager.model;

import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;

/**
 *

 * Describes key/value pairs.
 *

 *
 * @see AWS API
 *      Documentation
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class Metadata implements Serializable, Cloneable, StructuredPojo {

    /**
     *

     * The key name.
     *

     */
    private String name;
    /**
     *

     * The value.
     *

     */
    private String value;

    /**
     *

     * The key name.
     *

     *
     * @param name
     *        The key name.
     */

    public void setName(String name) {
        this.name = name;
    }

    /**
     *

     * The key name.
     *

     *
     * @return The key name.
     */

    public String getName() {
        return this.name;
    }

    /**
     *

     * The key name.
     *

     *
     * @param name
     *        The key name.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public Metadata withName(String name) {
        setName(name);
        return this;
    }

    /**
     *

     * The value.
     *

     *
     * @param value
     *        The value.
     */

    public void setValue(String value) {
        this.value = value;
    }

    /**
     *

     * The value.
     *

     *
     * @return The value.
     */

    public String getValue() {
        return this.value;
    }

    /**
     *

     * The value.
     *

     *
     * @param value
     *        The value.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public Metadata withValue(String value) {
        setValue(value);
        return this;
    }

    /**
     * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
     * redacted from this string using a placeholder value.
     *
     * @return A string representation of this object.
     *
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getName() != null)
            sb.append("Name: ").append(getName()).append(",");
        if (getValue() != null)
            sb.append("Value: ").append(getValue());
        sb.append("}");
        return sb.toString();
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;

        if (obj instanceof Metadata == false)
            return false;
        Metadata other = (Metadata) obj;
        if (other.getName() == null ^ this.getName() == null)
            return false;
        if (other.getName() != null && other.getName().equals(this.getName()) == false)
            return false;
        if (other.getValue() == null ^ this.getValue() == null)
            return false;
        if (other.getValue() != null && other.getValue().equals(this.getValue()) == false)
            return false;
        return true;
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;

        hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode());
        hashCode = prime * hashCode + ((getValue() == null) ? 0 : getValue().hashCode());
        return hashCode;
    }

    @Override
    public Metadata clone() {
        try {
            return (Metadata) super.clone();
        } catch (CloneNotSupportedException e) {
            throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
        }
    }

    @com.amazonaws.annotation.SdkInternalApi
    @Override
    public void marshall(ProtocolMarshaller protocolMarshaller) {
        com.amazonaws.services.licensemanager.model.transform.MetadataMarshaller.getInstance().marshall(this, protocolMarshaller);
    }
}


text:
package org.springframework.boot.actuate.autoconfigure;

import java.util.ArrayList;
import java.util.Collections;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;

import javax.annotation.PostConstruct;
import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.ObjectProvider;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.actuate.endpoint.Endpoint;
import org.springframework.boot.actuate.endpoint.mvc.EndpointHandlerMapping;
import org.springframework.boot.actuate.endpoint.mvc.MvcEndpoint;
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.boot.autoconfigure.AutoConfigureBefore;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionMessage;
import org.springframework.boot.autoconfigure.condition.ConditionOutcome;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
import org.springframework.boot.autoconfigure.condition.SpringBootCondition;
import org.springframework.boot.autoconfigure.security.AuthenticationManagerConfiguration;
import org.springframework.boot.autoconfigure.security.FallbackWebSecurityAutoConfiguration;
import org.springframework.boot.autoconfigure.security.SecurityAutoConfiguration;
import org.springframework.boot.autoconfigure.security.SecurityPrerequisite;
import org.springframework.boot.autoconfigure.security.SecurityProperties;
import org.springframework.boot.autoconfigure.security.SpringBootWebSecurityConfiguration;
import org.springframework.boot.autoconfigure.web.ErrorController;
import org.springframework.boot.autoconfigure.web.ServerProperties;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ConditionContext;
import org.springframework.context.annotation.Conditional;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.annotation.Order;
import org.springframework.core.type.AnnotatedTypeMetadata;
import org.springframework.security.config.annotation.web.WebSecurityConfigurer;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.builders.WebSecurity;
import org.springframework.security.config.annotation.web.builders.WebSecurity.IgnoredRequestConfigurer;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfiguration;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.config.annotation.web.configurers.ExpressionUrlAuthorizationConfigurer;
import org.springframework.security.config.http.SessionCreationPolicy;
import org.springframework.security.web.AuthenticationEntryPoint;
import org.springframework.security.web.authentication.www.BasicAuthenticationEntryPoint;
import org.springframework.security.web.util.matcher.AntPathRequestMatcher;
import org.springframework.security.web.util.matcher.AnyRequestMatcher;
import org.springframework.security.web.util.matcher.NegatedRequestMatcher;
import org.springframework.security.web.util.matcher.OrRequestMatcher;
import org.springframework.security.web.util.matcher.RequestMatcher;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;

/**
 * {@link EnableAutoConfiguration Auto-configuration} for security of framework endpoints.
 * Many aspects of the behavior can be controller with {@link ManagementServerProperties}
 * via externalized application properties (or via an bean definition of that type to set
 * the defaults).
 * <p>
 * The framework {@link Endpoint}s (used to expose application information to operations)
 * include a {@link Endpoint#isSensitive() sensitive} configuration option which will be
 * used as a security hint by the filter created here.
 *
 * @author Dave Syer
 * @author Andy Wilkinson
 */
@Configuration
@ConditionalOnWebApplication
@ConditionalOnClass({ EnableWebSecurity.class })
@AutoConfigureAfter(SecurityAutoConfiguration.class)
@AutoConfigureBefore(FallbackWebSecurityAutoConfiguration.class)
@EnableConfigurationProperties
public class ManagementWebSecurityAutoConfiguration {

	private static final String[] NO_PATHS = new String[0];

	private static final RequestMatcher MATCH_NONE = new NegatedRequestMatcher(
			AnyRequestMatcher.INSTANCE);

	@Bean
	@ConditionalOnMissingBean({ IgnoredPathsWebSecurityConfigurerAdapter.class })
	public IgnoredPathsWebSecurityConfigurerAdapter ignoredPathsWebSecurityConfigurerAdapter() {
		return new IgnoredPathsWebSecurityConfigurerAdapter();
	}

	@Configuration
	protected static class ManagementSecurityPropertiesConfiguration
			implements SecurityPrerequisite {

		private final SecurityProperties security;

		private final ManagementServerProperties management;

		public ManagementSecurityPropertiesConfiguration(
				ObjectProvider<SecurityProperties> securityProvider,
				ObjectProvider<ManagementServerProperties> managementProvider) {
			this.security = securityProvider.getIfAvailable();
			this.management = managementProvider.getIfAvailable();
		}

		@PostConstruct
		public void init() {
			if (this.management != null && this.security != null) {
				this.security.getUser().getRole()
						.addAll(this.management.getSecurity().getRoles());
			}
		}

	}

	// Get the ignored paths in early
	@Order(SecurityProperties.IGNORED_ORDER + 1)
	private static class IgnoredPathsWebSecurityConfigurerAdapter
			implements WebSecurityConfigurer<WebSecurity> {

		@Autowired(required = false)
		private ErrorController errorController;

		@Autowired
		private SecurityProperties security;

		@Autowired
		private ManagementServerProperties management;

		@Autowired(required = false)
		private ManagementContextResolver contextResolver;

		@Autowired(required = false)
		private ServerProperties server;

		@Override
		public void configure(WebSecurity builder) throws Exception {
		}

		@Override
		public void init(WebSecurity builder) throws Exception {
			if (this.server == null) {
				return;
			}
			IgnoredRequestConfigurer ignoring = builder.ignoring();
			// The ignores are not cumulative, so to prevent overwriting the defaults
			// we add them back.
			Set<String> ignored = new LinkedHashSet<String>(
					SpringBootWebSecurityConfiguration.getIgnored(this.security));
			if (ignored.contains("none")) {
				ignored.remove("none");
			}
			if (this.errorController != null) {
				ignored.add(normalizePath(this.errorController.getErrorPath()));
			}
			RequestMatcher requestMatcher = getRequestMatcher();
			String[] paths = this.server.getPathsArray(ignored);
			if (!ObjectUtils.isEmpty(paths)) {
				List<RequestMatcher> matchers = new ArrayList<RequestMatcher>();
				for (String pattern : paths) {
					matchers.add(new AntPathRequestMatcher(pattern, null));
				}
				if (requestMatcher != null) {
					matchers.add(requestMatcher);
				}
				requestMatcher = new OrRequestMatcher(matchers);
			}
			if (requestMatcher != null) {
				ignoring.requestMatchers(requestMatcher);
			}
		}

		private RequestMatcher getRequestMatcher() {
			if (this.management.getSecurity().isEnabled()) {
				return null;
			}
			return LazyEndpointPathRequestMatcher.getRequestMatcher(this.contextResolver);
		}

		private String normalizePath(String errorPath) {
			String result = StringUtils.cleanPath(errorPath);
			if (!result.startsWith("/")) {
				result = "/" + result;
			}
			return result;
		}

	}

	@Configuration
	@ConditionalOnMissingBean(WebSecurityConfiguration.class)
	@Conditional(WebSecurityEnablerCondition.class)
	@EnableWebSecurity
	protected static class WebSecurityEnabler extends AuthenticationManagerConfiguration {
	}

	/**
	 * WebSecurityEnabler condition.
	 */
	static class WebSecurityEnablerCondition extends SpringBootCondition {

		@Override
		public ConditionOutcome getMatchOutcome(ConditionContext context,
				AnnotatedTypeMetadata metadata) {
			String managementEnabled = context.getEnvironment()
					.getProperty("management.security.enabled", "true");
			String basicEnabled = context.getEnvironment()
					.getProperty("security.basic.enabled", "true");
			ConditionMessage.Builder message = ConditionMessage
					.forCondition("WebSecurityEnabled");
			if ("true".equalsIgnoreCase(managementEnabled)
					&& !"true".equalsIgnoreCase(basicEnabled)) {
				return ConditionOutcome.match(message.because("security enabled"));
			}
			return ConditionOutcome.noMatch(message.because("security disabled"));
		}

	}

	@Configuration
	@ConditionalOnMissingBean({ ManagementWebSecurityConfigurerAdapter.class })
	@ConditionalOnProperty(prefix = "management.security", name = "enabled", matchIfMissing = true)
	@Order(ManagementServerProperties.BASIC_AUTH_ORDER)
	protected static class ManagementWebSecurityConfigurerAdapter
			extends WebSecurityConfigurerAdapter {

		private final SecurityProperties security;

		private final ManagementServerProperties management;

		private final ManagementContextResolver contextResolver;

		public ManagementWebSecurityConfigurerAdapter(SecurityProperties security,
				ManagementServerProperties management,
				ObjectProvider<ManagementContextResolver> contextResolverProvider) {
			this.security = security;
			this.management = management;
			this.contextResolver = contextResolverProvider.getIfAvailable();
		}

		@Override
		protected void configure(HttpSecurity http) throws Exception {
			// secure endpoints
			RequestMatcher matcher = getRequestMatcher();
			if (matcher != null) {
				// Always protect them if present
				if (this.security.isRequireSsl()) {
					http.requiresChannel().anyRequest().requiresSecure();
				}
				AuthenticationEntryPoint entryPoint = entryPoint();
				http.exceptionHandling().authenticationEntryPoint(entryPoint);
				// Match all the requests for actuator endpoints ...
				http.requestMatcher(matcher);
				// ... but permitAll() for the non-sensitive ones
				configurePermittedRequests(http.authorizeRequests());
				http.httpBasic().authenticationEntryPoint(entryPoint);
				// No cookies for management endpoints by default
				http.csrf().disable();
				http.sessionManagement()
						.sessionCreationPolicy(asSpringSecuritySessionCreationPolicy(
								this.management.getSecurity().getSessions()));
				SpringBootWebSecurityConfiguration.configureHeaders(http.headers(),
						this.security.getHeaders());
			}
		}

		private SessionCreationPolicy asSpringSecuritySessionCreationPolicy(
				Enum<?> value) {
			if (value == null) {
				return SessionCreationPolicy.STATELESS;
			}
			return SessionCreationPolicy.valueOf(value.name());
		}

		private RequestMatcher getRequestMatcher() {
			if (this.management.getSecurity().isEnabled()) {
				return LazyEndpointPathRequestMatcher
						.getRequestMatcher(this.contextResolver);
			}
			return null;
		}

		private AuthenticationEntryPoint entryPoint() {
			BasicAuthenticationEntryPoint entryPoint = new BasicAuthenticationEntryPoint();
			entryPoint.setRealmName(this.security.getBasic().getRealm());
			return entryPoint;
		}

		private void configurePermittedRequests(
				ExpressionUrlAuthorizationConfigurer<HttpSecurity>.ExpressionInterceptUrlRegistry requests) {
			// Permit access to the non-sensitive endpoints
			requests.requestMatchers(new LazyEndpointPathRequestMatcher(
					this.contextResolver, EndpointPaths.NON_SENSITIVE)).permitAll();
			// Restrict the rest to the configured roles
			List<String> roles = this.management.getSecurity().getRoles();
			requests.anyRequest().hasAnyRole(roles.toArray(new String[roles.size()]));
		}

	}

	private enum EndpointPaths {

		ALL,

		NON_SENSITIVE {

			@Override
			protected boolean isIncluded(MvcEndpoint endpoint) {
				return !endpoint.isSensitive();
			}

		};

		public String[] getPaths(EndpointHandlerMapping endpointHandlerMapping) {
			if (endpointHandlerMapping == null) {
				return NO_PATHS;
			}
			Set<? extends MvcEndpoint> endpoints = endpointHandlerMapping.getEndpoints();
			Set<String> paths = new LinkedHashSet<String>(endpoints.size());
			for (MvcEndpoint endpoint : endpoints) {
				if (isIncluded(endpoint)) {
					String path = endpointHandlerMapping.getPath(endpoint.getPath());
					paths.add(path);
					if (!path.equals("")) {
						if (endpoint.isSensitive()) {
							// Ensure that nested paths are secured
							paths.add(path + "/**");
							// Add Spring MVC-generated additional paths
							paths.add(path + ".*");
						}
					}
					paths.add(path + "/");
				}
			}
			return paths.toArray(new String[paths.size()]);
		}

		protected boolean isIncluded(MvcEndpoint endpoint) {
			return true;
		}

	}

	private static class LazyEndpointPathRequestMatcher implements RequestMatcher {

		private final EndpointPaths endpointPaths;

		private final ManagementContextResolver contextResolver;

		private RequestMatcher delegate;

		public static RequestMatcher getRequestMatcher(
				ManagementContextResolver contextResolver) {
			if (contextResolver == null) {
				return null;
			}
			ManagementServerProperties management = contextResolver
					.getApplicationContext().getBean(ManagementServerProperties.class);
			ServerProperties server = contextResolver.getApplicationContext()
					.getBean(ServerProperties.class);
			String path = management.getContextPath();
			if (StringUtils.hasText(path)) {
				AntPathRequestMatcher matcher = new AntPathRequestMatcher(
						server.getPath(path) + "/**");
				return matcher;
			}
			// Match everything, including the sensitive and non-sensitive paths
			return new LazyEndpointPathRequestMatcher(contextResolver, EndpointPaths.ALL);
		}

		LazyEndpointPathRequestMatcher(ManagementContextResolver contextResolver,
				EndpointPaths endpointPaths) {
			this.contextResolver = contextResolver;
			this.endpointPaths = endpointPaths;
		}

		@Override
		public boolean matches(HttpServletRequest request) {
			if (this.delegate == null) {
				this.delegate = createDelegate();
			}
			return this.delegate.matches(request);
		}

		private RequestMatcher createDelegate() {
			ServerProperties server = this.contextResolver.getApplicationContext()
					.getBean(ServerProperties.class);
			List<RequestMatcher> matchers = new ArrayList<RequestMatcher>();
			EndpointHandlerMapping endpointHandlerMapping = getRequiredEndpointHandlerMapping();
			for (String path : this.endpointPaths.getPaths(endpointHandlerMapping)) {
				matchers.add(new AntPathRequestMatcher(server.getPath(path)));
			}
			return (matchers.isEmpty() ? MATCH_NONE : new OrRequestMatcher(matchers));
		}

		private EndpointHandlerMapping getRequiredEndpointHandlerMapping() {
			EndpointHandlerMapping endpointHandlerMapping = null;
			ApplicationContext context = this.contextResolver.getApplicationContext();
			if (context.getBeanNamesForType(EndpointHandlerMapping.class).length > 0) {
				endpointHandlerMapping = context.getBean(EndpointHandlerMapping.class);
			}
			if (endpointHandlerMapping == null) {
				// Maybe there are actually no endpoints (e.g. management.port=-1)
				endpointHandlerMapping = new EndpointHandlerMapping(
						Collections.<MvcEndpoint>emptySet());
			}
			return endpointHandlerMapping;
		}

	}

}


text:
<?php

namespace giicms\forum\models;

use Yii;
use yii\base\NotSupportedException;
use yii\behaviors\TimestampBehavior;
use yii\db\ActiveRecord;

/**
 * User model
 *
 * @property integer $id
 * @property string $username
 * @property string $password_hash
 * @property string $password_reset_token
 * @property string $email
 * @property string $auth_key
 * @property integer $status
 * @property integer $created_at
 * @property integer $updated_at
 * @property string $password write-only password
 */
class User extends ActiveRecord
{

    const STATUS_DELETED = 0;
    const STATUS_ACTIVE = 10;
    const ROLE_ADMIN = 'admin';
    const ROLE_MEMBER = 'member';
    const ROLE_USER = 'user';

    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'giicms_user';
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'username' => 'Tên đăng nhập',
            'firstname' => 'Họ',
            'lastname' => 'Tên',
            'email' => 'Email',
            'phone' => 'Điện thoại',
            'address' => 'Địa chỉ',
            'city' => 'Tỉnh/thành'
        ];
    }

}


text:
using System.Reflection;

namespace TestConsole.OutputFormatting.Internal
{
    internal class PropertyColumnFormat
    {
        public PropertyInfo Property { get; set; }
        public ColumnFormat Format { get; set; }

        internal PropertyColumnFormat(PropertyInfo property, ColumnFormat format)
        {
            Property = property;
            Format = format;
        }
    }
}


text:
WebGL-based viewer component for mddf
Only to be used in browser.

[Example usage](https://github.com/Deadarius/mddf-tester)

[Same thing on github page](http://deadarius.github.io/mddf-tester/)