text:
package org.apache.tuscany.sdo.generate;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Hashtable;
import java.util.Iterator;
import java.util.List;

import org.apache.tuscany.sdo.helper.HelperContextImpl;
import org.apache.tuscany.sdo.helper.XSDHelperImpl;
import org.apache.tuscany.sdo.util.DataObjectUtil;
import org.eclipse.emf.codegen.ecore.genmodel.GenClass;
import org.eclipse.emf.codegen.ecore.genmodel.GenFeature;
import org.eclipse.emf.codegen.ecore.genmodel.GenModel;
import org.eclipse.emf.codegen.ecore.genmodel.GenPackage;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EClassifier;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.ecore.impl.EPackageRegistryImpl;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.resource.ResourceSet;
import org.eclipse.emf.ecore.util.BasicExtendedMetaData;
import org.eclipse.emf.ecore.util.ExtendedMetaData;
import org.eclipse.xsd.XSDSchema;

import commonj.sdo.helper.HelperContext;
import commonj.sdo.helper.XSDHelper;

public class XSD2JavaGenerator extends JavaGenerator
{
  /**
   * Generate static SDOs from XML Schema
   *
   *   Usage arguments: see JavaGenerator
   *
   *     [ -targetDirectory <target-root-directory> ]
   *     [ -javaPackage <java-package-name> ]
   *     [ -schemaNamespace <namespace-uri> ]
   *     [ -namespaceInfo <namespaces-file> ]
   *     [ other options ... ]
   *     <xsd-file> | <wsdl-file>
   *
   *   Options:
   *
   *     -schemaNamespace
   *         Generate classes for XSD types in the specified targetNamespace. By default, types in the
   *         targetNamespace of the first schema in the specified xsd or wsdl file are generated. Specify
   *         'all' and this parameter will act as a wildcard selecting all namespaces for code generation.
   *     -namespaceInfo
   *         Specifies the name of a file that should contain a list of namespaces and their associated package names.
   *         Optionally, a prefix may be assigned to each namespace as well.  These values are separated by semicolons.
   *         So each line in the file would look something like this:
   *
   *         some\namespace;custom.package.name;optionalPrefix
   *
   *     NOTE: see the base class JavaGenerator for other options.
   *
   *   Example:
   *
   *     generate somedir/somefile.xsd
   *
   *   See base class JavaGenerator for details and the other options.
   *
   */
  public static void main(String args[])
  {
    try
    {
      XSD2JavaGenerator generator = new XSD2JavaGenerator();
      generator.processArguments(args);
      generator.run(args);
    }
    catch (Exception e)
    {
      e.printStackTrace();
      printUsage();
    }
  }

  protected String schemaNamespace = null;
  protected String namespaceInfo = null;
  protected String generateBuiltIn = null;
  protected static GeneratedPackages generatedPackages = null;
  protected boolean allNamespaces = false;

  protected int handleArgument(String args[], int index)
  {
    if (args[index].equalsIgnoreCase("-schemaNamespace"))
    {
      schemaNamespace = args[++index];
      if( "all".equalsIgnoreCase(schemaNamespace) )
      {
        schemaNamespace = null;
        allNamespaces = true;
      }
    }
    else if (args[index].equalsIgnoreCase("-generateBuiltIn"))
    {
      // Internal option used when regenerating one of the built-in (predefined) models (e.g., commonj.sdo).
      generateBuiltIn = args[++index];
    }
    else if (args[index].equalsIgnoreCase("-namespaceInfo"))
    {
        namespaceInfo = args[++index];
    }
    else
    {
      return super.handleArgument(args, index);
    }

    return index + 1;
  }

  protected void run(String args[])
  {
    String xsdFileName = args[inputIndex];
    EPackage.Registry packageRegistry = new EPackageRegistryImpl(EPackage.Registry.INSTANCE);
    ExtendedMetaData extendedMetaData = new BasicExtendedMetaData(packageRegistry);
    String packageURI = getSchemaNamespace(xsdFileName);
    Hashtable packageInfoTable = createPackageInfoTable(packageURI, schemaNamespace, javaPackage, prefix, namespaceInfo );
    generateFromXMLSchema(xsdFileName, packageRegistry, extendedMetaData, targetDirectory, packageInfoTable, genOptions, generateBuiltIn, allNamespaces);
  }

  /**
   * This method was invoked by the SDO Mojo plugin
   *
   * @param xsdFileName
   * @param namespace
   * @param targetDirectory
   * @param javaPackage
   * @param prefix
   * @param genOptions
   */
  public static void generateFromXMLSchema(String xsdFileName, String namespace, String targetDirectory, String javaPackage, String prefix, int genOptions)
  {
	  boolean allNamespaces = false;

	  // Need to process the passed-in schemaNamespace value from Mojo plugin the same as the command line
	  if( "all".equalsIgnoreCase(namespace))
      {
        namespace = null;
        allNamespaces = true;
      }

    EPackage.Registry packageRegistry = new EPackageRegistryImpl(EPackage.Registry.INSTANCE);
    ExtendedMetaData extendedMetaData = new BasicExtendedMetaData(packageRegistry);
    String packageURI = getSchemaNamespace(xsdFileName);
    Hashtable packageInfoTable = createPackageInfoTable(packageURI, namespace, javaPackage, prefix, null );
    generateFromXMLSchema(xsdFileName, packageRegistry, extendedMetaData, targetDirectory, packageInfoTable, genOptions, null, allNamespaces);
  }

  protected static GenModel generateFromXMLSchema(String xsdFileName,
                                                  EPackage.Registry packageRegistry,
                                                  ExtendedMetaData extendedMetaData,
                                                  String targetDirectory,
                                                  Hashtable packageInfoTable,
                                                  int genOptions,
                                                  String regenerateBuiltIn,
                                                  boolean allNamespaces )
  {
    GenModel genModel = null;

    HelperContext hc = new HelperContextImpl(extendedMetaData, false);
    XSDHelper xsdHelper = hc.getXSDHelper();
    ((XSDHelperImpl)xsdHelper).setRedefineBuiltIn(regenerateBuiltIn);

    try
    {
      File inputFile = new File(xsdFileName).getAbsoluteFile();
      InputStream inputStream = new FileInputStream(inputFile);
      xsdHelper.define(inputStream, inputFile.toURI().toString());

      if (targetDirectory == null)
      {
        targetDirectory = new File(xsdFileName).getCanonicalFile().getParent();
      }
      else
      {
        targetDirectory = new File(targetDirectory).getCanonicalPath();
      }

      if (!packageRegistry.values().isEmpty())
      {
        genModel = generatePackages(packageRegistry.values(), targetDirectory, packageInfoTable, genOptions, allNamespaces );
        // For now, this option is not supported
        /*
        if(  (genModel != null) )
        {
          if((extendedMetaData != null))
          {
            // Display only, will report all namespaces and associated packages found
            List genPackages = genModel.getGenPackages();
            for (Iterator iter = genPackages.iterator(); iter.hasNext();)
            {
              GenPackage genPackage = (GenPackage)iter.next();
              EPackage ecorePackage = genPackage.getEcorePackage();
              if( (genOptions & OPTION_DISPLAY_NAMESPACES) != 0)
                System.out.println(extendedMetaData.getNamespace(ecorePackage)+";"+genPackage.getInterfacePackageName()+"."+ecorePackage.getName());
            }
          }
        }
        */
      } else {
        System.err.println("Input schema file " + xsdFileName + " defined no metadata.");
      }

      /*
      for (Iterator iter = packageRegistry.values().iterator(); iter.hasNext();)
      {
        EPackage ePackage = (EPackage)iter.next();
        String basePackage = extractBasePackageName(ePackage, javaPackage);
        if (prefix == null)
        {
          prefix = CodeGenUtil.capName(ePackage.getName());
        }
        generateFromEPackage(ePackage, targetDirectory, basePackage, prefix, genOptions);
      }
      */
    }
    catch (IOException e)
    {
      e.printStackTrace();
    }
    return genModel;
  }

  public static String getSchemaNamespace(String xsdFileName)
  {
    ResourceSet resourceSet = DataObjectUtil.createResourceSet();
    File inputFile = new File(xsdFileName).getAbsoluteFile();
    Resource model = resourceSet.getResource(URI.createURI(inputFile.toURI().toString()), true);
    XSDSchema schema = (XSDSchema)model.getContents().get(0);
    String targetNS = schema.getTargetNamespace();
    if (targetNS == null) {
    	targetNS = schema.getSchemaLocation();
    }

    return targetNS;
  }

  protected static void printUsage()
  {
    System.out.println("Usage arguments:");
    System.out.println("  [ -targetDirectory <target-root-directory> ]");
    System.out.println("  [ -javaPackage <java-package-name> ]");
    System.out.println("  [ -prefix <prefix-string> ]");
    System.out.println("  [ -schemaNamespace <namespace-uri> ]");
    System.out.println("  [ -namespaceInfo <namespaces-file> ]");
    System.out.println("  [ -noInterfaces ]");
    System.out.println("  [ -noContainment ]");
    System.out.println("  [ -noNotification ]");
    System.out.println("  [ -noUnsettable ]");
    /* Future Option: System.out.println("  [ -sparsePattern | -storePattern ]"); */
    /* Future Option: System.out.println("  [ -arrayAccessors ]"); */
    /* Future Option: System.out.println("  [ -generateLoader ]"); */
    /* Future Option: System.out.println("  [ -interfaceDataObject ]"); */
    System.out.println("  <xsd-file> | <wsdl-file>");
    System.out.println("");
    System.out.println("For example:");
    System.out.println("");
    System.out.println("  generate somedir/somefile.xsd");
  }

  public void generateFromXMLSchema(String args[])
  {
    try
    {
      processArguments(args);
      EPackage.Registry packageRegistry = new EPackageRegistryImpl(EPackage.Registry.INSTANCE);
      ExtendedMetaData extendedMetaData = new BasicExtendedMetaData(packageRegistry);
      String xsdFileName = args[inputIndex];
      String packageURI = getSchemaNamespace(xsdFileName);
      Hashtable packageInfoTable = createPackageInfoTable(packageURI, schemaNamespace, javaPackage, prefix, namespaceInfo );
      GenModel genModel = generateFromXMLSchema(xsdFileName, packageRegistry, extendedMetaData, targetDirectory, packageInfoTable, genOptions, generateBuiltIn, allNamespaces);
      generatedPackages = new GeneratedPackages(genModel,extendedMetaData);
    }
    catch (IllegalArgumentException e)
    {
      printUsage();
    }
  }

  private static Hashtable createPackageInfoTable( String packageURI, String schemaNamespace, String javaPackage, String prefix, String namespaceInfo )
  {
    Hashtable packageInfoTable = new Hashtable();

    if( namespaceInfo != null )
    {
      try
      {
        FileReader inputFile = new FileReader(namespaceInfo);
        BufferedReader bufRead = new BufferedReader(inputFile);

        String line = bufRead.readLine();
        while( line != null )
        {
          if( line.length() > 0 )
          {
            String [] options = line.split(";");
            if( options.length > 1 )
            {
              if( options.length > 2 )
                packageInfoTable.put(options[0], new PackageInfo(options[1], options[2], options[0], null ));
              else
                packageInfoTable.put(options[0], new PackageInfo(options[1], null, options[0], null ));
            }
            else
              packageInfoTable.put(options[0], new PackageInfo(null, null, options[0], null ));
          }
              line = bufRead.readLine();
        }
      }
      catch (IOException e)
      {
        e.printStackTrace();
      }
    }
    else
    {
        if( schemaNamespace != null )
            packageInfoTable.put(schemaNamespace, new PackageInfo(javaPackage, prefix, schemaNamespace, null ));
        else if( packageURI != null )
            packageInfoTable.put(packageURI, new PackageInfo(javaPackage, prefix, null, null ));
    }
    return packageInfoTable;
  }

  public List getGeneratedPackageInfo()
  {
    if( generatedPackages != null )
      return generatedPackages.getPackageList();
    else
      return null;
  }

  protected class GeneratedPackages
  {
    private List genPackages = null;

    GeneratedPackages(GenModel genModel, ExtendedMetaData extendedMetaData)
    {
      List packages = genModel.getGenPackages();
      Hashtable genClasses = new Hashtable();
      for (Iterator iter = packages.iterator(); iter.hasNext();)
      {
        // loop through the list, once to build up the eclass to genclass mapper
        GenPackage genPackage = (GenPackage)iter.next();
        List classes = genPackage.getGenClasses();
        for (Iterator classIter = classes.iterator(); classIter.hasNext();)
        {
          GenClass genClass = (GenClass)classIter.next();
          genClasses.put(genClass.getEcoreClass(), genClass);
        }
      }
      genPackages = new ArrayList();
      for (Iterator iter = packages.iterator(); iter.hasNext();)
      {
        // now process the pckage list
        GenPackage genPackage = (GenPackage)iter.next();
        genPackages.add(new GeneratedPackage(genPackage,extendedMetaData,genClasses));
      }
    }

    List getPackageList() {return genPackages;}
  }

  public class GeneratedPackage
  {
    private String  namespace;
    private Hashtable classes;

    public String getNamespace() {return namespace;}
    public List getClasses() {return new ArrayList(classes.values());}

    GeneratedPackage(GenPackage genPackage, ExtendedMetaData extendedMetaData, Hashtable eclassGenClassMap )
    {
      classes = new Hashtable();

      EPackage ePackage = genPackage.getEcorePackage();
      namespace     = extendedMetaData.getNamespace(ePackage);

      List genClasses = genPackage.getGenClasses();
      for (Iterator iterClass = genClasses.iterator(); iterClass.hasNext();)
      {
        GenClass genClass = (GenClass)iterClass.next();
        if ("DocumentRoot".equals(genClass.getEcoreClass().getName())) {
	        List features = genClass.getGenFeatures();
	        for (Iterator iterFeatures = features.iterator(); iterFeatures.hasNext();)
	        {
	          GenFeature feature = (GenFeature)iterFeatures.next();
	          addGlobalElement(feature.getEcoreFeature(),extendedMetaData, eclassGenClassMap);
	        }
        }
      }
    }

    private void addGlobalElement(EStructuralFeature eFeature, ExtendedMetaData extendedMetaData, Hashtable eclassGenClassMap )
    {

      String name               = eFeature.getName();
      String classname          = "";
      boolean anonymous         = false;
      List propertyClassNames   = null;

      EClassifier eClassifier = eFeature.getEType();

      if( eClassifier instanceof EClass )
      {
        // complex type
        EClass eClass = (EClass)eClassifier;
        GenClass genEClass = (GenClass)eclassGenClassMap.get(eClassifier);
        if( genEClass != null )
        {
          classname = genEClass.getGenPackage().getInterfacePackageName()
                 + '.' + genEClass.getInterfaceName();
          anonymous = extendedMetaData.isAnonymous(eClass);

          // Build list of property names
          propertyClassNames = new ArrayList();
          List properties = eClass.getEStructuralFeatures();
          for (Iterator iterProperties = properties.iterator(); iterProperties.hasNext();)
          {
            EStructuralFeature property = (EStructuralFeature)iterProperties.next();
            EClassifier propertyType = property.getEType();
            if (propertyType instanceof EClass)
            {
              GenClass propertyGenClass = (GenClass)eclassGenClassMap.get(propertyType);
              if( propertyGenClass != null )
              {
                String propertyClassName =  propertyGenClass.getGenPackage().getInterfacePackageName() + '.'
                                            + propertyGenClass.getInterfaceName();
                propertyClassNames.add(propertyClassName);
              }
            }
            else if (propertyType instanceof EClassifier)
            {
              String propertyClassName = propertyType.getInstanceClass().getName();
              propertyClassNames.add(propertyClassName);
            }
          }
        }
      }
      else
      {
          // simple type
          classname = eClassifier.getInstanceClass().getName();
      }
      classes.put( name, new PackageClassInfo( name, classname, anonymous, propertyClassNames ) );
    }

    public class PackageClassInfo
    {
      private String name;
      private String className = null;
      private boolean anonymous = false;
      private List properties = null;

      PackageClassInfo( String name, String className, boolean anonymous, List properties )
      {
        this.name = name;
        this.className = className;
        this.anonymous = anonymous;
        this.properties = properties;
      }

      public String getName() {return name;}
      public String getClassName() {return className;}
      public boolean getAnonymous() {return anonymous;}
      public List getProperties() {return properties;}
    }
  }
}


text:
enum MCGeneratorType {
    NONE=-1,
    PP_PYTHIA=0,
    PP_PYTHIA_OLD,
    PPB_EPOS,
    PBPB_HIJING,
};
#endif

AliMCWeightsTask* AddTask_MCWeights(MCGeneratorType gen = MCGeneratorType::NONE, const char* collType = "pp", bool bUseMBPP = false) {
    return AliMCWeightsTask::AddTaskAliMCWeightsTask(gen, collType, bUseMBPP);
}

redpajama_set_name: RedPajamaGithub


text:
<?php

namespace Empress\Requests;

use Empress\Models\User;
use Empress\Base\Request;
use Illuminate\Validation\Rule;

class UpdateUserRequest extends Request
{
	/**
	 * Determine if the user is authorized to make this request.
	 *
	 * @return bool
	 */
	public function authorize()
	{
		if (! $this->user()->can('edit_users')) {
			return abort(403);
		}

		return true;
	}

	/**
	 * Get the validation rules that apply to the request.
	 *
	 * @return array
	 */
	public function rules()
	{
		return [
			'username' => [
				'required', 'string', 'max:180',
				Rule::unique('users')->ignore($this->user->id),
			],
			'name'     => 'required|string',
			'email'    => [
				'required','string','max:180',
				Rule::unique('users')->ignore($this->user->id),
			],
			'roles'    => 'required|array',
	    ];
	}
}


text:
*S.E. 2021-11-01*

Save (and re-generate index) for Applications created during the window where we mislabelled them by releasing code early.

Run

    python portality/upgrade.py -u portality/migrate/20211101_1779_fix_misrelease/migrate.json


text:
#ifndef BT_SIMPLE_DYNAMICS_WORLD_H
#define BT_SIMPLE_DYNAMICS_WORLD_H

#include "btDynamicsWorld.h"

class btDispatcher;
class btOverlappingPairCache;
class btConstraintSolver;

///The btSimpleDynamicsWorld serves as unit-test and to verify more complicated and optimized dynamics worlds.
///Please use btDiscreteDynamicsWorld instead
class btSimpleDynamicsWorld : public btDynamicsWorld
{
protected:

	btConstraintSolver*	m_constraintSolver;

	bool	m_ownsConstraintSolver;

	void	predictUnconstraintMotion(btScalar timeStep);

	void	integrateTransforms(btScalar timeStep);

	btVector3	m_gravity;

public:

	///this btSimpleDynamicsWorld constructor creates dispatcher, broadphase pairCache and constraintSolver
	btSimpleDynamicsWorld(btDispatcher* dispatcher,btBroadphaseInterface* pairCache,btConstraintSolver* constraintSolver,btCollisionConfiguration* collisionConfiguration);

	virtual ~btSimpleDynamicsWorld();

	///maxSubSteps/fixedTimeStep for interpolation is currently ignored for btSimpleDynamicsWorld, use btDiscreteDynamicsWorld instead
	virtual int	stepSimulation( btScalar timeStep,int maxSubSteps=1, btScalar fixedTimeStep=btScalar(1.)/btScalar(60.));

	virtual void	setGravity(const btVector3& gravity);

	virtual btVector3 getGravity () const;

	virtual void	addRigidBody(btRigidBody* body);

	virtual void	addRigidBody(btRigidBody* body, short group, short mask);

	virtual void	removeRigidBody(btRigidBody* body);

	virtual void	debugDrawWorld();

	virtual void	addAction(btActionInterface* action);

	virtual void	removeAction(btActionInterface* action);

	///removeCollisionObject will first check if it is a rigid body, if so call removeRigidBody otherwise call btCollisionWorld::removeCollisionObject
	virtual void	removeCollisionObject(btCollisionObject* collisionObject);

	virtual void	updateAabbs();

	virtual void	synchronizeMotionStates();

	virtual void	setConstraintSolver(btConstraintSolver* solver);

	virtual btConstraintSolver* getConstraintSolver();

	virtual btDynamicsWorldType	getWorldType() const
	{
		return BT_SIMPLE_DYNAMICS_WORLD;
	}

	virtual void	clearForces();

};

#endif //BT_SIMPLE_DYNAMICS_WORLD_H


text:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <artifactId>frameworks-vertx-web-server</artifactId>

  <parent>
  	<groupId>es.msanchez.frameworks</groupId>
  	<artifactId>frameworks-parent</artifactId>
  	<version>0.0.1-SNAPSHOT</version>
  	<relativePath>../../frameworks-parent/</relativePath>
  </parent>

  <properties>
    <main.verticle>es.msanchez.implementations.vertx.starter.StarterVerticle</main.verticle>
  </properties>

  <build>
	<plugins>
	  <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
      </plugin>

	  <plugin>
		<groupId>org.apache.maven.plugins</groupId>
		<artifactId>maven-shade-plugin</artifactId>
	  </plugin>
    </plugins>
  </build>

  <dependencies>
  	<!-- Vertx -->
	<dependency>
	    <groupId>io.vertx</groupId>
	    <artifactId>vertx-core</artifactId>
	</dependency>

	<dependency>
	    <groupId>io.vertx</groupId>
	    <artifactId>vertx-unit</artifactId>
	    <scope>test</scope>
	</dependency>

  	<!-- Logging -->
	<dependency>
	    <groupId>org.slf4j</groupId>
	    <artifactId>slf4j-api</artifactId>
	</dependency>

	<dependency>
	    <groupId>ch.qos.logback</groupId>
	    <artifactId>logback-classic</artifactId>
	</dependency>

	<dependency>
	    <groupId>ch.qos.logback</groupId>
	    <artifactId>logback-core</artifactId>
	</dependency>

  	<!-- Rest of Dependencies -->
	<dependency>
	    <groupId>org.projectlombok</groupId>
	    <artifactId>lombok</artifactId>
	    <scope>provided</scope>
	</dependency>

  	<!-- Test Dependencies -->
	<dependency>
	    <groupId>junit</groupId>
	    <artifactId>junit</artifactId>
	    <scope>test</scope>
	</dependency>

	<dependency>
	    <groupId>org.mockito</groupId>
	    <artifactId>mockito-core</artifactId>
	    <scope>test</scope>
	</dependency>

	<dependency>
	    <groupId>org.assertj</groupId>
	    <artifactId>assertj-core</artifactId>
	    <scope>test</scope>
	</dependency>
  </dependencies>
</project>


text:
<?php

namespace common\models\issue\search;

use common\models\issue\IssueUser;
use common\models\issue\query\IssueQuery;
use common\models\query\PhonableQuery;
use common\models\user\SurnameSearchInterface;
use Yii;
use yii\base\Model;
use yii\data\ActiveDataProvider;
use yii\db\ActiveQuery;
use yii\db\QueryInterface;

/**
 * UserSearch represents the model behind the search form of `common\models\issue\IssueUser`.
 *
 */
class UserSearch extends IssueUser implements
	ArchivedIssueSearch,
	SurnameSearchInterface {

	public string $surname = '';
	public string $phone = '';
	public bool $withArchive = false;

	/**
	 * {@inheritdoc}
	 */

	public function rules(): array {
		return [
			[['issue_id'], 'integer'],
			[['type', 'phone'], 'string'],
			['surname', 'string', 'min' => SurnameSearchInterface::MIN_LENGTH],

		];
	}

	public function attributeLabels(): array {
		return array_merge(parent::attributeLabels(), [
			'surname' => Yii::t('common', 'Surname'),
		]);
	}

	/**
	 * {@inheritdoc}
	 */
	public function scenarios(): array {
		return Model::scenarios();
	}

	/**
	 * Creates data provider instance with search query applied
	 *
	 * @param array $params
	 *
	 * @return ActiveDataProvider
	 */
	public function search(array $params): ActiveDataProvider {
		$query = IssueUser::find();
		$query->joinWith([
			'issue' => function (IssueQuery $query): void {
				if (!$this->getWithArchive()) {
					$query->withoutArchives();
				}
			},
		]);
		$query->joinWith('user.userProfile');

		$dataProvider = new ActiveDataProvider([
			'query' => $query,
			'sort' => [
				'defaultOrder' => 'issue.updated_at DESC',
			],
		]);

		$this->load($params);

		if (!$this->validate()) {
			return $dataProvider;
		}

		$this->applySurnameFilter($query);
		$this->applyPhoneFilter($query);

		// grid filtering conditions
		$query->andFilterWhere([
			'issue_id' => $this->issue_id,
			'type' => $this->type,
		]);

		return $dataProvider;
	}

	public function getWithArchive(): bool {
		return $this->withArchive;
	}

	public function applySurnameFilter(QueryInterface $query): void {
		if (!empty($this->surname)) {
			$query->andWhere(['like', 'user_profile.lastname', $this->surname . '%', false]);
		}
	}

	public function applyPhoneFilter(ActiveQuery $query): void {
		if (!empty($this->phone)) {
			$query->joinWith([
				'user.userProfile' => function (PhonableQuery $query) {
					$query->withPhoneNumber($this->phone);
				},
			]);
		}
	}
}


text:
package ch.ethz.inf.vs.californium.plugtests.resources;

import static ch.ethz.inf.vs.californium.coap.CoAP.ResponseCode.*;
import ch.ethz.inf.vs.californium.server.resources.CoapExchange;
import ch.ethz.inf.vs.californium.server.resources.ResourceBase;

public class ObserveReset extends ResourceBase {

	public ObserveReset() {
		super("obs-reset");
	}

	@Override
	public void handlePOST(CoapExchange exchange) {
		if (exchange.getRequestText().equals("sesame")) {
			System.out.println("obs-reset received POST. Clearing observers");

			// clear observers of the obs resources
			Observe obs = (Observe) this.getParent().getChild("obs");
			ObserveNon obsNon = (ObserveNon) this.getParent().getChild("obs-non");
			obs.clearObserveRelations();
			obsNon.clearObserveRelations();

			exchange.respond(CHANGED);

		} else {
			exchange.respond(FORBIDDEN);
		}
	}

}


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Github Finder</title>

    <link href="https://cdn.xgqfrms.xyz/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">

    <link rel="stylesheet" href="style.css">

                <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
                    Toggle navigation

                </button>
                Github Finder

Search Github Users

Enter a username to fetch a users profile info and repos

            <input type="text" id="searchUser" class="form-control" placeholder="Github Username...">


text:
<?php

use Lib\Services\Presentation\DbPresenter;
use Lib\Services\Validation\EpisodeValidator;
use Lib\Repository\Episode\EpisodeRepositoryInterface as EpRepo;

class SeasonsEpisodesController extends TitleController
{
    /**
     * Episode repository instance.
     *
     * @var Lib\Repository\Episode\EpisodeRepositoryInterface
     */
    private $episode;

    /**
     * Episode validator instance.
     *
     * @var Lib\Services\Validation\EpisodeValidator
     */
    private $epValidator;

	public function __construct(EpisodeValidator $epValidator, EpRepo $episode)
	{
        parent::__construct();

        $this->episode = $episode;
        $this->epValidator = $epValidator;
	}

    /**
     * Stores newly created episode in database.
     *
     * @param  string $series
     * @param  string $season
     * @param  string $episode
     *
     * @return Redirect
     */
    public function store($series, $season)
    {
        $input = Input::except('_token');

        if ( ! $this->epValidator->with($input)->passes())
        {
            if (Request::ajax())
            {
                return Helpers::compileErrorsForAjax( $this->epValidator->errors()->all() );
            }

            return Redirect::back()->withErrors($this->epValidator->errors())->withInput($input);
        }

        $this->episode->create($input);

        if (Request::ajax())
        {
            return 'success';
        }

        return Redirect::back()->withSuccess( trans('main.ep create success') );
    }

    /**
     * Displays the page for creating a new episode.
     *
     * @param  string $id
     * @return View
     */
    public function create($series, $season)
    {
        $data = $this->title->byId($series);
        $data = new DbPresenter($data);

        return View::make('Titles.CreateEpisode')->withData($data)->withNum($season);
    }

    /**
     * Updates specified season.
     *
     * @param  string $series
     * @param  string $season
     * @param  string $episode
     *
     * @return Redirect
     */
    public function update($series, $season, $episode)
    {
        $input = Input::except('_token', '_method');

        if ( ! $this->epValidator->with($input)->passes())
        {
            if (Request::ajax())
            {
                return Helpers::compileErrorsForAjax( $this->epValidator->errors()->all() );
            }

            return Redirect::back()->withErrors($this->epValidator->errors())->withInput($input);
        }

        $this->episode->create($input);

        if (Request::ajax())
        {
            return 'success';
        }

        return Redirect::back()->withSuccess( trans('main.ep update success') );
    }

    /**
     * Deletes specified episode.
     *
     * @param  string $series
     * @param  string $season
     * @param  string $episode
     *
     * @return Redirect
     */
    public function destroy($series, $season, $episode)
    {
        $this->episode->delete($episode);

        return Redirect::back()->withSuccess( trans('main.delete success') );
    }
}


text:
> remove the types that don't apply
> If you discover any security related issues, please email core@fork-cms.com instead of using the issue tracker.

- Critical bugfix
- Non critical bugfix
- Enhancement
- Feature

## Resolves the following issues

> List the hashes of the issues that this pull request resolves if their are issues for it.
> Use the following format: fixes #[issue_number]

## Pull request description

> Describe what your pull request will fix / add / …


text:
require 'elasticsearch'
require 'json'

module Elastic
  class EntityCentricIndexing
    def process_reviews
      reviews do |review_page|
        review_generator.process(review_page)
      end

      puts "Processed #{@review_generator.actions.length} Actions"
    end

    def generate_profiles
      Elastic::Indices::Profiles.bulk_upsert(client, actions)
    end

    def actions
      review_generator.actions
    end

    private

    def review_generator
      @review_generator ||= Elastic::ReviewActionGenerator.new
    end

    def reviews
      Elastic::Indices::Reviews.get(client) do |doc|
        yield doc
      end
    end

    def client
      @client ||= Elasticsearch::Client.new(log: true)
    end
  end
end


text:
package com.arm4j.weixin.request.customservice.entity.msg.mpnews;

import com.alibaba.fastjson.annotation.JSONField;
import com.arm4j.weixin.request.customservice.entity.KFAccountMsgEntity;

/**
 * Created by liwenhe on 16/11/16.
 */
public class KFAccountMpNewsMsgEntity extends KFAccountMsgEntity {

    private String msgType = "mpnews";

    private MpNewsMsgEntity mpNews;

    @JSONField(name = "msgtype")
    public String getMsgType() {
        return msgType;
    }

    @JSONField(name = "mpnews")
    public MpNewsMsgEntity getMpNews() {
        return mpNews;
    }

    public void setMpNews(MpNewsMsgEntity mpNews) {
        this.mpNews = mpNews;
    }
}


text:
class AddTagToQuestion < ActiveRecord::Migration
	def change
		add_column :questions, :tag, :string
	end
end


text:
{
  return event.timeStamp || Date.now();
}


text:
Alloy.CFG.platformWidth = Titanium.Platform.displayCaps.platformWidth;
Alloy.CFG.platformHeight = Titanium.Platform.displayCaps.platformHeight;
Alloy.Globals.loginViaFacebook = false;
Alloy.Globals.socialContacts = false;
Alloy.Globals.facebookSpinviteUser = false;
Alloy.Globals.fb = require('facebook');
Alloy.Globals.fb.appid = Alloy.CFG.facebook.appID;
Alloy.Globals.fb.permissions = ['publish_stream', 'read_stream', 'email', 'user_location', 'user_videos', 'user_birthday', 'user_actions.video', 'user_photos', 'export_stream', 'photo_upload', 'read_friendlists', 'status_update', 'xmpp_login', 'video_upload', 'user_actions.video'];
Alloy.Globals.fb.forceDialogAuth = true;

var facebook_login = function(e) {
    if (e.success) {

        Titanium.App.Properties.setString('token', Alloy.Globals.fb.getAccessToken());

        if (Alloy.Globals.loginViaFacebook) {
            Alloy.Globals.facbook_login();
        } else {
            //Alloy.Globals.facebook_signup();
            Alloy.Globals.facbook_login();
        }
    } else if (e.cancelled) {
        Ti.API.info('Facebook login cancelled');
    } else if (e.error) {
    } else {
        Alloy.Globals.fb.logout();
    }
};
Alloy.Globals.fb.addEventListener('login', facebook_login);

Alloy.Globals.fontFamily = (OS_IOS) ? "Roboto" : "Roboto-Regular";
Alloy.Globals.platform_width = Titanium.Platform.displayCaps.platformWidth;
Alloy.Globals.platform_height = Titanium.Platform.displayCaps.platformHeight;
Alloy.CFG.UI = {
    "socialsignupProfile" : Alloy.CFG.platformHeight * 0.1666,
    "half_socialsignupProfile" : (Alloy.CFG.platformHeight * 0.1666) / 2,
    "height_txtfield_72" : Alloy.CFG.platformHeight * 0.085,
    "width_textfield_95" : Alloy.CFG.platformWidth * 0.95,
    "width_button_85" : (Alloy.Globals.platformWidth * 0.85),
    "win_home_login_view_height" : (Alloy.CFG.platformHeight / 2),
    "win_home_commonView_height" : ((Alloy.CFG.platformHeight / 2) * 0.2),
    "win_home_commonView_width" : (Alloy.CFG.platformWidth * 0.8),
    "win_home_common_imageview_left" : ((Alloy.CFG.platformWidth * 0.8) * 0.10),
    "win_home_common_imageview_width" : ((Alloy.CFG.platformWidth * 0.8) * 0.17),
    "win_home_common_imageview_height" : (((Alloy.CFG.platformHeight / 2) * 0.2) * 0.7),
    "win_home_common_lbl_left" : ((Alloy.CFG.platformWidth * 0.8) * 0.29),
    "win_home_twitter_top" : ((Alloy.CFG.platformHeight / 2) * 0.25),
    "win_home_google_view_top" : ((Alloy.CFG.platformHeight / 2) * 0.5),
    "win_home_linkedin_view_top" : ((Alloy.CFG.platformHeight / 2) * 0.75),
    "win_home_bottomView_height" : Alloy.CFG.platformHeight * 0.20,
    "win_home_alreadylogin_lbl_height" : ((Alloy.CFG.platformHeight * 0.20) * 0.02),
    "win_login_login_view_top" : (Alloy.CFG.platformHeight * 0.25),
    "win_login_login_view_left" : (Alloy.CFG.platformWidth * 0.05),
    "win_login_login_view_height" : (Alloy.CFG.platformHeight * 0.18),
    "win_login_textfield_height" : (Alloy.CFG.platformHeight * 0.18) * 0.49,
    "win_login_divider_height" : (Alloy.CFG.platformHeight * 0.18) * 0.01,
    "win_login_button_height" : (Alloy.CFG.platformHeight * 0.07),
    "win_login_login_button_height" : (Alloy.CFG.platformHeight * 0.45),
    "win_login_signin_button_bottom" : (Alloy.CFG.platformHeight * 0.1),
    "win_login_signin_button_height" : (Alloy.CFG.platformHeight * 0.08),
    "win_login_signin_button_left" : (Alloy.CFG.platformWidth * 0.2),
    "win_login_forgot_password_lbl_bottom" : (Alloy.CFG.platformHeight * 0.05)

};

if (OS_ANDROID) {
    Alloy.CFG.platformDPI = Ti.Platform.displayCaps.dpi;
    var mod = require('ti.physicalSizeCategory');
    switch(mod.physicalSizeCategory) {
        case 'small':
            Titanium.API.info('------------------------Small device success------------------------------- :' + Alloy.CFG.platformDPI);
            Alloy.CFG.android_fonts = {

            };
            break;
        case 'normal':
            Titanium.API.info('------------------------Normal device success------------------------------- :' + Alloy.CFG.platformDPI);
            if (Alloy.CFG.platformDPI <= 160) {
                Alloy.CFG.android_fonts = {
                    //win_home.js
                    "win_home_27" : 20, // facebook,Twitter,Linkedin Label
                    //win_login.js
                    "win_login_via_button_forgotlabel" : 14,
                };

            } else if (Alloy.CFG.platformDPI >= 160 && Alloy.CFG.platformDPI <= 300) {

                Alloy.CFG.android_fonts = {
                    //win_home.js
                    "win_home_27" : 24, // facebook,Twitter,Linkedin Label
                    //win_login.js
                    "win_login_via_button_forgotlabel" : 18,
                };

            } else if (Alloy.CFG.platformDPI >= 300) {
                Alloy.CFG.android_fonts = {
                    //win_home.js
                    "win_home_27" : 28, // facebook,Twitter,Linkedin Label
                    //win_login.js
                    "win_login_via_button_forgotlabel" : 22,
                };
            } else {
                Alloy.CFG.android_fonts = {
                    //win_home.js
                    "win_home_27" : 28, // facebook,Twitter,Linkedin Label
                    //win_login.js
                    "win_login_via_button_forgotlabel" : 22,
                };
            }
            break;
        case 'large':
            Titanium.API.info('------------------------Large device success------------------------------- :' + Alloy.CFG.platformDPI);
            Alloy.CFG.android_fonts = {
                //win_home.js
                "win_home_27" : 28, // facebook,Twitter,Linkedin Label
                //win_login.js
                "win_login_via_button_forgotlabel" : 22,
            };
            break;
        case 'xlarge':
            Titanium.API.info('------------------------X-Large device success------------------------------- :' + Alloy.CFG.platformDPI);
            Alloy.CFG.android_fonts = {
                //win_home.js
                "win_home_27" : 32, // facebook,Twitter,Linkedin Label
                //win_login.js
                "win_login_via_button_forgotlabel" : 25,
            };
            break;
        case 'default':
            break;
    }

} else {
    Alloy.CFG.android_fonts = {
        //win_home.js
        "win_home_27" : 15, // facebook,Twitter,Linkedin Label
        //win_login.js
        "win_login_via_button_forgotlabel" : 12
    };
}


text:
SYNONYM

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Syll. fung. (Abellini) 6: 259 (1888)

#### Original name
Hansenia imitata P. Karst., 1886

### Remarks
null


text:
from __future__ import unicode_literals
"""
record of files

naming for same name files: file.gif, file-1.gif, file-2.gif etc
"""

import webnotes, webnotes.utils, os

class DocType():
	def __init__(self, d, dl):
		self.doc, self.doclist = d, dl

	def on_update(self):
		# check duplicate assignement
		n_records = webnotes.conn.sql("""select count(*) from `tabFile Data`
			where file_name=%s
			and attached_to_doctype=%s
			and attached_to_name=%s""", (self.doc.file_name, self.doc.attached_to_doctype,
				self.doc.attached_to_name))[0][0]
		if n_records > 1:
			webnotes.msgprint(webnotes._("Same file has already been attached to the record"))
			raise webnotes.DuplicateEntryError

	def on_trash(self):
		if self.doc.file_name and webnotes.conn.sql("""select count(*) from `tabFile Data`
			where file_name=%s""", self.doc.file_name)[0][0]==1:
			path = webnotes.utils.get_path("public", "files", self.doc.file_name)
			if os.path.exists(path):
				os.remove(path)

		if self.doc.attached_to_name:
			# check persmission
			try:
				if not webnotes.has_permission(self.doc.attached_to_doctype,
					"write", self.doc.attached_to_name):
					webnotes.msgprint(webnotes._("No permission to write / remove."),
					raise_exception=True)
			except webnotes.DoesNotExistError:
				pass


text:
#include <signaldata/AccLock.hpp>
#include <SignalLoggerManager.hpp>

bool
printACC_LOCKREQ(FILE* output, const Uint32* theData, Uint32 len, Uint16 rbn)
{
  const AccLockReq* const sig = (const AccLockReq*)theData;
  Uint32 reqtype = sig->requestInfo & 0xFF;
  switch (sig->returnCode) {
  case RNIL:
    fprintf(output, " returnCode=RNIL");
    break;
  case AccLockReq::Success:
    fprintf(output, " returnCode=Success");
    break;
  case AccLockReq::IsBlocked:
    fprintf(output, " returnCode=IsBlocked");
    break;
  case AccLockReq::WouldBlock:
    fprintf(output, " returnCode=WouldBlock");
    break;
  case AccLockReq::Refused:
    fprintf(output, " returnCode=Refused");
    break;
  case AccLockReq::NoFreeOp:
    fprintf(output, " returnCode=NoFreeOp");
    break;
  default:
    fprintf(output, " returnCode=%u?", sig->returnCode);
    break;
  }
  switch (reqtype) {
    case AccLockReq::LockShared:
    fprintf(output, " req=LockShared\n");
    break;
  case AccLockReq::LockExclusive:
    fprintf(output, " req=LockExclusive\n");
    break;
  case AccLockReq::Unlock:
    fprintf(output, " req=Unlock\n");
    break;
  case AccLockReq::Abort:
    fprintf(output, " req=Abort\n");
    break;
  default:
    fprintf(output, " req=%u\n", reqtype);
    break;
  }
  fprintf(output, " accOpPtr: 0x%x\n", sig->accOpPtr);
  if (reqtype == AccLockReq::LockShared ||
      reqtype == AccLockReq::LockExclusive) {
    fprintf(output, " userPtr: 0x%x userRef: 0x%x\n", sig->userPtr, sig->userRef);
    fprintf(output, " table: id=%u", sig->tableId);
    fprintf(output, " fragment: id=%u ptr=0x%x\n", sig->fragId, sig->fragPtrI);
    fprintf(output, " tuple: addr=0x%x hashValue=%x\n", sig->tupAddr, sig->hashValue);
    fprintf(output, " transid: %08x %08x\n", sig->transId1, sig->transId2);
  }
  return true;
}


text:
#ifndef rtkTotalNuclearVariationDenoisingBPDQImageFilter_h
#define rtkTotalNuclearVariationDenoisingBPDQImageFilter_h

#include "rtkSingularValueThresholdImageFilter.h"
#include "rtkDenoisingBPDQImageFilter.h"

namespace rtk
{
/** \class TotalNuclearVariationDenoisingBPDQImageFilter
 * \brief Performs total nuclear variation denoising
 *
 * This filter implements "Joint reconstruction of multi-channel, spectral CT data
 * via constrained total nuclear variation minimization", by Rigie & LaRiviere, in
 * Physics in Medicine and Biology 2015.
 *
 * It uses basis pursuit dequantization, and is (mathematically) only a generalization
 * of the TotalVariationDenoisingBPDQImageFilter to process multiple channel images.
 * It outputs a multiple channel image close to the input one, for which the spatial
 * gradient of each channel is sparser, and the gradient vectors are more similar (ie. colinear) across channels,
 * than in the input.
 *
 * The order of the channels is not taken into account, which makes this regularization
 * more suitable when the channels describe materials (i.e. in spectral CT) or
 * colors (i.e. in RGB images) than when they describe time frames (i.e. in dynamic CT).
 *
 * \dot
 * digraph TotalNuclearVariationDenoisingBPDQImageFilter
 * {
 *
 * subgraph clusterFirstIteration
 *   {
 *   label="First iteration"
 *
 *   FI_Input [label="Input"];
 *   FI_Input [shape=Mdiamond];
 *
 *   node [shape=box];
 *   FI_Multiply [ label="itk::MultiplyImageFilter (by beta)" URL="\ref itk::MultiplyImageFilter"];
 *   FI_Gradient [ label="rtk::ForwardDifferenceGradientImageFilter"
 *                 URL="\ref rtk::ForwardDifferenceGradientImageFilter"];
 *   FI_SingularValueThreshold [ label="rtk::SingularValueThresholdImageFilter"
 *                               URL="\ref rtk::SingularValueThresholdImageFilter"];
 *   FI_OutOfSingularValueThreshold [label="", fixedsize="false", width=0, height=0, shape=none];
 *
 *   FI_Input -> FI_Multiply;
 *   FI_Multiply -> FI_Gradient;
 *   FI_Gradient -> FI_SingularValueThreshold;
 *   FI_SingularValueThreshold -> FI_OutOfSingularValueThreshold [style=dashed];
 *   }
 *
 * subgraph clusterAfterFirstIteration
 *   {
 *   label="After first iteration"
 *
 *   Input [label="Input"];
 *   Input [shape=Mdiamond];
 *   Output [label="Output"];
 *   Output [shape=Mdiamond];
 *
 *   node [shape=box];
 *   Divergence [ label="rtk::BackwardDifferenceDivergenceImageFilter"
 *                URL="\ref rtk::BackwardDifferenceDivergenceImageFilter"];
 *   Subtract [ label="itk::SubtractImageFilter" URL="\ref itk::SubtractImageFilter"];
 *   Multiply [ label="itk::MultiplyImageFilter (by beta)" URL="\ref itk::MultiplyImageFilter"];
 *   Gradient [ label="rtk::ForwardDifferenceGradientImageFilter" URL="\ref rtk::ForwardDifferenceGradientImageFilter"];
 *   SubtractGradient [ label="itk::SubtractImageFilter" URL="\ref itk::SubtractImageFilter"];
 *   SingularValueThreshold [ label="rtk::SingularValueThresholdImageFilter"
 *                            URL="\ref rtk::SingularValueThresholdImageFilter"];
 *   OutOfSubtract [label="", fixedsize="false", width=0, height=0, shape=none];
 *   OutOfSingularValueThreshold [label="", fixedsize="false", width=0, height=0, shape=none];
 *   BeforeDivergence [label="", fixedsize="false", width=0, height=0, shape=none];
 *
 *   Input -> Subtract;
 *   Divergence -> Subtract;
 *   Subtract -> OutOfSubtract;
 *   OutOfSubtract -> Output;
 *   OutOfSubtract -> Multiply;
 *   Multiply -> Gradient;
 *   Gradient -> SubtractGradient;
 *   SubtractGradient -> SingularValueThreshold;
 *   SingularValueThreshold -> OutOfSingularValueThreshold;
 *   OutOfSingularValueThreshold -> BeforeDivergence [style=dashed, constraint=false];
 *   BeforeDivergence -> Divergence;
 *   BeforeDivergence -> SubtractGradient;
 *   }
 *
 * }
 * \enddot
 *
 * \author Cyril Mory
 *
 * \ingroup RTK IntensityImageFilters
 */

template <typename TOutputImage,
          typename TGradientImage =
            itk::Image<itk::CovariantVector<typename TOutputImage::ValueType, TOutputImage::ImageDimension - 1>,
                       TOutputImage::ImageDimension>>
class ITK_TEMPLATE_EXPORT TotalNuclearVariationDenoisingBPDQImageFilter
  : public rtk::DenoisingBPDQImageFilter<TOutputImage, TGradientImage>
{
public:
  ITK_DISALLOW_COPY_AND_MOVE(TotalNuclearVariationDenoisingBPDQImageFilter);

  /** Standard class type alias. */
  using Self = TotalNuclearVariationDenoisingBPDQImageFilter;
  using Superclass = rtk::DenoisingBPDQImageFilter<TOutputImage, TGradientImage>;
  using Pointer = itk::SmartPointer<Self>;
  using ConstPointer = itk::SmartPointer<const Self>;

  /** Method for creation through the object factory. */
  itkNewMacro(Self);

  /** Run-time type information (and related methods). */
  itkTypeMacro(TotalNuclearVariationDenoisingBPDQImageFilter, DenoisingBPDQImageFilter);

  /** Sub filter type definitions */
  using SingularValueThresholdFilterType = SingularValueThresholdImageFilter<TGradientImage>;

protected:
  TotalNuclearVariationDenoisingBPDQImageFilter();
  ~TotalNuclearVariationDenoisingBPDQImageFilter() override = default;

  void
  GenerateOutputInformation() override;

  /** Sub filter pointers */
  typename SingularValueThresholdFilterType::Pointer m_ThresholdFilter;
  typename Superclass::ThresholdFilterType *
  GetThresholdFilter() override
  {
    return dynamic_cast<typename Superclass::ThresholdFilterType *>(this->m_ThresholdFilter.GetPointer());
  }
};

} // namespace rtk

#ifndef ITK_MANUAL_INSTANTIATION
#  include "rtkTotalNuclearVariationDenoisingBPDQImageFilter.hxx"
#endif

#endif //__rtkTotalNuclearVariationDenoisingBPDQImageFilter__


text:
<!DOCTYPE html>

		<title>ng-bootstrap-daterangepicker</title>

		<link rel="stylesheet" type="text/css" href="../bower_components/bootstrap/dist/css/bootstrap.min.css">
		<link rel="stylesheet" type="text/css" href="../bower_components/bootstrap-daterangepicker/daterangepicker-bs3.css">

<input type="daterange" ng-model="dates1"> {{dates1|json}}

				<input type="daterange" ng-model="dates1"> {{dates1|json}}

<input type="daterange" ng-model="dates2" format="MMM DD" separator="/"> {{dates2|json}}

				<input type="daterange" ng-model="dates2" format="MMM DD" separator="/"> {{dates2|json}}

<input type="daterange" ng-model="dates3" separator="/" min-date="2013-09-10" max-date="2013-09-20" limit="1 day"> {{dates3|json}}

				<input type="daterange" ng-model="dates3" separator="/" min-date="2013-09-10" max-date="2013-09-20" limit="1 day" > {{dates3|json}}

<input type="daterange" ng-model="dates4" options="ranges"> {{dates4|json}}

				<input type="daterange" ng-model="dates4" ranges="ranges"> {{dates4|json}}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Bull. trimest. Soc. mycol. Fr. 97(3): 224 (1981)

#### Original name
Cortinarius submelleopallens Rob. Henry

### Remarks
null


text:
using System.Linq;
using NUnit.Framework;
using Saltarelle.Compiler.ScriptSemantics;

namespace Saltarelle.Compiler.Tests.CompilerTests.MethodCompilation.Expressions {
	[TestFixture]
	public class MethodGroupConversionTests : MethodCompilerTestBase {
		[Test]
		public void ReadingMethodGroupWithOneMethodWorks() {
			AssertCorrect(
@"void F(int x) {}
public void M() {
	System.Action<int> f;
	// BEGIN
	f = F;
	// END
}",
@"	$f = $Bind(this.$F, this);
");
		}

		[Test]
		public void CombiningDeclarationAndAssignmentWorks() {
			AssertCorrect(
@"void F(int x) {}
public void M() {
	// BEGIN
	System.Action<int> f = F;
	// END
}",
@"	var $f = $Bind(this.$F, this);
");
		}

		[Test]
		public void ReadingStaticMethodGroupWorks() {
			AssertCorrect(
@"static void F(int x) {}
public void M() {
	System.Action<int> f;
	// BEGIN
	f = F;
	// END
}",
@"	$f = {sm_C}.$F;
");
		}

		[Test]
		public void ReadingMethodGroupWithOverloadsWorks() {
			AssertCorrect(
@"void F(int x) {}
void F(string x) {}
public void M() {
	System.Action<int> f;
	// BEGIN
	f = F;
	// END
}",
@"	$f = $Bind(this.F_Int32, this);
", metadataImporter: new MockMetadataImporter { GetMethodSemantics = m => MethodScriptSemantics.NormalMethod(m.Parameters.Count > 0 ? m.Name + "_" + m.Parameters[0].Type.Name : m.Name) });
		}

		[Test]
		public void ReadingMethodGroupWithAnotherTargetWorks() {
			AssertCorrect(
@"class X { public void F(int x) {} public void F(string x) {} }
public void M() {
	Action<int> f;
	var x = new X();
	// BEGIN
	f = x.F;
	// END
}
",
@"	$f = $Bind($x.F_Int32, $x);
", metadataImporter: new MockMetadataImporter { GetMethodSemantics = m => MethodScriptSemantics.NormalMethod(m.Parameters.Count > 0 ? m.Name + "_" + m.Parameters[0].Type.Name : m.Name) });
		}

		[Test]
		public void ReadingMethodGroupWithAnotherTargetOnlyInvokesTheTargetOnce() {
			AssertCorrect(
@"class X { public void F(int x) {} public void F(string x) {} }
X F2() { return null; }
public void M() {
	Action<int> f;
	var x = new X();
	// BEGIN
	f = F2().F;
	// END
}
",
@"	var $tmp1 = this.F2();
	$f = $Bind($tmp1.F_Int32, $tmp1);
", metadataImporter: new MockMetadataImporter { GetMethodSemantics = m => MethodScriptSemantics.NormalMethod(m.Parameters.Count > 0 ? m.Name + "_" + m.Parameters[0].Type.Name : m.Name) });
		}

		[Test]
		public void MethodGroupConversionCanInstantiateGenericMethod() {
			AssertCorrect(
@"void F<T>(T x) {}
public void M() {
	System.Action<int> f;
	// BEGIN
	f = F<int>;
	// END
}",
@"	$f = $Bind($InstantiateGenericMethod(this.$F, {ga_Int32}), this);
");
		}

		[Test]
		public void MethodGroupConversionCanInstantiateGenericMethodWhenTheGenericArgumentIsNotExplicitlySpecified() {
			AssertCorrect(
@"void F<T>(T x) {}
public void M() {
	System.Action<int> f;
	// BEGIN
	f = F;
	// END
}",
@"	$f = $Bind($InstantiateGenericMethod(this.$F, {ga_Int32}), this);
");
		}

		[Test]
		public void MethodGroupConversionDoesNotInstantiateGenericMethodIfIgnoreGenericArgumentsIsSet() {
			AssertCorrect(
@"void F<T>(T x) {}
public void M() {
	System.Action<int> f;
	// BEGIN
	f = F<int>;
	// END
}",
@"	$f = $Bind(this.$F, this);
", metadataImporter: new MockMetadataImporter { GetMethodSemantics = m => MethodScriptSemantics.NormalMethod("$" + m.Name, ignoreGenericArguments: true) });
		}

		[Test]
		public void MethodGroupConversionCanInstantiateGenericStaticMethod() {
			AssertCorrect(
@"static void F<T>(T x) {}
public void M() {
	System.Action<int> f;
	// BEGIN
	f = F<int>;
	// END
}",
@"	$f = $InstantiateGenericMethod({sm_C}.$F, {ga_Int32});
");
		}

		[Test]
		public void UsingAMethodMarkedAsNotUsableFromScriptGivesAnError() {
			var er = new MockErrorReporter(false);
			Compile(new[] { "class Class { int UnusableMethod() {} public void M() { System.Func<int> f; f = UnusableMethod; } }" }, metadataImporter: new MockMetadataImporter { GetMethodSemantics = m => m.Name == "UnusableMethod" ? MethodScriptSemantics.NotUsableFromScript() : MethodScriptSemantics.NormalMethod(m.Name) }, errorReporter: er);
			Assert.That(er.AllMessages.Any(msg => msg.Severity == MessageSeverity.Error && msg.FormattedMessage.Contains("Class.UnusableMethod")));
		}

		[Test]
		public void MethodGroupConversionForBaseVersionOfOverriddenMethodWorks() {
			AssertCorrect(
@"
class B {
	public virtual void F(int x, int y) {}
}
class D : B {
	public override void F(int x, int y) {}
	public void M() {
		System.Action<int, int> a;
		// BEGIN
		a = this.F;
		a = base.F;
		// END
	}
}
",
@"	$a = $Bind(this.$F, this);
	$a = $BindBaseCall({bind_B}, '$F', [], this);
", addSkeleton: false);
		}

		[Test]
		public void MethodGroupConversionForMethodOverriddenFromGenericClassWorks() {
			AssertCorrect(
@"class B<T> {
	public virtual void F(T x, int y) {}
}
class D : B<string> {
	public override void F(string x, int y) {}
	public void M() {
		System.Action<string, int> a;
		// BEGIN
		a = this.F;
		a = base.F;
		// END
	}
}
",
@"	$a = $Bind(this.$F, this);
	$a = $BindBaseCall(bind_$InstantiateGenericType({B}, {ga_String}), '$F', [], this);
", addSkeleton: false);
		}

		[Test]
		public void MethodGroupConversionForMethodOverriddenFromGenericClassWorks2() {
			AssertCorrect(
@"class B<T> {
	public virtual void F(T x, int y) {}
}
class D<T2> : B<T2> {
	public override void F(T2 x, int y) {}
	public void M() {
		System.Action<T2, int> a;
		// BEGIN
		a = this.F;
		a = base.F;
		// END
	}
}
",
@"	$a = $Bind(this.$F, this);
	$a = $BindBaseCall(bind_$InstantiateGenericType({B}, $T2), '$F', [], this);
", addSkeleton: false);
		}

		[Test]
		public void MethodGroupConversionForGenericOverriddenMethodWorks() {
			AssertCorrect(
@"class B {
	public virtual void F<T>(T x, int y) {}
}
class D : B {
	public override void F<U>(U x, int y) {}
	public void M() {
		System.Action<int, int> a;
		// BEGIN
		a = this.F;
		a = base.F;
		// END
	}
}
",
@"	$a = $Bind($InstantiateGenericMethod(this.$F, {ga_Int32}), this);
	$a = $BindBaseCall({bind_B}, '$F', [{ga_Int32}], this);
", addSkeleton: false);
		}

		[Test]
		public void MethodGroupConversionForGenericMethodOverriddenFromGenericClassWorks2() {
			AssertCorrect(
@"class B<T> {
	public virtual void F<U>(U x, int y) {}
}
class D<T2> : B<T2> {
	public override void F<S>(S x, int y) {}
	public void M() {
		System.Action<int, int> a;
		// BEGIN
		a = F;
		a = base.F;
		// END
	}
}
",
@"	$a = $Bind($InstantiateGenericMethod(this.$F, {ga_Int32}), this);
	$a = $BindBaseCall(bind_$InstantiateGenericType({B}, $T2), '$F', [{ga_Int32}], this);
", addSkeleton: false);
		}

		[Test]
		public void MethodGroupConversionForBaseVersionOfMethodInheritedFromGrandParentWorks() {
			AssertCorrect(
@"class B {
	public virtual void F(int x, int y) {}
}
class D : B {
}
class D2 : D {
	public override void F(int x, int y) {}

	public void M() {
		System.Action<int, int> a;
		// BEGIN
		a = this.F;
		a = base.F;
		// END
	}
}
",
@"	$a = $Bind(this.$F, this);
	$a = $BindBaseCall({bind_B}, '$F', [], this);
", addSkeleton: false);
		}

		[Test]
		public void MethodGroupConversionForBaseVersionOfMethodDefinedInGrandParentAndOverriddenInParentWorks() {
			AssertCorrect(
@"class B {
	public virtual void F(int x, int y) {}
}
class D : B {
	public virtual void F(int x, int y) {}
}
class D2 : D {
	public override void F(int x, int y) {}

	public void M() {
		System.Action<int, int> a;
		// BEGIN
		a = this.F;
		a = base.F;
		// END
	}
}
",
@"	$a = $Bind(this.$F, this);
	$a = $BindBaseCall({bind_D}, '$F', [], this);
", addSkeleton: false);
		}

		[Test]
		public void CannotPerformMethodGroupConversionOnNormalMethodThatExpandsParamsToDelegateThatDoesNot() {
			var er = new MockErrorReporter(false);

			Compile(new[] {
@"class C1 {
	public void F(int x, int y, params int[] args) {}
	public void M() {
		System.Action<int, int, int[]> a = F;
	}
}" }, metadataImporter: new MockMetadataImporter { GetMethodSemantics = m => MethodScriptSemantics.NormalMethod("$" + m.Name, expandParams: m.Name == "F") }, errorReporter: er);

			Assert.That(er.AllMessages.Count, Is.EqualTo(1));
			Assert.That(er.AllMessages[0].FormattedMessage.Contains("C1.F") && er.AllMessages[0].FormattedMessage.Contains("System.Action") && er.AllMessages[0].FormattedMessage.Contains("expand") && er.AllMessages[0].FormattedMessage.Contains("param array"));
		}

		[Test]
		public void CanPerformMethodGroupConversionOnMethodThatExpandsParamsToDelegateThatAlsoDoes() {
			AssertCorrect(
@"public void F(int x, int y, params int[] args) {}
public void M() {
	System.Action<int, int, int[]> f;
	// BEGIN
	f = F;
	// END
}",
@"	$f = $Bind(this.$F, this);
", metadataImporter: new MockMetadataImporter { GetMethodSemantics = m => MethodScriptSemantics.NormalMethod("$" + m.Name, expandParams: m.Name == "F"), GetDelegateSemantics = d => new DelegateScriptSemantics(expandParams: true) });
		}

		[Test]
		public void BindFirstParameterToThisWorks() {
			AssertCorrect(
@"private int i;
public int F(int _this, int b) { return 0; }
public void M() {
	// BEGIN
	Func<int, int, int> f = F;
	// END
}
",
@"	var $f = $BindFirstParameterToThis($Bind(this.F, this));
", metadataImporter: new MockMetadataImporter { GetDelegateSemantics = d => new DelegateScriptSemantics(bindThisToFirstParameter: true) });
		}

		[Test]
		public void CanPerformMethodGroupConversionOnInlineCodeMethodWithReturnValue() {
			AssertCorrect(
@"private int i;
public int F<T>(int a, int b) { return 0; }
public void M() {
	// BEGIN
	Func<int, int, int> f = F<string>;
	// END
}
",
@"	var $f = function($tmp1, $tmp2) {
		return _($tmp1)._($tmp2)._({ga_String});
	};
", metadataImporter: new MockMetadataImporter { GetMethodSemantics = m => m.Name == "F" ? MethodScriptSemantics.InlineCode("_({a})._({b})._({T})") : MethodScriptSemantics.NormalMethod(m.Name) });
		}

		[Test]
		public void CanPerformMethodGroupConversionOnInlineCodeMethodWithoutReturnValue() {
			AssertCorrect(
@"private int i;
public void F<T>(int a, int b) {}
public void M() {
	// BEGIN
	Action<int, int> f = F<string>;
	// END
}
",
@"	var $f = function($tmp1, $tmp2) {
		_($tmp1)._($tmp2)._({ga_String});
	};
", metadataImporter: new MockMetadataImporter { GetMethodSemantics = m => m.Name == "F" ? MethodScriptSemantics.InlineCode("_({a})._({b})._({T})") : MethodScriptSemantics.NormalMethod(m.Name) });
		}

		[Test]
		public void CanPerformMethodGroupConversionOnInlineCodeMethodThatUsesThis() {
			AssertCorrect(
@"private int i;
public int F<T>(int a, int b) { return 0; }
public void M() {
	// BEGIN
	Func<int, int, int> f = F<string>;
	// END
}
",
@"	var $f = $Bind(function($tmp1, $tmp2) {
		return _(this)._($tmp1)._($tmp2)._({ga_String});
	}, this);
", metadataImporter: new MockMetadataImporter { GetMethodSemantics = m => m.Name == "F" ? MethodScriptSemantics.InlineCode("_({this})._({a})._({b})._({T})") : MethodScriptSemantics.NormalMethod(m.Name) });
		}

		[Test]
		public void MethodGroupConversionOnInlineCodeMethodOnAnotherTargetWorks() {
			AssertCorrect(
@"private int i;
public int F<T>(int a, int b) { return 0; }
public void M() {
	C c = null;
	// BEGIN
	Func<int, int, int> f = c.F<string>;
	// END
}
",
@"	var $f = function($tmp1, $tmp2) {
		return _($c)._($tmp1)._($tmp2)._({ga_String});
	};
", metadataImporter: new MockMetadataImporter { GetMethodSemantics = m => m.Name == "F" ? MethodScriptSemantics.InlineCode("_({this})._({a})._({b})._({T})") : MethodScriptSemantics.NormalMethod(m.Name) });
		}

		[Test]
		public void CanPerformMethodGroupConversionOnInlineCodeMethodUsingNonVirtualCall() {
			AssertCorrect(
@"class B {
	public virtual int F<T>(int a, int b) { return 0; }
}
class C : B {
	public override int F<T>(int a, int b) { return 0; }
	public void M() {
		// BEGIN
		System.Func<int, int, int> f = base.F<string>;
		// END
	}
}
",
@"	var $f = $Bind(function($tmp1, $tmp2) {
		return _(this)._($tmp1)._($tmp2)._({ga_String});
	}, this);
", metadataImporter: new MockMetadataImporter { GetMethodSemantics = m => m.Name == "F" ? MethodScriptSemantics.InlineCode("X", nonVirtualInvocationLiteralCode: "_({this})._({a})._({b})._({T})") : MethodScriptSemantics.NormalMethod(m.Name) }, addSkeleton: false);
		}

		[Test]
		public void CanPerformMethodGroupConversionOnInlineCodeMethodWhenDelegateTypeUsesBindThisToFirstParameter() {
			AssertCorrect(
@"public int F<T>(int _this, int b) { return 0; }
public void M() {
	// BEGIN
	Func<int, int, int> f = F<string>;
	// END
}
",
@"	var $f = $BindFirstParameterToThis($Bind(function($tmp1, $tmp2) {
		return _(this)._($tmp1)._($tmp2)._({ga_String});
	}, this));
", metadataImporter: new MockMetadataImporter { GetDelegateSemantics = d => new DelegateScriptSemantics(bindThisToFirstParameter: true), GetMethodSemantics = m => m.Name == "F" ? MethodScriptSemantics.InlineCode("_({this})._({_this})._({b})._({T})") : MethodScriptSemantics.NormalMethod(m.Name) });
		}

		[Test]
		public void CanPerformMethodGroupConversionOnInlineCodeMethodWhenDelegateTypeExpandsParamArray() {
			AssertCorrect(
@"public delegate void D(int x, int y, params object[] z);
public void F<T>(int a, int b, object[] c) {}
public void M() {
	// BEGIN
	D f = F<string>;
	// END
}",
@"	var $f = $Bind(function($tmp1, $tmp2) {
		_(this)._($tmp1)._($tmp2)._(Array.prototype.slice.call(arguments, 2));
	}, this);
", metadataImporter: new MockMetadataImporter { GetDelegateSemantics = d => new DelegateScriptSemantics(expandParams: true), GetMethodSemantics = m => m.Name == "F" ? MethodScriptSemantics.InlineCode("_({this})._({a})._({b})._({c})_({T})") : MethodScriptSemantics.NormalMethod(m.Name) });
		}

		[Test]
		public void CannotPerformMethodGroupConversionOnInlineCodeMethodThatIncludesAnExpandedParameter() {
			var er = new MockErrorReporter(false);
			Compile(new[] {
@"class C1 {
	public int F1(params object[] a) { return 0; }
	public void M() {
		System.Func<object[], int> f = F1;
	}
}
" }, metadataImporter: new MockMetadataImporter { GetMethodSemantics = m => m.Name == "F1" ? MethodScriptSemantics.InlineCode("_({*a})") : MethodScriptSemantics.NormalMethod(m.Name) }, errorReporter: er);

			Assert.That(er.AllMessages.Count, Is.EqualTo(1));
			Assert.That(er.AllMessages.Any(msg => msg.Severity == MessageSeverity.Error && msg.Code == 7523 && msg.FormattedMessage.Contains("C1.F1") && msg.FormattedMessage.Contains("expanded param array")));
		}

		[Test]
		public void MethodGroupConversionOnInlineCodeMethodUsesNonExpandedFormPattern() {
			AssertCorrect(
@"class C1 {
	public int F1(params object[] a) { return 0; }
	public void M() {
		// BEGIN
		System.Func<object[], int> f = F1;
		// END
	}
}
",
@"	var $f = function($tmp1) {
		return _2($tmp1);
	};
", metadataImporter: new MockMetadataImporter { GetMethodSemantics = m => m.Name == "F1" ? MethodScriptSemantics.InlineCode("_({*a})", nonExpandedFormLiteralCode: "_2({a})") : MethodScriptSemantics.NormalMethod(m.Name) });
		}

		[Test]
		public void CannotPerformMethodGroupConversionOnInlineCodeMethodThatIncludesAParameterAsLiteralText() {
			var er = new MockErrorReporter(false);
			Compile(new[] {
@"class C1 {
	public int F1(string a) { return 0; }
	public void M() {
		System.Func<string, int> f = F1;
	}
}
" }, metadataImporter: new MockMetadataImporter { GetMethodSemantics = m => m.Name == "F1" ? MethodScriptSemantics.InlineCode("_({@a})") : MethodScriptSemantics.NormalMethod(m.Name) }, errorReporter: er);

			Assert.That(er.AllMessages.Count, Is.EqualTo(1));
			Assert.That(er.AllMessages.Any(msg => msg.Severity == MessageSeverity.Error && msg.Code == 7523 && msg.FormattedMessage.Contains("C1.F1") && msg.FormattedMessage.Contains("literal string as code")));
		}

		[Test]
		public void CanPerformMethodGroupConversionOnStaticMethodWithThisAsFirstArgumentWithReturnValue() {
			AssertCorrect(
@"private int i;
public int F(int a, int b) { return 0; }
public void M() {
	// BEGIN
	Func<int, int, int> f = F;
	// END
}
",
@"	var $f = $Bind(function($tmp1, $tmp2) {
		return {sm_C}.$F(this, $tmp1, $tmp2);
	}, this);
", metadataImporter: new MockMetadataImporter { GetMethodSemantics = m => m.Name == "F" ? MethodScriptSemantics.StaticMethodWithThisAsFirstArgument("$F") : MethodScriptSemantics.NormalMethod(m.Name) });
		}

		[Test]
		public void CanPerformMethodGroupConversionOnStaticMethodWithThisAsFirstArgumentWithoutReturnValue() {
			AssertCorrect(
@"public void F(int a, int b) { return 0; }
public void M() {
	// BEGIN
	Action<int, int> f = F;
	// END
}
",
@"	var $f = $Bind(function($tmp1, $tmp2) {
		{sm_C}.$F(this, $tmp1, $tmp2);
	}, this);
", metadataImporter: new MockMetadataImporter { GetMethodSemantics = m => m.Name == "F" ? MethodScriptSemantics.StaticMethodWithThisAsFirstArgument("$F") : MethodScriptSemantics.NormalMethod(m.Name) });
		}

		[Test]
		public void CanPerformMethodGroupConversionOnStaticMethodWithThisAsFirstArgumentInGenericType() {
			AssertCorrect(
@"class C<T1, T2> {
	public int F(int a, int b) { return 0; }
	public void M() {
		// BEGIN
		System.Func<int, int, int> f = F;
		// END
	}
}
",
@"	var $f = $Bind(function($tmp1, $tmp2) {
		return sm_$InstantiateGenericType({C}, $T1, $T2).$F(this, $tmp1, $tmp2);
	}, this);
", metadataImporter: new MockMetadataImporter { GetMethodSemantics = m => m.Name == "F" ? MethodScriptSemantics.StaticMethodWithThisAsFirstArgument("$F") : MethodScriptSemantics.NormalMethod(m.Name) }, addSkeleton: false);
		}

		[Test]
		public void MethodGroupConversionOnStaticMethodWithThisAsFirstArgumentOnAnotherTargetWorks() {
			AssertCorrect(
@"public void F(int a, int b) { return 0; }
public void M() {
	C c;
	// BEGIN
	Action<int, int> f = c.F;
	// END
}
",
@"	var $f = $Bind(function($tmp1, $tmp2) {
		{sm_C}.$F(this, $tmp1, $tmp2);
	}, $c);
", metadataImporter: new MockMetadataImporter { GetMethodSemantics = m => m.Name == "F" ? MethodScriptSemantics.StaticMethodWithThisAsFirstArgument("$F") : MethodScriptSemantics.NormalMethod(m.Name) });
		}

		[Test]
		public void CanPerformMethodGroupConversionOnStaticMethodWithThisAsFirstArgumentWhenDelegateTypeUsesBindThisToFirstParameter() {
			AssertCorrect(
@"public void F(int a, int b) { return 0; }
public void M() {
	// BEGIN
	Action<int, int> f = F;
	// END
}
",
@"	var $f = $BindFirstParameterToThis($Bind(function($tmp1, $tmp2) {
		{sm_C}.$F(this, $tmp1, $tmp2);
	}, this));
", metadataImporter: new MockMetadataImporter { GetDelegateSemantics = d => new DelegateScriptSemantics(bindThisToFirstParameter: true), GetMethodSemantics = m => m.Name == "F" ? MethodScriptSemantics.StaticMethodWithThisAsFirstArgument("$F") : MethodScriptSemantics.NormalMethod(m.Name) });
		}

		[Test]
		public void CanPerformMethodGroupConversionOnStaticMethodWithThisAsFirstArgumentWhenBothTheMethodAndTheDelegateTypeExpandsParamArray() {
			AssertCorrect(
@"public void F(int a, int b) { return 0; }
public void M() {
	// BEGIN
	Action<int, int> f = F;
	// END
}
",
@"	var $f = $Bind(function() {
		{sm_C}.$F.apply(null, [this].concat(Array.prototype.slice.call(arguments)));
	}, this);
", metadataImporter: new MockMetadataImporter { GetDelegateSemantics = d => new DelegateScriptSemantics(expandParams: true), GetMethodSemantics = m => m.Name == "F" ? MethodScriptSemantics.StaticMethodWithThisAsFirstArgument("$F", expandParams: true) : MethodScriptSemantics.NormalMethod(m.Name) });
		}

		[Test]
		public void CannotPerformMethodGroupConversionOnStaticMethodWithThisAsFirstArgumentThatExpandsParamsToDelegateThatDoesNot() {
			var er = new MockErrorReporter(false);

			Compile(new[] {
@"class C1 {
	public void F(int x, int y, params int[] args) {}
	public void M() {
		System.Action<int, int, int[]> a = F;
	}
}" }, metadataImporter: new MockMetadataImporter { GetMethodSemantics = m => m.Name == "F" ? MethodScriptSemantics.StaticMethodWithThisAsFirstArgument("$F", expandParams: true) : MethodScriptSemantics.NormalMethod(m.Name) }, errorReporter: er);

			Assert.That(er.AllMessages.Count, Is.EqualTo(1));
			Assert.That(er.AllMessages[0].FormattedMessage.Contains("C1.F") && er.AllMessages[0].FormattedMessage.Contains("System.Action") && er.AllMessages[0].FormattedMessage.Contains("expand") && er.AllMessages[0].FormattedMessage.Contains("param array"));
		}

		[Test]
		public void MethodGroupConversionOnExtensionMethodImplementedAsNormalMethod() {
			AssertCorrect(
@"using System;
static class Ext {
	public static void F(this string s, int a, params int[] b) {}
}
class C {
	public void M() {
		string s = null;
		// BEGIN
		Action<int, int[]> f = s.F;
		// END
	}
}
",
@"	var $f = function($tmp1, $tmp2) {
		{sm_Ext}.$F($s, $tmp1, $tmp2);
	};
", addSkeleton: false);
		}

		[Test]
		public void MethodGroupConversionOnExtensionMethodImplementedAsNormalMethod_WithReturnValue() {
			AssertCorrect(
@"using System;
static class Ext {
	public static int F(this string s, int a, params int[] b) { return 0; }
}
class C {
	public void M() {
		string s = null;
		// BEGIN
		Func<int, int[], int> f = s.F;
		// END
	}
}
",
@"	var $f = function($tmp1, $tmp2) {
		return {sm_Ext}.$F($s, $tmp1, $tmp2);
	};
", addSkeleton: false);
		}

		[Test]
		public void MethodGroupConversionOnExtensionMethodImplementedAsNormalMethod_ExpandParams() {
			AssertCorrect(
@"using System;
static class Ext {
	public static void F(this string s, int a, int b) {}
}
class C {
	public void M() {
		string s = null;
		// BEGIN
		Action<int, int> f = s.F;
		// END
	}
}
",
@"	var $f = function() {
		{sm_Ext}.$F.apply(null, [$s].concat(Array.prototype.slice.call(arguments)));
	};
", addSkeleton: false, metadataImporter: new MockMetadataImporter { GetMethodSemantics = m => MethodScriptSemantics.NormalMethod("$" + m.Name, expandParams: true), GetDelegateSemantics = d => new DelegateScriptSemantics(expandParams: true) });
		}

		[Test]
		public void MethodGroupConversionOnExtensionMethodImplementedAsNormalMethodAppliedToThis() {
			AssertCorrect(
@"using System;
static class Ext {
	public static void F(this C c, int a, int b) {}
}
class C {
	public void M() {
		// BEGIN
		Action<int, int> f = this.F;
		// END
	}
}
",
@"	var $f = $Bind(function($tmp1, $tmp2) {
		{sm_Ext}.$F(this, $tmp1, $tmp2);
	}, this);
", addSkeleton: false);
		}

		[Test]
		public void MethodGroupConversionOnExtensionMethodImplementedAsInlineCode() {
			AssertCorrect(
@"using System;
static class Ext {
	public static void F(this string s, int a, int b) {}
}
class C {
	public void M() {
		string s = null;
		// BEGIN
		Action<int, int> f = s.F;
		// END
	}
}
",
@"	var $f = function($tmp1, $tmp2) {
		_($s)._($tmp1)._($tmp2);
	};
", addSkeleton: false, metadataImporter: new MockMetadataImporter { GetMethodSemantics = m => m.Name == "F" ? MethodScriptSemantics.InlineCode("_({s})._({a})._({b})") : MethodScriptSemantics.NormalMethod("$" + m.Name) });
		}

		[Test]
		public void MethodGroupConversionOnExtensionMethodImplementedAsInlineCode_WithReturnValue() {
			AssertCorrect(
@"using System;
static class Ext {
	public static int F(this string s, int a, params int[] b) { return 0; }
}
class C {
	public void M() {
		string s = null;
		// BEGIN
		Func<int, int[], int> f = s.F;
		// END
	}
}
",
@"	var $f = function($tmp1, $tmp2) {
		return _($s)._($tmp1)._($tmp2);
	};
", addSkeleton: false, metadataImporter: new MockMetadataImporter { GetMethodSemantics = m => m.Name == "F" ? MethodScriptSemantics.InlineCode("_({s})._({a})._({b})") : MethodScriptSemantics.NormalMethod("$" + m.Name) });
		}

		[Test]
		public void MethodGroupConversionOnExtensionMethodImplementedAsInlineCode_ExpandParams() {
			AssertCorrect(
@"using System;
static class Ext {
	public static void F(this string s, int a, int[] b) {}
}
class C {
	public void M() {
		string s = null;
		// BEGIN
		Action<int, int[]> f = s.F;
		// END
	}
}
",
@"	var $f = function($tmp1) {
		_($s)._($tmp1)._(Array.prototype.slice.call(arguments, 1));
	};
", addSkeleton: false, metadataImporter: new MockMetadataImporter { GetMethodSemantics = m => m.Name == "F" ? MethodScriptSemantics.InlineCode("_({s})._({a})._({b})") : MethodScriptSemantics.NormalMethod("$" + m.Name), GetDelegateSemantics = d => new DelegateScriptSemantics(expandParams: true) });
		}

		[Test]
		public void MethodGroupConversionOnExtensionMethodImplementedAsInlineCodeAppliedToThis() {
			AssertCorrect(
@"using System;
static class Ext {
	public static void F(this C c, int a, int b) {}
}
class C {
	public void M() {
		// BEGIN
		Action<int, int> f = this.F;
		// END
	}
}
",
@"	var $f = $Bind(function($tmp1, $tmp2) {
		_(this)._($tmp1)._($tmp2);
	}, this);
", addSkeleton: false, metadataImporter: new MockMetadataImporter { GetMethodSemantics = m => m.Name == "F" ? MethodScriptSemantics.InlineCode("_({c})._({a})._({b})") : MethodScriptSemantics.NormalMethod("$" + m.Name) });

		}
	}
}


text:
local FakeRequire = {
    originalRequire = require,
    fakedModules = {},
    whitelisted = {}
}

function FakeRequire:fakeModule( name, table )
    self.fakedModules[name] = table
end

function FakeRequire:whitelist( prefix )
    table.insert(self.whitelisted, '^'..prefix)
end

function FakeRequire:isWhitelisted( name )
    for _, pattern in ipairs(self.whitelisted) do
        if string.find(name, pattern) then
            return true
        end
    end
    return false
end

function FakeRequire._require( moduleName )
    local module = FakeRequire.fakedModules[moduleName]
    if module then return module end

    if FakeRequire:isWhitelisted(moduleName) then
        return FakeRequire.originalRequire(moduleName)
    else
        error('Requiring non whitelisted module: '..moduleName, 2)
    end
end

-- luacheck: globals require

function FakeRequire:install()
    require = self._require
end

function FakeRequire:uninstall()
    require = self.originalRequire
end

return FakeRequire


text:
package com.netflix.spinnaker.halyard.cli.command.v1.config.ci.jenkins;

import com.beust.jcommander.Parameter;
import com.beust.jcommander.Parameters;
import com.netflix.spinnaker.halyard.cli.command.v1.config.ci.master.AbstractEditMasterCommand;
import com.netflix.spinnaker.halyard.config.model.v1.ci.jenkins.JenkinsMaster;
import com.netflix.spinnaker.halyard.config.model.v1.node.CIAccount;

@Parameters(separators = "=")
public class JenkinsEditMasterCommand extends AbstractEditMasterCommand<JenkinsMaster> {
  protected String getCiName() {
    return "jenkins";
  }

  @Parameter(names = "--address", description = JenkinsCommandProperties.ADDRESS_DESCRIPTION)
  private String address;

  @Parameter(names = "--username", description = JenkinsCommandProperties.USERNAME_DESCRIPTION)
  public String username;

  @Parameter(
      names = "--password",
      password = true,
      description = JenkinsCommandProperties.PASSWORD_DESCRIPTION)
  public String password;

  @Parameter(names = "--csrf", arity = 1, description = JenkinsCommandProperties.CSRF_DESCRIPTION)
  public Boolean csrf;

  @Override
  protected CIAccount editMaster(JenkinsMaster master) {
    master.setAddress(isSet(address) ? address : master.getAddress());
    master.setUsername(isSet(username) ? username : master.getUsername());
    master.setPassword(isSet(password) ? password : master.getPassword());
    master.setCsrf(isSet(csrf) ? csrf : master.getCsrf());

    return master;
  }
}


text:
create table t1 (s1 string collate utf8_en_ci, i integer);
create table t2 (s1 string collate utf8_en_cs, i integer);

insert into t1 values ('Aby', 1), ('aay',1);
insert into t1 values ('Aby', 2), ('aay',2);

insert into t2 values ('Aby', 1), ('aay',1);
insert into t2 values ('Aby', 2), ('aay',2);

select if(group_concat (s1) in ('aay,Aby', 'Aby,aay'), 'ok', 'nok' )  from (select * from t1 order by 1,2) group by i order by 1;
select if(group_concat (s1) in ('aay,Aby', 'Aby,aay'), 'ok', 'nok' ) from (select * from t2 order by 1,2) group by i order by 1;

select group_concat (s1) from t1 group by s1 order by 1;
select group_concat (s1) from t2 group by s1 order by 1;

select group_concat (s1 order by 1) from t1 group by i order by 1;
select group_concat (s1 order by 1) from t2 group by i order by 1;

select group_concat (s1 order by 1) from t1 group by i order by 1;
select group_concat (s1 order by 1) from t2 group by i order by 1;

select group_concat (s1 order by 1 separator '+') from t1 group by i order by 1;
select group_concat (s1 order by 1 separator '+') from t2 group by i order by 1;

drop table t1;
drop table t2;


text:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

  <title>Qt 4.8: QTextOStream Class Reference</title>
  <link rel="stylesheet" type="text/css" href="style/style.css" />

  <link rel="stylesheet" type="text/css" href="style/superfish.css" />
  <link rel="stylesheet" type="text/css" href="style/narrow.css" />

      Home

    Qt Reference Documentation

Qt HOME

DEV

          DOC

BLOG

Qt 4.8

ALL VERSIONS

API Lookup

Class index

Function index

Modules

Namespaces

Global Declarations

QML elements

Qt Topics

Programming with Qt

Device UIs & Qt Quick

UI Design with Qt

Supported Platforms

Qt and Key Technologies

How-To's and Best Practices

Examples

Examples

Tutorials

Demos

QML Examples

          Search index:

          <form id="qtdocsearch" action="" onsubmit="return false;">
            <fieldset>
              <input type="text" name="searchstring" id="pageType" value="" />

 Close

All | API | Articles | Examples

 results:

            </fieldset>
          </form>

            API Lookup

Class index

Function index

Modules

Namespaces

Global Declarations

QML elements

            Qt Topics

Programming with Qt

Device UIs & Qt Quick

UI Design with Qt

Supported Platforms

Qt and Key Technologies

How-To's and Best Practices

            Examples

Examples

Tutorials

Demos

QML Examples

Home

Modules

QtCore

QTextOStream

A

A

A

                Print

Contents

Public Functions

Detailed Description

QTextOStream Class Reference

The QTextOStream class is a convenience class for output streams. More...

 #include <QTextOStream>

This class is part of the Qt 3 support library. It is provided to keep old source code working. We strongly advise against using it in new code. See Porting to Qt 4 for more information.

Inherits: QTextStream.

Note: All functions in this class are reentrant.

List of all members, including inherited members

Public Functions

 	QTextOStream ( QString * string )

 	QTextOStream ( QByteArray * byteArray )

 	QTextOStream ( FILE * file )

70 public functions inherited from QTextStream

Detailed Description

The QTextOStream class is a convenience class for output streams.

Use QTextStream instead.

Member Function Documentation

QTextOStream::QTextOStream ( QString * string )

Use QTextStream(&string, QIODevice::WriteOnly) instead.

QTextOStream::QTextOStream ( QByteArray * byteArray )

Use QTextStream(&byteArray, QIODevice::WriteOnly) instead.

QTextOStream::QTextOStream ( FILE * file )

Use QTextStream(file, QIODevice::WriteOnly) instead.

      <acronym title="Copyright">©</acronym> 2013 Digia Plc and/or its
      subsidiaries. Documentation contributions included herein are the copyrights of
      their respective owners.

      The documentation provided herein is licensed under the terms of the
      GNU Free Documentation
      License version 1.3 as published by the Free Software Foundation.

      Documentation sources may be obtained from
      www.qt-project.org.

      Digia, Qt and their respective logos are trademarks of Digia Plc
      in Finland and/or other countries worldwide. All other trademarks are property
      of their respective owners. Privacy Policy


text:
<?php

namespace LaraBug\Tests;

use LaraBug\LaraBug;
use LaraBug\Tests\Mocks\LaraBugClient;
use Illuminate\Foundation\Auth\User as AuthUser;

class UserTest extends TestCase
{
    /** @var Mocks\LaraBugClient */
    protected $client;

    /** @var LaraBug */
    protected $laraBug;

    public function setUp(): void
    {
        parent::setUp();

        $this->laraBug = new LaraBug($this->client = new LaraBugClient(
            'login_key',
            'project_key'
        ));
    }

    /** @test */
    public function it_return_custom_user()
    {
        $this->actingAs((new CustomerUser())->forceFill([
            'id' => 1,
            'username' => 'username',
            'password' => 'password',
            'email' => 'email',
        ]));

        $this->assertSame(['id' => 1, 'username' => 'username', 'password' => 'password', 'email' => 'email'], $this->laraBug->getUser());
    }

    /** @test */
    public function it_return_custom_user_with_to_larabug()
    {
        $this->actingAs((new CustomerUserWithToLarabug())->forceFill([
            'id' => 1,
            'username' => 'username',
            'password' => 'password',
            'email' => 'email',
        ]));

        $this->assertSame(['username' => 'username', 'email' => 'email'], $this->laraBug->getUser());
    }

    /** @test */
    public function it_returns_nothing_for_ghost()
    {
        $this->assertSame(null, $this->laraBug->getUser());
    }
}

class CustomerUser extends AuthUser
{
    protected $guarded = [];
}

class CustomerUserWithToLarabug extends CustomerUser implements \LaraBug\Concerns\Larabugable
{
    public function toLarabug()
    {
        return [
            'username' => $this->username,
            'email' => $this->email,
        ];
    }
}


text:
export const config = {
  apiService: {
    url: process.env.API_SERVICE_URL,
  },
};


text:
namespace Envoy {
namespace Event {

class MockProvisionalDispatcher : public ProvisionalDispatcher {
public:
  MockProvisionalDispatcher();
  ~MockProvisionalDispatcher() override = default;

  // ProvisionalDispatcher
  void deferredDelete(DeferredDeletablePtr&& to_delete) override {
    deferredDelete_(to_delete.get());
    if (to_delete) {
      to_delete_.push_back(std::move(to_delete));
    }
  }

  envoy_status_t post(std::function<void()> callback) override {
    callbacks_.push_back(callback);
    return post_(callback);
  }

  // Event::ProvisionalDispatcher
  MOCK_METHOD(void, drain, (Event::Dispatcher & event_dispatcher));
  MOCK_METHOD(void, deferredDelete_, (DeferredDeletable * to_delete));
  MOCK_METHOD(envoy_status_t, post_, (std::function<void()> callback));
  MOCK_METHOD(Event::SchedulableCallbackPtr, createSchedulableCallback, (std::function<void()> cb));
  MOCK_METHOD(bool, isThreadSafe, (), (const));
  MOCK_METHOD(void, pushTrackedObject, (const ScopeTrackedObject* object));
  MOCK_METHOD(void, popTrackedObject, (const ScopeTrackedObject* expected_object));
  MOCK_METHOD(bool, trackedObjectStackIsEmpty, (), (const));
  MOCK_METHOD(TimeSource&, timeSource, ());

  Event::GlobalTimeSystem time_system_;
  std::list<DeferredDeletablePtr> to_delete_;
  std::list<std::function<void()>> callbacks_;
};

} // namespace Event
} // namespace Envoy