text:
package com.ebradshaw.insight.agent.events;

public class InstrumentedEvent {

    private final long threadId;
    private final long creationTime;

    public InstrumentedEvent(long threadId) {
        this.threadId = threadId;
        this.creationTime = System.currentTimeMillis();
    }

    public long getThreadId() {
        return threadId;
    }

    public long getCreationTime() {
        return creationTime;
    }
}


text:
<?xml version="1.0"?>
<arquillian xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://jboss.org/schema/arquillian"
  xsi:schemaLocation="http://jboss.org/schema/arquillian http://jboss.org/schema/arquillian/arquillian_1_0.xsd">

  <engine>
    <property name="deploymentExportPath">target/arquillian</property>
  </engine>

  <defaultProtocol type="Servlet 2.5" />

  <group qualifier="containers" default="true">
    <container qualifier="remote-container" default="true">
      <configuration>
        <property name="adminUrl">t3://localhost:${container.port}</property>
        <property name="adminUserName">weblogic</property>
        <property name="adminPassword">weblogic1</property>
        <property name="wlHome">${weblogic.home}/wlserver</property>
        <property name="target">server</property>

        <property name="deployExplodedArchive">true</property>
      </configuration>
    </container>
  </group>

</arquillian>

redpajama_set_name: RedPajamaGithub


text:
package com.facebook.buck.jvm.java;

import static com.facebook.buck.jvm.java.AbstractJavacOptions.SpoolMode;

import com.facebook.buck.io.BuildCellRelativePath;
import com.facebook.buck.io.filesystem.ProjectFilesystem;
import com.facebook.buck.jvm.core.HasJavaAbi;
import com.facebook.buck.log.Logger;
import com.facebook.buck.model.BuildTarget;
import com.facebook.buck.rules.AddToRuleKey;
import com.facebook.buck.rules.AddsToRuleKey;
import com.facebook.buck.rules.BuildContext;
import com.facebook.buck.rules.BuildRule;
import com.facebook.buck.rules.BuildableContext;
import com.facebook.buck.rules.SourcePathResolver;
import com.facebook.buck.rules.SourcePathRuleFinder;
import com.facebook.buck.rules.Tool;
import com.facebook.buck.step.Step;
import com.facebook.buck.step.fs.MakeCleanDirectoryStep;
import com.facebook.buck.step.fs.SymlinkFileStep;
import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableList.Builder;
import com.google.common.collect.Iterables;
import java.nio.file.Path;
import java.util.Optional;
import javax.annotation.Nullable;

public class JavacToJarStepFactory extends CompileToJarStepFactory implements AddsToRuleKey {
  private static final Logger LOG = Logger.get(JavacToJarStepFactory.class);

  @AddToRuleKey private final Javac javac;
  @AddToRuleKey private JavacOptions javacOptions;
  @AddToRuleKey private final ExtraClasspathProvider extraClasspathProvider;

  public JavacToJarStepFactory(
      SourcePathResolver resolver,
      SourcePathRuleFinder ruleFinder,
      ProjectFilesystem projectFilesystem,
      Javac javac,
      JavacOptions javacOptions,
      ExtraClasspathProvider extraClasspathProvider) {
    super(resolver, ruleFinder, projectFilesystem);
    this.javac = javac;
    this.javacOptions = javacOptions;
    this.extraClasspathProvider = extraClasspathProvider;
  }

  public JavacPipelineState createPipelineState(
      BuildTarget invokingRule,
      CompilerParameters compilerParameters,
      @Nullable JarParameters abiJarParameters,
      @Nullable JarParameters libraryJarParameters) {
    final JavacOptions buildTimeOptions =
        javacOptions.withBootclasspathFromContext(extraClasspathProvider);

    return new JavacPipelineState(
        javac,
        buildTimeOptions,
        invokingRule,
        resolver,
        projectFilesystem,
        new ClasspathChecker(),
        compilerParameters,
        abiJarParameters,
        libraryJarParameters);
  }

  @Override
  public void createCompileStep(
      BuildContext context,
      BuildTarget invokingRule,
      CompilerParameters parameters,
      /* output params */
      Builder<Step> steps,
      BuildableContext buildableContext) {
    final JavacOptions buildTimeOptions =
        javacOptions.withBootclasspathFromContext(extraClasspathProvider);

    boolean generatingCode = !javacOptions.getAnnotationProcessingParams().isEmpty();
    if (generatingCode) {
      // Javac requires that the root directory for generated sources already exist.
      addAnnotationGenFolderStep(
          CompilerParameters.getAnnotationPath(projectFilesystem, invokingRule).get(),
          projectFilesystem,
          steps,
          buildableContext,
          context,
          null);
    }

    steps.add(
        new JavacStep(
            javac,
            buildTimeOptions,
            invokingRule,
            resolver,
            projectFilesystem,
            new ClasspathChecker(),
            parameters,
            null,
            null));
  }

  @Override
  protected Optional<String> getBootClasspath(BuildContext context) {
    JavacOptions buildTimeOptions =
        javacOptions.withBootclasspathFromContext(extraClasspathProvider);
    return buildTimeOptions.getBootclasspath();
  }

  @Override
  public Tool getCompiler() {
    return javac;
  }

  @Override
  public Iterable<BuildRule> getExtraDeps(SourcePathRuleFinder ruleFinder) {
    // If any dep of an annotation processor changes, we need to recompile, so we add those as
    // extra deps
    return Iterables.concat(
        super.getExtraDeps(ruleFinder),
        ruleFinder.filterBuildRuleInputs(javacOptions.getAnnotationProcessingParams().getInputs()));
  }

  public final void createPipelinedCompileToJarStep(
      BuildContext context,
      BuildTarget target,
      JavacPipelineState pipeline,
      ResourcesParameters resourcesParameters,
      ImmutableList<String> postprocessClassesCommands,
      Builder<Step> steps,
      BuildableContext buildableContext) {
    Preconditions.checkArgument(postprocessClassesCommands.isEmpty());
    CompilerParameters compilerParameters = pipeline.getCompilerParameters();

    if (!pipeline.isRunning()) {
      addCompilerSetupSteps(context, target, compilerParameters, resourcesParameters, steps);
    }

    Optional<JarParameters> jarParameters =
        HasJavaAbi.isLibraryTarget(target)
            ? pipeline.getLibraryJarParameters()
            : pipeline.getAbiJarParameters();

    if (jarParameters.isPresent()) {
      addJarSetupSteps(context, jarParameters.get(), steps);
    }

    // Only run javac if there are .java files to compile or we need to shovel the manifest file
    // into the built jar.
    if (!compilerParameters.getSourceFilePaths().isEmpty()) {
      recordDepFileIfNecessary(target, compilerParameters, buildableContext);

      // This adds the javac command, along with any supporting commands.
      createPipelinedCompileStep(context, pipeline, target, steps, buildableContext);
    }

    if (jarParameters.isPresent()) {
      addJarCreationSteps(compilerParameters, steps, buildableContext, jarParameters.get());
    }
  }

  @Override
  public void createCompileToJarStepImpl(
      BuildContext context,
      BuildTarget invokingRule,
      CompilerParameters compilerParameters,
      ImmutableList<String> postprocessClassesCommands,
      @Nullable JarParameters abiJarParameters,
      @Nullable JarParameters libraryJarParameters,
      /* output params */
      Builder<Step> steps,
      BuildableContext buildableContext) {
    Preconditions.checkArgument(
        libraryJarParameters == null
            || libraryJarParameters
                .getEntriesToJar()
                .contains(compilerParameters.getOutputDirectory()));

    String spoolMode = javacOptions.getSpoolMode().name();
    // In order to use direct spooling to the Jar:
    // (1) It must be enabled through a .buckconfig.
    // (2) The target must have 0 postprocessing steps.
    // (3) Tha compile API must be JSR 199.
    boolean isSpoolingToJarEnabled =
        compilerParameters.getAbiGenerationMode().isSourceAbi()
            || (postprocessClassesCommands.isEmpty()
                && javacOptions.getSpoolMode() == AbstractJavacOptions.SpoolMode.DIRECT_TO_JAR
                && javac instanceof Jsr199Javac);

    LOG.info(
        "Target: %s SpoolMode: %s Expected SpoolMode: %s Postprocessing steps: %s",
        invokingRule.getBaseName(),
        (isSpoolingToJarEnabled) ? (SpoolMode.DIRECT_TO_JAR) : (SpoolMode.INTERMEDIATE_TO_DISK),
        spoolMode,
        postprocessClassesCommands.toString());

    if (isSpoolingToJarEnabled) {
      final JavacOptions buildTimeOptions =
          javacOptions.withBootclasspathFromContext(extraClasspathProvider);
      boolean generatingCode = !buildTimeOptions.getAnnotationProcessingParams().isEmpty();
      if (generatingCode) {
        // Javac requires that the root directory for generated sources already exists.
        addAnnotationGenFolderStep(
            CompilerParameters.getAnnotationPath(projectFilesystem, invokingRule).get(),
            projectFilesystem,
            steps,
            buildableContext,
            context,
            null);
      }

      steps.add(
          new JavacStep(
              javac,
              buildTimeOptions,
              invokingRule,
              resolver,
              projectFilesystem,
              new ClasspathChecker(),
              compilerParameters,
              abiJarParameters,
              libraryJarParameters));
    } else {
      super.createCompileToJarStepImpl(
          context,
          invokingRule,
          compilerParameters,
          postprocessClassesCommands,
          null,
          libraryJarParameters,
          steps,
          buildableContext);
    }
  }

  public void createPipelinedCompileStep(
      BuildContext context,
      JavacPipelineState pipeline,
      BuildTarget invokingRule,
      Builder<Step> steps,
      BuildableContext buildableContext) {
    boolean generatingCode = !javacOptions.getAnnotationProcessingParams().isEmpty();
    if (generatingCode) {
      // Javac requires that the root directory for generated sources already exist.
      addAnnotationGenFolderStep(
          CompilerParameters.getAnnotationPath(projectFilesystem, invokingRule).get(),
          projectFilesystem,
          steps,
          buildableContext,
          context,
          pipeline);

      if (pipeline.isRunning()) {
        steps.add(
            SymlinkFileStep.of(
                projectFilesystem,
                CompilerParameters.getAnnotationPath(
                        projectFilesystem, HasJavaAbi.getSourceAbiJar(invokingRule))
                    .get(),
                CompilerParameters.getAnnotationPath(projectFilesystem, invokingRule).get()));
      }
    }

    steps.add(new JavacStep(pipeline, invokingRule));
  }

  private static void addAnnotationGenFolderStep(
      Path annotationGenFolder,
      ProjectFilesystem filesystem,
      Builder<Step> steps,
      BuildableContext buildableContext,
      BuildContext buildContext,
      @Nullable JavacPipelineState pipeline) {
    if (pipeline == null || !pipeline.isRunning()) {
      steps.addAll(
          MakeCleanDirectoryStep.of(
              BuildCellRelativePath.fromCellRelativePath(
                  buildContext.getBuildCellRootPath(), filesystem, annotationGenFolder)));
    }
    buildableContext.recordArtifact(annotationGenFolder);
  }

  @VisibleForTesting
  public JavacOptions getJavacOptions() {
    return javacOptions;
  }
}


text:
// Code generated by go-swagger; DO NOT EDIT.

// Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License"). You may
// not use this file except in compliance with the License. A copy of the
// License is located at
//
// 	http://aws.amazon.com/apache2.0/
//
// or in the "license" file accompanying this file. This file is distributed
// on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
// express or implied. See the License for the specific language governing
// permissions and limitations under the License.

package operations

// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command

import (
	"net/http"
	"time"

	"golang.org/x/net/context"

	"github.com/go-openapi/errors"
	"github.com/go-openapi/runtime"
	cr "github.com/go-openapi/runtime/client"

	strfmt "github.com/go-openapi/strfmt"

	client_models "github.com/firecracker-microvm/firecracker-go-sdk/client/models"
)

// NewCreateSyncActionParams creates a new CreateSyncActionParams object
// with the default values initialized.
func NewCreateSyncActionParams() *CreateSyncActionParams {
	var ()
	return &CreateSyncActionParams{

		timeout: cr.DefaultTimeout,
	}
}

// NewCreateSyncActionParamsWithTimeout creates a new CreateSyncActionParams object
// with the default values initialized, and the ability to set a timeout on a request
func NewCreateSyncActionParamsWithTimeout(timeout time.Duration) *CreateSyncActionParams {
	var ()
	return &CreateSyncActionParams{

		timeout: timeout,
	}
}

// NewCreateSyncActionParamsWithContext creates a new CreateSyncActionParams object
// with the default values initialized, and the ability to set a context for a request
func NewCreateSyncActionParamsWithContext(ctx context.Context) *CreateSyncActionParams {
	var ()
	return &CreateSyncActionParams{

		Context: ctx,
	}
}

// NewCreateSyncActionParamsWithHTTPClient creates a new CreateSyncActionParams object
// with the default values initialized, and the ability to set a custom HTTPClient for a request
func NewCreateSyncActionParamsWithHTTPClient(client *http.Client) *CreateSyncActionParams {
	var ()
	return &CreateSyncActionParams{
		HTTPClient: client,
	}
}

/*CreateSyncActionParams contains all the parameters to send to the API endpoint
for the create sync action operation typically these are written to a http.Request
*/
type CreateSyncActionParams struct {

	/*Info*/
	Info *client_models.InstanceActionInfo

	timeout    time.Duration
	Context    context.Context
	HTTPClient *http.Client
}

// WithTimeout adds the timeout to the create sync action params
func (o *CreateSyncActionParams) WithTimeout(timeout time.Duration) *CreateSyncActionParams {
	o.SetTimeout(timeout)
	return o
}

// SetTimeout adds the timeout to the create sync action params
func (o *CreateSyncActionParams) SetTimeout(timeout time.Duration) {
	o.timeout = timeout
}

// WithContext adds the context to the create sync action params
func (o *CreateSyncActionParams) WithContext(ctx context.Context) *CreateSyncActionParams {
	o.SetContext(ctx)
	return o
}

// SetContext adds the context to the create sync action params
func (o *CreateSyncActionParams) SetContext(ctx context.Context) {
	o.Context = ctx
}

// WithHTTPClient adds the HTTPClient to the create sync action params
func (o *CreateSyncActionParams) WithHTTPClient(client *http.Client) *CreateSyncActionParams {
	o.SetHTTPClient(client)
	return o
}

// SetHTTPClient adds the HTTPClient to the create sync action params
func (o *CreateSyncActionParams) SetHTTPClient(client *http.Client) {
	o.HTTPClient = client
}

// WithInfo adds the info to the create sync action params
func (o *CreateSyncActionParams) WithInfo(info *client_models.InstanceActionInfo) *CreateSyncActionParams {
	o.SetInfo(info)
	return o
}

// SetInfo adds the info to the create sync action params
func (o *CreateSyncActionParams) SetInfo(info *client_models.InstanceActionInfo) {
	o.Info = info
}

// WriteToRequest writes these params to a swagger request
func (o *CreateSyncActionParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {

	if err := r.SetTimeout(o.timeout); err != nil {
		return err
	}
	var res []error

	if o.Info != nil {
		if err := r.SetBodyParam(o.Info); err != nil {
			return err
		}
	}

	if len(res) > 0 {
		return errors.CompositeValidationError(res...)
	}
	return nil
}


text:
cc._currentProjectionMatrix = -1;
cc._vertexAttribPosition = false;
cc._vertexAttribColor = false;
cc._vertexAttribTexCoords = false;

if (cc.ENABLE_GL_STATE_CACHE) {
    cc.MAX_ACTIVETEXTURE = 16;

    cc._currentShaderProgram = -1;
    cc._currentBoundTexture = [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1];
    cc._blendingSource = -1;
    cc._blendingDest = -1;
    cc._GLServerState = 0;
    if(cc.TEXTURE_ATLAS_USE_VAO)
        cc._uVAO = 0;
}

// GL State Cache functions

/**
 * Invalidates the GL state cache.

 * If CC_ENABLE_GL_STATE_CACHE it will reset the GL state cache.
 */
cc.glInvalidateStateCache = function () {
    cc.kmGLFreeAll();
    cc._currentProjectionMatrix = -1;
    cc._vertexAttribPosition = false;
    cc._vertexAttribColor = false;
    cc._vertexAttribTexCoords = false;
    if (cc.ENABLE_GL_STATE_CACHE) {
        cc._currentShaderProgram = -1;
        for (var i = 0; i < cc.MAX_ACTIVETEXTURE; i++) {
            cc._currentBoundTexture[i] = -1;
        }
        cc._blendingSource = -1;
        cc._blendingDest = -1;
        cc._GLServerState = 0;
    }
};

/**
 * Uses the GL program in case program is different than the current one.

 * If CC_ENABLE_GL_STATE_CACHE is disabled, it will the glUseProgram() directly.
 * @param {WebGLProgram} program
 */
cc.glUseProgram = function (program) {
    if (program !== cc._currentShaderProgram) {
        cc._currentShaderProgram = program;
        cc._renderContext.useProgram(program);
    }
};

if(!cc.ENABLE_GL_STATE_CACHE){
    cc.glUseProgram = function (program) {
        cc._renderContext.useProgram(program);
    }
}

/**
 * Deletes the GL program. If it is the one that is being used, it invalidates it.

 * If CC_ENABLE_GL_STATE_CACHE is disabled, it will the glDeleteProgram() directly.
 * @param {WebGLProgram} program
 */
cc.glDeleteProgram = function (program) {
    if (cc.ENABLE_GL_STATE_CACHE) {
        if (program === cc._currentShaderProgram)
            cc._currentShaderProgram = -1;
    }
    gl.deleteProgram(program);
};

/**
 * Uses a blending function in case it not already used.

 * If CC_ENABLE_GL_STATE_CACHE is disabled, it will the glBlendFunc() directly.
 * @param {Number} sfactor
 * @param {Number} dfactor
 */
cc.glBlendFunc = function (sfactor, dfactor) {
    if ((sfactor !== cc._blendingSource) || (dfactor !== cc._blendingDest)) {
        cc._blendingSource = sfactor;
        cc._blendingDest = dfactor;
        cc.setBlending(sfactor, dfactor);
    }
};

cc.setBlending = function (sfactor, dfactor) {
    var ctx = cc._renderContext;
    if ((sfactor === ctx.ONE) && (dfactor === ctx.ZERO)) {
        ctx.disable(ctx.BLEND);
    } else {
        ctx.enable(ctx.BLEND);
        cc._renderContext.blendFunc(sfactor,dfactor);
        //TODO need fix for WebGL
        //ctx.blendFuncSeparate(ctx.SRC_ALPHA, dfactor, sfactor, dfactor);
    }
};

cc.glBlendFuncForParticle = function(sfactor, dfactor) {
    if ((sfactor !== cc._blendingSource) || (dfactor !== cc._blendingDest)) {
        cc._blendingSource = sfactor;
        cc._blendingDest = dfactor;
        var ctx = cc._renderContext;
        if ((sfactor === ctx.ONE) && (dfactor === ctx.ZERO)) {
            ctx.disable(ctx.BLEND);
        } else {
            ctx.enable(ctx.BLEND);
            //TODO need fix for WebGL
            ctx.blendFuncSeparate(ctx.SRC_ALPHA, dfactor, sfactor, dfactor);
        }
    }
};

if(!cc.ENABLE_GL_STATE_CACHE){
    cc.glBlendFunc = cc.setBlending;
};

/**
 * Resets the blending mode back to the cached state in case you used glBlendFuncSeparate() or glBlendEquation().

 * If CC_ENABLE_GL_STATE_CACHE is disabled, it will just set the default blending mode using GL_FUNC_ADD.
 */
cc.glBlendResetToCache = function () {
    var ctx = cc._renderContext;
    ctx.blendEquation(ctx.FUNC_ADD);
    if (cc.ENABLE_GL_STATE_CACHE)
        cc.setBlending(cc._blendingSource, cc._blendingDest);
    else
        cc.setBlending(ctx.BLEND_SRC, ctx.BLEND_DST);
};

/**
 * sets the projection matrix as dirty
 */
cc.setProjectionMatrixDirty = function () {
    cc._currentProjectionMatrix = -1;
};

/**
 *

 *    Will enable the vertex attribs that are passed as flags.

 *    Possible flags:

 *    cc.VERTEX_ATTRIB_FLAG_POSITION

 *    cc.VERTEX_ATTRIB_FLAG_COLOR

 *    cc.VERTEX_ATTRIB_FLAG_TEX_COORDS

 *

 *    These flags can be ORed. The flags that are not present, will be disabled.
 *

 * @param {cc.VERTEX_ATTRIB_FLAG_POSITION | cc.VERTEX_ATTRIB_FLAG_COLOR | cc.VERTEX_ATTRIB_FLAG_TEX_OORDS} flags
 */
cc.glEnableVertexAttribs = function (flags) {
    /* Position */
    var ctx = cc._renderContext;
    var enablePosition = ( flags & cc.VERTEX_ATTRIB_FLAG_POSITION );
    if (enablePosition !== cc._vertexAttribPosition) {
        if (enablePosition)
            ctx.enableVertexAttribArray(cc.VERTEX_ATTRIB_POSITION);
        else
            ctx.disableVertexAttribArray(cc.VERTEX_ATTRIB_POSITION);
        cc._vertexAttribPosition = enablePosition;
    }

    /* Color */
    var enableColor = (flags & cc.VERTEX_ATTRIB_FLAG_COLOR);
    if (enableColor !== cc._vertexAttribColor) {
        if (enableColor)
            ctx.enableVertexAttribArray(cc.VERTEX_ATTRIB_COLOR);
        else
            ctx.disableVertexAttribArray(cc.VERTEX_ATTRIB_COLOR);
        cc._vertexAttribColor = enableColor;
    }

    /* Tex Coords */
    var enableTexCoords = (flags & cc.VERTEX_ATTRIB_FLAG_TEX_COORDS);
    if (enableTexCoords !== cc._vertexAttribTexCoords) {
        if (enableTexCoords)
            ctx.enableVertexAttribArray(cc.VERTEX_ATTRIB_TEX_COORDS);
        else
            ctx.disableVertexAttribArray(cc.VERTEX_ATTRIB_TEX_COORDS);
        cc._vertexAttribTexCoords = enableTexCoords;
    }
};

/**
 * If the texture is not already bound, it binds it.

 * If CC_ENABLE_GL_STATE_CACHE is disabled, it will call glBindTexture() directly.
 * @param {cc.Texture2D} textureId
 */
cc.glBindTexture2D = function (textureId) {
    cc.glBindTexture2DN(0, textureId);
};

/**
 * If the texture is not already bound to a given unit, it binds it.

 * If CC_ENABLE_GL_STATE_CACHE is disabled, it will call glBindTexture() directly.
 * @param {Number} textureUnit
 * @param {cc.Texture2D} textureId
 */
cc.glBindTexture2DN = function (textureUnit, textureId) {
    if (cc._currentBoundTexture[textureUnit] == textureId)
        return;
    cc._currentBoundTexture[textureUnit] = textureId;

    var ctx = cc._renderContext;
    ctx.activeTexture(ctx.TEXTURE0 + textureUnit);
    if(textureId)
        ctx.bindTexture(ctx.TEXTURE_2D, textureId._webTextureObj);
    else
        ctx.bindTexture(ctx.TEXTURE_2D, null);
};
if (!cc.ENABLE_GL_STATE_CACHE){
    cc.glBindTexture2DN = function (textureUnit, textureId) {
        var ctx = cc._renderContext;
        ctx.activeTexture(ctx.TEXTURE0 + textureUnit);
        if(textureId)
            ctx.bindTexture(ctx.TEXTURE_2D, textureId._webTextureObj);
        else
            ctx.bindTexture(ctx.TEXTURE_2D, null);
    };
}

/**
 * It will delete a given texture. If the texture was bound, it will invalidate the cached.

 * If CC_ENABLE_GL_STATE_CACHE is disabled, it will call glDeleteTextures() directly.
 * @param {WebGLTexture} textureId
 */
cc.glDeleteTexture = function (textureId) {
    cc.glDeleteTextureN(0, textureId);
};

/**
 * It will delete a given texture. If the texture was bound, it will invalidate the cached for the given texture unit.

 * If CC_ENABLE_GL_STATE_CACHE is disabled, it will call glDeleteTextures() directly.
 * @param {Number} textureUnit
 * @param {WebGLTexture} textureId
 */
cc.glDeleteTextureN = function (textureUnit, textureId) {
    if (cc.ENABLE_GL_STATE_CACHE) {
        if (textureId == cc._currentBoundTexture[ textureUnit ])
            cc._currentBoundTexture[ textureUnit ] = -1;
    }
    cc._renderContext.deleteTexture(textureId);
};

/**
 * If the vertex array is not already bound, it binds it.

 * If CC_ENABLE_GL_STATE_CACHE is disabled, it will call glBindVertexArray() directly.
 * @param vaoId
 */
cc.glBindVAO = function (vaoId) {
    if (!cc.TEXTURE_ATLAS_USE_VAO)
        return;

    if (cc.ENABLE_GL_STATE_CACHE) {
        if (cc._uVAO != vaoId) {
            cc._uVAO = vaoId;
            //TODO need fixed
            //glBindVertexArray(vaoId);
        }
    } else {
        //glBindVertexArray(vaoId);
    }
};

/**
 * It will enable / disable the server side GL states.

 * If CC_ENABLE_GL_STATE_CACHE is disabled, it will call glEnable() directly.
 * @param {Number} flags
 */
cc.glEnable = function (flags) {
    if (cc.ENABLE_GL_STATE_CACHE) {
        /*var enabled;

         */
        /* GL_BLEND */
        /*
         if ((enabled = (flags & cc.GL_BLEND)) != (cc._GLServerState & cc.GL_BLEND)) {
         if (enabled) {
         cc._renderContext.enable(cc._renderContext.BLEND);
         cc._GLServerState |= cc.GL_BLEND;
         } else {
         cc._renderContext.disable(cc._renderContext.BLEND);
         cc._GLServerState &= ~cc.GL_BLEND;
         }
         }*/
    } else {
        /*if ((flags & cc.GL_BLEND))
         cc._renderContext.enable(cc._renderContext.BLEND);
         else
         cc._renderContext.disable(cc._renderContext.BLEND);*/
    }
};


text:
package api

import (
	"strings"
	"testing"
)

func TestOperator_RaftGetConfiguration(t *testing.T) {
	c, s := makeClient(t, nil, nil)
	defer s.Stop()

	operator := c.Operator()
	out, err := operator.RaftGetConfiguration(nil)
	if err != nil {
		t.Fatalf("err: %v", err)
	}
	if len(out.Servers) != 1 ||
		!out.Servers[0].Leader ||
		!out.Servers[0].Voter {
		t.Fatalf("bad: %v", out)
	}
}

func TestOperator_RaftRemovePeerByAddress(t *testing.T) {
	c, s := makeClient(t, nil, nil)
	defer s.Stop()

	// If we get this error, it proves we sent the address all the way
	// through.
	operator := c.Operator()
	err := operator.RaftRemovePeerByAddress("nope", nil)
	if err == nil || !strings.Contains(err.Error(),
		"address \"nope\" was not found in the Raft configuration") {
		t.Fatalf("err: %v", err)
	}
}


text:
title: Installing RavenDB
summary: Article outlines various ways of installing RavenDB in different versions of NServiceBus. As of version 5 it is mostly obsolete due to the fact that RavenDB is no longer part of the core.
tags:
- Persistence
- RavenDB
redirects:
 - nservicebus/using-ravendb-in-nservicebus-installing
---

Starting from NServiceBus version 5.0 RavenDB is no longer the default persistence option in NServiceBus. A user has to explicitly select persistence. For more information, on the various available persistence options, please read: [Persistence in NServiceBus](/nservicebus/persistence/).

RavenDB-related code has been moved to a separate package  [NServiceBus.RavenDB](https://www.nuget.org/packages/NServiceBus.RavenDB) and it is up to a user to install the RavenDB server from the [official download page](http://ravendb.net/download) following instructions on RavenDB website.

NServiceBus version 4.x and 3.x used RavenDB for persistence by default. The NServiceBus license permits the use of RavenDB for the storage needs of your endpoint. This only includes NServiceBus-related data such as sagas and subscriptions. If you store application-specific data in RavenDB you need to purchase a separate license.

To use the default storage, ensure you have a RavenDB server running to which your endpoint can connect. To set up RavenDB [Download](http://ravendb.net/download) and install it yourself.

## NServiceBus auto-installation of RavenDB

**NServiceBus Versions 5.x:** RavenDB is no longer auto-installed.

**NServiceBus Versions 4.x:** The /installinfrastructure has been deprecated in version 4.0 and above on NServiceBus.Host, and NServiceBus now expects RavenDB instance to be pre-installed and accessible to it. Use the [powershell commandlets](/nservicebus/operations/management-using-powershell.md) to install RavenDB on the needed servers. When the endpoints starts up, if the host is configured for RavenDB persistence and if the configured RavenDB persistence could not be contacted, then warnings will be logged.

**NServiceBus Versions 3.x:** RavenDB is included with the NServiceBus binaries (not ilmerged). When using the `/installinfrastructure` switch on the NServiceBus.Host at install time, the infrastructure installer ensures that RavenDB is installed on the local machine. The install is only performed if the following is true:

-   RavenDB persistence is configured for the endpoint
-   A custom connection string is not specified by the user
-   The current endpoint has no master node specified
-   Port 8080 is available
-   RavenDB is not already installed

\*When a master node is defined, NServiceBus understands that all data will be stored on that designated server  instead. This means that the RavenDB server runs on that remote machine and not the local machine where you run the install.

For instructions on how to administrate and operate a RavenDB server, refer to the [documentation for RavenDB](http://ravendb.net/search?q=server-administration).

## Upgrading RavenDB

To upgrade an existing RavenDB installation refer to the [RavenDB website article describing the upgrade process](http://ravendb.net/search?q=server-administration%20upgrade).

Note it is highly recommended that you backup your Raven database prior to upgrading.

## Which versions of RavenDB are compatible?

For a more detailed overview over the compatibility to RavenDB see also the [version compatibility](/nservicebus/ravendb/version-compatibility.md) documentation.

[NServiceBus.RavenDB](https://www.nuget.org/packages/NServiceBus.RavenDB) greater or equal version 3.0.0 requires RavenDB version 3.0 build 3660 or higher build number for version 3.0.

[NServiceBus.RavenDB](https://www.nuget.org/packages/NServiceBus.RavenDB) smaller than version 3.0.0 requires RavenDB version 2.5 build 2908 or higher build number for version 2.5.

NOTE: If you already have RavenDB 2.0 installed from a previous NServiceBus version 4.0 or prior version and want to run version 2.5, you can uninstall the service by finding the Raven.Server.exe executable on your machine and running it from the command line with /uninstall. [Read this document](uninstalling-v4.md) for full removal instructions. Note that the version 2.5 download will be unlicensed, so you will need to either copy the license.xml file from the version 2.0 installation folder to the version 2.5 installation folder, contact Particular Software and request a version 2.5 license file, or use your own license file.

NServiceBus version 4.0 is tested and compatible with RavenDB version 2261 and RavenDB version 2.

NServiceBus version 3.X is tested and compatible with all RavenDB versions from version 616 through version 992 and RavenDB version 1. We strongly recommend using version 992 since it has better support for transaction recovery. Download version 992 here: [RavenDB Server - 992](http://hibernatingrhinos.com/builds/ravendb-stable-v1.0/992).

For more information regarding RavenDB compatibility, please refer to [this article](version-compatibility.md) and the [RavenDB website](http://ravendb.net/search?q=client-api%20backward-compatibility).


text:
<!DOCTYPE html>

    <title>CSS Transforms Test: SVG presentation attribute and translate with translation-value and unit less arguments in scientific notation</title>
    <link rel="author" title="Rebecca Hauck" href="mailto:rhauck@adobe.com">
    <link rel="help" href="http://www.w3.org/TR/css-transforms-1/#svg-transform">
    <link rel="help" href="http://www.w3.org/TR/css-transforms-1/#svg-transform-value">
    <link rel="help" href="http://www.w3.org/TR/css-transforms-1/#svg-number">
    <link rel="help" href="http://www.w3.org/TR/css-transforms-1/#two-d-transform-functions">
		<link rel="help" href="http://www.w3.org/TR/css-transforms-1/#funcdef-transform-translate">
    <link rel="match" href="reference/svg-translate-ref.html">
    <meta name="flags" content="svg">
    <meta name="assert" content="The translate transform function must support unit less arguments in scientific numbers for translation-value. The rect in the test should be moved 50 pixels in the X direction and 50 pixels in the Y direction">

The test passes if there is a green square and no red.

    <svg>
        <rect x="51" y="51" width="98" height="98" fill="red"/>
        <rect width="100" height="100" fill="green" transform="translate(5.0e1 5.0e1)"/>
    </svg>


text:
/**
 * $Id: PresenceHandlerImpl.java,v 1.0 Apr 12, 2009 2:39:39 PM Jason Exp $
 */
package com.fruits.livechat.xmpp.protocal;

import com.fruits.livechat.xmpp.Package;

/**
 * @author Jason Tang
 */
public class PresenceHandlerImpl implements PackageHandler {

	public PresenceHandlerImpl() {
		// TODO: XXX
	}

	public void handle(Package pkg) throws Exception {
	}

	public PackageHandler nextHandler() {
		return null;
	}

}


text:
from django.contrib import admin
from blog.models import Post

class PostAdmin(admin.ModelAdmin):
  # fields display on change list
  list_display = ['title', 'description']
  # fields to filter the change list with
  list_filter = ['published', 'created']
  # fields to search in change list
  search_fields = ['title', 'description', 'content']
  # enable the date drill down on change list
  date_hierarchy = 'created'
  # enable the save buttons on top on change form
  save_on_top = True
  # prepopulate the slug from the title - big timesaver!
  prepopulated_fields = {"slug": ("title",)}

admin.site.register(Post,PostAdmin)


text:
=begin
INTRODUCTION
This little tool allows to automatically serialize files of the desired extensions located in the project folder.
In addition, modifications of the load/require methods are provided in order to:

    * Build those files into the RGSS interpreter (for script files).
    * Convert them into an array of lines (for text files).

Note that this only works in debug mode.

INSTRUCTIONS
Very easy to use. Place the script on the top of the editor (below the F12 fix or Pause script if you are using them).
Then configure which extensions you want to serialize.
You'll just have to call the appropriate methods for any particular later use.
=end

EXTENSIONS = ['.rb', '.txt']

if $DEBUG
  dirname = File.expand_path('./Game.exe')
  dirname.slice!('Game.exe')
  Dir.entries(dirname).each {|filename|
    next if ['.', '..'].include?(filename)
    if EXTENSIONS.include?(File.extname(filename))
      File.open(filename, 'rb') {|file| save_data(file.readlines.join, 'Data/' + filename)}
    end
  }
end

module Kernel
  class << self
    alias_method :kread_special_require, :require
    #--------------------------------------------------------------------------
    # * Require
    #--------------------------------------------------------------------------
    def require(filename)
      path = "Data/#{filename}"
      file = self.load_data(path)
      File.open('temp.rb', 'wb') {|newf| newf.write(file)}
      file = nil
      kread_special_require(File.expand_path('./temp.rb'))
      File.delete('temp.rb')
    end
    alias_method :kread_special_load, :load
    #--------------------------------------------------------------------------
    # * Load
    #--------------------------------------------------------------------------
    def load(filename)
      path = "Data/#{filename}"
      file = self.load_data(path)
      File.open('temp.rb', 'wb') {|newf| newf.write(file)}
      file = nil
      kread_special_load(File.expand_path('./temp.rb'))
      File.delete('temp.rb')
    end
    #--------------------------------------------------------------------------
    # * Load text files
    #--------------------------------------------------------------------------
    def load_text_file
      path = "Data/#{filename}"
      file = self.load_data(path)
      File.open('temp.txt', 'wb') {|newf| newf.write(file)}
      file = nil
      text_file = File.open('temp.txt', 'rb')
      array = text_file.readlines
      text_file.close
      File.delete('temp.txt')
      return array
    end
  end
end


text:
#import <IDEFindReplace/IDEBatchFindScopeRuleRow.h>

@class NSArray, NSTextField;

@interface IDEBatchFindScopeFileTypeRow : IDEBatchFindScopeRuleRow
{
    NSArray *_types;
    NSArray *_typeTitles;
    NSTextField *_otherTextField;
}

@property(readonly) NSArray *types; // @synthesize types=_types;
- (void).cxx_destruct;
- (id)criteriaNodesForMatchingPredicate:(id)arg1;
- (id)predicateForIndexPath:(id)arg1;
- (id)displayValueForPath:(id)arg1;
- (long long)childCountForIndexPath:(id)arg1;
- (unsigned long long)hash;
- (BOOL)isEqual:(id)arg1;
- (id)copyWithZone:(struct _NSZone *)arg1;
- (id)initWithFileTypes:(id)arg1 andTypeTitles:(id)arg2;

@end


text:
 * ruby 1.8, 1.9, 2.0 or mruby

## Usage

### mruby

Add the following lines to build_conf.rb and make.

```ruby
  conf.gem :git => 'https://github.com/iij/mruby-io.git'
  conf.gem :git => 'https://github.com/iij/mruby-socket.git'
  conf.gem :git => 'https://github.com/iij/mruby-pack.git'
  conf.gem :git => 'https://github.com/iij/msnmp.git'
```

There is a sample implementation of a snmpbulkwalk command.

    mruby bin/msnmpwalk -v 2c -c public host.example.com system

### ruby

install

    gem install msnmp

run

    msnmpwalk -v 2c -c public host.example.com system


text:
description("Tests dynamic updates of the 'result' propert of the SVGFilterPrimitiveStandardAttributes object")
createSVGTestCase();

var pointLight = createSVGElement("fePointLight");
pointLight.setAttribute("x", "100");
pointLight.setAttribute("y", "100");
pointLight.setAttribute("z", "30");

var gradientElement = createSVGElement("feDiffuseLighting");
gradientElement.setAttribute("in", "SourceGraphic");
gradientElement.setAttribute("diffuseConstant", "1");
gradientElement.setAttribute("lighting-color", "yellow");
gradientElement.setAttribute("x", "0");
gradientElement.setAttribute("y", "0");
gradientElement.setAttribute("width", "200");
gradientElement.setAttribute("height", "200");
gradientElement.setAttribute("result", "res1");
gradientElement.appendChild(pointLight);

var offsetElement = createSVGElement("feOffset");
offsetElement.setAttribute("in", "res2");

var filterElement = createSVGElement("filter");
filterElement.setAttribute("id", "myFilter");
filterElement.setAttribute("filterUnits", "userSpaceOnUse");
filterElement.setAttribute("x", "0");
filterElement.setAttribute("y", "0");
filterElement.setAttribute("width", "200");
filterElement.setAttribute("height", "200");
filterElement.appendChild(gradientElement);
filterElement.appendChild(offsetElement);

var defsElement = createSVGElement("defs");
defsElement.appendChild(filterElement);

rootSVGElement.appendChild(defsElement);

var rectElement = createSVGElement("rect");
rectElement.setAttribute("x", "0");
rectElement.setAttribute("y", "0");
rectElement.setAttribute("width", "200");
rectElement.setAttribute("height", "200");
rectElement.setAttribute("filter", "url(#myFilter)");
rootSVGElement.appendChild(rectElement);

shouldBeEqualToString("gradientElement.result.baseVal", "res1");

function repaintTest() {
    gradientElement.result.baseVal = "res2";
    shouldBeEqualToString("gradientElement.result.baseVal", "res2");

    completeTest();
}

var successfullyParsed = true;


text:
<!DOCTYPE html>

  <meta charset="utf-8">

  <meta name="viewport" content="width=device-width, initial-scale=1.0">

  <meta http-equiv="X-UA-Compatible" content="IE=edge">

  <title>The Whisper</title>
  <meta name="description" content="The Whisper(Fiction,2 minute read)The man was acutely aware of the sweat beads forming on his temples. He was pretty sure his shirt was wet. A quick sniff of his armpits confirmed his suspicions. T..." />

  <meta name="HandheldFriendly" content="True" />
  <meta name="MobileOptimized" content="320" />
  <meta name="apple-mobile-web-app-capable" content="yes">
  <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">

  <meta property="og:site_name" content="The Wordsmiths" />
  <meta property="og:title" content="The Whisper"/>

  <meta property="og:description" content="The Whisper(Fiction,2 minute read)The man was acutely aware of the sweat beads forming on his temples. He was pretty sure his shirt was wet. A quick sniff of his armpits confirmed his suspicions. T..." />

  <meta property="og:image" content="http://thewordsmiths.xyz/assets/article_images/the-whisper.jpg" />
  <meta property="og:url" content="http://thewordsmiths.xyz/fiction/2016/07/16/the-whisper.html" >
  <meta property="og:type" content="blog" />
  <meta property="article:published_time" content="2016-07-16T02:00:00+05:30">

  <link rel="canonical" href="http://thewordsmiths.xyz/fiction/2016/07/16/the-whisper.html"/>
  <link rel="shortcut icon" href="/assets/images/favicon.png" type="image/png"/>
  <link rel="stylesheet" href="//brick.a.ssl.fastly.net/Linux+Libertine:400,400i,700,700i/Open+Sans:400,400i,700,700i">
  <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">

  <link rel="stylesheet" type="text/css" media="screen" href="/css/main.css" />
  <link rel="stylesheet" type="text/css" media="print" href="/css/print.css" />

<meta name="google-site-verification" content="mVcFILv0mVEEkKbSOT_EuekNv-T2Y6qr05VNkIqR42k" />

            Article Image

            Article Image

The Whisper

Blog Logo

Harsh Pandey

              on
              <time datetime="2016-07-16 02:00">16 Jul 2016</time>
              , tagged on
                Fiction

             read

The Whisper

(Fiction,2 minute read)

The man was acutely aware of the sweat beads forming on his temples. He was pretty sure his shirt was wet. A quick sniff of his armpits confirmed his suspicions. The man took a deep breath and grabbed the doorknob. The steel knob was starkly cold to touch. The air conditioner kept the entire office to a comfortable 22 degrees, but it was not like his sweat glands gave a damn. He turned it. The brown door swung in without a sound. It was a very ordinary brown door, but there was pair of gray bolts that held up the cheap metal plaque upon the ordinary brown door. The metal plaque read Manager. The cheap metal plaque turned the ordinary brown door into something extraordinary. The Manager was sitting comfortably in her large ergonomic leather chair. She was tapping her finger on the desk while staring at the laptop screen. Ma’am? She looked at him and gestured him to sit. The man closed the door behind him.

The extraordinary brown door opened soundlessly. The man’s shirt was absolutely drenched. The walk back to his office seemed to stretch on forever. His office welcomed him with the ordinary brown door. The ordinary brown door opened noiselessly and closed with a slam. He sat at his desk and looked out of the window. The window was not particularly large and the view wasn’t much, just some apartment buildings and a quiet street, but he loved it. The man scouted his favourite houses for activity. He liked to look at people’s lives from afar, the vicarious spectator. Even the most mundane of jobs seemed most amusing.

Suddenly, his eyes froze. The man’s head froze and he felt the beads of sweat roll down from his temples to his cheeks. He was fixated on the house on the fifth floor.

The girl was standing on the balcony railing. She was looking down, probably gauging how far down it was. The man stared at her brainlessly, mesmerised, afraid. His trembling hands raised the telephone. He had to dial the emergency. The other hand searched for the keypad while the eyes remained fixated on the girl. He couldn’t see her emotions from this far off. Was she crying? The man looked harder, stunned, mesmerised. The man felt empty. The man felt inhuman. The man felt.. What did he feel. The man wondered. The fingers wandered around the keypad, not shaking anymore, the phone no longer raised.

The girl jumped.

His eyes didn’t leave her.

The man gathered his things, put them in a box and looked out of the window for the last time.

The ordinary brown door opened noiselessly and closed like a whisper.

- Harsh Pandey

Category

                Fiction

            Share this article!

                facebook

          Next Post: When The Fuckboy Falls in Love  →

Written by

Blog Logo

Harsh Pandey

Published <time datetime="2016-07-16 02:00">16 Jul 2016</time>

Social

               Follow the goodness

              ·

              ·

              ·

        Image

The Wordsmiths

Blog and Content Production Company

        Back to Overview


text:
package com.ltdev.cc.puzzles.logic;

public class Gate
{
    /**
     * An enum of the different types of logic gates.
     * @author Lightning Development Studios
     */
    public enum GateType
    {
        NONE,
        AND,
        OR,
        XOR,
        NOT,
        NAND,
        NOR,
        XNOR
    }

	protected GateType type;
	protected Gate[] input;
	protected Gate output;

	private boolean currentState;

	public Gate(GateType type, float posX, float posY)
	{
		this.type = type;

		switch (type)
		{
			case AND:
			case OR:
			case XOR:
			case NAND:
			case NOR:
			case XNOR:
				input = new Gate[2];
				break;

			case NOT:
				input = new Gate[1];
				//false
				break;
        default:
            break;
		}
	}

	public boolean getState()
	{
		return currentState;
	}
	public void update()
	{
		boolean[] inputStates = new boolean[input.length];

		for (int i = 0; i < input.length; i++)
		{
			inputStates[i] = input[i].getState();
		}

		switch (type)
		{
			case AND:
				if (inputStates[0] && inputStates[1])
					currentState = true;
				else
					currentState = false;
				break;

			case OR:
				if (inputStates[0] || inputStates[1])
					currentState = true;
				else
					currentState = false;
				break;

			case XOR:
				if (inputStates[0] != inputStates[1])
					currentState = true;
				else
					currentState = false;
				break;

			case NAND:
				if (!inputStates[0] || !inputStates[1])
					currentState = true;
				else
					currentState = false;
				break;

			case NOR:
				if (!(inputStates[0] || inputStates[1]))
					currentState = true;
				else
					currentState = false;
				break;

			case XNOR:
				if (inputStates[0] == inputStates[1])
					currentState = true;
				else
					currentState = false;
				break;

			case NOT:
				if (!inputStates[0])
					currentState = true;
				else
					currentState = false;
				break;
			default:
		}

		output.update();
	}
}


text:
package main

import "fmt"

// NOTE:to make a slice use make(<type>, <len>, <cap>)

func main() {
	myCourse := make([]int, 5, 10) //NOTE: Doesn't initialize the slice values
	fmt.Println(myCourse)
	fmt.Printf("Length is %d.\nCpacity is: %d\n", len(myCourse), cap(myCourse))
	anotherCourse := []string{"Docker", "Windows", "Linux"} //NOTE: Initialize the slice without make and assign values in one line
	fmt.Println(anotherCourse)
	fmt.Printf("Length is %d.\nCpacity is: %d\n", len(anotherCourse), cap(anotherCourse))
	mySlice := []int{1, 2, 3, 4, 5, 6, 7, 8, 9, 0}
	fmt.Println(mySlice[4])
	newSlice := mySlice[2:5]
	fmt.Println(newSlice)

	//Expending a slice
	appendedSlice := append(newSlice, 1)
	//NOTE: Double the capcity when the original capacity is not enough in go.
	fmt.Printf("Length is %d.\nCpacity is: %d\n", len(appendedSlice), cap(appendedSlice))

	for _, i := range appendedSlice {
		fmt.Println("For range loop:", i)
	}
	// NOTE: How to append a slice to another slice
	myNewSlice := append(mySlice, newSlice...)
	fmt.Println(myNewSlice)

}


text:
/******************************************************************************
 *
 * You may not use the identified files except in compliance with The MIT
 * License (the "License.")
 *
 * You may obtain a copy of the License at
 * https://github.com/oracle/Oracle.NET/blob/master/LICENSE
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 *****************************************************************************/

using System;
using System.Data;
using System.Text;
using Oracle.ManagedDataAccess.Client;
using Oracle.ManagedDataAccess.Types;

namespace Sample4
{
  /// <summary>
  /// Sample 4: Demonstrates how the LOB column data can be
  ///           read as a .NET type by utilizing stream reads.
  /// </summary>l
  class Sample4
  {
    /// <summary>
    /// The main entry point for the application.
    /// </summary>
    static void Main(string[] args)
    {
      // Connect
      string constr = "User Id=scott;Password=<PASSWORD>;Data Source=oracle";
      OracleConnection con = Connect(constr);

      // Setup
      Setup(con);

      // Set the command
      OracleCommand cmd = new OracleCommand(
        "select story from multimedia_tab where thekey = 1");
      cmd.Connection = con;
      cmd.CommandType = CommandType.Text;

      OracleDataReader reader;
      try
      {
        // Create DataReader
        reader = cmd.ExecuteReader();

        // Read the first row
        while(reader.Read())
        {
          // Set the OracleClob object to the CLOB selected
          OracleClob clob = reader.GetOracleClob(0);

          // Read data all data
          Byte [] clob_data = new Byte[120];
          Int64 amountRead = 0;
          int readSize = 8;
          Int64 totalRead = 0;

          do
          {
            amountRead = clob.Read(clob_data, (int)totalRead, readSize);
            Console.WriteLine("Actual read: {0} bytes", amountRead);
            totalRead += amountRead;
          } while(amountRead > 0);

          Console.WriteLine("Total number of bytes read: {0}", totalRead);

          // Dispose OracleClob object
          clob.Dispose();
        }
      }
      catch (Exception e)
      {
        Console.WriteLine("Exception:" + e.Message);
      }
      finally
      {
        // Dispose OracleCommand object
        cmd.Dispose();

        // Close and Dispose OracleConnection object
        con.Close();
        con.Dispose();
      }
		}

    /// <summary>
    /// Wrapper for Opening a new Connection
    /// </summary>
    /// <param name="connectStr"></param>
    /// <returns></returns>
    public static OracleConnection Connect(string connectStr)
    {
      OracleConnection con = new OracleConnection(connectStr);
      try
      {
        con.Open();
      }
      catch (Exception e)
      {
        Console.WriteLine("Error: {0}", e.Message);
      }
      return con;
    }

    /// <summary>
    /// Setup the necessary Tables & Test Data
    /// </summary>
    /// <param name="connectStr"></param>
    public static void Setup(OracleConnection con)
    {
      StringBuilder blr;
      OracleCommand cmd = new OracleCommand("", con);

      blr = new StringBuilder();
      blr.Append("DROP TABLE multimedia_tab");
      cmd.CommandText = blr.ToString();
      try
      {
        cmd.ExecuteNonQuery();
      }
      catch
      {
      }

      blr = new StringBuilder();
      blr.Append("CREATE TABLE multimedia_tab(thekey NUMBER(4) PRIMARY KEY,");
      blr.Append("story CLOB, sound BLOB)");
      cmd.CommandText = blr.ToString();
      try
      {
        cmd.ExecuteNonQuery();
      }
      catch (Exception e)
      {
        Console.WriteLine("Error: {0}", e.Message);
      }

      blr = new StringBuilder();
      blr.Append("INSERT INTO multimedia_tab values(");
      blr.Append("1,");
      blr.Append("'This is a long story. Once upon a time ...',");
      blr.Append("'656667686970717273747576777879808182838485')");
      cmd.CommandText = blr.ToString();
      try
      {
        cmd.ExecuteNonQuery();
      }
      catch (Exception e)
      {
        Console.WriteLine("Error: {0}", e.Message);
      }
    }
  }
}


text:
package main

import "fmt"

func main() {
	states := make(map[string]string)
	states["AK"] = "Alaska"
	states["CA"] = "California"
	states["FL"] = "Florida"

	fmt.Println(states["CA"])

	// Print all states
	for _, value := range states {
		fmt.Println(value)
	}
}


text:
namespace viz {

namespace {

class TestSurfaceOzoneCanvas : public ui::SurfaceOzoneCanvas {
 public:
  TestSurfaceOzoneCanvas() = default;
  ~TestSurfaceOzoneCanvas() override = default;

  // ui::SurfaceOzoneCanvas override:
  SkCanvas* GetCanvas() override { return surface_->getCanvas(); }
  void ResizeCanvas(const gfx::Size& viewport_size, float scale) override {
    surface_ = SkSurface::MakeRaster(SkImageInfo::MakeN32Premul(
        viewport_size.width(), viewport_size.height()));
  }
  std::unique_ptr<gfx::VSyncProvider> CreateVSyncProvider() override {
    return nullptr;
  }

  MOCK_METHOD1(PresentCanvas, void(const gfx::Rect& damage));

 private:
  sk_sp<SkSurface> surface_;
};

}  // namespace

class SoftwareOutputDeviceOzoneTest : public testing::Test {
 public:
  SoftwareOutputDeviceOzoneTest();
  ~SoftwareOutputDeviceOzoneTest() override;
  SoftwareOutputDeviceOzoneTest(const SoftwareOutputDeviceOzoneTest&) = delete;
  SoftwareOutputDeviceOzoneTest& operator=(
      const SoftwareOutputDeviceOzoneTest&) = delete;

  void SetUp() override;
  void TearDown() override;

 protected:
  std::unique_ptr<SoftwareOutputDeviceOzone> output_device_;
  bool enable_pixel_output_ = false;

  raw_ptr<TestSurfaceOzoneCanvas> surface_ozone_ = nullptr;
};

SoftwareOutputDeviceOzoneTest::SoftwareOutputDeviceOzoneTest() = default;
SoftwareOutputDeviceOzoneTest::~SoftwareOutputDeviceOzoneTest() = default;

void SoftwareOutputDeviceOzoneTest::SetUp() {
  std::unique_ptr<TestSurfaceOzoneCanvas> surface_ozone =
      std::make_unique<TestSurfaceOzoneCanvas>();
  surface_ozone_ = surface_ozone.get();
  output_device_ = std::make_unique<SoftwareOutputDeviceOzone>(
      nullptr, std::move(surface_ozone));
}

void SoftwareOutputDeviceOzoneTest::TearDown() {
  output_device_.reset();
}

TEST_F(SoftwareOutputDeviceOzoneTest, CheckCorrectResizeBehavior) {
  constexpr gfx::Size size(200, 100);
  // Reduce size.
  output_device_->Resize(size, 1.f);

  constexpr gfx::Rect damage1(0, 0, 100, 100);
  SkCanvas* canvas = output_device_->BeginPaint(damage1);
  ASSERT_TRUE(canvas);
  gfx::Size canvas_size(canvas->getBaseLayerSize().width(),
                        canvas->getBaseLayerSize().height());
  EXPECT_EQ(size, canvas_size);
  EXPECT_CALL(*surface_ozone_, PresentCanvas(damage1)).Times(1);
  output_device_->EndPaint();

  constexpr gfx::Size size2(1000, 500);
  // Increase size.
  output_device_->Resize(size2, 1.f);

  constexpr gfx::Rect damage2(0, 0, 50, 60);
  canvas = output_device_->BeginPaint(damage2);
  canvas_size.SetSize(canvas->getBaseLayerSize().width(),
                      canvas->getBaseLayerSize().height());
  EXPECT_EQ(size2, canvas_size);
  EXPECT_CALL(*surface_ozone_, PresentCanvas(damage2)).Times(1);
  output_device_->EndPaint();
}

}  // namespace viz


text:
[![Build Status](https://travis-ci.org/shakna-israel/frankenword.svg)](https://travis-ci.org/shakna-israel/frankenword)
![Dependencies Status](https://david-dm.org/shakna-israel/frankenword.svg)
[![npm version](https://badge.fury.io/js/frankenword.svg)](http://badge.fury.io/js/frankenword)

# Frankenword

npm module to check for frankenwords in your writing.

## Install

```shell
npm install frankenword
```

## Use

```javascript
var frankenword = require('frankenword');

var problems = frankenword('Frankenwords are the bane of the modern writer, backronyms and couplies are all invented words.');
```


text:
package com.github.xbest.behavioral.iterator;

import java.util.Iterator;

/**
 * Created by link on 2017/3/4.
 */
public class Client {
    public static void main(String[] args) {
        PersonList personList = new DefaultPersonList();
        Iterator iterator = personList.iterator();
        while (iterator.hasNext()) {
            System.out.println(iterator.next().toString());
        }
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <string name="pref_key_round_enable" translatable="false">PREF_KEY_ROUND_ENABLE</string>
    <string name="pref_key_start_on_boot" translatable="false">PREF_KEY_START_ON_BOOT</string>

    <string name="pref_cate_key_appearance" translatable="false">PREF_CATE_KEY_APPEARANCE</string>
    <string name="pref_key_round_size" translatable="false">PREF_KEY_ROUND_SIZE</string>
    <string name="pref_key_round_color" translatable="false">PREF_KEY_ROUND_COLOR</string>
    <string name="pref_key_round_top_left" translatable="false">PREF_KEY_ROUND_TOP_LEFT</string>
    <string name="pref_key_round_top_right" translatable="false">PREF_KEY_ROUND_TOP_RIGHT</string>
    <string name="pref_key_round_bottom_left" translatable="false">PREF_KEY_ROUND_BOTTOM_LEFT</string>
    <string name="pref_key_round_bottom_right" translatable="false">PREF_KEY_ROUND_BOTTOM_RIGHT</string>

    <string name="pref_key_github" translatable="false">PREF_KEY_GITHUB</string>
</resources>


text:
var pilihan=[];
pilihan[0] = "satu";
pilihan[1] = "dua";

function tambahSelect(namaDiv){
    var newDiv = document.createElement('div');
    var selectHTML = "";
    selectHTML = "<select>";
    for (i = 0; i < pilihan.length; i++){
        selectHTML += "<option value='" + pilihan[i] + "'>" + pilihan[i] + "</option>";
    }
    selectHTML += "</select>";
    newDiv.innerHTML = selectHTML;
    document.getElementById(namaDiv).appendChild(newDiv);
}


text:
/*
# This file is part of the Astrometry.net suite.
# Licensed under a 3-clause BSD style license - see LICENSE
 */
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdarg.h>
#include <stdlib.h>

#include "cutest.h"
#include "hd.h"
#include "starutil.h"
#include "ioutils.h"
#include "constellation-boundaries.h"

void test_bdy_1(CuTest* tc) {
    // "Suhail" (Lambda Vela)
    int con = constellation_containing(136.9992, -43.4325);
    printf("Got: %i\n", con);
    CuAssertIntEquals(tc, CON_VEL, con);

    // Naos (xi Pup?)
    con = constellation_containing(120.8963, -40.0033);
    printf("Got: %i\n", con);
    CuAssertIntEquals(tc, CON_PUP, con);
}


text:
var Shapes = {
	Circle: function(param){
		console.log("new "+param.color+' circle');
	},
	Square: function(param){
		console.log("new "+param.color+' square');
	}
}

function ShapeFactory(color){
	this.color = color;
	var sadasd;
}
ShapeFactory.prototype = {
	makeCircle: function(){return new Shapes.Circle({color:this.color})},
	makeSquare: function(){return new Shapes.Square({color:this.color})}
}

var factory = new ShapeFactory('red');
factory.makeCircle();
factory.makeCircle();
factory.makeSquare();

//---------------------------------------


text:
package es.nipalante.geobicimad.serializer;

import java.io.IOException;

import org.codehaus.jackson.JsonGenerator;
import org.codehaus.jackson.JsonProcessingException;
import org.codehaus.jackson.map.JsonSerializer;
import org.codehaus.jackson.map.SerializerProvider;

import es.nipalante.geobicimad.Estacion;
import es.nipalante.geobicimad.OriginalJsonResponse;

public class EstacionSerializer extends JsonSerializer<OriginalJsonResponse> {

	@Override
	public void serialize(OriginalJsonResponse value, JsonGenerator jgen,
			SerializerProvider provider) throws IOException,
			JsonProcessingException {

		// GeoJSON Style!!!!

		jgen.writeStartObject();
		jgen.writeFieldName( "type" );
		jgen.writeString( "FeatureCollection" );
		// Adding the projection
		jgen.writeFieldName("properties");
		jgen.writeStartObject();
		jgen.writeFieldName("name");
		jgen.writeString( "urn:ogc:def:crs:OGC:1.3:CRS84" );
		jgen.writeEndObject();

		// Features;
		jgen.writeFieldName( "features" );

		jgen.writeStartArray();
		for (Estacion e : value.getlEstaciones())
		{
			jgen.writeStartObject();

			jgen.writeFieldName( "type" );
			jgen.writeString( "Feature" );

			jgen.writeFieldName( "geometry" );
			jgen.writeStartObject();
			jgen.writeFieldName( "type" );
			jgen.writeString( "Point" );
			jgen.writeFieldName( "coordinates" );
			jgen.writeStartArray();
			jgen.writeNumber( e.getLongitud() );
			jgen.writeNumber( e.getLatitud() );
			jgen.writeEndArray();
			jgen.writeEndObject();

			// Comienzo de las propiedades del formato GeoJSON
			jgen.writeFieldName( "properties" );
			jgen.writeStartObject();

			jgen.writeFieldName( "idstation" );
			jgen.writeString( e.getIdestacion() );
			jgen.writeFieldName( "name" );
			jgen.writeString( e.getNombre() );
			jgen.writeFieldName( "direction" );
			jgen.writeString( e.getDireccion() );
			jgen.writeFieldName( "bases" );
			jgen.writeNumber( e.getNumero_bases() );
			jgen.writeFieldName( "free" );
			jgen.writeNumber( e.getLibres() );

			jgen.writeEndObject();
			jgen.writeEndObject();
		}
		jgen.writeEndArray();

		jgen.writeEndObject();

	}

}


text:
SYNONYM

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

#### Published in
Icon. Desc. Fung. Min. Cognit. (Leipzig) 1: 21 (1798)

#### Original name
Sphaeria typhina Pers., 1798

### Remarks
null


text:
"""
 YDK PY converter
"""

import os
import shutil
from distutils import dir_util

from ydkgen.api_model import Bits, Class, Enum, Package, get_property_name
from ydkgen.common import get_rst_file_name

from .import_test_printer import ImportTestPrinter
from .module_printer import ModulePrinter
from .module_meta_printer import ModuleMetaPrinter
from .namespace_printer import NamespacePrinter
from .init_file_printer import InitPrinter
from ..doc import DocPrinter
from ..tests import TestPrinter
from ydkgen.printer.language_bindings_printer import LanguageBindingsPrinter, _EmitArgs

import logging

logger = logging.getLogger('ydkgen')

class PythonBindingsPrinter(LanguageBindingsPrinter):

    def __init__(self, ydk_root_dir, bundle, generate_tests, one_class_per_module):
        super().__init__(ydk_root_dir, bundle, generate_tests, one_class_per_module)
        self.bundle = bundle
        self.bundle_name = bundle.name
        self.bundle_version = bundle.str_version
        self.generate_meta = False

    def print_files(self):
        self._print_init_file(self.models_dir)
        self._print_yang_ns_file()
        self._print_modules()
        self._print_import_tests_file()

        # Sub package
        if self.sub_dir != '':
            self._print_nmsp_declare_init_files()

        # RST Documentation
        if self.ydk_doc_dir is not None:
            self._print_python_rst_ydk_models()

        # YANG models
        self._copy_yang_files()
        return ()

    def _print_modules(self):
        only_modules = [package.stmt for package in self.packages]
        size = len(only_modules)

        for index, package in enumerate(self.packages):
            self._print_module(index, package, size)

    def _print_module(self, index, package, size):
        print('Processing %d of %d %s' % (index + 1, size, package.stmt.pos.ref))

        # Skip generating module for empty modules
        if len(package.owned_elements) == 0:
            logger.debug("    Skipping module, because it does not contain top level containers")
            return

        sub = package.sub_name
        test_output_dir = self.initialize_output_directory(self.test_dir)

        if self.one_class_per_module:
            path = os.path.join(self.models_dir, package.name)
            self.initialize_output_directory(path, True)
            self._print_init_file(path)

            extra_args = {'one_class_per_module': self.one_class_per_module,
                          'identity_subclasses': self.identity_subclasses,
                          'generate_meta': self.generate_meta,
                          'module_namespace_lookup': self.module_namespace_lookup}
            self.print_file(get_python_module_file_name(path, package),
                            emit_module,
                            _EmitArgs(self.ypy_ctx, package, extra_args))

            self._print_python_modules(package, index, path, size, sub)
        else:
            # RST Documentation
            self._print_python_module(package, index, self.models_dir, size, sub)

        if self.generate_meta:
            meta_dir = self.initialize_output_directory(self.models_dir + '/_meta')
            self._print_meta_module(package, meta_dir)
        if self.generate_tests:
            self._print_tests(package, test_output_dir)

        if self.ydk_doc_dir is not None:
            self._print_python_rst_module(package)

    def _print_python_rst_module(self, package):
        if self.ydk_doc_dir is None:
            return

        def _walk_n_print(named_element, p):
            self.print_file(get_python_module_documentation_file_name(p, named_element),
                            emit_module_documentation,
                            _EmitArgs(self.ypy_ctx, named_element, self.identity_subclasses))

            for owned_element in named_element.owned_elements:
                if any((isinstance(owned_element, Bits),
                        isinstance(owned_element, Class),
                        isinstance(owned_element, Enum))):
                    _walk_n_print(owned_element, p)

        _walk_n_print(package, self.ydk_doc_dir)

    def _print_python_rst_ydk_models(self):
        if self.ydk_doc_dir is None:
            return
        packages = [p for p in self.packages if len(p.owned_elements) > 0]

        self.print_file(get_table_of_contents_file_name(self.ydk_doc_dir),
                        emit_table_of_contents,
                        _EmitArgs(self.ypy_ctx, packages, (self.bundle_name, self.bundle_version)))

    def _print_python_modules(self, element, index, path, size, sub):
        for c in [clazz for clazz in element.owned_elements if isinstance(clazz, Class)]:
            if not c.is_identity():
                self._print_python_module(c, index, os.path.join(path, get_property_name(c, c.iskeyword)), size, sub)

    def _print_python_module(self, package, index, path, size, sub):
        if self.one_class_per_module:
            self.initialize_output_directory(path, True)
            self._print_init_file(path)

        self._print_init_file(path)

        package.parent_pkg_name = sub
        extra_args = {'one_class_per_module': self.one_class_per_module,
                      'generate_meta': self.generate_meta,
                      'identity_subclasses': self.identity_subclasses,
                      'module_namespace_lookup' : self.module_namespace_lookup}
        python_module_file_name = get_python_module_file_name(path, package)
        logger.debug("    Printing python module %s" % python_module_file_name)
        self.print_file(python_module_file_name,
                        emit_module,
                        _EmitArgs(self.ypy_ctx, package, extra_args))

        if self.one_class_per_module:
            self._print_python_modules(package, index, path, size, sub)

    def _print_meta_module(self, package, path):
        self._print_init_file(path)
        extra_args = {'one_class_per_module': self.one_class_per_module,
                      'identity_subclasses': self.identity_subclasses}
        self.print_file(get_meta_module_file_name(path, package),
                        emit_meta,
                        _EmitArgs(self.ypy_ctx, package, extra_args))

    def _print_tests(self, package, path):
        self._print_init_file(self.test_dir)
        empty = self.is_empty_package(package)
        if not empty:
            self.print_file(get_test_module_file_name(path, package),
                            emit_test_module,
                            _EmitArgs(self.ypy_ctx, package, self.identity_subclasses))

    def _print_yang_ns_file(self):
        packages = self.packages

        self.print_file(get_yang_ns_file_name(self.models_dir),
                        emit_yang_ns,
                        _EmitArgs(self.ypy_ctx, packages, (self.bundle_name, self.one_class_per_module)))

    def _print_import_tests_file(self):
        self.print_file(get_import_test_file_name(self.test_dir),
                        emit_importests,
                        _EmitArgs(self.ypy_ctx, self.packages))

    def _print_init_file(self, path):
        file_name = get_init_file_name(path)
        if not os.path.isfile(file_name):
            self.print_file(file_name)

    def _print_nmsp_declare_init_files(self):
        self._print_nmsp_declare_init(self.ydk_dir)
        self._print_nmsp_declare_init(os.path.join(self.ydk_dir, 'models'))
        self._print_nmsp_declare_init(self.models_dir)

    def _print_nmsp_declare_init(self, path):
        file_name = get_init_file_name(path)
        self.print_file(file_name,
                        emit_nmsp_declare_init,
                        _EmitArgs(self.ypy_ctx, self.packages))

    def _copy_yang_files(self):
        yang_files_dir = os.path.sep.join([self.models_dir, '_yang'])
        os.mkdir(yang_files_dir)
        dir_util.copy_tree(self.bundle.resolved_models_dir, yang_files_dir)
        _copy_yang_files_from_subdirectories(yang_files_dir)

def _copy_yang_files_from_subdirectories(yang_files_dir):
    subdirs = [os.path.join(yang_files_dir, o) for o in os.listdir(yang_files_dir) if os.path.isdir(os.path.join(yang_files_dir, o))]
    for subdir in subdirs:
        files = os.listdir(subdir)
        for file in files:
            file_path = os.path.join(subdir, file)
            if os.path.isfile(file_path):
                shutil.copy(file_path, yang_files_dir)

def get_init_file_name(path):
    return path + '/__init__.py'

def get_yang_ns_file_name(path):
    return path + '/_yang_ns.py'

def get_import_test_file_name(path):
    return path + '/import_tests.py'

def get_python_module_documentation_file_name(path, named_element):
    return '%s/%s.rst' % (path, get_rst_file_name(named_element))

def get_table_of_contents_file_name(path):
    return '%s/ydk.models.rst' % path

def get_python_module_file_name(path, package):
    if isinstance(package, Package):
        return '%s/%s.py' % (path, package.name)
    else:
        return '%s/%s.py' % (path, get_property_name(package, package.iskeyword))

def get_meta_module_file_name(path, package):
    return '%s/_%s.py' % (path, package.name)

def get_test_module_file_name(path, package):
    return '%s/test_%s.py' % (path, package.stmt.arg.replace('-', '_'))

def emit_yang_ns(ctx, packages, extra_args):
    bundle_name = extra_args[0]
    one_class_per_module = extra_args[1]
    NamespacePrinter(ctx, one_class_per_module).print_output(packages, bundle_name)

def emit_importests(ctx, packages):
    ImportTestPrinter(ctx).print_import_tests(packages)

def emit_module_documentation(ctx, named_element, identity_subclasses):
    DocPrinter(ctx, 'py').print_module_documentation(named_element, identity_subclasses)

def emit_table_of_contents(ctx, packages, extra_args):
    bundle_name, bundle_version = extra_args
    DocPrinter(ctx, 'py', bundle_name, bundle_version).print_table_of_contents(packages)

def emit_module(ctx, package, extra_args):
    ModulePrinter(ctx, extra_args).print_output(package)

def emit_test_module(ctx, package, identity_subclasses):
    TestPrinter(ctx, 'py').print_tests(package, identity_subclasses)

def emit_meta(ctx, package, extra_args):
    ModuleMetaPrinter(ctx, extra_args['one_class_per_module'],
                      extra_args['identity_subclasses']).print_output(package)

def emit_nmsp_declare_init(ctx, package):
    InitPrinter(ctx).print_nmsp_declare_init(package)


text:
namespace boost
{
  namespace signals2
  {
    namespace detail
    {
      // Get the slot so that it can be copied
      template<typename F>
      typename F::weak_signal_type
      get_invocable_slot(const F &signal, signal_tag)
      { return typename F::weak_signal_type(signal); }

      template<typename F>
      const F&
      get_invocable_slot(const F& f, reference_tag)
      { return f; }

      template<typename F>
      const F&
      get_invocable_slot(const F& f, value_tag)
      { return f; }

      // Determines the type of the slot - is it a signal, a reference to a
      // slot or just a normal slot.
      template<typename F>
      typename get_slot_tag<F>::type
      tag_type(const F&)
      {
        typedef typename get_slot_tag<F>::type
          the_tag_type;
        the_tag_type tag = the_tag_type();
        return tag;
      }
    }
  }
} // end namespace boost

#define BOOST_PP_ITERATION_LIMITS (0, BOOST_PP_INC(BOOST_SIGNALS2_MAX_ARGS))
#define BOOST_PP_FILENAME_1 <boost/signals2/detail/slot_template.hpp>
#include BOOST_PP_ITERATE()

namespace boost
{
  namespace signals2
  {
    template<typename Signature,
      typename SlotFunction = boost::function<Signature> >
    class slot: public detail::slotN<function_traits<Signature>::arity,
      Signature, SlotFunction>::type
    {
    private:
      typedef typename detail::slotN<boost::function_traits<Signature>::arity,
        Signature, SlotFunction>::type base_type;
    public:
      template<typename F>
      slot(const F& f): base_type(f)
      {}
      // bind syntactic sugar
// const AN & aN
#define BOOST_SIGNALS2_SLOT_BINDING_ARG_DECL(z, n, data) \
  const BOOST_PP_CAT(A, n) & BOOST_PP_CAT(a, n)
// template<typename F, typename A0, typename A1, ..., typename An-1> slot(...
#define BOOST_SIGNALS2_SLOT_BINDING_CONSTRUCTOR(z, n, data) \
  template<typename F, BOOST_PP_ENUM_PARAMS(n, typename A)> \
  slot(const F &f, BOOST_PP_ENUM(n, BOOST_SIGNALS2_SLOT_BINDING_ARG_DECL, ~)): \
    base_type(f, BOOST_PP_ENUM_PARAMS(n, a)) \
  {}
#define BOOST_SIGNALS2_SLOT_MAX_BINDING_ARGS 10
      BOOST_PP_REPEAT_FROM_TO(1, BOOST_SIGNALS2_SLOT_MAX_BINDING_ARGS, BOOST_SIGNALS2_SLOT_BINDING_CONSTRUCTOR, ~)
#undef BOOST_SIGNALS2_SLOT_MAX_BINDING_ARGS
#undef BOOST_SIGNALS2_SLOT_BINDING_ARG_DECL
#undef BOOST_SIGNALS2_SLOT_BINDING_CONSTRUCTOR
    };
  } // namespace signals2
}

#endif // BOOST_SIGNALS2_SLOT_HPP


text:
package com.emitrom.ti4j.mobile.client.core.events.media.audio;

import com.emitrom.ti4j.mobile.client.core.events.TiEvent;
import com.google.gwt.core.client.JavaScriptObject;

public class ChangeEvent extends TiEvent {

    public static String CHANGE = "change";

    protected ChangeEvent() {

    }

    private ChangeEvent(JavaScriptObject obj) {
        jsObj = obj;
    }

    /**
     * current state of playback
     */
    public native int getState() /*-{
		var jso = this.@com.emitrom.ti4j.core.client.ProxyObject::getJsObj()()
		return jso.state;
    }-*/;

    /**
     * textual description of the state of playback
     */
    public native String getDescription() /*-{
		var jso = this.@com.emitrom.ti4j.core.client.ProxyObject::getJsObj()()
		return jso.description;
    }-*/;

}


text:
Single-Link Hierarchical Agglomerative Clustering in Python

in f1f2.txt file each line has two formants representing the sound of a vowel, the program will cluster these vowels using the euclidian distance between sounds of vowels.

output is generated in file output.txt

### How to run the program?

open cmd

enter test.py "f1f2.txt"


text:
var password, confirmPassword, match, submit, name;

$( document ).ready(function() {
    var interval = 100;
    submit = $("#submit-button");
    //check password every 100ms
    setInterval(passwordCheck, interval);
});

function passwordCheck() {
    password = $('#password').val();
    confirmPassword = $("#confirm-password").val();
    name = $('#full-name').val();
    blank = password == '' || confirmPassword == '' || name =='';
    if (blank || password != confirmPassword) {
        //disable the submit button
        submit.addClass('disabled');
        submit.prop('disabled', true)
        console.log(submit.attr('class'));
    }
    else {
        submit.removeClass('disabled');
        submit.prop('disabled', false)
        console.log(submit.attr('class'));
    }
}


text:
This Python app creates a frontend skeleton based on Flask, Flask-Assets and the govuk_frontend_toolkit (and GOV.UK template). This renders pages with the GOV.UK style. Webpages can be coded using styles from GOV.UK Elements.

govuk_frontend_toolkit is pulled in as a git submodule.
To get the contents of the submodule run the following git commands.

    git submodule init
    git submodule update

### Installation

In a virtual environment, install the Python requirements:

    pip install -r requirements.txt

You will need sass installed:

    bundle install

### Running the app

To run the app:

    python app.py

Initial URL -

    http://localhost:5000/helloworld

(template for this page lives in /templates/hello-world.html, which adds a content block to govuk_template.html)


text:
enum ProfAPIFaultFlags
{
    // Forces the startup path to log an IDS_E_PROF_INTERNAL_INIT error
    kProfAPIFault_StartupInternal   = 0x00001,
};
#endif // _DEBUG

//---------------------------------------------------------------------------------------
// Static-only class to coordinate initialization of the various profiling API
// structures, plus other utility stuff.
//
class ProfilingAPIUtility
{
private:
    enum ProfilerCompatibilityFlag
    {
        // Default: disable V2 profiler
        kDisableV2Profiler = 0x0,

        // Enable V2 profilers
        kEnableV2Profiler  = 0x1,

        // Disable Profiling
        kPreventLoad       = 0x2,
    };

public:
    static HRESULT InitializeProfiling();
    static HRESULT LoadProfilerForAttach(
        const CLSID * pClsid,
        LPCWSTR wszProfilerDLL,
        LPVOID pvClientData,
        UINT cbClientData,
        DWORD dwConcurrentGCWaitTimeoutInMs);

    static BOOL IsProfilerEvacuated();
    static void TerminateProfiling();
    static void LogProfError(int iStringResourceID, ...);
    static void LogProfInfo(int iStringResourceID, ...);
    static void LogNoInterfaceError(REFIID iidRequested, LPCWSTR wszClsid);
    INDEBUG(static BOOL ShouldInjectProfAPIFault(ProfAPIFaultFlags faultFlag);)

#ifdef FEATURE_PROFAPI_ATTACH_DETACH
    // ----------------------------------------------------------------------------
    // ProfilingAPIUtility::IncEvacuationCounter
    //
    // Description:
    //    Simple helper to increase the evacuation counter inside an EE thread by one
    //
    // Arguments:
    //    * pThread - pointer to an EE Thread
    //
    template<typename ThreadType>
    static FORCEINLINE void IncEvacuationCounter(ThreadType * pThread)
    {
        LIMITED_METHOD_CONTRACT;

        if (pThread)
            pThread->IncProfilerEvacuationCounter();
    }

    // ----------------------------------------------------------------------------
    // ProfilingAPIUtility::DecEvacuationCounter
    //
    // Description:
    //    Simple helper to decrease the evacuation counter inside an EE thread by one
    //
    // Arguments:
    //    * pThread - pointer to an EE Thread
    //
    template<typename ThreadType>
    static FORCEINLINE void DecEvacuationCounter(ThreadType * pThread)
    {
        LIMITED_METHOD_CONTRACT;

        if (pThread)
            pThread->DecProfilerEvacuationCounter();
    }

#endif // FEATURE_PROFAPI_ATTACH_DETACH

    // See code:ProfilingAPIUtility::InitializeProfiling#LoadUnloadCallbackSynchronization
    static CRITSEC_COOKIE GetStatusCrst();

private:
    // ---------------------------------------------------------------------------------------
    // Enum used in LoadProfiler() to differentiate whether we're loading the profiler
    // for startup or for attach
    enum LoadType
    {
        kStartupLoad,
        kAttachLoad,
    };

    // See code:ProfilingAPIUtility::InitializeProfiling#LoadUnloadCallbackSynchronization
    static CRITSEC_COOKIE s_csStatus;

    // Static-only class.  Private constructor enforces you don't try to make an instance
    ProfilingAPIUtility() {}

    static HRESULT PerformDeferredInit();
    static HRESULT DoPreInitialization(
        EEToProfInterfaceImpl *pEEProf,
        const CLSID *pClsid,
        LPCWSTR wszClsid,
        LPCWSTR wszProfilerDLL,
        LoadType loadType,
        DWORD dwConcurrentGCWaitTimeoutInMs);
    static HRESULT LoadProfiler(
        LoadType loadType,
        const CLSID * pClsid,
        LPCWSTR wszClsid,
        LPCWSTR wszProfilerDLL,
        LPVOID pvClientData,
        UINT cbClientData,
        DWORD dwConcurrentGCWaitTimeoutInMs = INFINITE);
    static HRESULT ProfilerCLSIDFromString(__inout_z LPWSTR wszClsid, CLSID * pClsid);
    static HRESULT AttemptLoadProfilerForStartup();

    static void AppendSupplementaryInformation(int iStringResource, SString * pString);

    static void LogProfEventVA(
        int iStringResourceID,
        WORD wEventType,
        va_list insertionArgs);
};

//---------------------------------------------------------------------------------------
// When we call into profiler code, we push one of these babies onto the stack to
// remember on the Thread how the profiler was called.  If the profiler calls back into us,
// we use the flags that this set to authorize.
//
class SetCallbackStateFlagsHolder
{
public:
    SetCallbackStateFlagsHolder(DWORD dwFlags);
    ~SetCallbackStateFlagsHolder();

private:
    Thread *   m_pThread;
    DWORD      m_dwOriginalFullState;
};

#endif //__PROFILING_HELPER_H__


text:
package com.amazonaws.services.mediaconvert.model;

import javax.annotation.Generated;

/**
 * Specify whether MediaConvert should use any dynamic range control metadata from your input file. Keep the default
 * value, Custom (SPECIFIED), to provide dynamic range control values in your job settings. Choose Follow source
 * (INITIALIZE_FROM_SOURCE) to use the metadata from your input. Related settings--Use these settings to specify your
 * dynamic range control values: Dynamic range compression line (DynamicRangeCompressionLine) and Dynamic range
 * compression RF (DynamicRangeCompressionRf). When you keep the value Custom (SPECIFIED) for Dynamic range control
 * (DynamicRangeControl) and you don't specify values for the related settings, MediaConvert uses default values for
 * those settings.
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public enum Eac3AtmosDynamicRangeControl {

    SPECIFIED("SPECIFIED"),
    INITIALIZE_FROM_SOURCE("INITIALIZE_FROM_SOURCE");

    private String value;

    private Eac3AtmosDynamicRangeControl(String value) {
        this.value = value;
    }

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

    /**
     * Use this in place of valueOf.
     *
     * @param value
     *        real value
     * @return Eac3AtmosDynamicRangeControl corresponding to the value
     *
     * @throws IllegalArgumentException
     *         If the specified value does not map to one of the known values in this enum.
     */
    public static Eac3AtmosDynamicRangeControl fromValue(String value) {
        if (value == null || "".equals(value)) {
            throw new IllegalArgumentException("Value cannot be null or empty!");
        }

        for (Eac3AtmosDynamicRangeControl enumEntry : Eac3AtmosDynamicRangeControl.values()) {
            if (enumEntry.toString().equals(value)) {
                return enumEntry;
            }
        }

        throw new IllegalArgumentException("Cannot create enum from " + value + " value!");
    }
}


text:
require_relative '../../test_helper'

class FieldTextTagTest < ActiveSupport::TestCase

  def test_initialize_tag
    assert tag = ComfortableMexicanSofa::Tag::FieldText.initialize_tag(
      cms_pages(:default), '{{ cms:field:content:text }}'
    )
    assert_equal 'content', tag.identifier
    assert_nil tag.namespace
    assert tag = ComfortableMexicanSofa::Tag::FieldText.initialize_tag(
      cms_pages(:default), '{{cms:field:content:text}}'
    )
    assert_equal 'content', tag.identifier
    assert tag = ComfortableMexicanSofa::Tag::FieldText.initialize_tag(
      cms_pages(:default), '{{cms:field:dash-content:text}}'
    )
    assert_equal 'dash-content', tag.identifier
    assert tag = ComfortableMexicanSofa::Tag::FieldText.initialize_tag(
      cms_pages(:default), '{{cms:field:namespace.content:text}}'
    )
    assert_equal 'namespace.content', tag.identifier
    assert_equal 'namespace', tag.namespace
  end

  def test_initialize_tag_failure
    [
      '{{cms:field:content:not_text}}',
      '{{cms:not_field:content:text}}',
      '{not_a_tag}'
    ].each do |tag_signature|
      assert_nil ComfortableMexicanSofa::Tag::FieldText.initialize_tag(
        cms_pages(:default), tag_signature
      )
    end
  end

  def test_content_and_render
    tag = ComfortableMexicanSofa::Tag::FieldText.initialize_tag(
      cms_pages(:default), '{{cms:field:content:text}}'
    )
    assert tag.block.content.blank?
    tag.block.content = 'test_content'
    assert_equal 'test_content', tag.content
    assert_equal '', tag.render
  end

end


text:
SET FOREIGN_KEY_CHECKS=0;

-- ----------------------------
-- Table structure for sys_script
-- ----------------------------
DROP TABLE IF EXISTS `sys_script`;
CREATE TABLE `sys_script` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `type` varchar(255) NOT NULL COMMENT '1=SQL,2=存储过程',
  `module` varchar(255) DEFAULT NULL COMMENT '模块',
  `name` varchar(255) NOT NULL,
  `script` varchar(2000) NOT NULL COMMENT '执行脚本',
  `description` varchar(255) DEFAULT NULL,
  `flag` varchar(1) DEFAULT NULL COMMENT '是否有效,0无效,1或其他有效',
  PRIMARY KEY (`id`),
  UNIQUE KEY `I_SYS_SCRIPT_NAME` (`name`) USING HASH
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of sys_script
-- ----------------------------
INSERT INTO `sys_script` VALUES ('1', '1', 'sys', 'script_list', 'select * from sys_script where name <> \'script_list\'', '系统管理接口列表', '1');

-- ----------------------------
-- Table structure for sys_scriptparam
-- ----------------------------
DROP TABLE IF EXISTS `sys_scriptparam`;
CREATE TABLE `sys_scriptparam` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `scriptId` int(11) DEFAULT NULL COMMENT '参数对应脚本的id',
  `name` varchar(255) DEFAULT NULL COMMENT '参数名称',
  `content` varchar(255) DEFAULT NULL COMMENT '参数内容,sql条件语句或者过程参数',
  PRIMARY KEY (`id`),
  KEY `I_SCRIPT_ID` (`scriptId`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;