text:
package com.suscipio_solutions.consecro_mud.Abilities.Druid;
import java.util.List;
import java.util.Vector;

import com.suscipio_solutions.consecro_mud.Abilities.interfaces.Ability;
import com.suscipio_solutions.consecro_mud.Abilities.interfaces.ItemCraftor;
import com.suscipio_solutions.consecro_mud.Common.interfaces.CMMsg;
import com.suscipio_solutions.consecro_mud.Items.interfaces.Item;
import com.suscipio_solutions.consecro_mud.Items.interfaces.RawMaterial;
import com.suscipio_solutions.consecro_mud.Locales.interfaces.Room;
import com.suscipio_solutions.consecro_mud.MOBS.interfaces.MOB;
import com.suscipio_solutions.consecro_mud.core.CMClass;
import com.suscipio_solutions.consecro_mud.core.CMLib;
import com.suscipio_solutions.consecro_mud.core.interfaces.ItemPossessor;
import com.suscipio_solutions.consecro_mud.core.interfaces.Physical;

@SuppressWarnings({"unchecked","rawtypes"})
public class Chant_GrowItem extends Chant
{
	@Override public String ID() { return "Chant_GrowItem"; }
	private final static String localizedName = CMLib.lang().L("Grow Item");
	@Override public String name() { return localizedName; }
	@Override public int classificationCode(){return Ability.ACODE_CHANT|Ability.DOMAIN_PLANTGROWTH;}
	@Override public int abstractQuality(){return Ability.QUALITY_INDIFFERENT;}
	@Override protected int canAffectCode(){return 0;}
	@Override protected int canTargetCode(){return 0;}
	@Override protected int overrideMana(){return 50;}

	@Override
	public boolean invoke(MOB mob, Vector commands, Physical givenTarget, boolean auto, int asLevel)
	{
		if((mob.location().domainType()!=Room.DOMAIN_OUTDOORS_WOODS)
		&&((mob.location().myResource()&RawMaterial.MATERIAL_MASK)!=RawMaterial.MATERIAL_WOODEN)
		&&(mob.location().domainType()!=Room.DOMAIN_OUTDOORS_JUNGLE))
		{
			mob.tell(L("This magic will not work here."));
			return false;
		}
		int material=RawMaterial.RESOURCE_OAK;
		if((mob.location().myResource()&RawMaterial.MATERIAL_MASK)==RawMaterial.MATERIAL_WOODEN)
			material=mob.location().myResource();
		else
		{
			final List<Integer> V=mob.location().resourceChoices();
			final Vector V2=new Vector();
			if(V!=null)
			for(int v=0;v<V.size();v++)
			{
				if((V.get(v).intValue()&RawMaterial.MATERIAL_MASK)==RawMaterial.MATERIAL_WOODEN)
					V2.addElement(V.get(v));
			}
			if(V2.size()>0)
				material=((Integer)V2.elementAt(CMLib.dice().roll(1,V2.size(),-1))).intValue();
		}

		if(!super.invoke(mob,commands,givenTarget,auto,asLevel))
			return false;

		// now see if it worked
		final boolean success=proficiencyCheck(mob,0,auto);
		if(success)
		{
			final CMMsg msg=CMClass.getMsg(mob,null,this,verbalCastCode(mob,null,auto),auto?"":L("^S<S-NAME> chant(s) to the trees.^?"));
			if(mob.location().okMessage(mob,msg))
			{
				mob.location().send(mob,msg);
				final ItemCraftor A=(ItemCraftor)CMClass.getAbility("Carpentry");
				ItemCraftor.ItemKeyPair pair=null;
				if(A!=null) pair=A.craftAnyItem(material);
				if(pair==null)
				{
					mob.tell(L("The chant failed for some reason..."));
					return false;
				}
				final Item building=pair.item;
				final Item key=pair.key;
				mob.location().addItem(building,ItemPossessor.Expire.Resource);
				if(key!=null) mob.location().addItem(key,ItemPossessor.Expire.Resource);
				mob.location().showHappens(CMMsg.MSG_OK_ACTION,L("@x1 grows out of a tree and drops.",building.name()));
				mob.location().recoverPhyStats();
			}
		}
		else
			return beneficialWordsFizzle(mob,null,L("<S-NAME> chant(s) to the trees, but nothing happens."));

		// return whether it worked
		return success;
	}
}


text:
package portal

import events "github.com/Cepave/open-falcon-backend/modules/fe/model/falcon_portal"

func (this *PortalController) WhenStrategyUpdated() {
	baseResp := this.BasicRespGen()
	id, _ := this.GetInt("id", 0)
	if id == 0 {
		this.ResposeError(baseResp, "id is missing")
		return
	}
	err, resp := events.WhenStrategyUpdated(id)
	if err != nil {
		this.ResposeError(baseResp, err.Error())
		return
	}
	baseResp.Data["affectedRows"] = resp
	this.ServeApiJson(baseResp)
	return
}

func (this *PortalController) WhenStrategyDeleted() {
	baseResp := this.BasicRespGen()
	id, _ := this.GetInt("id", 0)
	if id == 0 {
		this.ResposeError(baseResp, "id is missing")
		return
	}
	err, resp := events.WhenStrategyDeleted(id)
	if err != nil {
		this.ResposeError(baseResp, err.Error())
		return
	}
	baseResp.Data["affectedRows"] = resp
	this.ServeApiJson(baseResp)
	return
}

func (this *PortalController) WhenTempleteDeleted() {
	baseResp := this.BasicRespGen()
	templateId, _ := this.GetInt("templateId", 0)
	if templateId == 0 {
		this.ResposeError(baseResp, "templateId is missing")
		return
	}
	err, resp := events.WhenTempleteDeleted(templateId)
	if err != nil {
		this.ResposeError(baseResp, err.Error())
		return
	}
	baseResp.Data["affectedRows"] = resp
	this.ServeApiJson(baseResp)
	return
}

func (this *PortalController) WhenTempleteUnbind() {
	baseResp := this.BasicRespGen()
	hostgroupId, _ := this.GetInt("hostgroupId", 0)
	templateId, _ := this.GetInt("templateId", 0)
	if templateId == 0 && hostgroupId == 0 {
		this.ResposeError(baseResp, "templateId or hostgroupId  is missing")
		return
	}
	err, resp := events.WhenTempleteUnbind(templateId, hostgroupId)
	if err != nil {
		this.ResposeError(baseResp, err.Error())
		return
	}
	baseResp.Data["affectedRows"] = resp
	this.ServeApiJson(baseResp)
	return
}

func (this *PortalController) WhenEndpointUnbind() {
	baseResp := this.BasicRespGen()
	hostgroupId, _ := this.GetInt("hostgroupId", 0)
	hostId, _ := this.GetInt("hostId", 0)
	if hostId == 0 && hostgroupId == 0 {
		this.ResposeError(baseResp, "hostId or hostgroupId is missing")
		return
	}
	err, resp := events.WhenEndpointUnbind(hostId, hostgroupId)
	if err != nil {
		this.ResposeError(baseResp, err.Error())
		return
	}
	baseResp.Data["affectedRows"] = resp
	this.ServeApiJson(baseResp)
	return
}

func (this *PortalController) WhenEndpointOnMaintain() {
	baseResp := this.BasicRespGen()
	hostId, _ := this.GetInt("hostId", 0)
	maintainBegin, _ := this.GetInt64("maintainBegin", 0)
	maintainEnd, _ := this.GetInt64("maintainEnd", 0)
	if hostId == 0 {
		this.ResposeError(baseResp, "hostId is missing")
		return
	}
	err, resp := events.WhenEndpointOnMaintain(hostId, maintainBegin, maintainEnd)
	if err != nil {
		this.ResposeError(baseResp, err.Error())
		return
	}
	baseResp.Data["affectedRows"] = resp
	this.ServeApiJson(baseResp)
	return
}

redpajama_set_name: RedPajamaGithub


text:
package sentry

import (
	"fmt"
	"io"
	"io/ioutil"
	"net/http"
	"strings"

	"github.com/getsentry/sentry-go"
)

// HTTP request building code, used to augment the data sent to Sentry
// if a http.Request object is passed as an argument to glog.

func buildHttpRequest(r *http.Request) *sentry.Request {
	return &sentry.Request{
		URL:         r.URL.String(),
		Method:      r.Method,
		Headers:     sentryHeaders(r.Header),
		Cookies:     r.Header.Get("Cookie"),
		QueryString: r.URL.RawQuery,
		Data:        sentryData(r.Body),
		Env:         nil,
	}
}

func sentryHeaders(headers map[string][]string) map[string]string {
	var m = map[string]string{}
	for k, v := range headers {
		// Skip including cookies in the headers.  Cookies have their own section.
		if k != "Cookie" {
			m[k] = strings.Join(v, ",")
		}
	}
	return m
}

func sentryData(body io.ReadCloser) string {
	if s, ok := body.(io.Seeker); ok {
		s.Seek(0, 0)
	}
	b, err := ioutil.ReadAll(body)
	if err != nil {
		return fmt.Sprintf("<%v>", err)
	}
	return string(b)
}


text:
/**
 @module ember
 @submodule ember-glimmer
*/

/**
  A Glimmer2 AST transformation that replaces all instances of

  ```handlebars
 {{input type=boundType}}
  ```

  with

  ```handlebars
 {{input (-input-type boundType) type=boundType}}
  ```

  Note that the type parameters is not removed as the -input-type helpers
  is only used to select the component class. The component still needs
  the type parameter to function.

  @private
  @class TransformInputTypeSyntax
*/

export default function TransformInputTypeSyntax() {
  // set later within Glimmer2 to the syntax package
  this.syntax = null;
}

/**
  @private
  @method transform
  @param {AST} ast The AST to be transformed.
*/
TransformInputTypeSyntax.prototype.transform = function TransformInputTypeSyntax_transform(ast) {
  let { traverse, builders: b } = this.syntax;

  traverse(ast, {
    MustacheStatement(node) {
      if (isInput(node)) {
        insertTypeHelperParameter(node, b);
      }
    }
  });

  return ast;
};

function isInput(node) {
  return node.path.original === 'input';
}

function insertTypeHelperParameter(node, builders) {
  let pairs = node.hash.pairs;
  let pair = null;
  for (let i = 0; i < pairs.length; i++) {
    if (pairs[i].key === 'type') {
      pair = pairs[i];
      break;
    }
  }
  if (pair && pair.value.type !== 'StringLiteral') {
    node.params.unshift(builders.sexpr('-input-type', [builders.path(pair.value.original, pair.loc)], null, pair.loc));
  }
}


text:
package org.apache.camel.component.mybatis;

import java.sql.Connection;
import java.sql.Statement;

import org.apache.camel.test.junit4.CamelTestSupport;
import org.junit.After;
import org.junit.Before;

/**
 * @version
 */
public abstract class MyBatisTestSupport extends CamelTestSupport {

    protected boolean createTestData() {
        return true;
    }

    @Override
    @Before
    public void setUp() throws Exception {
        super.setUp();

        // lets create the database...
        Connection connection = createConnection();
        Statement statement = connection.createStatement();
        statement.execute("create table ACCOUNT ( ACC_ID INTEGER , ACC_FIRST_NAME VARCHAR(255), ACC_LAST_NAME VARCHAR(255), ACC_EMAIL VARCHAR(255)  )");
        connection.close();

        if (createTestData()) {
            Account account = new Account();
            account.setId(123);
            account.setFirstName("James");
            account.setLastName("Strachan");
            account.setEmailAddress("TryGuessing@gmail.com");
            template.sendBody("mybatis:insertAccount?statementType=Insert", account);

            account = new Account();
            account.setId(456);
            account.setFirstName("Claus");
            account.setLastName("Ibsen");
            account.setEmailAddress("Noname@gmail.com");
            template.sendBody("mybatis:insertAccount?statementType=Insert", account);
        }
    }

    @Override
    @After
    public void tearDown() throws Exception {
        Connection connection = createConnection();
        Statement statement = connection.createStatement();
        statement.execute("drop table ACCOUNT");
        connection.close();

        super.tearDown();
    }

    private Connection createConnection() throws Exception {
        MyBatisEndpoint endpoint = resolveMandatoryEndpoint("mybatis:Account", MyBatisEndpoint.class);
        return endpoint.getSqlSessionFactory().getConfiguration().getEnvironment().getDataSource().getConnection();
    }

}


text:
<resources>
    <string name="app_name">Linote</string>

    <!-- Title of the Page with English Words  -->
    <string name="page_title_eng">English</string>

    <!-- Title of the Page with German Words  -->
    <string name="page_title_ger">German</string>

    <!-- Card Popup Menu Item: Search on Google-->
    <string name="menu_item_sear_on_google">Search on Google</string>
    <!-- Card Popup Menu Item: See on Abby Lingvo Live-->
    <string name="menu_item_see_on_abby">See on Abby Lingvo Live</string>

    <!-- Tab Title for the list of all words -->
    <string name="page_title_all">All</string>
    <string name="add_your_new_word">Add your new notation</string>

    <!-- String-Array for Chose_language Spinner-->
    <string name="chose_lang">Chose language</string>
    <string-array name="chose_lang_spinner">
        <item>@string/chose_lang</item>
        <item>@string/page_title_eng</item>
        <item>@string/page_title_ger</item>
    </string-array>

    <string name="details">Details</string>
    <string name="examples">Examples</string>

    <!-- Parts of Speech Strings for Spinner -->
    <string name="chose_pos">Part of Speech</string>
    <string name="noun">noun</string>
    <string name="pronoun">pronoun</string>
    <string name="verb">verb</string>
    <string name="adverb">adverb</string>
    <string name="adjective">adjective</string>
    <string name="conjunction">conjunction</string>
    <string name="preposition">preposition</string>
    <string name="interjection">interjecton</string>

    <string-array name="chose_pos_spinner">
        <item>@string/chose_pos</item>
        <item>@string/noun</item>
        <item>@string/pronoun</item>
        <item>@string/verb</item>
        <item>@string/adverb</item>
        <item>@string/adjective</item>
        <item>@string/conjunction</item>
        <item>@string/preposition</item>
        <item>@string/interjection</item>
    </string-array>

    <!-- Sections String of Notation-Detail view -->
    <string name="word">Word</string>
    <string name="translation">Translation</string>
    <string name="collocations">Collocations</string>
    <string name="description">Description</string>

    <!-- Articles Strings for Article-Spinner -->
    <string name="chose_article">Chose article</string>
    <string name="der" translatable="false">der</string>
    <string name="die" translatable="false">die</string>
    <string name="das" translatable="false">das</string>
    <string-array name="chose_article_spinner">
        <item>@string/chose_article</item>
        <item>@string/der</item>
        <item>@string/die</item>
        <item>@string/das</item>
    </string-array>

    <!-- Delete Dialog Strings -->
    <string name="delete_dialog_msg">Delete Notation?</string>
    <string name="delete">Delete</string>
    <string name="cancel">Cancel</string>
    <string name="save_menu_item">Save</string>
    <string name="delete_menu_item">Delete</string>

    <string name="action_settings">Settings</string>

    <!-- Titel of the Edit Notation Activity -->
    <string name="edit_word_titel">Edit Notation</string>

    <!--Dialog Strings-->
    <string name="unsaved_changes_dialog_msg">Discard your changes and quit editing?</string>
    <string name="discard">Discard</string>
    <string name="keep_editing">Keep editing</string>
    <string name="delete_successful_msg">Notation deleted</string>
    <string name="delete_failed_msg">Error! Notation not deleted</string>
    <string name="notation_added_msg">Notation added to your list</string>
    <string name="notation_add_failed_msg">Error! Notation not added</string>
    <string name="notation_updated_msg">Notation saved</string>
    <string name="notation_update_failed">Error! Notation not saved</string>

    <!-- Empty state of the List Strings -->
    <string name="your_list_is_empty">Your List is empty</string>
    <string name="start_with_new_notation">Start with adding new Notation</string>

    <!--Chosen Lang Strings-->
    <string name="eng" translatable="false">EN</string>
    <string name="ger" translatable="false">DE</string>

    <!-- User input validation Strings -->
    <string name="user_input_word_error_msg">Please enter a Word</string>
    <string name="required_input_error_msg">Valid Input required</string>
    <string name="user_input_translation_error_msg">Please enter a Translation</string>
    <string name="spinnerpos_input_error_msg">Please chose a Part of speech</string>
    <string name="spinnerlang_input_error_msg">Please chose a Language</string>
    <string name="spinnerarticle_input_error_msg">Please chose an Article</string>
    <string name="no_intenet_connection_msg">No internet connection</string>
    <string name="reload_menu_item">reload</string>

</resources>


text:
package org.apache.tinkerpop.gremlin.process.traversal.dsl.graph;

import org.apache.tinkerpop.gremlin.process.computer.GraphComputer;
import org.apache.tinkerpop.gremlin.process.traversal.TraversalEngine;
import org.apache.tinkerpop.gremlin.process.traversal.TraversalSource;
import org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategies;
import org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategy;
import org.apache.tinkerpop.gremlin.process.traversal.engine.ComputerTraversalEngine;
import org.apache.tinkerpop.gremlin.process.traversal.engine.StandardTraversalEngine;
import org.apache.tinkerpop.gremlin.process.traversal.step.map.AddVertexStartStep;
import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.GraphStep;
import org.apache.tinkerpop.gremlin.process.traversal.step.util.PathIdentityStep;
import org.apache.tinkerpop.gremlin.structure.Edge;
import org.apache.tinkerpop.gremlin.structure.Graph;
import org.apache.tinkerpop.gremlin.structure.Transaction;
import org.apache.tinkerpop.gremlin.structure.Vertex;
import org.apache.tinkerpop.gremlin.structure.util.StringFactory;
import org.apache.tinkerpop.gremlin.util.function.ConstantSupplier;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Optional;
import java.util.function.Supplier;
import java.util.function.UnaryOperator;

/**
 * @author Marko A. Rodriguez (http://markorodriguez.com)
 */
public class GraphTraversalSource implements TraversalSource {

    public static Builder standard() {
        return GraphTraversalSource.build().engine(StandardTraversalEngine.build());
    }

    public static Builder computer() {
        return GraphTraversalSource.build().engine(ComputerTraversalEngine.build());
    }

    public static Builder computer(final Class<? extends GraphComputer> graphComputerClass) {
        return GraphTraversalSource.build().engine(ComputerTraversalEngine.build().computer(graphComputerClass));
    }

    ////

    private final transient Graph graph;
    private final TraversalEngine.Builder engineBuilder;
    private final TraversalStrategies strategies;
    private final List<TraversalStrategy> withStrategies;
    private final List<Class<? extends TraversalStrategy>> withoutStrategies;

    private GraphTraversalSource(final Graph graph, final TraversalEngine.Builder engineBuilder, final List<TraversalStrategy> withStrategies, final List<Class<? extends TraversalStrategy>> withoutStrategies) {
        this.graph = graph;
        this.engineBuilder = engineBuilder;
        this.withStrategies = withStrategies;
        this.withoutStrategies = withoutStrategies;
        this.withStrategies.addAll(engineBuilder.getWithStrategies());
        this.withoutStrategies.addAll(engineBuilder.getWithoutStrategies());
        final TraversalStrategies tempStrategies = TraversalStrategies.GlobalCache.getStrategies(this.graph.getClass());
        this.strategies = withStrategies.isEmpty() && withoutStrategies.isEmpty() ?
                tempStrategies :
                tempStrategies.clone()
                        .addStrategies(withStrategies.toArray(new TraversalStrategy[withStrategies.size()]))
                        .removeStrategies(withoutStrategies.toArray(new Class[withoutStrategies.size()]));
    }

    private <S> GraphTraversal.Admin<S, S> generateTraversal() {
        final GraphTraversal.Admin<S, S> traversal = new DefaultGraphTraversal<>(this.graph);
        final TraversalEngine engine = this.engineBuilder.create(this.graph);
        traversal.setEngine(engine);
        traversal.setStrategies(this.strategies);
        return traversal;
    }

    public GraphTraversal<Vertex, Vertex> addV(final Object... keyValues) {
        final GraphTraversal.Admin<Vertex, Vertex> traversal = this.generateTraversal();
        return traversal.addStep(new AddVertexStartStep(traversal, keyValues));
    }

    public GraphTraversal<Vertex, Vertex> V(final Object... vertexIds) {
        final GraphTraversal.Admin<Vertex, Vertex> traversal = this.generateTraversal();
        return traversal.addStep(new GraphStep<>(traversal, Vertex.class, vertexIds));
    }

    public GraphTraversal<Edge, Edge> E(final Object... edgesIds) {
        final GraphTraversal.Admin<Edge, Edge> traversal = this.generateTraversal();
        return traversal.addStep(new GraphStep<>(traversal, Edge.class, edgesIds));
    }

    //// UTILITIES

    public GraphTraversalSourceStub withSideEffect(final String key, final Supplier supplier) {
        final GraphTraversal.Admin traversal = this.generateTraversal();
        traversal.getSideEffects().registerSupplier(key, supplier);
        return new GraphTraversalSourceStub(traversal, false);
    }

    public GraphTraversalSourceStub withSideEffect(final String key, final Object object) {
        final GraphTraversal.Admin traversal = this.generateTraversal();
        traversal.getSideEffects().registerSupplier(key, new ConstantSupplier<>(object));
        return new GraphTraversalSourceStub(traversal, false);
    }

    public <A> GraphTraversalSourceStub withSack(final Supplier<A> initialValue, final UnaryOperator<A> splitOperator) {
        final GraphTraversal.Admin traversal = this.generateTraversal();
        traversal.getSideEffects().setSack(initialValue, Optional.of(splitOperator));
        return new GraphTraversalSourceStub(traversal, false);
    }

    public <A> GraphTraversalSourceStub withSack(final Supplier<A> initialValue) {
        final GraphTraversal.Admin traversal = this.generateTraversal();
        traversal.getSideEffects().setSack(initialValue, Optional.empty());
        return new GraphTraversalSourceStub(traversal, false);
    }

    public <A> GraphTraversalSourceStub withSack(final A initialValue, final UnaryOperator<A> splitOperator) {
        final GraphTraversal.Admin traversal = this.generateTraversal();
        traversal.getSideEffects().setSack(new ConstantSupplier<>(initialValue), Optional.of(splitOperator));
        return new GraphTraversalSourceStub(traversal, false);
    }

    public <A> GraphTraversalSourceStub withSack(final A initialValue) {
        final GraphTraversal.Admin traversal = this.generateTraversal();
        traversal.getSideEffects().setSack(new ConstantSupplier<>(initialValue), Optional.empty());
        return new GraphTraversalSourceStub(traversal, false);
    }

    public <S> GraphTraversalSourceStub withPath() {
        return new GraphTraversalSourceStub(this.generateTraversal(), true);
    }

    public Transaction tx() {
        return this.graph.tx();
    }

    public static Builder build() {
        return new Builder();
    }

    @Override
    public List<TraversalStrategy> getStrategies() {
        return Collections.unmodifiableList(this.strategies.toList());
    }

    @Override
    public Optional<GraphComputer> getGraphComputer() {
        return this.engineBuilder.create(this.graph).getGraphComputer();
    }

    @Override
    public Optional<Graph> getGraph() {
        return Optional.ofNullable(this.graph);
    }

    @Override
    public GraphTraversalSource.Builder asBuilder() {
        final GraphTraversalSource.Builder builder = GraphTraversalSource.build().engine(this.engineBuilder);
        this.withStrategies.forEach(builder::with);
        this.withoutStrategies.forEach(builder::without);
        return builder;
    }

    @Override
    public String toString() {
        return StringFactory.traversalSourceString(this);
    }

    //////

    public final static class Builder implements TraversalSource.Builder<GraphTraversalSource> {

        private TraversalEngine.Builder engineBuilder = StandardTraversalEngine.build();
        private List<TraversalStrategy> withStrategies = new ArrayList<>();
        private List<Class<? extends TraversalStrategy>> withoutStrategies = new ArrayList<>();

        private Builder() {
        }

        @Override
        public Builder engine(final TraversalEngine.Builder engineBuilder) {
            this.engineBuilder = engineBuilder;
            return this;
        }

        @Override
        public Builder with(final TraversalStrategy strategy) {
            this.withStrategies.add(strategy);
            return this;
        }

        @Override
        public TraversalSource.Builder without(final Class<? extends TraversalStrategy> strategyClass) {
            this.withoutStrategies.add(strategyClass);
            return this;
        }

        @Override
        public GraphTraversalSource create(final Graph graph) {
            return new GraphTraversalSource(graph, this.engineBuilder, this.withStrategies, this.withoutStrategies);
        }
    }

    public static class GraphTraversalSourceStub {

        private final GraphTraversal.Admin traversal;
        private boolean withPaths;

        public GraphTraversalSourceStub(final GraphTraversal.Admin traversal, final boolean withPaths) {
            this.traversal = traversal;
            this.withPaths = withPaths;
        }

        public GraphTraversal<Vertex, Vertex> addV(final Object... keyValues) {
            this.traversal.addStep(new AddVertexStartStep(this.traversal, keyValues));
            return ((this.withPaths) ? this.traversal.addStep(new PathIdentityStep<>(this.traversal)) : this.traversal);
        }

        public GraphTraversal<Vertex, Vertex> V(final Object... vertexIds) {
            this.traversal.addStep(new GraphStep<>(this.traversal, Vertex.class, vertexIds));
            return ((this.withPaths) ? this.traversal.addStep(new PathIdentityStep<>(this.traversal)) : this.traversal);
        }

        public GraphTraversal<Edge, Edge> E(final Object... edgesIds) {
            this.traversal.addStep(new GraphStep<>(this.traversal, Edge.class, edgesIds));
            return ((this.withPaths) ? this.traversal.addStep(new PathIdentityStep<>(this.traversal)) : this.traversal);
        }

        //// UTILITIES

        public GraphTraversalSourceStub withSideEffect(final String key, final Supplier supplier) {
            this.traversal.getSideEffects().registerSupplier(key, supplier);
            return this;
        }

        public GraphTraversalSourceStub withSideEffect(final String key, final Object object) {
            this.traversal.getSideEffects().registerSupplier(key, new ConstantSupplier<>(object));
            return this;
        }

        public <A> GraphTraversalSourceStub withSack(final Supplier<A> initialValue, final UnaryOperator<A> splitOperator) {
            this.traversal.getSideEffects().setSack(initialValue, Optional.of(splitOperator));
            return this;
        }

        public <A> GraphTraversalSourceStub withSack(final Supplier<A> initialValue) {
            this.traversal.getSideEffects().setSack(initialValue, Optional.empty());
            return this;
        }

        public <A> GraphTraversalSourceStub withSack(final A initialValue, final UnaryOperator<A> splitOperator) {
            this.traversal.getSideEffects().setSack(new ConstantSupplier<>(initialValue), Optional.of(splitOperator));
            return this;
        }

        public <A> GraphTraversalSourceStub withSack(final A initialValue) {
            this.traversal.getSideEffects().setSack(new ConstantSupplier<>(initialValue), Optional.empty());
            return this;
        }

        public GraphTraversalSourceStub withPath() {
            this.withPaths = true;
            return this;
        }
    }
}


text:
@extends('admin.layout')
@section('content')

{{ trans('admin.category.lb_title_page') }}
            @if(empty($parent_id))
            {{ trans('admin.category.lb_title_edit_main') }}
            @else
            {{ trans('admin.category.lb_title_edit_sub') }}
            @endif

                @include('notifications')
                <form role="form" action="{{ route('admin_category_edit', ['id' => $id, 'parent_id' => $parent_id]) }}" id="form-general" method="post">

                        {{ csrf_field() }}
                        <button type="submit" class="btn btn-primary btn-sm">{{ trans('admin.category.btn_submit') }}</button>
                        @if(empty($parent_id))

                            {{ trans('admin.category.btn_back') }}

                        @else
                         $parent_id]) }}" class="btn btn-default btn-sm">
                            {{ trans('admin.category.btn_back') }}

                        @endif

                    @if(empty($parent_id))

has('is_home')) has-error @endif">

                                    <input name="is_home" type="checkbox" value="1" @if(old('is_home', $category->is_home or null) == '1') checked @endif /> {{ trans('admin.category.is_home') }}

                            @if ($errors->has('is_home'))

{{ $errors->first('is_home') }}

                            @endif

                    @endif

                        @foreach ($languages as $lang)

iso2 === 'vi') class="active" @endif>iso2 }}" data-toggle="tab">{{ $lang->name }}

                        @endforeach

                        @foreach ($categories as $cate)

language_code === 'vi') active @endif" id="tab_{{ $cate->language_code }}">

                                            <?php
                                                $title       = 'title_'.$cate->language_code;
                                                $slug       = 'slug_'.$cate->language_code;
                                            ?>

has($title)) has-error @endif">
                                                {{ trans('admin.title_'.$cate->language_code) }}
                                                <input type="text" class="form-control border-corner title-cate" lang="{{ $cate->language_code }}" name="{{ $title }}" placeholder="Input ..."
                                                        value="{{ old($title, $cate->title) }}" />
                                                @if ($errors->has($title))

{{ $errors->first($title) }}

                                                @endif

has($slug)) has-error @endif">
                                                {{ trans('admin.slug_'.$cate->language_code) }}
                                                <input type="hidden" class="form-control border-corner title-cate" id="slug_{{ $cate->language_code }}" lang="{{ $cate->language_code }}" name="{{ $slug }}" placeholder="Input ..."
                                                        value="{{ old($slug, $cate->slug) }}" />

language_code }}">{{ old($slug, $cate->slug) }}

                                                @if ($errors->has($slug))

{{ $errors->first($slug) }}

                                                @endif

                        @endforeach

                </form>

@endsection

@section('footer_script')

@endsection


text:
from flask import Flask, render_template, url_for, redirect, request, jsonify, Response
from artyhelper import HeightMap, UAV, Target

app = Flask(__name__)
app.debug = True
app.secret_key = "\x8c\x8d\xef\xd8\xbb\xb9\xf5\xc1\x85\x83\xf1\xf9\xb0\x98\xb0\x1f"

maps = {}
for name in HeightMap.get_map_names():
    maps[name] = HeightMap(name)

@app.route('/')
def root():
    return redirect('/altis')

@app.route('/<map_name>')
def render(map_name):
    return render_template('uav.html', map=maps[map_name.title()])

if __name__ == '__main__':
    app.run(debug=True, threaded=True)


text:
package org.apereo.cas.ticket.registry.config;

import org.apereo.cas.configuration.CasConfigurationProperties;
import org.apereo.cas.configuration.model.support.infinispan.InfinispanProperties;
import org.apereo.cas.ticket.Ticket;
import org.apereo.cas.ticket.registry.InfinispanTicketRegistry;
import org.apereo.cas.ticket.registry.TicketRegistry;
import org.apereo.cas.util.CoreTicketUtils;

import lombok.val;
import org.apache.commons.lang3.StringUtils;
import org.infinispan.Cache;
import org.infinispan.manager.DefaultCacheManager;
import org.infinispan.manager.EmbeddedCacheManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * This is {@link InfinispanTicketRegistryConfiguration}.
 *
 * @author Misagh Moayyed
 * @since 5.0.0
 */
@Configuration("infinispanTicketRegistryConfiguration")
@EnableConfigurationProperties(CasConfigurationProperties.class)
public class InfinispanTicketRegistryConfiguration {

    @Autowired
    private CasConfigurationProperties casProperties;

    @Bean
    @RefreshScope
    public TicketRegistry ticketRegistry() throws Exception {
        val span = casProperties.getTicket().getRegistry().getInfinispan();
        val r = new InfinispanTicketRegistry(getCache(span));
        r.setCipherExecutor(CoreTicketUtils.newTicketRegistryCipherExecutor(span.getCrypto(), "infinispan"));
        return r;
    }

    private Cache<String, Ticket> getCache(final InfinispanProperties span) throws Exception {
        val cacheName = span.getCacheName();
        if (StringUtils.isBlank(cacheName)) {
            return cacheManager().getCache();
        }
        return cacheManager().getCache(cacheName);
    }

    @Bean
    public EmbeddedCacheManager cacheManager() throws Exception {
        val loc = casProperties.getTicket().getRegistry().getInfinispan().getConfigLocation();
        return new DefaultCacheManager(loc.getInputStream());
    }
}


text:
using System;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Collections.ObjectModel;
using Syncfusion.SfChart.XForms;

namespace Sensus.Shared.Probes.User.Scripts
{
    public class ScriptProbe : Probe
    {
        private ObservableCollection<ScriptRunner> _scriptRunners;

        public ObservableCollection<ScriptRunner> ScriptRunners
        {
            get { return _scriptRunners; }
        }

        public sealed override string DisplayName
        {
            get { return "Scripted Interactions"; }
        }

        public sealed override Type DatumType
        {
            get { return typeof(ScriptDatum); }
        }

        protected override float RawParticipation
        {
            get
            {
                int scriptsRun = _scriptRunners.Sum(scriptRunner => scriptRunner.RunTimes.Count(runTime => runTime >= Protocol.ParticipationHorizon));
                int scriptsCompleted = _scriptRunners.Sum(scriptRunner => scriptRunner.CompletionTimes.Count(completionTime => completionTime >= Protocol.ParticipationHorizon));
                return scriptsRun == 0 ? 1 : scriptsCompleted / (float)scriptsRun;
            }
        }

        public override string CollectionDescription
        {
            get
            {
                StringBuilder collectionDescription = new StringBuilder();

                Regex uppercaseSplitter = new Regex(@"
                (?<=[A-Z])(?=[A-Z][a-z]) |
                (?<=[^A-Z])(?=[A-Z]) |
                (?<=[A-Za-z])(?=[^A-Za-z])", RegexOptions.IgnorePatternWhitespace);

                foreach (ScriptRunner scriptRunner in _scriptRunners)
                    if (scriptRunner.Enabled)
                    {
                        foreach (Trigger trigger in scriptRunner.Triggers)
                            collectionDescription.Append((collectionDescription.Length == 0 ? "" : Environment.NewLine) + scriptRunner.Name + ":  When " + trigger.Probe.DisplayName + " is " + uppercaseSplitter.Replace(trigger.Condition.ToString(), " ").ToLower() + " " + trigger.ConditionValue + ".");

                        if (scriptRunner.RunOnStart)
                            collectionDescription.Append((collectionDescription.Length == 0 ? "" : Environment.NewLine) + scriptRunner.Name + ":  Once when the study is started.");

                        if (scriptRunner.TriggerWindows != "")
                        {
                            string windows = scriptRunner.TriggerWindows;
                            string collectionDescriptionPrefix = "Randomly during hours ";
                            int commaCount = windows.Count(c => c == ',');
                            if (commaCount == 0)
                            {
                                if (!windows.Contains('-'))
                                    collectionDescriptionPrefix = "At ";
                            }
                            else if (commaCount == 1)
                                windows = windows.Replace(",", " and");
                            else if (commaCount > 1)
                                windows = windows.Insert(windows.LastIndexOf(',') + 1, " and");

                            collectionDescription.Append((collectionDescription.Length == 0 ? "" : Environment.NewLine) + scriptRunner.Name + ":  " + collectionDescriptionPrefix + windows + ".");
                        }
                    }

                return collectionDescription.ToString();
            }
        }

        public ScriptProbe()
        {
            _scriptRunners = new ObservableCollection<ScriptRunner>();
        }

        protected override void Initialize()
        {
            base.Initialize();

            foreach (ScriptRunner scriptRunner in _scriptRunners)
                if (scriptRunner.Enabled)
                    scriptRunner.Initialize();
        }

        protected override void InternalStart()
        {
            base.InternalStart();

            foreach (ScriptRunner scriptRunner in _scriptRunners)
                if (scriptRunner.Enabled)
                    scriptRunner.Start();
        }

        public override bool TestHealth(ref string error, ref string warning, ref string misc)
        {
            bool restart = base.TestHealth(ref error, ref warning, ref misc);

            if (Running)
            {
                foreach (ScriptRunner scriptRunner in _scriptRunners)
                    if (scriptRunner.Enabled && scriptRunner.TestHealth(ref error, ref warning, ref misc))
                    {
                        warning += "Restarting script runner \"" + scriptRunner.Name + "\"." + Environment.NewLine;

                        try
                        {
                            scriptRunner.Restart();
                        }
                        catch (Exception ex)
                        {
                            warning += "Error restarting script runner \"" + scriptRunner.Name + "\":  " + ex.Message;
                            SensusServiceHelper.Get().Logger.Log(warning, LoggingLevel.Normal, GetType());
                        }
                    }
            }

            return restart;
        }

        public override void Reset()
        {
            base.Reset();

            foreach (var scriptRunner in _scriptRunners)
            {
                scriptRunner.Reset();
            }
        }

        public override void Stop()
        {
            base.Stop();

            foreach (ScriptRunner scriptRunner in _scriptRunners)
                scriptRunner.Stop();
        }

        protected override ChartSeries GetChartSeries()
        {
            return null;
        }

        protected override ChartDataPoint GetChartDataPointFromDatum(Datum datum)
        {
            return null;
        }

        protected override ChartAxis GetChartPrimaryAxis()
        {
            throw new NotImplementedException();
        }

        protected override RangeAxisBase GetChartSecondaryAxis()
        {
            throw new NotImplementedException();
        }
    }
}


text:
#include "stdafx.h"
#include "amp_stl_algorithms.h"
#include "testtools.h"

using namespace Microsoft::VisualStudio::CppUnitTestFramework;
using namespace concurrency;
using namespace amp_stl_algorithms;
using namespace testtools;

namespace testtools_tests
{
    TEST_CLASS(testtools_equality_tests)
    {
        TEST_METHOD_CATEGORY(testtools_array_view_equality, "testtools")
        {
            const int size = 10;
            std::vector<int> a(size, 0);
            std::vector<int> b(size, 0);
            array_view<int> b_av(size, b);

            Assert::IsTrue(are_equal(a, b_av));
            Assert::IsTrue(are_equal(b_av, a));

            b_av[6] = 2;

            Assert::IsFalse(are_equal(a, b_av));
            Assert::IsFalse(are_equal(b_av, a));

            b_av = b_av.section(0, 5);

            Assert::IsFalse(are_equal(a, b_av));
            Assert::IsFalse(are_equal(b_av, a));

            a.resize(5);

            Assert::IsTrue(are_equal(a, b_av));
            Assert::IsTrue(are_equal(b_av, a));
        }
    };

    std::wstring Msg(std::vector<int>& expected, std::vector<int>& actual, size_t width = 32)
    {
        std::wostringstream msg;
        msg << container_width(50) << L"[" << expected << L"] != [" << actual << L"]" << std::endl;
        return msg.str();
    }

    TEST_CLASS(testtools_sequential_scan_tests)
    {
        TEST_METHOD_CATEGORY(testtools_sequential_exclusive_scan, "testtools")
        {
            std::array<int, 16> input = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 };
            std::vector<int> result(input.size(), -1);
            std::array<int, 16> expected = { 0, 1, 3, 6, 10, 15, 21, 28, 36, 45, 55, 66, 78, 91, 105, 120 };

            scan_sequential_exclusive(begin(input), end(input), result.begin());

            std::vector<int> exp(begin(expected), end(expected));
            Assert::IsTrue(exp == result, Msg(exp, result, 16).c_str());
        }

        TEST_METHOD_CATEGORY(testtools_sequential_inclusive_scan, "testtools")
        {
            std::array<int, 16> input = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 };
            std::vector<int> result(input.size(), -1);
            std::array<int, 16> expected = { 1, 3, 6, 10, 15, 21, 28, 36, 45, 55, 66, 78, 91, 105, 120, 136 };

            scan_sequential_inclusive(begin(input), end(input), result.begin());

            std::vector<int> exp(begin(expected), end(expected));
            Assert::IsTrue(exp == result, Msg(exp, result, 16).c_str());
        }
    };

    TEST_CLASS(testtools_ostream_tests)
    {
        TEST_METHOD_CATEGORY(testtools_ostream_insertion_std_vector, "testtools")
        {
            auto data = std::vector<int>(5);
            std::iota(begin(data), end(data), 1);
            std::ostringstream stream;
            stream << data;
            Assert::AreEqual("1,2,3,4,", stream.str().c_str());
        }

        TEST_METHOD_CATEGORY(testtools_ostream_insertion_std_array, "testtools")
        {
            auto data = std::array<int, 5>();
            std::iota(begin(data), end(data), 1);
            std::ostringstream stream;
            stream << data;
            Assert::AreEqual("1,2,3,4,", stream.str().c_str());
        }

        TEST_METHOD_CATEGORY(testtools_ostream_insertion_amp_array_view, "testtools")
        {
            auto data = std::vector<int>(5);
            std::iota(begin(data), end(data), 1);
            auto data_vw = concurrency::array_view<int, 1>(5, data.data());
            std::ostringstream stream;
            stream << data_vw;
            Assert::AreEqual("1,2,3,4,", stream.str().c_str());
        }

        TEST_METHOD_CATEGORY(testtools_ostream_insertion_amp_array, "testtools")
        {
            auto data = std::vector<int>(5);
            std::iota(begin(data), end(data), 1);
            auto data_arr = concurrency::array<int, 1>(5);
            copy(begin(data), end(data), data_arr);
            std::ostringstream stream;
            stream << data_arr;
            Assert::AreEqual("1,2,3,4,", stream.str().c_str());
        }

        TEST_METHOD_CATEGORY(testtools_ostream_insertion_container_width_limited, "testtools")
        {
            auto data = std::vector<int>(5);
            std::iota(begin(data), end(data), 1);
            std::ostringstream stream;
            stream << container_width(2) << data << container_width(3) << " " << data;
            Assert::AreEqual("1,2, 1,2,3,", stream.str().c_str());
        }
    };
};


text:
<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wikidot="http://www.wikidot.com/rss-namespace">

	<channel>
		<title>Comments for page "TicTac"</title>
		<link>http://bvs.wikidot.com/forum/t-48653/tictac</link>
		<description>Posts in the discussion thread "TicTac"</description>
				<copyright></copyright>
		<lastBuildDate>Sun, 10 Jul 2022 03:35:03 +0000</lastBuildDate>

					<item>
				<guid>http://bvs.wikidot.com/forum/t-48653#post-473203</guid>
				<title>(no title)</title>
				<link>http://bvs.wikidot.com/forum/t-48653/tictac#post-473203</link>
				<description></description>
				<pubDate>Fri, 08 May 2009 13:24:44 +0000</pubDate>
				<wikidot:authorName>Krafen</wikidot:authorName>				<wikidot:authorUserId>313547</wikidot:authorUserId>				<content:encoded>
					<![CDATA[

I think the comments entry should be removed. It is no longer accurate.

				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://bvs.wikidot.com/forum/t-48653#post-401422</guid>
				<title>The Bonus...</title>
				<link>http://bvs.wikidot.com/forum/t-48653/tictac#post-401422</link>
				<description></description>
				<pubDate>Mon, 02 Mar 2009 13:06:31 +0000</pubDate>
				<wikidot:authorName>Sekai</wikidot:authorName>				<wikidot:authorUserId>242461</wikidot:authorUserId>				<content:encoded>
					<![CDATA[

TicTac now gives +400% Friend Points, not +100%.

				 	]]>
				</content:encoded>							</item>
				</channel>
</rss>


text:
package org.elasticsearch.search.aggregations;

import org.elasticsearch.common.Strings;
import org.elasticsearch.common.io.stream.NamedWriteable;
import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.common.util.BigArrays;
import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.rest.action.search.RestSearchAction;
import org.elasticsearch.script.ScriptService;
import org.elasticsearch.search.aggregations.pipeline.PipelineAggregator;
import org.elasticsearch.search.aggregations.support.AggregationPath;

import java.io.IOException;
import java.util.List;
import java.util.Map;
import java.util.Objects;

/**
 * An internal implementation of {@link Aggregation}. Serves as a base class for all aggregation implementations.
 */
public abstract class InternalAggregation implements Aggregation, NamedWriteable {

    public static class ReduceContext {

        private final BigArrays bigArrays;
        private final ScriptService scriptService;
        private final boolean isFinalReduce;

        public ReduceContext(BigArrays bigArrays, ScriptService scriptService, boolean isFinalReduce) {
            this.bigArrays = bigArrays;
            this.scriptService = scriptService;
            this.isFinalReduce = isFinalReduce;
        }

        /**
         * Returns true iff the current reduce phase is the final reduce phase. This indicates if operations like
         * pipeline aggregations should be applied or if specific features like <tt>minDocCount</tt> should be taken into account.
         * Operations that are potentially loosing information can only be applied during the final reduce phase.
         */
        public boolean isFinalReduce() {
            return isFinalReduce;
        }

        public BigArrays bigArrays() {
            return bigArrays;
        }

        public ScriptService scriptService() {
            return scriptService;
        }
    }

    protected final String name;

    protected final Map<String, Object> metaData;

    private final List<PipelineAggregator> pipelineAggregators;

    /**
     * Constructs an get with a given name.
     *
     * @param name The name of the get.
     */
    protected InternalAggregation(String name, List<PipelineAggregator> pipelineAggregators, Map<String, Object> metaData) {
        this.name = name;
        this.pipelineAggregators = pipelineAggregators;
        this.metaData = metaData;
    }

    /**
     * Read from a stream.
     */
    protected InternalAggregation(StreamInput in) throws IOException {
        name = in.readString();
        metaData = in.readMap();
        pipelineAggregators = in.readNamedWriteableList(PipelineAggregator.class);
    }

    @Override
    public final void writeTo(StreamOutput out) throws IOException {
        out.writeString(name);
        out.writeGenericValue(metaData);
        out.writeNamedWriteableList(pipelineAggregators);
        doWriteTo(out);
    }

    protected abstract void doWriteTo(StreamOutput out) throws IOException;

    @Override
    public String getName() {
        return name;
    }

    /**
     * Reduces the given aggregations to a single one and returns it. In most cases, the assumption will be the all given
     * aggregations are of the same type (the same type as this aggregation). For best efficiency, when implementing,
     * try reusing an existing instance (typically the first in the given list) to save on redundant object
     * construction.
     */
    public final InternalAggregation reduce(List<InternalAggregation> aggregations, ReduceContext reduceContext) {
        InternalAggregation aggResult = doReduce(aggregations, reduceContext);
        if (reduceContext.isFinalReduce()) {
            for (PipelineAggregator pipelineAggregator : pipelineAggregators) {
                aggResult = pipelineAggregator.reduce(aggResult, reduceContext);
            }
        }
        return aggResult;
    }

    public abstract InternalAggregation doReduce(List<InternalAggregation> aggregations, ReduceContext reduceContext);

    /**
     * Get the value of specified path in the aggregation.
     *
     * @param path
     *            the path to the property in the aggregation tree
     * @return the value of the property
     */
    public Object getProperty(String path) {
        AggregationPath aggPath = AggregationPath.parse(path);
        return getProperty(aggPath.getPathElementsAsStringList());
    }

    public abstract Object getProperty(List<String> path);

    /**
     * Read a size under the assumption that a value of 0 means unlimited.
     */
    protected static int readSize(StreamInput in) throws IOException {
        final int size = in.readVInt();
        return size == 0 ? Integer.MAX_VALUE : size;
    }

    /**
     * Write a size under the assumption that a value of 0 means unlimited.
     */
    protected static void writeSize(int size, StreamOutput out) throws IOException {
        if (size == Integer.MAX_VALUE) {
            size = 0;
        }
        out.writeVInt(size);
    }

    @Override
    public Map<String, Object> getMetaData() {
        return metaData;
    }

    public List<PipelineAggregator> pipelineAggregators() {
        return pipelineAggregators;
    }

    @Override
    public String getType() {
        return getWriteableName();
    }

    @Override
    public final XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
        if (params.paramAsBoolean(RestSearchAction.TYPED_KEYS_PARAM, false)) {
            // Concatenates the type and the name of the aggregation (ex: top_hits#foo)
            builder.startObject(String.join(TYPED_KEYS_DELIMITER, getType(), getName()));
        } else {
            builder.startObject(getName());
        }
        if (this.metaData != null) {
            builder.field(CommonFields.META.getPreferredName());
            builder.map(this.metaData);
        }
        doXContentBody(builder, params);
        builder.endObject();
        return builder;
    }

    public abstract XContentBuilder doXContentBody(XContentBuilder builder, Params params) throws IOException;

    @Override
    public int hashCode() {
        return Objects.hash(name, metaData, pipelineAggregators, doHashCode());
    }

    /**
     * Opportunity for subclasses to the {@link #hashCode()} for this
     * class.
     **/
    protected abstract int doHashCode();

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (obj.getClass() != getClass()) {
            return false;
        }
        InternalAggregation other = (InternalAggregation) obj;
        return Objects.equals(name, other.name) &&
                Objects.equals(pipelineAggregators, other.pipelineAggregators) &&
                Objects.equals(metaData, other.metaData) &&
                doEquals(obj);
    }

    /**
     * Opportunity for subclasses to add criteria to the {@link #equals(Object)}
     * method for this class.
     *
     * This method can safely cast obj to the subclass since the
     * {@link #equals(Object)} method checks that obj is the same
     * class as this
     */
    protected abstract boolean doEquals(Object obj);

    @Override
    public String toString() {
        return Strings.toString(this);
    }

}


text:
"""Build a Convolutional Bayesian neural network."""

import functools

from absl import logging
import edward2 as ed
from experimental.auxiliary_sampling.sampling import mean_field_fn  # local file import

import tensorflow.compat.v1 as tf
import tensorflow_probability as tfp

keras = tf.keras

def _resnet_layer(inputs,
                  num_filters=16,
                  kernel_size=3,
                  strides=1,
                  activation='relu',
                  depth=20,
                  batchnorm=False,
                  conv_first=True,
                  variational=False,
                  n_examples=None):
  """2D Convolution-Batch Normalization-Activation stack builder.

  Args:
    inputs (tensor): input tensor from input image or previous layer
    num_filters (int): Conv2D number of filters
    kernel_size (int): Conv2D square kernel dimensions
    strides (int): Conv2D square stride dimensions
    activation (string): Activation function string.
    depth (int): ResNet depth; used for initialization scale.
    batchnorm (bool): whether to include batch normalization
    conv_first (bool): conv-bn-activation (True) or bn-activation-conv (False)
    variational (bool): Whether to use a variational convolutional layer.
    n_examples (int): Number of examples per epoch for variational KL.

  Returns:
      x (tensor): tensor as input to the next layer
  """
  if variational:

    def fixup_init(shape, dtype=None):
      """Fixup initialization; see https://arxiv.org/abs/1901.09321."""
      return keras.initializers.he_normal()(
          shape, dtype=dtype) * depth**(-1 / 4)

    p_fn, q_fn = mean_field_fn(empirical_bayes=True, initializer=fixup_init)

    def normalized_kl_fn(q, p, _):
      return tfp.distributions.kl_divergence(q, p) / tf.to_float(n_examples)

    conv = tfp.layers.Convolution2DFlipout(
        num_filters,
        kernel_size=kernel_size,
        strides=strides,
        padding='same',
        kernel_prior_fn=p_fn,
        kernel_posterior_fn=q_fn,
        kernel_divergence_fn=normalized_kl_fn)
  else:
    conv = keras.layers.Conv2D(
        num_filters,
        kernel_size=kernel_size,
        strides=strides,
        padding='same',
        kernel_initializer='he_normal',
        kernel_regularizer=keras.regularizers.l2(1e-4))

  def apply_conv(net):
    return conv(net)

  x = inputs
  x = apply_conv(x) if conv_first else x
  if batchnorm:
    x = keras.layers.BatchNormalization()(x)
  x = keras.layers.Activation(activation)(x) if activation is not None else x
  x = x if conv_first else apply_conv(x)
  return x

def build_resnet_v1(input_layer,
                    depth,
                    variational,
                    batchnorm,
                    n_examples):
  """ResNet Version 1 Model builder.

  Stacks of 2 x (3 x 3) Conv2D-BN-ReLU
  Last ReLU is after the shortcut connection.
  At the beginning of each stage, the feature map size is halved (downsampled)
  by a convolutional layer with strides=2, while the number of filters is
  doubled. Within each stage, the layers have the same number filters and the
  same number of filters.
  Features maps sizes:
  stage 0: 32x32, 16
  stage 1: 16x16, 32
  stage 2:  8x8,  64
  The Number of parameters is approx:
  ResNet20 0.27M
  ResNet32 0.46M
  ResNet44 0.66M
  ResNet56 0.85M
  ResNet110 1.7M

  Args:
    input_layer (tensor): keras.layers.InputLayer instance.
    depth (int): number of core convolutional layers. It should be 6n+2 (eg 20,
      32, 44).
    variational (str): 'none', 'hybrid', 'full'. whether to use variational
      inference for zero, some, or all layers.
    batchnorm (bool): use of batchnorm layers.
    n_examples (int): number of training points.

  Returns:
     output: the output tensor of the Network.
  """
  if (depth - 2) % 6 != 0:
    raise ValueError('depth should be 6n+2 (eg 20, 32, 44 in [a])')
  # Start model definition.
  num_filters = 16
  num_res_blocks = int((depth - 2) / 6)

  activation = 'selu' if variational else 'relu'
  resnet_layer = functools.partial(
      _resnet_layer,
      depth=depth,
      n_examples=n_examples)

  logging.info('Starting ResNet build.')
  x = resnet_layer(inputs=input_layer,
                   activation=activation)
  # Instantiate the stack of residual units
  for stack in range(3):
    for res_block in range(num_res_blocks):
      logging.info('Starting ResNet stack #%d block #%d.', stack, res_block)
      strides = 1
      if stack > 0 and res_block == 0:  # first layer but not first stack
        strides = 2  # downsample
      y = resnet_layer(
          inputs=x,
          num_filters=num_filters,
          strides=strides,
          activation=activation,
          variational=True if variational == 'full' else False,
          batchnorm=batchnorm)
      y = resnet_layer(
          inputs=y,
          num_filters=num_filters,
          activation=None,
          variational=True if variational in ('hybrid', 'full') else False,
          batchnorm=batchnorm)
      if stack > 0 and res_block == 0:  # first layer but not first stack
        # linear projection residual shortcut connection to match changed dims
        x = resnet_layer(
            inputs=x,
            num_filters=num_filters,
            kernel_size=1,
            strides=strides,
            activation=None,
            batchnorm=False)
      x = keras.layers.add([x, y])
      x = keras.layers.Activation(activation)(x)
    num_filters *= 2

  # Add classifier on top.
  # v1 does not use BN after last shortcut connection-ReLU
  x = keras.layers.AveragePooling2D(pool_size=8)(x)
  return keras.layers.Flatten()(x)

def res_net(n_examples,
            input_shape,
            num_classes,
            batchnorm=False,
            variational='full'):
  """Wrapper for build_resnet_v1.

  Args:
    n_examples (int): number of training points.
    input_shape (list): input shape.
    num_classes (int): number of classes (CIFAR10 has 10).
    batchnorm (bool): use of batchnorm layers.
    variational (str): 'none', 'hybrid', 'full'. whether to use variational
      inference for zero, some, or all layers.

  Returns:
      model (Model): Keras model instance whose output is a
        tfp.distributions.Categorical distribution.
  """
  inputs = tf.keras.layers.Input(shape=input_shape)
  x = build_resnet_v1(
      inputs,
      depth=20,
      variational=variational,
      batchnorm=batchnorm,
      n_examples=n_examples)

  p_fn, q_fn = mean_field_fn(empirical_bayes=True)

  def normalized_kl_fn(q, p, _):
    return tfp.distributions.kl_divergence(q, p) / tf.to_float(n_examples)

  logits = tfp.layers.DenseLocalReparameterization(
      num_classes,
      kernel_prior_fn=p_fn,
      kernel_posterior_fn=q_fn,
      bias_prior_fn=p_fn,
      bias_posterior_fn=q_fn,
      kernel_divergence_fn=normalized_kl_fn,
      bias_divergence_fn=normalized_kl_fn)(x)
  outputs = tf.keras.layers.Lambda(lambda x: ed.Categorical(logits=x))(logits)
  return tf.keras.models.Model(inputs=inputs, outputs=outputs)


text:
package br.com.clairtonluz.especializacao_em_arquitetura.module01_programacao_efetiva_com_orientacao_a_objectos.exercicios.exercicio4;

public class NumeroCartela {
	private Integer numero;
	private boolean marcar;

	public NumeroCartela(Integer numero) {
		this.numero = numero;
	}

	public boolean isMarcar() {
		return marcar;
	}

	public void setMarcar(boolean marcar) {
		this.marcar = marcar;
	}

	public Integer getNumero() {
		return numero;
	}

	@Override
	public String toString() {
		return numero.toString();
	}

}


text:
//
//  LeftViewController.m
//  PeopleOnline
//
//  Created by yangming on 16/5/24.
//  Copyright © 2016年 com.PeopleOnline. All rights reserved.
//

#import "LeftViewController.h"
#import "LeftView.h"
#import "UpdateViewController.h"

@interface LeftViewController ()

@property(nonatomic,weak)LeftView *leftView;

@end

@implementation LeftViewController

#pragma mark - 加载视图

- (void)loadView{

    LeftView *leftView = [[LeftView alloc]initWithFrame:[UIScreen mainScreen].bounds];
    self.view = leftView;
    _leftView = leftView;
}

#pragma mark - 视图加载完成

- (void)viewDidLoad {
    [super viewDidLoad];

    [_leftView.loginButton addTarget:self action:@selector(leftLoginButtonAction:) forControlEvents:UIControlEventTouchUpInside];

    [_leftView.perButton addTarget:self action:@selector(leftPersonAction:) forControlEvents:UIControlEventTouchUpInside];

    [_leftView.jianyiButton addTarget:self action:@selector(leftJianyiAction:) forControlEvents:UIControlEventTouchUpInside];

    [_leftView.upButton addTarget:self action:@selector(leftupiAction:) forControlEvents:UIControlEventTouchUpInside];

    [_leftView.aboutButton addTarget:self action:@selector(leftAboutAction:) forControlEvents:UIControlEventTouchUpInside];
}

/**
 *  登录按钮事件
 *
 *  @param sender 传入的UIButton
 */
-(void)leftLoginButtonAction:(UIButton *)sender{

    LoginViewController *loginVC = [LoginViewController new];
    UINavigationController *loginNC = [[UINavigationController alloc]initWithRootViewController:loginVC];
    //开关左抽屉
//    [self.mm_drawerController toggleDrawerSide:MMDrawerSideLeft animated:YES completion:nil];
    [self presentViewController:loginNC animated:YES completion:^{

    }];

}

#pragma mark - 个人中心

-(void)leftPersonAction:(UIButton *)sender{

    PersonViewController *personVC = [PersonViewController new];

    UINavigationController *perNC = [[UINavigationController alloc]initWithRootViewController:personVC];
    //开关左抽屉
//    [self.mm_drawerController toggleDrawerSide:MMDrawerSideLeft animated:YES completion:nil];
    [self presentViewController:perNC animated:YES completion:^{

    }];

}

#pragma mark - 更新

-(void)leftupiAction:(UIButton *)sender{

    UpdateViewController *upVC = [UpdateViewController new];
    UINavigationController *upNC = [[UINavigationController alloc]initWithRootViewController:upVC];
    [self presentViewController:upNC animated:YES completion:^{

    }];

}

#pragma mark - 建议

-(void)leftJianyiAction:(UIButton *)sender{

    JianYIViewController *jianYIVC = [JianYIViewController new];
    UINavigationController *jianYINC = [[UINavigationController alloc]initWithRootViewController:jianYIVC];
    [self presentViewController:jianYINC animated:YES completion:^{

    }];
}

#pragma mark - 关于

-(void)leftAboutAction:(UIButton *)sender{

    AboutViewController *aboutVC = [AboutViewController new];
    UINavigationController *aboutNC = [[UINavigationController alloc]initWithRootViewController:aboutVC];
    [self presentViewController:aboutNC animated:YES completion:^{

    }];

}

@end


text:
<component name="ProjectRunConfigurationManager">
  <configuration default="false" name="ManiaRuleset (Tests)" type="DotNetProject" factoryName=".NET Project" folderName="Ruleset">
    <option name="EXE_PATH" value="$PROJECT_DIR$/osu.Game.Rulesets.Mania.Tests/bin/Debug/netcoreapp3.0/osu.Game.Rulesets.Mania.Tests.dll" />
    <option name="PROGRAM_PARAMETERS" value="" />
    <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/osu.Game.Rulesets.Mania.Tests" />
    <option name="PASS_PARENT_ENVS" value="1" />
    <option name="USE_EXTERNAL_CONSOLE" value="0" />
    <option name="USE_MONO" value="0" />
    <option name="RUNTIME_ARGUMENTS" value="" />
    <option name="PROJECT_PATH" value="$PROJECT_DIR$/osu.Game.Rulesets.Mania.Tests/osu.Game.Rulesets.Mania.Tests.csproj" />
    <option name="PROJECT_EXE_PATH_TRACKING" value="1" />
    <option name="PROJECT_ARGUMENTS_TRACKING" value="1" />
    <option name="PROJECT_WORKING_DIRECTORY_TRACKING" value="1" />
    <option name="PROJECT_KIND" value="DotNetCore" />
    <option name="PROJECT_TFM" value=".NETCoreApp,Version=v3.0" />
    <browser url="http://localhost:5000" />
    <method v="2">
      <option name="Build" enabled="true" />
    </method>
  </configuration>
</component>


text:
require 'timeout'

class Minitest::Spec
  def self.it(desc = 'anonymous', &block) # :nodoc:
    return super unless block
    super(desc) { Timeout.timeout(2) { self.instance_eval(&block) } }
  end
end


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="horizontal" >

    <ImageView
        android:id="@+id/picture"
        android:layout_width="50dp"
        android:layout_height="50dp"
        android:layout_marginBottom="5dp"
        android:layout_marginLeft="5dp"
        android:layout_marginRight="5dp"
        android:layout_marginTop="5dp" />

    <LinearLayout
        android:orientation="vertical"
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

    <TextView
        android:id="@+id/id"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textSize="18sp"

        android:textColor="#000000"
        android:textAppearance="?attr/textAppearanceListItem" />

        <TextView
            android:id="@+id/status"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textSize="12sp"
            android:textColor="#000000"
            android:textAppearance="?attr/textAppearanceListItem" />

        <!--http://envyandroid.com/cut-off-long-lines-with-ellipsize/-->
    <TextView
        android:id="@+id/content"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textSize="12sp"
        android:textColor="#000000"
        android:ellipsize="end"
        android:maxLines="1"
        android:singleLine="true"
        android:textAppearance="?attr/textAppearanceListItem" />

        <!--http://stackoverflow.com/questions/19115332/android-draw-a-horizontal-line-between-views-->
        <View
            android:layout_width="250dp"
            android:layout_height="2dp"
            android:background="#c0c0c0"/>

    </LinearLayout>
</LinearLayout>


text:
#include "webrtc/modules/video_coding/codecs/test/packet_manipulator.h"

#include <queue>

#include "testing/gtest/include/gtest/gtest.h"
#include "webrtc/modules/video_coding/codecs/interface/video_codec_interface.h"
#include "webrtc/modules/video_coding/codecs/test/predictive_packet_manipulator.h"
#include "webrtc/test/testsupport/unittest_utils.h"
#include "webrtc/typedefs.h"

namespace webrtc {
namespace test {

const double kNeverDropProbability = 0.0;
const double kAlwaysDropProbability = 1.0;
const int kBurstLength = 1;

class PacketManipulatorTest: public PacketRelatedTest {
 protected:
  PacketReader packet_reader_;
  EncodedImage image_;
  NetworkingConfig drop_config_;
  NetworkingConfig no_drop_config_;

  PacketManipulatorTest() {
    image_._buffer = packet_data_;
    image_._length = kPacketDataLength;
    image_._size = kPacketDataLength;

    drop_config_.packet_size_in_bytes = kPacketSizeInBytes;
    drop_config_.packet_loss_probability = kAlwaysDropProbability;
    drop_config_.packet_loss_burst_length = kBurstLength;
    drop_config_.packet_loss_mode = kUniform;

    no_drop_config_.packet_size_in_bytes = kPacketSizeInBytes;
    no_drop_config_.packet_loss_probability = kNeverDropProbability;
    no_drop_config_.packet_loss_burst_length = kBurstLength;
    no_drop_config_.packet_loss_mode = kUniform;
  }

  virtual ~PacketManipulatorTest() {}

  void SetUp() {
    PacketRelatedTest::SetUp();
  }

  void TearDown() {
    PacketRelatedTest::TearDown();
  }

  void VerifyPacketLoss(int expected_nbr_packets_dropped,
                        int actual_nbr_packets_dropped,
                        int expected_packet_data_length,
                        uint8_t* expected_packet_data,
                        EncodedImage& actual_image) {
    EXPECT_EQ(expected_nbr_packets_dropped, actual_nbr_packets_dropped);
    EXPECT_EQ(expected_packet_data_length, static_cast<int>(image_._length));
    EXPECT_EQ(0, memcmp(expected_packet_data, actual_image._buffer,
                        expected_packet_data_length));
  }
};

TEST_F(PacketManipulatorTest, Constructor) {
  PacketManipulatorImpl manipulator(&packet_reader_, no_drop_config_, false);
}

TEST_F(PacketManipulatorTest, DropNone) {
  PacketManipulatorImpl manipulator(&packet_reader_,  no_drop_config_, false);
  int nbr_packets_dropped = manipulator.ManipulatePackets(&image_);
  VerifyPacketLoss(0, nbr_packets_dropped, kPacketDataLength,
                   packet_data_, image_);
}

TEST_F(PacketManipulatorTest, UniformDropNoneSmallFrame) {
  int data_length = 400;  // smaller than the packet size
  image_._length = data_length;
  PacketManipulatorImpl manipulator(&packet_reader_, no_drop_config_, false);
  int nbr_packets_dropped = manipulator.ManipulatePackets(&image_);

  VerifyPacketLoss(0, nbr_packets_dropped, data_length,
                     packet_data_, image_);
}

TEST_F(PacketManipulatorTest, UniformDropAll) {
  PacketManipulatorImpl manipulator(&packet_reader_, drop_config_, false);
  int nbr_packets_dropped = manipulator.ManipulatePackets(&image_);
  VerifyPacketLoss(kPacketDataNumberOfPackets, nbr_packets_dropped,
                   0, packet_data_, image_);
}

// Use our customized test class to make the second packet being lost
TEST_F(PacketManipulatorTest, UniformDropSinglePacket) {
  drop_config_.packet_loss_probability = 0.5;
  PredictivePacketManipulator manipulator(&packet_reader_, drop_config_);
  manipulator.AddRandomResult(1.0);
  manipulator.AddRandomResult(0.3);  // less than 0.5 will cause packet loss
  manipulator.AddRandomResult(1.0);

  // Execute the test target method:
  int nbr_packets_dropped = manipulator.ManipulatePackets(&image_);

  // Since we setup the predictive packet manipulator, it will throw away the
  // second packet. The third packet is also lost because when we have lost one,
  // the remains shall also be discarded (in the current implementation).
  VerifyPacketLoss(2, nbr_packets_dropped, kPacketSizeInBytes, packet1_,
                   image_);
}

// Use our customized test class to make the second packet being lost
TEST_F(PacketManipulatorTest, BurstDropNinePackets) {
  // Create a longer packet data structure (10 packets)
  const int kNbrPackets = 10;
  const int kDataLength = kPacketSizeInBytes * kNbrPackets;
  uint8_t data[kDataLength];
  uint8_t* data_pointer = data;
  // Fill with 0s, 1s and so on to be able to easily verify which were dropped:
  for (int i = 0; i < kNbrPackets; ++i) {
    memset(data_pointer + i * kPacketSizeInBytes, i, kPacketSizeInBytes);
  }
  // Overwrite the defaults from the test fixture:
  image_._buffer = data;
  image_._length = kDataLength;
  image_._size = kDataLength;

  drop_config_.packet_loss_probability = 0.5;
  drop_config_.packet_loss_burst_length = 5;
  drop_config_.packet_loss_mode = kBurst;
  PredictivePacketManipulator manipulator(&packet_reader_, drop_config_);
  manipulator.AddRandomResult(1.0);
  manipulator.AddRandomResult(0.3);  // less than 0.5 will cause packet loss
  for (int i = 0; i < kNbrPackets - 2; ++i) {
    manipulator.AddRandomResult(1.0);
  }

  // Execute the test target method:
  int nbr_packets_dropped = manipulator.ManipulatePackets(&image_);

  // Should discard every packet after the first one.
  VerifyPacketLoss(9, nbr_packets_dropped, kPacketSizeInBytes, data, image_);
}

}  // namespace test
}  // namespace webrtc


text:
class API::V1::UsersController < APIController
  handles :all

  private
    def user_params
      params.fetch(:user, {}).permit!
    end
end


text:
FrameSourceTypes Enumeration
============================

The types frame sources for a MultiSourceReader.

Syntax
======

<colgroup>
<col width="100%" />
</colgroup>

C++

[FlagsAttribute]
public enum class FrameSourceTypes

<colgroup>
<col width="100%" />
</colgroup>

C#

[FlagsAttribute]
public enum FrameSourceTypes

<colgroup>
<col width="100%" />
</colgroup>

JavaScript

var frameSourceTypes = WindowsPreview.Kinect.FrameSourceTypes.audio;

Members
=======

| Member                   | Value | Description                           |
|--------------------------|-------|---------------------------------------|
| **Audio**                | 64    | Audio stream source.                  |
| **Body**                 | 32    | Body stream source.                   |
| **BodyIndex**            | 16    | Body index stream source.             |
| **Color**                | 1     | Color stream source.                  |
| **Depth**                | 8     | Depth stream source.                  |
| **Infrared**             | 2     | Infrared stream source.               |
| **LongExposureInfrared** | 4     | Long exposure infrared stream source. |
| **None**                 | 0     | No source.                            |

Requirements
============

**Namespace:**WindowsPreview.Kinect
**Metadata:**windowspreview.kinect.winmd

See also
========

#### Reference

[WindowsPreview.Kinect Namespace](../Kinect.md)


text:
ApacheServerRequest::ApacheServerRequest(
	ApacheRequestRec* pApacheRequest,
	const char* serverName,
	int serverPort,
	const char* clientName,
	int clientPort):
	_pApacheRequest(pApacheRequest),
    _pResponse(0),
    _pStream(new ApacheInputStream(_pApacheRequest)),
	_serverAddress(serverName, serverPort),
	_clientAddress(clientName, clientPort)
{
}

ApacheServerRequest::~ApacheServerRequest()
{
	delete _pStream;
}

const Poco::Net::HTTPServerParams& ApacheServerRequest::serverParams() const
{
	throw Poco::NotImplementedException("No HTTPServerParams available in Apache modules.");
}

Poco::Net::HTTPServerResponse& ApacheServerRequest::response() const
{
	return *_pResponse;
}

void ApacheServerRequest::setResponse(ApacheServerResponse* pResponse)
{
	_pResponse = pResponse;
}

bool ApacheServerRequest::expectContinue() const
{
	return false;
}


text:
require "test_helper"

class InterestTest < UnitTestCase
  def test_setting_and_getting
    Interest.new(
      user: rolf,
      target: observations(:minimal_unknown_obs),
      state: true
    ).save

    Interest.new(
      user: mary,
      target: observations(:minimal_unknown_obs),
      state: false
    ).save

    Interest.new(
      user: dick,
      target: names(:agaricus_campestris),
      state: true
    ).save
    # assert_equal(2, Interest.find_all_by_target(observations(:minimal_unknown_obs)).length)
    assert_equal(2,
                 Interest.where_target(observations(:minimal_unknown_obs)).length)
    # assert_equal(1, Interest.find_all_by_target(names(:agaricus_campestris)).length)
    assert_equal(1, Interest.where_target(names(:agaricus_campestris)).length)
    # assert_equal(0, Interest.find_all_by_target(names(:coprinus_comatus)).length)
    assert_equal(0, Interest.where_target(names(:coprinus_comatus)).length)

    assert_equal(1, Interest.where(user_id: rolf.id).length)
    assert_equal(1, Interest.where(user_id: mary.id).length)
    assert_equal(1, Interest.where(user_id: dick.id).length)
    assert_equal(0, Interest.where(user_id: katrina.id).length)

    assert_equal(observations(:minimal_unknown_obs), Interest.find_by_user_id(rolf.id).target)
    assert_equal(names(:agaricus_campestris), Interest.find_by_user_id(dick.id).target)
  end
end


text:
/**
  Store information about records that were modified
  on the client (and not committed to server).
 */
DS._PendingUpSyncRecord = DS.Model.extend({
  recordId: DS.attr('string'),
  recordType: DS.attr('string'),
  pendingReason: DS.attr('string')
});


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

namespace Xsolla
{
	public class XsollaSummary : IParseble
	{

		private List<IXsollaSummaryItem> purchases;
		private XsollaFinance finance;

		public  List<IXsollaSummaryItem> GetPurchases ()
		{
			return purchases;
		}

		public  XsollaFinance GetFinance ()
		{
			return finance;
		}

		public IParseble Parse (JSONNode summaryNode)
		{
			purchases = new List<IXsollaSummaryItem> ();
			JSONNode nodeItems = summaryNode ["purchase"] ["virtual_items"];
			JSONNode nodeCurrency = summaryNode ["purchase"] ["virtual_currency"];
			JSONNode nodeSubscriptions = summaryNode ["purchase"] ["subscriptions"];
			if (nodeItems != null) {
				IEnumerator<JSONNode> iEnumerator = nodeItems.Childs.GetEnumerator ();
				while (iEnumerator.MoveNext ()) {
					JSONNode purchaseNode = iEnumerator.Current;
					purchases.Add (new XsollaSummaryItem ().Parse (purchaseNode) as IXsollaSummaryItem);
				}
			}
			if (nodeCurrency != null) {
				IEnumerator<JSONNode> iEnumerator = nodeCurrency.Childs.GetEnumerator ();
				while (iEnumerator.MoveNext ()) {
					JSONNode purchaseNode = iEnumerator.Current;
					purchases.Add (new XsollaSummaryItem ().Parse (purchaseNode) as IXsollaSummaryItem);
				}
			}
			if (nodeSubscriptions != null) {
				IEnumerator<JSONNode> iEnumerator = nodeSubscriptions.Childs.GetEnumerator ();
				while (iEnumerator.MoveNext ()) {
					JSONNode purchaseNode = iEnumerator.Current;
					purchases.Add (new XsollaSummarySubscription ().Parse (purchaseNode) as IXsollaSummaryItem);
				}
			}

			finance = new XsollaFinance ().Parse (summaryNode ["finance"]) as XsollaFinance;
			return this;
		}
	}

	public interface IXsollaSummaryItem
	{
		string GetImgUrl ();
		string GetName ();
		string GetPrice ();
		string GetDescription ();
		string GetBonus ();
	}

	public class XsollaSummaryItem : IParseble, IXsollaSummaryItem
	{
		public float quantity { get; private set; }
		public decimal amount { get; private set; }
		public string currency { get; private set; }
		public string name { get; private set; }
		public string imageUrl { get; set; }
		public string description { get; private set; }
		public string longDescription { get; private set; }
		public bool isBonus { get; private set; }

		public string GetImgUrl ()
		{
			if (imageUrl == null)
				return "";
			if (imageUrl.StartsWith ("https:"))
				return imageUrl;
			else
				return "https:" + imageUrl;
		}

		public string GetName ()
		{
			return quantity + " " + name;
		}

		public string GetPrice ()
		{
			return CurrencyFormatter.Instance.FormatPrice (currency, amount);
		}

		public string GetDescription ()
		{
			return "null".Equals (description) ? "" : description;
		}

		public string GetBonus ()
		{
			return isBonus ? "Bonus" : "";
		}

		public IParseble Parse (JSONNode purchaseNode)
		{
			quantity = purchaseNode ["quantity"].AsFloat;
			amount = purchaseNode ["amount"].AsDecimal;
			currency = purchaseNode ["currency"];
			name = purchaseNode ["name"];
			imageUrl = purchaseNode ["image_url"];
			description = purchaseNode ["description"].Value;
			longDescription = purchaseNode ["longDescription"].Value;
			isBonus = purchaseNode ["is_bonus"].AsBool;
			return this;
		}
	}

	public class XsollaSummarySubscription : IParseble, IXsollaSummaryItem
	{
		public decimal amount{ get; private set; }
		public int period{ get; private set; }
		public string currency{ get; private set; }
		public string description{ get; private set; }
		public string package_info{ get; private set; }
		public string period_type{ get; private set; }
		public string expiration_period_type{ get; private set; }
		public string recurrent_type{ get; private set; }
		public string date_next_charge{ get; private set; }
		public string amount_next_charge{ get; private set; }
		public string currency_next_charge{ get; private set; }

		public string GetImgUrl ()
		{
			return "";
		}

		public string GetName ()
		{
			return period + " " + period_type + " " + description;
		}

		public string GetPrice ()
		{
			return CurrencyFormatter.Instance.FormatPrice (currency, amount);
		}

		public string GetDescription ()
		{
			return date_next_charge;
		}

		public string GetBonus ()
		{
			return "";
		}

		public IParseble Parse (JSONNode purchaseNode)
		{
			amount = purchaseNode ["amount"].AsDecimal;
			period = purchaseNode ["period"].AsInt;
			currency = purchaseNode ["currency"];
			description = purchaseNode ["description"];
			package_info = purchaseNode ["package_info"];
			period_type = purchaseNode ["period_type"];
			expiration_period_type = purchaseNode ["expiration_period_type"];
			recurrent_type = purchaseNode ["recurrent_type"];
			date_next_charge = purchaseNode ["date_next_charge"];
			amount_next_charge = purchaseNode ["amount_next_charge"];
			currency_next_charge = purchaseNode ["currency_next_charge"];
			return this;
		}

	}

	public class XsollaFinance : IParseble
	{
		/*
		 *
			discount:{amount: 0, currency: "USD"}
			fee:{amount: 0.03, currency: "USD"}
			sales_tax:{amount: 0, percent: 0, currency: "USD"}
			sub_total:{amount: 1, currency: "USD", payment_amount: 1, payment_currency: "USD"}
			total:{amount: 1.21, currency: "USD"}
			user_balance:{amount: 0, currency: "USD"}
			vat:{amount: 0.18, percent: 18, currency: "USD"}
			vat_user:{amount: 0.18, percent: 18, currency: "USD"}
		 * */

		public FinanceItemBase discount { get; private set; }
		public FinanceItemBase fee { get; private set; }
		public FinanceItemPerc salesTax { get; private set; }
		public FinanceItem subTotal { get; private set; }
		public FinanceItemBase total { get; private set; }
		public FinanceItem userBalance { get; private set; }
		public FinanceItemPerc vat { get; private set; }
		public FinanceItemPerc vat_user { get; private set; }
		public FinanceItem xsollaCredits { get; private set; }

		public IParseble Parse (JSONNode financyNode)
		{
			if (financyNode ["sub_total"] != null)
				subTotal = new FinanceItem ().Parse (financyNode ["sub_total"]) as FinanceItem;
			if (financyNode ["discount"] != null)
				discount = new FinanceItemBase ().Parse (financyNode ["discount"]) as FinanceItemBase;
			if (financyNode ["fee"] != null)
				fee = new FinanceItemBase ().Parse (financyNode ["fee"]) as FinanceItemBase;
			if (financyNode ["xsolla_credits"] != null)
				xsollaCredits = new FinanceItem ().Parse (financyNode ["xsolla_credits"]) as FinanceItem;
			if (financyNode ["total"] != null)
				total = new FinanceItemBase ().Parse (financyNode ["total"]) as FinanceItemBase;
			if (financyNode ["vat"] != null)
				vat = new FinanceItemPerc ().Parse (financyNode ["vat"]) as FinanceItemPerc;
			if (financyNode ["sales_tax"] != null)
				salesTax = new FinanceItemPerc().Parse(financyNode ["sales_tax"]) as FinanceItemPerc;

			return this;
		}

		public class FinanceItemPerc : FinanceItemBase
		{
			public decimal perciant { get; private set;}

			public FinanceItemPerc ()
			{
			}

			public FinanceItemPerc(decimal newAmount, string newCurrency, decimal perc): base (newAmount, newCurrency)
			{
				perciant = perc;
			}

			public new IParseble Parse (JSONNode financeItemNode)
			{
				base.Parse (financeItemNode);
				perciant = financeItemNode ["percent"].AsDecimal;
				return this;
			}
		}

		public class FinanceItemBase : IParseble
		{
			public decimal amount { get; private set; }
			public string currency { get; private set; }

			public FinanceItemBase ()
			{
			}

			public FinanceItemBase (decimal newAmount, string newCurrency) : this ()
			{
				amount = newAmount;
				currency = newCurrency;
			}

			public IParseble Parse (JSONNode baseFinanceItemNode)
			{
				amount = baseFinanceItemNode ["amount"].AsDecimal;
				currency = baseFinanceItemNode ["currency"];
				return this;
			}
		}

		public class FinanceItem : FinanceItemBase
		{
			public decimal paymentAmount { get; private set; }
			public string paymentCurrency { get; private set; }

			public FinanceItem ()
			{
			}

			public FinanceItem (decimal newAmount, string newCurrency, decimal newPaymentAmount, string newPaymentCurrency) : base (newAmount, newCurrency)
			{
				paymentAmount = newPaymentAmount;
				paymentCurrency = newPaymentCurrency;
			}

			public new IParseble Parse (JSONNode financeItemNode)
			{
				base.Parse (financeItemNode);
				paymentAmount = financeItemNode ["payment_amount"].AsDecimal;
				paymentCurrency = financeItemNode ["payment_currency"];
				return this;
			}
		}

	}

}


text:
package be.howest.twentytwo.parametergame.model;

import be.howest.twentytwo.parametergame.model.component.BodyComponent;

import com.badlogic.ashley.core.Entity;
import com.badlogic.ashley.core.EntityListener;
import com.badlogic.ashley.core.Family;
import com.badlogic.gdx.physics.box2d.World;

public class PhysicsBodyEntityListener implements EntityListener {

	private World world;
	private Family fam;

	public PhysicsBodyEntityListener(World world) {
		this.world = world;
		fam = Family.all(BodyComponent.class).get();
	}

	@Override
	public void entityAdded(Entity entity) {
		// Gdx.app.debug("EntityListener", "Entity added: " + entity);
	}

	@Override
	public void entityRemoved(Entity entity) {
		if(fam.matches(entity)){
			// Gdx.app.debug("BodyEntityListener", "Entity removed: " + entity);
			world.destroyBody(BodyComponent.MAPPER.get(entity).getBody()); // Remove body from world
		}
	}

}


text:
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.

#pragma once

#include "ModuleManager.h"

/**
 * The public interface to this module.  In most cases, this interface is only public to sibling modules
 * within this plugin.
 */
class ILiveEditor : public IModuleInterface
{

public:

	/**
	 * Singleton-like access to this module's interface.  This is just for convenience!
	 * Beware of calling this during the shutdown phase, though.  Your module might have been unloaded already.
	 *
	 * @return Returns singleton instance, loading the module on demand if needed
	 */
	static inline ILiveEditor& Get()
	{
		return FModuleManager::LoadModuleChecked< ILiveEditor >( "LiveEditor" );
	}

	/**
	 * Checks to see if this module is loaded and ready.  It is only valid to call Get() if IsAvailable() returns true.
	 *
	 * @return True if the module is loaded and ready to use
	 */
	static inline bool IsAvailable()
	{
		return FModuleManager::Get().IsModuleLoaded( "LiveEditor" );
	}
};


text:
@class REDBookCategoryCell;

@protocol REDBookCategoryCellDelegate <NSObject>

-(void)didSelectCategoryCell:(REDBookCategoryCell *)cell;

@end

@interface REDBookCategoryCell : UITableViewCell

<REDBookCreationChainProtocol>

#pragma mark - properties
@property (nonatomic,strong) id<REDCategoryProtocol> category;
@property (nonatomic,weak) id<REDBookCategoryCellDelegate> delegate;

@end


text:
#include <boost/type_erasure/any.hpp>
#include <boost/type_erasure/builtin.hpp>
#include <boost/mpl/vector.hpp>

using namespace boost::type_erasure;

int main()
{
    const any<boost::mpl::vector<copy_constructible<>, typeid_<> > > x(1);
    any<copy_constructible<>, _self&> y(x);
}


text: void printStackTrace();


text:
<?php namespace Fisharebest\Localization\Locale;

use Fisharebest\Localization\Language\LanguageGa;

class LocaleGa extends AbstractLocale implements LocaleInterface {
	public function endonym() {
		return 'Gaeilge';
	}

	public function endonymSortable() {
		return 'GAEILGE';
	}

	public function language() {
		return new LanguageGa;
	}
}


text:
const unsigned int screenWidth = 800;
const unsigned int screenHeight = 600;

struct Vertex
{
    glm::vec3 position;
    glm::vec2 uvCoords;
};

int main()
{
    //Initialize SDL2 with video and event modes enabled,
    //and request an OpenGL 3.3 Core Profile
    SDL_Init(SDL_INIT_VIDEO | SDL_INIT_EVENTS);
    SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE);
    SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 3);
    SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 3);
    SDL_SetRelativeMouseMode(SDL_TRUE);

    SDL_Window* window = SDL_CreateWindow(
        "ogldev.atspace.co.uk Tutorial 16 -- Basic Texture Mapping",
        SDL_WINDOWPOS_CENTERED,
        SDL_WINDOWPOS_CENTERED,
        screenWidth,
        screenHeight,
        SDL_WINDOW_OPENGL
    );

    //Create the OpenGL context before trying to initialize OpenGL API functions
    SDL_GLContext context = SDL_GL_CreateContext(window);

    //Initialize OpenGL API functions, exit if we couldn't load the core functions
    if (gl3wInit()) {
        std::cout << "gl3w failed to initialize OpenGL" << std::endl;
        return EXIT_FAILURE;
    }

    Vertex vertices[] = {
        {glm::vec3(-1.0f, -1.0f, 0.0f), glm::vec2(0.0f, 0.0f)},
        {glm::vec3(0.0f, -1.0f, 1.0f), glm::vec2(0.5f, 0.0f)},
        {glm::vec3(1.0f, -1.0f, 0.0f), glm::vec2(1.0f, 0.0f)},
        {glm::vec3(0.0f, 1.0f, 0.0f), glm::vec2(0.5f, 1.0f)}
    };

    //Allocate a buffer for our vertices
    GLuint VBO;
    glGenBuffers(1, &VBO);
    glBindBuffer(GL_ARRAY_BUFFER, VBO);
    glBufferData(GL_ARRAY_BUFFER, sizeof(vertices), vertices, GL_STATIC_DRAW);
    glBindBuffer(GL_ARRAY_BUFFER, 0);

    //Note: the order of indices for each vertex matters. They are used to determine the "facing" of the traingle.
    //These are specified properly in clockwise order, but mix it up and you'll get faces culled
    //because of the backface culling operation
    std::vector<GLuint> indices = {
        0, 3, 1,
        1, 3, 2,
        2, 3, 0,
        0, 1, 2
    };

    //Create an index buffer to share vertices among triangles
    GLuint IBO;
    glGenBuffers(1, &IBO);
    glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, IBO);
    glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(indices[0]) * indices.size(), indices.data(), GL_STATIC_DRAW);
    glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);

    std::string vertexShaderPath = "../src/shaders/passthrough.vsh";
    std::string fragmentShaderPath = "../src/shaders/passthrough.fsh";
    std::vector<uint8_t> vertexShaderSource;
    std::vector<uint8_t> geometryShaderSource;
    std::vector<uint8_t> fragmentShaderSource;

    if (!Utilities::File::getFileContents(vertexShaderSource, vertexShaderPath)) {
        std::cout << "Failed to load " + vertexShaderPath << std::endl;
    }

    if (!Utilities::File::getFileContents(fragmentShaderSource, fragmentShaderPath)) {
        std::cout << "Failed to load " + fragmentShaderPath << std::endl;
    }

    Material basicPassthroughMaterial(vertexShaderSource, geometryShaderSource, fragmentShaderSource);

    //Sit around for a while until user input
    SDL_Event event;
    bool userRequestedExit = false;

    glEnable(GL_DEPTH_TEST);
    glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
    glFrontFace(GL_CW);
    glCullFace(GL_BACK);
    glEnable(GL_CULL_FACE);

    float scale = 0.0f;

    glm::mat4 worldMatrix;
    glm::mat4 scaleMatrix = glm::scale(glm::mat4(), glm::vec3(.5, .5, .5));
    glm::mat4 rotationMatrix = glm::rotate(glm::mat4(), (float)(2 * Utilities::Math::PI * (60.0 / 360)), glm::vec3(-1, 0, 0));
    glm::mat4 translationMatrix;
    glm::mat4 perspectiveProjection = glm::perspective(
        (GLfloat)Utilities::Math::degreesToRadians(60.0),
        ((GLfloat)screenWidth / (GLfloat)screenHeight),
        0.1f,
        100.0f
    );

    Controls playerControls;
    Camera playerCamera(
        glm::lookAt(
            glm::vec3(0, 0, 0), //position
            glm::vec3(0, 0, -1), //looking towards this direction
            glm::vec3(0, 1, 0) //up vector
        )
    );
    glm::mat4 viewMatrix = playerCamera.getViewMatrix();

    glm::mat4 WVPMatrix;

    //Get handle to WVP uniform in the shader program
    basicPassthroughMaterial.addUniformAttribute("WVPMatrix");
    auto WVPMatrixHandle = basicPassthroughMaterial.getUniformAttribute("WVPMatrix");

    //Initialize glVertexAttribPointers while VBO is bound
    glBindBuffer(GL_ARRAY_BUFFER, VBO);

    basicPassthroughMaterial.addAttribute("position");
    basicPassthroughMaterial.setGLVertexAttribPointer("position", 3, GL_FLOAT, GL_FALSE, sizeof(Vertex), 0);
    basicPassthroughMaterial.addAttribute("texCoord");
    basicPassthroughMaterial.setGLVertexAttribPointer("texCoord", 2, GL_FLOAT, GL_FALSE, sizeof(Vertex), (GLvoid *)sizeof(glm::vec3));
    glBindBuffer(GL_ARRAY_BUFFER, 0);

    //Set the sampler uniform for the fragment shader that we're going to use.
    //Note: technically unnecessary since we're only using 1 texture unit,
    //but good to be explicitly correct when possible
    basicPassthroughMaterial.addUniformAttribute("sampler");
    glUniform1i(basicPassthroughMaterial.getUniformAttribute("sampler"), 0);

    //Load the texture for our basic pyramid object
    std::vector<uint8_t> rawImageData;
    bool loadedImageFile = Utilities::File::getFileContents(rawImageData, "../test.png");

    if (!loadedImageFile) {
        std::cout << "Failed to load the texture image";
        return EXIT_FAILURE;
    }

    Texture pyramidTexture;
    pyramidTexture.load(GL_TEXTURE_2D, rawImageData, TextureFormat::PNG);
    pyramidTexture.setTextureParams(
        GL_REPEAT,
        GL_REPEAT,
        GL_LINEAR,
        GL_LINEAR,
        false
    );
    pyramidTexture.bind(GL_TEXTURE0);

    while (userRequestedExit == false)
    {
        while (SDL_PollEvent(&event)) {
            if (event.type == SDL_QUIT || (event.type == SDL_KEYDOWN && event.key.keysym.sym == SDLK_ESCAPE))
            {
                userRequestedExit = true;
            }

        }

        scale += 0.002f;

        playerControls.update();
        playerCamera.update(playerControls);
        rotationMatrix = glm::rotate(rotationMatrix, (float)(2 * Utilities::Math::PI * (2.0/360)), glm::vec3(0, 1, 0));
        translationMatrix = glm::translate(glm::mat4(), glm::vec3(sinf(scale * 2), 0, -3));

        worldMatrix = translationMatrix * rotationMatrix * scaleMatrix;

        viewMatrix = playerCamera.getViewMatrix();
        WVPMatrix = perspectiveProjection * viewMatrix * worldMatrix;

        basicPassthroughMaterial.bind();

        glUniformMatrix4fv(WVPMatrixHandle, 1, GL_FALSE, &WVPMatrix[0][0]);
        glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
        glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, IBO);
        glDrawElements(GL_TRIANGLES, 12, GL_UNSIGNED_INT, 0);
        basicPassthroughMaterial.unbind();
        glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);

        SDL_GL_SwapWindow(window);
    }

    //Shutdown SDL2 before exiting the program
    SDL_GL_DeleteContext(context);
    SDL_DestroyWindow(window);
    SDL_Quit();

    return EXIT_SUCCESS;
}