text:
package edu.umd.cs.findbugs.ba.npe;

import java.util.Map;
import java.util.Set;

import org.apache.bcel.generic.ACONST_NULL;
import org.apache.bcel.generic.ANEWARRAY;
import org.apache.bcel.generic.CHECKCAST;
import org.apache.bcel.generic.ConstantPoolGen;
import org.apache.bcel.generic.GETFIELD;
import org.apache.bcel.generic.GETSTATIC;
import org.apache.bcel.generic.INVOKEINTERFACE;
import org.apache.bcel.generic.INVOKESPECIAL;
import org.apache.bcel.generic.INVOKESTATIC;
import org.apache.bcel.generic.INVOKEVIRTUAL;
import org.apache.bcel.generic.Instruction;
import org.apache.bcel.generic.InvokeInstruction;
import org.apache.bcel.generic.LDC;
import org.apache.bcel.generic.LDC2_W;
import org.apache.bcel.generic.MULTIANEWARRAY;
import org.apache.bcel.generic.NEW;
import org.apache.bcel.generic.NEWARRAY;
import org.apache.bcel.generic.PUTFIELD;
import org.apache.bcel.generic.ReferenceType;
import org.apache.bcel.generic.Type;

import edu.umd.cs.findbugs.OpcodeStack.Item;
import edu.umd.cs.findbugs.SystemProperties;
import edu.umd.cs.findbugs.ba.AbstractFrameModelingVisitor;
import edu.umd.cs.findbugs.ba.AnalysisContext;
import edu.umd.cs.findbugs.ba.AssertionMethods;
import edu.umd.cs.findbugs.ba.DataflowAnalysisException;
import edu.umd.cs.findbugs.ba.Hierarchy2;
import edu.umd.cs.findbugs.ba.Location;
import edu.umd.cs.findbugs.ba.NullnessAnnotation;
import edu.umd.cs.findbugs.ba.XFactory;
import edu.umd.cs.findbugs.ba.XField;
import edu.umd.cs.findbugs.ba.XMethod;
import edu.umd.cs.findbugs.ba.deref.UnconditionalValueDerefAnalysis;
import edu.umd.cs.findbugs.ba.type.TypeDataflow;
import edu.umd.cs.findbugs.ba.type.TypeFrame;
import edu.umd.cs.findbugs.ba.vna.AvailableLoad;
import edu.umd.cs.findbugs.ba.vna.ValueNumber;
import edu.umd.cs.findbugs.ba.vna.ValueNumberAnalysisFeatures;
import edu.umd.cs.findbugs.ba.vna.ValueNumberDataflow;
import edu.umd.cs.findbugs.ba.vna.ValueNumberFrame;

public class IsNullValueFrameModelingVisitor extends AbstractFrameModelingVisitor<IsNullValue, IsNullValueFrame> {

    private static final boolean NO_ASSERT_HACK = SystemProperties.getBoolean("inva.noAssertHack");

    private static final boolean MODEL_NONNULL_RETURN = SystemProperties.getBoolean("fnd.modelNonnullReturn", true);

    private final AssertionMethods assertionMethods;

    private final ValueNumberDataflow vnaDataflow;

    private final TypeDataflow typeDataflow;

    private final boolean trackValueNumbers;

    private int slotContainingNewNullValue;

    public IsNullValueFrameModelingVisitor(ConstantPoolGen cpg, AssertionMethods assertionMethods,
            ValueNumberDataflow vnaDataflow, TypeDataflow typeDataflow, boolean trackValueNumbers) {
        super(cpg);
        this.assertionMethods = assertionMethods;
        this.vnaDataflow = vnaDataflow;
        this.trackValueNumbers = trackValueNumbers;
        this.typeDataflow = typeDataflow;
    }

    /*
     * (non-Javadoc)
     *
     * @see
     * edu.umd.cs.findbugs.ba.AbstractFrameModelingVisitor#analyzeInstruction
     * (org.apache.bcel.generic.Instruction)
     */
    @Override
    public void analyzeInstruction(Instruction ins) throws DataflowAnalysisException {
        if (!getFrame().isValid())
            return;
        slotContainingNewNullValue = -1;
        super.analyzeInstruction(ins);
        if (!getFrame().isValid())
            return;

        if (!NO_ASSERT_HACK) {
            if (assertionMethods.isAssertionHandle(getLocation().getHandle(), cpg)) {
                IsNullValueFrame frame = getFrame();
                for (int i = 0; i < frame.getNumSlots(); ++i) {
                    IsNullValue value = frame.getValue(i);
                    if (value.isDefinitelyNull() || value.isNullOnSomePath()) {
                        frame.setValue(i, IsNullValue.nonReportingNotNullValue());
                    }
                }
                for (Map.Entry<ValueNumber, IsNullValue> e : frame.getKnownValueMapEntrySet()) {
                    IsNullValue value = e.getValue();
                    if (value.isDefinitelyNull() || value.isNullOnSomePath())
                        e.setValue(IsNullValue.nonReportingNotNullValue());

                }
            }
        }

    }

    /**
     * @return Returns the slotContainingNewNullValue; or -1 if no new null
     *         value was produced
     */
    public int getSlotContainingNewNullValue() {
        return slotContainingNewNullValue;
    }

    @Override
    public IsNullValue getDefaultValue() {
        return IsNullValue.nonReportingNotNullValue();
    }

    // Overrides of specific instruction visitor methods.
    // ACONST_NULL obviously produces a value that is DEFINITELY NULL.
    // LDC produces values that are NOT NULL.
    // NEW produces values that are NOT NULL.

    // Note that all instructions that have an implicit null
    // check (field access, invoke, etc.) are handled in IsNullValueAnalysis,
    // because handling them relies on control flow (the existence of
    // an ETB and exception edge prior to the block containing the
    // instruction with the null check.)

    // Note that we don't override IFNULL and IFNONNULL.
    // Those are handled in the analysis itself, because we need
    // to produce different values in each of the control successors.

    private void produce(IsNullValue value) {
        IsNullValueFrame frame = getFrame();
        frame.pushValue(value);
        newValueOnTOS();
    }

    private void produce2(IsNullValue value) {
        IsNullValueFrame frame = getFrame();
        frame.pushValue(value);
        frame.pushValue(value);
    }

    /**
     * Handle method invocations. Generally, we want to get rid of null
     * information following a call to a likely exception thrower or assertion.
     */
    private void handleInvoke(InvokeInstruction obj) {
        Type returnType = obj.getReturnType(getCPG());

        Location location = getLocation();

        if (trackValueNumbers)
            try {
                ValueNumberFrame vnaFrame = vnaDataflow.getFactAtLocation(location);
                Set<ValueNumber> nonnullParameters = UnconditionalValueDerefAnalysis.checkAllNonNullParams(location, vnaFrame,
                        cpg, null, null, typeDataflow);

                if (!nonnullParameters.isEmpty()) {
                    IsNullValue kaboom = IsNullValue.noKaboomNonNullValue(location);
                    IsNullValueFrame frame = getFrame();
                    for (ValueNumber vn : nonnullParameters) {
                        IsNullValue knownValue = frame.getKnownValue(vn);
                        if (knownValue != null && knownValue.mightBeNull()) {
                            if (knownValue.isDefinitelyNull()) {
                                frame.setTop();
                                return;
                            }
                            frame.setKnownValue(vn, kaboom);
                        }
                        for (int i = 0; i < vnaFrame.getNumSlots(); i++) {
                            IsNullValue value = frame.getValue(i);
                            if (vnaFrame.getValue(i).equals(vn) && value.mightBeNull()) {
                                frame.setValue(i, kaboom);
                                if (value.isDefinitelyNull()) {
                                    frame.setTop();
                                    return;
                                }
                            }
                        }
                    }

                }
            } catch (DataflowAnalysisException e) {
                AnalysisContext.logError("Error looking up nonnull parameters for invoked method", e);
            }
       // Determine if we are going to model the return value of this call.
        boolean modelCallReturnValue = MODEL_NONNULL_RETURN && returnType instanceof ReferenceType;

        if (!modelCallReturnValue) {
            // Normal case: Assume returned values are non-reporting non-null.
            handleNormalInstruction(obj);
        } else {
            // Special case: some special value is pushed on the stack for the
            // return value
            IsNullValue result = null;
            TypeFrame typeFrame;
            try {
                typeFrame = typeDataflow.getFactAtLocation(location);

                Set<XMethod> targetSet = Hierarchy2.resolveMethodCallTargets(obj, typeFrame, cpg);

                if (targetSet.isEmpty()) {
                    XMethod calledMethod = XFactory.createXMethod(obj, getCPG());
                    result = getReturnValueNullness(calledMethod);
                } else for (XMethod calledMethod : targetSet) {
                    IsNullValue pushValue = getReturnValueNullness(calledMethod);
                    if (result == null)
                        result = pushValue;
                    else
                        result = IsNullValue.merge(result, pushValue);
                }
            } catch (DataflowAnalysisException e) {
                result = IsNullValue.nonReportingNotNullValue();
            } catch (ClassNotFoundException e) {
                result = IsNullValue.nonReportingNotNullValue();
            }
            modelInstruction(obj, getNumWordsConsumed(obj), getNumWordsProduced(obj), result);
            newValueOnTOS();
        }

    }

    public IsNullValue getReturnValueNullness(XMethod calledMethod) {
        IsNullValue pushValue;
        if (IsNullValueAnalysis.DEBUG)
            System.out.println("Check " + calledMethod + " for null return...");
        NullnessAnnotation annotation = AnalysisContext.currentAnalysisContext().getNullnessAnnotationDatabase()
                .getResolvedAnnotation(calledMethod, false);
        Boolean alwaysNonNull = AnalysisContext.currentAnalysisContext().getReturnValueNullnessPropertyDatabase()
                .getProperty(calledMethod.getMethodDescriptor());
        if (annotation == NullnessAnnotation.CHECK_FOR_NULL) {
            if (IsNullValueAnalysis.DEBUG) {
                System.out.println("Null value returned from " + calledMethod);
            }
            pushValue = IsNullValue.nullOnSimplePathValue().markInformationAsComingFromReturnValueOfMethod(
                    calledMethod);
        } else if (annotation == NullnessAnnotation.NULLABLE) {
            pushValue = IsNullValue.nonReportingNotNullValue();
        } else if (annotation == NullnessAnnotation.NONNULL
                || (alwaysNonNull != null && alwaysNonNull.booleanValue())) {
            // Method is declared NOT to return null
            if (IsNullValueAnalysis.DEBUG) {
                System.out.println("NonNull value return from " + calledMethod);
            }
            pushValue = IsNullValue.nonNullValue().markInformationAsComingFromReturnValueOfMethod(calledMethod);

        } else {
            pushValue = IsNullValue.nonReportingNotNullValue();
        }
        return pushValue;
    }

    /**
     * Hook indicating that a new (possibly-null) value is on the top of the
     * stack.
     */
    private void newValueOnTOS() {
        IsNullValueFrame frame = getFrame();
        if (frame.getStackDepth() < 1) {
            return;
        }
        int tosSlot = frame.getNumSlots() - 1;
        IsNullValue tos = frame.getValue(tosSlot);
        if (tos.isDefinitelyNull()) {
            slotContainingNewNullValue = tosSlot;
        }
        if (trackValueNumbers) {
            try {
                ValueNumberFrame vnaFrameAfter = vnaDataflow.getFactAfterLocation(getLocation());
                if (vnaFrameAfter.isValid()) {
                    ValueNumber tosVN = vnaFrameAfter.getTopValue();
                    getFrame().setKnownValue(tosVN, tos);
                }
            } catch (DataflowAnalysisException e) {
                AnalysisContext.logError("error", e);
            }
        }
    }

    @Override
    public void visitPUTFIELD(PUTFIELD obj) {
        if (getNumWordsConsumed(obj) != 2) {
            super.visitPUTFIELD(obj);
            return;
        }

        IsNullValue nullValueStored = null;
        try {
            nullValueStored = getFrame().getTopValue();
        } catch (DataflowAnalysisException e1) {
            AnalysisContext.logError("Oops", e1);
        }
        super.visitPUTFIELD(obj);
        XField field = XFactory.createXField(obj, cpg);
        if (nullValueStored != null && ValueNumberAnalysisFeatures.REDUNDANT_LOAD_ELIMINATION)
            try {
                ValueNumberFrame vnaFrameBefore = vnaDataflow.getFactAtLocation(getLocation());
                ValueNumber refValue = vnaFrameBefore.getStackValue(1);
                AvailableLoad load = new AvailableLoad(refValue, field);
                ValueNumberFrame vnaFrameAfter = vnaDataflow.getFactAfterLocation(getLocation());
                ValueNumber[] newValueNumbersForField = vnaFrameAfter.getAvailableLoad(load);
                if (newValueNumbersForField != null && trackValueNumbers)
                    for (ValueNumber v : newValueNumbersForField)
                        getFrame().setKnownValue(v, nullValueStored);
            } catch (DataflowAnalysisException e) {
                AnalysisContext.logError("Oops", e);
            }
    }

    @Override
    public void visitGETFIELD(GETFIELD obj) {
        if (getNumWordsProduced(obj) != 1) {
            super.visitGETFIELD(obj);
            return;
        }

        if (checkForKnownValue(obj)) {
            return;
        }

        XField field = XFactory.createXField(obj, cpg);

        NullnessAnnotation annotation = AnalysisContext.currentAnalysisContext().getNullnessAnnotationDatabase()
                .getResolvedAnnotation(field, false);
        if (annotation == NullnessAnnotation.NONNULL) {
            modelNormalInstruction(obj, getNumWordsConsumed(obj), 0);
            produce(IsNullValue.nonNullValue());
        } else if (annotation == NullnessAnnotation.CHECK_FOR_NULL) {
            modelNormalInstruction(obj, getNumWordsConsumed(obj), 0);
            produce(IsNullValue.nullOnSimplePathValue().markInformationAsComingFromFieldValue(field));
        } else {

            super.visitGETFIELD(obj);
        }

    }

    /*
     * (non-Javadoc)
     *
     * @see
     * edu.umd.cs.findbugs.ba.AbstractFrameModelingVisitor#visitGETSTATIC(org
     * .apache.bcel.generic.GETSTATIC)
     */
    @Override
    public void visitGETSTATIC(GETSTATIC obj) {
        if (getNumWordsProduced(obj) != 1) {
            super.visitGETSTATIC(obj);
            return;
        }

        if (checkForKnownValue(obj)) {
            return;
        }
        XField field = XFactory.createXField(obj, cpg);
        if (field.isFinal()) {
            Item summary = AnalysisContext.currentAnalysisContext().getFieldSummary().getSummary(field);
            if (summary.isNull()) {
                produce(IsNullValue.nullValue());
                return;
            }
        }
        if (field.getClassName().equals("java.util.logging.Level") && field.getName().equals("SEVERE")
                || field.getClassName().equals("org.apache.log4j.Level")
                && (field.getName().equals("ERROR") || field.getName().equals("FATAL")))
            getFrame().toExceptionValues();

        if (field.getName().startsWith("class$")) {
            produce(IsNullValue.nonNullValue());
            return;
        }
        NullnessAnnotation annotation = AnalysisContext.currentAnalysisContext().getNullnessAnnotationDatabase()
                .getResolvedAnnotation(field, false);
        if (annotation == NullnessAnnotation.NONNULL) {
            modelNormalInstruction(obj, getNumWordsConsumed(obj), 0);
            produce(IsNullValue.nonNullValue());
        } else if (annotation == NullnessAnnotation.CHECK_FOR_NULL) {
            modelNormalInstruction(obj, getNumWordsConsumed(obj), 0);
            produce(IsNullValue.nullOnSimplePathValue().markInformationAsComingFromFieldValue(field));
        } else {

            super.visitGETSTATIC(obj);
        }
    }

    /**
     * Check given Instruction to see if it produces a known value. If so, model
     * the instruction and return true. Otherwise, do nothing and return false.
     * Should only be used for instructions that produce a single value on the
     * top of the stack.
     *
     * @param obj
     *            the Instruction the instruction
     * @return true if the instruction produced a known value and was modeled,
     *         false otherwise
     */
    private boolean checkForKnownValue(Instruction obj) {
        if (trackValueNumbers) {
            try {
                // See if the value number loaded here is a known value
                ValueNumberFrame vnaFrameAfter = vnaDataflow.getFactAfterLocation(getLocation());
                if (vnaFrameAfter.isValid()) {
                    ValueNumber tosVN = vnaFrameAfter.getTopValue();
                    IsNullValue knownValue = getFrame().getKnownValue(tosVN);
                    if (knownValue != null) {
                        // System.out.println("Produce known value!");
                        // The value produced by this instruction is known.
                        // Push the known value.
                        modelNormalInstruction(obj, getNumWordsConsumed(obj), 0);
                        produce(knownValue);
                        return true;
                    }
                }
            } catch (DataflowAnalysisException e) {
                // Ignore...
            }
        }
        return false;
    }

    @Override
    public void visitACONST_NULL(ACONST_NULL obj) {
        produce(IsNullValue.nullValue());
    }

    @Override
    public void visitNEW(NEW obj) {
        produce(IsNullValue.nonNullValue());
    }

    @Override
    public void visitNEWARRAY(NEWARRAY obj) {
        modelNormalInstruction(obj, getNumWordsConsumed(obj), 0);
        produce(IsNullValue.nonNullValue());
    }

    @Override
    public void visitANEWARRAY(ANEWARRAY obj) {
        modelNormalInstruction(obj, getNumWordsConsumed(obj), 0);
        produce(IsNullValue.nonNullValue());
    }

    @Override
    public void visitMULTIANEWARRAY(MULTIANEWARRAY obj) {
        modelNormalInstruction(obj, getNumWordsConsumed(obj), 0);
        produce(IsNullValue.nonNullValue());
    }

    @Override
    public void visitLDC(LDC obj) {
        produce(IsNullValue.nonNullValue());
    }

    @Override
    public void visitLDC2_W(LDC2_W obj) {
        produce2(IsNullValue.nonNullValue());
    }

    @Override
    public void visitCHECKCAST(CHECKCAST obj) {
        // Do nothing
    }

    @Override
    public void visitINVOKESTATIC(INVOKESTATIC obj) {
        handleInvoke(obj);
    }

    @Override
    public void visitINVOKESPECIAL(INVOKESPECIAL obj) {
        handleInvoke(obj);
    }

    @Override
    public void visitINVOKEINTERFACE(INVOKEINTERFACE obj) {
        handleInvoke(obj);
    }

    @Override
    public void visitINVOKEVIRTUAL(INVOKEVIRTUAL obj) {
        handleInvoke(obj);
    }

}

// vim:ts=4


text:
package org.dozer.vo.inheritance;

public class AnotherSubClass extends AnotherBaseClass {

  private String subAttribute;
  private java.util.List subList;
  private SClass sClass;
  private SClass sClass2;

  public String getSubAttribute() {
    return subAttribute;
  }

  public void setSubAttribute(String subAttribute) {
    this.subAttribute = subAttribute;
  }

  public java.util.List getSubList() {
    return subList;
  }

  public void setSubList(java.util.List subList) {
    this.subList = subList;
  }

  public SClass getSClass() {
    return sClass;
  }

  public void setSClass(SClass class1) {
    sClass = class1;
  }

  public SClass getSClass2() {
    return sClass2;
  }

  public void setSClass2(SClass class2) {
    sClass2 = class2;
  }

}

redpajama_set_name: RedPajamaGithub


text:
package appc

import (
	"fmt"
)

// SetGroup sets the group the pod will run as in the untarred ACI stored at
// a.CurrentImagePath.
func (m *Manifest) SetGroup(group string) error {
	if group == "" {
		return fmt.Errorf("group cannot be empty")
	}
	if m.manifest.App == nil {
		m.manifest.App = newManifestApp()
	}
	m.manifest.App.Group = group
	return m.save()
}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<title>com.amazon.speech</title>
<meta name="date" content="2016-03-14">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">

com.amazon.speech

Classes

Sdk


text:
`npm install --save angular2-text-equality-validator`
`import { EqualTextValidator } from "angular2-text-equality-validator";`
Add the directive to module

#### Model driven

```html
 <form novalidate [formGroup]="signUpForm">
  <input type="text"
         placeholder="password"
         formControlName="password"
         validateEqualTo="repeatPassword">
  <input type="text" placeholder="confirm" formControlName="repeatPassword">
  <input type="submit" value="Submit" [disabled]="signUpForm.invalid">
  <p *ngIf="signUpForm.get('password').hasError('validateEqual')">Passwords don't match</p>
</form>
```

```js
export class AppComponent {
  signUpForm: FormGroup;

  constructor(public fb: FormBuilder) {
    this.signUpForm = this.fb.group({
      password: [""],
      repeatPassword: [""]
    });
  }
}
```

#### Template driven
```html
<form novalidate #form="ngForm">
  <input type="text"
         placeholder="password"
         ngModel
         validateEqualTo="repeatPassword"
         name="password"
         required
         #passwordControl="ngModel"
  >
  <input type="text" placeholder="confirm" name="repeatPassword" ngModel required>
  <input type="submit" value="Submit" [disabled]="form.invalid">
 <p *ngIf="passwordControl.errors?.validateEqual">Passwords don't match</p>
</form>

```


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>org.jenkins-ci.plugins</groupId>
        <artifactId>plugin</artifactId>
        <!--JENKINS-18537-->
        <version>1.554.1</version>
    </parent>

    <groupId>com.coravy.hudson.plugins.github</groupId>
    <artifactId>github</artifactId>
    <version>1.14.0-SNAPSHOT</version>
    <packaging>hpi</packaging>

    <name>GitHub plugin</name>
    <url>http://wiki.jenkins-ci.org/display/JENKINS/Github+Plugin</url>
    <licenses>
        <license>
            <name>Apache 2</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <developers>
        <developer>
            <id>kohsuke</id>
            <name>Kohsuke Kawaguchi</name>
        </developer>
        <developer>
            <id>juretta</id>
            <name>Stefan Saasen</name>
        </developer>
    </developers>

    <scm>
        <connection>scm:git:git://github.com/jenkinsci/github-plugin.git</connection>
        <developerConnection>scm:git:git@github.com:jenkinsci/github-plugin.git</developerConnection>
        <url>https://github.com/jenkinsci/github-plugin</url>
        <tag>HEAD</tag>
    </scm>

    <issueManagement>
        <system>JIRA</system>
        <url>https://issues.jenkins-ci.org/browse/JENKINS/component/15896</url>
    </issueManagement>

    <properties>
        <maven-compiler-plugin.version>3.3</maven-compiler-plugin.version>
        <maven-release-plugin.version>2.5.1</maven-release-plugin.version>
    </properties>

    <repositories>
        <repository>
            <id>repo.jenkins-ci.org</id>
            <name>Jenkins Repository</name>
            <url>http://repo.jenkins-ci.org/public/</url>
        </repository>
        <repository>
            <id>jgit-repository</id>
            <name>Eclipse JGit Repository</name>
            <url>http://download.eclipse.org/jgit/maven</url>
        </repository>
    </repositories>
    <pluginRepositories>
        <pluginRepository>
            <id>repo.jenkins-ci.org</id>
            <url>http://repo.jenkins-ci.org/public/</url>
        </pluginRepository>
    </pluginRepositories>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>com.google.guava</groupId>
                <artifactId>guava</artifactId>
                <version>11.0.1</version>
            </dependency>
        </dependencies>
    </dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
            <version>3.4</version>
        </dependency>

        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-jdk14</artifactId>
            <version>1.7.7</version>
        </dependency>

        <dependency>
            <groupId>org.jenkins-ci.plugins</groupId>
            <artifactId>github-api</artifactId>
            <version>1.69</version>
        </dependency>

        <dependency>
            <groupId>org.jenkins-ci.plugins</groupId>
            <artifactId>git</artifactId>
            <version>2.0</version>
        </dependency>

        <dependency>
            <groupId>org.eclipse.jgit</groupId>
            <artifactId>org.eclipse.jgit</artifactId>
            <version>0.12.1</version>
        </dependency>

        <dependency>
            <groupId>org.jenkins-ci.plugins</groupId>
            <artifactId>credentials</artifactId>
            <version>1.22</version>
        </dependency>

        <dependency>
            <groupId>org.jenkins-ci.plugins</groupId>
            <artifactId>plain-credentials</artifactId>
            <version>1.1</version>
        </dependency>

        <dependency>
            <groupId>org.jenkins-ci.plugins</groupId>
            <artifactId>multiple-scms</artifactId>
            <version>0.2</version>
            <optional>true</optional>
        </dependency>

        <dependency><!-- exists in the core -->
            <groupId>org.jenkins-ci.modules</groupId>
            <artifactId>instance-identity</artifactId>
            <version>1.3</version>
            <scope>provided</scope>
        </dependency>

        <!--TEST DEPS-->
        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest-all</artifactId>
            <version>1.3</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.12</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.jmock</groupId>
            <artifactId>jmock-junit4</artifactId>
            <version>2.5.1</version>
            <scope>test</scope>
        </dependency>

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

        <dependency>
            <groupId>com.jayway.restassured</groupId>
            <artifactId>rest-assured</artifactId>
            <version>2.4.0</version>
            <scope>test</scope>
        </dependency>

    </dependencies>

    <build>
        <plugins>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.6</source>
                    <target>1.6</target>
                </configuration>
            </plugin>

            <plugin>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <version>2.16</version>
                <executions>
                    <execution>
                        <id>checkstyle</id>
                        <phase>validate</phase>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <encoding>UTF-8</encoding>
                    <failOnViolation>true</failOnViolation>
                    <logViolationsToConsole>true</logViolationsToConsole>
                    <linkXRef>false</linkXRef>
                    <configLocation>
                        src/test/resources/checkstyle/checkstyle-config.xml
                    </configLocation>
                    <suppressionsLocation>
                        src/test/resources/checkstyle/checkstyle-suppressions.xml
                    </suppressionsLocation>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>


text:
USING_NS_CC;

SimpleDPad::SimpleDPad(void)
{
	this->_delegate=NULL;
}

SimpleDPad::~SimpleDPad(void)
{
}

SimpleDPad* SimpleDPad::dPadWithFile(cocos2d::CCString* fileName,float radius)
{
	SimpleDPad* pRet=new SimpleDPad();

	if(pRet&&pRet->initWithFile(fileName,radius)){
		return pRet;
	}else{
		delete pRet;
		pRet=NULL;
		return NULL;
	}
}

bool SimpleDPad::initWithFile(cocos2d::CCString *filename,float radius)
{
	if(!CCSprite::initWithFile(filename->getCString())){
		return false;
	}

	this->_radius=radius;
	this->_direction=CCPointZero;
	this->_isHeld=false;
	this->scheduleUpdate();

	return true;
}

void SimpleDPad::onEnterTransitionDidFinish()
{
	CCDirector::sharedDirector()->getTouchDispatcher()->addTargetedDelegate(this,0,true); //×¢²áµ¥µã´¥Ãþ
}

void SimpleDPad::onExit()
{
	CCDirector::sharedDirector()->getTouchDispatcher()->removeDelegate(this); //×¢Ïú´¥Ãþ
}

void SimpleDPad::update(float dt)
{
	if(this->_isHeld){
		this->_delegate->isHoldingDirector(this,this->_direction);
	}
}

bool SimpleDPad::ccTouchBegan(cocos2d::CCTouch *pTouch,cocos2d::CCEvent *pEvent)
{
	float distanceSQ=ccpDistanceSQ(pTouch->getLocation(),this->getPosition()); //Á½µã¼ä¾àÀëµÄƽ·½

	if(distanceSQ<=this->_radius*this->_radius){
		this->updateDirectionForTouchLocation(pTouch->getLocation());
		this->_isHeld=true;
		return true;
	}

	return false;
}

void SimpleDPad::ccTouchMoved(cocos2d::CCTouch *pTouch,cocos2d::CCEvent *pEvent)
{
	this->updateDirectionForTouchLocation(pTouch->getLocation());
}

void SimpleDPad::ccTouchEnded(cocos2d::CCTouch *pTouch,cocos2d::CCEvent *pEvent)
{
	this->_direction=CCPointZero;
	this->_isHeld=false;
	this->_delegate->simpleDPadTouchEnded(this);
}

void SimpleDPad::updateDirectionForTouchLocation(cocos2d::CCPoint location)
{
	float radians=ccpToAngle(ccpSub(location,this->getPosition())); //Ç󻡶ÈÖµ
	float degrees=-1*CC_RADIANS_TO_DEGREES(radians); //¸ù¾Ý»¡¶ÈÇó½Ç¶È

	if(degrees>=-22.5&&degrees<=22.5){
		this->_direction=ccp(1,0);
	}
	else if(degrees>22.5&&degrees<67.5)
	{
		this->_direction=ccp(1,-1);
	}
	else if(degrees>=67.5&&degrees<=112.5){
		this->_direction=ccp(0,-1);
	}
	else if(degrees>112.5&&degrees<157.5){
		this->_direction=ccp(-1,-1);
	}
	else if(degrees>=157.5 || degrees<=-157.5){
		this->_direction=ccp(-1,0);
	}
	else if(degrees<-22.5&&degrees>-67.5){
		this->_direction=ccp(1,1);
	}
	else if(degrees<=-67.5&&degrees>=-112.5){
		this->_direction=ccp(0,1);
	}
	else if(degrees<-112.5&&degrees>-157.5){
		this->_direction=ccp(-1,1);
	}

	this->_delegate->didChangeDirectorTo(this,this->_direction);
}


text:
package com.bright.polling.base.message;

import com.bright.polling.base.ConnectFilter;
import java.util.ArrayList;
import java.util.List;

public class MessageWrapper {

    private final String routerType;
    private final String to;
    private final List<String> tos;
    private final PollingMessage message;
    private final ConnectFilter filter;

    public MessageWrapper(String routerType, String to, PollingMessage message) {
        this.routerType = routerType;
        this.to = to;
        this.message = message;
        this.tos = new ArrayList<>();
        this.filter = null;
    }

    public MessageWrapper(String routerType, List<String> tos, PollingMessage message) {
        this.routerType = routerType;
        this.to = "";
        this.message = message;
        this.tos = tos;
        this.filter = null;
    }

    public MessageWrapper(String routerType, ConnectFilter filter, PollingMessage message) {
        this.routerType = routerType;
        this.to = "";
        this.message = message;
        this.tos = new ArrayList<>();
        this.filter = filter;
    }

    public String getRouterType() {
        return routerType;
    }

    public String getTo() {
        return to;
    }

    public PollingMessage getMessage() {
        return message;
    }

    public List<String> getTos() {
        return tos;
    }

    public ConnectFilter getFilter() {
        return filter;
    }

}


text:
<?php

/**
 * @version 1.0.0
 */

namespace App\Themes\CoreTheme\Controllers\Ajax;

use Symfony\Component\HttpFoundation\Response;
use NewsHour\WPCoreThemeComponents\Contexts\Context;
use NewsHour\WPCoreThemeComponents\Controllers\Controller;

/**
 * A controller for AJAX requests. See the RoutesManager class for
 * setting up AJAX routes.
 */
class AjaxController extends Controller
{
    // The Context object.
    private Context $context;

    /**
     * @param Context $context
     */
    public function __construct(Context $context)
    {
        if (WP_ENV == 'production' && !wp_doing_ajax()) {
            abort(403);
        }

        $this->context = $context;
    }

    /**
     * @param string $exampleParameter
     * @return Response
     */
    public function doHelloWorld(string $exampleParameter): Response
    {
        // This is our dictionary to be encoded as JSON sent by the response.
        $data = [
            'html' => 'This content was rendered from an AJAX request. It also has set a custom HTTP header.',
            'example_parameter' => $exampleParameter
        ];

        // We can send extra headers along with the response.
        $extra = [
            'headers' => [
                'Custom-Header' => 'Hello World!'
            ]
        ];

        $response = $this->renderJson($data, $this->context, $extra);
        $response->setCache(['max_age' => 60, 'public' => true]);

        return $response;
    }
}


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

    <LinearLayout
        android:orientation="vertical"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:background="@color/darkgrey">

        <LinearLayout
            android:orientation="horizontal"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginLeft="10dp"
            android:layout_marginTop="5dp"
            android:layout_marginRight="10dp"
            android:layout_marginBottom="5dp"
            android:background="@drawable/editshoppinglist_listviewelement_bg"
            android:layout_gravity="center_horizontal">

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:textAppearance="?android:attr/textAppearanceLarge"
                android:text="Produktname"
                android:id="@+id/ProdName"
                android:layout_weight="90"
                android:layout_marginLeft="15dp"
                android:textSize="15dp"
                android:layout_gravity="center_vertical" />

            <CheckBox
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:id="@+id/cBox"
                android:layout_gravity="center"
                android:layout_marginRight="15dp" />

        </LinearLayout>
    </LinearLayout>
</LinearLayout>


text:
/*
 * Rates_Analysis.h
 *
 *  Created on: 19 Dec 2014
 *      Author: DetlevCM
 */

#ifndef HEADERS_RATES_ANALYSIS_HPP_
#define HEADERS_RATES_ANALYSIS_HPP_

void MaxRatesAnalysis(
		vector< vector < str_RatesAnalysis > >& ,
		const vector< TrackSpecies > & ,
		const vector< TrackSpecies > & ,
		const vector< double > ,
		const double
);

void RatesAnalysisAtTimes(
		const vector< TrackSpecies > & ,
		const vector< TrackSpecies > & ,
		const vector< double > & ,
		const double ,
		const vector< string > ,
		const vector< SingleReactionData >&
);

void WriteMaxRatesAnalysis(
		vector< vector < str_RatesAnalysis > >&,
		const vector< string >&,
		const vector< SingleReactionData >&,
		string
);

void PrepareStreamRatesAnalysis(
		const vector< string >&,
		string
		);

void StreamRatesAnalysis(
		const string,
		const vector< TrackSpecies > & ,
		const vector< TrackSpecies > & ,
		const vector< double > & ,
		const double ,
		const size_t
);

// New function for rates of production

void Prepare_Print_Rates_Per_Species(
		//vector< TrackSpecies > & ,
		//vector< TrackSpecies > & ,
		string,
		//vector< double > & ,
		vector< string > ,
		vector< size_t > ,
		vector< vector< size_t > >//,
		//vector< SingleReactionData >&
);

void Print_Rates_Per_Species(
		vector< TrackSpecies > & ,
		vector< TrackSpecies > & ,
		const string,
		vector< double > & ,
		double ,
		vector< string > ,
		vector< size_t > ,
		vector< vector< size_t > > //,
		//vector< SingleReactionData >&
);

#endif /* HEADERS_RATES_ANALYSIS_HPP_ */


text:
module Main where
import P
main :: IO ()
main = return ()


text:
#ifndef LUDI_GRAPHICS_KERNEL_DIRECT3D11_H_
#define LUDI_GRAPHICS_KERNEL_DIRECT3D11_H_

namespace ludi {
namespace graphics {

    /*! */
    template<>
    class Kernel_<LUDI_GRAPHICS_PLATFORM_DIRECT3D11> : public Kernel_<> {
    protected:
        ComPointer<IDXGIFactory> dxgi_factory_;

    public:
        Kernel_();
        virtual ~Kernel();

    };

} // graphics
} // ludi

#endif // LUDI_GRAPHICS_KERNEL_DIRECT3D11_H_


text:
require 'thread'
require 'concurrent/obligation'
require 'concurrent/options_parser'

module Concurrent

  # Lazy evaluation of a block yielding an immutable result. Useful for expensive
  # operations that may never be needed.
  #
  # A `Delay` is similar to `Future` but solves a different problem.
  # Where a `Future` schedules an operation for immediate execution and
  # performs the operation asynchronously, a `Delay` (as the name implies)
  # delays execution of the operation until the result is actually needed.
  #
  # When a `Delay` is created its state is set to `pending`. The value and
  # reason are both `nil`. The first time the `#value` method is called the
  # enclosed opration will be run and the calling thread will block. Other
  # threads attempting to call `#value` will block as well. Once the operation
  # is complete the *value* will be set to the result of the operation or the
  # *reason* will be set to the raised exception, as appropriate. All threads
  # blocked on `#value` will return. Subsequent calls to `#value` will immediately
  # return the cached value. The operation will only be run once. This means that
  # any side effects created by the operation will only happen once as well.
  #
  # `Delay` includes the `Concurrent::Dereferenceable` mixin to support thread
  # safety of the reference returned by `#value`.
  #
  # @since 0.6.0
  #
  # @see Concurrent::Dereferenceable
  #
  # @see http://clojuredocs.org/clojure_core/clojure.core/delay
  # @see http://aphyr.com/posts/306-clojure-from-the-ground-up-state
  class Delay
    include Obligation

    # Create a new `Delay` in the `:pending` state.
    #
    # @yield the delayed operation to perform
    #
    # @param [Hash] opts the options to create a message with
    # @option opts [String] :dup_on_deref (false) call `#dup` before returning
    #   the data
    # @option opts [String] :freeze_on_deref (false) call `#freeze` before
    #   returning the data
    # @option opts [String] :copy_on_deref (nil) call the given `Proc` passing
    #   the internal value and returning the value returned from the proc
    #
    # @raise [ArgumentError] if no block is given
    def initialize(opts = {}, &block)
      raise ArgumentError.new('no block given') unless block_given?

      init_obligation
      @state = :pending
      @task  = block
      set_deref_options(opts)
      @task_executor = OptionsParser.get_task_executor_from(opts)
      @computing     = false
    end

    def wait(timeout)
      execute_task_once
      super timeout
    end

    # reconfigures the block returning the value if still #incomplete?
    # @yield the delayed operation to perform
    # @return [true, false] if success
    def reconfigure(&block)
      mutex.lock
      raise ArgumentError.new('no block given') unless block_given?
      unless @computing
        @task = block
        true
      else
        false
      end
    ensure
      mutex.unlock
    end

    private

    def execute_task_once
      mutex.lock
      execute = @computing = true unless @computing
      task    = @task
      mutex.unlock

      if execute
        @task_executor.post do
          begin
            result  = task.call
            success = true
          rescue => ex
            reason = ex
          end
          mutex.lock
          set_state success, result, reason
          event.set
          mutex.unlock
        end
      end
    end
  end
end


text:
from sys import version_info
if version_info >= (2, 6, 0):
    def swig_import_helper():
        from os.path import dirname
        import imp
        fp = None
        try:
            fp, pathname, description = imp.find_module('_SimList_ConnectorList_SimConnections', [dirname(__file__)])
        except ImportError:
            import _SimList_ConnectorList_SimConnections
            return _SimList_ConnectorList_SimConnections
        if fp is not None:
            try:
                _mod = imp.load_module('_SimList_ConnectorList_SimConnections', fp, pathname, description)
            finally:
                fp.close()
            return _mod
    _SimList_ConnectorList_SimConnections = swig_import_helper()
    del swig_import_helper
else:
    import _SimList_ConnectorList_SimConnections
del version_info
try:
    _swig_property = property
except NameError:
    pass  # Python < 2.2 doesn't have 'property'.

def _swig_setattr_nondynamic(self, class_type, name, value, static=1):
    if (name == "thisown"):
        return self.this.own(value)
    if (name == "this"):
        if type(value).__name__ == 'SwigPyObject':
            self.__dict__[name] = value
            return
    method = class_type.__swig_setmethods__.get(name, None)
    if method:
        return method(self, value)
    if (not static):
        if _newclass:
            object.__setattr__(self, name, value)
        else:
            self.__dict__[name] = value
    else:
        raise AttributeError("You cannot add attributes to %s" % self)

def _swig_setattr(self, class_type, name, value):
    return _swig_setattr_nondynamic(self, class_type, name, value, 0)

def _swig_getattr_nondynamic(self, class_type, name, static=1):
    if (name == "thisown"):
        return self.this.own()
    method = class_type.__swig_getmethods__.get(name, None)
    if method:
        return method(self)
    if (not static):
        return object.__getattr__(self, name)
    else:
        raise AttributeError(name)

def _swig_getattr(self, class_type, name):
    return _swig_getattr_nondynamic(self, class_type, name, 0)

def _swig_repr(self):
    try:
        strthis = "proxy of " + self.this.__repr__()
    except:
        strthis = ""
    return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)

try:
    _object = object
    _newclass = 1
except AttributeError:
    class _object:
        pass
    _newclass = 0

try:
    import weakref
    weakref_proxy = weakref.proxy
except:
    weakref_proxy = lambda x: x

import base
class SimList(base.SimGroup):
    __swig_setmethods__ = {}
    for _s in [base.SimGroup]:
        __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
    __setattr__ = lambda self, name, value: _swig_setattr(self, SimList, name, value)
    __swig_getmethods__ = {}
    for _s in [base.SimGroup]:
        __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
    __getattr__ = lambda self, name: _swig_getattr(self, SimList, name)
    __repr__ = _swig_repr

    def __init__(self, *args):
        this = _SimList_ConnectorList_SimConnections.new_SimList(*args)
        try:
            self.this.append(this)
        except:
            self.this = this

    def _clone(self, f=0, c=None):
        return _SimList_ConnectorList_SimConnections.SimList__clone(self, f, c)
    __swig_destroy__ = _SimList_ConnectorList_SimConnections.delete_SimList
    __del__ = lambda self: None
SimList_swigregister = _SimList_ConnectorList_SimConnections.SimList_swigregister
SimList_swigregister(SimList)

class SimList_ConnectorList(SimList):
    __swig_setmethods__ = {}
    for _s in [SimList]:
        __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
    __setattr__ = lambda self, name, value: _swig_setattr(self, SimList_ConnectorList, name, value)
    __swig_getmethods__ = {}
    for _s in [SimList]:
        __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
    __getattr__ = lambda self, name: _swig_getattr(self, SimList_ConnectorList, name)
    __repr__ = _swig_repr

    def __init__(self, *args):
        this = _SimList_ConnectorList_SimConnections.new_SimList_ConnectorList(*args)
        try:
            self.this.append(this)
        except:
            self.this = this

    def _clone(self, f=0, c=None):
        return _SimList_ConnectorList_SimConnections.SimList_ConnectorList__clone(self, f, c)
    __swig_destroy__ = _SimList_ConnectorList_SimConnections.delete_SimList_ConnectorList
    __del__ = lambda self: None
SimList_ConnectorList_swigregister = _SimList_ConnectorList_SimConnections.SimList_ConnectorList_swigregister
SimList_ConnectorList_swigregister(SimList_ConnectorList)

class SimList_ConnectorList_SimConnections(SimList_ConnectorList):
    __swig_setmethods__ = {}
    for _s in [SimList_ConnectorList]:
        __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
    __setattr__ = lambda self, name, value: _swig_setattr(self, SimList_ConnectorList_SimConnections, name, value)
    __swig_getmethods__ = {}
    for _s in [SimList_ConnectorList]:
        __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
    __getattr__ = lambda self, name: _swig_getattr(self, SimList_ConnectorList_SimConnections, name)
    __repr__ = _swig_repr

    def __init__(self, *args):
        this = _SimList_ConnectorList_SimConnections.new_SimList_ConnectorList_SimConnections(*args)
        try:
            self.this.append(this)
        except:
            self.this = this

    def _clone(self, f=0, c=None):
        return _SimList_ConnectorList_SimConnections.SimList_ConnectorList_SimConnections__clone(self, f, c)
    __swig_destroy__ = _SimList_ConnectorList_SimConnections.delete_SimList_ConnectorList_SimConnections
    __del__ = lambda self: None
SimList_ConnectorList_SimConnections_swigregister = _SimList_ConnectorList_SimConnections.SimList_ConnectorList_SimConnections_swigregister
SimList_ConnectorList_SimConnections_swigregister(SimList_ConnectorList_SimConnections)

class SimList_ConnectorList_SimConnections_sequence(base.sequence_common):
    __swig_setmethods__ = {}
    for _s in [base.sequence_common]:
        __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
    __setattr__ = lambda self, name, value: _swig_setattr(self, SimList_ConnectorList_SimConnections_sequence, name, value)
    __swig_getmethods__ = {}
    for _s in [base.sequence_common]:
        __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
    __getattr__ = lambda self, name: _swig_getattr(self, SimList_ConnectorList_SimConnections_sequence, name)
    __repr__ = _swig_repr

    def __init__(self, *args):
        this = _SimList_ConnectorList_SimConnections.new_SimList_ConnectorList_SimConnections_sequence(*args)
        try:
            self.this.append(this)
        except:
            self.this = this

    def assign(self, n, x):
        return _SimList_ConnectorList_SimConnections.SimList_ConnectorList_SimConnections_sequence_assign(self, n, x)

    def begin(self, *args):
        return _SimList_ConnectorList_SimConnections.SimList_ConnectorList_SimConnections_sequence_begin(self, *args)

    def end(self, *args):
        return _SimList_ConnectorList_SimConnections.SimList_ConnectorList_SimConnections_sequence_end(self, *args)

    def rbegin(self, *args):
        return _SimList_ConnectorList_SimConnections.SimList_ConnectorList_SimConnections_sequence_rbegin(self, *args)

    def rend(self, *args):
        return _SimList_ConnectorList_SimConnections.SimList_ConnectorList_SimConnections_sequence_rend(self, *args)

    def at(self, *args):
        return _SimList_ConnectorList_SimConnections.SimList_ConnectorList_SimConnections_sequence_at(self, *args)

    def front(self, *args):
        return _SimList_ConnectorList_SimConnections.SimList_ConnectorList_SimConnections_sequence_front(self, *args)

    def back(self, *args):
        return _SimList_ConnectorList_SimConnections.SimList_ConnectorList_SimConnections_sequence_back(self, *args)

    def push_back(self, *args):
        return _SimList_ConnectorList_SimConnections.SimList_ConnectorList_SimConnections_sequence_push_back(self, *args)

    def pop_back(self):
        return _SimList_ConnectorList_SimConnections.SimList_ConnectorList_SimConnections_sequence_pop_back(self)

    def detach_back(self, pop=True):
        return _SimList_ConnectorList_SimConnections.SimList_ConnectorList_SimConnections_sequence_detach_back(self, pop)

    def insert(self, *args):
        return _SimList_ConnectorList_SimConnections.SimList_ConnectorList_SimConnections_sequence_insert(self, *args)

    def erase(self, *args):
        return _SimList_ConnectorList_SimConnections.SimList_ConnectorList_SimConnections_sequence_erase(self, *args)

    def detach(self, position, r, erase=True):
        return _SimList_ConnectorList_SimConnections.SimList_ConnectorList_SimConnections_sequence_detach(self, position, r, erase)

    def swap(self, x):
        return _SimList_ConnectorList_SimConnections.SimList_ConnectorList_SimConnections_sequence_swap(self, x)
    __swig_destroy__ = _SimList_ConnectorList_SimConnections.delete_SimList_ConnectorList_SimConnections_sequence
    __del__ = lambda self: None
SimList_ConnectorList_SimConnections_sequence_swigregister = _SimList_ConnectorList_SimConnections.SimList_ConnectorList_SimConnections_sequence_swigregister
SimList_ConnectorList_SimConnections_sequence_swigregister(SimList_ConnectorList_SimConnections_sequence)

# This file is compatible with both classic and new-style classes.


text: <dfn id="text-track-cue-data">The data of the cue</dfn>


text:
@implementation NSObject (Common)

+ (BOOL)showError:(NSError *)error{

    NSString *tipStr = [NSObject tipFromError:error];
    [NSObject showHudTipStr:tipStr];
    return YES;

}
+ (NSString *)tipFromError:(NSError *)error{
    if (error && error.userInfo) {
        NSMutableString *tipStr = [[NSMutableString alloc] init];
        if ([error.userInfo objectForKey:@"msg"]) {
            NSArray *msgArray = [[error.userInfo objectForKey:@"msg"] allValues];
            NSUInteger num = [msgArray count];
            for (int i = 0; i < num; i++) {
                NSString *msgStr = [msgArray objectAtIndex:i];
                if (i+1 < num) {
                    [tipStr appendString:[NSString stringWithFormat:@"%@\n", msgStr]];
                }else{
                    [tipStr appendString:msgStr];
                }
            }
        }else{
            if ([error.userInfo objectForKey:@"NSLocalizedDescription"]) {
                tipStr = [error.userInfo objectForKey:@"NSLocalizedDescription"];
            }else{
                [tipStr appendFormat:@"ErrorCode%ld", (long)error.code];
            }
        }
        return tipStr;
    }
    return nil;
}
+ (void)showHudTipStr:(NSString *)tipStr{
    if (tipStr && tipStr.length > 0) {
        if ([tipStr isEqualToString:@"The Internet connection appears to be offline."]) {
            tipStr = @"似乎已断开与互联网的连接。";
        }
        if ([tipStr isEqualToString:@"The request timed out."]) {
            tipStr = @"请求连接超时。";
        }

        MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:[UIApplication sharedApplication].keyWindow animated:YES];
        hud.mode = MBProgressHUDModeText;
        hud.detailsLabelFont = [UIFont boldSystemFontOfSize:15.0];
        hud.detailsLabelText = tipStr;
        hud.margin = 10.f;
        hud.removeFromSuperViewOnHide = YES;
        [hud hide:YES afterDelay:1.5];
    }
}

#pragma mark File M
//获取fileName的完整地址
+ (NSString* )pathInCacheDirectory:(NSString *)fileName
{
    NSArray *cachePaths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES);
    NSString *cachePath = [cachePaths objectAtIndex:0];
    return [cachePath stringByAppendingPathComponent:fileName];
}
//创建缓存文件夹
+ (BOOL) createDirInCache:(NSString *)dirName
{
    NSString *dirPath = [self pathInCacheDirectory:dirName];
    BOOL isDir = NO;
    NSFileManager *fileManager = [NSFileManager defaultManager];
    BOOL existed = [fileManager fileExistsAtPath:dirPath isDirectory:&isDir];
    BOOL isCreated = NO;
    if ( !(isDir == YES && existed == YES) )
    {
        isCreated = [fileManager createDirectoryAtPath:dirPath withIntermediateDirectories:YES attributes:nil error:nil];
    }
    if (existed) {
        isCreated = YES;
    }
    return isCreated;
}

// 图片缓存到本地
+ (BOOL) saveImage:(NSData *)image imageName:(NSString *)imageName inFolder:(NSString *)folderName
{
    if (!image) {
        return NO;
    }
    if (!folderName) {
        folderName = kPath_ImageCache;
    }
    if ([self createDirInCache:folderName]) {
        NSString * directoryPath = [self pathInCacheDirectory:folderName];
        BOOL isDir = NO;
        NSFileManager *fileManager = [NSFileManager defaultManager];
        BOOL existed = [fileManager fileExistsAtPath:directoryPath isDirectory:&isDir];
        bool isSaved = false;
        if ( isDir == YES && existed == YES )
        {
            isSaved = [image writeToFile:[directoryPath stringByAppendingPathComponent:imageName] options:NSAtomicWrite error:nil];
        }
        return isSaved;
    }else{
        return NO;
    }
}
// 获取缓存图片
+ (NSData*) loadImageDataWithName:( NSString *)imageName inFolder:(NSString *)folderName
{
    if (!folderName) {
        folderName = kPath_ImageCache;
    }
    NSString * directoryPath = [self pathInCacheDirectory:folderName];
    BOOL isDir = NO;
    NSFileManager *fileManager = [NSFileManager defaultManager];
    BOOL dirExisted = [fileManager fileExistsAtPath:directoryPath isDirectory:&isDir];
    if ( isDir == YES && dirExisted == YES )
    {
        NSString *abslutePath = [NSString stringWithFormat:@"%@/%@", directoryPath, imageName];
        BOOL fileExisted = [fileManager fileExistsAtPath:abslutePath];
        if (!fileExisted) {
            return NULL;
        }
        NSData *imageData = [NSData dataWithContentsOfFile:abslutePath];
        return imageData;
    }
    else
    {
        return NULL;
    }
}

// 删除图片缓存
+ (BOOL) deleteImageCacheInFolder:(NSString *)folderName{
    if (!folderName) {
        folderName = kPath_ImageCache;
    }
    return [self deleteCacheWithPath:folderName];
}

//网络请求
+ (BOOL)saveResponseData:(NSDictionary *)data toPath:(NSString *)requestPath{
//    User *loginUser = [Login curLoginUser];
//    if (!loginUser) {
//        return NO;
//    }else{
        requestPath = [NSString stringWithFormat:@"%@_%@", @"", requestPath];
//    }
    if ([self createDirInCache:kPath_ResponseCache]) {
        NSString *abslutePath = [NSString stringWithFormat:@"%@/%@.plist", [self pathInCacheDirectory:kPath_ResponseCache], [requestPath md5Str]];
        return [data writeToFile:abslutePath atomically:YES];
    }else{
        return NO;
    }
}
+ (id) loadResponseWithPath:(NSString *)requestPath{//返回一个NSDictionary类型的json数据
////    User *loginUser = [Login curLoginUser];
//    if (!loginUser) {
//        return nil;
//    }else{
        requestPath = [NSString stringWithFormat:@"%@_%@", @"", requestPath];
//    }
    NSString *abslutePath = [NSString stringWithFormat:@"%@/%@.plist", [self pathInCacheDirectory:kPath_ResponseCache], [requestPath md5Str]];
    return [NSMutableDictionary dictionaryWithContentsOfFile:abslutePath];
}

+ (BOOL)deleteResponseCacheForPath:(NSString *)requestPath{
//    User *loginUser = [Login curLoginUser];
//    if (!loginUser) {
//        return NO;
//    }else{
        requestPath = [NSString stringWithFormat:@"%@_%@", @"", requestPath];
//    }
    NSString *abslutePath = [NSString stringWithFormat:@"%@/%@.plist", [self pathInCacheDirectory:kPath_ResponseCache], [requestPath md5Str]];
    NSFileManager *fileManager = [NSFileManager defaultManager];
    if ([fileManager fileExistsAtPath:abslutePath]) {
        return [fileManager removeItemAtPath:abslutePath error:nil];
    }else{
        return NO;
    }
}

+ (BOOL) deleteResponseCache{
    return [self deleteCacheWithPath:kPath_ResponseCache];
}

+ (BOOL) deleteCacheWithPath:(NSString *)cachePath{
    NSString *dirPath = [self pathInCacheDirectory:cachePath];
    BOOL isDir = NO;
    NSFileManager *fileManager = [NSFileManager defaultManager];
    BOOL existed = [fileManager fileExistsAtPath:dirPath isDirectory:&isDir];
    bool isDeleted = false;
    if ( isDir == YES && existed == YES )
    {
        isDeleted = [fileManager removeItemAtPath:dirPath error:nil];
    }
    return isDeleted;
}

#pragma mark NetError
-(id)handleResponse:(id)responseJSON
{
    return [self handleResponse:responseJSON autoShowError:YES];
}
-(id)handleResponse:(id)responseJSON autoShowError:(BOOL)autoShowError{
    NSError *error = nil;
//    //code为非0值时,表示有错
//    NSNumber *resultCode = [responseJSON valueForKeyPath:@"code"];
//
//    if (resultCode.intValue != 0) {
//        error = [NSError errorWithDomain:[NSObject baseURLStr] code:resultCode.intValue userInfo:responseJSON];
//
//        if (resultCode.intValue == 1000 || resultCode.intValue == 3207) {//用户未登录
//            if ([Login isLogin]) {//已登录的状态要抹掉
//                [Login doLogout];
//                [((AppDelegate *)[UIApplication sharedApplication].delegate) setupLoginViewController];
//                kTipAlert(@"%@", [self tipFromError:error]);
//            }
//        }else{
//            if (autoShowError) {
//                [self showError:error];
//            }
//        }
//    }
    return error;
}
@end


text:
<?php
/**
 * The template part for displaying results in search pages.
 *
 * Learn more: http://codex.wordpress.org/Template_Hierarchy
 *
 * @package wptheme-rg
 */
?>

<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>

		<?php the_title( sprintf( '
', esc_url( get_permalink() ) ), '
' ); ?>

		<?php if ( 'post' == get_post_type() ) : ?>

			<?php wptheme_rg_posted_on(); ?>

		<?php endif; ?>

		<?php the_excerpt(); ?>

		<?php if ( 'post' == get_post_type() ) : // Hide category and tag text for pages on Search ?>
			<?php
				/* translators: used between list items, there is a space after the comma */
				$categories_list = get_the_category_list( __( ', ', 'wptheme-rg' ) );
				if ( $categories_list && wptheme_rg_categorized_blog() ) :
			?>

				<?php printf( __( 'Posted in %1$s', 'wptheme-rg' ), $categories_list ); ?>

			<?php endif; // End if categories ?>

			<?php
				/* translators: used between list items, there is a space after the comma */
				$tags_list = get_the_tag_list( '', __( ', ', 'wptheme-rg' ) );
				if ( $tags_list ) :
			?>

				<?php printf( __( 'Tagged %1$s', 'wptheme-rg' ), $tags_list ); ?>

			<?php endif; // End if $tags_list ?>
		<?php endif; // End if 'post' == get_post_type() ?>

		<?php if ( ! post_password_required() && ( comments_open() || '0' != get_comments_number() ) ) : ?>
		<?php comments_popup_link( __( 'Leave a comment', 'wptheme-rg' ), __( '1 Comment', 'wptheme-rg' ), __( '% Comments', 'wptheme-rg' ) ); ?>
		<?php endif; ?>

		<?php edit_post_link( __( 'Edit', 'wptheme-rg' ), '', '' ); ?>


text:
declare module 'web-component-tester' {
  module wct {
    interface CLI {
      // TODO(justinfagnani): how do you import an interface into a .d.ts file?
      run(env: any, args: string[], stdout: any /*Stream*/): Promise<void>;
    }
    let cli : CLI;
  }

  export = wct;
}


text:
<bill session="115" type="h" number="583" updated="2017-05-03T23:56:15Z">
  <state datetime="2017-01-17">REFERRED</state>
  <status>
    <introduced datetime="2017-01-17"/>
  </status>
  <introduced datetime="2017-01-17"/>
  <titles>
    <title type="official" as="introduced">To direct the Federal Communications Commission to revoke certain changes to the ownership reporting requirements for noncommercial educational broadcast stations.</title>
    <title type="display">To direct the Federal Communications Commission to revoke certain changes to the ownership reporting requirements for noncommercial educational broadcast stations.</title>
  </titles>
  <sponsor bioguide_id="B001243"/>
  <cosponsors/>
  <actions>
    <action datetime="2017-01-17">
      <text>Introduced in House</text>
    </action>
    <action datetime="2017-01-17" state="REFERRED">
      <text>Referred to the House Committee on Energy and Commerce.</text>
    </action>
  </actions>
  <committees>
    <committee subcommittee="" code="HSIF" name="House Energy and Commerce" activity="Referral"/>
  </committees>
  <relatedbills/>
  <subjects>
    <term name="Science, technology, communications"/>
    <term name="Administrative law and regulatory procedures"/>
    <term name="Broadcasting, cable, digital technologies"/>
    <term name="Business records"/>
    <term name="Federal Communications Commission (FCC)"/>
    <term name="Government information and archives"/>
  </subjects>
  <amendments/>
  <summary date="2017-01-17T05:00:00Z" status="Introduced in House">This bill directs the Federal Communications Commission (FCC) to revoke changes to FCC regulations adopted on January 8, 2016, in the matter of Promoting Diversification of Ownership in the Broadcasting Services that require ownership reports to include information about the officers and governing board members of noncommercial educational broadcast stations.</summary>
  <committee-reports/>
</bill>


text:
namespace Ruzzie.Common;

/// <summary>
/// This class implements extension methods for the <see cref="System.Random"/> class.
/// </summary>
public static class RandomExtensions
{
    /// <summary>
    /// Returns an array of random bytes.
    /// </summary>
    /// <param name="random">The random number generator.</param>
    /// <param name="count">The size of the array to fill.</param>
    /// <returns></returns>
    /// <exception cref="System.ArgumentNullException"></exception>
    /// <exception cref="System.ArgumentOutOfRangeException"></exception>
    public static byte[] NextBytes(this Random random, int count)
    {
        if (random == null)
        {
            throw new ArgumentNullException(nameof(random));
        }
        if (count < 1)
        {
            throw new ArgumentOutOfRangeException(nameof(count));
        }

        byte[] samples = new byte[count];
        random.NextBytes(samples);
        return samples;
    }
}


text:
function [bins,binNames] = discretize(inputData,edges)
%DISCRETIZE Create a categorical array by discretizing numeric data.
%   BINS = DISCRETIZE(A,EDGES) returns the bin numbers obtained by discretizing
%   the numeric array A into categories.  EDGES is a numeric vector that
%   contains bin edges defining the categories.  EDGES has one more element than
%   B has categories, and the I-th category in B includes values in A where
%   EDGES(I) <= X < EDGES(I+1).  The uppermost category includes values in A
%   equal to the rightmost edge in EDGES.
%
%   [BINS,BINNAMES] = DISCRETIZE(A,EDGES) returns bins names of the form
%    "[A,B)", where A and B are consecutive values from EDGES.
%
%   See also CATEGORICAL, HISTC.

if ~isnumeric(inputData) || ~isreal(inputData)
    error(message('MATLAB:categorical:discretize:NonnumericData'));
elseif ~isnumeric(edges) || ~isreal(edges) || ~isvector(edges) || length(edges) < 2
    error(message('MATLAB:categorical:discretize:InvalidEdges'));
elseif length(edges)-1 > categorical.maxNumCategories
    error(message('MATLAB:categorical:MaxNumCategoriesExceeded',categorical.maxNumCategories));
end
nbins = length(edges) - 1;

if (nargout > 1)
    % Create names from the edges
    binNames = cell(1,nbins);
    for i = 1:nbins
        binNames{i} = sprintf('[%0.5g, %0.5g)',edges(i),edges(i+1));
    end
    binNames{end}(end) = ']';
    if length(unique(binNames)) < length(binNames)
        error(message('MATLAB:categorical:discretize:CantCreateCategoryNames'));
    end
end

% HISTC includes a rightmost "x==edges(end)" bin, remove it
[~,bins] = histc(inputData(:),edges);
bins(bins==nbins+1) = nbins;
bins = reshape(bins,size(inputData));


text:
export GOROOT=/c/ssd/go1.9
export PATH=$PATH:$GOROOT/bin
export GOPATH=/c/ssd/gohome


text:
'use strict';

Object.defineProperty(exports, "__esModule", {
	value: true
});
exports.default = undefined;

var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();

var _Base2 = require('./Base');

var _Base3 = _interopRequireDefault(_Base2);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }

function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /**
                                                                                * Boolean 校验
                                                                                */

var PBoolean = function (_Base) {
	_inherits(PBoolean, _Base);

	function PBoolean() {
		_classCallCheck(this, PBoolean);

		var _this = _possibleConstructorReturn(this, (PBoolean.__proto__ || Object.getPrototypeOf(PBoolean)).call(this, {
			type: '不是 Boolean',
			required: '必填,不能为空'
		}));

		_this.error = [];
		return _this;
	}

	_createClass(PBoolean, [{
		key: 'validate',
		value: function validate(schema, data, key) {
			if (data[key] === undefined || data[key] === null) {
				data[key] = schema[key].default ? schema[key].default : data[key];
			}
			if (!schema[key].required && (data[key] === undefined || data[key] === null)) return this.error;

			if (!this.required(schema, data, key)) return this.error;
			if (!this.isBoolean(schema, data, key)) return this.error;

			return this.error;
		}
	}, {
		key: 'required',
		value: function required(schema, data, key) {
			if (schema[key].required) {
				if (data[key] === undefined || data[key] === null) {
					this.error.push(this.getError(schema, key, 'required'));
					return false;
				}
			}
			return true;
		}
	}, {
		key: 'isBoolean',
		value: function isBoolean(schema, data, key) {
			if (typeof data[key] !== 'boolean') {
				this.error.push(this.getError(schema, key, 'type'));
				return false;
			}
			return true;
		}
	}]);

	return PBoolean;
}(_Base3.default);

exports.default = PBoolean;


text:
from __future__ import unicode_literals
from rest_framework.parsers import JSONParser
from rest_framework import status
from rest_framework.response import Response
from snippets.models import Snippet
from snippets.serializer import SnippetSerializer
from rest_framework.decorators import api_view

@api_view(['GET', 'POST'])
def snippet_list(request, format=None):
    """
    List all code snippets, or create a new snippet.
    """
    if request.method == 'GET':
        snippets = Snippet.objects.all()
        serializer = SnippetSerializer(snippets, many=True)
        # return JsonResponse(serializer.data, safe=False)
        return Response(serializer.data)

    elif request.method == 'POST':
        # data = JSONParser().parse(request)
        serializer = SnippetSerializer(data=request.data)
        if serializer.is_valid():
            serializer.save()
            # return JsonResponse(serializer.data, status=201)
            return Response(serializer.data, status=status.HTTP_201_CREATED)
        # return JsonResponse(serializer.errors, status=400)
        return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)

#@csrf_exempt
@api_view(['GET', 'PUT', 'DELETE'])
def snippet_detail(request, pk, format=None):
    """
    Retrieve, update or delete a code snippet.
    """
    try:
        snippet = Snippet.objects.get(pk=pk)
    except Snippet.DoesNotExist:
        return Response(status=status.HTTP_404_NOT_FOUND)
        # return HttpResponse(status=404)

    if request.method == 'GET':
        serializer = SnippetSerializer(snippet)
        return Response(serializer.data)
        # return JsonResponse(serializer.data)

    elif request.method == 'PUT':
        data = JSONParser().parse(request)
        serializer = SnippetSerializer(snippet, data=data)
        if serializer.is_valid():
            serializer.save()
            return Response(serializer.data)
            # return JsonResponse(serializer.data)
        # return JsonResponse(serializer.errors, status=400)
        return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)

    elif request.method == 'DELETE':
        snippet.delete()
        return Response(status=status.HTTP_204_NO_CONTENT)
        # return HttpResponse(status=204)


text:
<?php

namespace Sylius\Bundle\WebBundle\Controller\Frontend\Account;

use Doctrine\Common\Persistence\ObjectManager;
use FOS\RestBundle\Controller\FOSRestController;
use Sylius\Component\Addressing\Model\AddressInterface;
use Sylius\Component\Core\Model\CustomerInterface;
use Sylius\Component\Resource\Factory\FactoryInterface;
use Sylius\Component\Resource\Repository\RepositoryInterface;
use Symfony\Component\Form\FormInterface;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Symfony\Component\Security\Core\Exception\AccessDeniedException;

/**
 * Customer account address controller.
 *
 * @author Julien Janvier <j.janvier@gmail.com>
 */
class AddressController extends FOSRestController
{
    /**
     * Get collection of customer's addresses.
     */
    public function indexAction()
    {
        $view = $this
            ->view()
            ->setTemplate('SyliusWebBundle:Frontend/Account:Address/index.html.twig')
            ->setData([
                'customer' => $this->getCustomer(),
                'addresses' => $this->getCustomer()->getAddresses(),
            ])
        ;

        return $this->handleView($view);
    }

    /**
     * Create new customer address.
     */
    public function createAction(Request $request)
    {
        $customer = $this->getCustomer();
        $address = $this->getAddressFactory()->createNew();
        $form = $this->getAddressForm($address);

        if ($form->handleRequest($request)->isValid()) {
            $customer->addAddress($address);

            $manager = $this->getCustomerManager();
            $manager->persist($customer);
            $manager->flush();

            $this->addFlash('success', 'sylius.account.address.create');

            return $this->redirectToIndex();
        }

        $view = $this
            ->view()
            ->setTemplate('SyliusWebBundle:Frontend/Account:Address/create.html.twig')
            ->setData([
                'customer' => $this->getCustomer(),
                'form' => $form->createView(),
            ])
        ;

        return $this->handleView($view);
    }

    /**
     * Update existing user address.
     */
    public function updateAction(Request $request, $id)
    {
        $customer = $this->getCustomer();
        $address = $this->findUserAddressOr404($id);
        $form = $this->getAddressForm($address);

        if ($form->handleRequest($request)->isValid()) {
            $manager = $this->getCustomerManager();
            $manager->persist($customer);
            $manager->flush();

            $this->addFlash('success', 'sylius.account.address.update');

            return $this->redirectToIndex();
        }

        $view = $this
            ->view()
            ->setTemplate('SyliusWebBundle:Frontend/Account:Address/update.html.twig')
            ->setData([
                'customer' => $this->getCustomer(),
                'address' => $address,
                'form' => $form->createView(),
            ])
        ;

        return $this->handleView($view);
    }

    /**
     * Delete user address.
     */
    public function deleteAction($id)
    {
        $customer = $this->getCustomer();
        $address = $this->findUserAddressOr404($id);

        $customer->removeAddress($address);

        $manager = $this->getCustomerManager();
        $manager->persist($customer);
        $manager->flush();

        $this->addFlash('success', 'sylius.account.address.delete');

        return $this->redirectToIndex();
    }

    /**
     * Set an address as default billing/shipping address for the current user.
     *
     * @param int    $id
     * @param string $type
     *
     * @return RedirectResponse
     *
     * @throws NotFoundHttpException
     */
    public function setAddressAsAction($id, $type)
    {
        $address = $this->findUserAddressOr404($id);

        $customer = $this->getCustomer();

        if ('billing' === $type) {
            $customer->setBillingAddress($address);

            $this->addFlash('success', 'sylius.account.address.set_as_billing');
        } elseif ('shipping' === $type) {
            $customer->setShippingAddress($address);

            $this->addFlash('success', 'sylius.account.address.set_as_shipping');
        } else {
            throw new NotFoundHttpException();
        }

        $manager = $this->getCustomerManager();
        $manager->persist($customer);
        $manager->flush();

        return $this->redirectToIndex();
    }

    protected function addFlash($type, $message)
    {
        $translator = $this->get('translator');
        $this->get('session')->getFlashBag()->add($type, $translator->trans($message, [], 'flashes'));
    }

    /**
     * @param AddressInterface $address
     *
     * @return FormInterface
     */
    protected function getAddressForm(AddressInterface $address)
    {
        return $this->get('form.factory')->create('sylius_address', $address);
    }

    /**
     * @return ObjectManager
     */
    private function getCustomerManager()
    {
        return $this->get('sylius.manager.customer');
    }

    /**
     * @return RepositoryInterface
     */
    protected function getAddressRepository()
    {
        return $this->get('sylius.repository.address');
    }

    /**
     * @return FactoryInterface
     */
    protected function getAddressFactory()
    {
        return $this->get('sylius.factory.address');
    }

    protected function redirectToIndex()
    {
        return $this->redirect($this->generateUrl('sylius_account_address_index'));
    }

    /**
     * Accesses address or throws 403/404
     *
     * @param int $id
     *
     * @return AddressInterface
     *
     * @throws NotFoundHttpException
     * @throws AccessDeniedException
     */
    protected function findUserAddressOr404($id)
    {
        if (!$address = $this->getAddressRepository()->find($id)) {
            throw new NotFoundHttpException('Requested address does not exist.');
        }

        if (!$this->getCustomer()->hasAddress($address)) {
            throw new AccessDeniedException();
        }

        return $address;
    }

    /**
     * @return CustomerInterface
     */
    protected function getCustomer()
    {
        return $this->get('sylius.context.customer')->getCustomer();
    }
}


text:
module Merb
  module CgtsHelper

  end
end # Merb


text:
<?php
/**
 * Created by diModelsManager
 * Date: 01.10.2015
 * Time: 00:20
 */

namespace diCore\Entity\Feedback;

/**
 * Class Model
 * Methods list for IDE
 *
 * @method integer	getUserId
 * @method string	getName
 * @method string	getEmail
 * @method string	getPhone
 * @method string	getContent
 * @method integer	getIp
 * @method string	getDate
 *
 * @method bool hasUserId
 * @method bool hasName
 * @method bool hasEmail
 * @method bool hasPhone
 * @method bool hasContent
 * @method bool hasIp
 * @method bool hasDate
 *
 * @method $this setUserId($value)
 * @method $this setName($value)
 * @method $this setEmail($value)
 * @method $this setPhone($value)
 * @method $this setContent($value)
 * @method $this setIp($value)
 * @method $this setDate($value)
 */
class Model extends \diModel
{
	const type = \diTypes::feedback;
	const table = 'feedback';
	protected $table = 'feedback';

	public function validate()
	{
		if (!$this->hasContent()) {
			$this->addValidationError('Content required', 'content');
		}

		return parent::validate();
	}
}


text:
//
//  BaseGeocodingController.h
//  AdvancedMap.Objective-C
//
//  Created by Aare Undo on 22/08/2017.
//  Copyright © 2017 Nutiteq. All rights reserved.
//

#import "PackageDownloadBaseController.h"
#import "Sources.h"

/*
 * Base class for normal geocoding
 */

@interface BaseGeocodingController : PackageDownloadBaseController <UITableViewDataSource, UITextFieldDelegate, UITableViewDelegate>

@property NTGeocodingService *service;

@property int searchRequestId;
@property int displayRequestId;

- (void)geoCode:(NSString *)text autoComplete:(BOOL)autocomplete;

@end


text:
require File.join(File.expand_path(File.dirname(__FILE__)), 'InstrumentsListener.rb')

module StopDetectorEventSink

  def stopDetectorTriggered
    puts "  +++ If you're seeing this, #{self.class.name}.#{__method__} was not overridden"
  end

end

# StopDetector monitors the logs for things that indicate that instruments should be stopped (user errors)
#  - the saltinel for the intended test list
#  - a javascript error
#  - etc
class StopDetector < InstrumentsListener

  attr_accessor :eventSink

  def trigger
    # assume developer has set eventSink already
    @eventSink.stopDetectorTriggered
  end

  def receive message
    # error cases that indicate successful stop but involve errors that won't be fixed by a restart
    self.trigger if :stopped == message.status
  end

  def onAutomationFinished
  end

end


text:
<?php

namespace ZIMZIM\Bundles\UserBundle\Form\Type;

use Symfony\Component\Form\FormBuilderInterface;
use FOS\UserBundle\Form\Type\RegistrationFormType as BaseType;

class RegistrationFormType extends BaseType
{
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        parent::buildForm($builder, $options);

        $builder->remove('plainPassword');
        $builder->add('plainPassword', 'password', array('label' => 'mot de passe'))
            ->add('submit', 'submit', array('label' => 'button.register'));
    }

    public function getName()
    {
        return 'zimzim_user_registration';
    }
}


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

namespace MinecraftClone.Domain.Noise
{
    class OctavePerlinNoise
    {
        private PerlinNoise noise;
        private int octave;
        private float[] frequencies;
        private float[] amplitudes;
        private float compAmplitude;

        public OctavePerlinNoise(int seed, int octave_)
        {
            noise = new PerlinNoise(seed);
            octave = octave_;

            frequencies = new float[octave];
            amplitudes = new float[octave];
            compAmplitude = 0.0f;

            for (int i = 0; i < octave; i++)
            {
                frequencies[i] = (float)Math.Pow(2, i);
                amplitudes[i] = (float)Math.Pow(2, -i);
                compAmplitude += amplitudes[i];
            }
        }

        public float this[float x, float y, float z]
        {
            get
            {
                float w = 0.0f;

                for (int i = 0; i < octave; i++)
                {
                    w += amplitudes[i] * noise[frequencies[i] * x, frequencies[i] * y, frequencies[i] * z];
                }
                return w / compAmplitude;
            }
        }
    }
}


text:
//
//  UserEmailViewController.m
//  FollowMe
//
//  Created by SCJY on 16/3/24.
//  Copyright © 2016年 SCJY. All rights reserved.
//

#import "UserEmailViewController.h"
#import <BmobSDK/BmobUser.h>
@interface UserEmailViewController ()
@property (weak, nonatomic) IBOutlet UITextField *emailText;

@end

@implementation UserEmailViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    [self shoeRightBtn];
    [self showBackBtn];
    self.title = @"绑定邮箱";
    self.view.backgroundColor = [UIColor colorWithRed:252/256.0f green:244/256.0f blue:230/256.0f alpha:1.0];
}
- (void)collectionAction{
    BmobUser *user = [BmobUser getCurrentUser];
    //应用开启了邮箱验证功能
    if ([user objectForKey:@"emailVerified"]) {
        //用户没验证过邮箱
        if (![[user objectForKey:@"emailVerified"] boolValue]) {
            [user verifyEmailInBackgroundWithEmailAddress:self.emailText.text];
            [BmobUser getCurrentUser].email = self.emailText.text;

            [self.navigationController popViewControllerAnimated:YES];

        }
    }else{
        UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"提示" message:@"您没有开启邮箱验证,不能进行此操作,谢谢!" delegate:self cancelButtonTitle:@"确定" otherButtonTitles: nil];
        [alert show];
    }
}
- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
    [self.view resignFirstResponder];
    [self.emailText resignFirstResponder];
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end


text:
#ifndef SkottieEffects_DEFINED
#define SkottieEffects_DEFINED

#include "modules/skottie/src/Composition.h"
#include "modules/skottie/src/SkottiePriv.h"
#include "modules/skottie/src/animator/Animator.h"

class SkMaskFilter;

namespace sksg {
class MaskShaderEffect;
} // namespace sksg

namespace skottie {
namespace internal {

class EffectBuilder final : public SkNoncopyable {
public:
    EffectBuilder(const AnimationBuilder*, const SkSize&, CompositionBuilder*);

    sk_sp<sksg::RenderNode> attachEffects(const skjson::ArrayValue&,
                                          sk_sp<sksg::RenderNode>) const;

    sk_sp<sksg::RenderNode> attachStyles(const skjson::ArrayValue&,
                                         sk_sp<sksg::RenderNode>) const;

    static const skjson::Value& GetPropValue(const skjson::ArrayValue& jprops, size_t prop_index);

    LayerBuilder* getLayerBuilder(int layer_index) const {
        return fCompBuilder->layerBuilder(layer_index);
    }

private:
    using EffectBuilderT = sk_sp<sksg::RenderNode>(EffectBuilder::*)(const skjson::ArrayValue&,
                                                                     sk_sp<sksg::RenderNode>) const;

    sk_sp<sksg::RenderNode> attachBlackAndWhiteEffect     (const skjson::ArrayValue&,
                                                           sk_sp<sksg::RenderNode>) const;
    sk_sp<sksg::RenderNode> attachBrightnessContrastEffect(const skjson::ArrayValue&,
                                                           sk_sp<sksg::RenderNode>) const;
    sk_sp<sksg::RenderNode> attachBulgeEffect            (const skjson::ArrayValue&,
                                                           sk_sp<sksg::RenderNode>) const;
    sk_sp<sksg::RenderNode> attachCornerPinEffect         (const skjson::ArrayValue&,
                                                            sk_sp<sksg::RenderNode>) const;
    sk_sp<sksg::RenderNode> attachCCTonerEffect           (const skjson::ArrayValue&,
                                                            sk_sp<sksg::RenderNode>) const;
    sk_sp<sksg::RenderNode> attachDirectionalBlurEffect   (const skjson::ArrayValue&,
                                                            sk_sp<sksg::RenderNode>) const;
    sk_sp<sksg::RenderNode> attachDisplacementMapEffect   (const skjson::ArrayValue&,
                                                           sk_sp<sksg::RenderNode>) const;
    sk_sp<sksg::RenderNode> attachDropShadowEffect        (const skjson::ArrayValue&,
                                                           sk_sp<sksg::RenderNode>) const;
    sk_sp<sksg::RenderNode> attachFillEffect              (const skjson::ArrayValue&,
                                                           sk_sp<sksg::RenderNode>) const;
    sk_sp<sksg::RenderNode> attachFractalNoiseEffect      (const skjson::ArrayValue&,
                                                           sk_sp<sksg::RenderNode>) const;
    sk_sp<sksg::RenderNode> attachGaussianBlurEffect      (const skjson::ArrayValue&,
                                                           sk_sp<sksg::RenderNode>) const;
    sk_sp<sksg::RenderNode> attachGradientEffect          (const skjson::ArrayValue&,
                                                           sk_sp<sksg::RenderNode>) const;
    sk_sp<sksg::RenderNode> attachHueSaturationEffect     (const skjson::ArrayValue&,
                                                           sk_sp<sksg::RenderNode>) const;
    sk_sp<sksg::RenderNode> attachInvertEffect            (const skjson::ArrayValue&,
                                                           sk_sp<sksg::RenderNode>) const;
    sk_sp<sksg::RenderNode> attachEasyLevelsEffect        (const skjson::ArrayValue&,
                                                           sk_sp<sksg::RenderNode>) const;
    sk_sp<sksg::RenderNode> attachLinearWipeEffect        (const skjson::ArrayValue&,
                                                           sk_sp<sksg::RenderNode>) const;
    sk_sp<sksg::RenderNode> attachMotionTileEffect        (const skjson::ArrayValue&,
                                                           sk_sp<sksg::RenderNode>) const;
    sk_sp<sksg::RenderNode> attachProLevelsEffect         (const skjson::ArrayValue&,
                                                           sk_sp<sksg::RenderNode>) const;
    sk_sp<sksg::RenderNode> attachRadialWipeEffect        (const skjson::ArrayValue&,
                                                           sk_sp<sksg::RenderNode>) const;
    sk_sp<sksg::RenderNode> attachSharpenEffect            (const skjson::ArrayValue&,
                                                           sk_sp<sksg::RenderNode>) const;
    sk_sp<sksg::RenderNode> attachShiftChannelsEffect     (const skjson::ArrayValue&,
                                                           sk_sp<sksg::RenderNode>) const;
    sk_sp<sksg::RenderNode> attachSkSLColorFilter         (const skjson::ArrayValue&,
                                                           sk_sp<sksg::RenderNode>) const;
    sk_sp<sksg::RenderNode> attachSkSLShader              (const skjson::ArrayValue&,
                                                           sk_sp<sksg::RenderNode>) const;
    sk_sp<sksg::RenderNode> attachSphereEffect            (const skjson::ArrayValue&,
                                                           sk_sp<sksg::RenderNode>) const;
    sk_sp<sksg::RenderNode> attachThresholdEffect         (const skjson::ArrayValue&,
                                                           sk_sp<sksg::RenderNode>) const;
    sk_sp<sksg::RenderNode> attachTintEffect              (const skjson::ArrayValue&,
                                                           sk_sp<sksg::RenderNode>) const;
    sk_sp<sksg::RenderNode> attachTransformEffect         (const skjson::ArrayValue&,
                                                           sk_sp<sksg::RenderNode>) const;
    sk_sp<sksg::RenderNode> attachTritoneEffect           (const skjson::ArrayValue&,
                                                           sk_sp<sksg::RenderNode>) const;
    sk_sp<sksg::RenderNode> attachVenetianBlindsEffect    (const skjson::ArrayValue&,
                                                           sk_sp<sksg::RenderNode>) const;

    sk_sp<sksg::RenderNode> attachDropShadowStyle(const skjson::ObjectValue&,
                                                  sk_sp<sksg::RenderNode>) const;
    sk_sp<sksg::RenderNode> attachInnerShadowStyle(const skjson::ObjectValue&,
                                                   sk_sp<sksg::RenderNode>) const;
    sk_sp<sksg::RenderNode> attachInnerGlowStyle(const skjson::ObjectValue&,
                                                 sk_sp<sksg::RenderNode>) const;
    sk_sp<sksg::RenderNode> attachOuterGlowStyle(const skjson::ObjectValue&,
                                                 sk_sp<sksg::RenderNode>) const;

    EffectBuilderT findBuilder(const skjson::ObjectValue&) const;

    const AnimationBuilder* fBuilder;
    CompositionBuilder*     fCompBuilder;
    const SkSize            fLayerSize;
};

// Syntactic sugar/helper.
class EffectBinder {
public:
    EffectBinder(const skjson::ArrayValue& jprops,
                 const AnimationBuilder& abuilder,
                 AnimatablePropertyContainer* acontainer)
        : fProps(jprops)
        , fBuilder(abuilder)
        , fContainer(acontainer) {}

    template <typename T>
    const EffectBinder& bind(size_t prop_index, T& value) const {
        fContainer->bind(fBuilder, EffectBuilder::GetPropValue(fProps, prop_index), value);

        return *this;
    }

private:
    const skjson::ArrayValue&    fProps;
    const AnimationBuilder&      fBuilder;
    AnimatablePropertyContainer* fContainer;
};

/**
 * Base class for mask-shader-related effects.
 */
class MaskShaderEffectBase : public AnimatablePropertyContainer {
public:
    const sk_sp<sksg::MaskShaderEffect>& node() const { return fMaskEffectNode; }

protected:
    MaskShaderEffectBase(sk_sp<sksg::RenderNode>, const SkSize&);

    const SkSize& layerSize() const { return  fLayerSize; }

    struct MaskInfo {
        sk_sp<SkShader> fMaskShader;
        bool            fVisible;
    };
    virtual MaskInfo onMakeMask() const = 0;

private:
    void onSync() final;

    const sk_sp<sksg::MaskShaderEffect> fMaskEffectNode;
    const SkSize                        fLayerSize;
};

} // namespace internal
} // namespace skottie

#endif // SkottieEffects_DEFINED


text:
package org.la4j.iterator;

public abstract class VectorIterator extends CursorIterator {

    protected final int length;

    public VectorIterator(int length) {
        this.length = length;
    }

    /**
     * Returns an index of the current cell.
     *
     * @return an index of the current cell
     */
    public abstract int index();

    public VectorIterator orElseAdd(final VectorIterator those) {
        return new CursorToVectorIterator(super.orElse(those, JoinFunction.ADD), length);
    }

    public VectorIterator orElseSubtract(final VectorIterator those) {
        return new CursorToVectorIterator(super.orElse(those, JoinFunction.SUB), length);
    }

    public VectorIterator andAlsoMultiply(final VectorIterator those) {
        return new CursorToVectorIterator(super.andAlso(those, JoinFunction.MUL), length);
    }

    public VectorIterator andAlsoDivide(final VectorIterator those) {
        return new CursorToVectorIterator(super.andAlso(those, JoinFunction.DIV), length);
    }

    public double innerProduct(final VectorIterator those) {
        VectorIterator both = this.andAlsoMultiply(those);
        double acc = 0.0;
        while (both.hasNext()) {
            acc += both.next();
        }

        return acc;
    }

    @Override
    protected int cursor() {
        return index();
    }
}


text:
package golinters

import (
	"fmt"
	"go/token"
	"strings"
	"sync"

	"github.com/golangci/misspell"
	"golang.org/x/tools/go/analysis"

	"github.com/golangci/golangci-lint/pkg/golinters/goanalysis"
	"github.com/golangci/golangci-lint/pkg/lint/linter"
	"github.com/golangci/golangci-lint/pkg/result"
)

func runMisspellOnFile(fileName string, r *misspell.Replacer, lintCtx *linter.Context) ([]result.Issue, error) {
	var res []result.Issue
	fileContent, err := lintCtx.FileCache.GetFileBytes(fileName)
	if err != nil {
		return nil, fmt.Errorf("can't get file %s contents: %s", fileName, err)
	}

	// use r.Replace, not r.ReplaceGo because r.ReplaceGo doesn't find
	// issues inside strings: it searches only inside comments. r.Replace
	// searches all words: it treats input as a plain text. A standalone misspell
	// tool uses r.Replace by default.
	_, diffs := r.Replace(string(fileContent))
	for _, diff := range diffs {
		text := fmt.Sprintf("`%s` is a misspelling of `%s`", diff.Original, diff.Corrected)
		pos := token.Position{
			Filename: fileName,
			Line:     diff.Line,
			Column:   diff.Column + 1,
		}
		replacement := &result.Replacement{
			Inline: &result.InlineFix{
				StartCol:  diff.Column,
				Length:    len(diff.Original),
				NewString: diff.Corrected,
			},
		}

		res = append(res, result.Issue{
			Pos:         pos,
			Text:        text,
			FromLinter:  misspellName,
			Replacement: replacement,
		})
	}

	return res, nil
}

const misspellName = "misspell"

func NewMisspell() *goanalysis.Linter {
	var mu sync.Mutex
	var resIssues []goanalysis.Issue
	var ruleErr error

	analyzer := &analysis.Analyzer{
		Name: misspellName,
		Doc:  goanalysis.TheOnlyanalyzerDoc,
	}
	return goanalysis.NewLinter(
		misspellName,
		"Finds commonly misspelled English words in comments",
		[]*analysis.Analyzer{analyzer},
		nil,
	).WithContextSetter(func(lintCtx *linter.Context) {
		r := misspell.Replacer{
			Replacements: misspell.DictMain,
		}

		// Figure out regional variations
		settings := lintCtx.Settings().Misspell
		locale := settings.Locale
		switch strings.ToUpper(locale) {
		case "":
			// nothing
		case "US":
			r.AddRuleList(misspell.DictAmerican)
		case "UK", "GB":
			r.AddRuleList(misspell.DictBritish)
		case "NZ", "AU", "CA":
			ruleErr = fmt.Errorf("unknown locale: %q", locale)
		}

		if ruleErr == nil {
			if len(settings.IgnoreWords) != 0 {
				r.RemoveRule(settings.IgnoreWords)
			}

			r.Compile()
		}

		analyzer.Run = func(pass *analysis.Pass) (interface{}, error) {
			if ruleErr != nil {
				return nil, ruleErr
			}

			var fileNames []string
			for _, f := range pass.Files {
				pos := pass.Fset.PositionFor(f.Pos(), false)
				fileNames = append(fileNames, pos.Filename)
			}

			var res []goanalysis.Issue
			for _, f := range fileNames {
				issues, err := runMisspellOnFile(f, &r, lintCtx)
				if err != nil {
					return nil, err
				}
				for i := range issues {
					res = append(res, goanalysis.NewIssue(&issues[i], pass))
				}
			}
			if len(res) == 0 {
				return nil, nil
			}

			mu.Lock()
			resIssues = append(resIssues, res...)
			mu.Unlock()

			return nil, nil
		}
	}).WithIssuesReporter(func(*linter.Context) []goanalysis.Issue {
		return resIssues
	}).WithLoadMode(goanalysis.LoadModeSyntax)
}


text:
class Plc::TasksController < ApplicationController
  load_and_authorize_resource

  # GET /plc/tasks/1
  # GET /plc/tasks/1.json
  def show
  end

  # GET /plc/tasks/new
  def new
    @task.plc_learning_module_ids = [params[:plc_learning_module_id]]
    @task.type = params[:type]
  end

  # GET /plc/tasks/1/edit
  def edit
  end

  # POST /plc/tasks
  # POST /plc/tasks.json
  def create
    raise 'All tasks must have a distinct type' if @task.type == 'Plc::Task'

    if @task.save
      redirect_to edit_plc_task_url(@task), notice: 'Task was successfully created.'
    else
      redirect_to action: :new
    end
  end

  # PATCH/PUT /plc/tasks/1
  # PATCH/PUT /plc/tasks/1.json
  def update
    if @task.update(task_params)
      redirect_to plc_task_url(@task), notice: 'Task was successfully updated.'
    else
      redirect_to action: :edit
    end
  end

  # DELETE /plc/tasks/1
  # DELETE /plc/tasks/1.json
  def destroy
    @task.destroy
    redirect_to plc_content_creator_show_courses_and_modules_path
  end

  private
  # Never trust parameters from the scary internet, only allow the white list through.
  def task_params
    #Rails forms use the full name of the class including the module they are in, so we'll do the same
    if params[:plc_learning_resource_task]
      params.require(:plc_learning_resource_task).permit(:name, {plc_learning_module_ids: []}, :type, :resource_url, :icon)
    elsif params[:plc_script_completion_task]
      params.require(:plc_script_completion_task).permit(:name, {plc_learning_module_ids: []}, :type, :script_id)
    elsif params[:plc_written_assignment_task]
      params.require(:plc_written_assignment_task).permit(:name, {plc_learning_module_ids: []}, :type, :assignment_description)
    elsif params[:plc_task]
      params.require(:plc_task).permit(:name, {plc_learning_module_ids: []}, :type)
    end
  end
end