text:
package org.springframework.security.config.annotation.web;

import java.util.Base64;

import javax.servlet.http.HttpServletResponse;

import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.annotation.Order;
import org.springframework.mock.web.MockFilterChain;
import org.springframework.mock.web.MockHttpServletRequest;
import org.springframework.mock.web.MockHttpServletResponse;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.builders.WebSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.config.test.SpringTestContext;
import org.springframework.security.config.test.SpringTestContextExtension;
import org.springframework.security.core.userdetails.PasswordEncodedUser;
import org.springframework.security.web.FilterChainProxy;
import org.springframework.security.web.csrf.CsrfToken;
import org.springframework.security.web.csrf.DefaultCsrfToken;
import org.springframework.security.web.csrf.HttpSessionCsrfTokenRepository;

import static org.assertj.core.api.Assertions.assertThat;

/**
 * Demonstrate the samples.
 *
 * @author Rob Winch
 * @author Joe Grandja
 */
@ExtendWith(SpringTestContextExtension.class)
public class SampleWebSecurityConfigurerAdapterTests {

	public final SpringTestContext spring = new SpringTestContext(this);

	@Autowired
	private FilterChainProxy springSecurityFilterChain;

	private MockHttpServletRequest request;

	private MockHttpServletResponse response;

	private MockFilterChain chain;

	@BeforeEach
	public void setup() {
		this.request = new MockHttpServletRequest("GET", "");
		this.response = new MockHttpServletResponse();
		this.chain = new MockFilterChain();
		CsrfToken csrfToken = new DefaultCsrfToken("X-CSRF-TOKEN", "_csrf", "CSRF-TOKEN-TEST");
		new HttpSessionCsrfTokenRepository().saveToken(csrfToken, this.request, this.response);
		this.request.setParameter(csrfToken.getParameterName(), csrfToken.getToken());
	}

	@Test
	public void helloWorldSampleWhenRequestSecureResourceThenRedirectToLogin() throws Exception {
		this.spring.register(HelloWorldWebSecurityConfigurerAdapter.class).autowire();
		this.request.addHeader("Accept", "text/html");
		this.springSecurityFilterChain.doFilter(this.request, this.response, this.chain);
		assertThat(this.response.getRedirectedUrl()).isEqualTo("http://localhost/login");
	}

	@Test
	public void helloWorldSampleWhenRequestLoginWithoutCredentialsThenRedirectToLogin() throws Exception {
		this.spring.register(HelloWorldWebSecurityConfigurerAdapter.class).autowire();
		this.request.setServletPath("/login");
		this.request.setMethod("POST");
		this.request.addHeader("Accept", "text/html");
		this.springSecurityFilterChain.doFilter(this.request, this.response, this.chain);
		assertThat(this.response.getRedirectedUrl()).isEqualTo("/login?error");
	}

	@Test
	public void helloWorldSampleWhenRequestLoginWithValidCredentialsThenRedirectToIndex() throws Exception {
		this.spring.register(HelloWorldWebSecurityConfigurerAdapter.class).autowire();
		this.request.setServletPath("/login");
		this.request.setMethod("POST");
		this.request.addHeader("Accept", "text/html");
		this.request.addParameter("username", "user");
		this.request.addParameter("password", "password");
		this.springSecurityFilterChain.doFilter(this.request, this.response, this.chain);
		assertThat(this.response.getRedirectedUrl()).isEqualTo("/");
	}

	@Test
	public void readmeSampleWhenRequestSecureResourceThenRedirectToLogin() throws Exception {
		this.spring.register(SampleWebSecurityConfigurerAdapter.class).autowire();
		this.springSecurityFilterChain.doFilter(this.request, this.response, this.chain);
		assertThat(this.response.getRedirectedUrl()).isEqualTo("http://localhost/login");
	}

	@Test
	public void readmeSampleWhenRequestLoginWithoutCredentialsThenRedirectToLogin() throws Exception {
		this.spring.register(SampleWebSecurityConfigurerAdapter.class).autowire();
		this.request.setServletPath("/login");
		this.request.setMethod("POST");
		this.springSecurityFilterChain.doFilter(this.request, this.response, this.chain);
		assertThat(this.response.getRedirectedUrl()).isEqualTo("/login?error");
	}

	@Test
	public void readmeSampleWhenRequestLoginWithValidCredentialsThenRedirectToIndex() throws Exception {
		this.spring.register(SampleWebSecurityConfigurerAdapter.class).autowire();
		this.request.setServletPath("/login");
		this.request.setMethod("POST");
		this.request.addParameter("username", "user");
		this.request.addParameter("password", "password");
		this.springSecurityFilterChain.doFilter(this.request, this.response, this.chain);
		assertThat(this.response.getRedirectedUrl()).isEqualTo("/");
	}

	@Test
	public void multiHttpSampleWhenRequestSecureResourceThenRedirectToLogin() throws Exception {
		this.spring.register(SampleMultiHttpSecurityConfig.class).autowire();
		this.springSecurityFilterChain.doFilter(this.request, this.response, this.chain);
		assertThat(this.response.getRedirectedUrl()).isEqualTo("http://localhost/login");
	}

	@Test
	public void multiHttpSampleWhenRequestLoginWithoutCredentialsThenRedirectToLogin() throws Exception {
		this.spring.register(SampleMultiHttpSecurityConfig.class).autowire();
		this.request.setServletPath("/login");
		this.request.setMethod("POST");
		this.springSecurityFilterChain.doFilter(this.request, this.response, this.chain);
		assertThat(this.response.getRedirectedUrl()).isEqualTo("/login?error");
	}

	@Test
	public void multiHttpSampleWhenRequestLoginWithValidCredentialsThenRedirectToIndex() throws Exception {
		this.spring.register(SampleMultiHttpSecurityConfig.class).autowire();
		this.request.setServletPath("/login");
		this.request.setMethod("POST");
		this.request.addParameter("username", "user");
		this.request.addParameter("password", "password");
		this.springSecurityFilterChain.doFilter(this.request, this.response, this.chain);
		assertThat(this.response.getRedirectedUrl()).isEqualTo("/");
	}

	@Test
	public void multiHttpSampleWhenRequestProtectedResourceThenStatusUnauthorized() throws Exception {
		this.spring.register(SampleMultiHttpSecurityConfig.class).autowire();
		this.request.setServletPath("/api/admin/test");
		this.springSecurityFilterChain.doFilter(this.request, this.response, this.chain);
		assertThat(this.response.getStatus()).isEqualTo(HttpServletResponse.SC_UNAUTHORIZED);
	}

	@Test
	public void multiHttpSampleWhenRequestAdminResourceWithRegularUserThenStatusForbidden() throws Exception {
		this.spring.register(SampleMultiHttpSecurityConfig.class).autowire();
		this.request.setServletPath("/api/admin/test");
		this.request.addHeader("Authorization",
				"Basic " + Base64.getEncoder().encodeToString("user:password".getBytes()));
		this.springSecurityFilterChain.doFilter(this.request, this.response, this.chain);
		assertThat(this.response.getStatus()).isEqualTo(HttpServletResponse.SC_FORBIDDEN);
	}

	@Test
	public void multiHttpSampleWhenRequestAdminResourceWithAdminUserThenStatusOk() throws Exception {
		this.spring.register(SampleMultiHttpSecurityConfig.class).autowire();
		this.request.setServletPath("/api/admin/test");
		this.request.addHeader("Authorization",
				"Basic " + Base64.getEncoder().encodeToString("admin:password".getBytes()));
		this.springSecurityFilterChain.doFilter(this.request, this.response, this.chain);
		assertThat(this.response.getStatus()).isEqualTo(HttpServletResponse.SC_OK);
	}

	/**
	 *

	 *   <http>
	 *     <intercept-url pattern="/resources/**" access="permitAll"/>
	 *     <intercept-url pattern="/**" access="authenticated"/>
	 *     <logout
	 *         logout-success-url="/login?logout"
	 *         logout-url="/logout"
	 *     <form-login
	 *         authentication-failure-url="/login?error"
	 *         login-page="/login" <!-- Except Spring Security renders the login page -->
	 *         login-processing-url="/login" <!-- but only POST -->
	 *         password-parameter="password"
	 *         username-parameter="username"
	 *     />
	 *   </http>
	 *   <authentication-manager>
	 *     <authentication-provider>
	 *       <user-service>
	 *         <user username="user" password="password" authorities="ROLE_USER"/>
	 *       </user-service>
	 *     </authentication-provider>
	 *   </authentication-manager>
	 *

	 *
	 * @author Rob Winch
	 */
	@EnableWebSecurity
	public static class HelloWorldWebSecurityConfigurerAdapter extends WebSecurityConfigurerAdapter {

		@Override
		protected void configure(AuthenticationManagerBuilder auth) throws Exception {
			// @formatter:off
			auth
				.inMemoryAuthentication()
					.withUser(PasswordEncodedUser.user());
			// @formatter:on
		}

	}

	/**
	 *

	 *   <http security="none" pattern="/resources/**"/>
	 *   <http>
	 *     <intercept-url pattern="/logout" access="permitAll"/>
	 *     <intercept-url pattern="/login" access="permitAll"/>
	 *     <intercept-url pattern="/signup" access="permitAll"/>
	 *     <intercept-url pattern="/about" access="permitAll"/>
	 *     <intercept-url pattern="/**" access="hasRole('ROLE_USER')"/>
	 *     <logout
	 *         logout-success-url="/login?logout"
	 *         logout-url="/logout"
	 *     <form-login
	 *         authentication-failure-url="/login?error"
	 *         login-page="/login"
	 *         login-processing-url="/login" <!-- but only POST -->
	 *         password-parameter="password"
	 *         username-parameter="username"
	 *     />
	 *   </http>
	 *   <authentication-manager>
	 *     <authentication-provider>
	 *       <user-service>
	 *         <user username="user" password="password" authorities="ROLE_USER"/>
	 *         <user username="admin" password="password" authorities=
	"ROLE_USER,ROLE_ADMIN"/>
	 *       </user-service>
	 *     </authentication-provider>
	 *   </authentication-manager>
	 *

	 *
	 * @author Rob Winch
	 */
	@EnableWebSecurity
	public static class SampleWebSecurityConfigurerAdapter extends WebSecurityConfigurerAdapter {

		@Override
		public void configure(WebSecurity web) {
			web.ignoring().antMatchers("/resources/**");
		}

		@Override
		protected void configure(HttpSecurity http) throws Exception {
			// @formatter:off
			http
				.authorizeRequests()
					.antMatchers("/signup", "/about").permitAll()
					.anyRequest().hasRole("USER")
					.and()
				.formLogin()
					.loginPage("/login")
						// set permitAll for all URLs associated with Form Login
						.permitAll();
			// @formatter:on
		}

		@Override
		protected void configure(AuthenticationManagerBuilder auth) throws Exception {
			// @formatter:off
			auth
				.inMemoryAuthentication()
					.withUser(PasswordEncodedUser.user())
					.withUser(PasswordEncodedUser.admin());
			// @formatter:on
		}

	}

	/**
	 *
	 *   <http security="none" pattern="/resources/**"/>
	 *   <http pattern="/api/**">
	 *     <intercept-url pattern="/api/admin/**" access="hasRole('ROLE_ADMIN')"/>
	 *     <intercept-url pattern="/api/**" access="hasRole('ROLE_USER')"/>
	 *     <http-basic />
	 *   </http>
	 *   <http>
	 *     <intercept-url pattern="/logout" access="permitAll"/>
	 *     <intercept-url pattern="/login" access="permitAll"/>
	 *     <intercept-url pattern="/signup" access="permitAll"/>
	 *     <intercept-url pattern="/about" access="permitAll"/>
	 *     <intercept-url pattern="/**" access="hasRole('ROLE_USER')"/>
	 *     <logout
	 *         logout-success-url="/login?logout"
	 *         logout-url="/logout"
	 *     <form-login
	 *         authentication-failure-url="/login?error"
	 *         login-page="/login"
	 *         login-processing-url="/login" <!-- but only POST -->
	 *         password-parameter="password"
	 *         username-parameter="username"
	 *     />
	 *   </http>
	 *   <authentication-manager>
	 *     <authentication-provider>
	 *       <user-service>
	 *         <user username="user" password="password" authorities="ROLE_USER"/>
	 *         <user username="admin" password="password" authorities=
	"ROLE_USER,ROLE_ADMIN"/>
	 *       </user-service>
	 *     </authentication-provider>
	 *   </authentication-manager>
	 *
	 *
	 * @author Rob Winch
	 */
	@EnableWebSecurity
	public static class SampleMultiHttpSecurityConfig {

		@Autowired
		protected void configure(AuthenticationManagerBuilder auth) throws Exception {
			// @formatter:off
			auth
				.inMemoryAuthentication()
					.withUser(PasswordEncodedUser.user())
					.withUser(PasswordEncodedUser.admin());
			// @formatter:on
		}

		@Configuration
		@Order(1)
		public static class ApiWebSecurityConfigurationAdapter extends WebSecurityConfigurerAdapter {

			@Override
			protected void configure(HttpSecurity http) throws Exception {
				// @formatter:off
				http
					.antMatcher("/api/**")
						.authorizeRequests()
							.antMatchers("/api/admin/**").hasRole("ADMIN")
							.antMatchers("/api/**").hasRole("USER")
							.and()
						.httpBasic();
				// @formatter:on
			}

		}

		@Configuration
		public static class FormLoginWebSecurityConfigurerAdapter extends WebSecurityConfigurerAdapter {

			@Override
			public void configure(WebSecurity web) {
				web.ignoring().antMatchers("/resources/**");
			}

			@Override
			protected void configure(HttpSecurity http) throws Exception {
				// @formatter:off
				http
					.authorizeRequests()
						.antMatchers("/signup", "/about").permitAll()
						.anyRequest().hasRole("USER")
						.and()
					.formLogin()
						.loginPage("/login")
							.permitAll();
				// @formatter:on
			}

		}

	}

}


text:
#include <cstddef>

#include "HybridEventFactory.h"

using namespace pearl;

/*
 *---------------------------------------------------------------------------
 *
 * class HybridEventFactory
 *
 *---------------------------------------------------------------------------
 */

//--- Buffer-based factory methods ------------------------------------------

Event_rep* HybridEventFactory::createEvent(event_t           type,
                                           const GlobalDefs& defs,
                                           Buffer&           buffer) const
{
  Event_rep* result = NULL;

  switch (type) {
    case MPI_COLLEXIT:
    case MPI_SEND:
    case MPI_SEND_REQUEST:
    case MPI_SEND_COMPLETE:
    case MPI_RECV:
    case MPI_RECV_REQUEST:
    case MPI_RECV_COMPLETE:
    case MPI_REQUEST_TESTED:
    case MPI_CANCELLED:
    case MPI_RMA_PUT_START:
    case MPI_RMA_PUT_END:
    case MPI_RMA_GET_START:
    case MPI_RMA_GET_END:
    case MPI_RMAEXIT:
    case MPI_RMACOLLEXIT:
    case MPI_RMA_LOCK:
    case MPI_RMA_UNLOCK:
      result = MpiEventFactory::createEvent(type, defs, buffer);
      break;

    case OMP_FORK:
    case OMP_JOIN:
    case OMP_RLOCK:
    case OMP_ALOCK:
    case OMP_COLLEXIT:
      result = OmpEventFactory::createEvent(type, defs, buffer);
      break;

  default:
    result = EventFactory::createEvent(type, defs, buffer);
    break;
  }

  return result;
}

redpajama_set_name: RedPajamaGithub


text:
App.UserView = Ember.View.extend({
  tagName: "div",
  classNames: ['navbar', 'navbar-inverse', 'navbar-fixed-top'],
  templateName: "user"
});


text:
package ch.ntb.inf.deep.classItems;

import ch.ntb.inf.deep.config.Segment;
import ch.ntb.inf.deep.host.Dbg;
import ch.ntb.inf.deep.linker.FixedValueEntry;
import ch.ntb.inf.deep.strings.HString;

public class Array extends RefType {
	public Array nextArray;	// all arrays are linked
	public Array nextHigherDim;	// link to array with same type but next higher dimension
	public Array nextLowerDim;	// link to array with same type but next lower dimension

	public Type componentType;	// component type
	public byte dimension;	// array dimension

	public Segment segment;
	public FixedValueEntry typeDescriptor;	// reference to first item of array type descriptor (extension level)

	Array(HString regName, Type compType, int dimension) {
		super(regName, wktObject); // base type is java/lang/Object
		category = tcArray;
		sizeInBits = 32;	// array is of type reference type
		this.componentType = compType;
		this.dimension = (byte)dimension;
	}

	//--- debug primitives

	public void printShort(int indentLevel) {
		indent(indentLevel);
		vrb.printf("array %1$s, flags=", name);  Dbg.printAccAndPropertyFlags(accAndPropFlags, 'C');
	}

	public void printFields(int indentLevel) {
		indent(indentLevel);
		vrb.printf("array: (dim=%1$d, compType=%2$s, baseType=%3$s, nextHigherDim=%4$s, nextLowerDim=%5$s)\n", dimension, componentType.name, type.name, nextHigherDim!=null?nextHigherDim.name:"null", nextLowerDim!=null?nextLowerDim.name:"null");
	}

	public void printMethods(int indentLevel) {
		indent(indentLevel);
		vrb.println("methods: none");
	}

	public void print(int indentLevel) {
		printShort(indentLevel ); vrb.println();
		printFields(indentLevel+1 );
	}
}


text:
import {Component} from 'angular2/core';
import DemoComponent from './demo-component';
import Service1 from '../../services/service1';
import Service2 from '../../services/service2';

@Component({
  selector: 'demo',
  directives: [DemoComponent],
  providers: [Service1, Service2],
  template: `
  <div>
    <demo-comp
      [msg]='"input data"'
      (newMsg)='doStuff($event)'>
    </demo-comp>
  </div>
  `
})
export default class Demo {
  doStuff($event) {
    console.log($event);
  }
}


text:
  Pars-lès-Chavanges est
       un village
       situé dans le département de l'Aube en Champagne-Ardenne. Elle comptait 70 habitants en 2008.

Si vous envisagez de venir habiter à Pars-lès-Chavanges, vous pourrez aisément trouver une maison à acheter.

Le parc d'habitations, à Pars-lès-Chavanges, se décomposait en 2011 en zero appartements et 37 maisons soit
 un marché plutôt équilibré.

La ville propose quelques  équipements, elle dispose, entre autres, de un terrain de tennis.

À proximité de Pars-lès-Chavanges sont situées les villes de
Blignicourt à 5 km, 53 habitants,
Saint-Utin à 4 km, 78 habitants,
Rances située à 5 km, 47 habitants,
Saint-Léger-sous-Margerie localisée à 2 km, 63 habitants,
Braux située à 3 km, 110 habitants,
Yèvres-le-Petit localisée à 3 km, 72 habitants,
 entre autres. De plus, Pars-lès-Chavanges est située à seulement 25 km de Vitry-le-François.


text:
namespace TryAppService.Data.Migrations
{
    using System.CodeDom.Compiler;
    using System.Data.Entity.Migrations;
    using System.Data.Entity.Migrations.Infrastructure;
    using System.Resources;

    [GeneratedCode("EntityFramework.Migrations", "6.1.3-40302")]
    public sealed partial class AddSourceVariationColumn : IMigrationMetadata
    {
        private readonly ResourceManager Resources = new ResourceManager(typeof(AddSourceVariationColumn));

        string IMigrationMetadata.Id
        {
            get { return "201506170213273_AddSourceVariationColumn"; }
        }

        string IMigrationMetadata.Source
        {
            get { return null; }
        }

        string IMigrationMetadata.Target
        {
            get { return Resources.GetString("Target"); }
        }
    }
}


text:
package edu.clemson.cs.rsrg.absyn.declarations.operationdecl;

import edu.clemson.cs.rsrg.absyn.clauses.AffectsClause;
import edu.clemson.cs.rsrg.absyn.clauses.AssertionClause;
import edu.clemson.cs.rsrg.absyn.declarations.Dec;
import edu.clemson.cs.rsrg.absyn.declarations.facilitydecl.FacilityDec;
import edu.clemson.cs.rsrg.absyn.declarations.variabledecl.ParameterVarDec;
import edu.clemson.cs.rsrg.absyn.declarations.variabledecl.VarDec;
import edu.clemson.cs.rsrg.absyn.rawtypes.Ty;
import edu.clemson.cs.rsrg.absyn.statements.Statement;
import edu.clemson.cs.rsrg.parsing.data.PosSymbol;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

/**
 *
This is the class for all the procedure declaration objects
 * that the compiler builds using the ANTLR4 AST nodes.

 *
 * @version 2.0
 */
public class ProcedureDec extends Dec {

    // ===========================================================
    // Member Fields
    // ===========================================================

    /**
The list of parameter variable declarations
 */
    private final List<ParameterVarDec> myParameters;

    /**
The type model for the return value.
 */
    private final Ty myReturnTy;

    /**
The affects clause.
 */
    private final AffectsClause myAffects;

    /**
The decreasing expression
 */
    private final AssertionClause myDecreasing;

    /**
The list of facility declarations
 */
    private final List<FacilityDec> myFacilityDecs;

    /**
The list of variable declarations
 */
    private final List<VarDec> myVariableDecs;

    /**
The list of statements
 */
    private final List<Statement> myStatements;

    /**
Boolean indicating if this is a recursive procedure or not.
 */
    private final boolean myRecursiveFlag;

    // ===========================================================
    // Constructors
    // ===========================================================

    /**
     *
This constructs a recursive procedure declaration.

     *
     * @param name A {@link PosSymbol} representing the procedure's
     *             name.
     * @param parameters A list of {@link ParameterVarDec} representing the procedure's
     *                   parameter variables.
     * @param returnTy A {@link Ty} representing the procedure's
     *                 return value type.
     * @param affects A {@link AffectsClause} representing the procedure's
     *                affects clause.
     * @param decreasing A {@link AssertionClause} representing the procedure's
     *                   decreasing clause.
     * @param facDecs A list of {@link FacilityDec} representing the procedure's
     *                facility declarations.
     * @param varDecs A list of {@link VarDec} representing the procedure's
     *                variables.
     * @param statements As list of {@link Statement} representing the procedure's
     *                   statements.
     * @param recursiveFlag A boolean indicating if this procedure is recursive or not.
     */
    public ProcedureDec(PosSymbol name, List<ParameterVarDec> parameters,
            Ty returnTy, AffectsClause affects, AssertionClause decreasing,
            List<FacilityDec> facDecs, List<VarDec> varDecs,
            List<Statement> statements, boolean recursiveFlag) {
        super(name.getLocation(), name);
        myAffects = affects;
        myDecreasing = decreasing;
        myFacilityDecs = facDecs;
        myParameters = parameters;
        myRecursiveFlag = recursiveFlag;
        myReturnTy = returnTy;
        myStatements = statements;
        myVariableDecs = varDecs;
    }

    /**
     *
This constructs a procedure declaration.

     *
     * @param name A {@link PosSymbol} representing the procedure's
     *             name.
     * @param parameters A list of {@link ParameterVarDec} representing the procedure's
     *                   parameter variables.
     * @param returnTy A {@link Ty} representing the procedure's
     *                 return value type.
     * @param affects A {@link AffectsClause} representing the procedure's
     *                affects clause.
     * @param facDecs A list of {@link FacilityDec} representing the procedure's
     *                facility declarations.
     * @param varDecs A list of {@link VarDec} representing the procedure's
     *                variables.
     * @param statements As list of {@link Statement} representing the procedure's
     *                   statements.
     */
    public ProcedureDec(PosSymbol name, List<ParameterVarDec> parameters,
            Ty returnTy, AffectsClause affects, List<FacilityDec> facDecs,
            List<VarDec> varDecs, List<Statement> statements) {
        this(name, parameters, returnTy, affects, null, facDecs, varDecs,
                statements, false);
    }

    // ===========================================================
    // Public Methods
    // ===========================================================

    /**
     * {@inheritDoc}
     */
    @Override
    public final String asString(int indentSize, int innerIndentInc) {
        StringBuffer sb = new StringBuffer();
        printSpace(indentSize, sb);
        if (myRecursiveFlag) {
            sb.append("Recursive ");
        }
        sb.append("Procedure ");
        sb.append(myName.asString(0, innerIndentInc));

        // parameters
        sb.append("( ");
        Iterator<ParameterVarDec> paraIt = myParameters.iterator();
        while (paraIt.hasNext()) {
            sb.append(paraIt.next().asString(0, innerIndentInc));

            if (paraIt.hasNext()) {
                sb.append("; ");
            }
        }
        sb.append(" )");

        // return value
        if (myReturnTy != null) {
            sb.append(" : ");
            sb.append(myReturnTy.asString(0, innerIndentInc));
        }

        sb.append(";\n");

        // affects clause
        if (myAffects != null) {
            sb.append(myAffects.asString(indentSize + innerIndentInc,
                    innerIndentInc));
            sb.append("\n");
        }

        // decreasing clause
        if (myDecreasing != null) {
            sb.append(myDecreasing.asString(indentSize + innerIndentInc,
                    innerIndentInc));
            sb.append(";\n");
        }

        // facility declarations
        for (FacilityDec facilityDec : myFacilityDecs) {
            sb.append(facilityDec.asString(indentSize + innerIndentInc,
                    innerIndentInc));
            sb.append("\n");
        }

        // variable declarations
        for (VarDec varDec : myVariableDecs) {
            printSpace(indentSize + innerIndentInc, sb);
            sb.append("Var ");
            sb.append(varDec.asString(0, innerIndentInc));
            sb.append(";\n");
        }

        // statements
        sb.append("\n");
        for (Statement statement : myStatements) {
            sb.append(statement.asString(indentSize + innerIndentInc,
                    innerIndentInc));
            sb.append("\n");
        }

        printSpace(indentSize, sb);
        sb.append("end ");
        sb.append(myName.asString(0, innerIndentInc));
        sb.append(";");

        return sb.toString();
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public final boolean equals(Object o) {
        if (this == o)
            return true;
        if (o == null || getClass() != o.getClass())
            return false;
        if (!super.equals(o))
            return false;

        ProcedureDec that = (ProcedureDec) o;

        if (myRecursiveFlag != that.myRecursiveFlag)
            return false;
        if (!myParameters.equals(that.myParameters))
            return false;
        if (myReturnTy != null ? !myReturnTy.equals(that.myReturnTy)
                : that.myReturnTy != null)
            return false;
        if (myAffects != null ? !myAffects.equals(that.myAffects)
                : that.myAffects != null)
            return false;
        if (myDecreasing != null ? !myDecreasing.equals(that.myDecreasing)
                : that.myDecreasing != null)
            return false;
        if (!myFacilityDecs.equals(that.myFacilityDecs))
            return false;
        if (!myVariableDecs.equals(that.myVariableDecs))
            return false;
        return myStatements.equals(that.myStatements);

    }

    /**
     *
This method returns the affects clause
     * for this procedure declaration.

     *
     * @return The {@link AffectsClause} representation object.
     */
    public final AffectsClause getAffectedVars() {
        return myAffects;
    }

    /**
     *
This method returns the decreasing clause
     * for this procedure declaration.

     *
     * @return The {@link AssertionClause} representation object.
     */
    public final AssertionClause getDecreasing() {
        return myDecreasing;
    }

    /**
     *
This method returns the list of facility declarations
     * for this procedure declaration.

     *
     * @return A list of {@link FacilityDec} representation objects.
     */
    public final List<FacilityDec> getFacilities() {
        return myFacilityDecs;
    }

    /**
     *
This method returns the parameter variable declarations
     * for this procedure declaration.

     *
     * @return A list of {@link ParameterVarDec} representation objects.
     */
    public final List<ParameterVarDec> getParameters() {
        return myParameters;
    }

    /**
     *
This method returns whether or not this is an recursive procedure.

     *
     * @return {@code true} if it is recursive, {@code false} otherwise.
     */
    public final boolean getRecursive() {
        return myRecursiveFlag;
    }

    /**
     *
This method returns the raw return type
     * for this procedure declaration.

     *
     * @return The {@link Ty} representation object.
     */
    public final Ty getReturnTy() {
        return myReturnTy;
    }

    /**
     *
This method returns the list of statements in
     * for this procedure declaration.

     *
     * @return The list of {@link Statement} representation objects.
     */
    public final List<Statement> getStatements() {
        return myStatements;
    }

    /**
     *
This method returns the list of variables
     * for this procedure declaration.

     *
     * @return A list of {@link VarDec} representation objects.
     */
    public final List<VarDec> getVariables() {
        return myVariableDecs;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public int hashCode() {
        int result = super.hashCode();
        result = 31 * result + myParameters.hashCode();
        result = 31 * result + (myReturnTy != null ? myReturnTy.hashCode() : 0);
        result = 31 * result + (myAffects != null ? myAffects.hashCode() : 0);
        result =
                31 * result
                        + (myDecreasing != null ? myDecreasing.hashCode() : 0);
        result = 31 * result + myFacilityDecs.hashCode();
        result = 31 * result + myVariableDecs.hashCode();
        result = 31 * result + myStatements.hashCode();
        result = 31 * result + (myRecursiveFlag ? 1 : 0);
        return result;
    }

    // ===========================================================
    // Protected Methods
    // ===========================================================

    /**
     * {@inheritDoc}
     */
    @Override
    protected final ProcedureDec copy() {
        AffectsClause newAffects = null;
        if (myAffects != null) {
            newAffects = myAffects.clone();
        }

        AssertionClause newDecreasing = null;
        if (myDecreasing != null) {
            newDecreasing = myDecreasing.clone();
        }

        List<ParameterVarDec> newParameters = new ArrayList<>();
        for (ParameterVarDec varDec : myParameters) {
            newParameters.add((ParameterVarDec) varDec.clone());
        }

        Ty newReturnTy = null;
        if (myReturnTy != null) {
            newReturnTy = myReturnTy.clone();
        }

        List<FacilityDec> newFacilityDecs = new ArrayList<>();
        for (FacilityDec f : myFacilityDecs) {
            newFacilityDecs.add((FacilityDec) f.clone());
        }

        List<VarDec> newVarDecs = new ArrayList<>();
        for (VarDec v : myVariableDecs) {
            newVarDecs.add((VarDec) v.clone());
        }

        List<Statement> newStatements = new ArrayList<>();
        for (Statement s : myStatements) {
            newStatements.add(s.clone());
        }

        return new ProcedureDec(myName.clone(), newParameters, newReturnTy,
                newAffects, newDecreasing, newFacilityDecs, newVarDecs,
                newStatements, myRecursiveFlag);
    }
}


text:
using System;
using System.Collections.Generic;

using Cosmos.Build.Common;
using Cosmos.TestRunner.Core;

namespace Cosmos.TestRunner.Full
{
    public class DefaultEngineConfiguration : IEngineConfiguration
    {
        public virtual int AllowedSecondsInKernel => 6000;

        public virtual IEnumerable<RunTargetEnum> RunTargets
        {
            get
            {
                yield return RunTargetEnum.Bochs;
                //yield return RunTargetEnum.VMware;
                //yield return RunTargetEnum.HyperV;
            }
        }

        public virtual bool RunWithGDB => false;
        public virtual bool StartBochsDebugGUI => false;

        public virtual bool DebugIL2CPU => false;
        public virtual string KernelPkg => String.Empty;
        public virtual TraceAssemblies TraceAssembliesLevel => TraceAssemblies.User;
        public virtual bool EnableStackCorruptionChecks => true;
        public virtual StackCorruptionDetectionLevel StackCorruptionDetectionLevel => StackCorruptionDetectionLevel.AllInstructions;

        public virtual IEnumerable<string> KernelAssembliesToRun
        {
            get
            {
                foreach (var xKernelType in TestKernelSets.GetKernelTypesToRun())
                {
                    yield return xKernelType.Assembly.Location;
                }
            }
        }
    }
}


text:
import SimpleITK as sitk

elastixImageFilter = sitk.ElastixImageFilter()

fixed_image = sitk.ReadImage('../data/test/899885/T1mni.nii.gz')
#fixed_image = sitk.ReadImage('../data/atlas/mni_icbm152_t2_tal_nlin_sym_09a.nii.gz')
moving_image = sitk.ReadImage('../data/test/899885/T1native.nii.gz')

elastixImageFilter.SetFixedImage(fixed_image)
elastixImageFilter.SetMovingImage(moving_image)

parameterMapVector = sitk.VectorOfParameterMap()
parameterMapVector.append(sitk.GetDefaultParameterMap("affine"))
parameterMapVector.append(sitk.GetDefaultParameterMap("bspline"))
elastixImageFilter.SetParameterMap(parameterMapVector)

elastixImageFilter.Execute()
sitk.WriteImage(elastixImageFilter.GetResultImage())


text:
<?php

namespace Drupal\Tests\node\Functional;

use Drupal\Component\Serialization\Json;
use Drupal\Tests\BrowserTestBase;
use Drupal\system\Entity\Action;
use Drupal\user\Entity\User;

/**
 * Tests configuration of actions provided by the Node module.
 *
 * @group node
 */
class NodeActionsConfigurationTest extends BrowserTestBase {

  /**
   * Modules to install.
   *
   * @var array
   */
  protected static $modules = ['action', 'node'];

  /**
   * {@inheritdoc}
   */
  protected $defaultTheme = 'stark';

  /**
   * Tests configuration of the node_assign_owner_action action.
   */
  public function testAssignOwnerNodeActionConfiguration() {
    // Create a user with permission to view the actions administration pages.
    $user = $this->drupalCreateUser(['administer actions']);
    $this->drupalLogin($user);

    // Make a POST request to admin/config/system/actions.
    $edit = [];
    $edit['action'] = 'node_assign_owner_action';
    $this->drupalGet('admin/config/system/actions');
    $this->submitForm($edit, 'Create');
    $this->assertSession()->statusCodeEquals(200);

    // Make a POST request to the individual action configuration page.
    $edit = [];
    $action_label = $this->randomMachineName();
    $edit['label'] = $action_label;
    $edit['id'] = strtolower($action_label);
    $edit['owner_uid'] = $user->id();
    $this->drupalGet('admin/config/system/actions/add/node_assign_owner_action');
    $this->submitForm($edit, 'Save');
    $this->assertSession()->statusCodeEquals(200);

    $action_id = $edit['id'];

    // Make sure that the new action was saved properly.
    $this->assertSession()->pageTextContains('The action has been successfully saved.');
    // Check that the label of the node_assign_owner_action action appears on
    // the actions administration page after saving.
    $this->assertSession()->pageTextContains($action_label);

    // Make another POST request to the action edit page.
    $this->clickLink('Configure');
    $edit = [];
    $new_action_label = $this->randomMachineName();
    $edit['label'] = $new_action_label;
    $edit['owner_uid'] = $user->id();
    $this->submitForm($edit, 'Save');
    $this->assertSession()->statusCodeEquals(200);

    // Make sure that the action updated properly.
    $this->assertSession()->pageTextContains('The action has been successfully saved.');
    // Check that the old label for the node_assign_owner_action action does not
    // appear on the actions administration page after updating.
    $this->assertSession()->pageTextNotContains($action_label);
    // Check that the new label for the node_assign_owner_action action appears
    // on the actions administration page after updating.
    $this->assertSession()->pageTextContains($new_action_label);

    // Make sure that deletions work properly.
    $this->drupalGet('admin/config/system/actions');
    $this->clickLink('Delete');
    $this->assertSession()->statusCodeEquals(200);
    $edit = [];
    $this->submitForm($edit, 'Delete');
    $this->assertSession()->statusCodeEquals(200);

    // Make sure that the action was actually deleted.
    $this->assertSession()->pageTextContains("The action {$new_action_label} has been deleted.");
    $this->drupalGet('admin/config/system/actions');
    $this->assertSession()->statusCodeEquals(200);
    // Check that the label for the node_assign_owner_action action does not
    // appear on the actions administration page after deleting.
    $this->assertSession()->pageTextNotContains($new_action_label);

    $action = Action::load($action_id);
    $this->assertNull($action, 'The node_assign_owner_action action is not available after being deleted.');
  }

  /**
   * Tests the autocomplete field when configuring the AssignOwnerNode action.
   */
  public function testAssignOwnerNodeActionAutocomplete() {
    // Create 200 users to force the action's configuration page to use an
    // autocomplete field instead of a select field. See
    // \Drupal\node\Plugin\Action\AssignOwnerNode::buildConfigurationForm().
    for ($i = 0; $i < 200; $i++) {
      $this->drupalCreateUser();
    }

    // Create a user with permission to view the actions administration pages
    // and additionally permission to administer users. Otherwise the user would
    // not be able to reference the anonymous user.
    $this->drupalLogin($this->drupalCreateUser(['administer actions', 'administer users']));
    // Create AssignOwnerNode action.
    $this->drupalGet('admin/config/system/actions');
    $this->submitForm(['action' => 'node_assign_owner_action'], 'Create');

    // Get the autocomplete URL of the owner_uid textfield.
    $autocomplete_field = $this->getSession()->getPage()->findField('owner_uid');
    $autocomplete_url = $this->getAbsoluteUrl($autocomplete_field->getAttribute('data-autocomplete-path'));

    // Make sure that autocomplete works.
    $user = $this->drupalCreateUser();
    $data = Json::decode($this->drupalGet($autocomplete_url, ['query' => ['q' => $user->getDisplayName(), '_format' => 'json']]));
    $this->assertNotEmpty($data);

    $anonymous = User::getAnonymousUser();
    // Ensure that the anonymous user exists.
    $this->assertNotNull($anonymous);
    // Make sure the autocomplete does not show the anonymous user.
    $data = Json::decode($this->drupalGet($autocomplete_url, ['query' => ['q' => $anonymous->getDisplayName(), '_format' => 'json']]));
    $this->assertEmpty($data);

  }

}


text:
from django.views.generic import TemplateView, RedirectView
from django.core.urlresolvers import reverse
from django.utils.translation import ugettext_lazy as _

from oscar.core.loading import get_class
import logging

get_product_search_handler_class = get_class(
    'catalogue.search_handlers', 'get_product_search_handler_class')

logger = logging.getLogger(__name__)

class HomeView(TemplateView):
    """
    This is the home page and will typically live at /
    """
    template_name = 'promotions/home.html'
    context_object_name = "products"

    def get(self, request, *args, **kwargs):
        try:
            self.search_handler = self.get_search_handler(
                self.request.GET, request.get_full_path(), [])
        except InvalidPage:
            # Redirect to page one.
            messages.error(request, _('The given page number was invalid.'))
            return redirect('catalogue:index')
        return super(HomeView, self).get(request, *args, **kwargs)

    def get_search_handler(self, *args, **kwargs):
        return get_product_search_handler_class()(*args, **kwargs)

    def get_context_data(self, **kwargs):
        ctx = {}
        ctx['summary'] = _("All products")
        search_context = self.search_handler.get_search_context_data(
            self.context_object_name)

        search_context['products'] = search_context['object_list'][0:2]
        search_context['object_list'] = search_context['object_list'][0:2]
        # logger.info(search_context['object_list'])
        # logger.info(search_context)
        ctx.update(search_context)
        return ctx


text:
package com.nulabinc.backlog4j.internal.json.customFields;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.nulabinc.backlog4j.CustomFieldListItemSetting;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;

import java.util.List;

/**
 * @author nulab-inc
 */
@JsonIgnoreProperties(ignoreUnknown = true)
public class TextCustomFieldSetting extends CustomFieldSettingJSONImpl {

    private int typeId = 1;

    @Override
    public int getFieldTypeId() {
        return typeId;
    }

    @Override
    public FieldType getFieldType() {
        return FieldType.valueOf(typeId);
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (obj == this) {
            return true;
        }
        if (obj.getClass() != getClass()) {
            return false;
        }
        TextCustomFieldSetting rhs = (TextCustomFieldSetting) obj;
        return new EqualsBuilder()
                .append(getId(), rhs.getId())
                .append(getName(), rhs.getName())
                .append(this.typeId, rhs.typeId)
                .isEquals();
    }

    @Override
    public int hashCode() {
        return new HashCodeBuilder()
                .append(getId())
                .append(getName())
                .append(typeId)
                .toHashCode();
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this)
                .append("id", getId())
                .append("name", getName())
                .append("typeId", typeId)
                .toString();
    }

    @Override
    public List<? extends CustomFieldListItemSetting> getItems() {
        return null;
    }
}


text:
package loon.action.sprite.node;

import loon.core.geom.Vector2f;

public class LNJumpParabolaBy extends LNAction {

	LNJumpParabolaBy() {

	}

	public float _a;

	public float _b;

	public float _c;

	public Vector2f _delta;

	public float _height;

	public Vector2f _refPoint;

	public Vector2f _startPosition;

	public static LNJumpParabolaBy Action(float duration, Vector2f position,
			Vector2f refPoint) {
		LNJumpParabolaBy by = new LNJumpParabolaBy();
		by._delta = position;
		by._duration = duration;
		by._refPoint = refPoint;
		return by;
	}

	public void setTarget(LNNode node) {
		super._firstTick = true;
		super._isEnd = false;
		super._target = node;
		this._startPosition = super._target._position;
		this._a = ((this._refPoint.y / this._refPoint.x) - (this._delta.y / this._delta.x))
				/ (this._refPoint.x - this._delta.x);
		this._b = (this._delta.y / this._delta.x)
				- ((this._delta.x + (2f * this._startPosition.x)) * this._a);
		this._c = (this._startPosition.y - ((this._a * this._startPosition.x) * this._startPosition.x))
				- (this._b * this._startPosition.x);
	}

	public void update(float t) {
		float num = (t * this._delta.x) + this._startPosition.x;
		float x = num;
		float y = (((this._a * x) * x) + (this._b * x)) + this._c;
		super._target.setPosition(x, y);
	}

	public LNAction copy() {
		return Action(_duration, _delta, _refPoint);
	}

	public LNAction reverse() {
		return Action(_duration, _delta.negate(), _refPoint);
	}
}


text:
package org.apache.calcite.rel.core;

import org.apache.calcite.plan.RelOptCluster;
import org.apache.calcite.plan.RelTraitSet;
import org.apache.calcite.rel.RelInput;
import org.apache.calcite.rel.RelNode;
import org.apache.calcite.rel.metadata.RelMdUtil;
import org.apache.calcite.rel.metadata.RelMetadataQuery;
import org.apache.calcite.sql.SqlKind;

import java.util.List;

/**
 * Relational expression that returns the rows of its first input minus any
 * matching rows from its other inputs.
 *
 *
Corresponds to the SQL {@code EXCEPT} operator.
 *
 *
If "all" is true, then multiset subtraction is
 * performed; otherwise, set subtraction is performed (implying no duplicates in
 * the results).
 */
public abstract class Minus extends SetOp {
  public Minus(RelOptCluster cluster, RelTraitSet traits, List<RelNode> inputs,
      boolean all) {
    super(cluster, traits, inputs, SqlKind.EXCEPT, all);
  }

  /**
   * Creates a Minus by parsing serialized output.
   */
  protected Minus(RelInput input) {
    super(input);
  }

  @Override public double estimateRowCount(RelMetadataQuery mq) {
    return RelMdUtil.getMinusRowCount(mq, this);
  }
}


text:
/* global PaymentRequest:false */

/**
 * Launches the PaymentRequest UI that requests email address and phone number.
 */
function buy() { // eslint-disable-line no-unused-vars
  try {
    new PaymentRequest(
        [
          {supportedMethods: 'https://bobpay.com'},
          {
            supportedMethods: 'basic-card',
            data: {supportedNetworks: ['visa']},
          },
        ],
        {total: {label: 'Total', amount: {currency: 'USD', value: '5.00'}}},
        {requestPayerEmail: true, requestPayerPhone: true})
        .show()
        .then(function(resp) {
          resp.complete('success')
              .then(function() {
                print(JSON.stringify(resp, undefined, 2));
              })
              .catch(function(error) {
                print(error);
              });
        })
        .catch(function(error) {
          print(error);
        });
  } catch (error) {
    print(error.message);
  }
}


text:
using System;

namespace JsonRpc.Net.Exceptions
{
    public class InvalidParameterException : Exception
    {
        public InvalidParameterException(){}

        public InvalidParameterException(string message) : base(message)
        {
        }
    }
}


text:
@interface PodsDummy_Pods_TimerScroll_TimerScroll : NSObject
@end
@implementation PodsDummy_Pods_TimerScroll_TimerScroll
@end


text:
package org.jetbrains.plugins.gradle.service.project;

import org.gradle.initialization.BuildCancellationToken;
import org.gradle.internal.Factory;
import org.gradle.internal.UncheckedException;
import org.gradle.internal.classpath.ClassPath;
import org.gradle.internal.classpath.DefaultClassPath;
import org.gradle.logging.ProgressLogger;
import org.gradle.logging.ProgressLoggerFactory;
import org.gradle.tooling.BuildCancelledException;
import org.gradle.tooling.GradleConnectionException;
import org.gradle.tooling.internal.consumer.Distribution;
import org.gradle.tooling.internal.consumer.DistributionFactory;
import org.gradle.tooling.internal.consumer.ExecutorServiceFactory;
import org.gradle.util.DistributionLocator;
import org.gradle.util.GradleVersion;
import org.gradle.wrapper.*;

import java.io.File;
import java.io.FileNotFoundException;
import java.net.URI;
import java.util.LinkedHashSet;
import java.util.Set;
import java.util.concurrent.*;

/**
 * @author Vladislav.Soroka
 * @since 8/23/13
 */
public class DistributionFactoryExt extends DistributionFactory {
  private final ExecutorServiceFactory myExecutorFactory;

  public DistributionFactoryExt(ExecutorServiceFactory executorFactory) {
    super(executorFactory);
    myExecutorFactory = executorFactory;
  }

  /**
   * Returns the default distribution to use for the specified project.
   */
  public Distribution getWrappedDistribution(File propertiesFile) {
    //noinspection UseOfSystemOutOrSystemErr
    WrapperExecutor wrapper = WrapperExecutor.forWrapperPropertiesFile(propertiesFile, System.out);
    if (wrapper.getDistribution() != null) {
      return new ZippedDistribution(wrapper.getConfiguration(), myExecutorFactory);
    }
    return getDownloadedDistribution(GradleVersion.current().getVersion());
  }

  private Distribution getDownloadedDistribution(String gradleVersion) {
    URI distUri = new DistributionLocator().getDistributionFor(GradleVersion.version(gradleVersion));
    return getDistribution(distUri);
  }

  private static class ProgressReportingDownload implements IDownload {
    private final ProgressLoggerFactory progressLoggerFactory;

    private ProgressReportingDownload(ProgressLoggerFactory progressLoggerFactory) {
      this.progressLoggerFactory = progressLoggerFactory;
    }

    public void download(URI address, File destination) throws Exception {
      ProgressLogger progressLogger = progressLoggerFactory.newOperation(DistributionFactory.class);
      progressLogger.setDescription(String.format("Download %s", address));
      progressLogger.started();
      try {
        new Download(new Logger(false), "Gradle Tooling API", GradleVersion.current().getVersion()).download(address, destination);
      } finally {
        progressLogger.completed();
      }
    }
  }

  private static class InstalledDistribution implements Distribution {
    private final File gradleHomeDir;
    private final String displayName;
    private final String locationDisplayName;

    public InstalledDistribution(File gradleHomeDir, String displayName, String locationDisplayName) {
      this.gradleHomeDir = gradleHomeDir;
      this.displayName = displayName;
      this.locationDisplayName = locationDisplayName;
    }

    public String getDisplayName() {
      return displayName;
    }

    public ClassPath getToolingImplementationClasspath(ProgressLoggerFactory progressLoggerFactory,
                                                       File userHomeDir,
                                                       BuildCancellationToken cancellationToken) {
      ProgressLogger progressLogger = progressLoggerFactory.newOperation(DistributionFactory.class);
      progressLogger.setDescription("Validate distribution");
      progressLogger.started();
      try {
        return getToolingImpl();
      }
      finally {
        progressLogger.completed();
      }
    }

    private ClassPath getToolingImpl() {
      if (!gradleHomeDir.exists()) {
        throw new IllegalArgumentException(String.format("The specified %s does not exist.", locationDisplayName));
      }
      if (!gradleHomeDir.isDirectory()) {
        throw new IllegalArgumentException(String.format("The specified %s is not a directory.", locationDisplayName));
      }
      File libDir = new File(gradleHomeDir, "lib");
      if (!libDir.isDirectory()) {
        throw new IllegalArgumentException(
          String.format("The specified %s does not appear to contain a Gradle distribution.", locationDisplayName));
      }
      Set<File> files = new LinkedHashSet<File>();
      //noinspection ConstantConditions
      for (File file : libDir.listFiles()) {
        if (file.getName().endsWith(".jar")) {
          files.add(file);
        }
      }
      return new DefaultClassPath(files);
    }
  }

  private static class ZippedDistribution implements Distribution {
    private InstalledDistribution installedDistribution;
    private final WrapperConfiguration wrapperConfiguration;
    private final Factory<? extends ExecutorService> executorFactory;

    private ZippedDistribution(WrapperConfiguration wrapperConfiguration, Factory<? extends ExecutorService> executorFactory) {
      this.wrapperConfiguration = wrapperConfiguration;
      this.executorFactory = executorFactory;
    }

    public String getDisplayName() {
      return String.format("Gradle distribution '%s'", wrapperConfiguration.getDistribution());
    }

    public ClassPath getToolingImplementationClasspath(final ProgressLoggerFactory progressLoggerFactory, final File userHomeDir, BuildCancellationToken cancellationToken) {
      if (installedDistribution == null) {
        Callable<File> installDistroTask = new Callable<File>() {
          public File call() throws Exception {
            File installDir;
            try {
              File realUserHomeDir = userHomeDir != null ? userHomeDir : GradleUserHomeLookup.gradleUserHome();
              Install install =
                new Install(new Logger(false), new ProgressReportingDownload(progressLoggerFactory), new PathAssembler(realUserHomeDir));
              installDir = install.createDist(wrapperConfiguration);
            } catch (FileNotFoundException e) {
              throw new IllegalArgumentException(String.format("The specified %s does not exist.", getDisplayName()), e);
            } catch (CancellationException e) {
              throw new BuildCancelledException(String.format("Distribution download cancelled. Using distribution from '%s'.", wrapperConfiguration.getDistribution()), e);
            } catch (Exception e) {
              throw new GradleConnectionException(String.format("Could not install Gradle distribution from '%s'.", wrapperConfiguration.getDistribution()), e);
            }
            return installDir;
          }
        };
        File installDir;
        ExecutorService executor = null;
        try {
          executor = executorFactory.create();
          final Future<File> installDirFuture = executor.submit(installDistroTask);
          cancellationToken.addCallback(new Runnable() {
            public void run() {
              // TODO(radim): better to close the connection too to allow quick finish of the task
              installDirFuture.cancel(true);
            }
          });
          installDir = installDirFuture.get();
        } catch (CancellationException e) {
          throw new BuildCancelledException(String.format("Distribution download cancelled. Using distribution from '%s'.", wrapperConfiguration.getDistribution()), e);
        } catch (InterruptedException e) {
          throw new GradleConnectionException(String.format("Could not install Gradle distribution from '%s'.", wrapperConfiguration.getDistribution()), e);
        } catch (ExecutionException e) {
          if (e.getCause() != null) {
            UncheckedException.throwAsUncheckedException(e.getCause());
          }
          throw new GradleConnectionException(String.format("Could not install Gradle distribution from '%s'.", wrapperConfiguration.getDistribution()), e);
        } finally {
          if (executor != null) {
            executor.shutdown();
          }
        }
        installedDistribution = new InstalledDistribution(installDir, getDisplayName(), getDisplayName());
      }
      return installedDistribution.getToolingImplementationClasspath(progressLoggerFactory, userHomeDir, cancellationToken);
    }
  }
}


text:
<dashboard showsource="true" script="autodiscover.js">
  Exemple
  <search id="table">
    <query>| inputlookup exemples.csv |join max=0 type=outer [|inputlookup columns.csv |rename type as col_type parent as parent_col]|table columns rows col_type parent_col count|sort rows|</query>
    <earliest>0</earliest>
    <latest></latest>
  </search>
  <row>
    <panel>

        <title>Table source</title>
        <search base="table"></search>

    </panel>
    <panel>
      <viz type="viz_extensions_100.viz1">
        <title>Table Viz</title>
        <search base="table"></search>
        <option name="height">400</option>
        <option name="viz_extensions_100.viz1.Color1">#FFCCCC</option>
        <option name="viz_extensions_100.viz1.Color2">#DED9D9</option>
        <option name="viz_extensions_100.viz1.Color3">#B2AFAF</option>
        <option name="viz_extensions_100.viz1.Color4">#7C7A7A</option>
        <option name="viz_extensions_100.viz1.Color5">#000000</option>
        <option name="viz_extensions_100.viz1.case_font_size">34</option>
        <option name="viz_extensions_100.viz1.case_size">80</option>
        <option name="viz_extensions_100.viz1.scale">0.6</option>
        <option name="viz_extensions_100.viz1.show_total">1</option>
        <option name="viz_extensions_100.viz1.x_title">Project Stage</option>
        <option name="viz_extensions_100.viz1.y_title">Type</option>
      </viz>
    </panel>
  </row>
</dashboard>


text:
namespace cc {

YUVVideoDrawQuad::YUVVideoDrawQuad()
    : y_plane_resource_id(0),
      u_plane_resource_id(0),
      v_plane_resource_id(0),
      a_plane_resource_id(0) {}
YUVVideoDrawQuad::~YUVVideoDrawQuad() {}

void YUVVideoDrawQuad::SetNew(const SharedQuadState* shared_quad_state,
                              const gfx::Rect& rect,
                              const gfx::Rect& opaque_rect,
                              const gfx::Rect& visible_rect,
                              const gfx::RectF& ya_tex_coord_rect,
                              const gfx::RectF& uv_tex_coord_rect,
                              const gfx::Size& ya_tex_size,
                              const gfx::Size& uv_tex_size,
                              unsigned y_plane_resource_id,
                              unsigned u_plane_resource_id,
                              unsigned v_plane_resource_id,
                              unsigned a_plane_resource_id,
                              ColorSpace color_space) {
  bool needs_blending = false;
  DrawQuad::SetAll(shared_quad_state, DrawQuad::YUV_VIDEO_CONTENT, rect,
                   opaque_rect, visible_rect, needs_blending);
  this->ya_tex_coord_rect = ya_tex_coord_rect;
  this->uv_tex_coord_rect = uv_tex_coord_rect;
  this->ya_tex_size = ya_tex_size;
  this->uv_tex_size = uv_tex_size;
  this->y_plane_resource_id = y_plane_resource_id;
  this->u_plane_resource_id = u_plane_resource_id;
  this->v_plane_resource_id = v_plane_resource_id;
  this->a_plane_resource_id = a_plane_resource_id;
  this->color_space = color_space;
}

void YUVVideoDrawQuad::SetAll(const SharedQuadState* shared_quad_state,
                              const gfx::Rect& rect,
                              const gfx::Rect& opaque_rect,
                              const gfx::Rect& visible_rect,
                              bool needs_blending,
                              const gfx::RectF& ya_tex_coord_rect,
                              const gfx::RectF& uv_tex_coord_rect,
                              const gfx::Size& ya_tex_size,
                              const gfx::Size& uv_tex_size,
                              unsigned y_plane_resource_id,
                              unsigned u_plane_resource_id,
                              unsigned v_plane_resource_id,
                              unsigned a_plane_resource_id,
                              ColorSpace color_space) {
  DrawQuad::SetAll(shared_quad_state, DrawQuad::YUV_VIDEO_CONTENT, rect,
                   opaque_rect, visible_rect, needs_blending);
  this->ya_tex_coord_rect = ya_tex_coord_rect;
  this->uv_tex_coord_rect = uv_tex_coord_rect;
  this->ya_tex_size = ya_tex_size;
  this->uv_tex_size = uv_tex_size;
  this->y_plane_resource_id = y_plane_resource_id;
  this->u_plane_resource_id = u_plane_resource_id;
  this->v_plane_resource_id = v_plane_resource_id;
  this->a_plane_resource_id = a_plane_resource_id;
  this->color_space = color_space;
}

void YUVVideoDrawQuad::IterateResources(
    const ResourceIteratorCallback& callback) {
  y_plane_resource_id = callback.Run(y_plane_resource_id);
  u_plane_resource_id = callback.Run(u_plane_resource_id);
  v_plane_resource_id = callback.Run(v_plane_resource_id);
  if (a_plane_resource_id)
    a_plane_resource_id = callback.Run(a_plane_resource_id);
}

const YUVVideoDrawQuad* YUVVideoDrawQuad::MaterialCast(
    const DrawQuad* quad) {
  DCHECK(quad->material == DrawQuad::YUV_VIDEO_CONTENT);
  return static_cast<const YUVVideoDrawQuad*>(quad);
}

void YUVVideoDrawQuad::ExtendValue(
    base::trace_event::TracedValue* value) const {
  MathUtil::AddToTracedValue("ya_tex_coord_rect", ya_tex_coord_rect, value);
  MathUtil::AddToTracedValue("uv_tex_coord_rect", uv_tex_coord_rect, value);
  MathUtil::AddToTracedValue("ya_tex_size", ya_tex_size, value);
  MathUtil::AddToTracedValue("uv_tex_size", uv_tex_size, value);
  value->SetInteger("y_plane_resource_id", y_plane_resource_id);
  value->SetInteger("u_plane_resource_id", u_plane_resource_id);
  value->SetInteger("v_plane_resource_id", v_plane_resource_id);
  value->SetInteger("a_plane_resource_id", a_plane_resource_id);
}

}  // namespace cc


text:
set -euo pipefail

FILENAME=$1
USERNAME=$2
PASSWORD=$3
CODESIGN_STRING=$4
FILEPATH=$(dirname $0)/$FILENAME

# Make sure *.p12 is imported into local KeyChain
security unlock-keychain -p ${PASSWORD} /Users/${USERNAME}/Library/Keychains/login.keychain

attempt=1
limit=3
set +e
while [ $attempt -le $limit ]
do
  echo "signing (attempt $attempt) ${FILEPATH}"
  codesign -v --deep --force -s "${CODESIGN_STRING}" ${FILEPATH}
  if [ "$?" != "0" ]; then
    let "attempt += 1"
    if [ $attempt -eq $limit ]; then
      set -e
    fi
    echo "wait for 30 sec and try to sign again"
    sleep 30;
  else
    let "attempt += $limit"
    echo "signing done"
    codesign -v ${FILEPATH} -vvvvv
    echo "check sign done"
    fi
done


text:
(function() {
'use strict';

var AppController = function () {
};

AppController.$routeConfig = [
  {
    path: '/',
    redirectTo: '/list'
  },
  {
    path: '/list',
    components: {
      navigation: 'publicNavigation',
      content: 'list'
    },
    as: 'list'
  },
  {
    path: '/post',
    components: {
      navigation: 'memberNavigation',
      content: 'post'
    },
    as: 'post'
  },
  {
    path: '/user',
    components: {
      navigation: 'memberNavigation',
      content: 'user'
    },
    as: 'user'
  }
];

var PublicNavigationController = function () {
};

var MemberNavigationController = function () {
};

var ListController = function () {
};

var PostController = function () {
};

var UserController = function () {
};

angular.module('app', ['angular-google-gapi', 'ngNewRouter']);

angular.module('app')
  .factory('authorized', function ($rootScope, $q, GAuth, clientId) {
    GAuth.setClient(clientId);
    var auth = GAuth.checkAuth();
    return function () {
      var deferred = $q.defer();
      auth
        .finally(function () {
          if ($rootScope.gapi.user) {
            deferred.resolve();
          } else {
            deferred.reject();
          }
        });
      return deferred.promise;
    };
  });

angular.module('app')
  .factory('clientId', function ($location) {
    var origin = $location.protocol() + '://' + $location.host();
    if ($location.port() !== 80) {
      origin += ':' + $location.port();
    }
    if (origin === 'http://localhost') {
      return '737232045163-22rv82eod96bv46vphb63pde23cm5t8m.apps.googleusercontent.com';
    } else if (origin === 'http://localhost:8080') {
      return '737232045163-5dmfng17mjmg32p01p35restig325orb.apps.googleusercontent.com';
    } else if (origin === 'http://likr.github.io') {
      return '737232045163-ogsideqcfucvriqhifau8ngvis377pd3.apps.googleusercontent.com';
    }
    return null;
  });

angular.module('app').controller('AppController', AppController);
angular.module('app').controller('PublicNavigationController', PublicNavigationController);
angular.module('app').controller('MemberNavigationController', MemberNavigationController);
angular.module('app').controller('ListController', ListController);
angular.module('app').controller('PostController', PostController);
angular.module('app').controller('UserController', UserController);

angular.module('app')
  .run(function (GApi, authorized) {
    GApi.load('gdgkobe20150429', 'v1', 'https://gdgkobe20150429.appspot.com/_ah/api');
  });
})();


text:
'use strict';

var UIEvent = require('./UIEvent');

/**
 * See [UI Events (formerly DOM Level 3 Events)](http://www.w3.org/TR/2015/WD-uievents-20150428/#events-focusevent).
 *
 * @class FocusEvent
 * @augments UIEvent
 *
 * @param {Event} ev The native DOM event.
 */
function FocusEvent(ev) {
    // [Constructor(DOMString typeArg, optional FocusEventInit focusEventInitDict)]
    // interface FocusEvent : UIEvent {
    //     readonly    attribute EventTarget? relatedTarget;
    // };

    UIEvent.call(this, ev);
}

FocusEvent.prototype = Object.create(UIEvent.prototype);
FocusEvent.prototype.constructor = FocusEvent;

/**
 * Return the name of the event type
 *
 * @method
 *
 * @return {String} Name of the event type
 */
FocusEvent.prototype.toString = function toString () {
    return 'FocusEvent';
};

module.exports = FocusEvent;


text:
[![CI](https://github.com/tijsverkoyen/CssToInlineStyles/actions/workflows/ci.yml/badge.svg)](https://github.com/tijsverkoyen/CssToInlineStyles/actions/workflows/ci.yml)

## About

CssToInlineStyles is a class that enables you to convert HTML-pages/files into
HTML-pages/files with inline styles. This is very useful when you're sending
emails.

## Installation

The recommended installation way is through [Composer](https://getcomposer.org).

```bash
$ composer require tijsverkoyen/css-to-inline-styles
```

## Example

```php
use TijsVerkoyen\CssToInlineStyles\CssToInlineStyles;

// create instance
$cssToInlineStyles = new CssToInlineStyles();

$html = file_get_contents(__DIR__ . '/examples/sumo/index.htm');
$css = file_get_contents(__DIR__ . '/examples/sumo/style.css');

// output
echo $cssToInlineStyles->convert(
    $html,
    $css
);
```

## Known issues

* no support for pseudo selectors
* no support for [css-escapes](https://mathiasbynens.be/notes/css-escapes)
* UTF-8 charset is not always detected correctly. Make sure you set the charset to UTF-8 using the following meta-tag in the head: `<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />`. _(Note: using `<meta charset="UTF-8">` does NOT work!)_

## Sites using this class

* [Each site based on Fork CMS](http://www.fork-cms.com)
* [Print en Bind](http://www.printenbind.nl)
* [Tiki Wiki CMS Groupware](http://sourceforge.net/p/tikiwiki/code/49505) (starting in Tiki 13)
* [Laravel Framework](https://github.com/laravel/framework/blob/v6.18.24/src/Illuminate/Mail/Markdown.php#L55)


text:
package net.java.sip.communicator.service.protocol.whiteboardobjects;

import net.java.sip.communicator.service.protocol.*;

/**
 * Used to access the content of instant whiteboard objects that are sent or
 * received via the WhiteboardOperationSet.
 *
 * @author Julien Waechter
 */
public interface WhiteboardObjectImage extends WhiteboardObject
{
    /**
     * A type string constant indicating that an object is of type circle.
     */
    public static final String NAME = "WHITEBOARDOBJECTIMAGE";

    /**
     * Returns the coordinates of this whiteboard object.
     *
     * @return the coordinates of this object.
     */
    public WhiteboardPoint getWhiteboardPoint();

    /**
     * Sets the coordinates of this whiteboard object.
     *
     * @param whiteboardPoint the coordinates of this object.
     */
    public void setWhiteboardPoint(WhiteboardPoint whiteboardPoint);

    /**
     * Returns the height (in pixels) of the WhiteboardObject.
     *
     * @return The height.
     */
    public double getHeight();

    /**
     * Returns the width (in pixels) of the WhiteboardObject.
     *
     * @return The width.
     */
    public double getWidth();

    /**
     * Sets the width (in pixels) of the WhiteboardObject.
     *
     * @param height The new height.
     */
    public void setHeight(double height);

    /**
     * Sets the width (in pixels) of the WhiteboardObject.
     *
     * @param width The new width.
     */
    public void setWidth(double width);

    /**
     * Specifies an image that should be displayed as the background of this
     * object.
     *
     * @param background a binary array containing the image that should be
     * displayed as the object background.
     */
    public void setBackgroundImage(byte[] background);

    /**
     * Returns a binary array containing the image that should be displayed as
     * the background of this <tt>WhiteboardObject</tt>.
     *
     * @return a binary array containing the image that should be displayed as
     * the object background.
     */
    public byte[] getBackgroundImage();
}


text:
<?php

/* FOSUserBundle:Registration:register.html.twig */
class __TwigTemplate_ac86f0e3e9a1b3355aef556a0ee911f1574b59c7bf42c8b3e3275c0353f06dcf extends Twig_Template
{
    public function __construct(Twig_Environment $env)
    {
        parent::__construct($env);

        // line 1
        $this->parent = $this->loadTemplate("FOSUserBundle::layout.html.twig", "FOSUserBundle:Registration:register.html.twig", 1);
        $this->blocks = array(
            'fos_user_content' => array($this, 'block_fos_user_content'),
        );
    }

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

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

    // line 3
    public function block_fos_user_content($context, array $blocks = array())
    {
        // line 4
        $this->loadTemplate("FOSUserBundle:Registration:register_content.html.twig", "FOSUserBundle:Registration:register.html.twig", 4)->display($context);
    }

    public function getTemplateName()
    {
        return "FOSUserBundle:Registration:register.html.twig";
    }

    public function isTraitable()
    {
        return false;
    }

    public function getDebugInfo()
    {
        return array (  31 => 4,  28 => 3,  11 => 1,);
    }

    /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */
    public function getSource()
    {
        @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED);

        return $this->getSourceContext()->getCode();
    }

    public function getSourceContext()
    {
        return new Twig_Source("{% extends \"FOSUserBundle::layout.html.twig\" %}

{% block fos_user_content %}
{% include \"FOSUserBundle:Registration:register_content.html.twig\" %}
{% endblock fos_user_content %}
", "FOSUserBundle:Registration:register.html.twig", "C:\\wamp64\\www\\tunisiehologram\\app/Resources/FOSUserBundle/views/Registration/register.html.twig");
    }
}


text:
ACCEPTED

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

#### Published in
Trans. Agric. Soc. Jamaica 1825:5. 1825

#### Original name
null

### Remarks
null


text:
package org.apache.avro.ipc.trace;

import java.io.IOException;
import java.net.BindException;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.nio.ByteBuffer;
import java.util.List;
import java.util.Map;
import java.util.Random;

import org.apache.avro.AvroRemoteException;
import org.apache.avro.AvroRuntimeException;
import org.apache.avro.Schema;
import org.apache.avro.generic.GenericData;
import org.apache.avro.ipc.HttpServer;
import org.apache.avro.ipc.RPCContext;
import org.apache.avro.ipc.RPCPlugin;
import org.apache.avro.ipc.specific.SpecificResponder;
import org.mortbay.jetty.Server;
import org.mortbay.jetty.bio.SocketConnector;
import org.mortbay.jetty.servlet.Context;
import org.mortbay.jetty.servlet.ServletHolder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * A tracing plugin for Avro.
 *
 * This plugin traces RPC call timing and follows nested trees of RPC
 * calls. To use, instantiate and add to an existing Requestor or
 * Responder. If you have a Responder that itself acts as an RPC client (i.e.
 * it contains a Requestor) be sure to pass the same instance of the
 * plugin to both components so that propagation occurs correctly.
 *
 * Currently, propagation only works if each requester is performing
 * serial RPC calls. That is, we cannot support the case in which the
 * Requestor's request does not occur in the same thread as the Responder's
 * response.
 */
public class TracePlugin extends RPCPlugin {
  final private static Random RANDOM = new Random();
  private static final Logger LOG = LoggerFactory.getLogger(TracePlugin.class);
  public static enum StorageType { MEMORY, DISK }
  protected static TracePlugin singleton;
  protected static TracePluginConfiguration singletonConf;

  /*
   * This plugin uses three key/value meta-data pairs. The value type for all
   * of these pairs is fixed(8) and they are assumed to be encoded as 8-byte
   * ID's. The presence of a TRACE_ID_KEY and a SPAN_ID_KEY in a message
   * signals that tracing is in progress. The optional PARENT_SPAN_ID_KEY
   * signals that this message has a parent node in the RPC call tree.
   */
  private static final String TRACE_ID_KEY = "traceID";
  private static final String SPAN_ID_KEY = "spanID";
  private static final String PARENT_SPAN_ID_KEY = "parentSpanID";

  class TraceResponder implements AvroTrace {
    private SpanStorage spanStorage;

    public TraceResponder(SpanStorage spanStorage) {
      this.spanStorage = spanStorage;
    }

    @Override
    public List<Span> getAllSpans() throws AvroRemoteException {
      return this.spanStorage.getAllSpans();
    }

    @Override
    public List<Span> getSpansInRange(long start, long end)
      throws AvroRemoteException {
      return this.spanStorage.getSpansInRange(start, end);
    }
  }

  private double traceProb; // Probability of starting tracing
  private int port;         // Port to serve tracing data
  private int clientPort;   // Port to expose client HTTP interface
  private StorageType storageType;  // How to store spans
  private long maxSpans; // Max number of spans to store
  private boolean enabled; // Whether to participate in tracing
  protected TracePluginConfiguration config; // Init options

  private ThreadLocal<Span> currentSpan; // span in which we are server
  private ThreadLocal<Span> childSpan;   // span in which we are client

  // Storage and serving of spans
  protected SpanStorage storage;
  protected HttpServer httpServer;
  protected SpecificResponder responder;

  // Client interface
  protected Server clientFacingServer;
  private String hostname;

  /**
   * Get a singleton TracePlugin. This is useful if you want to persist a plugin
   * across both a { @link Requestor } and { @link Responder }. This must be
   * prefixed by at least one call of configureSingleton();
   */
  public static synchronized TracePlugin getSingleton()
      throws IOException {
    if (singletonConf == null) {
      throw new RuntimeException("Singleton not configured yet.");
    }
    singleton = new TracePlugin(singletonConf);
    return singleton;
  }

  /**
   * Configure a singleton instance for this TracePlugin. If a singleton
   * has already been created according to a different configuration, throw
   * a RuntimeException.
   */
  public static synchronized void configureSingleton(
      TracePluginConfiguration conf) {
    if (singleton != null && !(singleton.config.equals(conf))) {
      throw new RuntimeException("Singleton already in use: " +
        "can't reconfigure.");
    }
    singletonConf = conf;
  }

  public TracePlugin(TracePluginConfiguration conf) throws IOException {
    config = conf;
    traceProb = conf.traceProb;
    port = conf.port;
    clientPort = conf.clientPort;
    storageType = conf.storageType;
    maxSpans = conf.maxSpans;
    enabled = conf.enabled;

    // check bounds
    if (!(traceProb >= 0.0 && traceProb <= 1.0)) { traceProb = 0.0; }
    if (!(port > 0 && port < 65535)) { port = 51001; }
    if (!(clientPort > 0 && clientPort < 65535)) { clientPort = 51200; }
    if (maxSpans < 0) { maxSpans = 5000; }

    try {
      hostname = InetAddress.getLocalHost().toString();
    } catch (UnknownHostException e) {
      hostname = "Unknown";
    }

    currentSpan = new ThreadLocal<Span>(){
      @Override protected Span initialValue(){
          return null;
      }
    };

    childSpan = new ThreadLocal<Span>(){
      @Override protected Span initialValue(){
          return null;
      }
    };

    if (storageType == StorageType.MEMORY) {
      this.storage = new InMemorySpanStorage();
    }
    else if (storageType == StorageType.DISK) {
      this.storage = new FileSpanStorage(false, conf);
    }
    else { // default
      this.storage = new InMemorySpanStorage();
    }

    this.storage.setMaxSpans(maxSpans);

    // Start serving span data
    responder = new SpecificResponder(
        AvroTrace.PROTOCOL, new TraceResponder(this.storage));

    boolean bound = false;

    while (!bound) {
      // rather than die if port is taken, try to fail over to another port.
      try {
        httpServer = new HttpServer(responder, this.port);
        httpServer.start();
        bound = true;
      } catch (AvroRuntimeException e) {
        if (e.getCause() instanceof BindException) {
          LOG.error("Failed to bind to port: " + this.port);
          this.port = this.port +1;
        } else {
          throw e;
        }
      }
    }

    // Start client-facing servlet
    initializeClientServer();
  }

  @Override
  public void clientStartConnect(RPCContext context) {
    // There are two cases in which we will need to seed a trace
    // (1) If we probabilistically decide to seed a new trace
    // (2) If we are part of an existing trace

    if ((this.currentSpan.get() == null) &&
        (RANDOM.nextFloat() < this.traceProb) && enabled) {
      // Start new trace
      Span span = Util.createEventlessSpan(null, null, null);
      span.requestorHostname = this.hostname;
      this.childSpan.set(span);
    }

    if ((this.currentSpan.get() != null) && enabled) {
      Span currSpan = this.currentSpan.get();
      Span span = Util.createEventlessSpan(
          currSpan.traceID, null, currSpan.spanID);
      span.requestorHostname = this.hostname;
      this.childSpan.set(span);
    }

    if (this.childSpan.get() != null) {
      Span span = this.childSpan.get();
      context.requestHandshakeMeta().put(
          TRACE_ID_KEY, ByteBuffer.wrap(span.traceID.bytes()));
      context.requestHandshakeMeta().put(
          SPAN_ID_KEY, ByteBuffer.wrap(span.spanID.bytes()));
      if (span.parentSpanID != null) {
        context.requestHandshakeMeta().put(
            PARENT_SPAN_ID_KEY, ByteBuffer.wrap(span.parentSpanID.bytes()));
      }
    }
  }

  @Override
  public void serverConnecting(RPCContext context) {
    Map<String, ByteBuffer> meta = context.requestHandshakeMeta();
    // Are we being asked to propagate a trace?
    if (meta.containsKey(TRACE_ID_KEY) && enabled) {
      if (!(meta.containsKey(SPAN_ID_KEY))) {
        LOG.warn("Span ID missing for trace " +
            meta.get(TRACE_ID_KEY).toString());
        return; // should have been given full span data
      }
      byte[] spanIDBytes = new byte[8];
      meta.get(SPAN_ID_KEY).get(spanIDBytes);
      ID spanID = new ID();
      spanID.bytes(spanIDBytes);

      ID parentSpanID = null;
      if (meta.get(PARENT_SPAN_ID_KEY) != null) {
        parentSpanID = new ID();
        parentSpanID.bytes(meta.get(PARENT_SPAN_ID_KEY).array());
      }
      ID traceID = new ID();
      traceID.bytes(meta.get(TRACE_ID_KEY).array());

      Span span = Util.createEventlessSpan(traceID, spanID, parentSpanID);
      span.responderHostname = this.hostname;

      span.events = new GenericData.Array<TimestampedEvent>(
          100, Schema.createArray(TimestampedEvent.SCHEMA$));
      this.currentSpan.set(span);
    }
  }

  @Override
  public void clientFinishConnect(RPCContext context) { }

  @Override
  public void clientSendRequest(RPCContext context) {
    if (this.childSpan.get() != null) {
      Span child = this.childSpan.get();
      Util.addEvent(child, SpanEvent.CLIENT_SEND);
      child.messageName = context.getMessage().getName();
      child.requestPayloadSize = Util.getPayloadSize(
          context.getRequestPayload());
    }
  }

  @Override
  public void serverReceiveRequest(RPCContext context) {
    if (this.currentSpan.get() != null) {
      Span current = this.currentSpan.get();
      Util.addEvent(current, SpanEvent.SERVER_RECV);
      current.messageName = context.getMessage().getName();
      current.requestPayloadSize = Util.getPayloadSize(
          context.getRequestPayload());
    }
  }

  @Override
  public void serverSendResponse(RPCContext context) {
    if (this.currentSpan.get() != null) {
      Span current = this.currentSpan.get();
      Util.addEvent(current, SpanEvent.SERVER_SEND);
      current.responsePayloadSize =
        Util.getPayloadSize(context.getResponsePayload());
      this.storage.addSpan(this.currentSpan.get());
      this.currentSpan.set(null);
    }
  }

  @Override
  public void clientReceiveResponse(RPCContext context) {
    if (this.childSpan.get() != null) {
      Span child = this.childSpan.get();
      Util.addEvent(child, SpanEvent.CLIENT_RECV);
      child.responsePayloadSize =
        Util.getPayloadSize(context.getResponsePayload());
      this.storage.addSpan(this.childSpan.get());
      this.childSpan.set(null);
    }
  }

  public void stopClientServer() {
    try {
      this.clientFacingServer.stop();
    } catch (Exception e) {
      // ignore
    }
  }

  /**
   * Start a client-facing server. Can be overridden if users
   * prefer to attach client Servlet to their own server.
   */
  protected void initializeClientServer() {
    clientFacingServer = new Server();
    Context staticContext = new Context(clientFacingServer, "/static");
    staticContext.addServlet(new ServletHolder(new StaticServlet()), "/");
    Context context = new Context(clientFacingServer, "/");
    context.addServlet(new ServletHolder(new TraceClientServlet()), "/");
    boolean connected = false;
    SocketConnector socket = null;

    // Keep trying ports until we can connect
    while (!connected) {
      try {
        socket = new SocketConnector();
        socket.setPort(clientPort);
        clientFacingServer.addConnector(socket);
        clientFacingServer.start();
        connected = true;
      } catch (Exception e) {
        if (e instanceof BindException) {
          clientFacingServer.removeConnector(socket);
          clientPort = clientPort + 1;
          continue;
        }
        else {
          break; // Fail silently here (this is currently unused)
        }
      }
    }
  }
}


text:
github para desarrolladores

[Visita mi blog] (https://www.facebook.com/fernando.calderonayala)


text:
\hypertarget{class_vector2_d}{}\section{Vector2D Class Reference}
\label{class_vector2_d}\index{Vector2D@{Vector2D}}

{\ttfamily \#include $<$Utils.\+h$>$}

Inheritance diagram for Vector2D\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=175pt]{class_vector2_d__inherit__graph}
\end{center}
\end{figure}

Collaboration diagram for Vector2D\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=152pt]{class_vector2_d__coll__graph}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item
\hyperlink{class_vector2_d_a525e125aac4c844f04c52ddb0e75d594}{Vector2D} (double \hyperlink{class_vector2_d_ac5c4e553815737aa24bec8281270178f}{x}, double \hyperlink{class_vector2_d_ac38d0179cfe74c30fee290a703ab209a}{y})
\end{DoxyCompactItemize}
\subsection*{Public Attributes}
\begin{DoxyCompactItemize}
\item
double \hyperlink{class_vector2_d_ac5c4e553815737aa24bec8281270178f}{x}
\item
double \hyperlink{class_vector2_d_ac38d0179cfe74c30fee290a703ab209a}{y}
\end{DoxyCompactItemize}

\subsection{Constructor \& Destructor Documentation}
\mbox{\Hypertarget{class_vector2_d_a525e125aac4c844f04c52ddb0e75d594}\label{class_vector2_d_a525e125aac4c844f04c52ddb0e75d594}}
\index{Vector2D@{Vector2D}!Vector2D@{Vector2D}}
\index{Vector2D@{Vector2D}!Vector2D@{Vector2D}}
\subsubsection{\texorpdfstring{Vector2\+D()}{Vector2D()}}
{\footnotesize\ttfamily Vector2\+D\+::\+Vector2D (\begin{DoxyParamCaption}\item[{double}]{x,  }\item[{double}]{y }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}

\subsection{Member Data Documentation}
\mbox{\Hypertarget{class_vector2_d_ac5c4e553815737aa24bec8281270178f}\label{class_vector2_d_ac5c4e553815737aa24bec8281270178f}}
\index{Vector2D@{Vector2D}!x@{x}}
\index{x@{x}!Vector2D@{Vector2D}}
\subsubsection{\texorpdfstring{x}{x}}
{\footnotesize\ttfamily double Vector2\+D\+::x}

\mbox{\Hypertarget{class_vector2_d_ac38d0179cfe74c30fee290a703ab209a}\label{class_vector2_d_ac38d0179cfe74c30fee290a703ab209a}}
\index{Vector2D@{Vector2D}!y@{y}}
\index{y@{y}!Vector2D@{Vector2D}}
\subsubsection{\texorpdfstring{y}{y}}
{\footnotesize\ttfamily double Vector2\+D\+::y}

The documentation for this class was generated from the following file\+:\begin{DoxyCompactItemize}
\item
C\+:/\+Users/\+Public/paramics/programmer/plugins/pveins/src/\+Tra\+C\+I\+A\+P\+I/\hyperlink{_utils_8h}{Utils.\+h}\end{DoxyCompactItemize}