text:
package koopa.grammars.cobol.test;

import junit.framework.TestCase;
import koopa.parsers.Parser;
import koopa.tokenizers.cobol.SourceFormat;
import koopa.tokenizers.cobol.TestTokenizer;

import org.junit.Test;

/** This code was generated from SortStatement.stage. */
public class SortStatementTest extends TestCase {

  private static koopa.grammars.cobol.CobolGrammar grammar = new koopa.grammars.cobol.CobolGrammar();

    @Test
    public void testSortStatement_1() {
      Parser parser = grammar.sortStatement();
      assertNotNull(parser);
      TestTokenizer tokenizer = new TestTokenizer(SourceFormat.FREE, " SORT foo ON ASCENDING bar\n     INPUT PROCEDURE p1\n     OUTPUT PROCEDURE p2 ");
      assertTrue(parser.accepts(tokenizer));
      assertTrue(tokenizer.isWhereExpected());
    }

    @Test
    public void testSortStatement_2() {
      Parser parser = grammar.sortStatement();
      assertNotNull(parser);
      TestTokenizer tokenizer = new TestTokenizer(SourceFormat.FREE, " SORT foo ON DESCENDING bar\n     INPUT PROCEDURE p1\n     OUTPUT PROCEDURE p2 ");
      assertTrue(parser.accepts(tokenizer));
      assertTrue(tokenizer.isWhereExpected());
    }

    @Test
    public void testSortStatement_3() {
      Parser parser = grammar.sortStatement();
      assertNotNull(parser);
      TestTokenizer tokenizer = new TestTokenizer(SourceFormat.FREE, " SORT foo ON ASCENDING KEY bar\n     INPUT PROCEDURE p1\n     OUTPUT PROCEDURE p2 ");
      assertTrue(parser.accepts(tokenizer));
      assertTrue(tokenizer.isWhereExpected());
    }

    @Test
    public void testSortStatement_4() {
      Parser parser = grammar.sortStatement();
      assertNotNull(parser);
      TestTokenizer tokenizer = new TestTokenizer(SourceFormat.FREE, " SORT foo ON ASCENDING KEY IS bar\n     INPUT PROCEDURE p1\n     OUTPUT PROCEDURE p2 ");
      assertTrue(parser.accepts(tokenizer));
      assertTrue(tokenizer.isWhereExpected());
    }

    @Test
    public void testSortStatement_5() {
      Parser parser = grammar.sortStatement();
      assertNotNull(parser);
      TestTokenizer tokenizer = new TestTokenizer(SourceFormat.FREE, " SORT foo ON ASCENDING KEY bar baz\n     INPUT PROCEDURE p1\n     OUTPUT PROCEDURE p2 ");
      assertTrue(parser.accepts(tokenizer));
      assertTrue(tokenizer.isWhereExpected());
    }

    @Test
    public void testSortStatement_6() {
      Parser parser = grammar.sortStatement();
      assertNotNull(parser);
      TestTokenizer tokenizer = new TestTokenizer(SourceFormat.FREE, " SORT foo ON ASCENDING KEY IS bar\n     DUPLICATES\n     INPUT PROCEDURE p1\n     OUTPUT PROCEDURE p2 ");
      assertTrue(parser.accepts(tokenizer));
      assertTrue(tokenizer.isWhereExpected());
    }

    @Test
    public void testSortStatement_7() {
      Parser parser = grammar.sortStatement();
      assertNotNull(parser);
      TestTokenizer tokenizer = new TestTokenizer(SourceFormat.FREE, " SORT foo ON ASCENDING KEY IS bar\n     WITH DUPLICATES\n     INPUT PROCEDURE p1\n     OUTPUT PROCEDURE p2 ");
      assertTrue(parser.accepts(tokenizer));
      assertTrue(tokenizer.isWhereExpected());
    }

    @Test
    public void testSortStatement_8() {
      Parser parser = grammar.sortStatement();
      assertNotNull(parser);
      TestTokenizer tokenizer = new TestTokenizer(SourceFormat.FREE, " SORT foo ON ASCENDING KEY IS bar\n     WITH DUPLICATES IN ORDER\n     INPUT PROCEDURE p1\n     OUTPUT PROCEDURE p2 ");
      assertTrue(parser.accepts(tokenizer));
      assertTrue(tokenizer.isWhereExpected());
    }

    @Test
    public void testSortStatement_9() {
      Parser parser = grammar.sortStatement();
      assertNotNull(parser);
      TestTokenizer tokenizer = new TestTokenizer(SourceFormat.FREE, " SORT foo ON ASCENDING KEY IS bar\n     WITH DUPLICATES IN ORDER\n     INPUT PROCEDURE p1\n     OUTPUT PROCEDURE p2 ");
      assertTrue(parser.accepts(tokenizer));
      assertTrue(tokenizer.isWhereExpected());
    }

    @Test
    public void testSortStatement_10() {
      Parser parser = grammar.sortStatement();
      assertNotNull(parser);
      TestTokenizer tokenizer = new TestTokenizer(SourceFormat.FREE, " SORT foo ON ASCENDING KEY IS bar\n     SEQUENCE abc\n     INPUT PROCEDURE p1\n     OUTPUT PROCEDURE p2 ");
      assertTrue(parser.accepts(tokenizer));
      assertTrue(tokenizer.isWhereExpected());
    }

    @Test
    public void testSortStatement_11() {
      Parser parser = grammar.sortStatement();
      assertNotNull(parser);
      TestTokenizer tokenizer = new TestTokenizer(SourceFormat.FREE, " SORT foo ON ASCENDING KEY IS bar\n     COLLATING SEQUENCE abc\n     INPUT PROCEDURE p1\n     OUTPUT PROCEDURE p2 ");
      assertTrue(parser.accepts(tokenizer));
      assertTrue(tokenizer.isWhereExpected());
    }

    @Test
    public void testSortStatement_12() {
      Parser parser = grammar.sortStatement();
      assertNotNull(parser);
      TestTokenizer tokenizer = new TestTokenizer(SourceFormat.FREE, " SORT foo ON ASCENDING KEY IS bar\n     COLLATING SEQUENCE IS abc\n     INPUT PROCEDURE p1\n     OUTPUT PROCEDURE p2 ");
      assertTrue(parser.accepts(tokenizer));
      assertTrue(tokenizer.isWhereExpected());
    }

    @Test
    public void testSortStatement_13() {
      Parser parser = grammar.sortStatement();
      assertNotNull(parser);
      TestTokenizer tokenizer = new TestTokenizer(SourceFormat.FREE, " SORT foo ON ASCENDING KEY IS bar\n     INPUT PROCEDURE p1 THROUGH p3\n     OUTPUT PROCEDURE p2 THROUGH p4 ");
      assertTrue(parser.accepts(tokenizer));
      assertTrue(tokenizer.isWhereExpected());
    }

    @Test
    public void testSortStatement_14() {
      Parser parser = grammar.sortStatement();
      assertNotNull(parser);
      TestTokenizer tokenizer = new TestTokenizer(SourceFormat.FREE, " SORT foo ON ASCENDING KEY IS bar\n     INPUT PROCEDURE p1 THRU p3\n     OUTPUT PROCEDURE p2 THRU p4 ");
      assertTrue(parser.accepts(tokenizer));
      assertTrue(tokenizer.isWhereExpected());
    }

    @Test
    public void testSortStatement_15() {
      Parser parser = grammar.sortStatement();
      assertNotNull(parser);
      TestTokenizer tokenizer = new TestTokenizer(SourceFormat.FREE, " SORT foo ON ASCENDING KEY IS bar\n     USING f1\n     OUTPUT PROCEDURE p2 ");
      assertTrue(parser.accepts(tokenizer));
      assertTrue(tokenizer.isWhereExpected());
    }

    @Test
    public void testSortStatement_16() {
      Parser parser = grammar.sortStatement();
      assertNotNull(parser);
      TestTokenizer tokenizer = new TestTokenizer(SourceFormat.FREE, " SORT foo ON ASCENDING KEY IS bar\n     INPUT PROCEDURE p1\n     GIVING f1 ");
      assertTrue(parser.accepts(tokenizer));
      assertTrue(tokenizer.isWhereExpected());
    }

    @Test
    public void testSortStatement_17() {
      Parser parser = grammar.sortStatement();
      assertNotNull(parser);
      TestTokenizer tokenizer = new TestTokenizer(SourceFormat.FREE, " SORT foo ON ASCENDING KEY IS bar\n     USING f1\n     GIVING f2 ");
      assertTrue(parser.accepts(tokenizer));
      assertTrue(tokenizer.isWhereExpected());
    }

    @Test
    public void testSortStatement_18() {
      Parser parser = grammar.sortStatement();
      assertNotNull(parser);
      TestTokenizer tokenizer = new TestTokenizer(SourceFormat.FREE, " SORT foo ON ASCENDING KEY IS bar\n     USING f1 f2\n     GIVING f3 ");
      assertTrue(parser.accepts(tokenizer));
      assertTrue(tokenizer.isWhereExpected());
    }

    @Test
    public void testSortStatement_19() {
      Parser parser = grammar.sortStatement();
      assertNotNull(parser);
      TestTokenizer tokenizer = new TestTokenizer(SourceFormat.FREE, " SORT foo ON ASCENDING KEY IS bar\n     USING f1 f2\n     GIVING f3 f4 ");
      assertTrue(parser.accepts(tokenizer));
      assertTrue(tokenizer.isWhereExpected());
    }

    @Test
    public void testSortStatement_20() {
      Parser parser = grammar.sortStatement();
      assertNotNull(parser);
      TestTokenizer tokenizer = new TestTokenizer(SourceFormat.FREE, " SORT foo ON ASCENDING bar DESCENDING baz ");
      assertTrue(parser.accepts(tokenizer));
      assertTrue(tokenizer.isWhereExpected());
    }

    @Test
    public void testSortStatement_21() {
      Parser parser = grammar.sortStatement();
      assertNotNull(parser);
      TestTokenizer tokenizer = new TestTokenizer(SourceFormat.FREE, " SORT foo ON DESCENDING KEY bar DESCENDING KEY baz ");
      assertTrue(parser.accepts(tokenizer));
      assertTrue(tokenizer.isWhereExpected());
    }

    @Test
    public void testSortStatement_22() {
      Parser parser = grammar.sortStatement();
      assertNotNull(parser);
      TestTokenizer tokenizer = new TestTokenizer(SourceFormat.FREE, " SORT foo ON DESCENDING KEY IS bar DESCENDING KEY IS baz ");
      assertTrue(parser.accepts(tokenizer));
      assertTrue(tokenizer.isWhereExpected());
    }

    @Test
    public void testSortStatement_23() {
      Parser parser = grammar.sortStatement();
      assertNotNull(parser);
      TestTokenizer tokenizer = new TestTokenizer(SourceFormat.FREE, " SORT foo ON DESCENDING KEY IS bar\n     WITH DUPLICATES IN ORDER ");
      assertTrue(parser.accepts(tokenizer));
      assertTrue(tokenizer.isWhereExpected());
    }

    @Test
    public void testSortStatement_24() {
      Parser parser = grammar.sortStatement();
      assertNotNull(parser);
      TestTokenizer tokenizer = new TestTokenizer(SourceFormat.FREE, " SORT foo ON DESCENDING KEY IS bar\n     WITH DUPLICATES IN ORDER\n     COLLATING SEQUENCE IS abc ");
      assertTrue(parser.accepts(tokenizer));
      assertTrue(tokenizer.isWhereExpected());
    }

    @Test
    public void testSortStatement_25() {
      Parser parser = grammar.sortStatement();
      assertNotNull(parser);
      TestTokenizer tokenizer = new TestTokenizer(SourceFormat.FREE, " SORT ST-FS1\n     ON ASCENDING KEY A-KEY OF SORT-KEY\n     ASCENDING N-KEY OF NON-KEY-2\n     USING SQ-FS1\n     GIVING SQ-FS2 ");
      assertTrue(parser.accepts(tokenizer));
      assertTrue(tokenizer.isWhereExpected());
    }

    @Test
    public void testSortStatement_26() {
      Parser parser = grammar.sortStatement();
      assertNotNull(parser);
      TestTokenizer tokenizer = new TestTokenizer(SourceFormat.FREE, " SORT SORT1\n     ON DESCENDING KEY S1-1\n     ON ASCENDING KEY S1-2\n     USING FILE1\n     GIVING FILE2 ");
      assertTrue(parser.accepts(tokenizer));
      assertTrue(tokenizer.isWhereExpected());
    }
}


text:
var mongoose = require('mongoose');

var gameListSchema = new mongoose.Schema({
  title: {type: String, required: true},
  link: {type: String, required: false}
});

var GameList = mongoose.model('GameList', gameListSchema);
module.exports = GameList;

redpajama_set_name: RedPajamaGithub


text:
package org.qcri.rheem.core.plan.rheemplan;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.Arrays;
import java.util.Collection;
import java.util.HashSet;
import java.util.Set;
import java.util.function.Predicate;
import java.util.stream.Collectors;
import java.util.stream.Stream;

/**
 * Traverse a plan. In each instance, every operator will be traversed only once.
 */
public class PlanTraversal {

    private static final Logger logger = LoggerFactory.getLogger(PlanTraversal.class);

    public Set<Operator> visitedRelevantOperators = new HashSet<>(), visitedIrrelevantOperators = new HashSet<>();

    private final boolean isFollowInputs;

    private final boolean isFollowOutputs;

    /**
     * Whether to visit the {@link Operator}s contained in {@link CompositeOperator}s.
     */
    private Predicate<OperatorContainer> containerEnterCondition = container -> false;

    /**
     * If a {@link CompositeOperator} has been entered as permitted by {@link #containerEnterCondition}, then this
     * field tells whether {@link CompositeOperator}s should still be treated like {@link ElementaryOperator}s,
     * e.g., w.rt. the {@link #traversalCallback}.
     */
    private Predicate<CompositeOperator> compositeRelevanceCondition = compositeOperator -> false;

    private Callback traversalCallback = null;

    private Predicate<OutputSlot<?>> outputFollowPredicate = outputSlot -> true;

    private Predicate<InputSlot<?>> inputFollowPredicate = inputSlot -> true;

    private Predicate<InputSlot<?>> inputFollowDownstreamPredicate = inputSlot -> true;

    @Deprecated
    public PlanTraversal(boolean isFollowInputs, boolean isFollowOutputs) {
        this.isFollowInputs = isFollowInputs;
        this.isFollowOutputs = isFollowOutputs;
    }

    /**
     * @return new instance that follows any reachable {@link Operator}
     */
    public static PlanTraversal fanOut() {
        return new PlanTraversal(true, true);
    }

    /**
     * @return new instance traverses downstream only (i.e., follows {@link OutputSlot}s only)
     */
    public static PlanTraversal downstream() {
        return new PlanTraversal(false, true);
    }

    /**
     * @return new instance traverses downstream only (i.e., follows {@link OutputSlot}s only)
     */
    public static PlanTraversal upstream() {
        return new PlanTraversal(true, false);
    }

    public PlanTraversal withCallback(Callback traversalCallback) {
        this.traversalCallback = traversalCallback;
        return this;
    }

    public PlanTraversal withCallback(SimpleCallback traversalCallback) {
        this.traversalCallback = (operator, fromInputSlot, fromOutputSlot) -> traversalCallback.traverse(operator);
        return this;
    }

    public PlanTraversal followingInputsIf(Predicate<InputSlot<?>> inputFollowPredicate) {
        this.inputFollowPredicate = inputFollowPredicate;
        return this;
    }

    public PlanTraversal followingInputsDownstreamIf(Predicate<InputSlot<?>> inputFollowPredicate) {
        this.inputFollowDownstreamPredicate = inputFollowPredicate;
        return this;
    }

    public PlanTraversal followingOutputsIf(Predicate<OutputSlot<?>> outputFollowPredicate) {
        this.outputFollowPredicate = outputFollowPredicate;
        return this;
    }

    /**
     * Criterion to control when to visit the {@link Operator}s contained in {@link CompositeOperator}s.
     */
    public PlanTraversal enteringContainersIf(Predicate<OperatorContainer> containerEnterCondition) {
        this.containerEnterCondition = containerEnterCondition;
        return this;
    }

    /**
     * Criterion when to consider an entered {@link CompositeOperator} as normal {@link Operator} as well.
     */
    public PlanTraversal consideringEnteredOperatorsIf(Predicate<CompositeOperator> compositeRelevanceCondition) {
        this.compositeRelevanceCondition = compositeRelevanceCondition;
        return this;
    }

    /**
     * If this method is invoked, this instance will not treat {@link Subplan}s and {@link OperatorAlternative}s as
     * normal traversed {@link Operator}s but will rather enter them and traverse their contained {@link Operator}s.
     *
     * @return this instance
     */
    public PlanTraversal traversingHierarchically() {
        return this.enteringContainersIf(operatorContainer -> true).consideringEnteredOperatorsIf(op -> false);
    }

    /**
     * If this method is invoked, this instance will not enter {@link CompositeOperator}s and instead treat
     * them just the same as {@link ElementaryOperator}s. This is the default.
     *
     * @return this instance
     */
    public PlanTraversal traversingFlat() {
        return this.enteringContainersIf(operatorContainer -> false);
    }

    /**
     * Traversing as with {@link #traverse(Operator, InputSlot, OutputSlot)} for every operator.
     */
    public PlanTraversal traverse(Collection<? extends Operator> operators) {
        operators.forEach(this::traverse);
        return this;
    }

    /**
     * Traversing as with {@link #traverse(Operator, InputSlot, OutputSlot)} for every operator.
     */
    public PlanTraversal traverse(Stream<? extends Operator> operators) {
        operators.forEach(this::traverse);
        return this;
    }

    /**
     * Traverse the plan by following any connected operators.
     *
     * @param operator the start point of the traversal
     * @return this instance
     */
    public PlanTraversal traverse(Operator operator) {
        return this.traverse(operator, null, null);
    }

    /**
     * Traverses a plan in a focused manner.
     *
     * @param operator     from that the traversal should be started (will not be traversed itself)
     * @param focusedSlots {@link OutputSlot}s of the {@code operator} that should be followed
     * @return this instance
     */
    public PlanTraversal traverseFocused(Operator operator, Collection<OutputSlot<?>> focusedSlots) {
        this.visitedRelevantOperators.add(operator);
        assert focusedSlots.stream().allMatch(slot -> slot.getOwner() == operator);
        this.followOutputs(focusedSlots.stream());
        return this;
    }

    /**
     * Traverses a plan.
     *
     * @param operator       from that the traversal should be started
     * @param fromInputSlot  {@link InputSlot} of the {@code operator} that has been followed
     * @param fromOutputSlot {@link OutputSlot} of the {@code operator} that has been followed
     * @return this instance
     */
    public PlanTraversal traverse(Operator operator, InputSlot<?> fromInputSlot, OutputSlot<?> fromOutputSlot) {
        // Visit the operator.
        boolean isUnseenOperator = this.visit(operator, fromInputSlot, fromOutputSlot);

        // If it has not been seen yet, continue the traversal.
        if (isUnseenOperator) {
            if (this.isFollowInputs) this.followInputs(operator);
            if (this.isFollowOutputs) this.followOutputs(operator);
        }

        return this;
    }

    /**
     * Visit the given {@link Operator}: Route to contained {@link Operator}s if possible; note the existence of
     * the {@link Operator} and whether it has been seen already; do the callback if requested.
     *
     * @param operator       from that the traversal should be started
     * @param fromInputSlot  {@link InputSlot} of the {@code operator} that has been followed
     * @param fromOutputSlot {@link OutputSlot} of the {@code operator} that has been followed
     * @return whether the {@code operator} has not been seen yet
     */
    private boolean visit(Operator operator, InputSlot<?> fromInputSlot, OutputSlot<?> fromOutputSlot) {
        // Try to do a hierarchical traversal.
        // Important: Don't add hierarchical Operators to the #visitedRelevantOperators, otherwise we might not traverse
        // them completely (e.g., by not entering via all InputSlots).
        boolean isOperatorEntered = false;
        if (!operator.isElementary()) {
            for (OperatorContainer operatorContainer : ((CompositeOperator) operator).getContainers()) {
                if (this.containerEnterCondition.test(operatorContainer)) {
                    this.enter(operatorContainer, fromInputSlot, fromOutputSlot);
                    isOperatorEntered = true;
                }
            }
        }
        boolean isRelevantOperator = !isOperatorEntered || this.compositeRelevanceCondition.test((CompositeOperator) operator);
        final Set<Operator> visitedOperators = isRelevantOperator ? this.visitedRelevantOperators : this.visitedIrrelevantOperators;
        final boolean isUnseenOperator = visitedOperators.add(operator);
        if (isUnseenOperator && isRelevantOperator && this.traversalCallback != null) {
            this.traversalCallback.traverse(operator, fromInputSlot, fromOutputSlot);
        }
        return isUnseenOperator;
    }

    /**
     * Try to enter the given {@link Operator} either via an {@link InputSlot} or {@link OutputSlot} or via its
     * sink or source.
     *
     * @param operator   a possibly non-elementary (composite) {@link Operator} to enter
     * @param fromInput  {@link InputSlot} via that the {@link Operator} should be entered
     * @param fromOutput {@link OutputSlot} via that the {@link Operator} should be entered
     * @return whether the {@link Operator} could be entered
     */
    private boolean traverseHierarchical(Operator operator, InputSlot<?> fromInput, OutputSlot<?> fromOutput) {
        if (operator.isSubplan()) {
            this.enter((Subplan) operator, fromInput, fromOutput);
        } else if (operator.isAlternative()) {
            OperatorAlternative operatorAlternative = (OperatorAlternative) operator;
            for (OperatorAlternative.Alternative alternative : operatorAlternative.getAlternatives()) {
                this.enter(alternative, fromInput, fromOutput);
            }
            return true;
        }

        assert operator.isElementary() : String.format("Unknown composite operator: %s", operator);
        return false;
    }

    /**
     * Try to enter the given {@link OperatorContainer} either via an {@link InputSlot} or {@link OutputSlot} or via its
     * sink or source.
     *
     * @param container  the {@link OperatorContainer}
     * @param fromInput  {@link InputSlot} via that the {@link Operator} should be entered
     * @param fromOutput {@link OutputSlot} via that the {@link Operator} should be entered
     * @return whether the {@link Operator} could be entered
     */
    private void enter(OperatorContainer container, InputSlot<?> fromInput, OutputSlot<?> fromOutput) {
        if (fromInput != null) {
            final Collection<InputSlot<Object>> innerInputs = container.followInput(fromInput.unchecked());
            for (InputSlot<Object> innerInput : innerInputs) {
                this.traverse(innerInput.getOwner(), innerInput, null);
            }
        } else if (fromOutput != null) {
            final OutputSlot<Object> innerOutput = container.traceOutput(fromOutput.unchecked());
            this.traverse(innerOutput.getOwner(), null, innerOutput);
        } else if (container.isSink()) {
            final Operator innerSink = container.getSink();
            this.traverse(innerSink, null, null);
        } else if (container.isSource()) {
            final Operator innerSource = container.getSource();
            this.traverse(innerSource, null, null);
        } else {
            logger.warn("Could not enter {} during hierarchical traversal.", container);
        }
    }

    /**
     * Override to control the traversal behavior.
     */
    protected void followInputs(Operator operator) {
        Arrays.stream(operator.getAllInputs())
                .filter(this.inputFollowPredicate)
                .map(InputSlot::getOccupant)
                .filter(outputSlot -> outputSlot != null)
                .forEach(outputSlot -> this.traverse(outputSlot.getOwner(), null, outputSlot));
    }

    /**
     * Call {@link #followOutputs(Stream)} for all the {@link OutputSlot}s of the given {@code operator}.
     */
    private void followOutputs(Operator operator) {
        this.followOutputs(Arrays.stream(operator.getAllOutputs()));
    }

    /**
     * Override to control the traversal behavior.
     */
    protected void followOutputs(Stream<OutputSlot<?>> outputSlots) {
        outputSlots
                .filter(this.outputFollowPredicate)
                .map(outputSlot -> ((OutputSlot<Object>) outputSlot).getOccupiedSlots())
                .flatMap(Collection::stream)
                .filter(inputSlot -> inputSlot != null)
                .filter(this.inputFollowDownstreamPredicate)
                .forEach(inputSlot -> this.traverse(inputSlot.getOwner(), inputSlot, null));
    }

    /**
     * Retrieve all traversed operators that fulfill a predicate.
     *
     * @param operatorPredicate the predicate to filter desired operators
     * @return previously traversed operators matching the predicated
     */
    public Collection<Operator> getTraversedNodesWith(Predicate<Operator> operatorPredicate) {
        return this.visitedRelevantOperators.stream().filter(operatorPredicate).collect(Collectors.toList());
    }

    /**
     * Retrieve all traversed operators.
     *
     * @return previously traversed operators
     */
    public Collection<Operator> getTraversedNodes() {
        return this.getTraversedNodesWith(operator -> true);
    }

    /**
     * A callback can be invoked during a plan traversal on each traversed node.
     */
    @FunctionalInterface
    public interface Callback {

        /**
         * Perform some action on a traversed operator.
         *
         * @param operator       the operator that is being traversed
         * @param fromInputSlot  if the operator is being traversed via an input slot, this parameter is that slot, otherwise {@code null}
         * @param fromOutputSlot if the operator is being traversed via an output slot, this parameter is that slot, otherwise {@code null}
         */
        void traverse(Operator operator, InputSlot<?> fromInputSlot, OutputSlot<?> fromOutputSlot);

        /**
         * Does nothing.
         */
        Callback NOP = (operator, fromInputSlot, fromOutputSlot) -> {
        };
    }

    /**
     * A callback can be invoked during a plan traversal on each traversed node.
     */
    @FunctionalInterface
    public interface SimpleCallback {

        /**
         * Perform some action on a traversed operator.
         *
         * @param operator the operator that is being traversed
         */
        void traverse(Operator operator);
    }

}


text:
package com.amazonaws.services.ecrpublic.model.transform;

import java.math.*;

import javax.annotation.Generated;

import com.amazonaws.services.ecrpublic.model.*;
import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*;
import com.amazonaws.transform.*;

import com.fasterxml.jackson.core.JsonToken;
import static com.fasterxml.jackson.core.JsonToken.*;

/**
 * InitiateLayerUploadResult JSON Unmarshaller
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class InitiateLayerUploadResultJsonUnmarshaller implements Unmarshaller<InitiateLayerUploadResult, JsonUnmarshallerContext> {

    public InitiateLayerUploadResult unmarshall(JsonUnmarshallerContext context) throws Exception {
        InitiateLayerUploadResult initiateLayerUploadResult = new InitiateLayerUploadResult();

        int originalDepth = context.getCurrentDepth();
        String currentParentElement = context.getCurrentParentElement();
        int targetDepth = originalDepth + 1;

        JsonToken token = context.getCurrentToken();
        if (token == null)
            token = context.nextToken();
        if (token == VALUE_NULL) {
            return initiateLayerUploadResult;
        }

        while (true) {
            if (token == null)
                break;

            if (token == FIELD_NAME || token == START_OBJECT) {
                if (context.testExpression("uploadId", targetDepth)) {
                    context.nextToken();
                    initiateLayerUploadResult.setUploadId(context.getUnmarshaller(String.class).unmarshall(context));
                }
                if (context.testExpression("partSize", targetDepth)) {
                    context.nextToken();
                    initiateLayerUploadResult.setPartSize(context.getUnmarshaller(Long.class).unmarshall(context));
                }
            } else if (token == END_ARRAY || token == END_OBJECT) {
                if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {
                    if (context.getCurrentDepth() <= originalDepth)
                        break;
                }
            }
            token = context.nextToken();
        }

        return initiateLayerUploadResult;
    }

    private static InitiateLayerUploadResultJsonUnmarshaller instance;

    public static InitiateLayerUploadResultJsonUnmarshaller getInstance() {
        if (instance == null)
            instance = new InitiateLayerUploadResultJsonUnmarshaller();
        return instance;
    }
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Syll. fung. (Abellini) 2: 87 (1883)

#### Original name
Pleospora phragmiticola P. Crouan & H. Crouan

### Remarks
null


text:
package net.vicp.milim.ScheduledTask.zaixianwanjia.task;

import org.quartz.JobExecutionContext;

public interface IOpenAwardTask {
	/**
	 *
	 * openAward:cron = (0/20 * * * * ?) 开奖 <br/>
	 * @author 毛龙飞
	 * @param context
	 * @return
	 * @since JDK 1.8
	 */
	public Boolean openAward(JobExecutionContext context);
}


text:
hash -d libas="$HOME/Library/Application Support/"
# hash -d lib_icl="$HOME/Library/Mobile Documents/com~apple~CloudDocs/"

# Development
alias dev='cd ~/Development'
hash -d dev=$HOME/Development
hash -d play=$HOME/Development/playground
hash -d p=$HOME/Development/projects

# MacPorts
hash -d o=/opt/local
hash -d oe=/opt/local/etc
hash -d ol=/opt/local/var/log

# Easy cd to project directories.
cdpath=($cdpath $HOME/Development)

#################### noglob #########################
alias bazel='noglob bazel'

################## highlighting #####################
# https://github.com/sharkdp/bat
# Syntax shortcurts, useful as colorized less
alias yml='bat -l yaml --plain --paging=never --color=always'
alias jsn='bat -l json --plain --paging=never --color=always'
alias ini='bat -l ini --plain --paging=never --color=always'
# Pager versions
# alias yml-l='bat -l yaml -p'
# alias jsn-l='bat -l json -p'
# alias ini-l='bat -l ini -p'

alias dl='delta'

#################### docker #########################
alias dcup='docker-compose up -d'
alias dk='nocorrect docker'
alias dkp='docker ps -a'
alias dkpe='docker ps -a -q --filter "status=exited"'
alias dki='docker images'
# alias dkrm='docker rm --force'
alias dkr='docker run -it --rm'
alias dcrr='nocorrect docker-compose run --rm'
alias dcre='docker-compose down; docker-compose up -d'

#################### kubectl #########################
# plugin: https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/kubectl
alias kd='kubectl describe'
alias kc='kubectl config'
alias kcv='kubectl config view --minify | yml'

#################### gcloud ##########################
# plugin: https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/gcloud
alias gcl='gcloud'
alias gclcv="gcloud config list 2>&1 | ini"
alias gclcl="gcloud config configurations list"

###################### Nodejs #######################

# Yarn tests
# alias y='yarn'
# alias yl='yarn lint'
# alias yt='yarn test'
# alias ytf='yarn test:full'
# alias t='yarn test'
# alias tl='yarn lint'
# alias tu='yarn test:unit'
# alias ti='yarn test:integration'
# alias tc='yarn coverage'
# alias tch='yarn coverage:report:html && open ./coverage/index.html'
# alias tf='yarn test:full'

###################### Android ######################
# alias lcdb='lc l AndroidRuntime:e budgetking.db BudgetApplication_ TableUtils BaseMappedStatement StatementExecutor MappedCreate'
# alias a=adb
# alias a-='adb devices -l'
# alias a-wifi='adb tcpip 5555 && adb connect android'
# alias a-unpack='dd if=data.ab bs=1 skip=24 | openssl zlib -d | tar xvf -'

# alias adbl='adb logcat \*:W | coloredlogcat.py'
# alias adble='adb logcat \*:E | coloredlogcat.py'
# alias adbll='adb logcat -s "logmarker" | coloredlogcat.py'
# adb logcat ActiveAndroid:V SQLiteStatements:V \*:S | coloredlogcat.py
# adb logcat | grep --line-buffered $(adb shell ps | grep com.suponix.budgetking | cut -c10-15 ) | coloredlogcat.py
# adb logcat $(adb shell ps | grep com.example.budgetk | cut -c10-15 ) | coloredlogcat.py
# adb logcat com.example.budgetc:I \*:S
# FragmentManager

####################### resinctl ########################
#alias resinctl='resinctl -DAPPENV=local'
#alias resinpid='jps -l | grep com.caucho.server.resin.Resin | cut -d" " -f1'


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Instituto, (Coimbra) 4(1): 555 (1827)

#### Original name
Acladium griseum Wallr.

### Remarks
null


text:
package client_test

import (
	"encoding/json"
	"fmt"
	"net/http"
	"net/http/httptest"
	"net/url"
	"strings"
	"testing"
	"time"

	"github.com/toorop/influxdb/client"
)

func BenchmarkUnmarshalJSON2Tags(b *testing.B) {
	var bp client.BatchPoints
	data := []byte(`
{
    "database": "foo",
    "retentionPolicy": "bar",
    "points": [
        {
            "name": "cpu",
            "tags": {
                "host": "server01",
                "region": "us-east1"
            },
            "time": 14244733039069373,
            "precision": "n",
            "fields": {
                    "value": 4541770385657154000
            }
        }
    ]
}
`)

	for i := 0; i < b.N; i++ {
		if err := json.Unmarshal(data, &bp); err != nil {
			b.Errorf("unable to unmarshal nanosecond data: %s", err.Error())
		}
		b.SetBytes(int64(len(data)))
	}
}

func BenchmarkUnmarshalJSON10Tags(b *testing.B) {
	var bp client.BatchPoints
	data := []byte(`
{
    "database": "foo",
    "retentionPolicy": "bar",
    "points": [
        {
            "name": "cpu",
            "tags": {
                "host": "server01",
                "region": "us-east1",
                "tag1": "value1",
                "tag2": "value2",
                "tag2": "value3",
                "tag4": "value4",
                "tag5": "value5",
                "tag6": "value6",
                "tag7": "value7",
                "tag8": "value8"
            },
            "time": 14244733039069373,
            "precision": "n",
            "fields": {
                    "value": 4541770385657154000
            }
        }
    ]
}
`)

	for i := 0; i < b.N; i++ {
		if err := json.Unmarshal(data, &bp); err != nil {
			b.Errorf("unable to unmarshal nanosecond data: %s", err.Error())
		}
		b.SetBytes(int64(len(data)))
	}
}

func TestNewClient(t *testing.T) {
	config := client.Config{}
	_, err := client.NewClient(config)
	if err != nil {
		t.Fatalf("unexpected error.  expected %v, actual %v", nil, err)
	}
}

func TestClient_Ping(t *testing.T) {
	ts := emptyTestServer()
	defer ts.Close()

	u, _ := url.Parse(ts.URL)
	config := client.Config{URL: *u}
	c, err := client.NewClient(config)
	if err != nil {
		t.Fatalf("unexpected error.  expected %v, actual %v", nil, err)
	}
	d, version, err := c.Ping()
	if err != nil {
		t.Fatalf("unexpected error.  expected %v, actual %v", nil, err)
	}
	if d == 0 {
		t.Fatalf("expected a duration greater than zero.  actual %v", d)
	}
	if version != "x.x" {
		t.Fatalf("unexpected version.  expected %s,  actual %v", "x.x", version)
	}
}

func TestClient_Query(t *testing.T) {
	ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
		var data client.Response
		w.WriteHeader(http.StatusOK)
		_ = json.NewEncoder(w).Encode(data)
	}))
	defer ts.Close()

	u, _ := url.Parse(ts.URL)
	config := client.Config{URL: *u}
	c, err := client.NewClient(config)
	if err != nil {
		t.Fatalf("unexpected error.  expected %v, actual %v", nil, err)
	}

	query := client.Query{}
	_, err = c.Query(query)
	if err != nil {
		t.Fatalf("unexpected error.  expected %v, actual %v", nil, err)
	}
}

func TestClient_BasicAuth(t *testing.T) {
	ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
		u, p, ok := r.BasicAuth()

		if !ok {
			t.Errorf("basic auth error")
		}
		if u != "username" {
			t.Errorf("unexpected username, expected %q, actual %q", "username", u)
		}
		if p != "password" {
			t.Errorf("unexpected password, expected %q, actual %q", "password", p)
		}
		w.WriteHeader(http.StatusNoContent)
	}))
	defer ts.Close()

	u, _ := url.Parse(ts.URL)
	u.User = url.UserPassword("username", "password")
	config := client.Config{URL: *u, Username: "username", Password: "password"}
	c, err := client.NewClient(config)
	if err != nil {
		t.Fatalf("unexpected error.  expected %v, actual %v", nil, err)
	}

	_, _, err = c.Ping()
	if err != nil {
		t.Fatalf("unexpected error.  expected %v, actual %v", nil, err)
	}
}

func TestClient_Write(t *testing.T) {
	ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
		var data client.Response
		w.WriteHeader(http.StatusNoContent)
		_ = json.NewEncoder(w).Encode(data)
	}))
	defer ts.Close()

	u, _ := url.Parse(ts.URL)
	config := client.Config{URL: *u}
	c, err := client.NewClient(config)
	if err != nil {
		t.Fatalf("unexpected error.  expected %v, actual %v", nil, err)
	}

	bp := client.BatchPoints{}
	r, err := c.Write(bp)
	if err != nil {
		t.Fatalf("unexpected error.  expected %v, actual %v", nil, err)
	}
	if r != nil {
		t.Fatalf("unexpected response. expected %v, actual %v", nil, r)
	}
}

func TestClient_UserAgent(t *testing.T) {
	receivedUserAgent := ""
	ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
		receivedUserAgent = r.UserAgent()

		var data client.Response
		w.WriteHeader(http.StatusOK)
		_ = json.NewEncoder(w).Encode(data)
	}))
	defer ts.Close()

	_, err := http.Get(ts.URL)
	if err != nil {
		t.Fatalf("unexpected error.  expected %v, actual %v", nil, err)
	}

	tests := []struct {
		name      string
		userAgent string
		expected  string
	}{
		{
			name:      "Empty user agent",
			userAgent: "",
			expected:  "InfluxDBClient",
		},
		{
			name:      "Custom user agent",
			userAgent: "Test Influx Client",
			expected:  "Test Influx Client",
		},
	}

	for _, test := range tests {
		u, _ := url.Parse(ts.URL)
		config := client.Config{URL: *u, UserAgent: test.userAgent}
		c, err := client.NewClient(config)
		if err != nil {
			t.Fatalf("unexpected error.  expected %v, actual %v", nil, err)
		}

		receivedUserAgent = ""
		query := client.Query{}
		_, err = c.Query(query)
		if err != nil {
			t.Fatalf("unexpected error.  expected %v, actual %v", nil, err)
		}
		if !strings.HasPrefix(receivedUserAgent, test.expected) {
			t.Fatalf("Unexpected user agent. expected %v, actual %v", test.expected, receivedUserAgent)
		}

		receivedUserAgent = ""
		bp := client.BatchPoints{}
		_, err = c.Write(bp)
		if err != nil {
			t.Fatalf("unexpected error.  expected %v, actual %v", nil, err)
		}
		if !strings.HasPrefix(receivedUserAgent, test.expected) {
			t.Fatalf("Unexpected user agent. expected %v, actual %v", test.expected, receivedUserAgent)
		}

		receivedUserAgent = ""
		_, _, err = c.Ping()
		if err != nil {
			t.Fatalf("unexpected error.  expected %v, actual %v", nil, err)
		}
		if receivedUserAgent != test.expected {
			t.Fatalf("Unexpected user agent. expected %v, actual %v", test.expected, receivedUserAgent)
		}
	}
}

func TestPoint_UnmarshalEpoch(t *testing.T) {
	now := time.Now()
	tests := []struct {
		name      string
		epoch     int64
		precision string
		expected  time.Time
	}{
		{
			name:      "nanoseconds",
			epoch:     now.UnixNano(),
			precision: "n",
			expected:  now,
		},
		{
			name:      "microseconds",
			epoch:     now.Round(time.Microsecond).UnixNano() / int64(time.Microsecond),
			precision: "u",
			expected:  now.Round(time.Microsecond),
		},
		{
			name:      "milliseconds",
			epoch:     now.Round(time.Millisecond).UnixNano() / int64(time.Millisecond),
			precision: "ms",
			expected:  now.Round(time.Millisecond),
		},
		{
			name:      "seconds",
			epoch:     now.Round(time.Second).UnixNano() / int64(time.Second),
			precision: "s",
			expected:  now.Round(time.Second),
		},
		{
			name:      "minutes",
			epoch:     now.Round(time.Minute).UnixNano() / int64(time.Minute),
			precision: "m",
			expected:  now.Round(time.Minute),
		},
		{
			name:      "hours",
			epoch:     now.Round(time.Hour).UnixNano() / int64(time.Hour),
			precision: "h",
			expected:  now.Round(time.Hour),
		},
		{
			name:      "max int64",
			epoch:     9223372036854775807,
			precision: "n",
			expected:  time.Unix(0, 9223372036854775807),
		},
		{
			name:      "100 years from now",
			epoch:     now.Add(time.Hour * 24 * 365 * 100).UnixNano(),
			precision: "n",
			expected:  now.Add(time.Hour * 24 * 365 * 100),
		},
	}

	for _, test := range tests {
		t.Logf("testing %q\n", test.name)
		data := []byte(fmt.Sprintf(`{"time": %d, "precision":"%s"}`, test.epoch, test.precision))
		t.Logf("json: %s", string(data))
		var p client.Point
		err := json.Unmarshal(data, &p)
		if err != nil {
			t.Fatalf("unexpected error.  exptected: %v, actual: %v", nil, err)
		}
		if !p.Time.Equal(test.expected) {
			t.Fatalf("Unexpected time.  expected: %v, actual: %v", test.expected, p.Time)
		}
	}
}

func TestPoint_UnmarshalRFC(t *testing.T) {
	now := time.Now().UTC()
	tests := []struct {
		name     string
		rfc      string
		now      time.Time
		expected time.Time
	}{
		{
			name:     "RFC3339Nano",
			rfc:      time.RFC3339Nano,
			now:      now,
			expected: now,
		},
		{
			name:     "RFC3339",
			rfc:      time.RFC3339,
			now:      now.Round(time.Second),
			expected: now.Round(time.Second),
		},
	}

	for _, test := range tests {
		t.Logf("testing %q\n", test.name)
		ts := test.now.Format(test.rfc)
		data := []byte(fmt.Sprintf(`{"time": %q}`, ts))
		t.Logf("json: %s", string(data))
		var p client.Point
		err := json.Unmarshal(data, &p)
		if err != nil {
			t.Fatalf("unexpected error.  exptected: %v, actual: %v", nil, err)
		}
		if !p.Time.Equal(test.expected) {
			t.Fatalf("Unexpected time.  expected: %v, actual: %v", test.expected, p.Time)
		}
	}
}

func TestPoint_MarshalOmitempty(t *testing.T) {
	now := time.Now().UTC()
	tests := []struct {
		name     string
		point    client.Point
		now      time.Time
		expected string
	}{
		{
			name:     "all empty",
			point:    client.Point{Measurement: "cpu", Fields: map[string]interface{}{"value": 1.1}},
			now:      now,
			expected: `{"measurement":"cpu","fields":{"value":1.1}}`,
		},
		{
			name:     "with time",
			point:    client.Point{Measurement: "cpu", Fields: map[string]interface{}{"value": 1.1}, Time: now},
			now:      now,
			expected: fmt.Sprintf(`{"measurement":"cpu","time":"%s","fields":{"value":1.1}}`, now.Format(time.RFC3339Nano)),
		},
		{
			name:     "with tags",
			point:    client.Point{Measurement: "cpu", Fields: map[string]interface{}{"value": 1.1}, Tags: map[string]string{"foo": "bar"}},
			now:      now,
			expected: `{"measurement":"cpu","tags":{"foo":"bar"},"fields":{"value":1.1}}`,
		},
		{
			name:     "with precision",
			point:    client.Point{Measurement: "cpu", Fields: map[string]interface{}{"value": 1.1}, Precision: "ms"},
			now:      now,
			expected: `{"measurement":"cpu","fields":{"value":1.1},"precision":"ms"}`,
		},
	}

	for _, test := range tests {
		t.Logf("testing %q\n", test.name)
		b, err := json.Marshal(&test.point)
		if err != nil {
			t.Fatalf("unexpected error.  exptected: %v, actual: %v", nil, err)
		}
		if test.expected != string(b) {
			t.Fatalf("Unexpected result.  expected: %v, actual: %v", test.expected, string(b))
		}
	}
}

func TestEpochToTime(t *testing.T) {
	now := time.Now()

	tests := []struct {
		name      string
		epoch     int64
		precision string
		expected  time.Time
	}{
		{name: "nanoseconds", epoch: now.UnixNano(), precision: "n", expected: now},
		{name: "microseconds", epoch: now.Round(time.Microsecond).UnixNano() / int64(time.Microsecond), precision: "u", expected: now.Round(time.Microsecond)},
		{name: "milliseconds", epoch: now.Round(time.Millisecond).UnixNano() / int64(time.Millisecond), precision: "ms", expected: now.Round(time.Millisecond)},
		{name: "seconds", epoch: now.Round(time.Second).UnixNano() / int64(time.Second), precision: "s", expected: now.Round(time.Second)},
		{name: "minutes", epoch: now.Round(time.Minute).UnixNano() / int64(time.Minute), precision: "m", expected: now.Round(time.Minute)},
		{name: "hours", epoch: now.Round(time.Hour).UnixNano() / int64(time.Hour), precision: "h", expected: now.Round(time.Hour)},
	}

	for _, test := range tests {
		t.Logf("testing %q\n", test.name)
		tm, e := client.EpochToTime(test.epoch, test.precision)
		if e != nil {
			t.Fatalf("unexpected error: expected %v, actual: %v", nil, e)
		}
		if tm != test.expected {
			t.Fatalf("unexpected time: expected %v, actual %v", test.expected, tm)
		}
	}
}

// helper functions

func emptyTestServer() *httptest.Server {
	return httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
		w.Header().Set("X-Influxdb-Version", "x.x")
		return
	}))
}

// Ensure that data with epoch times can be decoded.
func TestBatchPoints_Normal(t *testing.T) {
	var bp client.BatchPoints
	data := []byte(`
{
    "database": "foo",
    "retentionPolicy": "bar",
    "points": [
        {
            "name": "cpu",
            "tags": {
                "host": "server01"
            },
            "time": 14244733039069373,
            "precision": "n",
            "values": {
                    "value": 4541770385657154000
            }
        },
        {
            "name": "cpu",
             "tags": {
                "host": "server01"
            },
            "time": 14244733039069380,
            "precision": "n",
            "values": {
                    "value": 7199311900554737000
            }
        }
    ]
}
`)

	if err := json.Unmarshal(data, &bp); err != nil {
		t.Errorf("unable to unmarshal nanosecond data: %s", err.Error())
	}
}

func TestClient_Timeout(t *testing.T) {
	ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
		time.Sleep(1 * time.Second)
		var data client.Response
		w.WriteHeader(http.StatusOK)
		_ = json.NewEncoder(w).Encode(data)
	}))
	defer ts.Close()

	u, _ := url.Parse(ts.URL)
	config := client.Config{URL: *u, Timeout: 500 * time.Millisecond}
	c, err := client.NewClient(config)
	if err != nil {
		t.Fatalf("unexpected error.  expected %v, actual %v", nil, err)
	}

	query := client.Query{}
	_, err = c.Query(query)
	if err == nil {
		t.Fatalf("unexpected success.  expected timeout error")
	} else if !strings.Contains(err.Error(), "use of closed network connection") {
		t.Fatalf("unexpected error.  expected 'use of closed network connection' error, got %v", err)
	}

	confignotimeout := client.Config{URL: *u}
	cnotimeout, err := client.NewClient(confignotimeout)
	_, err = cnotimeout.Query(query)
	if err != nil {
		t.Fatalf("unexpected error.  expected %v, actual %v", nil, err)
	}
}


text:
require 'sprockets'
require 'sprockets-blackcoffee/version'
require 'sprockets-blackcoffee/template'

Sprockets.register_engine '.black_coffee', Sprockets::BlackCoffee::Template


text:
var Animator = AVObj.extend();
Animator.properties =
{
	play : function( animationName, speed, numberOfTimes )
	{

	},

	pause : function()
	{

	}

};


text:
package com.thales.window.deckView;

import com.thales.model.Manifest;
import com.thales.model.Vessel;
import com.thales.window.deckView.CargoView.CargoView;
import com.thales.window.deckView.CargoView.ItemView;
import com.thales.window.deckView.color.DestinationColorFactory;
import com.thales.window.deckView.color.IColorFactory;
import javafx.scene.DepthTest;
import javafx.scene.Group;
import javafx.scene.PerspectiveCamera;
import javafx.scene.SubScene;
import javafx.scene.layout.Pane;
import javafx.scene.paint.Color;
import javafx.scene.paint.PhongMaterial;
import javafx.scene.shape.Box;

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

/**
 * Created by Administrator on 8/04/2016.
 */
public class DeckView extends Pane
{

    private static final double CAMERA_INITIAL_DISTANCE = -10000;
    private static final double CAMERA_INITIAL_X_ANGLE = -40;
    private static final double CAMERA_INITIAL_Y_ANGLE = 0;
    private static final double CAMERA_INITIAL_Z_ANGLE =90;

    private static final double CAMERA_NEAR_CLIP = 0.1;
    private static final double CAMERA_FAR_CLIP = 1000000.0;

    final PerspectiveCamera camera = new PerspectiveCamera(true);

    final Xform cameraXform = new Xform();
    final Xform cameraXform2 = new Xform();
    final Xform cameraXform3 = new Xform();

    final Xform axisGroup = new Xform();

    final Xform world = new Xform();

    final Group root = new Group();

    final Xform axis = new Axis(10000);

    final VesselView vesselView;

    final Delta dragDelta = new Delta();

    final Xform grid = new Grid(14000, 10000, 100, 100);

    private Manifest lastUpdated = null;

    CargoView cargoView;

    private IColorFactory<?> colorFactory = new DestinationColorFactory();

    private boolean setNewDelta = true;

    final Arrow arrow = new Arrow();

    public DeckView(Vessel v)
    {
        setMaxWidth(1600);
        cargoView = new CargoView();

        vesselView = new VesselView(v);
        world.getChildren().addAll(axis, grid, vesselView, cargoView, arrow);
        grid.setVisible(false);
        axis.setVisible(false);

        buildCamera();

        arrow.setTranslateZ(40);

        vesselView.setTranslateZ(40);
        grid.setTranslateZ(20);

        double vesselWidth = vesselView.getLayoutBounds().getWidth();
        double vesselHeight = vesselView.getLayoutBounds().getHeight();

        double arrowHeight = arrow.getLayoutBounds().getHeight();
        arrow.setTranslateY(-vesselHeight / 2 - 30 - arrowHeight/2);

        cargoView.setTranslate(-vesselWidth / 2 + 50, (vesselHeight / 2) - 50);

        root.getChildren().add(world);
        root.setDepthTest(DepthTest.ENABLE);

        SubScene subScene = new SubScene(root, 1400, 1200);
        subScene.setCamera(camera);
        getChildren().add(subScene);
        setSceneEvents();

        this.setStyle("-fx-background-color: #E0EEEE;");
    }
    public void setColourFactory(IColorFactory<?> colourFactory){

        this.colorFactory = colourFactory;
        if (lastUpdated != null) {
            updateDeck(lastUpdated);
        }
    }
    private void buildAxes() {
        System.out.println("buildAxes()");
        final PhongMaterial redMaterial = new PhongMaterial();
        redMaterial.setDiffuseColor(Color.DARKRED);
        redMaterial.setSpecularColor(Color.RED);

        final PhongMaterial greenMaterial = new PhongMaterial();
        greenMaterial.setDiffuseColor(Color.DARKGREEN);
        greenMaterial.setSpecularColor(Color.GREEN);

        final PhongMaterial blueMaterial = new PhongMaterial();
        blueMaterial.setDiffuseColor(Color.DARKBLUE);
        blueMaterial.setSpecularColor(Color.BLUE);

        final Box xAxis = new Box(250, 1, 1);
        final Box yAxis = new Box(1, 250, 1);
        final Box zAxis = new Box(1, 1, 250);

        xAxis.setMaterial(redMaterial);
        yAxis.setMaterial(greenMaterial);
        zAxis.setMaterial(blueMaterial);

        axisGroup.getChildren().addAll(xAxis, yAxis, zAxis);
        axisGroup.setVisible(true);
        world.getChildren().addAll(axisGroup);
    }

    private void buildCamera() {
        root.getChildren().add(cameraXform);
        cameraXform.getChildren().add(cameraXform2);
        cameraXform2.getChildren().add(cameraXform3);
        cameraXform3.getChildren().add(camera);
        cameraXform3.setRotateZ(180.0);

        camera.setNearClip(CAMERA_NEAR_CLIP);
        camera.setFarClip(CAMERA_FAR_CLIP);
        camera.setTranslateZ(CAMERA_INITIAL_DISTANCE);

        cameraXform.ry.setAngle(CAMERA_INITIAL_Y_ANGLE);
        cameraXform.rx.setAngle(CAMERA_INITIAL_X_ANGLE);
        cameraXform.rz.setAngle(CAMERA_INITIAL_Z_ANGLE);

    }
    private void setSceneEvents() {
        //handles mouse scrolling
        this.setOnScroll(
            event -> {
                double zoomValue = camera.getTranslateZ() + event.getDeltaY() * 5;
                if (zoomValue > -200) {
                    zoomValue = -200;
                } else if (zoomValue < -10000) {
                    zoomValue = -10000;
                }
                camera.setTranslateZ(zoomValue);
                event.consume();
            });

        this.setOnMousePressed((dragover) ->
        {
            setNewDelta = true;
            dragover.consume();
        });

        this.setOnMouseDragged(dragEvent ->
        {
            if (setNewDelta) {
                dragDelta.x = camera.getLayoutX() - dragEvent.getSceneX();
                dragDelta.y = camera.getLayoutY() - dragEvent.getSceneY();
                setNewDelta = false;
            }
            camera.setLayoutX(dragEvent.getSceneX() + dragDelta.x);
            camera.setLayoutY(dragEvent.getSceneY() + dragDelta.y);
            dragEvent.consume();
        });

    }

    class Delta {
        double x, y; }

    public void updateDeck(Manifest m)
    {
        lastUpdated = m;
        int maxWidth =  m.getVessel().getDimension().width;
        int maxHeight = m.getVessel().getDimension().height;

        List<List<ItemView>> list = new ArrayList<>();

        for(int i = 0; i < maxWidth; i++)
        {
            List<ItemView> row = new ArrayList<>();

            for(int j = 0; j < maxHeight; j++)
            {
                ItemView itemView = new ItemView(m.getPosition(i, j));
                Color c  = m.getVessel().check(itemView.getItem(), i, j) ? colorFactory.getColor(itemView) : Color.BLACK;

                if(!m.getVessel().check(itemView.getItem(), i, j))
                {
                    itemView.setDepth(1);
                }
                itemView.setMaterial(new PhongMaterial(c));
                row.add(itemView);
            }

            list.add(row);
        }

        cargoView.update(list);
    }
}


text:
package org.dswarm.controller.resources.job.test;

import java.io.BufferedInputStream;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.nio.file.Files;

import javax.ws.rs.client.Entity;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;

import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.ArrayNode;
import com.fasterxml.jackson.databind.node.ObjectNode;
import com.fasterxml.jackson.databind.node.TextNode;
import com.google.common.io.Resources;
import org.apache.commons.io.FileUtils;
import org.junit.Assert;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.xmlunit.builder.DiffBuilder;
import org.xmlunit.builder.Input;
import org.xmlunit.diff.Diff;
import org.xmlunit.diff.Difference;

import org.dswarm.controller.resources.job.TasksResource;
import org.dswarm.controller.resources.resource.test.utils.DataModelsResourceTestUtils;
import org.dswarm.controller.resources.resource.test.utils.ResourcesResourceTestUtils;
import org.dswarm.controller.resources.test.ResourceTest;
import org.dswarm.controller.test.GuicedTest;
import org.dswarm.persistence.model.resource.Configuration;
import org.dswarm.persistence.model.resource.DataModel;
import org.dswarm.persistence.model.resource.Resource;
import org.dswarm.persistence.model.resource.ResourceType;
import org.dswarm.persistence.model.resource.utils.ConfigurationStatics;
import org.dswarm.persistence.model.resource.utils.DataModelUtils;
import org.dswarm.persistence.model.schema.Schema;
import org.dswarm.persistence.service.UUIDService;
import org.dswarm.persistence.util.DMPPersistenceUtil;

public class TasksCsvResourceTest4 extends ResourceTest {

	private static final Logger LOG = LoggerFactory.getLogger(TasksCsvResourceTest4.class);

	private String taskJSONString;

	private ResourcesResourceTestUtils resourcesResourceTestUtils;

	private DataModelsResourceTestUtils dataModelsResourceTestUtils;

	private final ObjectMapper objectMapper = GuicedTest.injector.getInstance(ObjectMapper.class);

	public TasksCsvResourceTest4() {

		super("tasks");
	}

	@Override protected void initObjects() {
		super.initObjects();

		resourcesResourceTestUtils = new ResourcesResourceTestUtils();
		dataModelsResourceTestUtils = new DataModelsResourceTestUtils();
	}

	@Override
	public void prepare() throws Exception {

		super.prepare();

		taskJSONString = DMPPersistenceUtil.getResourceAsString("task.csv.json");
	}

	/**
	 * do ingest on-the-fly + export on-the-fly
	 *
	 * @throws Exception
	 */
	@Test
	public void testTaskExecution() throws Exception {

		TasksCsvResourceTest4.LOG.debug("start task execution test");

		final String resourceFileName = "test_csv-controller.csv";

		final String resource1Uuid = UUIDService.getUUID(Resource.class.getSimpleName());

		final Resource res1 = new Resource(resource1Uuid);
		res1.setName(resourceFileName);
		res1.setDescription("this is a description");
		res1.setType(ResourceType.FILE);

		final URL fileURL = Resources.getResource(resourceFileName);
		final File resourceFile = FileUtils.toFile(fileURL);

		final ObjectNode attributes1 = new ObjectNode(objectMapper.getNodeFactory());
		attributes1.put("path", resourceFile.getAbsolutePath());

		String fileType = null;

		try {
			fileType = Files.probeContentType(resourceFile.toPath());
		} catch (final IOException e1) {

			TasksCsvResourceTest4.LOG.debug("couldn't determine file type from file '" + resourceFile.getAbsolutePath() + "'");
		}

		if (fileType != null) {

			attributes1.put("filetype", fileType);
		}

		// hint: size is not important to know since its value is skipped in the comparison of actual and expected resource
		attributes1.put("filesize", -1);

		res1.setAttributes(attributes1);

		// upload data resource
		Resource resource = resourcesResourceTestUtils.uploadResource(resourceFile, res1);

		final String configuration1Uuid = UUIDService.getUUID(Configuration.class.getSimpleName());

		// process input data model
		final Configuration conf1 = new Configuration(configuration1Uuid);

		conf1.setName("config1");
		conf1.addParameter(ConfigurationStatics.COLUMN_DELIMITER, new TextNode(";"));
		conf1.addParameter(ConfigurationStatics.STORAGE_TYPE, new TextNode("csv"));

		final String configurationJSONString = objectMapper.writeValueAsString(conf1);

		// create configuration
		Configuration configuration = resourcesResourceTestUtils.addResourceConfiguration(resource, configurationJSONString);

		final String dataModelUuid = "DataModel-642fa5de-9afc-4f91-ad35-d204c40a11f4";

		final DataModel dataModel1 = new DataModel(dataModelUuid);
		dataModel1.setName("'" + res1.getName() + "' + '" + conf1.getName() + "' data model");
		dataModel1.setDescription("data model of resource '" + res1.getName() + "' and configuration '" + conf1.getName() + "'");
		dataModel1.setDataResource(resource);
		dataModel1.setConfiguration(configuration);

		final String schemaUuid = "Schema-b2db413b-9c14-4724-b7e2-7b03186bf6be";

		final Schema schema1 = new Schema(schemaUuid);

		dataModel1.setSchema(schema1);

		// manipulate input data model
		final String finalInputDataModelJSONString = objectMapper.writeValueAsString(dataModel1);
		final ObjectNode finalInputDataModelJSON = objectMapper.readValue(finalInputDataModelJSONString, ObjectNode.class);

		final ObjectNode taskJSON = objectMapper.readValue(taskJSONString, ObjectNode.class);
		taskJSON.set("input_data_model", finalInputDataModelJSON);

		// utilise internal model as output data model
		final DataModel outputDataModel = dataModelsResourceTestUtils.getObject(DataModelUtils.BIBO_DOCUMENT_DATA_MODEL_UUID);
		final String outputDataModelJSONString = objectMapper.writeValueAsString(outputDataModel);
		final ObjectNode outputDataModelJSON = objectMapper.readValue(outputDataModelJSONString, ObjectNode.class);

		taskJSON.set("output_data_model", outputDataModelJSON);

		// manipulate attributes
		final ObjectNode mappingJSON = (ObjectNode) taskJSON.get("job").get("mappings").get(0);

		final String dataResourceSchemaBaseURI = DataModelUtils.determineDataModelSchemaBaseURI(dataModel1);

		final ObjectNode outputAttributePathAttributeJSON = (ObjectNode) mappingJSON
				.get("output_attribute_path").get("attribute_path").get("attributes").get(0);
		final String outputAttributeName = outputAttributePathAttributeJSON.get("name").asText();
		outputAttributePathAttributeJSON.put("uri", dataResourceSchemaBaseURI + outputAttributeName);

		final ArrayNode inputAttributePathsJSON = (ArrayNode) mappingJSON.get("input_attribute_paths");

		for (final JsonNode inputAttributePathsJSONNode : inputAttributePathsJSON) {

			final ObjectNode inputAttributeJSON = (ObjectNode) inputAttributePathsJSONNode
					.get("attribute_path").get("attributes").get(0);
			final String inputAttributeName = inputAttributeJSON.get("name").asText();
			inputAttributeJSON.put("uri", dataResourceSchemaBaseURI + inputAttributeName);
		}

		// manipulate parameter mappings in transformation component
		final ObjectNode transformationComponentParameterMappingsJSON = (ObjectNode) mappingJSON.get("transformation")
				.get("parameter_mappings");
		transformationComponentParameterMappingsJSON.put("description", "description");
		transformationComponentParameterMappingsJSON.put("__TRANSFORMATION_OUTPUT_VARIABLE__1", "output mapping attribute path instance");

		final ObjectNode requestJSON = objectMapper.createObjectNode();
		requestJSON.set(TasksResource.TASK_IDENTIFIER, taskJSON);
		requestJSON.put(TasksResource.PERSIST_IDENTIFIER, Boolean.FALSE);
		requestJSON.put(TasksResource.DO_INGEST_ON_THE_FLY_IDENTIFIER, Boolean.TRUE);
		requestJSON.put(TasksResource.DO_VERSIONING_ON_RESULT_IDENTIFIER, Boolean.FALSE);

		final Response response = target().request(MediaType.APPLICATION_XML_TYPE).post(Entity.json(requestJSON));

		// SR Start checking response

		Assert.assertEquals("200 Created was expected", 200, response.getStatus());

		final InputStream actualXMLStream = response.readEntity(InputStream.class);
		Assert.assertNotNull(actualXMLStream);

		final BufferedInputStream bis = new BufferedInputStream(actualXMLStream, 1024);

		final String expectedXML = DMPPersistenceUtil.getResourceAsString("controller_task-result.csv.xml");

		// do comparison: check for XML similarity
		final Diff xmlDiff = DiffBuilder
				.compare(Input.fromString(expectedXML).build())
				.withTest(Input.fromStream(bis).build())
				.ignoreWhitespace()
				.checkForSimilar()
				.build();

		if (xmlDiff.hasDifferences()) {
			final StringBuilder sb = new StringBuilder("Oi chap, there seem to ba a mishap!");
			for (final Difference difference : xmlDiff.getDifferences()) {
				sb.append('\n').append(difference);
			}
			Assert.fail(sb.toString());
		}

		actualXMLStream.close();
		bis.close();

		TasksCsvResourceTest4.LOG.debug("end task execution test");
	}
}


text:
package com.pineone.icbms.so.virtualobject.common;

import com.pineone.icbms.so.virtualobject.state.IGenericStateStore;

/**
 * abstract Generic state owner.<BR/>
 *
 * Created by uni4love on 2016. 11. 16..
 */
abstract public class AGenericStateStoreOwner
        implements IGenericStateStoreOwner<String, Object, IGenericStateStore<String, Object>> {

    /**
     * state
     */
    protected IGenericStateStore stateStore;

    /**
     * constuctor
     */
    public AGenericStateStoreOwner() {
    }

    @Override
    public IGenericStateStore getStateStore() {
        return stateStore;
    }

    public void setStateStore(IGenericStateStore state) {
        this.stateStore = state;
    }

    @Override
    public String toString() {
        StringBuffer sb = new StringBuffer();
        sb.append(super.toString());
        sb.append(", stateStore: ").append(stateStore);
        return sb.toString();
    }
}


text:
package net.firejack.platform.service.directory.broker;

import net.firejack.platform.api.directory.domain.BaseUser;
import net.firejack.platform.core.broker.ListBroker;
import net.firejack.platform.core.domain.NamedValues;
import net.firejack.platform.core.exception.BusinessFunctionException;
import net.firejack.platform.core.model.SpecifiedIdsFilter;
import net.firejack.platform.core.model.user.BaseUserModel;
import net.firejack.platform.core.request.ServiceRequest;
import net.firejack.platform.core.store.user.IBaseUserStore;
import net.firejack.platform.core.utils.ListUtils;
import net.firejack.platform.core.utils.SortOrder;
import org.apache.commons.lang.StringUtils;
import org.hibernate.criterion.Order;

import java.util.List;

public abstract class ReadBaseUserListBroker<M extends BaseUserModel, DTO extends BaseUser>
        extends ListBroker<M, DTO, NamedValues<Object>> {

    public static final String PARAM_TERM = "term";
    public static final String PARAM_EXCEPT_IDS = "exceptIds";
    public static final String PARAM_OFFSET = "offset";
    public static final String PARAM_LIMIT = "limit";
    public static final String PARAM_SORT_COLUMN = "sortColumn";
    public static final String PARAM_SORT_DIRECTION = "sortDirection";

    protected abstract IBaseUserStore<M> getStore();

	@Override
    @SuppressWarnings("unchecked")
	protected List<M> getModelList(ServiceRequest<NamedValues<Object>> request) throws BusinessFunctionException {
        NamedValues<Object> data = request.getData();
        String term = (String) data.get(PARAM_TERM);
		List<Long> exceptIds = (List<Long>) data.get(PARAM_EXCEPT_IDS);
        Integer offset = (Integer) data.get(PARAM_OFFSET);
        Integer limit = (Integer) data.get(PARAM_LIMIT);
        String sortColumn = (String) data.get(PARAM_SORT_COLUMN);
        SortOrder sortOrder = (SortOrder) data.get(PARAM_SORT_DIRECTION);
        SpecifiedIdsFilter filter = getFilter(true);
		List<M> users;

		if (exceptIds != null) {
			List<Long> exceptPermissionIds = ListUtils.removeNullableItems(exceptIds);
			filter.getUnnecessaryIds().addAll(exceptPermissionIds);
			filter.setAll(true);
		}

		if (StringUtils.isNotBlank(term)) {
            if (StringUtils.isBlank(sortColumn)) {
                Order order = sortOrder == null ? Order.asc(sortColumn) :
                        sortOrder == SortOrder.ASC ? Order.asc(sortColumn) : Order.desc(sortColumn);
                users = getStore().findAllByRegistryNodeIdsAndSearchTermWithFilter(null, term, filter, limit, offset, order);
            } else {
                users = getStore().findAllByRegistryNodeIdsAndSearchTermWithFilter(null, term, filter, limit, offset);
            }
		} else {
			users = getStore().findAllWithFilter(filter);
		}
		for (M user : users) {
			user.setUserRoles(null);
		}

		return users;
	}
}


text:
package survivalgame.server.network;

import io.netty.bootstrap.ServerBootstrap;
import io.netty.buffer.PooledByteBufAllocator;
import io.netty.channel.Channel;
import io.netty.channel.ChannelException;
import io.netty.channel.ChannelInitializer;
import io.netty.channel.ChannelOption;
import io.netty.channel.EventLoopGroup;
import io.netty.channel.nio.NioEventLoopGroup;
import io.netty.channel.socket.SocketChannel;
import io.netty.channel.socket.nio.NioServerSocketChannel;
import io.netty.handler.codec.http.HttpObjectAggregator;
import io.netty.handler.codec.http.HttpServerCodec;
import io.netty.handler.logging.LogLevel;
import io.netty.handler.logging.LoggingHandler;
import survivalgame.server.Server;
import survivalgame.server.network.packet.PacketRegistry;

import java.io.IOException;

public class NetworkManager {

    private final Server server;
    private EventLoopGroup bossGroup;
    private EventLoopGroup workerGroup;
    private Channel channel;

    public NetworkManager(Server server) {
        this.server = server;
    }

    public void start() throws IOException, InterruptedException {
        // Server part
        bossGroup = new NioEventLoopGroup();
        workerGroup = new NioEventLoopGroup();

        ServerBootstrap b = new ServerBootstrap();
        b.group(bossGroup, workerGroup).channel(NioServerSocketChannel.class).handler(new LoggingHandler(LogLevel.INFO)).childHandler(new ClientInitializer(server));

        channel = b.bind(server.getConfig().server.port).sync().channel();

        Server.log.info("Server started on port " + server.getConfig().server.port + ".");
    }

    public boolean shutdown() {
        if (channel == null) {
            return false;
        }

        try {
            channel.close().sync();
            return true;
        } catch (InterruptedException ex) {
            return false;
        } finally {
            bossGroup.shutdownGracefully();
            workerGroup.shutdownGracefully();
        }
    }

    private static class ClientInitializer extends ChannelInitializer<SocketChannel> {

        private final Server server;

        public ClientInitializer(Server server) {
            this.server = server;
        }

        @Override
        protected void initChannel(SocketChannel ch) throws Exception {
            try {
                ch.config().setOption(ChannelOption.IP_TOS, 0x18);
//                ch.config().setOption(ChannelOption.WRITE_BUFFER_HIGH_WATER_MARK, 32 * 1024);
//                ch.config().setOption(ChannelOption.WRITE_BUFFER_LOW_WATER_MARK, 8 * 1024);
            } catch (ChannelException ex) {
                // IP_TOS not supported by platform, ignore
            }
            ch.config().setAllocator(PooledByteBufAllocator.DEFAULT);

            PacketRegistry r = new PacketRegistry();

            ch.pipeline().addLast(new HttpServerCodec());
            ch.pipeline().addLast(new HttpObjectAggregator(65536));
            ch.pipeline().addLast(new WebSocketHandler());
            ch.pipeline().addLast(new PacketDecoder(r));
            ch.pipeline().addLast(new PacketEncoder(r));
            ch.pipeline().addLast(new ClientHandler(server));
        }
    }
}


text:
layout: default
name: icon-facebook
---

 Facebook


text:
#include <memory>
#include <string>
#include <unordered_map>
#include <vector>

#include "tensorflow/contrib/lite/toco/graph_transformations/graph_transformations.h"
#include "tensorflow/contrib/lite/toco/model.h"
#include "tensorflow/contrib/lite/toco/tooling_util.h"
#include "tensorflow/core/platform/logging.h"

namespace toco {

::tensorflow::Status ResolveSliceAttributes::Run(Model* model,
                                                 std::size_t op_index,
                                                 bool* modified) {
  *modified = false;
  const auto slice_it = model->operators.begin() + op_index;
  auto* slice_op = slice_it->get();
  if (slice_op->type != OperatorType::kSlice) return ::tensorflow::Status::OK();

  auto* op = static_cast<SliceOperator*>(slice_op);
  if (!op->begin.empty()) return ::tensorflow::Status::OK();

  CHECK_EQ(op->inputs.size(), 3);
  if (!IsConstantParameterArray(*model, op->inputs[1]))
    return ::tensorflow::Status::OK();
  if (!IsConstantParameterArray(*model, op->inputs[2]))
    return ::tensorflow::Status::OK();

  const auto& begin_array = model->GetArray(op->inputs[1]);
  if (!begin_array.has_shape()) return ::tensorflow::Status::OK();

  const auto& size_array = model->GetArray(op->inputs[2]);
  if (!size_array.has_shape()) return ::tensorflow::Status::OK();

  op->begin = begin_array.GetBuffer<ArrayDataType::kInt32>().data;
  op->size = size_array.GetBuffer<ArrayDataType::kInt32>().data;

  // TODO(dkalenichenko): Delete the extra inputs?

  *modified = true;
  return ::tensorflow::Status::OK();
}
}  // namespace toco


text:
layout: post
title: The Talmud and RapGenius
comments: true
author: Mimoun
---

I've been thinking about annotation and RapGenius, the startup that successfully took advantage of this trend. But it is not until recently that I realized that the most interesting example of annotation has been lying there, in front of me, my entire life.

The Talmud, or body of Jewish law, contains the most fascinating example of annotation, annotation on annotation, and annotation on annotation on annotation.

The chain of commentary-on-commentary in the Talmud traverses eras and languages. For those interested in annotation, the Talmud is an incredible source of awe and inspiration.

For those who are not familiar with this topic, the Talmud is the body of Jewish civil law. It is comprised of the Mishnah and the Guemarah. The Mishnah represents the oral tradition of the Torah, and the Guemarah consists of discussions about those laws.

Here's what a typical page of the Guemarah looks like:

<img src="../../../../guemarah.gif" width="300" height="500">

* The text in blue is the Mishnah, written in 'Mishnaic Hebrew' circa 189 CE.
* The text in yellow is the Guemarah, annotations on the Mishnah. It was written in Aramaic in the 4th-6th centuries CE.
* The text in purple is called "Rashi" and was written several centuries later. It explains and clarifies ambiguities from the Guemarah. Though written in Hebrew, it often uses Latin and Medieval French words to designate objects that didn't have a proper Hebrew translation.
* The text in red is Tosafos, most of which were written in France in the middle ages. They represent further commentary on the Mishnah and Rashi.

I wonder if modern examples of annotation will ever reach the same level of complexity, depth and sophistication that is present in the Talmud.


text:
Datalog package

go get bitbucket.org/swriddle/datalog


text:
package com.junnanhao.samantha.info.utils;

import android.widget.ImageView;
import android.widget.TextView;

/**
 * Created by Jonas on 2017/4/11.
 * Property constants
 */

public class Setters {

    public static final Setter<TextView, String> TEXT_VIEW_TEXT = new Setter<TextView, String>() {
        @Override
        public void set(TextView object, String value) {
            object.setText(value);
        }
    };

    public static final Setter<ImageView, Integer> IMAGE_VIEW_RESOURCE_ID = new Setter<ImageView, Integer>() {
        @Override
        public void set(ImageView object, Integer value) {
            object.setImageResource(value);
        }
    };

}


text:
package com.java110.store.bmo.contractPartya.impl;

import com.java110.core.annotation.Java110Transactional;
import com.java110.core.factory.GenerateCodeFactory;
import com.java110.intf.store.IContractPartyaInnerServiceSMO;
import com.java110.po.contractPartya.ContractPartyaPo;
import com.java110.store.bmo.contractPartya.ISaveContractPartyaBMO;
import com.java110.vo.ResultVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;

@Service("saveContractPartyaBMOImpl")
public class SaveContractPartyaBMOImpl implements ISaveContractPartyaBMO {

    @Autowired
    private IContractPartyaInnerServiceSMO contractPartyaInnerServiceSMOImpl;

    /**
     * 添加小区信息
     *
     * @param contractPartyaPo
     * @return 订单服务能够接受的报文
     */
    @Java110Transactional
    public ResponseEntity<String> save(ContractPartyaPo contractPartyaPo) {

        contractPartyaPo.setPartyaId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_partyaId));
        int flag = contractPartyaInnerServiceSMOImpl.saveContractPartya(contractPartyaPo);

        if (flag > 0) {
            return ResultVo.createResponseEntity(ResultVo.CODE_OK, "保存成功");
        }

        return ResultVo.createResponseEntity(ResultVo.CODE_ERROR, "保存失败");
    }

}


text:
import storyBuilder from '../../shared/story-builder'
export default storyBuilder


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Leptostroma maculae Lib.

### Remarks
null


text:
package be.seriousbusiness.brusselnieuws.rss.datastore.model.dto.impl;

import java.math.BigInteger;
import java.util.ArrayList;

import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;

import be.seriousbusiness.brusselnieuws.rss.datastore.model.dto.AbstractFeedDTOTest;

/**
 * {@link FeedDTOImpl} test implementation.
 * @author Serious Business
 * @author Stefan Borghys
 * @version 1.0
 * @since 1.0
 */
public class FeedDTOImplTest extends AbstractFeedDTOTest<MediumTypeDTOImpl,
														MediumDTOImpl,
														CategoryDTOImpl,
														AuthorDTOImpl,
														CreatorDTOImpl,
														ArticleDTOImpl,
														FeedDTOImpl> {

	public FeedDTOImplTest() {
		super(BigInteger.valueOf(111222333l),
				new ArrayList<ArticleDTOImpl>(),
				"",
				"http://www.brusselnieuws.be/nl/hoofdpunten/feed",
				"BrusselNieuws RSS - Hoofdpunten");
	}

	@Override
	public FeedDTOImpl create() {
		return new FeedDTOImpl.Builder().build();
	}

	@Ignore
	@Test
	public void testCloneable() {
		FeedDTOImpl clonedFeedDTOImpl=(FeedDTOImpl) getDTO().clone();
		Assert.assertEquals("The clone should be equal to the one it's cloned from",getDTO(),clonedFeedDTOImpl);
		clonedFeedDTOImpl.setDescription(String.valueOf(System.currentTimeMillis()));
		Assert.assertNotEquals("The clone should not be equal to the one it's cloned from after altering it",getDTO(),clonedFeedDTOImpl);
		// ArticleImpl:
		clonedFeedDTOImpl=(FeedDTOImpl) getDTO().clone();
		for(final ArticleDTOImpl articleDTOImpl : clonedFeedDTOImpl.getArticleDTOs()) {
			articleDTOImpl.setDescription(String.valueOf(System.currentTimeMillis()));
			break;
		}
		Assert.assertNotEquals("The clone should not be equal to the one it's cloned from after altering it",getDTO(),clonedFeedDTOImpl);
		// AuthorImpl:
		clonedFeedDTOImpl=(FeedDTOImpl) getDTO().clone();
		for(final ArticleDTOImpl articleDTOImpl : clonedFeedDTOImpl.getArticleDTOs()) {
			for(final AuthorDTOImpl authorDTOImpl : articleDTOImpl.getAuthorDTOs()) {
				authorDTOImpl.setName(String.valueOf(System.currentTimeMillis()));
				break;
			}
			break;
		}
		Assert.assertNotEquals("The clone should not be equal to the one it's cloned from after altering it",getDTO(),clonedFeedDTOImpl);
		// CategoryImpl:
		clonedFeedDTOImpl=(FeedDTOImpl) getDTO().clone();
		for(final ArticleDTOImpl articleDTOImpl : clonedFeedDTOImpl.getArticleDTOs()) {
			for(final CategoryDTOImpl categoryDTOImpl : articleDTOImpl.getCategoryDTOs()) {
				categoryDTOImpl.setName(String.valueOf(System.currentTimeMillis()));
				break;
			}
			break;
		}
		Assert.assertNotEquals("The clone should not be equal to the one it's cloned from after altering it",getDTO(),clonedFeedDTOImpl);
		// MediumImpl:
		clonedFeedDTOImpl=(FeedDTOImpl) getDTO().clone();
		for(final ArticleDTOImpl articleDTOImpl : clonedFeedDTOImpl.getArticleDTOs()) {
			for(final MediumDTOImpl mediumDTOImpl : articleDTOImpl.getMediumDTOs()) {
				mediumDTOImpl.setSize(System.currentTimeMillis());
				break;
			}
			break;
		}
		Assert.assertNotEquals("The clone should not be equal to the one it's cloned from after altering it",getDTO(),clonedFeedDTOImpl);
		// MediumTypeImpl:
		clonedFeedDTOImpl=(FeedDTOImpl) getDTO().clone();
		for(final ArticleDTOImpl articleDTOImpl : clonedFeedDTOImpl.getArticleDTOs()) {
			for(final MediumDTOImpl mediumDTOImpl : articleDTOImpl.getMediumDTOs()) {
				mediumDTOImpl.getMediumTypeDTO().setType(String.valueOf(System.currentTimeMillis()));
				break;
			}
			break;
		}
		Assert.assertNotEquals("The clone should not be equal to the one it's cloned from after altering it",getDTO(),clonedFeedDTOImpl);
	}

}


text:
<?php

namespace Subbly\CMS\Controllers\Api;

class WelcomeController extends BaseController
{
    /**
     * The constructor.
     */
    public function __construct()
    {
        parent::__construct();

        $this->beforeFilter('@processAuthentication');
    }

    /**
     * Return stats for the dashboard.
     *
     * @route GET /api/v1/welcome
     * @authentication required
     */
    public function index()
    {
        return $this->jsonResponse('ok');
    }
}


text:
require "mixlib/shellout"

module PumaRunner
  class Base

    attr_accessor :config, :binder, :app, :events, :server, :pid

    def initialize
      @events     = PidEvents.new($stdout, $stderr)
      @config     = load_config()
      @pid        = Pid.new(config.options[:pidfile])

      @daemon_starter = DaemonStarter.new(pid.pid_dir, File.basename(pid.pid_file))
    end

    def rails_root
      @config.options[:directory]
    end

    def rails_env
      @config.options[:environment]
    end

    def log(str)
      events.log(str)
    end

    def error(str)
      events.error(str)
    end

    def debug(str)
      events.debug(str)
    end

    # Load and validate configuration from PUMA_CONF
    #
    # @return [Puma::Configuration] config
    def load_config
      # defaults from Puma::CLI
      options = {
        :min_threads => 0,
        :max_threads => 16,
        :quiet       => false,
        :debug       => false,
        :binds       => [],
        :workers     => 0,
        :daemon      => false,
        :worker_boot => [],

        # custom defaults (differ from Puma)
        :redirect_append => true,
        :config_file     => File.join("config", "deploy", "puma.conf.rb")
      }

      config = Puma::Configuration.new(options)
      config.load

      if not config.app_configured? then
        error "Rails app not configured!"
        exit 1
      end

      config
    end

    # Attempt to bind to sockets
    #
    # @return [Puma::Binder]
    def bind_sockets
      binds = config.options[:binds]
      debug "* Binding to #{binds.inspect}"

      binder = PumaRunner::SocketBinder.new(events)
      binder.import_from_env    # always try to import, if they are there
      binder.import_from_socket
      binder.parse(binds, events) # not sure why we need events again

      binder
    end

    # Export the file descriptors into the ENV for use by child processes
    #
    # @return [Hash] FD redirect options for Kernel.exec
    def export_fds
      redirects = {:close_others => true}
      if not self.binder then
        return redirects
      end
      self.binder.listeners.each_with_index do |(bind,io),i|
        ENV["PUMA_INHERIT_#{i}"] = "#{io.to_i}:#{bind}"
        redirects[io.to_i] = io.to_i
      end
      redirects
    end

    def respawn_child
      respawn_child_exec()
      # respawn_child_fork()
    end

    def respawn_child_exec
      @socket_passer = SocketPasser.new(self.binder)
      if !@socket_passer.test_sockets then
        log "* [FATAL] listener sockets failed test; exiting"
        exit 1
      end
      @socket_passer.start

      runner = File.join(rails_root, "script", "puma")
      child_pid = rvm_exec("#{runner} server")
      Process.detach(child_pid)

      log "* started server process #{child_pid}, waiting for it to initialize..."

      return child_pid
    end

    # Execute a command using rvm_wrapper.sh
    #
    # Wipes all traces of the currently running ruby version in favor of the version configured
    # in bixby.yml. This is to allow restarting across ruby versions
    #
    # @param [String] cmd
    #
    # @return [Fixnum] child PID
    def rvm_exec(cmd)
      conf = YAML.load_file(File.join(rails_root, "config", "bixby.yml"))[rails_env]
      env = {
        "USE_RUBY_VERSION"   => conf["ruby"],
        "USE_RVM"            => (conf["rvm"] == "system" ? "system" : conf["user"]),
        "_ORIGINAL_GEM_PATH" => nil,
        "BUNDLE_BIN_PATH"    => nil,
        "RUBYOPT"            => nil,
        "RUBYLIB"            => nil,
        "PATH"               => ENV["PATH"].split(/:/).reject{ |s| s =~ %r{\.rvm|/usr/local/rvm} }.join(":"),
        "RUN_IN_BG"          => "1",
        "PUMA_INHERIT_SOCK"  => ENV["PUMA_INHERIT_SOCK"]
      }

      rvm_wrapper = File.join(rails_root, "config", "deploy", "rvm_wrapper.sh")
      full_cmd = "#{rvm_wrapper} #{cmd}"

      cmd = nil
      log "* chdir to #{rails_root}"
      Dir.chdir(rails_root) do
        Bundler.with_clean_env do
          # do extra env cleanup, on top of our custom env created above
          cmd = Mixlib::ShellOut.new(full_cmd, :environment => env)
          cmd.run_command
        end
      end

      if cmd.error? then
        msg = "server start failed with exit code #{cmd.status.exitstatus}\n"
        msg += "  command was: #{full_cmd}\n"
        msg += "  stdout/stderr:\n"
        msg += "    " + cmd.stdout.gsub(/\n/, "    \n") if cmd.stdout && !cmd.stdout.strip.empty?
        msg += "    " + cmd.stderr.gsub(/\n/, "    \n") if cmd.stderr && !cmd.stderr.strip.empty?
        error msg
        exit 1
      end

      s = cmd.stdout.strip
      if s.to_i.to_s == s then
        return s.to_i # the real pid is returned from the script, assuming it ran successfully
      end

      return cmd.status.pid
    end

    # Spawn the child process in a subshell
    #
    # @return [Fixnum] new child pid
    def respawn_child_fork
      cmd = File.join(self.rails_root, "script", "puma") + " server"
      redirects = export_fds()
      child_pid = fork { Dir.chdir(self.rails_root); exec(cmd, redirects) }
      Process.detach(child_pid)

      log "* started server process #{child_pid}"

      return child_pid
    end

  end # Base
end # PumaRunner


text:
:- module(extract_failed_translations,
	  [extract_failed_translations/3]
	 ).

:- use_module('$REGULUS/Prolog/regulus_utilities').
:- use_module('$REGULUS/PrologLib/utilities').
:- use_module(library(lists)).

%----------------------------------------------------------------------

extract_failed_translations(InFile, OutFile, PrologOrText) :-
	absolute_file_name(InFile, AbsInFile),
	absolute_file_name(OutFile, AbsOutFile),

	prolog_file_to_list(AbsInFile, InList),
	length(InList, NInList),
	format('~N--- Read file (~d records): ~w~n', [NInList, AbsInFile]),

	extract_failed_translations1(InList, OutList),
	length(OutList, NOutList),

	open(AbsOutFile, write, S),
	print_failed_translations(OutList, S, PrologOrText),
	close(S),
	format('~N--- Written file (~d records): ~w~n', [NOutList, AbsOutFile]).
extract_failed_translations(InFile, OutFile, PrologOrText) :-
	format2error('~N*** Error: bad call: ~w~n',
		     [extract_failed_translations(InFile, OutFile, PrologOrText)]),
	fail.

extract_failed_translations1([], []).
extract_failed_translations1([F | R], [Source | R1]) :-
	extract_failed_translation(F, Source),
	!,
	extract_failed_translations1(R, R1).
extract_failed_translations1([_F | R], R1) :-
	!,
	extract_failed_translations1(R, R1).

extract_failed_translation(Record, RealSource) :-
	Record = translation(Source, _Target, _Info, Judgement),
	member(Judgement, [error]),
	(   Source = RealSource+_Context ->
	    true
	;
	    otherwise ->
	    RealSource = Source
	),
	!.

print_failed_translations([], _S, _PrologOrText).
print_failed_translations([F | R], S, PrologOrText) :-
	print_failed_translation(F, S, PrologOrText),
	!,
	print_failed_translations(R, S, PrologOrText).

print_failed_translation(SourceAtom, S, text) :-
	format(S, '~N~w~n', [SourceAtom]),
	!.
print_failed_translation(SourceAtom, S, prolog) :-
	format(S, '~N~q.~n', [sent(SourceAtom)]),
	!.


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>The Cowl</title>
		<link>http://bvs.wikidot.com/forum/t-144393/the-cowl</link>
		<description>Posts in the discussion thread "The Cowl" - the last for the best thing</description>
				<copyright></copyright>
		<lastBuildDate>Sun, 10 Jul 2022 05:21:47 +0000</lastBuildDate>

					<item>
				<guid>http://bvs.wikidot.com/forum/t-144393#post-441109</guid>
				<title>Re: The Cowl</title>
				<link>http://bvs.wikidot.com/forum/t-144393/the-cowl#post-441109</link>
				<description></description>
				<pubDate>Mon, 06 Apr 2009 14:20:39 +0000</pubDate>
				<wikidot:authorName>Moare</wikidot:authorName>				<wikidot:authorUserId>79546</wikidot:authorUserId>				<content:encoded>
					<![CDATA[

Awesome abilities count as long as they are activ, which is until you restat

				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://bvs.wikidot.com/forum/t-144393#post-441102</guid>
				<title>Re: the COWL</title>
				<link>http://bvs.wikidot.com/forum/t-144393/the-cowl#post-441102</link>
				<description></description>
				<pubDate>Mon, 06 Apr 2009 14:17:55 +0000</pubDate>
				<wikidot:authorName>D0NC35</wikidot:authorName>								<content:encoded>
					<![CDATA[

if u buy that awesome ability its for all mission per season or limited ?

i need more much time to get cowl of 2nd hocage.

				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://bvs.wikidot.com/forum/t-144393#post-441001</guid>
				<title>Re: the COWL</title>
				<link>http://bvs.wikidot.com/forum/t-144393/the-cowl#post-441001</link>
				<description></description>
				<pubDate>Mon, 06 Apr 2009 12:33:30 +0000</pubDate>
				<wikidot:authorName>Ren Po Ken</wikidot:authorName>				<wikidot:authorUserId>103468</wikidot:authorUserId>				<content:encoded>
					<![CDATA[

60000 Ryo a Day

fixed

Although there is no point in going past 10 drinks (50%) since MPH rounds down.

				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://bvs.wikidot.com/forum/t-144393#post-440954</guid>
				<title>Re: The Cowl</title>
				<link>http://bvs.wikidot.com/forum/t-144393/the-cowl#post-440954</link>
				<description></description>
				<pubDate>Mon, 06 Apr 2009 11:19:00 +0000</pubDate>
				<wikidot:authorName>Moare</wikidot:authorName>				<wikidot:authorUserId>79546</wikidot:authorUserId>				<content:encoded>
					<![CDATA[

Permanent Item: Cowl of the Second HoCage: +5 MPH

Awesome Abillity: Limitless Focus Lvl. 2 or 3: +3 MPH

Juice: Rack on the Rocks: +5% per juice. Max +60% (Not nesseary to go past +50%)

Total: 12,8 MPH ≈ 12 MPH

This requires

Season 3+

90 Awesome

60000 Ryo per day

				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://bvs.wikidot.com/forum/t-144393#post-440687</guid>
				<title>Re: the COWL</title>
				<link>http://bvs.wikidot.com/forum/t-144393/the-cowl#post-440687</link>
				<description></description>
				<pubDate>Mon, 06 Apr 2009 02:03:01 +0000</pubDate>
				<wikidot:authorName>D0NC35</wikidot:authorName>								<content:encoded>
					<![CDATA[

my cowl only give me +1 mph.
 can u teach me how to get +12 mph ?
 tq

				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://bvs.wikidot.com/forum/t-144393#post-440314</guid>
				<title>Re: the COWL</title>
				<link>http://bvs.wikidot.com/forum/t-144393/the-cowl#post-440314</link>
				<description></description>
				<pubDate>Sun, 05 Apr 2009 14:51:41 +0000</pubDate>
				<wikidot:authorName>1337</wikidot:authorName>								<content:encoded>
					<![CDATA[

actually, it's possible to get around 12 mph per mission if you know how to.

				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://bvs.wikidot.com/forum/t-144393#post-440305</guid>
				<title>Re: the COWL</title>
				<link>http://bvs.wikidot.com/forum/t-144393/the-cowl#post-440305</link>
				<description></description>
				<pubDate>Sun, 05 Apr 2009 14:39:27 +0000</pubDate>
				<wikidot:authorName>D0NC35</wikidot:authorName>								<content:encoded>
					<![CDATA[

i not know why.
 but, i am not lose any stamina at burger mission but not for wasteland mission.

and

7.500 mph for activated the favor ??? with only +1 mph/mission, when i can get this favor with its looping :(

				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://bvs.wikidot.com/forum/t-144393#post-439564</guid>
				<title>Re: the COWL + the STORM</title>
				<link>http://bvs.wikidot.com/forum/t-144393/the-cowl#post-439564</link>
				<description></description>
				<pubDate>Sat, 04 Apr 2009 11:37:31 +0000</pubDate>
				<wikidot:authorName>D0NC35</wikidot:authorName>								<content:encoded>
					<![CDATA[

ahh yes.. i just got THE STORM MENU.
 what it is favor ability ? how i use it ? how about for the 1st time i got it just like now, can i use 1 of that favor immediatly or has to wait for 7.500 MPH ? ( i wont make it when my loop timer running now ).

				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://bvs.wikidot.com/forum/t-144393#post-439377</guid>
				<title>Re: the COWL</title>
				<link>http://bvs.wikidot.com/forum/t-144393/the-cowl#post-439377</link>
				<description></description>
				<pubDate>Sat, 04 Apr 2009 02:59:12 +0000</pubDate>
				<wikidot:authorName>Swan21</wikidot:authorName>				<wikidot:authorUserId>93166</wikidot:authorUserId>				<content:encoded>
					<![CDATA[

The cowl is EXTREMELY valuable. The faster your storm gets because of your cowl the more storm favors you can get, and Storm Favors are excellent.

				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://bvs.wikidot.com/forum/t-144393#post-439374</guid>
				<title>the COWL</title>
				<link>http://bvs.wikidot.com/forum/t-144393/the-cowl#post-439374</link>
				<description></description>
				<pubDate>Sat, 04 Apr 2009 02:55:55 +0000</pubDate>
				<wikidot:authorName>d0nc35</wikidot:authorName>								<content:encoded>
					<![CDATA[

this boots + cowl is useless.

why u need to play waste mission if u can do another high mission ?

the only reason for this thing is eye of the storm bloodline.

Obtain Cowl

Perhaps the most important item after you complete Wasteland will be your cowl. Your cowl powers up your Storm's power later on for the Eye of the Storm bloodline. The better the cowl, the more powerful your storm. However, any cowl will do for now in order to progress.

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


text:
package org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.plans;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.io.PrintStream;

import org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.MapReduceOper;
import org.apache.pig.backend.hadoop.executionengine.physicalLayer.PhysicalOperator;
import org.apache.pig.backend.hadoop.executionengine.physicalLayer.plans.PhysicalPlan;
import org.apache.pig.backend.hadoop.executionengine.physicalLayer.plans.PlanPrinter;
import org.apache.pig.impl.plan.DepthFirstWalker;
import org.apache.pig.impl.plan.VisitorException;

/**
 * A visitor mechanism printing out the logical plan.
 */
public class MRPrinter extends MROpPlanVisitor {

    private PrintStream mStream = null;
    private boolean isVerbose = true;

    /**
     * @param ps PrintStream to output plan information to
     * @param plan MR plan to print
     */
    public MRPrinter(PrintStream ps, MROperPlan plan) {
        super(plan, new DepthFirstWalker<MapReduceOper, MROperPlan>(plan));
        mStream = ps;
        mStream.println("#--------------------------------------------------");
        mStream.println("# Map Reduce Plan                                  ");
        mStream.println("#--------------------------------------------------");
    }

    public void setVerbose(boolean verbose) {
        isVerbose = verbose;
    }

    @Override
    public void visitMROp(MapReduceOper mr) throws VisitorException {
        mStream.println("MapReduce node " + mr.getOperatorKey().toString());
        if (mr.mapPlan != null && mr.mapPlan.size() > 0) {
            mStream.println("Map Plan");
            PlanPrinter<PhysicalOperator, PhysicalPlan> printer = new PlanPrinter<PhysicalOperator, PhysicalPlan>(mr.mapPlan, mStream);
            printer.setVerbose(isVerbose);
            printer.visit();
            mStream.println("--------");
        }
        if (mr.combinePlan != null && mr.combinePlan.size() > 0) {
            mStream.println("Combine Plan");
            PlanPrinter<PhysicalOperator, PhysicalPlan> printer = new PlanPrinter<PhysicalOperator, PhysicalPlan>(mr.combinePlan, mStream);
            printer.setVerbose(isVerbose);
            printer.visit();
            mStream.println("--------");
        }
        if (mr.reducePlan != null && mr.reducePlan.size() > 0) {
            mStream.println("Reduce Plan");
            PlanPrinter<PhysicalOperator, PhysicalPlan> printer = new PlanPrinter<PhysicalOperator, PhysicalPlan>(mr.reducePlan, mStream);
            printer.setVerbose(isVerbose);
            printer.visit();
            mStream.println("--------");
        }
        mStream.println("Global sort: " + mr.isGlobalSort());
        if (mr.getQuantFile() != null) {
            mStream.println("Quantile file: " + mr.getQuantFile());
        }
        if (mr.getUseSecondaryKey())
            mStream.println("Secondary sort: " + mr.getUseSecondaryKey());
        mStream.println("----------------");
        mStream.println("");
    }
}