text:
#include <stdlib.h>

#include "contributors.h"
#include "global.h"

#ifdef _LEAKYBUCKET_

//long Bit_Buffer[20000];
unsigned long total_frame_buffer = 0;

/*!
 ***********************************************************************
 * \brief
 *   Function to get Leaky Bucket rates from rate file
 * \param NumberLeakyBuckets
 *    Number of Leaky Bucket Parameters
 * \param Rmin
 *    Rate values for each Bucket.
 * \return
 *    returns 1 if successful; else returns zero.
 * \para SideEffects
 *     None.
 * \para Notes
 *     Failure if LeakyBucketRate is missing or if it does not have
 *     the correct number of entries.
 * \author
 *    Shankar Regunathan                   shanre@microsoft.com
 *  \date
 *      December 06, 2001.
 ***********************************************************************
 */

int get_LeakyBucketRate(unsigned long NumberLeakyBuckets, unsigned long *Rmin)
{
  FILE *f;
  unsigned long i, buf;

  if((f = fopen(input->LeakyBucketRateFile, "r")) == NULL)
  {
    printf(" LeakyBucketRate File does not exist. Using rate calculated from avg. rate \n");
    return 0;
  }

  for(i=0; i<NumberLeakyBuckets; i++)
  {
    if(1 != fscanf(f, "%lu", &buf))
    {
      printf(" Leaky BucketRateFile does not have valid entries.\n Using rate calculated from avg. rate \n");
      fclose (f);
      return 0;
    }
    Rmin[i] = buf;
  }
  fclose (f);
  return 1;
}
/*!
 ***********************************************************************
 * \brief
 *   Writes one unsigned long word in big endian order to a file.
 * \param dw
 *    Value to be written
 * \param fp
 *    File pointer
 * \return
 *    None.
 * \para SideEffects
 *     None.
 * \author
 *    Shankar Regunathan                   shanre@microsoft.com
 *  \date
 *      December 06, 2001.
 ***********************************************************************
 */

void PutBigDoubleWord(unsigned long dw, FILE *fp)
{
  fputc((dw >> 0x18) & 0xFF, fp);
  fputc((dw >> 0x10) & 0xFF, fp);
  fputc((dw >> 0x08) & 0xFF, fp);
  fputc(dw & 0xFF, fp);
}

/*!
 ***********************************************************************
 * \brief
 *   Stores the Leaky BucketParameters in file input->LeakyBucketParamFile.
 * \param NumberLeakyBuckets
 *    Number of LeakyBuckets.
 * \param Rmin
 *    Rate values of the buckets.
 * \param Bmin
 *    Minimum buffer values of the buckets.
 *  \param Fmin
 *     Minimum initial buffer fullness of the buckets
 * \return
 *    None.
 * \para
 *    Returns error if LeakyBucketParamFile cannot be opened.
 * \para SideEffects
 *     Prints the LeakyBucket Parameters in standard output.
 * \author
 *    Shankar Regunathan                   shanre@microsoft.com
 *  \date
 *      December 06, 2001.
 ***********************************************************************
 */

void write_buffer(unsigned long NumberLeakyBuckets, unsigned long Rmin[], unsigned long Bmin[], unsigned long Fmin[])
{
  FILE *outf;
  unsigned long iBucket;

  if ((outf=fopen(input->LeakyBucketParamFile,"wb"))==NULL)
  {
    snprintf(errortext, ET_SIZE, "Error open file lk %s  \n",input->LeakyBucketParamFile);
    error(errortext,1);
  }

  PutBigDoubleWord(NumberLeakyBuckets, outf);
  for(iBucket =0; iBucket < NumberLeakyBuckets; iBucket++)
  {
    //assert(Rmin[iBucket]<4294967296); //Overflow should be corrected already.
    //assert(Bmin[iBucket]<4294967296);
    //assert(Fmin[iBucket]<4294967296);
    PutBigDoubleWord(Rmin[iBucket], outf);
    PutBigDoubleWord(Bmin[iBucket], outf);
    PutBigDoubleWord(Fmin[iBucket], outf);
  }
  fclose(outf);
}

/*!
 ***********************************************************************
 * \brief
 *    Sorts the rate array in ascending order.
 * \param NumberLeakyBuckets
 *    Number of LeakyBuckets.
 * \param Rmin
 *    Rate values of the buckets.
 * \return
 *    None.
 * \author
 *    Shankar Regunathan                   shanre@microsoft.com
 *  \date
 *      December 06, 2001.
 ***********************************************************************
 */

void Sort(unsigned long NumberLeakyBuckets, unsigned long *Rmin)
{
  unsigned long i, j;
  unsigned long temp;
  for(i=0; i< NumberLeakyBuckets-1; i++)
  {
    for(j=i+1; j<NumberLeakyBuckets; j++)
    {
      if(Rmin[i] > Rmin[j]) {
        temp = Rmin[i];
        Rmin[i] = Rmin[j];
        Rmin[j] = temp;
      }
    }
  }
}

/*!
 ***********************************************************************
 * \brief
 *    Main Routine to calculate Leaky Buffer parameters
 * \param NumberLeakyBuckets
 *    None.
 * \return
 *    None.
 * \author
 *    Shankar Regunathan                   shanre@microsoft.com
 *  \date
 *      December 06, 2001.
 ***********************************************************************
 */

void calc_buffer()
{
  unsigned long AvgRate, TotalRate, NumberLeakyBuckets;
  long *buffer_frame, minB;
  unsigned long iBucket, iFrame,  FrameIndex = 0;
  long maxBuffer, actualBuffer, InitFullness, iChannelRate;
  unsigned long *Rmin, *Bmin, *Fmin;

  fprintf(stdout,"-------------------------------------------------------------------------------\n");
  printf(" Total Frames:  %ld (%d) \n", total_frame_buffer, input->no_frames);
  NumberLeakyBuckets = (unsigned long) input->NumberLeakyBuckets;
  buffer_frame = calloc(total_frame_buffer+1, sizeof(long));
  if(!buffer_frame)
    no_mem_exit("init_buffer: buffer_frame");
  Rmin = calloc(NumberLeakyBuckets, sizeof(unsigned long));
  if(!Rmin)
    no_mem_exit("init_buffer: Rmin");
  Bmin = calloc(NumberLeakyBuckets, sizeof(unsigned long));
  if(!Bmin)
    no_mem_exit("init_buffer: Bmin");
  Fmin = calloc(NumberLeakyBuckets, sizeof(unsigned long));
  if(!Fmin)
    no_mem_exit("init_buffer: Fmin");

  TotalRate = 0;
  for(iFrame=0; iFrame < total_frame_buffer; iFrame++)
  {
    TotalRate += (unsigned long) Bit_Buffer[iFrame];
  }
  AvgRate = (unsigned long) ((float) TotalRate/ total_frame_buffer);

  if(1 != get_LeakyBucketRate(NumberLeakyBuckets, Rmin))
  { /* if rate file is not present, use default calculated from avg.rate */
    for(iBucket=0; iBucket < NumberLeakyBuckets; iBucket++)
    {
      if(iBucket == 0)
        Rmin[iBucket] = (unsigned long)((float) AvgRate * img->framerate)/(input->jumpd+1); /* convert bits/frame to bits/second */
      else
        Rmin[iBucket] = (unsigned long) ((float) Rmin[iBucket-1] + (AvgRate/4) * (img->framerate) / (input->jumpd+1));
    }
  }
  Sort(NumberLeakyBuckets, Rmin);

  maxBuffer = AvgRate * 20; /* any initialization is good. */
  for(iBucket=0; iBucket< NumberLeakyBuckets; iBucket++)
  {
    iChannelRate = (long) (Rmin[iBucket] * (input->jumpd+1)/(img->framerate)); /* converts bits/second to bits/frame */
    /* To calculate initial buffer size */
    InitFullness = maxBuffer; /* set Initial Fullness to be buffer size */
    buffer_frame[0] = InitFullness;
    minB = maxBuffer;

    for(iFrame=0; iFrame<total_frame_buffer ; iFrame++)
    {
      buffer_frame[iFrame] = buffer_frame[iFrame] - Bit_Buffer[iFrame];
      if(buffer_frame[iFrame] < minB)
      {
        minB = buffer_frame[iFrame];
        FrameIndex = iFrame;
      }

      buffer_frame[iFrame+1] = buffer_frame[iFrame] + iChannelRate;
      if(buffer_frame[iFrame+1] > maxBuffer)
        buffer_frame[iFrame+1] = maxBuffer;
    }
    actualBuffer = (maxBuffer - minB);

    /* To calculate initial buffer Fullness */
    InitFullness = Bit_Buffer[0];
    buffer_frame[0] = InitFullness;
    for(iFrame=0; iFrame < FrameIndex+1; iFrame++)
    {
      buffer_frame[iFrame] = buffer_frame[iFrame] - Bit_Buffer[iFrame];
      if(buffer_frame[iFrame] < 0) {
        InitFullness -= buffer_frame[iFrame];
        buffer_frame[iFrame] = 0;
      }
      buffer_frame[iFrame+1] = buffer_frame[iFrame] + iChannelRate;
      if(buffer_frame[iFrame+1] > actualBuffer)
        break;
    }
    Bmin[iBucket] = (unsigned long) actualBuffer;
    Fmin[iBucket] = (unsigned long) InitFullness;
  }

  write_buffer(NumberLeakyBuckets, Rmin, Bmin, Fmin);

  free(buffer_frame);
  free(Rmin);
  free(Bmin);
  free(Fmin);
  return;
}
#endif


text:
<component name="InspectionProjectProfileManager">
  <profile version="1.0">
    <option name="myName" value="Project Default" />
    <inspection_tool class="ClassName" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
    <inspection_tool class="ConstPropertyName" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
    <inspection_tool class="Convert2streamapi" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
    <inspection_tool class="EmptyStatementBody" enabled="true" level="WARNING" enabled_by_default="true">
      <option name="m_reportEmptyBlocks" value="true" />
      <option name="commentsAreContent" value="true" />
    </inspection_tool>
    <inspection_tool class="EnumEntryName" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
    <inspection_tool class="FunctionName" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
    <inspection_tool class="LocalVariableName" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
    <inspection_tool class="ObjectPropertyName" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
    <inspection_tool class="PackageName" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
    <inspection_tool class="PrivateMemberAccessBetweenOuterAndInnerClass" enabled="true" level="WARNING" enabled_by_default="true" />
    <inspection_tool class="PrivatePropertyName" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
    <inspection_tool class="PropertyName" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
    <inspection_tool class="ShrinkerUnresolvedReference" enabled="true" level="WARNING" enabled_by_default="true" />
    <inspection_tool class="SpellCheckingInspection" enabled="false" level="TYPO" enabled_by_default="false">
      <option name="processCode" value="true" />
      <option name="processLiterals" value="true" />
      <option name="processComments" value="true" />
    </inspection_tool>
    <inspection_tool class="TestFunctionName" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
    <inspection_tool class="TrailingComma" enabled="true" level="WEAK WARNING" enabled_by_default="true" />
  </profile>
</component>

redpajama_set_name: RedPajamaGithub


text:
.zn-animate-rotate-out-newspaper {
	-webkit-transform-origin: 50% 50%;
	-webkit-animation: rotateOutNewspaper .5s both ease-in;
	-moz-transform-origin: 50% 50%;
	-moz-animation: rotateOutNewspaper .5s both ease-in;
	transform-origin: 50% 50%;
	animation: rotateOutNewspaper .5s both ease-in;
}

.zn-animate-rotate-in-newspaper {
	-webkit-transform-origin: 50% 50%;
	-webkit-animation: rotateInNewspaper .5s both ease-out;
	-moz-transform-origin: 50% 50%;
	-moz-animation: rotateInNewspaper .5s both ease-out;
	transform-origin: 50% 50%;
	animation: rotateInNewspaper .5s both ease-out;
}

/* newspaper */

@-webkit-keyframes rotateOutNewspaper {
	to { -webkit-transform: translateZ(-3000px) rotateZ(360deg); opacity: 0; }
}
@-moz-keyframes rotateOutNewspaper {
	to { -moz-transform: translateZ(-3000px) rotateZ(360deg); opacity: 0; }
}
@keyframes rotateOutNewspaper {
	to { transform: translateZ(-3000px) rotateZ(360deg); opacity: 0; }
}

@-webkit-keyframes rotateInNewspaper {
	from { -webkit-transform: translateZ(-3000px) rotateZ(-360deg); opacity: 0; }
}
@-moz-keyframes rotateInNewspaper {
	from { -moz-transform: translateZ(-3000px) rotateZ(-360deg); opacity: 0; }
}
@keyframes rotateInNewspaper {
	from { transform: translateZ(-3000px) rotateZ(-360deg); opacity: 0; }
}


text:
/**
 *
 */
/**
 * @author lwq
 *
 */
package org.fkjava.activiti.workflow.web.controller;


text:
CFLAGS+= -std=gnu99 -I. -Wall -Wpedantic -Wextra -D_GNU_SOURCE
LIBS = -L.
SOURCES = l7knockknock.c proxy-splice.c
MAIN_PROGRAM= l7knockknock

UNAME_S := $(shell uname -s)
ifneq ($(UNAME_S),Linux)
USELIBEVENT = 1
endif

.PHONY: clean test test-libevent

ifdef USELIBEVENT
SOURCES= l7knockknock.c proxy-libevent.c
# if not defined, default to homebrew folder
LIBEVENT ?= /usr/local
LIBS+= -L$(LIBEVENT)/lib -levent
CFLAGS+=-I$(LIBEVENT)/include
endif

ifdef COVERAGE
CFLAGS+=-O0 -coverage
endif

ifeq ($(shell uname), Darwin)
LIBS += -largp
endif

ifdef DEBUG # set with `make .. DEBUG=1`
	CFLAGS+=-g -DDEBUG
ifdef VERBOSE
	CFLAGS+=-DVERY_VERBOSE
endif
else
	CFLAGS+=-O2 -DNDEBUG
endif

$(MAIN_PROGRAM): $(SOURCES)
	$(CC) $(CFLAGS) -o $@ $(SOURCES) $(LIBS)

test: $(MAIN_PROGRAM)
	./run-test.sh ./$(MAIN_PROGRAM) --valgrind

clean:
	rm -f *.o *.gcda *.gcno $(MAIN_PROGRAM)


text:
require 'new_relic/metric_parser/java_parser'
module NewRelic
  module MetricParser
    class StrutsResult < NewRelic::MetricParser::MetricParser
      include JavaParser

      def method_name
        "execute"
      end

      def full_class_name
        segment_1
      end

      def call_rate_suffix
        'cpm'
      end
    end
  end
end


text:
package com.asakusafw.compiler.testing;

import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Optional;

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

import com.asakusafw.compiler.batch.BatchCompiler;
import com.asakusafw.compiler.batch.BatchCompilerConfiguration;
import com.asakusafw.compiler.batch.BatchDriver;
import com.asakusafw.compiler.batch.Workflow;
import com.asakusafw.compiler.batch.processor.JobFlowWorkDescriptionProcessor;
import com.asakusafw.compiler.common.Precondition;
import com.asakusafw.compiler.flow.FlowCompilerOptions;
import com.asakusafw.compiler.flow.Location;
import com.asakusafw.compiler.flow.jobflow.CompiledStage;
import com.asakusafw.compiler.flow.jobflow.JobflowModel;
import com.asakusafw.compiler.repository.SpiDataClassRepository;
import com.asakusafw.compiler.repository.SpiExternalIoDescriptionProcessorRepository;
import com.asakusafw.compiler.repository.SpiFlowElementProcessorRepository;
import com.asakusafw.compiler.repository.SpiFlowGraphRewriterRepository;
import com.asakusafw.compiler.repository.SpiWorkflowProcessorRepository;
import com.asakusafw.utils.graph.Graph;
import com.asakusafw.utils.graph.Graphs;
import com.asakusafw.utils.java.model.util.Models;
import com.asakusafw.vocabulary.batch.BatchDescription;
import com.asakusafw.vocabulary.batch.JobFlowWorkDescription;

/**
 * Compiles batch classes and generates batch applications.
 */
public final class DirectBatchCompiler {

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

    /**
     * Compiles the target batch class and returns its structural information.
     * @param batchClass the target batch class
     * @param basePackageName the base package name of generated Java source files
     * @param clusterWorkingDirectory the runtime working directory
     * @param outputDirectory the output directory
     * @param localWorkingDirectory the working directory for compiler
     * @param extraResources the extra resources for embedding contents into each jobflow package file
     * @param serviceClassLoader the class loader for loading compiler services
     * @param flowCompilerOptions the compiler options for flow DSL
     * @return the compile results
     * @throws IOException if failed to compile
     * @throws IllegalArgumentException if the parameters are {@code null}
     */
    public static BatchInfo compile(
            Class<? extends BatchDescription> batchClass,
            String basePackageName,
            Location clusterWorkingDirectory,
            File outputDirectory,
            File localWorkingDirectory,
            List<File> extraResources,
            ClassLoader serviceClassLoader,
            FlowCompilerOptions flowCompilerOptions) throws IOException {
        Precondition.checkMustNotBeNull(batchClass, "batchClass"); //$NON-NLS-1$
        Precondition.checkMustNotBeNull(clusterWorkingDirectory, "clusterWorkingDirectory"); //$NON-NLS-1$
        Precondition.checkMustNotBeNull(outputDirectory, "outputDirectory"); //$NON-NLS-1$
        Precondition.checkMustNotBeNull(localWorkingDirectory, "localWorkingDirectory"); //$NON-NLS-1$
        Precondition.checkMustNotBeNull(extraResources, "extraResources"); //$NON-NLS-1$
        Precondition.checkMustNotBeNull(serviceClassLoader, "serviceClassLoader"); //$NON-NLS-1$
        Precondition.checkMustNotBeNull(flowCompilerOptions, "flowCompilerOptions"); //$NON-NLS-1$

        if (localWorkingDirectory.exists()) {
            delete(localWorkingDirectory);
        }
        if (outputDirectory.exists()) {
            delete(outputDirectory);
        }
        BatchDriver driver = BatchDriver.analyze(batchClass);
        if (driver.hasError()) {
            throw new IOException(driver.getDiagnostics().toString());
        }

        String batchId = driver.getBatchClass().getConfig().name();
        BatchCompilerConfiguration config = createConfig(
                batchId,
                basePackageName,
                clusterWorkingDirectory,
                outputDirectory,
                localWorkingDirectory,
                extraResources,
                serviceClassLoader,
                flowCompilerOptions);

        BatchCompiler compiler = new BatchCompiler(config);
        Workflow workflow = compiler.compile(driver.getBatchClass().getDescription());
        return toInfo(workflow, outputDirectory);
    }

    /**
     * Returns the structural information of the batch application from a compiled workflow.
     * @param workflow the target workflow
     * @param outputDirectory the output directory
     * @return the structural information
     * @throws IllegalArgumentException if the parameters are {@code null}
     */
    public static BatchInfo toInfo(Workflow workflow, File outputDirectory) {
        Precondition.checkMustNotBeNull(workflow, "workflow"); //$NON-NLS-1$
        Precondition.checkMustNotBeNull(outputDirectory, "outputDirectory"); //$NON-NLS-1$
        List<JobflowInfo> jobflows = new ArrayList<>();
        for (Workflow.Unit unit : Graphs.sortPostOrder(workflow.getGraph())) {
            JobflowInfo jobflow = toJobflow(unit, outputDirectory);
            if (jobflow != null) {
                jobflows.add(jobflow);
            }
        }
        return new BatchInfo(workflow, outputDirectory, jobflows);
    }

    private static boolean delete(File target) {
        assert target != null;
        boolean success = true;
        if (target.isDirectory()) {
            for (File child : list(target)) {
                success &= delete(child);
            }
        }
        success &= target.delete();
        return success;
    }

    private static List<File> list(File file) {
        return Optional.ofNullable(file.listFiles())
                .map(Arrays::asList)
                .orElse(Collections.emptyList());
    }

    /**
     * Creates a compiler configuration object.
     * @param batchId the target batch ID
     * @param basePackageName the base package name of generated Java source files
     * @param clusterWorkingLocation the runtime working directory
     * @param outputDirectory the output directory
     * @param localWorkingDirectory the working directory for compiler
     * @param extraResources the extra resources for embedding contents into each jobflow package file
     * @param serviceClassLoader the class loader for loading compiler services
     * @param flowCompilerOptions the compiler options for flow DSL
     * @return the created object
     * @throws IOException if failed to extract the configuration
     * @throws IllegalArgumentException if the parameters are {@code null}
     */
    public static BatchCompilerConfiguration createConfig(
            String batchId,
            String basePackageName,
            Location clusterWorkingLocation,
            File outputDirectory,
            File localWorkingDirectory,
            List<File> extraResources,
            ClassLoader serviceClassLoader,
            FlowCompilerOptions flowCompilerOptions) throws IOException {
        assert batchId != null;
        assert basePackageName != null;
        assert clusterWorkingLocation != null;
        assert outputDirectory != null;
        assert localWorkingDirectory != null;
        assert extraResources != null;
        assert serviceClassLoader != null;
        assert flowCompilerOptions != null;
        BatchCompilerConfiguration config = new BatchCompilerConfiguration();
        config.setBatchId(batchId);
        config.setDataClasses(new SpiDataClassRepository());
        config.setExternals(new SpiExternalIoDescriptionProcessorRepository());
        config.setGraphRewriters(new SpiFlowGraphRewriterRepository());
        config.setFactory(Models.getModelFactory());
        config.setFlowElements(new SpiFlowElementProcessorRepository());
        config.setLinkingResources(DirectFlowCompiler.createRepositories(serviceClassLoader, extraResources));
        config.setOutputDirectory(outputDirectory);
        config.setRootLocation(clusterWorkingLocation);
        config.setRootPackageName(basePackageName);
        config.setWorkflows(new SpiWorkflowProcessorRepository());
        config.setServiceClassLoader(serviceClassLoader);
        config.setWorkingDirectory(localWorkingDirectory);
        config.setFlowCompilerOptions(flowCompilerOptions);
        return config;
    }

    private static JobflowInfo toJobflow(
            Workflow.Unit unit,
            File outputDirectory) {
        assert unit != null;
        assert outputDirectory != null;
        if ((unit.getDescription() instanceof JobFlowWorkDescription) == false) {
            return null;
        }
        JobflowModel model = (JobflowModel) unit.getProcessed();
        String flowId = model.getFlowId();
        return new JobflowInfo(
                model,
                JobFlowWorkDescriptionProcessor.getPackageLocation(outputDirectory, flowId),
                JobFlowWorkDescriptionProcessor.getSourceLocation(outputDirectory, flowId),
                toStagePlan(model));
    }

    private static List<StageInfo> toStagePlan(JobflowModel jobflow) {
        assert jobflow != null;
        List<StageInfo> results = new ArrayList<>();
        for (CompiledStage compiled : jobflow.getCompiled().getPrologueStages()) {
            results.add(toInfo(compiled));
        }
        Graph<JobflowModel.Stage> depenedencies = jobflow.getDependencyGraph();
        for (JobflowModel.Stage stage : Graphs.sortPostOrder(depenedencies)) {
            results.add(toInfo(stage.getCompiled()));
        }
        for (CompiledStage compiled : jobflow.getCompiled().getEpilogueStages()) {
            results.add(toInfo(compiled));
        }
        return results;
    }

    private static StageInfo toInfo(CompiledStage stage) {
        assert stage != null;
        String className = stage.getQualifiedName().toNameString();
        return new StageInfo(className);
    }

    private DirectBatchCompiler() {
        return;
    }
}


text:
#include <grpc/support/port_platform.h>

#include <grpc/grpc.h>

void grpc_http_filters_init(void);
void grpc_http_filters_shutdown(void);
void grpc_chttp2_plugin_init(void);
void grpc_chttp2_plugin_shutdown(void);
void grpc_deadline_filter_init(void);
void grpc_deadline_filter_shutdown(void);
void grpc_client_channel_init(void);
void grpc_client_channel_shutdown(void);
void grpc_tsi_alts_init(void);
void grpc_tsi_alts_shutdown(void);
void grpc_server_load_reporting_plugin_init(void);
void grpc_server_load_reporting_plugin_shutdown(void);

void grpc_register_built_in_plugins(void) {
  grpc_register_plugin(grpc_http_filters_init,
                       grpc_http_filters_shutdown);
  grpc_register_plugin(grpc_chttp2_plugin_init,
                       grpc_chttp2_plugin_shutdown);
  grpc_register_plugin(grpc_deadline_filter_init,
                       grpc_deadline_filter_shutdown);
  grpc_register_plugin(grpc_client_channel_init,
                       grpc_client_channel_shutdown);
  grpc_register_plugin(grpc_tsi_alts_init,
                       grpc_tsi_alts_shutdown);
  grpc_register_plugin(grpc_server_load_reporting_plugin_init,
                       grpc_server_load_reporting_plugin_shutdown);
}


text:
from twisted.internet import reactor
import goldenrod, config

def execute(parser, bot, user, args):
    if not parser.checkPerms(bot, user, "owner") or not bot.isWhisperRequest():
        return
    from goldenrod import channelInstances
    channelsIamIn = "I am in: "
    channelsIamIn += ", ".join(channel for channel in channelInstances)
    bot.addressUser(user, "%s" % channelsIamIn)

def requiredPerm():
    return "owner"

def canUseByWhisper():
    return True


text:
'use strict';

var _createSpy = _interopRequireDefault(require('./createSpy'));

var _Env = _interopRequireDefault(require('./Env'));

var _JsApiReporter = _interopRequireDefault(require('./JsApiReporter'));

var _ReportDispatcher = _interopRequireDefault(require('./ReportDispatcher'));

var _Spec = _interopRequireDefault(require('./Spec'));

var _spyRegistry = _interopRequireDefault(require('./spyRegistry'));

var _Suite = _interopRequireDefault(require('./Suite'));

var _Timer = _interopRequireDefault(require('./Timer'));

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

function _objectSpread(target) {
  for (var i = 1; i < arguments.length; i++) {
    var source = arguments[i] != null ? arguments[i] : {};
    var ownKeys = Object.keys(source);
    if (typeof Object.getOwnPropertySymbols === 'function') {
      ownKeys = ownKeys.concat(
        Object.getOwnPropertySymbols(source).filter(function(sym) {
          return Object.getOwnPropertyDescriptor(source, sym).enumerable;
        })
      );
    }
    ownKeys.forEach(function(key) {
      _defineProperty(target, key, source[key]);
    });
  }
  return target;
}

function _defineProperty(obj, key, value) {
  if (key in obj) {
    Object.defineProperty(obj, key, {
      value: value,
      enumerable: true,
      configurable: true,
      writable: true
    });
  } else {
    obj[key] = value;
  }
  return obj;
}

const create = function create(createOptions) {
  const j$ = _objectSpread({}, createOptions);

  j$._DEFAULT_TIMEOUT_INTERVAL = 5000;

  j$.getEnv = function(options) {
    const env = (j$.currentEnv_ = j$.currentEnv_ || new j$.Env(options)); //jasmine. singletons in here (setTimeout blah blah).

    return env;
  };

  j$.createSpy = _createSpy.default;
  j$.Env = (0, _Env.default)(j$);
  j$.JsApiReporter = _JsApiReporter.default;
  j$.ReportDispatcher = _ReportDispatcher.default;
  j$.Spec = _Spec.default;
  j$.SpyRegistry = _spyRegistry.default;
  j$.Suite = _Suite.default;
  j$.Timer = _Timer.default;
  j$.version = '2.5.2-light';
  return j$;
};

const _interface = function _interface(jasmine, env) {
  const jasmineInterface = {
    describe(description, specDefinitions) {
      return env.describe(description, specDefinitions);
    },

    xdescribe(description, specDefinitions) {
      return env.xdescribe(description, specDefinitions);
    },

    fdescribe(description, specDefinitions) {
      return env.fdescribe(description, specDefinitions);
    },

    it() {
      return env.it.apply(env, arguments);
    },

    xit() {
      return env.xit.apply(env, arguments);
    },

    fit() {
      return env.fit.apply(env, arguments);
    },

    beforeEach() {
      if (typeof arguments[0] !== 'function') {
        throw new Error(
          'Invalid first argument. It must be a callback function.'
        );
      }

      return env.beforeEach.apply(env, arguments);
    },

    afterEach() {
      if (typeof arguments[0] !== 'function') {
        throw new Error(
          'Invalid first argument. It must be a callback function.'
        );
      }

      return env.afterEach.apply(env, arguments);
    },

    beforeAll() {
      if (typeof arguments[0] !== 'function') {
        throw new Error(
          'Invalid first argument. It must be a callback function.'
        );
      }

      return env.beforeAll.apply(env, arguments);
    },

    afterAll() {
      if (typeof arguments[0] !== 'function') {
        throw new Error(
          'Invalid first argument. It must be a callback function.'
        );
      }

      return env.afterAll.apply(env, arguments);
    },

    pending() {
      return env.pending.apply(env, arguments);
    },

    fail() {
      return env.fail.apply(env, arguments);
    },

    spyOn(obj, methodName, accessType) {
      return env.spyOn(obj, methodName, accessType);
    },

    jsApiReporter: new jasmine.JsApiReporter({
      timer: new jasmine.Timer()
    }),
    jasmine
  };
  return jasmineInterface;
}; // Interface is a reserved word in strict mode, so can't export it as ESM

module.exports = {
  create,
  interface: _interface
};


text:
FROM ubuntu:15.10

RUN apt-get -y update && apt-get install -y python-dev python-pip
RUN apt-get install -y g++
RUN apt-get install -y doxygen dvipng
RUN apt-get install -y cmake libjpeg8-dev zlib1g-dev texlive-latex-base texlive-latex-extra
RUN apt-get install -y git
RUN apt-get install -y graphviz

RUN pip install Sphinx breathe sphinx_bootstrap_theme awscli matplotlib
RUN pip install --upgrade https://github.com/hobu/rst2pdf/zipball/master

RUN useradd pdal
RUN mkdir /home/pdal&& chown -R pdal: /home/pdal

RUN mkdir /root/.ssh
RUN ssh-keyscan github.com >> /root/.ssh/known_hosts
WORKDIR /home/pdal
RUN git clone https://github.com/PDAL/PDAL.git pdal
RUN git config --global push.default matching
RUN git config --global user.email "pdal@hobu.net"
RUN git config --global user.name "PDAL Automated Dockerfile"

VOLUME /data

ADD run.sh /home/pdal/run.sh

# docker run --rm --volumes-from docbuild pdal-doc-build ls -al /data
# docker create -v $(pwd)/output:/data --name docbuild pdal-doc-build


text:
class CreateMessages < ActiveRecord::Migration
  def change
    create_table :messages do |t|
      t.text :body, null: false
      t.references :conversation, index: true, null: false
      t.references :user, index: true, null: false
      t.boolean :read, default: false
      t.timestamps(null: false)
    end
  end
end


text:
require 'chef/chef_fs/file_system/base_fs_dir'
require 'chef/chef_fs/file_system/rest_list_entry'
require 'chef/chef_fs/file_system/not_found_error'

class Chef
  module ChefFS
    module FileSystem
      class RestListDir < BaseFSDir
        def initialize(name, parent, api_path = nil, data_handler = nil)
          super(name, parent)
          @api_path = api_path || (parent.api_path == "" ? name : "#{parent.api_path}/#{name}")
          @data_handler = data_handler
        end

        attr_reader :api_path
        attr_reader :data_handler

        def child(name)
          result = @children.select { |child| child.name == name }.first if @children
          result ||= can_have_child?(name, false) ?
                     _make_child_entry(name) : NonexistentFSObject.new(name, self)
        end

        def can_have_child?(name, is_dir)
          name =~ /\.json$/ && !is_dir
        end

        def children
          begin
            @children ||= root.get_json(api_path).keys.sort.map do |key|
              _make_child_entry("#{key}.json", true)
            end
          rescue Timeout::Error => e
            raise Chef::ChefFS::FileSystem::OperationFailedError.new(:children, self, e), "Timeout retrieving children: #{e}"
          rescue Net::HTTPServerException => e
            if $!.response.code == "404"
              raise Chef::ChefFS::FileSystem::NotFoundError.new(self, $!)
            else
              raise Chef::ChefFS::FileSystem::OperationFailedError.new(:children, self, e), "HTTP error retrieving children: #{e}"
            end
          end
        end

        def create_child(name, file_contents)
          begin
            object = Chef::JSONCompat.parse(file_contents)
          rescue Chef::Exceptions::JSON::ParseError => e
            raise Chef::ChefFS::FileSystem::OperationFailedError.new(:create_child, self, e), "Parse error reading JSON creating child '#{name}': #{e}"
          end

          result = _make_child_entry(name, true)

          if data_handler
            object = data_handler.normalize_for_post(object, result)
            data_handler.verify_integrity(object, result) do |error|
              raise Chef::ChefFS::FileSystem::OperationFailedError.new(:create_child, self), "Error creating '#{name}': #{error}"
            end
          end

          begin
            rest.post(api_path, object)
          rescue Timeout::Error => e
            raise Chef::ChefFS::FileSystem::OperationFailedError.new(:create_child, self, e), "Timeout creating '#{name}': #{e}"
          rescue Net::HTTPServerException => e
            if e.response.code == "404"
              raise Chef::ChefFS::FileSystem::NotFoundError.new(self, e)
            elsif $!.response.code == "409"
              raise Chef::ChefFS::FileSystem::AlreadyExistsError.new(:create_child, self, e), "Failure creating '#{name}': #{path}/#{name} already exists"
            else
              raise Chef::ChefFS::FileSystem::OperationFailedError.new(:create_child, self, e), "Failure creating '#{name}': #{e.message}"
            end
          end

          @children = nil

          result
        end

        def org
          parent.org
        end

        def environment
          parent.environment
        end

        def rest
          parent.rest
        end

        def _make_child_entry(name, exists = nil)
          RestListEntry.new(name, self, exists)
        end
      end
    end
  end
end


text:
<?php
/* @var $this SeguimientoPercepcionController */
/* @var $model SeguimientoPercepcion */

$this->breadcrumbs=array(
	'Seguimiento Percepcions'=>array('index'),
	$model->id,
);

$this->menu=array(
	array('label'=>'List SeguimientoPercepcion', 'url'=>array('index')),
	array('label'=>'Create SeguimientoPercepcion', 'url'=>array('create')),
	array('label'=>'Update SeguimientoPercepcion', 'url'=>array('update', 'id'=>$model->id)),
	array('label'=>'Delete SeguimientoPercepcion', 'url'=>'#', 'linkOptions'=>array('submit'=>array('delete','id'=>$model->id),'confirm'=>'Are you sure you want to delete this item?')),
	array('label'=>'Manage SeguimientoPercepcion', 'url'=>array('admin')),
);
?>

View SeguimientoPercepcion #<?php echo $model->id; ?>

<?php $this->widget('zii.widgets.CDetailView', array(
	'data'=>$model,
	'attributes'=>array(
		'id',
		'linea_servicio_contrato_id',
		'per_cliente',
		'per_sm',
		'fecha',
		'tipo_seguimiento',
	),
)); ?>


text:
"""Abstraction of notes on the filesystem."""
from datetime import datetime
from flask import current_app
from werkzeug.security import safe_join
import os

class Note(object):

    def __init__(self, filename, title, text=None, mtime=None):
        self.filename = filename
        self.title = title
        self.text = text
        self.mtime = mtime

def _path_for(fname):
    path = safe_join(current_app.config['NOTES_DIR'], fname)
    return path

def note_exists(fname):
    path = _path_for(fname)
    return (not fname.startswith('.') and os.path.exists(path) and
            os.path.isfile(path))

def _read_title(f):
    line = f.readline()
    if line.startswith(b'# ') and f.readline() == b'\n':
        return line[2:-1].decode('utf-8')
    return None

def read_note(fname):
    """Assumes filename is valid."""
    with open(_path_for(fname), 'rb') as f:
        return Note(fname, _read_title(f), f.read().decode('utf-8'))

def write_note(note):
    """Assumes filename is valid."""
    with open(_path_for(note.filename), 'wb') as f:
        if note.title:
            f.write(b'# ')
            f.write(note.title.encode('utf-8'))
            f.write(b'\n\n')
        if note.text:
            f.write(note.text.encode('utf-8'))

def list_notes():
    notes = []
    for fname in os.listdir(current_app.config['NOTES_DIR']):
        if note_exists(fname):
            path = _path_for(fname)
            ts = os.path.getmtime(path)
            with open(path, 'rb') as f:
                title = _read_title(f)
                note = Note(fname, title, None, datetime.fromtimestamp(ts))
                notes.append(note)
    notes.sort(key=lambda x: x.mtime, reverse=True)
    return notes


text: cp /workspace/phpframeworks/public/index.html /var/www/html/


text:
"""
    test.py
    Copyright 2015 Jeroen Arnoldus <jeroen@repleo.nl>

THIS SOFTWARE IS SUPPLIED WITHOUT WARRANTY OF ANY KIND, AND MAY BE
COPIED, MODIFIED OR DISTRIBUTED IN ANY WAY, AS LONG AS THIS NOTICE
AND ACKNOWLEDGEMENT OF AUTHORSHIP REMAIN.
"""

from django.test import TestCase
from randomcab.backends import mail
from django.core.mail import EmailMessage

class MailFailOverTest(TestCase):
    def runMailFailOverBackendWithConfig(self,config):
        with self.settings(EMAIL_BACKEND_LIST=config):
            backend=mail.MailFailOverBackend();
            email_message=EmailMessage("foo", "body", "from@example.com",
                    ["to@example.com"], ["bcc@example.com"])
            return backend.send_messages([email_message])

    def test_no_mailserver(self):
        with self.assertRaises(Exception):
            self.runMailFailOverBackendWithConfig([])

    def test_one_ok_mailserver(self):
        config=[{
                'EMAIL_BACKEND' : 'django.core.mail.backends.dummy.EmailBackend',
                'EMAIL_HOST' : '',
                'EMAIL_PORT' : '',
                'EMAIL_HOST_USER' : '',
                'EMAIL_HOST_PASSWORD' : '',
                'EMAIL_USE_TLS' : False,
        }]
        result=self.runMailFailOverBackendWithConfig(config)
        self.assertEqual(result, 1)

    def test_two_ok_mailserver(self):
        config=[{
                'EMAIL_BACKEND' : 'django.core.mail.backends.dummy.EmailBackend',
                'EMAIL_HOST' : '',
                'EMAIL_PORT' : '',
                'EMAIL_HOST_USER' : '',
                'EMAIL_HOST_PASSWORD' : '',
                'EMAIL_USE_TLS' : False,
        },
        {
                'EMAIL_BACKEND' : 'django.core.mail.backends.dummy.EmailBackend',
                'EMAIL_HOST' : '',
                'EMAIL_PORT' : '',
                'EMAIL_HOST_USER' : '',
                'EMAIL_HOST_PASSWORD' : '',
                'EMAIL_USE_TLS' : False,
        }
        ]
        result=self.runMailFailOverBackendWithConfig(config)
        self.assertEqual(result, 1)

    def test_two_failover_mailserver(self):
        config=[{
            '    EMAIL_BACKEND' : 'django.core.mail.backends.smtp.EmailBackend',
                'EMAIL_HOST' : 'smtp.sendgrid.net',
                'EMAIL_PORT' : 587,
                'EMAIL_HOST_USER' : 'foo',
                'EMAIL_HOST_PASSWORD' : 'bar',
                'EMAIL_USE_TLS' : True,
        },
        {
                'EMAIL_BACKEND' : 'django.core.mail.backends.dummy.EmailBackend',
                'EMAIL_HOST' : '',
                'EMAIL_PORT' : '',
                'EMAIL_HOST_USER' : '',
                'EMAIL_HOST_PASSWORD' : '',
                'EMAIL_USE_TLS' : False,
        }
        ]
        result=self.runMailFailOverBackendWithConfig(config)
        self.assertEqual(result, 1)

    def test_one_fail_mailserver(self):
        with self.assertRaises(Exception):
            config=[{
                '    EMAIL_BACKEND' : 'django.core.mail.backends.smtp.EmailBackend',
                    'EMAIL_HOST' : 'smtp.sendgrid.net',
                    'EMAIL_PORT' : 587,
                    'EMAIL_HOST_USER' : 'foo',
                    'EMAIL_HOST_PASSWORD' : 'bar',
                    'EMAIL_USE_TLS' : True,
            }
            ]
            result=self.runMailFailOverBackendWithConfig(config)
            self.assertEqual(result, 1)

    def test_two_fail_mailserver(self):
        with self.assertRaises(Exception):
            config=[{
                '    EMAIL_BACKEND' : 'django.core.mail.backends.smtp.EmailBackend',
                    'EMAIL_HOST' : 'smtp.sendgrid.net',
                    'EMAIL_PORT' : 587,
                    'EMAIL_HOST_USER' : 'foo',
                    'EMAIL_HOST_PASSWORD' : 'bar',
                    'EMAIL_USE_TLS' : True,
            },
            {
                    'EMAIL_BACKEND' : '<PROJECTNAME>.backends.mail.SSLEmailBackend',
                    'EMAIL_HOST' : 'email-smtp.us-west-2.amazonaws.com',
                    'EMAIL_PORT' : 465,
                    'EMAIL_HOST_USER' : 'foo',
                    'EMAIL_HOST_PASSWORD' : 'bar',
                    'EMAIL_USE_TLS' : False,
            }
            ]
            result=self.runMailFailOverBackendWithConfig(config)
            self.assertEqual(result, 1)

    def test_three_failover_mailserver(self):
        config=[{
            '    EMAIL_BACKEND' : 'django.core.mail.backends.smtp.EmailBackend',
                'EMAIL_HOST' : 'smtp.sendgrid.net',
                'EMAIL_PORT' : 587,
                'EMAIL_HOST_USER' : 'foo',
                'EMAIL_HOST_PASSWORD' : 'bar',
                'EMAIL_USE_TLS' : True,
        },
        {
                'EMAIL_BACKEND' : '<PROJECTNAME>.backends.mail.SSLEmailBackend',
                'EMAIL_HOST' : 'email-smtp.us-west-2.amazonaws.com',
                'EMAIL_PORT' : 465,
                'EMAIL_HOST_USER' : 'foo',
                'EMAIL_HOST_PASSWORD' : 'bar',
                'EMAIL_USE_TLS' : False,
        },
        {
                'EMAIL_BACKEND' : 'django.core.mail.backends.dummy.EmailBackend',
                'EMAIL_HOST' : '',
                'EMAIL_PORT' : '',
                'EMAIL_HOST_USER' : '',
                'EMAIL_HOST_PASSWORD' : '',
                'EMAIL_USE_TLS' : False,
        }
        ]
        result=self.runMailFailOverBackendWithConfig(config)
        self.assertEqual(result, 1)


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

    var test = require('colored-tape'),
        runOptionsTest = require('./common.js').runOptionsTest;

    test('prefix', function(t) {
        runOptionsTest(t, {
            prefix: 'combined-'
        });
    });
}());


text:
SpecBegin(RACTestScheduler)

__block RACTestScheduler *scheduler;

beforeEach(^{
	scheduler = [[RACTestScheduler alloc] init];
	expect(scheduler).notTo.beNil();
});

it(@"should do nothing when stepping while empty", ^{
	[scheduler step];
	[scheduler step:5];
	[scheduler stepAll];
});

it(@"should execute the earliest enqueued block when stepping", ^{
	__block BOOL firstExecuted = NO;
	[scheduler schedule:^{
		firstExecuted = YES;
	}];

	__block BOOL secondExecuted = NO;
	[scheduler schedule:^{
		secondExecuted = YES;
	}];

	expect(firstExecuted).to.beFalsy();
	expect(secondExecuted).to.beFalsy();

	[scheduler step];
	expect(firstExecuted).to.beTruthy();
	expect(secondExecuted).to.beFalsy();

	[scheduler step];
	expect(secondExecuted).to.beTruthy();
});

it(@"should step multiple times", ^{
	__block BOOL firstExecuted = NO;
	[scheduler schedule:^{
		firstExecuted = YES;
	}];

	__block BOOL secondExecuted = NO;
	[scheduler schedule:^{
		secondExecuted = YES;
	}];

	__block BOOL thirdExecuted = NO;
	[scheduler schedule:^{
		thirdExecuted = YES;
	}];

	expect(firstExecuted).to.beFalsy();
	expect(secondExecuted).to.beFalsy();
	expect(thirdExecuted).to.beFalsy();

	[scheduler step:2];
	expect(firstExecuted).to.beTruthy();
	expect(secondExecuted).to.beTruthy();
	expect(thirdExecuted).to.beFalsy();

	[scheduler step:1];
	expect(thirdExecuted).to.beTruthy();
});

it(@"should step through all scheduled blocks", ^{
	__block NSUInteger executions = 0;
	for (NSUInteger i = 0; i < 10; i++) {
		[scheduler schedule:^{
			executions++;
		}];
	}

	expect(executions).to.equal(0);

	[scheduler stepAll];
	expect(executions).to.equal(10);
});

it(@"should execute blocks in date order when stepping", ^{
	__block BOOL laterExecuted = NO;
	[scheduler after:[NSDate distantFuture] schedule:^{
		laterExecuted = YES;
	}];

	__block BOOL earlierExecuted = NO;
	[scheduler after:[NSDate dateWithTimeIntervalSinceNow:20] schedule:^{
		earlierExecuted = YES;
	}];

	expect(earlierExecuted).to.beFalsy();
	expect(laterExecuted).to.beFalsy();

	[scheduler step];
	expect(earlierExecuted).to.beTruthy();
	expect(laterExecuted).to.beFalsy();

	[scheduler step];
	expect(laterExecuted).to.beTruthy();
});

it(@"should execute delayed blocks in date order when stepping", ^{
	__block BOOL laterExecuted = NO;
	[scheduler afterDelay:100 schedule:^{
		laterExecuted = YES;
	}];

	__block BOOL earlierExecuted = NO;
	[scheduler afterDelay:50 schedule:^{
		earlierExecuted = YES;
	}];

	expect(earlierExecuted).to.beFalsy();
	expect(laterExecuted).to.beFalsy();

	[scheduler step];
	expect(earlierExecuted).to.beTruthy();
	expect(laterExecuted).to.beFalsy();

	[scheduler step];
	expect(laterExecuted).to.beTruthy();
});

it(@"should execute a repeating blocks in date order", ^{
	__block NSUInteger firstExecutions = 0;
	[scheduler after:[NSDate dateWithTimeIntervalSinceNow:20] repeatingEvery:5 withLeeway:0 schedule:^{
		firstExecutions++;
	}];

	__block NSUInteger secondExecutions = 0;
	[scheduler after:[NSDate dateWithTimeIntervalSinceNow:22] repeatingEvery:10 withLeeway:0 schedule:^{
		secondExecutions++;
	}];

	expect(firstExecutions).to.equal(0);
	expect(secondExecutions).to.equal(0);

	// 20 ticks
	[scheduler step];
	expect(firstExecutions).to.equal(1);
	expect(secondExecutions).to.equal(0);

	// 22 ticks
	[scheduler step];
	expect(firstExecutions).to.equal(1);
	expect(secondExecutions).to.equal(1);

	// 25 ticks
	[scheduler step];
	expect(firstExecutions).to.equal(2);
	expect(secondExecutions).to.equal(1);

	// 30 ticks
	[scheduler step];
	expect(firstExecutions).to.equal(3);
	expect(secondExecutions).to.equal(1);

	// 32 ticks
	[scheduler step];
	expect(firstExecutions).to.equal(3);
	expect(secondExecutions).to.equal(2);
});

SpecEnd


text:
package com.opengamma.core.historicaltimeseries.impl;

import java.util.Set;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.threeten.bp.LocalDate;

import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisPool;

import com.opengamma.OpenGammaRuntimeException;
import com.opengamma.id.ExternalId;
import com.opengamma.id.UniqueId;
import com.opengamma.timeseries.date.localdate.LocalDateDoubleTimeSeries;
import com.opengamma.util.ArgumentChecker;

/**
 * An extremely minimal and lightweight {@code HistoricalTimeSeriesSource} that pulls data
 * directly from Redis for the purpose of historical simulations, where the full market data
 * series for that simulation can change every day..
 * This is only appropriate for use in conjunction with {@code HistoricalTimeSeriesFunction}
 * and requires its own specific API for publishing data. It is not
 * a general purpose component.
 *

 * Effectively, there is a double-time series involved:
 *

 *
The {@code SimulationExecution} series is one time series, representing the date
 *       that the simulation series was performed (and/or expected to be used).

 *
The {@code Value} series is one point inside a particular simulation.

 *

 * So, for example, assume that every day a system generates a whole new time series,
 * where that time series is the simulation points that should be run. In that case,
 * this class may be appropriate.
 *

 * The following constraints must hold for this Source to be of any utility whatsoever:
 *

 *
Historical lookups are not required. Because they are not supported.

 *
Version corrections are not required. Because they are not supported.

 *
Each time series has a single {@link ExternalId} which then acts
 *       as the {@link UniqueId} internally.

 *
Each external ID has a single time series (thus there is not the capacity to store
 *       different Data Source, Data Provider, Observation Time, Data Field series).

 *

 *

 * Where a method is not supported semantically, an {@link UnsupportedOperationException}
 * will be thrown. Where use indicates that this class may be being used incorrectly,
 * a log message will be written at {@code WARN} level.
 *

 * See PLAT-3385 for the original
 * requirement.
 */
public class RedisSimulationSeriesSource extends NonVersionedRedisHistoricalTimeSeriesSource implements SimulationSeriesSource {
  private static final Logger s_logger = LoggerFactory.getLogger(RedisSimulationSeriesSource.class);
  private LocalDate _currentSimulationExecutionDate = LocalDate.now();

  public RedisSimulationSeriesSource(JedisPool jedisPool) {
    this(jedisPool, "");
  }

  public RedisSimulationSeriesSource(JedisPool jedisPool, String redisPrefix) {
    super(jedisPool, redisPrefix, "RedisSimulationSeriesSource");
  }

  @Override
  public RedisSimulationSeriesSource withSimulationDate(LocalDate date) {
    RedisSimulationSeriesSource redisSimulationSeriesSource = new RedisSimulationSeriesSource(getJedisPool(), getRedisPrefix());
    redisSimulationSeriesSource.setCurrentSimulationExecutionDate(date);
    return redisSimulationSeriesSource;
  }

  /**
   * Gets the currentSimulationExecutionDate.
   * @return the currentSimulationExecutionDate
   */
  @Override
  public LocalDate getCurrentSimulationExecutionDate() {
    return _currentSimulationExecutionDate;
  }

  /**
   * Sets the currentSimulationExecutionDate.
   * This will be used in calls to load the simulation series.
   * @param currentSimulationExecutionDate  the currentSimulationExecutionDate
   */
  public void setCurrentSimulationExecutionDate(LocalDate currentSimulationExecutionDate) {
    _currentSimulationExecutionDate = currentSimulationExecutionDate;
  }

  // ------------------------------------------------------------------------
  // REDIS MANIPULATION OPERATIONS:
  // ------------------------------------------------------------------------

  @Override
  public void updateTimeSeriesPoint(UniqueId uniqueId, LocalDate simulationExecutionDate, LocalDate valueDate, double value) {
    ArgumentChecker.notNull(uniqueId, "uniqueId");
    ArgumentChecker.notNull(simulationExecutionDate, "simulationExecutionDate");
    ArgumentChecker.notNull(valueDate, "valueDate");

    String redisKey = toRedisKey(uniqueId, simulationExecutionDate);
    updateTimeSeriesPoint(redisKey, valueDate, value);
  }

  @Override
  public void updateTimeSeries(UniqueId uniqueId, LocalDate simulationExecutionDate, LocalDateDoubleTimeSeries timeseries) {
    ArgumentChecker.notNull(uniqueId, "uniqueId");
    ArgumentChecker.notNull(simulationExecutionDate, "simulationExecutionDate");
    ArgumentChecker.notNull(timeseries, "timeseries");

    String redisKey = toRedisKey(uniqueId, simulationExecutionDate);
    updateTimeSeries(redisKey, timeseries, false);
  }

  @Override
  public void replaceTimeSeries(UniqueId uniqueId, LocalDate simulationExecutionDate, LocalDateDoubleTimeSeries timeSeries) {
    ArgumentChecker.notNull(uniqueId, "uniqueId");
    ArgumentChecker.notNull(timeSeries, "timeSeries");

    String redisKey = toRedisKey(uniqueId, simulationExecutionDate);
    updateTimeSeries(redisKey, timeSeries, true);
  }

  @Override
  public void clearExecutionDate(LocalDate simulationExecutionDate) {
    final String keysPattern = getRedisPrefix() + "*_" + simulationExecutionDate.toString();
    Jedis jedis = getJedisPool().getResource();
    try {
      Set<String> keys = jedis.keys(keysPattern);
      if (!keys.isEmpty()) {
        jedis.del(keys.toArray(new String[0]));
      }
      getJedisPool().returnResource(jedis);
    } catch (Exception e) {
      s_logger.error("Unable to clear execution date " + simulationExecutionDate, e);
      getJedisPool().returnBrokenResource(jedis);
      throw new OpenGammaRuntimeException("Unable to clear execution date " + simulationExecutionDate, e);
    }
  }

  @Override
  protected String toRedisKey(UniqueId uniqueId) {
    return toRedisKey(uniqueId, getCurrentSimulationExecutionDate());
  }

  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    if (!super.equals(o)) {
      return false;
    }
    RedisSimulationSeriesSource that = (RedisSimulationSeriesSource) o;
    return _currentSimulationExecutionDate.equals(that._currentSimulationExecutionDate);
  }

  @Override
  public int hashCode() {
    int result = super.hashCode();
    return 31 * result + _currentSimulationExecutionDate.hashCode();
  }
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CopterDown.Game
{
    public class GameActions
    {
        public const int GAMEOBJECT_KILLED = 8;
        public const int PARA_GROUNDED = 9;
    }
}


text:
<?php

namespace Drupal\Tests\media_library\FunctionalJavascript;

/**
 * Tests Media Library's integration with Views UI.
 *
 * @group media_library
 */
class ViewsUiIntegrationTest extends MediaLibraryTestBase {

  /**
   * {@inheritdoc}
   */
  protected static $modules = ['views_ui'];

  /**
   * {@inheritdoc}
   */
  protected function setUp(): void {
    parent::setUp();

    // Create a few example media items for use in selection.
    $this->createMediaItems([
      'type_one' => [
        'Horse',
        'Bear',
        'Cat',
        'Dog',
      ],
      'type_two' => [
        'Crocodile',
        'Lizard',
        'Snake',
        'Turtle',
      ],
    ]);

    $account = $this->drupalCreateUser(['administer views']);
    $this->drupalLogin($account);
  }

  /**
   * Tests that the integration with Views works correctly.
   */
  public function testViewsAdmin() {
    $page = $this->getSession()->getPage();

    // Assert that the widget can be seen and that there are 8 items.
    $this->drupalGet('/admin/structure/views/view/media_library/edit/widget');
    $this->waitForElementsCount('css', '.js-media-library-item', 8);

    // Assert that filtering works in live preview.
    $page->find('css', '.js-media-library-view .view-filters')->fillField('name', 'snake');
    $page->find('css', '.js-media-library-view .view-filters')->pressButton('Apply filters');
    $this->waitForElementsCount('css', '.js-media-library-item', 1);

    // Test the same routine but in the view for the table widget.
    $this->drupalGet('/admin/structure/views/view/media_library/edit/widget_table');
    $this->waitForElementsCount('css', '.js-media-library-item', 8);

    // Assert that filtering works in live preview.
    $page->find('css', '.js-media-library-view .view-filters')->fillField('name', 'snake');
    $page->find('css', '.js-media-library-view .view-filters')->pressButton('Apply filters');
    $this->waitForElementsCount('css', '.js-media-library-item', 1);

    // We cannot test clicking the 'Insert selected' button in either view
    // because we expect an AJAX error, which would always throw an exception
    // on ::tearDown even if we try to catch it here. If there is an API for
    // marking certain elements 'unsuitable for previewing', we could test that
    // here.
    // @see https://www.drupal.org/project/drupal/issues/3060852
  }

}


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

<title>GDB’s Obsolete Annotations: Frame Annotations</title>

<meta name="description" content="GDB’s Obsolete Annotations: Frame Annotations">
<meta name="keywords" content="GDB’s Obsolete Annotations: Frame Annotations">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="index.html#Top" rel="start" title="Top">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="index.html#Top" rel="up" title="Top">
<link href="Displays.html#Displays" rel="next" title="Displays">
<link href="Value-Annotations.html#Value-Annotations" rel="prev" title="Value Annotations">

Next: Displays, Previous: Value Annotations, Up: Top   [Contents]

6 Frames

Value Annotations have been removed.  GDB/MI instead provides
a number of frame commands.

Frame annotations are no longer available.  The GDB/MI
provides ‘<samp>-stack-list-arguments</samp>’, ‘<samp>-stack-list-locals</samp>’, and
‘<samp>-stack-list-frames</samp>’ commands.

Whenever GDB prints a frame, it annotates it.  For example, this applies
to frames printed when GDB stops, output from commands such as
backtrace or up, etc.

The frame annotation begins with

^Z^Zframe-begin <var>level</var> <var>address</var>
<var>level-string</var>

where <var>level</var> is the number of the frame (0 is the innermost frame,
and other frames have positive numbers), <var>address</var> is the address of
the code executing in that frame, and <var>level-string</var> is a string
designed to convey the level to the user.  <var>address</var> is in the form
‘<samp>0x</samp>’ followed by one or more lowercase hex digits (note that this
does not depend on the language).  The frame ends with

^Z^Zframe-end

Between these annotations is the main body of the frame, which can
consist of

^Z^Zfunction-call
<var>function-call-string</var>

where <var>function-call-string</var> is text designed to convey to the user
that this frame is associated with a function call made by GDB to a
function in the program being debugged.

^Z^Zsignal-handler-caller
<var>signal-handler-caller-string</var>

where <var>signal-handler-caller-string</var> is text designed to convey to
the user that this frame is associated with whatever mechanism is used
by this operating system to call a signal handler (it is the frame which
calls the signal handler, not the frame for the signal handler itself).

 A normal frame.

This can optionally (depending on whether this is thought of as
interesting information for the user to see) begin with

^Z^Zframe-address
<var>address</var>
^Z^Zframe-address-end
<var>separator-string</var>

where <var>address</var> is the address executing in the frame (the same
address as in the frame-begin annotation, but printed in a form
which is intended for user consumption—in particular, the syntax varies
depending on the language), and <var>separator-string</var> is a string
intended to separate this address from what follows for the user’s
benefit.

Then comes

^Z^Zframe-function-name
<var>function-name</var>
^Z^Zframe-args
<var>arguments</var>

where <var>function-name</var> is the name of the function executing in the
frame, or ‘<samp>??</samp>’ if not known, and <var>arguments</var> are the arguments
to the frame, with parentheses around them (each argument is annotated
individually as well, see Value Annotations).

If source information is available, a reference to it is then printed:

^Z^Zframe-source-begin
<var>source-intro-string</var>
^Z^Zframe-source-file
<var>filename</var>
^Z^Zframe-source-file-end
:
^Z^Zframe-source-line
<var>line-number</var>
^Z^Zframe-source-end

where <var>source-intro-string</var> separates for the user’s benefit the
reference from the text which precedes it, <var>filename</var> is the name of
the source file, and <var>line-number</var> is the line number within that
file (the first line is line 1).

If GDB prints some information about where the frame is from (which
library, which load segment, etc.; currently only done on the RS/6000),
it is annotated with

^Z^Zframe-where
<var>information</var>

Then, if source is to actually be displayed for this frame (for example,
this is not true for output from the backtrace command), then a
source annotation (see Source Annotations) is displayed.  Unlike
most annotations, this is output instead of the normal text which would be
output, not in addition.

Next: Displays, Previous: Value Annotations, Up: Top   [Contents]


text:
import React, { Component } from 'react'
import { login } from '../helpers/auth'

export default class Login extends Component {
  render () {
    return (
      <div className="col-sm-6 col-sm-offset-3">
        <h1> Login </h1>
        <button type="button" onClick={() => login()}>Login</button>
      </div>
    )
  }
}


text:
<?php

namespace Magento\Framework\Exception;

class IntegrationException extends LocalizedException
{
}


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>

    <string name="app_name">Clusters are Lists</string>

</resources>


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>404 Not Found - That page doesn't exist !</title>
    <link href="/public/css/style.min.css" rel="stylesheet">

404 Not Found - That page doesn't exist !


text:
@implementation GXApp

+ (NSString *)gxGetVersionUniqueNum{
    NSString *str = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"];
    NSArray *arr = [str componentsSeparatedByString:@"."];
    NSInteger version = 0;
    for (int i=0; i<3; i++) {
        NSInteger v = 0;
        if (i<arr.count)
            v = [[arr objectAtIndex:i] integerValue];
        version = version*100+v;
    }
    return [NSString stringWithFormat:@"%ld",version];
}

+ (NSURL *)gxGetUrlOfReview{
    //    itms-apps://ax.itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?type=Purple+Software&id=APP_ID
    //    @"itms-apps://itunes.apple.com/app/idAPP_ID"

    NSURL *deepURL = [NSURL URLWithString:[NSString stringWithFormat:@"https://itunes.apple.com/us/app/itunes-u/id%@?action=write-review",GXAPPID]];

    if ([[UIApplication sharedApplication] canOpenURL:deepURL])
        return deepURL;
    return [NSURL URLWithString:[NSString stringWithFormat:@"itms-apps://itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?type=Purple+Software&id=%@", GXAPPID]];
}

@end


text:
var Const = require('../sharedConstants').constant;

/*
 * GET home page.
 */

exports.index = function(req, res){
  res.render('index', { title: 'Express' });
};

exports.birds = function(req, res){
  res.render('birds', { title: 'Birds.js', wsAddress: Const.SOCKET_ADDR + ':' + Const.SOCKET_PORT });
};


text:
@class NSString;

@interface NSBundle (DVTNSBundleAdditions)
+ (id)dvt_rawInfoDictionaryForBundleAtPath:(id)arg1 error:(id *)arg2;
+ (id)dvt_filteredInfoDictionaryForBundleAtPath:(id)arg1 error:(id *)arg2;
+ (id)_uncachedValueForKey:(struct __CFString *)arg1 atURL:(id)arg2;
+ (id)_uncachedBundleStringForKey:(struct __CFString *)arg1 AtURL:(id)arg2;
+ (id)dvt_uncachedExtensionInfoAtPath:(id)arg1;
+ (id)dvt_uncachedBundleExecutableAtPath:(id)arg1;
+ (id)dvt_uncachedBundleIdentifierAtPath:(id)arg1;
+ (id)dvt_uncachedBundleExecutableAtURL:(id)arg1;
+ (id)dvt_uncachedBundleIdentifierAtURL:(id)arg1;
+ (id)dvt_platformFamilyForBundleAtPath:(id)arg1 error:(id *)arg2;
+ (id)dvt_platformForBundleAtPath:(id)arg1 error:(id *)arg2;
+ (id)dvt_executablePathForBundleAtPath:(id)arg1;
@property(readonly, nonatomic) NSString *dvt_contentsPath;
@end


text:
using System;

namespace GSoft.Dynamite.Features.Types
{
    /// <summary>
    /// Information object defining a feature dependency.
    /// </summary>
    public class FeatureDependencyInfo
    {
        /// <summary>
        /// Gets or sets the name.
        /// </summary>
        /// <value>
        /// The name.
        /// </value>
        public string Name { get; set; }

        /// <summary>
        /// Gets or sets the feature identifier.
        /// </summary>
        /// <value>
        /// The feature identifier.
        /// </value>
        public Guid FeatureId { get; set; }

        /// <summary>
        /// Gets or sets the feature activation mode.
        /// </summary>
        /// <value>
        /// The feature activation mode.
        /// </value>
        public FeatureActivationMode FeatureActivationMode { get; set; }

        /// <summary>
        /// Gets or sets a value indicating whether [force reactivation].
        /// </summary>
        /// <value>
        ///   <c>true</c> if [force reactivation]; otherwise, <c>false</c>.
        /// </value>
        public bool ForceReactivation { get; set; }
    }
}


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

public class UnicodeCharacters
{
    public static void Main()
    {
        var input = Console.ReadLine();
        var result = new List<string>();
        for (int i = 0; i < input.Length; i++)
        {
            result.Add(GetEscapeSequence(input[i]));
        }
        Console.WriteLine(string.Join("", result));
    }

    public static string GetEscapeSequence(char c)
    {
        return "\\u" + ((int)c).ToString("x4");
    }
}