text:
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
/* global AJAXBASE */

/**
 * Provides an in browser PDF editor.
 *
 * @module moodle-assignfeedback_editpdf-editor
 */

/**
 * Class representing a users list of quick comments.
 *
 * @namespace M.assignfeedback_editpdf
 * @class quickcommentlist
 */
var QUICKCOMMENTLIST = function(editor) {

    /**
     * Reference to M.assignfeedback_editpdf.editor.
     * @property editor
     * @type M.assignfeedback_editpdf.editor
     * @public
     */
    this.editor = editor;

    /**
     * Array of Comments
     * @property shapes
     * @type M.assignfeedback_editpdf.quickcomment[]
     * @public
     */
    this.comments = [];

    /**
     * Add a comment to the users quicklist.
     *
     * @protected
     * @method add
     */
    this.add = function(comment) {
        var ajaxurl = AJAXBASE,
            config;

        // Do not save empty comments.
        if (comment.rawtext === '') {
            return;
        }

        config = {
            method: 'post',
            context: this,
            sync: false,
            data: {
                'sesskey': M.cfg.sesskey,
                'action': 'addtoquicklist',
                'userid': this.editor.get('userid'),
                'commenttext': comment.rawtext,
                'width': comment.width,
                'colour': comment.colour,
                'attemptnumber': this.editor.get('attemptnumber'),
                'assignmentid': this.editor.get('assignmentid')
            },
            on: {
                success: function(tid, response) {
                    var jsondata, quickcomment;
                    try {
                        jsondata = Y.JSON.parse(response.responseText);
                        if (jsondata.error) {
                            return new M.core.ajaxException(jsondata);
                        } else {
                            quickcomment = new M.assignfeedback_editpdf.quickcomment(jsondata.id,
                                                                                jsondata.rawtext,
                                                                                jsondata.width,
                                                                                jsondata.colour);
                            this.comments.push(quickcomment);
                        }
                    } catch (e) {
                        return new M.core.exception(e);
                    }
                },
                failure: function(tid, response) {
                    return M.core.exception(response.responseText);
                }
            }
        };

        Y.io(ajaxurl, config);
    };

    /**
     * Remove a comment from the users quicklist.
     *
     * @public
     * @method remove
     */
    this.remove = function(comment) {
        var ajaxurl = AJAXBASE,
            config;

        // Should not happen.
        if (!comment) {
            return;
        }

        config = {
            method: 'post',
            context: this,
            sync: false,
            data: {
                'sesskey': M.cfg.sesskey,
                'action': 'removefromquicklist',
                'userid': this.editor.get('userid'),
                'commentid': comment.id,
                'attemptnumber': this.editor.get('attemptnumber'),
                'assignmentid': this.editor.get('assignmentid')
            },
            on: {
                success: function() {
                    var i;

                    // Find and remove the comment from the quicklist.
                    i = this.comments.indexOf(comment);
                    if (i >= 0) {
                        this.comments.splice(i, 1);
                    }
                },
                failure: function(tid, response) {
                    return M.core.exception(response.responseText);
                }
            }
        };

        Y.io(ajaxurl, config);
    };

    /**
     * Load the users quick comments list.
     *
     * @protected
     * @method load_quicklist
     */
    this.load = function() {
        var ajaxurl = AJAXBASE,
            config;

        config = {
            method: 'get',
            context: this,
            sync: false,
            data: {
                'sesskey': M.cfg.sesskey,
                'action': 'loadquicklist',
                'userid': this.editor.get('userid'),
                'attemptnumber': this.editor.get('attemptnumber'),
                'assignmentid': this.editor.get('assignmentid')
            },
            on: {
                success: function(tid, response) {
                    var jsondata;
                    try {
                        jsondata = Y.JSON.parse(response.responseText);
                        if (jsondata.error) {
                            return new M.core.ajaxException(jsondata);
                        } else {
                            Y.each(jsondata, function(comment) {
                                var quickcomment = new M.assignfeedback_editpdf.quickcomment(comment.id,
                                                                                comment.rawtext,
                                                                                comment.width,
                                                                                comment.colour);
                                this.comments.push(quickcomment);
                            }, this);
                        }
                    } catch (e) {
                        return new M.core.exception(e);
                    }
                },
                failure: function(tid, response) {
                    return M.core.exception(response.responseText);
                }
            }
        };

        Y.io(ajaxurl, config);
    };
};

M.assignfeedback_editpdf = M.assignfeedback_editpdf || {};
M.assignfeedback_editpdf.quickcommentlist = QUICKCOMMENTLIST;


text:
/*foreach($individu->getLogement()->getAdresse()->getRue()->getTroncons() as $unTroncon)
            {
                echo true;
            }*/

            //On vérifie que l'adresse lié au troncon dans le résultat de la requête est permise au sein de ce dernier
            if(isset($this->secteurs) && count($this->secteurs) > 0)
            {

                 echo 'Taille début du tableau avant suppression : ' . count($arrayResults);
                 echo 'Nombre de troncon en tableau' . $nbTroncon . '
';
                 echo 'Nombre de troncons en objet ' . $nbTronconObj . '
';

                 for($i = 0;$i < count($arrayResults);$i++)
                 {
                     //Initialisation : il est censé être deans le secteur à la base
                    $presentDansSecteur = true;

                    //On récupère le numéro de la rue
                    $numeroRue = $arrayResults[$i]['Famille']['Logement']['Adresse']['numeroRue'];

                    //On parcours tout les troncons pour cette adresse dans la rue dans laquelle elle se situe (une adresse n'a qu'une rue)
                    for($j = 0;$j < $nbTroncon;$j++)
                    {
                        $minImp = $arrayResults[$i]['Famille']['Logement']['Adresse']['Rue']['Troncons'][$j]['numDebutImpair'];
                        $maxImp = $arrayResults[$i]['Famille']['Logement']['Adresse']['Rue']['Troncons'][$j]['numFinImpair'];
                        $minPair = $arrayResults[$i]['Famille']['Logement']['Adresse']['Rue']['Troncons'][$j]['numDebutPair'];
                        $maxPair = $arrayResults[$i]['Famille']['Logement']['Adresse']['Rue']['Troncons'][$j]['numFinPair'];

                        //On vérifie si l'adresse est dans l'intervalle
                        if(Troncon::getAdresseDisponible($numeroRue, $minImp, $maxImp, $minPair, $maxPair))
                        {
                            //Si c'est la cas on garde
                            echo "Ce troncon est dans les clou !
";
                            $presentDansSecteur = true;
                        }
                        else
                        {
                            //Isnon on la vire...mais elle peut repasser à true si dans un autre troncons elle est présente
                            echo "Ce troncon n'est pas dans les clou !
";
                            echo '
';
                            print_r($arrayResults[$i]);
                            echo '
';
                            $presentDansSecteur = false;
                        }
                    }

                    //S'il n'a rien à faire là on supprime ce dernier du tableau
                    if($presentDansSecteur == false)
                    {
                        unset($arrayResults[$i]);
                    }

                 }

                 echo 'Taille final du tableau après suppression : ' . count($arrayResults);
            }

redpajama_set_name: RedPajamaGithub


text:
@if($closed==true)

             Komentarze pod tym wpisem zostały wyłączone...

@endif()


text:
#include "ElftosbAST.h"
#include <stdexcept>
#include <math.h>
#include <assert.h>
#include "ElftosbErrors.h"
#include "format_string.h"

using namespace elftosb;

#pragma mark = ASTNode =

void ASTNode::printTree(int indent) const
{
	printIndent(indent);
	printf("%s\n", nodeName().c_str());
}

void ASTNode::printIndent(int indent) const
{
	int i;
	for (i=0; i<indent; ++i)
	{
		printf("   ");
	}
}

void ASTNode::setLocation(token_loc_t & first, token_loc_t & last)
{
	m_location.m_firstLine = first.m_firstLine;
	m_location.m_lastLine = last.m_lastLine;
}

void ASTNode::setLocation(ASTNode * first, ASTNode * last)
{
	m_location.m_firstLine = first->getLocation().m_firstLine;
	m_location.m_lastLine = last->getLocation().m_lastLine;
}

#pragma mark = ListASTNode =

ListASTNode::ListASTNode(const ListASTNode & other)
:	ASTNode(other), m_list()
{
	// deep copy each item of the original's list
	const_iterator it = other.begin();
	for (; it != other.end(); ++it)
	{
		m_list.push_back((*it)->clone());
	}
}

//! Deletes child node in the list.
//!
ListASTNode::~ListASTNode()
{
	iterator it = begin();
	for (; it != end(); it++)
	{
		delete *it;
	}
}

//! If \a node is NULL then the list is left unmodified.
//!
//! The list node's location is automatically updated after the node is added by a call
//! to updateLocation().
void ListASTNode::appendNode(ASTNode * node)
{
	if (node)
	{
		m_list.push_back(node);
		updateLocation();
	}
}

void ListASTNode::printTree(int indent) const
{
	ASTNode::printTree(indent);

	int n = 0;
	const_iterator it = begin();
	for (; it != end(); it++, n++)
	{
		printIndent(indent + 1);
		printf("%d:\n", n);
		(*it)->printTree(indent + 2);
	}
}

void ListASTNode::updateLocation()
{
	token_loc_t current = { 0 };
	const_iterator it = begin();
	for (; it != end(); it++)
	{
		const ASTNode * node = *it;
		const token_loc_t & loc = node->getLocation();

		// handle first node
		if (current.m_firstLine == 0)
		{
			current = loc;
			continue;
		}

		if (loc.m_firstLine < current.m_firstLine)
		{
			current.m_firstLine = loc.m_firstLine;
		}

		if (loc.m_lastLine > current.m_lastLine)
		{
			current.m_lastLine = loc.m_lastLine;
		}
	}

	setLocation(current);
}

#pragma mark = CommandFileASTNode =

CommandFileASTNode::CommandFileASTNode()
:	ASTNode(), m_options(), m_constants(), m_sources(), m_sections()
{
}

CommandFileASTNode::CommandFileASTNode(const CommandFileASTNode & other)
:	ASTNode(other), m_options(), m_constants(), m_sources(), m_sections()
{
	m_options = dynamic_cast<ListASTNode*>(other.m_options->clone());
	m_constants = dynamic_cast<ListASTNode*>(other.m_constants->clone());
	m_sources = dynamic_cast<ListASTNode*>(other.m_sources->clone());
	m_sections = dynamic_cast<ListASTNode*>(other.m_sections->clone());
}

void CommandFileASTNode::printTree(int indent) const
{
	ASTNode::printTree(indent);

	printIndent(indent + 1);
	printf("options:\n");
	if (m_options) m_options->printTree(indent + 2);

	printIndent(indent + 1);
	printf("constants:\n");
	if (m_constants) m_constants->printTree(indent + 2);

	printIndent(indent + 1);
	printf("sources:\n");
	if (m_sources) m_sources->printTree(indent + 2);

	printIndent(indent + 1);
	printf("sections:\n");
	if (m_sections) m_sections->printTree(indent + 2);
}

#pragma mark = ExprASTNode =

int_size_t ExprASTNode::resultIntSize(int_size_t a, int_size_t b)
{
	int_size_t result;
	switch (a)
	{
		case kWordSize:
			result = kWordSize;
			break;
		case kHalfWordSize:
			if (b == kWordSize)
			{
				result = kWordSize;
			}
			else
			{
				result = kHalfWordSize;
			}
			break;
		case kByteSize:
			if (b == kWordSize)
			{
				result = kWordSize;
			}
			else if (b == kHalfWordSize)
			{
				result = kHalfWordSize;
			}
			else
			{
				result = kByteSize;
			}
			break;
	}

	return result;
}

#pragma mark = IntConstExprASTNode =

IntConstExprASTNode::IntConstExprASTNode(const IntConstExprASTNode & other)
:	ExprASTNode(other), m_value(other.m_value), m_size(other.m_size)
{
}

void IntConstExprASTNode::printTree(int indent) const
{
	printIndent(indent);
	char sizeChar='?';
	switch (m_size)
	{
		case kWordSize:
			sizeChar = 'w';
			break;
		case kHalfWordSize:
			sizeChar = 'h';
			break;
		case kByteSize:
			sizeChar = 'b';
			break;
	}
	printf("%s(%d:%c)\n", nodeName().c_str(), m_value, sizeChar);
}

#pragma mark = VariableExprASTNode =

VariableExprASTNode::VariableExprASTNode(const VariableExprASTNode & other)
:	ExprASTNode(other), m_variable()
{
	m_variable = new std::string(*other.m_variable);
}

void VariableExprASTNode::printTree(int indent) const
{
	printIndent(indent);
	printf("%s(%s)\n", nodeName().c_str(), m_variable->c_str());
}

ExprASTNode * VariableExprASTNode::reduce(EvalContext & context)
{
	if (!context.isVariableDefined(*m_variable))
	{
		throw std::runtime_error(format_string("line %d: undefined variable '%s'", getFirstLine(), m_variable->c_str()));
	}

	uint32_t value = context.getVariableValue(*m_variable);
	int_size_t size = context.getVariableSize(*m_variable);
	return new IntConstExprASTNode(value, size);
}

#pragma mark = SymbolRefExprASTNode =

SymbolRefExprASTNode::SymbolRefExprASTNode(const SymbolRefExprASTNode & other)
:	ExprASTNode(other), m_symbol(NULL)
{
	if (other.m_symbol)
	{
		m_symbol = dynamic_cast<SymbolASTNode*>(other.m_symbol->clone());
	}
}

void SymbolRefExprASTNode::printTree(int indent) const
{
}

ExprASTNode * SymbolRefExprASTNode::reduce(EvalContext & context)
{
	EvalContext::SourceFileManager * manager = context.getSourceFileManager();
	if (!manager)
	{
		throw std::runtime_error("no source manager available");
	}

	if (!m_symbol)
	{
		throw semantic_error("no symbol provided");
	}

	// Get the name of the symbol
	std::string * symbolName = m_symbol->getSymbolName();
//	if (!symbolName)
//	{
//		throw semantic_error(format_string("line %d: no symbol name provided", getFirstLine()));
//	}

	// Get the source file.
	std::string * sourceName = m_symbol->getSource();
	SourceFile * sourceFile;

	if (sourceName)
	{
		sourceFile = manager->getSourceFile(*sourceName);
		if (!sourceFile)
		{
			throw semantic_error(format_string("line %d: no source file named %s", getFirstLine(), sourceName->c_str()));
		}
	}
	else
	{
		sourceFile = manager->getDefaultSourceFile();
		if (!sourceFile)
		{
			throw semantic_error(format_string("line %d: no default source file is set", getFirstLine()));
		}
	}

	// open the file if it hasn't already been
	if (!sourceFile->isOpen())
	{
		sourceFile->open();
	}

	// Make sure the source file supports symbols before going any further
	if (symbolName && !sourceFile->supportsNamedSymbols())
	{
		throw semantic_error(format_string("line %d: source file %s does not support symbols", getFirstLine(), sourceFile->getPath().c_str()));
	}

    if (!symbolName && !sourceFile->hasEntryPoint())
    {
        throw semantic_error(format_string("line %d: source file %s does not have an entry point", getFirstLine(), sourceFile->getPath().c_str()));
    }

	// Returns a const expr node with the symbol's value.
	uint32_t value;
    if (symbolName)
    {
        value = sourceFile->getSymbolValue(*symbolName);
    }
    else
    {
        value = sourceFile->getEntryPointAddress();
    }
	return new IntConstExprASTNode(value);
}

#pragma mark = NegativeExprASTNode =

NegativeExprASTNode::NegativeExprASTNode(const NegativeExprASTNode & other)
:	ExprASTNode(other), m_expr()
{
	m_expr = dynamic_cast<ExprASTNode*>(other.m_expr->clone());
}

void NegativeExprASTNode::printTree(int indent) const
{
	ExprASTNode::printTree(indent);
	if (m_expr) m_expr->printTree(indent + 1);
}

ExprASTNode * NegativeExprASTNode::reduce(EvalContext & context)
{
	if (!m_expr)
	{
		return this;
	}

	m_expr = m_expr->reduce(context);
	IntConstExprASTNode * intConst = dynamic_cast<IntConstExprASTNode*>(m_expr.get());
	if (intConst)
	{
	    int32_t value = -(int32_t)intConst->getValue();
		return new IntConstExprASTNode((uint32_t)value, intConst->getSize());
	}
	else
	{
		return this;
	}
}

#pragma mark = BooleanNotExprASTNode =

BooleanNotExprASTNode::BooleanNotExprASTNode(const BooleanNotExprASTNode & other)
:	ExprASTNode(other), m_expr()
{
	m_expr = dynamic_cast<ExprASTNode*>(other.m_expr->clone());
}

void BooleanNotExprASTNode::printTree(int indent) const
{
	ExprASTNode::printTree(indent);
	if (m_expr) m_expr->printTree(indent + 1);
}

ExprASTNode * BooleanNotExprASTNode::reduce(EvalContext & context)
{
	if (!m_expr)
	{
		return this;
	}

	m_expr = m_expr->reduce(context);
	IntConstExprASTNode * intConst = dynamic_cast<IntConstExprASTNode*>(m_expr.get());
	if (intConst)
	{
	    int32_t value = !((int32_t)intConst->getValue());
		return new IntConstExprASTNode((uint32_t)value, intConst->getSize());
	}
	else
	{
		throw semantic_error(format_string("line %d: expression did not evaluate to an integer", m_expr->getFirstLine()));
	}
}

#pragma mark = SourceFileFunctionASTNode =

SourceFileFunctionASTNode::SourceFileFunctionASTNode(const SourceFileFunctionASTNode & other)
:	ExprASTNode(other), m_functionName(), m_sourceFile()
{
	m_functionName = new std::string(*other.m_functionName);
	m_sourceFile = new std::string(*other.m_sourceFile);
}

void SourceFileFunctionASTNode::printTree(int indent) const
{
	ExprASTNode::printTree(indent);
	printIndent(indent+1);

	// for some stupid reason the msft C++ compiler barfs on the following line if the ".get()" parts are remove,
	// even though the first line of reduce() below has the same expression, just in parentheses. stupid compiler.
	if (m_functionName.get() && m_sourceFile.get())
	{
		printf("%s ( %s )\n", m_functionName->c_str(), m_sourceFile->c_str());
	}
}

ExprASTNode * SourceFileFunctionASTNode::reduce(EvalContext & context)
{
	if (!(m_functionName && m_sourceFile))
	{
		throw std::runtime_error("unset function name or source file");
	}

	// Get source file manager from evaluation context. This will be the
	// conversion controller itself.
	EvalContext::SourceFileManager * mgr = context.getSourceFileManager();
	if (!mgr)
	{
		throw std::runtime_error("source file manager is not set");
	}

	// Perform function
	uint32_t functionResult = 0;
	if (*m_functionName == "exists")
	{
		functionResult = static_cast<uint32_t>(mgr->hasSourceFile(*m_sourceFile));
	}

	// Return function result as an expression node
	return new IntConstExprASTNode(functionResult);
}

#pragma mark = DefinedOperatorASTNode =

DefinedOperatorASTNode::DefinedOperatorASTNode(const DefinedOperatorASTNode & other)
:	ExprASTNode(other), m_constantName()
{
	m_constantName = new std::string(*other.m_constantName);
}

void DefinedOperatorASTNode::printTree(int indent) const
{
	ExprASTNode::printTree(indent);
	printIndent(indent+1);

	if (m_constantName)
	{
		printf("defined ( %s )\n", m_constantName->c_str());
	}
}

ExprASTNode * DefinedOperatorASTNode::reduce(EvalContext & context)
{
	assert(m_constantName);

	// Return function result as an expression node
	return new IntConstExprASTNode(context.isVariableDefined(m_constantName) ? 1 : 0);
}

#pragma mark = SizeofOperatorASTNode =

SizeofOperatorASTNode::SizeofOperatorASTNode(const SizeofOperatorASTNode & other)
:	ExprASTNode(other), m_constantName(), m_symbol()
{
	m_constantName = new std::string(*other.m_constantName);
	m_symbol = dynamic_cast<SymbolASTNode*>(other.m_symbol->clone());
}

void SizeofOperatorASTNode::printTree(int indent) const
{
	ExprASTNode::printTree(indent);

	printIndent(indent+1);

	if (m_constantName)
	{
		printf("sizeof: %s\n", m_constantName->c_str());
	}
	else if (m_symbol)
	{
		printf("sizeof:\n");
		m_symbol->printTree(indent + 2);
	}
}

ExprASTNode * SizeofOperatorASTNode::reduce(EvalContext & context)
{
	// One or the other must be defined.
	assert(m_constantName || m_symbol);

	EvalContext::SourceFileManager * manager = context.getSourceFileManager();
	assert(manager);

	unsigned sizeInBytes = 0;
	SourceFile * sourceFile;

	if (m_symbol)
	{
		// Get the symbol name.
		std::string * symbolName = m_symbol->getSymbolName();
		assert(symbolName);

		// Get the source file, using the default if one is not specified.
		std::string * sourceName = m_symbol->getSource();
		if (sourceName)
		{
			sourceFile = manager->getSourceFile(*sourceName);
			if (!sourceFile)
			{
				throw semantic_error(format_string("line %d: invalid source file: %s", getFirstLine(), sourceName->c_str()));
			}
		}
		else
		{
			sourceFile = manager->getDefaultSourceFile();
			if (!sourceFile)
			{
				throw semantic_error(format_string("line %d: no default source file is set", getFirstLine()));
			}
		}

		// Get the size of the symbol.
		if (sourceFile->hasSymbol(*symbolName))
		{
			sizeInBytes = sourceFile->getSymbolSize(*symbolName);
		}
	}
	else if (m_constantName)
	{
		// See if the "constant" is really a constant or if it's a source name.
		if (manager->hasSourceFile(m_constantName))
		{
			sourceFile = manager->getSourceFile(m_constantName);
			if (sourceFile)
			{
				sizeInBytes = sourceFile->getSize();
			}
		}
		else
		{
			// Regular constant.
			if (!context.isVariableDefined(*m_constantName))
			{
				throw semantic_error(format_string("line %d: cannot get size of undefined constant %s", getFirstLine(), m_constantName->c_str()));
			}

			int_size_t intSize = context.getVariableSize(*m_constantName);
			switch (intSize)
			{
				case kWordSize:
					sizeInBytes = sizeof(uint32_t);
					break;
				case kHalfWordSize:
					sizeInBytes = sizeof(uint16_t);
					break;
				case kByteSize:
					sizeInBytes = sizeof(uint8_t);
					break;
			}
		}
	}

	// Return function result as an expression node
	return new IntConstExprASTNode(sizeInBytes);
}

#pragma mark = BinaryOpExprASTNode =

BinaryOpExprASTNode::BinaryOpExprASTNode(const BinaryOpExprASTNode & other)
:	ExprASTNode(other), m_left(), m_op(other.m_op), m_right()
{
	m_left = dynamic_cast<ExprASTNode*>(other.m_left->clone());
	m_right = dynamic_cast<ExprASTNode*>(other.m_right->clone());
}

void BinaryOpExprASTNode::printTree(int indent) const
{
	ExprASTNode::printTree(indent);

	printIndent(indent + 1);
	printf("left:\n");
	if (m_left) m_left->printTree(indent + 2);

	printIndent(indent + 1);
	printf("op: %s\n", getOperatorName().c_str());

	printIndent(indent + 1);
	printf("right:\n");
	if (m_right) m_right->printTree(indent + 2);
}

std::string BinaryOpExprASTNode::getOperatorName() const
{
	switch (m_op)
	{
		case kAdd:
			return "+";
		case kSubtract:
			return "-";
		case kMultiply:
			return "*";
		case kDivide:
			return "/";
		case kModulus:
			return "%";
		case kPower:
			return "**";
		case kBitwiseAnd:
			return "&";
		case kBitwiseOr:
			return "|";
		case kBitwiseXor:
			return "^";
		case kShiftLeft:
			return "<<";
		case kShiftRight:
			return ">>";
		case kLessThan:
			return "<";
		case kGreaterThan:
			return ">";
		case kLessThanEqual:
			return "<=";
		case kGreaterThanEqual:
			return ">";
		case kEqual:
			return "==";
		case kNotEqual:
			return "!=";
		case kBooleanAnd:
			return "&&";
		case kBooleanOr:
			return "||";
	}

	return "???";
}

//! \todo Fix power operator under windows!!!
//!
ExprASTNode * BinaryOpExprASTNode::reduce(EvalContext & context)
{
	if (!m_left || !m_right)
	{
		return this;
	}

	IntConstExprASTNode * leftIntConst = NULL;
	IntConstExprASTNode * rightIntConst = NULL;
	uint32_t leftValue;
	uint32_t rightValue;
	uint32_t result = 0;

	// Always reduce the left hand side.
	m_left = m_left->reduce(context);
	leftIntConst = dynamic_cast<IntConstExprASTNode*>(m_left.get());
	if (!leftIntConst)
	{
		throw semantic_error(format_string("left hand side of %s operator failed to evaluate to an integer", getOperatorName().c_str()));
	}
	leftValue = leftIntConst->getValue();

	// Boolean && and || operators are handled separately so that we can perform
	// short-circuit evaluation.
	if (m_op == kBooleanAnd || m_op == kBooleanOr)
	{
		// Reduce right hand side only if required to evaluate the boolean operator.
		if ((m_op == kBooleanAnd && leftValue != 0) || (m_op == kBooleanOr && leftValue == 0))
		{
			m_right = m_right->reduce(context);
			rightIntConst = dynamic_cast<IntConstExprASTNode*>(m_right.get());
			if (!rightIntConst)
			{
				throw semantic_error(format_string("right hand side of %s operator failed to evaluate to an integer", getOperatorName().c_str()));
			}
			rightValue = rightIntConst->getValue();

			// Perform the boolean operation.
			switch (m_op)
			{
				case kBooleanAnd:
					result = leftValue && rightValue;
					break;

				case kBooleanOr:
					result = leftValue && rightValue;
					break;
			}
		}
		else if (m_op == kBooleanAnd)
		{
			// The left hand side is false, so the && operator's result must be false
			// without regard to the right hand side.
			result = 0;
		}
		else if (m_op == kBooleanOr)
		{
			// The left hand value is true so the || result is automatically true.
			result = 1;
		}
	}
	else
	{
		// Reduce right hand side always for most operators.
		m_right = m_right->reduce(context);
		rightIntConst = dynamic_cast<IntConstExprASTNode*>(m_right.get());
		if (!rightIntConst)
		{
			throw semantic_error(format_string("right hand side of %s operator failed to evaluate to an integer", getOperatorName().c_str()));
		}
		rightValue = rightIntConst->getValue();

		switch (m_op)
		{
			case kAdd:
				result = leftValue + rightValue;
				break;
			case kSubtract:
				result = leftValue - rightValue;
				break;
			case kMultiply:
				result = leftValue * rightValue;
				break;
			case kDivide:
				result = leftValue / rightValue;
				break;
			case kModulus:
				result = leftValue % rightValue;
				break;
			case kPower:
			#ifdef WIN32
				result = 0;
			#else
				result = lroundf(powf(float(leftValue), float(rightValue)));
			#endif
				break;
			case kBitwiseAnd:
				result = leftValue & rightValue;
				break;
			case kBitwiseOr:
				result = leftValue | rightValue;
				break;
			case kBitwiseXor:
				result = leftValue ^ rightValue;
				break;
			case kShiftLeft:
				result = leftValue << rightValue;
				break;
			case kShiftRight:
				result = leftValue >> rightValue;
				break;
			case kLessThan:
				result = leftValue < rightValue;
				break;
			case kGreaterThan:
				result = leftValue > rightValue;
				break;
			case kLessThanEqual:
				result = leftValue <= rightValue;
				break;
			case kGreaterThanEqual:
				result = leftValue >= rightValue;
				break;
			case kEqual:
				result = leftValue == rightValue;
				break;
			case kNotEqual:
				result = leftValue != rightValue;
				break;
		}
	}

	// Create the result value.
	int_size_t resultSize;
	if (leftIntConst && rightIntConst)
	{
		resultSize = resultIntSize(leftIntConst->getSize(), rightIntConst->getSize());
	}
	else if (leftIntConst)
	{
		resultSize = leftIntConst->getSize();
	}
	else
	{
		// This shouldn't really be possible, but just in case.
		resultSize = kWordSize;
	}
	return new IntConstExprASTNode(result, resultSize);
}

#pragma mark = IntSizeExprASTNode =

IntSizeExprASTNode::IntSizeExprASTNode(const IntSizeExprASTNode & other)
:	ExprASTNode(other), m_expr(), m_size(other.m_size)
{
	m_expr = dynamic_cast<ExprASTNode*>(other.m_expr->clone());
}

void IntSizeExprASTNode::printTree(int indent) const
{
	ExprASTNode::printTree(indent);

	char sizeChar='?';
	switch (m_size)
	{
		case kWordSize:
			sizeChar = 'w';
			break;
		case kHalfWordSize:
			sizeChar = 'h';
			break;
		case kByteSize:
			sizeChar = 'b';
			break;
	}
	printIndent(indent + 1);
	printf("size: %c\n", sizeChar);

	printIndent(indent + 1);
	printf("expr:\n");
	if (m_expr) m_expr->printTree(indent + 2);
}

ExprASTNode * IntSizeExprASTNode::reduce(EvalContext & context)
{
	if (!m_expr)
	{
		return this;
	}

	m_expr = m_expr->reduce(context);
	IntConstExprASTNode * intConst = dynamic_cast<IntConstExprASTNode*>(m_expr.get());
	if (!intConst)
	{
		return this;
	}

	return new IntConstExprASTNode(intConst->getValue(), m_size);
}

#pragma mark = ExprConstASTNode =

ExprConstASTNode::ExprConstASTNode(const ExprConstASTNode & other)
:	ConstASTNode(other), m_expr()
{
	m_expr = dynamic_cast<ExprASTNode*>(other.m_expr->clone());
}

void ExprConstASTNode::printTree(int indent) const
{
	ConstASTNode::printTree(indent);
	if (m_expr) m_expr->printTree(indent + 1);
}

#pragma mark = StringConstASTNode =

StringConstASTNode::StringConstASTNode(const StringConstASTNode & other)
:	ConstASTNode(other), m_value()
{
	m_value = new std::string(other.m_value);
}

void StringConstASTNode::printTree(int indent) const
{
	printIndent(indent);
	printf("%s(%s)\n", nodeName().c_str(), m_value->c_str());
}

#pragma mark = BlobConstASTNode =

BlobConstASTNode::BlobConstASTNode(const BlobConstASTNode & other)
:	ConstASTNode(other), m_blob()
{
	m_blob = new Blob(*other.m_blob);
}

void BlobConstASTNode::printTree(int indent) const
{
	printIndent(indent);

	const uint8_t * dataPtr = m_blob->getData();
	unsigned dataLen = m_blob->getLength();
	printf("%s(%p:%d)\n", nodeName().c_str(), dataPtr, dataLen);
}

#pragma mark = IVTConstASTNode =

IVTConstASTNode::IVTConstASTNode(const IVTConstASTNode & other)
:	ConstASTNode(other), m_fields()
{
	m_fields = dynamic_cast<ListASTNode*>(other.m_fields->clone());
}

void IVTConstASTNode::printTree(int indent) const
{
	printIndent(indent);
	printf("%s:\n", nodeName().c_str());
    if (m_fields)
    {
        m_fields->printTree(indent + 1);
    }
}

#pragma mark = AssignmentASTNode =

AssignmentASTNode::AssignmentASTNode(const AssignmentASTNode & other)
:	ASTNode(other), m_ident(), m_value()
{
	m_ident = new std::string(*other.m_ident);
	m_value = dynamic_cast<ConstASTNode*>(other.m_value->clone());
}

void AssignmentASTNode::printTree(int indent) const
{
	printIndent(indent);
	printf("%s(%s)\n", nodeName().c_str(), m_ident->c_str());

	if (m_value) m_value->printTree(indent + 1);
}

#pragma mark = SourceDefASTNode =

SourceDefASTNode::SourceDefASTNode(const SourceDefASTNode & other)
:	ASTNode(other), m_name()
{
	m_name = new std::string(*other.m_name);
}

#pragma mark = PathSourceDefASTNode =

PathSourceDefASTNode::PathSourceDefASTNode(const PathSourceDefASTNode & other)
:	SourceDefASTNode(other), m_path()
{
	m_path = new std::string(*other.m_path);
}

void PathSourceDefASTNode::printTree(int indent) const
{
	SourceDefASTNode::printTree(indent);

	printIndent(indent+1);
	printf("path: %s\n", m_path->c_str());

	printIndent(indent+1);
	printf("attributes:\n");
	if (m_attributes)
	{
		m_attributes->printTree(indent+2);
	}
}

#pragma mark = ExternSourceDefASTNode =

ExternSourceDefASTNode::ExternSourceDefASTNode(const ExternSourceDefASTNode & other)
:	SourceDefASTNode(other), m_expr()
{
	m_expr = dynamic_cast<ExprASTNode*>(other.m_expr->clone());
}

void ExternSourceDefASTNode::printTree(int indent) const
{
	SourceDefASTNode::printTree(indent);

	printIndent(indent+1);
	printf("expr:\n");
	if (m_expr) m_expr->printTree(indent + 2);

	printIndent(indent+1);
	printf("attributes:\n");
	if (m_attributes)
	{
		m_attributes->printTree(indent+2);
	}
}

#pragma mark = SectionContentsASTNode =

SectionContentsASTNode::SectionContentsASTNode(const SectionContentsASTNode & other)
:	ASTNode(other), m_sectionExpr()
{
	m_sectionExpr = dynamic_cast<ExprASTNode*>(other.m_sectionExpr->clone());
}

void SectionContentsASTNode::printTree(int indent) const
{
	ASTNode::printTree(indent);

	printIndent(indent + 1);
	printf("section#:\n");
	if (m_sectionExpr) m_sectionExpr->printTree(indent + 2);
}

#pragma mark = DataSectionContentsASTNode =

DataSectionContentsASTNode::DataSectionContentsASTNode(const DataSectionContentsASTNode & other)
:	SectionContentsASTNode(other), m_contents()
{
	m_contents = dynamic_cast<ASTNode*>(other.m_contents->clone());
}

void DataSectionContentsASTNode::printTree(int indent) const
{
	SectionContentsASTNode::printTree(indent);

	if (m_contents)
	{
		m_contents->printTree(indent + 1);
	}
}

#pragma mark = BootableSectionContentsASTNode =

BootableSectionContentsASTNode::BootableSectionContentsASTNode(const BootableSectionContentsASTNode & other)
:	SectionContentsASTNode(other), m_statements()
{
	m_statements = dynamic_cast<ListASTNode*>(other.m_statements->clone());
}

void BootableSectionContentsASTNode::printTree(int indent) const
{
	SectionContentsASTNode::printTree(indent);

	printIndent(indent + 1);
	printf("statements:\n");
	if (m_statements) m_statements->printTree(indent + 2);
}

#pragma mark = IfStatementASTNode =

//! \warning Be careful; this method could enter an infinite loop if m_nextIf feeds
//!		back onto itself. m_nextIf must be NULL at some point down the next if list.
IfStatementASTNode::IfStatementASTNode(const IfStatementASTNode & other)
:	StatementASTNode(),
	m_conditionExpr(),
	m_ifStatements(),
	m_nextIf(),
	m_elseStatements()
{
	m_conditionExpr = dynamic_cast<ExprASTNode*>(other.m_conditionExpr->clone());
	m_ifStatements = dynamic_cast<ListASTNode*>(other.m_ifStatements->clone());
	m_nextIf = dynamic_cast<IfStatementASTNode*>(other.m_nextIf->clone());
	m_elseStatements = dynamic_cast<ListASTNode*>(other.m_elseStatements->clone());
}

#pragma mark = ModeStatementASTNode =

ModeStatementASTNode::ModeStatementASTNode(const ModeStatementASTNode & other)
:	StatementASTNode(other), m_modeExpr()
{
	m_modeExpr = dynamic_cast<ExprASTNode*>(other.m_modeExpr->clone());
}

void ModeStatementASTNode::printTree(int indent) const
{
	StatementASTNode::printTree(indent);
	printIndent(indent + 1);
	printf("mode:\n");
	if (m_modeExpr) m_modeExpr->printTree(indent + 2);
}

#pragma mark = MessageStatementASTNode =

MessageStatementASTNode::MessageStatementASTNode(const MessageStatementASTNode & other)
:	StatementASTNode(other), m_type(other.m_type), m_message()
{
	m_message = new std::string(*other.m_message);
}

void MessageStatementASTNode::printTree(int indent) const
{
	StatementASTNode::printTree(indent);
	printIndent(indent + 1);
	printf("%s: %s\n", getTypeName(), m_message->c_str());
}

const char * MessageStatementASTNode::getTypeName() const
{
	switch (m_type)
	{
		case kInfo:
			return "info";

		case kWarning:
			return "warning";

		case kError:
			return "error";
	}

	return "unknown";
}

#pragma mark = LoadStatementASTNode =

LoadStatementASTNode::LoadStatementASTNode(const LoadStatementASTNode & other)
:	StatementASTNode(other), m_data(), m_target(), m_isDCDLoad(other.m_isDCDLoad)
{
	m_data = other.m_data->clone();
	m_target = other.m_target->clone();
}

void LoadStatementASTNode::printTree(int indent) const
{
	StatementASTNode::printTree(indent);

	printIndent(indent + 1);
	printf("data:\n");
	if (m_data) m_data->printTree(indent + 2);

	printIndent(indent + 1);
	printf("target:\n");
	if (m_target) m_target->printTree(indent + 2);
}

#pragma mark = CallStatementASTNode =

CallStatementASTNode::CallStatementASTNode(const CallStatementASTNode & other)
:	StatementASTNode(other), m_type(other.m_type), m_target(), m_arg()
{
	m_target = other.m_target->clone();
	m_arg = other.m_arg->clone();
}

void CallStatementASTNode::printTree(int indent) const
{
	printIndent(indent);
	printf("%s(%s)%s\n", nodeName().c_str(), (m_type == kCallType ? "call" : "jump"), (m_isHAB ? "/HAB" : ""));

	printIndent(indent + 1);
	printf("target:\n");
	if (m_target) m_target->printTree(indent + 2);

	printIndent(indent + 1);
	printf("arg:\n");
	if (m_arg) m_arg->printTree(indent + 2);
}

#pragma mark = SourceASTNode =

SourceASTNode::SourceASTNode(const SourceASTNode & other)
:	ASTNode(other), m_name()
{
	m_name = new std::string(*other.m_name);
}

void SourceASTNode::printTree(int indent) const
{
	printIndent(indent);
	printf("%s(%s)\n", nodeName().c_str(), m_name->c_str());
}

#pragma mark = SectionMatchListASTNode =

SectionMatchListASTNode::SectionMatchListASTNode(const SectionMatchListASTNode & other)
:	ASTNode(other), m_sections(), m_source()
{
	if (other.m_sections)
	{
		m_sections = dynamic_cast<ListASTNode *>(other.m_sections->clone());
	}

	if (other.m_source)
	{
		m_source = new std::string(*other.m_source);
	}
}

void SectionMatchListASTNode::printTree(int indent) const
{
	ASTNode::printTree(indent);

	printIndent(indent+1);
	printf("sections:\n");
	if (m_sections)
	{
		m_sections->printTree(indent+2);
	}

	printIndent(indent+1);
	printf("source: ");
	if (m_source)
	{
		printf("%s\n", m_source->c_str());
	}
	else
	{
		printf("\n");
	}
}

#pragma mark = SectionASTNode =

SectionASTNode::SectionASTNode(const SectionASTNode & other)
:	ASTNode(other), m_name(), m_source()
{
	m_action = other.m_action;

	if (other.m_name)
	{
		m_name = new std::string(*other.m_name);
	}

	if (other.m_source)
	{
		m_source = new std::string(*other.m_source);
	}
}

void SectionASTNode::printTree(int indent) const
{
	printIndent(indent);

	const char * actionName;
	switch (m_action)
	{
		case kInclude:
			actionName = "include";
			break;
		case kExclude:
			actionName = "exclude";
			break;
	}

	if (m_source)
	{
		printf("%s(%s:%s:%s)\n", nodeName().c_str(), actionName, m_name->c_str(), m_source->c_str());
	}
	else
	{
		printf("%s(%s:%s)\n", nodeName().c_str(), actionName, m_name->c_str());
	}
}

#pragma mark = SymbolASTNode =

SymbolASTNode::SymbolASTNode(const SymbolASTNode & other)
:	ASTNode(other), m_symbol(), m_source()
{
	m_symbol = new std::string(*other.m_symbol);
	m_source = new std::string(*other.m_source);
}

void SymbolASTNode::printTree(int indent) const
{
	printIndent(indent);

	const char * symbol = NULL;
	if (m_symbol)
	{
		symbol = m_symbol->c_str();
	}

	const char * source = NULL;
	if (m_source)
	{
		source = m_source->c_str();
	}

	printf("%s(", nodeName().c_str());
	if (source)
	{
		printf("%s", source);
	}
	else
	{
		printf(".");
	}
	printf(":");
	if (symbol)
	{
		printf("%s", symbol);
	}
	else
	{
		printf(".");
	}
	printf(")\n");
}

#pragma mark = AddressRangeASTNode =

AddressRangeASTNode::AddressRangeASTNode(const AddressRangeASTNode & other)
:	ASTNode(other), m_begin(), m_end()
{
	m_begin = other.m_begin->clone();
	m_end = other.m_end->clone();
}

void AddressRangeASTNode::printTree(int indent) const
{
	ASTNode::printTree(indent);

	printIndent(indent + 1);
	printf("begin:\n");
	if (m_begin) m_begin->printTree(indent + 2);

	printIndent(indent + 1);
	printf("end:\n");
	if (m_end) m_end->printTree(indent + 2);
}

#pragma mark = FromStatementASTNode =

FromStatementASTNode::FromStatementASTNode(std::string * source, ListASTNode * statements)
:	StatementASTNode(), m_source(source), m_statements(statements)
{
}

FromStatementASTNode::FromStatementASTNode(const FromStatementASTNode & other)
:	StatementASTNode(), m_source(), m_statements()
{
	m_source = new std::string(*other.m_source);
	m_statements = dynamic_cast<ListASTNode*>(other.m_statements->clone());
}

void FromStatementASTNode::printTree(int indent) const
{
	ASTNode::printTree(indent);

	printIndent(indent + 1);
	printf("source: ");
	if (m_source) printf("%s\n", m_source->c_str());

	printIndent(indent + 1);
	printf("statements:\n");
	if (m_statements) m_statements->printTree(indent + 2);
}


text:
using Genus.Migrator.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace Genus.Migrator.Migrations.Operations
{
    public sealed class AddForeignKey:TableOperation
    {
        public string ForeignKeyName { get; set; }
        public string FieldName { get; set; }
        public string PrincipalSchema { get; set; }
        public string PrincipalTable { get; set; }
        public string PrincipalField { get; set; }
        public ForeignKeyAction? OnDelete { get; set; }
        public ForeignKeyAction? OnUpdate { get; set; }

        public override int OrderHint
            => 12000;
    }
}


text:
<?php

namespace BekoDesign\versioAPI\Contracts;

interface IDomains
{

}


text:
import {Component} from '@angular/core';

@Component({
  templateUrl: 'demo.component.html'
})
export class RatingDemoComponent {

  horizontalValue = 2.5;
  verticalValue = 2.5;
  customValue = 7.5;

}


text:
/*global describe, it, expect */

var Strategy = require('..').Strategy;

describe('Strategy', function() {

  var strategy = new Strategy(function() {});

  it('should be named "json-custom"', function() {
    expect(strategy.name).to.equal('json-custom');
  });

  it('should throw if constructed without a verify callback', function() {
    expect(function() {
      /*jshint unused:false */
      var s = new Strategy();
    }).to.throw(TypeError, 'JsonCustomStrategy requires a verify callback');
  });

});


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Camarosporium roumeguerei var. verbasci Gonz. Frag.

### Remarks
null


text:
const { checkBuffer } = require('./helper')
const { Usage } = require('../constants')

/**
 * decodes dpt5
 *
 * @param {string} dpt
 * @param {Buffer} encoded
 * @param {Object} [options]
 * @param {number} [options.decimals=2]
 * @return {number}
 *
 * @throws {Error} Will throw an error if <encoded> is not a Buffer
 * @throws {Error} Will throw an error if the byteLength of <encoded> is not equal to 1
 */
function decode (dpt, encoded, options) {
  checkBuffer(encoded, 1)

  let decimals = 2

  if (options !== null && typeof options === 'object') {
    if (Object.prototype.hasOwnProperty.call(options, 'decimals')) {
      decimals = Number(options.decimals)
    }
  }

  const byte1 = encoded.readUInt8(0)

  switch (dpt) {
    case '5.001':
      return parseFloat((byte1 / 2.55).toFixed(decimals))

    case '5.003':
      return parseFloat(((byte1 / 255) * 360).toFixed(decimals))

    case '5.004':
    case '5.006':
    case '5.010':
      return byte1
  }
}

/**
 * encodes dpt5
 *
 * @param {string} dpt
 * @param {number} decoded
 * @return {Buffer}
 *
 * @throws {RangeError} Will throw an error if <decoded> is out of range
 */
function encode (dpt, decoded) {
  let value = Number(decoded)

  switch (dpt) {
    case '5.001':
      if (value > 100 || value < 0) {
        throw new RangeError(`Value out of range (expected 0-100, got ${value})`)
      }
      value = Math.round(value * 2.55)
      return Buffer.alloc(1, value)

    case '5.003':
      if (value > 360 || value < 0) {
        throw new RangeError(`Value out of range (expected 0-360, got ${value})`)
      }
      value = Math.round((value / 360) * 255)
      return Buffer.alloc(1, value)

    case '5.004':
    case '5.006':
    case '5.010':
      if (value > 255 || value < 0) {
        throw new RangeError(`Value out of range (expected 0-255, got ${value})`)
      }
      return Buffer.alloc(1, value)
  }
}

/**
 * dpt definitions
 */
module.exports = {
  common: {
    bitlength: 8
  },
  1: {
    name: 'DPT_Scaling',
    encode,
    decode,
    use: Usage.GENERAL
  },
  3: {
    name: 'DPT_Angle',
    encode,
    decode,
    use: Usage.GENERAL
  },
  4: {
    name: 'DPT_Percent_U8',
    encode,
    decode,
    use: Usage.FUNCTIONAL
  },
  5: {
    name: 'DPT_DecimalFactor',
    encode,
    decode,
    use: Usage.GENERAL
  },
  6: {
    name: 'DPT_Tariff',
    encode,
    decode,
    use: Usage.GENERAL
  },
  10: {
    name: 'DPT_Value_1_Ucount',
    encode,
    decode,
    use: Usage.GENERAL
  }
}


text:
@interface ApigeeUIWebView()

@property (strong) ApigeeUIWebViewDelegateInterceptor *interceptor;

@end

@implementation ApigeeUIWebView

- (id) initWithCoder:(NSCoder *)aDecoder
{
    self = [super initWithCoder:aDecoder];

    if (self) {
        self.interceptor = nil;
    }

    return self;
}

- (id) initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];

    if (self) {
        self.interceptor = nil;
    }

    return self;
}

- (void) setDelegate:(id<UIWebViewDelegate>)delegate
{
    self.interceptor = [[ApigeeUIWebViewDelegateInterceptor alloc] initAndInterceptFor:delegate];
    [super setDelegate:self.interceptor];
}

@end


text:
<?php

namespace PROCERGS\VPR\CoreBundle\Form\Type;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Validator\Constraints\Length;

class CitySelectionType extends AbstractType
{

    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
                ->add('city', new CityType(), array('required' => false))
                ->add('voterRegistration', 'voter_registration', array(
                    'required' => false
                ))
                ->add('submit', 'submit');
    }

    public function getName()
    {
        return 'citySelection';
    }

}


text:
namespace boost {

// * convert a type T to a const volatile type - add_cv<T>
// this is not required since the result is always
// the same as "T const volatile", but it does suppress warnings
// from some compilers:

#if defined(BOOST_MSVC)
// This bogus warning will appear when add_volatile is applied to a
// const volatile reference because we can't detect const volatile
// references with MSVC6.
#   pragma warning(push)
#   pragma warning(disable:4181) // warning C4181: qualifier applied to reference type ignored
#endif

BOOST_TT_AUX_TYPE_TRAIT_DEF1(add_cv,T,T const volatile)

#if defined(BOOST_MSVC)
#   pragma warning(pop)
#endif

#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,add_cv,T&,T&)
#endif

} // namespace boost

#include "boost/type_traits/detail/type_trait_undef.hpp"

#endif // BOOST_TT_ADD_CV_HPP_INCLUDED


text:
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <errno.h>
#include <unistd.h>
#include <ucontext.h>

#include "internal.h"

void proc_mainfxn(Proc *proc)
{
    ASSERT_NOTNULL(proc);
    ASSERT_NOTNULL(proc->fxn);

    /* do scheduler stuff */
    /* call ctx->fxn() */
    /* when fxn returns, do */
        /* maybe clean up context? */
        /* remove context from scheduler */
        /* return control to scheduler */

    proc->fxn();

    PDEBUG("proc_mainfxn done\n");

    proc->state = PROC_ENDED;
    proc_yield(proc);
}

Proc* proc_self(void)
{
    Proc *proc = scheduler_self()->curr_proc;
    ASSERT_NOTNULL(proc);
    return proc;
}

int proc_create(Proc **new_proc, ProcFxn fxn)
{
    ASSERT_NOTNULL(new_proc);
    ASSERT_NOTNULL(fxn);

    Proc *proc;
    if (!(proc = malloc(sizeof(Proc)))) {
        PERROR("malloc failed for Proc\n");
        return errno;
    }

    Scheduler *sched = scheduler_self();
    if (posix_memalign(&proc->stack.ptr, sched->page_size, sched->stack_size)) {
        free(proc);
        PERROR("posix_memalign failed\n");
        return errno;
    }

    /* set fxn and args */
    proc->fxn      = fxn;
    proc->args.num = 0;
    proc->args.ptr = NULL;

    /* configure members */
    proc->stack.size = sched->stack_size;
    proc->stack.used = 0;
    proc->state      = PROC_READY;
    proc->sleep_us   = 0;
    proc->sched      = sched;
    proc->proc_build = NULL;

    /* configure context */
    ctx_init(&proc->ctx, proc);

    /* register in sched totalQ */
    TAILQ_INSERT_TAIL(&sched->totalQ, proc, schedQ_node);

    *new_proc = proc;

    return 0;
}

void proc_free(Proc *proc)
{
    if (!proc) return;

    /* remove from totalQ */
    Scheduler *sched = proc->sched;
    TAILQ_REMOVE(&sched->totalQ, proc, schedQ_node);

    /* resolve ProcBuild */
    ProcBuild *build = proc->proc_build;
    if (build != NULL) {
        csp_parsebuild(BUILDER_CAST(build, Builder*));
    }

    free(proc->args.ptr);
    free(proc->stack.ptr);
    free(proc);
}

static inline
int _proc_copyargs(Proc *proc, void **buf, size_t buf_size)
{
    size_t new_num = proc->args.num + buf_size;
    void *ptr;
    if (!(ptr = realloc(proc->args.ptr, sizeof(void *) * new_num))) {
        free(proc);
        PERROR("realloc failed for Proc Args\n");
        return errno;
    }
    proc->args.ptr = ptr;
    memcpy(proc->args.ptr + proc->args.num, buf, sizeof(void *) * buf_size);
    proc->args.num += buf_size;
    return 0;
}

int proc_setargs(Proc *proc, va_list args)
{
    enum { ARGS_N = 32 };
    void *tmp_args[ARGS_N];
    size_t curr_n = 0;
    int ret;

    void *xarg = va_arg(args, void *);
    while (xarg != PROXC_NULL) {
        tmp_args[curr_n++] = xarg;
        xarg = va_arg(args, void *);

        /* if tmp_args is full, realloc and copy over into args */
        if (curr_n == ARGS_N) {
            ret = _proc_copyargs(proc, tmp_args, ARGS_N);
            ASSERT_0(ret);
            curr_n = 0;
        }
    }

    if (curr_n > 0) {
        ret = _proc_copyargs(proc, tmp_args, curr_n);
        ASSERT_0(ret);
    }

    return 0;
}

void proc_yield(Proc *proc)
{
    Scheduler *sched = (!proc)
                     ? scheduler_self()
                     : proc->sched;

    PDEBUG("yielding\n");
    ctx_switch(&sched->curr_proc->ctx, &sched->ctx);
}


text:
<?php
// src/L1m2/PlatformBundle/Entity/Proposition.php

namespace L1m2\PlatformBundle\Entity;

use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;

/** @ORM\MappedSuperclass */
abstract class Proposition
{
    /**
     * @ORM\Column(type="integer")
     */
    protected $status;
    /**
     * @ORM\Column(name="auteur", type="string", length=255)
     * @Assert\NotBlank
     * @Assert\Length(
     *      min = 4,
     *      max = 40,
     *      minMessage = "Votre pseudonyme est trop court, moins de {{ limit }} lettres",
     *      maxMessage = "Votre pseudonyme est trop long, plus de {{ limit }} lettres"
     * )
     */
    protected $auteur;
    /**
     * @ORM\Column(name="datepropo", type="datetime")
     */
    protected $datePropo;
    /**
     * @ORM\Column(name="dateparu", type="datetime")
     */
    protected $dateParu;

    const STATUS_RECU = 1;    // valeur initiale du status, filtre les propositions recues
    const STATUS_REJETE = 2;  // filtre les propositions rejetees
    const STATUS_ACCEPTE = 4; // filtre les propositions acceptees
    const STATUS_TOUT = 7;    // pas de filtre sur les propositions
    const DATE_DESC = 1;      // ordre du plus recent au plus ancien
    const DATE_ASC = 2;       // ordre du plus ancien au plus recent
    const LEN_DESC = 3;       // ordre du plus long au plus court
    const LEN_ASC = 4;        // ordre du plus court au plus long

    public function __construct()
    {
        $this->setDatePropo(new \Datetime());
        $this->setDateParu($this->datePropo);
        $this->setStatus(self::STATUS_RECU);
    }

    /**
     * @return integer
     */
    public function getStatus()
    {
        return $this->status;
    }
    /**
    * @param int $id
    * @return Proposition
    */
    public function setStatus($status)
    {
        $this->status = $status;
        return $this;
    }
    /**
     * @return string
     */
    public function getAuteur()
    {
        return $this->auteur;
    }
    /**
     * @param string $auteur
     * @return Proposition
     */
    public function setAuteur($auteur)
    {
        $this->auteur = $auteur;
        return $this;
    }
    /**
     * @param \DateTime $date
     * @return Proposition
     */
    public function setDatePropo($date)
    {
        $this->datePropo = $date;
        return $this;
    }
    /**
     * @return \DateTime
     */
    public function getDatePropo()
    {
        return $this->datePropo;
    }
    /**
     * @param \DateTime $date
     * @return Proposition
     */
    public function setDateParu($date)
    {
        $this->dateParu = $date;
        return $this;
    }
    /**
     * @return \DateTime
     */
    public function getDateParu()
    {
        return $this->dateParu;
    }

    /**
     * @return bool
     */
    public function isAccepted()
    {
        return ($this->status == self::STATUS_ACCEPTE);
    }
    /**
     * @return bool
     */
    public function isRejected()
    {
        return ($this->status == self::STATUS_REJETE);
    }
}


text:
<?php

use Silex\Application;
use Silex\Provider\AssetServiceProvider;
use Silex\Provider\TwigServiceProvider;
use Silex\Provider\ServiceControllerServiceProvider;
use Silex\Provider\HttpFragmentServiceProvider;
use Ulime\General\Providers\MongoDBServiceProvider;
use Ulime\General\Providers\RepositoryServiceProvider;
use Ulime\General\Providers\ControllerServiceProvider;
use Ulime\General\Providers\SessionServiceProvider;

$app = new Application();
$app->register(new ServiceControllerServiceProvider());
$app->register(new AssetServiceProvider());
$app->register(new TwigServiceProvider());
$app->register(new HttpFragmentServiceProvider());
$app->register(new MongoDBServiceProvider());
$app->register(new ControllerServiceProvider());
$app->register(new RepositoryServiceProvider());
$app->register(new SessionServiceProvider());

return $app;


text:
<?php

/**
 * @see Zend_Reflection_File
 */
// require_once 'Zend/Reflection/File.php';

/**
 * @category   Zend
 * @package    Zend_Reflection
 * @subpackage UnitTests
 * @copyright  Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
 * @license    http://framework.zend.com/license/new-bsd     New BSD License
 * @group      Zend_Reflection
 * @group      Zend_Reflection_File
 */
class Zend_Reflection_FileTest extends PHPUnit_Framework_TestCase
{

    public function testFileConstructor()
    {
        $fileToRequire = dirname(dirname(dirname(__DIR__))) . '/packages/zend-version/library/Zend/Version.php';
        require_once $fileToRequire;
        $reflectionFile = new Zend_Reflection_File($fileToRequire);
        $this->assertEquals(get_class($reflectionFile), 'Zend_Reflection_File');
    }

    /**
     * @expectedException Zend_Reflection_Exception
     */
    public function testFileConstructorThrowsExceptionOnNonExistentFile()
    {
        $nonExistentFile = 'Non/Existent/File.php';
        $reflectionFile = new Zend_Reflection_File($nonExistentFile);
        $this->fail('Exception should have been thrown');
    }

    public function testFileGetClassReturnsClassReflectionObject()
    {
        $fileToRequire = __DIR__ . '/_files/TestSampleClass.php';
        require_once $fileToRequire;
        $reflectionFile = new Zend_Reflection_File($fileToRequire);
        $this->assertEquals(get_class($reflectionFile), 'Zend_Reflection_File');
        $this->assertEquals(count($reflectionFile->getClasses()), 9);
        $this->assertEquals(get_class($reflectionFile->getClass('Zend_Reflection_TestSampleClass2')), 'Zend_Reflection_Class');
    }

    public function testFileGetClassReturnsFirstClassWithNoOptions()
    {
        $fileToRequire = __DIR__ . '/_files/TestSampleClass.php';
        require_once $fileToRequire;
        $reflectionFile = new Zend_Reflection_File($fileToRequire);
        $this->assertEquals('Zend_Reflection_TestSampleClass', $reflectionFile->getClass()->getName());
    }

    /**
     * @expectedException Zend_Reflection_Exception
     */
    public function testFileGetClassThrowsExceptionOnNonExistentClassName()
    {
        $fileToRequire = __DIR__ . '/_files/TestSampleClass.php';
        require_once $fileToRequire;
        $reflectionFile = new Zend_Reflection_File($fileToRequire);
        $nonExistentClass = 'Some_Non_Existent_Class';
        $reflectionFile->getClass($nonExistentClass);
        $this->fail('Exception should have been thrown');
    }

    public function testFileReflectorRequiredFunctionsDoNothing()
    {
        $this->assertNull(Zend_Reflection_File::export());

        $fileToRequire = dirname(dirname(dirname(__DIR__))) . '/packages/zend-version/library/Zend/Version.php';
        require_once $fileToRequire;
        $reflectionFile = new Zend_Reflection_File($fileToRequire);
        $this->assertEquals('', $reflectionFile->__toString());
    }

    public function testFileGetFilenameReturnsCorrectFilename()
    {
        $fileToRequire = dirname(dirname(dirname(__DIR__))) . '/packages/zend-version/library/Zend/Version.php';
        require_once $fileToRequire;
        $reflectionFile = new Zend_Reflection_File($fileToRequire);

        // Make sure this test works on all platforms
        $this->assertRegExp('#^.*Zend.Version.php$#i', $reflectionFile->getFileName());
    }

    public function testFileGetLineNumbersWorks()
    {
        $fileToRequire = __DIR__ . '/_files/TestSampleClass.php';
        require_once $fileToRequire;
        $reflectionFile = new Zend_Reflection_File($fileToRequire);
        $this->assertEquals(9, $reflectionFile->getStartLine());
        $this->assertEquals(197, $reflectionFile->getEndLine());
    }

    public function testFileGetDocblockReturnsFileDocblock()
    {
        $fileToRequire = __DIR__ . '/_files/TestSampleClass.php';
        require_once $fileToRequire;
        $reflectionFile = new Zend_Reflection_File($fileToRequire);
        $this->assertTrue($reflectionFile->getDocblock() instanceof Zend_Reflection_Docblock);
    }

    public function testFileGetFunctionsReturnsFunctions()
    {
        $this->markTestSkipped('Regex in Zend_Reflection_File needs work in the function department');
        $fileToRequire = __DIR__ . '/_files/FileOfFunctions.php';
        require_once $fileToRequire;
        $reflectionFile = new Zend_Reflection_File($fileToRequire);
        echo count($reflectionFile->getFunctions());
    }

    public function testFileCanReflectFileWithInterface()
    {
        $fileToRequire = __DIR__ . '/_files/TestSampleInterface.php';
        require_once $fileToRequire;
        $reflectionFile = new Zend_Reflection_File($fileToRequire);
        $class = $reflectionFile->getClass();
        $this->assertEquals('Zend_Reflection_TestSampleInterface', $class->getName());
        $this->assertTrue($class->isInterface());
    }

    /**
     * @group ZF-12155
     */
    public function testFileCanReflectFunctionsContainingVariablesEmbeddedInStringWithCurlyBraces()
    {
        $fileToRequire = __DIR__ . '/_files/FunctionWithEmbeddedVariableInString.php';
        require_once $fileToRequire;
        $reflectionFile = new Zend_Reflection_File($fileToRequire);
        $functions = $reflectionFile->getFunctions();
        $this->assertEquals(2, count($functions));
        $this->assertContainsOnly('Zend_Reflection_Function', $functions);
        $this->assertEquals('firstOne', $functions[0]->getName());
        $this->assertEquals('secondOne', $functions[1]->getName());
    }
}


text:
// Copyright 2010 WebDriver committers
// Copyright 2010 Google Inc.
//
// 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.

/**
 * @fileoverview Utilities for working with errors as defined by WebDriver's
 * wire protocol: http://code.google.com/p/selenium/wiki/JsonWireProtocol.
 */

goog.provide('bot.Error');
goog.provide('bot.ErrorCode');

/**
 * Error codes from the WebDriver wire protocol:
 * http://code.google.com/p/selenium/wiki/JsonWireProtocol#Response_Status_Codes
 *
 * @enum {number}
 */
bot.ErrorCode = {
  SUCCESS: 0,  // Included for completeness

  NO_SUCH_ELEMENT: 7,
  NO_SUCH_FRAME: 8,
  UNKNOWN_COMMAND: 9,
  UNSUPPORTED_OPERATION: 9,  // Alias.
  STALE_ELEMENT_REFERENCE: 10,
  ELEMENT_NOT_VISIBLE: 11,
  INVALID_ELEMENT_STATE: 12,
  UNKNOWN_ERROR: 13,
  ELEMENT_NOT_SELECTABLE: 15,
  JAVASCRIPT_ERROR: 17,
  XPATH_LOOKUP_ERROR: 19,
  TIMEOUT: 21,
  NO_SUCH_WINDOW: 23,
  INVALID_COOKIE_DOMAIN: 24,
  UNABLE_TO_SET_COOKIE: 25,
  MODAL_DIALOG_OPENED: 26,
  NO_MODAL_DIALOG_OPEN: 27,
  SCRIPT_TIMEOUT: 28,
  INVALID_ELEMENT_COORDINATES: 29,
  IME_NOT_AVAILABLE: 30,
  IME_ENGINE_ACTIVATION_FAILED: 31,
  INVALID_SELECTOR_ERROR: 32,
  SESSION_NOT_CREATED: 33,
  MOVE_TARGET_OUT_OF_BOUNDS: 34,
  SQL_DATABASE_ERROR: 35,
  INVALID_XPATH_SELECTOR: 51,
  INVALID_XPATH_SELECTOR_RETURN_TYPE: 52,
  // The following error codes are derived straight from HTTP return codes.
  METHOD_NOT_ALLOWED: 405
};

/**
 * Error extension that includes error status codes from the WebDriver wire
 * protocol:
 * http://code.google.com/p/selenium/wiki/JsonWireProtocol#Response_Status_Codes
 *
 * @param {!bot.ErrorCode} code The error's status code.
 * @param {string=} opt_message Optional error message.
 * @constructor
 * @extends {Error}
 */
bot.Error = function(code, opt_message) {

  /**
   * This error's status code.
   * @type {!bot.ErrorCode}
   */
  this.code = code;

  /** @type {string} */
  this.state =
      bot.Error.CODE_TO_STATE_[code] || bot.Error.State.UNKNOWN_ERROR;

  /** @override */
  this.message = opt_message || '';

  var name = this.state.replace(/((?:^|\s+)[a-z])/g, function(str) {
    // IE<9 does not support String#trim(). Also, IE does not include 0xa0
    // (the non-breaking-space) in the \s character class, so we have to
    // explicitly include it.
    return str.toUpperCase().replace(/^[\s\xa0]+/g, '');
  });
  var l = name.length - 'Error'.length;
  if (l < 0 || name.indexOf('Error', l) != l) {
    name += 'Error';
  }

  /** @override */
  this.name = name;

  // Generate a stacktrace for our custom error; ensure the error has our
  // custom name and message so the stack prints correctly in all browsers.
  var template = new Error(this.message);
  template.name = this.name;

  /** @override */
  this.stack = template.stack || '';
};
goog.inherits(bot.Error, Error);

/**
 * Status strings enumerated in the W3C WebDriver working draft.
 * @enum {string}
 * @see http://www.w3.org/TR/webdriver/#status-codes
 */
bot.Error.State = {
  ELEMENT_NOT_SELECTABLE: 'element not selectable',
  ELEMENT_NOT_VISIBLE: 'element not visible',
  IME_ENGINE_ACTIVATION_FAILED: 'ime engine activation failed',
  IME_NOT_AVAILABLE: 'ime not available',
  INVALID_COOKIE_DOMAIN: 'invalid cookie domain',
  INVALID_ELEMENT_COORDINATES: 'invalid element coordinates',
  INVALID_ELEMENT_STATE: 'invalid element state',
  INVALID_SELECTOR: 'invalid selector',
  JAVASCRIPT_ERROR: 'javascript error',
  MOVE_TARGET_OUT_OF_BOUNDS: 'move target out of bounds',
  NO_SUCH_ALERT: 'no such alert',
  NO_SUCH_DOM: 'no such dom',
  NO_SUCH_ELEMENT: 'no such element',
  NO_SUCH_FRAME: 'no such frame',
  NO_SUCH_WINDOW: 'no such window',
  SCRIPT_TIMEOUT: 'script timeout',
  SESSION_NOT_CREATED: 'session not created',
  STALE_ELEMENT_REFERENCE: 'stale element reference',
  SUCCESS: 'success',
  TIMEOUT: 'timeout',
  UNABLE_TO_SET_COOKIE: 'unable to set cookie',
  UNEXPECTED_ALERT_OPEN: 'unexpected alert open',
  UNKNOWN_COMMAND: 'unknown command',
  UNKNOWN_ERROR: 'unknown error',
  UNSUPPORTED_OPERATION: 'unsupported operation'
};

/**
 * A map of error codes to state string.
 * @private {!Object.<bot.ErrorCode, bot.Error.State>}
 */
bot.Error.CODE_TO_STATE_ = {};
goog.scope(function() {
  var map = bot.Error.CODE_TO_STATE_;
  var code = bot.ErrorCode;
  var state = bot.Error.State;

  map[code.ELEMENT_NOT_SELECTABLE] = state.ELEMENT_NOT_SELECTABLE;
  map[code.ELEMENT_NOT_VISIBLE] = state.ELEMENT_NOT_VISIBLE;
  map[code.IME_ENGINE_ACTIVATION_FAILED] = state.IME_ENGINE_ACTIVATION_FAILED;
  map[code.IME_NOT_AVAILABLE] = state.IME_NOT_AVAILABLE;
  map[code.INVALID_COOKIE_DOMAIN] = state.INVALID_COOKIE_DOMAIN;
  map[code.INVALID_ELEMENT_COORDINATES] = state.INVALID_ELEMENT_COORDINATES;
  map[code.INVALID_ELEMENT_STATE] = state.INVALID_ELEMENT_STATE;
  map[code.INVALID_SELECTOR_ERROR] = state.INVALID_SELECTOR;
  map[code.INVALID_XPATH_SELECTOR] = state.INVALID_SELECTOR;
  map[code.INVALID_XPATH_SELECTOR_RETURN_TYPE] = state.INVALID_SELECTOR;
  map[code.JAVASCRIPT_ERROR] = state.JAVASCRIPT_ERROR;
  map[code.METHOD_NOT_ALLOWED] = state.UNSUPPORTED_OPERATION;
  map[code.MOVE_TARGET_OUT_OF_BOUNDS] = state.MOVE_TARGET_OUT_OF_BOUNDS;
  map[code.NO_MODAL_DIALOG_OPEN] = state.NO_SUCH_ALERT;
  map[code.NO_SUCH_ELEMENT] = state.NO_SUCH_ELEMENT;
  map[code.NO_SUCH_FRAME] = state.NO_SUCH_FRAME;
  map[code.NO_SUCH_WINDOW] = state.NO_SUCH_WINDOW;
  map[code.SCRIPT_TIMEOUT] = state.SCRIPT_TIMEOUT;
  map[code.SESSION_NOT_CREATED] = state.SESSION_NOT_CREATED;
  map[code.STALE_ELEMENT_REFERENCE] = state.STALE_ELEMENT_REFERENCE;
  map[code.SUCCESS] = state.SUCCESS;
  map[code.TIMEOUT] = state.TIMEOUT;
  map[code.UNABLE_TO_SET_COOKIE] = state.UNABLE_TO_SET_COOKIE;
  map[code.MODAL_DIALOG_OPENED] = state.UNEXPECTED_ALERT_OPEN;
  map[code.UNKNOWN_ERROR] = state.UNKNOWN_ERROR;
  map[code.UNSUPPORTED_OPERATION] = state.UNKNOWN_COMMAND;
});  // goog.scope

/**
 * Flag used for duck-typing when this code is embedded in a Firefox extension.
 * This is required since an Error thrown in one component and then reported
 * to another will fail instanceof checks in the second component.
 * @type {boolean}
 */
bot.Error.prototype.isAutomationError = true;

if (goog.DEBUG) {
  /** @return {string} The string representation of this error. */
  bot.Error.prototype.toString = function() {
    return this.name + ': ' + this.message;
  };
}


text:
/*================================================================================
  code generated by: java2cpp
  author: Zoran Angelov, mailto://baldzar@gmail.com
  class: java.util.Stack
================================================================================*/

#ifndef J2CPP_INCLUDE_IMPLEMENTATION

#ifndef J2CPP_JAVA_UTIL_STACK_HPP_DECL
#define J2CPP_JAVA_UTIL_STACK_HPP_DECL

namespace j2cpp { namespace java { namespace lang { class Object; } } }
namespace j2cpp { namespace java { namespace util { class Vector; } } }

#include <java/lang/Object.hpp>
#include <java/util/Vector.hpp>

namespace j2cpp {

namespace java { namespace util {

	class Stack;
	class Stack
		: public object<Stack>
	{
	public:

		J2CPP_DECLARE_CLASS

		J2CPP_DECLARE_METHOD(0)
		J2CPP_DECLARE_METHOD(1)
		J2CPP_DECLARE_METHOD(2)
		J2CPP_DECLARE_METHOD(3)
		J2CPP_DECLARE_METHOD(4)
		J2CPP_DECLARE_METHOD(5)

		explicit Stack(jobject jobj)
		: object<Stack>(jobj)
		{
		}

		operator local_ref<java::util::Vector>() const;

		Stack();
		jboolean empty();
		local_ref< java::lang::Object > peek();
		local_ref< java::lang::Object > pop();
		local_ref< java::lang::Object > push(local_ref< java::lang::Object >  const&);
		jint search(local_ref< java::lang::Object >  const&);
	}; //class Stack

} //namespace util
} //namespace java

} //namespace j2cpp

#endif //J2CPP_JAVA_UTIL_STACK_HPP_DECL

#else //J2CPP_INCLUDE_IMPLEMENTATION

#ifndef J2CPP_JAVA_UTIL_STACK_HPP_IMPL
#define J2CPP_JAVA_UTIL_STACK_HPP_IMPL

namespace j2cpp {

java::util::Stack::operator local_ref<java::util::Vector>() const
{
	return local_ref<java::util::Vector>(get_jobject());
}

java::util::Stack::Stack()
: object<java::util::Stack>(
	call_new_object<
		java::util::Stack::J2CPP_CLASS_NAME,
		java::util::Stack::J2CPP_METHOD_NAME(0),
		java::util::Stack::J2CPP_METHOD_SIGNATURE(0)
	>()
)
{
}

jboolean java::util::Stack::empty()
{
	return call_method<
		java::util::Stack::J2CPP_CLASS_NAME,
		java::util::Stack::J2CPP_METHOD_NAME(1),
		java::util::Stack::J2CPP_METHOD_SIGNATURE(1),
		jboolean
	>(get_jobject());
}

local_ref< java::lang::Object > java::util::Stack::peek()
{
	return call_method<
		java::util::Stack::J2CPP_CLASS_NAME,
		java::util::Stack::J2CPP_METHOD_NAME(2),
		java::util::Stack::J2CPP_METHOD_SIGNATURE(2),
		local_ref< java::lang::Object >
	>(get_jobject());
}

local_ref< java::lang::Object > java::util::Stack::pop()
{
	return call_method<
		java::util::Stack::J2CPP_CLASS_NAME,
		java::util::Stack::J2CPP_METHOD_NAME(3),
		java::util::Stack::J2CPP_METHOD_SIGNATURE(3),
		local_ref< java::lang::Object >
	>(get_jobject());
}

local_ref< java::lang::Object > java::util::Stack::push(local_ref< java::lang::Object > const &a0)
{
	return call_method<
		java::util::Stack::J2CPP_CLASS_NAME,
		java::util::Stack::J2CPP_METHOD_NAME(4),
		java::util::Stack::J2CPP_METHOD_SIGNATURE(4),
		local_ref< java::lang::Object >
	>(get_jobject(), a0);
}

jint java::util::Stack::search(local_ref< java::lang::Object > const &a0)
{
	return call_method<
		java::util::Stack::J2CPP_CLASS_NAME,
		java::util::Stack::J2CPP_METHOD_NAME(5),
		java::util::Stack::J2CPP_METHOD_SIGNATURE(5),
		jint
	>(get_jobject(), a0);
}

J2CPP_DEFINE_CLASS(java::util::Stack,"java/util/Stack")
J2CPP_DEFINE_METHOD(java::util::Stack,0,"<init>","()V")
J2CPP_DEFINE_METHOD(java::util::Stack,1,"empty","()Z")
J2CPP_DEFINE_METHOD(java::util::Stack,2,"peek","()Ljava/lang/Object;")
J2CPP_DEFINE_METHOD(java::util::Stack,3,"pop","()Ljava/lang/Object;")
J2CPP_DEFINE_METHOD(java::util::Stack,4,"push","(Ljava/lang/Object;)Ljava/lang/Object;")
J2CPP_DEFINE_METHOD(java::util::Stack,5,"search","(Ljava/lang/Object;)I")

} //namespace j2cpp

#endif //J2CPP_JAVA_UTIL_STACK_HPP_IMPL

#endif //J2CPP_INCLUDE_IMPLEMENTATION


text:
namespace SpecFlow.GeneratedTests.Tests
{
    using TechTalk.SpecFlow;

    [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "2.1.0.0")]
    [System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
    [NUnit.Framework.TestFixtureAttribute()]
    [NUnit.Framework.DescriptionAttribute("AzureWebSlotTrafficRouting")]
    public partial class AzureWebSlotTrafficRoutingFeature
    {

        private TechTalk.SpecFlow.ITestRunner testRunner;

#line 1 "AzureWebSlotTrafficRouting.feature"
#line hidden

        [NUnit.Framework.TestFixtureSetUpAttribute()]
        public virtual void FeatureSetup()
        {
            testRunner = TechTalk.SpecFlow.TestRunnerManager.GetTestRunner();
            TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "AzureWebSlotTrafficRouting", "\tIn order to A/B test using the Staging and Production slots \r\n\tAs a route me adm" +
                    "inistrator\r\n\tI want to have an automated approach to test the alpha environment " +
                    "to allow automated scaling up or down of the percentage of users hitting the alp" +
                    "ha environment", ProgrammingLanguage.CSharp, ((string[])(null)));
            testRunner.OnFeatureStart(featureInfo);
        }

        [NUnit.Framework.TestFixtureTearDownAttribute()]
        public virtual void FeatureTearDown()
        {
            testRunner.OnFeatureEnd();
            testRunner = null;
        }

        [NUnit.Framework.SetUpAttribute()]
        public virtual void TestInitialize()
        {
        }

        [NUnit.Framework.TearDownAttribute()]
        public virtual void ScenarioTearDown()
        {
            testRunner.OnScenarioEnd();
        }

        public virtual void ScenarioSetup(TechTalk.SpecFlow.ScenarioInfo scenarioInfo)
        {
            testRunner.OnScenarioStart(scenarioInfo);
        }

        public virtual void ScenarioCleanup()
        {
            testRunner.CollectScenarioErrors();
        }

        [NUnit.Framework.TestAttribute()]
        [NUnit.Framework.DescriptionAttribute("GetRoutingDirection - Routing to alpha increasing")]
        [NUnit.Framework.CategoryAttribute("basic")]
        public virtual void GetRoutingDirection_RoutingToAlphaIncreasing()
        {
            TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("GetRoutingDirection - Routing to alpha increasing", new string[] {
                        "basic"});
#line 7
this.ScenarioSetup(scenarioInfo);
#line 8
testRunner.Given("I have a build with no problem", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given ");
#line 9
 testRunner.And("I have a default of 10% with a 5% increment", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 10
testRunner.When("I deploy a new staging build", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
#line 11
testRunner.Then("I expect to see the percentage of traffic go up to 15%", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
#line hidden
            this.ScenarioCleanup();
        }

        [NUnit.Framework.TestAttribute()]
        [NUnit.Framework.DescriptionAttribute("GetRoutingDirection - Routing to alpha decreasing")]
        [NUnit.Framework.CategoryAttribute("validation")]
        [NUnit.Framework.TestCaseAttribute("Router issues", "metrics", "availabilityResults/availabilityPercentage", "As determined load testing on Azure", "5%", new string[0])]
        [NUnit.Framework.TestCaseAttribute("Javascript errors", "metrics", "exceptions/browser", "Application insights", "0%", new string[0])]
        [NUnit.Framework.TestCaseAttribute("Server side errors", "metrics", "exceptions/server", "Application insights", "0%", new string[0])]
        [NUnit.Framework.TestCaseAttribute("Latency regression", "metrics", "browserTimings/receiveDuration", "Must be less than 20% regression", "5%", new string[0])]
        [NUnit.Framework.TestCaseAttribute("Customer conversion regression", "events", "customEvents", "Are users getting through the sales funnel.", "5%", new string[0])]
        [NUnit.Framework.TestCaseAttribute("Customer bounce rate", "metrics", "pageViews/count", "How far do users get through our sales funnel", "5%", new string[0])]
        [NUnit.Framework.TestCaseAttribute("Customer average time spent on page", "metrics", "pageViews/duration", "Are users engaged enough with content?", "5%", new string[0])]
        [NUnit.Framework.TestCaseAttribute("Server side errors & Latency regression", "N/A", "N/A", "Many technical", "0%", new string[0])]
        [NUnit.Framework.TestCaseAttribute("Customer bounce rate & Customer average time spent on page", "N/A", "N/A", "Many business", "5%", new string[0])]
        [NUnit.Framework.TestCaseAttribute("All issue types", "N/A", "N/A", "Many technical and business", "0%", new string[0])]
        public virtual void GetRoutingDirection_RoutingToAlphaDecreasing(string problem, string azureAPI, string azureAPIMetric, string description, string stagingRoutingPercentage, string[] exampleTags)
        {
            string[] @__tags = new string[] {
                    "validation"};
            if ((exampleTags != null))
            {
                @__tags = System.Linq.Enumerable.ToArray(System.Linq.Enumerable.Concat(@__tags, exampleTags));
            }
            TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("GetRoutingDirection - Routing to alpha decreasing", @__tags);
#line 14
this.ScenarioSetup(scenarioInfo);
#line 15
testRunner.Given(string.Format("I have a build with {0}", problem), ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given ");
#line 16
 testRunner.And("I have a default of 10% with a 5% increment", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 17
testRunner.When("I deploy a new staging build", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
#line 18
testRunner.Then(string.Format("I expect to see the the percentage of traffic go down to {0}", stagingRoutingPercentage), ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
#line hidden
            this.ScenarioCleanup();
        }
    }
}
#pragma warning restore
#endregion


text:
package ru.ilya.generalizations;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import org.junit.Test;
import static org.junit.Assert.assertThat;
import static org.hamcrest.core.Is.is;

/**
 * Created by Lenovo2 on 06.02.2018.
 */
public class UserConvertTest {

    @Test
    public void addUsersAndConvertInMap() {
        List<User> user = new ArrayList<>();
        User user1 = new User("Ilya", "Moscow", 1);
        User user2 = new User("Max", "Rostov", 2);
        User user3 = new User("Stepa", "Reutov", 3);
        User user4 = new User("Ivan", "Gravity Falls", 6);
        user.add(user1);
        user.add(user2);
        user.add(user3);
        user.add(user4);
        UserConvert convert = new UserConvert();
        HashMap<Integer, User> result = convert.process(user);
        HashMap<Integer, User> expected = new HashMap<>();
        expected.put(1, user1);
        expected.put(2, user2);
        expected.put(3, user3);
        expected.put(6, user4);
        assertThat(result, is(expected));
    }

}


text:
module AppmenHelper
end


text:
module Packet
  class Plan
    include Entity

    attr_accessor :slug
    attr_accessor :name
    attr_accessor :description
    attr_accessor :line
    attr_accessor :specs
    attr_accessor :pricing

    serializer_key :slug
  end
end


text:
<meta charset="utf-8">
(#) Looking for Rear Camera only feature

!!! WARNING: Looking for Rear Camera only feature
   This is a warning.

Id
:   `UnsupportedChromeOsCameraSystemFeature`
Summary
:   Looking for Rear Camera only feature
Severity
:   Warning
Category
:   Correctness
Platform
:   Android
Vendor
:   Android Open Source Project
Feedback
:   https://issuetracker.google.com/issues/new?component=192708
Affects
:   Kotlin and Java files
Editing
:   This check runs on the fly in the IDE editor
Implementation
:   [Source Code](https://cs.android.com/android-studio/platform/tools/base/+/mirror-goog-studio-main:lint/libs/lint-checks/src/main/java/com/android/tools/lint/checks/ChromeOsSourceDetector.kt)
Tests
:   [Source Code](https://cs.android.com/android-studio/platform/tools/base/+/mirror-goog-studio-main:lint/libs/lint-tests/src/test/java/com/android/tools/lint/checks/ChromeOsSourceDetectorTest.kt)
Copyright Year
:   2018

You should look for the `FEATURE_CAMERA_ANY` features to include all
possible cameras that may be on the device. Looking for `FEATURE_CAMERA`
only looks for a rear facing camera, which certain tablets or Chrome OS
devices don't have, as well as newer device configurations and modes may
place the device in a state where the rear camera is not available. To
fix the issue, look for `FEATURE_CAMERA_ANY` instead.

!!! Tip
   This lint check has an associated quickfix available in the IDE.

(##) Example

Here is an example of lint warnings produced by this check:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text
src/test/pkg/MainActivity.java:15:Warning: You should look for any
camera available on the device, not just the rear
[UnsupportedChromeOsCameraSystemFeature]

    getPackageManager().hasSystemFeature(PackageManager.FEATURE_CAMERA);
    -------------------------------------------------------------------

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Here is the source file referenced above:

`src/test/pkg/MainActivity.java`:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~java linenumbers
package test.pkg;

import android.app.Activity;

import android.content.pm.PackageManager;
import android.os.Bundle;

public class MainActivity extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        getPackageManager().hasSystemFeature(PackageManager.FEATURE_CAMERA);
    }
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

You can also visit the
[source code](https://cs.android.com/android-studio/platform/tools/base/+/mirror-goog-studio-main:lint/libs/lint-tests/src/test/java/com/android/tools/lint/checks/ChromeOsSourceDetectorTest.kt)
for the unit tests for this check to see additional scenarios.

The above example was automatically extracted from the first unit test
found for this lint check, `ChromeOsSourceDetector.testInvalidCameraSystemFeature`.
To report a problem with this extracted sample, visit
https://issuetracker.google.com/issues/new?component=192708.

(##) Suppressing

You can suppress false positives using one of the following mechanisms:

* Using a suppression annotation like this on the enclosing
  element:

  ```kt
  // Kotlin
  @Suppress("UnsupportedChromeOsCameraSystemFeature")
  fun method() {
     setRequestedOrientation(...)
  }
  ```

  or

  ```java
  // Java
  @SuppressWarnings("UnsupportedChromeOsCameraSystemFeature")
  void method() {
     setRequestedOrientation(...);
  }
  ```

* Using a suppression comment like this on the line above:

  ```kt
  //noinspection UnsupportedChromeOsCameraSystemFeature
  problematicStatement()
  ```

* Using a special `lint.xml` file in the source tree which turns off
  the check in that folder and any sub folder. A simple file might look
  like this:
  ```xml
  <?xml version="1.0" encoding="UTF-8"?>
  <lint>
      <issue id="UnsupportedChromeOsCameraSystemFeature" severity="ignore" />
  </lint>
  ```
  Instead of `ignore` you can also change the severity here, for
  example from `error` to `warning`. You can find additional
  documentation on how to filter issues by path, regular expression and
  so on
  [here](https://googlesamples.github.io/android-custom-lint-rules/usage/lintxml.md.html).

* In Gradle projects, using the DSL syntax to configure lint. For
  example, you can use something like
  ```gradle
  lintOptions {
      disable 'UnsupportedChromeOsCameraSystemFeature'
  }
  ```
  In Android projects this should be nested inside an `android { }`
  block.

* For manual invocations of `lint`, using the `--ignore` flag:
  ```
  $ lint --ignore UnsupportedChromeOsCameraSystemFeature ...`
  ```

* Last, but not least, using baselines, as discussed
  [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html).

<!-- Markdeep: --><style class="fallback">body{visibility:hidden;white-space:pre;font-family:monospace}</style><script src="markdeep.min.js" charset="utf-8"></script><script src="https://morgan3d.github.io/markdeep/latest/markdeep.min.js" charset="utf-8"></script><script>window.alreadyProcessedMarkdeep||(document.body.style.visibility="visible")</script>


text:
@implementation DBFILESUploadSessionFinishBatchResultEntry

@synthesize success = _success;
@synthesize failure = _failure;

#pragma mark - Constructors

- (instancetype)initWithSuccess:(DBFILESFileMetadata *)success {
  self = [super init];
  if (self) {
    _tag = DBFILESUploadSessionFinishBatchResultEntrySuccess;
    _success = success;
  }
  return self;
}

- (instancetype)initWithFailure:(DBFILESUploadSessionFinishError *)failure {
  self = [super init];
  if (self) {
    _tag = DBFILESUploadSessionFinishBatchResultEntryFailure;
    _failure = failure;
  }
  return self;
}

#pragma mark - Instance field accessors

- (DBFILESFileMetadata *)success {
  if (![self isSuccess]) {
    [NSException
         raise:@"IllegalStateException"
        format:@"Invalid tag: required DBFILESUploadSessionFinishBatchResultEntrySuccess, but was %@.", [self tagName]];
  }
  return _success;
}

- (DBFILESUploadSessionFinishError *)failure {
  if (![self isFailure]) {
    [NSException
         raise:@"IllegalStateException"
        format:@"Invalid tag: required DBFILESUploadSessionFinishBatchResultEntryFailure, but was %@.", [self tagName]];
  }
  return _failure;
}

#pragma mark - Tag state methods

- (BOOL)isSuccess {
  return _tag == DBFILESUploadSessionFinishBatchResultEntrySuccess;
}

- (BOOL)isFailure {
  return _tag == DBFILESUploadSessionFinishBatchResultEntryFailure;
}

- (NSString *)tagName {
  switch (_tag) {
  case DBFILESUploadSessionFinishBatchResultEntrySuccess:
    return @"DBFILESUploadSessionFinishBatchResultEntrySuccess";
  case DBFILESUploadSessionFinishBatchResultEntryFailure:
    return @"DBFILESUploadSessionFinishBatchResultEntryFailure";
  }

  @throw([NSException exceptionWithName:@"InvalidTag" reason:@"Tag has an unknown value." userInfo:nil]);
}

#pragma mark - Serialization methods

+ (NSDictionary *)serialize:(id)instance {
  return [DBFILESUploadSessionFinishBatchResultEntrySerializer serialize:instance];
}

+ (id)deserialize:(NSDictionary *)dict {
  return [DBFILESUploadSessionFinishBatchResultEntrySerializer deserialize:dict];
}

#pragma mark - Description method

- (NSString *)description {
  return [[DBFILESUploadSessionFinishBatchResultEntrySerializer serialize:self] description];
}

@end

#pragma mark - Serializer Object

@implementation DBFILESUploadSessionFinishBatchResultEntrySerializer

+ (NSDictionary *)serialize:(DBFILESUploadSessionFinishBatchResultEntry *)valueObj {
  NSMutableDictionary *jsonDict = [[NSMutableDictionary alloc] init];

  if ([valueObj isSuccess]) {
    jsonDict[@"success"] = [[DBFILESFileMetadataSerializer serialize:valueObj.success] mutableCopy];
    jsonDict[@".tag"] = @"success";
  } else if ([valueObj isFailure]) {
    jsonDict[@"failure"] = [[DBFILESUploadSessionFinishErrorSerializer serialize:valueObj.failure] mutableCopy];
    jsonDict[@".tag"] = @"failure";
  } else {
    @throw([NSException exceptionWithName:@"InvalidTag"
                                   reason:@"Object not properly initialized. Tag has an unknown value."
                                 userInfo:nil]);
  }

  return jsonDict;
}

+ (DBFILESUploadSessionFinishBatchResultEntry *)deserialize:(NSDictionary *)valueDict {
  NSString *tag = valueDict[@".tag"];

  if ([tag isEqualToString:@"success"]) {
    DBFILESFileMetadata *success = [DBFILESFileMetadataSerializer deserialize:valueDict];
    return [[DBFILESUploadSessionFinishBatchResultEntry alloc] initWithSuccess:success];
  } else if ([tag isEqualToString:@"failure"]) {
    DBFILESUploadSessionFinishError *failure =
        [DBFILESUploadSessionFinishErrorSerializer deserialize:valueDict[@"failure"]];
    return [[DBFILESUploadSessionFinishBatchResultEntry alloc] initWithFailure:failure];
  }

  @throw([NSException
      exceptionWithName:@"InvalidTag"
                 reason:[NSString stringWithFormat:@"Tag has an invalid value: \"%@\".", valueDict[@".tag"]]
               userInfo:nil]);
}

@end