text:
using CjClutter.OpenGl.OpenGl.Diagnostics;
using OpenTK.Graphics.OpenGL;

namespace CjClutter.OpenGl.OpenGl
{
    public class OpenGlResourceFactory : IOpenGlResourceFactory
    {
        private readonly OpenGl _openGl;

        public OpenGlResourceFactory()
        {
            _openGl = new OpenGl();
        }

        public IProgram CreateProgram()
        {
            var program = new Program(_openGl);
            return new DebugProgram(program, new ConsoleLogger());
        }

        public IShader CreateShader(ShaderType shaderType)
        {
            var shader = new Shader(_openGl);
            shader.Create(shaderType);

            return new DebugShader(shader, new ConsoleLogger());
        }

        public VertexArrayObject CreateVertexArrayObject()
        {
            var vertexArrayObject = new VertexArrayObject();
            vertexArrayObject.Create();

            return vertexArrayObject;
        }

        public VertexBufferObject<T> CreateVertexBufferObject<T>(BufferTarget bufferTarget) where T : struct, IBufferDataType
        {
            var sizeInBytes = new T().SizeInBytes;
            var vertexBufferObject = new VertexBufferObject<T>(bufferTarget, sizeInBytes);

            vertexBufferObject.Generate();

            return vertexBufferObject;
        }

        public VertexBufferObject<T> CreateVertexBufferObject<T>(BufferTarget bufferTarget, int sizeOfT) where T : struct
        {
            var vertexBufferObject = new VertexBufferObject<T>(bufferTarget, sizeOfT);
            vertexBufferObject.Generate();

            return vertexBufferObject;
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
package ai.h2o.sparkling.backend.external

import java.io.{File, FileInputStream, FileOutputStream}
import java.util.Properties
import ai.h2o.sparkling.{H2OConf, H2OContext}
import ai.h2o.sparkling.backend.utils.{ArgumentBuilder, SharedBackendUtils, ShellUtils}
import ai.h2o.sparkling.backend.{SharedBackendConf, SparklingBackend}
import ai.h2o.sparkling.utils.ScalaUtils._
import ai.h2o.sparkling.utils.SparkSessionUtils
import org.apache.commons.io.IOUtils
import org.apache.spark.SparkFiles

import scala.io.Source

class ExternalH2OBackend(val hc: H2OContext) extends SparklingBackend with ShellUtils {

  override def startH2OCluster(conf: H2OConf): Unit = {
    if (conf.isAutoClusterStartUsed) {
      conf.resolveGeneratedCredentials()
      if (conf.externalAutoStartBackend == ExternalBackendConf.YARN_BACKEND) {
        launchExternalH2OOnYarn(conf)
      } else if (conf.externalAutoStartBackend == ExternalBackendConf.KUBERNETES_BACKEND) {
        K8sExternalBackendClient.startExternalH2OOnKubernetes(conf)
      } else {
        throw new RuntimeException(s"Invalid backend type for auto cluster start - ${conf.externalAutoStartBackend}")
      }
    }
  }

  override def backendUIInfo: Seq[(String, String)] = {
    Seq(("External backend YARN AppID", yarnAppId), ("External IP", hc.getConf.h2oCluster)).filter(_._2.nonEmpty).map {
      case (k, v) => (k, v.get)
    }
  }

  override def epilog: String =
    if (hc.getConf.isAutoClusterStartUsed && hc.getConf.externalAutoStartBackend == ExternalBackendConf.YARN_BACKEND) {
      s"""
         | * Yarn App ID of external H2O cluster: ${yarnAppId.get}
    """.stripMargin
    } else {
      ""
    }

  private def yarnAppId: Option[String] = {
    hc.getConf.getOption(ExternalBackendConf.PROP_EXTERNAL_CLUSTER_YARN_APP_ID._1)
  }

  private def launchExternalH2OOnYarn(conf: H2OConf): Unit = {
    logInfo("Starting the external H2O cluster on YARN.")
    val cmdToLaunch = getExternalH2ONodesArguments(conf)
    logInfo("Command used to start H2O on yarn: " + cmdToLaunch.mkString(" "))

    val proc = launchShellCommand(cmdToLaunch)

    val notifyFile = new File(conf.clusterInfoFile.get)
    if (!notifyFile.exists()) {
      throw new RuntimeException(s"""
           |Cluster notification file ${notifyFile.getAbsolutePath} could not be created. The possible causes are:
           |
           |1) External H2O cluster did not cloud within the pre-defined timeout. In that case, please try
           |   to increase the timeout for starting the external cluster as:
           |
           |   H2OContext.getOrCrete(H2OConf().setClusterStartTimeout(timeout))
           |
           |2) The file could not be created because of missing write rights.""".stripMargin)
    }
    // get ip port
    val clusterInfo = Source.fromFile(conf.clusterInfoFile.get).getLines()
    val ipPort = clusterInfo.next()
    val yarnAppId = clusterInfo.next().replace("job", "application")
    conf.set(ExternalBackendConf.PROP_EXTERNAL_CLUSTER_YARN_APP_ID._1, yarnAppId)
    // we no longer need the notification file
    new File(conf.clusterInfoFile.get).delete()
    logInfo(s"Yarn ID obtained from cluster file: $yarnAppId")
    logInfo(s"Cluster ip and port obtained from cluster file: $ipPort")

    assert(proc == 0, s"Starting external H2O cluster failed with return value $proc.")
    conf.setH2OCluster(ipPort)
  }

  private def getExternalH2ONodesArguments(conf: H2OConf): Seq[String] = {
    // Application tags shown in Yarn Resource Manager UI
    val yarnAppTags =
      s"${ExternalH2OBackend.TAG_EXTERNAL_H2O},${ExternalH2OBackend.TAG_SPARK_APP.format(hc.sparkContext.applicationId)}"
    new ArgumentBuilder()
      .add(Seq(conf.externalHadoopExecutable, "jar", conf.h2oDriverPath.get))
      .add("-libjars", getExtensionsAssemblyJar().getAbsolutePath + conf.externalExtraJars.map("," + _).getOrElse(""))
      .add("-files", getSecurityFiles(conf))
      .add(conf.YARNQueue.map(queue => s"-Dmapreduce.job.queuename=$queue"))
      .add(s"-Dmapreduce.job.tags=$yarnAppTags")
      .add(s"-Dai.h2o.args.config=sparkling-water-external") // H2O custom application master
      .add("-nodes", conf.clusterSize)
      .add("-notify", conf.clusterInfoFile)
      .add("-jobname", conf.cloudName)
      .add("-mapperXmx", conf.externalMemory)
      .add("-nthreads", conf.nthreads)
      .add(Seq("-J", "-log_level", "-J", conf.logLevel))
      .add(conf.icedDir.map(dir => Seq("-J", "-ice_root", "-J", dir)).getOrElse(Seq()))
      .add(conf.flowDir.map(dir => Seq("-J", "-flow_dir", "-J", dir)).getOrElse(Seq()))
      .add("-port_offset", conf.internalPortOffset)
      .add("-baseport", conf.basePort)
      .add("-timeout", conf.clusterStartTimeout)
      .add("-disown")
      .add(Seq("-J", "-rest_api_ping_timeout", "-J", conf.clientCheckRetryTimeout.toString))
      .add("-run_as_user", conf.runAsUser)
      .add(
        Seq("-J", "-stacktrace_collector_interval", "-J", conf.stacktraceCollectorInterval.toString),
        conf.stacktraceCollectorInterval != -1)
      .add("-output", conf.HDFSOutputDir)
      .add("-context_path", conf.contextPath)
      .add("-network", conf.nodeNetworkMask)
      .add(ExternalH2OBackend.getH2OSecurityArgs(conf))
      .add("-principal", conf.kerberosPrincipal)
      .add("-keytab", conf.kerberosKeytab)
      .add("-driverif", conf.externalH2ODriverIf)
      .add("-driverport", conf.externalH2ODriverPort)
      .add("-driverportrange", conf.externalH2ODriverPortRange)
      .add("-extramempercent", conf.externalExtraMemoryPercent)
      .addIf("-hiveHost", conf.hiveHost, conf.isKerberizedHiveEnabled)
      .addIf("-hivePrincipal", conf.hivePrincipal, conf.isKerberizedHiveEnabled)
      .addIf("-hiveJdbcUrlPattern", conf.hiveJdbcUrlPattern, conf.isKerberizedHiveEnabled)
      .addIf("-hiveToken", conf.hiveToken, conf.isKerberizedHiveEnabled)
      .add("-refreshTokens", conf.isKerberizedHiveEnabled)
      .add(conf.extraProperties)
      .add(ExternalH2OBackend.getExtraHttpHeaderArgs(conf).flatMap(arg => Seq("-J", arg)))
      .buildArgs()
  }

  private def getExtensionsAssemblyJar(): File = {
    val fileInJar = "assembly-extensions.jar.embedded"
    val tempFile = File.createTempFile("assembly-extensions-", ".jar")
    tempFile.deleteOnExit()
    withResource(new FileOutputStream(tempFile)) { outputStream =>
      withResource(getClass.getClassLoader.getResourceAsStream(fileInJar)) { inputStream =>
        IOUtils.copy(inputStream, outputStream)
      }
    }
    tempFile
  }

  private def getSecurityFiles(conf: H2OConf): Option[String] = {
    conf.sslConf match {
      case Some(internalSecurityConf) =>
        // In External Backend, auto mode we need distribute the keystore files to the H2O cluster
        val props = new Properties()
        props.load(new FileInputStream(internalSecurityConf))
        val keyStoreFiles = Array(props.get("h2o_ssl_jks_internal"), props.get("h2o_ssl_jts")).map(f =>
          SparkFiles.get(f.asInstanceOf[String]))
        logInfo(s"Starting external H2O cluster in encrypted mode with config: $internalSecurityConf")
        Some(keyStoreFiles.mkString(","))
      case _ =>
        None
    }
  }
}

object ExternalH2OBackend extends SharedBackendUtils {

  override def checkAndUpdateConf(conf: H2OConf): H2OConf = {
    super.checkAndUpdateConf(conf)
    // Increase locality timeout since h2o-specific tasks can be long computing
    if (conf.getInt("spark.locality.wait", 3000) <= 3000) {
      logWarning(s"Increasing 'spark.locality.wait' to value 30000")
      conf.set("spark.locality.wait", "30000")
    }

    if (conf.clusterStartMode != ExternalBackendConf.EXTERNAL_BACKEND_MANUAL_MODE &&
        conf.clusterStartMode != ExternalBackendConf.EXTERNAL_BACKEND_AUTO_MODE) {

      throw new IllegalArgumentException(
        s"""'${ExternalBackendConf.PROP_EXTERNAL_CLUSTER_START_MODE._1}' property is set to ${conf.clusterStartMode}.
          Valid options are "${ExternalBackendConf.EXTERNAL_BACKEND_MANUAL_MODE}" or "${ExternalBackendConf.EXTERNAL_BACKEND_AUTO_MODE}".
      """)
    }

    if (conf.isAutoClusterStartUsed) {

      if (conf.externalAutoStartBackend != ExternalBackendConf.YARN_BACKEND &&
          conf.externalAutoStartBackend != ExternalBackendConf.KUBERNETES_BACKEND) {
        throw new IllegalArgumentException(
          s"""'${ExternalBackendConf.PROP_EXTERNAL_AUTO_START_BACKEND._1}' property is set to ${conf.externalAutoStartBackend}.
          Valid options are "${ExternalBackendConf.YARN_BACKEND}" or "${ExternalBackendConf.KUBERNETES_BACKEND}".
      """)
      }
      if (conf.externalAutoStartBackend == ExternalBackendConf.YARN_BACKEND) {
        val envDriverJar = ExternalH2OBackend.ENV_H2O_DRIVER_JAR

        lazy val driverPath = sys.env.get(envDriverJar)
        if (conf.h2oDriverPath.isEmpty && driverPath.isEmpty) {
          throw new IllegalArgumentException(
            s"""Path to the H2O driver has to be specified when using automatic cluster start.
               |It can be specified either via method available on the configuration object or
               |by using the '$envDriverJar' environmental property.
          """.stripMargin)
        }

        if (conf.h2oDriverPath.isEmpty && driverPath.isDefined) {
          logInfo(s"""Obtaining path to the H2O driver from the environment variable $envDriverJar.
               |Specified path is: ${driverPath.get}""".stripMargin)
          conf.setH2ODriverPath(driverPath.get)
        }

        if (conf.clientCheckRetryTimeout < conf.backendHeartbeatInterval) {
          logWarning(
            s"%s needs to be larger than %s, increasing the value to %d".format(
              SharedBackendConf.PROP_EXTERNAL_CLIENT_RETRY_TIMEOUT._1,
              SharedBackendConf.PROP_BACKEND_HEARTBEAT_INTERVAL._1,
              conf.backendHeartbeatInterval * 6))
          conf.setClientCheckRetryTimeout(conf.backendHeartbeatInterval * 6)
        }

        if (conf.cloudName.isEmpty) {
          conf.setCloudName(H2O_JOB_NAME.format(SparkSessionUtils.active.sparkContext.applicationId))
        }

        if (conf.clusterInfoFile.isEmpty) {
          conf.setClusterInfoFile("notify_" + conf.cloudName.get)
        }

        if (conf.getOption("spark.yarn.principal").isDefined &&
            conf.kerberosPrincipal.isEmpty) {
          logInfo(
            s"spark.yarn.principal provided and ${ExternalBackendConf.PROP_EXTERNAL_KERBEROS_PRINCIPAL._1} is" +
              s" not set. Passing the configuration to H2O.")
          conf.setKerberosPrincipal(conf.get("spark.yarn.principal"))
        }

        if (conf.getOption("spark.yarn.keytab").isDefined &&
            conf.kerberosKeytab.isEmpty) {
          logInfo(
            s"spark.yarn.keytab provided and ${ExternalBackendConf.PROP_EXTERNAL_KERBEROS_KEYTAB._1} is" +
              s" not set. Passing the configuration to H2O.")
          conf.setKerberosKeytab(conf.get("spark.yarn.keytab"))
        }

        if (conf.kerberosKeytab.isDefined && conf.kerberosPrincipal.isEmpty) {
          throw new IllegalArgumentException(s"""
                                                |  Both options ${ExternalBackendConf.PROP_EXTERNAL_KERBEROS_KEYTAB._1} and
                                                |  ${ExternalBackendConf.PROP_EXTERNAL_KERBEROS_PRINCIPAL._1} need to be provided, specified has
                                                |  been just ${ExternalBackendConf.PROP_EXTERNAL_KERBEROS_KEYTAB._1}
          """.stripMargin)
        } else if (conf.kerberosPrincipal.isDefined && conf.kerberosKeytab.isEmpty) {
          throw new IllegalArgumentException(s"""
                                                |  Both options ${ExternalBackendConf.PROP_EXTERNAL_KERBEROS_KEYTAB._1} and
                                                |  ${ExternalBackendConf.PROP_EXTERNAL_KERBEROS_PRINCIPAL._1} need to be provided, specified has
                                                |  been just ${ExternalBackendConf.PROP_EXTERNAL_KERBEROS_PRINCIPAL._1}
          """.stripMargin)
        }
      } else {
        if (conf.cloudName.isEmpty) {
          // H2O on Kubernetes in Docker image provided by us is running as root and sets
          // the cluster name as root as well
          conf.setCloudName("root")
        }
      }

      if (conf.clusterSize.isEmpty) {
        throw new IllegalArgumentException(
          "Cluster size of external H2O cluster has to be specified in automatic mode of external H2O backend!")
      }
    } else {
      if (conf.cloudName.isEmpty) {
        throw new IllegalArgumentException(
          s"""Cluster name has to be specified when using the external H2O cluster mode in the manual start mode.
             |It can be set either on the configuration object or via '${SharedBackendConf.PROP_CLOUD_NAME._1}'
             |spark configuration property""".stripMargin)
      }

      if (conf.h2oCluster.isEmpty) {
        throw new IllegalArgumentException("H2O Cluster endpoint has to be specified!")
      }
    }
    distributeFiles(conf, SparkSessionUtils.active.sparkContext)
    conf
  }

  // This string tags instances of H2O launched from Sparkling Water
  val TAG_EXTERNAL_H2O = "H2O/Sparkling-Water"

  // Another tag which identifies launcher - aka Spark application
  val TAG_SPARK_APP = "Sparkling-Water/Spark/%s"

  // Job name for H2O Yarn job
  val H2O_JOB_NAME = "H2O_via_SparklingWater_%s"

  // Name of the environmental property, which may contain path to the external H2O driver
  val ENV_H2O_DRIVER_JAR = "H2O_DRIVER_JAR"
}


text:
namespace global {

    export class FormControllerMock {

        public static getMock(overrides:Object = {}):ng.IFormController {

            let defaults = {
                $pristine: false,
                $dirty: true,
                $valid: true,
                $invalid: false,
                $submitted: false,
                $error: {},
                $addControl: sinon.stub(),
                $removeControl: sinon.stub(),
                $setValidity:sinon.stub(),
                $setDirty: sinon.stub(),
                $setPristine: sinon.stub(),
                $commitViewValue: sinon.stub(),
                $rollbackViewValue: sinon.stub(),
                $setSubmitted: sinon.stub(),
                $setUntouched: sinon.stub(),
            };

            return <ng.IFormController>_.merge(defaults, overrides);

        }

    }

    export class NgModelControllerMock {

        public static getMock(overrides:Object = {}):ng.INgModelController {

            let defaults = {
                $render: sinon.stub(),
                $setValidity: sinon.stub(),
                $setViewValue: sinon.stub(),
                $setPristine: sinon.stub(),
                $setDirty: sinon.stub(),
                $validate: sinon.stub(),
                $setTouched: sinon.stub(),
                $setUntouched: sinon.stub(),
                $rollbackViewValue: sinon.stub(),
                $commitViewValue: sinon.stub(),
                $isEmpty: sinon.stub(),
                $viewValue: {},
                $modelValue: {},
                $parsers: [],
                $formatters: [],
                $viewChangeListeners: [],
                $error: {},
                $name: '',
                $touched: false,
                $untouched: true,
                $validators: {},
                $asyncValidators: {},
                $pending: {},
                $pristine: false,
                $dirty: true,
                $valid: true,
                $invalid: false,
            };

            return <ng.INgModelController>_.merge(defaults, overrides);

        }

    }

    export interface MouseEventMockInit {
        typeArg?: string;
        canBubbleArg?: boolean;
        cancelableArg?: boolean;
        viewArg?: Window;
        detailArg?: number;
        screenXArg?: number;
        screenYArg?: number;
        clientXArg?: number;
        clientYArg?: number;
        ctrlKeyArg?: boolean;
        altKeyArg?: boolean;
        shiftKeyArg?: boolean;
        metaKeyArg?: boolean;
        buttonArg?: number;
        relatedTargetArg?: EventTarget;
    }

    export class MouseEventMock {

        public static getMock(overrides:MouseEventMockInit = {}):MouseEvent {

            let defaults = {
                typeArg: 'click',
                canBubbleArg: true,
                cancelableArg: true,
                viewArg: window,
                detailArg: 1,
                screenXArg: 800,
                screenYArg: 600,
                clientXArg: 290,
                clientYArg: 260,
                ctrlKeyArg: false,
                altKeyArg: false,
                shiftKeyArg: false,
                metaKeyArg: false,
                buttonArg: 0,
                relatedTargetArg: null,
            };

            let evt = document.createEvent("MouseEvent");

            evt.initMouseEvent.apply(evt, _.values(_.merge(defaults, overrides)));

            return evt;

        }

    }

}


text:
package qub;

/**
 * A ProcessFactory that builds and runs fake processes.
 */
public class FakeChildProcessRunner implements ChildProcessRunner
{
    private final DesktopProcess process;
    private final List<FakeChildProcessRun> fakeProcessRuns;

    /**
     * Create a new FakeProcessFactory.
     */
    private FakeChildProcessRunner(DesktopProcess process)
    {
        PreCondition.assertNotNull(process, "process");

        this.process = process;
        this.fakeProcessRuns = List.create();
    }

    public static FakeChildProcessRunner create(DesktopProcess process)
    {
        return new FakeChildProcessRunner(process);
    }

    @Override
    public Result<? extends ChildProcess> start(ChildProcessParameters parameters)
    {
        PreCondition.assertNotNull(parameters, "parameters");

        return Result.create(() ->
        {
            Path currentFolderPath = parameters.getWorkingFolderPath();
            if (currentFolderPath == null)
            {
                currentFolderPath = this.process.getCurrentFolderPath();
            }

            final FileSystem fileSystem = this.process.getFileSystem();
            if (!fileSystem.folderExists(currentFolderPath).await())
            {
                throw new FolderNotFoundException(currentFolderPath);
            }

            final Path executablePath = parameters.getExecutablePath();
            final Iterable<String> arguments = parameters.getArguments();

            FakeChildProcessRun partialMatch = null;
            FakeChildProcessRun match = null;
            final int fakeProcessRunCount = this.fakeProcessRuns.getCount();
            for (int i = fakeProcessRunCount - 1; 0 <= i; --i)
            {
                final FakeChildProcessRun fakeProcessRun = this.fakeProcessRuns.get(i);

                if (executablePath.equals(fakeProcessRun.getExecutablePath()) && arguments.equals(fakeProcessRun.getArguments()))
                {
                    final Path runWorkingFolderPath = fakeProcessRun.getWorkingFolderPath();
                    if (currentFolderPath.equals(runWorkingFolderPath))
                    {
                        match = fakeProcessRun;
                        break;
                    }
                    else if (runWorkingFolderPath == null && partialMatch == null)
                    {
                        partialMatch = fakeProcessRun;
                    }
                }
            }

            if (match == null && partialMatch != null)
            {
                match = partialMatch;
            }

            final FakeChildProcess result = FakeChildProcess.create()
                .setState(ProcessState.Running);

            if (match == null)
            {
                final String command = ChildProcessRunner.getCommand(executablePath, arguments, currentFolderPath);
                throw new NotFoundException("No fake process run found for " + Strings.escapeAndQuote(command) + ".");
            }
            else
            {
                final Action1<FakeDesktopProcess> action = match.getAction();
                if (action == null)
                {
                    result.setProcessResult(0);
                }
                else
                {
                    final AsyncRunner parallelAsyncRunner = this.process.getParallelAsyncRunner();
                    final FakeDesktopProcess childProcess = FakeDesktopProcess.create(arguments)
                        .setChildProcessRunner(this.process::getChildProcessRunner)
                        .setClock(this.process::getClock)
                        .setCurrentFolderPath(currentFolderPath)
                        .setDefaultApplicationLauncher(this.process::getDefaultApplicationLauncher)
                        .setDisplays(this.process::getDisplays)
                        .setEnvironmentVariables(this.process::getEnvironmentVariables)
                        .setFileSystem(fileSystem)
                        .setNetwork(this.process::getNetwork)
                        .setRandom(this.process::getRandom)
                        .setSynchronization(this.process::getSynchronization)
                        .setSystemProperties(this.process::getSystemProperties)
                        .setTypeLoader(this.process::getTypeLoader);

                    final ByteReadStream inputStream = parameters.getInputStream();
                    if (inputStream != null)
                    {
                        childProcess.setInputReadStream(() ->
                        {
                            final InMemoryCharacterToByteStream childProcessInput = InMemoryCharacterToByteStream.create();
                            parallelAsyncRunner.schedule(() ->
                            {
                                childProcessInput.writeAll(inputStream).await();
                                childProcessInput.endOfStream();
                            });
                            return childProcessInput;
                        });

                    }

                    final Action1<ByteReadStream> outputStreamHandler = parameters.getOutputStreamHandler();
                    final InMemoryCharacterToByteStream childProcessOutput = childProcess.getOutputWriteStream();
                    if (outputStreamHandler != null)
                    {
                        result.setOutputResult(parallelAsyncRunner.schedule(() -> outputStreamHandler.run(childProcessOutput)));
                    }

                    final Action1<ByteReadStream> errorStreamHandler = parameters.getErrorStreamHandler();
                    final InMemoryCharacterToByteStream childProcessError = childProcess.getErrorWriteStream();
                    if (errorStreamHandler != null)
                    {
                        result.setErrorResult(parallelAsyncRunner.schedule(() -> errorStreamHandler.run(childProcessError)));
                    }

                    result.setProcessResult(parallelAsyncRunner.schedule(() ->
                    {
                        try
                        {
                            action.run(childProcess);
                        }
                        finally
                        {
                            childProcessOutput.endOfStream();
                            childProcessError.endOfStream();
                            result.setState(ProcessState.NotRunning);
                        }
                        return childProcess.getExitCode();
                    }));
                }
            }

            PostCondition.assertNotNull(result, "result");

            return result;
        });
    }

    /**
     * Add the provided FakeProcessRun to this FakeProcessBuilderFactory. When a ProcessBuilder that
     * was created by this FakeProcessBuilderFactory is run, the list of added FakeProcessRuns will
     * be searched instead of running the actual executable file. If a matching FakeProcessRun is
     * found, then its result will be performed. If no matching FakeProcessRun is found, then an
     * error will be returned.
     * @param fakeProcessRun The FakeProcessRun to add.
     * @return This object for method chaining.
     */
    public FakeChildProcessRunner add(FakeChildProcessRun fakeProcessRun)
    {
        PreCondition.assertNotNull(fakeProcessRun, "fakeProcessRun");

        this.fakeProcessRuns.add(fakeProcessRun);

        return this;
    }
}


text:
@class CKRecordID;

@interface CKDiscoveredUserInfo : NSObject

- (instancetype)init NS_UNAVAILABLE;

@property(nonatomic, readonly, copy) CKRecordID *userRecordID;
@property(nonatomic, readonly, copy) NSString *firstName;
@property(nonatomic, readonly, copy) NSString *lastName;

@end


text:
import { flatten, keyBy, sortNumeric, uniq } from "../../clientUtils/Util"
import { StackedPointPositionType, StackedSeries } from "./StackedConstants"

// This method shift up the Y Values of a Series with Points in place.
// Todo: use a lib?
export const stackSeries = <PositionType extends StackedPointPositionType>(
    seriesArr: readonly StackedSeries<PositionType>[]
): readonly StackedSeries<PositionType>[] => {
    seriesArr.forEach((series, seriesIndex) => {
        if (!seriesIndex) return // The first series does not need to be shifted
        series.points.forEach((point, pointIndex) => {
            const pointBelowThisOne =
                seriesArr[seriesIndex - 1].points[pointIndex]
            point.valueOffset =
                pointBelowThisOne.value + pointBelowThisOne.valueOffset
        })
    })
    return seriesArr
}

// Adds a Y = 0 value for each missing x value (where X is usually Time)
export const withMissingValuesAsZeroes = <
    PositionType extends StackedPointPositionType
>(
    seriesArr: readonly StackedSeries<PositionType>[]
): StackedSeries<PositionType>[] => {
    const allXValuesSorted = sortNumeric(
        uniq(
            flatten(seriesArr.map((series) => series.points)).map(
                (point) => point.position
            )
        )
    )
    return seriesArr.map((series) => {
        const pointsByPosition = keyBy(series.points, "position")
        return {
            ...series,
            points: allXValuesSorted.map((position) => {
                const point = pointsByPosition[position]
                const value = point?.value ?? 0
                const time = point?.time ?? 0
                return {
                    time,
                    position,
                    value,
                    valueOffset: 0,
                    fake: !point,
                }
            }),
        }
    })
}


text:
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.web.mavenproject6.other;

import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.Iterator;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.springframework.stereotype.Component;

/**
 *
 * @author Aleks
 */
public class XLSParser {

    private static String readCell(Row row) {
        String buf = "";
        Iterator<Cell> cells = row.iterator();
        while (cells.hasNext()) {
            Cell cell = cells.next();
            int cellType = cell.getCellType();
            if (cell.getCellStyle().getLocked() == false) {
                switch (cellType) {
                    case Cell.CELL_TYPE_STRING:
                        buf += cell.getStringCellValue();
                        break;
                    case Cell.CELL_TYPE_NUMERIC:
                        buf += (int) cell.getNumericCellValue();
                        break;

                    case Cell.CELL_TYPE_FORMULA:
                        buf += cell.getNumericCellValue();
                        break;
                    default:
                        buf += " ";
                        break;
                }
            }
        }
        return buf;
    }

    private static String readCell(Row row, int offset, int count) {
        String buf = "";
        Iterator<Cell> cells = row.iterator();
        int index = 0;
        while (cells.hasNext()) {
            Cell cell = cells.next();

            int cellType = cell.getCellType();
            if (cell.getCellStyle().getLocked() == false) {
                if (index >= offset && index < offset + count) {
                    switch (cellType) {
                        case Cell.CELL_TYPE_STRING:
                            buf += cell.getStringCellValue();
                            break;
                        case Cell.CELL_TYPE_NUMERIC:
                            buf += (int) cell.getNumericCellValue();
                            break;

                        case Cell.CELL_TYPE_FORMULA:
                            buf += cell.getNumericCellValue();
                            break;

                    }
                }
                index++;
            }
        }
        return buf;
    }

    public static String parse(String name) {

        String result = "";
        InputStream in = null;
        HSSFWorkbook wb = null;
        try {
            in = new FileInputStream(name);
            wb = new HSSFWorkbook(in);
        } catch (IOException e) {
            e.printStackTrace();
        }

        System.out.println("!!!!sheet count:" + wb.getNumberOfSheets());
        for (int i = 0; i < wb.getNumberOfSheets(); i++) {
            System.out.println("!!!!sheet[" + i + "]:" + wb.getSheetName(i));
        }
        for (int i = 0; i < wb.getNumberOfSheets(); i++) {
            Sheet sheet = wb.getSheetAt(i);
            Iterator<Row> it = sheet.iterator();
            String buf = "";
            while (it.hasNext()) {
                Row row = it.next();

                //result += row.getRowNum() + ":";
                switch (row.getRowNum() + 1) {
                    case 13:
                        result += readCell(row);
                        result += "
";
                        break;
                    case 14:
                        result += readCell(row);
                        result += "
";
                        break;
                    case 15:
                        result += readCell(row);
                        break;
                    case 16:
                        result += readCell(row);
                        result += "
";
                        break;
                    case 18:
                        result += readCell(row);
                        break;
                    case 19:
                        result += readCell(row);
                        break;
                    case 20:
                        result += readCell(row);
                        break;
                    case 21:
                        result += readCell(row);
                        break;
                    case 22:
                        result += readCell(row);
                        result += "
";
                        break;
                    case 25:
                        result += readCell(row);
                        break;
                    case 26:
                        result += readCell(row);
                        result += "
";
                        break;
                    default:
                        result += readCell(row);
                        result += "
";
                        break;
                }

//            if (row.getRowNum() + 1 != 34 || row.getRowNum() + 1 != 34) {
//                result += readCell(row);
//            } else {
//                result += "[" + readCell(row, 0, 7) + "][" + readCell(row, 7, 10);
//            }
            }
        }
        return result;
    }

    public static String parseStatisticDoc(String name) {

        String result = "";
        InputStream in = null;
        HSSFWorkbook wb = null;
        try {
            in = new FileInputStream(name);
            wb = new HSSFWorkbook(in);
        } catch (IOException e) {
            e.printStackTrace();
        }

        System.out.println("!!!!sheet count:" + wb.getNumberOfSheets());
        for (int i = 0; i < wb.getNumberOfSheets(); i++) {
            System.out.println("!!!!sheet[" + i + "]:" + wb.getSheetName(i));
        }

        Sheet sheet = wb.getSheetAt(0);
        Iterator<Row> it = sheet.iterator();
        while (it.hasNext()) {
            Row row = it.next();
            Iterator<Cell> cells = row.iterator();

            //  row.getCell(0).getStringCellValue()
            switch (row.getRowNum()) {

            }
            result += "\n";
        }

        return result;
    }

}


text:
using UnityEngine;
using UnityEditor;
using System.Collections;

using System.IO;
using System.Collections.Generic;
using System.Reflection;
using System.Xml;

public static class EditorHelpers
{

	#region Helper

	public static bool GetImageSize(this Texture2D asset, out int width, out int height) {
		if (asset != null) {
			string assetPath = AssetDatabase.GetAssetPath(asset);
			TextureImporter importer = AssetImporter.GetAtPath(assetPath) as TextureImporter;

			if (importer != null) {
				object[] args = new object[2] { 0, 0 };
				MethodInfo mi = typeof(TextureImporter).GetMethod("GetWidthAndHeight", BindingFlags.NonPublic | BindingFlags.Instance);
				mi.Invoke(importer, args);

				width = (int)args[0];
				height = (int)args[1];

				return true;
			}
		}

		height = width = 0;
		return false;
	}

	public static T CreateAsset<T> (string name = "") where T : ScriptableObject
	{
		T asset = ScriptableObject.CreateInstance<T>();

		string path = AssetDatabase.GetAssetPath (Selection.activeObject);
		if (path == "")
		{
			path = "Assets";
		}
		else if (Path.GetExtension (path) != "")
		{
			path = path.Replace (Path.GetFileName (AssetDatabase.GetAssetPath (Selection.activeObject)), "");
		}

		if(name.Equals(""))
		{
			name = "New " + typeof(T).ToString();
		}

		string assetPathAndName = AssetDatabase.GenerateUniqueAssetPath (path + "/" + name + ".asset");

		AssetDatabase.CreateAsset (asset, assetPathAndName);

		AssetDatabase.SaveAssets ();
		EditorUtility.FocusProjectWindow ();
		Selection.activeObject = asset;

		return AssetDatabase.LoadAssetAtPath(assetPathAndName, typeof(T) ) as T;
	}

	#endregion
}


text:
package org.apache.accumulo.test.replication;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;

import java.util.Collections;
import java.util.HashSet;
import java.util.Map.Entry;
import java.util.Set;
import java.util.UUID;

import org.apache.accumulo.core.client.Accumulo;
import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.BatchScanner;
import org.apache.accumulo.core.client.BatchWriter;
import org.apache.accumulo.core.client.IteratorSetting;
import org.apache.accumulo.core.data.Key;
import org.apache.accumulo.core.data.Mutation;
import org.apache.accumulo.core.data.Range;
import org.apache.accumulo.core.data.TableId;
import org.apache.accumulo.core.data.Value;
import org.apache.accumulo.core.iterators.user.WholeRowIterator;
import org.apache.accumulo.core.protobuf.ProtobufUtil;
import org.apache.accumulo.core.replication.ReplicationSchema.OrderSection;
import org.apache.accumulo.core.replication.ReplicationSchema.StatusSection;
import org.apache.accumulo.core.replication.ReplicationSchema.WorkSection;
import org.apache.accumulo.core.replication.ReplicationTable;
import org.apache.accumulo.core.replication.ReplicationTarget;
import org.apache.accumulo.core.security.TablePermission;
import org.apache.accumulo.master.replication.RemoveCompleteReplicationRecords;
import org.apache.accumulo.server.replication.StatusUtil;
import org.apache.accumulo.server.replication.proto.Replication.Status;
import org.apache.accumulo.test.functional.ConfigurableMacBase;
import org.easymock.EasyMock;
import org.junit.Before;
import org.junit.Test;

import com.google.common.collect.Iterables;

public class RemoveCompleteReplicationRecordsIT extends ConfigurableMacBase {

  private MockRemoveCompleteReplicationRecords rcrr;
  private AccumuloClient client;

  private static class MockRemoveCompleteReplicationRecords
      extends RemoveCompleteReplicationRecords {

    public MockRemoveCompleteReplicationRecords(AccumuloClient client) {
      super(client);
    }

    @Override
    public long removeCompleteRecords(AccumuloClient client, BatchScanner bs, BatchWriter bw) {
      return super.removeCompleteRecords(client, bs, bw);
    }

  }

  @Before
  public void initialize() throws Exception {
    client = Accumulo.newClient().from(getClientProperties()).build();
    rcrr = new MockRemoveCompleteReplicationRecords(client);
    client.securityOperations().grantTablePermission(client.whoami(), ReplicationTable.NAME,
        TablePermission.READ);
    client.securityOperations().grantTablePermission(client.whoami(), ReplicationTable.NAME,
        TablePermission.WRITE);
    ReplicationTable.setOnline(client);
  }

  private TableId createTableId(int i) {
    return TableId.of(Integer.toString(i));
  }

  @Test
  public void notYetReplicationRecordsIgnored() throws Exception {
    BatchWriter bw = ReplicationTable.getBatchWriter(client);
    int numRecords = 3;
    for (int i = 0; i < numRecords; i++) {
      String file = "/accumulo/wal/tserver+port/" + UUID.randomUUID();
      Mutation m = new Mutation(file);
      StatusSection.add(m, createTableId(i), StatusUtil.openWithUnknownLengthValue());
      bw.addMutation(m);
    }

    bw.close();

    assertEquals(numRecords, Iterables.size(ReplicationTable.getScanner(client)));

    try (BatchScanner bs = ReplicationTable.getBatchScanner(client, 1)) {
      bs.setRanges(Collections.singleton(new Range()));
      IteratorSetting cfg = new IteratorSetting(50, WholeRowIterator.class);
      bs.addScanIterator(cfg);
      bw = EasyMock.createMock(BatchWriter.class);

      EasyMock.replay(bw);

      rcrr.removeCompleteRecords(client, bs, bw);
      assertEquals(numRecords, Iterables.size(ReplicationTable.getScanner(client)));
    }
  }

  @Test
  public void partiallyReplicatedRecordsIgnored() throws Exception {
    BatchWriter bw = ReplicationTable.getBatchWriter(client);
    int numRecords = 3;
    Status.Builder builder = Status.newBuilder();
    builder.setClosed(false);
    builder.setEnd(10000);
    builder.setInfiniteEnd(false);
    for (int i = 0; i < numRecords; i++) {
      String file = "/accumulo/wal/tserver+port/" + UUID.randomUUID();
      Mutation m = new Mutation(file);
      StatusSection.add(m, createTableId(i),
          ProtobufUtil.toValue(builder.setBegin(1000 * (i + 1)).build()));
      bw.addMutation(m);
    }

    bw.close();

    assertEquals(numRecords, Iterables.size(ReplicationTable.getScanner(client)));

    try (BatchScanner bs = ReplicationTable.getBatchScanner(client, 1)) {
      bs.setRanges(Collections.singleton(new Range()));
      IteratorSetting cfg = new IteratorSetting(50, WholeRowIterator.class);
      bs.addScanIterator(cfg);
      bw = EasyMock.createMock(BatchWriter.class);

      EasyMock.replay(bw);

      // We don't remove any records, so we can just pass in a fake BW for both
      rcrr.removeCompleteRecords(client, bs, bw);
      assertEquals(numRecords, Iterables.size(ReplicationTable.getScanner(client)));
    }
  }

  @Test
  public void replicatedClosedWorkRecordsAreNotRemovedWithoutClosedStatusRecords()
      throws Exception {
    BatchWriter replBw = ReplicationTable.getBatchWriter(client);
    int numRecords = 3;

    Status.Builder builder = Status.newBuilder();
    builder.setClosed(false);
    builder.setEnd(10000);
    builder.setInfiniteEnd(false);

    // Write out numRecords entries to both replication and metadata tables, none of which are fully
    // replicated
    for (int i = 0; i < numRecords; i++) {
      String file = "/accumulo/wal/tserver+port/" + UUID.randomUUID();
      Mutation m = new Mutation(file);
      StatusSection.add(m, createTableId(i),
          ProtobufUtil.toValue(builder.setBegin(1000 * (i + 1)).build()));
      replBw.addMutation(m);
    }

    // Add two records that we can delete
    String fileToRemove = "/accumulo/wal/tserver+port/" + UUID.randomUUID();
    Mutation m = new Mutation(fileToRemove);
    StatusSection.add(m, TableId.of("5"),
        ProtobufUtil.toValue(builder.setBegin(10000).setEnd(10000).setClosed(false).build()));
    replBw.addMutation(m);

    numRecords++;

    fileToRemove = "/accumulo/wal/tserver+port/" + UUID.randomUUID();
    m = new Mutation(fileToRemove);
    StatusSection.add(m, TableId.of("6"),
        ProtobufUtil.toValue(builder.setBegin(10000).setEnd(10000).setClosed(false).build()));
    replBw.addMutation(m);

    numRecords++;

    replBw.flush();

    // Make sure that we have the expected number of records in both tables
    assertEquals(numRecords, Iterables.size(ReplicationTable.getScanner(client)));

    // We should not remove any records because they're missing closed status
    try (BatchScanner bs = ReplicationTable.getBatchScanner(client, 1)) {
      bs.setRanges(Collections.singleton(new Range()));
      IteratorSetting cfg = new IteratorSetting(50, WholeRowIterator.class);
      bs.addScanIterator(cfg);

      try {
        assertEquals(0L, rcrr.removeCompleteRecords(client, bs, replBw));
      } finally {
        replBw.close();
      }
    }
  }

  @Test
  public void replicatedClosedRowsAreRemoved() throws Exception {
    BatchWriter replBw = ReplicationTable.getBatchWriter(client);
    int numRecords = 3;

    Status.Builder builder = Status.newBuilder();
    builder.setClosed(false);
    builder.setEnd(10000);
    builder.setInfiniteEnd(false);

    long time = System.currentTimeMillis();
    // Write out numRecords entries to both replication and metadata tables, none of which are fully
    // replicated
    for (int i = 0; i < numRecords; i++) {
      builder.setCreatedTime(time++);
      String file = "/accumulo/wal/tserver+port/" + UUID.randomUUID();
      Mutation m = new Mutation(file);
      Value v = ProtobufUtil.toValue(builder.setBegin(1000 * (i + 1)).build());
      StatusSection.add(m, createTableId(i), v);
      replBw.addMutation(m);
      m = OrderSection.createMutation(file, time);
      OrderSection.add(m, createTableId(i), v);
      replBw.addMutation(m);
    }

    Set<String> filesToRemove = new HashSet<>();
    // We created two mutations for each file
    numRecords *= 2;
    int finalNumRecords = numRecords;

    // Add two records that we can delete
    String fileToRemove = "/accumulo/wal/tserver+port/" + UUID.randomUUID();
    filesToRemove.add(fileToRemove);
    Mutation m = new Mutation(fileToRemove);
    ReplicationTarget target = new ReplicationTarget("peer1", "5", TableId.of("5"));
    Value value = ProtobufUtil.toValue(
        builder.setBegin(10000).setEnd(10000).setClosed(true).setCreatedTime(time).build());
    StatusSection.add(m, TableId.of("5"), value);
    WorkSection.add(m, target.toText(), value);
    replBw.addMutation(m);

    m = OrderSection.createMutation(fileToRemove, time);
    OrderSection.add(m, TableId.of("5"), value);
    replBw.addMutation(m);
    time++;

    numRecords += 3;

    fileToRemove = "/accumulo/wal/tserver+port/" + UUID.randomUUID();
    filesToRemove.add(fileToRemove);
    m = new Mutation(fileToRemove);
    value = ProtobufUtil.toValue(
        builder.setBegin(10000).setEnd(10000).setClosed(true).setCreatedTime(time).build());
    target = new ReplicationTarget("peer1", "6", TableId.of("6"));
    StatusSection.add(m, TableId.of("6"), value);
    WorkSection.add(m, target.toText(), value);
    replBw.addMutation(m);

    m = OrderSection.createMutation(fileToRemove, time);
    OrderSection.add(m, TableId.of("6"), value);
    replBw.addMutation(m);
    time++;

    numRecords += 3;

    replBw.flush();

    // Make sure that we have the expected number of records in both tables
    assertEquals(numRecords, Iterables.size(ReplicationTable.getScanner(client)));

    // We should remove the two fully completed records we inserted
    try (BatchScanner bs = ReplicationTable.getBatchScanner(client, 1)) {
      bs.setRanges(Collections.singleton(new Range()));
      StatusSection.limit(bs);
      WorkSection.limit(bs);
      IteratorSetting cfg = new IteratorSetting(50, WholeRowIterator.class);
      bs.addScanIterator(cfg);

      try {
        assertEquals(4L, rcrr.removeCompleteRecords(client, bs, replBw));
      } finally {
        replBw.close();
      }

      int actualRecords = 0;
      for (Entry<Key,Value> entry : ReplicationTable.getScanner(client)) {
        assertFalse(filesToRemove.contains(entry.getKey().getRow().toString()));
        actualRecords++;
      }

      assertEquals(finalNumRecords, actualRecords);
    }
  }

  @Test
  public void partiallyReplicatedEntriesPrecludeRowDeletion() throws Exception {
    BatchWriter replBw = ReplicationTable.getBatchWriter(client);
    int numRecords = 3;

    Status.Builder builder = Status.newBuilder();
    builder.setClosed(false);
    builder.setEnd(10000);
    builder.setInfiniteEnd(false);

    // Write out numRecords entries to both replication and metadata tables, none of which are fully
    // replicated
    for (int i = 0; i < numRecords; i++) {
      String file = "/accumulo/wal/tserver+port/" + UUID.randomUUID();
      Mutation m = new Mutation(file);
      StatusSection.add(m, createTableId(i),
          ProtobufUtil.toValue(builder.setBegin(1000 * (i + 1)).build()));
      replBw.addMutation(m);
    }

    // Add two records that we can delete
    String fileToRemove = "/accumulo/wal/tserver+port/" + UUID.randomUUID();
    Mutation m = new Mutation(fileToRemove);
    ReplicationTarget target = new ReplicationTarget("peer1", "5", TableId.of("5"));
    Value value =
        ProtobufUtil.toValue(builder.setBegin(10000).setEnd(10000).setClosed(true).build());
    StatusSection.add(m, TableId.of("5"), value);
    WorkSection.add(m, target.toText(), value);
    target = new ReplicationTarget("peer2", "5", TableId.of("5"));
    WorkSection.add(m, target.toText(), value);
    target = new ReplicationTarget("peer3", "5", TableId.of("5"));
    WorkSection.add(m, target.toText(), ProtobufUtil.toValue(builder.setClosed(false).build()));
    replBw.addMutation(m);

    numRecords += 4;

    replBw.flush();

    // Make sure that we have the expected number of records in both tables
    assertEquals(numRecords, Iterables.size(ReplicationTable.getScanner(client)));

    // We should remove the two fully completed records we inserted
    try (BatchScanner bs = ReplicationTable.getBatchScanner(client, 1)) {
      bs.setRanges(Collections.singleton(new Range()));
      IteratorSetting cfg = new IteratorSetting(50, WholeRowIterator.class);
      bs.addScanIterator(cfg);

      try {
        assertEquals(0L, rcrr.removeCompleteRecords(client, bs, replBw));
      } finally {
        replBw.close();
      }
    }
  }
}


text:
package ru.stqa.pft.addressbook.generators;

import com.beust.jcommander.JCommander;
import com.beust.jcommander.Parameter;
import com.beust.jcommander.ParameterException;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.thoughtworks.xstream.XStream;
import ru.stqa.pft.addressbook.model.ContactData;

import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.Writer;
import java.util.ArrayList;
import java.util.List;

public class ContactDataGenerator {

    @Parameter(names = "-c", description = "Contact count")
    public int count;

    @Parameter(names = "-f", description = "Target file")
    public String file;

    @Parameter(names = "-d", description = "Data format")
    public String format;

    public static void main (String[] args) throws IOException {
        ContactDataGenerator generator = new ContactDataGenerator();
        JCommander jCommander = new JCommander(generator);
        try {
            jCommander.parse(args);
        } catch (ParameterException ex){
            jCommander.usage();
            return;
        }
        generator.run();
    }

    private void run() throws IOException {
        List<ContactData> contacts = generateContacts(count);
        if (format.equals("csv")) {
//            saveAsCsv(contacts, new File(file));
        }else if (format.equals("xml")) {
            saveAsXml(contacts, new File(file));
        }else if (format.equals("json")) {
            saveAsJson(contacts, new File(file));
        }else {
            save(contacts, new File(file));
        }
    }

    private void saveAsJson(List<ContactData> contacts, File file) throws IOException {
        Gson gson = new GsonBuilder().setPrettyPrinting().excludeFieldsWithoutExposeAnnotation().create();
        String json = gson.toJson(contacts);
        try(Writer writer = new FileWriter(file)){
            writer.write(json);
        }
    }

    private void saveAsXml(List<ContactData> contacts, File file) throws IOException {
        XStream xstream = new XStream();
        xstream.processAnnotations(ContactData.class);
        String xml = xstream.toXML(contacts);
        try(Writer writer = new FileWriter(file)){
            writer.write(xml);
        }
    }

    private void save(List<ContactData> contacts, File file) throws IOException {
        System.out.println(new File(".").getAbsolutePath());
        try(Writer writer = new FileWriter(file)){
            for (ContactData contact : contacts) {
                String row = new StringBuilder(contact.getFirstName())
                        .append(contact.getMiddleName())
                        .append(contact.getLastName())
                        .append(contact.getNickName())
                        .append(contact.getHomePhone())
                        .append(contact.getMobilePhone())
                        .append(contact.getWorkPhone())
                        .append(contact.getAddress())
                        .append(contact.getEmail1())
                        .append(contact.getEmail2())
                        .append(contact.getEmail3())
                        .toString();
                writer.write(row);
            }
        }
    }

    private List<ContactData> generateContacts(int count) {
        List<ContactData> contacts = new ArrayList<ContactData>();
        for (int i = 0; i < count; i++) {
            contacts.add(new ContactData().withFirstName(String.format("TestFirstName %s",i))
                    .withMiddleName(String.format("TestMiddleName %s",i))
                    .withLastName(String.format("TestLastName %s",i))
                    .withNickName(String.format("TestNickName %s",i))
//                    .withGroup(String.format("TestGroup %s",i))
                    .withHomePhone(String.format("111 %1$s%1$s%1$s",i))
                    .withMobilePhone(String.format("+7(111) %1$s%1$s%1$s",i))
                    .withWorkPhone(String.format("111-%1$s%1$s%1$s",i))
                    .withAddress(String.format("TestAddress %s",i))
                    .withEmail1(String.format("email1.test-%s@test.com",i))
                    .withEmail2(String.format("email2.test-%s@mail.ru",i))
                    .withEmail3(String.format("email3.test-%s@mail.com",i))
            );
        }
        return contacts;
    }
}


text:
package com.flipkart.poseidon.ds.trie;

/**
 * Created by shrey.garg on 18/07/16.
 */
public class KeyWrapper<K> {
    public K key;
    public boolean wildCard = false;
    public boolean greedyWildCard = false;

    public KeyWrapper(K key) {
        this.key = key;
    }
}


text:
ACCEPTED

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

#### Published in
Gdns' Bull. , Singapore 39(2): 115 (1986)

#### Original name
Panellus alutaceus Corner, 1986

### Remarks
null


text:
/* eslint-disable */

'use strict';

/*::
import type { Fragment, ReaderFragment } from 'relay-runtime';
import type { FragmentType } from "relay-runtime";
declare export opaque type RelayModernEnvironmentExecuteWithSiblingAndNestedModuleTestPlainUserNameRenderer_name$fragmentType: FragmentType;
export type RelayModernEnvironmentExecuteWithSiblingAndNestedModuleTestPlainUserNameRenderer_name$data = {|
  +data: ?{|
    +text: ?string,
  |},
  +user: ?{|
    +name: ?string,
  |},
  +$fragmentType: RelayModernEnvironmentExecuteWithSiblingAndNestedModuleTestPlainUserNameRenderer_name$fragmentType,
|};
export type RelayModernEnvironmentExecuteWithSiblingAndNestedModuleTestPlainUserNameRenderer_name$key = {
  +$data?: RelayModernEnvironmentExecuteWithSiblingAndNestedModuleTestPlainUserNameRenderer_name$data,
  +$fragmentSpreads: RelayModernEnvironmentExecuteWithSiblingAndNestedModuleTestPlainUserNameRenderer_name$fragmentType,
  ...
};
*/

var node/*: ReaderFragment*/ = {
  "argumentDefinitions": [],
  "kind": "Fragment",
  "metadata": null,
  "name": "RelayModernEnvironmentExecuteWithSiblingAndNestedModuleTestPlainUserNameRenderer_name",
  "selections": [
    {
      "alias": null,
      "args": null,
      "concreteType": "PlainUserNameData",
      "kind": "LinkedField",
      "name": "data",
      "plural": false,
      "selections": [
        {
          "alias": null,
          "args": null,
          "kind": "ScalarField",
          "name": "text",
          "storageKey": null
        }
      ],
      "storageKey": null
    },
    {
      "alias": null,
      "args": null,
      "concreteType": "User",
      "kind": "LinkedField",
      "name": "user",
      "plural": false,
      "selections": [
        {
          "alias": null,
          "args": null,
          "kind": "ScalarField",
          "name": "name",
          "storageKey": null
        }
      ],
      "storageKey": null
    }
  ],
  "type": "PlainUserNameRenderer",
  "abstractKey": null
};

if (__DEV__) {
  (node/*: any*/).hash = "ae2aca32b80cc94b4e12bba6e40e645a";
}

module.exports = ((node/*: any*/)/*: Fragment<
  RelayModernEnvironmentExecuteWithSiblingAndNestedModuleTestPlainUserNameRenderer_name$fragmentType,
  RelayModernEnvironmentExecuteWithSiblingAndNestedModuleTestPlainUserNameRenderer_name$data,
>*/);


text:
ACCEPTED

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

#### Published in
Öst. bot. Z. 25: 47 (1875)

#### Original name
Gnomonia riparia Niessl, 1875

### Remarks
null


text:
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;
import java.io.Writer;

/**
 * Created with IntelliJ IDEA.
 * User: maxim
 * Date: 10/5/13
 * Time: 1:19 AM
 * To change this template use File | Settings | File Templates.
 */
@WebServlet(name = "GuestBookServlet", urlPatterns = "/")
public class GuestBookServlet extends HttpServlet
{
    /**
     *
     * @param request
     * @param response
     * @throws ServletException
     * @throws IOException
     */
    protected void doPost(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException
    {

    }

    /**
     *
     * @param request
     * @param response
     * @throws ServletException
     * @throws IOException
     */
    protected void doGet(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException
    {
        PrintWriter out = response.getWriter();
        out.print("
Hi
");
        out.flush();
        out.close();
    }
}


text:
Template[getTemplate('layout')].helpers({
  mobile_nav: function () {
    return getTemplate('mobile_nav');
  },
  nav: function () {
    return getTemplate('nav');
  },
  error: function () {
    return getTemplate('error');
  },
  notifications: function () {
    return getTemplate('notifications');
  },
  footer: function () {
    return getTemplate('footer');
  },
  pageName : function(){
    return getCurrentTemplate();
  },
  css: function () {
    return getTemplate('css');
  },
  heroModules: function () {
    return heroModules;
  },
  getTemplate: function () {
    return getTemplate(this.template);
  },
  views: function () {
    return getTemplate('views');
  },
  isStaticPage: function(){
    console.log(isStaticPage);
    return isStaticPage;
  }
});

Template[getTemplate('layout')].created = function(){
  Session.set('currentScroll', null);
};

Template[getTemplate('layout')].rendered = function(){
  if(currentScroll=Session.get('currentScroll')){
    $('body').scrollTop(currentScroll);
    Session.set('currentScroll', null);
  }
};


text:
// Set this to your Hadoop username
var CELOS_USER = "manuel";
// Set this to your Oozie API endpoint
var CELOS_DEFAULT_OOZIE = "http://oozie003.ewr004.collective-media.net:11000/oozie";
// Set this to your HDFS name node
var CELOS_DEFAULT_HDFS = "hdfs://nameservice1";
// Set this to your Hadoop job tracker
var JOB_TRACKER = "cldmgr001.ewr004.collective-media.net:8032";

// No changes beyond this point should be required.

var CELOS_DEFAULT_OOZIE_PROPERTIES = {
    "user.name": CELOS_USER,
    "jobTracker" : JOB_TRACKER,
    "nameNode" : CELOS_DEFAULT_HDFS
};


text:
#include "jsonworker.h"

/**
 *  Constructeur générique des workers. Il va en particulier vérifier que
 *  les fichiers de sortie et d'entrée existent.
 *
 *  Params :
 *      - inputPath : chemin vers le fichier original à traiter.
 *                    S'il vaut "", il ne sera pas chargé.
 *      - outputPath : chemin vers le fichier de sortie de la BDD remaniée.
 *      - bddName_ : nom de la BDD étudiée.
 */
JsonWorker::JsonWorker(QString inputPath, QString outputPath, QString bddName_){
    cout << "INFO    : Construction d'un worker pour la BDD " << this->bddName.toStdString() << "." << endl;

    // Création du fichier de sortie s'il n'existe pas
    if(this->fileExists(outputPath)){
        cout << "WARNING : Un fichier de sortie existe deja. Voullez-vous le supprimer ou arreter le traitement." << endl;
        cout << "          [N] pour stopper le traitement ; [O] pour continuer." << endl;
        cout << "          Votre choix : ";
        string answer;
        getline(cin, answer);
        if(answer == "o" || answer == "O"){
            QFile::remove(outputPath);
            this->createOutputFile(outputPath);
            cout << "INFO    : Creation du fichier de sortie " << outputPath.toStdString() << "." << endl;
        } else {
            this->outputFile = new QFile(outputPath);
        }
    } else {
        this->createOutputFile(outputPath);
        cout << "INFO    : Creation du fichier de sortie " << outputPath.toStdString() << "." << endl;
    }
    if(inputPath != ""){
        this->loadFile(inputPath);
    }
    this->bddName = bddName_;
}

/**
 *  Méthode pour ouvrir le fichier d'entrée ce Worker.
 *
 *  Params :
 *      - path : le chemin du fichier à lire.
 *
 *  Return :
 *      - Rien, mais initialise la variable inputFile pour la lecture.
 *
 */
void JsonWorker::loadFile(QString path){
    this->inputFile = new QFile(path);
}

/**
 *  Méthode pour créer le fichier de sortie pour ce Worker.
 *
 *  Params :
 *      - path : le chemin du fichier à créer.
 *
 *  Return :
 *      - Rien, mais initialise la variable outputFile pour l'écriture.
 *
 */
void JsonWorker::createOutputFile(QString path){
    this->outputFile = new QFile(path);
    this->outputFile->open(QIODevice::WriteOnly | QIODevice::Text);
    this->outputFile->close();
}

/**
 *  Lancement du job pour faire le traitement des données en entrées.
 *  Cette méthode va appeler les worker associés nécessaires par héritage.
 *
 *  Params :
 *      - Aucun.
 *
 *  Return :
 *      - True si le traitement s'est bien déroulé, false sinon.
 *
 */
bool JsonWorker::launchWorker(){
    // Vérification de l'existence des fichiers d'entrée et de sortie.
    QString inputPath = this->inputFile->fileName();
    QString outputPath = this->outputFile->fileName();
    // On vérifie que le fichier à parser et le fichier de sortie existent bien.
    if(!(this->fileExists(inputPath) && this->fileExists(outputPath))){
        if(!this->fileExists(inputPath)){
            cout << "ERREUR  : Le chemin du fichier a charger n'existe pas ou est un repertoire..." << endl;
        } else if (!this->fileExists(outputPath)){
            cout << "ERREUR  : Le chemin du fichier de sortie n'existe pas ou est un repertoire..." << endl;
        } else {
            cout << "ERREUR  : Un des flux de lecture ou ecriture n'a pas pu etre lance convenablement..." << endl;
        }
        cout << "INFO    : Ce traitement est interrompu. Veuillez verifier les configurations avant de relancer les conversions." << endl;
        return false;
    }

    // Lecture du fichier ligne par ligne.
    if (this->inputFile->open(QIODevice::ReadOnly | QIODevice::Text)){
        QTextStream in(this->inputFile);
        this->outputFile->open(QIODevice::WriteOnly | QIODevice::Text);
        QTextStream out(this->outputFile);
        out << "Comment\t RatingDegrad\t Rating\t TextType\t BDDName" << endl;

        while(!in.atEnd()){
            QString line = in.readLine();
            QString newLine = QString::fromStdString(this->parseData(line));
            if(!newLine.trimmed().isEmpty()){
                out << newLine << endl;
            }
        }
    }
    cout << "INFO    : Worker termine pour " << this->bddName.toStdString() << "." << endl;

    // Nettoyage espace de travail.
    this->outputFile->close();
    this->inputFile->close();
    return true;
}

/**
 *  Méthode pour vérifier l'existence d'un fichier donné. La méthode vérifie que le
 *  chemin fournit existe et qu'il s'agit bien d'un fichier et non d'un répertoire.
 *
 *  Params :
 *      - path : un QString contenant l'emplacement à tester.
 *
 *  Return :
 *      - bool : true si le fichier existe ; false sinon.
 *
 */
bool JsonWorker::fileExists(QString path) {
    QFileInfo check_file(path);
    return (check_file.exists() && check_file.isFile());
}

/**
 *  Méthode utilitaire pour retirer des substring d'une chaîne de caractère.
 *  Toutes les occurences seront retirées.
 *
 *  Params :
 *      - s : la string a modifier.
 *      - p : la substring à supprimer de s.
 *
 *  Return :
 *      - La string modifiée.
 */
string JsonWorker::removeSubstrs(string s, string p) {
    string::size_type n = p.length();
    for (string::size_type i = s.find(p); i != string::npos; i = s.find(p)){
        s.erase(i, n);
    }
    return s;
}


text:
/**
 * RespuestaController.js
 *
 * @description ::
 * @docs        :: http://sailsjs.org/#!documentation/controllers
 */

module.exports = {
	getAll: function(req, res){
		Respuesta.find().exec(function(err, respuestas){
			res.json(respuestas);
		});
	}
};


text:
from Model.DataObject.SendingData.BaseDataSending import BaseDataSending
from Model.DataObject.BaseDataObject import catch_format_error

# Demande à l'UI si le serveur de la stratégie IA est en UDP ou en serial

__author__='RobocupULaval'

class SendingDataPorts(BaseDataSending):
    def __init__(self, data_in=None):
        super().__init__(data_in)
        self._format_data()

    @catch_format_error
    def _check_obligatory_data(self):
        assert isinstance(self.data, dict), \
            "data={} n'est pas un dictionnaire."
        keys = self.data.keys()

        assert 'recv_port' in keys, \
            "data['recv_port'] n'existe pas."
        assert isinstance(self.data['recv_port'], int), \
            "data['recv_port']: {} n'a pas le format attendu (int)".format(type(self.data['recv_port']))

        assert 'send_port' in keys, \
            "data['send_port'] n'existe pas."
        assert isinstance(self.data['send_port'], int), \
            "data['send_port']: {} n'a pas le format attendu (int)".format(type(self.data['send_port']))

    @catch_format_error
    def _check_optional_data(self):
        pass

    @staticmethod
    def get_default_data_dict():
        return dict(zip(['recv_port',
                         'send_port'],
                         [0,
                          0]))

    @staticmethod
    def get_type():
        return 5007


text:
/* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE78_OS_Command_Injection__wchar_t_listen_socket_w32spawnl_83.h
Label Definition File: CWE78_OS_Command_Injection.strings.label.xml
Template File: sources-sink-83.tmpl.h
*/
/*
 * @description
 * CWE: 78 OS Command Injection
 * BadSource: listen_socket Read data using a listen socket (server side)
 * GoodSource: Fixed string
 * Sinks: w32spawnl
 *    BadSink : execute command with wspawnl
 * Flow Variant: 83 Data flow: data passed to class constructor and destructor by declaring the class object on the stack
 *
 * */

#include "std_testcase.h"

#include <wchar.h>

#ifdef _WIN32
#define COMMAND_INT_PATH L"%WINDIR%\\system32\\cmd.exe"
#define COMMAND_INT L"cmd.exe"
#define COMMAND_ARG1 L"/c"
#define COMMAND_ARG2 L"dir"
#define COMMAND_ARG3 data
#else /* NOT _WIN32 */
#include <unistd.h>
#define COMMAND_INT_PATH L"/bin/sh"
#define COMMAND_INT L"sh"
#define COMMAND_ARG1 L"ls"
#define COMMAND_ARG2 L"-la"
#define COMMAND_ARG3 data
#endif

namespace CWE78_OS_Command_Injection__wchar_t_listen_socket_w32spawnl_83
{

#ifndef OMITBAD

class CWE78_OS_Command_Injection__wchar_t_listen_socket_w32spawnl_83_bad
{
public:
    CWE78_OS_Command_Injection__wchar_t_listen_socket_w32spawnl_83_bad(wchar_t * dataCopy);
    ~CWE78_OS_Command_Injection__wchar_t_listen_socket_w32spawnl_83_bad();

private:
    wchar_t * data;
};

#endif /* OMITBAD */

#ifndef OMITGOOD

class CWE78_OS_Command_Injection__wchar_t_listen_socket_w32spawnl_83_goodG2B
{
public:
    CWE78_OS_Command_Injection__wchar_t_listen_socket_w32spawnl_83_goodG2B(wchar_t * dataCopy);
    ~CWE78_OS_Command_Injection__wchar_t_listen_socket_w32spawnl_83_goodG2B();

private:
    wchar_t * data;
};

#endif /* OMITGOOD */

}


text:
\hypertarget{class_view}{\section{View Class Reference}
\label{class_view}\index{View@{View}}
}

{\ttfamily \#include $<$view.\-h$>$}

\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item
\hyperlink{class_view_a44ad60a768422d3fa8fbd7576950080a}{View} ()
\item
\hyperlink{class_view_ad0dc854db9aabbea98a334dec89f785c}{$\sim$\-View} ()
\item
void \hyperlink{class_view_ac0b7ffdb316f54013052928c6e2e8ace}{swap} ()
\item
bool \hyperlink{class_view_a2c7a00026247246c1f4b7b18b1cec20e}{load} (std\-::string file\-Name)
\item
bool \hyperlink{class_view_a6edea19c9c4efd1a088d2ebbfbd3a240}{load\-Package} (std\-::string file\-Name)
\item
void \hyperlink{class_view_a133f5487097d796a1b276f8c14f0671c}{draw} (\hyperlink{struct_rect}{Rect} r, std\-::string res)
\item
void \hyperlink{class_view_a2a474840a5d346723e37dd01fd248e4e}{draw} (float x, float y, float w, float h, std\-::string res)
\item
void \hyperlink{class_view_ab756d944d5d8a45c1ce6b365e6b6c27c}{resize\-\_\-event} (int \&w, int \&h)
\item
void \hyperlink{class_view_a81b5809859fda85f39e0faa1b169e6d5}{draw\-Anim} ()
\item
void \hyperlink{class_view_a067c5cbb6e248ae041c13d50da48d699}{stop\-Anim} ()
\item
T\-I\-M\-E \hyperlink{class_view_a9cb2b63e68cff08050892f8d43909bf9}{get\-Now} ()
\item
void \hyperlink{class_view_a33aeee3fb2659af067d1a279a2d96ed7}{set\-Now} ()
\item
void \hyperlink{class_view_a51b9f1d6901753f868242ab9b3334dce}{set\-Tick\-Interval} (int i)
\item
void \hyperlink{class_view_a2299069ba34803c1da65e0b43b6d7f10}{Screenshot} ()
\item
void \hyperlink{class_view_a3f1c78cf35fbbed0019e9b835a118f19}{Toggle} ()
\item
void \hyperlink{class_view_a62c7ef62ba7a4dab206a81ff999a2978}{frame\-Begin} ()
\item
void \hyperlink{class_view_ac63fd1ddfcfb68d11f3a039ae8537765}{frame\-End} ()
\item
T\-I\-M\-E \hyperlink{class_view_a911928e6ed1a440eafe321f2aab1c3e0}{frame\-Delay} ()
\end{DoxyCompactItemize}

\subsection{Detailed Description}
Main class for handling graphics

\subsection{Constructor \& Destructor Documentation}
\hypertarget{class_view_a44ad60a768422d3fa8fbd7576950080a}{\index{View@{View}!View@{View}}
\index{View@{View}!View@{View}}
\subsubsection[{View}]{\setlength{\rightskip}{0pt plus 5cm}View\-::\-View (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}}\label{class_view_a44ad60a768422d3fa8fbd7576950080a}
Constructor, initialize screen \hypertarget{class_view_ad0dc854db9aabbea98a334dec89f785c}{\index{View@{View}!$\sim$\-View@{$\sim$\-View}}
\index{$\sim$\-View@{$\sim$\-View}!View@{View}}
\subsubsection[{$\sim$\-View}]{\setlength{\rightskip}{0pt plus 5cm}View\-::$\sim$\-View (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}}\label{class_view_ad0dc854db9aabbea98a334dec89f785c}
Destructor, unload objects

\subsection{Member Function Documentation}
\hypertarget{class_view_a133f5487097d796a1b276f8c14f0671c}{\index{View@{View}!draw@{draw}}
\index{draw@{draw}!View@{View}}
\subsubsection[{draw}]{\setlength{\rightskip}{0pt plus 5cm}void View\-::draw (
\begin{DoxyParamCaption}
\item[{{\bf Rect}}]{r, }
\item[{std\-::string}]{res}
\end{DoxyParamCaption}
)}}\label{class_view_a133f5487097d796a1b276f8c14f0671c}
Draw on frame
\begin{DoxyParams}{Parameters}
{\em r} & rectangle of drawing position \\
\hline
{\em res} & full drawing string \\
\hline
\end{DoxyParams}
\hypertarget{class_view_a2a474840a5d346723e37dd01fd248e4e}{\index{View@{View}!draw@{draw}}
\index{draw@{draw}!View@{View}}
\subsubsection[{draw}]{\setlength{\rightskip}{0pt plus 5cm}void View\-::draw (
\begin{DoxyParamCaption}
\item[{float}]{x, }
\item[{float}]{y, }
\item[{float}]{w, }
\item[{float}]{h, }
\item[{std\-::string}]{res}
\end{DoxyParamCaption}
)}}\label{class_view_a2a474840a5d346723e37dd01fd248e4e}
Draw on frame
\begin{DoxyParams}{Parameters}
{\em x} & coordinate \\
\hline
{\em y} & coordinate \\
\hline
{\em w} & width \\
\hline
{\em h} & height \\
\hline
{\em res} & full drawing string \\
\hline
\end{DoxyParams}
\hypertarget{class_view_a81b5809859fda85f39e0faa1b169e6d5}{\index{View@{View}!draw\-Anim@{draw\-Anim}}
\index{draw\-Anim@{draw\-Anim}!View@{View}}
\subsubsection[{draw\-Anim}]{\setlength{\rightskip}{0pt plus 5cm}void View\-::draw\-Anim (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}}\label{class_view_a81b5809859fda85f39e0faa1b169e6d5}
Draw animations on frame, delete ended animations \hypertarget{class_view_a62c7ef62ba7a4dab206a81ff999a2978}{\index{View@{View}!frame\-Begin@{frame\-Begin}}
\index{frame\-Begin@{frame\-Begin}!View@{View}}
\subsubsection[{frame\-Begin}]{\setlength{\rightskip}{0pt plus 5cm}void View\-::frame\-Begin (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}}\label{class_view_a62c7ef62ba7a4dab206a81ff999a2978}
Begin of frame, actualilze time variables for current and previous frame \hypertarget{class_view_a911928e6ed1a440eafe321f2aab1c3e0}{\index{View@{View}!frame\-Delay@{frame\-Delay}}
\index{frame\-Delay@{frame\-Delay}!View@{View}}
\subsubsection[{frame\-Delay}]{\setlength{\rightskip}{0pt plus 5cm}T\-I\-M\-E View\-::frame\-Delay (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}}\label{class_view_a911928e6ed1a440eafe321f2aab1c3e0}
Amount of sleep needed for enough frames per second \hypertarget{class_view_ac63fd1ddfcfb68d11f3a039ae8537765}{\index{View@{View}!frame\-End@{frame\-End}}
\index{frame\-End@{frame\-End}!View@{View}}
\subsubsection[{frame\-End}]{\setlength{\rightskip}{0pt plus 5cm}void View\-::frame\-End (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}}\label{class_view_ac63fd1ddfcfb68d11f3a039ae8537765}
End of frame, sleep for a while to save C\-P\-U time \hypertarget{class_view_a9cb2b63e68cff08050892f8d43909bf9}{\index{View@{View}!get\-Now@{get\-Now}}
\index{get\-Now@{get\-Now}!View@{View}}
\subsubsection[{get\-Now}]{\setlength{\rightskip}{0pt plus 5cm}T\-I\-M\-E View\-::get\-Now (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}}}\label{class_view_a9cb2b63e68cff08050892f8d43909bf9}
Get current frame time \hypertarget{class_view_a2c7a00026247246c1f4b7b18b1cec20e}{\index{View@{View}!load@{load}}
\index{load@{load}!View@{View}}
\subsubsection[{load}]{\setlength{\rightskip}{0pt plus 5cm}bool View\-::load (
\begin{DoxyParamCaption}
\item[{std\-::string}]{file\-Name}
\end{DoxyParamCaption}
)}}\label{class_view_a2c7a00026247246c1f4b7b18b1cec20e}
Load image, animation or text file
\begin{DoxyParams}{Parameters}
{\em file\-Name} & name of file, extension determines the type \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
success
\end{DoxyReturn}
\hypertarget{class_view_a6edea19c9c4efd1a088d2ebbfbd3a240}{\index{View@{View}!load\-Package@{load\-Package}}
\index{load\-Package@{load\-Package}!View@{View}}
\subsubsection[{load\-Package}]{\setlength{\rightskip}{0pt plus 5cm}bool View\-::load\-Package (
\begin{DoxyParamCaption}
\item[{std\-::string}]{file\-Name}
\end{DoxyParamCaption}
)}}\label{class_view_a6edea19c9c4efd1a088d2ebbfbd3a240}
Load resources from list
\begin{DoxyParams}{Parameters}
{\em file\-Name} & name of package \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
success
\end{DoxyReturn}
\hypertarget{class_view_ab756d944d5d8a45c1ce6b365e6b6c27c}{\index{View@{View}!resize\-\_\-event@{resize\-\_\-event}}
\index{resize\-\_\-event@{resize\-\_\-event}!View@{View}}
\subsubsection[{resize\-\_\-event}]{\setlength{\rightskip}{0pt plus 5cm}void View\-::resize\-\_\-event (
\begin{DoxyParamCaption}
\item[{int \&}]{w, }
\item[{int \&}]{h}
\end{DoxyParamCaption}
)}}\label{class_view_ab756d944d5d8a45c1ce6b365e6b6c27c}
Resize callback function
\begin{DoxyParams}{Parameters}
{\em w} & width \\
\hline
{\em h} & height \\
\hline
\end{DoxyParams}
\hypertarget{class_view_a2299069ba34803c1da65e0b43b6d7f10}{\index{View@{View}!Screenshot@{Screenshot}}
\index{Screenshot@{Screenshot}!View@{View}}
\subsubsection[{Screenshot}]{\setlength{\rightskip}{0pt plus 5cm}void View\-::\-Screenshot (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}}\label{class_view_a2299069ba34803c1da65e0b43b6d7f10}
Request to take screenshot at the end of frame \hypertarget{class_view_a33aeee3fb2659af067d1a279a2d96ed7}{\index{View@{View}!set\-Now@{set\-Now}}
\index{set\-Now@{set\-Now}!View@{View}}
\subsubsection[{set\-Now}]{\setlength{\rightskip}{0pt plus 5cm}void View\-::set\-Now (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}}}\label{class_view_a33aeee3fb2659af067d1a279a2d96ed7}
Set current frame time to actual time \hypertarget{class_view_a51b9f1d6901753f868242ab9b3334dce}{\index{View@{View}!set\-Tick\-Interval@{set\-Tick\-Interval}}
\index{set\-Tick\-Interval@{set\-Tick\-Interval}!View@{View}}
\subsubsection[{set\-Tick\-Interval}]{\setlength{\rightskip}{0pt plus 5cm}void View\-::set\-Tick\-Interval (
\begin{DoxyParamCaption}
\item[{int}]{i}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}}}\label{class_view_a51b9f1d6901753f868242ab9b3334dce}
Set refresh rate \hypertarget{class_view_a067c5cbb6e248ae041c13d50da48d699}{\index{View@{View}!stop\-Anim@{stop\-Anim}}
\index{stop\-Anim@{stop\-Anim}!View@{View}}
\subsubsection[{stop\-Anim}]{\setlength{\rightskip}{0pt plus 5cm}void View\-::stop\-Anim (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}}\label{class_view_a067c5cbb6e248ae041c13d50da48d699}
Stop all animations \hypertarget{class_view_ac0b7ffdb316f54013052928c6e2e8ace}{\index{View@{View}!swap@{swap}}
\index{swap@{swap}!View@{View}}
\subsubsection[{swap}]{\setlength{\rightskip}{0pt plus 5cm}void View\-::swap (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}}\label{class_view_ac0b7ffdb316f54013052928c6e2e8ace}
Swap buffers, draw on screen \hypertarget{class_view_a3f1c78cf35fbbed0019e9b835a118f19}{\index{View@{View}!Toggle@{Toggle}}
\index{Toggle@{Toggle}!View@{View}}
\subsubsection[{Toggle}]{\setlength{\rightskip}{0pt plus 5cm}void View\-::\-Toggle (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}}}\label{class_view_a3f1c78cf35fbbed0019e9b835a118f19}
Request to toggle fullscreen

The documentation for this class was generated from the following files\-:\begin{DoxyCompactItemize}
\item
view/view.\-h\item
view/view.\-cpp\end{DoxyCompactItemize}


text:
package org.gwtbootstrap3.client.shared.event;

import com.google.gwt.event.shared.EventHandler;

/**
 * @author Sven Jacobs
 */
public interface AlertCloseHandler extends EventHandler {
    void onClose(final AlertCloseEvent evt);
}


text:
package org.apache.ignite.plugin.security;

import org.apache.ignite.*;

/**
 * Security credentials provider for specifying security credentials.
 * Security credentials used for node authentication.
 *

 * Getting credentials through {@link SecurityCredentialsProvider} abstraction allows
 * users to provide custom implementations for storing user names and passwords in their
 * environment, possibly in encrypted format. Ignite comes with
 * {@link SecurityCredentialsBasicProvider} which simply provides
 * the passed in {@code login} and {@code password} when encryption or custom logic is not required.
 *

 * In addition to {@code login} and {@code password}, security credentials allow for
 * specifying {@link SecurityCredentials#setUserObject(Object) userObject} as well, which can be used
 * to pass in any additional information required for authentication.
 */
public interface SecurityCredentialsProvider {
    /**
     * Gets security credentials.
     *
     * @return Security credentials.
     * @throws IgniteCheckedException If failed.
     */
    public SecurityCredentials credentials() throws IgniteCheckedException;
}


text:
<!DOCTYPE html>
<title>Test that shortcut items with an empty name are skipped</title>
<link rel="help" href="https://w3c.github.io/manifest/#shortcuts-member" />
<link rel="manifest" href="resources/shortcuts-member-skip-for-empty-name.webmanifest" />

Testing if shortcut items with an empty name are skipped

    To pass, the application must provide a single shortcut named "pass".


text:
package org.wso2.carbon.apimgt.rest.api.store.v1.dto;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import javax.validation.constraints.*;

import io.swagger.annotations.*;
import java.util.Objects;

import javax.xml.bind.annotation.*;

public class APIProductInfoDTO   {

    private String id = null;
    private String name = null;
    private String description = null;
    private String provider = null;
    private String thumbnailUri = null;

  /**
   **/
  public APIProductInfoDTO id(String id) {
    this.id = id;
    return this;
  }

  @ApiModelProperty(example = "01234567-0123-0123-0123-012345678901", value = "")
  @JsonProperty("id")
  public String getId() {
    return id;
  }
  public void setId(String id) {
    this.id = id;
  }

  /**
   **/
  public APIProductInfoDTO name(String name) {
    this.name = name;
    return this;
  }

  @ApiModelProperty(example = "CalculatorAPIProduct", value = "")
  @JsonProperty("name")
  public String getName() {
    return name;
  }
  public void setName(String name) {
    this.name = name;
  }

  /**
   **/
  public APIProductInfoDTO description(String description) {
    this.description = description;
    return this;
  }

  @ApiModelProperty(example = "A calculator API product that supports basic operations", value = "")
  @JsonProperty("description")
  public String getDescription() {
    return description;
  }
  public void setDescription(String description) {
    this.description = description;
  }

  /**
   * If the provider value is not given, the user invoking the API will be used as the provider.
   **/
  public APIProductInfoDTO provider(String provider) {
    this.provider = provider;
    return this;
  }

  @ApiModelProperty(example = "admin", value = "If the provider value is not given, the user invoking the API will be used as the provider. ")
  @JsonProperty("provider")
  public String getProvider() {
    return provider;
  }
  public void setProvider(String provider) {
    this.provider = provider;
  }

  /**
   **/
  public APIProductInfoDTO thumbnailUri(String thumbnailUri) {
    this.thumbnailUri = thumbnailUri;
    return this;
  }

  @ApiModelProperty(example = "/api-products/01234567-0123-0123-0123-012345678901/thumbnail", value = "")
  @JsonProperty("thumbnailUri")
  public String getThumbnailUri() {
    return thumbnailUri;
  }
  public void setThumbnailUri(String thumbnailUri) {
    this.thumbnailUri = thumbnailUri;
  }

  @Override
  public boolean equals(java.lang.Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    APIProductInfoDTO apIProductInfo = (APIProductInfoDTO) o;
    return Objects.equals(id, apIProductInfo.id) &&
        Objects.equals(name, apIProductInfo.name) &&
        Objects.equals(description, apIProductInfo.description) &&
        Objects.equals(provider, apIProductInfo.provider) &&
        Objects.equals(thumbnailUri, apIProductInfo.thumbnailUri);
  }

  @Override
  public int hashCode() {
    return Objects.hash(id, name, description, provider, thumbnailUri);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class APIProductInfoDTO {\n");

    sb.append("    id: ").append(toIndentedString(id)).append("\n");
    sb.append("    name: ").append(toIndentedString(name)).append("\n");
    sb.append("    description: ").append(toIndentedString(description)).append("\n");
    sb.append("    provider: ").append(toIndentedString(provider)).append("\n");
    sb.append("    thumbnailUri: ").append(toIndentedString(thumbnailUri)).append("\n");
    sb.append("}");
    return sb.toString();
  }

  /**
   * Convert the given object to string with each line indented by 4 spaces
   * (except the first line).
   */
  private String toIndentedString(java.lang.Object o) {
    if (o == null) {
      return "null";
    }
    return o.toString().replace("\n", "\n    ");
  }
}


text:
"""tlksio URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/1.10/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  url(r'^$', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  url(r'^$', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.conf.urls import url, include
    2. Add a URL to urlpatterns:  url(r'^blog/', include('blog.urls'))
"""
from django.conf.urls import url
from django.conf.urls import include
from django.contrib import admin

from django.conf import settings
from django.conf.urls.static import static

from tlksio import views as main_views
from talks import views as talk_views

urlpatterns = [
    url(r'^$', main_views.index, name='index'),
    url(r'^auth/login', main_views.login, name='login'),
    url(r'^auth/twitter/callback', main_views.auth_twitter_callback, name='auth_twitter_callback'),
    url(r'^auth/twitter', main_views.auth_twitter, name='auth_twitter'),
    url(r'^auth/logout', main_views.logout, name='logout'),
    url(r'^settings', main_views.settings, name='settings'),
    url(r'^profile/(?P<username>[\w-]+)$', main_views.profile, name='profile'),
    url(r'^profile/(?P<username>[\w-]+)/page/(?P<page>[0-9]+)$', main_views.profile, name='profile_page'),
    url(r'^profile/(?P<username>[\w-]+)/upvoted$', main_views.profile_upvoted, name='profile_upvoted'),
    url(r'^profile/(?P<username>[\w-]+)/upvoted/page/(?P<page>[0-9]+)$', main_views.profile_upvoted,
        name='profile_upvoted_page'),
    url(r'^profile/(?P<username>[\w-]+)/favorited$', main_views.profile_favorited, name='profile_favorited'),
    url(r'^profile/(?P<username>[\w-]+)/favorited/page/(?P<page>[0-9]+)$', main_views.profile_favorited,
        name='profile_favorited_page'),
    url(r'^about', main_views.about, name='about'),
    url(r'^faq', main_views.faq, name='faq'),
    url(r'^contactus', main_views.contactus, name='contactus'),
    url(r'^terms', main_views.terms, name='terms'),
    url(r'^privacy', main_views.privacy, name='privacy'),
    url(r'^activity', main_views.activity, name='activity'),

    url(r'^latest$', talk_views.latest, name='latest'),
    url(r'^latest/page/(?P<page>[0-9]+)$', talk_views.latest, name='latest_page'),
    url(r'^popular$', talk_views.popular, name='popular'),
    url(r'^popular/page/(?P<page>[0-9]+)$', talk_views.popular, name='popular_page'),

    url(r'^tag/(?P<tag_slug>[\w-]+)$', talk_views.tag, name='tag'),
    url(r'^tag/(?P<tag_slug>[\w-]+)/page/(?P<page>[0-9]+)$', talk_views.tag, name='tag_page'),

    url(r'^talk/add$', talk_views.add, name='add'),
    url(r'^talk/play/(?P<talk_slug>[\w-]+)', talk_views.play, name='play'),
    url(r'^talk/favorite/(?P<talk_id>[0-9]+)', talk_views.favorite, name='favorite'),
    url(r'^talk/upvote/(?P<talk_id>[0-9]+)', talk_views.upvote, name='upvote'),
    url(r'^talk/(?P<talk_slug>[\w-]+)', talk_views.talk, name='talk'),

    url(r'^admin/', admin.site.urls),

    url(r'^search/', include('haystack.urls')),
]