text:
/*
 * Changes for GemFireXD distributed data platform (some marked by "GemStone changes")
 *
 * Portions Copyright (c) 2010-2015 Pivotal Software, Inc. All rights reserved.
 *
 * 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. See accompanying
 * LICENSE file.
 */

package	com.pivotal.gemfirexd.internal.impl.sql.compile;

import com.pivotal.gemfirexd.internal.catalog.AliasInfo;
import com.pivotal.gemfirexd.internal.catalog.TypeDescriptor;
import com.pivotal.gemfirexd.internal.iapi.error.StandardException;
import com.pivotal.gemfirexd.internal.iapi.reference.SQLState;
import com.pivotal.gemfirexd.internal.iapi.services.compiler.LocalField;
import com.pivotal.gemfirexd.internal.iapi.services.compiler.MethodBuilder;
import com.pivotal.gemfirexd.internal.iapi.services.context.ContextManager;
import com.pivotal.gemfirexd.internal.iapi.services.i18n.MessageService;
import com.pivotal.gemfirexd.internal.iapi.services.loader.ClassInspector;
import com.pivotal.gemfirexd.internal.iapi.services.sanity.SanityManager;
import com.pivotal.gemfirexd.internal.iapi.sql.compile.CompilerContext;
import com.pivotal.gemfirexd.internal.iapi.sql.dictionary.TableDescriptor;
import com.pivotal.gemfirexd.internal.iapi.types.DataTypeDescriptor;
import com.pivotal.gemfirexd.internal.iapi.types.StringDataValue;
import com.pivotal.gemfirexd.internal.iapi.util.JBitSet;
import com.pivotal.gemfirexd.internal.impl.sql.compile.ExpressionClassBuilder;

import java.lang.reflect.Member;
import java.lang.reflect.Modifier;

import java.util.Vector;
import java.util.Enumeration;

/**
 * A NewInvocationNode represents a new object() invocation.
 *
 */
public class NewInvocationNode extends MethodCallNode
{
	// Whether or not to do a single instantiation
	private boolean singleInstantiation = false;

	private boolean delimitedIdentifier;

	private boolean isBuiltinVTI = false;

	/**
	 * Initializer for a NewInvocationNode. Parameters are:
	 *
	 *

	 *
javaClassName		The full package.class name of the class

	 *
parameterList		The parameter list for the constructor

	 *

	 *
	 * @exception StandardException		Thrown on error
	 */
	public void init(
					Object javaClassName,
					Object params,
					Object delimitedIdentifier)
		throws StandardException
	{
		super.init("<init>");
		addParms((Vector) params);

		this.javaClassName = (String) javaClassName;
		this.delimitedIdentifier =
				 ((Boolean) delimitedIdentifier).booleanValue();
	}

	/* This version of the "init" method is used for mapping a table name
	 * or table function name to a corresponding VTI class name.  The VTI
	 * is then invoked as a regular NEW invocation node.
	 *
	 * There are two kinds of VTI mappings that we do: the first is for
	 * "table names", the second is for "table function names".  Table
	 * names can only be mapped to VTIs that do not accept any arguments;
	 * any VTI that has at least one constructor which accepts one or more
	 * arguments must be mapped from a table *function* name.  The way we
	 * tell the difference is by looking at the received arguments: if
	 * the vtiTableFuncName that we receive is null then we are mapping
	 * a "table name" and tableDescriptor must be non-null; if the
	 * vtiTableFuncName is non-null then we are mapping a "table
	 * function name" and tableDescriptor must be null.
	 *
	 * Note that we could have just used a single "init()" method and
	 * performed the mappings based on what type of Object "javaClassName"
	 * was (String, TableDescriptor, or TableName), but making this VTI
	 * mapping method separate from the "normal" init() method seems
	 * cleaner...
	 *
	 * @param vtiTableFuncName A TableName object holding a qualified name
	 *  that maps to a VTI which accepts arguments.  If vtiTableFuncName is
	 *  null then tableDescriptor must NOT be null.
	 * @param tableDescriptor A table descriptor that corresponds to a
	 *  table name (as opposed to a table function name) that will be
	 *  mapped to a no-argument VTI.  If tableDescriptor is null then
	 *  vtiTableFuncName should not be null.
	 * @param params Parameter list for the VTI constructor.
	 * @param delimitedIdentifier Whether or not the target class name
	 *  is a delimited identifier.
	 */
	public void init(
					Object vtiTableFuncName,
					Object tableDescriptor,
					Object params,
					Object delimitedIdentifier)
		throws StandardException
	{
		super.init("<init>");
		addParms((Vector) params);

		if (SanityManager.DEBUG)
		{
			// Exactly one of vtiTableFuncName or tableDescriptor should
			// be null.
			SanityManager.ASSERT(
				((vtiTableFuncName == null) && (tableDescriptor != null)) ||
				((vtiTableFuncName != null) && (tableDescriptor == null)),
				"Exactly one of vtiTableFuncName or tableDescriptor should " +
				"be null, but neither or both of them were null.");
		}

		TableName vtiName = (TableName)vtiTableFuncName;
		TableDescriptor td = (TableDescriptor)tableDescriptor;
		boolean isTableFunctionVTI = (vtiTableFuncName != null);
		if (isTableFunctionVTI)
		{
			// We have to create a generic TableDescriptor to
			// pass to the data dictionary.
			td = new TableDescriptor(getDataDictionary(),
					vtiName.getTableName(),
					getSchemaDescriptor(vtiName.getSchemaName()),
					TableDescriptor.VTI_TYPE,
					TableDescriptor.DEFAULT_LOCK_GRANULARITY,
					TableDescriptor.DEFAULT_ROW_LEVEL_SECURITY_ENABLED);
		}

		/* Use the table descriptor to figure out what the corresponding
		 * VTI class name is; we let the data dictionary do the mapping
		 * for us.
		 */
		this.javaClassName = getDataDictionary().getVTIClass(
			td, isTableFunctionVTI);

		this.isBuiltinVTI =
		    ( getDataDictionary().getBuiltinVTIClass( td, isTableFunctionVTI) != null);

		/* If javaClassName is still null at this point then we
		 * could not find the target class for the received table
		 * (or table function) name.  So throw the appropriate
		 * error.
		 */
		if (this.javaClassName == null)
		{
			if (!isTableFunctionVTI)
			{
				/* Create a TableName object from the table descriptor
				 * that we received.  This gives us the name to use
				 * in the error message.
				 */
				vtiName = makeTableName(td.getSchemaName(),
					td.getDescriptorName());
			}

			throw StandardException.newException(
				isTableFunctionVTI
					? SQLState.LANG_NO_SUCH_METHOD_ALIAS
					: SQLState.LANG_TABLE_NOT_FOUND,
				vtiName.getFullTableName(), "" /* GemStoneAddition */);
		}

		this.delimitedIdentifier =
				 ((Boolean) delimitedIdentifier).booleanValue();
	}

	/**
	 * Report whether this node represents a builtin VTI.
	 */
	public  boolean isBuiltinVTI()  { return isBuiltinVTI; }

	/**
	 * Mark this node as only needing to
	 * to a single instantiation.  (We can
	 * reuse the object after newing it.)
	 */
	void setSingleInstantiation()
	{
		singleInstantiation = true;
	}

	/**
	 * Bind this expression.  This means binding the sub-expressions,
	 * as well as figuring out what the return type is for this expression.
	 *
	 * @param fromList		The FROM list for the query this
	 *				expression is in, for binding columns.
	 * @param subqueryList		The subquery list being built as we find SubqueryNodes
	 * @param aggregateVector	The aggregate vector being built as we find AggregateNodes
	 *
	 * @return	Nothing
	 *
	 * @exception StandardException		Thrown on error
	 */

	public JavaValueNode bindExpression(
		FromList fromList, SubqueryList subqueryList,
		Vector aggregateVector)
			throws StandardException
	{
		bindParameters(fromList, subqueryList, aggregateVector);

		verifyClassExist(javaClassName);
		/*
		** Get the parameter type names out of the parameters and put them
		** in an array.
		*/
		String[]	parmTypeNames = getObjectSignature();
		boolean[]	isParam = getIsParam();
		ClassInspector classInspector = getClassFactory().getClassInspector();

		/*
		** Find the matching constructor.
		*/
		try
		{
			/* First try with built-in types and mappings */
			method = classInspector.findPublicConstructor(javaClassName,
											parmTypeNames, null, isParam);

			/* If no match, then retry to match any possible combinations of
			 * object and primitive types.
			 */
			if (method == null)
			{
				String[] primParmTypeNames = getPrimitiveSignature(false);
				method = classInspector.findPublicConstructor(javaClassName,
								parmTypeNames, primParmTypeNames, isParam);
			}
		}
		catch (ClassNotFoundException e)
		{
			/*
			** If one of the classes couldn't be found, just act like the
			** method couldn't be found.  The error lists all the class names,
			** which should give the user enough info to diagnose the problem.
			*/
			method = null;
		}

		if (method == null)
		{
			/* Put the parameter type names into a single string */
			String	parmTypes = "";
			for (int i = 0; i < parmTypeNames.length; i++)
			{
				if (i != 0)
					parmTypes += ", ";
				parmTypes += (parmTypeNames[i].length() != 0 ?
								parmTypeNames[i] :
								MessageService.getTextMessage(
									SQLState.LANG_UNTYPED)
									);
			}

			throw StandardException.newException(SQLState.LANG_NO_CONSTRUCTOR_FOUND,
													javaClassName,
												 	parmTypes);
		}

		methodParameterTypes = classInspector.getParameterTypes(method);

		for (int i = 0; i < methodParameterTypes.length; i++)
		{
			if (classInspector.primitiveType(methodParameterTypes[i]))
				methodParms[i].castToPrimitive(true);
		}

		/* Set type info for any null parameters */
		if ( someParametersAreNull() )
		{
			setNullParameterInfo(methodParameterTypes);
		}

		/* Constructor always returns an object of type javaClassName */
		if (SanityManager.DEBUG) {
			SanityManager.ASSERT(javaClassName.equals(classInspector.getType(method)),
				"Constructor is wrong type, expected " + javaClassName +
				" actual is " + classInspector.getType(method));
		}
	 	setJavaTypeName( javaClassName );
	 	if (routineInfo != null)
                {
                    TypeDescriptor returnType = routineInfo.getReturnType();
                    if (returnType != null)
                    {
                        setCollationType(returnType.getCollationType());
                    }
                }
	 	return this;
	}

	/**
	 * Categorize this predicate.  Initially, this means
	 * building a bit map of the referenced tables for each predicate.
	 * If the source of this ColumnReference (at the next underlying level)
	 * is not a ColumnReference or a VirtualColumnNode then this predicate
	 * will not be pushed down.
	 *
	 * For example, in:
	 *		select * from (select 1 from s) a (x) where x = 1
	 * we will not push down x = 1.
	 * NOTE: It would be easy to handle the case of a constant, but if the
	 * inner SELECT returns an arbitrary expression, then we would have to copy
	 * that tree into the pushed predicate, and that tree could contain
	 * subqueries and method calls.
	 * RESOLVE - revisit this issue once we have views.
	 *
	 * @param referencedTabs	JBitSet with bit map of referenced FromTables
	 * @param simplePredsOnly	Whether or not to consider method
	 *							calls, field references and conditional nodes
	 *							when building bit map
	 *
	 * @return boolean		Whether or not source.expression is a ColumnReference
	 *						or a VirtualColumnNode.
	 * @exception StandardException		Thrown on error
	 */
	public boolean categorize(JBitSet referencedTabs, boolean simplePredsOnly)
		throws StandardException
	{
		/* We stop here when only considering simple predicates
		 *  as we don't consider new opeators when looking
		 * for null invariant predicates.
		 */
		if (simplePredsOnly)
		{
			return false;
		}

		boolean pushable = true;

		pushable = pushable && super.categorize(referencedTabs, simplePredsOnly);

		return pushable;
	}

	/**
	 * Is this class assignable to the specified class?
	 * This is useful for the VTI interface where we want to see
	 * if the class implements java.sql.ResultSet.
	 *
	 * @param toClassName	The java class name we want to assign to
	 *
	 * @return boolean		Whether or not this class is assignable to
	 *						the specified class
	 *
	 * @exception StandardException		Thrown on error
	 */
	protected boolean assignableTo(String toClassName) throws StandardException
	{
		ClassInspector classInspector = getClassFactory().getClassInspector();
		return classInspector.assignableTo(javaClassName, toClassName);
	}

	/**
	 * Is this class have a public method with the specified signiture
	 * This is useful for the VTI interface where we want to see
	 * if the class has the option static method for returning the
	 * ResultSetMetaData.
	 *
	 * @param methodName	The method name we are looking for
	 * @param staticMethod	Whether or not the method we are looking for is static
	 *
	 * @return Member		The Member representing the method (or null
	 *						if the method doesn't exist).
	 *
	 * @exception StandardException		Thrown on error
	 */
	protected Member findPublicMethod(String methodName, boolean staticMethod)
		throws StandardException
	{
		Member publicMethod;

		/*
		** Get the parameter type names out of the parameters and put them
		** in an array.
		*/
		String[]	parmTypeNames = getObjectSignature();
		boolean[]	isParam = getIsParam();

		ClassInspector classInspector = getClassFactory().getClassInspector();

		try
		{
			publicMethod = classInspector.findPublicMethod(javaClassName, methodName,
											   parmTypeNames, null, isParam, staticMethod, false);

			/* If no match, then retry to match any possible combinations of
			 * object and primitive types.
			 */
			if (publicMethod == null)
			{
				String[] primParmTypeNames = getPrimitiveSignature(false);
				publicMethod = classInspector.findPublicMethod(javaClassName,
										methodName, parmTypeNames,
										primParmTypeNames, isParam, staticMethod, false);
			}
		}
		catch (ClassNotFoundException e)
		{
			/* We should always be able to find the class at this point
			 * since the protocol is to check to see if it exists
			 * before checking for a method off of it.  Anyway, just return
			 * null if the class doesn't exist, since the method doesn't
			 * exist in that case.
			 */
			if (SanityManager.DEBUG)
			{
				SanityManager.THROWASSERT("Unexpected exception", e);
			}
			return null;
		}

		return	publicMethod;
	}

	/**
	 * Do code generation for this method call
	 *
	 * @param acb	The ExpressionClassBuilder for the class we're generating
	 * @param mb	The method the expression will go into
	 *
	 *
	 * @exception StandardException		Thrown on error
	 */

	public void generateExpression(ExpressionClassBuilder acb,
											MethodBuilder mb)
									throws StandardException
	{
		/* If this node is for an ungrouped aggregator,
		 * then we generate a conditional
		 * wrapper so that we only new the aggregator once.
		 *		(fx == null) ? fx = new ... : fx
		 */
		LocalField objectFieldLF = null;
		if (singleInstantiation)
		{
			/* Declare the field */
			objectFieldLF = acb.newFieldDeclaration(Modifier.PRIVATE, javaClassName);

			// now we fill in the body of the conditional

			mb.getField(objectFieldLF);
			mb.conditionalIfNull();
		}

		mb.pushNewStart(javaClassName);
		int nargs = generateParameters(acb, mb);
		mb.pushNewComplete(nargs);

		if (singleInstantiation) {

			  mb.putField(objectFieldLF);
			mb.startElseCode();
			  mb.getField(objectFieldLF);
			mb.completeConditional();
		}
	}
}


text:
package com.silentgo.servlet.http;

/**
 * Created by teddyzhu on 16/7/15.
 */
public enum RequestMethod {
    GET("get"), POST("post"), PUT("put"), DELETE("delete"), HEAD("head"), TRACE("trace"), CONNECT("connect"), OPTIONS("options");

    String method;

    RequestMethod(String string) {
        this.method = string;
    }

    public static RequestMethod prase(String method) {
        for (RequestMethod requestMethod : RequestMethod.values()) {
            if (requestMethod.method.equalsIgnoreCase(method)) {
                return requestMethod;
            }
        }
        return RequestMethod.GET;
    }

    public boolean equals(String method) {
        return this.method.equals(method);
    }
}

redpajama_set_name: RedPajamaGithub


text:
require 'rails_helper'

describe "realizes/show" do
  before(:each) do
    @realize = assign(:realize, FactoryBot.create(:realize))
  end

  it "renders attributes in <p>" do
    render
    # Run the generator again with the --webrat flag if you want to use webrat matchers
    rendered.should match(/#{@realize.expression.original_title}/)
  end
end


text:
package requirejs;

import com.intellij.openapi.util.text.StringUtil;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.openapi.vfs.newvfs.impl.VirtualDirectoryImpl;
import com.intellij.openapi.vfs.newvfs.impl.VirtualFileImpl;

import java.util.ArrayList;
import java.util.List;

public final class FileUtils {
    private FileUtils() {
    }

    public static String join(String file, String ext) {
        return file + '/' + ext;
    }

    public static String removeExt(String file, String ext) {
        if (file.endsWith(ext)) {
            return file.replace(ext, "");
        }
        return file;
    }

    public static String relativePath(VirtualFile root, VirtualFile file) {
        // get project relative path
        return file.getPath().substring(root.getPath().length() + 1);
    }

    public static VirtualFile findFileByPath(VirtualFile path, String valuePath) {
        VirtualFile file = path.findFileByRelativePath(valuePath);
        if (null == file || file.isDirectory()) {
            file = path.findFileByRelativePath(valuePath + ".js");
        }
        return file;
    }

    public static String getNormalizedPath(int doubleDotCount, String[] pathsOfPath) {
        StringBuilder newValuePath = new StringBuilder();
        for (int i = 0; i < pathsOfPath.length - doubleDotCount; i++) {
            if (0 != i) {
                newValuePath.append('/');
            }
            newValuePath.append(pathsOfPath[i]);
        }
        return newValuePath.toString();
    }

    public static int getDoubleDotCount(String valuePath) {
        int doubleDotCount = (valuePath.length() - valuePath.replaceAll("\\.\\.", "").length()) / 2;
        boolean doubleDotCountTrues = false;

        while (!doubleDotCountTrues && 0 != doubleDotCount) {
            if (valuePath.startsWith(StringUtil.repeat("../", doubleDotCount))) {
                doubleDotCountTrues = true;
            } else if (valuePath.startsWith(StringUtil.repeat("../", doubleDotCount - 1) + "..")) {
                doubleDotCountTrues = true;
            } else {
                doubleDotCount--;
            }
        }
        return doubleDotCount;
    }

    public static List<String> getAllFilesInDirectory(VirtualFile directory, String target, String replacement) {
        List<String> files = new ArrayList<String>();
        VirtualFile[] children = directory.getChildren();
        for (VirtualFile child : children) {
            if (child instanceof VirtualDirectoryImpl) {
                files.addAll(getAllFilesInDirectory(child, target, replacement));
            } else if (child instanceof VirtualFileImpl) {
                files.add(child.getPath().replace(target, replacement));
            }
        }
        return files;
    }
}


text:
var cli = require('../bin/node-debug');
var expect = require('chai').expect;

describe('node-debug', function() {
  describe('argument parser', function() {
    it('handles `app.js`', function() {
      var config = cli.parseArgs(argv('app.js'));
      delete config.options;
      expect(config).to.eql({
        printScript: true,
        subproc: {
          script: 'app.js',
          args: [],
          execArgs: ['--debug=5858', '--debug-brk'],
          debugPort: 5858
        },
        inspector: {
          port: 8080,
          args: ['--web-port=8080']
        }
      });
    });

    it('handles empty arguments', function() {
      var config = cli.parseArgs(argv());
      expect(config.printScript, 'printScript').to.equal(false);
      expect(config.subproc.script, 'subproc.script')
        .to.eql(require.resolve('../bin/run-repl'));
    });

    it('handles options', function() {
      var config = cli.parseArgs(argv('--no-debug-brk -p 10 -d 20 -c app.js'));
      expect(config.subproc).to.eql({
        script: 'app.js',
        args: [],
        execArgs: ['--debug=20'],
        debugPort: 20
      });
      expect(config.inspector).to.eql({
        port: 10,
        args: ['--web-port=10']
      });
    });

    it('handles long options with =val and no script file', function() {
      var config = cli.parseArgs(argv('--debug-port=10'));
      expect(config.subproc.debugPort).to.equal(10);
    });

    it('ignores options of the debugged application', function() {
      var config = cli.parseArgs(argv('app.js -b -p 10 -d 20 -c carg rest'));
      expect(config.subproc).to.eql({
        script: 'app.js',
        args: '-b -p 10 -d 20 -c carg rest'.split(' '),
        execArgs: ['--debug=5858', '--debug-brk'],
        debugPort: 5858
      });
      expect(config.inspector.port, 'inspector.port').to.eql(8080);
    });

    it('supports slc-debug argument names', function() {
      var config = cli.parseArgs(argv('--suspend --port=10 --debug-port=20'));
      expect(config.subproc.execArgs).to.contain('--debug-brk');
      expect(config.subproc.debugPort, 'subproc.debugPort').to.equal(20);
      expect(config.inspector.port, 'inspector.port').to.equal(10);
    });

    it('supports node-inspector argument names', function() {
      var config = cli.parseArgs(argv('--web-port=10 --debug-port=20 app.js'));
      expect(config.subproc.debugPort, 'subproc.debugPort').to.equal(20);
      expect(config.inspector.port, 'inspector.port').to.equal(10);
    });

    it('forwards unknown options to node-inspector', function() {
      var config = cli.parseArgs(argv('--some-bool --some-string val app.js'));
      expect(config.inspector.args, 'inspector args')
        .to.eql(['--some-bool', '--some-string', 'val', '--web-port=8080']);
      expect(config.subproc.execArgs, 'subprocess args')
        .to.not.include.members(['--some-bool', '--some-string', 'val']);
    });

    function argv(cmdString) {
      cmdString = cmdString || '';
      return ['node', 'node-debug'].concat(cmdString.split(' '));
    }
  });
});


text:
<?php
namespace Craft;

class Formerly_FormRecord extends BaseRecord
{
	public function getTableName()
	{
		return 'formerly_forms';
	}

	protected function defineAttributes()
	{
		return array(
			'name'          => array(AttributeType::Name, 'required' => true),
			'handle'        => array(AttributeType::Handle, 'required' => true),
			'emails'        => AttributeType::Mixed,
		);
	}

	public function defineRelations()
	{
		return array(
			'fieldGroup'  => array(static::BELONGS_TO, 'FieldGroupRecord', 'onDelete' => static::SET_NULL),
			'submissions' => array(static::HAS_MANY, 'Formerly_SubmissionRecord', 'formId'),
		);
	}

	public function defineIndexes()
	{
		return array(
			array('columns' => array('name'), 'unique' => true),
			array('columns' => array('handle'), 'unique' => true),
		);
	}

	public function scopes()
	{
		return array(
			'ordered' => array('order' => 'name'),
		);
	}
}


text:
<?php
namespace TYPO3\CMS\Fluid\Core\ViewHelper\Facets;

/*                                                                        *
 * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
 *                                                                        *
 * It is free software; you can redistribute it and/or modify it under    *
 * the terms of the GNU Lesser General Public License, either version 3   *
 *  of the License, or (at your option) any later version.                *
 *                                                                        *
 * The TYPO3 project - inspiring people to share!                         *
 *                                                                        */

/**
 * Child Node Access Facet. View Helpers should implement this interface if they
 * need access to the direct children in the Syntax Tree at rendering-time.
 * This might happen if you only want to selectively render a part of the syntax
 * tree depending on some conditions.
 * To render subnodes, you can fetch the RenderingContext via $this->renderingContext.
 *
 * In most cases, you will not need this facet, and it is NO PUBLIC API!
 * Right now it is only used internally for conditions, so by subclassing TYPO3\CMS\Fluid\Core\ViewHelpers\AbstractConditionViewHelper, this should be all you need.
 *
 * See \TYPO3\CMS\Fluid\ViewHelpers\IfViewHelper for an example how it is used.
 */
interface ChildNodeAccessInterface
{
    /**
     * Sets the direct child nodes of the current syntax tree node.
     *
     * @param array<\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\AbstractNode> $childNodes
     * @return void
     */
    public function setChildNodes(array $childNodes);
}


text:
<?php

require_once 'phing/types/selectors/BaseExtendSelector.php';

/**
 * Selector that selects a certain kind of file: directory or regular file.
 *
 * @author    Hans Lellelid <hans@xmpl.org> (Phing)
 * @author    Jeff Turner <jefft@apache.org> (Ant)
 * @version   $Id$
 * @package   phing.types.selectors
 */
class TypeSelector extends BaseExtendSelector
{

    private $type;

    /** Key to used for parameterized custom selector */
    const TYPE_KEY = "type";

    /** Valid types */
    private static $types = array('file', 'dir', 'link');

    /**
     * @return string A string describing this object
     */
    public function toString()
    {
        $buf = "{typeselector type: " . $this->type . "}";

        return $buf;
    }

    /**
     * Set the type of file to require.
     * @param string $type The type of file - 'file' or 'dir'
     */
    public function setType($type)
    {
        $this->type = $type;
    }

    /**
     * When using this as a custom selector, this method will be called.
     * It translates each parameter into the appropriate setXXX() call.
     *
     * @param array $parameters the complete set of parameters for this selector
     * @return mixed|void
     */
    public function setParameters($parameters)
    {
        parent::setParameters($parameters);
        if ($parameters !== null) {
            for ($i = 0, $size = count($parameters); $i < $size; $i++) {
                $paramname = $parameters[$i]->getName();
                if (self::TYPE_KEY == strtolower($paramname)) {
                    $this->setType($parameters[$i]->getValue());
                } else {
                    $this->setError("Invalid parameter " . $paramname);
                }
            }
        }
    }

    /**
     * Checks to make sure all settings are kosher. In this case, it
     * means that the pattern attribute has been set.
     *
     */
    public function verifySettings()
    {
        if ($this->type === null) {
            $this->setError("The type attribute is required");
        } elseif (!in_array($this->type, self::$types, true)) {
            $this->setError("Invalid type specified; must be one of (" . implode(self::$types) . ")");
        }
    }

    /**
     * The heart of the matter. This is where the selector gets to decide
     * on the inclusion of a file in a particular fileset.
     *
     * @param  PhingFile $basedir  the base directory the scan is being done from
     * @param  string    $filename is the name of the file to check
     * @param  PhingFile $file     is a PhingFile object the selector can use
     * @return boolean   Whether the file should be selected or not
     */
    public function isSelected(PhingFile $basedir, $filename, PhingFile $file)
    {
        // throw BuildException on error
        $this->validate();

        if ($file->isLink()) {
            if ($this->type == 'link') {
                return true;
            }

            $this->log(
                $file->getAbsolutePath() . " is a link, proceeding with " . $file->getCanonicalPath() . " instead.",
                Project::MSG_DEBUG
            );
            $file = new PhingFile($file->getCanonicalPath());
        }

        if ($file->isDirectory()) {
            return $this->type === 'dir';
        } else {
            return $this->type === 'file';
        }
    }

}


text:
hubot-xregexp
=============

Adds XRegExp support to Hubot.


text:
from __future__ import absolute_import, division, print_function

import numpy as np
import pandas as pd
import sklearn.preprocessing as preprocessing
from sklearn.ensemble import RandomForestRegressor

### Loading data
train = pd.read_csv('train.csv')
test = pd.read_csv('test.csv')

### Concat train + test
alldata = pd.concat(
    [train.ix[:, 'Pclass':'Embarked'],
     test.ix[:, 'Pclass':'Embarked']]).reset_index(drop=True)

### Cleaning the data
# Fare
alldata['Fare'] = alldata['Fare'].fillna(alldata['Fare'].mean())  # median()

# Embarked
alldata['Embarked'] = alldata['Embarked'].fillna(alldata['Embarked'].mode()[0])

# Age: Fill in missing values with RandomForestClassifier
def set_missing_ages(df):
    age_df = df[['Age', 'Fare', 'Parch', 'SibSp', 'Pclass']]
    known_age = age_df[age_df.Age.notnull()].as_matrix()
    unknown_age = age_df[age_df.Age.isnull()].as_matrix()
    y = known_age[:, 0]
    X = known_age[:, 1:]
    rfr = RandomForestRegressor(random_state=10, n_estimators=2000, n_jobs=-1)
    rfr.fit(X, y)
    predictedAges = rfr.predict(unknown_age[:, 1::])
    df.loc[(df.Age.isnull()), 'Age'] = predictedAges
    return df, rfr

alldata, rfr = set_missing_ages(alldata)

### Constructing features
alldata['CabinHead'] = alldata['Cabin'].str[0]
alldata['CabinHead'] = alldata['CabinHead'].fillna('None')
alldata['CabinAlpha'] = (alldata['CabinHead'].isin(['B', 'D', 'E'])) * 1
alldata['NullCabin'] = (alldata['Cabin'].notnull() == True) * 1
alldata['NullCabin'] = alldata['NullCabin'].fillna(0)
alldata['NoSibSp'] = (alldata['SibSp'] <= 0) * 1
alldata['NoParch'] = (alldata['Parch'] <= 0) * 1
alldata['Family'] = alldata['SibSp'] + alldata['Parch'] + 1
alldata['isAlone'] = (alldata['Family'] == 1) * 1

# Constructing a real fare for everyone from Ticket
Ticket = pd.DataFrame(alldata['Ticket'].value_counts())
Ticket.columns = ['PN']
Ticket.head()
alldata1 = pd.merge(alldata, Ticket, left_on='Ticket', right_index=True)
alldata['realFare'] = alldata['Fare'] / alldata1['PN']

# Constructing each person's rank from Name
alldata['Title'] = alldata['Name'].str.split(", |\.", expand=True)[1]
alldata.ix[alldata['Title'].isin(['Ms', 'Mlle']), 'Title'] = 'Miss'
alldata.ix[alldata['Title'].isin(['Mme']), 'Title'] = 'Mrs'
stat_min = 10
title_names = (alldata['Title'].value_counts() < stat_min)
alldata['Title'] = alldata['Title'].apply(lambda x: 'Misc'
                                          if title_names.loc[x] == True else x)

# Constructing a ismother label
alldata['ismother'] = ((alldata['Sex']=='female') & (alldata['Parch'] > 0) \
                    & (alldata['Age']>=16) & (alldata['Title']=='Mrs')) *1

alldata = alldata.drop(
    ['Name', 'SibSp', 'Parch', 'Ticket', 'Fare', 'Cabin', 'CabinHead'], axis=1)

### Dividing the preprocessed files into trainSet and testSet
train_ = pd.concat([alldata.iloc[:train.shape[0], :], train[['Survived']]],
                   axis=1)
test_ = alldata.iloc[train.shape[0]:, :]

### Getting dummies for category features
objList = ['Pclass', 'Sex', 'Embarked', 'Title']
temp_obj = pd.concat([pd.get_dummies(train_[i], prefix=i) for i in objList],
                     axis=1)
temp_num = train_[[
    'NoSibSp', 'NoParch', 'NullCabin', 'CabinAlpha', 'Family', 'isAlone',
    'ismother', 'Age', 'realFare', 'Survived'
]]
trainSet = pd.concat([temp_obj, temp_num], axis=1)

temp_obj = pd.concat([pd.get_dummies(test_[i], prefix=i) for i in objList],
                     axis=1)
temp_num = test_[[
    'NoSibSp', 'NoParch', 'NullCabin', 'CabinAlpha', 'Family', 'isAlone',
    'ismother', 'Age', 'realFare'
]]
testSet = pd.concat([temp_obj, temp_num], axis=1)

### Scaling data
scaler = preprocessing.StandardScaler()
age_scale_param = scaler.fit(trainSet[['Age']])
trainSet['Age'] = scaler.fit_transform(trainSet[['Age']], age_scale_param)
testSet['Age'] = scaler.fit_transform(testSet[['Age']], age_scale_param)

fare_scale_param = scaler.fit(trainSet[['realFare']])
trainSet['realFare'] = scaler.fit_transform(trainSet[['realFare']],
                                            fare_scale_param)
testSet['realFare'] = scaler.fit_transform(testSet[['realFare']],
                                           age_scale_param)

trainSet.columns = [i.lower() for i in trainSet.columns]
testSet.columns = [i.lower() for i in testSet.columns]

trainSet.to_csv('train_dp.csv', index=False)
testSet.to_csv('test_dp.csv', index=False)


text:
<?php

namespace ride\cli\command\orm\doctrine;

use Doctrine\ORM\Tools\Console\Command\GenerateRepositoriesCommand;
use ride\library\dependency\DependencyInjector;

class GenerateRepositoriesDoctrineCommand extends AbstractDoctrineCommand {
    /**
     * @param \ride\library\dependency\DependencyInjector $di
     */
    public function __construct(DependencyInjector $di) {
        parent::__construct($di, new GenerateRepositoriesCommand(), 'doctrine generate repositories');
    }
}


text:
using SA.DataAccess.Sql;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Dapper;
using System.Data;
namespace SA.Authentication.Repository
{
    public class UserRepository : IUserRepository
    {
        readonly Func<IAccessor> accessor;

        public UserRepository(Func<IAccessor> accessor)
        {
            this.accessor = accessor;
        }
        public Models.User GetUserByUsername(string username)
        {
            using (var db = accessor())
            {
                return db.ExecuteQuery<Models.User>("SurvayDataConnection", query => query.Query<Models.User>(new CommandDefinition("[System].[GetUser]", new { Username = username }, commandType: CommandType.StoredProcedure)).FirstOrDefault());
            }
        }
    }
}


text:
<?php

namespace Saft\Store;

use Saft\Rdf\NamedNode;
use Saft\Rdf\Node;
use Saft\Rdf\Statement;
use Saft\Rdf\StatementIterator;
use Saft\Sparql\Result\Result;

/**
 * Declaration of methods that any Store implementation must have, whether its for a Triple- or Quad store.
 *
 * @api
 *
 * @since 0.1
 */
interface Store
{
    /**
     * Adds multiple Statements to (default-) graph.
     *
     * @param StatementIterator|array $statements statementList instance must contain Statement instances which are
     *                                            'concret-' and not 'pattern'-statements
     * @param Node                    $graph      Overrides target graph. If set, all statements will be add to that
     *                                            graph, if it is available. (optional)
     * @param array                   $options    Key-value pairs which provide additional introductions for the store
     *                                            and/or its adapter(s). (optional)
     *
     * @api
     *
     * @since 0.1
     */
    public function addStatements($statements, Node $graph = null, array $options = []);

    /**
     * Removes all statements from a (default-) graph which match with given statement.
     *
     * @param Statement $statement it can be either a concrete or pattern-statement
     * @param Node      $graph     Overrides target graph. If set, all statements will be delete in that
     *                             graph. (optional)
     * @param array     $options   Key-value pairs which provide additional introductions for the store and/or its
     *                             adapter(s). (optional)
     *
     * @api
     *
     * @since 0.1
     */
    public function deleteMatchingStatements(
        Statement $statement,
        Node $graph = null,
        array $options = []
    );

    /**
     * It gets all statements of a given graph which match the following conditions:
     * - statement's subject is either equal to the subject of the same statement of the graph or
     *   it is null.
     * - statement's predicate is either equal to the predicate of the same statement of the graph or
     *   it is null.
     * - statement's object is either equal to the object of a statement of the graph or it is null.
     *
     * @param Statement $statement it can be either a concrete or pattern-statement
     * @param Node      $graph     Overrides target graph. If set, you will get all matching statements of
     *                             that graph. (optional)
     * @param array     $options   It contains key-value pairs and should provide additional introductions for
     *                             the store and/or its adapter(s). (optional)
     *
     * @return StatementIterator it contains Statement instances  of all matching statements of the given graph
     *
     * @api
     *
     * @since 0.1
     */
    public function getMatchingStatements(Statement $statement, Node $graph = null, array $options = []);

    /**
     * Returns true or false depending on whether or not the statements pattern
     * has any matches in the given graph.
     *
     * @param Statement $statement it can be either a concrete or pattern-statement
     * @param Node      $graph     Overrides target graph. (optional)
     * @param array     $options   It contains key-value pairs and should provide additional introductions for the
     *                             store and/or its adapter(s). (optional)
     *
     * @return bool returns true if at least one match was found, false otherwise
     *
     * @api
     *
     * @since 0.1
     */
    public function hasMatchingStatement(Statement $statement, Node $graph = null, array $options = []);

    /**
     * This method sends a SPARQL query to the store.
     *
     * @param string $query   the SPARQL query to send to the store
     * @param array  $options It contains key-value pairs and should provide additional introductions for the
     *                        store and/or its adapter(s). (optional)
     *
     * @return Result Returns result of the query. Its type depends on the type of the query.
     *
     * @throws \Exception if query is no string, is malformed or an execution error occured
     *
     * @api
     *
     * @since 0.1
     */
    public function query($query, array $options = []);

    /**
     * Get information about the store and its features.
     *
     * @return array array which contains information about the store and its features
     *
     * @api
     *
     * @since 0.1
     */
    public function getStoreDescription();

    /**
     * Returns a list of all available graph URIs of the store. It can also respect access control,
     * to only returned available graphs in the current context. But that depends on the implementation
     * and can differ.
     *
     * @return array array with the graph URI as key and a NamedNode as value for each graph
     *
     * @api
     *
     * @since 0.1
     */
    public function getGraphs();

    /**
     * Create a new graph with the URI given as Node. If the underlying store implementation doesn't
     * support empty graphs this method will have no effect.
     *
     * @param NamedNode $graph   instance of NamedNode containing the URI of the graph to create
     * @param array     $options it contains key-value pairs and should provide additional introductions for
     *                           the store and/or its adapter(s)
     *
     * @throws \Exception if given $graph is not a NamedNode
     * @throws \Exception if the given graph could not be created
     *
     * @api
     *
     * @since 0.1
     */
    public function createGraph(NamedNode $graph, array $options = []);

    /**
     * Removes the given graph from the store.
     *
     * @param NamedNode $graph   instance of NamedNode containing the URI of the graph to drop
     * @param array     $options it contains key-value pairs and should provide additional introductions for
     *                           the store and/or its adapter(s)
     *
     * @throws \Exception if given $graph is not a NamedNode
     * @throws \Exception if the given graph could not be droped
     *
     * @api
     *
     * @since 0.1
     */
    public function dropGraph(NamedNode $graph, array $options = []);
}


text:
echo "being start demo project, please wait a moment ... ..."
if [ ! -n "$JAVA_HOME" ]; then
	echo "please make sure you have already install java 8 and set JAVA_HOME in your profile"
	exit 1
fi

if [ ! -x "$JAVA_HOME/bin/java" ]; then
	echo "please make sure you can invoke the command $JAVA_HOME/bin/java"
	exit 1
fi
parentPath=$(dirname $(pwd))

export CLASSPATH = $CLASSPATH:$parentPath/fileserver/target/fileserver-0.0.1-SNAPSHOT.jar
echo $CLASSPATH
echo " begin start file server ... ...."
$JAVA_HOME/bin/java
echo "Congratulation! you can using BI-Platform  with URL :[http://localhost:8090/silkroad/home.html ] and user [demo/demo] through Chrome Browser "


text:
Adozioni libri di testo a.s. {{currentYear.getFullYear()}}-{{nextYear.getFullYear()}}

Corso diurno

      Amm.ne Finanza & Marketing

	  {{adoption.classe}}

      Liceo Scientifico

	  {{adoption.classe}}

      Manut.ne e Assitenza Tecnica

	  {{adoption.classe}}

      Servizi Commerciali

	  {{adoption.classe}}

    No adoptions yet, why don't you create one?


text:
c { dg-do compile }
      subroutine sgbcon(norm,n,kl,ku,ab,ldab,ipiv,anorm,rcond,work,iwork
     &,info)
C
C  -- LAPACK routine (version 3.0) --
C     Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd.,
C     Courant Institute, Argonne National Lab, and Rice University
C     September 30, 1994
C
C     .. Scalar Arguments ..
      character norm
      integer info,kl,ku,ldab,n
      real anorm,rcond
C     ..
C     .. Array Arguments ..
      integer ipiv(n),iwork(n)
      real ab(ldab,n),work(n)
C     ..
C
C  Purpose
C  =======
C demonstrate g77 bug at -O -funroll-loops
C  =====================================================================
C
C     .. Parameters ..
      real one,zero
      parameter(one= 1.0e+0,zero= 0.0e+0)
C     ..
C     .. Local Scalars ..
      logical lnoti,onenrm
      character normin
      integer ix,j,jp,kase,kase1,kd,lm
      real ainvnm,scale,smlnum,t
C     ..
C     .. External Functions ..
      logical lsame
      integer isamax
      real sdot,slamch
      externallsame,isamax,sdot,slamch
C     ..
C     .. External Subroutines ..
      externalsaxpy,slacon,slatbs,srscl,xerbla
C     ..
C     .. Executable Statements ..
C
C           Multiply by inv(L).
C
      do j= 1,n-1
C the following min() intrinsic provokes this bug
         lm= min(kl,n-j)
         jp= ipiv(j)
         t= work(jp)
         if(jp.ne.j)then
C but only when combined with this if block
            work(jp)= work(j)
            work(j)= t
         endif
C and this subroutine call
         call saxpy(lm,-t,ab(kd+1,j),1,work(j+1),1)
      enddo
      return
      end


text:
'use strict';

var angular = require('../../../../../camunda-commons-ui/vendor/angular');

module.exports = [
  '$scope',
  '$q',
  '$location',
  '$interval',
  'search',
  'dataDepend',
  'camAPI',
  function($scope, $q, $location, $interval, search, dataDepend, camAPI) {
    function getPropertyFromLocation(property) {
      var search = $location.search() || {};
      return search[property] || null;
    }

    function updateSilently(params) {
      search.updateSilently(params);
    }

    // init data depend for task list data
    var tasklistData = ($scope.tasklistData = dataDepend.create($scope));
    // get current task id from location
    var taskId = getPropertyFromLocation('task');
    var detailsTab = getPropertyFromLocation('detailsTab');

    // resources
    var Filter = camAPI.resource('filter');
    var Task = camAPI.resource('task');

    // current selected filter
    var currentFilter;

    // provide /////////////////////////////////////////////////////////////////////////////////

    /**
     * Provides the list of filters
     */
    tasklistData.provide('filters', function() {
      var deferred = $q.defer();

      Filter.count({
        itemCount: false,
        resourceType: 'Task'
      })
        .then(function(count) {
          var paginationSize = 2000;

          var pages = Math.ceil(count / paginationSize);
          var requests = [];
          for (var i = 0; i < pages; i++) {
            requests.push(
              Filter.list({
                firstResult: i * paginationSize,
                maxResults: paginationSize,
                itemCount: false,
                resourceType: 'Task'
              })
            );
          }

          return $q.all(requests);
        })
        .then(function(res) {
          deferred.resolve(res.flat(2));
        })
        .catch(function(err) {
          deferred.reject(err);
        });

      return deferred.promise;
    });

    tasklistData.provide('currentFilter', [
      'filters',
      function(filters) {
        var focused,
          filterId = getPropertyFromLocation('filter');

        for (var i = 0, filter; (filter = filters[i]); i++) {
          if (filterId === filter.id) {
            focused = filter;
            break;
          }
          // auto focus first filter
          if (
            !focused ||
            filter.properties.priority < focused.properties.priority
          ) {
            focused = filter;
          }
        }

        if (currentFilter && focused && currentFilter.id !== focused.id) {
          var currentPage = getPropertyFromLocation('page');
          if (currentPage) {
            updateSilently({
              page: '1'
            });
          }
        }

        if (focused && focused.id !== filterId) {
          updateSilently({
            filter: focused.id
          });
        }

        return angular.copy(focused);
      }
    ]);

    tasklistData.provide('searchQuery', {
      processVariables: [],
      taskVariables: [],
      caseInstanceVariables: []
    });

    tasklistData.provide('taskListQuery', [
      'currentFilter',
      'searchQuery',
      function(currentFilter, searchQuery) {
        if (!currentFilter) {
          return null;
        }

        var taskListQuery = angular.copy(searchQuery);

        var firstResult = ((getPropertyFromLocation('page') || 1) - 1) * 15;
        var sorting = getPropertyFromLocation('sorting');
        try {
          sorting = JSON.parse(sorting);
        } catch (err) {
          sorting = [{}];
        }
        sorting = Array.isArray(sorting) && sorting.length ? sorting : [{}];
        sorting[0].sortOrder = sorting[0].sortOrder || 'desc';
        sorting[0].sortBy = sorting[0].sortBy || 'created';

        taskListQuery.id = currentFilter.id;
        taskListQuery.firstResult = firstResult;
        taskListQuery.maxResults = 15;
        taskListQuery.sorting = sorting;
        taskListQuery.active = true;

        return taskListQuery;
      }
    ]);

    /**
     * Provide the list of tasks
     */

    // Handeling of long-running requests
    // store state of last Request
    var lastRequest = $q.defer();
    var lastQuery = {};

    // trigger reloading of the tasks if the query changes
    tasklistData.observe('taskListQuery', function(taskListQuery) {
      var lastRequestIsPending = lastRequest.promise.$$state.status === 0;
      if (
        lastRequestIsPending &&
        JSON.stringify(taskListQuery) !== JSON.stringify(lastQuery)
      ) {
        tasklistData.changed('taskList');
      }
    });

    tasklistData.provide('taskList', [
      'taskListQuery',
      function(taskListQuery) {
        var lastRequestIsPending = lastRequest.promise.$$state.status === 0;
        if (
          !lastRequestIsPending ||
          JSON.stringify(taskListQuery) !== JSON.stringify(lastQuery)
        ) {
          var deferred = $q.defer();
          lastRequest = deferred;
          lastQuery = taskListQuery;

          if (!taskListQuery || taskListQuery.id === null) {
            // no filter selected
            deferred.resolve({
              count: 0,
              _embedded: {}
            });
          } else {
            // filter selected
            Filter.getTasks(angular.copy(taskListQuery), function(err, res) {
              if (err) {
                deferred.resolve(err);
              } else {
                deferred.resolve(res);
              }
            });
          }
          return deferred.promise;
        } else {
          return lastRequest.promise;
        }
      }
    ]);

    /**
     * Provide current task id
     */
    tasklistData.provide('taskId', {taskId: taskId});

    /**
     * Provide the current task or the value 'null' in case no task is selected
     */
    tasklistData.provide('task', [
      'taskId',
      function(task) {
        var deferred = $q.defer();

        var taskId = task.taskId;

        if (typeof taskId !== 'string') {
          deferred.resolve(null);
        } else {
          Task.get(taskId, function(err, res) {
            if (err) {
              deferred.reject(err);
            } else {
              deferred.resolve(res);
            }
          });
        }

        return deferred.promise;
      }
    ]);

    // observe //////////////////////////////////////////////////////////////////////////////

    tasklistData.observe('currentFilter', function(_currentFilter) {
      currentFilter = _currentFilter;
    });

    /*
     * automatically refresh the taskList every 10 seconds so that changes
     * (such as claims) are represented in realtime
     */
    $scope.$on('refresh', function() {
      if (!currentFilter || !currentFilter.properties.refresh) return;

      tasklistData.changed('taskList');
    });

    // routeChanged listener ////////////////////////////////////////////////////////////////

    /**
     * Update task if location changes
     */
    $scope.$on('$routeChanged', function() {
      var oldTaskId = taskId;
      var oldDetailsTab = detailsTab;

      taskId = getPropertyFromLocation('task');
      detailsTab = getPropertyFromLocation('detailsTab');

      if (oldTaskId !== taskId || oldDetailsTab === detailsTab) {
        tasklistData.set('taskId', {taskId: taskId});
      }

      currentFilter = null;
      tasklistData.changed('currentFilter');
    });
  }
];


text:
<?php

/* AcmeInfoBundle:Default:contactus.html.twig */
class __TwigTemplate_6e3c023237128d537cc550e1d71d9d841b6561a58f5feb68718f8bb1b3818fe7 extends Twig_Template
{
    public function __construct(Twig_Environment $env)
    {
        parent::__construct($env);

        $this->parent = $this->env->loadTemplate("::base.html.twig");

        $this->blocks = array(
            'body' => array($this, 'block_body'),
            'content' => array($this, 'block_content'),
        );
    }

    protected function doGetParent(array $context)
    {
        return "::base.html.twig";
    }

    protected function doDisplay(array $context, array $blocks = array())
    {
        $this->parent->display($context, array_merge($this->blocks, $blocks));
    }

    // line 2
    public function block_body($context, array $blocks = array())
    {
        echo $this->env->getExtension('stfalcon_tinymce')->tinymceInit();
        echo "
    ";
        // line 3
        $this->displayBlock('content', $context, $blocks);
    }

    public function block_content($context, array $blocks = array())
    {
        // line 4
        echo "

ContactUs Details

                <form action=\"";
        // line 12
        echo $this->env->getExtension('routing')->getPath("acme_info_contactus");
        echo "\" method=\"POST\">

                        <input type=\"hidden\" value=\"";
        // line 14
        echo twig_escape_filter($this->env, $this->getAttribute($this->getContext($context, "contactus"), "id"), "html", null, true);
        echo "\" name=\"id\">
                        <textarea rows=\"15\" cols=\"60\" name=\"description\">";
        // line 15
        echo twig_escape_filter($this->env, $this->getAttribute($this->getContext($context, "contactus"), "description"), "html", null, true);
        echo "</textarea>

                        <input type=\"submit\" name=\"submit\" value=\"save\" class=\"btn btn-primary\">
                        <input type=\"reset\" name=\"Reset\" value=\"Reset\" class=\"btn btn-danger\" onclick=\"javascript:window.location.href = '";
        // line 20
        echo $this->env->getExtension('routing')->getPath("acme_info_contactus");
        echo "'\"/>

                </form>
            \t\t\t

    ";
    }

    public function getTemplateName()
    {
        return "AcmeInfoBundle:Default:contactus.html.twig";
    }

    public function isTraitable()
    {
        return false;
    }

    public function getDebugInfo()
    {
        return array (  79 => 25,  71 => 20,  64 => 16,  60 => 15,  56 => 14,  51 => 12,  41 => 4,  35 => 3,  29 => 2,);
    }
}


text:
package org.jetbrains.plugins.cbt.runner.internal

import javax.swing.Icon

import com.intellij.execution.configurations.{ConfigurationFactory, ConfigurationType}
import com.intellij.openapi.project.DumbAware
import org.jetbrains.plugins.cbt.CBT

class CbtBuildConfigurationType extends ConfigurationType with DumbAware {
  def getIcon: Icon = CBT.Icon

  def getDisplayName: String = "CBT Internal Task"

  def getConfigurationTypeDescription: String = "CBT Internal Task"

  def getConfigurationFactories: Array[ConfigurationFactory] = Array.empty

  def getId: String = "CbtBuildConfiguration"
}

object CbtBuildConfigurationType {
  def getInstance = new CbtBuildConfigurationType
}


text:
package org.apache.edgent.analytics.math3.stat;

import org.apache.commons.math3.stat.regression.OLSMultipleLinearRegression;
import org.apache.edgent.analytics.math3.json.JsonUnivariateAggregator;

import com.google.gson.JsonElement;
import com.google.gson.JsonObject;

class JsonOLS implements JsonUnivariateAggregator {

    private final Regression type;
    private final OLSMultipleLinearRegression ols = new OLSMultipleLinearRegression();
    private double[] values;
    private int yOffset;

    JsonOLS(Regression type) {
        this.type = type;
    }

    @Override
    public void clear(JsonElement partition, int n) {
        values = new double[n*2];
        yOffset = 0;
    }

    @Override
    public void increment(double v) {
        values[yOffset] = v;
        yOffset+=2;
    }

    void setSampleData() {
        // Fill  in the x values
        for (int x = 0; x < values.length/2; x++)
            values[(x*2)+1] = x;
        ols.newSampleData(values, values.length/2, 1);
    }
    @Override
    public void result(JsonElement partition, JsonObject result) {
        // If there are no values or only a single
        // value then we cannot calculate tne slope.
        if (values.length <= 2)
            return;

        setSampleData();
        double[] regressionParams = ols.estimateRegressionParameters();
        if (regressionParams.length >= 2) {
            // [0] is the constant (zero'th order)
            // [1] is the first order , which we use as the slope.
            final double slope = regressionParams[1];
            if (Double.isFinite(slope))
                result.addProperty(type.name(), slope);
        }
        values = null;
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<level-list xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:maxLevel="0">
        <layer-list>
            <item>
                <shape android:shape="oval">
                    <size
                        android:width="@dimen/item_height"
                        android:height="@dimen/item_height"/>
                    <solid android:color="@color/white"/>
                </shape>
            </item>
            <item>
                <bitmap
                    android:gravity="center"
                    android:alpha="0.54"
                    android:src="@drawable/question"/>
            </item>
        </layer-list>
    </item>
</level-list>


text:
'use strict'

module.exports = {
  CURRENT_VERSION: 'Current Version : ',
  TARGET_VERSION: 'Target Version : ',
  FIRST_INITIALIZE: 'Versioning table does not exist, will be created for the first time',
  CONNECTION_STRING_MUST_BE_PROVIDED: 'ConnectionString must be provided',
  INVALID_TARGET_VERSION: 'Target version parameter must be:\n* a valid version id to migrate to\n* or +1 to roll one step forward\n* or -1 to roll one step back\n* or empty to migrate to the latest version available\nTarget version was set to: ',
  ALREADY_MIGRATED: 'Database is already migrated to the target version',
  MIGRATION_SCRIPT_NOT_FOUND: 'There is no migration script file in current folder and subfolders',
  FILE_NOT_FOUND: 'Migration script could not be found : ',
  NO_MORE_ROLLBACK: "Database at the initial state, can't roll back more",
  NO_MORE_MIGRATE: "Database at the latest version, can't find newer migrations",
  MIGRATION_ERROR: 'Migration could not be completed: ',
  MIGRATION_COMPLETED: 'Migration has been completed successfully\nCurrent database version : ',
  ROLLBACK_COMPLETED: 'Rollback has been completed successfully\nCurrent database version : ',
  INITIAL_STATE: 'initial state',
  NOT_MIGRATED: 'NOT MIGRATED'
}


text:
<bill session="115" type="s" number="503" updated="2017-10-06T05:52:15Z">
  <state datetime="2017-03-02">REFERRED</state>
  <status>
    <introduced datetime="2017-03-02"/>
  </status>
  <introduced datetime="2017-03-02"/>
  <titles>
    <title type="short" as="introduced">Animal Welfare Accountability and Transparency Act</title>
    <title type="short" as="introduced">Animal Welfare Accountability and Transparency Act</title>
    <title type="official" as="introduced">A bill to require the Secretary of Agriculture to make publicly available certain regulatory records relating to the administration of the Animal Welfare Act and the Horse Protection Act, to amend the Internal Revenue Code of 1986 to provide for the use of an alternative depreciation system for taxpayers violating rules under the Animal Welfare Act and the Horse Protection Act, and for other purposes.</title>
    <title type="display">Animal Welfare Accountability and Transparency Act</title>
  </titles>
  <sponsor bioguide_id="W000779"/>
  <cosponsors>
    <cosponsor bioguide_id="B001277" joined="2017-03-02"/>
    <cosponsor bioguide_id="B001288" joined="2017-03-02"/>
    <cosponsor bioguide_id="C000127" joined="2017-03-02"/>
    <cosponsor bioguide_id="G000555" joined="2017-10-05"/>
    <cosponsor bioguide_id="M000639" joined="2017-03-02"/>
    <cosponsor bioguide_id="P000595" joined="2017-03-02"/>
  </cosponsors>
  <actions>
    <action datetime="2017-03-02">
      <text>Introduced in Senate</text>
    </action>
    <action datetime="2017-03-02" state="REFERRED">
      <text>Read twice and referred to the Committee on Finance.</text>
      <reference ref="CR S1580" label="Sponsor introductory remarks on measure"/>
      <reference ref="CR S1580-1581" label="text of measure as introduced"/>
    </action>
  </actions>
  <committees>
    <committee subcommittee="" code="SSFI" name="Senate Finance" activity="Referral"/>
  </committees>
  <relatedbills>
    <bill type="h" session="115" relation="identical" number="1368"/>
  </relatedbills>
  <subjects>
    <term name="Animals"/>
    <term name="Administrative law and regulatory procedures"/>
    <term name="Animal protection and human-animal relationships"/>
    <term name="Business investment and capital"/>
    <term name="Civil actions and liability"/>
    <term name="Department of Agriculture"/>
    <term name="Government information and archives"/>
    <term name="Income tax deductions"/>
    <term name="Judicial review and appeals"/>
    <term name="Licensing and registrations"/>
    <term name="Mammals"/>
  </subjects>
  <amendments/>
  <summary date="2017-03-02T05:00:00Z" status="Introduced in Senate">Animal Welfare Accountability and Transparency Act

This bill requires the Department of Agriculture (USDA) to maintain and publicly disclose records relating to the administration of the Animal Welfare Act and the Horse Protection Act, including specified details regarding inspections, enforcement actions, regulations, registrations, and licenses under the two laws. Within 90 days of the enactment of this bill, USDA must make the records available to the public in an online searchable database in a machine-readable format on its website.

The bill also amends the Internal Revenue Code to require a taxpayer who has been convicted or assessed civil penalties for violating certain provisions of the Animal Welfare Act or the Horse Protection Act to use the alternative depreciation system that increases the number of years over which property is depreciated. The taxpayer must use the system for any property placed in service during the five-year period beginning with the year in which the period for seeking judicial review of a civil penalty has lapsed or in which there has been a final judgment entered with respect to the violation, whichever is earlier.</summary>
  <committee-reports/>
</bill>


text:
package com.ettrema.http.caldav;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;

/**
 * A helper class to parse and format the iCalendar specification
 *
 * To use this, first implement the appropriate interface (E.g. EventResource for VEVENT)
 * and then use this class to implement getICalData
 *
 * Eg
 *
 *     public String getICalData() {
ICalFormatter formatter = new ICalFormatter();
return formatter.formatEvent( this );
}
 *
 * @author brad
 */
public class ICalFormatter {

    // Changed T to space. removed trailing Z
    private static final String PATTERN_ICAL = "yyyyMMdd HHmmss";

    public void parseEvent( EventResource r, String data ) {
        String[] lines = data.split( "\n" );
        Map<String, String> mapOfPairs = new HashMap<String, String>();
        for( String line : lines ) {
            String[] arr = line.split( ":" );
            mapOfPairs.put( arr[0], arr[1] );
        }
        r.setSummary( mapOfPairs.get( "SUMMARY"));
        r.setStart( parseDate(mapOfPairs.get( "DTSTART")));
        r.setEnd( parseDate(mapOfPairs.get( "DTEND")));
    }

    public String formatEvent( EventResource r ) {
        return "BEGIN:VCALENDAR\n"
            + "VERSION:2.0\n"
            + "PRODID:-//MiltonCalDAV//EN\n"
            + "BEGIN:VEVENT\n"
            + "UID:" + r.getUniqueId() + "\n"
            + "DTSTAMP:19970714T170000Z\n"
            + "SUMMARY:" + r.getSummary() + "\n"
            + "DTSTART:" + formatDate( r.getStart() ) + "\n"
            + "DTEND:" + formatDate( r.getEnd() ) + "\n"
            + "END:VEVENT\n"
            + "END:VCALENDAR";
    }

    private Date parseDate(String s) {
        if( s == null || s.length() == 0) return null;
        s = s.replace( "T", " ");
        s = s.replace( "Z", "");
        SimpleDateFormat sdf = new SimpleDateFormat( PATTERN_ICAL);
        try {
            return sdf.parse( s );
        } catch( ParseException ex ) {
            throw new RuntimeException( s, ex );
        }
    }

    private String formatDate( Date d ) {
        if( d == null ) return "";
        Calendar cal = Calendar.getInstance();
        cal.setTime( d );
        StringBuilder sb = new StringBuilder();
        sb.append( cal.get( Calendar.YEAR ) + "" );
        sb.append( pad2( cal.get( Calendar.MONTH ) + 1 ) );
        sb.append( pad2( cal.get( Calendar.DAY_OF_MONTH ) ) );
        sb.append( 'T' );
        sb.append( pad2( cal.get( Calendar.HOUR_OF_DAY ) ) );
        sb.append( pad2( cal.get( Calendar.MINUTE ) ) );
        sb.append( pad2( cal.get( Calendar.SECOND ) ) );
        sb.append( 'Z' );
        String s = sb.toString();
        return s;
    }

    private static String pad2( int i ) {
        if( i < 10 ) {
            return "0" + i;
        } else {
            return i + "";
        }
    }
}


text:
<?php

/*
 * This file was taken from Composer (https://github.com/composer/composer)
 * and improved as suggested since PHP min version is 5.6
 */

namespace Fazland\Rabbitd\Tests\Util;

use Fazland\Rabbitd\Util\Silencer;

/**
 * SilencerTest
 *
 * @author Niels Keurentjes <niels.keurentjes@omines.com>
 */
class SilencerTest extends \PHPUnit_Framework_TestCase
{
    /**
     * Test succeeds when no warnings are emitted externally, and original level is restored.
     */
    public function testSilencer()
    {
        $before = error_reporting();

        // Check warnings are suppressed correctly
        Silencer::suppress();
        @trigger_error('Test', E_USER_WARNING);
        Silencer::restore();

        // Check all parameters and return values are passed correctly in a silenced call.
        $result = Silencer::call(function ($a, $b, $c) {
            @trigger_error('Test', E_USER_WARNING);

            return $a * $b * $c;
        }, 2, 3, 4);
        $this->assertEquals(24, $result);

        // Check the error reporting setting was restored correctly
        $this->assertEquals($before, error_reporting());
    }

    /**
     * Test whether exception from silent callbacks are correctly forwarded.
     * @expectedException \RuntimeException
     */
    public function testSilencedException()
    {
        $verification = microtime();
        $this->expectExceptionMessage($verification);

        Silencer::call(function () use ($verification) {
            throw new \RuntimeException($verification);
        });
    }
}


text:
<?xml version='1.0' encoding='utf-8'?>
<widget id="de.buzzwoo.dev.mapkit" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
    <name>MapKitTest</name>
    <description>
        A sample Apache Cordova application that responds to the deviceready event.
    </description>
    <author email="dev@cordova.apache.org" href="http://cordova.io">
        Apache Cordova Team
    </author>
    <content src="index.html" />
    <access origin="*" />
</widget>


text:
pkgdatadir = $(datadir)/bcm2835
pkgincludedir = $(includedir)/bcm2835
pkglibdir = $(libdir)/bcm2835
pkglibexecdir = $(libexecdir)/bcm2835
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
subdir = doc
DIST_COMMON = $(srcdir)/Doxyfile.in $(srcdir)/Makefile.am \
	$(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
	$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES = Doxyfile
CONFIG_CLEAN_VPATH_FILES =
SOURCES =
DIST_SOURCES =
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = ${SHELL} /home/pi/rasp-tempsensor/bcm2835/missing --run aclocal-1.11
AMTAR = ${SHELL} /home/pi/rasp-tempsensor/bcm2835/missing --run tar
AUTOCONF = ${SHELL} /home/pi/rasp-tempsensor/bcm2835/missing --run autoconf
AUTOHEADER = ${SHELL} /home/pi/rasp-tempsensor/bcm2835/missing --run autoheader
AUTOMAKE = ${SHELL} /home/pi/rasp-tempsensor/bcm2835/missing --run automake-1.11
AWK = mawk
CC = gcc
CCDEPMODE = depmode=gcc3
CFLAGS = -g -O2
CPPFLAGS =
CYGPATH_W = echo
DEFS = -DHAVE_CONFIG_H
DEPDIR = .deps
DOXYGEN =
ECHO_C =
ECHO_N = -n
ECHO_T =
EXEEXT =
INSTALL = /usr/bin/install -c
INSTALL_DATA = ${INSTALL} -m 644
INSTALL_PROGRAM = ${INSTALL}
INSTALL_SCRIPT = ${INSTALL}
INSTALL_STRIP_PROGRAM = $(install_sh) -c -s
LDFLAGS =
LIBOBJS =
LIBS =
LTLIBOBJS =
MAKEINFO = ${SHELL} /home/pi/rasp-tempsensor/bcm2835/missing --run makeinfo
MKDIR_P = /bin/mkdir -p
OBJEXT = o
PACKAGE = bcm2835
PACKAGE_BUGREPORT = mikem@open.com.au
PACKAGE_NAME = bcm2835
PACKAGE_STRING = bcm2835 1.8
PACKAGE_TARNAME = bcm2835
PACKAGE_URL =
PACKAGE_VERSION = 1.8
PATH_SEPARATOR = :
RANLIB = ranlib
SET_MAKE =
SHELL = /bin/bash
STRIP =
VERSION = 1.8
abs_builddir = /home/pi/rasp-tempsensor/bcm2835/doc
abs_srcdir = /home/pi/rasp-tempsensor/bcm2835/doc
abs_top_builddir = /home/pi/rasp-tempsensor/bcm2835
abs_top_srcdir = /home/pi/rasp-tempsensor/bcm2835
ac_ct_CC = gcc
am__include = include
am__leading_dot = .
am__quote =
am__tar = ${AMTAR} chof - "$$tardir"
am__untar = ${AMTAR} xf -
bindir = ${exec_prefix}/bin
build_alias =
builddir = .
datadir = ${datarootdir}
datarootdir = ${prefix}/share
docdir = ${datarootdir}/doc/${PACKAGE_TARNAME}
dvidir = ${docdir}
exec_prefix = ${prefix}
host_alias =
htmldir = ${docdir}
includedir = ${prefix}/include
infodir = ${datarootdir}/info
install_sh = ${SHELL} /home/pi/rasp-tempsensor/bcm2835/install-sh
libdir = ${exec_prefix}/lib
libexecdir = ${exec_prefix}/libexec
localedir = ${datarootdir}/locale
localstatedir = ${prefix}/var
mandir = ${datarootdir}/man
mkdir_p = /bin/mkdir -p
oldincludedir = /usr/include
pdfdir = ${docdir}
prefix = /usr/local
program_transform_name = s,x,x,
psdir = ${docdir}
sbindir = ${exec_prefix}/sbin
sharedstatedir = ${prefix}/com
srcdir = .
sysconfdir = ${prefix}/etc
target_alias =
top_build_prefix = ../
top_builddir = ..
top_srcdir = ..
#CLEANFILES = doxyfile.stamp *~
all: all-am

.SUFFIXES:
$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
	@for dep in $?; do \
	  case '$(am__configure_deps)' in \
	    *$$dep*) \
	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
	        && { if test -f $@; then exit 0; else break; fi; }; \
	      exit 1;; \
	  esac; \
	done; \
	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/Makefile'; \
	$(am__cd) $(top_srcdir) && \
	  $(AUTOMAKE) --gnu doc/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
	@case '$?' in \
	  *config.status*) \
	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
	  *) \
	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
	esac;

$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh

$(top_srcdir)/configure:  $(am__configure_deps)
	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
#Doxyfile: $(top_builddir)/config.status $(srcdir)/Doxyfile.in
#	cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
tags: TAGS
TAGS:

ctags: CTAGS
CTAGS:

distdir: $(DISTFILES)
	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
	list='$(DISTFILES)'; \
	  dist_files=`for file in $$list; do echo $$file; done | \
	  sed -e "s|^$$srcdirstrip/||;t" \
	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
	case $$dist_files in \
	  */*) $(MKDIR_P) `echo "$$dist_files" | \
			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
			   sort -u` ;; \
	esac; \
	for file in $$dist_files; do \
	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
	  if test -d $$d/$$file; then \
	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
	    if test -d "$(distdir)/$$file"; then \
	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
	    fi; \
	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
	    fi; \
	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
	  else \
	    test -f "$(distdir)/$$file" \
	    || cp -p $$d/$$file "$(distdir)/$$file" \
	    || exit 1; \
	  fi; \
	done
check-am: all-am
check: check-am
all-local:
all-am: Makefile all-local
installdirs:
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am

install-am: all-am
	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am

installcheck: installcheck-am
install-strip:
	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
	  `test -z '$(STRIP)' || \
	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:

clean-generic:
	-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)

distclean-generic:
	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)

maintainer-clean-generic:
	@echo "This command is intended for maintainers to use"
	@echo "it deletes files that may require special tools to rebuild."
clean-local:
clean: clean-am

clean-am: clean-generic clean-local mostlyclean-am

distclean: distclean-am
	-rm -f Makefile
distclean-am: clean-am distclean-generic

dvi: dvi-am

dvi-am:

html: html-am

html-am:

info: info-am

info-am:

install-data-am:

install-dvi: install-dvi-am

install-dvi-am:

install-exec-am:

install-html: install-html-am

install-html-am:

install-info: install-info-am

install-info-am:

install-man:

install-pdf: install-pdf-am

install-pdf-am:

install-ps: install-ps-am

install-ps-am:

installcheck-am:

maintainer-clean: maintainer-clean-am
	-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic

mostlyclean: mostlyclean-am

mostlyclean-am: mostlyclean-generic

pdf: pdf-am

pdf-am:

ps: ps-am

ps-am:

uninstall-am:

.MAKE: install-am install-strip

.PHONY: all all-am all-local check check-am clean clean-generic \
	clean-local distclean distclean-generic distdir dvi dvi-am \
	html html-am info info-am install install-am install-data \
	install-data-am install-dvi install-dvi-am install-exec \
	install-exec-am install-html install-html-am install-info \
	install-info-am install-man install-pdf install-pdf-am \
	install-ps install-ps-am install-strip installcheck \
	installcheck-am installdirs maintainer-clean \
	maintainer-clean-generic mostlyclean mostlyclean-generic pdf \
	pdf-am ps ps-am uninstall uninstall-am

#doxyfile.stamp: ../src/bcm2835.h
#	$(DOXYGEN) Doxyfile
#	echo Timestamp > doxyfile.stamp

#all-local: doxyfile.stamp

#clean-local:
#	rm -rf html

# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:


text:
require 'seth/provider/mount'

class Seth
  class Provider
    class Mount
      class Aix < Seth::Provider::Mount::Mount

        # Override for aix specific handling
        def initialize(new_resource, run_context)
          super
          # options and fstype are set to "defaults" and "auto" respectively in the Mount Resource class. These options are not valid for AIX, override them.
          if @new_resource.options[0] == "defaults"
            @new_resource.options.clear
          end
          if @new_resource.fstype == "auto"
            @new_resource.fstype = nil
          end
        end

        def enabled?
          # Check to see if there is an entry in /etc/filesystems. Last entry for a volume wins. Using command "lsfs" to fetch entries.
          enabled = false

          # lsfs o/p = #MountPoint:Device:Vfs:Nodename:Type:Size:Options:AutoMount:Acct
          # search only for current mount point
          shell_out("lsfs -c #{@new_resource.mount_point}").stdout.each_line do | line |
            case line
            when /^#\s/
              next
            when /^#{Regexp.escape(@new_resource.mount_point)}:#{device_fstab_regex}:(\S+):(\[\S+\])?:(\S+)?:(\S+):(\S+):(\S+):(\S+)/
              # mount point entry with ipv6 address for nodename (ipv6 address use ':')
              enabled = true
              @current_resource.fstype($1)
              @current_resource.options($5)
              Seth::Log.debug("Found mount #{device_fstab} to #{@new_resource.mount_point} in /etc/filesystems")
              next
            when /^#{Regexp.escape(@new_resource.mount_point)}:#{device_fstab_regex}::(\S+):(\S+)?:(\S+)?:(\S+):(\S+):(\S+):(\S+)/
              # mount point entry with hostname or ipv4 address
              enabled = true
              @current_resource.fstype($1)
              @current_resource.options($5)
              Seth::Log.debug("Found mount #{device_fstab} to #{@new_resource.mount_point} in /etc/filesystems")
              next
            when /^#{Regexp.escape(@new_resource.mount_point)}/
              enabled=false
              Seth::Log.debug("Found conflicting mount point #{@new_resource.mount_point} in /etc/filesystems")
            end
          end
          @current_resource.enabled(enabled)
        end

        def mounted?
          mounted = false
          shell_out!("mount").stdout.each_line do |line|
            if network_device?
              device_details = device_fstab.split(":")
              search_device = device_details[1]
            else
              search_device = device_fstab_regex
            end
            case line
            when /#{search_device}\s+#{Regexp.escape(@new_resource.mount_point)}/
              mounted = true
              Seth::Log.debug("Special device #{device_logstring} mounted as #{@new_resource.mount_point}")
            when /^[\/\w]+\s+#{Regexp.escape(@new_resource.mount_point)}\s+/
              mounted = false
              Seth::Log.debug("Found conflicting mount point #{@new_resource.mount_point} in /etc/fstab")
            end
          end
          @current_resource.mounted(mounted)
        end

        def mount_fs
          unless @current_resource.mounted
            mountable?
            command = "mount -v #{@new_resource.fstype}"

            if !(@new_resource.options.nil? || @new_resource.options.empty?)
              command << " -o #{@new_resource.options.join(',')}"
            end

            command << case @new_resource.device_type
            when :device
              " #{device_real}"
            when :label
              " -L #{@new_resource.device}"
            when :uuid
              " -U #{@new_resource.device}"
            end
            command << " #{@new_resource.mount_point}"
            shell_out!(command)
            Seth::Log.debug("#{@new_resource} is mounted at #{@new_resource.mount_point}")
          else
            Seth::Log.debug("#{@new_resource} is already mounted at #{@new_resource.mount_point}")
          end
        end

        def remount_command
          if !(@new_resource.options.nil? || @new_resource.options.empty?)
            return "mount -o remount,#{@new_resource.options.join(',')} #{@new_resource.device} #{@new_resource.mount_point}"
          else
            return "mount -o remount #{@new_resource.device} #{@new_resource.mount_point}"
          end
        end

        def enable_fs
          if @current_resource.enabled && mount_options_unchanged?
            Seth::Log.debug("#{@new_resource} is already enabled - nothing to do")
            return nil
          end

          if @current_resource.enabled
            # The current options don't match what we have, so
            # disable, then enable.
            disable_fs
          end
          ::File.open("/etc/filesystems", "a") do |fstab|
            fstab.puts("#{@new_resource.mount_point}:")
            if network_device?
              device_details = device_fstab.split(":")
              fstab.puts("\tdev\t\t= #{device_details[1]}")
              fstab.puts("\tnodename\t\t= #{device_details[0]}")
            else
              fstab.puts("\tdev\t\t= #{device_fstab}")
            end
            fstab.puts("\tvfs\t\t= #{@new_resource.fstype}")
            fstab.puts("\tmount\t\t= false")
            fstab.puts "\toptions\t\t= #{@new_resource.options.join(',')}" unless @new_resource.options.nil? || @new_resource.options.empty?
            Seth::Log.debug("#{@new_resource} is enabled at #{@new_resource.mount_point}")
          end
        end

        def disable_fs
          contents = []
          if @current_resource.enabled
            found_device = false
            ::File.open("/etc/filesystems", "r").each_line do |line|
              case line
              when /^\/.+:\s*$/
                if line =~ /#{Regexp.escape(@new_resource.mount_point)}+:/
                  found_device = true
                else
                  found_device = false
                end
              end
              if !found_device
                contents << line
              end
            end
            ::File.open("/etc/filesystems", "w") do |fstab|
              contents.each { |line| fstab.puts line}
            end
          else
            Seth::Log.debug("#{@new_resource} is not enabled - nothing to do")
          end
        end

    end
   end
  end
end


text:
import argparse
import json
import re
import os.path
# BEGIN OPENSOURCE
import sys
sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), os.pardir))
# END OPENSOURCE
import tmp.benchmarks_pb2 as benchmarks_pb2

__file_size_map = {}

def __get_data_size(filename):
  if filename[0] != '/':
    filename = os.path.dirname(os.path.abspath(__file__)) + "/../" + filename
  if filename in __file_size_map:
    return __file_size_map[filename]
  benchmark_dataset = benchmarks_pb2.BenchmarkDataset()
  benchmark_dataset.ParseFromString(
      open(filename, "rb").read())
  size = 0
  count = 0
  for payload in benchmark_dataset.payload:
    size += len(payload)
    count += 1
  __file_size_map[filename] = (size, 1.0 * size / count)
  return size, 1.0 * size / count

def __extract_file_name(file_name):
  name_list = re.split(r"[/\.]", file_name)
  short_file_name = ""
  for name in name_list:
    if name[:14] == "google_message":
      short_file_name = name
  return short_file_name

__results = []

# CPP results example:
# [
#   "benchmarks": [
#     {
#       "bytes_per_second": int,
#       "cpu_time_ns": double,
#       "iterations": int,
#       "name: string,
#       "real_time_ns: double,
#       ...
#     },
#     ...
#   ],
#   ...
# ]
def __parse_cpp_result(filename):
  if filename == "":
    return
  if filename[0] != '/':
    filename = os.path.dirname(os.path.abspath(__file__)) + '/' + filename
  with open(filename, encoding="utf-8") as f:
    results = json.loads(f.read())
    for benchmark in results["benchmarks"]:
      data_filename = "".join(
          re.split("(_parse_|_serialize)", benchmark["name"])[0])
      behavior = benchmark["name"][len(data_filename) + 1:]
      if data_filename[:2] == "BM":
        data_filename = data_filename[3:]
      __results.append({
        "language": "cpp",
        "dataFilename": data_filename,
        "behavior": behavior,
        "throughput": benchmark["bytes_per_second"] / 2.0 ** 20
      })

# Synthetic benchmark results example:
# [
#   "benchmarks": [
#     {
#       "cpu_time_ns": double,
#       "iterations": int,
#       "name: string,
#       "real_time_ns: double,
#       ...
#     },
#     ...
#   ],
#   ...
# ]
def __parse_synthetic_result(filename):
  if filename == "":
    return
  if filename[0] != "/":
    filename = os.path.dirname(os.path.abspath(__file__)) + "/" + filename
  with open(filename, encoding="utf-8") as f:
    results = json.loads(f.read())
    for benchmark in results["benchmarks"]:
      __results.append({
          "language": "cpp",
          "dataFilename": "",
          "behavior": "synthetic",
          "throughput": 10.0**9 / benchmark["cpu_time_ns"]
      })

# Python results example:
# [
#   [
#     {
#       "filename": string,
#       "benchmarks": {
#         behavior: results,
#         ...
#       },
#     },
#     ...
#   ], #pure-python
#   ...
# ]
def __parse_python_result(filename):
  if filename == "":
    return
  if filename[0] != '/':
    filename = os.path.dirname(os.path.abspath(__file__)) + '/' + filename
  with open(filename, encoding="utf-8") as f:
    results_list = json.loads(f.read())
    for results in results_list:
      for result in results:
        _, avg_size = __get_data_size(result["filename"])
        for behavior in result["benchmarks"]:
          __results.append({
            "language": "python",
            "dataFilename": __extract_file_name(result["filename"]),
            "behavior": behavior,
            "throughput": result["benchmarks"][behavior]
          })

# Java results example:
# [
#   {
#     "id": string,
#     "instrumentSpec": {...},
#     "measurements": [
#       {
#         "weight": float,
#         "value": {
#           "magnitude": float,
#           "unit": string
#         },
#         ...
#       },
#       ...
#     ],
#     "run": {...},
#     "scenario": {
#       "benchmarkSpec": {
#         "methodName": string,
#         "parameters": {
#            defined parameters in the benchmark: parameters value
#         },
#         ...
#       },
#       ...
#     }
#
#   },
#   ...
# ]
def __parse_java_result(filename):
  if filename == "":
    return
  if filename[0] != '/':
    filename = os.path.dirname(os.path.abspath(__file__)) + '/' + filename
  with open(filename, encoding="utf-8") as f:
    results = json.loads(f.read())
    for result in results:
      total_weight = 0
      total_value = 0
      for measurement in result["measurements"]:
        total_weight += measurement["weight"]
        total_value += measurement["value"]["magnitude"]
      avg_time = total_value * 1.0 / total_weight
      total_size, _ = __get_data_size(
          result["scenario"]["benchmarkSpec"]["parameters"]["dataFile"])
      __results.append({
        "language": "java",
        "throughput": total_size / avg_time * 1e9 / 2 ** 20,
        "behavior": result["scenario"]["benchmarkSpec"]["methodName"],
        "dataFilename": __extract_file_name(
            result["scenario"]["benchmarkSpec"]["parameters"]["dataFile"])
      })

# Go benchmark results:
#
# goos: linux
# goarch: amd64
# Benchmark/.././datasets/google_message2/dataset.google_message2.pb/Unmarshal-12               3000      705784 ns/op
# Benchmark/.././datasets/google_message2/dataset.google_message2.pb/Marshal-12                 2000      634648 ns/op
# Benchmark/.././datasets/google_message2/dataset.google_message2.pb/Size-12                    5000      244174 ns/op
# Benchmark/.././datasets/google_message2/dataset.google_message2.pb/Clone-12                    300     4120954 ns/op
# Benchmark/.././datasets/google_message2/dataset.google_message2.pb/Merge-12                    300     4108632 ns/op
# PASS
# ok    _/usr/local/google/home/yilunchong/mygit/protobuf/benchmarks  124.173s
def __parse_go_result(filename):
  if filename == "":
    return
  if filename[0] != '/':
    filename = os.path.dirname(os.path.abspath(__file__)) + '/' + filename
  with open(filename, encoding="utf-8") as f:
    for line in f:
      result_list = re.split(r"[\ \t]+", line)
      if result_list[0][:9] != "Benchmark":
        continue
      first_slash_index = result_list[0].find('/')
      last_slash_index = result_list[0].rfind('/')
      full_filename = result_list[0][first_slash_index+1:last_slash_index]
      total_bytes, _ = __get_data_size(full_filename)
      behavior_with_suffix = result_list[0][last_slash_index+1:]
      last_dash = behavior_with_suffix.rfind("-")
      if last_dash == -1:
        behavior = behavior_with_suffix
      else:
        behavior = behavior_with_suffix[:last_dash]
      __results.append({
        "dataFilename": __extract_file_name(full_filename),
        "throughput": total_bytes / float(result_list[2]) * 1e9 / 2 ** 20,
        "behavior": behavior,
        "language": "go"
      })

# Self built json results example:
#
# [
#   {
#     "filename": string,
#     "benchmarks": {
#       behavior: results,
#       ...
#     },
#   },
#   ...
# ]
def __parse_custom_result(filename, language):
  if filename == "":
    return
  if filename[0] != '/':
    filename = os.path.dirname(os.path.abspath(__file__)) + '/' + filename
  with open(filename, encoding="utf-8") as f:
    results = json.loads(f.read())
    for result in results:
      _, avg_size = __get_data_size(result["filename"])
      for behavior in result["benchmarks"]:
        __results.append({
          "language": language,
          "dataFilename": __extract_file_name(result["filename"]),
          "behavior": behavior,
          "throughput": result["benchmarks"][behavior]
        })

def __parse_js_result(filename, language):
  return __parse_custom_result(filename, language)

def __parse_php_result(filename, language):
  return __parse_custom_result(filename, language)

def get_result_from_file(cpp_file="",
                         java_file="",
                         python_file="",
                         go_file="",
                         synthetic_file="",
                         node_file="",
                         php_c_file="",
                         php_file=""):
  results = {}
  if cpp_file != "":
    __parse_cpp_result(cpp_file)
  if java_file != "":
    __parse_java_result(java_file)
  if python_file != "":
    __parse_python_result(python_file)
  if go_file != "":
    __parse_go_result(go_file)
  if synthetic_file != "":
    __parse_synthetic_result(synthetic_file)
  if node_file != "":
    __parse_js_result(node_file, "node")
  if php_file != "":
    __parse_php_result(php_file, "php")
  if php_c_file != "":
    __parse_php_result(php_c_file, "php")

  return __results

if __name__ == "__main__":
  parser = argparse.ArgumentParser()
  parser.add_argument(
      "-cpp",
      "--cpp_input_file",
      help="The CPP benchmark result file's name",
      default="")
  parser.add_argument(
      "-java",
      "--java_input_file",
      help="The Java benchmark result file's name",
      default="")
  parser.add_argument(
      "-python",
      "--python_input_file",
      help="The Python benchmark result file's name",
      default="")
  parser.add_argument(
      "-go",
      "--go_input_file",
      help="The golang benchmark result file's name",
      default="")
  parser.add_argument(
      "-node",
      "--node_input_file",
      help="The node.js benchmark result file's name",
      default="")
  parser.add_argument(
      "-php",
      "--php_input_file",
      help="The pure php benchmark result file's name",
      default="")
  parser.add_argument(
      "-php_c",
      "--php_c_input_file",
      help="The php with c ext benchmark result file's name",
      default="")
  args = parser.parse_args()

  results = get_result_from_file(
      cpp_file=args.cpp_input_file,
      java_file=args.java_input_file,
      python_file=args.python_input_file,
      go_file=args.go_input_file,
      node_file=args.node_input_file,
      php_file=args.php_input_file,
      php_c_file=args.php_c_input_file,
  )
  print(json.dumps(results, indent=2))


text:
<?php
/**
  Limit Words
  ===========
  Limit Words from the_content()

  Example:
  <?= limit_words(get_the_excerpt(), '41'); ?>
*/

function limit_words($string, $word_limit) {
	$words = explode(' ', $string);

	return implode(' ', array_slice($words, 0, $word_limit));
}


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">

<title>Digital Land Charges</title>

	<link rel="stylesheet" href="/public/stylesheets/styles.css">
	<link href='https://fonts.googleapis.com/css?family=Roboto:300,400,700' rel='stylesheet' type='text/css'>

{{>includes/header}}

Bankruptcy amendment

		1. Retrieve original

		2. View and amend

		3. Check details

		4. Key number

					Debtor details

						Change

					Forename
					Charlie

					Surname
					Richardson

					Occupation

					Address
					67 Southern Way
North Radworthy
Devon
EX36 6HJ

					Address
					14 Heasley Lane
North Radworthy
Devon
EX36 3LE

					Particulars of court

						Change

					Court name
					Barnstaple County Court

					Reference
					412 of 2015

					Year
					2015

							<input type="button" id="btn" value="Continue" class="form_button">

				Return to this application later

									Page 1 of 1

									Page 1 of 1

{{>includes/footer}}


text:
package DDG::Goodie::IsAwesome::bfmags;
# ABSTRACT: bfmags's first Goodie

use DDG::Goodie;
use strict;

zci answer_type => "is_awesome_bfmags";
zci is_cached   => 1;

# Triggers
triggers start => "duckduckhack bfmags";

handle remainder => sub {
    return if $_;
    return "bfmags is awesome and has successfully completed the DuckDuckHack Goodie tutorial!";
};

1;


text:
#ifndef XENIA_UI_VULKAN_VULKAN_DEVICE_H_
#define XENIA_UI_VULKAN_VULKAN_DEVICE_H_

#include <memory>
#include <mutex>
#include <string>
#include <vector>

#include "xenia/ui/vulkan/vulkan.h"
#include "xenia/ui/vulkan/vulkan_util.h"

namespace xe {
namespace ui {
namespace vulkan {

class VulkanInstance;

// Wrapper and utilities for VkDevice.
// Prefer passing this around over a VkDevice and casting as needed to call
// APIs.
class VulkanDevice {
 public:
  VulkanDevice(VulkanInstance* instance);
  ~VulkanDevice();

  VkDevice handle = nullptr;

  operator VkDevice() const { return handle; }
  operator VkPhysicalDevice() const { return device_info_.handle; }

  // Declares a layer to verify and enable upon initialization.
  // Must be called before Initialize.
  void DeclareRequiredLayer(std::string name, uint32_t min_version,
                            bool is_optional) {
    required_layers_.push_back({name, min_version, is_optional});
  }

  // Declares an extension to verify and enable upon initialization.
  // Must be called before Initialize.
  void DeclareRequiredExtension(std::string name, uint32_t min_version,
                                bool is_optional) {
    required_extensions_.push_back({name, min_version, is_optional});
  }

  // Initializes the device, querying and enabling extensions and layers and
  // preparing the device for general use.
  // If initialization succeeds it's likely that no more failures beyond runtime
  // issues will occur.
  bool Initialize(DeviceInfo device_info);

  uint32_t queue_family_index() const { return queue_family_index_; }
  std::mutex& primary_queue_mutex() { return queue_mutex_; }
  // Access to the primary queue must be synchronized with primary_queue_mutex.
  VkQueue primary_queue() const { return primary_queue_; }
  const DeviceInfo& device_info() const { return device_info_; }

  // Acquires a queue for exclusive use by the caller.
  // The queue will not be touched by any other code until it's returned with
  // ReleaseQueue.
  // Not all devices support queues or only support a limited number. If this
  // returns null the primary_queue should be used with the
  // primary_queue_mutex.
  // This method is thread safe.
  VkQueue AcquireQueue();
  // Releases a queue back to the device pool.
  // This method is thread safe.
  void ReleaseQueue(VkQueue queue);

  static void DbgSetObjectName(VkDevice device, uint64_t object,
                               VkDebugReportObjectTypeEXT object_type,
                               std::string name);
  void DbgSetObjectName(uint64_t object, VkDebugReportObjectTypeEXT object_type,
                        std::string name);

  // True if RenderDoc is attached and available for use.
  bool is_renderdoc_attached() const;
  // Begins capturing the current frame in RenderDoc, if it is attached.
  // Must be paired with EndRenderDocCapture. Multiple frames cannot be
  // captured at the same time.
  void BeginRenderDocFrameCapture();
  // Ends a capture.
  void EndRenderDocFrameCapture();

  // Allocates memory of the given size matching the required properties.
  VkDeviceMemory AllocateMemory(
      const VkMemoryRequirements& requirements,
      VkFlags required_properties = VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT);

 private:
  VulkanInstance* instance_ = nullptr;

  std::vector<Requirement> required_layers_;
  std::vector<Requirement> required_extensions_;
  std::vector<const char*> enabled_extensions_;

  bool debug_marker_ena_ = false;

  DeviceInfo device_info_;
  uint32_t queue_family_index_ = 0;
  std::mutex queue_mutex_;
  VkQueue primary_queue_ = nullptr;
  std::vector<VkQueue> free_queues_;
};

}  // namespace vulkan
}  // namespace ui
}  // namespace xe

#endif  // XENIA_UI_VULKAN_VULKAN_DEVICE_H_


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

	<title>Shared Toolbars — CKEditor Sample</title>
	<meta content="text/html; charset=utf-8" http-equiv="content-type" />

	<link href="sample.css" rel="stylesheet" type="text/css" />

		CKEditor Sample — Shared Toolbars

		This sample shows how to configure multiple CKEditor instances to share some parts of the interface.
		You can choose to share the toolbar (topSpace), the elements path
		(bottomSpace), or both.

		CKEditor instances with shared spaces can be inserted with a JavaScript call using the following code:

CKEDITOR.replace( 'textarea_id',
	{
		sharedSpaces :
		{
			top : 'topSpace',
			bottom : 'bottomSpace'
		}
	});

		Note that textarea_id in the code above is the id attribute of
		the <textarea> element to be replaced with CKEditor.

				CKEditor requires JavaScript to run. In a browser with no JavaScript
				support, like yours, you should still see the contents (HTML data) and you should
				be able to edit it normally, without a rich editor interface.

	<form action="sample_posteddata.php" id="editorsForm" method="post">

				Editor 1 (uses the shared toolbar and elements path):
			<textarea cols="80" id="editor1" name="editor1" rows="10"><p>This is some <strong>sample text</strong>. You are using <a href="http://ckeditor.com/">CKEditor</a>.</p></textarea>

				Editor 2 (uses the shared toolbar and elements path):
			<textarea cols="80" id="editor2" name="editor2" rows="10"><p>This is some <strong>sample text</strong>. You are using <a href="http://ckeditor.com/">CKEditor</a>.</p></textarea>

				Editor 3 (uses the shared toolbar only):
			<textarea cols="80" id="editor3" name="editor3" rows="10"><p>This is some <strong>sample text</strong>. You are using <a href="http://ckeditor.com/">CKEditor</a>.</p></textarea>

				Editor 4 (no shared spaces):
			<textarea cols="80" id="editor4" name="editor4" rows="10"><p>This is some <strong>sample text</strong>. You are using <a href="http://ckeditor.com/">CKEditor</a>.</p></textarea>

			<input type="submit" value="Submit" />

	</form>

			CKEditor - The text editor for the Internet - http://ckeditor.com

			Copyright © 2003-2012, CKSource - Frederico
			Knabben. All rights reserved.